Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 68 additions & 7 deletions app/routes/LandingPage.res
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ export {
<section className="relative mt-20 bg-gray-10">
<div className="relative flex justify-center w-full">
<div className="relative w-full pt-6 pb-8 sm:px-8 md:px-16 max-w-[1400px]">
<div className="relative z-2 mx-auto mb-10 max-w-3xl text-center">
<h2 className="hl-2 text-gray-80"> {React.string("Readable in. Predictable out.")} </h2>
<p className="body-lg text-gray-60 mt-4">
{React.string(`Readable source, predictable output, and fast compiler feedback make ReScript easier to work with. Those qualities help while learning, debugging, reviewing changes, or bringing coding agents into the workflow.`)}
</p>
</div>
// Playground widget
<div
className="relative z-2 flex flex-col md:flex-row bg-gray-90 mx-auto sm:rounded-lg max-w-1280"
Expand Down Expand Up @@ -387,13 +393,6 @@ module MainUSP = {
caches, wrong type hints, or memory hungry language servers that slow you
down.`)}
</p>
<p className="mt-6">
// <ReactRouter.Link to={("/docs/manual/build-performance" :> ReactRouter.Link.to)}>
// <Button size={Button.Small} kind={Button.PrimaryBlue}>
// {React.string("Learn more")}
// </Button>
// </ReactRouter.Link>
</p>
</>}
/>

Expand Down Expand Up @@ -446,6 +445,67 @@ module MainUSP = {
}
}

module AgenticWorkflows = {
type point = {
title: string,
body: string,
}

let points = [
{
title: "Clear code is easier to guide",
body: "ReScript's small, consistent syntax makes prompts easier to ground and generated edits easier to review.",
},
{
title: "Compiler feedback helps close the loop",
body: "When a change breaks a contract, the compiler points to it directly. That gives both humans and tools a faster path to a correct fix.",
},
{
title: "The output stays readable",
body: "ReScript compiles to straightforward JavaScript, so teams can inspect behavior, debug issues, and hand work back and forth without losing the thread.",
},
]

@react.component
let make = () => {
<section className="flex justify-center w-full bg-fire-5 px-5 sm:px-8 lg:px-16 py-24 lg:py-32">
<div className="max-w-1060 w-full">
<div className="max-w-3xl">
<h2 className="hl-1 text-gray-80"> {React.string("Working with coding agents")} </h2>
<p className="body-lg text-gray-60 mt-4">
{React.string(`The same qualities that make ReScript pleasant for people also make it a good fit for coding agents: clear source, fast feedback, and JavaScript output that stays easy to inspect.`)}
</p>
</div>
<div className="grid gap-6 mt-12 lg:mt-16 md:grid-cols-3">
{points
->Array.mapWithIndex((point, i) =>
<div
key={Int.toString(i)}
className="rounded-xl border border-fire-10 bg-white px-6 py-6 shadow-[0px_12px_40px_0px_rgba(230,72,79,0.08)]"
>
<h3 className="hl-4 text-gray-80 mb-3"> {React.string(point.title)} </h3>
<p className="body-md text-gray-60"> {React.string(point.body)} </p>
</div>
)
->React.array}
</div>
<div
className="mt-12 lg:mt-16 rounded-2xl border border-fire-10 bg-white px-6 py-6 lg:px-8 lg:py-7 flex flex-col gap-6 lg:flex-row lg:items-center lg:justify-between"
>
<p className="body-lg text-gray-60 max-w-2xl">
{React.string(`Read a short guide about using ReScript alongside coding agents.`)}
</p>
<ReactRouter.Link.String
to="/docs/manual/agentic-workflows" className="self-start shrink-0"
>
<Button kind={Button.PrimaryBlue}> {React.string("Read the guide")} </Button>
</ReactRouter.Link.String>
</div>
</div>
</section>
}
}

module OtherSellingPoints = {
@react.component
let make = () => {
Expand Down Expand Up @@ -723,6 +783,7 @@ let make = (~components=MarkdownComponents.default) => {
<PlaygroundHero />
<QuickInstall />
<MainUSP />
<AgenticWorkflows />
<OtherSellingPoints />
<TrustedBy />
<CuratedResources />
Expand Down
33 changes: 33 additions & 0 deletions markdown-pages/docs/manual/agentic-workflows.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: "ReScript and Coding Agents"
description: "How ReScript supports teams working with coding agents"
canonical: "/docs/manual/agentic-workflows"
section: "Guides"
order: 4
---

# ReScript and Coding Agents

ReScript is a strong fit for teams working with coding agents because it reduces ambiguity in the source language, surfaces errors early through the compiler, and keeps generated output understandable. This guide explains why those properties matter in real development workflows.

## Readable code is easier to steer

Agents do better when the language they are editing is small, regular, and easy to inspect. ReScript keeps the syntax compact and consistent, which makes prompts easier to ground in the actual code and makes generated changes easier for humans to review.

## Compiler feedback tightens the repair loop

When an agent makes an incorrect assumption, fast compiler feedback matters. ReScript turns many mistakes into concrete, local errors instead of vague runtime failures, which gives both the agent and the human reviewer a clearer path to the next fix.

## Reviewable JavaScript keeps handoff practical

ReScript compiles to straightforward JavaScript, so teams can still inspect output, debug behavior, and understand how a change behaves in the wider JavaScript ecosystem. That keeps the handoff between agent-written code and human review practical.

## You can keep your existing stack

Using ReScript does not mean walking away from the JavaScript ecosystem your product already depends on. You can keep using the SDKs, APIs, frameworks, and deployment tooling your team already knows while adding stronger guarantees where correctness and maintainability matter most.

## Where to start

- For setup, see [Installation](./installation.mdx).
- For adding ReScript to an existing codebase, see [Converting from JS](./converting-from-js.mdx).
- For editor and compiler feedback loops, see [Code Analysis](./editor-code-analysis.mdx).
2 changes: 2 additions & 0 deletions markdown-pages/docs/manual/build-performance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ ReScript doesn't take whole seconds to run every time. The bulk of the build per

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.

That kind of tight, correct incremental feedback is especially useful in coding-agent workflows, where small edits need to be validated quickly.

## Speed Up Incremental Build

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.
Expand Down
2 changes: 2 additions & 0 deletions markdown-pages/docs/manual/converting-from-js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ Open an editor tab for `src/Main.res.js`. Do a command-line `diff -u src/main.js

**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!

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.

## Step 3: Extract Parts into Idiomatic ReScript

Let's turn the `defaultId` variable into a ReScript let-binding:
Expand Down
2 changes: 2 additions & 0 deletions markdown-pages/docs/manual/editor-code-analysis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Dead code refers to code that's present in your codebase but is never executed.

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

This is useful not only for manual refactors, but also for AI-assisted edits where fast project-wide feedback helps catch incorrect assumptions early.

### Prerequisites

- ReScript VSCode extension (v1.8.2 or higher)
Expand Down
4 changes: 4 additions & 0 deletions markdown-pages/docs/manual/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ That compiles your ReScript into JavaScript, then uses Node.js to run said JavaS

**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.

That workflow is also handy when experimenting with coding agents, since both the source and generated JS stay easy to inspect.

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.

## Integrate Into an Existing JS Project
Expand Down Expand Up @@ -172,6 +174,8 @@ bun create rescript-app

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

That low setup overhead also makes it practical to try ReScript in fast-moving teams, including ones exploring AI-assisted workflows.

Helpful guides:

- [Converting from JS](./converting-from-js.mdx).
Expand Down
4 changes: 4 additions & 0 deletions markdown-pages/docs/manual/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ A `Hello world` ReScript program generates **20 bytes** of JS code. Additionally

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.

That same fast loop is also useful in AI-assisted workflows, where small edits need to be checked and repaired quickly.

### Readable Output

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.

It also helps when teams use coding agents but still want the generated result to stay easy to inspect and review.

This characteristic, combined with a fully-featured JS interop system, allows ReScript code to be inserted into an existing JavaScript codebase almost unnoticed.

### Preservation of Code Structure
Expand Down
1 change: 1 addition & 0 deletions markdown-pages/docs/manual/llms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Currently, we have the following files...
...and package-level documentation:

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

## Notes

Expand Down
Loading