Live data from Hacker News

Sile: A Modern Rewrite of TeX

sile-typesetter.org

131–140 of 181 posts

Re: Sile: A Modern Rewrite of TeX

#131
post #108

TeX and Literate Programming (and Lisp) are my fundamental, day-to-day tools. Code it, explain it, generate a Literate PDF containing the code. The programming cycle is simple. Write the code in a latex block. Run make. The makefile extracts the code from the latex, compiles it, runs the test cases (also in the latex), and regenerates the PDF. Code and explanations are always up to date and in sync. I have found no b…

Not really a programmer (sysadmin) but I've tried the literate way with org-mode for my stuff and I use LaTeX for all "pretty docs" needs, however while for document production LaTeX excel literate programming AS A MERE CONCEPT for me does not work that much:

- simple things became uselessly lengthy and prolix

- complex things became too big to be easy read, while the equivalent "pure-code with comments" and a small new developers doc while fail to give an equally deep knowledge of the code base is FAR more quick and easy accessed.

Maybe it's my style, I do not know but while I do not feel LaTeX as painful, since most my docs are of the same kind so a template/class produced once with calm get reused issueless, I can't really digest literate programming...

Re: Sile: A Modern Rewrite of TeX

#132
post #28

Earlier quoted context omitted.

My experience with TeX is a complete opposite. I feel like I can do pretty much anything in plain TeX, with a very good feel of what it is doing in its 'guts'. I wrote parsers in compilers in pure TeX (the latter was admittedly a silly academic exercise). It took a very thorough reading of 'The TeXbook' but after that I am constantly amazed at how deliberate and tasteful Knuth's choices were. TeX is simply ... elegan…

People assume that they know a language because they read a tutorial online once. The TeX Book is a work of art that we should all aspire to when writing software.

An amazing thing about the TeX Book is that due to TeX's stability, it's mostly still current. It was written in a day when the graphical computer was a special thing that required a trip to the lab. So the stuff it has about how to run TeX is dated.

But once you know how to run TeX at your "site" (as they would have called it then) all the stuff on the language (that is, practically the whole book) is still good.

Re: Sile: A Modern Rewrite of TeX

#133
post #108

TeX and Literate Programming (and Lisp) are my fundamental, day-to-day tools. Code it, explain it, generate a Literate PDF containing the code. The programming cycle is simple. Write the code in a latex block. Run make. The makefile extracts the code from the latex, compiles it, runs the test cases (also in the latex), and regenerates the PDF. Code and explanations are always up to date and in sync. I have found no b…

With pluto/jupyter/observable you can make it live.

Re: Sile: A Modern Rewrite of TeX

#134
post #18

Earlier quoted context omitted.

I work with TeX quite a lot and I can't even really understand intuitively the principles of the language design let alone the grammar. Like 15 years later and I'm still copy and pasting spells. I'd love to see an CST of my document and figure out why I'm writing the characters I'm writing!

TikZ is the worst for this. I don't usually have any problem picking up esoteric programming languages, but whatever the hell is going in with TikZ/TeX will be forever beyond my comprehension.

I find TikZ quite amazing. You make a picture by describing a picture. It's completely unlike anything else.

Re: Sile: A Modern Rewrite of TeX

#135
post #54

Earlier quoted context omitted.

TeX is a program for typesetting, and IMO if one is a programmer, it is best used as a target or output format: do all your "document" stuff somewhere else (don't use LaTeX), and use TeX just for typesetting. You can have your document in some parsable format, but not require it of the output .tex file, just as we expect high-level programming-language source code to be parsable but don't really expect to get much ut…

> TeX is a program for typesetting, and IMO if one is a programmer, it is best used as a target or output format That's the only thing I ever found it to be good for. Even then, it's a PITA. The world would not be a poorer place if it disappeared and was replaced something that that separated style definition, markup, and content in a reasonable fashion, and used modern language techniques (just a CFG would be a star…

And Computer Modern Roman is as ugly as fudge.

Re: Sile: A Modern Rewrite of TeX

#136
post #6

I am really desperate for an alternative.

https://github.com/gfngfn/SATySFi

SATySFi (pronounced in the same way as the verb “satisfy” in English) is a new typesetting system equipped with a statically-typed, functional programming language. It consists mainly of two “layers” ― the text layer and the program layer. The former is for writing documents in LaTeX-like syntax. The latter, which has OCaml-like syntax, is for defining functions and commands. SATySFi enables you to write documents markuped with flexible commands of your own making. In addition, its informative type error reporting will be a good help to your writing.

The main problem is that a lot of the documentation is in japanese.

Re: Sile: A Modern Rewrite of TeX

#137
post #127
post #46

Earlier quoted context omitted.

> latest fads Context-free languages are the standard for decades now. They haven't been in the very early days of computing due to a lack of formal education of programmers and because they come with a certain, but tiny, memory requirement. What Knuth did with TeX was a violation of KISS. There's no good reason, but several downsides, to mix markup, code, and interpreter state like this.

I am not sure what you mean by context-free languages because literally none of the modern languages have context-free grammars. This includes HTML and XML although I would not call them programming languages per se. C++ grammar is undecidable. On the other hand, TeX's core typesetting language (i.e. not using its macro facilities) is context-free. Quite trivial in fact. Pascal, which is the language used to build Te…

As someone who is intimidated by the thought of programming TeX, I think the following comment which asserts that it is badly designed seems unlikely to be coming out of nowhere. (MetaFont is apparently better than TeX)

https://tex.stackexchange.com/a/602950

I'll quote the key part here in case that link stops working.

> TeX has two programming systems, the "mouth" (which does macro expansion essentially) and the "stomach" (which typesets and does assignments). They run only loosely synchronised and on-demand.

> For programming purposes, they are a pairing of a blind and a lame system since the "stomach" is not able to make decisions based on the value of variables (conditionals only exist in the "mouth") and the "mouth" is not able to affect the value of variables and other state.

> While eTeX has added a bit of arithmetic facilities that can be operated in the mouth, as originally designed the mouth does not do arithmetic. There is a fishy hack for doing a given run-time specified number of iterations in the mouth that relies on the semantics of \romannumeral which converts, say, 11000 into mmmmmmmmmmm.

> Because of the synchronisation issues of mouth and stomach, there is considerable incentive to get some tasks done mouth-only. Due to the mouth being lame and suffering from dyscalculia, this is somewhat akin to programming a Turing machine in lambda calculus.

> TLDR: the programming paradigm of the TeX language is awful.

Re: Sile: A Modern Rewrite of TeX

#138
post #134
post #18

Earlier quoted context omitted.

TikZ is the worst for this. I don't usually have any problem picking up esoteric programming languages, but whatever the hell is going in with TikZ/TeX will be forever beyond my comprehension.

I find TikZ quite amazing. You make a picture by describing a picture. It's completely unlike anything else.

Oh yes, I find TikZ very useful and it's an amazing piece of engineering. My point is more that I find it very difficult to understand how it works on a deep level.

Re: Sile: A Modern Rewrite of TeX

#139
post #108

TeX and Literate Programming (and Lisp) are my fundamental, day-to-day tools. Code it, explain it, generate a Literate PDF containing the code. The programming cycle is simple. Write the code in a latex block. Run make. The makefile extracts the code from the latex, compiles it, runs the test cases (also in the latex), and regenerates the PDF. Code and explanations are always up to date and in sync. I have found no b…

I'm curious what literate style you use? I have tried getting into the style a few times, but I often find I'm not taking advantage of the full scramble of the code that is often possible.

Re: Sile: A Modern Rewrite of TeX

#140

I always had the hope that Lout[0] would take over LaTeX: very clean & reasonably small implementation, functional programming instead of macros. I guess it's just hard to move against the inertia that (La)TeX carries. [0]: https://en.wikipedia.org/wiki/Lout_(software)

I've had a look at Lout years ago, but I think the development stalled a bit and the source wasn't that inviting for contributors. So the PDF support came (too) late and still isn't feature-complete with the PS output.

I am still fond of the Scribe[1]-like syntax, but then again, I also liked it in Texinfo or Borland Sprint.

[1]: https://en.wikipedia.org/wiki/Scribe_(markup_language)

Post reply on HN