Compile time resolution is important for a lot of functionality. Unfortunately, adding keywords for them pollutes the keyword space AND makes it harder at a glance to tell compile-time directives from runtime ones.
C2 already adds attributes using the @(...) syntax. There are roughly the following symbols available:
@ $ # ยด ~ ' `
My proposal is that we use the @ prefix, but I don't have a really strong opinion. Here are a few code samples:
@foo(); // expand macro foo
@sizeof(i32); // currently "sizeof"
@typeof(a); // return the type of a
@sizeof(@typeof(a)); // the size of a
func i32 do_something() @(inline)
$foo(); // expand macro foo
$sizeof(i32); // currently "sizeof"
$typeof(a); // return the type of a
$sizeof($typeof(a)); // the size of a
func i32 do_something() @(inline)
#foo(); // expand macro foo
#sizeof(i32); // currently "sizeof"
#typeof(a); // return the type of a
#sizeof(#typeof(a)); // the size of a
func i32 do_something() @(inline)
`foo(); // expand macro foo
`sizeof(i32); // currently "sizeof"
`typeof(a); // return the type of a
`sizeof(`typeof(a)); // the size of a
func i32 do_something() @(inline)
~foo(); // expand macro foo
~sizeof(i32); // currently "sizeof"
~typeof(a); // return the type of a
~sizeof(~typeof(a)); // the size of a
func i32 do_something() @(inline)
I think that nesting @ is a bit ugly looking though. Opinions?