Leaf is the language we always wanted. Drawing from a half century’s worth of collective knowledge, Leaf incorporates the best ideas into a unified whole. A language with the willingness to rebuild everything and examine the deep foundations of every issue.

All programmers will feel at home with Leaf.

Leaf Language Site


Leaf is in the very early stages of development. The goal is to reach a usable state quickly and start learning from real world examples. It is expected that all early code will be rewritten several times until we’re completely happy with the results.

Status details


The code for the project is available on Launchpad. It uses the “scons” build system; refer to the BUILD.TXT file for instructions on building and running.

Absolutely all feedback is welcome.


14 replies »

  1. I like your idea’s and looking forward for updates.
    Maybe i will even look into the code and look if I can help :)
    Some features I would like to see are simple use of parrallel computing and concurrency.

    And maybe some different pointer system or special pointer helpers, because the most time I spend debugging C/C++ code is figuring out the pointers

    • Pointers definitely work quite differently than C++. Trying to figure out if one needs ‘a.b.c’ or ‘a->b.c’ or ‘(*a)->b->c’ gets tiresome. Also the verbosity of ‘make_shared(…)’ and ‘shared_ptr’ also gets annoying.

      Concurrency I’m not sure how I will address yet. I will try to leave it quite flexible here since I’m not sure anybody has the ideal concurrency model yet. At the same time I think there can’t be guarnateed safety here since it would cost way too much in terms of performance. I definitely think about it the whole time however.

  2. Hah! Seems like a good read, also because I can “steal” some ideas from you. If your Leaf is in very early stages, my own language — Skila (http://skila.pl/) is in embryo stage :-D

    Anyway, +1 subscriber of your blog.

    • I’m not quite sure if I understand your comment Devid, but are you asking about everybody developing their own language?

      I find it to be useful, even though the vast majority of languages will never be widely used. New languages become experiments for new features and programming models. They help drive features into existing languages. Occassionally they find niches as well and become widely supported.

  3. Your leaf ideas look nice. Here are some things I have in mind about it:
    1. Having to write`()->()` for no parameter void functions is a severe syntax design flaw! Shouldn’t the plain arrow `->` be a very unique symbol that cannot be confused with other stuff? A good modern language provides a good amount of implicitness; just like type inference you propose, but also like allowing to skip unnecessary syntax.
    2. Did you look at the things Mozilla/Rust (http://www.rust-lang.org) can already do? Why do you not just extend their system with new features? In the long run you may benefit from any tools/eco-system they may built up.

    Good luck with your project!

    • The short-form `->` is already supported: as you say, this operator is unique and always denotes a function. In the simplest form it means no parameters and an implicit return type. I do however find for simple examples it is clearer to put the parameter lists.

      Prior to starting I did not look at Rust (I’m not sure where it was at the time). I obviously keep looking at all languages, but am already far enough to not want to build on top of another language. That said, obviously I build on top of other projects like LLVM. Being a compiled language also gives us a great environment of tools like valgrind and gdb.

    • Ahh OK, I get it. In the end any low level LLVM tools will help you. Are you also working on a Vim plugin or similar tooling? I guess you will need such if you want people to use Leaf.
      Again, regarding the `()->()` examples, I would really replace them or, maybe better, add a section on the two options. That you also allow the much more beautiful `->` is not obvious. Remember: you want to “write beautiful programs” ;)

    • So far just a Kate syntax highlighting file is availble. Other tools, like vim, will be supported in time. Once a few more key features are done I’ll push towards making building/install a lot easier.

      Yes, I should replace the examples. I can’t completely do it yet though since the inferred return type isn’t actually working, thus it’s limited to void returns now.

  4. This Language looks a bit like Rust.
    But it seems to be only in very early stage.
    The question is why do some one will need it?
    Why not use Rust or may be D Language ?
    What is the unique selling point ?

    • I think the syntax differs significantly from Rust, without full examples it’s hard to see that. I suspect the feature set will be similar. This is to be expected of a modern language: one would hope the authors, including me, would include popular and useful features found in other languages.

      I think Rust, D, and Leaf generally belong to the same class of languages, so it’s hard to say that one will be able to do something greatly different than the other.

      That said, Leaf is trying to be a highly orthogonal, strongly-typed language with the ease of use similar to a dynamic language. The goal is to reduce defects, reduce development time, and reduce maintenance effort.

  5. Unfortunately I could not find any bigger example to compare syntax.
    But syntax is not the most important point.
    What are advantages over other languages ?
    For example Rust is very interesting because of its memory management and safety.
    Rust is probably only 2 years young.
    D2 has mixins, easy to use templates, CTFE and much more.
    D2 is around 7 years young and is based on D1.
    There is also Go language.

    Any way any programing language need REPL, IDE, package manager and other tool support.
    For D there eare VisualD, DUB.
    For Rust is at least Cargo but no IDE or REPL for now.
    For Haskell there are GHCi, Cabal. Cabal hell inclusive :)

  6. Another Programmer Language Designer here.

    I will not get you bored, talking about my own project.

    I haven’t had enough time, to download, ant try, about your Leaf project, when I can, I will do it.

    Have followed several of your posts, they are very interesting, as well as Leaf does.

    Good Work !!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s