-
Notifications
You must be signed in to change notification settings - Fork 2
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
core: make SourceMap
static + module import improvements
#960
Conversation
I wonder if |
I think it depends on what we want to do with it. It isn't as widely used across the compiler as the Not strictly related but:
|
A couple of points:
|
This doesn't necessarily mean it should be static; if we make it static we are just moving the issue forward and can use the same logic to argue that the workspace should be static too. So maybe we could stop at the source map. Or we could make the whole workspace static. I think anything in between doesn't make much sense.. |
My dream is to make the workspace a kind of "user" facing API which enables you to essentially configure a compiler to do the kind of work you want it to do, e.g. a workspace that builds an executable, or a library, a test suite, etc. For example, you could in a build script do: main := () => {
// Create a main workspace.
w := Compiler::create_workspace();
w.set_entry_point("src/main.hash");
w.set_exe_output("out/main");
w.build();
// Create a testing workspace.
w := Compiler::create_workspace();
w.set_entry_point("tests/main.hash");
w.set_exe_output("out/main-tests");
w.build();
} Perhaps it would make sense to detach |
I think to have that interface, at this point, this API would need to separately invoke |
Yeah the workspace would effectively spawn a new compiler instance, and run separately from the other workspaces and perhaps the build environment too. |
In that case, surely the workspace itself could be made static too. (I mean the |
Yeah it probably would mean to make the workspace static too. |
I think this can be done later though, it's not a need-to-do right now task I think. |
#dump_ast
directivetree.rs
intohash-ast-utils
hash-fmt
intohash-ast-utils
SourceMap
staticcompiler_note!
tonote_on_span!
&Path
from mod-def due to source map being accessibleImportExpr
by storing importSourceId
over resolved pathTodo
#dump_ast
and re-organise AST printing code #957 should be merged first