4 ms·
Does it have a context-free syntax? Because this is basically the only problem with TeX: You cannot parse it.
by choeger 7y ago
Does it have a context-free syntax? Because this is basically the only problem with TeX: You cannot parse it.
- zweep 7y agoWhat does context-free syntax mean? And what does “you cannot parse it” mean? Meaning you can’t stream it, you need the whole file first?
- CJefferson 7y agoTex is like a programming language, you have to "run" the program to generate output, and that execution is tightly tied to producing output on paper pages. This means it is extremely difficult to produce good looking HTML, or accessible output.
- The_Amp_Walrus 7y agoContext free means that the language/program can be described using a "context free grammar": https://en.wikipedia.org/wiki/Context-free_grammar https://en.wikipedia.org/wiki/Context-free_grammar. Context free grammars are more expressive than regular expressions, but less expressive than full-blown programming languages. If you've got a spare 100 or so hours and you're interested in learning more, there's a good lecture series on YouTube about this stuff: https://www.youtube.com/watch?v=TOsMcgIK95k&list=PLbtzT1TYeoMjNOGEiaRmm_vMIwUAidnQz https://www.youtube.com/watch?v=TOsMcgIK95k&list=PLbtzT1TYeo...
- ttul 7y agoIIRC there are DSLs that are context free and which compile down to TeX. I just can’t recall at the moment any.. it’s been years. The layout engine inside TeX is second to none. Why throw out the baby with the bath water?
- choeger 7y agoI never encountered a context-free typesetting language that was as powerful as TeX. I assume it would be quite a lot of rather boring work. The main interesting design question would be how to express content and its relationships in some logical way that is distinctive from the algorithmic layouting.