Stream: compiler development

Topic: zig compiler - package-qualified module identifiers


view this post on Zulip Richard Feldman (Feb 12 2025 at 03:15):

I don't think the current parser supports this, but I'd like to allow package-qualified module identifiers - e.g. so that instead of basic-cli's Hello World needing to do this...

import cli.Stdout

main! = |_args|
    Stdout.line("Hello, world!")

...it can do this:

main! = |_args|
    cli.Stdout.line("Hello, world!")

view this post on Zulip Richard Feldman (Feb 12 2025 at 03:16):

these should be unambiguous, because lowercase.Uppercase. is never a valid record because you can't have an uppercase record field

view this post on Zulip Sam Mohr (Feb 12 2025 at 03:21):

So no need to write an import for cli here?

view this post on Zulip Richard Feldman (Feb 12 2025 at 03:26):

right, it would be optional

view this post on Zulip Lucas Rosa (Feb 12 2025 at 04:12):

yea that's nice, in Elixir all modules are available at all times in any scope by their full name without top level imports in a module definition

view this post on Zulip Anthony Bullard (Feb 19 2025 at 23:08):

I like this change, even if it makes ident chains more complicated


Last updated: Jul 06 2025 at 12:14 UTC