Glint Design Blog 000

THERE IS ONLY EVER A MAXIMUM OF ONE GLINT PROGRAM.

THERE IS ONLY EVER A MAXIMUM OF ONE INSTANCE OF EACH GLINT MODULE.

A Glint program (currently) implicitly accesses the global scope.

mod.g:

module foo;
export foo :: 69;

exe.g:

import foo;
foo;

I think Glint source code should not have access to the global scope. To use an external symbol, i.e. one defined in C, declare it in your program as external!. This causes issues with current symbol resolution algorithm, as functions and such are defined only in the global scope—this should be rather fixable, though.

I guess, what I'm saying is that the only valid identifiers at the top level should appear in the file it is used in.

In the example above, it is clear that anyone reading the file would assume (and reasonably so), that foo; refers to the imported module, not some variable that module happens to export…

Explore Similar Posts Through Tags