Re: Lisp syntax, A simpler way to tokenize and parse?

Lieven Marchand <mal@wyrd.be>
Mon, 27 Mar 2023 23:15:02 +0200

          From comp.compilers

Related articles
A simpler way to tokenize and parse? costello@mitre.org (Roger L Costello) (2023-03-24)
Re: A simpler way to tokenize and parse? mal@wyrd.be (Lieven Marchand) (2023-03-25)
Re: A simpler way to tokenize and parse? 864-117-4973@kylheku.com (Kaz Kylheku) (2023-03-26)
Re: Lisp syntax, A simpler way to tokenize and parse? mal@wyrd.be (Lieven Marchand) (2023-03-27)
| List of all articles for this month |

From: Lieven Marchand <mal@wyrd.be>
Newsgroups: comp.compilers
Date: Mon, 27 Mar 2023 23:15:02 +0200
Organization: Compilers Central
References: 23-03-011 23-03-019 23-03-026
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="9504"; mail-complaints-to="abuse@iecc.com"
Keywords: Lisp, syntax
Posted-Date: 27 Mar 2023 19:43:17 EDT

Kaz Kylheku <864-117-4973@kylheku.com> writes:


> Not every Lisp dialect has hash-dot read-time evaluation; that's
> a feature of Common Lisp, disabled by setting/binding *read-eval*
> to nil. I don't seem to recall that Scheme has it. I deliberately
> kept it out of TXR Lisp.


You also should wrap a use of read in a with-standard-io-syntax and even
then there can still be surprises in CL. One implementation I used by
default still also had the #, that has disappeared from the CLtL2 era of
the standard.


>> A good rule of thumb for production ready software is to define
>> a grammar for valid input and provide a validating parser.
>
> Sure, if you want to waste your time defining grammars and
> writing validating parsers.
>
> This is no longer done that much outside of the Lisp world. People use XML,
> JSON, Yaml, ..., whose grammar they definitely didn't design or
> implement, and validate the content/shape of the object that comes out.


The Haskell and the Rust world have partially gone to applicative and
monadic parsing. In such a paradigm it's not that hard to write
grammars.


--
Laat hulle almal sterf. Ek is tevrede om die wêreld te sien brand en die vallende
konings te spot. Ek en my aasdier sal loop op die as van die verwoeste aarde.


Post a followup to this message

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