Commit Graph

2650 Commits

Author SHA1 Message Date
Torsten Ruger
3db7707614 Get a basic MetaClass going
Does get created in new, but not in boot.
Also not yet used in compiling
2019-02-16 23:24:16 +02:00
Torsten Ruger
2fbea82039 bring class methods down to mom
not functionally correct, still compiling into class, not metaclass
part of #24
2019-02-16 17:54:45 +02:00
Torsten Ruger
40581494de class Methods down to vool #24 2019-02-14 19:24:12 +02:00
Torsten Ruger
86e3103543 More or less a stash 2019-02-12 22:41:42 +02:00
Torsten Ruger
37571a0ff9 Add ruby class methods
Ruby parser and ruby level for #24
2019-02-12 22:36:37 +02:00
Torsten Ruger
403540b3ca slightly better messages for unsupported ruby
Very slightly unfortunately, just just enought to find the error.
Also testing what is unsupported, so it's documented.
2019-02-10 21:02:16 +02:00
Torsten Ruger
d24b6ee153 start writing parfait witout the module
Parfait classes must be unscoped. Now we start parsing Parfait, it must be without the module.
Luckily module_eval makes this a breeze.
Also remove string interpolation that is not yet processed
2019-02-10 21:00:25 +02:00
Torsten Ruger
a89301d623 finally creating less objects in the test
basic still #23 , now applied
Basic size of 20, interpreter gets 50 and the full set is 1024

Tests run more than twice as fast!!
2019-02-09 12:44:35 +02:00
Torsten Ruger
37eeb81f45 fix all tests for previous commit 2019-02-08 23:03:23 +02:00
Torsten Ruger
74b790250a use class variables instead of globals
and set page size from new argument
This closes #23 , though ripples will follow
2019-02-08 23:03:08 +02:00
Torsten Ruger
d777b4fa88 fix travis (try 1) 2019-02-07 19:05:06 +02:00
Torsten Ruger
8d3a1954fa close #21
Mostly replaced Fixnum with integer
also in the rx-file dependency
all travis and testing with 2.4+
2019-02-07 18:24:35 +02:00
Torsten Ruger
51eff62931 Very basic cli to compile ruby files
Off course this is basically a cross compiler and the files
have to be transferred to an arm machine (and fixed as per note)
close #22
2019-02-07 11:07:57 +02:00
Torsten Ruger
e634781d6c upgrade ruby and include thor in general 2019-02-07 11:05:40 +02:00
Torsten Ruger
4d30727811 test and last fixes for previous commits (allocalte ints)
mostly just fixing the additional instructions
close #20
2018-11-24 22:40:22 +02:00
Torsten Ruger
e6615d0a6a remove the old add_new_int and calls
last orrurences in syscalls replaced, 2 variants
- exit does not actually need the int
- all else, preallocate the int beforehand and in syscall assume the reg name (integer_tmp)

test missing
2018-11-22 09:16:56 +02:00
Torsten Ruger
a8d1f070f1 replace add_new_int in most builtins
in integer and word mainly, replaced with allocate_int
(tests pending as syscalls are undone)
2018-11-21 20:29:22 +02:00
Torsten Ruger
bbb7dbef75 First part of int allocation
implemented allocate_int
instead of add_new_int
2018-11-21 11:12:39 +02:00
Torsten Ruger
5015a11108 function docs improvements 2018-11-14 12:41:13 +02:00
Torsten Ruger
fb6a1a0e01 fix the statement moming 2018-11-02 17:27:46 -07:00
Torsten Ruger
4ff84133d2 add append to MomCompiler
also lazy init boot_function, so that compilers can be added up
before going to translate, where the boot_compilers are used
2018-11-02 15:54:30 -07:00
Torsten Ruger
1377bda641 combining sources at vool level
using ScopeStatements
(those unfortunately don't go to_mom)
2018-11-02 12:36:23 -07:00
Torsten Ruger
52f6f1eaa8 cleaner interfaces for rubyXcompiler
store the vool
seperate api for ruby -> X and stored vool -> X
2018-11-02 12:19:13 -07:00
Torsten Ruger
87fc91cd5c start to integrate sources 2018-11-02 11:57:54 -07:00
Torsten Ruger
6606593169 add parallel testing possibility
3 time speedup on 8 cores, 2,5 on 4. with

NCPU=8 RUBYOPT=-rminitest/parallel_fork ruby test/test_all.rb
2018-09-07 16:08:53 +03:00
Torsten Ruger
7fc104a019 Use minitest-profile to find long tests
Only found one big fibo
All else due to large amount of objects
(now with factories it jumped from hundreds to thousands)
2018-09-02 13:58:42 +03:00
Torsten Ruger
8a81d41d5e Move booting to RubyXCompiler init
Also pass the source into the compile method.
This way compiler can be reused for subsequent compile.
Does remove some double boots, but no major time save
2018-09-02 13:57:19 +03:00
Torsten Ruger
d73e1526cd Some docs and to_s testing
somewhat code_climate inspired
2018-09-01 15:54:25 +03:00
Torsten Ruger
2bb6ad5f61 remove unused code
Arrays and Hashes have to resolve to object creation calls
Not to constants. In the future off course
2018-09-01 15:14:07 +03:00
Torsten Ruger
f798173a09 change to_risc and builtin code according to last commit
Wherever space was loaded to get to the next_message
we now load the Message factory.
Otherwise much the same, only the attribute is next_object, not next_message
The binary is growing with 1k objects per factory, so i had to fix (hack) arm to handle bigger constants
close #14
2018-09-01 11:28:53 +03:00
Torsten Ruger
d964e9ea9d let spce keep the messages in a factory #14
Like Integers and addresses before, messages are now in a factory
Factories keep allocated (uninitialised) objects, had to make init public to call it
2018-09-01 11:24:16 +03:00
Torsten Ruger
0a390cc5a9 shaves an instruction off resolve_method
by loading nil directly,  not space first
2018-09-01 11:20:59 +03:00
Torsten Ruger
c3b026a180 expand constant load
slightly hacky, but in good tradition
previous implementation only worked until 16 significant bits, which is getting to little
this one just keeps adding more instructions to arrive at the constant by force
There are surely cleverer ways of doing this, ie by using the barrel shifter
A start on #15, admittedly a hack
2018-08-31 23:28:31 +03:00
Torsten Ruger
b2339dc330 fix address nil values 2018-08-30 16:38:00 +03:00
Torsten Ruger
dc12c1d70b add the addresses from labels as constants 2018-08-29 21:06:29 +03:00
Torsten Ruger
ea7f3c9653 remove the last_object from chain
also tried to keep the first around as was done in space
partially to not have to add the consrtants seperately
didn't work, as chain gets broken
also this has to be redone anyway
2018-08-29 21:05:54 +03:00
Torsten Ruger
c983dcf0eb move return address generation to factory
removes the list from space
adds a ReturnAddress factory instead
and uses these throughout
2018-08-29 21:02:49 +03:00
Torsten Ruger
f993ccefe3 litte bit of docs 2018-08-24 18:49:44 +03:00
Torsten Ruger
71ab369c71 use factory to generte intergers in space
start with just integer factory in space
change all the hand-out code
still #14
2018-08-24 18:49:21 +03:00
Torsten Ruger
d396da16e3 start with #14 by implementing factory
page was maybe a too low level name
pages may be the unit of the syscall, but after that objects desolve (maybe later to be added on from different pages)
Factory has the job of handing out a new instance of a type
it keeps a freelist for that and a reserve
2018-08-23 19:55:06 +03:00
Torsten Ruger
9687d6611f avoid adding risc instructions twice
that causes loops in the chain
infinite loops in the code that are hard to debug
closes #11
2018-08-19 17:29:04 +03:00
Torsten Ruger
f85fe8a2cb fix bug in slot_load and definition
move parfait helper for reuse
2018-08-19 15:36:51 +03:00
Torsten Ruger
253d2fead8 change all to_risc functions to add directly
still #11
test not working yet
2018-08-19 13:18:25 +03:00
Torsten Ruger
57dc6c45bb remove the code_builder
this is core of #11
rename compiler_builder to just builder
and change all builder uses to use that
some test change as code is not returned anymore
2018-08-19 13:16:07 +03:00
Torsten Ruger
b294208025 continue with #11
slots are the most tricky, especially testing
2018-08-19 13:06:00 +03:00
Torsten Ruger
047a36178f start with #11
by adding striaght to compiler
2018-08-19 12:56:44 +03:00
Torsten Ruger
5b2c7745fe move the methods test to mains
previous commit made the mains tests more general
this joins methods tests here
so we can run them on arm too
fix #11
2018-08-18 20:06:15 +03:00
Torsten Ruger
80264c5322 mains tests can include any code
not wrapping as main anymore
(must still include mains)
first part of #11
2018-08-18 19:42:14 +03:00
Torsten Ruger
233b83510f fixed some disabled tests 2018-08-17 22:43:17 +03:00
Torsten Ruger
176b12d896 last two to_risc converted to builder
no change of tests, good sign
2018-08-16 20:28:42 +03:00