|
Josh @ Dreamland
|
|
Reply #16 Posted on: August 23, 2009, 07:36:21 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
The preprocessor is what handles #preprocessor directives.
|
|
|
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
|
|
|
|
|
|
score_under
|
|
Reply #20 Posted on: August 24, 2009, 01:37:08 pm |
|
|
Joined: Aug 2008
Posts: 308
|
Compiler optimizations aside, ++i is faster than i++, because i++ has to create a copy of i to evaluate to and increment the real one, while ++i just increments it.
No. The only difference between i++ and ++i is when it is incremented - you still have to reference the variable if you are using it as part of another expression. No copies are created, either. Rusky: Reinventing the wheel is good. 1- It allows you to improve. 2- Any bugs and you can find them pretty easily, as it's your own code 3- It's specialized. You can make your own optimizations. 4- Human-written is almost always better than auto-generated.
|
|
« Last Edit: August 24, 2009, 01:39:02 pm by score_under »
|
Logged
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #22 Posted on: August 24, 2009, 06:40:11 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Doesn't matter if the spec is human-authored or not. (And for all you know, it isn't. [That was a joke; you don't have to go calling people morons over it]) ENIGMA's API is human-written. GCC's optimizer is human-written. But there are some things that only a human can optimize.
Maybe a parser's not one of them; maybe it is. It doesn't really matter to me; my way will at very, very least keep up. And considering its comparative performance to GM, Which I'm not going to bother quantifying again, I'd say it'll do much more than that anyway.
Either way, if both methods had identical output with identical speed, I would still stick to this one simply because I'm already writing it, and I'm the only one that will ever be reading it. Anyone that thinks they have the incentive can fork the project and write their own parser that does what mine can.
Until then, we're sticking to what I'm writing.
|
|
|
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
|
|
|
RetroX
|
|
Reply #23 Posted on: August 24, 2009, 08:08:22 pm |
|
|
Master of all things Linux
Location: US Joined: Apr 2008
Posts: 1055
|
He said g++ has been around longer and thus has been improved more. That is a valid argument- we don't need to compile anything ourselves. Yacc has been around much longer than Josh, and is a computer program, so it is easier to generate correct parsers with it.
You obviously still don't understand what is going on. All Josh's parser needs to do is make the code readable by a c++ compiler. It doesn't have to actually parse it. All your analogies to florescent lights and lcd screens are completely off. The reason his method is useful is because it's doing something different- it's not doing the same thing in a different way.
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. Essentially, parsing is taking text from one form and putting it to another, better form. Something as simple as BBCode is "parsed". The lightbulb worked for hundreds of years. Because it has worked well for that long, does it mean that it's the best? No. It is impossible to re-invent the wheel. It is one of the most simplistic machines, and now that you know how to make it work, you realize that is the only way to make it work. By making it better, you would simply be modifying the current design and adding on to it. However, a regular light bulb is not the only way to make something work. You can make it differently, even though you know its current design which works so well.
|
|
|
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)Why do all the pro-Microsoft people have troll avatars?
|
|
|
|
|
|
|
|
MrJackSparrow2
|
|
Reply #29 Posted on: August 25, 2009, 10:12:46 pm |
|
|
Joined: Apr 2008
Posts: 35
|
I don't have enough knowledge to fight in this argument, however could we all calm down and stop bitching at each other about what a parser does, and efficiency of methods of parsing. Frankly, I only care to read about what Josh is doing, how things are going, etcetera. I could give a damn about these stupid metaphors, and fighting over things that doesn't help Josh one bit. Can we be less like the GMC, and more of a supportive community? I know it started out in a suggestive supporting tone, but that went to hell pretty fast. Not trying to shove a stick in anybodies ass, but this fighting in every one of Josh's new topics is childish and stupid in my opinion. Don't flame me for this; as the point of this post is to stop the trolling around. Thanks.
|
|
« Last Edit: August 25, 2009, 10:18:55 pm by MrJackSparrow2 »
|
Logged
|
|
|
|
|