Re: Looking for a fast C++ parser

Scott Nicol <snicol@apk.net>
16 Aug 2005 11:12:45 -0400

          From comp.compilers

Related articles
Designing a language for dataflow/parallelism peteg42@gmail.com (Peter Gammie) (2005-06-26)
Looking for a fast C++ parser nscc@c7.org (2005-08-07)
Re: Looking for a fast C++ parser snicol@apk.net (Scott Nicol) (2005-08-10)
Re: Looking for a fast C++ parser vidar.hokstad@gmail.com (Vidar Hokstad) (2005-08-10)
Re: Looking for a fast C++ parser firefly@diku.dk (Peter \Firefly\Lund) (2005-08-13)
Re: Looking for a fast C++ parser snicol@apk.net (Scott Nicol) (2005-08-16)
Re: Looking for a fast C++ parser Martin.Ward@durham.ac.uk (Martin Ward) (2005-08-16)
Re: Looking for a fast C++ parser firefly@diku.dk (Peter \Firefly\Lund) (2005-08-16)
Re: Looking for a fast C++ parser firefly@diku.dk (Peter \Firefly\Lund) (2005-08-16)
Re: Looking for a fast C++ parser snicol@apk.net (Scott Nicol) (2005-08-16)
Re: Looking for a fast C++ parser firefly@diku.dk (Peter \Firefly\Lund) (2005-08-16)
| List of all articles for this month |

From: Scott Nicol <snicol@apk.net>
Newsgroups: comp.compilers
Date: 16 Aug 2005 11:12:45 -0400
Organization: Compilers Central
References: 05-06-133 05-08-030 05-08-035 05-08-051
Keywords: tools, parse
Cc: compilers@iecc.com
Posted-Date: 16 Aug 2005 11:12:45 EDT

Peter "Firefly" Lund wrote:
> The current fashion in syntax coloring seems to be to use a generic editor
> that attaches font and colour attributes to the text, combined with a
> general regexp engine + a file of regexps per language that is used to
> generate the colour attributes after loading the file into the editor
> widget. This is both slower and more memory-hungry than it really needs to
> be.


As with every design, there are trade-offs. The current fashion adds a
lot of flexibility to support multiple languages, and the ability to add
support new languages without modifying the editor. On the flip side it
wastes a few MHz of your x.y GHz CPU and a couple hundred K out of your
GB of RAM. In 1985, these burdens would be unconsciable. Those few MHz
would be all of your MHz, and a couple hundred K would be all of your
RAM. But this is 2005, and I think the last time I touched a 4.77MHz
computer was around 1989.


I hate gratuitous code bloat as much as any other neanderthal (vi is my
IDE), but there are times when code bloat is not gratuitous.


--
Scott Nicol
snicol@apk.net


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.