rename bosl to phisol

This commit is contained in:
Torsten Ruger 2015-10-07 15:22:47 +03:00
parent f88fc8bba1
commit 99098951ca
26 changed files with 38 additions and 38 deletions

View File

@ -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

View File

@ -1,4 +1,4 @@
module Bosl
module Phisol
class Compiler < AST::Processor
def initialize()

View File

@ -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.

View File

@ -1,4 +1,4 @@
module Bosl
module Phisol
# collection of the simple ones, int and strings and such
Compiler.class_eval do

View File

@ -1,4 +1,4 @@
module Bosl
module Phisol
Compiler.class_eval do
def on_call expression

View File

@ -1,4 +1,4 @@
module Bosl
module Phisol
Compiler.class_eval do
def on_class_field expression

View File

@ -1,4 +1,4 @@
module Bosl
module Phisol
Compiler.class_eval do
# attr_reader :values

View File

@ -1,4 +1,4 @@
module Bosl
module Phisol
Compiler.class_eval do
# list - attr_reader :expressions
def on_expressions expession

View File

@ -1,4 +1,4 @@
module Bosl
module Phisol
Compiler.class_eval do
def on_field_access expression

View File

@ -1,4 +1,4 @@
module Bosl
module Phisol
Compiler.class_eval do
def on_field_def expression

View File

@ -1,4 +1,4 @@
module Bosl
module Phisol
Compiler.class_eval do
def on_function expression

View File

@ -1,4 +1,4 @@
module Bosl
module Phisol
Compiler.class_eval do
# if - attr_reader :cond, :if_true, :if_false

View File

@ -1,4 +1,4 @@
module Bosl
module Phisol
Compiler.class_eval do
# module attr_reader :name ,:expressions
def on_module expression

View File

@ -1,4 +1,4 @@
module Bosl
module Phisol
Compiler.class_eval do
# attr_reader :name

View File

@ -1,4 +1,4 @@
module Bosl
module Phisol
Compiler.class_eval do
def on_operator expression

View File

@ -1,4 +1,4 @@
module Bosl
module Phisol
Compiler.class_eval do
# return attr_reader :expression

View File

@ -1,4 +1,4 @@
module Bosl
module Phisol
Compiler.class_eval do
def on_while expression

View File

@ -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.

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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