I like 99% of this, and the thing I don't like is in the very first line of the example:
> import abs, epsilon from math
IMHO it's wrong to put the imported symbols first, because the same symbol could come from two different libraries and mean different things. So the library name is pretty important, and putting it last (and burying it after a potentially long list of imported symbols) just feels wrong.
I get that it has a more natural-language vibe this way, but put there's a really good reason that most of the languages I know that put the package/module name first:
import packageName.member; // java
from package import symbol; # python
use Module 'symbol'; # perl
With Typescript being the notable exception: import { pi as π } from "./maths.js";t
I really like the way Elm does it, from "wide" (package) to "narrow" (symbol). I suspect this also helps language server implementation.
See https://guide.elm-lang.org/webapps/modules (scroll down to "Using Modules") for examples
Do you think approaching the way typescript does it for Bolt is a reasonable compromise here? Bolt already supports full-module renames like
import math as not_math
So supporting something along the lines of import abs as absolute, sqrt as square_root from math
Would be farily simple to accomplish.According to the Programming Guide, it supports aliases for imports
"In case of conflict or convenience, you can give modules an alias as well."
Also autocomplete.
Though I almost never manually type out imports manually anymore.