Tiny C Compiler can be embedded into other C programs and compile and run code dynamically. It should be pretty easy hook up PhysicsFS so that tcc can read the source from that archive. We could use .hate files with main.c and other source code along with all resources. From what I understand, tcc compiles really fast, so I don't think loading time is a problem except for really huge projects.
To run a .hate file, you would obviously need Hate installed. Hate would come with a standard set of libraries very similar to the way LÖVE does. The Hate tool would be capable of compiling a .hate into a stand-alone binary for the current platform. People will not need Hate installed to run the resulting binary.
There could also be a webpage where you submit your .hate file, and builds for all platforms appeared after a time, submitted by volunteers (semi-automatically by the hate binary?).
Code: Select all
/**
* Imaginary Hate code. Yes I realize this is just mimicing SDL.
* This example is 2D only, but I do not rule out 3D support as
* a possibility.
**/
#include <hate>
int main(int argc, char ** argv)
{
static hate_Event e;
hate_Image * image;
hate_init(argc, argv);
hate_setdisplay(800, 600, 0);
// Load.
image = hate_newimage("hello.png");
while(1)
{
while(hate_pollevent(&e))
{
switch(e.type)
{
case HATE_QUIT:
hate_quit();
return 0;
}
}
hate_clear(); // Clear screen.
hate_drawimage(image, 0, 0); // Draw the image.
hate_present(); // Presents on screen.
}
return 0;
}
Ok, I'll stop now, while it's still under the threshold of tl;dr. I realize that I haven't really asked any questions in this post, I'm just checking if someone finds this interesting. Hopefully I can supress my urge to find out whether I can pull it off or not so I can focus on LÖVE.