lunacookies / eldiro

Learn to make your own programming language with Rust

Home Page:https://lunacookies.github.io/lang/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hi may I know how does this language differ from Rust?

Joe23232 opened this issue · comments

Hi I wanted to know what is this new language about, and how does it differ to Rust.

Additionally I would like to know what is Markers?

Hello!

Eldiro at the moment isn’t really a language, as the only thing you can do is simple arithmetic (e.g. (1 + 2) * -4). Before the rewrite it used something like the following syntax:

let a = 10

fn add x y => x + y

# this returns 30
add a 20

The implementation was ugly, buggy and didn’t lend itself to good performance, error messages or future IDE tooling. Due to these reasons I decided to rewrite the whole thing using Rowan. Since then, the language tutorials have focused on infrastructure and architecture instead of language implementation; as such, Eldiro doesn’t exist as a language like it used to.

My plan is for Eldiro to be a ‘fast enough’ (read: slow but used in areas where that doesn’t matter) interpreted language that’s practical for everyday projects (like Ruby). It will hopefully be statically typed, with a particular focus on great IDE tooling from the very beginning. Although I will likely crib a few features from Rust, the languages will be different in almost every way:

  • Rust focuses on performance, while Eldiro does not
  • Rust is compiled, while Eldiro is interpreted
  • Rust has ownership and borrowing, while Eldiro does not (maybe in the future? not sure yet)

Markers are an API on top of Rowan that could be described as ‘fancy checkpoints’. They give you nicer errors when you mess up, and also give you more flexibility. If you want more info I’d recommend reading the relevant language tutorial or rust-analyzer’s implementation.