Commit Graph

1559 Commits

Author SHA1 Message Date
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
6811fc4174 fix interpreter to output symbols
which amazingly lets us get at classnames etc
2019-09-08 15:31:03 +03:00
a99abd7ad0 update gems, remove ssh 2019-09-08 13:44:51 +03:00
1a096110a8 basic require_relative (hack)
opted to hack require to be getting on
need require for the test helper
and the files in lib/parfait

General require mechanism would still be ok, but require_ralative means implementing file source, which needs to be dragged around. I'll make an issue
2019-09-07 22:13:53 +03:00
b13c19def3 cache booted functions
remove more redundant parfait boots
2019-09-07 17:56:06 +03:00
2c681bf2e5 Add mom boot options
and remove a lot of stale parfait boots from tests
(from before using rubyxc)
2019-09-07 16:43:47 +03:00
1539904ee2 Starting to parse parfait tests
will have to detour via require next
2019-09-06 21:02:09 +03:00
363d1cb36f fix module handling at ruby level
Was returning arrays instead of Statements, which messed things up
2019-09-06 21:00:37 +03:00
646797301e rearrange test helpers for later 2019-09-06 20:59:14 +03:00
f126aa52df Descope Parfait in the compiler
Compiler now removes the module Parfait scope
and also the ::Parfait:: Scope in module names
Which means we can compile scoped code
and get unscoped code. for Parfait
Handy for tests too
2019-09-06 13:59:33 +03:00
7d92ee9e6a add a statistics command to compiler
just to see how many objects make up a binary
2019-09-05 13:25:40 +03:00
91995dc1b3 make elf symbols optional
and default to false. Smaller executables  by at least half
also add option for compiler cli
2019-09-03 02:02:21 +03:00
160d860db2 using new macro approach for builtin, testing first 2019-08-26 09:24:06 +03:00
b9bdc55059 A good start on the macro idea
I call it macro because it lets you insert basically arbitrary risc code into the ruby level. The way it works:
Reserve namespace X
map any X.some_call to a Mom instruction
by the name SomeCall
which must take the same args in constructor as given
And obviously produce whatever risc it wants
Hoping to rewrite builtin around this idea (with the existing Mom builtn instructions)
2019-08-25 14:40:59 +03:00
c0a3c9b65c block version of loop
no debugging, just worked!
only about 10% slower, nice
also recording qemu-linux times, which are a lot faster(and double bonus, save the startup/syncing)
2019-08-24 17:00:59 +03:00
d3a0aa3d8e redid benchmarks with new options
especially calling did improve
also binaries don't get crazy big even for bigger heaps, because they are just ints
2019-08-24 16:03:35 +03:00
259edb51e9 adding parfait options to compiler
to make smaller binaries with larger integer heaps
also ran some benchmarks to see if it makes a difference
at least the binaries are smaller, calling also faster
2019-08-24 11:44:13 +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
4656ea8ffb fix all mom tests
still quite brittle, but easy to fix
2019-08-23 19:24:18 +03:00
4ca16e5f9a fixing most of the risc tests 2019-08-23 15:31:22 +03:00
50c172915e fixing most of the mom tests 2019-08-23 15:31:04 +03:00
5e44e9caaf fix mom and vool after cc changes 2019-08-23 10:21: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
017e7e2971 fix most of mom from calling changes 2019-08-22 22:56:44 +03:00
0c49612e5e vool working after message change 2019-08-22 21:24:02 +03:00
0a1b05b2ee Inline arguments into message
thus removing indirection for access
does affect rather much, several commits
2019-08-22 17:55:19 +03:00
c13d4fb017 Make builtin tests more stand alone
not relying on the whole boot process
easier to test basic when broken (like now)
2019-08-22 17:52:19 +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
57b0ad2c32 Fix super as statement
Super is a statement, a send really.
Not an expression (as maybe in c++)
The actual implementation will be a bit tricky, like raise, a bit of stack walking, but not impossible. Still, later
2019-08-19 18:48:13 +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
a722a4c285 Move vool block compilation into constant generation
When the lambda is passed as argument, it must be moved. This triggers the generation of a corresponding parfait object (as before, and as for other constants) but now also triggers the code build. The code being the constant as it were
Also some more name fixes from renames
2019-08-19 14:33:02 +03:00
3ddf2e3837 Redoing ruby block conversion
Since the block is actually a constant, it does not need assignment or special hoisting
Just use the send and stick the lambda in as last arg
2019-08-19 14:23:55 +03:00
f87526f86f Renaming Vool exppressions rightly
Class, Method and Lambda (was block) are expressions.
Just making things clearer, especially for the blocks (ahem, lambdas) is matters.
wip
2019-08-19 11:33:12 +03:00
ae16551ed0 Rename Vool Block to Lambda
Making the distinction clearer
Some fixing of previous (wip)
2019-08-19 10:40:22 +03:00
02807cf6f9 Rename Block to RubyBlock at Ruby level
The parser presents the whole call that defines the block as a block. And so does the Ruby layer, as we don't want to do processing in ast.
Just making it clearer, also Vool:: block will have to be renamed
2019-08-19 10:31:11 +03:00
4f3d117e40 Object dogfood, compiling parfiat to binary
Object is the first (obviously) Parfait object to parse and fully compile to binary.
No tests yet, but almost 500 lines of real world code with 17  methods, not bad
2019-08-18 20:41:49 +03:00
ee8927b059 Fix slot access for constants
Type access is allowed for any object, including constants.
Needed for parfait
2019-08-18 20:35:01 +03:00
5a80850975 still debugging travis (for arm tests) 2019-08-18 15:40:40 +03:00
6547b1608d Ok, any fail makes it go red, now i know
also making command configurable as they seem different on ubuntu (16?) 
than fedora 30 (and who knows where else)
2019-08-18 15:30:52 +03:00
02a4742cc2 Backticks raise exception, who knew
catching and tryig different exe name
2019-08-18 15:22:09 +03:00
c9d77a29b2 Running tests on binary through qemu (system, no ssh) 2019-08-18 12:39:23 +03:00
15d1c07a1c Remove dead code
some copy paste in creating full mom layer left dome unused (untested) 
code
thanks to code climate stats
2019-08-18 10:19:52 +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
ae7f31381b Fixing self type creation
When compiling a classs, we pick up all instance variables.
Now that conditions and returns can be calls, that was broken, now fixed
2019-08-17 15:58:27 +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
7c91a08d5b Fix vool assignments after call rework
also small fix for if and return, as they need to execute sneds and yields (not just sends), so testing for Call not SendStatement
2019-08-16 20:39:08 +03:00