Any language containing eval in its spec cannot be (fully) compiled ahead of time, you’ll need interpretation or JIT.
Also last I checked (it’s been a while) Racket compiles to bitcode and then links in a bitcode interpreter. There’s static lisp/scheme compilers but when they come across an eval, they’re going to bail and compile in a JIT compiler or interpreter to deal with that stuff.
Fair enough, but you COULD create a compiler for a a subset of the language without eval. There are so many dialects of Scheme, what’s one without eval? Evals are very much evil anyway.
There’s plenty of schemes that aren’t fully standards-compliant but I don’t think leaving out eval is common – it’s easy to implement and nothing about the standard says that it needs to run code fast.
Just wanted to point out that eval is the real static vs dynamic boundary. As to evil, sure, you shouldn’t run just any code you find without having a sandbox in place, C’s way to do the same thing is to call cc followed by dlopen, that’s way scarier, which is why people just link in lua or something instead. I guess in <currentyear> you should probably include a wasm runtime instead of using dlopen.
Technically there’s no such thing as a compiled or interpreted language. Python compilers exist. You could write a Scheme or Lisp compiler. Racket is a Scheme that can be interpreted or compiled
Any language containing
eval
in its spec cannot be (fully) compiled ahead of time, you’ll need interpretation or JIT.Also last I checked (it’s been a while) Racket compiles to bitcode and then links in a bitcode interpreter. There’s static lisp/scheme compilers but when they come across an eval, they’re going to bail and compile in a JIT compiler or interpreter to deal with that stuff.
Fair enough, but you COULD create a compiler for a a subset of the language without eval. There are so many dialects of Scheme, what’s one without eval? Evals are very much evil anyway.
There’s plenty of schemes that aren’t fully standards-compliant but I don’t think leaving out eval is common – it’s easy to implement and nothing about the standard says that it needs to run code fast.
Just wanted to point out that eval is the real static vs dynamic boundary. As to evil, sure, you shouldn’t run just any code you find without having a sandbox in place, C’s way to do the same thing is to call
cc
followed bydlopen
, that’s way scarier, which is why people just link in lua or something instead. I guess in <currentyear> you should probably include a wasm runtime instead of usingdlopen
.