Commit Graph

164 Commits

Author SHA1 Message Date
Timothy Sample 953197594a mes: optargs: Adjust for new module system.
* module/mes/optargs.scm: Move this...
* mes/module/ice-9/optargs.scm: ...here with minor adjustments.
* mes/module/mes/optargs.mes: Adjust accordingly.
* tests/optargs.test: Adjust accordingly.
* mes/module/mes/boot-5.scm: Add '(mes syntax)' to the root module.
* mes/modules/system/base/pmatch.scm: Export 'pmatch' using
'#:replace'.
2022-04-26 16:46:08 -06:00
Timothy Sample 16c48267e4 mes: Add Guile-style module support.
This change adds support for Guile-style modules, but does not
enable it by default.  It can be enabled by using the 'boot-5' boot
script.

* mes/module/mes/guile-module.mes: New file.
* mes/module/mes/boot-5.mes: New file.
* mes/module/mes/boot-0.mes (effective-version, include-from-path)
(define-module, use-modules, effective-version): Move these...
* mes/module/mes/guile.scm: ...here.
* mes/module/mes/boot-0.mes: Move '%main' and the command-line
interface code...
* mes/module/mes/main.mes: ...to this new file.
* mes/module/mes/boot-0.mes: Import '(mes guile)' and '(mes main)'.
* mes/module/ice-9/rdelim.scm: New file.
* tests/data/bar.scm: New file.
* tests/data/foo.scm: New file.
* tests/guile-module.test: New file.
* build-aux/check-mes.sh (TESTS): Add it.
2022-04-26 16:46:08 -06:00
Timothy Sample 9ed7460eba mes: Use a hash table for fluids.
If 'make-fluid' is a macro that calls 'gensym' directly, any attempt
to wrap 'make-fluid' will result in only one symbol being produced
at expansion time.

* mes/module/mes/fluids.mes (make-fluid): Rewrite to generate a
symbol at evaluation time, and use that symbol as a key for a hash
table.
(fluid?, fluid-ref, fluid-set!): Adjust accordingly.
(with-fluid*, with-fluids): Use 'fluid-ref' instead of applying a
fluid directly.
* tests/fluids.test: Add test.
2022-04-26 16:46:08 -06:00
Timothy Sample 543e4300c0 core: Fix continuations.
* src/eval-apply.c: Do not add a frame to the GC stack while making
a continuation.
* mes/module/mes/catch.mes (catch): Remove workaround.
* tests/boot.test: Add test.
2022-04-26 16:46:08 -06:00
Timothy Sample 01d658a356 core: Make symbol lookup extensible.
* src/module.c (set_current_module): New function.
(module_variable): Remove function.
(module_define_x): Remove function.
(current_module_variable): New function.
* src/eval-apply.c (lookup_binding): Replace 'module_variable' with
'current_module_variable'; add the 'define_p' argument.
(set_x): Adjust for 'define_p'.
(lookup_value): Likewise.
(expand_variable_): Likewise.
(eval_apply): When evaluating defines, replace 'module_define_x' with
'lookup_binding' with 'define_p' set.
* src/gc.c (gc_init)[!__M2_PLANET__]: Double ARENA_SIZE.
* include/mes/constants.h (MODULE_EVAL_CLOSURE): New constant.
* include/mes/mes.h (current_module_variable): New declaration.
(current_module_define_x): New declaration.
* include/mes/builtins.h (set_current_module): New declaration.
(lookup_binding): Declare the 'define_p' argument.
(module_variable): Remove declaration.
(module_define_x): Remove declaration.
* src/builtins.c (mes_builtins): Register 'set-current-module';
remove 'module-variable' and 'module-define!'.
* mes/module/boot-0.scm (defined?): Do not use 'module-variable'.
* mes/module/boot-00.scm (defined?): Likewise.
* mes/module/boot-01.scm (defined?): Likewise.
* mes/module/boot-02.scm (defined?): Likewise.
* mes/module/boot-03.scm (defined?): Likewise.
* scaffold/boot/60-let-syntax-expanded.scm (defined?): Likewise.
* mes/module/mes/fluids.mes (make-fluid): Do not use
'module-define!', and wrap fluids in a variable record.
* tests/macro.test (make-fluid): Likewise.

Co-authored-by: Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
2022-04-26 16:46:05 -06:00
Timothy Sample 22d89dfa97 core: Make 'primitive-load' a builtin.
In addition to simplifying the interpreter, this change ensures that
'primitive-load' evaluates the loaded file in the top level
environment.

* include/mes/symbols.h (cell_symbol_primitive_load): Remove
variable.
(cell_vm_begin_primitive_load): Remove variable.
(cell_vm_begin_expand_primitive_load): Remove variable.
(SYMBOL_MAX, CELL_SYMBOL_RECORD_TYPE): Adjust accordingly.
* src/symbol.c (init_symbols): Do not initialize removed variables.
* src/eval-apply.c (eval_apply): Remove primitive load code.
(primitive_load): New function.
* include/mes/builtins.h (primitive_load): Declare it.
* src/builtins.c (mes_builtins): Initialize it.
* mes/module/mes/boot-03.scm: Remove duplicate call to
'primitive-load'.
* mes/module/mes/boot-0.scm: Remove extra call to 'primitive-load';
adjust how the "--main" option is handled.
* tests/base/test.test: Add a test.
* tests/data/load.scm: Set the 'toplevel?' variable to support the
new test.
2022-04-26 11:22:57 -06:00
Timothy Sample 1360189685 core: Fix internal define bug.
* src/eval-apply.c (eval_apply): When evaluating 'define', recompute
the 'global_p' and 'local_p' flags; when evaluating a local
definition, set the closure directly instead of using 'set_x'.
* tests/base.test: Add a test.
2022-04-26 11:22:57 -06:00
Timothy Sample f1447abeb3 tests: Fix tests to run on Guile.
* scaffold/boot/17-open-input-string.scm: Test 'current-module' to
see if we can lookup 'read-string' in a module.
* scaffold/boot/gc.scm: Skip all tests on Guile.
* tests/gc.test: Rename 'mes?' to 'mes-core?'; use 'current-module'
to check if we need to use core Mes procedures; and adjust all tests
accordingly.
* tests/scm.test (iota -1): Skip on Guile.
* tests/vector.test (make-vector): Adjust for Guile.
2022-04-26 11:22:57 -06:00
Timothy Sample a8ce580123 core: Rename the 'current-module' symbol.
This change renames 'current-module' to 'current-environment'.  This
will make way for 'current-module' to actually be a module.

* include/mes/symbols.h (cell_symbol_current_module): Rename this...
(cell_symbol_current_environment): ...to this.
* src/eval-apply.c: Adjust accordingly.
* src/symbol.c: Adjust accordingly, and update the Scheme name to
'current-environment'.
* mes/module/mes/base.mes: Adjust accordingly.
* mes/module/mes/boot-0.scm: Adjust accordingly.
* mes/module/mes/boot-00.scm: Adjust accordingly.
* mes/module/mes/boot-01.scm: Adjust accordingly.
* mes/module/mes/boot-02.scm: Adjust accordingly.
* mes/module/mes/boot-03.scm: Adjust accordingly.
* mes/module/mes/display.mes: Adjust accordingly.
* mes/module/mes/module.mes: Adjust accordingly.
* mes/module/mes/psyntax-0.mes: Adjust accordingly.
* mes/module/mes/repl.mes: Adjust accordingly.
* mes/module/mes/scm.mes: Adjust accordingly.
* mes/module/srfi/srfi-16.scm: Adjust accordingly.
* mes/module/srfi/srfi-26.scm: Adjust accordingly.
* module/mescc/compile.scm: Adjust accordingly.
* scaffold/boot/17-open-input-string.scm: Adjust accordingly.
* scaffold/boot/4c-quasiquote.scm: Adjust accordingly.
* scaffold/boot/4f-string-split.scm: Adjust accordingly.
* scaffold/boot/50-make-string.scm: Adjust accordingly.
* scaffold/boot/50-string-join.scm: Adjust accordingly.
* scaffold/boot/51-module.scm: Adjust accordingly.
* scaffold/boot/52-define-module.scm: Adjust accordingly.
* scaffold/boot/60-let-syntax-expanded.scm: Adjust accordingly.
* scaffold/boot/60-let-syntax.scm: Adjust accordingly.
* scaffold/gc.scm: Adjust accordingly.
* tests/gc.test: Adjust accordingly.
* tests/psyntax.test: Adjust accordingly.
2022-04-26 11:22:57 -06:00
Timothy Sample 5edef591b7 core: Implement Guile-style variables.
* src/variable.c: New file.
* simple.make (LIBMES_SOURCES): Add it.
* build-aux/configure-lib.sh (mes_SOURCES): Add it.
* build-aux/snarf.sh: Snarf it.
* kaem.run: Compile it.
* include/mes/builtins.h (make_variable): New function.
(variable_p): New function.
(variable_ref): New function.
(variable_set_x): New function.
(variable_printer): New function.
* src/builtins.c (mes_builtins): Register them.
* include/mes/mes.h (make_variable_type): New function.
(scm_variable_type): New variable.
* src/module.c (make_initial_module): Initialize it.
* src/gc.c (gc_flip, gc_): Keep track of it.
* include/mes/symbols.h (cell_symbol_variable): New variable.
(SYMBOL_MAX): Adjust accordingly.
* src/symbol.c (init_symbols): Initialize 'cell_symbol_variable'.
* mes/module/mes/scm.mes (make-undefined-variable): New procedure.
(variable-bound?): New procedure.
* tests/variable.test: New file.
* build-aux/check-mes.sh (TESTS): Add it.
2022-04-25 14:19:03 -06:00
Jan (janneke) Nieuwenhuizen c317e939b9 core: Replace special cell_boot_module with initial-module builtin.
* src/module.c (initial_module): New builtin.
* include/mes/builtins.h: Declare it.
* src/builtins.c (mes_builtins): Register it.
* include/mes/symbols.h (cell_boot_module): Remove.
* src/symbol.c (init_symbols_): Update.
(init_symbols): Likewise.
* src/eval-apply.c (eval_apply): Likewise.
(expand_variable_): Likewise.
* tests/macro.test (make-fluid): Likewise.
* mes/module/mes/fluids.mes (make-fluid):  Likewise.
2022-04-25 14:19:03 -06:00
Jan (janneke) Nieuwenhuizen 07c90bdebd core: Add hashq_create_handle_x.
* src/hash.c (hash_create_handle_x): New function.
* include/mes/builtins.h: Declare it.
* src/builtins.c (mes_builtins): Register it.
* tests/hash.test: Add a test.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2022-04-25 09:22:13 -06:00
Jan (janneke) Nieuwenhuizen 64d6dff810 core: Add hash_clear!.
* src/hash.c (hash_clear_x): New builtin.
* include/mes/builtins.h: Declare it.
* src/builtins.c (mes_builtins): Register it.
* tests/hash.test: Add a test.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2022-04-25 09:22:13 -06:00
Jan (janneke) Nieuwenhuizen 858daa625d core: Add hash-table?.
* include/mes/mes.h (scm_hash_table_type): New type.
* src/hash.c (make_hash_table_type): Rename from make_hash_type, and
initialize it.
* src/symbol.c (init_symbols): Add it to environment.
* tests/hash.test: Add a test.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2022-04-25 09:22:13 -06:00
Jan (janneke) Nieuwenhuizen 9a5de02f42 core: Allow non-string hash keys.
This merely allows adding non-string keys to a hash table and puts them
non-string keys in bucket 0.  Efficiency is lost.  TODO: calculate a
proper hash.

* src/hash.c (hash_): Allow non-string keys in bucket 0.
* tests/hash.test: Add a test.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2022-04-25 09:22:13 -06:00
Jan (janneke) Nieuwenhuizen e4d35f5915 core: Add hash-map->list.
* src/hash.c (hash_buckets): New function.
* src/builtins.c (mes_builtins): Initialize it.
* include/mes/builtins.h: Declare it.
* mes/module/mes/scm.mes (hash-map->list): New procedure.
* tests/hash.test: Add a test.
* tests/gc.test: Bump arena size to handle more built-ins.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2022-04-25 09:22:10 -06:00
Jan (janneke) Nieuwenhuizen 3339cd11dd mes: hash: Guile interface compatibility.
* src/hash.c (hashq_get_handle): Remove the dflt argument.
(hashq_ref): Rename this...
(hashq_ref_): ...to this, update for hashq_get_handle, and handle
the dflt argument directly.
(hash_ref): Rename this...
(hash_ref_): ...to this, and fix handling of the dflt argument.
* include/mes/builtins.h: Update accordingly.
* src/eval-apply.c (macro_get_handle): Update for hashq_get_handle.
* src/module.c (module_variable): Likewise.
* src/builtins.c (mes_builtins): Set hashq-get-handle argument count
to 2; rename hashq-ref to core:hashq-ref; and rename hash-ref to
core:hash-ref.
* mes/module/mes/scm.mes (hashq-ref, hash-ref): New procedures.
* tests/hash.test: Add some tests.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2022-03-24 11:51:33 -06:00
Jan (janneke) Nieuwenhuizen eac19abd29 mes: srfi-9: Guile interface compatibility.
* tests/srfi-9.test: Convert to bootstrap test, do not use
mes-use-module.
* mes/module/srfi/srfi-9-vector.mes: Resurrect.
2022-03-23 15:21:47 -06:00
Jan (janneke) Nieuwenhuizen a0757413b9 mes: srfi-9: Guile interface compatibility.
* mes/module/srfi/srfi-9-struct.mes (record-type-name): Rename from
record-type.  Update users.
(record-type-descriptor): New function.
* mes/module/srfi/srfi-9/gnu-struct.mes (set-field): Update.
* tests/srfi-9.test ("make-record-type", "record-constructor",
"record?", "record-predicate", "zero?", "zero-one", "zero-one-set!",
"record-type-descriptor", "record-type-name", "record-type-fields"):
New test.
2022-03-23 15:21:47 -06:00
Jan (janneke) Nieuwenhuizen fb0b01e904 core: make-hash-table: Fix optional argument.
* src/hash.c (make_hash_table): Fix optional argument.
* src/builtins.c (mes_builtins): Update arity.
* tests/hash.test: New file.
* build-aux/check-mes.sh (TESTS): Add it.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2022-03-23 10:59:32 -06:00
Jan (janneke) Nieuwenhuizen 9a660bf782
mes: Remove PEG.
PEG is not used and mostly broken.

* mes/module/mes/peg.mes,
mes/module/mes/peg/cache.scm,
mes/module/mes/peg/codegen.scm,
mes/module/mes/peg/simplify-tree.scm,
mes/module/mes/peg/string-peg.scm,
mes/module/mes/peg/using-parsers.scm,
tests/peg.test: Remove.
* AUTHORS: Remove mention.
2020-12-30 17:28:21 +01:00
Jan (janneke) Nieuwenhuizen ae9988bb3a
core: Add gc-stats.
* include/mes/mes.h (gc_start_time, gc_end_time, gc_time): New
variables.
* src/mes.c (init): Initialize them.
* src/gc.c: Use them.
* src/gc.c (gc_stats): New function.
* include/mes/builtins.h: Declare it.
* src/builtins.c (mes_builtins): Register it.
* tests/gc.test: Use it.
2020-12-31 10:34:07 +01:00
Jan (janneke) Nieuwenhuizen e6b4216a98
core: make-vector: Move to core.
* src/vector.c (make_vector_): Rename from make_vector__.  Add
parameter.  Fix double allocation.
(make_vector): Rename from make_vector_.  Use arity n.  Update users.
2020-08-16 16:54:18 +02:00
Jan (janneke) Nieuwenhuizen 49dfdb4890
tests: Add gc.test.
* tests/gc.test: New file.
* build-aux/check-mes.sh (TESTS): Add it.
* scaffold/gc-test.scm: Remove.
2020-04-25 16:39:43 +02:00
W. J. van der Laan ce80c24ae4
mes: Make logand work correctly.
* src/math.c (logand): Start from -1 instead of 0, so that the bitwise AND-ed
result is the intersection of bit sets instead of always 0.
* tests/math.test ("logand", "logand 3"): Test it.

Co-authored-by: Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
2021-04-21 08:31:37 +02:00
Jan (janneke) Nieuwenhuizen 87c3dca401
tests: Update to bin/mes for standalone run.
* tests/base.test,
tests/boot.test,
tests/macro.test,
tests/perform.test,
tests/quasiquote.test,
tests/read.test,
tests/scm.test,
tests/srfi-0.test: Default to bin/mes.
2021-01-23 08:43:48 +01:00
Jan Nieuwenhuizen d55ca711f1
build: Cater for bootstrap build.
* build-aux/build.sh.in: Build bin/mes.  Update scripts and users.
* build-aux/bootstrap.sh.in: Update.
* build-aux/install.sh.in: Install all built bin/mes-* flavours.
* configure: Drop SEED, support --bootstrap.
* configure.sh: Likewise.
2019-12-13 21:52:18 +01:00
Jan Nieuwenhuizen dd34569751
mes: string->number: Support #x-prefixed hex numbers.
* mes/module/mes/scm.mes (string->number): Support "#x"-prefix.
* tests/math.test ("string->number #hex"): Test it.
2019-08-02 22:52:46 +02:00
Jan Nieuwenhuizen 81849edb86
mes: Remove broken copy of simple-format.
* mes/module/mes/simple-format.mes: New file.
* mes/module/mes/guile.mes: Use it.
(with-output-to-string, simple-format): Remove broken copies.
* mes/module/mes/display.mes (with-output-to-string, simple-format,
format): Remove.
2019-07-19 15:36:36 +02:00
Jan Nieuwenhuizen 27d771e6ab
test: Move srfi-1 for-each and map tests to tests/srfi-1.test.
This fixes: `make check MES=guile'.

* tests/srfi-1.test ("map 1,2", "map 2,1", "for-each 1,2",
for-each 2,1"): Move from scm.test.
* tests/scm.test ("map 1,2", "map 2,1", "for-each 1,2",
for-each 2,1"): Remove.
2019-05-29 16:30:25 +02:00
Jan Nieuwenhuizen 90b384def3
mes: Support map and for-each with lists of unequal length.
* mes/module/mes/base.mes (map): Support lists of unequal length.
* mes/module/mes/scm.mes (for-each): Likewise.
* module/mescc/compile.scm (expr->register): Fix compile warning.
* tests/scm.test ("map 1,2", "map 2,1", "for-each 1,2", "for-each
2,1": Test it.
2019-03-02 14:33:58 +01:00
Jan Nieuwenhuizen 819b32e61c
core: Add string-append.
* src/strings.c (string_append): New function.
* mes/module/mes/boot-0.scm.in (string-append): Remove.
* mes/module/mes/boot-03.scm (string-append): Remove.
* scaffold/boot/50-make-string.scm (string-append): Remove.
* scaffold/boot/50-string-append.scm (string-append): Remove.
* scaffold/boot/50-string-join.scm (string-append): Remove.
* scaffold/boot/51-module.scm (string-append): Remove.
* scaffold/boot/52-define-module.scm (string-append): Remove.
* tests/macro.test (string-append): Remove.
* scaffold/boot/17-string-append.scm: Move from 50-string-append.scm.
2018-11-15 23:09:56 +01:00
Jan Nieuwenhuizen 149f2a3e51
core: String as array of bytes.
* src/strings.c: New file.
* src/mes.c: Use it.  Update users.
2018-11-11 16:25:36 +01:00
Jan Nieuwenhuizen 6b5ac57602
build: Simplify: cater for one compiler at a time.
* build-aux/build-cc.sh: Remove.
* build-aux/build-cc32.sh: Remove.
* build-aux/build-cc64.sh: Remove.
* build-aux/build-x86_64-mes.sh: Remove.
* build-aux/cc-mes.sh: Remove.
* build-aux/cc-x86_64-mes.sh: Remove.
* build-aux/cc32-mes.sh: Remove.
* build-aux/cc64-mes.sh: Remove.
* build-aux/test64.sh: Remove.
* build-aux/bootstrap-mes.sh: New file.
* build-aux/config.make.in: New file.
* build-aux/config.status.in: New file.
* build-aux/test-cc.sh: New file.
* .gitignore: Update.
* build-aux/GNUmakefile.in: Update.
* build-aux/build-guile.sh: Update.
* build-aux/build-mes.sh: Update.
* build-aux/build.sh.in: Update.
* build-aux/cc.sh: Update.
* build-aux/check-boot.sh: Update.
* build-aux/check-mes.sh: Update.
* build-aux/check-mescc.sh: Update.
* build-aux/check-tcc.sh: Update.
* build-aux/check.sh.in: Update.
* build-aux/config.sh: Update.
* build-aux/export.make: Update.
* build-aux/install.sh.in: Update.
* build-aux/pre-inst-env.in: Update.
* build-aux/test.sh: Update.
* build-aux/uninstall.sh.in: Update.
* configure: Update.
* configure.sh: Update.
* module/mescc/i386/as.scm: Update.
* module/mescc/preprocess.scm: Update.
* module/mescc/x86_64/as.scm: Update.
* scripts/mescc.in: Update.
* tests/psyntax.test: Update.
2018-11-06 20:29:35 +01:00
Jan Nieuwenhuizen 5d8e44de2c
test: Add performance test.
* module/mes/test.scm (pass-if-timeout): New macro.
* tests/perform.test: New test.
* build-aux/check-mes.sh (tests): Run it.
2018-10-21 12:04:25 +02:00
Jan Nieuwenhuizen 00dc02757b
mes: Print backtrace upon exception.
* mes/module/mes/catch.mes (display-backtrace,
frame-function): New function.
(%eh): Use them.
2018-10-20 18:24:37 +02:00
Jan Nieuwenhuizen 7da67941e2
core: Add module-define!
* src/module.c (module_define_x, module_printer): New function.
(make_initial_module): Use them.
* tests/srfi-0.test: Test it.
* src/mes.c (display_m0): Remove.  Update callers.
* mes/module/mes/fluids.mes (make-fluid): Rewrite.
* tests/macro.test: Test it.
* mes/module/mes/boot-0.scm.in (module-define!): Remove.
* mes/module/mes/boot-02.scm: Likewise.
* module/mes/misc.scm (pk, warn): New function.
* build-aux/check-mes.sh (tests): Run tests.
2018-10-14 09:10:30 +02:00
Jan Nieuwenhuizen 3e5d775b3b
mes: with-fluids: Fix reset.
* mes/module/mes/fluids.mes (with-fluids): Fix reset.
* tests/fluids.test (report): Remove Mes failure expectation.
2018-10-15 10:39:02 +02:00
Jan Nieuwenhuizen a155a0a9a2
core: Support \xNN in reader. Fixes tcc-boot running on Mes.
* src/reader.c (reader_read_string): Support \xNN.  Fixes Guix
bootstrap chain; i.e., compilation of gcc-2.95.3 using tcc-boot.
* tests/base.test ("reader: \\x08"): Test it.
* scaffold/tests/17-compare-char.c: Likewise, for mescc.
* build-aux/check-mescc.sh (tests): Run it.
2018-12-13 18:19:43 +01:00
Jan Nieuwenhuizen a8a32a5280
tests: Expect srfi-13 failure, MesCC more resembles Gcc.
* tests/srfi-13.test (report): Expect INT-MIN failure for x86.
2018-10-07 14:14:50 +02:00
Jan Nieuwenhuizen b31d431b5d
mes: Support fold-right 3.
* mes/module/srfi/srfi-1.mes (fold-right): Support fold-right 3.
* tests/srfi-1.test ("fold-right-3"): Test it.
2018-10-06 21:05:43 +02:00
Jan Nieuwenhuizen f1778a7a0c
Add missing copyright headers.
* .dir-locals.el: Add copyright header.
* AUTHORS: Likewise.
* HACKING: Likewise.
* INSTALL: Likewise.
* README: Likewise.
* build-aux/export.make: Likewise.
* build-aux/setup-mes.sh: Likewise.
* configure.sh: Likewise.
* install.sh: Likewise.
* scaffold/tests/90-goto-var.c: Likewise.
* scaffold/tests/91-goto-array.c: Likewise.
* tests/read.test: Likewise.
* uninstall.sh: Likewise.
* doc/fosdem/beamercolorthemeX.sty:
* doc/fosdem/beamerthemeX.sty:
* doc/fosdem/html.sty: Remove.
* doc/fosdem/README: New file.
* doc/images/README: New file.
2018-07-23 19:10:34 +02:00
Jan Nieuwenhuizen 72cb975213
GNU Mes.
Throughout, make these changes

   Copyright headers: GNU Mes
   First mention of name: GNU Mes
   Website: https://www.gnu.org/software/mes
   Git:     git://git.savannah.gnu.org/mes.git
2018-07-22 14:24:36 +02:00
Jan Nieuwenhuizen 87269a16f6
core: Document number->string INT-MIN failure with gcc-x86.
* src/mes.c (scm_symbol_arch, scm_symbol_compiler): New symbol.
  (mes_symbols, bload_env): Add them.
  (scm_symbol_gnuc, scm_symbol_mesc): Remove.
* scaffold/mini-mes.c: Likewise.
* module/mes/mes-0.scm (%arch, %compiler): New public variable.
* tests/srfi-13.test: Expect number->string INT-MIN to fail for
  gcc-x86.
* HACKING (Bugs): Add it.
2018-07-21 15:20:01 +02:00
Jan Nieuwenhuizen 4f2c685753
build: Refactor mes tests.
* build-aux/check-mes.sh: New file.
* check.sh: Invoke it for Guile and Mes.
* .gitignore: Ignore new guile logs.
* mes/module/mes/boot-0.scm: Ignore some standard Guile options.
* module/mes/test.scm: Make a module.
* tests/base.test: Use it.  Make a module, support invoking with Guile
  or Mes alike.
* tests/boot.test: Likewise.
* tests/catch.test: Likewise.
* tests/closure.test: Likewise.
* tests/cwv.test: Likewise.
* tests/display.test: Likewise.
* tests/fluids.test: Likewise.
* tests/getopt-long.test: Likewise.
* tests/guile.test: Likewise.
* tests/let-syntax.test: Likewise.
* tests/let.test: Likewise.
* tests/match.test: Likewise.
* tests/math.test: Likewise.
* tests/module.test: Likewise.
* tests/optargs.test: Likewise.
* tests/peg.test: Likewise.
* tests/pmatch.test: Likewise.
* tests/psyntax.test: Likewise.
* tests/quasiquote.test: Likewise.
* tests/read.test: Likewise.
* tests/scm.test: Likewise.
* tests/srfi-13.test: Likewise.
* tests/srfi-14.test: Likewise.
* tests/srfi-16.test: Likewise.
* tests/srfi-1.test: Likewise.
* tests/srfi-43.test: Likewise.
* tests/srfi-9.test: Likewise.
* tests/syntax.test: Likewise.
* tests/vector.test: Likewise.
* tests/base.test-guile: Remove.
* tests/boot.test-guile: Remove.
* tests/catch.test-guile: Remove.
* tests/closure.test-guile: Remove.
* tests/cwv.test-guile: Remove.
* tests/display.test-guile: Remove.
* tests/fluids.test-guile: Remove.
* tests/getopt-long.test-guile: Remove.
* tests/guile.test-guile: Remove.
* tests/let-syntax.test-guile: Remove.
* tests/let.test-guile: Remove.
* tests/match.test-guile: Remove.
* tests/math.test-guile: Remove.
* tests/module.test-guile: Remove.
* tests/optargs.test-guile: Remove.
* tests/peg.test-guile: Remove.
* tests/pmatch.test-guile: Remove.
* tests/psyntax.test-guile: Remove.
* tests/quasiquote.test-guile: Remove.
* tests/read.test-guile: Remove.
* tests/scm.test-guile: Remove.
* tests/srfi-13.test-guile: Remove.
* tests/srfi-14.test-guile: Remove.
* tests/srfi-16.test-guile: Remove.
* tests/srfi-1.test-guile: Remove.
* tests/srfi-43.test-guile: Remove.
* tests/srfi-9.test-guile: Remove.
* tests/syntax.test-guile: Remove.
* tests/vector.test-guile: Remove.
2018-07-21 13:48:50 +02:00
Jan Nieuwenhuizen 542289a3c6
build: Separate Mes and Guile modules.
* scaffold/gc.scm: Move from guile/gc.scm.
* guile/: Remove.
* module/language/paren.mes: Remove.
* mes/module/mes/base.mes: Move from module/mes/.
* mes/module/mes/boot-0.scm: Likewise.
* mes/module/mes/boot-00.scm: Likewise.
* mes/module/mes/boot-01.scm: Likewise.
* mes/module/mes/boot-02.scm: Likewise.
* mes/module/mes/catch.mes: Likewise.
* mes/module/mes/display.mes: Likewise.
* mes/module/mes/fluids.mes: Likewise.
* mes/module/mes/getopt-long.mes: Likewise.
* mes/module/mes/guile.mes: Likewise.
* mes/module/mes/lalr.mes: Likewise.
* mes/module/mes/lalr.scm: Likewise.
* mes/module/mes/let.mes: Likewise.
* mes/module/mes/match.mes: Likewise.
* mes/module/mes/match.scm: Likewise.
* mes/module/mes/mescc.mes: Likewise.
* mes/module/mes/misc.mes: Likewise.
* mes/module/mes/module.mes: Likewise.
* mes/module/mes/optargs.mes: Likewise.
* mes/module/mes/optargs.scm: Likewise.
* mes/module/mes/peg.mes: Likewise.
* mes/module/mes/peg/cache.scm: Likewise.
* mes/module/mes/peg/codegen.scm: Likewise.
* mes/module/mes/peg/simplify-tree.scm: Likewise.
* mes/module/mes/peg/string-peg.scm: Likewise.
* mes/module/mes/peg/using-parsers.scm: Likewise.
* mes/module/mes/pmatch.mes: Likewise.
* mes/module/mes/pmatch.scm: Likewise.
* mes/module/mes/posix.mes: Likewise.
* mes/module/mes/pretty-print.mes: Likewise.
* mes/module/mes/pretty-print.scm: Likewise.
* mes/module/mes/psyntax-0.mes: Likewise.
* mes/module/mes/psyntax-1.mes: Likewise.
* mes/module/mes/psyntax.mes: Likewise.
* mes/module/mes/psyntax.pp: Likewise.
* mes/module/mes/psyntax.ss: Likewise.
* mes/module/mes/quasiquote.mes: Likewise.
* mes/module/mes/quasisyntax.mes: Likewise.
* mes/module/mes/quasisyntax.scm: Likewise.
* mes/module/mes/repl.mes: Likewise.
* mes/module/mes/scm.mes: Likewise.
* mes/module/mes/syntax.mes: Likewise.
* mes/module/mes/syntax.scm: Likewise.
* mes/module/mes/test.mes: Likewise.
* mes/module/mes/tiny-0.mes: Likewise.
* mes/module/mes/type-0.mes: Likewise.
* mes/module/mescc/M1.mes: Likewise.
* mes/module/mescc/as.mes: Likewise.
* mes/module/mescc/bytevectors.mes: Likewise.
* mes/module/mescc/compile.mes: Likewise.
* mes/module/mescc/i386/as.mes: Likewise.
* mes/module/mescc/info.mes: Likewise.
* mes/module/mescc/mescc.mes: Likewise.
* mes/module/mescc/preprocess.mes: Likewise.
* mes/module/nyacc/lalr.mes: Likewise.
* mes/module/nyacc/lang/c99/cpp.mes: Likewise.
* mes/module/nyacc/lang/c99/parser.mes: Likewise.
* mes/module/nyacc/lang/c99/pprint.mes: Likewise.
* mes/module/nyacc/lang/calc/parser.mes: Likewise.
* mes/module/nyacc/lang/util.mes: Likewise.
* mes/module/nyacc/lex.mes: Likewise.
* mes/module/nyacc/parse.mes: Likewise.
* mes/module/nyacc/util.mes: Likewise.
* mes/module/rnrs/arithmetic/bitwise.mes: Likewise.
* mes/module/srfi/srfi-0.mes: Likewise.
* mes/module/srfi/srfi-1.mes: Likewise.
* mes/module/srfi/srfi-1.scm: Likewise.
* mes/module/srfi/srfi-13.mes: Likewise.
* mes/module/srfi/srfi-14.mes: Likewise.
* mes/module/srfi/srfi-16.mes: Likewise.
* mes/module/srfi/srfi-16.scm: Likewise.
* mes/module/srfi/srfi-26.mes: Likewise.
* mes/module/srfi/srfi-26.scm: Likewise.
* mes/module/srfi/srfi-43.mes: Likewise.
* mes/module/srfi/srfi-8.mes: Likewise.
* mes/module/srfi/srfi-9.mes: Likewise.
* mes/module/srfi/srfi-9/gnu.mes: Likewise.
* mes/module/sxml/xpath.mes: Likewise.
* mes/module/sxml/xpath.scm: Likewise.
* module/mes/mes-0.scm: Likewise.
* build-aux/build-guile.sh: Update for new layout.
* build-aux/build-mes.sh: Likewise.
* build-aux/check-boot.sh: Likewise.
* build-aux/check-mescc.sh: Likewise.
* install.sh: Likewise.
* scaffold/boot/51-module.scm: Likewise.
* scaffold/boot/52-define-module.scm: Likewise.
* scripts/mescc: Likewise.
* src/mes.c: Likewise.
* tests/base.test-guile: Likewise.
* tests/boot.test: Likewise.
* tests/srfi-9.test: Likewise.
* mes/include: New symlink.
* mes/lib: New symlink.
* AUTHORS: Update file names.
2018-07-21 07:15:52 +02:00
Jan Nieuwenhuizen cfda148e1e
mescc: Tinycc support: Minimal float support.
* lib/libc+tcc.c (ldexp, strtod, strtof, strtold): New stub.
* include/math.h (ldexp): Declare.
* include/stdlib.h (strtod, strtof, strtold): Declare.
* module/mes/scm.mes (string->number): Minimal float support.
  (inexact->exact): New function.
* tests/math.test ("string->number"): Test it.
* module/language/c99/compiler.mes (ast->type): Handle float type.
  (type->info): Likewise.
  (cstring->int): Rename from cstring->number.  Update callers.
  (cstring->float): New function.
  (expr->accu): Use it.
2018-05-18 15:28:05 +02:00
Jan Nieuwenhuizen 1cd97f1172
mes: Add unfold.
* module/srfi/srfi-1.mes (unfold): New function.
2018-05-20 13:04:20 +02:00
Jan Nieuwenhuizen 479a5ef7f1
mes: Add const.
* module/mes/scm.mes (const): New function.
* tests/scm.test ("const"): Test it.
2018-05-20 13:18:36 +02:00
Jan Nieuwenhuizen c4abd50a53
core: Add logxor.
* src/math.c (logxor): New function.
* tests/math.test ("logxor"): Test it.
2018-05-16 22:30:08 +02:00