z88dk forums

z80 Development Kit

You are not logged in.

#1 2017-12-05 21:44:43

stefano
Administrator
Registered: 2007-07-16
Posts: 1580

[z88dk-dev] campus lisp vs spec lisp

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  smile
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

Offline

 

#2 2017-12-06 07:57:43

stefano
Administrator
Registered: 2007-07-16
Posts: 1580

Re: [z88dk-dev] campus lisp vs spec lisp

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

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson