Skip to content

Commit 654736a

Browse files
committed
docs: add light AI notes to manual
Add a small set of measured references to coding-agent and AI-assisted workflows in the manual pages where they fit naturally. Keep the changes limited to overview, setup, migration, tooling, performance, and LLM documentation so the docs stay close to their existing tone.
1 parent de98bb0 commit 654736a

6 files changed

Lines changed: 15 additions & 0 deletions

File tree

markdown-pages/docs/manual/build-performance.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ ReScript doesn't take whole seconds to run every time. The bulk of the build per
7070

7171
In short, thanks to our compiler and the build system's architecture, we're able to **only build what's needed**. If `MyFile.res` isn't changed, it isn't recompiled. Renaming or moving files is handled automatically, with no stale builds.
7272

73+
That kind of tight, correct incremental feedback is especially useful in coding-agent workflows, where small edits need to be validated quickly.
74+
7375
## Speed Up Incremental Build
7476

7577
ReScript uses the concept of interface files (`.resi`) (or, equivalently, [module signatures](./module.mdx#signatures)). Exposing only what you need naturally speeds up incremental builds. E.g. if you change a `.res` file whose corresponding `.resi` file doesn't expose the changed part, then you've reduced the amount of dependent files you have to rebuild.

markdown-pages/docs/manual/converting-from-js.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ Open an editor tab for `src/Main.res.js`. Do a command-line `diff -u src/main.js
8787

8888
**Always make sure** that at each step, you keep the ReScript output `.res.js` file open to compare against the existing JavaScript file. Our compilation output is very close to your hand-written JavaScript; you can simply eye the difference to catch conversion bugs!
8989

90+
This step-by-step workflow also pairs well with AI-assisted migrations: a tool can make a small change, and you can review the generated JS against the original file at each step.
91+
9092
## Step 3: Extract Parts into Idiomatic ReScript
9193

9294
Let's turn the `defaultId` variable into a ReScript let-binding:

markdown-pages/docs/manual/editor-code-analysis.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Dead code refers to code that's present in your codebase but is never executed.
1919

2020
ReScript’s language design allows for accurate and efficient dead code analysis using the **ReScript Code Analyzer**, available via the official VSCode extension.
2121

22+
This is useful not only for manual refactors, but also for AI-assisted edits where fast project-wide feedback helps catch incorrect assumptions early.
23+
2224
### Prerequisites
2325

2426
- ReScript VSCode extension (v1.8.2 or higher)

markdown-pages/docs/manual/installation.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ That compiles your ReScript into JavaScript, then uses Node.js to run said JavaS
6868

6969
**When taking your first steps with ReScript, we recommend you use our unique workflow of keeping a tab open for the generated JS file** (`.res.js`/`.res.mjs`), so that you can learn how ReScript transforms into JavaScript. Not many languages output clean JavaScript code you can inspect and learn from! With our [VS Code extension](https://marketplace.visualstudio.com/items?itemName=chenglou92.rescript-vscode), use the command "ReScript: Open the compiled JS file for this implementation file" to open the generated JS file for the currently active ReScript source file.
7070

71+
That workflow is also handy when experimenting with coding agents, since both the source and generated JS stay easy to inspect.
72+
7173
During development, instead of running `npm run res:build` each time to compile, use `npm run res:dev` to start a watcher that recompiles automatically after file changes.
7274

7375
## Integrate Into an Existing JS Project
@@ -172,6 +174,8 @@ bun create rescript-app
172174

173175
Since ReScript compiles to clean readable JS files, the rest of your existing toolchain (e.g. Vite, Rspack, Rollup) should just work!
174176

177+
That low setup overhead also makes it practical to try ReScript in fast-moving teams, including ones exploring AI-assisted workflows.
178+
175179
Helpful guides:
176180

177181
- [Converting from JS](./converting-from-js.mdx).

markdown-pages/docs/manual/introduction.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ A `Hello world` ReScript program generates **20 bytes** of JS code. Additionally
4242

4343
ReScript's build time is **one or two orders of magnitude** faster than alternatives. In its watcher mode, the build system usually finishes before you switch screen from the editor to the terminal tab (two digits of milliseconds). A fast iteration cycle reduces the need of keeping one's mental state around longer; this in turn allows one to stay in the flow longer and more often.
4444

45+
That same fast loop is also useful in AI-assisted workflows, where small edits need to be checked and repaired quickly.
46+
4547
### Readable Output
4648

4749
ReScript's JS output is very readable. This is especially important while learning, where users might want to understand how the code's compiled, and to audit for bugs.
4850

51+
It also helps when teams use coding agents but still want the generated result to stay easy to inspect and review.
52+
4953
This characteristic, combined with a fully-featured JS interop system, allows ReScript code to be inserted into an existing JavaScript codebase almost unnoticed.
5054

5155
### Preservation of Code Structure

markdown-pages/docs/manual/llms.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Currently, we have the following files...
1919
...and package-level documentation:
2020

2121
- [/docs/react/llms](../react/llms.mdx) — the LLms documentation for ReScript React.
22+
- For a human-oriented overview of how these properties help in coding-agent workflows, see [ReScript and Coding Agents](./agentic-workflows.mdx).
2223

2324
## Notes
2425

0 commit comments

Comments
 (0)