newLISP Fan Club

Forum => newLISP newS => Topic started by: ale870 on October 04, 2008, 08:40:20 AM

Title: Eval function performance
Post by: ale870 on October 04, 2008, 08:40:20 AM
Hi,



I'm not sure if using eval function inside a define-macro (to evaluate a lambda function ) is fast as using a list inside a define.



Can you give me some info about eval performance?



(symbols are compiled even if they are inside a list?)



Thank you.
Title:
Post by: Kazimir Majorinc on October 04, 2008, 02:19:50 PM
Check my blog, there are two posts about that. The conclusion is that in Newlisp, eval doesn't slow down evaluation significantly.



In my experience, it is not the case in CL and Scheme implementations, use of eval, and especially if evaluated expression contains macros, result in significant, frequently huge slow down. In my test, Newlisp's eval - for short expressions - is about twice as fast as the closest competitor - compiled Lispworks - and 100 times faster than PLT Scheme. It is especially important becaue Newlisp's eval is real, unrestricted eval able to access local variables.



Eval is the main reason I use Newlisp.
Title:
Post by: cormullion on October 05, 2008, 04:25:45 AM
Quote from: "Kazimir Majorinc"Eval is the main reason I use Newlisp.


Yes that was another excellent article Kazimir!



By spooky coincidence, I just happened to read this (//http) yesterday:


Quoteevery CL book I have, and the commonly accepted consesus on comp.lang.lisp and irc.freemode.net#lisp is that use of eval in code is almost always a mistake


(This is 'in code' rather than interactively, though.)
Title:
Post by: ale870 on October 05, 2008, 05:52:00 AM
I red your article and it is very good!

Thank you for that in your blog @Kazimir !