3 ms·
I'm currently using a CPU-slow machine, and I've discovered everything is slow among the popular scripting languages, except Lua. I've thought JS has good start
by aasasd 7y ago
I'm currently using a CPU-slow machine, and I've discovered everything is slow among the popular scripting languages, except Lua. I've thought JS has good startup time, but some of my Lua scripts that are doing file i/o finish faster than node.js does a ‘hello world.’ Lua is also very lightweight on memory, to my knowledge. I think it can even do true multithreading, via libraries.
So, there's a Lisp on top of Lua―compiled, not interpreted: https://fennel-lang.org https://fennel-lang.org
It's deliberately feature-poor, just like Lua: you use libraries for everything aside simple functions and loops. And it suffers somewhat from double unpopularity of Lua and Lisp. But it works fine.
- DickieStarshine 7y agoHave you looked at Julia?
- MiroF 7y agoJulia is compiled to machine code, not interpreted
- vanderZwan 7y agoThat has nothing to do with how "lispy" it might be. Part of the compiler is implemented in femtolispe no?
- MiroF 7y agoI suspect this does have to do with whether or not it is a fast scripting language, considering a language compiled into machine code is by definition not a scripting language. Sure, flag me, but my comment was relevant to the discussion.
- fiddlerwoaroof 7y agoMany lisps compile to machine code too. Compilation vs. interpretation is a feature of an implementation, not a language.
- MiroF 7y agoScripting languages are by definition interpreted. The question was about fast scripting languages. I'm skeptical that Lisp compiled to Lua would count as in that category, but Julia unequivocally doesn't.
- fiddlerwoaroof 7y ago"Scripting languages are by definition interpreted" [[Citation Needed]]. There are Common Lisp implementations of both Python and Javascript (ES3) that compile to Common Lisp and then the Common Lisp compiles to machine code: as I said before, whether or not a language is interpreted or compiled is an implementation detail, not part of its spec.
- MiroF 7y agohttps://www.webopedia.com/TERM/S/scripting_language.html https://www.webopedia.com/TERM/S/scripting_language.html I chose this based off a random search on google of "scripting language." You can do the same and would get the same result. It's not a rigorous term, because (you are right) its a property of the implementation not the language itself, despite the name. But I don't think Julia has relevance to discussion of the speeds of interpreted Lisp.
- lispm 7y agoThat term was a long time ago already seen as problematic in the Lisp community. At the time when Ousterhout used it for marketing TCL. Basically a scripting language interpreter runs source code files, called scripts. Lisp does that, too. But many Lisp implementations compile the code and often to machine code, since the runtime includes an incremental compiler. The incremental compiler can compile individual expressions to memory. Thus when you use a Lisp system, running a script just looks like running an interpreter, even though the code gets compiled incrementally. Lisp uses the function LOAD, which can load a textual source file and which can then read, compile, execute expressions from the file. Typically this is also available via command line arguments. Like in SBCL one can do: sbcl --script foo.lisp and it will read/compile/execute expression by expression from a textual source code file, actually incrementally compiling each expression to machine code.
- e12e 7y agoJulia is currently (only) jit. AOT is stil work in progress AFAIK. It's about as "compiled" as Luajit is.
- tonetheman 7y agoI am using Fennel for this: https://itch.io/jam/autumn-lisp-game-jam-2019 https://itch.io/jam/autumn-lisp-game-jam-2019 I will not finish ... I suck at lisp. But it works.