📈 GH Trending Explorer 🎲 Surprise me

← all repos

Gabriella439 / grace

git clone https://github.com/Gabriella439/grace.git

A prompt engineering functional programming language

+1
stars, 24h · #13,788
+~5
stars, 7 days · #17,323
+~20
stars, 30 days · #22,040
624
★ total · +1% this week
48
forks · 9 open issues

Star history (as recorded here)

2026-10-20 · 622 ★ 2026-10-23 · 624 ★
LanguageHaskell
LicenseBSD-3-Clause
Created2020-10-22 (6y ago)
Last push1mo ago
Watchers12
OwnerUser

Seen on GitHub Trending

  • 2026-10-22 — #3 daily in haskell · +1 ★
  • 2026-10-21 — #2 daily in haskell
  • 2026-10-20 — #2 daily in haskell

GitHub topics

Links

README excerpt
# Grace
Grace (short for Fall-from-Grace) is a domain-specific programming
language for prompting models. In particular, Grace is well-suited for building
and auto-generating elaborate prompt chains
You can use Grace in your browser without installing anything by visiting
trygrace.dev. That website includes an interactive
tutorial and is the recommended way to both learn and get started with using
Grace.
## Features
- Integrated language support for models
 You don't need to install any dependencies or import anything to get started.
 Everything you need is built directly into the language.
 The language provides a built-in `prompt` function for prompting a model:
 [code] 
 … and you can structure the output by giving a type annotation:
 [code] 
 If the type is sufficiently self-explanatory, you can even omit the prompt:
 [code] 
 In fact, you can omit the type, too, if the type can be inferred from use:
 [code] 
- JSON schemas inferred from use
 That last example works even without a prompt, schema, or type because Grace's
 type checker reasons backwards from how the output is used to infer the
 correct JSON schem, like this:
 - the type checker infers that the `name` variable must be `Text`
 … because the `name` variable is interpolated into `"Hello, ${name}!"`
 - the type checker infers that the `prompt` function must generate a `List`
 … because the program loops over the output using a `for … of` loop.
 - the type checker infers each element of the `List` has type `{ name: Text }`
 … because the `for … of` loop destructures each element using `{ name }`
 - therefore the `prompt` function outputs a value of type `List{ name: Text }`
 … which you can read as "a `List` of records, each of which has a `name` field
 containing `Text`".
 The interpreter then converts that Grace type into the following matching JSON
 schema to constrain the model's output:
 [code] 
 Finally, the model infers from that JSON schema alone (without any additional
 prompt) that it should generate a JSON-encoded list of names.
- Code generation
 You can prefix the `prompt` keyword with `import` to ask the model to generate
 a Grace expression of any type. For example:
 [code] 
 You can use an explicit type annotation to guide the generated code:
 [code] 
 … and if the type is informative enough then you can omit the prompt:
 [code] 
 Notice in that last example how the model can generate code which itself
 `prompt`s an model. Neat!
 Inferred types also guide the code generation process, too!
 [code] 
 There the model infers that the type of the `upper` function needs to be
 `Text -> Text` (a function whose input is `Text` and whose output is `Text`)
 and generates an function matching that type which uppercases `Text`.
### Command line
This Haskell package builds a `grace` executable with the following command-line
API:
 [code] 
You can use the `interpret` subcommand for interpreting a single file:
 [code] 
 [code] 
 [code] 
… and you can specify `-` to process standard