4 ms·
TXR Lisp setup is easy. If you have to build from source (not a user of a distro that has packaged it like Guix or Void, then: ./configure && make && sudo ma
by kazinator 6y ago
TXR Lisp setup is easy. If you have to build from source (not a user of a distro that has packaged it like Guix or Void, then:
./configure && make && sudo make install
Then there is a txr executable with some auto-loaded library files in /usr/share, and that's it. The txr executable performs all the sysrooting calculations so you can move an installation of it anywhere, as long as you keep the relative locations of the files the same (the installation tree shape). If you have a tarball of it, it will unpack and run from anywhere.
The documentation is all in a single man page, covering everything.
TXR is designed from the ground up as a system utility integrated well into a POSIX environment.
TXR requires no package management or build system because the load function behaves sanely. If you load a file that is located in path/to/dir, and that file itself does a (load "foo") at its own top level, then that top-level load look for path/to/dir/foo.tlo (compiled file) or path/to/dir/foo.tl (source): i.e relative to the same directory as the parent file that is being load-ed.
There is no need to mess around with irksome path schemes (look for stuff here, look for stuff there, ...). You're in the driver's seat: put the pieces you need where you want, load each of their main files, and that's it.
We can make a package just by putting some files into a directory, and documenting which one is the main one that is to be loaded. That one loads the others using relative paths, and that's that.
A module/program's main file can rebuild itself and the others like this:
(defvarl myfiles '#"main foo bar baz xyzzy") ;; word list lit, same as '("main" "foo" ...)
(each ((f myfiles))
(or (compile-update-file `@f.tl` `@f.tlo`)
(load f))
compile-update-file checks the existence and time stamps, rebuilding the .tlo if it is missing or older than the .tl file. Compilation usually has the same effect as loading, so in that case we don't have to load. If compile-update-file returns nil, then it means it did nothing; we load the existing compiled file then.
> But it is not designed from ground up as one of the language in a system.
I know exactly what you mean there; that is why I designed TXR from the ground up in the form factor of a utility that fits into the surrounding OS environment instead of being a kind of immigrant from a Lisp planet. It's Lisp, for Unix and C people -- with a decent Windows port.
- kazinator 6y agoSpeaking of controlling the terminal, TXR Lisp has a built-in comprehensive wrapper for termios. https://www.nongnu.org/txr/txr-manpage.html#N-0260AE30 https://www.nongnu.org/txr/txr-manpage.html#N-0260AE30 It even supports the coreutils "stty -g" string format for saving and restoring termios settings.