Elixir v0.4 in the works

69 views
Skip to first unread message

José Valim

unread,
Dec 23, 2011, 2:41:08 AM12/23/11
to elixir-lang-core
Ladies and Gentlemen,

I have pushed to master a new Elixir version. You will find out it is
a rework from scratch (well, I was able to use 20% of the previous
code) and this e-mail is to explain the reasons I have decided to
rewrite it.

After attempting to build a whole production application with Elixir,
I decided the direction the previous version was moving was not good.
The fact a compiled module in Elixir could not be called directly from
Erlang (and vice-versa) was one of the thing that was annoying me the
most because I had to eventually wrap all Erlang behaviors
(gen_server, gen_event, etc) and data types (List, Orddict, Regexp,
etc) in Elixir. This means Elixir would always play catch up with
Erlang. Also, the whole Objected-Oriented feeling was not working well
with immutability.

I feel demotivated to work with Elixir since then but lately after
working a bit with Clojure and checking out Ioke I got enough
inspiration to work on a new version to solve those problems but still
have the features I would like Elixir to have the most (polymorphism,
meta-programming, etc). You will soon find out that the new version is
homoiconic.

There were other bugs and major annoyances that would take me a long
time to fix. For example, using leex as a tokenizer were limiting me
in several ways in terms of features I could add to the language.
Those are all addressed now.

I am really excited with the current version and since the target is
to work seamlessly with Erlang, the final source code will also be
much, much, much smaller.

Cheers!

Rodrigo Bernardino

unread,
Dec 24, 2011, 1:19:31 PM12/24/11
to elixir-lang-core
Hello there, I'm writing from Brasil and I'm involved in a project
similar to yours here in my University in Manaus, Amazonas. But,
instead of Ruby, we focus on Java.

We've got really excited with this new release, your code is helping
us a lot, because we are just in the early beginning and were quite
without any directions about how to make this compiler... Thank you
very much for coding and, even more, for sharing it!!! =)
The comments you put really helps understanding the code, thx!

Now, we would like to know if you could help us a bit...
Analysing your old code (0.3.1) we noticed that you first compile some
modules written in elixir to generate the actual elixir compiler, is
that correct? Or just some modules were required? If that is so, it
wasn't a trivial task to analyse how the whole compiling process was
made, so that's why I would like to ask some things...

What we would like to know is if with this new version this approach
has been left behind.
Or you just reduced the amount of internal elixir code necessary to
compile and run "generic" elixir code?

Another question is: Why you removed the examples and the "learning
elixir" section in the README?

We noticed that this new version is not finished yet, correct? we can
not run the "hello world" =(

Anyway, we are not the best Erlang programmers, but as we want to
understand how you made all that cool code, we might even help you if
we see something we are capable of coding! ^^

Best Regards,
Rodrigo Bernardino
Daniel Henrique

José Valim

unread,
Dec 24, 2011, 3:15:24 PM12/24/11
to elixir-l...@googlegroups.com
Regardless of the approach, when creating a language the general rule is that you will always need to write some code in the target language. So if you are writing a language using Java, there is a minimal amount of Java code you will need to write. How much code will depend on the platform and on your language. For instance, the new Elixir version provide macros, so things like if/else/end and short-circuit operators like && and || can now be written in Elixir itself because any Elixir code can generate a tree structure via macros, as you can see here: https://github.com/josevalim/elixir/blob/master/lib/elixir/macros.ex#L111

Finally, I have removed the examples from README because they are all outdated. I will need to start them from scratch with the new Elixir v0.4 version as soon as it is ready. I hope to give it a huge boost the next days.

PS: I am also from Brazil, graduated at São Paulo University (USP). Are you guys working on a Graduation Project or is it Master of Science/Doctorate? I would love to know more about the project. In case you guys can share more information about it, feel free to send me a direct e-mail.


José Valim
Founder and Lead Developer
Reply all
Reply to author
Forward
0 new messages