From 4dcfddb27017627793ae5fb705ee94ab3b9ba385 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Wed, 11 Apr 2018 19:58:57 +0300 Subject: [PATCH] rename typed to soml --- .../pages => assets/images}/typed/bench.png | Bin app/views/layouts/application.html.haml | 2 +- app/views/pages/rubyx/_menu.haml | 16 ++++++---------- .../pages/{typed => rubyx}/debugger.html.haml | 2 +- app/views/pages/soml/_menu.html.haml | 8 ++++++++ app/views/pages/{typed => soml}/bench.numbers | Bin .../pages/{typed => soml}/benchmarks.html.haml | 10 ++++++---- .../pages/{typed => soml}/syntax.html.haml | 10 +++++----- app/views/pages/{typed => soml}/typed.html.haml | 6 +++--- app/views/pages/typed/_menu.html.haml | 10 ---------- 10 files changed, 30 insertions(+), 34 deletions(-) rename app/{views/pages => assets/images}/typed/bench.png (100%) rename app/views/pages/{typed => rubyx}/debugger.html.haml (99%) create mode 100644 app/views/pages/soml/_menu.html.haml rename app/views/pages/{typed => soml}/bench.numbers (100%) rename app/views/pages/{typed => soml}/benchmarks.html.haml (95%) rename app/views/pages/{typed => soml}/syntax.html.haml (97%) rename app/views/pages/{typed => soml}/typed.html.haml (93%) delete mode 100644 app/views/pages/typed/_menu.html.haml diff --git a/app/views/pages/typed/bench.png b/app/assets/images/typed/bench.png similarity index 100% rename from app/views/pages/typed/bench.png rename to app/assets/images/typed/bench.png diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 153e266..d497b2b 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -16,7 +16,7 @@ %ul.nav %li= link_to "Home" , root_path %li= link_to "Architecture", "/rubyx/layers.html" - %li= link_to "Typed layer" , "/typed/typed.html" + %li= link_to "Soml (obsolete)" , "/soml/typed.html" %li= link_to "Arm Resources" , "/arm/overview.html" %li= link_to "About" , "/project/motivation.html" %li= link_to "News" , blog_index_path diff --git a/app/views/pages/rubyx/_menu.haml b/app/views/pages/rubyx/_menu.haml index 4d04efa..a8ec0d1 100644 --- a/app/views/pages/rubyx/_menu.haml +++ b/app/views/pages/rubyx/_menu.haml @@ -1,12 +1,8 @@ .row %ul.nav - %li - %a{:href => "/rubyx/layers.html"} Layers of RubyX - %li - %a{:href => "/rubyx/parfait.html"} Parfait - %li - %a{:href => "/rubyx/memory.html"} Memory - %li - %a{:href => "/rubyx/threads.html"} Threads - %li - %a{:href => "/rubyx/optimisations.html"} Optimisation ideas + %li= link_to "Layers of RubyX" , "layers.html" + %li= link_to "Parfait", "parfait.html" + %li= link_to "Debugger", "debugger.html" + %li= link_to "Memory" , "memory.html" + %li= link_to "Threads" , "threads.html" + %li= link_to "Optimisation ideas" , "optimisations.html" diff --git a/app/views/pages/typed/debugger.html.haml b/app/views/pages/rubyx/debugger.html.haml similarity index 99% rename from app/views/pages/typed/debugger.html.haml rename to app/views/pages/rubyx/debugger.html.haml index 781a407..5127358 100644 --- a/app/views/pages/typed/debugger.html.haml +++ b/app/views/pages/rubyx/debugger.html.haml @@ -1,4 +1,4 @@ -= render "pages/typed/menu" += render "pages/rubyx/menu" %h1= title "Register Level Debugger / simulator" diff --git a/app/views/pages/soml/_menu.html.haml b/app/views/pages/soml/_menu.html.haml new file mode 100644 index 0000000..967d42b --- /dev/null +++ b/app/views/pages/soml/_menu.html.haml @@ -0,0 +1,8 @@ +.row + %ul.nav + %li + %a{:href => "typed.html"} Typed + %li + %a{:href => "benchmarks.html"} Performance + %li + %a{:href => "syntax.html"} Syntax (obsolete) diff --git a/app/views/pages/typed/bench.numbers b/app/views/pages/soml/bench.numbers similarity index 100% rename from app/views/pages/typed/bench.numbers rename to app/views/pages/soml/bench.numbers diff --git a/app/views/pages/typed/benchmarks.html.haml b/app/views/pages/soml/benchmarks.html.haml similarity index 95% rename from app/views/pages/typed/benchmarks.html.haml rename to app/views/pages/soml/benchmarks.html.haml index bd47be4..7b7f0a4 100644 --- a/app/views/pages/typed/benchmarks.html.haml +++ b/app/views/pages/soml/benchmarks.html.haml @@ -1,4 +1,4 @@ -= render "pages/typed/menu" += render "pages/soml/menu" %h1= title "Simple soml performance numbers" @@ -15,7 +15,8 @@ Hello and itos and add run 100_000 iterations per program invocation to remove startup overhead. Call only has 10000 iterations, as it is much slower, executing about 10000 calls per invocation %p Gcc used to compile c on the machine. soml executables produced by ruby (on another machine) -%h3#results Results + +%h2 Results %p Results were measured by a ruby script. Mean and variance was measured until variance was low, always under one percent. @@ -23,8 +24,9 @@ The machine was a virtual arm run on a powerbook, performance roughly equivalent to a raspberry pi. But results should be seen as relative, not absolute (some were scaled) %p - %img{:alt => "Graph", :src => "bench.png"}/ -%h3#discussion Discussion + = image_tag "typed/bench.png" ,alt: "Graph" + +%h2 Discussion %p Surprisingly there are areas where soml code runs faster than c. Especially in the hello example this may not mean too much. Printf does caching and has a lot functionality, so it may not be a straight diff --git a/app/views/pages/typed/syntax.html.haml b/app/views/pages/soml/syntax.html.haml similarity index 97% rename from app/views/pages/typed/syntax.html.haml rename to app/views/pages/soml/syntax.html.haml index 4a90b33..41ea81b 100644 --- a/app/views/pages/typed/syntax.html.haml +++ b/app/views/pages/soml/syntax.html.haml @@ -1,8 +1,8 @@ -= render "pages/typed/menu" += render "pages/soml/menu" %h1= title "Soml Syntax" -%h4#top-level-class-and-methods Top level Class and methods +%h2 Top level Class and methods %p The top level declarations in a file may only be class definitions %pre %code @@ -28,7 +28,7 @@ %p Classes are represented by class objects (instances of class Class to be precise) and methods by Method objects, so all information is available at runtime. -%h4#expressions Expressions +%h2 Expressions %p Soml distinguishes between expressions and statements. Expressions have value, statements perform an action. Both are compiled to Register level instructions for the current method. Generally speaking @@ -90,7 +90,7 @@ Operator expressions may be used in assignments and conditions, but not in calls, where the result would have to be assigned beforehand. This is one of those cases where soml’s low level approach shines through, as soml has no auto-generated temporary variables. -%h4#statements Statements +%h2 Statements %p We have seen the top level statements above. In methods the most interesting statements relate to flow control and specifically how conditionals are expressed. This differs somewhat from other @@ -172,7 +172,7 @@ :preserve counter = 0 %p Any of the expressions, basic, call, operator, field access, may be assigned. -%h3#code-generation-and-scope Code generation and scope +%h2 Code generation and scope %p Compiling generates two results simultaneously. The more obvious is code for a function, but also an object structure of classes etc that capture the declarations. To understand the code part better diff --git a/app/views/pages/typed/typed.html.haml b/app/views/pages/soml/typed.html.haml similarity index 93% rename from app/views/pages/typed/typed.html.haml rename to app/views/pages/soml/typed.html.haml index e3fab54..22274bd 100644 --- a/app/views/pages/typed/typed.html.haml +++ b/app/views/pages/soml/typed.html.haml @@ -1,4 +1,4 @@ -= render "pages/typed/menu" += render "pages/soml/menu" %h1= title "Typed intermediate representation" @@ -12,7 +12,7 @@ ruby above, and the register machine below. One can think of it as a mix between c and c++, minus the syntax aspect. While in 2015, this layer existed as a language, (see soml-parser), it is now a tree representation only. -%h4#object-oriented-to-the-core-including-calling-convention Object oriented to the core, including calling convention +%h2 Object oriented to the core, including calling convention %p Types are modeled by the class Type and carry information about instance variable names and their basic type. @@ -36,7 +36,7 @@ %p There is no non- object based memory at all. The only global constants are instances of classes that can be accessed by writing the class name in ruby source. -%h4#runtime--parfait Runtime / Parfait +%h2 Runtime / Parfait %p The typed representation layer depends on the higher layer to actually determine and instantiate types (type objects, or objects of class Type). This includes method arguments and local variables. diff --git a/app/views/pages/typed/_menu.html.haml b/app/views/pages/typed/_menu.html.haml deleted file mode 100644 index d3be1db..0000000 --- a/app/views/pages/typed/_menu.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -.row - %ul.nav - %li - %a{:href => "/typed/typed.html"} Typed - %li - %a{:href => "/typed/benchmarks.html"} Performance - %li - %a{:href => "/typed/debugger.html"} Debugger - %li - %a{:href => "/typed/syntax.html"} Syntax (obsolete)