ZH version is available. Content is displayed in original English for accuracy.
Advertisement
Advertisement
⚡ Community Insights
Discussion Sentiment
60% Positive
Analyzed from 1027 words in the discussion.
Trending Topics
#code#llvm#interpreter#jit#interpreters#cvi#changes#programs#lua#tracing

Discussion (23 Comments)Read Original on HackerNews
It integrated with "Function panels". Function panels were our attempt at documenting our library functions. See the second link below. But you could enter values, declare variables, etc and then run the function panel. Behind the scenes, the code is inserted to the interactive window and then run. Results are added back to the function panel.
These also worked while suspended on a breakpoint in your project so available while debugging.
My understanding was that these features were quite popular with customers. They also came it handy internally when we wrote examples and did manual testing.
https://www.ni.com/docs/de-DE/bundle/labwindows-cvi/page/cvi...
https://www.ni.com/docs/de-DE/bundle/labwindows-cvi/page/cvi...
https://irkr.fei.tuke.sk/PPpET/_materialy/CVI/Quick_manual.p...
Yeah, I find this valuable regardless of the programming language, ideally the toolchain should be a mix of interpreter/JIT/AOT, to cherry pick depending on the deployment use case.
Naturally for dynamic languages pure AOT is not really worth it, althought a JIT cache is helpful as alternative.
Metatracing ones are kind of an interesting twist on the original idea.
> So it takes normal interpreted code and jits it somehow?
Anyway, they use a patched LLVM to JIT-compile not just interpreted code but the main loop of the bytecode interpreter. Like, the C implementation itself.
> But you have to modify the source code of your program in some way?
Generally speaking, this is not normally the goal. All JIT-s try to support as much of the target language as possible. Some JIT-s do limit the subset of features supported.
> added about 400LoC to PUC Lua, and changed under 50LoC
Lua 5.5.0 has 32106 lines of code including comments and empty lines. The changes amount to 1.4% of the code base. And then there's the code changes in the yk LLVM fork that you'd have to maintain which I'm guessing would be a few orders of magnitude larger.
If this project would be able to detect the interpreter hotspots itself and completely automate the procedure, it would be great.
However not without downsides. It sounds like average code is only 2x faster than Lua, vs. LuaJit which is often 5-10x faster.
That's an abrasive question but i dare say that we all do. It's our only constant point of reference.
> Have you written a parser or interpreter?
i have written many parsers, several parser generators, and a handful of programming languages. This article, however, covers a whole other level, way over my head (or well beyond any of my ambitions, in any case).
Pics or it didn't happen: fossil.wanderinghorse.net/r/cwal