Re: Try/Catch

new topic     » goto parent     » topic index » view thread      » older message » newer message
ghaberek said...

Really? Where can we find this? I am just curious to peruse the code.

I'm not sure I could even find the code at this point. I basically decided that it wasn't worth pursuing because I didn't want to compete with Robert, and it wasn't going to convince him to change Euphoria anyway. So it ended up morphing into the core data structure in wxBasic - basically a dynamic growable array.

Robert's code is much cooler than mine was. For example, my interpreter was a stack-based VM, which is guaranteed to run much slower than Euphoria.

If I gained any insight, it was that the core idea behind Euphoria is using bits to indicate the data type. This - and not some concept of minimalism - is what limits the number of data types that you've got. That's why Euphoria only has three datatypes: the first bit indicated if it was a 31 bit integer or a pointer, and the second bit indicated if the 30 bit pointer to an atom, or 30 bit pointer to a structure.

Only having 30 bits means you align all your pointers to 4 byte boundaries, but that's an acceptable loss for the resulting speed gain.

The rest is mostly just details of reference counting - something that's really, really easy to get wrong. But there's nothing magical about it - just attention to details.

That's how I implemented it, anyway. It's been a while since I've looked at the actual Euphoria internals, so the implementation of atoms may be different. But the core limitation remains the same.

- David

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu