Commit Graph

1584 Commits

Author SHA1 Message Date
Jan Nieuwenhuizen d6bd78ed8d
doc: Release update. WIP.
* AUTHORS: Update.
* HACKING: Update.
* NEWS: Update.
* doc/mes.guix: Update.
* scripts/mescc.in: Update.
* mes/module/mes/boot-0.scm.in: Update.
2018-11-15 21:01:13 +01:00
Jan Nieuwenhuizen d9c46b75ae
test: Use write instead of display.
* module/mes/test.scm (seq?, sequal?, seq2?, sless?, sequal2?): Use
write for expected, actual.
2018-11-15 21:01:13 +01:00
Jan Nieuwenhuizen 1425127012
core: struct_set_: Oops typo.
* src/struct.c (struct_set_x_): Oops, remove indirection.
2018-11-15 21:01:13 +01:00
Jan Nieuwenhuizen b4d18e646a
mes: Remove copy of make-string.
* mes/module/mes/guile.mes (make-string): Remove copy.
2018-11-15 18:08:51 +01:00
Jan Nieuwenhuizen ddec5fc281
mescc: Compile fixes.
* include/libmes-mini.h[WITH_GLIBC]: Do not declare strlen, write, types.
2018-11-15 18:08:51 +01:00
Jan Nieuwenhuizen 4441279bae
mes: Oops, %moduledir debug info.
* mes/module/mes/boot-0.scm.in: Oops, %moduledir debug info.
2018-11-15 18:08:51 +01:00
Jan Nieuwenhuizen 41dfc1bbbe
build: configure: Support Mes.
* configure: Support Mes.
2018-11-15 18:08:51 +01:00
Jan Nieuwenhuizen 664df95190
mes; Add read-line.
* mes/module/mes/guile.mes (read-line): New function.
2018-11-15 18:08:51 +01:00
Jan Nieuwenhuizen fec9fde0c9
mes: dirname: Fix for absolute file names.
* mes/module/mes/guile.mes (dirname): Fix absolute files.
2018-11-15 18:08:51 +01:00
Jan Nieuwenhuizen ef78835501
mes: Add file-exists?.
* mes/module/mes/guile.mes (file-exists?): New function.
2018-11-15 18:08:50 +01:00
Jan Nieuwenhuizen 47b7fe2e38
mes: Add with-error-to-file.
* mes/module/mes/guile.mes (with-error-to-file): New function.
2018-11-15 18:08:50 +01:00
Jan Nieuwenhuizen b76866f688
mes: Add string-downcase, string-upcase, string-tokenize.
* mes/module/srfi/srfi-13.mes (string-downcase, string-upcase,
string-tokenize): New function.
2018-11-15 18:08:50 +01:00
Jan Nieuwenhuizen 3c7266dff1
mes: Add char-downcase, char-upcase.
* mes/module/srfi/srfi-14.mes (char-downcase, char-upcase): New
function.
2018-11-15 18:08:50 +01:00
Jan Nieuwenhuizen 0761f6479e
mes: Add char-set:digit, char-set:lower-case, char-set:upper-case.
* mes/module/srfi/srfi-14.mes (char-set:digit, char-set:lower-case,
char-set:upper-case): New variable.
2018-11-15 18:08:50 +01:00
Jan Nieuwenhuizen 36e4de29e8
mes: Add char-set-adjoin, char-set-complement.
* mes/module/srfi/srfi-14.mes (char-set-adjoin, char-set-complement):
New function.
2018-11-15 18:08:50 +01:00
Jan Nieuwenhuizen ad9f78718f
mes: system*: Support redirection.
* mes/module/mes/posix.mes (system*): Support redirection.
2018-11-15 18:08:50 +01:00
Jan Nieuwenhuizen b85db01e9b
core: read_string: Allow for gc.
* src/posix.c (read_char): Add optional port parameter.
(read_string): Allow for gc.
2018-11-15 18:08:49 +01:00
Jan Nieuwenhuizen 280b763ae8
core: Add delete_file.
* src/posix.c (delete_file): New function.
2018-11-15 18:08:49 +01:00
Jan Nieuwenhuizen 4568b8434b
core: Add dup, dup2.
* src/posix.c (dup_, dup2_): New function.
2018-11-15 18:08:49 +01:00
Jan Nieuwenhuizen cf04774209
core: Add getcwd.
* src/posix.c (getcwd_): New function.
2018-11-15 18:08:49 +01:00
Jan Nieuwenhuizen 059fb2e27f
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-15 18:08:49 +01:00
Jan Nieuwenhuizen 216936e085
core: Assert g_free in alloc.
* src/mes.c (alloc): Assert g_free.
2018-11-15 18:08:49 +01:00
Jan Nieuwenhuizen 1d3d28dfbe
mescc: unlink: Move to libc.
* lib/linux/libc.c (unlink): New function.
* lib/linux/tcc.c (unlink): Remove.
2018-11-15 18:08:49 +01:00
Jan Nieuwenhuizen 938f425c71
mescc: dup, dup2: Move to libc.
* lib/linux/libc.c (dup, dup2): New function.
* lib/linux/gnu.c (dup, dup2): Remove.
2018-11-15 18:08:49 +01:00
Jan Nieuwenhuizen 5a3f28a069
mescc: getcwd: Move to libc.
* lib/linux/libc.c (getcwd): New function.
* lib/linux/tcc.c (getcwd): Remove.
2018-11-15 18:08:48 +01:00
Jan Nieuwenhuizen 5f987d12c2
mescc: Support GNU make with POSIX.
* include/linux/x86/syscall.h (SYS_sigprocmask): New macro.
* include/linux/x86_64/syscall.h (SYS_rt_sigprocmask): New macro.
* include/signal.h (SIG_BLOCK, SIG_UNBLOCK, SIG_SETMASK): New macro.
(sigprocmask): Declare.
* lib/linux/gnu.c (sigprocmask): New function.
2018-11-15 18:08:48 +01:00
Jan Nieuwenhuizen cd30bee788
mescc: Support GNU Bash.
* include/errno.h (EACCES, ENOSPC, ESPIPE): New macro.
* include/linux/x86/syscall.h (SYS_setuid, SYS_geteuid, SYS_getegid,
SYS_setgid): New macro.
* include/linux/x86_64/syscall.h: Likewise.
* include/stdint.h (LLONG_MIN, LLONG_MAX, SIZE_MAX): New macro.
* include/sys/stat.h (S_ISUID, S_ISGID, S_IXGRP, S_IXOTH, S_IRGRP,
S_IROTH, S_IWGRP, S_IWOTH, S_IRWXG, S_IRWXO): New macro.
* include/termio.h: New file.
* include/unistd.h (_POSIX_VERSION): New macro.
* lib/linux/gnu.c (geteuid, getegid, setuid, setgid): New function.
* lib/string/memchr.c: New file.
* lib/stub/getpwuid.c: New file.
* lib/stub/rand.c: New file.
* lib/stub/ttyname.c: New file.
* include/string.h (memchr): Declare.
* include/unistd.h (geteuid, getegid, setuid, setgid): Declare.
2018-11-15 18:08:48 +01:00
Jan Nieuwenhuizen 23d4019d13
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-15 18:08:48 +01:00
Jan Nieuwenhuizen 28190c53df
mescc: Add missing define.
* lib/x86-mes/x86.M1: Add missing define.
2018-11-15 18:08:28 +01:00
Jan Nieuwenhuizen fc1db23dc8
mescc: Exit if library cannot be found.
* module/mescc/mescc.scm (arch-find): Exit upon failure.
2018-11-15 18:08:28 +01:00
Jan Nieuwenhuizen 213c89072f
mescc: Accept -O, --std, -x.
* scripts/mescc.in (parse-opts): Accept -O, --std, -x.
2018-11-11 12:10:42 +01:00
Jan Nieuwenhuizen 414a94f5f6
mescc: Support -dumpmachine.
* scripts/mescc.in (parse-opts): Support -dumpmachine.
2018-11-11 12:10:42 +01:00
Jan Nieuwenhuizen 1e3e1f33bf
mescc: vsnprintf: Compliant implementation.
* lib/stdio/vsnprintf.c (vsnprintf): New, complient implementation,
replacing vsnprint.
* lib/stdio/vsprintf.c (vsnprint): Forward to vsnprint.
* lib/stdio/snprintf.c (snprintf): Likewise.
* scaffold/tests/9a-snprintf.c: Test it.
* build-aux/check-mescc.sh (tests): Run it.
2018-11-11 12:10:42 +01:00
Jan Nieuwenhuizen 72665f5bba
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-11-11 12:10:42 +01:00
Jan Nieuwenhuizen 38d014decd
mes: Add ceil, floor, round, inexact->exact.
* mes/module/mes/scm.mes (ceil, floor, round, inexact->exact,
exact->inexact): New function.
2018-11-11 12:10:41 +01:00
Jan Nieuwenhuizen bb6cdb6b54
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-11-11 12:10:41 +01:00
Jan Nieuwenhuizen 4a31bcb06a
core: eval_apply: Order gotos according to frequency.
* src/mes.c (eval_apply): Order gotos according to frequency.
2018-11-11 12:10:41 +01:00
Jan Nieuwenhuizen 47600095c3
Revert "core: eval_apply profile."
This reverts commit d61e6be0b18459a8e3c262eab448b428dc81937a.
2018-11-11 12:10:41 +01:00
Jan Nieuwenhuizen 3d4dbdef60
core: eval_apply profile.
* src/mes.c: Poor man's eval_apply profile.
2018-11-11 12:10:41 +01:00
Jan Nieuwenhuizen cee0972566
core: Fix displaying of closure.
* src/lib.c (display_helper): Fix displaying of closure.
2018-11-11 12:10:41 +01:00
Jan Nieuwenhuizen 24748f575a
mes: Print backtrace upon exception.
* mes/module/mes/catch.mes (display-backtrace,
frame-function): New function.
(%eh): Use them.
2018-11-11 12:10:41 +01:00
Jan Nieuwenhuizen b93fd30819
core: Set procedure in stack frame.
* src/mes.c (eval_apply): Set procedure in stack frame.
2018-11-07 22:48:10 +01:00
Jan Nieuwenhuizen 10a0ec8808
core: Implement stack and frame.
* src/lib.c (frame_printer make_frame_type, make_frame,
make_stack_type, make_stack, stack_length, stack_ref): New function.
2018-11-07 22:48:10 +01:00
Jan Nieuwenhuizen 37cba9c93b
core: Support time functions.
* lib/linux/clock_gettime.c: New file, move from gnu.c.
* lib/linux/gettimeofday.c: New file, move from tcc.c.
* lib/linux/time.c: New file, move from tcc.c.
* lib/linux/libc.c: Include them.
* lib/linux/gnu.c (clock_gettime): Remove.
* lib/linux/tcc.c (time, gettimeofday): Remove.
* include/time.h (CLOCK_PROCESS_CPUTIME_ID): New define.
* src/posix.c (init_time, current_time, gettimeofday_,
seconds_and_nanoseconds_to_long, get_internal_run_time): New function.
* src/mes.c (scm_symbol_internal_time_units_per_second): New symbol.
(main): Call init_time.
2018-11-07 22:48:10 +01:00
Jan Nieuwenhuizen 9b32098573
core: Use hash table for symbols.
* src/mes.c (mes_symbols): Use hash table for symbols.  Update users.
2018-11-07 22:48:10 +01:00
Jan Nieuwenhuizen 554d1beeb2
core: Use assert before failure exit.
* src/mes.c (error): Use assert before failure exit.  Helps debugging.
2018-11-07 22:48:10 +01:00
Jan Nieuwenhuizen 42e6f43149
core: Add hashq_get_handle, hash, hash_ref, hash_set_x.
* src/mes.c (scm_symbol_hashq_table, scm_symbol_record_type,
scm_symbol_module, scm_symbol_buckets, scm_symbol_size): New symbols.
Update users.
* src/hash.c (hash_list_of_char): Rename from hashq_.  Respect size,
update callers.
(hashq_, hash_ hash, hashq_get_handle, hash_ref, hash_set_x_,
hash_set_x): New function.
(hashq_ref): Do not return handle.  Update callers.
2018-11-07 22:48:09 +01:00
Jan Nieuwenhuizen d9199b3536
mes: Move pair? to core.
* src/lib.c (pair_p): New function.  Gains 8% performance on MesCC.
2018-11-07 22:48:09 +01:00
Jan Nieuwenhuizen 4e1f494d19
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-11-07 22:48:09 +01:00
Jan Nieuwenhuizen 5c685ebd22
Revert "core: Add gc-debug for stack array."
This reverts commit f35084d1dbea889d107824e7596da1701c6b90ad.
2018-11-07 22:48:09 +01:00