JeffBezanson
6ec69f5375
optimizations to map and case
...
several optimizations to the compiler itself, mostly involving
emit and encode-byte-code
experimental, very basic profiling utility
2009-06-11 00:34:50 +00:00
JeffBezanson
943c0d71d1
tiny performance tweaks: removing some variables, making some static
2009-06-09 18:46:02 +00:00
JeffBezanson
27a3e413d3
adding opcodes loada0, loada1, loadc00, loadc01
...
adding offset and count arguments to dump
2009-06-08 03:22:32 +00:00
JeffBezanson
17752decf4
implementing support for lambdas with up to 2^32-1 required arguments
...
using copy-list to implement append2
fixing bug in op_vargc when nrequired==MAX_ARGS
making fetching of multibyte numbers from bytecode portable
some cleanup in compiler
2009-06-06 21:15:54 +00:00
JeffBezanson
7e59898778
updating doc
2009-05-31 22:27:37 +00:00
JeffBezanson
91a6ae6490
adding string.width
2009-05-31 22:09:26 +00:00
JeffBezanson
7c48f6ae53
some renaming and reorganizing
...
using more scheme-like names append! and reverse!
2009-05-31 21:06:04 +00:00
JeffBezanson
ba32e4b0e9
simplifying the whole list* situation, taking better advantage of
...
existing builtin functionality
2009-05-31 18:58:09 +00:00
JeffBezanson
7e65db3e74
faster append
...
removing 'equal' alias
removing some top level bindings
2009-05-30 21:13:13 +00:00
JeffBezanson
bbcc68cfdf
making copy-list a builtin, since the functionality was there anyway.
...
adding builtin primitive apply-nlist*, to speed up list* and nlist*
2009-05-30 17:54:27 +00:00
JeffBezanson
a23bee041f
fixing bug in cond when condition wasn't followed by any forms
...
fixing typo in cps.lsp
optimizing constant conditions in if
2009-05-30 17:04:34 +00:00
JeffBezanson
e2c1d2ae9e
some cleanup
2009-05-30 02:52:22 +00:00
JeffBezanson
c42ee12d4c
allowing multiple expressions in lambda
...
making cond a macro
increasing size limit for cvalues on the managed heap, and inline
allocated hashtables
2009-05-29 04:38:50 +00:00
JeffBezanson
1ee81e2625
fixing bug printing functions involved in cycles
2009-05-21 00:56:25 +00:00
JeffBezanson
99c17feac1
made cons hashing tail recursive on cdrs
...
plus one more test
2009-05-20 18:52:09 +00:00
JeffBezanson
ff650e3049
fixing hash function to do a better job on long lists.
2009-05-20 04:30:00 +00:00
JeffBezanson
bfbbf051c9
doing a better job hashing circular structure. the hash function is now
...
always fast and gives conservative correct answers, at the expense of
fidelity on medium and large size structures. for example (hash (iota 15))
gives the same result as (hash (iota 14)).
2009-05-20 03:39:20 +00:00
JeffBezanson
c2026ba77c
adding gc handles, making evaluator stack static
...
this provides a better interface and could only help performance
starting to add some useful library code
2009-05-19 02:54:56 +00:00
JeffBezanson
c38c47d264
adding R6RS div, mod, div0, mod0
...
small improvement to cmp_eq
explicit -fomit-frame-pointer was causing test failures with gcc4.3.2
2009-05-14 17:54:59 +00:00
JeffBezanson
e365cb1d33
adding divide by 0 check in div
2009-05-14 02:53:04 +00:00
JeffBezanson
ae2a4dd156
adding integer division function div
...
changing / to do real division always
fixing equal? to distinguish -0.0 and 0.0
making equal? and eqv? false on numbers of different exactness
2009-05-14 01:30:25 +00:00
JeffBezanson
6c549f0399
fixing hash of circular structure to avoid tree recursion (very important!!)
...
simplifying vector_grow
2009-05-13 04:03:13 +00:00
JeffBezanson
77e37368c9
fixing trace and untrace
...
replacing function->vector with function:code, function:vals, and
function:env
2009-05-13 01:13:40 +00:00
JeffBezanson
a7a31cf53a
fixing vararg apply to work properly
2009-05-11 23:55:40 +00:00
JeffBezanson
afa77a8c5f
adding array?
...
adding vararg apply
2009-05-08 04:08:31 +00:00
JeffBezanson
af72c4f5bd
putting the saved environment in the order that matches the current
...
boot file
2009-05-08 03:00:40 +00:00
JeffBezanson
2c212fbcf7
adding random function
...
fixing bug in integer?
sorting environment in make-system-image for more stable diffs
2009-05-08 02:52:25 +00:00
JeffBezanson
3dbaa358f9
making 3rd argument to string.sub optional
...
some renaming
removing 1/Instructions table
2009-05-07 02:10:52 +00:00
JeffBezanson
c94774a5df
adding *error-stream* variable
...
removing unnecessary byte after :let in bytecode encoding
adding script for easy bootstrapping
2009-05-05 23:51:13 +00:00
JeffBezanson
63edc82ba4
using global variables uniformly for print settings instead of passing
...
around one of them
fixing unwind-protect not to duplicate code
2009-05-05 04:01:06 +00:00
JeffBezanson
264df1f90b
improving closure representation
...
some performance tweaks
2009-04-28 04:10:18 +00:00
JeffBezanson
14d625bd83
some performance tweaks
2009-04-27 03:21:53 +00:00
JeffBezanson
de19e4f401
adding return special form
...
eliminating some unnecessary top-level bindings
adding opcodes add2, sub2, neg
2009-04-26 22:19:32 +00:00
JeffBezanson
0dc4c16276
making procedure? a builtin
...
fixing type error trying to apply #t, #f, nil
2009-04-24 20:43:56 +00:00
JeffBezanson
1259c17837
updating interpreter to work better for bootstrapping
...
adding program mkboot0, which can be run in the interpreter to compile
source files into a stage-0 boot image.
2009-04-23 00:55:03 +00:00
JeffBezanson
909b91ffcc
fixing printing of invalid UTF-8
2009-04-23 00:22:03 +00:00
JeffBezanson
e4488bb065
some tweaks to the vm
2009-04-22 23:00:13 +00:00
JeffBezanson
27120b0ce4
fixing bug in truncate
...
simplifying nconc loop
2009-04-22 15:02:49 +00:00
JeffBezanson
291b5f86e0
fixing nconc on long argument lists
2009-04-22 01:40:10 +00:00
JeffBezanson
2bf87ede4f
fixing !print_pretty on vectors
2009-04-21 21:41:32 +00:00
JeffBezanson
2cceb9e538
fixing function? and disassemble
2009-04-21 15:47:30 +00:00
JeffBezanson
d6f73d0bf0
implementing #vu8 read and print syntax for uint8 vectors
...
much more compact string representation of bytecode
2009-04-21 15:35:46 +00:00
JeffBezanson
305c350c56
a couple small fixes
...
making bytecode representation more space-efficient
2009-04-21 14:53:18 +00:00
JeffBezanson
25812731cc
eliminating interpreter. the bytecode VM is now fully bootstrapped.
...
making the empty vector a singleton
removing syntax environment stuff from core
reimplementing eval using the compiler
fixing a couple bugs in long argument lists
2009-04-21 00:56:05 +00:00
JeffBezanson
5ab7a7c1e1
adding new "translucent" function type for byte-compiled lambdas
2009-04-19 22:22:17 +00:00
JeffBezanson
aa62ae9e96
allowing (copy x) and other byte stream functions only on plain-old-data types
...
adding plain-old-data? predicate
adding string.join
2009-04-19 16:48:09 +00:00
JeffBezanson
2ed581e62d
adding top-level-value and set-top-level-value!, using them instead of
...
set and eval where appropriate
adding separate integer? and integer-valued? predicates
2009-04-17 14:41:15 +00:00
JeffBezanson
86b7738c89
cleaning up implementation of apply() entry point
...
removing use of interpreter in computed calls to builtins
2009-04-17 03:40:52 +00:00
JeffBezanson
94814a2e34
a bug fix and a first pass at let-optimization
2009-04-16 21:20:15 +00:00
JeffBezanson
0a3590aa01
some optimizations
2009-04-16 14:21:16 +00:00
JeffBezanson
ad4a086790
converting for to a special form
...
adding loadi8 instruction
cleaning up numeric comparison, reducing repeated code
2009-04-16 03:05:38 +00:00
JeffBezanson
36a209cd5f
making = a builtin
...
fixing = and eqv? to work properly on NaNs
fixing other comparison predicates to be consistent
2009-04-15 23:54:43 +00:00
JeffBezanson
81641a2240
fixing glaring bug in last revision
2009-04-15 00:30:24 +00:00
JeffBezanson
672558d30f
bytecode vm is now working, off by default
...
various bug fixes
language changes:
• constant symbols no longer shadow everything
• eval* removed
• vararg lists always allocated on entry, dotted argument
lists not preserved
new applyn() entry point
2009-04-15 00:12:01 +00:00
JeffBezanson
b9a1be78a0
implementing op_closure, fix to loadc/setc
2009-04-09 16:09:02 +00:00
JeffBezanson
debf3fd517
moving (length) out of core
...
changing another recursive call to goto
adding special cases in compiler for 0 and 1 argument versions of some
vararg builtins
beginning implementation of bytecode interpreter
2009-04-09 04:04:27 +00:00
JeffBezanson
ea5d334626
some cleanup, removing some unnecessary global bindings
2009-04-08 18:17:02 +00:00
JeffBezanson
43cb51f640
replacing a recursive call with a goto; saves lots of stack space.
2009-04-07 15:55:13 +00:00
JeffBezanson
e119a66bcd
moving lognot out of core
...
fixing type check in ash
2009-04-02 03:53:38 +00:00
JeffBezanson
8e78e4cdbb
making some utf8 routines more robust against invalid data
...
implementing tail position in compiler
adding arg count checking for instructionized builtins
2009-04-02 02:22:38 +00:00
JeffBezanson
28c39e8cf0
fixing definition of let*
2009-04-01 22:23:19 +00:00
JeffBezanson
43e8d1fbf0
adding the ability to heap-allocate extentions to the value stack,
...
so recursion depth is limited only by the process stack limit.
reorganizing evaluator so the same code is used for evaluating
and pushing arguments for both builtin functions and lambdas.
for now this is slower, but it was done in preparation for
Things To Come.
adding list-head
implementing the calling convention for long argument lists in
bytecode compiler. arguments are broken down into a nest of
list and nconc calls.
also implementing vararg builtins.
2009-04-01 04:31:49 +00:00
JeffBezanson
2ddbac400a
fixing bug in hash table. growth schedule made it possible for
...
maxprobe to decrease, causing growth during rehashing, which leaks
the table.
2009-03-28 23:46:02 +00:00
JeffBezanson
e3158b8640
adding nestlist, to-proper, string.rep, pad-l, pad-r, trace, untrace,
...
table.invert, table.foreach
reorganizing system.lsp so functions are grouped sensibly
scheme implementation of a simple bytecode compiler
2009-03-28 21:39:04 +00:00
JeffBezanson
c076be667b
fixing bug in macroexpand on lambdas
2009-03-27 03:47:11 +00:00
JeffBezanson
4cb9685266
adding support for arbitrarily-long argument lists
...
argument lists are heap-allocated after a certain cutoff (currently 127)
2009-03-27 03:06:55 +00:00
JeffBezanson
fe72c101e2
avoiding sprintf for error messages where possible
...
moving raise, logand, logior, logxor, and ash out of core
changing prog1 to a special form
2009-03-25 02:28:21 +00:00
JeffBezanson
b63a23eb1a
char read/print improvement
...
adding char.upcase and char.downcase
2009-03-24 21:27:38 +00:00
JeffBezanson
a9b0f7879b
removing some unnecessary stuff
...
improving key-error
2009-03-23 20:44:19 +00:00
JeffBezanson
8f93c9dfc6
adding string->number
2009-03-23 19:49:08 +00:00
JeffBezanson
9023705d27
adding some error messages
...
adding io.seek, io.copyuntil
adding #\uHHHH hex character literal read syntax
2009-03-22 02:05:26 +00:00
JeffBezanson
7059a471a1
initial implementation of let-syntax
2009-03-17 21:53:55 +00:00
JeffBezanson
5edb75af2c
making nconc, assq, and memq builtins
...
some small optimizations to string.map, string.trim,
string.inc, string.dec, aref
2009-03-17 03:29:17 +00:00
JeffBezanson
5681745bc3
adding apply1, using it in trycatch (avoids consing)
...
allowing left bit shift to overflow to larger types
fixing bug in number->string on uint64
fixing bug in rand.uint64
2009-03-13 22:26:44 +00:00
JeffBezanson
dceced2bb0
fix bug in (case)
...
reducing use of strlen
2009-03-13 14:54:48 +00:00
JeffBezanson
0643a4f3a2
fixing bug in datum comment #;
...
improving some library functions
2009-03-13 03:30:10 +00:00
JeffBezanson
bfa30fb095
allowing logand, logior, logxor to accept any number of arguments
...
adding negative?, positive?, zero?, even?, odd?, for-each
adding *linefeed*, terpri
2009-03-12 02:47:34 +00:00
JeffBezanson
d81e6c2d57
adding ash function
...
making more functions static
removing list_nth, using vectors for enums instead
making more operators return fixnums where possible
2009-03-11 19:16:40 +00:00
JeffBezanson
05ef9f42a5
simplifying (string) to just princ-to-string
...
small printing improvements
2009-03-11 14:52:37 +00:00
JeffBezanson
e2b7652e36
some printing improvements
2009-03-10 19:29:30 +00:00
JeffBezanson
fdfaacfbe5
adding io.putc, io.tostring!, string.map, print-to-string
...
fixing bug in ios, not initializing readonly flag
updating string and sizeof to use new strstream functions
removing some redundant numeric type init functions
2009-03-05 03:48:17 +00:00
JeffBezanson
40cff81550
more reorganization of LLT
...
adding io.readuntil, io.readline
improvements to ios_readprep
2009-03-03 03:16:30 +00:00
JeffBezanson
2cf5187ca9
adding dump, memstream, io.read, and io.write
...
more renaming
allowing iostreams to be read-only
fixing bug allowing arrays with 0-size elements
2009-03-02 04:26:16 +00:00
JeffBezanson
923c7d5495
fixing bug reading negative constants with #b,o,d,x
...
adding string.trim
2009-02-28 01:59:01 +00:00
JeffBezanson
c1610f0a9f
changing load to expand each expression before evaluating
...
improve performance by reloading system.lsp with this loader
other misc. changes
2009-02-26 18:15:38 +00:00
JeffBezanson
7883a5de0b
fixing ambiguity in reading hex numbers and floating point
...
making print robust against the undefined value
2009-02-24 18:31:05 +00:00
JeffBezanson
115b2843fb
adding copy and string.count
2009-02-24 04:12:33 +00:00
JeffBezanson
6c56120669
better solution for allowing an input stream to be relocated while
...
reading from it
improving prettyprinting of lists of short strings
2009-02-24 02:21:16 +00:00
JeffBezanson
76edead57b
adding (do ) form
2009-02-20 19:50:35 +00:00
JeffBezanson
3aad0bd6be
fixing some bugs in lerror and read
...
making memory errors non-consing (duh)
cleaning up main() a bit
adding case macro, moving other stuff around a bit
2009-02-20 05:11:05 +00:00
JeffBezanson
f1927a3b57
moving delete-duplicates and new f-body so they can be macroexpanded in advance
...
deprecating setf, labels, and try (weren't used anywhere)
adding string.tail
changing match to use delete-duplicates
2009-02-19 22:29:47 +00:00
JeffBezanson
0c0471e856
moving implementation of startup, repl, load, and top-level
...
exception handler into system.lsp
adding several iostream functions
adding support for internal define
2009-02-19 03:31:40 +00:00
JeffBezanson
79e12b2dcb
adding io.print and io.princ
...
misc. touch-ups
2009-02-09 05:38:40 +00:00
JeffBezanson
1097597437
file stream creation and io.read
2009-02-09 03:22:31 +00:00
JeffBezanson
2a083db293
adding named let
2009-02-06 03:41:24 +00:00
JeffBezanson
2c1bb59486
adding integer? and number->string
...
a bit more renaming
2009-02-01 05:41:43 +00:00
JeffBezanson
17d81eb4e6
adding #b, #o, #d, #x numeric literals
...
accepting r6rs IEEE literals +-nan.0 and +-inf.0
printing distinguished -0.0, indicating float with .0f instead
of #float, double with .0 instead of #double
more renaming (? on predicates, ! on mutating operators)
changing T to #t :( all those #s are so ugly
2009-02-01 01:53:58 +00:00
JeffBezanson
a55b46e9a6
switching to scheme #t, #f, and () values
...
porting code to sort out which NILs are false and which are
empty lists
switching to scheme-style special forms. however you feel about
scheme names vs. CL names, using both is silly.
mostly switching to scheme predicate names, with compatibility
aliases for now. adding set-constant! to make this efficient.
adding null?, eqv?, assq, assv, assoc, memq, memv, member
adding 2-argument form of if
allowing else as final cond condition
looking for init file in same directory as executable, so flisp
can be started from anywhere
renaming T to FL_T, since exporting a 1-character symbol is
not very nice
adding opaque type boilerplate example file
adding correctness checking for the pattern-lambda benchmark
bugfix in int2str
2009-01-29 01:04:23 +00:00
JeffBezanson
38cf75733e
adding #; datum comment
...
allowing #||# comments to nest
2009-01-26 02:03:37 +00:00
JeffBezanson
808d92dfb6
some micro-optimizations
2009-01-16 14:12:35 +00:00