← Back to context

Comment by shevy-java

6 hours ago

    (defn foo [first & rest] ...)

So basically Lisp 2.0.

Although, this here is a good idea:

"pass values from compile-time to run-time"

Would be nice if some kind of "scripting" language be as fast as a compiled language, but without ruining the syntax. Just about 99% of the languages that are shown, have a horrible syntax. Syntax is not everything, but most language designers don't understand that syntax also matters. So tons of horrible languages emerge. Nobody will use those languages, so 99% of them will die off quickly.

What would be a better syntax according to you? I have found Janet’s syntax very pleasant to work with as opposed to JavaScript, Lua or even Python.

can't there theoretically be a language which transpiles to Janet to get all the benefits without additional paranthesis too?

Not sure if such transpilation would have a perf hit though, I hope somebody responds who knows about it more.

I don't deny that syntax matters itself too but there are some ideas of janet like sandboxing and other features which seem to me to be worth implementing in other languages too.

Personally, I would be really interested in a language like lua/wren which can transpile to Janet too.

  • "... all the benefits without additional parenthesis too?"

    I guess you don't like Lisp's syntax. I didn't either until I realized the key insight: when you're writing Lisp, you're basically writing an AST. Which is why it's so easy to manipulate your code. Want a new feature the language doesn't have, such as the pattern-matching they added to C# a few versions back? You can add it yourself; you don't need to wait for a language committee to implement it years after you needed it. That's all that macros are: functions that take AST and return AST, which is then executed.

    And once I realized that Lisp's syntax was basically an AST, I no longer saw the parentheses. Now I just see blonde, brunette, redhead... Oops. Sorry. Wrong reference.

  • I guess you could transpile direct to Janet bytecode, and performance would be in theory the same as native Janet?