rename phisol to soml
This commit is contained in:
@ -1,7 +1,15 @@
|
||||
## Notice of change
|
||||
|
||||
The stuff below, like the whole of Parfait, was written before soml. Ie before there was a seperate
|
||||
language to compile a higher language to. Soml is not so dynamic, could do without much of the
|
||||
ObjectSpace that is the core of Parfait.
|
||||
|
||||
So things will change. How will become clear when soml is finished.
|
||||
|
||||
### Parfait: a thin layer
|
||||
|
||||
Parfait is the run-time of the **vm**.
|
||||
To be more precise, it is that part of the run-time needed to boot ruby.
|
||||
To be more precise, it is that part of the run-time needed to boot soml.
|
||||
|
||||
The run-time needs to contain quite a lot of functionality for a dynamic system.
|
||||
And a large part of that functionality must actually be used at compile time too.
|
||||
@ -10,7 +18,7 @@ We reuse the Parfait code at compile-time, to create the data for the compiled v
|
||||
To do this the vm (re) defines the object memory (in parfait_adapter).
|
||||
|
||||
To do the actual compiling we parse and compile the parfait code and inline it to
|
||||
appropriate places (ie send, get_instance_variable etc). We have to inline to avoid recursion.
|
||||
appropriate places.
|
||||
|
||||
A work in progress that started from here : http://salama.github.io/2014/06/10/more-clarity.html
|
||||
went on here http://salama.github.io/2014/07/05/layers-vs-passes.html
|
||||
@ -25,31 +33,9 @@ It's too simple: just slips off the mind like a fish into water.
|
||||
Parfait has a brother, the Builtin module. Builtin contains everything that can not be coded in ruby,
|
||||
but we still need (things like List access).
|
||||
|
||||
#### Example: Message send
|
||||
|
||||
It felt a little stupid that it took me so long to notice that sending a message is very closely
|
||||
related to the existing ruby method Object.send
|
||||
|
||||
Off course Object.send takes symbol and the arguments and has the receiver, so all the elements of our
|
||||
Message are there. And the process that Object.send needs to do is exactly that:
|
||||
send that message, ie find the correct method according to the old walk up the inheritance tree rules and dispatch it.
|
||||
|
||||
And as all this happens at runtime, "all" we have to do is code this logic. And since it is at runtime,
|
||||
we can do it in ruby (as i said, this get's compiled and run, just like the program).
|
||||
|
||||
But what about the infinite loop problem:
|
||||
|
||||
There was a little step left out: Off course the method gets compiled at compile-time and so
|
||||
we don't just blindly dispatch: we catch the simple cases that we know about:
|
||||
layout, type instance variables and compile time known functions.
|
||||
Part of those are some that we just don't allow to be overridden.
|
||||
|
||||
Also what in ruby is object.send is Message.send in salama, as it is the message we are sending and
|
||||
which defines all the data we need (not the object). The object receives, it does not send.
|
||||
|
||||
### Vm vs language- core
|
||||
|
||||
Parfait is not the language (ie ruby) core library. Core library functionality differs between
|
||||
Parfait is not the language core library. Core library functionality differs between
|
||||
languages and so the language core lib must be on top of the vm parfait.
|
||||
|
||||
To make this point clear, i have started using different names for the core classes. Hopefully
|
||||
@ -57,8 +43,3 @@ more sensible ones, ie List instead of Array, Dictionary instead of Hash.
|
||||
|
||||
Also Parfait is meant to be as thin as humanly possibly, so extra (nice to have) functionality
|
||||
will be in future modules.
|
||||
|
||||
So the Namespace of the Runtime is actually Parfait (not nothing as in ruby).
|
||||
Only in the require does one later have to be clever and see which vm one is running in and either
|
||||
require or not. Maybe one doesn't even have to be so clever, we'll see (as requiring an existing
|
||||
module should result in noop)
|
||||
|
@ -5,21 +5,12 @@
|
||||
# It allows for access to those variables basically
|
||||
|
||||
# A Message and a Frame make up the two sides of message passing:
|
||||
# A Message (see details there) is created by the sender and control is transferred
|
||||
# A Message (see details there) is created by the caller and control is transferred
|
||||
# A Frame is created by the receiver
|
||||
# PS: it turns out that both messages and frames are created at compile, not run-time, and
|
||||
# just constantly reused. Each message has a frame object ready and ist also linked
|
||||
# to the next message.
|
||||
# The better way to say above is that a messages is *used* by the caller, and a frame by the callee.
|
||||
|
||||
# In static languages these two objects are one, because the method is known at compile time.
|
||||
# In that case the whole frame is usually on the stack, for leaves even omitted and all data is
|
||||
# held in registers
|
||||
#
|
||||
# In a dynamic language the method is dynamically resolved, and so the size of the frame is not
|
||||
# know to the caller
|
||||
# Also exceptions (with the possibility of retry) and the idea of being able to take and store
|
||||
# bindings make it, to say the very least, unsensibly tricky to store them on the stack. So we don't.
|
||||
# The better way to say above is that a message is *used* by the caller, and a frame by the callee.
|
||||
|
||||
# Also at runtime Messages and Frames remain completely "normal" objects. Ie have layouts and so on.
|
||||
# Which resolves the dichotomy of objects on the stack or heap. Sama sama.
|
||||
|
Reference in New Issue
Block a user