3 ms·
I'm impressed that people didn't mention https://www.gnu.org/software/libjit/ https://www.gnu.org/software/libjit/ it's a small well designed library with a ver
by mingodad 8y ago
I'm impressed that people didn't mention https://www.gnu.org/software/libjit/ https://www.gnu.org/software/libjit/ it's a small well designed library with a very good interpreter.
I wish more people put some effort on improving it and all of us could benefit form it without reinventing the whell again and again.
- b2gills 8y agoI'm very confident it would not be very good at optimizing Perl 6 code. On the first page of the documentation for libjit is this: “Only a very small proportion of the work is concerned with language specifics.” The thing is that Perl 6 tends to break more of the established rules than it follows. For example, most normal operators in Perl 6 are just subroutines with a special name: a + b == &infix:«+»(a,b) put &infix:«+».candidates.elems; # 26 There is currently 26 multi subs with the same name for handling the numeric infix addition operator. (27 if you count the proto sub) That is among the easiest of things to optimize in Perl 6. I would also like to know if it is a JIT that profiles and compiles the optimized code on another thread like MoarVM does. Is there a plugin system that allows high level code to influence what code gets JIT compiled like MoarVM recently received? I'm sure that for just about every other dynamic language libjit would be very suitable. It's just that I imagine it would quickly strain under the weight that is Perl 6. (Perl 6 brings in many varied features from many languages, and combines them in a way that it feel like they have always belonged together.)