Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(compiler): Enable single-file compilation #2105

Open
wants to merge 1 commit into
base: oscar/gro-linking
Choose a base branch
from

Conversation

ospencer
Copy link
Member

@ospencer ospencer commented May 4, 2024

Refactors the DependenciesCompiled, ObjectsLinked, Compiled, and Assembled states out of compile.re and introduces the grainc flag --single-file to compile a single dependency. The linker is now completely separate from the process of compilation—compiling a file now only means converting source code into an object file. Linking is the combining a number of object files into a wasm file (and grainc will still do both compiling and linking). This allows build tools to handle compilation and linking separately.

The future plan is to make single file mode the default once we have a build tool managing building projects (silo). I'm not sure that we should get rid of the dependency compilation entirely since it would be useful for development, but that's a decision for later.

@ospencer ospencer self-assigned this May 4, 2024
@ospencer ospencer marked this pull request as draft May 4, 2024 00:43
@ospencer ospencer force-pushed the oscar/gro-linking branch 2 times, most recently from 92e6423 to 89fcb11 Compare May 4, 2024 16:15
@ospencer ospencer force-pushed the oscar/dependency-refactor branch 3 times, most recently from b9bfd14 to 7039e88 Compare May 9, 2024 21:26
@ospencer ospencer marked this pull request as ready for review May 10, 2024 01:35
Copy link
Member

@marcusroberts marcusroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read this all through, it made sense, code was clear, LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants