git.haldean.org expel / 2b2ec0d
s/Expel/Ubik Haldean Brown 3 years ago
4 changed file(s) with 33 addition(s) and 33 deletion(s). Raw diff Collapse all Expand all
0 Contributing to Expel ==================================================
0 Contributing to Ubik ==================================================
11 Haldean Brown First draft: Mar 2016
22 Last updated: Mar 2016
33
4 To contribute to Expel, please send a patch generated using git
4 To contribute to Ubik, please send a patch generated using git
55 format-patch to ubik@haldean.org. By sending the patches you agree to
6 license your patch to the Expel project under the terms of the GNU
6 license your patch to the Ubik project under the terms of the GNU
77 Public License, version 2.
88
9 Contributors to the Expel project --------------------------------------
9 Contributors to the Ubik project --------------------------------------
1010
11 The following people have contributed to the Expel project:
11 The following people have contributed to the Ubik project:
1212
1313 Haldean Brown (haldean.org)
1414 Xianhang Zhang (bumblebeelabs.com)
0 Expel
0 Ubik
11 =====
22
33 *This document is a work-in-progress, and everything in it is subject to
44 change.*
55
6 Expel will eventually be a programming language. Expel aims to be a
6 Ubik will eventually be a programming language. Ubik aims to be a
77 programming language that approximates the combination of the.
88 conciseness of Haskell, the simplicity of Lisp, the productivity of
9 Python and the deployability of Go. Expel is what I wish I could write
10 everything in, but first I have to write Expel.
11
12 Expel will have strict, static typing with full type inference. Expel
9 Python and the deployability of Go. Ubik is what I wish I could write
10 everything in, but first I have to write Ubik.
11
12 Ubik will have strict, static typing with full type inference. Ubik
1313 will be homoiconic, and provide language-level features that allow users
1414 to control order-of-evaluation; in doing so, it will obviate the need
15 for macros. Expel will draw heavily from Python's view of
16 everything-as-namespace. Expel will, at first, be interpreted, but
17 eventually will be compiled into LLVM IR (or similar). Expel will not
18 have a null value or type. Expel will have no mutable state.
19
20 ## Expel in examples
21
22 Syntactically, Expel borrows heavily from Haskell and Hoon. As in Hoon,
15 for macros. Ubik will draw heavily from Python's view of
16 everything-as-namespace. Ubik will, at first, be interpreted, but
17 eventually will be compiled into LLVM IR (or similar). Ubik will not
18 have a null value or type. Ubik will have no mutable state.
19
20 ## Ubik in examples
21
22 Syntactically, Ubik borrows heavily from Haskell and Hoon. As in Hoon,
2323 punctuation is used in lieu of keywords, allowing any alphabetic symbol
2424 to be a valid user operator. Of course, there are also symbols provided
2525 by the standard library; these, however, need not be imported.
5555
5656 The `{` (pronounced "new-block") operator introduces a new scoping
5757 block. This allows for what other languages call `with` or `let`; in
58 Expel, to create symbols of limited scope, you create a binding within a
58 Ubik, to create symbols of limited scope, you create a binding within a
5959 scope block. Note that in this example, the type signature of `f` is
6060 inferred.
6161
159159
160160 ### Record types
161161
162 Expel has record types, which are structured types containing multiple
163 typed and named fields. Unlike many other functional languages, Expel
162 Ubik has record types, which are structured types containing multiple
163 typed and named fields. Unlike many other functional languages, Ubik
164164 seeks to avoid polluting the record's enclosing namespace by accessing
165165 child fields using the member operator instead of creating accessor
166166 functions for each.
191191
192192 ### Conditionals
193193
194 There is only one explicit control-flow construct in Expel: a simple
194 There is only one explicit control-flow construct in Ubik: a simple
195195 conditional statement. You can create a conditional statement using the
196196 `=>` (pronounced "implies") and `/>` (pronounced "opposes") operator,
197197 like so:
216216 As an example, examine the case of the member operator. While some
217217 uses of the member operator are language built-ins, the usage of the
218218 member operator to access a field in a record is implemented in native
219 Expel as a CTPA. Record types are all instances of a `Record`
219 Ubik as a CTPA. Record types are all instances of a `Record`
220220 typeclass:
221221
222222 _ Record
224224
225225 `Symbol` is a type provided by the prelude that represents a symbol in
226226 the AST of the program. Note the `!` (pronounced "eager") operator after
227 the `Symbol` type; this tells Expel that this is an unevaluated
227 the `Symbol` type; this tells Ubik that this is an unevaluated
228228 expression tree instead of an actual value. It is a compile-time error
229229 to pass this function anything but a symbol as its first argument.
230230
265265
266266 ## Input, output and external state
267267
268 Expel has to deal with a problem common to all side-effect-free
268 Ubik has to deal with a problem common to all side-effect-free
269269 languages: how does such a system mutate the state of the system it runs
270270 on? Modern computing systems are state modification machines; no real
271271 programming language can ignore this. However, the advantages of
272272 stateless computing are innumerable: repeatability, parallelization and
273273 understandability shouldn't be compromised wherever possible.
274274
275 To this goal, the Expel runtime provides a view into state outside the
275 To this goal, the Ubik runtime provides a view into state outside the
276276 system that enforces repeatability and a weak form of immutability,
277 while falling short on the ability to parallelize in some cases. Expel
277 while falling short on the ability to parallelize in some cases. Ubik
278278 programs declare what external state sources they need access to; this
279279 could be a file, a random number generator, or an interface to a
280280 physical device. The runtime provides a monadic view to these state
287287 a randomly-chosen initial starting seed for the lifetime of the runtime.
288288
289289 Writing external state to a state sink is harder, especially when
290 coupled with the desire for immutability. Expel solves this by only
290 coupled with the desire for immutability. Ubik solves this by only
291291 allowing one handle to each state sink to be created over the lifetime
292292 of the runtime. This is equivalent to saying that a file may only be
293293 opened for writing once over the lifetime of the program. It is also
303303 into, in which everything but that which interacts with the outside world is
304304 fully repeatable.
305305
306 ## All Expel operators
306 ## All Ubik operators
307307
308308 ### `:`
309309 Pronounced "bind name", creates a binding with a name.
5959 * loaded. */
6060 #define TAG_GRAPH_MODINIT 0x0004
6161
62 /* The maximum Expel bytecode version that this library supports. */
62 /* The maximum Ubik bytecode version that this library supports. */
6363 #define CURRENT_ENCODING_VERSION 1
6464
6565 /* Private data structures referenced by public data structures. */
9595 xl_float f;
9696 };
9797
98 /* The base type of all data in Expel; it's a cons cell. */
98 /* The base type of all data in Ubik; it's a cons cell. */
9999 struct xl_value
100100 {
101101 /* A bitset of the TAG_ constants. One each of the
0 # Python DSL for encoding Expel DAGCs.
0 # Python DSL for encoding Ubik DAGCs.
11
22 import struct
33 import sys