mes.git
6 years agoSupport quasisyntax.
Jan Nieuwenhuizen [Sat, 15 Oct 2016 23:41:07 +0000 (01:41 +0200)]
Support quasisyntax.

* mes.c (eval_quasisyntax, add_unsyntaxers): New functions.
  (eval_env): Use them.

6 years agoAdd REPL.
Jan Nieuwenhuizen [Sun, 16 Oct 2016 07:44:52 +0000 (09:44 +0200)]
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.

6 years agoAvoid 90% of cdr'ing environment, assuming static primitives.
Jan Nieuwenhuizen [Wed, 12 Oct 2016 19:14:06 +0000 (21:14 +0200)]
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.

6 years agoDo not use quasiquote in base0.
Jan Nieuwenhuizen [Sun, 16 Oct 2016 07:21:17 +0000 (09:21 +0200)]
Do not use quasiquote in base0.

* base0.scm (defined?): Rewrite without quasiquote.

6 years agoAdd procedure? to base.
Jan Nieuwenhuizen [Wed, 12 Oct 2016 20:58:35 +0000 (22:58 +0200)]
Add procedure? to base.

* base.mes (procedure?): Move from scm.mes.

6 years agospeedup: use ->car etc.
Jan Nieuwenhuizen [Sat, 8 Oct 2016 15:00:32 +0000 (17:00 +0200)]
speedup: use ->car etc.

6 years agoAvoid out-of-spec strncat usage.
Jan Nieuwenhuizen [Tue, 11 Oct 2016 16:50:14 +0000 (18:50 +0200)]
Avoid out-of-spec strncat usage.

mes.c (readword): Use character assignment instead of strncat.  Fixes
Valgrind nit.

6 years agoDiscern between primitive atoms and symbols.
Jan Nieuwenhuizen [Tue, 11 Oct 2016 05:10:01 +0000 (07:10 +0200)]
Discern between primitive atoms and symbols.

* mes.c (internal_symbol_p): New function.
 (eval): Use it.

6 years agoresurrect mescc.
Jan Nieuwenhuizen [Mon, 10 Oct 2016 21:54:48 +0000 (23:54 +0200)]
resurrect mescc.

6 years agocleanup and doc update.
Jan Nieuwenhuizen [Mon, 10 Oct 2016 21:24:44 +0000 (23:24 +0200)]
cleanup and doc update.

6 years agosyntax.mes: silence syntax error.
Jan Nieuwenhuizen [Mon, 10 Oct 2016 20:44:42 +0000 (22:44 +0200)]
syntax.mes: silence syntax error.

6 years agotest/scm.test: update.
Jan Nieuwenhuizen [Mon, 10 Oct 2016 20:42:05 +0000 (22:42 +0200)]
test/scm.test: update.

6 years agotest/match.test: pass.
Jan Nieuwenhuizen [Tue, 11 Oct 2016 16:51:30 +0000 (18:51 +0200)]
test/match.test: pass.

6 years agolib/match: ugly hygiene hack. FIXME.
Jan Nieuwenhuizen [Mon, 10 Oct 2016 18:53:42 +0000 (20:53 +0200)]
lib/match: ugly hygiene hack. FIXME.

6 years agolet-syntax.mes: implement.
Jan Nieuwenhuizen [Mon, 10 Oct 2016 20:55:37 +0000 (22:55 +0200)]
let-syntax.mes: implement.

6 years agospeedup: use ->car etc.
Jan Nieuwenhuizen [Sat, 8 Oct 2016 15:00:32 +0000 (17:00 +0200)]
speedup: use ->car etc.

6 years agouse IF as primitive, drop using cond/evcon only option.
Jan Nieuwenhuizen [Sat, 8 Oct 2016 14:54:59 +0000 (16:54 +0200)]
use IF as primitive, drop using cond/evcon only option.

6 years agoc++ type-safety.
Jan Nieuwenhuizen [Sat, 8 Oct 2016 08:14:17 +0000 (10:14 +0200)]
c++ type-safety.

6 years agoassq: use while instead of recursion.
Jan Nieuwenhuizen [Sat, 8 Oct 2016 06:47:23 +0000 (08:47 +0200)]
assq: use while instead of recursion.

6 years agomes.c: uniquify symbols.
Jan Nieuwenhuizen [Sat, 8 Oct 2016 06:41:30 +0000 (08:41 +0200)]
mes.c: uniquify symbols.

6 years agomes-check: separate target.
Jan Nieuwenhuizen [Sat, 8 Oct 2016 06:38:29 +0000 (08:38 +0200)]
mes-check: separate target.

6 years agoUpdates to README, TODO. announce-2
Jan Nieuwenhuizen [Sun, 25 Sep 2016 10:50:00 +0000 (12:50 +0200)]
Updates to README, TODO.

6 years agomescc.scm: compile simple, well-behaved for-loop.
Jan Nieuwenhuizen [Sun, 14 Aug 2016 12:42:52 +0000 (14:42 +0200)]
mescc.scm: compile simple, well-behaved for-loop.

6 years agoelf.mes: for loop.
Jan Nieuwenhuizen [Sun, 14 Aug 2016 12:02:09 +0000 (14:02 +0200)]
elf.mes: for loop.

6 years agomescc.scm: print two strings.
Jan Nieuwenhuizen [Sun, 14 Aug 2016 07:06:09 +0000 (09:06 +0200)]
mescc.scm: print two strings.

6 years agomescc.scm: first a.out produced from main.c.
Jan Nieuwenhuizen [Sat, 13 Aug 2016 23:44:42 +0000 (01:44 +0200)]
mescc.scm: first a.out produced from main.c.

6 years agolib/match.scm: import.
Jan Nieuwenhuizen [Sat, 13 Aug 2016 23:40:55 +0000 (01:40 +0200)]
lib/match.scm: import.

6 years agolib/srfi/srfi-1.scm: add append-map, filter, find.
Jan Nieuwenhuizen [Sat, 13 Aug 2016 23:40:45 +0000 (01:40 +0200)]
lib/srfi/srfi-1.scm: add append-map, filter, find.

6 years agoelf.mes: make-elf.
Jan Nieuwenhuizen [Sat, 13 Aug 2016 20:43:55 +0000 (22:43 +0200)]
elf.mes: make-elf.

6 years agoelf.mes: use elf32-* remove set!.
Jan Nieuwenhuizen [Sat, 13 Aug 2016 20:21:59 +0000 (22:21 +0200)]
elf.mes: use elf32-* remove set!.

6 years agoelf.mes: remove text-free, softcode data-offset.
Jan Nieuwenhuizen [Sat, 13 Aug 2016 17:19:52 +0000 (19:19 +0200)]
elf.mes: remove text-free, softcode data-offset.

6 years agoelf.mes: put marker in note section.
Jan Nieuwenhuizen [Sat, 13 Aug 2016 16:57:49 +0000 (18:57 +0200)]
elf.mes: put marker in note section.

6 years agoRevert "elf.mes: drop .note section."
Jan Nieuwenhuizen [Sat, 13 Aug 2016 16:46:22 +0000 (18:46 +0200)]
Revert "elf.mes: drop .note section."

This reverts commit b2b5b73b91308407ec82a5ba658aca025512c542.

6 years agoelf.mes: drop .note section.
Jan Nieuwenhuizen [Sat, 13 Aug 2016 16:42:53 +0000 (18:42 +0200)]
elf.mes: drop .note section.

6 years agoelf.mes: softcode more.
Jan Nieuwenhuizen [Sat, 13 Aug 2016 16:42:38 +0000 (18:42 +0200)]
elf.mes: softcode more.

6 years agomes.c: implement string->list.
Jan Nieuwenhuizen [Sat, 13 Aug 2016 16:42:11 +0000 (18:42 +0200)]
mes.c: implement string->list.

6 years agoelf.mes: compute text-free, text-offset.
Jan Nieuwenhuizen [Sat, 13 Aug 2016 13:27:02 +0000 (15:27 +0200)]
elf.mes: compute text-free, text-offset.

6 years agolib/rnrs/bytevectors.scm: minimal rnrs bytevectors.
Jan Nieuwenhuizen [Sat, 13 Aug 2016 15:05:29 +0000 (17:05 +0200)]
lib/rnrs/bytevectors.scm: minimal rnrs bytevectors.

6 years agoelf.mes: separate-out text, text-free and data sections.
Jan Nieuwenhuizen [Sat, 13 Aug 2016 08:32:07 +0000 (10:32 +0200)]
elf.mes: separate-out text, text-free and data sections.

6 years agoresurrect guile-mescc, use write-int and (current-error-port) iso `2'.
Jan Nieuwenhuizen [Fri, 12 Aug 2016 23:07:26 +0000 (01:07 +0200)]
resurrect guile-mescc, use write-int and (current-error-port) iso `2'.

6 years agoRevert "mes.c: use single malloc with arena."
Jan Nieuwenhuizen [Sun, 25 Sep 2016 08:13:09 +0000 (10:13 +0200)]
Revert "mes.c: use single malloc with arena."

This reverts commit 38c364faeff430a5ee28f402d24b073f6bf9a548.

6 years agomes.c: use single malloc with arena.
Jan Nieuwenhuizen [Fri, 12 Aug 2016 22:58:00 +0000 (00:58 +0200)]
mes.c: use single malloc with arena.

6 years agoelf.mes: a.out runs.
Jan Nieuwenhuizen [Fri, 12 Aug 2016 14:38:59 +0000 (16:38 +0200)]
elf.mes: a.out runs.

6 years agoelf.mes: error-free header, no program yet.
Jan Nieuwenhuizen [Fri, 12 Aug 2016 13:54:15 +0000 (15:54 +0200)]
elf.mes: error-free header, no program yet.

6 years agoelf.mes: readelf -h a.out shows some info.
Jan Nieuwenhuizen [Fri, 12 Aug 2016 13:10:05 +0000 (15:10 +0200)]
elf.mes: readelf -h a.out shows some info.

6 years agomescc/elf.mes: write minimal ELF header.
Jan Nieuwenhuizen [Fri, 12 Aug 2016 12:17:55 +0000 (14:17 +0200)]
mescc/elf.mes: write minimal ELF header.

6 years agomes.c: display, newline: take optional port; add write-char, read hex #xXX.
Jan Nieuwenhuizen [Fri, 12 Aug 2016 12:17:20 +0000 (14:17 +0200)]
mes.c: display, newline: take optional port; add write-char, read hex #xXX.

6 years agoremove debug output to stdout.
Jan Nieuwenhuizen [Fri, 12 Aug 2016 10:06:59 +0000 (12:06 +0200)]
remove debug output to stdout.

6 years agosyntax-if.mes: TODO.
Jan Nieuwenhuizen [Wed, 27 Jul 2016 10:16:44 +0000 (12:16 +0200)]
syntax-if.mes: TODO.

6 years agoUse IF iso COND as primitive; keep COND primitive as option.
Jan Nieuwenhuizen [Wed, 27 Jul 2016 06:49:45 +0000 (08:49 +0200)]
Use IF iso COND as primitive; keep COND primitive as option.

6 years agolet.scm: cleanups.
Jan Nieuwenhuizen [Wed, 27 Jul 2016 05:35:57 +0000 (07:35 +0200)]
let.scm: cleanups.

6 years agomacro hax0rz
Jan Nieuwenhuizen [Tue, 26 Jul 2016 22:32:30 +0000 (00:32 +0200)]
macro hax0rz

6 years agoRevert "lib/lalr-debug.scm"
Jan Nieuwenhuizen [Tue, 26 Jul 2016 22:05:02 +0000 (00:05 +0200)]
Revert "lib/lalr-debug.scm"

This reverts commit 084d1bea33d45f0653cdc6bef44dc295faef6b72.

6 years agolib/lalr-debug.scm
Jan Nieuwenhuizen [Tue, 26 Jul 2016 21:34:00 +0000 (23:34 +0200)]
lib/lalr-debug.scm

6 years agoquasiquote.mes: disable, too slow.
Jan Nieuwenhuizen [Tue, 26 Jul 2016 21:22:32 +0000 (23:22 +0200)]
quasiquote.mes: disable, too slow.

6 years agosplit-up test suite, implement quasiquote in scheme.
Jan Nieuwenhuizen [Mon, 25 Jul 2016 12:39:56 +0000 (14:39 +0200)]
split-up test suite, implement quasiquote in scheme.

6 years agohello.c, hello.S: hello world target for C compiler.
Jan Nieuwenhuizen [Tue, 26 Jul 2016 05:30:53 +0000 (07:30 +0200)]
hello.c, hello.S: hello world target for C compiler.

6 years agomescc: mes parses simplest main with lalr.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 23:12:22 +0000 (01:12 +0200)]
mescc: mes parses simplest main with lalr.

6 years agoscm.mes: add port-location dummies.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 22:06:50 +0000 (00:06 +0200)]
scm.mes: add port-location dummies.

6 years agomes.c: add set-cdr, substring, string-ref.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 22:06:18 +0000 (00:06 +0200)]
mes.c: add set-cdr, substring, string-ref.

6 years agomes.c: support whitespace characters.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 21:41:16 +0000 (23:41 +0200)]
mes.c: support whitespace characters.

6 years agomescc.scm: parse simple main.c.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 21:18:53 +0000 (23:18 +0200)]
mescc.scm: parse simple main.c.

6 years agoTODO/HACKING: update: lalr/paren.scm runs.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 17:38:47 +0000 (19:38 +0200)]
TODO/HACKING: update: lalr/paren.scm runs.

6 years agomes.c: when reading `EOF', defer read control to program.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 16:28:45 +0000 (18:28 +0200)]
mes.c: when reading `EOF', defer read control to program.

6 years agomes.c, scm.c: add read-char, peek-char, char=?, char-alphabetic?.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 15:35:31 +0000 (17:35 +0200)]
mes.c, scm.c: add read-char, peek-char, char=?, char-alphabetic?.

6 years agoscm.mes: add list-ref.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 15:25:03 +0000 (17:25 +0200)]
scm.mes: add list-ref.

6 years agomes.c: add logior.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 15:21:30 +0000 (17:21 +0200)]
mes.c: add logior.

6 years agoscm.mes: add expt.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 15:16:55 +0000 (17:16 +0200)]
scm.mes: add expt.

6 years agoscm.mes: remainder.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 15:11:49 +0000 (17:11 +0200)]
scm.mes: remainder.

6 years agoscm.mes: implement do.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 15:03:28 +0000 (17:03 +0200)]
scm.mes: implement do.

6 years agoscm.mes: add max, min.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 14:34:54 +0000 (16:34 +0200)]
scm.mes: add max, min.

6 years ago<=, >=: take multiple arguments.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 14:29:38 +0000 (16:29 +0200)]
<=, >=: take multiple arguments.

6 years agomes.c: add quotient and modulo.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 13:25:16 +0000 (15:25 +0200)]
mes.c: add quotient and modulo.

6 years agomes.c: less_p, greater_p, is_p: take multiple arguments.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 13:26:49 +0000 (15:26 +0200)]
mes.c: less_p, greater_p, is_p: take multiple arguments.

6 years agomes.c: display_helper fix for vector.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 13:25:47 +0000 (15:25 +0200)]
mes.c: display_helper fix for vector.

6 years agoscm.mes: make-vector: fix fill.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 12:10:18 +0000 (14:10 +0200)]
scm.mes: make-vector: fix fill.

6 years agoparen.scm revert
Jan Nieuwenhuizen [Sun, 24 Jul 2016 11:28:17 +0000 (13:28 +0200)]
paren.scm revert

6 years agomes.c: fix apply.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 11:27:05 +0000 (13:27 +0200)]
mes.c: fix apply.

6 years agofix for-each.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 10:40:44 +0000 (12:40 +0200)]
fix for-each.

6 years agolalr paren test
Jan Nieuwenhuizen [Sun, 24 Jul 2016 10:08:21 +0000 (12:08 +0200)]
lalr paren test

6 years agoADD .gitignore.
Jan Nieuwenhuizen [Tue, 18 Oct 2016 20:43:23 +0000 (22:43 +0200)]
ADD .gitignore.

6 years agolib/lalr.scm
Jan Nieuwenhuizen [Tue, 18 Oct 2016 20:41:39 +0000 (22:41 +0200)]
lib/lalr.scm

6 years agomes.c: grok #\tab.
Jan Nieuwenhuizen [Sun, 24 Jul 2016 10:06:05 +0000 (12:06 +0200)]
mes.c: grok #\tab.

6 years agomes.c: add syntax, quasisyntax to reader....
Jan Nieuwenhuizen [Sat, 23 Jul 2016 22:40:37 +0000 (00:40 +0200)]
mes.c: add syntax, quasisyntax to reader....

6 years agosrfi-9 records!
Jan Nieuwenhuizen [Sat, 23 Jul 2016 22:14:40 +0000 (00:14 +0200)]
srfi-9 records!

6 years agomes.c: refactor begin and closures. Fixes bugs/top.mes.
Jan Nieuwenhuizen [Sat, 23 Jul 2016 22:01:31 +0000 (00:01 +0200)]
mes.c: refactor begin and closures. Fixes bugs/top.mes.

6 years agobugs/top.mes: document toplevel begin bug; probable reason for record/syntax-case...
Jan Nieuwenhuizen [Sat, 23 Jul 2016 13:29:14 +0000 (15:29 +0200)]
bugs/top.mes: document toplevel begin bug; probable reason for record/syntax-case failure.

6 years agocheck: resurrect guile-check.
Jan Nieuwenhuizen [Sat, 23 Jul 2016 13:17:03 +0000 (15:17 +0200)]
check: resurrect guile-check.

6 years agomes.c: remove hacks
Jan Nieuwenhuizen [Sat, 23 Jul 2016 13:11:32 +0000 (15:11 +0200)]
mes.c: remove hacks

6 years agotrying to get records up....WIP
Jan Nieuwenhuizen [Sat, 23 Jul 2016 12:39:33 +0000 (14:39 +0200)]
trying to get records up....WIP

6 years agosrfi-9
Jan Nieuwenhuizen [Sat, 23 Jul 2016 11:13:21 +0000 (13:13 +0200)]
srfi-9

6 years agolib/record.scm: import.
Jan Nieuwenhuizen [Sat, 23 Jul 2016 10:58:25 +0000 (12:58 +0200)]
lib/record.scm: import.

6 years agolib/srfi/srfi-0.scm: add.
Jan Nieuwenhuizen [Sat, 23 Jul 2016 10:54:34 +0000 (12:54 +0200)]
lib/srfi/srfi-0.scm: add.

6 years agomes.c: barf on unknown symbols.
Jan Nieuwenhuizen [Sat, 23 Jul 2016 09:51:06 +0000 (11:51 +0200)]
mes.c: barf on unknown symbols.

6 years agosyntax.mes: update from scheme48-1.1.
Jan Nieuwenhuizen [Sat, 23 Jul 2016 07:58:23 +0000 (09:58 +0200)]
syntax.mes: update from scheme48-1.1.

6 years agoAdd header to syntax.mes MERGE
Jan Nieuwenhuizen [Sat, 23 Jul 2016 07:47:15 +0000 (09:47 +0200)]
Add header to syntax.mes MERGE

6 years agoscm.mes: add last-pair.
Jan Nieuwenhuizen [Sat, 23 Jul 2016 06:17:49 +0000 (08:17 +0200)]
scm.mes: add last-pair.

6 years agotest.mes: enable vector tests for mes.
Jan Nieuwenhuizen [Sat, 23 Jul 2016 05:51:19 +0000 (07:51 +0200)]
test.mes: enable vector tests for mes.

6 years agoscm.mes: add assq-set!, assq-ref.
Jan Nieuwenhuizen [Fri, 22 Jul 2016 23:38:25 +0000 (01:38 +0200)]
scm.mes: add assq-set!, assq-ref.

6 years agoUpdate documentation, remove old bug files, move bugs into bugs/.
Jan Nieuwenhuizen [Fri, 22 Jul 2016 20:12:05 +0000 (22:12 +0200)]
Update documentation, remove old bug files, move bugs into bugs/.