Haskell Primitives
fpcomplete.com
fpcomplete.com
""Look at the implementation of other functions in GHC.Prim;they're all defined as let x = x in x."
This begs the question of why this strange code exists at all. Answer: the sole reason is to give Haddock documentation for the primops a place to live. GHC.Prim is processed by Haddock more or less like any other module; but is effectively ignored by GHC itself.
Worth saying this.
Simon"
primop = let x = x in x
(+#) = primop
or something else at least somewhat meaningful.There is a Stack Overflow discussion about this that gives a bit more background, by the way. (The answer needlessly digressing into the lambda calculus is mine.)
0. http://stackoverflow.com/questions/15893524/what-is-the-mean...
I've been in HFT for a while and what strikes me is the performance optimizations you make in C++, Java, and Haskell are actually so so similar. Get down to the primitives. Avoid boxing. Avoid memory allocation at run time. Makes me think any language can be performant if you know what you're doing.
Idiomatic Haskell for most of my code and imperative Haskell for performance achieves something similar without having to switch languages.
If you really need C, Haskell also makes it pretty easy as well.
This, plus the "magic hashes" reminds me a great deal of Urbit's hinting syntax for jet propulsion (associating a body of high-level code in Hoon with an alternative (presumably low-level) implementation).