Cure - a new language compiled to BEAM

I don’t interact with those per se, I use jj git export and I believe some commits on that stage should better go into git branches, or like, because I do not bother to keep the jujutsu repo clean in general.

FWIW, effective now, the active forum is Cure Forum - Erlang Forums

I am not going to cross-post anything here, sorry for the inconvenience. @michallepicki GHA took their place :slight_smile:

1 Like

Cure v0.14.0 is a full rewrite from scratch.

It still must have some glitches and it’s far from being considered v1.0.0 but it’s definitely a huge step forward. It comes with standard lib and a bunch of examples.

Check the new https://cure-lang.org site, shaped as an introduction tour with language features, type system description and whatnot.

The BEAM files are still generated via erlang forms (with :compile.forms/2.)

There is also an elixir project example using Cure code in examples/cure_example. Erlang example project will be there soon.

4 Likes

FYI the contrast is poor on the light system version of the site and some characters aren’t showing up.

Light System

Dark

EDIT: Actually light is fine. It’s System.

1 Like

Thanks for heads up! I’ll amend it.

In the meanwhile, I have added a real-life example to Cure: spline interpolation written completely in Cure and called from Elixir. cure-lang/examples/cure_spline at main · am-kantox/cure-lang · GitHub

The code is still clumsy. mostly due to the missing full destructure in matches (it should be released during this weekend,) but it’s a complete Thomas algorithm implementation in 325 LoCs with comments.

Eager to get any feedback.

In the meanwhile, Cure sees a light at the end of the tunnel. In the last week it got several features I’m really proud of, and I have implemented cubic spline interpolation fully in Cure.

More examples of real-life application are coming next week. This post is just summing up the last enhancements and new features.

5 Likes

Cure gets REPL!

It’s not yet 102% polished, but one already can play with the language without a create-new-project hassle.

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
  ...
6 Likes

Try Cure directly on the site in the real time (type checker is alive.)

Cure Playground -- Dependently-Typed BEAM Language

2 Likes