{"id":"language--using-external","name":"Using and external declarations","owner":"yeho","package":"language","kind":"language","signature":"using package.path\nexternal thing Name { ... }\nexternal Function(...) { ... }","description":"using imports a dotted package path. external makes an eligible top-level declaration visible outside its package.","context":"Use using for a dependency you actually call and external only for the smallest intentional package API.","parameters":[],"returns":"","members":[],"tags":["cpu","external","language","packages","using","yeho"],"updated":"2026-09-09","source":{"repository":"yeho","path":"parser_core.cpp run and parseTopLevelCallableOrStatement; conformance packages.using-external"},"status":"stable","notes":["external applies only to top-level type, function, extern, or compute declarations.","The old export spelling is rejected. Use external."],"examples":[{"id":"complete","title":"Complete program","description":"Import real packages and expose a helper with external. The export spelling is unavailable.","code":"using dolphin.math\nusing dolphin.spatial3d\n\nexternal DistanceToGoal(Vector3 position) -> float\n{\n    return DolphinDistance3(position, Vector3(3.0, 4.0, 0.0))\n}\nConsole.Log(Text.From(DistanceToGoal(Vector3(0.0, 0.0, 0.0))))\n","tags":["cpu","language"],"run":"cpu-oracle","expected":null,"verifyRun":false,"manifest":"manifestVersion = \"2\"\npackage = \"api.example.language__using_external\"\nversion = \"0.1.0\"\nlanguageEdition = \"yeho-core-2026.1\"\n\n[app]\nkind = \"headless\"\n\n[[dependencies]]\npackage = \"dolphin.math\"\nversion = \"0.1.0\"\npath = \"../../../dolphin/packages/math\"\n\n[[dependencies]]\npackage = \"dolphin.spatial3d\"\nversion = \"0.1.0\"\npath = \"../../../dolphin/packages/spatial3d\"\n","verification":"type checked","sha256":"98f912cdab0de5fcc0c14912d44be2ed945722bc5903ce2585c82f0b48fbb874","checked":"2026-09-09","diagnostic":"","observedOutput":null,"checkedBackend":null}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=language--using-external","json":"https://demonhunterlabs.com/reference/items/language--using-external.json","markdown":"https://demonhunterlabs.com/reference/text/language--using-external.md"}
