4 ms·
> I work through SICP these days in an org babel document Would you mind sharing a bit more on your workflow? I am personally going through Crafting Interprete
by mynameismon 5y ago
> I work through SICP these days in an org babel document
Would you mind sharing a bit more on your workflow? I am personally going through Crafting Interpreters myself, and I am struggling to organise my code and notes, since I am unable to get org-babel to work like in separate files, and build in one go.
- Jtsummers 5y agoNot GP, but I've done this before. I don't have access to it at the moment, but I wrote a small shell script that invoked emacs (without running init.el/.emacs) and ran org tangle on a file. I incorporated that into a Makefile so it ran on every org file. I placed my org files in the same places (in the file system) as normal source files and had a 1-to-1 mapping of org files to <target language> files (C, Java, Lisp, Go, doesn't matter, done it all). 1-to-1 isn't necessary, I've also done one mega-file that tangled into many source files, including into subdirectories. After tangling, you can trigger any particular build system commands needed (like in rust, run `cargo build` or `cargo run`). Another thing I've done for smaller things is something like: #+BEGIN_SOURCE language :tangle foo.language ... #+END_SOURCE #+BEGIN_SOURCE sh build command foo.language ./foo #+END_SOURCE Run C-v-t (to tangle the source file(s)) and then navigate to that last block and use C-c C-c to execute it, which will execute the language specific build commands and then run the executable (adjust to particular circumstances). You can also have many of those shell blocks to run different things or in different ways (one to build a release version, another to build a debug version, another to run all the tests, etc.).
- mynameismon 5y agoAh, that actually seems extremely interesting. Thanks for clearing the multifile bit of it!