POV-Ray : Newsgroups : povray.off-topic : Mini-languages : Re: Mini-languages Server Time
4 Sep 2024 03:20:18 EDT (-0400)
  Re: Mini-languages  
From: Darren New
Date: 12 Nov 2010 12:17:48
Message: <4cdd76bc$1@news.povray.org>
Invisible wrote:
>>> Semantic correctness is impossible to guarantee.
>>
>> Yes, and that's my point. Even with your syntactic correctness, you got
>> the parser for the numbers wrong.
> 
> So because you can't find /all/ bugs automatically, it's pointless to 
> try to find /any/ bugs automatically?

No. Because you can't find semantic bugs, it's pointless to moan about a 
simple reliable bug that gets reproduced the first time you run the code, if 
not sooner.  It's almost as silly to complain about a regexp library not 
ensuring syntactic correctness before you invoke the library as it is to 
complain about a compiler that doesn't issue error messages until you try to 
compile something.

For a regexp literal, it's trivial to check it's syntactically valid, 
*because* it doesn't depend on the rest of the program.

>>> It's a bit like trying to build an
>>> XML file by string manipulation. Yes, it can be done. Yes, you can
>>> make it work. And yes, it's incredibly fragile.
>>
>> No it's not.
> 
> I give up.

<Yoda> And that is why you fail. </Yoda>

You're making assertions with no experience. You've already admitted you 
don't know how regular expressions work, yet here you are telling *me* that 
building them programatically is "incredibly fragile".  You're talking out 
your ass, my dear.

> I have yet to see anybody construct a regex in any way other than typing 
> it out by hand, or gluing strings together by hand.

You don't even know how they work, so I am not at all surprised you haven't 
seen the more sophisticated mechanisms. Just off the top of my head, 
GUI-wise that you may have seen, there's Agent Ransack's expression builder.

http://www.cs.uiuc.edu/class/fa05/cs475/Lectures/new/lec05.pdf

http://www.physicsforums.com/showthread.php?t=265064

There are also any number of systems that'll build lexers for you.

(I'd like you to note that some of these are college lecture course notes. 
This is basic fundamental stuff that everyone with a degree in CS should 
know. So it's not like we're pushing some bizarre esoteric edge-case at you.)

In any case, a regexp is generally not powerful enough that you need to 
build it programatically. Indeed, that's precisely the point.

-- 
Darren New, San Diego CA, USA (PST)
   Serving Suggestion:
     "Don't serve this any more. It's awful."


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.