sod
8 years agoMakefile.am, debian/: Initial packaging; release 0.2.0. 0.2.0
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
Makefile.am, debian/: Initial packaging; release 0.2.0.

8 years agoMakefile.am: Include a pkgconfig file.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
Makefile.am: Include a pkgconfig file.

8 years agoInclude `confsubst' machinery.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
Include `confsubst' machinery.

8 years agoMakefile.am: Write release number into distribution packages.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
Makefile.am: Write release number into distribution packages.

8 years agoMakefile.am: Actually distribute the `auto-version' script.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
Makefile.am: Actually distribute the `auto-version' script.

8 years agosrc/Makefile.am: Install `parser' files in the correct place.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/Makefile.am: Install `parser' files in the correct place.

We have to use the `nobase_...' variable, which is waaay too long.  So
invent our own variable `LISP_SOURCES' and use that instead.

8 years agosrc/Makefile.am: Distribute `src/parser/package.lisp'.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/Makefile.am: Distribute `src/parser/package.lisp'.

8 years agosrc/Makefile.am, src/test-base.lisp: Check version numbers match.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/Makefile.am, src/test-base.lisp: Check version numbers match.

We have version numbers in two places, and that's no good, but I can't
see a good way of generating the Lisp package version from the Git
version, so I'm just going to add a test that they match.

It's not a perfect test, but it ought to do.

8 years agosrc/Makefile.am: Improve test running rule.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/Makefile.am: Improve test running rule.

Catch errors and print them briefly rather than having a full stack
backtrace.

8 years agosrc/test-base.lisp: Actually signal an error if the tests fail.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/test-base.lisp: Actually signal an error if the tests fail.

8 years agosrc/parser/parser-test.lisp: Suppress maybe-unused variable warning.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/parser/parser-test.lisp: Suppress maybe-unused variable warning.

8 years agosrc/c-types-parse.lisp: Some better comment formatting.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/c-types-parse.lisp: Some better comment formatting.

8 years agosrc/c-types-parse.lisp: Handle `...' in prefix-`(' disambiguation.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/c-types-parse.lisp: Handle `...' in prefix-`(' disambiguation.

Now that we've actually got the machinery to parse ellipses in function
argument lists, it'd be nice to do it properly.

(I think -- but I might be wrong -- that the reason this wasn't done
before is that C doesn't let you put `...' as the only thing in an
argument list, because you need to have a named argument to initialize
the `va_list'.  But Sod can, and does, because there's always at least a
receiver argument.)

8 years agosrc/module-parse.lisp: Reinstate `peek' around the main item parser.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/module-parse.lisp: Reinstate `peek' around the main item parser.

This was removed for debugging.  Now we can parse slot initializers
again.

The error handling for class items is still pretty awful and needs
fixing.

8 years agosrc/module-parse.lisp: Don't allow a method body on a varargs message def.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/module-parse.lisp: Don't allow a method body on a varargs message def.

It doesn't work because the method will have the wrong type.

8 years agosrc/class-make-impl.lisp: Make `make-sod-MUMBLE' actually return a MUMBLE.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/class-make-impl.lisp: Make `make-sod-MUMBLE' actually return a MUMBLE.

8 years agosrc/method-{proto,impl}.lisp: Add `:valist' method-entry role.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/method-{proto,impl}.lisp: Add `:valist' method-entry role.

For each varargs message, add a new entry whose name has a `__v' suffix,
and which takes a `va_list' argument in place of the variable-length
argument list of the `nil' entry.  The `nil' entry now just sets up the
`va_list' pointer and invokes the corresponding `:valist' entry function.

This actually makes constructing the method-entry functions somewhat
cleaner, since the handling of variable argument lists is now
concentrated in the construction of a separate entry function.

8 years agosrc/: Allow methods to have more than one entry each in a vtable.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/: Allow methods to have more than one entry each in a vtable.

The entries are assigned distinct `roles' to distinguish them.  Each
role can have a different type.  To accommodate this a number of changes
are made to the API.  Note that no roles other than the standard `nil'
role are currently defined, so none of this change should have any
externally observable effect.

  * The `make-method-entry' method is replaced by `make-method-entries',
    which returns a list of entry objects.  The standard method on
    `compute-vtmsgs' collects these together into a big list.

  * Slots in the `vtmsgs' structure are now given names by the method
    entries directly, rather than being named after their messages.
    There is a new generic function `method-entry-slot-name' to make
    this work, and a little protocol `method-entry-slot-name-by-role' to
    make extending this machinery easy.

  * The `message-macro-name' function now takes a method-entry rather
    than a message, because each entry needs its own macro.

  * The `method-entry-function-name' function has grown an additional
    `role' argument.  The standard method inserts a non-nil role name in
    an unimaginative manner.

  * The standard method on `method-entry-function-type' now inspects the
    entry role, but its behaviour is unchanged except to check that the
    role is nil.

8 years agosrc/method-impl.lisp (compute-method-entry-functions): Simplify `parm-n'.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/method-impl.lisp (compute-method-entry-functions): Simplify `parm-n'.

8 years agosrc/method-impl.lisp (compute-method-entry-functions): Reorder `let*'.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/method-impl.lisp (compute-method-entry-functions): Reorder `let*'.

Currently the `method entry details' and `effective method function
details' blocks are independent, but they won't be soon.

8 years agosrc/: Tweak handling of `va_list' pointers in generated functions.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/: Tweak handling of `va_list' pointers in generated functions.

In method entries, effective method bodies, and delegation trampolines,
the `va_list' argument is named `sod__ap', and a copy is made for
invoking direct methods into a temporary called `sod__tmp_ap'.  The name
`sod__master_ap' is now only used in direct method argument lists and
the `CALL_NEXT_METHOD' machinery.

This reduces the amount of mangling of argument lists which needs to be
done.  It will also make some future changes a little easier.

8 years agosrc/method-proto.lisp: Fix varargs trampoline method construction.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/method-proto.lisp: Fix varargs trampoline method construction.

The extra `ap' argument comes at the front, not the end.  Trim the final
ellipsis instead of (wrongly) trying to convert it.

8 years agosrc/method-impl.lisp: Don't mangle `ap' name in `basic-argument-names'.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/method-impl.lisp: Don't mangle `ap' name in `basic-argument-names'.

It's already correct.  If we change it then there'll be two `master_ap'
arguments when we invoke the method.

8 years agosrc/method-impl.lisp: Argument name list should only contain names.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/method-impl.lisp: Argument name list should only contain names.

The whole argument object prints wrongly and makes a mess in the output.

8 years agosrc/method-impl.lisp: Handle varargs methods in `next-method-type'.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/method-impl.lisp: Handle varargs methods in `next-method-type'.

8 years agosrc/debug.lisp: Write output to a well-known file.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/debug.lisp: Write output to a well-known file.

This way, Emacs can display it properly fontified in a buffer, and
refresh when it gets changed, rather than having an enormous dump of
text in the middle of a REPL session.

8 years agosrc/c-types-parse.lisp: Plain types don't have `declspec' slots.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/c-types-parse.lisp: Plain types don't have `declspec' slots.

Type names count as declaration specifiers, so `scan-declspec' has to
cope with them.  Fortunately, bare types don't come with tags, so this
is easy to work around.

8 years agosrc/class-utilities.lisp: Compare C types with the right function.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/class-utilities.lisp: Compare C types with the right function.

There's something weird with the caching, I think.  But this way leaves
a better taste anyway.

8 years agosrc/class-output.lisp: Remove debugging hack.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/class-output.lisp: Remove debugging hack.

8 years agosrc/: Argument lists don't only contain `argument' objects.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/: Argument lists don't only contain `argument' objects.

They can also contain `:ellipsis' markers.

8 years agosrc/c-types-parse.lisp: Parse `...' in argument lists.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/c-types-parse.lisp: Parse `...' in argument lists.

Somehow this got missed out.  There are a number of bugs elsewhere,
where things can't cope with the `:ellipsis' marker, to be fixed in
subsequent commits.

8 years agosrc/method-aggregate.lisp: Expose number of methods to custom combination.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/method-aggregate.lisp: Expose number of methods to custom combination.

This permits pre-allocating an array for collecting results, for
example.  Suggested by Tony Finch.

8 years agolib/sod.h, src/class-{output,utilities}.lisp: Macros for messages.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
lib/sod.h, src/class-{output,utilities}.lisp: Macros for messages.

Emit a C macro for each message defined, which just saves the ugly
messing duplication of the receiver and the messing about with vtables.

This feature isn't stable yet, so don't rely on it not changing.  For
example, I've not yet decided on whether or not to uppercase the message
name.

8 years agosrc/method-aggregate.lisp: Move return-type check into `define-' macro.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/method-aggregate.lisp: Move return-type check into `define-' macro.

It seems a better fit this way.

8 years agosrc/method-aggregate.lisp: Fix export for `aggregating-effective-method'.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/method-aggregate.lisp: Fix export for `aggregating-effective-method'.

8 years agosrc/method-aggregate.lisp: Give aggregating combinations their own file.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/method-aggregate.lisp: Give aggregating combinations their own file.

The code has been reordered a little too, but there are no substantive
changes.

8 years agosrc/classes.lisp, src/class-layout-proto.lisp: Docstring fixes.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/classes.lisp, src/class-layout-proto.lisp: Docstring fixes.

Specifically, name literal symbols in lowercase, with quotes, to
distinguish from metasyntactic variables.

8 years agolib/sod.h, test/chimaera.sod: Promote `SOD_DECL' to the library header.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
lib/sod.h, test/chimaera.sod: Promote `SOD_DECL' to the library header.

It seems generally useful.

8 years agotest/: Make `nml.tickle' be a `progn' method.
Mark Wooding [Sun, 30 Aug 2015 11:59:22 +0000 (12:59 +0100)]
test/: Make `nml.tickle' be a `progn' method.

I think this was always intended, but I didn't have the method
combination until now.

8 years agotest/chimaera.sod: Don't use `(void)' for message argument lists.
Mark Wooding [Sun, 30 Aug 2015 10:08:11 +0000 (11:08 +0100)]
test/chimaera.sod: Don't use `(void)' for message argument lists.

It's inaccurate because more arguments are added later.

8 years agosrc/class-make-{proto,impl}.lisp: Better choice of default message class.
Mark Wooding [Sun, 30 Aug 2015 10:07:21 +0000 (11:07 +0100)]
src/class-make-{proto,impl}.lisp: Better choice of default message class.

If a combination is specified, use the new `aggregating-message' by
default.

8 years agosrc/method-impl.lisp: New protocol for aggregating method combinations.
Mark Wooding [Sun, 30 Aug 2015 10:06:13 +0000 (11:06 +0100)]
src/method-impl.lisp: New protocol for aggregating method combinations.

8 years agosrc/method-impl.lisp: Invoke `after' methods, even in `void' messages.
Mark Wooding [Sat, 29 Aug 2015 13:36:34 +0000 (14:36 +0100)]
src/method-impl.lisp: Invoke `after' methods, even in `void' messages.

Previously, the code would have suppressed them for some bizarre
reason.

The `voidp' variable is no longer needed, so remove it.

8 years agosrc/method-impl.lisp: Fix incorrect argument order.
Mark Wooding [Sat, 29 Aug 2015 13:33:40 +0000 (14:33 +0100)]
src/method-impl.lisp: Fix incorrect argument order.

8 years agosrc/method-impl.lisp: There's a handy definition `c-type-void', so use it.
Mark Wooding [Sat, 29 Aug 2015 13:33:02 +0000 (14:33 +0100)]
src/method-impl.lisp: There's a handy definition `c-type-void', so use it.

8 years agosrc/method-impl.lisp: Remove unnecessary `with-slots' form.
Mark Wooding [Sat, 29 Aug 2015 13:13:01 +0000 (14:13 +0100)]
src/method-impl.lisp: Remove unnecessary `with-slots' form.

8 years agosrc/method-impl.lisp: Typo in docstring.
Mark Wooding [Sat, 29 Aug 2015 13:12:07 +0000 (14:12 +0100)]
src/method-impl.lisp: Typo in docstring.

8 years agosrc/method-impl.lisp: Default method for `primary-method-class'.
Mark Wooding [Sat, 29 Aug 2015 13:11:42 +0000 (14:11 +0100)]
src/method-impl.lisp: Default method for `primary-method-class'.

The `basic-direct-method' class seems like an appropriate choice.

8 years agosrc/module-impl.lisp: Don't emit `#line' to non-position-aware streams.
Mark Wooding [Sun, 30 Aug 2015 10:03:22 +0000 (11:03 +0100)]
src/module-impl.lisp: Don't emit `#line' to non-position-aware streams.

Because we can't switch back afterwards, the compiler will blame the
wrong thing.  Also, if the output stream isn't position-aware, it's
probably because we're in the midst of pretty-printing something, and
forcing `#line' directives will produce hideous results.

This is all rather unfortunate.  It's clearly a bug that we can't
produce pretty output and have useful error location information, but I
think this is the best I can manage right now.

8 years agosrc/classes.lisp: Add comment explaining why psets aren't captured.
Mark Wooding [Sun, 30 Aug 2015 09:57:57 +0000 (10:57 +0100)]
src/classes.lisp: Add comment explaining why psets aren't captured.

This one had me wondering for a while, but it turns out there's a good
reason.

8 years agosrc/: Rename the various `:lisp-class' properties.
Mark Wooding [Sat, 29 Aug 2015 14:11:55 +0000 (15:11 +0100)]
src/: Rename the various `:lisp-class' properties.

Instead, there's now a separate property for each kind of metaobject.
The reason is that some declarations can produce two metaobjects, e.g.,
a message declaration might also include a direct method, and we can't
possibly use the same metaobject class for both.  To resolve this, we
use different properties to name the different metaobject classes.

  * For classes, we use `:lisp-metaclass' (to distinguish from a runtime
    metaclass).

  * For messages, `:message-class'.

  * For methods, `:method-class'.

  * For slots, `:slot-class'.

  * For slot initializers, `:initializer-class'.

  * For modules, `:module-class'.

8 years agosrc/pset-parse.lisp: Allow brace-enclosed fragments as property values.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/pset-parse.lisp: Allow brace-enclosed fragments as property values.

8 years agosrc/codegen-{proto,impl}.lisp: Protocol for emitting custom declarations.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/codegen-{proto,impl}.lisp: Protocol for emitting custom declarations.

8 years agosrc/codegen-proto.lisp: Include `;' in `var-inst' output.
Mark Wooding [Sun, 30 Aug 2015 09:59:45 +0000 (10:59 +0100)]
src/codegen-proto.lisp: Include `;' in `var-inst' output.

Because other kinds of decls will have their own semicolons.  Previously
the semicolons were added as part of the block output machinery.

8 years agosrc/{codegen,method}-impl.lisp: Allow non-variables in `vars' lists.
Mark Wooding [Sun, 30 Aug 2015 10:04:18 +0000 (11:04 +0100)]
src/{codegen,method}-impl.lisp: Allow non-variables in `vars' lists.

It used to be assumed that everything in the `vars' list was a
`var-inst' object, but that's not going to be true any more.

8 years agosrc/codegen-proto.lisp: A small number of new instructions.
Mark Wooding [Sat, 29 Aug 2015 13:09:54 +0000 (14:09 +0100)]
src/codegen-proto.lisp: A small number of new instructions.

8 years agosrc/codegen-{proto,impl}.lisp: Have `definst' optionally export symbols.
Mark Wooding [Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)]
src/codegen-{proto,impl}.lisp: Have `definst' optionally export symbols.

The enormous export lists are annoying to maintain.

8 years agosrc/sod.asd: Elide a transitively implied dependency.
Mark Wooding [Sat, 29 Aug 2015 12:20:49 +0000 (13:20 +0100)]
src/sod.asd: Elide a transitively implied dependency.

8 years agosrc/sod.asd: Fix another missing dependency.
Mark Wooding [Sat, 29 Aug 2015 12:20:28 +0000 (13:20 +0100)]
src/sod.asd: Fix another missing dependency.

8 years agosrc/debug.lisp: New small utility function for interactive testing.
Mark Wooding [Sat, 29 Aug 2015 12:19:33 +0000 (13:19 +0100)]
src/debug.lisp: New small utility function for interactive testing.

Testing at the command line is OK when things can be expected to work,
but it's annoying when they're likely to break.  This simple function
makes things pleasant to debug from inside SLIME.

8 years agopre-reorg/: Delete this old cruft.
Mark Wooding [Tue, 25 Aug 2015 16:46:54 +0000 (17:46 +0100)]
pre-reorg/: Delete this old cruft.

8 years agolib/sod.[ch]: The runtime library is LGPL.
Mark Wooding [Tue, 25 Aug 2015 16:44:54 +0000 (17:44 +0100)]
lib/sod.[ch]: The runtime library is LGPL.

8 years agovars.am, */Makefile.am: Improve silent-rules building.
Mark Wooding [Tue, 25 Aug 2015 09:44:20 +0000 (10:44 +0100)]
vars.am, */Makefile.am: Improve silent-rules building.

New silent-rules handling for Lisp dumping, testing, and for generating
Sod outputs.

8 years agolib/sod.[ch]: Name instance arguments `obj', not `p'.
Mark Wooding [Tue, 25 Aug 2015 09:25:30 +0000 (10:25 +0100)]
lib/sod.[ch]: Name instance arguments `obj', not `p'.

In some cases, the documentation already had this right.

8 years agolib/sod.[ch] (sod_convert): Make the instance argument be `const void *'.
Mark Wooding [Tue, 25 Aug 2015 09:23:50 +0000 (10:23 +0100)]
lib/sod.[ch] (sod_convert): Make the instance argument be `const void *'.

The documentation says that it should be, and I agree.

8 years agosrc/module-output.lisp: Remove unused output tag `:classes'.
Mark Wooding [Tue, 25 Aug 2015 09:20:05 +0000 (10:20 +0100)]
src/module-output.lisp: Remove unused output tag `:classes'.

8 years agoInclude test machinery in the new build system.
Mark Wooding [Wed, 19 Aug 2015 16:47:15 +0000 (17:47 +0100)]
Include test machinery in the new build system.

8 years agoconfigure.ac, src/Makefile.am: Rename the FASL extension variable.
Mark Wooding [Wed, 19 Aug 2015 16:45:26 +0000 (17:45 +0100)]
configure.ac, src/Makefile.am: Rename the FASL extension variable.

8 years agosrc/parser/scanner-charbuf-impl.lisp: Delay `charbuf-scanner-place'.
Mark Wooding [Wed, 19 Aug 2015 16:37:17 +0000 (17:37 +0100)]
src/parser/scanner-charbuf-impl.lisp: Delay `charbuf-scanner-place'.

Similar to 1d087117..., we have mutually recursive references between a
class and structure, which we resolve by delaying the structure
definition.

8 years agoFactor common Makefile definitions into a `vars.am' file.
Mark Wooding [Wed, 19 Aug 2015 16:34:12 +0000 (17:34 +0100)]
Factor common Makefile definitions into a `vars.am' file.

8 years agoIntroduce a proper build system and clear away old cruft.
Mark Wooding [Wed, 19 Aug 2015 01:17:36 +0000 (02:17 +0100)]
Introduce a proper build system and clear away old cruft.

8 years agosrc/: Export a package version from the ASDF system definition.
Mark Wooding [Wed, 19 Aug 2015 01:11:52 +0000 (02:11 +0100)]
src/: Export a package version from the ASDF system definition.

I'd like to arrange the version automatically from `config/auto-version'
but can't figure out a good way yet.

8 years agosrc/optparse.lisp: Simplify `set-command-line-arguments'.
Mark Wooding [Mon, 17 Aug 2015 16:44:57 +0000 (17:44 +0100)]
src/optparse.lisp: Simplify `set-command-line-arguments'.

If we depend on `cl-launch' and assume that we're always started through
it then we don't need to do such complicated things to put together the
command line.

It's not all happy bunnies, unfortunately, because we have to mess with
system-specific details to discover the program name from a dumped
executable image.

8 years agosrc/: Split the frontend out into its own separate system.
Mark Wooding [Mon, 17 Aug 2015 16:41:58 +0000 (17:41 +0100)]
src/: Split the frontend out into its own separate system.

It has additional dependencies, which is rather less than ideal.

8 years agosrc/frontend.lisp: Provide a slightly more useful synopsis.
Mark Wooding [Mon, 17 Aug 2015 16:39:56 +0000 (17:39 +0100)]
src/frontend.lisp: Provide a slightly more useful synopsis.

8 years agosrc/builtin.lisp: Export `make-builtin-module' and `*builtin-module*'
Mark Wooding [Mon, 17 Aug 2015 16:38:58 +0000 (17:38 +0100)]
src/builtin.lisp: Export `make-builtin-module' and `*builtin-module*'

The former is needed for bootstrapping.  The latter is useful for
emitting the builtin module.

8 years agosrc/sod.asd: Fix some minor errors in strings.
Mark Wooding [Mon, 17 Aug 2015 16:36:04 +0000 (17:36 +0100)]
src/sod.asd: Fix some minor errors in strings.

8 years agotest/chimaera.sod: Introduce a macro for stack-allocating instances.
Mark Wooding [Mon, 17 Aug 2015 16:33:26 +0000 (17:33 +0100)]
test/chimaera.sod: Introduce a macro for stack-allocating instances.

8 years agotest/chimaera.sod: Attach some driver code to test it.
Mark Wooding [Sat, 15 Aug 2015 22:46:31 +0000 (23:46 +0100)]
test/chimaera.sod: Attach some driver code to test it.

Surprisingly, this actually works.

8 years agotest/chimaera.sod: Fix the example so that it compiles.
Mark Wooding [Sat, 15 Aug 2015 22:46:03 +0000 (23:46 +0100)]
test/chimaera.sod: Fix the example so that it compiles.

8 years agosrc/c-types-impl.lisp: Handle `void' argument lists specially.
Mark Wooding [Sat, 15 Aug 2015 16:55:29 +0000 (17:55 +0100)]
src/c-types-impl.lisp: Handle `void' argument lists specially.

We'll treat them as equivalent to empty lists.  Otherwise it's just too
easy to declare a message as

void msg(void)

and end up with a horrible mess when the translator tries to turn that
into a direct method of the form

void msg(Thing *me, void)

which works less then brilliantly.

And, on output, we'll write an empty list as `void'.  This situation
doesn't arise in the current translator (I think), but might well do in
extensions.

8 years agosrc/class-output.lisp: Insert the correct class pointers.
Mark Wooding [Sat, 15 Aug 2015 15:25:24 +0000 (16:25 +0100)]
src/class-output.lisp: Insert the correct class pointers.

I must have been confused, because vtable class pointers ended up
pointing to the metaclass rather than the object class.  Fix this.

8 years agosrc/class-output.lisp: Output effective methods directly from the class.
Mark Wooding [Sat, 15 Aug 2015 15:24:29 +0000 (16:24 +0100)]
src/class-output.lisp: Output effective methods directly from the class.

Earlier there was a bug where effective methods and method entries were
emitted twice, because there were two paths to them: one directly from
the class, and one via method entry points.  To resolve this, I removed
the path directly from the class.

This turns out to have been the wrong choice, because method entries are
found once for each chain, so there are still duplicates in classes with
more than one chain carrying methods.  So don't iterate from method
entries to effective methods, and reinstate the direct path from the
top-level class.

8 years agosrc/parser/scanner-proto.lisp: Reorder declarations.
Mark Wooding [Sat, 15 Aug 2015 15:19:47 +0000 (16:19 +0100)]
src/parser/scanner-proto.lisp: Reorder declarations.

The `token-scanner' and `token-scanner-place' objects refer to each
other recursively through their slot types.  SBCL's loader objects to
this if `token-scanner-place' -- a structure type -- is first.  Reorder
them so that `token-scanner' -- a CLOS class -- is first, because that
seems to work better.

8 years agosrc/class-output.lisp: Fix docstring grammar.
Mark Wooding [Sat, 15 Aug 2015 15:16:25 +0000 (16:16 +0100)]
src/class-output.lisp: Fix docstring grammar.

8 years agosrc/builtin.lisp: Delete unused variable binding.
Mark Wooding [Sat, 15 Aug 2015 15:15:58 +0000 (16:15 +0100)]
src/builtin.lisp: Delete unused variable binding.

8 years agosrc/foo.sod: Split `Second' off into its own separate chain.
Mark Wooding [Sat, 15 Aug 2015 15:15:16 +0000 (16:15 +0100)]
src/foo.sod: Split `Second' off into its own separate chain.

8 years agolib/sod.h: New macro `SOD_INSTBASE' to find the allocated base address.
Mark Wooding [Sat, 15 Aug 2015 15:14:32 +0000 (16:14 +0100)]
lib/sod.h: New macro `SOD_INSTBASE' to find the allocated base address.

This turns out to be useful, e.g., for freeing dynamically allocated
objects.  A destructor method might usefully say something like

free(SOD_INSTBASE(me));

after actually releasing any other resources.

8 years agoAn actual running implementation, which makes code that compiles. 0.1.0
Mark Wooding [Sat, 15 Aug 2015 02:28:59 +0000 (03:28 +0100)]
An actual running implementation, which makes code that compiles.

I've not tested it very hard yet.  There are probably lots of small
bugs, and maybe some big ones.  There are certainly rough edges in the
error handling, particularly in the class-body parser which will get
cleaned up later.

10 years agoMore WIP.
Mark Wooding [Wed, 24 Jul 2013 21:54:12 +0000 (22:54 +0100)]
More WIP.

10 years agoToday's wip.
Mark Wooding [Tue, 23 Jul 2013 23:49:14 +0000 (00:49 +0100)]
Today's wip.

10 years agoRefactoring more or less complete. Maybe I should test it.
Mark Wooding [Wed, 17 Jul 2013 20:03:27 +0000 (21:03 +0100)]
Refactoring more or less complete.  Maybe I should test it.

10 years agoDaily work in progress.
Mark Wooding [Mon, 15 Jul 2013 00:54:09 +0000 (01:54 +0100)]
Daily work in progress.

10 years agoWork in progress. Mostly bug fixing.
Mark Wooding [Sun, 14 Jul 2013 15:09:22 +0000 (16:09 +0100)]
Work in progress.  Mostly bug fixing.

10 years agoFix formatting badness.
Mark Wooding [Fri, 12 Jul 2013 01:39:37 +0000 (02:39 +0100)]
Fix formatting badness.

10 years agoRemove apparently dead files.
Mark Wooding [Fri, 12 Jul 2013 01:25:39 +0000 (02:25 +0100)]
Remove apparently dead files.

10 years agoDon't write Lisp symbol names in uppercase: use `...' instead.
Mark Wooding [Fri, 12 Jul 2013 01:24:21 +0000 (02:24 +0100)]
Don't write Lisp symbol names in uppercase: use `...' instead.

Otherwise it's too confusing to distinguish them from metavariables.

10 years agoChange naming convention around.
Mark Wooding [Fri, 12 Jul 2013 00:37:09 +0000 (01:37 +0100)]
Change naming convention around.

Put `test', `proto', `impl', `parse', `output' on the end, not the
start.  This keeps pieces of the same chunk of functionality together in
listings.

10 years agoWork in progress, recovered from old crybaby.
Mark Wooding [Fri, 12 Jul 2013 00:22:58 +0000 (01:22 +0100)]
Work in progress, recovered from old crybaby.

13 years agoMassive reorganization in progress.
Mark Wooding [Fri, 2 Jul 2010 09:11:35 +0000 (10:11 +0100)]
Massive reorganization in progress.

The code is a complete disaster area right now.