-
Notifications
You must be signed in to change notification settings - Fork 236
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
Imports #58
Comments
I like how npm does it, but can't stand that hideous |
@ChristopherDumas This sounds great, I'm a fan of having actual functions that do imports. I like how you assign packages to variables manually in Node, but this could work well for Streem even if @naturalethic Agreed. While I don't dislike |
Also, if we made global scope an object, similar to javascript or lua ( |
I frequently mess around in node_modules when I'm hacking on contribs, so that's not my point really. Anything not going in the git repo should be hidden from my directory listing. |
@ChristopherDumas Hmm, sounds like an interesting idea. |
Like I said, I've written a small language similar to scala/python in ruby. That's basically how I wrote imports. Have a function exposed by the runtime to run other files, and then make sure the other files return an object, which is then assigned to the filename, without the extension. |
I am currently working on a package manager, and the next part, actually making it so that when you install a package, it goes into the include/import/require scope for streem. But we haven't even specified how that should work yet. I was wondering if anyone has any ideas?
My idea looks something like this:
It wouldn't be that hard to implement that once we have objects of some kind. Just use the interpreter to eval that file before the rest of the code is executed. And the assign the anonymous class that executing the file returns to the name of the file. I implemented a toy language called Bike in ruby that did it that way.
The text was updated successfully, but these errors were encountered: