L
Lennon Day-Reynolds
Forgot to copy the list on this...sorry to anyone who was hoping this
thread would just die.
---------- Forwarded message ----------
Lothar,
Thanks for "weighing in." You're definitely right about many of the
corrections, but I also think there are a few places where we're just
getting mixed up on terminology (probably due to my admittedly
"amateur" knowledge of programming language implementation).
I'm confused that on the one hand, you would say that native libraries
and data structures are not the problem, and on the other that the
mixing of Ruby and C stack preclude serialization. I think of the two
as more or less equivalent -- use native structures and calling
conventions, and you're tied to that execution model.
(BTW, what is the correct term for the dumped image? "Heap image" was
the standard term used within the language implementation group I
worked for a few years ago, who included old Lucid Lisp core
developers, but it's possible I'm mis-using it.)
[...]
Sorry, I'm thinking in terms of Lisp, where code simply *is* a
special-case type of data. I'm curious as to what about the internal
representation of Ruby code objects is imcompatible with normal data
serialization methods -- is it just that the code isn't constructed in
a relocatable way?
[...]
See my contents above for my confusion on this point. I don't disagree
that freely mixing the Ruby and C stacks causes problems for global
persistence, but I do wonder how continuations are implemented in that
case. Are they just using setjmp/longjmp?
Again, my experience with Common Lisp and Scheme colored my
interpretation here; when generating an image, you actually *did*
specify a toplevel function to enter at start, though most had a
default setting of the REPL mainloop.
[...]
That's always the critical issue with major language implementation
changes; if you core API compatibility, you effectively create a new
language from the perspective of library authors.
I'm sorry; perhaps I got carried away in my earlier comments about the
amount of work involved in adding image-based persistence to the
existing Ruby runtime. I was thinking more of the overall object
model, not the nitty-gritty details of maintaining low-level
compatibility.
It doesn't seem quite as bleak as "needing a complete rewrite,"
though. There's even a precedent in "that other language". (i.e., the
Python core developers seperated the Python and C stacks so they could
implement generators).
Thanks for the additional information,
Lennon
thread would just die.
---------- Forwarded message ----------
Lothar,
Thanks for "weighing in." You're definitely right about many of the
corrections, but I also think there are a few places where we're just
getting mixed up on terminology (probably due to my admittedly
"amateur" knowledge of programming language implementation).
Hello Lennon, [...]
Sorry but here you miss the point, using file handles, DLL's and
native structure does not mean anything for implementing an image
based language (it's not a heap image by the way).
I'm confused that on the one hand, you would say that native libraries
and data structures are not the problem, and on the other that the
mixing of Ruby and C stack preclude serialization. I think of the two
as more or less equivalent -- use native structures and calling
conventions, and you're tied to that execution model.
(BTW, what is the correct term for the dumped image? "Heap image" was
the standard term used within the language implementation group I
worked for a few years ago, who included old Lucid Lisp core
developers, but it's possible I'm mis-using it.)
[...]
At the moment you can't dump methods and classes. So this would
require a lot of work. We are not talking about data persistence here.
Sorry, I'm thinking in terms of Lisp, where code simply *is* a
special-case type of data. I'm curious as to what about the internal
representation of Ruby code objects is imcompatible with normal data
serialization methods -- is it just that the code isn't constructed in
a relocatable way?
[...]
The current problem is the serialization of the program stack because
there native C function calls and ruby calls are mixed. Okay we could
dump only if there is nothing on the stack (which is the case when the
program exits normally), and return to a special "main" function on
the next start, but this is normally not that what you want in an
image based language.
See my contents above for my confusion on this point. I don't disagree
that freely mixing the Ruby and C stacks causes problems for global
persistence, but I do wonder how continuations are implemented in that
case. Are they just using setjmp/longjmp?
Again, my experience with Common Lisp and Scheme colored my
interpretation here; when generating an image, you actually *did*
specify a toplevel function to enter at start, though most had a
default setting of the REPL mainloop.
[...]
I think the technical implementation is not the difficult thing here,
its the current state of libraries.
That's always the critical issue with major language implementation
changes; if you core API compatibility, you effectively create a new
language from the perspective of library authors.
Oh yes, i implemented an LISP system in about 50000 lines of Assembler
code many many years ago. The core system, the VM, is not difficult to
write, but we would need a complete rewrite of Ruby.
I'm sorry; perhaps I got carried away in my earlier comments about the
amount of work involved in adding image-based persistence to the
existing Ruby runtime. I was thinking more of the overall object
model, not the nitty-gritty details of maintaining low-level
compatibility.
It doesn't seem quite as bleak as "needing a complete rewrite,"
though. There's even a precedent in "that other language". (i.e., the
Python core developers seperated the Python and C stacks so they could
implement generators).
Thanks for the additional information,
Lennon