Commit Graph

1326 Commits

Author SHA1 Message Date
Jan Nieuwenhuizen e628b311d6
mescc: Create less garbage when dumping M1.
* module/mes/M1.mes (display-join): New function.
* (object->M1): Use it.
2018-04-24 07:26:27 +02:00
Jan Nieuwenhuizen 18d143aa62
core: last_pair: Move to core.
* src/lib.c (last_pair): New function.
* module/mes/scm.mes (last-pair): Remove.
2018-04-24 07:00:35 +02:00
Jan Nieuwenhuizen 4fa6acc480
core: equal2_p: Add short-circuit and eliminate tail call.
* src/lib.c (equal2_p): Add short-circuit and eliminate tail call.
2018-04-24 06:59:18 +02:00
Jan Nieuwenhuizen 9936aa383b
mescc: Use display for dumping M1.
* module/mes/M1.mes (object->M1): Use display for dumping M1.
2018-04-23 06:56:35 +02:00
Jan Nieuwenhuizen 630718f134
mes: Guile-like command-line interface.
* module/mes/boot-0.scm (tty?): Guile-like command-line interface.
* scripts/repl.mes: Remove.
* scripts/mescc.mes: Update.
* tests/*.test: Update scripts.
* module/mes/repl.mes (repl): Add ,quit.
2018-04-22 11:51:28 +02:00
Jan Nieuwenhuizen a26eae418b
mes: getopt-long: Support stop-at-first-non-option.
* module/mes/getopt-long.scm (process-options): Fix parsing `-'.  Add
  parameter: stop-at-first-non-option.
  (getopt-long): Add keyword parameter #:stop-at-first-non-option.
2018-04-22 11:49:30 +02:00
Jan Nieuwenhuizen bb45012c39
mes: Add isatty?.
* src/posix.c (isatty_p): New function.
2018-04-22 11:48:38 +02:00
Jan Nieuwenhuizen ece39a9a18
mlibc: Add isatty.
* lib/libc.c (isatty): New function.
* include/unistd.h: Declare it.
2018-04-22 11:47:44 +02:00
Jan Nieuwenhuizen 979406f3a6
mlibc: Add ioctl.
* stage0/x86.M1 (SYS_ioctl): New define.
* lib/linux-mes.c (ioctl): New syscall.
* lib/linux-gcc.c (ioctl): New syscall.
* include/sys/ioctl.h: New file.
2018-04-22 11:42:47 +02:00
Jan Nieuwenhuizen 75444afc21
core: Compile minimal mes with MES_MINI=1.
* src/mes.c: Compile minimal mes with MES_MINI=1.
2018-04-10 21:43:19 +02:00
Jan Nieuwenhuizen 3f943c8cfa
core; reader_read_string: Support escaped characters.
* src/reader.c (reader_read_string): Support escaped characters.
2018-04-22 00:33:50 +02:00
Jan Nieuwenhuizen cf1704f5b3
Revert "mescc: Use core:write."
This reverts commit d88e31dfec3158a830c32f9f732b052cfccac6eb.
2018-04-22 16:38:55 +02:00
Jan Nieuwenhuizen b91e87f476
mescc: Use core:write.
* scripts/mescc.mes (source->ast): Use core:write.
2018-04-21 23:58:37 +02:00
Jan Nieuwenhuizen d3f962c376
mes: display: Display escaped characters.
* module/mes/display.mes (display): Display escaped characters.
2018-04-22 20:08:38 +02:00
Jan Nieuwenhuizen 6be49a294b
core: display_helper: Display escaped characters.
* src/lib.c (display_helper): Display escaped characters.
2018-04-21 23:58:28 +02:00
Jan Nieuwenhuizen 7ecec93a88
mes: Resurrect macros in repl.
* src/mes.c (scm_vm_begin_expand): Rename to core:begin-expand.
 (eval_apply): Expose it.
* module/mes/repl.mes (repl): Use it to resurrect macros.
2018-04-21 17:30:14 +02:00
Jan Nieuwenhuizen 833fe991cb
core: Fixes for garbage collector/jam scraper.
* src/gc.c (gc_loop): Do not relocate car of TCLOSURE, TCONTINUATION.
  Check for TBROKEN_HEART.
* src/mes.c (make_closure_): Set car to 0.
  (check_apply): Check for TBROKEN_HEART.  Fixes reporting artificial
  out-of-memory error.
  (eval_apply): Likewise.
* src/vector.c (vector_entry): Only copy TCHAR and TNUMBER.
2018-04-21 13:31:12 +02:00
Jan Nieuwenhuizen 0be441446e
core: drop global_p from variable.
* src/mes (struct scm): Remove field global_p.
 (VARIABLE_GLOBAL_P): Remove.
 (make_variable_): Remove global_p parameter.  Update callers.
* src/lib.c (display_helper): Drop VARIABLE_GLOBAL_P support.
2018-04-21 13:19:54 +02:00
Jan Nieuwenhuizen 82db3a941a
core: Reenable full printing of lists.
* src/lib.c (display_helper): Reenable full printing of lists.
2018-04-21 08:54:14 +02:00
Jan Nieuwenhuizen 4b6d11e990
core: append2, append_reverse, reverse, reverse!: Create less garbage.
* src/mes.c (append_reverse): New function.
  (reverse_x_): New function.
  (append2): Use them to create less garbage.
* module/mes/scm.mes (reverse): Create less garbage.
* module/srfi/srfi-1.mes (reverse!): Rewrite, use core:reverse!.
  (append-reverse): Remove.
2018-04-20 14:38:24 +02:00
Jan Nieuwenhuizen 62a369e6de
core: vector_to_list: Create less garbage.
* src/vector.c (vector_to_list): Create less garbage.
2018-04-20 13:22:47 +02:00
Jan Nieuwenhuizen 3330948a90
core: Optimize vector-map, vector-for-each.
* module/srfi/srfi-43.mes (vector-map): Optimize.
  (vector-for-each): Optimize.
* tests/srfi-43.test: New file.
* tests/srfi-43.test-guile: New file.
* check.sh (tests): Add it.
* make.scm (mes-tests): Add it.
2018-04-20 13:06:00 +02:00
Jan Nieuwenhuizen 04d90849e1
Revert "build-32.sh"
This reverts commit ace8b6f1b52de58c9ab404ed13234f397dac6bdc.
2018-04-18 19:35:25 +02:00
Jan Nieuwenhuizen 53838fb6b6
build-32.sh 2018-04-16 20:25:31 +02:00
Jan Nieuwenhuizen ac0baf84d4
core: Cleanup make_cell, remove tmp cells.
* src/mes.c (make_cell__): New function.
  (make_cell_): Use it.
  (length__): New function.
  (tmp, tmp_num, tmp_num2, tmp_num_, tmp_num2_, make_tmps): Remove.
  Update callers to use make_cell__ directly.
 * src/vector.c (make_vector__): New function.
  (make_vector_): Use it.
2018-04-14 08:15:49 +02:00
Jan Nieuwenhuizen 7cad0671f3
Revert "mlibc: Use memmove in realloc."
This reverts commit f47a21e3cb4814c4a30d10ff59e5c947441725e9.
2018-04-21 13:42:16 +02:00
Jan Nieuwenhuizen 1270c767cd
mlibc: Use memmove in realloc.
* src/libc.c (memmove): New function.
  (realloc): Use it.
* src/libc+tcc.c (memmove): Remove.
2018-04-15 08:13:36 +02:00
Jan Nieuwenhuizen d052876f85
mes: Add char-whitespace?
* module/srfi/srfi-14.mes (char-whitespace?): New function.
2018-04-15 08:04:09 +02:00
Jan Nieuwenhuizen 0d0c7a415b
mes: Move base-0.mes int boot-0.scm.
* module/mes/boot-02.scm: New file, rename from boot-0.scm.
* module/mes/boot-0.scm: Add base-0.mes.
* module/mes/base-0.mes: Remove.
2018-04-14 22:06:28 +02:00
Jan Nieuwenhuizen b200366f27
mes: Unify mlibc-gcc and mes builds.
* make.scm (bin.gcc): Remove stray slash.
* src/mes.c: Unify mlibc-gcc and mes builds.
(gc_init_cells):
(gc_init_news):
(bload_env):
* src/reader.c (reader_read_character):
(reader_read_string):
2018-04-13 08:18:19 +02:00
Jan Nieuwenhuizen 3dc72ce20d
core: Remove local variables from gc.
* src/gc.c (gl_loop): Remove local variables.
2018-04-12 21:33:38 +02:00
Jan Nieuwenhuizen a342791f2b
core: Listen to MES_SAFETY environment variable. 2018-04-12 07:08:09 +02:00
Jan Nieuwenhuizen 1bc4bc7894
core: Remove local variables from eval/apply.
* src/mes.c (eval_apply): Move all variables to global scope.
2018-04-12 07:07:24 +02:00
Jan Nieuwenhuizen 9b9a27b743
core: Remove MesCC reminder. 2018-04-12 07:06:40 +02:00
Jan Nieuwenhuizen 5b30d234cb
core: Update default memory settings.
* src/mes.c (MAX_ARENA_SIZE)[__MESC__]: Set to maximum 172100000.
2018-04-11 20:46:06 +02:00
Jan Nieuwenhuizen b65e57be31
core: Tune debug printing.
* src/mes.c: Tune debug printing.
* src/gc.c: Likewise.
* module/mes/guile.mes: Likewise.
* HACKING: Describe it.
2018-04-09 07:12:38 +02:00
Jan Nieuwenhuizen 72fc46a572
core: Rewrite reader to create less garbage.
* src/reader.c (reader_read_line_comment): Rename from read_line_comment.
(reader_identifier_p): New function.
(reader_end_of_word_p): New function.
(reader_read_identifier_or_number): New function.
(reader_read_sexp_): Rewrite.  Update callers.
(reader_read_list): Rewrite.
(reader_lookup_): Remove.
2018-04-09 08:41:30 +02:00
Jan Nieuwenhuizen 25907f514c
core: Add isspace.
* include/ctype.h (isspace): Declare.
* lib/libc.c (isspace): New function.
2018-04-10 21:51:15 +02:00
Jan Nieuwenhuizen 45e347588c
core: Rewrite string reader.
* src/reader.c (reader_read_string): Rewrite, create much less
  garbage.
  (append_char): Remove.
2018-04-08 23:14:45 +02:00
Jan Nieuwenhuizen 7d32ecd906
install: Fix prefix confusion.
* install.sh: Substitute @PREFIX@ with MES_PREFIX.
* scripts/mescc.mes: Grok PREFIX as MES_PREFIX.
2018-04-08 17:01:59 +02:00
Jan Nieuwenhuizen 87302af14e guix.scm: Update mes to 0.12.
* guix.scm (mes, mes.git): Update to 0.12.
2018-04-08 14:43:44 +02:00
Jan Nieuwenhuizen 0330aab202 Release 0.12.
* configure (VERSION): Bump to 0.12.
2018-04-06 07:24:05 +02:00
Jan Nieuwenhuizen ad135d3752 doc: Release udpate.
* HACKING: Update.
* INSTALL: Update.
* NEWS: Update.
* README: Update.
* doc/ANNOUNCE-0.12: New file.
* throughout: (janneke) coming out.
2017-11-21 19:22:26 +01:00
Jan Nieuwenhuizen e2c2c1f78f guix.scm: Update mescc-tools to 0.4.
* guix.scm (mescc-tools): Update to 0.4.
2018-04-08 07:51:14 +02:00
Jan Nieuwenhuizen 20f66238c5 core: Workaround for mescc.
* src/mes.c (eval_apply)[__MESC__]: Add reminder for macro_p, global_p.
2018-04-08 07:50:12 +02:00
Jan Nieuwenhuizen 28b3ec954b build: Remove scripts/mes symlink. 2018-04-07 18:27:26 +02:00
Jan Nieuwenhuizen 4958921abc mes: Add string-fold, string-fold-right.
* module/srfi/srfi-13.mes (string-fold, string-fold-right): New
  function.
* tests/srfi-13.test ("string-fold"): Test it.
  ("string-fold-right"): Test it.
2018-04-07 13:37:07 +02:00
Jan Nieuwenhuizen c4b0879bc9 mes: Allow tick as part of identifier.
* src/reader.c (reader_read_sexp_): Do not treat tick as special.
2018-04-07 13:36:23 +02:00
Jan Nieuwenhuizen cd0e3f8ba5 mescc: Remove debugging.
* module/language/c99/compiler.mes: Remove debugging.
2018-04-07 13:14:58 +02:00
Jan Nieuwenhuizen 83549786ed mescc: No comments in M1 when running on Mes.
* module/language/c99/compiler.mes (ast-comment): If mes?, return nil.
2018-04-07 13:13:26 +02:00