about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-06-27 21:34:40 -0700
committerKartik Agaram <vc@akkartik.com>2018-06-27 21:49:27 -0700
commit66cd241ebcf6ba072c2a54bbf6894acff42bc799 (patch)
treea1dc0c5a73d4218cb8a7ae75e63f0b6231bb0337 /subx
parent697d1d121390483881e85f6508e5f2899cf3f137 (diff)
downloadmu-66cd241ebcf6ba072c2a54bbf6894acff42bc799.tar.gz
4276 - switching gears to subx
New plan: spend some time learning to program in machine code atop subx,
relying solely on a tiny subset of kernel-provided syscalls. Gradually
introduce helpers.

Helpers we're sure we don't need, so far:
  a) Nested expressions
  b) Garbage collection
  c) One-size-fits-all memory allocation primitive
  d) Function overloading and generics

Helpers we're sure we need, so far:
  a) Dependency-injected versions of syscalls
  b) Tangling directives
  c) Statically checked types

Workflow for a C translator from ascii to binary:
  a) run generated machine code atop subx (unit tests probably go here)
  b) emit machine code packaged as an ELF file
  c) check that the ELF binary runs natively
  d) check that the ELF binary can be unwrapped and run atop subx

This is different from a conventional compiler because the 'HLL' is
unconstrained.
It is also different from Forth given the emphasis on types.

We want a simple stack that also encourages code sharing between
programmers. Conventional languages grow monotonically complex. Forth
discourages code sharing; it is non-trivial to figure out the 'shape' of
data a strange function expects on the stack.
Diffstat (limited to 'subx')
-rw-r--r--subx/001help.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/subx/001help.cc b/subx/001help.cc
index a9bf85f5..f938fdfc 100644
--- a/subx/001help.cc
+++ b/subx/001help.cc
@@ -6,7 +6,10 @@ if (argc <= 1 || is_equal(argv[1], "--help")) {
   //: this is the functionality later layers will provide
   // currently no automated tests for commandline arg parsing
   cerr << "Usage:\n"
-       << "  subx test\n";
+       << "  subx test\n"
+       << "  subx --help\n"
+       << "  subx <elf file>\n"
+       ;
   return 0;
 }