mudasobwa

mudasobwa

Creator of Cure

I am happy to introduce the very α version of the new programming language compiled to BEAM.

Welcome Cure.

It has literally three killer-features:

  • Dependent types (think Idris) with SMT-solvers
  • FSMs with SMT-validation as a language primitive
  • No if-then-else construct.

I created Cure more as an ad-hoc DSL, rather than as a general purpose language. Currently it is in the proof of concept stage, although everyone might grab it, compile it, write and execute some code with it.

I am very open to suggestions, improvements, hints, and “this is all crap” comments.

Showing Posts 1 to 10

plcholder

plcholder

Interesting , could you elaborate on what problem arose with regular beam languages for you to create the lang/dsl? I imagine it didnt just chuck down to elixir and erlang not being statically typed, also I thought dependent types were more on the theoretical side and arent really used for applications in the industry, ive played around with idris because of the thinking in types book and did enjoy using the type as a value and vice versa

edit:

Just to clarify on what I mean by “problem”, I understand beam languages arent typed but Ive been under the assumption that beam fault tolerance/”let it crash” primitives cleans up on this area in terms of safety and correctness

mudasobwa

mudasobwa OP

Creator of Cure

They don’t. Sending the mistyped message (:ook instead of :ok) to the arbitrary process won’t bring any harm whatsoever, but the application would be obviously misfunctional; assigning a negative value to the latitude won’t bring any harm, etc.

In Cure, if FSM has been compiled, it’s proven to be correct. The compiler won’t let you send a message to it which won’t be understood and handled.

I was simply tired to implement critical parts in Idris and then transate the code to Elixir once proved to be correct.

Just as an example: in Cure, List.reverse/1 is proven to be correct implementation. No tests are ever needed. That is also true for some user-defined functions.

escargot33

escargot33

This is super cool and incredibly useful. It could be interesting to position this as something similar to LiquidHaskell but for BEAM.

I would love to use these features within elixir though…

AstonJ

AstonJ

Congratulations @mudasobwa :tada:

I’ve moved the thread here from libraries as it does not appear to be used within Elixir (if it is let me know and we can move it back).

Must admit I do not know much about FSMs and SMT verification myself (and I can’t be the only one) so it may be worth explaining in a bit more detail why those things are important enough to become a fundamental compelling part of your/a new language :icon_biggrin:

mudasobwa

mudasobwa OP

Creator of Cure

Tehchnically, you can, because Cure compiles to BEAM. You can use these features with Elixir as you can use erlang with Elixir (:math.pi().) If you are talking about using it with Elixir syntax, or directly from Elixir as a library, or like, it’s impossible, because Cure compiles to BEAM using its own compiler, I cannot use Elixir compiler because of SMT solver and FSMs validation.

I have plans of introducing a bridge (through Elixir compiler,) so that one might have Cure code in cure/ directory like you have erlang in src/.

mudasobwa

mudasobwa OP

Creator of Cure

Thanks!

Yeah, I eventually will.

juhalehtonen

juhalehtonen

This seems very interesting! Ever since I first tried out Idris I’ve loved the idea of dependent types – and now you’re telling me I might use them on BEAM? Congrats on reaching this milestone :clap:

mudasobwa

mudasobwa OP

Creator of Cure

Standard library (which is tiny yet, I implemented only what I needed myself atm) already does:

  # Basic operations
  def length(v: Vector(T, n)): Nat = n
  def is_empty(v: Vector(T, n)): Bool = n == 0
ValorZard

ValorZard

I’ve been trying to look at the website on my phone, and I can’t see any links to downloads or a git repository? Does a public git repository exist or is it not out yet?

Edit: ah, never mind you mention it in the original post itself, but not on the website I guess

mudasobwa

mudasobwa OP

Creator of Cure

Yeah, my bad. Will fix it. The website has a link to ex_doc generated from erlang sources though: https://cure-lang.org/api/readme.html which in turn has links to the repository.

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 94592 917
New
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
caslu
I want to open this thread for you all to discuss and help those who really like Ash but are still hesitant to use it in a real project. ...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
heathen
Quite interesting article Google brought me. Didn’t find any mentions about it here. What do you think in general? Would you use togethe...
New
marciol
It would be helpful to have a list of companies worldwide that hire engineers without prior experience in Elixir. Often, it can be quite ...
New
durvia
Anyone running long-lived stateful processes on BEAM? We’re building an AI agent runtime and would love to compare notes. We’re a small ...
New

Other Trending Topics Top

marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews