Skip to content

A Better Module System #42

@mehcode

Description

@mehcode
  • Check for absolute modules in ./arrow_modules
  • Check for absolute modules in ~/.arrow_modules
  • Check for absolute modules in $BIN/../lib

  • arrow --install git+<git url> — Clone and install to ./arrow_modules (same as npm)
  • arrow --uninstall <name>

  • Import module (relative to the current file)
import "./some_file" as module;
  • Import module (relative to an installed module path; resolved similar to node/python)
import "std" as std;
  • Shorthand for the above
import std;
  • Import one or more items from a module
from "./some_file" import a, b, c;
  • Import all items from a module
from "./some_file" import *;
  • Export a module (instead of importing it)
export "./other_file" as module;
  • Export one or more items from a module (instead of importing)
from "./some_file" export a, b, c;
  • Export all items from a module (instead of importing)
from "./some_file" export *;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions