4 ms·
Yup, bash and GNU Make have the same issue as Perl does, and I mention the C++ issue here too: Parsing Bash is Undecidable - https://www.oilshell.org/blog/201
by chubot 2y ago
Yup, bash and GNU Make have the same issue as Perl does, and I mention the C++ issue here too:
Parsing Bash is Undecidable - https://www.oilshell.org/blog/2016/10/20.html https://www.oilshell.org/blog/2016/10/20.html
I remember a talk from Larry Wall on Perl 6 (now Raku), where he says this type of thing is a mistake. Raku can be statically parsed, as far as I know.
- jwilk 2y agoParsing POSIX shell in undecidable too: https://news.ycombinator.com/item?id=30362718 https://news.ycombinator.com/item?id=30362718
- chubot 2y agoYes, good point -- aliases makes parse time depend on runtime. That is mentioned in Morbig: A static parser for POSIX shell - https://scholar.google.com/scholar?cluster=15754961728999604986&hl=en&as_sdt=0,39 https://scholar.google.com/scholar?cluster=15754961728999604... (at the time I wrote the post about bash, I hadn't implemented aliases yet) But it's a little different since it is an intentional feature, not an acccident. It's designed to literally reinvoke the parser at runtime. I think it's not that good/useful a feature, and I tend to avoid it, but many people use it.