|
|
|
|
|
by hacker_9
3308 days ago
|
|
The problem is JS is built from the ground up to be mutable. For example one big difference in Clojure is that all mutation is done through the Atom, which is transactional, making it threadsafe. I wasn't being pedantic saying JS is compiled, because it really is. Sure it's compiled to an IR though, which is then JIT compiled as needed. Nice thing about macros is they are zero cost abstractions, so there is no overhead added by using them. For example in C# using Linq creates garbage, so you can't use it in a game engine else you get freezes every couple of seconds as the GC does a collection. With macros you can have the convenience while still compiling to something that is memory efficient. As for an IDE, look at the Cursive plugin for IntelliJ. It's free for personal use and gives you a debugger, autocomplete, errors, goto definition, find usages etc. |
|
JS is not parallelized, so whether or not it's thread safe is a moot point.
Python is also compiled to a bytecode before interpretation; were still don't call it a compiled language.
In a JIT language, macros aren't significantly faster than runtime abstractions. In the latter case, you can always precompile your abstraction on program load at the expense of slower start times (think regex engines or precompile linq queries). The cost is negligible.
I can't seem to find anything on type documentation for Cursive. How can I ask it what type a function returns or what types it's arguments should take?