3 ms·
I've been making a language called TXR for ... oh, ten years this coming August now. It combines a Lisp dialect ("TXR Lisp") with a whole-document pattern-based
by kazinator 7y ago
I've been making a language called TXR for ... oh, ten years this coming August now. It combines a Lisp dialect ("TXR Lisp") with a whole-document pattern-based extraction language ("TXR Pattern Language"). It takes the form of a simple executable with a few satellite files in your /usr/share.
Lots of "batteries" are included in TXR Lisp: object system with static and instance slots, single inheritance, GC finalization and a form of RAII, exception handling, delimited continuations, byte code compiler for virtual machine, file compilation, macros (of course), regexes, built-in lazy lists, a fantastic set of macros for partial application, a comprehensive declarative FFI, good amount of POSIX wrapage built-in, a decent REPL with history, completion, multi-line editing, visual copy-paste, ...
TXR Lisp has a concept similar to CL's "generalized places" implemented differently. It supports Lisp-1-style evaluation (higher order functions used without a funcall operator), in the middle of a Lisp-2 substrate. Traditional list operations are generalized so they work on other sequences; you can mapcar over a string and such.
Link: https://nongnu.org/txr https://nongnu.org/txr
- GordonS 7y agoYou didn't include any links - is it public?
- deleted 7y ago[deleted]
- 6thaccount2 7y agoFirst of all, thanks for doing this and making it free. I do a lot of shell based work (Linux commands, Awk, Python, Perl, and Powershell) and Lisp has always interested me, so this may scratch an itch. How easy is this to get setup? Just a few binaries? Also, one barrier to me has always been learning lisp as it is very different from most traditional scripting languages. I took a look at your examples and it looks neat, but a little complex. Is there a tutorial document that goes over the main functionality and commands. Like with Linux, knowing grep,cut, sort, uniq, cat, and a few others can take you a long way. I should add that although I haven't coded enough lisp to get competent, I've read two books on Common Lisp and have played with Chez Scheme, Racket, and Clojure...so I get the concepts with CONS/CAR/CDR...macros...etc.
- kazinator 7y ago> How easy is this to get setup? Just a few binaries? From sources, just unpack, ./configure (with --prefix=/your/dest/dir if you don't want it in /usr/local/bin), make, make tests, make install if you're going from source. The dependencies are very low. But one of them is libffi; ./configure doesn't complain about it missing, but you get a build with reduced functionality (which doesn't pass certain tests). For every release I make tarball packages for for older Debian 5.x (64 bit), Ubuntu 12 (32 bit), Mac OS 10.7.4 (64) and Solaris 10 (x86, 32 bit) as well as Cygwin (32 and 64). For native Windows, I make a installer. It registers TXR into your PATH environment variable and associates .txr and .tl file associations. TXR installations are relocatable: TXR discovers its own path and then finds the satellite files relative to its own location; if you keep the relative locations of the pieces as they are, you can move it anywhere in your filesystem. That's also useful for deployment. In the TXR executable there is a 128 byte space where you can embed command-line arguments to the executable. There is a helper function for this called save-exe. https://www.nongnu.org/txr/txr-manpage.html#N-02850687 https://www.nongnu.org/txr/txr-manpage.html#N-02850687 If you've read books on Common Lisp, you're in pretty good stead. My own Lisp background is heavily Common Lisp, and the CL influences in TXR Lisp are clear; yet it's not CL and will probably mess with your head if you know a bit of CL in ways that it wouldn't if you didn't know CL. The reference manual has some dialect notes in relation to CL, far and few between though. I don't have a newbie tutorial, unfortunately; I'm hoping someone else will write that. Keeping the documentation complete and at a good level of quality has been a big effort; it's pushing close to 700 pages now if PDF-ed.
- 6thaccount2 7y agoThanks for the lengthy reply. I'll have to give it a try at some point. Even as a current non user I'm always super stoked by the large effort put into these projects and wish you the best!
- selestify 7y agoHow does it feel to have worked on a project like this for an entire decade? Are you satisfied with its progress?
- kazinator 7y agoI'm quite satisfied with it. I put time into it that I was able, and no more than that; and for that time put into it, it is good. I have a private TODO list, in point form, that is over 1300 lines long, so there is no shortage of stuff to do. There was never supposed to be Lisp dialect, object system, FFI, or any of those things; it really was just a specialized text extraction tool. A decade and 5200 commits later, it's interesting that I'm the only contributor (of any logic). There have only been doc fixes. I also didn't think that a decade later, there would be more than 5200 commits, almost all of them from only me. There have been only some half dozen contributions from outsiders: most of them documentation issues, and something in the configure script. Third party code I've brought in, of which there isn't much, I took over as if they were my own. I've kind of gotten used to it being that way; if that ever changes, it will be big adjustment from "everything here is mine".
- selestify 7y agoFascinating, I'm glad it's worked out well! > I also didn't think that a decade later, there would be more than 5200 commits Did you originally not plan on working on it for quite so long?