News for hackers. Stuff that matters.
Re:LaTeX3 Automatic Labels for Fun and No Profit by YWall39 on Tuesday March 19, 2024 @10:18AM (#39755971)
> The author is a PhD student that has been using LaTeX heavily for 10 years. But what should a new student use, and why? When the only reason to choose LaTeX is old colleagues and gatekeeping publishers, I know it's a matter of time.

Sadly its more than that. Will we be able to compile a typst file made today in 10 years? I have to do that regularly with latex. Will everybody one collaborates with also use typst? Very unlikely. A new PhD student may find it beneficial to write papers with someone who only uses latex. then why bother with typst? (and I really want typst to win)

Re:LaTeX3 Automatic Labels for Fun and No Profit by LegibleCrimson on Tuesday March 19, 2024 @10:43AM (#39756215)
I regularly can't do that in LaTeX due to changes in packages. Yeah, the core is stable, but dependencies are still an issue in TeX land.
Re:LaTeX3 Automatic Labels for Fun and No Profit by vouaobrasil on Tuesday March 19, 2024 @12:10PM (#39757213)
That's only true if you need a lot of speciality packages. For the vast majority of people using LaTeX, they only need the core packages like the basic features of hyperref, geometry, amsmath, amsthm, and in that case, they are quite stable.

I've never had a problem recompiling documents. Yeah, you might have a problem if you're using LaTeX for a fringe use but most people don't.

Re:LaTeX3 Automatic Labels for Fun and No Profit by kldx on Tuesday March 19, 2024 @10:25AM (#39756040)
Typst is a single file binary. The preview packages are versioned too. If typst breaks the API in ten years, I'd still be able to download the old binary and make a PDF from scratch. I can't begin to imagine the complexity in installing multiple texlive distributions side by side.
Re:LaTeX3 Automatic Labels for Fun and No Profit by YWall39 on Tuesday March 19, 2024 @10:45AM (#39756234)
Yes, but its more complicated. In my case I have slides with a number of include files, some have not changed since 2006 (just checked), one does not want to maintain slides with same ancient version of typst, and then possibly have many floating around.

For me, they need to promise full backwards compatibility.

Re:LaTeX3 Automatic Labels for Fun and No Profit by cbolton on Tuesday March 19, 2024 @11:17AM (#39756634)
That's a valid point: if you don't want a language that makes breaking changes (so you can always compile old files with the latest version), it's not the right time to use typst. It's just moving too fast now. It's currently at version 0.11. Come back when they release 1.0.
Re:LaTeX3 Automatic Labels for Fun and No Profit by chaxor on Tuesday March 19, 2024 @10:49AM (#39756273)
Yeah, this is also not a fair fight.

The "will it work in 10 years?" just swayed _immensely_ in Typst's favor.

Re:LaTeX3 Automatic Labels for Fun and No Profit by crotchfire on Tuesday March 19, 2024 @10:35AM (#39756144)
That old binary won't link with the shared libraries on your machine 10 years from now. Depends on 280 other crates. Ye gads.

"Yeah just use ancient binaries" is not a viable strategy for future-proofing.

It's a lot easier to move fast and break things when you don't care about stability.

Re:LaTeX3 Automatic Labels for Fun and No Profit by cbolton on Tuesday March 19, 2024 @10:38AM (#39756161)

  $ ldd bin/typst
   statically linked
Re:LaTeX3 Automatic Labels for Fun and No Profit by crotchfire on Tuesday March 19, 2024 @10:45AM (#39756229)
You faked this. `ldd` never prints just the text `statically linked` for a statically-linked binary.

Here's the real output.

    $ ldd result/bin/typst
        linux-vdso.so.1 (0x00007ffd2c4e5000)
        libgcc_s.so.1 => /nix/store/28d6zz06v3mpwdbi72fdw64qmmq8rhfm-gcc-13.2.0-lib/lib/libgcc_s.so.1 (0x00007f4fe68b9000)
        libm.so.6 => /nix/store/7x591g0d1kydp4dci0jvksi0qbn013v3-glibc-2.38-27/lib/libm.so.6 (0x00007f4fe67d9000)
        libc.so.6 => /nix/store/7x591g0d1kydp4dci0jvksi0qbn013v3-glibc-2.38-27/lib/libc.so.6 (0x00007f4fe4619000)
        /nix/store/7x591g0d1kydp4dci0jvksi0qbn013v3-glibc-2.38-27/lib/ld-linux-x86-64.so.2 => /nix/store/7v29y7b3b38x2hpgld698fw6k5mffam8-glibc-2.38-44/lib64/ld-linux-x86-64.so.2 (0x00007f4fe68e1000)
You can't have truly statically linked binaries on glibc systems; they ditched support for that over a decade ago. On the 1% of Linux systems using Musl you can produce statically-linked binaries, but `ldd` will report `not a dynamic executable`.

You faked your console output.

Re:LaTeX3 Automatic Labels for Fun and No Profit by cbolton on Tuesday March 19, 2024 @10:49AM (#39756267)
It's not faked. I guess the nix recipe does things differently from the official binary. Try yourself: https://github.com/typst/typst/releases/download/v0.11.0/typ...

But it's true that when I tried ldd on a trivial static binary (compiling "int main() { return 0; }" with "gcc -static a.c") I got a different message: "not a dynamic executable". I don't know why you'd get sometimes one message sometimes the other...

Re:LaTeX3 Automatic Labels for Fun and No Profit by crotchfire on Tuesday March 19, 2024 @10:56AM (#39756363)
Having to use magically-blessed (what you call "official") binaries is not a viable strategy either.
Re:LaTeX3 Automatic Labels for Fun and No Profit by mahkoh on Tuesday March 19, 2024 @11:14AM (#39756586)
If you don't know how to build a statically linked rust binary yourself, then why bother posting about the downsides of dynamic linking?

And obviously you can also link statically against musl on glibc systems. It's just another library.

Re:LaTeX3 Automatic Labels for Fun and No Profit by cbolton on Tuesday March 19, 2024 @11:09AM (#39756527)
Come on, it's a really good strategy if you care about this (use the official binary, or make the effort of making a static binary yourself).

And even your linked binary will probably work in 10 years, these libraries are not likely to break. See for example https://superuser.com/questions/1450027/how-exactly-a-system...

I couldn't say the same thing about the LaTeX binaries:

  $ ldd /usr/bin/pdflatex
 linux-vdso.so.1 (0x00007ffe347f7000)
 libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007e699d5bf000)
 libz.so.1 => /usr/lib/x86_64-linux-gnu/libz.so.1 (0x00007e699d5a3000)
 libkpathsea.so.6 => /usr/lib/x86_64-linux-gnu/libkpathsea.so.6 (0x00007e699d587000)
 libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007e699ce00000)
 libm.so.6 => /usr/lib/x86_64-linux-gnu/libm.so.6 (0x00007e699d4a0000)
 libgcc_s.so.1 => /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007e699d47e000)
 libc.so.6 => /usr/lib/x86_64-linux-gnu/libc.so.6 (0x00007e699ca00000)
 /lib64/ld-linux-x86-64.so.2 (0x00007e699d624000)
libpng, libz, libkpathsea, libstdc++ are much more likely to break than glibc.

  $ ldd /usr/bin/lualatex
 linux-vdso.so.1 (0x00007ffe4f8d6000)
 libtexlua53.so.5 => /usr/lib/x86_64-linux-gnu/libtexlua53.so.5 (0x00007eccb87c1000)
 libzzip-0.so.13 => /usr/lib/x86_64-linux-gnu/libzzip-0.so.13 (0x00007eccb9392000)
 libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007eccb8786000)
 libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007eccb86b7000)
 libz.so.1 => /usr/lib/x86_64-linux-gnu/libz.so.1 (0x00007eccb9376000)
 libkpathsea.so.6 => /usr/lib/x86_64-linux-gnu/libkpathsea.so.6 (0x00007eccb8699000)
 libm.so.6 => /usr/lib/x86_64-linux-gnu/libm.so.6 (0x00007eccb85b2000)
 libgcc_s.so.1 => /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007eccb8592000)
 libc.so.6 => /usr/lib/x86_64-linux-gnu/libc.so.6 (0x00007eccb8200000)
 libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007eccb8458000)
 libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007eccb8138000)
 libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007eccb842f000)
 /lib64/ld-linux-x86-64.so.2 (0x00007eccb93c5000)
 libpcre.so.3 => /usr/lib/x86_64-linux-gnu/libpcre.so.3 (0x00007eccb80c2000)
 libbrotlidec.so.1 => /usr/lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007eccb80b4000)
 libbrotlicommon.so.1 => /usr/lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007eccb8091000)
no comment

PS: you could edit your previous comment and/or apologize for accusing me twice of forgery.

Re:LaTeX3 Automatic Labels for Fun and No Profit by cbolton on Tuesday March 19, 2024 @10:34AM (#39756127)
> Will we be able to compile a typst file made today in 10 years?

Yes! typst is actually better than LaTeX in this regard:

LaTeX: contrary to how it sells itself, it's not good at compiling old files. The TeX core is fine but the packaging story is awful. Once I found a beamer presentation about LaTeX itself, including of course some slides about the amazing backward compatibility. Well, the slides failed to compile in multiple places due to the fancy packages used by the author, which had made breaking changes between whatever they were using and my own TeX Live installation. And using an older version of TeX Live is not trivial. Another example: a few weeks ago a colleague found himself unable to compile a document that worked before the system (Linux distribution) update. It took us two hours to figure out that one of the LaTeX packages had made a change which made it incompatible with another package unless you switch the order of \usepackage. Fun!

typst: it's a single binary, statically linked. That's it! If you care about this, you can literally commit this one file (30MB or so) in your repository and it will run flawlessly in 10 years. The packaging system is very recent and still a preview, but it's already better than LaTeX since packages are imported by specific versions. And if you're worried that the typst package server will go down it's easy to mirror it locally.

> Will everybody one collaborates with also use typst? Very unlikely. A new PhD student may find it beneficial to write papers with someone who only uses latex.

That's the reason I mention. If it's the only reason left for learning LaTeX, good luck LaTeX. Very soon it will be "Will everybody one collaborates with also use LaTeX? Very unlikely".

Re:LaTeX3 Automatic Labels for Fun and No Profit by YWall39 on Tuesday March 19, 2024 @10:47AM (#39756258)
> LaTeX: contrary to how it sells itself, it's not good at compiling old files.

yes and no, that bit me last week, some packages decided to become incompatible. but in my case 99% of old files compile fine today.

Re:LaTeX3 Automatic Labels for Fun and No Profit by mmplxx on Tuesday March 19, 2024 @03:09PM (#39759168)
A legitimate concern given that Typst is still maturing. But I have at least one thing to say in its favour: you can lock the version of packages that you import. The only reason LaTeX documents full of \usepackages are reproducible ten years later is because packages are in maintenance mode, not because of well-thought-out future-proof design.