Live data from Hacker News

Rewriting LaTeX in Pure Rust

github.com

51–60 of 148 posts

Re: Rewriting LaTeX in Pure Rust

#51

Earlier quoted context omitted.

> Does anyone know if the Rust community has ever done anything original, though? Depends on what you call "original". Is the Servo layout engine _not_ original because layout engines already exist? :) Moving away from the rhetorical question, I think there are several reasons to rewrite something in Rust, the first and foremost being the huge improvement in memory safety/management. The other reasons are typically r…

Rust seems to be a lot safer than C or C++ but I don't really understand why a documentation system must be written in a low level language. Why not use C#, Java, Go or something similar? Most users can't really need extreme performance.

I'm quite sure anybody who has written substantial documents with *TeX disagrees that "extreme performance" isn't needed.

Re: Rewriting LaTeX in Pure Rust

#52
post #48

Personally, I think this approach -- which as far as the engine is concerned looks like a largely-automated "translation" of xetex from C/C++ to Rust -- is misguided. The xetex code is a byzantine tangle of disparate pieces that evolved over the course of a number of years and several changes of direction; it originally started as a personal tool to address one individual's use case for a "Unicode-capable TeX", and g…

The advantage of this approach (as opposed to a rewrite), is that you reproduce all the bugs and misfeatures that people in the wild depend on. You can then add a test suite and start refactoring and gradually move to a codebase you're happy with, while breaking few or no users on the way. Another approach is to split it into blocks and replace parts of the system, but whether that is feasible depends on the software…

But the advantage of avoiding C specific bugs is shallow, because the Rust code contains lots of unsafe blocks. Bugfixes made to the original source are not automatically ported to the Rust code base.

From my point of view the chosen porting "strategy" doesn't make much sense. It is more of a toy project to see what's possible.

What would really make sense would be starting with an extensive test suite and trying to build a properly architected Rust implementation according to it.

Re: Rewriting LaTeX in Pure Rust

#53

Earlier quoted context omitted.

You are not having any issues because TeXLive is everything. The `full` scheme on `install-sh` or `texlive-full` on Debian takes up around 7 GB last time I looked, 2 to 3 of which are PDFs for package documentation. That is, by a long shot, the largest install a lot of people have on their system. Nowadays, no biggie, but systems like Miktex allow to install-on-demand and of course, it allows you to shrink your insta…

You don't play very many new games do you?

Being on HN and talking about TeXLive, I was thinking in terms of Linux, for which those 90GB blockbuster games don't exist (?). So I did a mental jump there, because to me TeXLive is the "native" Linux TeX distribution, and Miktex the "native" Windows distribution.

Re: Rewriting LaTeX in Pure Rust

#54

Earlier quoted context omitted.

...but it's forked from an existing Rust port of Latex. That's the bit that intrigues me; what is the difference between this port and the original?

If seems to me that upstream is C. https://github.com/tectonic-typesetting/tectonic/

O'rly?

https://github.com/tectonic-typesetting/tectonic/blob/master...

Re: Rewriting LaTeX in Pure Rust

#55

This looks amazing and like everything I always wanted. Sadly, I think basing off XeTeX and not LuaTeX is a mistake. Certainly renders it unusable for me. Having Lua integration is just great. Also, `lualatex` does not have some of the limitations of `xelatex` (memory limitations, `contours` package, ...), but I guess this XeTeX reimplementation can work on removing those implementations, so that only lack of Lua int…

> Also, `lualatex` does not have some of the limitations of `xelatex` (memory limitations, `contours` package, ...)

Are there some more details of the memory limitations you can share with us?

Re: Rewriting LaTeX in Pure Rust

#56
post #52

Earlier quoted context omitted.

The advantage of this approach (as opposed to a rewrite), is that you reproduce all the bugs and misfeatures that people in the wild depend on. You can then add a test suite and start refactoring and gradually move to a codebase you're happy with, while breaking few or no users on the way. Another approach is to split it into blocks and replace parts of the system, but whether that is feasible depends on the software…

But the advantage of avoiding C specific bugs is shallow, because the Rust code contains lots of unsafe blocks. Bugfixes made to the original source are not automatically ported to the Rust code base. From my point of view the chosen porting "strategy" doesn't make much sense. It is more of a toy project to see what's possible. What would really make sense would be starting with an extensive test suite and trying to…

The unsafe blocks can be removed one by one as time goes on. It's no different to any other legacy refactoring project: get the old code on a new platform, instrument/add unit tests, refactor piece by piece until the end result is acceptable.

Re: Rewriting LaTeX in Pure Rust

#57
post #42

Earlier quoted context omitted.

You are not having any issues because TeXLive is everything. The `full` scheme on `install-sh` or `texlive-full` on Debian takes up around 7 GB last time I looked, 2 to 3 of which are PDFs for package documentation. That is, by a long shot, the largest install a lot of people have on their system. Nowadays, no biggie, but systems like Miktex allow to install-on-demand and of course, it allows you to shrink your insta…

You don't need to install the bits you don't want though, like languages you don't know, documentation (online is easier), music, and humanities. My installs are a bit over 2GB, which seems comparable to a minimal Android Studio install (and a maximal TeXLive install is much less than a large Android development install, if I'm reading things right), and full TeXLive is less than full Qt. I use the installer from TeX…

That means spending time to figure out what you don't need. It's far better to just spend those extra 5 gigs than waste time on this.

Re: Rewriting LaTeX in Pure Rust

#58
post #48

Personally, I think this approach -- which as far as the engine is concerned looks like a largely-automated "translation" of xetex from C/C++ to Rust -- is misguided. The xetex code is a byzantine tangle of disparate pieces that evolved over the course of a number of years and several changes of direction; it originally started as a personal tool to address one individual's use case for a "Unicode-capable TeX", and g…

[deleted]

Re: Rewriting LaTeX in Pure Rust

#59

I think that Rust is a perfect open source language. For the longest time the open source community has shown that it has an issue with innovation, however is great at recreating existing ideas and products. I think that this strength can be combined somehow with the "rewrite in Rust" strength and get great synergy.

OTOH, there's the hypothesis that people who're in it primarily to advance their programming language or other tool are bound to never advance the state of the art, or create something original really. I think this phenomenon is cast well in terms of Keirsey temperaments [1] used to this date by partnership agencies. In particular, the different characterization of The Engineer vs The Operator (or The Architect and the Artisan) comes to mind.

There are obviously other psychological and sociological phenomenae associated with adolescence, such as peer group pressure [2] and self-righteousness [3], at play as well.

It's nothing new; the "100% Pure Rust" rhetoric is strikingly similar to 90s/00s Java developer attitudes.

[1]: https://en.m.wikipedia.org/wiki/Keirsey_Temperament_Sorter

[2]: https://en.m.wikipedia.org/wiki/Peer_pressure

[3]: https://en.m.wikipedia.org/wiki/Self-righteousness

Re: Rewriting LaTeX in Pure Rust

#60

This is great. After all these years the venerable and super useful TeX/LaTeX meme has once again managed to propagate into a new and exiting ecosystem. This would be good for the insufferable Rust community as well, I hope. Perhaps as the language they invested their identity in, actually becomes useful and venerated, they will calm the fuck down and start becoming adult members of the useful tool community. Nice on…

[deleted]
Post reply on HN