Commit Graph

36 Commits

Author SHA1 Message Date
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
b13c19def3 cache booted functions
remove more redundant parfait boots
2019-09-07 17:56:06 +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
Torsten Ruger
37eeb81f45 fix all tests for previous commit 2019-02-08 23:03:23 +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
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
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
520dc7b41f remove ad_transfer in save_message
towards removing all add_
change to set_builder and chaining in reg values
2018-08-14 20:08:58 +03:00
Torsten Ruger
37461a1727 add the ! syntax to create variables in builder, fix #8
now a variable has to be created before being used
thus it is save to develop contracts where a certain name
must exist in the scope
Maybe the syntax starts getting a bit weird, but at least the ! is a common symbol in ruby
2018-08-14 19:39:46 +03:00
Torsten Ruger
c9d8f750e5 extend type inference for dsl
and finally test it
2018-08-06 10:11:12 +03:00
Torsten Ruger
f31d22d901 use real type in register, not symbol
this has some more consequences, upcoming
2018-07-15 15:16:12 +03:00
Torsten Ruger
9005513368 rename typed_method to callable_method
seems to make the essence clearer
also extracted base class
2018-07-07 09:11:09 +03:00
Torsten Ruger
4b33d1c056 fix many a test especially whole mom
but some positioning bug still in there preventing
binary to work
2018-07-02 17:01:07 +03:00
Torsten Ruger
1132309f6a unify space collection attribute naming
currently space is still acting as a sort of memory manager.
For proper linking, all objects must be reachable from space, hence the plural versions like messages and addresses (even they are instances, it is the list that is important)
To dish out instance to use, the head must be kept, ie next_XXX for intergers, return addresses and messages
2018-07-02 15:49:51 +03:00
Torsten Ruger
c947c27a14 clean up booting
many machine boot became obsolete
or just neede parfait to boot
actual linker functionality pending
2018-07-01 14:12:42 +03:00
Torsten Ruger
05669065ca back to method_compiler
it is what it is
2018-06-30 23:26:28 +03:00
Torsten Ruger
46d8f5002f hoist parfait boot out of the machine boot 2018-06-30 00:39:23 +03:00
Torsten Ruger
6bd01fd55f rename method_compiler
in line with other compiler XX_Compiler being the compiler for that layer
remove type from compiler as it is in method available
2018-06-29 14:48:52 +03:00
Torsten Ruger
86b1edb40c add seperate builders
remove if with polymorphism for different builders
(easier to understand by naming)
2018-06-29 13:27:57 +03:00
Torsten Ruger
d50893bb0f rename risc_value to register_value
almost to register, but it still carries that value
2018-06-29 11:39:07 +03:00
Torsten Ruger
8322fca7b3 give labels an integer that will end up being the position at runtime
Since integers are first class objects, we need to use an integer object
as the return address. The actual address can not be stored in an
instance variable since it is not an object.
The address is unique to the label and never changes after positioning
(using the int is next up)
2018-05-29 20:26:00 +03:00
Torsten Ruger
059ff4a868 pass a source into the builder
for debugging
2018-04-18 19:12:30 +03:00
Torsten Ruger
9867234c38 move most code from method_compiler to builder
rather use builder in two ways, than sometimes compiler and sometimes
builder
Also makes it possible to reuse builtin code in mom’s to_risc, as both
use builder. The builtin code by directly adding to compiler, the mom
code not.
2018-04-08 18:51:20 +03:00
Torsten Ruger
c30e461385 add operator to builder
just minus for now, easily extended
2018-04-08 01:01:24 +03:00
Torsten Ruger
5d4b9d4834 add branches to builder 2018-04-08 00:50:51 +03:00
Torsten Ruger
695ae5ad99 add label generation to builder 2018-04-08 00:39:35 +03:00
Torsten Ruger
26cf911a5c change build names a little and document 2018-04-07 22:35:40 +03:00
Torsten Ruger
db55ec3fd6 slightly changing built return logic
very tempted to add immediately, but bigger change
2018-04-07 00:35:54 +03:00
Torsten Ruger
1ddbde1191 return single message for "message" ie r0
other names, like next_message allocate  a new register
2018-04-06 22:54:54 +03:00
Torsten Ruger
22409c93ee remove >>, consistent use of <<
makes code easier to read, like assignments
does remind of Passengers
2018-04-06 22:40:58 +03:00
Torsten Ruger
c042dd9faa allow reverse syntax for >> (ie <<)
slot >> reg makes sense, being a slot_to_reg
but . . .
consistently use of << (as meaning assignment , =) also makes sense
allow both and let time tell which makes more sense
2018-04-06 21:05:26 +03:00
Torsten Ruger
c02576b239 reuse dished out names
so they become like variables
2018-04-06 20:55:21 +03:00
Torsten Ruger
cae5e323ec add reg to slot 2018-04-06 20:21:14 +03:00
Torsten Ruger
88dbc7c84f slot to reg for builder 2018-04-06 16:35:27 +03:00
Torsten Ruger
44d661fe56 progress on the builder front
mainly tests for now
2018-04-06 14:54:24 +03:00
Torsten Ruger
e396807ee5 start work on dsl
so i can read my own code
2018-04-06 14:21:38 +03:00