Commit Graph

355 Commits

Author SHA1 Message Date
aa9fc8bc81 More rename cleanp 2019-10-03 21:07:55 +03:00
c43436f35a Change Mom to SlotMachine
rather large commit, but essentially a simple rename
Rationale in docs and blogs
2019-10-03 20:55:41 +03:00
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
dcbc3e17be refactor risc_collection
move code that operates on compiler to the compiler class
this leaves the collection thin, very thin indeed
2019-09-28 15:37:02 +03:00
2eb9364283 make mom:method_compiler a list
Compilers forms alist by Util::CompilerList
Change Collection to use the list instead of array
2019-09-28 12:41:38 +03:00
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
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
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
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
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
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
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
1e2c4d6678 More tests and compiling parfait object 2019-09-19 17:41:26 +03:00
b0d1948800 Moving space to object class
away from Parfait module, as that gets collapsed
Leaving shortcut outside parfait for now
2019-09-18 22:36:56 +03:00
f13e8b3bd7 A little work on test times
They have been rising of late, installer reporter to check 8and keep checking)
tweaking of cli parameters 
removed redundant interpreter tests
2019-09-18 13:36:29 +03:00
e56db0a3ac get method name out from method_missing 2019-09-17 20:18:00 +03:00
d58ed8e5e8 remove dead code that was produced 2019-09-17 16:08:49 +03:00
5ab021de5a Continue testing mom instructions
especially with the custom asserts, gadda say
mesa lika disa
2019-09-15 18:31:10 +03:00
d913bb01de use method missing in resolve method
not just exit
try to print name next
2019-09-15 15:13:11 +03:00
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
b36ba42990 Test complied parfait tests
this makes it obvious that we need a working raise
and a correct method_missing, so we can diagnose the 
resulting errors
2019-09-15 12:18:31 +03:00
12b29285d7 Lots of preloading for tests
so many relied (implicitly( on some builtin function
after all can't do much in ruby without calling
Now all those dependencies are explicit
Small risc changes come because the macro version has a return label and unreachable label
2019-09-13 14:07:12 +03:00
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
616dd3487c renaming mom builtin to macro 2019-09-11 20:33:49 +03:00
2c4f040654 starting to move builtin into parfait
single object method for now
little framework next
2019-09-10 20:40:41 +03:00
feeb9332a2 cleaning 2019-09-10 16:21:13 +03:00
72643ebb08 Fix last parfait bug
missing return statement (duh)
2019-09-10 14:49:02 +03:00
63323376e4 use more instances in parfait
and misc
2019-09-10 12:33:57 +03:00
0ae7c5d8aa hacking method not found
was using exit, since raise is not implemented. This was ambiguous as all programs exit.
Using :died as special kernel code and bending it, and reporting it in interpreter.
2019-09-09 11:47:37 +03:00
b13c19def3 cache booted functions
remove more redundant parfait boots
2019-09-07 17:56:06 +03:00
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
86b27ab319 CC change test fixes finished 2019-08-23 19:25:02 +03:00
4ca16e5f9a fixing most of the risc tests 2019-08-23 15:31:22 +03:00
ec1e8c8f3a Fix risc layer from cc changes 2019-08-23 10:20:39 +03:00
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
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
0e694a38f7 Implicit returns for class methods
gets us parsing of parfaits second file data_object
2019-08-19 15:56:15 +03:00
d5d1df951c Block/Lambda rework done
recovered from all renames and redoing the block compilation
all green
2019-08-19 15:23:57 +03:00
5a43cbff15 Fixing tests for implicit return
previous commit affected rather many test, as the implicit returns add extra instructions
Also added some explicit returns, so as not to test the return logic too much. return (ie return nl) is a knonwn 3 risc operation.
2019-08-17 23:29:42 +03:00
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
d3f3c91ae5 Fix all but one test
Riples upon riples. The one left looks like the genuine article
2019-08-16 21:43:54 +03:00
b2260d856d And we are green again
After having over 600 failing tests at one point, this does feel good.
Even better, most of the risc/interpreter tests where i didn't change anything came gree without changing the tests. ie we have binary compatibility.
2019-08-14 11:11:26 +03:00
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
9474932320 fixing risc collection tests 2019-08-12 16:12:17 +03:00
fa0aa30386 Move builtin wholesale to Mom
Since Builtin generates risc, just like mom instructions, it was a design mistake to put builtin into risc in the first place. Now that borders are coming more into focus, it make much more sense to have the builtin in mom.
In fact the instructions should be moved out and a seperate invocation mechanism used , so functions can be parsed, not generated (wip)
2019-08-12 12:38:29 +03:00
2326081161 Now booting all original methods
Just need to refactor now
2019-08-12 11:31:47 +03:00
91ddae2251 Start to convert integer operations
All apart from operators, which are its own thing
2019-08-12 11:08:09 +03:00
97488c4e5b Transform builtin word functions
according to same schema
2019-08-12 10:45:07 +03:00
3282e0ae06 transformed object builtins 2019-08-11 20:36:10 +03:00
0725f02e9a starting to fix builtin
start at Object get_interna_word
using the pattern to replace the whole risc method with a single mom instruction. Copying the original risc code into the instrucitons to_risc
also adding some very basic tests
2019-08-11 14:31:00 +03:00