Pages: « 1 2 3 4 5 »
  Print  
Author Topic: Fresh Topic  (Read 10657 times)
Offline (Male) Josh @ Dreamland
Reply #45 Posted on: August 21, 2009, 08:34:27 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2958

View Profile Email
Well, hey, if any of you experts want to show me how it's done, feel free. When your parser can outperform mine, I'll use it. It's that simple.

Until then, however, we'll be sticking with what I'm coding.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) score_under
Reply #46 Posted on: August 23, 2009, 07:46:06 PM

Member
Joined: Aug 2008
Posts: 308

View Profile
Good thing you like fake, hard-coded, inflexible, unreadable, take-forever-to-write parsers.
Okay, let's pick that apart...
Fake? It parses. There's no fake about it, and I can see no possible way for a working parser to be fake.
Hard-coded/Inflexible? How do you make a fully-customizable parser, then? Why would you need to?
Unreadable? You must have never touched a programming language before.
Take-forever-to-write? Josh chooses how long Josh programs.

Good thing I like trolls.
Logged
Offline (Male) Rusky
Reply #47 Posted on: August 24, 2009, 08:48:27 AM

Resident Troll
Joined: Feb 2008
Posts: 960
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
It doesn't parse. Parsing means analyzing, and you can only really say that of the CFile parser and maybe the syntax checker. The main translator doesn't understand anything it looks at, it just sticks semicolons in.

It is a lot more hard-coded than if it were based on a grammar. If you look at a parser written using yacc or antlr, you'll see that it's a lot less hard-coded than what Josh is doing. The grammar that his accepts is implicit in the code that's also doing other stuff. With a generator, you see the grammar explicitly and it's much faster and less bug-prone to change things.

Unreadable- compared to an actual grammar definition.
Take-forever-to-write- Yes, Josh chooses, but it will take him longer if he has to manually build a parser for a grammar that he hasn't really written down than if he just writes the grammar and uses a generator to build an LR table. It'll also be more bug-prone because when he makes modifications he's doing it at a lower level.

Good thing we're not trolls.
Logged
Offline (Unknown gender) score_under
Reply #48 Posted on: August 24, 2009, 01:35:33 PM

Member
Joined: Aug 2008
Posts: 308

View Profile
Wikipedia says:
In computer science and linguistics, parsing, or, more formally, syntactic analysis, is the process of analyzing a text, made of a sequence of tokens (for example, words), to determine its grammatical structure with respect to a given (more or less) formal grammar.

That's pretty much what it does. Reads through the "tokens" (variables, operators, numbers, etc) and determines the structure - without which it is completely impossible to insert the semicolons.

And by the way, modifications at a lower level does not equal bug-prone. I have proved this many times.
« Last Edit: August 24, 2009, 01:41:31 PM by score_under » Logged
Offline (Male) Rusky
Reply #49 Posted on: August 24, 2009, 01:40:40 PM

Resident Troll
Joined: Feb 2008
Posts: 960
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
It doesn't determine the structure, though. At least most of the time. Usually it just looks for tokens that shouldn't be next to each other.

Modification at a lower level does equal bug-prone. Maybe you're exceptionally good at manually converting higher-level constructs to lower-level representations, but not everyone is, and you are a human, so you're definitely not as good as a computer. A computer is also much faster at it.
Logged
Offline (Unknown gender) score_under
Reply #50 Posted on: August 24, 2009, 01:42:22 PM

Member
Joined: Aug 2008
Posts: 308

View Profile
Modification at a lower level does equal bug-prone. Maybe you're exceptionally good at manually converting higher-level constructs to lower-level representations, but not everyone is
I must admit I have had a lot of practice.
Logged
Offline (Unknown gender) Micah
Reply #51 Posted on: August 26, 2009, 06:52:34 PM

Resident Troll
Joined: May 2008
Posts: 129

View Profile
It is a fact that you cannot change, no matter how hard you try, that it is easier, faster and less bug-prone to write or to change a description of a parser containing only the information that will need to be changed, the grammar, than to write or to change code in a parser hard-coded around the grammar.
« Last Edit: August 26, 2009, 06:59:01 PM by miky » Logged
Offline (Unknown gender) score_under
Reply #52 Posted on: August 28, 2009, 01:07:39 PM

Member
Joined: Aug 2008
Posts: 308

View Profile
it is easier, faster and less bug-prone
Sounds like an insurance ad.
Logged
Offline (Male) Rusky
Reply #53 Posted on: August 29, 2009, 05:47:54 PM

Resident Troll
Joined: Feb 2008
Posts: 960
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
I love Geico ads.
Logged
Offline (Unknown gender) score_under
Reply #54 Posted on: August 30, 2009, 08:19:41 AM

Member
Joined: Aug 2008
Posts: 308

View Profile
I love Geico ads.
I would probably love them if we had them in England.
Logged
Offline (Male) RetroX
Reply #55 Posted on: August 30, 2009, 11:03:31 AM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
It doesn't parse. Parsing means analyzing
No; analyzing means analyzing.  Parsing means parsing.

Aww, I was beaten to it.  EIther way, does Josh's methods use tokens?  Yes.  Does it use a token tree?  No.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Male) Rusky
Reply #56 Posted on: August 31, 2009, 06:23:30 PM

Resident Troll
Joined: Feb 2008
Posts: 960
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
Quote from: wikipedia
parsing, or, more formally, syntactic analysis, is the process of analyzing a text
Analyzing means parsing; parsing means analyzing.

Either way, we already knew Josh's method didn't use a token syntax tree.
Logged
Offline (Male) RetroX
Reply #57 Posted on: August 31, 2009, 08:53:33 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
It's still tokens.  Just not the kind of tokens you're thinking of.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Male) Rusky
Reply #58 Posted on: September 01, 2009, 07:36:43 AM

Resident Troll
Joined: Feb 2008
Posts: 960
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
What the heck does that mean? Using tokens has nothing to do with whether or not it's parsing it. Besides, it is the kind of tokens I'm thinking of. variable names are tokens, keywords are tokens, symbols are tokens, etc...
Logged
Offline (Unknown gender) score_under
Reply #59 Posted on: September 01, 2009, 11:09:08 AM

Member
Joined: Aug 2008
Posts: 308

View Profile
What the heck does that mean? Using tokens has nothing to do with whether or not it's parsing it. Besides, it is the kind of tokens I'm thinking of. variable names are tokens, keywords are tokens, symbols are tokens, etc...
The kind of tokens you were thinking of were arranged in a tree, not linearly.
Logged
Pages: « 1 2 3 4 5 »
  Print