You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We do this already but can do better by handling unwind-protect as
well
Passes
SCCP pass
GVN pass
Note that we can copy-propagate into a funcall or apply
For apply this is a bit like strength reduction
Can we always optimize mapc and mapcar with a lambda?
If we add a compiler macro can it expand back to ‘itself’?
We can optimize some regexps.
for example looking-at-p with a constant can be turned into ordinary code
especially if the regexp is very simple this would be a win
same with string-match-p
At least a simple form of TCO is easy
Look into a smarter form of closure conversion
Possibly sometimes we could optimize away closed-over variables, etc
We could convert `elt’ to aref or nth if we deduced the type
This could just be done with a compiler macro.
Or by rewriting ‘elt’ entirely into a macro
We could perhaps inline nth and nthcdr if the argument is a constant
Back Ends
Disassembly
C Code
if we’re generating code to compile and dlopen then we don’t really
need DEFUN, and generating a doc comment is the wrong thing to do
Currently does not handle QUIT etc.
Could use Aurélien’s “FFI” / DSO thing
Type inference would be great here, could do unboxing
this works ok but needs better code generation
Bytecode
bytecode from this compiler would probably be worse than what
emacs generates
however, we could instead write a new bytecode interpreter
a register-based interpreter would likely be faster anyway
Emacs Bugs and Changes
the emacs core needs to support a SUBR in a `closure’ list
we need the number of arguments constant exported
see eltoc.el
if we write some kind of jit back end, we’ll need many more
constants, like how to unbox
we need hacks to emacs for unwinding, see eltoc.el
in the c code we can get a vector of args
but elisp is always going to want a list for &rest
we could do better with &vector-rest
There’s no way to recapture the fact that some CL ‘throw’ constructs
are lexical
we need our own special hack. like maybe CL could put a special
property on the magic symbols it makes
concat and mapconcat don’t allow characters
this seems unfriendly and pointless
vc-dir “i” gives an unhelpful error if any other file is marked
this seems somewhat useless
it seems strange for elisp to have both defstruct and defclass
given that it isn’t really planning to be CL
it seems that cl-nreconc would be more efficient as
(prog1 (nreverse x) (setcdr x y))
… not if x=nil?
I wonder if progv is implemented correctly now that