Statically typed languages on BEAM

I believe why we want static typing is more because of compile time guarantee that our code will work as expected, better performance is a bonus.

1 Like

I guess I will have to add read-macros to make you happy. Would it be enough to have them prefixed with # and followed by an sexpr? Otherwise it would entail rewriting the io and it would not be that easy to use for those who want to write their own read-macros. The io system is not really oriented towards reading characters from input. It can be done but the result could be ā€œinterestingā€ if you have concurrent input.

Another interesting question is whether we have one set of read-macros for a whole node, which feels unnaturally single threaded, or have one set per process?

2 Likes

Why did you write the word optionally in parenthesis?

Again, for backward compatibility. We can’t enforce to break current syntax unless you want to make many people mad and rant about elixir :slight_smile:

I don’t think it’s even wise to have major breaking syntax change in Elixir 2.0, I know it’s a major version bump, but still…

1 Like

Remember how it went with Python 2 and 3. :grinning:

3 Likes

Could you explain better? Read macros are a compile time construction. Why would you want the same source code to be compiled to different things in different nodes?

1 Like

I’m not asking what you meant. I’m asking why was the word optional wrapped in parenthesis? What’s the difference between:

I hope one day elixir can (optionally) be one

and

I hope one day elixir can optionally be one

?

:slight_smile: i’m unsure whether it will be optional or not in the future

Well, he let it open that Elixir becomes a fully statically typed language at all, without any opt-out.
This is of course unrealistic, what let him probably choose the parentheses.
I agree that they are semantically superfluous, considering this.

Lol, only if wanted. As long as it let’s one do something like a prefix (like say #{) then any arbitrary characters up until it considers itself done, then it should handle most cases just fine sans ā€˜executing’ custom formats. :slight_smile:

/me still needs to get around to making an Elixir compat layer for lfe…

Well in my version I had to explictly import a module that defined a given read macro and even then the read macro’s were only valid in the scope it was defined in. I know it’s not quite ā€˜pure’ but I like the scopeness of it (and I could always import another code file inlline for the read-macros to run over).

Because lisp’y languages can read in more code and run it later, or maybe even run a new data structure that it generates at runtime via requests or so ā€˜as’ code. :slight_smile:

Though you can limit that in your own lisp’y language for the sake of speed.

An elixir backend for Idris looks interesting.

4 Likes

Indeed, this is super interesting. It might be what I need to finally get to reading Type Driven Development with Idris. I already started the cycle of ā€œTry to learn, back off because it’s not clickingā€¦ā€ with Idris a little over a year ago and I reckon I’ll feel the same way about it in a couple of years as I do about Haskell now.

2 Likes

Very interesting. I’ll definitely give it a shot.

1 Like

Idris 2 currently works by emitting Scheme code. Would be interesting if someone tried adding an LFE backend…

LFE may be lisp’y syntax, but it’s primitives are too different to work well as a backend like that, it would have to be something new I’d wager. Porting typed racket would probably be easiest to be a typed lfe.