News for hackers. Stuff that matters.
Re:Run programs in Emacs buffer, seeing their output inline,... by merlincorey on Monday September 26, 2022 @01:05AM (#32979630)
`org-mode` has the ability to evaluate code blocks and store the output in a following results block[0].

You can configure it to run just about everything in various ways and therefore you can do Literate Programming in nearly the full Knuth sense in it.

I find it's a good solution for a local "notebook" similar to IPython/Jupyter Notebooks but for any language in Emacs.

[0] https://orgmode.org/manual/Evaluating-Code-Blocks.html

Re:Run programs in Emacs buffer, seeing their output inline,... by xenodium on Monday September 26, 2022 @03:20AM (#32980362)
Extending org babel to support other languages is fairly accessible. I had a lot of fun getting SwiftUI to rendering inline https://xenodium.com/previewing-swiftui-layouts-in-emacs-rev...

Also did a little experiment for Objective-C https://xenodium.com/org-babel-objective-c-support

Re:Run programs in Emacs buffer, seeing their output inline,... by ghosty141 on Monday September 26, 2022 @05:10AM (#32980957)
The first link is really impressive. Amazing what can be achieved with so little code/configuration.
Re:Run programs in Emacs buffer, seeing their output inline,... by aesyondu on Monday September 26, 2022 @02:14AM (#32980006)
Org+babel is probably my favorite thing about emacs, magit being a close second.

I tried doing Literate Programming using this blog as my guide http://fgiasson.com/blog/index.php/2016/06/21/optimal-emacs-..., but I got burned out pretty quickly. I think my problem was I put literally everything in a single README.org file, and it was so taxing scrolling up and down. I might try again but with multiple org files.