about summary refs log tree commit diff stats
path: root/cpp/020run
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-17 11:22:59 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-17 11:22:59 -0700
commit2199940af170456929a3c4fe4d07d25afea6ae55 (patch)
tree178c2f4a4188c19da3bfd1a0b3f32ec6a82880e6 /cpp/020run
parentc18e17f22feaf308376f53f2f61775ddad0e4a9d (diff)
downloadmu-2199940af170456929a3c4fe4d07d25afea6ae55.tar.gz
1077
Diffstat (limited to 'cpp/020run')
-rw-r--r--cpp/020run15
1 files changed, 13 insertions, 2 deletions
diff --git a/cpp/020run b/cpp/020run
index 91e242a7..1de1c6ae 100644
--- a/cpp/020run
+++ b/cpp/020run
@@ -1,3 +1,14 @@
+//: Once a recipe is loaded, we need to run it.
+//:
+//: So far we've seen recipes as lists of instructions, and instructions point
+//: at other recipes. To kick things off mu needs to know how to run certain
+//: 'primitive' recipes. That will then give the ability to run recipes
+//: containing these primitives.
+//:
+//: This layer defines a skeleton with just two primitive recipes: IDLE which
+//: does nothing, and COPY, which can copy numbers from one memory location to
+//: another. Later layers will add more primitives.
+
 :(scenarios run)
 :(scenario copy_literal)
 recipe main [
@@ -66,6 +77,7 @@ void run(routine rr) {
 //: Some helpers.
 //: We'll need to override these later as we change the definition of routine.
 //: Important that they return referrences into the routine.
+
 inline size_t& running_at(routine& rr) {
   return rr.running_at;
 }
@@ -115,9 +127,8 @@ void load(string filename) {
 load("core.mu");
 recently_added_recipes.clear();  // freeze everything so it doesn't get cleared by tests
 
-//: helper for tests
-
 :(code)
+// helper for tests
 void run(string form) {
   vector<recipe_number> tmp = add_recipes(form);
   transform_all();