Jan (janneke) Nieuwenhuizen
6ca9855f70
tests: string-join: Be noisy.
...
* scaffold/boot/50-string-join.scm ("string-join\n"): Avoid exit 0
without output.
2021-01-01 16:19:45 +01:00
Jan (janneke) Nieuwenhuizen
90b1ecac9f
mes: simple-format: Use core display.
...
* mes/module/mes/simple-format.mes: Do not import (mes display).
2021-01-01 16:19:45 +01:00
Jan (janneke) Nieuwenhuizen
b3f5007302
mes: Resurrect backtraces.
...
* mes/module/mes/catch.mes (%eh): Resurrect backtraces.
(display-frame): New function.
(display-backtrace): Use it.
2021-01-01 16:19:45 +01:00
Jan (janneke) Nieuwenhuizen
d0c98e5796
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.
2021-01-01 16:19:45 +01:00
Jan (janneke) Nieuwenhuizen
3a06e2685d
.dir-locals: Add test macro indentation.
...
* .dir-locals.el (scheme-mode): Add indentation for pass-if,
pass-if-not, pass-if-eq, pass-if-equal, expect-fail, pass-if-timeout.
2021-01-01 16:19:44 +01:00
Jan (janneke) Nieuwenhuizen
fa27e87268
mescc: Use (format (current-error-port) ...) instead of stderr.
...
* module/mescc/M1.scm: Use (format (current-error-port) ...) instead of
stderr.
* module/mescc/compile.scm: Likewise.
* module/mescc/mescc.scm: Likewise.
* module/mescc/preprocess.scm: Likewise.
2021-01-01 16:19:44 +01:00
Jan (janneke) Nieuwenhuizen
d237c18ac2
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.
2021-01-01 16:19:44 +01:00
Jan (janneke) Nieuwenhuizen
ecb1551b9e
core: Avoid Floating point exception dividing negative numbers.
...
This fixes
kaem --verbose --strict
bin/mes-m2 -c '(display (/ -1 1))'
* src/math.c (divide): Use signed division.
2021-01-01 16:19:44 +01:00
Jan (janneke) Nieuwenhuizen
56f9235c10
Mes C Library: m2/execve.c: Remove specialization.
...
* lib/linux/execve.c (execve): Cater for M2-Planet.
* lib/m2/execve.c: Remove.
* kaem.run: Update accordingly.
* simple.make (M2_SOURCES): Likewise.
2021-01-01 16:19:44 +01:00
Jan (janneke) Nieuwenhuizen
01816e1f18
Mes C Library: m2/getcwd.c: Remove specialization.
...
* lib/posix/getcwd.c (getcwd): Cater for M2-Planet.
* lib/m2/getcwd.c: Remove.
* kaem.run: Update accordingly.
* simple.make (M2_SOURCES): Likewise.
2021-01-01 16:19:44 +01:00
Jan (janneke) Nieuwenhuizen
ff04def66e
Mes C Library: m2/ioctl.c: Remove specialization.
...
* lib/stub/ioctl.c (ioctl3): Move to...
* lib/stub/ioctl3.c: ...new file.
* lib/m2/ioctl3.c: Move to...
* lib/linux/ioctl3.c: ...here.
* include/mes/lib.h (ioctl3): Declare it.
* lib/m2/isatty.c (isatty): Use it.
* build-aux/configure-lib.sh (libc_SOURCES): Include it; move
lib/linux/ioctl.c to ...
(libc_gnu_SOURCES): ... here.
* kaem.run: Update accordingly.
* simple.make (M2_SOURCES): Likewise.
* simple.sh (compiler): Likewise.
2021-01-01 16:19:43 +01:00
Jan (janneke) Nieuwenhuizen
81c7f8b37c
Mes C Library: m2/waitpid.c: Remove specialization.
...
* lib/linux/waitpid.c: Cater for M2-Planet.
* lib/m2/waitpid.c: Remove.
* kaem.run: Update accordingly.
* simple.make (M2_SOURCES, M2_TODO): Likewise.
2021-01-01 16:19:43 +01:00
Jan (janneke) Nieuwenhuizen
9e492c03eb
Mes C Library: m2/ntoab.c: Remove specialization.
...
* lib/mes/ntoab.c (__mesabi_uldiv)[__M2_PLANET__ || !(__MESC__ &&
__arm__)]: New function.
* lib/mes/ntoab.c (ntoab): Use it to cater for M2-Planet.
* lib/m2/ntoab.c: Remove.
* kaem.run: Update accordingly.
* simple.make (M2_SOURCES, (M2_TODO): Likewise.
2021-01-01 16:19:43 +01:00
Jan (janneke) Nieuwenhuizen
9967760b46
build: Resurrect simple.sh.
...
* simple.sh: Do not attempt to build multiple C files with mescc.
Update for new and split C files.
2021-01-01 16:19:43 +01:00
Jan (janneke) Nieuwenhuizen
968adc4f37
guix: m2-planet: Update to 1.7.0.
...
* guix/git/mes.scm (m2-planet)[source]: Update to 1.7.0.
[arguments]: Add CC to make-flags. Update sha256sum patch.
2021-01-01 16:19:43 +01:00
Jan (janneke) Nieuwenhuizen
72fe3946bf
guix: mescc-tools: Update to 1.1.0.
...
* guix/git/mes.scm (mescc-tools)[source]: Update to 1.1.0.
[arguments]: Update sha256sum patch.
2021-01-01 16:19:43 +01:00
Jan (janneke) Nieuwenhuizen
cf5e1022ce
core: Prepare for M2-Planet 1.7.0.
...
* src/eval-apply.c (expand_variable_, apply_builtin): Declare variables
at toplevel.
* src/gc.c (gc_cellcpy, gc_loop, gc_dump_arena): Likewise.
* src/hash.c (hash_table_printer): Likewise.
* src/lib.c (equal2_p): Likewise.
* src/math.c (greater_p, less_p, is_p, minus, plus, divide, multiply,
logand, logior, logxor): Likewise.
* src/posix.c (current_input_port, execl_): Likewise.
* src/reader.c (reader_read_string): Likewise.
* src/stack.c (make_stack): Likewise.
* src/string.c (list_to_cstring, bytes_to_list, string_append):
Likewise.
* src/struct.c (make_struct): Likewise.
* src/vector.c (vector_to_list): Likewise.
2021-01-01 16:19:43 +01:00
Jan (janneke) Nieuwenhuizen
ab13a2ee38
mescc: Mes C Library: Prepare for M2-Planet 1.7.0.
...
* lib/m2/ntoab.c (ntoab): Declare variables at toplevel.
* lib/mes/abtol.c (abtol): Likewise.
* lib/posix/getenv.c (getenv): Likewise.
* lib/posix/setenv.c (setenv): Likewise.
2021-01-01 16:19:42 +01:00
Jan (janneke) Nieuwenhuizen
ca31626469
mescc: Mes C Library: isatty: Use fixed array size for M2-Planet.
...
* lib/m2/isatty.c (struct ktermios)[c_cc]: Hardcode to size 19.
2021-01-01 16:19:42 +01:00
Jan (janneke) Nieuwenhuizen
c04693bd71
mescc: Mes C Library: Update M2-Planet macros.
...
* lib/m2/x86/x86_defs.M1: Update from M2-Planet 1.7.0.
2021-01-01 16:19:42 +01:00
Jan (janneke) Nieuwenhuizen
0a41d94945
mes: compatibility: Move (mes pmatch) to (system base pmatch).
...
* mes/module/system/base/pmatch.scm: Move from mes/pmatch.scm. Update
users.
2021-01-01 16:19:42 +01:00
Jan (janneke) Nieuwenhuizen
f67001e082
mes: compatibility: Make base.mes pure guile.
...
* mes/module/mes/type-0.mes (procedure?): New function. Rewrite
without `cond' from
* mes/module/mes/base.mes (procedure?): here; Remove.
2021-01-01 16:19:42 +01:00
Jan (janneke) Nieuwenhuizen
c7b5ecc0da
build: Cater for M2-Planet.
...
* configure: Drop MES_SEED, support M2-Planet.
* kaem.run: Also build bin/mes.
* build-aux/bootstrap.sh.in: Run kaem bootstrap.
* build-aux/build.sh.in: Run kaem bootstrap. Build bin/mes. Update
scripts and users.
* build-aux/install.sh.in: Install all built bin/mes-* flavours.
2021-01-01 16:19:40 +01:00
Jan (janneke) Nieuwenhuizen
0f86bb583a
guix: Update M2-Planet to 1fc2aeab483208bd2ba117b21df3894c182470ec.
...
* guix/git/mes.scm (m2-planet): Update to 1fc2aeab483208bd2ba117b21df3894c182470ec.
* lib/m2/x86/x86_defs.M1: Update from M2-Planet.
2021-01-01 16:19:13 +01:00
Jan (janneke) Nieuwenhuizen
94517e295f
guix: Add m2-planet.
...
* guix/git/mes.scm (m2-planet): New variable.
2021-01-01 16:19:13 +01:00
Jan (janneke) Nieuwenhuizen
075baa0b67
core: Use casting functions.
...
Silence all casting errors by using casting functions.
* src/cc.c (cast_charp_to_scmp, cast_charp_to_scmpp,
cast_voidp_to_charp, cast_scmp_to_long, cast_scmp_to_charp): New function.
* src/m2.c (cast_charp_to_scmp, cast_charp_to_scmpp,
cast_voidp_to_charp, cast_scmp_to_long, cast_scmp_to_charp): New function.
* include/mes/mes.h: Declare them.
(struct scm): Add car_value, cdr_value, function.
(g_continuations): Change to long.
* src/mes.c: Silence all casting errors by using casting functions.
2021-01-01 16:19:13 +01:00
Jan (janneke) Nieuwenhuizen
27b0405853
mescc: Mes C Library: Use casting functions.
...
Silence all casting errors by using casting functions.
* lib/mes/cast.c: New file.
* build-aux/configure-lib.sh (libmes_SOURCES): Add it.
* lib/m2/cast.c: New file.
* kaem.run: Add it.
* simple.make: Add them both.
* include/mes/lib.h: Add cast prototypes.
* include/m2/lib.h: Likewise.
* lib/linux/_getcwd.c (_getcwd): Use them.
* lib/linux/access.c (access): Likewise.
* lib/linux/brk.c (brk): Likewise.
* lib/linux/chmod.c (chmod): Likewise.
* lib/linux/clock_gettime.c (clock_gettime): Likewise.
* lib/linux/gettimeofday.c (gettimeofday): Likewise.
* lib/linux/unlink.c (unlink): Likewise.
* lib/mes/fdputc.c (fdputc): Likewise.
* lib/stdio/putchar.c (putchar): Likewise.
* lib/stdlib/malloc.c (malloc): Likewise.
2021-01-01 16:19:13 +01:00
Jan (janneke) Nieuwenhuizen
2ad729ccfb
core: Switch to pointer cells.
...
Run
build-aux/pointer.sh
* include/mes/macros.h: Remove.
* src/*.c: Update.
* include/mes/*.h: Update.
* simple.make: Update.
* kaem.run: Update.
2021-01-01 16:19:13 +01:00
Jan (janneke) Nieuwenhuizen
d6ea65ea22
build: Update snarfer.
...
* build-aux/mes-snarf.scm (symbol->header): Update for pointer cells.
(snarf-symbols): Likewise.
(snarf-functions): Likewise.
2021-01-01 16:19:12 +01:00
Jan (janneke) Nieuwenhuizen
0a5c953eda
core: Drop support for number based cells.
...
This removes the POINTER_CELLS define and all its references.
* simple.make (CFLAGS): Remove -D POINTER_CELLS.
* include/mes/mes.h: Remove #define POINTER_CELLS.
* include/mes/cc.h: Remove !POINTER_CELLS branches.
* include/mes/macros.h: Likewise.
* src/gc.c: Likewise.
* src/symbol.c: Likewise.
* src/test/gc.c: Likewise.
2021-01-01 16:19:12 +01:00
Jan (janneke) Nieuwenhuizen
53cc732026
core: gc: Pointer cells: Drop cells->news->cells flipping.
...
* src/gc.c (gc_init): Undo doubling of initial memory.
(gc_init_news)[!GC_NOFLIP]: Remove.
(gc_)[!GC_NOFLIP]: Remove symbol relocation.
(gc)[!GC_NOFLIP]: Remove second gc.
2021-01-01 16:19:12 +01:00
Jan (janneke) Nieuwenhuizen
d6d062332d
core: gc: Abort upon broken heart failure.
...
* src/gc.c (gc_cellcpy, gc_loop): Abort upon broken heart failure.
2021-01-01 16:19:12 +01:00
Jan (janneke) Nieuwenhuizen
91acf14cec
core: gc: Enable memory dump debugging.
...
* src/gc.c (gc): If MES_DUMP is set, dump arena. [POINTER_CELLS &&
!GC_NOFLIP]: Run gc_ twice to enable comparing memory dumps.
2021-01-01 16:19:12 +01:00
Jan (janneke) Nieuwenhuizen
63db903dd2
core: gc: Add gc_dump_arena.
...
* src/gc.c (dumpc, dumps, gc_dump_register, gc_dump_state,
gc_dump_stack, gc_dump_arena): New function.
2021-01-01 16:19:12 +01:00
Jan (janneke) Nieuwenhuizen
294011d6f5
core: Pointer cells: Allow smaller memory footprint using cellcpy.
...
* src/gc.c (gc_init)[GC_NOFLIP]: Do not use double sized arena.
(gc_cellcpy): New function.
* src/gc.c (gc_flip): Use it, do not flip.
(gc_init_news)[GC_NOFLIP]: Update.
2021-01-01 16:19:12 +01:00
Jan (janneke) Nieuwenhuizen
1f8cf375bd
test/gc: Add three extra gc's.
...
* src/test/gc.c (test_gc): Add three extra gc's.
2021-01-01 16:19:11 +01:00
Jan (janneke) Nieuwenhuizen
550753372c
test/gc: struct.
...
* src/test/gc.c (test_struct): New function.
(main): Call it.
2021-01-01 16:19:11 +01:00
Jan (janneke) Nieuwenhuizen
8a83f9fbfe
test/gc: vector.
...
* src/test/gc.c (test_vector): New function.
(main): Call it.
(print_arena): New function.
(test_gc): Call it.
2021-01-01 16:19:11 +01:00
Jan (janneke) Nieuwenhuizen
4a5d8fde29
test/gc: string.
...
* src/test/gc.c (test_string): New function.
(main): Call it.
2021-01-01 16:19:11 +01:00
Jan (janneke) Nieuwenhuizen
c1f457bbf9
test/gc: list.
...
* src/test/gc.c (test_list): New function.
(main): Call it.
2021-01-01 16:19:11 +01:00
Jan (janneke) Nieuwenhuizen
d5f082bfc6
test/gc: cons.
2021-01-01 16:19:11 +01:00
Jan (janneke) Nieuwenhuizen
3826af002d
test/gc: number.
...
* src/test/gc.c (test_number): New function.
(main): Call it.
2021-01-01 16:19:11 +01:00
Jan (janneke) Nieuwenhuizen
f060a9fe09
test/gc: empty.
...
* src/test/gc.c (test_empty): New function.
2021-01-01 16:19:10 +01:00
Jan (janneke) Nieuwenhuizen
bd3571c82d
core: eval-apply: Prepare for M2-Planet.
...
* src/eval-apply.c (apply_builtin): Split M2-Planet specific and CC
specifi part off to ..
* src/cc.c: New file, and
* build-aux/configure-lib.sh (mes_SOURCES): Add it.
* src/m2.c: New file.
* simple.make (MES_SOURCES, M2_SOURCES): Likewise.
2021-01-01 16:19:10 +01:00
Jan (janneke) Nieuwenhuizen
f33f0b3d26
core: display: Prepare for pointer cells, M2-Planet.
...
Rewrite C-constructs not supported by M2-Planet
if (foo) -> if (foo != 0)
if (!foo) -> if (foo == 0)
; -> 0;
// ... -> /* ... */
* src/display.c (display_helper): Use cell_ref.
2021-01-01 16:19:10 +01:00
Jan (janneke) Nieuwenhuizen
e26f2eaa13
core: gc: Prepare for pointer cells, M2-Planet.
...
* include/mes/mes.h (cell_zero): Declare.
* src/gc.c (gc_init): Initialize it.
(gc_init_news): Likewise.
2021-01-01 16:19:10 +01:00
Jan (janneke) Nieuwenhuizen
df871e695e
core: Remove cell_call_with_current_continuation special.
...
* include/mes/symbols.h (cell_call_with_current_continuation): Remove.
* src/eval-apply.c (eval_apply): Update to use
cell_symbol_call_with_current_continuation.
* src/symbol.c (init_symbols_): Remove inititialization.
2021-01-01 16:19:10 +01:00
Jan (janneke) Nieuwenhuizen
7c27a8db6a
core: Remove cell_begin special.
...
* include/mes/symbols.h (cell_begin): Remove.
* src/eval-apply.c (eval_apply): Update to use cell_symbol_begin.
* src/symbol.c (init_symbols_): Remove initialization.
2021-01-01 16:19:10 +01:00
Jan (janneke) Nieuwenhuizen
a2905d1a45
core: Remove unused symbols.
...
* include/mes/symbols.h (cell_symbol_dot, cell_symbol_read_input_file,
cell_symbol_write, cell_symbol_display): Remove
* src/symbol.c (init_symbols_): Remove initializations.
2021-01-01 16:19:09 +01:00
Jan (janneke) Nieuwenhuizen
6e158f67ae
core: builtins: MES_MINI.
...
* include/mes/mes.h (g_mini): New global.
* src/mes.c (init): Initialize it with environment variable MES_MINI.
* src/builtins.c (mes_builtins): Register a minimal set of builtins
when g_mini.
2021-01-01 16:19:09 +01:00