Re: voting on GOTO
- Posted by Matt Lewis <matthewwalkerlewis at gm?il?com> Jun 06, 2008
- 807 views
Greg Haberek wrote: > > Matt Lewis wrote: > > > > Greg Haberek wrote: > > > > > > There seem to be several chunks of PCRE-related code scattered around > > > the SVN trunk, some C, some Euphoria. Nothing I've looked at thus far > > > has expressed a need for GOTO. Perhaps you could point me in the right > > > direction? > > > > matt@oneill:~/euphoria/dev/rds/source/pcre$ grep -c goto *c | grep -v \:0 > > pcre_compile.c:96 > > pcre_dfa_exec.c:9 > > pcre_exec.c:28 > > So the C code needs it... let the C code have it!!! Just compile that > into the Interpreter back-end. Isn't that what you're already doing? Are > most (if not *all*) the things the Interpreter does actually implemented > in the C back-end? I would imagine it'd be the *fastest* and *simplest* > route to implementing PCRE. Why bother re-writing it in Euphoria? Then > you'll have to re-re-write it every time there's an update (or hunt down > the updates to the PRCE code and implement them individually) if you'd > like to maintain that the code is fresh and stable. > > As much as I respect you as a programmer, Matt, I find this a moot argument > for GOTO. Huh? You asked a question and I answered it. No one is saying that we should port PCRE instead of putting it into the interpreter (well, maybe Bernie). I don't understand what's so hard about this argument (which multiple people have gotten wrong, BTW--I'm addressing all of you here). For the sake of argument, let's pretend that the letters P, C, R and E were never typed in that order. The question was, when is goto a useful thing, over and above what you can do with other structures that euphoria has. I answered, "It can be very useful when porting code from other languages that might have goto or other features that aren't easily handled by what euphoria has." I then gave my previous, failed attempt at doing just that with PCRE, to show that it wasn't completely theoretical. You [in the generic sense] are free to disagree with the need for goto. You are not free to think that this argument has anything to do with the decision to include PCRE into euphoria, and that including it has any bearing on the debate about goto. It was simply an example of some useful code that couldn't be easily made into a native euphoria port. Now, you could ask, "Why bother to port it? Why not just wrap the shared library?" And my answer would be: it's easier to distribute euphoria code with a euphoria app than to deal with additional dependencies. And if the performance is acceptable, then it's a plus. And it's not going to be possible or desirable to put every useful library into the interpreter. Matt