On 2011-03-30, at 21:38 , chevalma@iro.umontreal.ca wrote:
Let me remind everyone that having only an "image dump" feature was a cause of problems for Smalltalk (according to Allen Wirfs-Brock, see his DLS keynote). That's why having a .exe (self contained executable) is important.
I have the slides but I'm not sure what you mean. I think the problem with Smalltalk is that programmers would have liked to distribute standalone, precompiled apps and couldn't really. This wouldn't be an issue for us.
Since we're advocating in favour of javascript outside the web, I wouldn't be so quick to dismiss this possibility.
One thing we should discuss as a team is the format of the image. Not only the layout of information, but also what the image represents (the whole heap, or just a section, such as the result of compiling a file). I believe two formats are required (a binary executable, and a custom file format that can be loaded in a running instance of Tachyon).
I believe there are two simple approaches:
- Dump only executable code. Have the compiler initialize itself at
startup. This would yield a smaller image file, but may be limiting in terms of dynamic recompilation. It may however be quicker to implement, and be advantageous in terms of cross-platform bootstrapping.
- Dump all allocated memory. This has the advantage that the compiler can
preserve lots of information about its own state for dynamic recompilation (e.g.: it's own IR), and be already initialized at startup. Not necessarily incompatible with approach #1.
Either way, I would implement it using an image file with a C image loader. Writing an actual ELF binary seems more complicated and less portable. Implementing a C image loader would be quick and simple.
IIRC, last time we talked about this Marc was arguing that reusing the standard OS tools for loading and linking is a good idea, partly because they don't have to be reimplemented and partly because they are optimized for speed. That being said, I'm in favour of supporting multiple formats in the backend (at least, leaving that option open for later).
Bruno