Preferences

Literate programming is an intriguing concept, but its hard to compete with modern IDEs. Having build system is good, but can you get proper syntax highlight for the code segments? Or goto-symbol, real-time typechecking?

I feel like it needs its own IDE, because now apart from the coding abstractions you also have named snippets.


codebje
I write a bit of literate Haskell, sometimes. It's one of the most well supported literate programming systems out there: the compiler supports it, the language server supports it, using VSCode as an "IDE" means full support for all the things you mentioned. Haskell code formatters don't seem to support literate Haskell, though, and GitHub Copilot, at least, gets confused between prose and code (but that's fine, if I'm taking the time to make my code extra readable and understandable the last thing I want is for an AI to get involved).

Maybe a tool like the one presented here could work as a language server proxy to the underlying language's server. The presence of literate text alone doesn't seem to be the main issue, it's getting the code portions parsed, checked, and annotated with references that matters.

WillAdams
This is why I use LuaLaTeX for this:

https://github.com/WillAdams/gcodepreview/blob/main/literati...

which allows me to have an ordinary .tex file:

https://github.com/WillAdams/gcodepreview/blob/main/gcodepre...

which outputs multiple .py and .scad files and generates a .pdf with nice listings-based code blocks, ToC, index, hyperlinks, &c.:

https://github.com/WillAdams/gcodepreview/blob/main/gcodepre...

The notable downsides are that the .sty and .tex files have to be customized for the filenames which one can output, and I haven't been able to get auto-line numbering working between code blocks, so one has to manually manage the counters.

hongbo_zhang
Yes, I think this is the missing part. You may have a look at MoonBit(https://www.moonbitlang.com/blog/moonbit-markdown) which has the full IDE support in the markdown editing
corysama
Code-as-a-Database is something lots of people would like to have, but not much effort has been put into implementation since... Smalltalk? Could still be a pile of loose text files with markup. Like how https://obsidian.md/ is an informal graph database of loose markdown files.
ModernMech
There's an active research community based around this very idea: https://liveprog.org, also https://www.hytradboi.com
> Code-as-a-Database is something lots of people would like to have, but not much effort has been put into implementation since... Smalltalk?

It happens in some forms of Bank Python, but there's not much of it going on in the public/open-source world. I think because the advantages for a lone developer are small, and it's hard to maintain for an internet-based project since globally distributed databases are still expensive, bad, or both.

taeric
I mean... somewhat yes to all of those? Emacs can even do most of what you are asking for. When I export an org buffer, it even has the syntax highlighting in the html that I was looking at. :D

Obviously, the type checking will be a bit more limited for code snippets you haven't finished. But especially for image based environments, it should have everything that you have in the image just fine.

CWEB, which is the one that Knuth prefers, even supports step debugging. Has supported it for decades, at this point.

This item has no comments currently.