1. 30
    1. 2

      It is great to see how languages can be used as runtimes for other languages. JavaScript is probably the language that has the most “sugar transpilers” out there. An interesting derivative question is: which set of primitives make a great semantic bedrock for implementing programming languages. In JavaScript, the prototypical inheritance, native list and maps, plus closures make it very easy to kickstart a new language. What would be Lua’s in that case?

      1. 9

        which set of primitives make a great semantic bedrock for implementing programming languages. […] What would be Lua’s in that case?

        The reason I like Lua so much is that the language has a ruthless simplicity. There’s no “Lua: the good parts” distinct from the whole language itself. You have your numbers and strings, your tables and your closures, and that’s 95% of the language right there. When it’s time to get really fancy you can break out your metatables and coroutines, but most code really doesn’t need this. Share-nothing threads and queues can be added by a platform like LÖVE, but they’re not part of the core language.

        I think the fact that this question would even be asked tells you more about Javascript than anything else.

        1. 3

          “Lua: the good parts”

          I’ve been avoiding JavaScript like the plague for the past 10 years and finally decided to pick up that JavaScript book. With pretty much every feature he described I was thinking to myself, “man, this is a shittier version of what Lua does”

        2. 1

          I guess the underlying question is: if you free a language from its syntax, which (minimal) set of core semantics become your basis (as in linear algebra) for implementing new languages or simply new syntaxes. What I find so interesting with Fennel and many JavaScript transpilers is how it challenges our preconception of what a language is, by showing that syntax is “just” a UI.

          Did you know about Io (the language)? It was designed with minimalism in mind and is inspired by Lua in its implementation. The semantics are quite different, and one could argue, lend themselves even better to creating derived languages.

          1. 1

            I’ve read a bit about Io but never used it myself. It does seem conceptually a lot simpler than any OOP-centric language I’ve seen with the possible exception of Smalltalk, but these days I don’t have a lot of patience for OOP to begin with. But Io’s lack of any built-in reserved syntax and its focus on runtime introspectability do look appealing.