#!/usr/bin/java -cp /usr/local/lib/jarc.jar jarc.JarcBut it doesn't work on Linux since the execve() system call only accepts one argument. :-( So I wrote a little C program, which was fun since I haven't written any C in over a decade at least. So now I can do
#!/usr/local/bin/jarcAnd voila! I can write scripts for Linux too. You can read the whopping 26 lines of jarc.c if you are interested in the not so fascinating details. Yeah, it'll probably need to be enhanced so I can pass JVM args also. But I haven't needed that yet, and I'm on a write-it-when-you-need-it regimen.
The other ugly bit is that I actually had to change the Jarc parser. Of course, this is the great thing about writing your own language implementation---you can change whatever you want! Jarc has to ignore the first line of the file. So it treats # in line 1 column 1 as a comment character. Yes, I could have had jarc.c make a temporary file without the first line, but that seems inelegant, though much more general purpose. So this requires the latest Jarc (version 2) which I released last week on Jarc SourceForge download page. Now whatever will I do with it?
5 comments: