summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-10-09Doc: mention vectors are self-quotingluaIan Price1-13/+9
Reported by Dmitry Bogatov <KAction@gnu.org>. * doc/ref/api-compound.texi (Vector Syntax, Vector Creation): Mention that vectors are self-quoting. Remove examples with quote signs.
2013-09-09Fix code generated for `while'.Ian Price1-2/+2
* module/language/lua/compile-tree-il.scm (while-loop->tree-il): Generate `letrec' instead of `let'. Generate valid `lambda' expression.
2013-09-09Add missing `make-sequence' procedure.Ian Price1-0/+5
* module/language/lua/compile-tree-il.scm (make-sequence): New procedure.
2013-09-09Use `make-application' instead of removed `make-call'.Ian Price1-51/+51
* module/language/lua/compile-tree-il.scm: Rename.
2013-09-09Compile Lua's ... form.Ian Price3-8/+20
* module/language/lua/compile-tree-il.scm (compile): Add clause for ast-variable-arguments. * module/language/lua/parser.scm (define-ast, make-parser): Add vararg-gensym field to functions, gensym field to variable-arguments. Propagate *vararg-gensym* from functions to variable-arguments. * test-suite/tests/lua-eval-2.test ("lua-eval"): Check for #nil
2013-09-09Fix typo in lua lexer test.Ian Price1-1/+1
* test-suite/tests/lua-lexer.test ("lua-lexer"): #:vararg -> #:varargs
2013-09-09Add some documentation. Function calls now properly handle multiplePhil9-46/+130
values resulting from a function call as the last argument. doc/ref/api-languages.texi: Add a small blurb about Lua. module/language/lua/compile-tree-il.scm: Function calls now properly handle multiple values resulting from a function call as the last argument.
2013-09-09module/language/lua/parser.scm: Rename #:dots to #:varargsPhil6-15/+15
2013-09-09Fix and/or double evaluation. Add math.modf, math.fmod.Phil5-43/+123
* module/language/lua/compile-tree-il.scm: Fix and/or double evaluation. * module/language/lua/notes.org: Add file describing known issues. * module/language/lua/parser.scm: (token-type): Recognize and/or. * module/language/lua/standard/math.scm: Add modf, fmod implementations. * test-suite/tests/lua-eval-3.test: Add another test file for basic language features.
2013-09-09lua code returning via normal pathAndy Wingo1-2/+2
* module/language/lua/compile-tree-il.scm (compile): Get more lua code returning via the normal path.
2013-09-09lua/runtime tweaksAndy Wingo1-113/+140
* module/language/lua/runtime.scm: Various indentation and idiom tweaks.
2013-09-09lua/lexer tweaksAndy Wingo3-82/+73
* module/language/lua/lexer.scm: Some tweaks and reindentations. Remove the define/init lexer interface; I don't like separating declaration and initialization. * module/language/lua/parser.scm: * test-suite/tests/lua-lexer.test: Adapt to lexer interface change.
2013-09-09lua/compile-tree-il tweaksAndy Wingo1-121/+156
* module/language/lua/compile-tree-il.scm: Reflow a bit, and a number of small rewrites. Added some FIXMEs.
2013-09-09remove true? and false?; lua's truthiness and falsehood is guile's.Andy Wingo2-26/+8
* module/language/lua/runtime.scm (true?, false?): Remove, now that #nil is false. * module/language/lua/compile-tree-il.scm: Don't emit calls to true? or false?.
2013-09-09lua/parser tweaksAndy Wingo1-472/+436
* module/language/lua/parser.scm (define-record, define-ast): Simplify these macros. (make-parser): A number of small idiomatic changes.
2013-09-09lua/common cleanupAndy Wingo5-19/+8
* module/language/lua/common.scm: Remove `or-eqv?'. Make a bit more idiomatic. * module/language/lua/compile-tree-il.scm: * module/language/lua/lexer.scm: * module/language/lua/parser.scm: * module/language/lua/runtime.scm: Replace or-eqv? instances with memq or memv.
2013-09-09syntax-error throws to syntax-errorAndy Wingo1-15/+5
* module/language/lua/common.scm (syntax-error): Throw to 'syntax-error.
2013-09-09add lua language implementationNo Itisnt16-0/+3242
What is missing: + Functions: module, getfenv, setfenv, math.modf, table.sort + Parser: needs to be more flexible + Compiler: needs more extensive work to properly handle all possible cases of variable arguments, multiple returns, and loops + Language: Variable arguments and unpacking of multiple returns. (For example we need to be able to handle something as complex as print(unpack({...})), which is easy with Lua's explicit stack but will require lots of tree-il gymnastics, or perhaps modifications to better allow different calling conventions. (For instance -- how would we support Python or Ruby, where keyword arguments are gathered into a hashtable and passed as a single argument?) What is there: A fair shot at supporting Lua 5.1, not quite a drop-in replacement, but not far from that goal either.
2013-08-31Micro-optimize char_decimal_value.Andy Wingo1-12/+17
* libguile/numbers.c (char_decimal_value): A wee micro-optimization.
2013-08-31Faster scm_from_port_stringnAndy Wingo1-1/+2
* libguile/strings.c (scm_from_port_stringn): Always inline to scm_from_utf8_string if the byte sequence is valid utf-8.
2013-08-31unread-char: inline conversion from codepoint to bytesAndy Wingo1-4/+25
* libguile/ports.c (scm_ungetc_unlocked): Inline the conversion from codepoint to bytes for UTF-8 and latin-1 ports. Speeds up a numbers-reading test case by 100% (!).
2013-08-31Add contification passAndy Wingo3-3/+241
* module/Makefile.am: * module/language/cps/contification.scm: New pass. * module/language/cps/compile-rtl.scm (optimize): Wire it into the compiler.
2013-08-31Add CPS -> RTL compilerAndy Wingo7-1/+1428
* module/Makefile.am: * module/language/cps/compile-rtl.scm: * module/language/cps/dfg.scm: * module/language/cps/slot-allocation.scm: New modules. * module/language/cps/spec.scm: Register the compiler. * test-suite/Makefile.am: * test-suite/tests/rtl-compilation.test: Add tests.
2013-08-31Add pass to reify primcalls without corresponding VM opsAndy Wingo2-0/+118
* module/Makefile.am: * module/language/cps/reify-primitives.scm: New pass.
2013-08-31Add arity-adapting moduleAndy Wingo2-0/+153
* module/Makefile.am: * module/language/cps/arities.scm: New module. Adapts call and return arities, especially for primcalls.
2013-08-31Add CPS primitives info moduleAndy Wingo2-0/+97
* module/Makefile.am: * module/language/cps/primitives.scm: New file.
2013-08-31RTL languageAndy Wingo3-0/+128
* module/Makefile.am * module/language/rtl.scm: * module/language/rtl/spec.scm: Add a stub RTL language.
2013-08-31Add closure conversionAndy Wingo2-0/+274
* module/Makefile.am * module/language/cps/closure-conversion.scm: New module, implementing a closure conversion pass.
2013-08-31(compile foo #:to 'cps)Andy Wingo4-1/+635
* module/language/tree-il/compile-cps.scm: New module implementing CPS conversion of Tree-IL. * module/Makefile.am: * module/language/tree-il/spec.scm: * module/language/cps/spec.scm: Integrate CPS in the build and language system.
2013-08-31Add CPS languageAndy Wingo4-6/+660
* module/Makefile.am: * module/language/cps.scm: * module/language/cps/verify.scm: Add CPS language. * .dir-locals.el: Add indentation rules for some CPS forms.
2013-08-29,xx for RTL imagesAndy Wingo3-11/+12
* module/scripts/disassemble.scm (disassemble): * module/system/vm/disassembler.scm (disassemble-file): Factor disassemble-file out. * module/system/repl/command.scm (disassemble-file): Map ,xx to disassemble RTL images.
2013-08-29add ability to disassemble ELF imagesAndy Wingo3-9/+55
* module/scripts/disassemble.scm (disassemble): Update to work with RTl (and only RTL, as that's the future). * module/system/vm/debug.scm (for-each-elf-symbol): New public interface. (debug-context-from-image): New helper. (find-debug-context): Use the helper. * module/system/vm/disassembler.scm (disassemble-image): New public interface.
2013-08-24Export the assembler proceduresAndy Wingo1-8/+12
* module/system/vm/assembler.scm (define-assembler): (define-macro-assembler): Export the assemblers.
2013-08-24rtl vm: box-set! binds no valuesAndy Wingo1-1/+1
* libguile/vm-engine.c (box-set!): Remove the OP_DST flag.
2013-08-24RA == MVRA in disassemblerAndy Wingo1-6/+1
* module/system/vm/disassembler.scm: Modify call disassembler to assume RA == MVRA.
2013-08-24assembler: give proper permissions to .data sectionAndy Wingo1-3/+11
* module/system/vm/assembler.scm (link-data): Give stringbufs the "shared" flag already, so we don't attempt to set it at runtime. Give .data sections the SHF_WRITE flag.
2013-08-24compile-file adds #:to-disk? #t to optsAndy Wingo2-2/+3
* module/system/base/compile.scm (compile-file): Pass #:to-disk? as an option to indicate that the result will be being loaded from disk. Perhaps a linker might want to page-align in that case. * module/language/elisp/compile-tree-il.scm (process-options!): Accept and ignore the #:to-file compiler option.
2013-08-24RTL: 'return-values' instruction assumes 'reset-frame' has been called.Mark H Weaver2-8/+6
* libguile/vm-engine.c (return-values): Remove NVALUES operand. Don't reset the frame. * test-suite/tests/rtl.test ("cached-toplevel-set!"): Adapt to the fact that 'return-values' has no operand now, and that 'reset-frame' must be done first.
2013-08-24RTL VM: Rename 'apply' instruction to 'tail-apply'.Mark H Weaver2-4/+4
* libguile/vm-engine.c (apply, tail-apply): apply -> tail-apply. (RETURN_VALUE_LIST): goto op_apply -> goto op_tail_apply. * libguile/vm.c (rtl_apply_code): scm_rtl_op_apply -> scm_rtl_op_tail_apply.
2013-08-24RTL VM: fix multiple value returns.Mark H Weaver1-1/+1
* libguile/vm-engine.c (halt): Fix off-by-one error in retrieving multiple values from the frame.
2013-08-24Convert branchable primitives into binary operations only.Mark H Weaver1-3/+25
* module/language/tree-il/primitives.scm (maybe-simplify-to-eq): Wrap within another lambda, binding the primitive name. If there are less than two arguments, expand to constant #t. If there are more than two arguments, convert into a conjunction of binary applications. (expand-chained-comparisons): New procedure. (*primitive-expand-table*): Add entries for (< <= = >= > eq?).
2013-08-23Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver5-25/+21
2013-08-23Fix 'define-public' from (ice-9 curried-definitions).Mark H Weaver1-17/+10
* module/ice-9/curried-definitions.scm (cdefine, cdefine*): Simplify, and improve error reporting by making the patterns more strict. (define-public): Fix bug in generated 'export' form.
2013-08-19Improve error checking in 'define-public' and 'module-add!'.Mark H Weaver1-1/+3
* module/ice-9/boot-9.scm (module-add!): Check that the symbol argument is actually a symbol. (define-public): Expand into 'define' in such a way that curried definitions will immediately fail.
2013-08-19doc: `get-string-all' takes only one argument.Ian Price1-1/+1
* doc/ref/api-io.texi (R6RS Textual Input): Remove `count' argument.
2013-08-19`write-request-line' always prints a path component.Ian Price2-6/+7
* module/web/http.scm (write-request-line): Always write "/" when path is empty, regardless of query. * test-suite/tests/web-http.test ("write-request-line"): Add test.
2013-08-16In bytevector->uint-list et al, check that SIZE divides the bv length.Mark H Weaver2-9/+8
Fixes <http://bugs.gnu.org/15100>. Reported by Göran Weinholt <goran@weinholt.se>. * libguile/bytevectors.c (INTEGERS_TO_LIST): Enforce the R6RS requirement that SIZE divides the bytevector length. * test-suite/tests/bytevectors.test: Add test. Remove tests that assumes that this "divides" check is not enforced.
2013-08-16Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver2-6/+12
2013-08-16Improved error checking in bytevector->uint-list and bytevector->sint-list.Mark H Weaver2-6/+12
Partially fixes <http://bugs.gnu.org/15100>. Reported by Göran Weinholt <goran@weinholt.se>. * libguile/bytevectors.c (INTEGERS_TO_LIST): Make sure SIZE isn't 0. Allow SIZE to be greater than the bytevector length, for consistency with allowing extra bytes at the end when the bytevector length is non-zero. Use scm_from_size_t instead of scm_from_uint. * test-suite/tests/bytevectors.test: Add tests. Remove a test that checks for an exception when SIZE is greater than the bytevector length.
2013-08-15Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver4-7/+11