mes.git
2 years agomescc: Cleanup mini-mes build and test.
Jan Nieuwenhuizen [Sun, 19 Mar 2017 12:41:56 +0000 (13:41 +0100)]
mescc: Cleanup mini-mes build and test.

* GNUmakefile (guile-cons-mes guile-m guile-main guile-micro-mes
  guile-mini-mes guile-t guile-tiny-mes): New targets.
  (clean): Clean them.
* .gitignore: Ignore them.
* HACKING: Update.
* scaffold/tiny-mes.c (bload_env): Read module/mes/tiny-0-32.mo.
* scaffold/cons-mes.c (simple_bload_env): Likewise.
* lib.c (dump)[MES_TINY]: Write crafted dump: module/mes/tiny-0-32.mo.
  (load_env): Read module/mes/mini-0.mes.
  (bload_env): Read module/mes/read-0-32.mo.
* module/mes/mini-0.mes: New file.
* module/mes/tiny-0.mes : New file.

2 years agomescc: Refactor libc.
Jan Nieuwenhuizen [Sun, 2 Apr 2017 10:29:09 +0000 (12:29 +0200)]
mescc: Refactor libc.

* GNUmakefile (mini-mes): Add include.
* mlibc.c: New file: libc bits for GNUC -nostdlib.
* mstart.c: New file: _start for GNUC -nostdlib.
* scaffold/cons-mes.c: Remove GNUC libc bits.
* scaffold/m.c: Likewise.
* scaffold/mini-mes.c: Likewise.
* scaffold/t.c: Likewise.
* scaffold/tiny-mes.c: Litkewise.
* module/language/c99/compiler.mes (libc, i386:libc): Remove.
* module/language/c99/compiler.scm
* module/mes/libc-i386.mes: Remove assembly bits.
  (_start): New function.
* module/mes/libc-i386.scm: Export it, remove assembly exports.
* module/mes/as-i386.mes: New file: assembly bits from libc-i386.mes.
* module/mes/as-i386.scm: New file: export them.
* module/mes/libc.mes (libc,_start): New functions from compiler.mes.
* module/mes/libc.scm: Export them.

2 years agomescc: Refactor ret.
Jan Nieuwenhuizen [Sun, 19 Mar 2017 09:27:18 +0000 (10:27 +0100)]
mescc: Refactor ret.

* module/mes/libc-i386.mes (i386:ret): Refactor.
* module/language/c99/compiler.mes (ast->info): Use it.

2 years agomescc: Cache text generation.
Jan Nieuwenhuizen [Sat, 18 Mar 2017 22:00:04 +0000 (23:00 +0100)]
mescc: Cache text generation.

* module/mes/elf-util.mes (functions->text): Add cache.

2 years agomescc: Refactor function-offset.
Jan Nieuwenhuizen [Sat, 18 Mar 2017 18:12:25 +0000 (19:12 +0100)]
mescc: Refactor function-offset.

* module/mes/elf-util.mes (function-offset): Recurse down.  Factor 5
  speedup on mini-mes.c.

2 years agomescc: Cache data-offset too.
Jan Nieuwenhuizen [Sat, 18 Mar 2017 07:58:15 +0000 (08:58 +0100)]
mescc: Cache data-offset too.

* module/mes/elf-util.mes (data-offset): Add cache.

2 years agomescc: Support assignment with comparison.
Jan Nieuwenhuizen [Sat, 18 Mar 2017 07:25:15 +0000 (08:25 +0100)]
mescc: Support assignment with comparison.

* module/language/c99/compiler.mes (expr->accu): Handle assignment -> accu.
* doc/examples/t.c (test): Test it.
* doc/examples/mini-mes.c (eval_apply): Use it.

2 years agomescc: Support assignment test.
Jan Nieuwenhuizen [Sat, 18 Mar 2017 07:17:18 +0000 (08:17 +0100)]
mescc: Support assignment test.

* module/language/c99/compiler.mes (test->jump->info): Handle assignment.
* doc/examples/t.c (test): Test it.

2 years agomescc: Fix simple value tests.
Jan Nieuwenhuizen [Fri, 17 Mar 2017 22:49:29 +0000 (23:49 +0100)]
mescc: Fix simple value tests.

* module/language/c99/compiler.mes (test->jump->info): Test accu
  before jumping.  Fixes simple value tests.

2 years agomescc: Struct by value.
Jan Nieuwenhuizen [Fri, 17 Mar 2017 21:45:48 +0000 (22:45 +0100)]
mescc: Struct by value.

* build-aux/mes-snarf.scm (symbol->names, function->header,
  function->environment): Remove struct by value assignment
  workarounds.
* module/language/c99/compiler.mes (ast->info): Remove struct by value
  assignment debug printing.

2 years agomescc: Support generic initializer.
Jan Nieuwenhuizen [Fri, 17 Mar 2017 16:54:37 +0000 (17:54 +0100)]
mescc: Support generic initializer.

* module/language/c99/compiler.mes (ast->info): Support generic
  declaration using initializer.  Supports struct field initializer.
* doc/examples/t.c (struct_test): Test it.
* doc/examples/mini-mes.c (call_lambda, eval_apply, write_byte,
  display_): Use it.  (call_lambda): (eval_apply,
  list_of_char_equal_p): Use it.

2 years agomescc: Remove last hardcodings for identifiers.
Jan Nieuwenhuizen [Fri, 17 Mar 2017 16:32:23 +0000 (17:32 +0100)]
mescc: Remove last hardcodings for identifiers.

* module/language/c99/compiler.mes (ident->accu, ident->base):
  Use local:ptr, type->size to remove hard coding of functionx, c1.
  (expr->accu): Use type->size to remove hard coding of size byte.
  (decl->type): Also handle typename, bail out if type not found.
  (type->size): Print identifier and and bail out if type not found.
  (formal:ptr): New function.
  (formals->locals): Use it to set pointer value of parameter.  WAS: 0.
  (ast->info): Remove functionx hardcoding.
  (getchar): Rename c1 to c.
* doc/examples/t.c: Test it.

2 years agomescc: Support function call with enum value.
Jan Nieuwenhuizen [Fri, 17 Mar 2017 07:37:45 +0000 (08:37 +0100)]
mescc: Support function call with enum value.

* doc/examples/mini-mes.c: Remove debug printing.
* module/language/c99/compiler.mes (push-global, push-local,
  push-global-address, push-local-address, push-local-de-ref): Return
  list of lambda.
  (push-ident): Support push constant.  Fixes mini-mes,
  cstring_to_list.
* doc/examples/t.c (test): Test it.

2 years agomescc: Fix d-sel comparisons.
Jan Nieuwenhuizen [Mon, 13 Mar 2017 23:15:13 +0000 (00:15 +0100)]
mescc: Fix d-sel comparisons.

* module/language/c99/compiler.mes (ast->info): Save base while
computing accu. Fix comparison using d-sel in second argument.
* doc/examples/t.c: Test it.
* doc/examples/mini-mes.c (assq): Use it.

2 years agomescc: Fix for character array s[0].
Jan Nieuwenhuizen [Mon, 13 Mar 2017 18:38:38 +0000 (19:38 +0100)]
mescc: Fix for character array s[0].

* module/language/c99/compiler.mes (expr->arg, expr->accu, ast->info):
  Use type size to calculate index.
* doc/examples/t.c: Test it.
* doc/examples/mini-mes.c (cstring_to_list): Simplify.

2 years agomescc: Support mini-mes running scheme program with builtins.
Jan Nieuwenhuizen [Sun, 12 Mar 2017 11:02:12 +0000 (12:02 +0100)]
mescc: Support mini-mes running scheme program with builtins.

Mini-mes, compiled with either gcc or mescc, now runs a memory dump of
this mini-0.mes program

(begin
  (write-byte (make-cell 0 0 65))
  (write-byte (make-cell 0 0 66))
          (write-byte (make-cell 0 0 67))
    (write-byte (make-cell 0 0 10))
  #f)

when read and dumped by (gcc-compiled) mes-32.

* build-aux/mes-snarf.scm: FIXES ..collapse?
* module/language/c99/compiler.mes (ast->info): Bail out on unhandled
  declarations.  Was: verbosely skip.

2 years agomescc: Support [for] itoa.
Jan Nieuwenhuizen [Sun, 12 Mar 2017 10:05:20 +0000 (11:05 +0100)]
mescc: Support [for] itoa.

* module/mes/libc-i386.mes (i386:accu%base): New function.
* module/mes/libc-i386.scm: Export it.
* module/language/c99/compiler.mes (expr->accu): Use it to support mod.
* doc/examples/t.c (itoa): New function.
  (test): Test it.
* doc/examples/mini-mes.c (itoa)[!__GNUC__]: New function.

2 years agomescc: Support do .. while.
Jan Nieuwenhuizen [Sun, 12 Mar 2017 10:05:00 +0000 (11:05 +0100)]
mescc: Support do .. while.

* module/language/c99/compiler.mes (ast->info): Support do-while.
* doc/examples/t.c (test): Test it.

2 years agocore+mini-mes: Replace manual snippets by snarfed includes.
Jan Nieuwenhuizen [Fri, 10 Mar 2017 19:56:18 +0000 (20:56 +0100)]
core+mini-mes: Replace manual snippets by snarfed includes.

* build-aux/mes-snarf.scm (symbol->source, function->header,
  function->source, function->environment): Add workarounds to
  avoid struct-copy initializers.
* GNUmakefile (mini-mes): Snarf symbols and functions.
* scaffold/mini-mes.c: Include mini-mes.h, mini-mes.symbols.h,
  mini-mes.symbols.i, mini-mes.i, mini-mes.environment.i.
  Add snarfable symbol/special definitions.
  (type_t): Prefix all types with `T', update users.
  (assert_defined, gc_push_frame, gc_peek_frame, gc_init_cells): Mark
  as internal.
* mes.c (type_t): Prefix all types with `T', update users.
* scaffold/mini-mes.c (eq_p, type_, car_, cdr_,
  list_of_char_equal_p, lookup_macro, write_byte): New functions (from
  mes.c).
  (assq): Add debugging, workaround.

2 years agonyacc: removed start from lalr-spec -- not needed
Matt Wette [Sun, 5 Mar 2017 21:22:51 +0000 (13:22 -0800)]
nyacc: removed start from lalr-spec -- not needed

2 years agonyacc: working javascript interpreter in guile
Matt Wette [Sat, 4 Mar 2017 01:07:29 +0000 (17:07 -0800)]
nyacc: working javascript interpreter in guile

2 years agonyacc: lex fixes for char-lit
Matt Wette [Fri, 3 Mar 2017 00:23:44 +0000 (16:23 -0800)]
nyacc: lex fixes for char-lit

2 years agonyacc: cleaned up documentation
Matt Wette [Thu, 2 Mar 2017 02:11:40 +0000 (18:11 -0800)]
nyacc: cleaned up documentation

2 years agonyacc: working on C99 UG as a memo
Matt Wette [Wed, 1 Mar 2017 01:19:48 +0000 (17:19 -0800)]
nyacc: working on C99 UG as a memo

2 years agonyacc: new release 0.76.5
Matt Wette [Tue, 28 Feb 2017 17:57:49 +0000 (09:57 -0800)]
nyacc: new release 0.76.5

2 years agonyacc: fixed bug in pretty-print-c99 wrt i-sel
Matt Wette [Tue, 28 Feb 2017 17:53:41 +0000 (09:53 -0800)]
nyacc: fixed bug in pretty-print-c99 wrt i-sel

3 years agonyacc: merge from 0.76.4
Matt Wette [Sat, 25 Feb 2017 15:36:57 +0000 (07:36 -0800)]
nyacc: merge from 0.76.4

3 years agonyacc: new release 0.76.4
Matt Wette [Fri, 24 Feb 2017 01:31:24 +0000 (17:31 -0800)]
nyacc: new release 0.76.4

3 years agonyacc: new release 0.76.3
Matt Wette [Thu, 23 Feb 2017 13:38:49 +0000 (05:38 -0800)]
nyacc: new release 0.76.3

3 years agonyacc: more bugs in cpp tokl->string
Matt Wette [Thu, 23 Feb 2017 13:37:25 +0000 (05:37 -0800)]
nyacc: more bugs in cpp tokl->string

3 years agonyacc: new release 0.76.2
Matt Wette [Thu, 23 Feb 2017 01:14:07 +0000 (17:14 -0800)]
nyacc: new release 0.76.2

3 years agonyacc: fixed more CPP issues
Matt Wette [Thu, 23 Feb 2017 01:12:32 +0000 (17:12 -0800)]
nyacc: fixed more CPP issues

3 years agonyacc: new release 0.76.1
Matt Wette [Wed, 22 Feb 2017 16:26:40 +0000 (08:26 -0800)]
nyacc: new release 0.76.1

3 years agonyacc: fixed C99 CPP to deal with numbers correctly
Matt Wette [Wed, 22 Feb 2017 16:23:27 +0000 (08:23 -0800)]
nyacc: fixed C99 CPP to deal with numbers correctly

3 years agonyacc: merge master 0.76.0
Matt Wette [Mon, 20 Feb 2017 21:45:45 +0000 (13:45 -0800)]
nyacc: merge master 0.76.0

3 years agonyacc: new release 0.76.0
Matt Wette [Sun, 19 Feb 2017 16:28:25 +0000 (08:28 -0800)]
nyacc: new release 0.76.0

3 years agonyacc: worked c99/util2.scm udecl->mspec
Matt Wette [Sun, 19 Feb 2017 16:26:30 +0000 (08:26 -0800)]
nyacc: worked c99/util2.scm udecl->mspec

3 years agonyacc: new release 0.75.6
Matt Wette [Sun, 19 Feb 2017 01:11:12 +0000 (17:11 -0800)]
nyacc: new release 0.75.6

3 years agonyacc: fixed some c99/util2 items
Matt Wette [Sun, 19 Feb 2017 01:06:50 +0000 (17:06 -0800)]
nyacc: fixed some c99/util2 items

3 years agonyacc: merged in 0.75.5 from master and inc version
Matt Wette [Fri, 17 Feb 2017 18:21:52 +0000 (10:21 -0800)]
nyacc: merged in 0.75.5 from master and inc version

3 years agonyacc: new release 0.75.5
Matt Wette [Fri, 17 Feb 2017 16:30:20 +0000 (08:30 -0800)]
nyacc: new release 0.75.5

3 years agonyacc: new release 0.74.4
Matt Wette [Fri, 17 Feb 2017 00:14:42 +0000 (16:14 -0800)]
nyacc: new release 0.74.4

3 years agonyacc: minor cpp fixes
Matt Wette [Fri, 17 Feb 2017 00:12:40 +0000 (16:12 -0800)]
nyacc: minor cpp fixes

3 years agonyacc: merge from 0.75.3
Matt Wette [Thu, 16 Feb 2017 19:03:11 +0000 (11:03 -0800)]
nyacc: merge from 0.75.3

3 years agonyacc: new release 0.75.3
Matt Wette [Thu, 16 Feb 2017 14:26:10 +0000 (06:26 -0800)]
nyacc: new release 0.75.3

3 years agonyacc: new release 0.75.2
Matt Wette [Thu, 16 Feb 2017 14:24:56 +0000 (06:24 -0800)]
nyacc: new release 0.75.2

3 years agonyacc: new release 0.75.1
Matt Wette [Thu, 16 Feb 2017 14:12:32 +0000 (06:12 -0800)]
nyacc: new release 0.75.1

3 years agonyacc: new release 0.74.0
Matt Wette [Thu, 16 Feb 2017 04:49:07 +0000 (20:49 -0800)]
nyacc: new release 0.74.0

3 years agonyacc: I think cpp is working now
Matt Wette [Thu, 16 Feb 2017 03:58:29 +0000 (19:58 -0800)]
nyacc: I think cpp is working now

3 years agonyacc: working cpp now, I hope
Matt Wette [Wed, 15 Feb 2017 03:24:59 +0000 (19:24 -0800)]
nyacc: working cpp now, I hope

3 years agonyacc: CPP not yet working for file mode
Matt Wette [Sun, 12 Feb 2017 22:29:18 +0000 (14:29 -0800)]
nyacc: CPP not yet working for file mode

3 years agonyacc: working on cpp issues
Matt Wette [Sat, 11 Feb 2017 21:04:38 +0000 (13:04 -0800)]
nyacc: working on cpp issues

3 years agonyacc: C99 CPP for code is better
Matt Wette [Sun, 5 Feb 2017 15:52:44 +0000 (07:52 -0800)]
nyacc: C99 CPP for code is better

3 years agonyacc: starting to work on reframing
Matt Wette [Fri, 20 Jan 2017 22:51:55 +0000 (14:51 -0800)]
nyacc: starting to work on reframing

3 years agonyacc: more CPP fixes
Matt Wette [Thu, 19 Jan 2017 01:26:41 +0000 (17:26 -0800)]
nyacc: more CPP fixes

3 years agonyacc: redesign lang/c99/cppbocy.scm:scan-cpp-input
Matt Wette [Tue, 17 Jan 2017 13:50:45 +0000 (05:50 -0800)]
nyacc: redesign lang/c99/cppbocy.scm:scan-cpp-input

2 years agomescc: Support goto in while body.
Jan Nieuwenhuizen [Fri, 10 Mar 2017 06:01:51 +0000 (07:01 +0100)]
mescc: Support goto in while body.

* module/language/c99/compiler.mes (ast->info): Support goto in while
  body.
* doc/examples/t.c (test): Test it.

2 years agocore+mini-mes: Move function name to struct function.
Jan Nieuwenhuizen [Thu, 9 Mar 2017 22:27:12 +0000 (23:27 +0100)]
core+mini-mes: Move function name to struct function.

* module/language/c99/compiler.mes (expr->arg): Handle char arguments.
* doc/examples/cons-mes.c (struct function): Add name field.
* doc/examples/mini-mes.c: Likewise.
  (mes_builtins): Update.
* mes.c: Likewise.
* build-aux/mes-snarf.scm: Update.

2 years agomescc: Support strings in struct initialization.
Jan Nieuwenhuizen [Thu, 9 Mar 2017 07:14:27 +0000 (08:14 +0100)]
mescc: Support strings in struct initialization.

* module/mes/elf-util.mes (add-s:-prefix, drop-s:-prefix): New functions.
* module/mes/elf-util.scm: Export them.
* module/language/c99/compiler.mes (string->global): Add `s:' prefix
  to global strings.  Update users.
  (expr->arg): Update.
  (expr->accu): Handle string expressions.
  (initzer->global): New function.
  (struct-field): Handle string field.
* doc/examples/t.c: Test it.
* doc/examples/mini-mes.c: Use it.

dun!

2 years agomescc: Display sexps better.
Jan Nieuwenhuizen [Tue, 7 Mar 2017 21:33:59 +0000 (22:33 +0100)]
mescc: Display sexps better.

* module/mes/elf.mes (make-elf): Only display data sections smaller
  than 200 bytes.
* doc/examples/mini-mes.c (simple_bload_env): Read mini-0-32.mes.
* doc/examples/cons-mes.c (display_): Support symbols and specials.
* doc/examples/tiny-mes.c: Likewise.
* lib.c:
* mes.c:

2 years agomescc: Compile all of mini-mes.
Jan Nieuwenhuizen [Mon, 6 Mar 2017 06:14:15 +0000 (07:14 +0100)]
mescc: Compile all of mini-mes.

* module/language/c99/compiler.mes (case->jump-info): Support single statement.
* module/mes/elf-util.mes (function-prefix): Workaround for reversed
  functions.  FIXME!
* module/mes/elf.mes:
* scaffold/mini-mes.c (type_t): Rename FUNCTION to TFUNCTION for Nyacc.
  Add missing symbols.
  (eval_apply): Uncomment most.
* scaffold/tiny-mes.c:
* scaffold/cons-mes.c: Remove cruft.

2 years agomescc: Support struct assignment.
Jan Nieuwenhuizen [Thu, 2 Mar 2017 19:26:13 +0000 (20:26 +0100)]
mescc: Support struct assignment.

* module/mes/libc-i386.mes (i386:base-address->accu-address,
  i386:accu+n, i386:base+n): New functions.
* module/mes/libc-i386.scm: Export them.
* module/language/c99/compiler.mes (ast->info): Use them.
* doc/examples/t.c: Test them.
* doc/examples/cons-mes.c: Drop workarounds.
* doc/examples/mini-mes.c: Likewise.
* mes.c:

2 years agomescc: Fix add, sub, lshift.
Jan Nieuwenhuizen [Thu, 2 Mar 2017 19:19:53 +0000 (20:19 +0100)]
mescc: Fix add, sub, lshift.

* module/language/c99/compiler.mes (expr->accu): Fix add, sub, lshift.
* doc/examples/t.c: Test them.
* doc/examples/cons-mes.c:
* doc/examples/mini-mes.c:

3 years agomescc: Support any expression as arg.
Jan Nieuwenhuizen [Mon, 27 Feb 2017 06:50:33 +0000 (07:50 +0100)]
mescc: Support any expression as arg.

* module/language/c99/compiler.mes (expr->arg): Also push parameter,
  always return info.
  (ast->info): Loop over args.  Fixes using function calls in arguments.
* module/mes/libc-i386.mes (i386:push-arg): Remove.
  (i386:call, i386:call-accu): Remove arguments parameter.
* doc/examples/t.c: Test it.

2 years agomescc: Rename expr->accu*.
Jan Nieuwenhuizen [Thu, 2 Mar 2017 05:41:19 +0000 (06:41 +0100)]
mescc: Rename expr->accu*.

* module/language/c99/compiler.mes (expr->accu*): Rename from expr->accuX.

2 years agomescc: Fixes for goto.
Jan Nieuwenhuizen [Sun, 2 Apr 2017 10:13:04 +0000 (12:13 +0200)]
mescc: Fixes for goto.

* module/mes/libc-i386.mes (XXjump): New function.
* module/mes/libc-i386.scm: Export it.
* module/language/c99/compiler.mes (case->jump-info, ast->info): Use it.
* scaffold/t.c: Test it.
* GNUmakefile (cons-mes): New target.
* scaffold/cons-mes.c: New file.
* scaffold/mini-mes.c:

3 years agomescc: Mini-mes runs (cons 0 1) dump.
Jan Nieuwenhuizen [Fri, 24 Feb 2017 12:27:39 +0000 (13:27 +0100)]
mescc: Mini-mes runs (cons 0 1) dump.

* module/mes/libc-i386.mes (i386:Xjump-z, i386:Xjump-c,
  i386:Xjump-nc): New functions.
* module/mes/libc-i386.scm: Export them.
* module/language/c99/compiler.mes (case->jump-info, test-jump->info,
  ast->info): Use them.
* doc/examples/t.c: Test it.
* doc/examples/mini-mes.c: Run it.

3 years agomescc: Run mini-mes.
Jan Nieuwenhuizen [Sun, 29 Jan 2017 14:22:39 +0000 (15:22 +0100)]
mescc: Run mini-mes.

* .gitignore: Ignore tiny-mes and tiny .mo's.
* doc/examples/tiny-mes.c: Simplify.
* doc/examples/mini-mes.c: Use simplifications from tiny-mes.
* doc/examples/t.c (read_test, struct_test): New functions.
  (test): Add tests for arena, g_cells globals.
* module/mes/elf-util.mes (dec->hex): New function.
  (lambda/label->list): Add text-address parameter.  Update callers.
* module/language/c99/compiler.mes (make, info, clone): Add init field.
  (.init): New function.
  (ident->accu): Add exceptions for globals.
* module/mes/elf-util.scm: Export it.
* module/mes/libc-i386.mes (i386:accu->base-ref,
  i386:byte-accu->base-ref, i386:accu->base-ref+n,
  i386:accu->global-ref, i386:global-ref->accu, i386:global-ref->base,
  i386:global-add, i386:global->accu):, i386:local-ref->accu,
  i386:local-ptr->accu, i386:local-ptr->base): New functions.
* module/mes/libc-i386.scm: Export them.

3 years agodoc: Add gdb assembly debugging info.
Jan Nieuwenhuizen [Sun, 22 Jan 2017 13:16:22 +0000 (14:16 +0100)]
doc: Add gdb assembly debugging info.

* HACKING: Add gdb assembly debugging info.

3 years agodoc: Add fosdem talk.
Jan Nieuwenhuizen [Sat, 21 Jan 2017 15:15:34 +0000 (16:15 +0100)]
doc: Add fosdem talk.

* .gitignore: Ignore beamer/tex stuff.
* doc/fosdem/fosdem.org: New file.
* doc/fosdem/GuixSD.png: New file.
* doc/fosdem/LISP-1-5-page-13-bottom.png: New file.
* doc/fosdem/LISP-1.5-page-13-bottom.png: New file.
* doc/fosdem/LISP-1.5-page-13.pdf: New file.
* doc/fosdem/LISP-1.5-page-13.png: New file.
* doc/fosdem/beamercolorthemeX.sty: New file.
* doc/fosdem/beamerthemeX.sty: New file.
* doc/fosdem/bootstrap-graph.png: New file.
* doc/fosdem/egg.jpeg: New file.
* doc/fosdem/egg.png: New file.
* doc/fosdem/egg.xcf: New file.
* doc/fosdem/fosdem.pdf: New file.
* doc/fosdem/fsb-logo-guile-guix-gnu.png: New file.
* doc/fosdem/fsb-logo-guile-guix-gnu.xcf: New file.
* doc/fosdem/fsb-logo-guile-guix-mes.png: New file.
* doc/fosdem/fsb-logo-guile-guix-mes.xcf: New file.
* doc/fosdem/fsb-logo.png: New file.
* doc/fosdem/guix-build-bootstrap-tarballs.log: New file.
* doc/fosdem/html.sty: New file.
* doc/fosdem/mes.png: New file.
* doc/fosdem/mes.xcf: New file.

3 years agomescc: bugfix: arg as function call.
Jan Nieuwenhuizen [Sat, 21 Jan 2017 12:17:24 +0000 (13:17 +0100)]
mescc: bugfix: arg as function call.

* module/language/c99/compiler.mes (expr->arg):

3 years agomini-mes: gcc: run (cons 0 1).
Jan Nieuwenhuizen [Wed, 18 Jan 2017 06:38:45 +0000 (07:38 +0100)]
mini-mes: gcc: run (cons 0 1).

3 years agonyacc: new release 0.74.3
Matt Wette [Sun, 15 Jan 2017 16:51:21 +0000 (08:51 -0800)]
nyacc: new release 0.74.3

3 years agonyacc: CPP working better now
Matt Wette [Sun, 15 Jan 2017 16:47:49 +0000 (08:47 -0800)]
nyacc: CPP working better now

3 years agonyacc: something working
Matt Wette [Sat, 14 Jan 2017 23:16:28 +0000 (15:16 -0800)]
nyacc: something working

3 years agonyacc: still debugginug
Matt Wette [Sat, 14 Jan 2017 21:30:47 +0000 (13:30 -0800)]
nyacc: still debugginug

3 years agonyacc: working # and ## I think, but lots of debug output too
Matt Wette [Thu, 12 Jan 2017 00:37:58 +0000 (16:37 -0800)]
nyacc: working # and ## I think, but lots of debug output too

3 years agonyacc: exceptions worked on.. still need to fix #
Matt Wette [Wed, 11 Jan 2017 16:14:45 +0000 (08:14 -0800)]
nyacc: exceptions worked on.. still need to fix #

3 years agonyacc: new release 0.74.2
Matt Wette [Wed, 11 Jan 2017 04:10:32 +0000 (20:10 -0800)]
nyacc: new release 0.74.2

3 years agonyacc: fixed C99 use of 'defined XYZ' (no parens)
Matt Wette [Wed, 11 Jan 2017 04:06:28 +0000 (20:06 -0800)]
nyacc: fixed C99 use of 'defined XYZ' (no parens)

3 years agonyacc: merged master
Matt Wette [Wed, 11 Jan 2017 02:57:27 +0000 (18:57 -0800)]
nyacc: merged master

3 years agonyacc: working on fixes
Matt Wette [Wed, 11 Jan 2017 02:56:00 +0000 (18:56 -0800)]
nyacc: working on fixes

3 years agomescc: Read and display sexp dumped by mes.
Jan Nieuwenhuizen [Tue, 10 Jan 2017 19:05:47 +0000 (20:05 +0100)]
mescc: Read and display sexp dumped by mes.

* lib.c (dump)[MES_HACK]: Dump small hello-world sexp, to be handled by
* doc/examples/tiny-mes.c (display_): New function.
* module/mes/libc-i386.mes (i386:accu->base, i386:mem->accu,
  i386:mem+n->accu): New functions.
* module/mes/libc-i386.scm: Export them.
* GNUmakefile (mes-32): New target.

3 years agomescc: Support global pointer assignments.
Jan Nieuwenhuizen [Tue, 17 Jan 2017 17:57:41 +0000 (18:57 +0100)]
mescc: Support global pointer assignments.

* module/mes/libc-i386.mes (base->accu-ref, local-ref->base): New functions.
* module/mes/libc-i386.scm: Export them.
* module/language/c99/compiler.mes (base->ident-ref, ident-ref->base):
  New functions.

3 years agomescc: Add data as loadable ELF section.
Jan Nieuwenhuizen [Tue, 17 Jan 2017 17:48:54 +0000 (18:48 +0100)]
mescc: Add data as loadable ELF section.

* module/mes/elf.mes (make-elf): Add data as loadable section too.

3 years agomescc: Support switch.
Jan Nieuwenhuizen [Tue, 17 Jan 2017 18:03:08 +0000 (19:03 +0100)]
mescc: Support switch.

* module/language/c99/compiler.mes (case->jump-info): New function.
  (ast->info): Use it.
* doc/examples/t.c (swits): Test it.

3 years agomescc: Handle enums.
Jan Nieuwenhuizen [Tue, 10 Jan 2017 21:44:01 +0000 (22:44 +0100)]
mescc: Handle enums.

* module/language/c99/compiler.mes (<types>, <constants>): New slots for info.
 (make, clone): Add them.
 (.types, .constants): New accessors.

3 years agomescc: Update for.
Jan Nieuwenhuizen [Tue, 10 Jan 2017 19:51:29 +0000 (20:51 +0100)]
mescc: Update for.

* module/language/c99/compiler.mes (ast->info): Rewrite for to use
  test->jump->info.

3 years agoscm: Add string-delete.
Jan Nieuwenhuizen [Tue, 17 Jan 2017 17:48:28 +0000 (18:48 +0100)]
scm: Add string-delete.

* module/srfi/srfi-13.mes (string-delete): New function.

2 years agomescc: Add open/read C-tests.
Jan Nieuwenhuizen [Sun, 2 Apr 2017 10:10:38 +0000 (12:10 +0200)]
mescc: Add open/read C-tests.

* scaffold/m.c: New file.
* scaffold/tiny-mes.c: New file.
* GNUmakefile (m, tiny-mes): New targets.
* scaffold/micro-mes.c: Update gcc-libc bits.
* scaffold/mini-mes.c: Likewise.

3 years agomescc: Support ?.
Jan Nieuwenhuizen [Tue, 10 Jan 2017 19:27:44 +0000 (20:27 +0100)]
mescc: Support ?.

* module/language/c99/compiler.mes (ast->info): Support cond-expr.
* scaffold/t.c (test): Test it.

3 years agomescc: Support open, read.
Jan Nieuwenhuizen [Tue, 10 Jan 2017 19:35:52 +0000 (20:35 +0100)]
mescc: Support open, read.

* module/mes/libc-i386.mes (i386:write): Fix comment.
  (i386:open, i386:read): New functions.
* module/mes/libc-i386.scm: Export them.
* module/language/c99/compiler.mes (i386:libc): Add them.
  (getchar, putchar): New libc functions.
  (libc): Add them.

3 years agomescc: Support globals.
Jan Nieuwenhuizen [Tue, 10 Jan 2017 19:12:06 +0000 (20:12 +0100)]
mescc: Support globals.

* module/language/c99/compiler.mes (write-any): Catch writing of
  procedure and give more debug information.
  (ref-local, ref-global): Remove.
  (push-global-ref, push-global, push-ident-ref): New functions.
  (push-ident): New function.
  (expr->arg): Use them.
  (ident->accu, ident->accu, accu->ident, value->ident, ident->base):
  Take info parameter, also handle globals.
  (ident-address->accu, ident->global, cstring->number): New functions.
  (ast->info): Update.
* module/mes/libc-i386.mes (i386:ret-local): Remove.
  (i386:push-global-ref): Rename from i386:ref-global.
  (i386:push-local): Rename from i386:ref-local.
  (i386:value->local): Rename from i386:local-assign.
  (i386:push-global, i386:push-local-ref, i386:value->global,
  i386:local-address->accu): New functions.
* module/mes/libc-i386.scm: Export them.

3 years agomescc: Small ELF tweaks allowing debugging with gdb.
Jan Nieuwenhuizen [Mon, 9 Jan 2017 19:06:32 +0000 (20:06 +0100)]
mescc: Small ELF tweaks allowing debugging with gdb.

* module/mes/elf.mes (make-elf): Change note section to comment.  Fixes
  readelf.  Add SHF-ALLOC to .text and .data.

3 years agomescc: Handle && in if and while.
Jan Nieuwenhuizen [Sun, 8 Jan 2017 16:51:40 +0000 (17:51 +0100)]
mescc: Handle && in if and while.

* scaffold/t.c (test): Add strcmp tests.
* module/language/c99/compiler.mes (expr->arg):
  (test->jump->info): New function.
  (ast->info): Use it.
* module/mes/libc-i386.mes (i386:global->accu):
  (i386:base-mem->accu): Rename from i386:mem->accu.
  (i386:byte-base-mem->accu): Rename from i386:base-mem->accu.
  (i386:accu-not, i386:global->accu, i386:xor-accu): New functions.
* module/mes/libc-i386.scm: Export them.

3 years agomescc: Proper support for i++,++i,i--,--i.
Jan Nieuwenhuizen [Sat, 7 Jan 2017 20:53:12 +0000 (21:53 +0100)]
mescc: Proper support for i++,++i,i--,--i.

* module/language/c99/compiler.mes (ast->info): Bugfix: locals.
  Add i--, --i.  Properly support i++, ++i.
* module/mes/libc-i386.mes (i386:function-locals): Support 8 local vars.
* scaffold/t.c (test): Test it.

2 years agomescc: Beginning of expression and test template.
Jan Nieuwenhuizen [Sun, 2 Apr 2017 10:23:00 +0000 (12:23 +0200)]
mescc: Beginning of expression and test template.

* scaffold/t.c: New file.
* GNUmakefile (mescc-check, t-check): New targets.
* module/language/c99/compiler.mes (write-any): Catch weirdness.
  (make): Add <function> slot.
  (.function): New accessor.
  (clone): Handle it.
  (function->info): Set it.
  (ast->info): Make tests generic in if, for, while.  Add goto, label,
  !, ==, !=, -, &&.
* module/mes/elf-util.mes (lambda/label->list): New function.
  (text->list): Use it.
  (functions->text, function-prefix): New function.
  (function-offset): Use it.
  (label-offset): New function.
* module/mes/elf-util.scm (mes): Export them.
* module/mes/elf.mes (make-elf): Use text->list.
* module/mes/libc-i386.mes (eputs, puts): Remove.
  (i386:byte-base-sub): Rename from sub-byte-base.
  (i386:byte-jump-z): Rename from i386:Xjump-byte-z.
  (i386:byte-mem->accu): Rename from i386:Xmem-byte->accu.
  (i386:byte-mem->base): Rename from i386:Xmem-byte->base.
  (i386:accu->local, i386:accu-non-zero?, i386:accu-zero?,
  i386:base-sub, i386:byte-sub-base, i386:jump-c, i386:jump-cz,
  i386:jump-nc, i386:jump-ncz, i386:byte-mem->base, i386:sub-base,
  i386:test-accu, i386:test-base, i386:test-jump-z, i386:value->base,
  i386:xor-zf): New functions.

3 years agomescc: Have micro-mes use strcmp to print help.
Jan Nieuwenhuizen [Thu, 5 Jan 2017 23:20:05 +0000 (00:20 +0100)]
mescc: Have micro-mes use strcmp to print help.

* doc/examples/micro-mes.c (main): Add --help.
* module/language/c99/compiler.mes (info?): New function.
  (expr->accu): Handle function call and sub.
  (ast->info): Handle if not, and, de-ref, eq, sub, return f ().
* module/mes/libc-i386.mes (i386:accu-zero?, i386:Xmem-byte->accu,
  i386:Xmem-byte->base, i386:jump-byte-nz, i386:jump-byte-z,
  i386:test-byte-base, i386:Xjump-byte-z, i386:sub-byte-base): New
  functions.
* module/mes/libc-i386.scm: Export them.

3 years agomescc: Compile specific for loop.
Jan Nieuwenhuizen [Thu, 5 Jan 2017 20:24:56 +0000 (21:24 +0100)]
mescc: Compile specific for loop.

* module/language/c99/compiler.mes (ast->info): Handle for, pre-inc.
* GNUmakefile (main): New target.
* doc/examples/main.c:
  (exit, write, strlen,puts)[__GNUC__]: New functions; import from micro-mes.c
  (_start): New function.

3 years agomescc: Refactor compiler.
Jan Nieuwenhuizen [Wed, 4 Jan 2017 23:55:46 +0000 (00:55 +0100)]
mescc: Refactor compiler.

* module/language/c99/compiler.mes (make, clone): Lightweight functional
  GOOPS-like list-based info structure.
  (make-text+globals+locals): Remove.
  (ast->info): Rename from statement->text+globals+locals, refactor.
  Update callers.
  (function->info): Rename from function->globals, refactor.  Update
  callers.
  (ast-list->info): New function.