diff --git a/CNAME b/CNAME index 82e3ee10..c352c56f 100644 --- a/CNAME +++ b/CNAME @@ -1 +1 @@ -salama-vm.org +ruby-x.org diff --git a/CodeStyle.md b/CodeStyle.md index 20a561cd..b7f92eca 100644 --- a/CodeStyle.md +++ b/CodeStyle.md @@ -1,7 +1,7 @@ # Code Style and Conventions Just few things that have become important enough to write down. Apart from what is written here -standard blah applies (ie RoboCop stuff). +standard blah applies (ie RoboCop/Reek stuff). ## Formatting @@ -9,6 +9,12 @@ standard blah applies (ie RoboCop stuff). While the days of 80 are over, too big steps seems difficult. I've settled on 100 (ish) +### Brackets + +While ruby allows the ommision of brackets even with arguments, i try to avoid that because +of readablity. There may be an exception for an assignment, a single call with a single arg. +Brackets without arguments look funny though. + ### Hash I still prefer 1.9 => style , it makes the association more obvious. @@ -25,13 +31,8 @@ the code reads much nicer when they are on the module. ### Code generators -Since code is represented by instances of Instructions (and subclasses) the most straightforward -way of generating code is by new of the Class. This is ok for some. - -But often one finds a little massaging of the incoming data is better, while keeping that logic -out of the Instructions classes. In such cases Module functions are again quite nice. Example: - Instead of SlotToReg.new( register, index , register) we use Register.slot_to_reg( name , name , name). All names are resolved to registers, or index via Type. More readable code less repetition. - As the example shows, in this case the module function name should be the instruction class name. + +Singletons should hang off the module (not the class), eg Parfait.object_space diff --git a/Gemfile b/Gemfile index a9b3c78d..74766d89 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ gem "ast" , :github => "whitequark/ast" , branch: :master gem "rake" gem "rye" -gem "salama-object-file" , :github => "salama/salama-object-file" +gem "salama-object-file" , :github => "ruby-x/salama-object-file" #gem "salama-object-file" , :path => "../salama-object-file" gem "codeclimate-test-reporter", require: nil diff --git a/README.md b/README.md index 95b6bf58..a70eb3b7 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ -[![Build Status](https://travis-ci.org/salama/salama.svg?branch=master)](https://travis-ci.org/salama/salama) +[![Build Status](https://travis-ci.org/ruby-x/salama.svg?branch=master)](https://travis-ci.org/ruby-x/salama) [![Gem Version](https://badge.fury.io/rb/salama.svg)](http://badge.fury.io/rb/salama) -[![Code Climate](https://codeclimate.com/github/salama/salama/badges/gpa.svg)](https://codeclimate.com/github/salama/salama) -[![Test Coverage](https://codeclimate.com/github/salama/salama/badges/coverage.svg)](https://codeclimate.com/github/salama/salama) +[![Code Climate](https://codeclimate.com/github/ruby-x/ruby-x/badges/gpa.svg)](https://codeclimate.com/github/ruby-x/salama) +[![Test Coverage](https://codeclimate.com/github/ruby-x/ruby-x/badges/coverage.svg)](https://codeclimate.com/github/ruby-x/salama) -# Salama +# RubyX -Salama is about native code generation in and of ruby. +RubyX is about native code generation in and of ruby. X can be read as 10 times faster, +or a decade away, depending on mindset. The current (fourth) rewrite adds a typed intermediate representation layer (bit like c, but not as a language). The idea is to compile ruby to that typed representation. @@ -28,7 +29,7 @@ Completely object oriented, including calling convention. Not much slower than c ### A runtime: Parfait In a dynamic system the distinction between compile-time and run-time is blurs. But a minimum -of support is needed to get the system up, and that is [Parfait](http://salama-vm.org/soml/parfait.html) +of support is needed to get the system up, and that is [Parfait](http://ruby-x.org/soml/parfait.html) ### Interpreter @@ -37,7 +38,7 @@ register layer. That way test runs on the interpreter reveal most issues. ### Debugger -And after the interpreter was done, i wrote a [visual debugger](https://github.com/salama/salama-debugger). +And after the interpreter was done, i wrote a [visual debugger](https://github.com/ruby-x/salama-debugger). It is a simple opal application that nevertheless has proven great help both in figuring out what is going on, and in finding bugs. diff --git a/ToDo.md b/ToDo.md index 4cc8aa76..7f1a843d 100644 --- a/ToDo.md +++ b/ToDo.md @@ -1,26 +1,23 @@ ToDo ===== -Some things that would be nice . . (if you did them :-) ) +Some things that would be nice . . -- Better elf support. I think it should be relatively easy to produce an executable binary (so linking - could be skipped). Off course the possibility to link in another library would be nice +- Better elf support. I think it should be relatively easy to produce an executable binary +(so linking could be skipped). Off course the possibility to link in another library would be nice +- better elf tests +- better arm coverage (more instructions, better tests) - utf8 support (string improvements generally) -- SOF parser - -Or the list of things i am not even planning of tackling at the moment Platforms --------- -x86 is up for grabs. I have intentionally started on arm (the most sold cpu) because i do this for fun. -And my pi is fun. +x86 is up for grabs. I have intentionally started on arm (the most sold cpu) because i do +this for fun. And my pi is fun. -Trying to get mainstream acknowledgement/acceptence is not fun, it's hard work and should be undertaken by -someone with funding. - -I hope to get the multi-machine architecture done at some point as i also want to port to Arduino +There is a ruby intel assembler called wilson out there. Or then there is Metasm, with +good support for many other cpu's (and a lot more code) Compliance ---------- @@ -38,4 +35,8 @@ Stdlib is not clean. More like a layer that accumulated over the years. Very nice solutions exist for most of the important things. Like celluloid for concurrency. Celluloid-io for good performance io with or without zero-mq. Fiddle looks nice admittedly. -Anyway, as i want to use gpio mostly the whole c wrapping is not too high on the list. +Interesting +----------- + +Solving concurrency is up for grabs. Any solution is a start, channels ala go are nice and +lock free stuff is the ultimate goal. diff --git a/lib/register/builtin/README.md b/lib/register/builtin/README.md index cbed6063..7f64e00d 100644 --- a/lib/register/builtin/README.md +++ b/lib/register/builtin/README.md @@ -13,6 +13,6 @@ A normal ruby function is one that is parsed and transformed to code. But not al be written in ruby, one of those chicken and egg things. C uses Assembler in this situation, we use Builtin functions. -Slightly more here : http://salama.github.io/2014/06/10/more-clarity.html (then still called Kernel) +Slightly more here : http://ruby-x.org/2014/06/10/more-clarity.html (then still called Kernel) The Builtin module is scattered into several files, but that is just so the file doesn't get too long. diff --git a/lib/typed/parfait/README.md b/lib/typed/parfait/README.md index 2d5349da..64e57ac8 100644 --- a/lib/typed/parfait/README.md +++ b/lib/typed/parfait/README.md @@ -9,8 +9,8 @@ And a large part of that functionality must actually be used at compile time too We reuse the Parfait code at compile-time, to create the data for the compiled vm. To do this the vm (re) defines the object memory (in parfait_adapter). -A work in progress that started from here : http://salama.github.io/2014/06/10/more-clarity.html -went on here http://salama.github.io/2014/07/05/layers-vs-passes.html +A work in progress that started from here : http://ruby-x.org/2014/06/10/more-clarity.html +went on here http://ruby-x.org/2014/07/05/layers-vs-passes.html A step back: the code (program) we compile runs at run - time. And so does parfait. So all we have to do is compile it with the program. diff --git a/lib/typed/parfait/object.rb b/lib/typed/parfait/object.rb index 4a75a3a1..ccc344e4 100644 --- a/lib/typed/parfait/object.rb +++ b/lib/typed/parfait/object.rb @@ -54,7 +54,7 @@ module Parfait # This is the crux of the object system. The class of an object is stored in the objects # memory (as opposed to an integer that has no memory and so always has the same class) # - # In Salama we store the class in the Type, and so the Type is the only fixed + # In RubyX we store the class in the Type, and so the Type is the only fixed # data that every object carries. def get_class() l = get_type() diff --git a/salama.gemspec b/rubyx.gemspec similarity index 75% rename from salama.gemspec rename to rubyx.gemspec index c0b8c244..bc564f41 100644 --- a/salama.gemspec +++ b/rubyx.gemspec @@ -8,10 +8,10 @@ Gem::Specification.new do |s| s.email = 'torsten@villataika.fi' s.extra_rdoc_files = ['README.md'] s.files = %w(README.md LICENSE.txt Rakefile) + Dir.glob("lib/**/*") - s.homepage = 'https://github.com/salama/salama' + s.homepage = 'https://github.com/ruby-x/salama' s.license = 'MIT' s.require_paths = ['lib'] - s.summary = 'Salama is a native object vm without any c, one day possibly a ruby vm' + s.summary = 'RubyX is a native object vm without any c, one day possibly a ruby vm' s.add_dependency "parser" , "~> 2.3.0" s.add_dependency "salama-object-file" , "~> 0.3" diff --git a/stash/soml/helper.rb b/stash/soml/helper.rb index 2d3269cf..624f49b7 100644 --- a/stash/soml/helper.rb +++ b/stash/soml/helper.rb @@ -67,7 +67,7 @@ module RuntimeTests return unless box = connected load_program file = write_object_file - r_file = file.sub("./" , "salama/") + r_file = file.sub("./" , "ruby-x/") box.file_upload file , r_file print "\nfile #{file} " return if dont_run diff --git a/stash/test_runner.rb b/stash/test_runner.rb index 9ab3b293..9cea3840 100644 --- a/stash/test_runner.rb +++ b/stash/test_runner.rb @@ -19,7 +19,7 @@ class TestRunner < MiniTest::Test def execute file string = File.read(file) - parser = Parser::Salama.new + parser = Parser::RubyX.new object_space = Register::Program.new "Arm" #TODO : files would have to include s-expressions now syntax = parser.parse_with_debug(string, reporter: Parslet::ErrorReporter::Deepest.new)