Hacker News new | ask | show | jobs
by Taig 863 days ago
`import Y from X` is a terrible language design decision, established by the JavaScript ecosystem. It should be along the lines of `import X.Y` or `from X import Y` so that autocomplete tools can assist you.
4 comments

Aspects of the python lexer and parser implementation were borrowed from python, which is partly why we ended up here. I do agree though.
Python does from x import y though.
Yeah, I think we only allow import x from y for the minute. And because we don't have a language server yet, it wasn't obvious that it was an issue. That'll change soon when the server is up though!
Agreed, we need to flip this.
Disagree. I rarely remember what lib has the class/function/whatever I need. Doesn't help that some libs often use "proprietary" names (e.g. "Uno", "Avalonia", "Rotativa"). I often don't even write "imports" myself. I use stuff in code and let my IDE autoimport stuff.
Really? When I type import { someVal in JS, VSCode autocompletes it to import { someValue } from “somePackage”. I haven’t had issues here.