Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
LambdaMOO with multiple inheritance, HTTP, JSON <-> MOO parsing/generation, better crypto, a map datatype and a RESTful interface.
C TeX Ruby C++ Shell Perl
Pull request Compare This branch is 10 commits ahead of toddsundsted:stunt.
Failed to load latest commit information.
executables Added exec tests.
patches Dropped the hunks concerning execute.h
test Tests for `random()' builtin.
.cvsignore HACKING
.indent.pro GNU Indent normalization
AddingNewMOOTypes.txt Updated the docs to reflect the current state of the server.
ChangeLog-YAJL.txt Added the YAJL changelog.
ChangeLog-fileio.txt Updated the documentation.
ChangeLog.txt first 1.8.4 update
FileioDocs.txt Updated the documentation.
GNUmakefile Support for version_hook and version_src.h
Gemfile Upgraded the parslet parsing library.
Gemfile.lock Upgraded the parslet parsing library.
HACKING HACKING
MOOCodeSequences.txt Initial revision
Makefile.in Hand-edited Makefile.in to accomodate code base changes from Stunt
Minimal.db Initial revision
ProgrammersManual.texinfo Added documentation on built-in `read_http()'.
README Updated the readme.
README.Minimal Initial revision
README.YAJL Added the YAJL library (v 1.0.12).
README.fileio Initial commit of the FileIO patch.
README.lambdamoo Updated the documentation for this release.
README.rX More doc tweaking, really warn about BYTECODE_REDUCE_REF.
Stunt.db Copy of the Stunt database off http://stunt.io/
Test.db Added `handle_uncaught_error()' and `handle_task_timeout()' verbs to …
acinclude.m4 Several changes in this commit:
aclocal.m4 Several changes in this commit:
ast.c First batch of files that now compile via g++
ast.h First batch of files that now compile via g++
base64.c Cleaned up warnings.
base64.h Cleaned up warnings.
bf_register.h First cut at secure external process exec.
client_bsd.c GNU Indent normalization
client_sysv.c GNU Indent normalization
code_gen.c Remove a warning about pointer types.
code_gen.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
collection.c Map in/is_member now behaves more like list in/is_member.
collection.h Map in/is_member now behaves more like list in/is_member.
config.h.in merging in WROGUE changes (W_SRCIP, W_STARTUP, W_OOB)
configure Several changes in this commit:
configure.ac Several changes in this commit:
db.h First batch of files that now compile via g++
db_file.c Map in/is_member now behaves more like list in/is_member.
db_io.c Handle the dumping/loading of an iterator.
db_io.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
db_objects.c Just ref the children and roll.
db_private.h Changes to the database layer in support of multiple-inheritance.
db_properties.c Fix warnings about using uninitialized variables.
db_tune.h Merge UNSAFE_OPTS (r5) after extensive testing.
db_verbs.c Removed unused variable.
decompile.c Moved the loop initialization into `run()'.
decompile.h Line number and pc are unsigned: fix find_line_number return/args types
disassemble.c Added basic support for enhanced for-loops. New syntax: `for v, i in …
disassemble.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
eval_env.c Added map datatype.
eval_env.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
eval_vm.c Only read the task local value on more modern databases.
eval_vm.h Added support for a task local value.
exceptions.c Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
exceptions.h First batch of files that now compile via g++
exec.c Removed unused labels.
exec.h First cut at secure external process exec.
execute.c Simplified handling of the stack, which had the beneficial effect of …
execute.h First batch of files that now compile via g++
extension-fileio.c Bumped up the FileIO patch version.
extension-fileio.h Initial commit of the FileIO patch.
extensions.c Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
functions.c Pretty sure this should be `int32' instead of just `int'.
functions.h differentiate kinds of BI_KILL; replace make_kill_pack() with make_ab…
getpagesize.h GNU Indent normalization
gnu-malloc.c GNU Indent normalization
hmac_sha2.c Added Olivier Gay's HMAC-SHA256 library.
hmac_sha2.h Added Olivier Gay's HMAC-SHA256 library.
http_parser.c Modify the HTTP error messages.
http_parser.h The Node HTTP parsing library.
install-sh Several changes in this commit:
json.c Vast amounts of long-overdue cleanup.
json.h Added YAJL/JSON integration.
keywords.c Added the `E_INTRPT' error -- raised when built-in functions like `ex…
keywords.gperf Added the `E_INTRPT' error -- raised when built-in functions like `ex…
keywords.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
list.c Maybe someday, someone will tell me whether this disabled code was su…
list.h Refactored value equality, and added value comparison.
log.c merging in WROGUE changes (W_SRCIP, W_STARTUP, W_OOB)
log.h merging in WROGUE changes (W_SRCIP, W_STARTUP, W_OOB)
malloc.c Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
map.c Replaced unnecessary dynamic allocations, which had the beneficial ef…
map.h Added max limits to maps.
match.c Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
match.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
md5.c Cleaned up compiler warnings.
md5.h Added MD5, SHA1, and SHA256 from md5deep.
my-ctype.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
my-fcntl.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
my-in.h merging in WROGUE changes (W_SRCIP, W_STARTUP, W_OOB)
my-inet.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
my-ioctl.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
my-math.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
my-poll.h Initial revision
my-signal.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
my-socket.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
my-stat.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
my-stdarg.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
my-stdio.h sync so that checkpoint is physically written before prior checkpoint…
my-stdlib.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
my-string.h merging in WROGUE changes (W_SRCIP, W_STARTUP, W_OOB)
my-stropts.h Initial revision
my-sys-time.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
my-time.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
my-tiuser.h GNU Indent normalization
my-types.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
my-unistd.h sync so that checkpoint is physically written before prior checkpoint…
my-wait.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
name_lookup.c Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
name_lookup.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
net_bsd_lcl.c GNU Indent normalization
net_bsd_tcp.c fix unsigned-ness compiler warning
net_mp_fake.c GNU Indent normalization
net_mp_poll.c GNU Indent normalization
net_mp_selct.c Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
net_mplex.c Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
net_mplex.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
net_multi.c raw_bytes_to_binary() replaced by stream_add_raw_bytes_to_binary()
net_multi.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
net_proto.c Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
net_proto.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
net_single.c raw_bytes_to_binary() replaced by stream_add_raw_bytes_to_binary()
net_sysv_lcl.c GNU Indent normalization
net_sysv_tcp.c merging in WROGUE changes (W_SRCIP, W_STARTUP, W_OOB)
net_tcp.c merging in WROGUE changes (W_SRCIP, W_STARTUP, W_OOB)
network.c merging in WROGUE changes (W_SRCIP, W_STARTUP, W_OOB)
network.h Add third argument to open_network_connection() that associates a spe…
numbers.c Dodge division by zero failure when invoking `random(0)'.
numbers.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
objects.c The `ancestors()' and `descendants()' now take a second argument.
opcode.h Added basic support for enhanced for-loops. New syntax: `for v, i in …
options.h `MEMO_STRLEN' is enabled by default.
parse_cmd.c Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
parse_cmd.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
parser.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
parser.y Added basic support for enhanced for-loops. New syntax: `for v, i in …
pattern.c Fix compiler warning about unassigned variable
pattern.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
program.c Avoid using uninitialized Program.cached_lineno_vec (rob@mars.org)
program.h Avoid using uninitialized Program.cached_lineno_vec (rob@mars.org)
property.c Fix iffy usage of str_dup in verb_info() and property_info() which could
quota.c Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
quota.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
random.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
regexpr.c oops, more braces
regexpr.h GNU Indent normalization
restart Initial revision
restart.sh Initial revision
server.c Added `switch_player' built-in to explicitly permit player/connection…
server.h Pretty sure this should be `int32' instead of just `int'.
sha1.c Cleaned up compiler warnings.
sha1.h Added MD5, SHA1, and SHA256 from md5deep.
sha256.c Added Olivier Gay's HMAC-SHA256 library.
sha256.h Added Olivier Gay's HMAC-SHA256 library.
storage.c Maybe someday, someone will tell me whether this disabled code was su…
storage.h Maybe someday, someone will tell me whether this disabled code was su…
str_intern.c Add new MEMO_STRLEN option which uses the refcounting mechanism to
str_intern.h Initial string interning during db load.
streams.c remove max=0 meaning no limit
streams.h remove max=0 meaning no limit
structures.h Added max limits to maps.
sym_table.c Added map datatype.
sym_table.h Added map datatype.
t2hinit.pl Added support files necessary to generate the documentation.
tasks.c Added `switch_player' built-in to explicitly permit player/connection…
tasks.h First cut at HTTP parsing.
test.yml Added testing framework and basic object/verb/property tests.
texinfo.tex Added support files necessary to generate the documentation.
timers.c free cancelled timers with free_timer() instead of free() so they can
timers.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
todo.org Added org-mode file to track tasks for the Waverous branch
tokens.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
unparse.c Added basic support for enhanced for-loops. New syntax: `for v, i in …
unparse.h Added parse_error function (which doesn't belong here).
utils.c Maybe someday, someone will tell me whether this disabled code was su…
utils.h Refactored value equality, and added value comparison.
verbs.c Fix `respond_to()' so that it returns a callable indication even if t…
verbs.h Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
version.c support for server_version(argument)
version.h Added support for looping over maps.
version_opt_gen.pl Added max limits to maps.
version_options.h Added max limits to maps.
version_src.txt HACKING
xtrapbits.h Added xtrapbits.h to get common bit array operations.
yajl.c Added the YAJL library (v 1.0.12).
yajl_alloc.c Added the YAJL library (v 1.0.12).
yajl_alloc.h Added the YAJL library (v 1.0.12).
yajl_buf.c Added the YAJL library (v 1.0.12).
yajl_buf.h Added the YAJL library (v 1.0.12).
yajl_bytestack.h Added the YAJL library (v 1.0.12).
yajl_common.h Added the YAJL library (v 1.0.12).
yajl_encode.c Handle the translation between JSON escaped characters and MOO binary…
yajl_encode.h Added the YAJL library (v 1.0.12).
yajl_gen.c Fixed floating point number formatting to match MOO formatting.
yajl_gen.h Fixed some missed headers.
yajl_lex.c Added the YAJL library (v 1.0.12).
yajl_lex.h Added the YAJL library (v 1.0.12).
yajl_parse.h Fixed some missed headers.
yajl_parser.c Added the YAJL library (v 1.0.12).
yajl_parser.h Added the YAJL library (v 1.0.12).
yajl_version.c Added the YAJL library (v 1.0.12).
yajl_version.h Added the YAJL library (v 1.0.12).

README

See `README.lambdamoo' for general information on LambdaMOO.

More information on Stunt is available here: http://stunt.io/.  If you
want to get up and running quickly, consider starting with Improvise,
the Stunt starter kit: https://github.com/toddsundsted/improvise.

This is Release 8 of the Stunt extensions to the LambdaMOO server.  It
is based on the latest "1.8.3+" version from SourceForge.  Read the
very important WARNING below before running this on your existing
database!!!

Release 8 enhances existing features and improves performance in
specific areas:

* `^' is an alias for the first element in a sequence (to go along
  with `$').

* The map datatype supports index/range access/assignment using `^'
  and `$' (previously these only worked on lists).

* The `for' loop now sports the following syntax:

    for v, i in (...)

When used in this way, the first variable is assigned the value from
the sequence and the second variable is assigned the index (the
position in the case of lists and strings) or key (in the case of
maps).

The last change makes iterating over a map more performant.  Iteration
no longer requires a lengthly call to get the keys before actually
performing the iteration.

    m = [... map ...];
    for v, k in (m)
      ...
    endfor

This release also improves the performance of code that uses indexed
assignment (code like `foo[x][y][x] = "blah"').  In my specific case
(package import in the Stunt core), it knocked off ~20% of the overall
time required to import a large package (LambdaCore, for example).

Stunt includes the following functionality not found in the main
server:

1) Multiple-Inheritance
   `create()' now takes either an object number or a list of object
   numbers in the first argument position.  Two new built-ins,
   `parents()' and `chparents()', manipulate an object's parents.  The
   built-ins `parent()' and `chparent()' exist for backward
   compatibility -- when an object has multiple parents these
   built-ins operate on the first parent.

2) Task Local Storage
   The built-ins `task_local' and `set_task_local' retrieve/store a
   task local value.  The value is automatically freed when the task
   finishes.

3) Map Datatype
   The server includes a native map datatype based on a binary search
   tree (specifically, a red-black tree).  The implementation allows
   in-order traversal, efficient lookup/insertion/deletion, and
   supports existing MOO datatypes as values (keys may not be lists or
   maps).  Index, range, and looping operations on lists and strings
   also work on maps.

4) JSON Parsing/Generation
   The built-ins `parse_json' and `generate_json' transform MOO
   datatypes from/to JSON.

5) New Built-in Cryptographic Operations
   The new cryptographic operations include SHA-1 and SHA-256 hashes.
   The existing MD5 hash algorithm is broken from a cryptographic
   standpoint, as is SHA-1 -- both are included for interoperability
   with existing applications (both are still popular) but the default
   for `string_hash'/`binary_hash'/`value_hash' is now SHA-256.  Stunt
   also includes the HMAC-SHA-256 algorithm for generating secure,
   hash- based message authentication codes.

6) Built-in Base64 Encoding/Decoding
   The built-ins `encode_base64' and `decode_base64' encode and decode
   Base64-encoded strings.

7) An Improved FileIO Patch
   The 1.5p1 patch that is in wide circulation has flaws, including two
   server crashing bugs.  This patch fixes those bugs/flaws without
   changing the API.

8) Secure Suspending Process Exec
   The exec functionality adds an `exec' built-in which securely
   forks/execs an external executable.  It doesn't use the `system()'
   call, which is hard to secure and which blocks the server.
   `exec()' takes two parameters, a list of strings comprising the
   program and its arguments, and a MOO binary string that is sent to
   stdin.  It suspends the current task so the server can continue
   serving other tasks, and eventually returns the process termination
   code, stdout, and stderr in a list.

9) Verb Calls on Primitive Types
   The server supports verbs calls on primitive types (numbers,
   strings, etc.) so calls like `"foo bar":split()' can be implemented
   and work as expected (they were always syntactically correct but
   resulted in an E_TYPE error).  Verbs are implemented on prototype
   object delegates ($int_proto, $float_proto, $str_proto, etc.).  The
   server transparently invokes the correct verb on the appropriate
   prototype -- the primitive value is the value of `this'.

10) In Server HTTP Parsing
    The server uses the excellent Node HTTP parsing library to
    natively parse HTTP requests and responses into key/value pairs in
    a map datatype.  The parser handles corner cases correctly and
    supports things like HTTP upgrade (for using WebSockets, for
    example).  It's also much much faster than parsers implemented in
    MOO code.

11) Testing Framework
    The server includes a unit testing framework based on Ruby's
    Test-Unit.  It includes a Parslet parser (two, actually) for
    turning moo-code values into Ruby values, which makes writing
    tests much easier.  The new code is covered very well by the
    existing tests.

WARNING: This server changes the database format in a non-backward
compatible way in order to persist multiple-parent relationships.  The
server will automatically upgrade version 4 databases, however THERE
IS NO WAY BACK!

Use Github and the Github issue system for feedback and bugs!

Todd
Something went wrong with that request. Please try again.