Class BuiltinExternInterface

java.lang.Object
org.ek9lang.compiler.BuiltinExternInterface

public final class BuiltinExternInterface extends Object
THE fixed, machine-independent identity of EK9's own built-in types (the introspected extern module, org.ek9.lang): the logical name recorded on every one of its symbols' source tokens, and the classpath path of its bundled interface text. Hold one and use it; never re-derive either constant.

The defect this replaces (found 2026-11-15, packaging/macos/check-dmg.sh static check 3). Before this class existed, Ek9BuiltinIntrospectionSupplier built the built-in's CompilableSource with a plain relative name ("org-ek9-lang.ek9"), and CompilableSource#getGeneralIdentifier() turned that into a file: URI resolved against the CURRENT WORKING DIRECTORY (PathToSourceFileUri) — at BootstrapArchiveWriter's build time, compiler-main's own directory. Every symbol's source token then carried the BUILD MACHINE's absolute path (e.g. file:///Users/stevelimb/IdeaProjects/ek9/compiler-main/org-ek9-lang.ek9), serialised into the shipped BootstrapArchive — baked into every compiler and IDE jar, on every platform.

LOGICAL_SOURCE_NAME replaces that resolved URI: a constant, never resolved against cwd, the user's home or the build directory — identical whether the program came from a live bootstrap (LiveBootstrap) or the shipped archive (see BootstrapArchiveTest, which pins the two agree). It deliberately is NOT a file: URI, so nothing that decodes a source token's name as a filesystem path (org.ek9lang.core.SourceFileUriToPath) mistakes it for a real, readable file — the built-in's source lives only in memory, exactly as before.

RESOURCE is the classpath path of the plain EK9 interface TEXT that BootstrapArchiveWriter ALSO writes at process-classes, beside the serialised archive — so every jar that ships the archive ships this text too. The two are kept EQUAL, not structurally guaranteed equal: Ek9BuiltinIntrospectionSupplier is called once for each (once to write this resource, once inside LiveBootstrap to compile the archive's symbols), and their agreement rests on Ek9ExternExtractor's introspection being deterministic across calls — pinned, not merely asserted, by BootstrapArchiveTest.theBundledExternInterfaceResourceIsByteForByteWhatWasIntrospected. read() is how a door reads the bundled text. LOGICAL_SOURCE_NAME's suffix is exactly RESOURCE by design: a future LSP/IDE "go to definition" on a built-in (not wired yet — see docs/implementation/EK9_PACKAGE_RESOLUTION_ASSESSMENT.md §4.6, D-M6 step 2 = D-M7) strips the BuiltinSourceScheme.PREFIX scheme from a symbol's source name and is left with exactly this classpath resource, unambiguously.

  • Field Details

    • RESOURCE

      public static final String RESOURCE
      The classpath resource name of the bundled EK9 extern-interface text.
      See Also:
    • LOGICAL_SOURCE_NAME

      public static final String LOGICAL_SOURCE_NAME
      THE fixed, machine-independent identifier recorded as getGeneralIdentifier() on the built-in CompilableSource and, through it, on every one of its symbols' source tokens — in a live bootstrap and in the shipped BootstrapArchive alike. Carries BuiltinSourceScheme.PREFIX (held there, not duplicated here, so org.ek9lang.core.SourceFileUriToPath - which decodes it - and every module that must recognise it see the ONE definition).
      See Also:
  • Constructor Details

    • BuiltinExternInterface

      public BuiltinExternInterface()
  • Method Details