User function invocation now working

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

User function invocation now working

Post by sje »

ChessLisp's user function invocation is now working. However, the internal evaluator implementation needs to be changed from recursive to iterative. But all the dynamic and lexical scope bindings are working along with the activation stack and storage reclamation, so that's something.

Demo: Fibonacci

Code: Select all

$ ./ChessLisp
ChessLisp ready
[]  (defun fib (n) (cond ((= n 0) 1) ((= n 1) 1) (t (+ (fib (- n 1)) (fib (- n 2))))))
fib
[] (fib 40)
165580141
[] (quit)
nil
$
benstoker
Posts: 342
Joined: Tue Jan 19, 2010 2:05 am

Re: User function invocation now working

Post by benstoker »

sje wrote:ChessLisp's user function invocation is now working. However, the internal evaluator implementation needs to be changed from recursive to iterative. But all the dynamic and lexical scope bindings are working along with the activation stack and storage reclamation, so that's something.

Demo: Fibonacci

Code: Select all

$ ./ChessLisp
ChessLisp ready
[]  (defun fib (n) (cond ((= n 0) 1) ((= n 1) 1) (t (+ (fib (- n 1)) (fib (- n 2))))))
fib
[] (fib 40)
165580141
[] (quit)
nil
$
Is there any version of this available to the public?
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: User function invocation now working

Post by sje »

Not yet. But eventually the whole kit including source will be released under Creative Commons.

Look for a beta release early next year. Maybe even late this year.

----

At present, the system is spending about 3% of its time doing storage reclamation.

It's spending about 35% of its time doing symbol binding look-up.

Much room for improvement, for sure.