Live data from Hacker News

Rewriting LaTeX in Pure Rust

github.com

41–50 of 148 posts

Re: Rewriting LaTeX in Pure Rust

#41
post #17

Earlier quoted context omitted.

What do you need that isn't there already with TeXLive? I haven't downloaded a package in many years, despite many reinstalls and a lot of varied Latex use.

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?

Re: Rewriting LaTeX in Pure Rust

#42
post #17

Earlier quoted context omitted.

What do you need that isn't there already with TeXLive? I haven't downloaded a package in many years, despite many reinstalls and a lot of varied Latex use.

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 TeXLive itself rather than the distro packages, as you have more control that way. Not only that, you can share everything but binaries between multiple OSes, like Windows and Linux (via WSL).

Re: Rewriting LaTeX in Pure Rust

#43
post #24

Previous discussion: 1 year ago: https://news.ycombinator.com/item?id=21172964 3.5 years ago: https://news.ycombinator.com/item?id=14450448 The project seems pretty active, though, so some of that may now be irrelevant.

Why it may be irrelevant that the project is active? Not sure I understood the point behind your last sentence. Can you explain please?

Probably more outdated than irrelevant.

Re: Rewriting LaTeX in Pure Rust

#44
post #24

Previous discussion: 1 year ago: https://news.ycombinator.com/item?id=21172964 3.5 years ago: https://news.ycombinator.com/item?id=14450448 The project seems pretty active, though, so some of that may now be irrelevant.

Why it may be irrelevant that the project is active? Not sure I understood the point behind your last sentence. Can you explain please?

"That" refers to the previous discussion just mentioned, and "now" confirms it by contrasting with 1 or 3.5 years ago. The point is that it is possible some of the criticisms and problems discussed back then could have been fixed since then (though I don't know, hence "may").

Re: Rewriting LaTeX in Pure Rust

#45
post #6

Why link to a fork instead of the main project? https://github.com/tectonic-typesetting/tectonic

The reason is that the main project is written in C whereas this fork uses Rust instead as explained in https://github.com/tectonic-typesetting/tectonic/issues/459

[deleted]

Re: Rewriting LaTeX in Pure Rust

#46

Earlier quoted context omitted.

how is this widely adopted, think in the scale of Linux or Gimp.

In addition to being useful in its own right, QEMU powers or has powered a number of virtualization projects, including VirtualBox's software-based virtualization, parts of Xen, Android Studio's emulator, …

If this is the best that you can do, the community has bigger issues than I previously thought. The world is not QUEMU, friend. I feel like the reason that the open source community has issues with innovation is that all of the brain power is absorbed by adhering to cultist nonsense, while in reality people are using their brains to solve real issues, build businesses, etc...

Re: Rewriting LaTeX in Pure Rust

#47

Earlier quoted context omitted.

The about summarizes it: > Experimental Oxidization of Tectonic the TeX/LaTeX engine.

...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/

Re: Rewriting LaTeX in Pure Rust

#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 grew from there. While it generally works really well, it's not a solid piece of engineering on which to build the future.

The resulting code doesn't benefit from being Rust, except for the added buzzword-ness. It's simply a translation of the C code, littered with unsafe blocks, as it has not been architected to work with Rust's ownership semantics, borrow checker, etc.

What XeTeX (or LuaTeX, though I don't find the Lua integration important -- but that depends heavily on your use cases) needs is a rewrite that preserves backward compatibility for documents, while re-architecting the engine using a modern language such as Rust. Simply wrapping the 1980s-era code in a "skin" of Rust syntax brings little value.

Re: Rewriting LaTeX in Pure Rust

#49

Really cool to see all those rewrites of existing stuff in Rust. Does anyone know if the Rust community has ever done anything original, though?

> 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.

Re: Rewriting LaTeX in Pure Rust

#50
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 and how modular it is.

Finally, you could try a clean-room rewrite, but that could take years without visible results and is hard to find the motivation for if existing software works ok.

Post reply on HN