5 ms·
I got as far as trying to build and run it, but bugged out, thusly: $ ./one-page-j warning: this program uses gets(), which is unsafe. Segmentatio
by mmjaa 9y ago
I got as far as trying to build and run it, but bugged out, thusly:
$ ./one-page-j
warning: this program uses gets(), which is unsafe.
Segmentation fault: 11
Ah well, its still cute to try to read and understand ..
- jpfr 9y agoThe code was written on paper. Without the usual compile/debug cycles during development. The amazing part is how little cleanup work is required to make the code work. It's an entire programming language after all!
- kuroguro 9y agoI got it to compile but what is it even supposed to do?
- klibertp 9y agoShould start a REPL. The `main` function looks like this: main(){ C s[99]; while(gets(s)) pr(ex(wd(s))); } which is a very direct expression of read-execute-print-loop.
- icen 9y agoIt's a tiny interpreter. You can create vectors, add them, concatenate them, store them to variables, count their lengths, and so on. An example session: x=~5 5 0 1 2 3 4 y=x,x 10 0 1 2 3 4 0 1 2 3 4 x+y 10 0 2 4 6 8 0 1 2 3 4 To understand the source, the key are the arrays `C vt[]`, `A(vd[])()`, and `A(vm[])()`, which maps the verb token to the dyads and monads respectively. `V1` functions are monads, `V2` are dyads.
- ksherlock 9y agoIt's not 64-bit clean. If you compile it as 32-bit it will run.