1. 34

  2. 5

    fascinating. is there a mainstream language with more implementations? (not counting scheme because different dialects feel more like their own languages than implementations of some common spec)

    1. 16

      C. A recent post about C23 mentioned they considered over 100 compilers when authoring the next revision of the standard.

      1. 8

        Remove “mainstream”, and there are probably 1000+ Forths.

        1. 6

          That’s what Forthers are best at… Implementing new Forths instead of useful applications. I think that realisation is when Chuck stopped caring.

          1. 3

            I think the most useful application written in Forth was probably Open Firmware, and everyone at IBM I asked who worked on it celebrated when petitboot meant they no longer had to write drivers in Forth, so…

            1. 2

              Writing Forth isn’t for everyone but I love it.

            2. 1

              I mean, Forth might work for his brain as a useful thing, but it definitely is an acquired taste, other than being relatively easy to implement vs most other languages.

        2. 4

          This is probably really out of date now, but it is an implementation of javascript in Racket (https://docs.racket-lang.org/javascript/index.html) written by Dave Herman

          1. 2

            Thanks! Added!

            1. 2

              In a similar vein, check out JSCert, JS-2-GIL, and KJS. I believe Gillian is the only actively developed semantics….

              1. 2

                Amazing! I was getting so few replies with research implementations. Thank you!

          2. 2

            Some parts of ECMAScript are more implemented than others. I know that a lot (not all, but a lot) of JavaScript implementations don’t support backreferences in regular expressions; this is a good thing in my book, as backreferences are impossible to execute in linear time for all inputs, but it’s something to be aware of.

            (Off the top of my head, I know that all of the Golang based ones don’t support backreferences, same for boa in Rust, I believe. Espurino doesn’t either.)

            As someone who loves regular expressions and implementing specifications, it’s a weird intersection of topics that I’m fairly familiar with…

            (Also, the first ECMAScript specification, long since withdrawn, describes a much simpler language. No first-class functions, no in-language exception handling, a much slimmer standard library…it was a tiny language.)

            1. 1

              This was a fun read! I’ve been investing a bit of time researching various engines suitable for embedding. Used Duktape extensively, but curious about the alternatives.

              I haven’t tried JerryScript, but you seem to mention it’s ES5 only. I might not remember exactly, but Kangax had it listed with quite a decent ES6+ score.

              1. 2

                I like Duktape, but haven’t done anything with it for a while. QuickJS was released after the last time I needed an embedded JS interpreter and colleagues who have used it have found it a great experience. JerryScript, from what I remember, is heavily focused on microcontrollers: if you have more than 64 KiB of RAM in your system then it’s probably not a great choice.

                The one I’m sad about was a Samsung project. They had an AoT compiler that did a lot of reification and reachability analysis bordering on symbolic execution to get accurate type inference and used an LLVM back end to generate small executables that were about as fast as V8 (faster for some things, slower for others). The project was killed because management wanted to focus on JerryScript.

                1. 1

                  Re: JerryScript, I could only go off of what they said on their project pages which is that they had full ES5 compliance. It could indeed be they support more than just ES5.