RockstarLang / rockstar

Home of the Rockstar programming language
https://codewithrockstar.com/
GNU Affero General Public License v3.0
6.88k stars 223 forks source link

Define syntax of import paths #319

Open Prime541 opened 2 years ago

Prime541 commented 2 years ago

This discussion follows the pull request 314

Featuring LIBRARY PATH AND NAME What syntax would you like for the LIBRARY PATH AND NAME part?

Personally I like the 's because it looks English, however the grammar should not be ambiguous with the current is assignment contraction. Also having some more aliases would avoid having 's repeatedly in longer paths.

I don't really like, for security reasons, allowing the code to include anything from anywhere. Thus I would ban absolute path /blabla and random locations ../other. Instead I would limit the search, like in Python, to the relative children directories child/grandchild/library and the default locations listed in a ROCKSTAR_PATH environment variable. The implementation would search in order: in the directory of the currently executed (or imported) file, then in ROCKSTAR_PATH, then in an implementation dependent location which would contain the standard library followed by other implementation specific libraries.

What do you think?