[kwlug-disc] Modern way of doing Lex/Yacc

Mikalai Birukou mb at 3nsoft.com
Thu Jun 23 09:40:40 EDT 2022


> Yes there is: Dhall!
>
> https://dhall-lang.org

I see the point.

Programmable part: dhall-s input to json.

Second part: JSON is sanitized on a semantic level instead of 
characters, allowing this operation, forbidding another, etc. This check 
starts on a rich ground of types/structures, enforced by dhall 
beforehand, making this sane to write and to read, as in security audit.

Having only 'in' for repetition removes infinite loop. Which is good. 
Yet, you can have operation that explicitly recurses, 'repeat-self' as 
simpler name (?), to jump out of finite-ness in a controllable way, if 
you really wanted. May be simpler 'schedule-self' will be more 
appropriate in domain with real time (e.g. thermostat over a day).

Articulation into operations and giving only what is allowed is your 
POLA. https://en.wikipedia.org/wiki/Principle_of_least_privilege It 
sounds like deno's embedding of V8 into its rust code uses operations as 
part of creating a sandbox. Let's not forget, sandbox is there mostly to 
keep send away from the rest of the garden. You don't need malice to 
appreciate its usefulness.

> A modern language, designed to handle configuration settings. The
> syntax is easy on the eyes. Bindings for many languages.
>
> -erik
>
> On Tue, Jun 21, 2022 at 11:37 PM William Park via kwlug-disc
> <kwlug-disc at kwlug.org> wrote:
>
> To Computer Science guys,
>
> You come across a situation that calls for little "embedded interpreter"
> solution.
>       - You can use already existing embedded interpreter like Tcl or
> Lua.  But, these bring their own baggages.
>       - Or, you can use Lex/Yacc (or Flex/Bison) solution which you
> studied in school.  For simple situation, this may be the way to go.
>
> But, I'm curious.  Is there something more modern?  Something that
> leverages 40 years of collective experience in software development.
> Something more than "state machine", but less than full "interpreter".





More information about the kwlug-disc mailing list