4 ms·
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.
by KirinDave 9y ago
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.
- aviaviavi 9y agoThat would be awesome! Hopefully over time I (or anyone contributing) can spend a little more time making it as idiomatic as possible and beefing up the docs a little bit. Please let me know if you end up doing that!
- KirinDave 9y agoOkay. And your code is just very clean and approachable and doesn't try to do popular gymnastics. I'll ping you via GitHub.
- tomcam 9y agoPlease do
- seanparsons 9y agoWould it make sense to make the code Literate Haskell?
- aviaviavi 9y agoI'm not familiar with Literate Haskell, what would that involve?
- KirinDave 9y agoIt's just where the majority of the file is a comment instead of a minority.
- piaste 9y agoThank you. Thank you so much. It's an old pet peeve of mine. I cringe inside every time someone starts waxing about "writing your thoughts first, and your code only incidentally" or "it's a completely different paradigm of programming" and other such pieces of useless, discouraging new age fluff.
- elviejo 9y ago"Programs should be written for people to read, and only incidentally for machines to execute." (Structure and Interpretation of Computer Programs" by Abelson and Sussman) The idea is that you write a "Book" and the program is extracted, from the book. Literate Programming Wikipedia: https://en.wikipedia.org/wiki/Literate_programming https://en.wikipedia.org/wiki/Literate_programming A nice talk about it: https://youtu.be/Av0PQDVTP4A https://youtu.be/Av0PQDVTP4A
- elviejo 9y agoA literate blockchain implementation?? YES please!!!
- closeparen 9y agoA Literate Haskell blockchain might just be Peak HN. (Definitely peak HN if it runs in the browser).
- KirinDave 9y agoIs GHCJS using WASM yet, because if so...
- pcthrowaway 9y agoI want to chime in that this would be amazing also. However, an actual line-by-line video might be less helpful for those without any Haskell or blockchain experience. I (and thousands of others at HN) really enjoyed Jeremy Ruten's tutorial of building antirez's 1000-line text editor, Kilo, from scratch (antirez is the author of Redis which is renowned for its code quality and approachability) - http://viewsourcecode.org/snaptoken/kilo/ http://viewsourcecode.org/snaptoken/kilo/ . Additionally, the author of that walkthrough has published the project used to create that tutorial here - https://github.com/yjerem/leg https://github.com/yjerem/leg I realize this might be less trivial than creating a Youtube video, but if you have the bandwidth I'm certain creating a similar walkthrough for Legion would not go unappreciated here :)
- aviaviavi 9y agoThis is a cool idea. I would love to do this, but realistically won't have time for a little while. I can certainly look into it more when I get some spare time!
- KirinDave 9y agoI actually think that if I did it line by line in the traditional haskell style that'd be more approachable for this project. Kilo is quite a bit bigger. With respect and praise offered to the author, Legion is a simple project. I think an approach of building it interactively and showing how a developer actually makes the types line up and uses the tooling probably answers more questions about what it's like to use Haskell than you may give it credit for.
- pcthrowaway 9y agoRegarding the Kilo tutorial: a text editor is something that most people intuitively understand how to use, but the author took the time to explain the challenges that needed to be solved in order to create a terminal text editor, and built it incrementally while explaining each problem encountered and then how each iteration provided a solution. I can definitely also see your argument that a smaller and more straightforward project may be easier to explain. As someone at least superficially acquainted with how blockchain technology works, my fear was that a lack of understanding of the thing being built might be a stumbling point for readers/listeners of a line-by-line code walkthrough. However, you seem confident that a line-by-line will be sufficient to explain both the Haskell and bitcoin sides of things concisely, so I'll defer to your judgment, and look forward to it!