HigherOrderCO / Bend

A massively parallel, high-level programming language
https://higherorderco.com
Apache License 2.0
16.65k stars 409 forks source link

Modules, namespacing and overall dependency management #403

Open sam-goodwin opened 1 month ago

sam-goodwin commented 1 month ago
// file based
import { some_symbol }  from "./my/module.bend"
# FQN based
from my.module import some_symbol

The advantage of the file-based approach is that you can include multiple versions of the same package in a single program. This has been an advantage for the NPM ecosystem since it avoids some of the dependency hell problems seen in Python by allowing people to more freely upgrade versions downstream.

The advantage of FQNs is that it's familiar to Python developers which Bend seems to be targeting.

fzn0x commented 1 month ago

It depends on the module system later IMO.

I believe file based imports provides easy developer experience on major code editors and IDEs, since you can Ctrl + Left Click the file path.

developedby commented 1 month ago

We're not using cargo, we're making our own package manager. We'll be using something like version + fully qualified name for imports