I found a wonderful essay by Peter Norvig entitled Teach Yourself Programming in 10 Years.
Peter Norvig has a wealth of insightful essays I’ll probably be mentioning over the coming weeks.
I found a wonderful essay by Peter Norvig entitled Teach Yourself Programming in 10 Years.
Peter Norvig has a wealth of insightful essays I’ll probably be mentioning over the coming weeks.
I recently implemented some new Haskell numeric types that, instead of performing calculations, can generate a rendering of the requested calculation or store units with it.
Here you see a transcript of my session with a Haskell interpreter. The mathematical statements I am entering after the “>” are standard Haskell expressions, and, as I demonstrate, normally evaluate to a single result.
Once I get a more powerful simplifier, I will probably write a LaTeX exporting function as well.
The entire implementation of this, BTW, is less than 200 lines.
NumTest> 5 + 1 * 3 8 NumTest> prettyShow $ 5 + 1 * 3 "5+(1*3)" NumTest> rpnShow $ 5 + 1 * 3 "5 1 3 * +" NumTest> prettyShow $ 5 + 1 * 3 "5+(1*3)" NumTest> prettyShow $ simplify $ 5 + 1 * 3 "5+3" NumTest> prettyShow $ 5 * (Symbol "x") + 3 "(5*x)+3" NumTest> 5 / 2 2.5 NumTest> (units 5 "m") / (units 2 "s") 2.5_m/s NumTest> (units 5 "m") / 2 2.5_m NumTest> 10 * (units 5 "m") / (units 2 "s") 25.0_m/s NumTest> sin (pi/2) 1.0 NumTest> sin (units (pi/2) "rad") 1.0_1.0 NumTest> sin (units 90 "deg") 1.0_1.0 NumTest> (units 50 "m") * sin (units 90 "deg") 50.0_m NumTest> ((units 50 "m") * sin (units 90 "deg")) :: Units (SymbolicManip Double) 50.0*sin(((2.0*pi)*90.0)/360.0)_m NumTest> rpnShow $ dropUnits $ ((units 50 "m") * sin (units 90 "deg")) "50.0 2.0 pi * 90.0 * 360.0 / sin *" NumTest> (units (Symbol "x") "m") * sin (units 90 "deg") x*sin(((2.0*pi)*90.0)/360.0)_m
Also, I defined this in my source file:
test :: forall a. (Num a) => a test = 2 * 5 + 3
Now, it can be used:
NumTest> test 13 NumTest> rpnShow test "2 5 * 3 +" NumTest> prettyShow test "(2*5)+3" NumTest> test + 5 18 NumTest> prettyShow (test + 5) "((2*5)+3)+5" NumTest> rpnShow $ test + 5 "2 5 * 3 + 5 +"
You can grab the very early experimental code with darcs get http://darcs.complete.org/num.
Haskell has no built-in support for numeric types with units, arbitrary symbols carried through computations, etc. But it was trivial to add it. This kind of extensibility is a key part of why Haskell is so amazing.
Free Software Magazine has just posted my article Haskell: A Very Different Language.
The folks at Free Software Magazine are doing a great job on a shoestring. I hope they can continue to do good things out there.
Someone sent me a link to this interesting article. It does a good job of explaining some of the reasons that Haskell is such an interesting language.
Sweet.
Juliusz Chroboczek has announced a working prototype of a darcs that can pull from git. This follows a long discussion on darcs-devel about how darcs could interoperate with git.
I found this article while surfing today. Looks like a good read:
Benefits from a real world switch from CVS to darcs
One thing the author didn’t mention, since everything is presumably on a LAN in their environment, is the substantial performance benefits in darcs from not having to hit the net for so many activities.
Finally, I’ve released darcs-buildpackage, a system for using Darcs to track the history of Debian packages. Now I can convert the last of my Arch repositories to Darcs.
I wrote darcs-buildpackage in Haskell. It took about half the number of lines of code that tla-buildpackage required in Python.
Cliff’s memories of Easter are a great read.
A study showing that a significant number of people exhibit violence towards their computer when it malfunctions, and another significant number of people attempt to sweet-talk it.
Shapr posted a link to the extremeperl mailing list. I found this post on the value of learning languages to be insightful.
Along a similar line, there’s an intriguing post on The Sequence from a Perl hacker looking at the Haskell community. I think he’s right.
These Perl people are really impressing me lately. My respect for the Perl commnuity has really shot upwards lately. And I am similarly disappointed in many of the directions Python is taking these days. Nice time to be using Haskell :-)
Usually when I learn a new programming language, I’ll hang out on its mailing lists and IRC channels, learning from the answers given to other people’s questions, and asking my own. After a month or two, I usually feel fairly good with my abilities; that I could answer most of the questions, and understand most of the questions.
Well, I’ve been using Haskell for about 6 months now. I really like Haskell, and it’s a great language to use, and it’s already my preferred language.
But here’s what’s unique about Haskell. The more I use it, and the more I participate with the Haskell community, the more I realize just how much there is that I could learn. And it seems that I’m not alone with that feeling.
I wonder why Haskell is unique this way.
I’ve started a new Drupal site, The Haskell Sequence. Its focus is on news and discussions relating to the Haskell programming language. People seem to be enjoying it so far.