Show HN: FizzBuzz purely in Rust's trait system
11–20 of 32 posts
Re: Show HN: FizzBuzz purely in Rust's trait system
#12Re: Show HN: FizzBuzz purely in Rust's trait system
#13Re: Show HN: FizzBuzz purely in Rust's trait system
#14Re: Show HN: FizzBuzz purely in Rust's trait system
#15Re: Show HN: FizzBuzz purely in Rust's trait system
#16Re: Show HN: FizzBuzz purely in Rust's trait system
#17It's horrible, I love it! Interesting implementation of `If`, I had no idea the trait system could be... used ... to such extent.
Re: Show HN: FizzBuzz purely in Rust's trait system
#18Rules for actually using this crate: Don't :-).
That said, there are legitimate reasons to implement things at compile time. It means that libraries can create very efficient code that you don't have to write. But like all of powerful capabilities you should beware of misusing them. Like this :-).
Re: Show HN: FizzBuzz purely in Rust's trait system
#19Someone looking for the unbeatable https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris... ?
Seems unrelated. Does Java have a compile-time feature that is Turing complete and can be (ab)used to write FizzBuzz? For example, C++ has such a feature: https://gist.github.com/bgaff/2496338 (there's more examples, try searching for "accidentally Turing-complete", there are some really fun solutions.)
But it has been proposed in JEP 303 [1]
Re: Show HN: FizzBuzz purely in Rust's trait system
#20Earlier quoted context omitted.
Seems unrelated. Does Java have a compile-time feature that is Turing complete and can be (ab)used to write FizzBuzz? For example, C++ has such a feature: https://gist.github.com/bgaff/2496338 (there's more examples, try searching for "accidentally Turing-complete", there are some really fun solutions.)
As far as i know, No. The compiler stubbornly refuse to inline any method calls. But it has been proposed in JEP 303 [1] [1] https://openjdk.java.net/jeps/303