feat: add extern keyword and documentation #29
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/if/extern"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I think you can remove the
Implementation formatssection, since those details are really up to the compiler rather than being part of the language spec. You can add a sentence or something somewhere saying that extern functions can't be type-checked by the NC compiler so any issues during compilation will be reported by the compiler backend, since that seems to be the gist of that section, unless I'm misunderstanding it.@ -0,0 +39,4 @@The implementation file's extension selects the handler used by the compiler. This keeps `extern` independent of any one external format. A compiler may support `.etch` or other formats without changing NC syntax.The supported extensions are compiler-specific. A compiler must report an error when it does not support the extension in an external block. Paths without an extension refer to NC modules and are loaded with [`import`](../modules).I don't think that necessarily has to be true. The compiler should try to compile it regardless of what the path or extension is, and if compilation fails then it can report that error. But it's perfectly legal to have
without an extension and have
path/to/filenot be an NC file.@ -0,0 +41,4 @@The supported extensions are compiler-specific. A compiler must report an error when it does not support the extension in an external block. Paths without an extension refer to NC modules and are loaded with [`import`](../modules).Each format handler defines which NC types it can represent at its boundary. If a handler cannot represent a parameter or return type, the compiler must report the declaration as an error. This check applies to compound types such as structs and maps as well as builtin types.I don't really understand what this paragraph means.
LGTM