Also by the same author.
Also by the same author.
But it does come with some design decisions that I'm a bit ambivalent about and for which I haven't found a good explanation:
- No persistent data structures. I guess this has something to do with limitations of the GC?
- unhygienic macros combined with lack of namespaces. XOR those two choices would be fine, but the combination is janky
- Somewhat peculiar choices in syntax. It's neither Scheme, nor is it Clojure. # starts comments, ; is splice, @ marks literals as mutable...
0(example config): https://github.com/TheBlob42/love2d-fennel-neovim
https://git.sr.ht/~technomancy/fennel-lang.org
Janet looks like is by Calvin Rose (bakpakin) https://github.com/janet-lang/janet/graphs/contributors
% git remote -v
origin https://git.sr.ht/~technomancy/fennel (fetch)
origin https://git.sr.ht/~technomancy/fennel (push)
% git log --reverse
commit 9afe4338ed1816a759cb4b120f89e8f67159ce16
Author: Calvin Rose <calsrose@gmail.com>
Date: Sun Aug 7 18:50:34 2016
First commit.
commit b62a24853e24662f76932a2a81bb77cc25704491
Author: Calvin Rose <calsrose@gmail.com>
Date: Sun Aug 7 19:05:40 2016
Add some examples.
commit 5e3e0fe11e4f56007b3523e54d81d55280ef2204
Author: Calvin Rose <calsrose@gmail.com>
Date: Tue Aug 9 08:27:43 2016
Update README.mdWhat? People are just creating new languages these days as if they were Javascript libraries?
Let's say I wanted to make my own programming language. What's the easiest way to prototype it in a way I can share it with the world? Are the programming language development toolkits that come with a tokenizer library and things like that? Should I write my own program to output machine code? Or maybe it's easier to just transpile to Javascript?
I don't think the average programming language enthusiast is maintaining multiple well-known languages.
I really want to try making a language that is imperative, like really imperative, where every line must start with a verb, just to see what it would look like.
It would look like Tcl.
One way I think I can get rid of that is like this
32 = foo;
But why do we even need variables? I think the perfect language design would be if you could just do this: pow(x, 2);
pow(y, 2);
sqrt() = result;
And maybe you could do this {
pow(x, 2);
pow(y, 2);
sqrt();
} + 1;
pow(2) = result;
Instead of result = pow(sqrt(pow(x, 2), pow(y, 2)) + 1, 2); that we have today.The author posts on HN as ‘munificent’, I think.
You can make a simple language very easily if you design the syntax carefully and restrict its capabilities. It all depends on what you need it for.
In my case I needed a way to create reports from a Turbo Pascal program (TP3 for DOS I think) without having to edit the program and ship a new version. So I made a simple report generating language. It had simple for loops, all variables were global, tokens were all separated by white-space, no user defined sub-routines or functions, a set of predefined procedures specifically designed for the report generating function, arithmetic expressions that were only allowed in assignment statements, interpreted not compiled.
It was actually quite easy to do but of course was not a general purpose language. These days it might be simpler to embed Lua.