Re: Pass by Reference

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

But that's not an equivalent comparison. In something like C where you've got a bad pointer, you have no idea what went wrong.

The interpreted version of Euphoria not only knows that something has gone wrong, but it knows what has gone wrong. The program can even provide that information to itself so if could decide how to recover.

Right, but the translated version probably wouldn't have any of this information. (The shrouded version is somewhere in between these two extremes.)

dcuny said...

One of the problems with Euphoria is that it isn't balanced. It crashes at the drop of a hat (by design), but doesn't offer any good mechanisms to recover from the error.

The thing is, you can recover from those errors. The try/catch mechanism is a great example. I can't imagine why Euphoria doesn't have some equivalent mechanism.

If Euphoria balanced crashing with a powerful recovery mechanism, that would be great.

But it doesn't, which means that unless you write perfect code, it's going to crash.

Agreed. Adding something like a try/catch mechanism is on the TODO list for this very reason.

dcuny said...

Similarly, I like the fact that Euphoria offers me a very flexible data structure, so I don't have to resort to malloc and accidentally trashing memory.

But why does so much of the remainder of the language have to remain so inexpressive? Sure, I can implement structures by using a global sequence, and then pass in an index. But Euphoria (as a language) doesn't support that.

It does with eumem.... again that's the whole point of eumem. Why is using eumem (or your superior rewrite with its getter/setter routines) so much more of a problem compared to built-in PBR or pointers?

dcuny said...

It seems to me that Euphoria ends up being a "simple" language, but requires a lot of extra work for what comes "for free" in other languages.

Agreed on the try/catch part. Disagree on the PBR part... but if you really want to add PBR support to Euphoria itself, I don't know of anything stopping you. (If done cleverly, you could add PBR support just by modifying the parser, removing the need to change any underlying C code.)

I imagine that, if done in the right style (ala D, so PBR is not the default and made very explicit), a proof-of-concept feature could be merged into the mainlane pretty easily, without much objection.

Since we already have eumem, which is "good enough", I don't see a compelling reason to work on PBR as a core language feature. But if someone provided a patch with the hard work already done, then it'd be a different story.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu