Commit graph

1282 commits

Author SHA1 Message Date
Jan Nieuwenhuizen 83970245e5 Support quasisyntax.
* mes.c (eval_quasisyntax, add_unsyntaxers): New functions.
  (eval_env): Use them.
2016-10-16 01:41:07 +02:00
Jan Nieuwenhuizen 2715e241e5 Add REPL.
* mes.c (expand_macro_env, force_output): New function.  Use STRING_MAX
  for string buffers throughout.  (eval_env, eval_begin_env): Rename
  from eval, eval_begin.  Update callers.
* repl.mes: New file.
* base.mes (list?): Move from scm.mes.
* scm.mes (eval, apply, primitive-eval, expand-macro): New function.
* GNUmakefile: New repl target.
2016-10-16 09:44:52 +02:00
Jan Nieuwenhuizen 422b6e6ce9 Avoid 90% of cdr'ing environment, assuming static primitives.
* mes.c (internal_primitive_p)[STATIC_PRIMITIVES: New function.
 (lookup_macro)[STATIC_PRIMITIVES]: Use it.
 (internal_lookup_primitive)[STATIC_PRIMITIVES]: New function.
 (lookup)[STATIC_PRIMITIVES]: Use it.
 (mes_primitives)[STATIC_PRIMITIVES]: New function.
 (main): Use it.
* base0-if.mes (disabled-cond): Rename from xcond.
* GNUmakefile: Add commented profiling CFLAGS.
2016-10-12 21:14:06 +02:00
Jan Nieuwenhuizen 6948629c27 Do not use quasiquote in base0.
* base0.scm (defined?): Rewrite without quasiquote.
2016-10-16 09:21:17 +02:00
Jan Nieuwenhuizen dd271be218 Add procedure? to base.
* base.mes (procedure?): Move from scm.mes.
2016-10-12 22:58:35 +02:00
Jan Nieuwenhuizen 1bb3d1de11 speedup: use ->car etc. 2016-10-08 17:00:32 +02:00
Jan Nieuwenhuizen c5e3e3818d Avoid out-of-spec strncat usage.
mes.c (readword): Use character assignment instead of strncat.  Fixes
Valgrind nit.
2016-10-11 18:50:14 +02:00
Jan Nieuwenhuizen 513bd09f76 Discern between primitive atoms and symbols.
* mes.c (internal_symbol_p): New function.
 (eval): Use it.
2016-10-11 07:10:01 +02:00
Jan Nieuwenhuizen c506880a14 resurrect mescc. 2016-10-10 23:54:48 +02:00
Jan Nieuwenhuizen 7ff86c393f cleanup and doc update. 2016-10-10 23:24:44 +02:00
Jan Nieuwenhuizen bf02fa7f07 syntax.mes: silence syntax error. 2016-10-10 22:44:42 +02:00
Jan Nieuwenhuizen c6ce1662e4 test/scm.test: update. 2016-10-10 22:42:05 +02:00
Jan Nieuwenhuizen 2e1685dc2d test/match.test: pass. 2016-10-11 18:51:30 +02:00
Jan Nieuwenhuizen c38ae1ebc5 lib/match: ugly hygiene hack. FIXME. 2016-10-10 20:53:42 +02:00
Jan Nieuwenhuizen d3fab554d5 let-syntax.mes: implement. 2016-10-10 22:55:37 +02:00
Jan Nieuwenhuizen a265f933d8 speedup: use ->car etc. 2016-10-08 17:00:32 +02:00
Jan Nieuwenhuizen 4514be76d9 use IF as primitive, drop using cond/evcon only option. 2016-10-08 16:54:59 +02:00
Jan Nieuwenhuizen 7c759e0670 c++ type-safety. 2016-10-08 10:14:17 +02:00
Jan Nieuwenhuizen e504998b03 assq: use while instead of recursion. 2016-10-08 08:47:23 +02:00
Jan Nieuwenhuizen 509bf3956e mes.c: uniquify symbols. 2016-10-08 08:41:30 +02:00
Jan Nieuwenhuizen 3ff385ce6d mes-check: separate target. 2016-10-08 08:38:29 +02:00
Jan Nieuwenhuizen cd84c337f1 Updates to README, TODO. 2016-09-25 12:50:00 +02:00
Jan Nieuwenhuizen e1eeaf979a mescc.scm: compile simple, well-behaved for-loop. 2016-08-14 14:42:52 +02:00
Jan Nieuwenhuizen 76ff664dab elf.mes: for loop. 2016-08-14 14:02:09 +02:00
Jan Nieuwenhuizen 04eb0609cd mescc.scm: print two strings. 2016-08-14 09:06:09 +02:00
Jan Nieuwenhuizen 2c7f26dbe6 mescc.scm: first a.out produced from main.c. 2016-08-14 01:44:42 +02:00
Jan Nieuwenhuizen 85f3d40e71 lib/match.scm: import. 2016-08-14 01:40:55 +02:00
Jan Nieuwenhuizen da27cf183a lib/srfi/srfi-1.scm: add append-map, filter, find. 2016-08-14 01:40:45 +02:00
Jan Nieuwenhuizen a3e5461952 elf.mes: make-elf. 2016-08-13 22:43:55 +02:00
Jan Nieuwenhuizen 9fe124a4bf elf.mes: use elf32-* remove set!. 2016-08-13 22:21:59 +02:00
Jan Nieuwenhuizen 24291da28e elf.mes: remove text-free, softcode data-offset. 2016-08-13 19:19:52 +02:00
Jan Nieuwenhuizen 30076e1b2b elf.mes: put marker in note section. 2016-08-13 18:57:49 +02:00
Jan Nieuwenhuizen 51d0fc90de Revert "elf.mes: drop .note section."
This reverts commit b2b5b73b91308407ec82a5ba658aca025512c542.
2016-08-13 18:46:22 +02:00
Jan Nieuwenhuizen 403e487d16 elf.mes: drop .note section. 2016-08-13 18:42:53 +02:00
Jan Nieuwenhuizen 98d4772e3f elf.mes: softcode more. 2016-08-13 18:42:38 +02:00
Jan Nieuwenhuizen ec8553dc4f mes.c: implement string->list. 2016-08-13 18:42:11 +02:00
Jan Nieuwenhuizen 00e000306d elf.mes: compute text-free, text-offset. 2016-08-13 15:27:02 +02:00
Jan Nieuwenhuizen 1ddb703265 lib/rnrs/bytevectors.scm: minimal rnrs bytevectors. 2016-08-13 17:05:29 +02:00
Jan Nieuwenhuizen 1d08cc7f6f elf.mes: separate-out text, text-free and data sections. 2016-08-13 10:32:07 +02:00
Jan Nieuwenhuizen 038f4c71be resurrect guile-mescc, use write-int and (current-error-port) iso `2'. 2016-08-13 01:07:26 +02:00
Jan Nieuwenhuizen 697858f670 Revert "mes.c: use single malloc with arena."
This reverts commit 38c364faeff430a5ee28f402d24b073f6bf9a548.
2016-09-25 10:13:09 +02:00
Jan Nieuwenhuizen b955b84d20 mes.c: use single malloc with arena. 2016-08-13 00:58:00 +02:00
Jan Nieuwenhuizen 355042300c elf.mes: a.out runs. 2016-08-12 16:38:59 +02:00
Jan Nieuwenhuizen ecc1ebec1d elf.mes: error-free header, no program yet. 2016-08-12 15:54:15 +02:00
Jan Nieuwenhuizen 2ffa9e2cdd elf.mes: readelf -h a.out shows some info. 2016-08-12 15:10:05 +02:00
Jan Nieuwenhuizen 0829c5762c mescc/elf.mes: write minimal ELF header. 2016-08-12 14:17:55 +02:00
Jan Nieuwenhuizen 2097e9e4ef mes.c: display, newline: take optional port; add write-char, read hex #xXX. 2016-08-12 14:17:20 +02:00
Jan Nieuwenhuizen 066deeb183 remove debug output to stdout. 2016-08-12 12:06:59 +02:00
Jan Nieuwenhuizen ef874c8fd3 syntax-if.mes: TODO. 2016-07-27 12:16:44 +02:00
Jan Nieuwenhuizen 287c0284fe Use IF iso COND as primitive; keep COND primitive as option. 2016-07-27 08:49:45 +02:00