Commit Graph

17 Commits

Author SHA1 Message Date
Jan (janneke) Nieuwenhuizen 7562330ec7
build: Release 0.24.2.
* configure (VERSION): Bump to 0.24.2.
* configure.sh (VERSION): Likewise.
* src/symbol.c (MES_VERSION): Likewise.
* mes/module/mes/repl.mes (welcome): Update copyright years.
2023-02-13 09:22:39 +01:00
Jan (janneke) Nieuwenhuizen adb232edd9
kaem: Fix version.
* src/symbol.c (MES_VERSION): Update to 0.24.
2022-05-03 22:52:45 +02:00
Jan (janneke) Nieuwenhuizen 72e371d77f
core: Resurrect gcc-10 support.
* include/mes/mes.h (g_datadir, g_debug, g_buf, g_continuations,
g_symbols, g_symbol_max, g_mini, R0, R1, R2, R3, M0, g_macros, g_ports,
ARENA_SIZE, MAX_ARENA_SIZE, STACK_SIZE, JAM_SIZE, GC_SAFETY, MAX_STRING,
g_arena, cell_arena, cell_zero, g_free, g_symbol, g_stack_array,
g_cells, g_news, g_stack, gc_count, gc_start_time, gc_end_time, gc_time,
__execl_c_argv, __open_boot_buf, __open_boot_file_name, __setenv_buf,
__reader_read_char_buf, g_start_time, __gettimeofday_time,
__get_internal_run_time_ts): Declare extern.
* include/mes/symbols.h ( cell_nil, cell_f, cell_t, cell_dot,
cell_arrow, cell_undefined, cell_unspecified, cell_closure,
cell_circular, cell_vm_apply, cell_vm_apply2, cell_vm_begin,
cell_vm_begin_eval, cell_vm_begin_expand, cell_vm_begin_expand_eval,
cell_vm_begin_expand_macro, cell_vm_begin_expand_primitive_load,
cell_vm_begin_primitive_load, cell_vm_begin_read_input_file,
cell_vm_call_with_current_continuation2, cell_vm_call_with_values2,
cell_vm_eval, cell_vm_eval2, cell_vm_eval_check_func,
cell_vm_eval_define, cell_vm_eval_macro_expand_eval,
cell_vm_eval_macro_expand_expand, cell_vm_eval_pmatch_car,
cell_vm_eval_pmatch_cdr, cell_vm_eval_set_x, cell_vm_evlis,
cell_vm_evlis2, cell_vm_evlis3, cell_vm_if, cell_vm_if_expr,
cell_vm_macro_expand, cell_vm_macro_expand_car,
cell_vm_macro_expand_cdr, cell_vm_macro_expand_define,
cell_vm_macro_expand_define_macro, cell_vm_macro_expand_lambda,
cell_vm_macro_expand_set_x, cell_vm_return, cell_symbol_lambda,
cell_symbol_begin, cell_symbol_if, cell_symbol_quote,
cell_symbol_define, cell_symbol_define_macro, cell_symbol_quasiquote,
cell_symbol_unquote, cell_symbol_unquote_splicing, cell_symbol_syntax,
cell_symbol_quasisyntax, cell_symbol_unsyntax,
cell_symbol_unsyntax_splicing, cell_symbol_set_x, cell_symbol_sc_expand,
cell_symbol_macro_expand, cell_symbol_portable_macro_expand,
cell_symbol_sc_expander_alist, cell_symbol_call_with_values,
cell_symbol_call_with_current_continuation, cell_symbol_boot_module,
cell_symbol_current_module, cell_symbol_primitive_load, cell_symbol_car,
cell_symbol_cdr, cell_symbol_not_a_number, cell_symbol_not_a_pair,
cell_symbol_system_error, cell_symbol_throw,
cell_symbol_unbound_variable, cell_symbol_wrong_number_of_args,
cell_symbol_wrong_type_arg, cell_symbol_buckets, cell_symbol_builtin,
cell_symbol_frame, cell_symbol_hashq_table, cell_symbol_module,
cell_symbol_procedure, cell_symbol_record_type, cell_symbol_size,
cell_symbol_stack, cell_symbol_argv, cell_symbol_mes_datadir,
cell_symbol_mes_version, cell_symbol_internal_time_units_per_second,
cell_symbol_compiler, cell_symbol_arch, cell_symbol_pmatch_car,
cell_symbol_pmatch_cdr, cell_type_bytes, cell_type_char,
cell_type_closure, cell_type_continuation, cell_type_function,
cell_type_keyword, cell_type_macro, cell_type_number, cell_type_pair,
cell_type_port, cell_type_ref, cell_type_special, cell_type_string,
cell_type_struct, cell_type_symbol, cell_type_values,
cell_type_variable, cell_type_vector, cell_type_broken_heart,
cell_symbol_program, cell_symbol_test): Likewise.
* src/globals.c: New file.
* build-aux/configure-lib.sh (mes_SOURCES): Add it.
2021-05-02 14:58:23 +02:00
Jan (janneke) Nieuwenhuizen 795225ec29
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.
2020-12-29 13:38:38 +01:00
Jan (janneke) Nieuwenhuizen 8f2bc16e7a
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.
2020-10-18 15:44:49 +02:00
Jan (janneke) Nieuwenhuizen 3b29abc850
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.
2020-10-18 11:34:32 +02:00
Jan (janneke) Nieuwenhuizen 1cdbadfe98
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.
2020-09-20 11:32:38 +02:00
Jan (janneke) Nieuwenhuizen 020cb3661d
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.
2020-08-18 11:06:15 +02:00
Jan (janneke) Nieuwenhuizen c6fd15469c
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.
2020-08-18 10:40:55 +02:00
Jan (janneke) Nieuwenhuizen f8152da76a
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.
2020-08-18 10:33:56 +02:00
Jan (janneke) Nieuwenhuizen 9e684b9886
boot: Add gc test.
* scaffold/boot/gc.test: New file.
* build-aux/check-boot.sh (TESTS): Add it.
* include/mes/symbols.h (cell_symbol_program): New symbol.
* src/symbol.c (init_symbols_): Initialize it.
* src/mes.c (main): Add it to environment.
2020-08-16 17:36:55 +02:00
Jan (janneke) Nieuwenhuizen d7c4fae997
core: Prepare for M2-Planet: if (foo).
Rewrite C-constructs not supported by M2-Planet

    if (foo)              -> if (foo != 0)

* src/posix.c: Rewrite C-constructs not supported by M2-Planet.
(current_input_port): Likewise.
* src/display.c (display_helper): : Likewise.
* src/eval-apply.c (expand_variable_): : Likewise.
(eval_apply): : Likewise.
* src/mes.c (open_boot): : Likewise.
* src/reader.c (reader_read_identifier_or_number): : Likewise.
* src/symbols.c (init_symbol): : Likewise.
2020-07-18 08:53:42 +02:00
Jan (janneke) Nieuwenhuizen a54f6e9028
core: Prepare for M2-Planet: M2_CELL_SIZE.
* src/gc.c (M2_CELL_SIZE): Hack for missing pointer arithmetic in
M2-Planet.
(gc_init, alloc, make_cell, gc_up_arena, gc_copy, gc_loop, gc_): Use it.
2020-07-16 21:56:49 +02:00
Jan (janneke) Nieuwenhuizen f9a372de13
core: Prepare for pointer cells.
* include/mes/cc.h: Prepare for pointer-based cells.
* include/mes/macros.h[POINTER_CELLS]: Alternative set of macros.
* include/mes/mes.h (struct scm)[POINTER_CELLS]: Alternative definition.
* src/gc.c (copy_cell, copy_news): New function.
* include/mes/mes.h: Declare them.
2020-07-14 15:57:49 +02:00
Jan (janneke) Nieuwenhuizen 4613b070e4
core: Create symbols dynamically.
* include/mes/symbols.h: New file.
* include/mes/mes.hh: Include it.
* include/mes/constants.h: Remove symbol constants.
* src/symbols.c (init_symbols): Create symbols dynamically.
* build-aux/mes-snarf.scm (snarf-symbols): Update.
2020-06-16 15:59:26 +02:00
Jan (janneke) Nieuwenhuizen 781f4f0e6c
core: Remove macros from cell creation: make_char .. make_string.
* src/gc.c (make_char, make_continuation, make_macro, make_number,
make_ref, make_string0, make_string_port): New function.
(make_string): Move from string.c.
* include/mes/macros.h (MAKE_CHAR, MAKE_CONTINUATION, MAKE_MACRO,
MAKE_NUMBER, MAKE_REF, MAKE_STRING0, MAKE_STRING_PORT): Remove macro.
Update users.
* include/mes/m2.h: Likewise.
2020-05-18 22:35:12 +02:00
Jan (janneke) Nieuwenhuizen cadf047530
core: Split-out symbol.c.
* src/mes.c (init_symbol, mes_symbols): Move to ..
* src/symbol.c: New file.
* build-aux/configure-lib.sh (mes_SOURCES): Add it.
* simple.make: Likewise.
* include/mes/mes.h: Declare init_symbols.
2020-05-17 20:50:12 +02:00