With static intro all of this is a macro, while loop, and a switch statement. A fraction of the complexity and you get editor help and typed holes. https://willcrichton.net/notes/type-safe-printf/ … https://github.com/deech/LambdaWorldCadiz2019-WhatFPCanLearnFromStaticIntrospection/blob/master/printf.nim …
I wouldn't say this is a meaningful comparison. The nim strategy is the same as Rust's (see: https://github.com/rust-lang/rust/blob/8e5a27766ff14af36448a4b4c0a8bff84090168f/src/librustc_builtin_macros/format.rs …). The blog post is showing how a format safety property can be captured without macros.
-
-
That said, I agree that the trait-encoding is gnarly. I think there are ways to make these kinds of programs easier to write, in terms of distance from mental model to code. See:https://github.com/willcrichton/tyrade …
-
But doesn't the rust built-in have access to type information that rust users do not have? With static intro any user of the language can run the type checker on an arbitrary expression at compile time.
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
cognitive psychology. PhD