[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs Lisp JIT Compiler
From: |
Tom Tromey |
Subject: |
Re: Emacs Lisp JIT Compiler |
Date: |
Wed, 12 Sep 2018 22:32:06 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) |
>> Yes, el-compilador is pretty unfinished. I think it should support
>> all of elisp in the front end and in the optimizers; but the C back end
>> is quite incomplete.
>>
Robert> OK. Iʼm assuming completing the C back end is just a SMP? :-)
Yeah, for some value of S. The github repo has some bugs if you're
interested. Also you can pretty much pick a random, real elisp program,
compile it, and find failures, usually in the C back end. I've got an
Emacs branch where I tried rewriting bits of C to elisp and then compile
them back to C; and IIRC I had to skip some functions for this reason.
Not to talk down el-compilador. It has some nice things that are more
of a pain to do in something like the bytecode->C compiler. For example
it can apply type inference along one side of a conditional.
>> I wrote a second compiler, though, that just compiles from bytecode to
>> C. This one is more complete, see my post about it from sometime in the
>> last month or so. IIRC wiring it up to the build was the remaining
>> difficulty.
Robert> I saw that, but I donʼt remember if you said where youʼd put it. I
Robert> couldnʼt see a likely branch in the savannah emacs git repository.
It's in my github in the feature/bytecode-c branch.
The C generation is ok but the rest isn't finished. It is tricky to
associate the compiled C code with the Lisp defun. Also see my other
post about it, it doubles (IIRC) the size of the executable.
You may recall that I was also looking at gcc-jit. I have partially
done this translation but I got stalled by my illness. I'm not sure if
I'll return to it, mostly because libjit is sounding perhaps more
attractive here on emacs-devel.
Tom