News for hackers. Stuff that matters.
Re:KaTeX – The fastest math typesetting library for the web by snicker7 on Sunday October 11, 2020 @03:10AM (#24744228)
JS on server-side can be taxing. If I don't use NodeJS, then I'd have to (1) call it from a script, eating the startup time (2) run a daemon of NodeJS workers running in parallel to my web server or (3) use an "embedded" JS engine, hoping I don't run into compatibility issues. All three options have performance costs + adds more dependencies.

If KaTeX were written in C, for example, it would be no problem FFI'ing it into just about any language. Plus whatever perf benefits there are of not using JS.

Re:KaTeX – The fastest math typesetting library for the web by mbeex on Sunday October 11, 2020 @04:38AM (#24744504)
He wrote "can be generated". You can use KaTeX for setting up complete static web pages with no JS/server-side prozessing at all. Example from my blog:

https://depot.traits.de/pages/2020/02/21-markdown-example.ht...

Re:KaTeX – The fastest math typesetting library for the web by franga2000 on Sunday October 11, 2020 @04:42AM (#24744521)
For the vast majority of use cases, you should probably be pre-generating these anyways, and for the few use cases where content would be constantly changing, client-side rendering makes way more sense.
Re:KaTeX – The fastest math typesetting library for the web by joppy on Sunday October 11, 2020 @06:18AM (#24744822)
The thing specifically with KaTeX is that if you do this, you can blow page sizes out completely. In the example above, less than 20 characters of latex turned into a giant amount of HTML markup. Repeat this in many places for a mathematics-heavy page, and the browser might be better off just running KaTeX itself. Besides, you need to ship a whole bunch of fonts and a stylesheet anyway.
Re:KaTeX – The fastest math typesetting library for the web by mbeex on Sunday October 11, 2020 @10:24AM (#24746007)
KaTeX has an 'output' option and one of his settings is 'mathml'. You can produce clean MathML this way and even mixed HTML/MathML output (default and what you see in the OP's example) with MathML for accessibility. Problem with the pure approach isn't KaTeX but the browser support.
Re:KaTeX – The fastest math typesetting library for the web by franga2000 on Sunday October 11, 2020 @08:14AM (#24745268)
Oh yeah, definitely, I was just responding to the "calling server-side JS" part. Even if the same library was implemented in native code, you still wouldn't want to be calling it inline from a cgi* script.