5 ms·
I salute you if you understood anything in "The Problem" section.
by hondo77 12y ago
I salute you if you understood anything in "The Problem" section.
- deleted 12y ago[deleted]
- PaulAJ 12y agoIts not difficult. The author has a stream of data (random bytes for crypto keys) which needs to be consumed in different bits of the program at different times. The traditional ways are either a global variable holding the current state of the generator or else re-assigning that state to one or more variables in a complicated and error-prone way.
- dopamean 12y agoThis is my problem with everything I encounter when trying to learn about Haskell. I find almost everything I come across to be completely unapproachable. If I cant understand the problem you're solving in the blog post then the solution makes even less sense. I don't say this as a criticism of this author at all. It's just something I've noticed with Haskell.
- the_why_of_y 12y agoThe problem statement is basically copied verbatim from RFC 5246 sections 5 and 6.3. The author picked a cryptographic function from a rather important and widely deployed real-world internet protocol (TLS 1.2), but of course since the author is writing about Haskell readers assume it must be some esoteric academic nonsense that undoubtedly involves category theory, whatever that is.
- dopamean 12y agoI didn't say anything about "esoteric academic nonsense." Just because the subject matter is a part of something that is very commonly used does not mean it is outside the reach of many very competent people.
- the_why_of_y 12y agoEhh sorry for the hyperbole, was feeling a bit grumpy that day :-)
- jon-wood 12y agoI'm glad I'm not the only one who feels that way. I find that with many articles on functional languages, which leaves me wondering if they attract a certain type of person, or if they're just not well suited to the problems I work on. Is there anything good on doing web development in a functional style? I keep hearing about Om and Clojurescript in relation to React, but I have no idea where to start.
- bandrami 12y agoIf you count Lisp as functional[0] it has a pretty big web presence, both Common and Scheme. Functional languages reward (require?) a different kind of problem domain analysis than imperative languages do, and one of the things they are least good at is "I want to track the state of a bunch of discrete things that share similarities in structure", ie, 90% of Web programming. (But then again maybe that's only 90% of web programming because OO was the fad-of-the-day when web programming took off.) There's the old adage that data structures tell you a lot more than flowcharts; languages like Haskell and ML kind of turn that on its head. Rather than using functions to apply and track changes of state to abstracted chunks of memory, you apply and track changes of state by composing the functions with each other. This is great for some problem domains (eg, I think there's a reason that so much prototyping and code analysis is done in Haskell and ML) and less great for others (interfacing with a table-based database always felt kludgey to me, for instance). I do think they attract a certain type of person, namely the kind of person who prefers debugging on paper to debugging in memory. Haskell may well have a debugger, but I've never used it because I always do a static debug, usually with a physical code printout. Then again I'm also a crotchety geezer. TL;DR: many functional languages aren't great for the kinds of problems a lot of developers today are trying to solve, but the process of refactoring those problems in a way that does make functional languages useful is often a Good Thing for a developer to do. [0] I would argue it's not "functional" except in an accidental sense; it's a "symbolic" language that happens to have first-class functions. Lisp is mostly useful for writing more Lisp (but note "mostly"; I'm a confirmed Lisp Weenie and I find myself very productive in it).
- sukilot 12y agoThis website is written in a Lisp dialect.