Skip to content

Allow the definition of external types in artic. - #36

Merged
m-kurtenacker merged 12 commits into
masterfrom
feature/extern_type
Nov 30, 2026
Merged

m-kurtenacker merged 12 commits into
masterfrom
feature/extern_type

Conversation

@m-kurtenacker

Copy link
Copy Markdown
Contributor

Relates to AnyDSL/thorin#183.

The syntax for these external types is type_ext <NAME> = { <Options> };, with <Options> being a List of string literals. Back-end support is required for these types to work; and the back-end will define how the type is being interpreted.

Syntax (for now): `type_ext <name> =  { <arg>, ... };` where the
arguments are strings that are passed through to the thorin backend.

The implementation of this feature depends on the backend. For now, only
C supports this feature, and only a single argument is supported.
`type_ext bar = { "foo" };` will cause thorin to emit `typedef foo bar;`.
The type (`bar`) is opaque to artic and thorin. This feature is mainly
intended to interact with external APIs, not to extend the artic
programming language as a whole.
@Hugobros3 Hugobros3 self-assigned this Nov 30, 2026
@Hugobros3

Copy link
Copy Markdown
Contributor

Note: we've changed the syntax of this such that the list of options is a mixture of types and values. The semantics are backend-dependent!

@m-kurtenacker
m-kurtenacker merged commit 6ac2158 into master Nov 30, 2026
0 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants