rename bosl to phisol
This commit is contained in:
parent
f88fc8bba1
commit
99098951ca
18
README.md
18
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.
|
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 current third rewrite adds a system language, with the idea of compiling ruby to that language, Phisol.
|
||||||
The original ruby parser has been remodelled to parse bosl and later we will use whitequarks
|
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 --> bosl --> assembler --> binary .
|
parser to parse ruby. Then it will be ruby --> Phisol --> assembler --> binary .
|
||||||
|
|
||||||
|
|
||||||
## Done
|
## Done
|
||||||
@ -69,11 +69,11 @@ As said, "Hello world" comes out and does use syscall 4.
|
|||||||
Also the program stops by syscall exit.
|
Also the program stops by syscall exit.
|
||||||
The full list is on the net and involves mostly just work.
|
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
|
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.
|
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
|
## 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
|
## Future
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
module Bosl
|
module Phisol
|
||||||
class Compiler < AST::Processor
|
class Compiler < AST::Processor
|
||||||
|
|
||||||
def initialize()
|
def initialize()
|
@ -23,7 +23,7 @@ The compiler has a method for each type for ast, named along on_xxx with xxx as
|
|||||||
|
|
||||||
#### Compiler holds scope
|
#### 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 static language) things have become more simple.
|
||||||
|
|
||||||
A class statement sets the current @clazz scope , a method definition the @method.
|
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
|
### 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
|
even many, features may not make sense on their own. But these features, like several return
|
||||||
addresses, are important to implement the higher language.
|
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,
|
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.
|
we just need it to create our layers.
|
@ -1,4 +1,4 @@
|
|||||||
module Bosl
|
module Phisol
|
||||||
# collection of the simple ones, int and strings and such
|
# collection of the simple ones, int and strings and such
|
||||||
|
|
||||||
Compiler.class_eval do
|
Compiler.class_eval do
|
@ -1,4 +1,4 @@
|
|||||||
module Bosl
|
module Phisol
|
||||||
Compiler.class_eval do
|
Compiler.class_eval do
|
||||||
|
|
||||||
def on_call expression
|
def on_call expression
|
@ -1,4 +1,4 @@
|
|||||||
module Bosl
|
module Phisol
|
||||||
Compiler.class_eval do
|
Compiler.class_eval do
|
||||||
|
|
||||||
def on_class_field expression
|
def on_class_field expression
|
@ -1,4 +1,4 @@
|
|||||||
module Bosl
|
module Phisol
|
||||||
Compiler.class_eval do
|
Compiler.class_eval do
|
||||||
|
|
||||||
# attr_reader :values
|
# attr_reader :values
|
@ -1,4 +1,4 @@
|
|||||||
module Bosl
|
module Phisol
|
||||||
Compiler.class_eval do
|
Compiler.class_eval do
|
||||||
# list - attr_reader :expressions
|
# list - attr_reader :expressions
|
||||||
def on_expressions expession
|
def on_expressions expession
|
@ -1,4 +1,4 @@
|
|||||||
module Bosl
|
module Phisol
|
||||||
Compiler.class_eval do
|
Compiler.class_eval do
|
||||||
|
|
||||||
def on_field_access expression
|
def on_field_access expression
|
@ -1,4 +1,4 @@
|
|||||||
module Bosl
|
module Phisol
|
||||||
Compiler.class_eval do
|
Compiler.class_eval do
|
||||||
|
|
||||||
def on_field_def expression
|
def on_field_def expression
|
@ -1,4 +1,4 @@
|
|||||||
module Bosl
|
module Phisol
|
||||||
Compiler.class_eval do
|
Compiler.class_eval do
|
||||||
|
|
||||||
def on_function expression
|
def on_function expression
|
@ -1,4 +1,4 @@
|
|||||||
module Bosl
|
module Phisol
|
||||||
Compiler.class_eval do
|
Compiler.class_eval do
|
||||||
# if - attr_reader :cond, :if_true, :if_false
|
# if - attr_reader :cond, :if_true, :if_false
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
module Bosl
|
module Phisol
|
||||||
Compiler.class_eval do
|
Compiler.class_eval do
|
||||||
# module attr_reader :name ,:expressions
|
# module attr_reader :name ,:expressions
|
||||||
def on_module expression
|
def on_module expression
|
@ -1,4 +1,4 @@
|
|||||||
module Bosl
|
module Phisol
|
||||||
Compiler.class_eval do
|
Compiler.class_eval do
|
||||||
|
|
||||||
# attr_reader :name
|
# attr_reader :name
|
@ -1,4 +1,4 @@
|
|||||||
module Bosl
|
module Phisol
|
||||||
Compiler.class_eval do
|
Compiler.class_eval do
|
||||||
|
|
||||||
def on_operator expression
|
def on_operator expression
|
@ -1,4 +1,4 @@
|
|||||||
module Bosl
|
module Phisol
|
||||||
Compiler.class_eval do
|
Compiler.class_eval do
|
||||||
|
|
||||||
# return attr_reader :expression
|
# return attr_reader :expression
|
@ -1,4 +1,4 @@
|
|||||||
module Bosl
|
module Phisol
|
||||||
Compiler.class_eval do
|
Compiler.class_eval do
|
||||||
|
|
||||||
def on_while expression
|
def on_while expression
|
@ -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.
|
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
|
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
|
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.
|
||||||
|
@ -5,7 +5,7 @@ require "virtual/positioned"
|
|||||||
require "virtual/padding"
|
require "virtual/padding"
|
||||||
require "virtual/parfait_adapter"
|
require "virtual/parfait_adapter"
|
||||||
|
|
||||||
require "bosl/compiler"
|
require "Phisol/compiler"
|
||||||
require "virtual/instruction"
|
require "virtual/instruction"
|
||||||
require "virtual/method_source"
|
require "virtual/method_source"
|
||||||
require "virtual/slots/slot"
|
require "virtual/slots/slot"
|
||||||
|
@ -136,7 +136,7 @@ module Virtual
|
|||||||
syntax = @parser.parse_with_debug(bytes)
|
syntax = @parser.parse_with_debug(bytes)
|
||||||
parts = Parser::Transform.new.apply(syntax)
|
parts = Parser::Transform.new.apply(syntax)
|
||||||
#puts parts.inspect
|
#puts parts.inspect
|
||||||
Bosl::Compiler.compile( parts )
|
Phisol::Compiler.compile( parts )
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -2,7 +2,7 @@ require_relative '../helper'
|
|||||||
require 'parslet/convenience'
|
require 'parslet/convenience'
|
||||||
|
|
||||||
|
|
||||||
Bosl::Compiler.class_eval do
|
Phisol::Compiler.class_eval do
|
||||||
|
|
||||||
def check
|
def check
|
||||||
Virtual.machine.boot.parse_and_compile @string_input
|
Virtual.machine.boot.parse_and_compile @string_input
|
||||||
|
@ -7,7 +7,7 @@ class CompilerTest < MiniTest::Test
|
|||||||
Virtual.machine.boot
|
Virtual.machine.boot
|
||||||
end
|
end
|
||||||
def check
|
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}"
|
assert res.is_a?(Virtual::Slot) , "compiler must compile to slot, not #{res.inspect}"
|
||||||
end
|
end
|
||||||
def test_function_expression
|
def test_function_expression
|
||||||
|
@ -17,7 +17,7 @@ class AddTest < MiniTest::Test
|
|||||||
s(:name, :plus),
|
s(:name, :plus),
|
||||||
s(:arguments , s(:int , 5)),
|
s(:arguments , s(:int , 5)),
|
||||||
s(:receiver, s(:int, 2)))))))
|
s(:receiver, s(:int, 2)))))))
|
||||||
Bosl::Compiler.compile( code )
|
Phisol::Compiler.compile( code )
|
||||||
Virtual.machine.run_before "Register::CallImplementation"
|
Virtual.machine.run_before "Register::CallImplementation"
|
||||||
@interpreter = Interpreter::Interpreter.new
|
@interpreter = Interpreter::Interpreter.new
|
||||||
@interpreter.start Virtual.machine.init
|
@interpreter.start Virtual.machine.init
|
||||||
|
@ -51,10 +51,10 @@ HERE
|
|||||||
syntax = Parser::Salama.new.parse_with_debug(@string_input)
|
syntax = Parser::Salama.new.parse_with_debug(@string_input)
|
||||||
parts = Parser::Transform.new.apply(syntax)
|
parts = Parser::Transform.new.apply(syntax)
|
||||||
puts parts.inspect
|
puts parts.inspect
|
||||||
Bosl::Compiler.compile( parts )
|
Phisol::Compiler.compile( parts )
|
||||||
|
|
||||||
# expressions = Virtual.machine.boot.parse_and_compile @string_input
|
# 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"
|
Virtual.machine.run_before "Register::CallImplementation"
|
||||||
@interpreter = Interpreter::Interpreter.new
|
@interpreter = Interpreter::Interpreter.new
|
||||||
@interpreter.start Virtual.machine.init
|
@interpreter.start Virtual.machine.init
|
||||||
|
@ -18,7 +18,7 @@ class TestPuts < MiniTest::Test
|
|||||||
s(:receiver,
|
s(:receiver,
|
||||||
s(:string, "Hello again")))))))
|
s(:string, "Hello again")))))))
|
||||||
|
|
||||||
Bosl::Compiler.compile( code )
|
Phisol::Compiler.compile( code )
|
||||||
Virtual.machine.run_before "Register::CallImplementation"
|
Virtual.machine.run_before "Register::CallImplementation"
|
||||||
@interpreter = Interpreter::Interpreter.new
|
@interpreter = Interpreter::Interpreter.new
|
||||||
@interpreter.start Virtual.machine.init
|
@interpreter.start Virtual.machine.init
|
||||||
|
Loading…
Reference in New Issue
Block a user