This is a small
experiment on lex. Lex is
implemented as a built-in function (via syscall 16). The hope is that this will accelerate
the compiler.
lex2.c is written based on token-s.txt (lex in Som). An experimental version is lex0.c. It has a better buffering. However, it is more complex. lex0.c uses
buffering to reduce the number of fread() call. lex2.c reads
one line at a time.
It is quite
interesting to see how the new lex is interfaced to the old token-s.txt in a simple
way.
Note: the interactive mode does not work. Only compile and run is available at
present (due to some bugs in lex on stdin).
compiling som v3.1 (as a benchmark)
noi runtime (ms)
v41
4798780 266
v42
3757236 265
therefore, noi v42/v41 = 0.78, 1-v42/v41 = 0.22 (or
22% faster)
but the actual running time is the same. (running time is measured on Hp n6400, core 2 duo, 2 GHz)
Also this
release celebrate the triple 9, ie. 9 September 2009 or 9/9/2009.
9/9/2009