Arc Forumnew | comments | leaders | submitlogin
1 point by sacado 6119 days ago | link | parent

only cons ? What about bignums ? And strings ?


2 points by stefano 6119 days ago | link

If you use the Boehm GC, you can handle everything simply by calling GC_malloc every time you need memory.

-----

1 point by sacado 6119 days ago | link

Yes, you're right. Sorry about that.

Anyway, maybe the right way to do so is by destructuring a Scheme implementation ? Starting from a given implementation, you write your compiler from scratch, but use the facilities of the chosen implementation for the reader and the GC. Then, once it's working, you gradually remove the scaffolding by implementing these things by hand...

-----

1 point by almkglor 6119 days ago | link

Well, if you're going to end up implementing something like my unrolled-lists ideas, then everything can very well be a cons cell underneath. Including bignums and strings.

-----

4 points by stefano 6119 days ago | link

PicoLisp (http://www.software-lab.de/ref.html#cell) uses cons cells to implement everything, from bignums to strings.

-----

1 point by sacado 6119 days ago | link

Hmm, looks like an interesting beast... I'll have a look at it some day...

-----