Legion
Languages and libraries
blockchain example in haskell
SHOW HN2017
How HN took it
10 positive, 16 neutral or asking, 0 mixed, 5 critical, out of 31 comments about the project. Thread score +0.07.
Idea: 1 for, 5 againstDocs: 5 for, 0 againstExecution: 4 for, 0 against
The thread, comment by comment
Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.
positive neutral or mixed critical about another commenter or something else the maker
What HN said
What people liked
Clean, readable, approachable code
From 4 comments
Okay. And your code is just very clean and approachable and doesn't try to do popular gymnastics. I'll ping you via GitHub.
KirinDave on HNNicely done. It reads like Ikea instructions. I didn't really know how blockchain worked until I read this code. If this was written as a teaching tool or a portfolio piece or…
m-j-fox on HNThanks for sharing, the code looks very elegant. This alone makes me want to sit down and learn Haskell.
cocktailpeanuts on HNWell uh, value judgements aside my reading of those code is that it is short, straightforward in its choices and generally quite good. I'm not sure what there is to be mad about.…
KirinDave on HN
Good introduction to blockchain and Haskell
From 2 comments
I'm tempted to just make a youtube video going over this code line by line. It's a really great introduction to a non-trivial bit of Haskell.
KirinDave on HNNicely done. It reads like Ikea instructions. I didn't really know how blockchain worked until I read this code. If this was written as a teaching tool or a portfolio piece or…
m-j-fox on HN
Objections
No proof-of-work, so history can be rewritten; essentially a linked list
From 3 comments
I had a brief look through, and it looks like there's no proof-of-work in the mining? What stops somebody from rewriting history and passing it off as legitimate?
jstanley on HNA blockchain without a consensus algorithm is just a linked list.
runeks on HNMy takeaway from this was to learn more about Literate Haskell. As somebody points out a Blockchain without a consensus mechanism is simply a linked list ie this is not really…
bernardlunn on HN
Requests
Add proof-of-work
From 2 comments
To implement rudimentary proof of work, you could add a nonce field and then force every block hash to start with a certain number of zeroes - I'll see what I can do and submit a…
18nleung on HNCorrect, the goal for this was as minimal as possible. However, if I (or anyone wanting to contribute) can come up with a very compact way to implement that, we could definitely…
aviaviavi on HN
Literate Haskell version
From 2 comments
Would it make sense to make the code Literate Haskell?
seanparsons on HNA literate blockchain implementation?? YES please!!!
elviejo on HN
Video or line-by-line walkthrough
From 2 comments
I'm tempted to just make a youtube video going over this code line by line. It's a really great introduction to a non-trivial bit of Haskell.
KirinDave on HNPlease do
tomcam on HN
Questions
Meaning of the type equality squiggle in getBlockChain
From 2 comments
Nicely done. It reads like Ikea instructions. I didn't really know how blockchain worked until I read this code. If this was written as a teaching tool or a portfolio piece or…
m-j-fox on HNIt is an equality assertion: https://downloads.haskell.org/~ghc/7.6.1/docs/html/users_guide/equality-constraints.html
eutectic on HN
Why block hash concatenates four hashes
From 2 comments
Neat. Just browsing through the source, is there a reason that: ``` calculateBlockHash (Block i p t b _) = concatMap hashString [show i, p, show t, b] ``` is not ```…
eemax on HNYou're correct, it really should be the 2nd way. The current form isn't really a problem per se, mostly just that the generated hashes are really long and make the output harder…
aviaviavi on HN
Alternatives named
Naivechain (JavaScript blockchain)
From 1 comment
I suggest you take a look at https://github.com/lhartikk/naivechain, the original version of this work, written in JS
aviaviavi on HN
Haskoin (Bitcoin implementation in Haskell)
From 1 comment
In case you're not aware of it, also check out Haskoin, a Bitcoin implementation in Haskell. https://github.com/haskoin/haskoin
SkyMarshal on HN