Well that’s elegant. I think that’s how some FORTH “threaded code” implementations reportedly worked? :)
I wonder if it’s a win for wall clock time performance to implement this way all the opcodes that are statistically rarely executed because they are inherently expensive anyway: this way they don’t burn much instruction cache space.
I was a bit sad to see the JIT being written in C++ with lots of the other code in C, i guess its easier to justify if erlang already depended on C++, which I’m not sure about. I would love to hear about the rationale for this decision.
I hope its easy to turn off for use in C only environments.
I hope its easy to turn off for use in C only environments.
What C only environments exist that can run BEAM? Honest question, coming from someone who has ported BEAM to bizarre platforms where even there you can count on the existence of a C++ compiler and runtime.
Looks like it’s because they use asmjit, which is written in C++.
The post also mention the JIT only works on x86_64 and AArch64, other platforms use the interpreter.
Also, isn’t luajit development stalled out/not keeping pace with standard lua? My understanding is that the original author doesn’t have much interest in pushing the project forward, which might be indicative of how much effort is involved.
(Please correct me if I’m off base. I don’t know very much about lua or luajit.)
I’m not an expert on software licenses, but my understanding is that while GPLv3 projects can include Apache 2.0 projects, the reverse is not true. That seems to eliminate Lightning and libjit from consideration.
Well that’s elegant. I think that’s how some FORTH “threaded code” implementations reportedly worked? :)
I wonder if it’s a win for wall clock time performance to implement this way all the opcodes that are statistically rarely executed because they are inherently expensive anyway: this way they don’t burn much instruction cache space.
I was a bit sad to see the JIT being written in C++ with lots of the other code in C, i guess its easier to justify if erlang already depended on C++, which I’m not sure about. I would love to hear about the rationale for this decision.
I hope its easy to turn off for use in C only environments.
What C only environments exist that can run BEAM? Honest question, coming from someone who has ported BEAM to bizarre platforms where even there you can count on the existence of a C++ compiler and runtime.
Looks like it’s because they use asmjit, which is written in C++. The post also mention the JIT only works on x86_64 and AArch64, other platforms use the interpreter.
Sure, but is there a rationale why asmjit is better than a pure C one? I know luajit has a jit engine one can use.
edit: link to the luajit engine http://luajit.org/dynasm.html
It’s a library that they don’t have to write.
Also, isn’t luajit development stalled out/not keeping pace with standard lua? My understanding is that the original author doesn’t have much interest in pushing the project forward, which might be indicative of how much effort is involved.
(Please correct me if I’m off base. I don’t know very much about lua or luajit.)
I’m just saying there are C jit libraries out there already so wonder what the justification for C++ is. Maybe they evaluated them and rejected them:
Note I was talking about the luajit dynasm project.
See, that’s something that I was not aware of. Thank you for sharing!
And while I’m at it, apologies for being so curt in my previous comment. I reread it and it comes off very short. Not my intention.
I’m not an expert on software licenses, but my understanding is that while GPLv3 projects can include Apache 2.0 projects, the reverse is not true. That seems to eliminate Lightning and libjit from consideration.
http://www.apache.org/licenses/GPL-compatibility.html
LuaJIT was designed around the Lua language. It wouldn’t be suitable for Erlang without a substantial amount of work possibly even a rewrite.
I should clarify my point: it would be difficult for erlang to build and maintain something comparable to luajit.
I don’t think it makes sense to use luajit. I may not know a lot about lua, but I know it’s very different from erlang.
I was referring to the jit engine http://luajit.org/dynasm.html , not sure why that would not be suitable.
https://github.com/erlang/otp/pull/2745#issuecomment-691482132
Thanks for finding that.
I know Erlang depends on WxWidgets for their GUI, so they aren’t strangers to C++ code.