Not sure why this got downvoted. I'm familiar with Church encoding but not Rust's type system. Armed with that knowledge, I can read the source and deduce what the foreign syntax means. To somebody who knows neither, identifying this pattern can be helpful -- without that, they can read Rust docs and puzzle through the weird construction. With the information, they can read up on Church encoding at an abstract level, and then recognize it in the source -- which can help untangle the Rust syntax.
Makes me think of the time, many, many, many years go, when I was learning IBM 7090 assembly language (my introduction to computers). The macro assembler was powerful enough that I could check for primality at assembly time.
This sounds super awesome! I can't imagine how interesting those times might have been. I started to play around with a 6502 just because there is the possibility to understand the system to some extend. Modern day software engineering is like sitting in the golden cage. Not because the the systems are inaccessible like mobile devices or Apple Computers – you can still get pretty far on Linux systems – but the main reason is that you just can fit all the stuff in your brain. If you try to understand how your Angular/React/whatever project is getting their pixels to the screen all the way down – its just a project for a lifetime and even that is not enough. Understanding modern x86 processors is almost impossible – yeah to some degree enough to understand some basic concepts to not shoot yourself in the foot with how the cache works etc. but getting your hands dirty with an 8-bit processor and reading the datasheet is just something very different.
It is to be honest. I checked out various OS's and being involved in one of them ( Redox OS ). The problem is that this is "just" the OS part. There are multiple layers above and multiple layers below. Understanding the ins and outs of modern processors (pipelining, branch prediction etc.) motherboards pcie, things like coreboot, modern RAM etc. multiple layers of software abstractions until chrome or firefox have rendered the pixels i command with the javascript engine ... that is just humongous compared to a simple 6502 setup where i am able to really understand every aspect, can replace pieces, build things on top (hard and software) .. making my own RAM ... just for fun. Its a different kind of thing.
Beautiful. With such advances on the frontier of Trait exploitation, soon most of the Rust language will become obsolete and everything will be evaluated on compile-time! It is the ultimate optimization. Just embed the most expected output values in the binary and run time calculation becomes redundant.
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 :-).
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.)