https://janet-lang.org

Also by the same author.

I like Janet a lot, and have been using it for small personal projects for about a year.

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...

Janet is very small, apparently smaller than Lua, and is also intended to be embedded into native-code programs. Hence, I suppose, the decisions that make it "too" simple: it apparently is not intended for writing large amounts of code.

I prefer Janet, but Fennel is great in places Lua is already supported, like in Löve2D.

https://git.sr.ht/~benthor/absolutely-minimal-love2d-fennel

One thing I've found that's really nice with Fennel + Love2D is you can even do hot reloading with nvim+conjure[0](I assume emacs too). I assume there's a way to hot refresh with just straight Lua but it feels very natural to do with a lisp.

0(example config): https://github.com/TheBlob42/love2d-fennel-neovim

I believe Fennel was originated by Phil Hagelberg (technomancy)

https://git.sr.ht/~technomancy/fennel-lang.org

Janet looks like is by Calvin Rose (bakpakin) https://github.com/janet-lang/janet/graphs/contributors

I’m pretty sure Calvin created Fennel and Phil took up the reins when Calvin moved on from the project.

I stand corrected:

    % 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.md

Dammit, Janet! Ok, looks good. I'll need to look into it.

Whomever downvoted you probably never saw the Rocky Horror Picture Show

[deleted]

>by the same author

What? 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?

The author, Calvin Rose, is a (I assume pretty great) compiler engineer at NVIDIA who has a personal affinity for LISPs and Lua: https://bakpakin.com/

I don't think the average programming language enthusiast is maintaining multiple well-known languages.

Interesting. I saw another link here of someone who insists on making C# run everywhere, now someone who insists on LISPs.

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.

> 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.

A bit but I don't like "set foo 32"

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.

At that point you’re almost, but not quite into the realm of “forth”

Crafting interpreters by Robert Nystrom could be a place to start - https://craftinginterpreters.com/

The author posts on HN as ‘munificent’, I think.

Great book—as an entry point for designing languages.

I thought almost all programmers created a language or two in the course of their careers or hobbies.

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.