5 Support the same language as the original interpreter, except for
8 ## Architectural faithfulness
10 Try to maintain the spirit of the initial implementation.
12 The original was written in assembly and ran in environments we'd now
13 consider extremely memory constrained. Update the design to fit new
14 platforms, but don't expand its resource requirements to fit the glut
17 ## Suitability for new projects
19 The implementation should not be optimized for the PDP at the expense
20 of performance on modern hardware.
22 The language should not be complicated solely for backward
25 The runtime should not be larger or slower than necessitated by the
26 dynamism of the language.
28 # Distinctive features
32 The package-oriented nature of the language is a huge plus. Easy
33 sharing of packages along the lines of Quicklisp/MELPA/Cargo is a key
34 feature for building a community.
36 ## Coroutines (stackful)
38 ## Interrupt mechanism
40 Very powerful. In combination with coroutines, could be used to
41 implement pre-emptively multitasked green threads. Supports setting
42 "breakpoints" on variable accesses.
46 In Muddle there are no "magic" forms that can only be provided by the
47 runtime (or, anything can be magic). Disciplined use is required to
48 avoid madness, but sometimes FEXPRs can be clearer than macros.
50 ## First-class term-rewriting fexprs...
52 "CALL" is the most (dangerously) powerful language feature I've ever
55 ## Re-entrant first-class stack-allocated continuations
57 That can jump forward.
61 ## Powerful type system
65 Simple accessors just evaluate to numbers that perform access into
66 vector slots, but the caller sees the same interface as if it were a
69 ### Truthiness is an `Either` type
73 ## no tail call elimination
75 TCE would elide FRAMEs, and mess with ACTIVATIONs and stack introspection.
79 * primarily dynamic, with namespaces
80 * lexical scoping features available
83 ## coroutines (stackful)
87 ### fexprs: FSUBR, CALL/QUOTE/ARGS
89 Any "function" can accept arguments unevaluated, and then it may BIND
90 and EVAL them. Hence short-circuiting operators such as AND could be
91 defined as library functions.
95 * reference to a struct field
99 * operationally similar to UNIX signals
100 * checked for a defined times (PL-21.7.1)
101 * could be implemented with an atomic flag
105 * FIX is defined as a 36-bit integer
106 * by default, an error will be produced on overflow! this makes
107 compatibility easier than if software counted on wrapping...
108 * RANDOM returns a 36-bit random
109 * though code that compares <RANDOM> to <MAX> may be ok
110 * out of a 64-bit word, this leaves a lot of room for tags or something...
114 * false/true is actually: left(list) / any
115 * T exists as true value carrying no additional information
119 * type-homogenous vector
123 * since scope is dynamic, closure variables are captured explicitly
131 * NEWTYPE definitions
132 * MACROs that don't depend on the package's functions
137 The documentation refers to "mediation" when compiled code calls in to
138 the interpreter or interpreted code calls a compiled subroutine.
140 ## Mediated subroutine calls
142 Calls to `RSUBR`s that haven't been `SUBRIFY`'d are _mediated_ calls;
143 the interpreter does a full `MCALL`, and the compiled code has an
144 entry point that translates to a `BINCALL`.
148 ## Non-local control flow
150 ### `ERRET` / return from
151 Check `PROCESS` id. Unwind stack until the specified `FRAME`. Return.
154 Change `PROCESS` id. Return from new `PROCESS`es previous `RESUME`
155 frame with specified value.
158 `TAG`: holds a pointer to an AST node, and the call depth of that
159 node's enclosing `PROG`.
160 `GO`: unwind to depth specified in `TAG`; resume execution.
163 Uwind to enclosing `PROG`; continue.
167 Copyright (C) 2018 Keziah Wesley
169 You can redistribute and/or modify this file under the terms of the
170 GNU Affero General Public License as published by the Free Software
171 Foundation, either version 3 of the License, or (at your option) any
174 This file is distributed in the hope that it will be useful, but
175 WITHOUT ANY WARRANTY; without even the implied warranty of
176 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
177 Affero General Public License for more details.
179 You should have received a copy of the GNU Affero General Public
180 License along with this file. If not, see
181 <http://www.gnu.org/licenses/>.