crlf0710 / tectonic

Experimental Oxidization of Tectonic the TeX/LaTeX engine.
https://tectonic-typesetting.github.io/
Other
285 stars 14 forks source link

Consider the possibility to share some code with texlab #187

Open XVilka opened 5 years ago

XVilka commented 5 years ago

TexLab it the LSP implementation for TeX/LaTeX, so some kind of integration and code sharing (not sure about this point, but you might know better) is probably possible.

image

cormacrelf commented 5 years ago

I'm not sure that's really feasible. I'm very slowly becoming familiar, but my impression is XeTeX doesn't work like a familiar code compiler. It doesn't have distinct parsing and IR/optimising stages; I think the engine reads a token and processes it immediately. (Or at least it only tokenizes and then executes token streams, not any higher level structure.) So if you wanted the reusability of e.g. the syn crate for Rust code, then no dice. If you wanted to know whether commands are defined or not and what arguments they accept, then not really no, that's a highly dynamic concept that changes from line to line. The engine does virtually no static analysis, so there is no static analysis we can carve out and make reusable. You can feel this is intuitively true because all the TeX errors you ever get are 'bailing out midway because this input does not make sense given what I've already processed', with debug dumps of varying degrees of effort trying to map the current engine state back to what you typed.