POV-Ray : Newsgroups : povray.off-topic : Monads in C# : Re: C# monads Server Time
29 Jul 2024 02:24:04 EDT (-0400)
  Re: C# monads  
From: Orchid Win7 v1
Date: 9 Apr 2013 03:47:02
Message: <5163c776$1@news.povray.org>
On 09/04/2013 08:14 AM, scott wrote:
>> For most parsing tasks, speed isn't really an issue. Usually you use
>> parsers to parse human-written text, which is typically small enough
>> that the time spent parsing is negligible compared to the time spent on
>> subsequent processing.
>
> I don't know a great deal about parsers (the most I've done is made one
> to calculate very simple sums, like (5+4)/2) but AIUI things like POV
> first convert the human readable text to binary symbols (removing any
> unnecessary formatting) and then parse the binary symbols rather than
> the raw text.

In other words, "lexing" (AKA "tokenising") followed by "parsing".

> IDK which part typically takes longer (I guess the first
> part as that involves a lot of string searching), but the time POV
> spends "parsing" even a medium-sized scene isn't trivial.

That's because
1) The "parsing" time includes the time taken to expand macros, because 
these work at the token level rather than some higher-level abstraction.
2) The "big" scenes are ones which include huge meshes. These 
machine-generated constructs tend to be quite large.

> Saying that if you're writing something to do single-line equations then
> you probably don't need to worry :-) I thought it would just be an
> interesting real-world example if you've coded the same algorithm in
> both Haskell and C# to see the difference.

Yeah, why not...


Post a reply to this message

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