Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ANN: TXR 192 released.

13 views
Skip to first unread message

Kaz Kylheku

unread,
Apr 19, 2018, 11:42:12 PM4/19/18
to
I'm pleased to announce the 192nd public release of the TXR
language.

Home: <http://www.nongnu.org/txr>.
Git: <http://www.kylheku.com/cgit/txr>.

TXR is comprised of a whole-document pattern matching language ("the
'TXR pattern language' or just 'TXR'") combined with an innovative Lisp
dialect ('TXR Lisp') which is used an extension language within TXR, or
standalone. TXR is loaded with features.

It is completely free, open source software, offered for redistribution
under the 2-Clause BSD license.

Last I posted a Usenet announcement was for TXR 180, in June 2017,
twelve releases ago.

I'm pleased to announce that TXR now has a compiler and virtual
machine for the faster loading and execution of TXR Lisp.
The Lisp library of TXR is fully compiled, including the compiler
itself. (The startup time of TXR is up to four times faster
than before, depending on how much of the library is autoloaded.)

Function objects and expression syntax can be dynamically compiled:

(compile 'foo) ;; compile the intepreted function named foo

(compile x) ;; compile function object in variable x

(compile (lambda (...) ...)) ;; compile anon. function

(compile-toplevel '(expression ...))

Importantly, compilation of files is supported:

(compile-file "foo.tl") ;; produces foo.tlo

The foo.tlo file can then be loaded instead of foo.tl;
no aspect of foo.tl is required by foo.tlo.

Not only providing faster loading and execution, compiled files are completely
"royalty-free" for redistribution and resist reverse engineering.

Example: a file containing this function:

(defun fibonacci (n)
(let ((a 0) (b 1) (c n))
(for ((i 2)) ((<= i n) c) ((inc i))
(set c (+ a b)
a b
b c))))

compiles to this:

(1 0 nil)
((5 5 #b'2100009c03000100 0100010000080000 2000005c00040400 03000304000c0138
010c05380008c230 1e00005c00000400 0100040400100938 0400022401000010
000800001b000048 04000000020c0224 0300000c010c0000 010cc030020cc130
0010012402000010 0e000044020c0010 020c043004000010 0400001004000010
0400001002000224 0000000403000000 02000010'
#(pub:fibonacci) #(sys:rt-defun usr:<= usr:succ usr:+)))

We can load it and disassemble:

1> (load "fib-iter")
nil
2> (disassemble 'fibonacci)
data:
d000: fibonacci
funs:
0: sys:rt-defun
1: <=
2: succ
3: +
code:
0: 9C000021 close t003 1 33 1 1 nil v00000
1: 00010003
2: 00010001
3: 00000800
4: 5C000020 block t004 d000 32
5: 00040400
6: 04030003 frame 3 3
7: 38010C00 movrsi v01000 0
8: 38050C01 movrsi v01001 1
9: 30C20800 movsr v01002 v00000
10: 5C00001E block t004 nil 30
11: 00040000
12: 04040001 frame 4 1
13: 38091000 movrsi v02000 2
14: 24020004 gcall t004 1 v02000 v00000
15: 10000001
16: 00000800
17: 4800001B if t004 27
18: 00000004
19: 24020C02 gcall v01002 3 v01000 v01001
20: 0C000003
21: 00000C01
22: 30C00C01 movsr v01000 v01001
23: 30C10C02 movsr v01001 v01002
24: 24011000 gcall v02000 2 v02000
25: 10000002
26: 4400000E jmp 14
27: 10000C02 end v01002
28: 30040C02 movsr t004 v01002
29: 10000004 end t004
30: 10000004 end t004
31: 10000004 end t004
32: 10000004 end t004
33: 24020002 gcall t002 0 d000 t003
34: 04000000
35: 00000003
36: 10000002 end t002
instruction count:
24
entry point:
3
fibonacci

Cheers ...

--
TXR Programming Lanuage: http://nongnu.org/txr
Music DIY Mailing List: http://www.kylheku.com/diy
ADA MP-1 Mailing List: http://www.kylheku.com/mp1
0 new messages