git.haldean.org ubik / 4811bff
make it dumber Haldean Brown 6 years ago
1 changed file(s) with 17 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
2323 Any code block in a literate Ubik file is considered Ubik source code.
2424 So this:
2525
26 =============================================
27 A package for creating something from nothing
28 =============================================
29 By Haldean Brown
30 ---------------------------------------------
26 ====================================================
27 Creating nothing from something
28 ====================================================
29 A brief exposition on writing a programming language
30 ----------------------------------------------------
3131
32 Something from nothing is a really cool trick. Check out what
33 happens when I do something like this::
32 Something from nothing is a really cool trick, but nothing from
33 something is even cooler. Check out what happens when I do something
34 like this::
3435
35 : this ^ imp:Nothing -> imp:Something
36 = \x -> Something "from nothing"
36 : this ^ imp:MaybeThing -> imp:MaybeThing
37 = \x -> imp:Nothing
3738
38 I did it. I made something from nothing. Check that out. And all I
39 I did it. I made nothing from something. Check that out. And all I
3940 needed to do it were these things:
4041
4142 .. code:: ubik
42 . something-from-nothing
43 . the-void
4344 + imp
4445
4546 Which is not dissimilar from this Java code:
4647
4748 .. code:: java
48 package something.from.nothing;
49 package thevoid;
4950 import imp;
5051
5152 Or this Go code::
5253
53 > package somethingfromnothing;
54 > package thevoid;
5455 > import imp;
5556
5657 Becomes this Ubik file:
5758
58 : this ^ imp:Nothing -> imp:Something
59 = \x -> Something "from nothing"
60 . something-from-nothing
59 : this ^ imp:MaybeThing -> imp:MaybeThing
60 = \x -> imp:Nothing
61 . the-void
6162 + imp
6263
6364 Specifically, the following elements are assumed to be Ubik source