[z88dk-dev] campus lisp vs spec lisp

Bridge to the z88dk-developers mailing list
Post Reply
stefano
Well known member
Posts: 1534
Joined: Mon Jul 16, 2007 7:39 pm

[z88dk-dev] campus lisp vs spec lisp

Post by stefano »

Lisp language is an incredible abstraction 'thing' (tool, langage, whatever it is). Playing with it is addictive, still it is very difficult to get stable and useful applications. An extreme simplification is recursion compared to iteration, the latter one is usually faster and requires little memory, but the other way is magic!
The Campus Lisp is a brillant piece of code, nevertheless the old Spec Lisp by Serious Software seemed to be even better. Under some aspect.
The way it handles the 'lambda' instructions and the possibility to use self modifying code are astonishing. Moreover it had graphics and consumes less memory than Campus Lisp, so I inserted two new options in Campus Lisp, to accept the Spec Lisp Syntax and support Turtle Graphics in the exact way its ancestor did :)
Now on the memory consumption... the Campus Lisp 'wins' most of the maths challenges, because its 'atoms' are defined as long words, while Spec Lisp chose simple 16 bit words (guess why). The practical effect is that the factorial programs work better on Campus Lisp but the recursive programs run out of memory soon, so some program I ported from Spec Lisp hangs halfway.
To cope with the lack of memory there are three ways: engine optimization (done already in many ways), add memory (paging, etc, e.g. as done for the zx81 version), change the size of the atoms (! doesn't sound scientific at all..).

In any case I'd like to try: is there an easy way to 'kill' the long type and treat it everywhere as if it is an integer ?
Is sccz80 accepting typedef of some macro?



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
stefano
Well known member
Posts: 1534
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

Solved, a simple macro to force the long type to be seen as an 'int' did most of the trick.
The data area gets much smaller, now I'm testing this crappy variant to verify it is still useful.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Post Reply