Cure gets REPL, docs, formatter and more

It’s probably a good time to try it and report issues.

❯ ./cure help
Cure 0.23.0 -- Dependently-typed language for the BEAM

Usage: cure <command> [options] [arguments]

Commands:
  compile <file|dir>   Compile .cure files to BEAM bytecode
  run <file>           Compile and execute a .cure file
  check <file>         Type-check without compiling
  lsp                  Start the Language Server Protocol server
  stdlib               Compile the standard library
  doc [path|dir]       Generate HTML documentation
  fmt [path|dir]       Format .cure source files (algebra by default; --safe, --aggressive, --check)
  repl                 Interactive Cure session (multi-line, :help for commands)
  watch [path]         Recompile/check/test on every save
  new <name>           Scaffold a new project (--lib | --app | --fsm)
  init <name>          Same as `new --lib`
  deps                 Resolve project dependencies
  test [--cover]       Run .cure tests under test/, optionally with coverage
  bench [path]         Run .cure benchmarks under bench/
  explain <Eddd>       Explain an error code
  why <Eddd>           Alias for `explain`
  doctor               Environment + project + source health report
  fix [--dry-run]      Apply safe project-wide code fixes
  ...
2 Likes

I think this is a very interesting language you’ve got there. I haven’t tried it out yet. But I am curious about your AI pipeline. You are developing this very quickly and I suppose type system and such is helping out a ton if the AI are working iteratively. I see that you use Warp and Oz, but I suppose there is more to it. Prompting techniques, guard rails and such. Are you willing to share some of that in a blog post?

3 Likes

Thanks.

There is no “AI” magic or secret knowledge I am The Keeper of, though. I’ll rant on it in the blog post soon, thanks for the tip. Below is the TL;DR excerpt for those impatient ones.

▸ the first attempt of implementing this language failed miserably, because I buried myself 6 feet under a pile of ad-hoc solutions; the version currently in the wild is the full rewrite. I know all¹ the pitfalls, all the rakes to avoid stepping at, all the drawbacks of wrongly chosen assumptions
▸ I know for sure what I need to be done next, therefore all my prompts are straightforward, full with clarifications, and have zero unanswered conditionals in between; the assistant does not need to invent anything
▸ After I’ve got all the bumps with my previous attempt, I made a huge step back and re-thought the approach; I came up with Metastatic v0.20.1 — Documentation which is essentially a MetaAST for languages in different paradigms, and I use this MetaAST as native AST for Cure; that helps damn a lot
▸ I borrowed the ecosystem from Elixir (which is the greatgest one, btw,) and I even don’t need to explain many tasks in details, I just tell the beast, “Hey, now I need the same stuff as mix new
▸ From the day one I have a comprehensive regression test suite, including but not limited to stdlib, examples, and whatnot.

That’s basically it. I’ll do my best to convert the above to the long read :slight_smile:

———

¹ Not all, of course, but at least I know how to discover them sooner rather than later.

3 Likes
1 Like