Commit Graph

53 Commits

Author SHA1 Message Date
Jan Nieuwenhuizen ac9c18f8b8
doc: Release update.
* BLURB: Release update.
* HACKING: Remove roadmap.
* INSTALL: Release update.
* NEWS: Add 0.21 section.
* README: Release update.
* ROADMAP: New file.
* configure.sh: Release update.
* doc/announce/ANNOUNCE-0.21: New file.
* doc/mes.texi: Release update.
2019-11-04 19:59:13 +01:00
Jan Nieuwenhuizen c6cceb47f3
build: Update script help and usage.
* doc/mes.texi (Invoking mesar): New section.
* mes/module/mes/boot-0.scm: Add one line help description.
* module/mescc.scm (parse-opts): Likewise.
* scripts/diff.scm (main): Add -h,--help, -v,--version.
* scripts/mesar.in: Likewise.
2019-11-04 23:56:15 +01:00
Jan Nieuwenhuizen 092626243a
mes: Fix -c, --command.
* mes/module/mes/boot-0.scm: Prepend 'begin to expr list.
2019-10-10 13:22:12 +02:00
Jan Nieuwenhuizen ef29ade04b
mescc: Mes C Library: Add buffered read.
* lib/mes/__buffered_read.c: New file.
* build-aux/configure-lib.sh (libc_SOURCES): Add it.  Also add memmove.c.
(libc_tcc_SOURCES): Remove memmove.c
* lib/linux/close.c (close): Clear read buffer.
* lib/linux/_open3.c (_open3): Likewise.
* lib/linux/lseek.c (lseek): Correct for read buffer.
* lib/stdio/fwrite.c (fwrite): Likewise.
* lib/posix/read.c (read): Call __buffered_read.
* lib/posix/write.c (write): Add FIXME note about buffered reads.
* simple.sh: Update.
2019-07-27 22:58:49 +02: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
Danny Milosavljevic 4b5d5017c4
Fix remainder handling.
* mes/module/mes/scm.mes (number->string): Fix remainder handling.
* build-aux/check-mescc.sh (XFAIL_TESTS): Remove
lib/tests/scaffold/60-math.c.
2019-07-05 15:52:04 +02:00
Jan Nieuwenhuizen 5dc245e739
build: Simplify.
core: Make mes src/ c files separate compilation units.

* include/mes/constants.h: New file.
* include/mes/macros.h: New file.
* include/mes/mes.h: New file.
* src/gc.c: Update.
* src/hash.c: Update.
* src/lib.c: Update.
* src/math.c: Update.
* src/mes.c: Update.
* src/module.c: Update.
* src/posix.c: Update.
* src/reader.c: Update.
* src/string.c: Update.
* src/struct.c: Update.
* src/vector.c: Update.

    mes: Update datadir.

* src/mes.c (g_datadir): New global.
(open_boot): Rename from read_boot.
(read_boot): New function.
* mes/module/mes/boot-0.scm: Move from boot-0.scm.in
* configure: Update.
* configure.sh: Update.

    mescc: Create libraries from separate files.

* .gitignore: Update.
* build-aux/bootstrap-mes.sh: Remove.
* build-aux/bootstrap.sh.in: Remove.
* build-aux/build-guile.sh: Update.
* build-aux/build-mes.sh: Update.
* build-aux/build-scaffold.sh: New file.
* build-aux/build.sh.in: Update.
* build-aux/cc.sh: Update.
* build-aux/check-tcc.sh: Remove.
* build-aux/config.sh.in: New file.
* build-aux/config.sh: Remove.
* build-aux/install.sh.in: Update.
* build-aux/test-boot.sh: New file.
* build-aux/test-c.sh: New file.
* build-aux/test-driver: New file.
* build-aux/test-suite.sh: New file.
* build-aux/trace.sh: Update.
* build-aux/uninstall.sh.in: Update.
* configure: Update.
* configure.sh: Update.
* lib/linux/x86-mes-mescc/crt1.c: Move from lib/linux/x86-mes.
* lib/linux/x86-mes-mescc/mini.c: Likewise.
* lib/linux/x86_64-mes-mescc/crt1.c: Move from lib/linux/x86_64-mes.
* lib/linux/x86_64-mes-mescc/mini.c: Likewise.
* lib/linux/x86-mes-gcc/syscall.c: Rename from mes.c.
* lib/linux/x86-mes-mescc/syscall.c: Likewise.
* lib/linux/x86_64-mes-gcc/syscall.c: Likewise.
* lib/linux/x86_64-mes-mescc/syscall.c: Likewise.
* lib/mes/mes_open.c: Include config.h.
* lib/tests/stdio/70-printf-hello.c: Likewise.
* lib/tests/stdio/70-printf-simple.c: Likewise.
* scaffold/gc-test.sh: New file.
* simple.sh: Update.
2019-06-08 15:36:22 +02:00
Jan Nieuwenhuizen 77e75c3142
mes: Bugfix for search-path. Fixes running MesCC on Guile.
* module/mescc/mescc.scm (arch-find): Also look in cwd.
* mes/module/mes/posix.mes (search-path): Do not look in cwd.
2019-05-27 21:51:37 +02:00
Jan (janneke) Nieuwenhuizen 1d56567c50
mes: Support -c EXPR.
* mes/module/mes/boot-0.scm.in: Support -c EXPR.
2019-05-16 00:04:45 +02:00
Jan (janneke) Nieuwenhuizen b969c08205
mes: Support optional port on read.
* mes/module/mes/scm.mes (read): Support optional port on read.
2019-05-16 00:05:47 +02:00
Jan (janneke) Nieuwenhuizen e0eee55bf3
build: Fix mescc installation on Debian.
* build-aux/pre-inst-env.in: Set bindir.
* scripts/mescc.in: Fix configure/prefix issues.
* mes/module/mes/boot-01.scm (integer->char): Remove.
(newline): Use "\n".
(%moduledir): Use string-append.
* mes/module/mes/boot-02.scm: Likewise.
* mes/module/mes/boot-0.scm: Likewise.
2019-05-15 23:26:52 +02:00
Jan Nieuwenhuizen 829cc9cca5
mes: m2: Move force-output to Scheme.
* mes/module/mes/posix.mes (force-output): New function.
* src/posix.c (force_output): Remove.
* src/mes.c (mes_builtins): Remove adding of force-output.
2019-05-05 13:11:33 +02:00
Jan Nieuwenhuizen c5e098bc35
mescc: Mes C Library: Fix isatty.
* lib/posix/isatty.c (isatty): Test ioctl == 0.
* mes/module/mes/boot-0.scm.in: Update: no tty?: read from stdin.
2019-03-02 22:27:39 +01: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 a9bf3bfb12
mes: Remove stray debugging newline output.
* mes/module/mes/guile.mes (open-input-file): Move debugging newline
into debug clause.
2019-02-24 10:49:56 +01:00
Jan Nieuwenhuizen 99ac7b59c4
core: Remove struct definitions for builtins, drop snarfing.
After making a change to the list of builtin functions, run

    cat src/*.i

and move the into

    src/mes.c:mes_builtins ()

and, or also after changing the list of fixed symbols in src/mes.c:mes_symbols (), do

    cat src/*.h > src/builtins.h

* build-aux/build.sh.in: Remove snarfing.
* build-aux/bootstrap.sh.in: Likewise.
* mes/module/mes/display.mes (display):
* mes/module/mes/type-0.mes (cell:type-alist): Remove <cell:function>.
(function?, builtin?): Remove.
* src/builtins.h: New file.
* src/mes.c (TFUNCTION): Remove.
(struct function): Remove.
(apply_builtin): Rewrite from call.
(mes_builtins): Rewrite.
(init_builtin, make_builtin_type, make_builtin, builtin_name,
builtin_arity, builtin, builtin_p, builtin_printer): New function.
2019-01-04 09:55:16 +01:00
Jan Nieuwenhuizen 00289fb651
core: Remove --dump, --load.
* mes/module/mes/boot-0.scm.in (tty?): Remove --dump, --load.
* src/mes.c (bload_env): Remove.
* src/reader.c (dump): Remove.
2018-12-27 16:47:56 +01:00
Jan Nieuwenhuizen 32dcd3a575
doc: Release update.
* AUTHORS: Update.
* HACKING: Update.
* NEWS: Update.
* doc/mes.guix: Update.
* scripts/mescc.in: Update.
* mes/module/mes/boot-0.scm.in: Update.
* doc/announce/ANNOUNCE-0.19: New file.
2018-10-20 09:53:44 +02:00
Jan Nieuwenhuizen e90aed9d1b
mes: assq-ref, assoc-ref: Support alist == #f.
* mes/module/mes/scm.mes (assq-ref): Support alist == #f.
(assoc-ref): Likewise.
2018-12-15 12:56:15 +01:00
Jan Nieuwenhuizen 1ab054002c
core: Add string-ref.
* src/strings.c (string_ref): New function.
* mes/module/mes/scm.mes (string-ref): Remove.
2018-11-16 00:15:50 +01:00
Jan Nieuwenhuizen 6af0b49f09
core: Add string-length.
* src/strings.c (string_length): New function.
* mes/module/mes/scm.mes (string-length): Remove.
2018-11-15 23:51:29 +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 0be3bea141
mes: Remove copy of make-string.
* mes/module/mes/guile.mes (make-string): Remove copy.
2018-11-14 08:19:01 +01:00
Jan Nieuwenhuizen e27e7af055
mes: Oops, %moduledir debug info.
* mes/module/mes/boot-0.scm.in: Oops, %moduledir debug info.
2018-11-11 14:47:14 +01:00
Jan Nieuwenhuizen fb8a6f3408
mes; Add read-line.
* mes/module/mes/guile.mes (read-line): New function.
2018-11-11 16:57:58 +01:00
Jan Nieuwenhuizen c61c6866b5
mes: dirname: Fix for absolute file names.
* mes/module/mes/guile.mes (dirname): Fix absolute files.
2018-11-11 10:15:12 +01:00
Jan Nieuwenhuizen e0a2d540f4
mes: Add file-exists?.
* mes/module/mes/guile.mes (file-exists?): New function.
2018-11-11 10:14:50 +01:00
Jan Nieuwenhuizen e95c5742be
mes: Add with-error-to-file.
* mes/module/mes/guile.mes (with-error-to-file): New function.
2018-11-11 10:14:10 +01:00
Jan Nieuwenhuizen 1f1fa33eaa
mes: system*: Support redirection.
* mes/module/mes/posix.mes (system*): Support redirection.
2018-11-11 10:00:50 +01:00
Jan Nieuwenhuizen 7d2e0f1215
core: Support redirection of stderr.
* include/libmes-mini.h (g_stderr): New global.
* lib/mes/eputc.c (eputc): Use it.
* lib/mes/eputs.c (eputs): Likewise.
* lib/mes/oputc.c (oputc): Likewise.
* lib/mes/oputs.c (oputs): Likewise.
* src/lib.c (display_error_, write_error_): Likewise.
* src/posix.c (write_byte): Likewise.
* src/mes.c (mes_builtins): Likewise.
(main): Iniitalize g_stderr.
* src/posix.c (current_error_port, set_current_error_port): New
function.
* mes/module/mes/boot-0.scm.in (current-output-port,
current-error-port): Remove.
2018-11-11 10:04:03 +01:00
Jan Nieuwenhuizen 06bf0fd6a3
mes: Add ceil, floor, round, inexact->exact.
* mes/module/mes/scm.mes (ceil, floor, round, inexact->exact,
exact->inexact): New function.
2018-10-21 12:07:06 +02:00
Jan Nieuwenhuizen 0e1d98963c
mes: read-string: Take optional port argument.
* src/posix.c (read_string): Take optional port argument.
* mes/module/mes/guile.mes (read-string): Remove.
2018-10-21 12:00:00 +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 67046e1b00
mes: Move pair? to core.
* src/lib.c (pair_p): New function.  Gains 8% performance on MesCC.
2018-10-18 20:06:10 +02:00
Jan Nieuwenhuizen 5ed45a4e24
mes: Move assoc to core.
* mes/mes.c (assoc_string, assoc): New function.
* mes/module/mes/scm.mes (assoc): Remove.  Gains 12% performance for
MesCC.
2018-10-19 22:38:19 +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 16934697f7
core: Add module indirection for variable lookup.
* src/module.c (module_ref, module_variable): New function.
* src/mes.c: Thoughout: Use them.
(assq_ref_env): Remove.
* mes/module/mes/boot-0.scm.in (defined?): Use module-variable.
* mes/module/mes/boot-00.scm (defined?): Likewise.
* mes/module/mes/boot-01.scm (defined?): Likewise.
* mes/module/mes/boot-02.scm (defined?): Likewise.
* scaffold/boot/53-closure-display.scm: Likewise.
2018-10-14 08:30:18 +02:00
Jan Nieuwenhuizen 79c1fe0466
core: Add module type.
* src/module.c: New file.
* build-aux/snarf.sh: Snarf it.
* src/mes.c: Include it.
2018-10-14 08:15:22 +02:00
Jan Nieuwenhuizen 96ca5b4e4b
core: Add cstring_to_symbol.
* src/mes.c (make_symbol): Rename from lookup_symbol_.  Update
callers.
(cstring_to_symbol): New function.
* src/reader.c (reader_read_identifier_or_number): Use it.
2018-10-14 07:38:51 +02:00
Jan Nieuwenhuizen 0068fe533d
core: Add struct type.
* src/struct.c: New file.
* build-aux/snarf.sh: Snarf it.
* src/mes.c: Include it.
2018-10-13 17:34:27 +02:00
Jan Nieuwenhuizen 2d882ee7bb
core: core:cdr: Support port type.
* src/mes.c (cdr_): Support port type.
* mes/module/mes/display.mes (display): Add space between fields.
2018-10-15 12:28:02 +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
Peter De Wachter 053309e4dc
mescc: Exit with non-zero exit code when subprocess fails.
system* returns the result of waitpid. So, suppose that a subprocess
fails with exit code 1. Then the waitpid return value will be 256.
And exit(256) is equivalent to exit(0).

Modified-by: Jan Nieuwenhuizen <janneke@gnu.org>

* mes/module/mes/posix.mes (status:exit-val): New function.
* module/mescc/mescc.scm (assert-system*): Use it.
2018-10-16 20:40:35 +02:00
Jan Nieuwenhuizen f68b169feb
Add missing copyright headers and READMEs.
* ChangeLog: Add copyright header.
* build-aux/GNUmakefile.in (generate-ChangeLog): Append it as copyright footer.
* BOOTSTRAP: Add copyright header.
* scaffold/boot/2f-define-second-lambda.scm: Likewise.
* scaffold/boot/39-global-define-override.scm: Likewise.
* scaffold/boot/3a-global-define-lambda-override.scm: Likewise.
* scaffold/boot/4f-string-split.scm: Likewise.
* scaffold/boot/numbers.scm: Likewise.
* scaffold/gc.scm: Likewise.
* scaffold/b-0.mes: Remove.
* doc/GNU-EVAL-APPLY: Remove.
* doc/announce/README: New file.
* doc/announce/ANNOUNCE: Move from doc/ANNOUNCE.
* doc/announce/ANNOUNCE-0.10: Likewise.
* doc/announce/ANNOUNCE-0.11: Likewise.
* doc/announce/ANNOUNCE-0.12: Likewise.
* doc/announce/ANNOUNCE-0.13: Likewise.
* doc/announce/ANNOUNCE-0.14: Likewise.
* doc/announce/ANNOUNCE-0.15: Likewise.
* doc/announce/ANNOUNCE-0.16: Likewise.
* doc/announce/ANNOUNCE-0.3: Likewise.
* doc/announce/ANNOUNCE-0.4: Likewise.
* doc/announce/ANNOUNCE-0.5: Likewise.
* doc/announce/ANNOUNCE-0.6: Likewise.
* doc/announce/ANNOUNCE-0.7: Likewise.
* doc/announce/ANNOUNCE-0.8: Likewise.
* doc/announce/ANNOUNCE-0.9: Likewise.
* doc/announce/ANNOUNCE-2: Likewise.
* doc/announce/UPDATE-0.13: Likewise.
* doc/fosdem/README: New file.
* doc/fosdem/fosdem.org: Add legalese.
* doc/fosdem/fosdem.pdf: Regenerate.
* doc/images/README: New file.
* mes/module/mes/psyntax.pp.header: New file.
* mes/module/mes/psyntax.pp: Add it to generated file.
2018-07-26 19:17:12 +02:00
Jan Nieuwenhuizen 6c7b391e32
Relicense some taken-from-GNU Guile LGPLv3+ files to GPLv3+.
* mes/module/mes/pmatch.scm: Relicense to GPLv3+.
* mes/module/sxml/xpath.scm: 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.
2018-07-26 20:47:46 +02:00
Jan Nieuwenhuizen a2d54958ff
Relicense some taken-from-GNU Guile LGPLv2+ files to GPLv3+.
* mes/module/mes/pretty-print.scm: Relicense to GPLv3+.
* mes/module/mes/psyntax.ss: Likewise.
* mes/module/srfi/srfi-1.scm: Likewise.
* mes/module/srfi/srfi-16.scm: Likewise.
* mes/module/srfi/srfi-26.scm: Likewise.
* module/mes/getopt-long.scm: Likewise.
2018-07-23 19:11:45 +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 4203a427d0
build: Support --srcdir build.
* build-aux/config.sh: New file.
* build-aux/trace.sh: New file.
* build-aux/GNUmakefile.in: New file.
* configure: Support srcdir configure.
* GNUmakefile: Support srcdir build.
* build-aux/build-cc.sh: Likewise.
* build-aux/build-cc32.sh: Likewise.
* build-aux/build-guile.sh: Likewise.
* build-aux/build-mes.sh: Likewise.
* build-aux/cc-mes.sh: Likewise.
* build-aux/cc.sh: Likewise.
* build-aux/cc32-mes.sh: Likewise.
* build-aux/check-mes.sh: Likewise.
* build-aux/check-mescc.sh: Likewise.
* build-aux/export.make: Likewise.
* build-aux/mes-snarf.scm: Likewise.
* build-aux/pre-inst-env.in: Likewise.
* build-aux/test.sh: Likewise.
* build.sh: Likewise.
* check.sh: Likewise.
* install.sh: Likewise.
* module/mescc/mescc.scm: Likewise.
* scripts/mescc.in: Likewise.
* src/mes.c: Likewise.
2018-07-22 00:43:39 +02:00