Replies: 3 comments
-
|
ableC-contracts: On declarations: On definitions: These would get transformed to something like (when building with contracts; we'd probably want something like It might make sense for whoever implements this to read thru the discussion about C++'s contracts proposal; I'm not too familiar with the details, but I think one of the points of contention is whether some contracts should be checked at compile-time only, runtime-only, or at both runtime and compile-time. There are almost certainly more design questions that they've explored, though. For the compile-time vs run-time one, it might make sense to parameterize contracts? As perhaps hinted by Other things:
|
Beta Was this translation helpful? Give feedback.
-
"compiled" ableC-regexInstead of
To compile this:
Section 6 of the Brzozowski paper goes through turning this into a proper lexer. Nice syntax for that might be like: // I like this taking a char** or string* better because
// it makes it more obvious that this changes what s is
// pointing to.
lex switch(&s) {
case "if": return TOK_IF;
case /[a-zA-Z][a-zA-Z0-9]*/: return TOK_ID;
}Prior art here is OCaml's sedlex. Though, that syntax might not respect case order because of maximal-munch (idk if sedlex does) which might be surprising. logos would be the other option; syntax for that might be like: lexable
enum token {
TOK_IF ~= "if",
TOK_ID ~= /[a-zA-Z][a-zA-Z0-9]*/,
}; |
Beta Was this translation helpful? Give feedback.
-
ableC-modulesIt would be nice to have a real module system, to get rid of One possible design, that pretends other preprocessor usage has magically disappeared:
This is probably way slower without Nailgun or something else that improves our start-up time... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Making a discussion for this because Slack #ideas disappears after a while...
Beta Was this translation helpful? Give feedback.
All reactions