Skip to content
This repository has been archived by the owner on Jun 13, 2020. It is now read-only.

Handling Runtime Code #699

Open
kiljacken opened this issue Feb 14, 2016 · 4 comments
Open

Handling Runtime Code #699

kiljacken opened this issue Feb 14, 2016 · 4 comments

Comments

@kiljacken
Copy link
Member

@MovingtoMars said the following on IRC before I could ask him about it:

having the runtime stuff in the parser package isn't going to work

So I'm creating this issue both so I can ask him to explain why, and to discuss how to handle the runtime code in the future.

As he hinted at, the runtime code is currently stored in runtime.go in the parser package, which I know isn't optimal due to our package structure. Fx we can't do semantic checks on the runtime code atm because there is a dependency between the semantic checks and the parser, and thus we can't include the semantic checks in the parser.

Among changes that would alleviate this would be extracting the AST and the type system from the parser package to their own individual packages.

@kiljacken kiljacken added this to the bootstrap milestone Feb 14, 2016
kiljacken added a commit that referenced this issue Feb 19, 2016
@MovingtoMars
Copy link
Member

Ideally it would be package std::runtime that gets imported into the global namespace automatically, for things like Option<T> and Result<T>. string and rune can just be specified in the compiler, since they're used as types for literals.

@kiljacken
Copy link
Member Author

string and rune can just be specified in the compiler, since they're used as types for literals.'

there's no real need to do this though.

Also, I'm not sure if you've seen but I've moved loading the runtime module to cmd/ark, which should resolve any problems you might've found.

The main thing is how to handle locating the runtime (or even stdlib in general) without always having the user pass along the full path. If we ever plan to distribute ark via various package managers, we'd need a plan for this.

@MovingtoMars
Copy link
Member

string and rune can just be specified in the compiler, since they're used as types for literals.'

there's no real need to do this though.

I did this when moving Option to the runtime, because expect uses a string literal, so we had to have the string type already.

@kiljacken
Copy link
Member Author

👍 makes sense now that I see the purpose

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

No branches or pull requests

2 participants