Static checking of units in Servo
blog.mozilla.org
blog.mozilla.org
I love that you get all of this safety with zero runtime cost.
This is a perfect example of why just statically type checking your code does not make it correct.
I teach Haskell to experienced programmers and people that have never written code before. I know nothing about math, I dropped out of uni after one quarter, I have not studied math since that time. Most of my students didn't know any math and weren't any worse for it.
https://github.com/bitemyapp/learnhaskell
If you start going through the guide and get stuck, I will help you.
Only fear can stop you, be brave!
There is something terrifying about feeling like you won't be able to solve a problem. However, from experience I know how much better off I'll be after getting over that and solving the exercise ;)
Rust is awesome because it's bringing powerful ideas like this to a systems language.
I've heard from people that learned Haskell independently or went through my guide alike that benefited greatly from having learned Haskell despite not using it at work.
Types are a more compact and faithful representation of code semantics than what most non-Haskell programmers are working with internally. Haskell also teaches you, beyond thinking in terms of types (heh), how to identify patterns & abstractions that most languages wouldn't allow you to credibly leverage.
Could also be a failure to admit they wasted their time, because of sunk costs et al.
Not meaning it as snark -- it can always be a valid hypothesis when we're talking about people.
But people that I think got something out of it seem to be benefiting. One is a startup CTO that was using Clojure before - he's ship-of-theseus'ing his way out.
What? Systems programming means things like OS kernels and language runtimes. Places where garbage collection is not acceptable, and assembly language is not unheard of. Places where Haskell would be useless.
Lusting over a language that borrows its syntax from the Algol we all love and doesn't require a degree in Type Theory?
Oh, and without laziness, and with speed and no-GC guarantees...
Let me know if you'd like to know more.
1) Not algol derived syntax (check) 2) Speed (check -- I don't care about the: "you can write it totally unidiomatic and squeeze it to almost C or even better for some microbenchmark" situation). 3) Degree in type theory (meant as a joke anyway, refers to the steep learning curve of the tons of concepts introduced). 4) Laziness (don't care about the "you can switch it off" situation). 5) Has a GC (check).
Is there anything I really missed? In real life, classical use, as opposed to "if you really try and want it, you can also do it this way"?
Here's the documentation for the proposed units module. I believe it has the same principles as Boost units:
What I think the OP was expressing is that the various articles written on people writing great code in Rust inspires people to work with it. Admittedly phantom types are not a distinguishing feature of Rust, but it still makes a nice read that people are elegantly solving real problems in the language.