Crystal's Interpreter (2021)
crystal-lang.org
crystal-lang.org
I would really like to see a hybrid approach, where an interpreter is used for the outer loop and a compiler for the inner loop. I believe Guile takes this approach by automatically compiling frequently called functions.
That's just a standard JIT isn't it?
Also - note there are multiple ways to automatically make a compiler from an interpreter, so really you just need the interpreter.
For context: I'm just a hobbyist interested in PLs and want to learn more about JITs, I found Crafting Interpreters super helpful for a lot of foundational knowledge.
https://www3.hhu.de/stups/downloads/pdf/BoCuFiRi09_246.pdf
https://chrisseaton.com/truffleruby/pldi17-truffle/pldi17-tr...
I found the source code to be quite readable too, last time I delved into it. Also its command line tool ("ch"), when compiled in debug mode, has loads of options available to show what it's doing internally when it executes a JavaScript program.
The runtime performance of crystal executables are great, of course, comparable with C or C++ in the given web development domain, of course, where the Boehm GC isn’t a problem, given the request response cycle and the standard lib http and socket objects, etc
I don't think that's true. Crystal seems to be more in the ballpark of Go or Java:https://www.techempower.com/benchmarks/
https://programming-language-benchmarks.vercel.app/crystal-v...
It's called ICR: Interactive Crystal
https://github.com/crystal-community/icr
the first release was back in 2017
docker run --rm -it crystallang/crystal:1.4.1-alpine
/ # crystal i
Crystal was compiled without interpreter support
/ # crystal eval '3.times { |i| puts "Hello #{i}" }'
Hello 0
Hello 1
Hello 2
/ # crystal eval 'require "http/client"; puts HTTP::Client.get("https://news.ycombinator.com/").body.split("\n").first'
<html lang="en" op="news"><head><meta name="referrer" content="origin"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" type="text/css" href="news.css?E6T8vRgACsBJvJjCXAU8">
I tried the non-alpine package as well. No dice.