Re: GSoC compiler work, SICL

Sam Steingold <[email protected]> Wed, 21 Mar 2018 18:24:35 -0400
Newsgroups gmane.lisp.clisp.devel
Message-ID <[email protected]>
Hi Bruno & Charles,

> * Bruno Haible <[email protected]> [2018-03-21 22:35:39 +0100]:
>
> inlining of local functions,

I think better handling of local functions in general would be a good
improvement and a sizable project.
Inlining them is one thing (btw, they do not have to be inlined _always_).
(and doing it well probably entails removing function-macro-let, after
making sure that this does not cost performance)

Many years ago I added disassembling local functions:

--8<---------------cut here---------------start------------->8---
(defun foo (x z)
  (flet ((add (y) (+ x y)))
    (values (apply #'add z nil) #'add)))
(disassemble 'foo)
(disassemble  (local foo add))
--8<---------------cut here---------------end--------------->8---

How about tracing them too?
This would make debugging CLISP loop much easier (loop is implemented as
a huge function with an insane number of local functions, some of which
are redefined inside other local functions).

Calling closures always conses (by calling copy-closure).
Can this be eliminated?

> data-flow optimizations

e.g., eliminate the first `bar`:

--8<---------------cut here---------------start------------->8---
(defun foo ()
  (labels ((bar () t)) (bar))
  (labels ((bar () nil)) (bar)))
(disassemble 'foo)
--8<---------------cut here---------------end--------------->8---

> Scheme-like optimizations.

What is that?
CLISP already eliminates tail calls.

> Sam, are you willing as well?

Yes.

Thanks.

-- 
Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1561
http://steingoldpsychology.com http://www.childpsy.net
http://www.memritv.org http://mideasttruth.com http://no2bds.org http://jij.org
Bug free software merely has random features.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
clisp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-devel