
Emacs Bytecode Internals (2014) - noch
http://nullprogram.com/blog/2014/01/04/
======
_ph_
Nice article, but I was surprised to read that array accesses are not range
checked for speed concerns. The emacs byte code interpreter is not known to be
a very fast one, I doubt that the range checks would make a significant
difference in run time. If anything, byte codes should bring high levels of
safety.

~~~
throwaway161220
There's a JIT branch in the official upstream emacs repository. Just checkout
nick.lloyd-bytecode-jit after cloning emacs from git and run `./configure
--with-jit` once you have libjit (originally a part of GNU dotNET) to give it
a try. libjit doesn't install a .pc file so you'll have to explicitly set the
LIBJIT lib and C ./configure flags if you install libjit from source.

~~~
smindinvern
If you want to try out that branch, do note that lisp functions are either
explicitly JIT compiled with the `jit-compile' function or JIT can be enabled
globally by setting `byte-code-jit-on' to non-nil.

In my own testing I've found that global JIT seems to not help very much, and
may actually be slower because of repeated compilations. Selectively compiling
specific functions can give a decent speedup, though.

Also, check out Burton Samograd's emacs-jit[1], which uses a very similar
technique.

[1] [https://github.com/burtonsamograd/emacs-
jit/](https://github.com/burtonsamograd/emacs-jit/)

~~~
throwaway161220
This branch being in the official repository, I took it to be favored. Do you
know what's going on?

------
khanan
Article might need a 2014-tag.

~~~
dang
Added. Thanks!

------
mmrezaie
"People do not write byte-code; that job is left to the byte compiler. But we
provide a disassembler to satisfy a cat-like curiosity."

How dare they! I will use that disassembler with my dog like curiosity.

~~~
macintux
As long as it doesn't involve dog-like comprehension[1]. Or butt-sniffing.

[1]:
[https://www.flickr.com/photos/sluggerotoole/153603564/](https://www.flickr.com/photos/sluggerotoole/153603564/)

------
gravypod
"Byte-code compilation is an underdocumented — and in the case of the recent
lexical binding updates, undocumented — part of Emacs"

"People do not write byte-code; that job is left to the byte compiler. But we
provide a disassembler to satisfy a cat-like curiosity."

If I was an emacs fan I'd be weary of this. What happens if the devs are hit
by busses? What happens to emacs? No documentation means very little
stability.

~~~
ffggvv
That's true for a lot of software. Do you use any SaaS? That's the worse.

~~~
gravypod
The only SaaS I use personally are websites I visit. I host my own ownCloud,
file storage, contact backups, and when I move into my new place I'll be
setting up my own email server as well.

Edit: If you consider DNS as SaaS then I also use that but I don't need it
internally for my network to function so I won't call it a dependancy.

