Re:Compiler Construction by Niklaus Wirth [pdf]
by hasbot on Friday January 31, 2020 @05:36PM
(#22206631)
I got that impression from this sentence of yours:
> These tools are a great example of over-complicating and over-theorising programming languages.
If programming languages are over-complicated, it's not the fault of these tools.
> So why are we trying to use context-free tools?
I no longer keep up with compilers (or languages), but when I was, there was no other tools. Either go through the tedium and effort of hand-rolling a lexer/parser or munge the language grammar to fit.
Re:Compiler Construction by Niklaus Wirth [pdf]
by chrisseaton on Friday January 31, 2020 @05:39PM
(#22206653)
I see why you'd think that, but I meant over-complicating the implementation of languages, not their design.
> there was no other tools
I don't think you need tools. Just write your parser as a normal program directly in a general-purpose programming language. I'm not sure that parsing is so special as to require an external DSL.
I'm really not sure where you got the impression I was blaming Yacc or Lex for the complexity of the languages - I think you've imagined that.
The situation we're in in practice is that our language grammars are complex and are context-sensitive. So why are we trying to use context-free tools? It's madness - we're trying to hammer a nail using a screwdriver.