4 ms·
here is the quote (http://www.stlport.org/resources/StepanovUSA.html http://www.stlport.org/resources/StepanovUSA.html) from one of the original auhors of stl:
by signa11 14y ago
here is the quote (http://www.stlport.org/resources/StepanovUSA.html http://www.stlport.org/resources/StepanovUSA.html) from one of the original auhors of stl:
'While in the hospital, in the state of delirium, I suddenly realized that the ability to add numbers in parallel depends on the fact that addition is associative. (So, putting it simply, STL is the result of a bacterial infection.) In other words, I realized that a parallel reduction algorithm is associated with a semigroup structure type. That is the fundamental point: algorithms are defined on algebraic structures. It took me another couple of years to realize that you have to extend the notion of structure by adding complexity requirements to regular axioms. And than it took 15 years to make it work. (I am still not sure that I have been successful in getting the point across to anybody outside the small circle of my friends.) I believe that iterator theories are as central to Computer Science as theories of rings or Banach spaces are central to Mathematics. Every time I would look at an algorithm I would try to find a structure on which it is defined. So what I wanted to do was to describe algorithms generically. That's what I like to do. I can spend a month working on a well known algorithm trying to find its generic representation. So far, I have been singularly unsuccessful in explaining to people that this is an important activity. But, somehow, the result of the activity - STL - became quite successful.'
- jerf 14y agoIf you want to work in an environment where a lot of people are thinking like this routinely, instead of a few lone voices in a vast sea of otherwise uninterested people, the Haskell community is doing a lot of work in this area, and able to move much faster since it's so much easier in Haskell than C++ templates (which isn't really a criticism of C++ templates, a lot of their capabilities are accidental rather than intended). This is why the Haskell community talks so much about monoids and applicatives and semigroups and a variety of other interesting structures in that area (and no, I did not forget to say monad, that structure is actually uninteresting here because it is too powerful). I believe the Fortress language is also doing some work here. A sample of the interesting sort of algorithm work that you can do when you think this way: http://apfelmus.nfshost.com/articles/monoid-fingertree.html http://apfelmus.nfshost.com/articles/monoid-fingertree.html Edit: See also the Typeclassopedia: http://www.haskell.org/haskellwiki/Typeclassopedia http://www.haskell.org/haskellwiki/Typeclassopedia And if you're really interested and want to take it hardcore, Edward Kmett's video on his lens library walks through how you can derive it with this sort of logic: http://youtu.be/cefnmjtAolY?hd=1 http://youtu.be/cefnmjtAolY?hd=1
- scott_s 14y agoAre people still working on Fortress? It's done as an Oracle project: https://blogs.oracle.com/projectfortress/ https://blogs.oracle.com/projectfortress/
- jerf 14y agoAh, yes, past tense, then.
- deleted 14y ago[deleted]
- klodolph 14y ago> monad, that structure is actually uninteresting here because it is too powerful I am worried these days that people are avoiding talking about monads not because they are not useful, but because places like HN were saturated with talk about monads a few years back. I remember seeing several blog posts explaining monads as some kind of revelation: like they were overloaded semicolons, or monads were burritos, etc. So let's not try to let the popularity of monads interfere with our respect for their powerful and simple structure. It's kind of like saying that sets are uninteresting in mathematics because they are too general. The Haskell community still does talk a lot about monads, and they are interesting and useful. Monads are what let us describe things like the difference between IO, ST, and STM. Monads give us generalizations of list comprehensions and give us ways to simulate nondeterministic execution. In short, monads are still king; but the Haskell community is much more aware of the diversity of useful algebraic structures than it was.
- jerf 14y ago"uninteresting here", which is to say, in this context. Yes, they are still fantastically useful, despite having a terrible PR department over the past decade, but in terms of extracting maximal usefulness from things like "this operator is associative" they aren't very interesting, because they are too powerful, or, equivalently, make too few guarantees.