From 2f02189ddcdeb7d25b0ca9bd5b955b764d41a1a7 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 21 May 2016 17:44:53 -0700 Subject: 2996 --- index.html | 211 ++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 112 insertions(+), 99 deletions(-) (limited to 'index.html') diff --git a/index.html b/index.html index a1b158d3..70cfd731 100644 --- a/index.html +++ b/index.html @@ -28,7 +28,7 @@ example, showing how Mu supports conditionals and loops without any special syntax, using the special labels '{' and '}'.
  • tangle.mu: another (contrived) version of factorial showing Mu's ability to 'tangle' code from multiple places into a -single function or 'recipe'. +single function or recipe.
  • counters.mu: lexical scope
  • simple examples showing off support for concurrency: fork.mu, channel.mu @@ -38,11 +38,12 @@ single function or 'recipe'. print primitives that inject a screen dependency which can be faked for testing.
  • static_dispatch.mu: example -program showing mu's ability to define functions with headers, and allow -functions with the same name but different headers to coexist. +program showing mu's ability to define recipes with headers, and allow +recipes with the same name but different headers to coexist.
  • chessboard.mu: a little program for 2 people to play chess, with thorough tests of its behavior including both screen and keyboard handling. +
  • nqueens.mu: a solution for the N queens problem. Now a listing of every layer in mu. Recall that you can stop @@ -50,6 +51,7 @@ loading at any layer and get a valid program to run with a subset of features, that passes all its tests.

    Part I: basic infrastructure +

    000organization.cc: the basic skeleton program. Compiles and runs but doesn't do much. Later layers hook into this skeleton to add functionality. Mu's guarantee: you can load @@ -65,65 +67,87 @@ lists of tests to run. facts about our program, and for checking the facts logged in tests. (tests for the test harness) -

    Part II: the Mu virtual machine, designed to compile easily to +

    Part II: the core Mu virtual machine, designed to compile easily to machine language. +

    010vm.cc: core data structures: -functions, instructions and reagents (operands). +recipes, instructions and reagents (operands).
    011load.cc: the textual representation -of functions and how it's turned into the data structures. +of recipes and how it's turned into the data structures.
    012transform.cc: after Mu programs are loaded but before they are run they can be transformed in an extensible manner akin to lisp macros. Think of this as the core of Mu's ‘compiler’ for providing high-level features atop the core.
    013update_operation.cc: -our first transform: check for unknown functions before the program runs. +our first transform: check for unknown recipes before the program runs.
    014literal_string.cc: extend the loader to support literal strings in various instructions.
    015literal_noninteger.cc: extend the loader to support non-integer numbers. -
    020run.cc: executing Mu functions by +
    016dilated_reagent.cc: +allowing whitespace in reagents. +
    017parse_tree.cc: a new syntax +for representing complex types as trees using whitespace and parentheses +(s-expressions). + +
    020run.cc: executing Mu recipes by executing the list of instructions they contain. Future layers will define more primitive operations that can be used in instructions.
    021check_instruction.cc: harness for adding per-primitive checks to run before running a program. -
    Various primitive operations: on numbers, + +

    Various primitive operations: on numbers, booleans, for control flow, and comparing values. -
    026call.cc: calls to functions look -just like primitive operations. -
    027call_ingredient.cc: how -functions pass arguments or 'ingredients' without introducing any syntax and -breaking the metaphor of functions as lists of instructions. -
    028call_reply.cc: functions can -return arbitrary numbers of values to their callers. -
    029tools.cc: various primitive -operations to help with testing and debugging. -

    030container.cc: Mu supports -compound types called containers akin to records, structs or classes. -
    031array.cc: all Mu data structures -are bounds-checked. -
    032exclusive_container.cc: -tagged unions or sum types. -
    033address.cc: Mu requires you to -manually manage memory. However, it provides transparent refcounting for all -addresses, making it entirely safe from the sorts of undefined behavior and -security vulnerabilities that plague C. Compared to Rust, Mu gives up some -runtime efficiency in exchange for C-like flexibility (you can copy addresses -around all you like, and write from any copy of an address) and simpler -implementation (since I punt on Rust's static analysis). +

    Support for defining new recipes. In +Mu calls to functions look just like primitive operations, with the ability to +pass in ingredients, and to +return products. In particular, Mu +supports returning multiple values, and uses this ability far more pervasively +than high-level languages can. + +

    Support for various data structures: heterogeneous compound types called +containers, akin to records +or structs, homogeneous arrays of a single +type of value, and exclusive containers, +akin to C unions but with a tag so each value knows its ‘kind’. +Out of these primitive types, Mu builds the usual and growing menagerie of +data structures: linked lists permitting +fast insertion and deletion and unidirectional scanning but slow search; +duplex lists that permit +bidirectional scanning; associative arrays or tables +for fast insertion, deletion and search using hash +tables; and streams for +gradually constructing long strings in a piecemeal fashion. -

    061recipe.cc: passing functions -around as first-class values in higher-order functions. -
    062scheduler.cc: running multiple -functions concurrently using routines that might execute in -interleaved fashion. -
    063wait.cc: primitives for -synchronization between routines. +

    Dynamic memory management: Mu supports allocating +space at run-time as pointers or addresses. All Mu instructions can +dereference or lookup addresses +of values in addition to operating on regular values. These addresses are +manually managed like C. However, all allocations are transparently +reference-counted or refcounted, +with every copy of a pointer updating refcounts appropriately. When the +refcount of an allocation drops to zero it is transparently reclaimed +and made available to future allocations. By construction it is impossible to +reclaim memory prematurely, while some other part of a program is still +pointing to it. This eliminates a whole class of undefined behavior and +security vulnerabilities that plague C. Compared to Rust, Mu pays some +additional runtime cost in exchange for C-like flexibility (you can copy +addresses around all you like, and write from any copy of an address) and +simpler implementation (no static analysis). -

    Part III: transforms to provide 80% of the benefits of high-level -languages. -
    040brace.cc and +

    Support for higher-order recipes that can pass recipes +around like any other value. + +

    Support for running multiple functions concurrently using routines, +for communicating between routines using channels, +and for synchronizing between routines. + +

    Part III: transforms to make Mu a little more expressive, and give +it some of the benefits of a high-level language. + +

    040brace.cc and 041jump_target.cc: how Mu provides structured goto-less programming without introducing the syntax of conditionals and loops other languages require. @@ -143,45 +167,35 @@ has no variables that are available transparently across routines, and this might go away as well. Global variables are currently not checked as rigorously as the rest of the type system.
    047check_type_by_name.cc: -a simple transform to deduce missing types in instructions on the basis of +a transform to deduce missing types in instructions on the basis of previous instructions in the same function.
    050scenario.cc: Mu's first syntax — not for code but for tests. (example)
    052tangle.cc: support for layers in Mu programs. They've been so good to us. -
    Support for shape-shifting or generic data structures that can -contain type ingredients: 053dilated_reagent.cc, -a new syntax for allowing whitespace in types; 054parse_tree.cc, -a new syntax for representing complex types as trees using whitespace and -parentheses (s-expressions); 055recipe_header.cc, -a new syntax for introducing ingredients and products with the name of a reagent; -056static_dispatch.cc, allowing -multiple variants of a function to coexist with support for different headers; -057shape_shifting_container.cc, -a new syntax for wildcard type ingredients in containers; and finally -058shape_shifting_recipe.cc, -support for type ingredients in functions. Everytime you call a shape-shifting -function with a new set of types for its type ingredients, it creates a new -variant of the function for you matching those types. -
    060immutable.cc, a static analysis to +
    053recipe_header.cc: +a new syntax for summarizing the number and types of ingredients and products +a function expects at the top next to its name, in a header. +
    054static_dispatch.cc: +allowing multiple variants of a function to coexist as long as each has a +unique header. +
    Support for generic or shape-shifting data structures +and recipes, containing +wildcard type ingredients that start with an ‘_’. Everytime you +use a shape-shifting recipe with a new set of ‘concrete’ types +for its type ingredients, it creates a new variant of the recipe for you +matching those types. +
    057immutable.cc, a static analysis to ensure that functions never modify anything but their products. -

    998check_type_pointers.cc.html: -After all our messing about with types, a final pass to make sure we didn't -introduce any invalid types. -
    999spaces.cc.html: Maps summarizing -various address spaces in the core, and the conventions that regulate their -use in previous layers. -various address spaces in the core, and the conventions that regulate their -use in previous layers.

    Part IV: beginnings of a standard library +

    070text.mu: strings in Mu are bounds-checked rather than null-terminated. They're also unicode-aware (code -points only; no control characters, no combining characters, no normalization). -
    064rewrite_literal_string.cc: -allow functions taking strings to also take string literals. Mu doesn't have a -global segment; string literals are allocated on the heap everytime they're -used. +points only; no control characters, no combining characters, no +normalization). Mu recipes that take strings can take literal strings thanks +to a transform that +allocates them on the heap.
    071rewrite_stash.cc: a convenience when debugging is the ability to add variables to the trace using the stash command. By default @@ -192,21 +206,18 @@ with the appropriate ingredient type, returning a Mu string.
    072channel.mu: channels are Mu's only synchronization primitive, queues that can cause the routine reading or writing from them to stall without taking up CPU resources. -
    073array.mu +
    073array.mu: utilities for arrays.
    074list.mu: linked lists where each node points to the next, permitting fast insertion/deletion but slow for search. -
    075random.cc +
    075random.cc: a random-number +generator for introducing non-determinism into programs.
    076duplex_list.mu: doubly linked lists that can be traversed both forwards and back.
    077stream.mu: data structure to efficiently append strings. -

    Part V: Nascent tools for browsing Mu codebases, and for teaching -programming to non-programmers by getting them hooked on the value of tests. -The eventual goal is an environment that watches programmers as they -manually test their code, and turns these interactive sessions into -reproducible test scenarios. +

    Part V: Primitives for interfacing with hardware.

    080display.cc: primitives for using the keyboard and screen. @@ -220,23 +231,22 @@ swap the real keyboard and mouse with fake ones for testing.
    085scenario_console.cc: writing tests for keyboard and mouse using the fakes. (examples) + +
    029tools.cc: various primitive +operations to help with testing and debugging.
    090trace_browser.cc: a zoomable UI for inspecting traces generated by Mu programs. Allows both scanning a high-level view and drilling down into selective details. -
    091run_interactive.cc: -hacky primitives for running Mu code in the programming environment below. -
    092persist.cc: more hacky -primitives for supporting saving/restoring sessions in the Mu programming -environment. -

    Finally, the programming environment, the first major application in its -own directory. Stop loading after each of these layers to get a working -version with just fewer features. The readme -for the app contains instructions for running it.
    +

    Part VI: An environment that watches programmers as they +manually test their code, and turns these interactive sessions into reproducible +test scenarios. The readme for the app +contains instructions for running it. Stop loading after each of these layers +to get a working version with just fewer features. -
    edit/001-editor.mu: data -structures for a simple text editor widget. Load just this layer to see just -the rendering and line-wrapping at work. +

    edit/001-editor.mu: data +structures for a text editor widget. Load just this layer to see just the +rendering and line-wrapping at work.
    edit/002-typing.mu: support for moving the cursor anywhere with the mouse and typing text in there.
    edit/003-shortcuts.mu: @@ -248,22 +258,25 @@ for running mu code in the right-hand widget using code from the left, and displaying results in a sandbox below on the right. You can have multiple sandboxes, and hit F4 to rerun them all at anytime with the latest version of the code on the left side. -
    edit/006-sandbox-edit.mu: -click on the title bar of each sandbox to pop it back into the sandbox editor -and make changes to it. +
    edit/006-sandbox-edit.mu: +click on the 'copy' button in each sandbox to duplicate its contents.
    edit/007-sandbox-delete.mu: -click on the 'x' in the title bar of a sandbox to delete it. -
    edit/008-sandbox-test.mu: +support for the 'delete' button in each sandbox. +
    edit/008-sandbox-edit.mu: +click on the 'edit' button of each sandbox to pop its back into the sandbox +editor. Basically like copying and then deleting a sandbox. +
    edit/009-sandbox-test.mu: click on the results of a sandbox to turn them green and save the output as golden/expected. Any future changes to the output will then be flagged in red. -
    edit/009-sandbox-trace.mu: +
    edit/010-sandbox-trace.mu: click on code in a sandbox to open up a drawer containing its trace. The trace can be added to using the stash -command, which renders arbitrary data structures using to-text -with the appropriate function header. -
    edit/010-errors.mu: +command, which can be extended to render arbitrary data structures by creating +new variants of the to-text +recipe for the appropriate types. +
    edit/011-errors.mu: support for rendering errors on both the left and in each sandbox. -
    edit/011-editor-undo.mu: +
    edit/012-editor-undo.mu: support for undo in the editor widget.


    -- cgit 1.4.1-2-gfad0