Worgle is the Web ORg TanGLEr. At the very least, it aims to be able to tangler for literate programs written in a subset of org markup that is compatible with org-babel. This includes noweb style code expansion, a crucial aspect to literate programming (which often seems to be ignored in other non-emacs org-mode tanglers). Eventually, the hope is to introduce more WEB-like syntax and construct a backend for weave (export to HTML, TeX, etc).
The initial motivation for building Worgle is performance. The tangling done by org-babel is embarassingly slow to the point of being useless for any projects larger than a script. Worgle aims to make org-tangle usable for actual software projects.
The larger goal is to build a spirtual successor to CWEB, a program I use on a daily basis to write literate programs in C. It is perhaps one of the best literate programming tools out there. Now over 3 decades old, CWEB is definitely showing signs of old age.
Right now, Worgle has just enough features to be useful.
Pretty much any of the advanced features of org-mode won’t be implemented. Emacs is plenty good at handling that if you need it.
To compile, run make
.
To install, run sudo make install
.
As it turns out, this README is the sample code. Cool, right?
A code block for a simple hello world program in C looks like this:
#include
int main(int argc, char *argv[])
{
<<say_the_worgle_greeting>>
return 0;
}
The code mentioned above has a code block called say_the_worgle_greeting
.
This gets expanded to this code block below:
printf("Orgle Worgle Borgle!n");
The C code is tangled up using the orgle
bootstrapper, which can then
be compiled and run using a C compiler like GCC.
./orgle README.org
gcc hello.c -o hello
./hello
A very casual performance test indicates that Worgle is able to tangle itself faster than Emacs by a factor of 1300x (!). The test is done using the shell script measure_performance.sh.
The results printed below are from a mid-2015 MacBook pro running High Sierra.
Org-babel-tangle (via Emacs): 0m1.318s Worgle: 0m0.001s
This project is placed under the public domain. Happy hacking, humans.