Commit Graph

231 Commits

Author SHA1 Message Date
Torsten a758d610d6 Merge branch 'master' of github.com:ruby-x/rubyx 2020-03-28 19:50:26 +02:00
Deepi Garg a04c27e1b0
Merge branch 'master' into master 2020-03-28 22:55:24 +05:30
Deepi Garg 9e0eca64e8
Update test_word.rb 2020-03-28 22:47:04 +05:30
Torsten 8dfcc0f5de add decent method to get the programs return to interpreter
only had such methods in tests, but they really belong in code
also adding fake values to true ,false and nil
2020-03-28 18:39:49 +02:00
chhavikirtani2000 2e3b614c92 review comments incorporated 2020-03-28 18:24:59 +02:00
chhavikirtani2000 fa28475b71 review comments incorporated 2020-03-28 18:24:59 +02:00
chhavikirtani2000 c477e90c45 implemented start_with along with tests 2020-03-28 18:24:59 +02:00
Deepi Garg bc04efadec
Added test for insert function 2020-03-28 20:04:59 +05:30
Torsten 62d8d92b50 restrict list index to integer 2020-03-22 14:31:43 +02:00
Torsten Rüger d1f8733623 Rename Vool to Sol
Simple is really the descriptive name for the layer
Sure, it is "virtual" but that is not as important as the fact that it is simple (or simplified)
Also objct (based really) is better, since orientated implies it is a little like that, but only orientated, not really it. Sol only has objects, nothing else
Just cause i was renaming anyway
2019-10-04 00:38:47 +03:00
Torsten Rüger fd8a3e9cc5 some cc driven cleanup
bit anoying that the builtin engine is used
Even it is not as well configurable as preferred reek.
Still, found one minor bug
2019-10-02 17:54:42 +03:00
Torsten Rüger 48e18ac9cd the superclass of a singleton class is the singleton class of the superclass
And i have tests to prove it!
That just rolls of the tongue, it had to be the commit message
2019-10-01 20:55:05 +03:00
Torsten Rüger 2dcb2a9a72 Introduce singleton types
Just for future, as this gives us a way to know immediately in the type, which represent normal, and which singleton classes
Also instantiate singleton class lazily (with singleton type)
This makes the type of class single, ie unique, immediately when it is used, ie methods or variables defined.
Fixes a design mistake, where all singletonn classes shared the same type, and thus unique methods per class were impossible
(Also some misc in commit)
2019-10-01 19:42:16 +03:00
Torsten Rüger ba83affd8c fix resolve issue
the typed method has to be created in the to_pafait pass for it to work correctly, ie for the sends to have something to call

also means that when during compilation creating (raising?) a  method, not only vool. but also callable has to be created
2019-09-29 22:37:28 +03:00
Torsten Rüger 17f87f7464 Starting to fix resolve mechanism
resolve had the wrong approach, sort of class based oo
It took methods from "derived" types and just used them
To be correct, those methods would have to be recompiled for the current type, rubyx is type, not class based.
Started on that, still soe strange hang though

Later, type and method analysis may reveal "compatible" types (down only off course) where one could use the exact same code, but that is phase 2
2019-09-29 12:06:37 +03:00
Torsten Rüger 1022390e0f check for redefining of methods and forbid
causing some test problems, but better that way (until it's done right off course)
2019-09-24 21:20:12 +03:00
Torsten Rüger 3df54910cc rename singleton_class to single_class and misc
was clashing with real ruby method name
also many superclass mismatch fixes
some misc
2019-09-24 17:25:19 +03:00
Torsten Rüger dd810cfc49 Make to_mom a 2 stage process
First baby baby step on the way to passes
Create all parfait objects in first pass, so methods exist to be resolved in second path
2019-09-24 15:44:33 +03:00
Torsten Rüger 7b9097a0b1 Fix word offset
which had weirdly been 1 off
(not weird that it was off, index bugs are common, but weird that the tests passed anyway)
2019-09-24 12:59:22 +03:00
Torsten Rüger a446d3da6b rename meta to singleton class
seems more appropriate, as it is the class for a single object
Also seems to be called that on the net (don't remember where the meta came from, but it's gone)
2019-09-24 12:59:22 +03:00
Torsten Rüger 66728f09f4 Fix meta_class, sis class instance variables and class methods
after some serious recursive thinking it now actually makes sense.
The key was to change the actual type of the class that the meta_class manages
For objects it's (still) ok just to change the instance_type, but since the class object exists and has type, when adding instance variables, that actual type has to change
2019-09-24 12:59:22 +03:00
Torsten Rüger 7b40bb9106 Fixing new parfait boot process
mostly about setting the types to existing objects. 
Then after space is in place, it is set automatically

also a fair bit of misc in the commit
2019-09-23 00:07:30 +03:00
Torsten Rüger e61c5d4a55 Simplify Parfait booting
Since some weeks, Parfait uses instance variables instead of generated attribute getters (that needed type)
This makes it possible to simplify the boot process, getting rid of separate boot Space and class versions.
It is still quite order dependent, but all "normal" ruby code, (less magic) so easier to understand.

Also moved all code that can never run at runtime into the adapter. This included Space and Object new, space as the space will only ever be created at compile time and object, since that is quite different at run-time (which is where i am working towards)
2019-09-22 19:10:47 +03:00
Torsten Rüger a496ea7e4b Derive Class and MetaClass from Behaviour
Finally! If i remember the module was from before i had any non Object superclasses
unified code, unified bugs :-) just makes sense
2019-09-21 18:50:33 +03:00
Torsten Rüger fd46826b9c Implement class instance variables
as they are just the type of the meta_class, that was relatively simple.
I feel this is what oo is meant to be, instance variables and methods for the objects, and since classes are objects, for them too.
Class variables seem like a design mistake, weird scoping rules and no data hiding (left as an exercise to the reader)
2019-09-19 15:48:27 +03:00
Torsten Rüger 38491d120b removed unused NamedList
args and locals got inlined into message, forgot to delete then
ripples out due to type creation
small type class api change, more ripples, but also more consistent
2019-09-18 22:07:05 +03:00
Torsten Rüger 7ee57f2b08 generalize get_main and get_init to get_method
to get at those know methods that really
__must__ exists, hence the bang, raise if don't
about to add method missing and raise to the list
2019-09-15 12:58:43 +03:00
Torsten Rüger 4bf23defc8 fix many tests with preloading
preloading, something akin to builtin, loads some very small predefined (macro) methods for the tests to work (ie call)
2019-09-12 22:27:26 +03:00
Torsten Rüger e33b9f565d some renames before main fixes commences 2019-09-12 13:10:31 +03:00
Torsten Rüger d82cedf4c0 Quite small amount of parfait tests needed changing after that
But something is amiss anyway, especially dynamic jumps
2019-09-09 20:29:18 +03:00
Torsten Rüger 7334e72458 Weird to be finding Parfait word bugs now
but index maths is also much easier 10th time around
2019-09-08 21:14:54 +03:00
Torsten Rüger 6811fc4174 fix interpreter to output symbols
which amazingly lets us get at classnames etc
2019-09-08 15:31:03 +03:00
Torsten Rüger 02261ad79d changing factory size per factory
Before it was one class variable, but ints and messages are not created in equal amounts.
2019-08-24 09:46:33 +03:00
Torsten Rüger 5e44e9caaf fix mom and vool after cc changes 2019-08-23 10:21:22 +03:00
Torsten Rüger 7ca3599c5a Fixed all after changing argument handling
arguments are now fully inlined into the message
locals next
2019-08-22 23:10:29 +03:00
Torsten Rüger 0a1b05b2ee Inline arguments into message
thus removing indirection for access
does affect rather much, several commits
2019-08-22 17:55:19 +03:00
Torsten Rüger 5dc8c046e7 increase binary_code size to 32
save a few jump, adds some size to binary
16 just seemed kind of small
2019-08-22 12:26:40 +03:00
Torsten Rüger d5d1df951c Block/Lambda rework done
recovered from all renames and redoing the block compilation
all green
2019-08-19 15:23:57 +03:00
Torsten Rüger 4c76ff3388 Remove Padded module
Parfait was depending on it, ie it created a dependency out of Parfait. But Parfiat needs to be self contained.
Moved 2 methods into parfait object, and resolved single call from text_writer to third.
2019-08-17 21:07:07 +03:00
Torsten Rüger aaf169ad8d Fixed almost all but Interpreter
150 only failing, seems only 1 bug though
and one in linker
2019-08-13 00:13:29 +03:00
Torsten Rüger 82c9f1d97f more and better tests
especially vool
2019-08-08 12:18:36 +03:00
Torsten fdb940e43f stashing 2019-07-22 15:21:16 +03:00
Torsten Ruger 5ed6a07083 better test for attr
still #25
2019-03-07 10:47:48 +02:00
Torsten Ruger 0ebb8e31c6 to_s for parfait list 2019-02-17 18:16:19 +02:00
Torsten Ruger e430701645 Using MetaClass to compile class methods into
still #24, still wip
2019-02-17 14:37:50 +02:00
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 86e3103543 More or less a stash 2019-02-12 22:41:42 +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 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