Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #16323

Re: Scanning

From Richard Heathfield <rjh@cpax.org.uk>
Newsgroups comp.programming
Subject Re: Scanning
Date 2023-01-19 13:56 +0000
Organization Fix this later
Message-ID <tqbi6d$1hm7a$2@dont-email.me> (permalink)
References <Scanning-20230119123241@ram.dialup.fu-berlin.de> <tqbdu1$1hm7a$1@dont-email.me> <scanners-20230119143810@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 19/01/2023 1:38 pm, Stefan Ram wrote:
> Richard Heathfield <rjh@cpax.org.uk> writes:
>> This was a perennial comp.lang.c topic back in the day.
> 
>    But what about writing a scanner in languages with automatic
>    memory management where reading a whole line is very simple
>    and assuming an input language that limits line length to
>    some reasonable value, say, 1,000,000 characters?
> 
>    In such a language, would there still be reasons not to
>    read the whole line into memory, but to read it char-by-char
>    as traditional scanners do?

There are always reasons, and sometimes they conflict.

For example, memory management, which should be done by the 
language because it's too important to be left to the programmer, 
and which should be done by the programmer because it's too 
important to be left to the language.

What are your priorities? Run speed? Speed of development? Code 
re-use? Scalability? Programmer cost? Robustness? Security?

And what are your constraints?

I'm not asking for your answer to these questions. I'm just 
pointing out that the answer to your question will depend at 
least in part on the answers to mine.

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

Back to comp.programming | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: Scanning Richard Heathfield <rjh@cpax.org.uk> - 2023-01-19 12:43 +0000
  Re: Scanning Richard Heathfield <rjh@cpax.org.uk> - 2023-01-19 13:56 +0000
  Re: Scanning V V V V V V V V V V V V V V V V V V <vvvvvvvvaaaaaaaaaaaaaaa@mail.ee> - 2023-01-27 01:46 -0800

csiph-web