diff --git a/README.md b/README.md index 4cfa9124..55550bde 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,9 @@ Salama is about native code generation in and of ruby. It is probably best to read the [The Book](http://dancinglightning.gitbooks.io/the-object-machine/content/) first. -The current third rewrite adds a system language, with the idea of compiling ruby to that language, bosl. -The original ruby parser has been remodelled to parse bosl and later we will use whitequarks -parser to parse ruby. Then it will be ruby --> bosl --> assembler --> binary . +The current third rewrite adds a system language, with the idea of compiling ruby to that language, Phisol. +The original ruby parser has been remodeled to parse Phisol and later we will use whitequarks +parser to parse ruby. Then it will be ruby --> Phisol --> assembler --> binary . ## Done @@ -69,11 +69,11 @@ As said, "Hello world" comes out and does use syscall 4. Also the program stops by syscall exit. The full list is on the net and involves mostly just work. -### Parse Bosl +### Parse Phisol -Parse bosl, using Parslet. This has been separated out as it's own gem, [salama-reader](https://github.com/salama/salama-reader). +Parse Phisol, using Parslet. This has been separated out as it's own gem, [salama-reader](https://github.com/salama/salama-reader). -Bosl is now fully typed (all variables, arguments and return). Also it has statements, unlike ruby +Phisol is now fully typed (all variables, arguments and return). Also it has statements, unlike ruby where everything is an expressions. Statements have no value. Otherwise it is quite basic, and it's main purpose is to have an oo system language to compile to. @@ -108,11 +108,11 @@ exchange format, have the core read that, and use the mechanism to achieve langu ## Status -Currently all the work is on the bosl front. Also documenting the *small* change of a new language. +Currently all the work is on the Phisol front. Also documenting the *small* change of a new language. -I'll do some simple string and fibo examples in bosl next. +I'll do some simple string and fibo examples in Phisol next. -Next will be the multiple return feature and then to try to compile ruby to bosl. +Next will be the multiple return feature and then to try to compile ruby to Phisol. ## Future diff --git a/lib/bosl/ast_helper.rb b/lib/phisol/ast_helper.rb similarity index 100% rename from lib/bosl/ast_helper.rb rename to lib/phisol/ast_helper.rb diff --git a/lib/bosl/compiler.rb b/lib/phisol/compiler.rb similarity index 99% rename from lib/bosl/compiler.rb rename to lib/phisol/compiler.rb index 738d0940..e1997881 100644 --- a/lib/bosl/compiler.rb +++ b/lib/phisol/compiler.rb @@ -1,4 +1,4 @@ -module Bosl +module Phisol class Compiler < AST::Processor def initialize() diff --git a/lib/bosl/compiler/README.md b/lib/phisol/compiler/README.md similarity index 93% rename from lib/bosl/compiler/README.md rename to lib/phisol/compiler/README.md index 76d52601..ba3eac76 100644 --- a/lib/bosl/compiler/README.md +++ b/lib/phisol/compiler/README.md @@ -23,7 +23,7 @@ The compiler has a method for each type for ast, named along on_xxx with xxx as #### Compiler holds scope -The Compiler instance can hold arbitrary scope needed during the compilation. Since we compile bosl +The Compiler instance can hold arbitrary scope needed during the compilation. Since we compile Phisol (a static language) things have become more simple. A class statement sets the current @clazz scope , a method definition the @method. @@ -69,10 +69,10 @@ The important thing here is that Messages and Frames are normal objects. ### Distinctly future proof -Bosl is designed to be used as an implementation language for a higher oo language. Some, or +Phisol is designed to be used as an implementation language for a higher oo language. Some, or even many, features may not make sense on their own. But these features, like several return addresses, are important to implement the higher language. -In fact, Bosl's main purpose is not even to be written. The main purpose is to have a language to +In fact, Phisol's main purpose is not even to be written. The main purpose is to have a language to compile ruby to. In the same way that the assembler layer in salama is not designed to be written, we just need it to create our layers. diff --git a/lib/bosl/compiler/basic_expressions.rb b/lib/phisol/compiler/basic_expressions.rb similarity index 99% rename from lib/bosl/compiler/basic_expressions.rb rename to lib/phisol/compiler/basic_expressions.rb index cf9fd2f4..38595301 100644 --- a/lib/bosl/compiler/basic_expressions.rb +++ b/lib/phisol/compiler/basic_expressions.rb @@ -1,4 +1,4 @@ -module Bosl +module Phisol # collection of the simple ones, int and strings and such Compiler.class_eval do diff --git a/lib/bosl/compiler/callsite_expression.rb b/lib/phisol/compiler/callsite_expression.rb similarity index 99% rename from lib/bosl/compiler/callsite_expression.rb rename to lib/phisol/compiler/callsite_expression.rb index 240cf708..3eb10ad7 100644 --- a/lib/bosl/compiler/callsite_expression.rb +++ b/lib/phisol/compiler/callsite_expression.rb @@ -1,4 +1,4 @@ -module Bosl +module Phisol Compiler.class_eval do def on_call expression diff --git a/lib/bosl/compiler/class_field.rb b/lib/phisol/compiler/class_field.rb similarity index 97% rename from lib/bosl/compiler/class_field.rb rename to lib/phisol/compiler/class_field.rb index 5a8906ce..1f3d0e88 100644 --- a/lib/bosl/compiler/class_field.rb +++ b/lib/phisol/compiler/class_field.rb @@ -1,4 +1,4 @@ -module Bosl +module Phisol Compiler.class_eval do def on_class_field expression diff --git a/lib/bosl/compiler/compound_expressions.rb b/lib/phisol/compiler/compound_expressions.rb similarity index 93% rename from lib/bosl/compiler/compound_expressions.rb rename to lib/phisol/compiler/compound_expressions.rb index 960dd640..cfc69ac8 100644 --- a/lib/bosl/compiler/compound_expressions.rb +++ b/lib/phisol/compiler/compound_expressions.rb @@ -1,4 +1,4 @@ -module Bosl +module Phisol Compiler.class_eval do # attr_reader :values diff --git a/lib/bosl/compiler/expression_list.rb b/lib/phisol/compiler/expression_list.rb similarity index 91% rename from lib/bosl/compiler/expression_list.rb rename to lib/phisol/compiler/expression_list.rb index 83d7a7e0..4058d748 100644 --- a/lib/bosl/compiler/expression_list.rb +++ b/lib/phisol/compiler/expression_list.rb @@ -1,4 +1,4 @@ -module Bosl +module Phisol Compiler.class_eval do # list - attr_reader :expressions def on_expressions expession diff --git a/lib/bosl/compiler/field_access.rb b/lib/phisol/compiler/field_access.rb similarity index 98% rename from lib/bosl/compiler/field_access.rb rename to lib/phisol/compiler/field_access.rb index 5224230a..d09d9b8b 100644 --- a/lib/bosl/compiler/field_access.rb +++ b/lib/phisol/compiler/field_access.rb @@ -1,4 +1,4 @@ -module Bosl +module Phisol Compiler.class_eval do def on_field_access expression diff --git a/lib/bosl/compiler/field_def.rb b/lib/phisol/compiler/field_def.rb similarity index 95% rename from lib/bosl/compiler/field_def.rb rename to lib/phisol/compiler/field_def.rb index 1083808b..7508c6a1 100644 --- a/lib/bosl/compiler/field_def.rb +++ b/lib/phisol/compiler/field_def.rb @@ -1,4 +1,4 @@ -module Bosl +module Phisol Compiler.class_eval do def on_field_def expression diff --git a/lib/bosl/compiler/function_expression.rb b/lib/phisol/compiler/function_expression.rb similarity index 99% rename from lib/bosl/compiler/function_expression.rb rename to lib/phisol/compiler/function_expression.rb index 1c8dcb14..cce3f430 100644 --- a/lib/bosl/compiler/function_expression.rb +++ b/lib/phisol/compiler/function_expression.rb @@ -1,4 +1,4 @@ -module Bosl +module Phisol Compiler.class_eval do def on_function expression diff --git a/lib/bosl/compiler/if_expression.rb b/lib/phisol/compiler/if_expression.rb similarity index 99% rename from lib/bosl/compiler/if_expression.rb rename to lib/phisol/compiler/if_expression.rb index b9d3d428..8df22405 100644 --- a/lib/bosl/compiler/if_expression.rb +++ b/lib/phisol/compiler/if_expression.rb @@ -1,4 +1,4 @@ -module Bosl +module Phisol Compiler.class_eval do # if - attr_reader :cond, :if_true, :if_false diff --git a/lib/bosl/compiler/module_expression.rb b/lib/phisol/compiler/module_expression.rb similarity index 97% rename from lib/bosl/compiler/module_expression.rb rename to lib/phisol/compiler/module_expression.rb index 01d22d82..aa30e6f6 100644 --- a/lib/bosl/compiler/module_expression.rb +++ b/lib/phisol/compiler/module_expression.rb @@ -1,4 +1,4 @@ -module Bosl +module Phisol Compiler.class_eval do # module attr_reader :name ,:expressions def on_module expression diff --git a/lib/bosl/compiler/name_expression.rb b/lib/phisol/compiler/name_expression.rb similarity index 98% rename from lib/bosl/compiler/name_expression.rb rename to lib/phisol/compiler/name_expression.rb index 8d4d549e..d2e17cd9 100644 --- a/lib/bosl/compiler/name_expression.rb +++ b/lib/phisol/compiler/name_expression.rb @@ -1,4 +1,4 @@ -module Bosl +module Phisol Compiler.class_eval do # attr_reader :name diff --git a/lib/bosl/compiler/operator_expressions.rb b/lib/phisol/compiler/operator_expressions.rb similarity index 98% rename from lib/bosl/compiler/operator_expressions.rb rename to lib/phisol/compiler/operator_expressions.rb index 6fd15008..b0529efe 100644 --- a/lib/bosl/compiler/operator_expressions.rb +++ b/lib/phisol/compiler/operator_expressions.rb @@ -1,4 +1,4 @@ -module Bosl +module Phisol Compiler.class_eval do def on_operator expression diff --git a/lib/bosl/compiler/return_expression.rb b/lib/phisol/compiler/return_expression.rb similarity index 91% rename from lib/bosl/compiler/return_expression.rb rename to lib/phisol/compiler/return_expression.rb index 848b71dd..03d7fa54 100644 --- a/lib/bosl/compiler/return_expression.rb +++ b/lib/phisol/compiler/return_expression.rb @@ -1,4 +1,4 @@ -module Bosl +module Phisol Compiler.class_eval do # return attr_reader :expression diff --git a/lib/bosl/compiler/while_expression.rb b/lib/phisol/compiler/while_expression.rb similarity index 98% rename from lib/bosl/compiler/while_expression.rb rename to lib/phisol/compiler/while_expression.rb index 4b637fde..1eb28cc1 100644 --- a/lib/bosl/compiler/while_expression.rb +++ b/lib/phisol/compiler/while_expression.rb @@ -1,4 +1,4 @@ -module Bosl +module Phisol Compiler.class_eval do def on_while expression diff --git a/lib/register/builtin/README.md b/lib/register/builtin/README.md index 9d824fa1..95e2b8f4 100644 --- a/lib/register/builtin/README.md +++ b/lib/register/builtin/README.md @@ -17,8 +17,8 @@ Slightly more here : http://salama.github.io/2014/06/10/more-clarity.html (then The Builtin module is scattered into several files, but that is just so the file doesn't get too long. -Note: This is about to change slightly with the arrival of Bosl. Bosl is a lower level function, +Note: This is about to change slightly with the arrival of Phisol. Phisol is a lower level function, and as such there is not much that we need that can not be expressed in it. My current thinking -is that i can code anything in bosl and will only need the bosl instruction set. +is that i can code anything in Phisol and will only need the Phisol instruction set. So this whole Builtin approach may blow over in the next months. It had already become clear that -mostly this was going to be about memory access, which in bosl is part of the language. +mostly this was going to be about memory access, which in Phisol is part of the language. diff --git a/lib/virtual.rb b/lib/virtual.rb index 6b5ebe3f..81264c70 100644 --- a/lib/virtual.rb +++ b/lib/virtual.rb @@ -5,7 +5,7 @@ require "virtual/positioned" require "virtual/padding" require "virtual/parfait_adapter" -require "bosl/compiler" +require "Phisol/compiler" require "virtual/instruction" require "virtual/method_source" require "virtual/slots/slot" diff --git a/lib/virtual/machine.rb b/lib/virtual/machine.rb index 7e33a4b3..d7453d13 100644 --- a/lib/virtual/machine.rb +++ b/lib/virtual/machine.rb @@ -136,7 +136,7 @@ module Virtual syntax = @parser.parse_with_debug(bytes) parts = Parser::Transform.new.apply(syntax) #puts parts.inspect - Bosl::Compiler.compile( parts ) + Phisol::Compiler.compile( parts ) end private diff --git a/test/compiler/compiler_helper.rb b/test/compiler/compiler_helper.rb index 666db943..855ce51e 100644 --- a/test/compiler/compiler_helper.rb +++ b/test/compiler/compiler_helper.rb @@ -2,7 +2,7 @@ require_relative '../helper' require 'parslet/convenience' -Bosl::Compiler.class_eval do +Phisol::Compiler.class_eval do def check Virtual.machine.boot.parse_and_compile @string_input diff --git a/test/compiler/test_compiler.rb b/test/compiler/test_compiler.rb index d0652543..98d2c3a3 100644 --- a/test/compiler/test_compiler.rb +++ b/test/compiler/test_compiler.rb @@ -7,7 +7,7 @@ class CompilerTest < MiniTest::Test Virtual.machine.boot end def check - res = Bosl::Compiler.compile( @expression ) + res = Phisol::Compiler.compile( @expression ) assert res.is_a?(Virtual::Slot) , "compiler must compile to slot, not #{res.inspect}" end def test_function_expression diff --git a/test/interpreter/test_add.rb b/test/interpreter/test_add.rb index 1aa64587..d26bcc81 100644 --- a/test/interpreter/test_add.rb +++ b/test/interpreter/test_add.rb @@ -17,7 +17,7 @@ class AddTest < MiniTest::Test s(:name, :plus), s(:arguments , s(:int , 5)), s(:receiver, s(:int, 2))))))) - Bosl::Compiler.compile( code ) + Phisol::Compiler.compile( code ) Virtual.machine.run_before "Register::CallImplementation" @interpreter = Interpreter::Interpreter.new @interpreter.start Virtual.machine.init diff --git a/test/interpreter/test_puti.rb b/test/interpreter/test_puti.rb index 8127fd1f..37a663b8 100644 --- a/test/interpreter/test_puti.rb +++ b/test/interpreter/test_puti.rb @@ -51,10 +51,10 @@ HERE syntax = Parser::Salama.new.parse_with_debug(@string_input) parts = Parser::Transform.new.apply(syntax) puts parts.inspect - Bosl::Compiler.compile( parts ) + Phisol::Compiler.compile( parts ) # expressions = Virtual.machine.boot.parse_and_compile @string_input -# Bosl::Compiler.compile( expressions , Virtual.machine.space.get_main ) +# Phisol::Compiler.compile( expressions , Virtual.machine.space.get_main ) Virtual.machine.run_before "Register::CallImplementation" @interpreter = Interpreter::Interpreter.new @interpreter.start Virtual.machine.init diff --git a/test/interpreter/test_puts.rb b/test/interpreter/test_puts.rb index 298c185b..ccdaa5cf 100644 --- a/test/interpreter/test_puts.rb +++ b/test/interpreter/test_puts.rb @@ -18,7 +18,7 @@ class TestPuts < MiniTest::Test s(:receiver, s(:string, "Hello again"))))))) - Bosl::Compiler.compile( code ) + Phisol::Compiler.compile( code ) Virtual.machine.run_before "Register::CallImplementation" @interpreter = Interpreter::Interpreter.new @interpreter.start Virtual.machine.init