c4-project / c4t

Runs concurrent C compiler tests
MIT License
1 stars 0 forks source link

Idea: merge compiler and runner in machine node #38

Open MattWindsor91 opened 4 years ago

MattWindsor91 commented 4 years ago

Here's a slightly left-of-field idea: now that we have a stack machine that runs compile instructions, why not make running the binary one of those instructions?

This would involve something like:

Why would we do this?

1) Makes it easier to support recipes that don't need to run binaries later on (I'm thinking Herd recipes that just simulate the C, at this stage - in these, the lifter does all the work and the recipe would just need to parse the results from a file); 2) Makes the machine runner a bit more uniform, instead of being two separate concerns packaged into one binary; 3) Makes things like 'disable compilation' or 'disable running' generalise quite nicely; they'd instead become 'only dry run instructions of this kind', or maybe 'don't do compilation if the file requested already exists'.

This would need a fair bit of work in terms of the plan, as there's a distinction between compiler results and run results, but in the multi-stage world this probably needs to be cleaned up anyway, and I'll think about filing a separate issue.

MattWindsor91 commented 3 years ago

Here's a possible scenario for this: