rain-1 / rain-1.github.io

GNU General Public License v3.0
4 stars 0 forks source link

scheme-7 #7

Open utterances-bot opened 4 years ago

utterances-bot commented 4 years ago

Lessons from Tarot 7 - pointer tagging and data representation. | rain-1.github.io

undefined

https://rain-1.github.io/scheme-7.html

xieyuheng commented 4 years ago

remember the 64-bit word trick you used in the vm ? I did something like 64-bit tag ... crazy ... (but, I can used hashed value of symbol as tag)

rain-1 commented 4 years ago

hashed value of symbol as tag, can you explain more?

xieyuheng commented 4 years ago

something like the following:

A symbol is an index into the hash-table of strings.
A symbol (without its tag) is an 64-bit value.
I can use 64-bit value as tag.
----------------------
I can use symbol as tag.
xieyuheng commented 4 years ago

by doing this, I wasted a lot of space. but I can dynamicly add new tag (new datatype).

look back now, I think it is not a good idea. (defining new datatype can be achieved by better method.)

xieyuheng commented 4 years ago

(a little off topic)

do you like type system now ? after I read "the little typer" and this :: http://davidchristiansen.dk/tutorials/nbe implementing eval and check feels like equally simple.