Compile time evaluator for bedrock #5
vasucp1207
started this conversation in
Ideas
Replies: 1 comment
|
in this: func add(comptime x: T, comptime y: T, type: T) -> T
return x + y;
endwhy is the last parameter |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
We are thinking of adding the compile time interpreter to bedrock like the
zig comptimes, so no more generic type paramscomptimewill provide the generic functions foundation.The
comptimeblock will evaluates the block result and replaces the initial result. No runtime dependency is allowed incomptimeblocks.We can mark function params as
comptimewith comptime time known values at call site.See some simple examples,
cc @aliqyan-21
All reactions