←back to thread

105 points faresahmed | 5 comments | | HN request time: 0.939s | source
1. zokier ◴[] No.41852280[source]
Code typography is such a neglected area, I'm glad to see any projects that touch on that. This reminds me of Suns Fortress language, which was designed also for scientific computing (afaik more in HPC sense), and also allowed rendering code into pdf with improved typography. Unfortunately lot of the original Fortress resources have linkrotted away, but there are some examples in this presentation (by Guy Steele!) https://www.cs.tufts.edu/comp/150FP/archive/neal-glew/mcrt/F...
replies(2): >>41853218 #>>41858214 #
2. WillAdams ◴[] No.41853218[source]
Arguably the most successful effort in this space is:

http://literateprogramming.com/

I use it in a current project using LaTeX:

https://github.com/WillAdams/gcodepreview

replies(1): >>41853949 #
3. zokier ◴[] No.41853949[source]
I checked the linked PDF[1] as an example, and the codeblocks are still just basic plain monospaced blocks with practically no typesetting done to them; very different from something like Fortress, or indeed this Forscape

[1] https://github.com/WillAdams/gcodepreview/blob/main/gcodepre...

replies(1): >>41857659 #
4. WillAdams ◴[] No.41857659{3}[source]
Yeah, I've been using the listings package and it doesn't have much support for Python and I had to hack together the settings for OpenSCAD.

If you know of a better LaTeX package to use, or better settings for Python or languages like OpenSCAD I'd be glad of them.

Mostly I need the LP stuff for managing multiple files, and the overview of the PDF and hyperlinked ToC and Index and so forth.

5. versteegen ◴[] No.41858214[source]
Agreed, I've wondered why it's so ignored since I first learnt to program, and relatedly, why are programming languages strictly English-based?

Those slides are my introduction to Fortress. Sounds nice, sorry to hear it's discontinued. I'm struck by how very similar to Julia it is (which is officially inspired by Fortress), for example the focus on performance and maths, zero-cost abstractions, type specialisation, very similar syntax, ASCII<->Unicode equivalence, encouragement of unicode identifiers and operators, and some (small) amount of eliding '*' for multiplication. (You can write "2(a + 1)a^2" but not "(a+1)(a+2)" because the latter is a function call. Whitespace between multiplicands not allowed.)

It seems it would be easy to write a package to display Julia code as HTML or Latex, although I didn't find one. There's already a library to print expressions as Latex, and of course in a Jupyter notebook results are displayed in HTML.