Not much to report, except that I am still trucking along through Real World Haskell (currently chapter 7). This is much better than last year (the year of smalltalk) where I was already having lots of trouble with motivation by this point.
I've been thinking alot about what the chances are that haskell will become one of my daily use power tools like python is. Or what the chances are that haskell will "take off" like a python.
I've already (mostly) gotten over one of my haskell phobias: dealing with "do" blocks. When I only had a passing understanding, I always got confused with "<-" and "lets" and "return"s in do blocks (and nested do blocks) and the rules seemed rather arbitrary, etc. Of course I'm no expert now, but at least I don't look at them as magical things. They have a precise use and logic and now I (mostly) get them.
A couple things from python I miss in haskell: list access syntax (e.g. x[2:]), default args/kwargs, etc. Both of these haven't really hurt me yet but just the thought that I don't have them available makes me sad.
Showing posts with label haskell. Show all posts
Showing posts with label haskell. Show all posts
Friday, February 26, 2010
Monday, February 1, 2010
One Language a Year: Haskell - update 1
So one month in and so far Haskell is treating me much better than Smalltalk did a year ago. What is better? Well to start with my main learning period is a 20 to 30 minute window each morning before work. For whatever reason Smalltalk put me directly to sleep and I would often literally find my forehead mashed into my keyboard. I haven't had that problem at all yet with Haskell. One thing is for sure, if you want to learn a new programming language, you have to be awake.
What is the difference? For one it may just be that I like functional rather than object oriented thinking better. I'm fairly comfortable with object design ideas, but things like design patterns more often than not seem like bandaids over language problems rather than powerful solution cookie cutters. Also I admit that I generally expect object based solution to be over engineered. There is such a thing as beautiful OO solutions, but they seem to be the exception in my experience.
But probably the number one success factor for me is the fantastic book: Real World Haskell. 4 chapters in and I find the pacing quite nice. And there is no shying away from mundane things like reading and writing files and reading command line arguments. I swear I have a Haskell book that doesn't do any discussion of IO until chapter 17. I get that IO is about monads and monads are serious mind benders, but you still need to crank out a "Hello World" program early on. RWH gets that and many other things right.
One of my main rules for making sure I understand everything as I'm going along is to retype in *all* code from scratch as I come across it and to do so without directly copying it. In other words I have to understand it enough to retype it in directly from memory. This is probably something I should always have done, but cutting and pasting is just so easy and there is so little time....
In any case, the year of Haskell is doing quite nicely so far.
What is the difference? For one it may just be that I like functional rather than object oriented thinking better. I'm fairly comfortable with object design ideas, but things like design patterns more often than not seem like bandaids over language problems rather than powerful solution cookie cutters. Also I admit that I generally expect object based solution to be over engineered. There is such a thing as beautiful OO solutions, but they seem to be the exception in my experience.
But probably the number one success factor for me is the fantastic book: Real World Haskell. 4 chapters in and I find the pacing quite nice. And there is no shying away from mundane things like reading and writing files and reading command line arguments. I swear I have a Haskell book that doesn't do any discussion of IO until chapter 17. I get that IO is about monads and monads are serious mind benders, but you still need to crank out a "Hello World" program early on. RWH gets that and many other things right.
One of my main rules for making sure I understand everything as I'm going along is to retype in *all* code from scratch as I come across it and to do so without directly copying it. In other words I have to understand it enough to retype it in directly from memory. This is probably something I should always have done, but cutting and pasting is just so easy and there is so little time....
In any case, the year of Haskell is doing quite nicely so far.
Labels:
haskell,
programming languages
Monday, January 4, 2010
One New Language a Year: Haskell
Another year starts and so I try again to do the "Language a Year" thing. Last year it was a close decision between smalltalk and haskell. I went with smalltalk and for various reason it didn't really grab me and I ended up abandoning my efforts and switching to emacslisp.
So hopefully I've learned a little bit about the focus and dedication it takes to work on a new language and I'm ready to try this thing again.
First of all you need a goal or you won't know if you've succeeded (or failed). My goal is to essentially have a new python at my command. Another general purpose language that I can use as easily as I think for any sort of programming itch I happen to have. I originally learned python because I was looking for a new language that was different from what I was using at work. In 2000 or so I was mostly a Java and perl programmer. Python seemed interesting and different so I dove in. Relatively soon after that it became my full time work language and I sort of lost the idea of having a second language that I used in my free time.
So here I am again looking for a "fun" language. I've actually done occasional reading on haskell topics/blogs and have gone through a few short tutorials, but it's hardly a language I would say I'm at all comfortable in. In fact, unlike most languages that I have some familiarity in, random haskell code more often than not seems to have some scary new function/datatype/etc that I can't even start to grok from context.
The metaphor I have in mind as I dive in is that just as a professional builder uses tools that would be confusing and dangerous to a amateur builder there are programming tools/languages/concepts that are a level of effectiveness above the blub that I'm used to. It will take time/energy to master the more powerful tools but once you have, you will be working at a more advanced level.
I'm really curious to see if I can get a new language in my tool belt that is as concise (or more so) than python, faster, less prone to bugs, etc. Haskell seems as likely to provide this as any language as I'm aware of.
My plan is to use "Real World Haskell" as my main resource. By the end of the year I'd like to have gotten comfortable enough that I could use it interchangeably with python for random fun projects at home and even better to create a project and/or get involved in an existing project so that I have a reason to keep my skills fresh (since it ain't too likely to become my work language any time soon).
In any case I'll check back in a month or so and let you know how it's going.
So hopefully I've learned a little bit about the focus and dedication it takes to work on a new language and I'm ready to try this thing again.
First of all you need a goal or you won't know if you've succeeded (or failed). My goal is to essentially have a new python at my command. Another general purpose language that I can use as easily as I think for any sort of programming itch I happen to have. I originally learned python because I was looking for a new language that was different from what I was using at work. In 2000 or so I was mostly a Java and perl programmer. Python seemed interesting and different so I dove in. Relatively soon after that it became my full time work language and I sort of lost the idea of having a second language that I used in my free time.
So here I am again looking for a "fun" language. I've actually done occasional reading on haskell topics/blogs and have gone through a few short tutorials, but it's hardly a language I would say I'm at all comfortable in. In fact, unlike most languages that I have some familiarity in, random haskell code more often than not seems to have some scary new function/datatype/etc that I can't even start to grok from context.
The metaphor I have in mind as I dive in is that just as a professional builder uses tools that would be confusing and dangerous to a amateur builder there are programming tools/languages/concepts that are a level of effectiveness above the blub that I'm used to. It will take time/energy to master the more powerful tools but once you have, you will be working at a more advanced level.
I'm really curious to see if I can get a new language in my tool belt that is as concise (or more so) than python, faster, less prone to bugs, etc. Haskell seems as likely to provide this as any language as I'm aware of.
My plan is to use "Real World Haskell" as my main resource. By the end of the year I'd like to have gotten comfortable enough that I could use it interchangeably with python for random fun projects at home and even better to create a project and/or get involved in an existing project so that I have a reason to keep my skills fresh (since it ain't too likely to become my work language any time soon).
In any case I'll check back in a month or so and let you know how it's going.
Saturday, February 28, 2009
My Dangerous New Obsession
I think if I had to blame anyone, I'd start with Alan Kay. I recently read the following quote by him:
Alan Kay wants smalltalk to go away? Well, if I'm going to use the man's language I should also have the decency to try to improve upon it and replace it.
So that was the start of a tiny little snow ball. And the snow ball grew. And now I find myself keeping notebooks full of ideas for creating a new programming language.
And that is my obsession. I've got it in my head that I could create a new language. And that this is somehow a good use of my time. So I'm constantly comparing and contrasting the various features that different languages have. Looking for a good idea to steal or a wart to avoid. I've been shopping around for language parsers and VMs to use.
And you know what? It's fun as hell. I actually don't have any illusions that I'm going to set the world on fire or that anyone but me will ever use my language. Or, let's be serious, that there is much likelihood that I will get past the vaporware stage. But I really feel like I'm seeing the landscape of languages with new eyes. Sort of like when you take a class on drawing and your brain starts learning how to do the "switch". And you can almost magically just draw things. I feel like my eyes are really seeing languages and language features for the first time.
So what is my language like? Not much. I've actually been avoiding trying to commit to any specific syntax. Which is probably going to make it lisp like if I'm not careful. (Not that there's anything wrong with that). When I start committing to various features it's been coming out something like a pythonized haskell (or a haskellized python) with strong nods to smalltalk minimalism. In a word its sort of an incoherent jumble. But I keep circling around and trying new things.
And like I said it's really fun. And I'm learning a lot. (And I've become addicted to starting sentences with "and").
I wonder if this is a common or rare affliction. I've never met anyone who said that they were trying to create their own language. Perhaps others are too smart to go down that road in the first place or too ashamed to admit they did and failed.
In any case, be prepared for the next big thing. Any decade now....
I think it is safe to say that most of the Squeak community is dedicated to making this Smalltalk more useful and accessible, and not devoted to making something so much better as to render Smalltalk obsolete (a fate I would dearly love to see happen).
Alan Kay wants smalltalk to go away? Well, if I'm going to use the man's language I should also have the decency to try to improve upon it and replace it.
So that was the start of a tiny little snow ball. And the snow ball grew. And now I find myself keeping notebooks full of ideas for creating a new programming language.
And that is my obsession. I've got it in my head that I could create a new language. And that this is somehow a good use of my time. So I'm constantly comparing and contrasting the various features that different languages have. Looking for a good idea to steal or a wart to avoid. I've been shopping around for language parsers and VMs to use.
And you know what? It's fun as hell. I actually don't have any illusions that I'm going to set the world on fire or that anyone but me will ever use my language. Or, let's be serious, that there is much likelihood that I will get past the vaporware stage. But I really feel like I'm seeing the landscape of languages with new eyes. Sort of like when you take a class on drawing and your brain starts learning how to do the "switch". And you can almost magically just draw things. I feel like my eyes are really seeing languages and language features for the first time.
So what is my language like? Not much. I've actually been avoiding trying to commit to any specific syntax. Which is probably going to make it lisp like if I'm not careful. (Not that there's anything wrong with that). When I start committing to various features it's been coming out something like a pythonized haskell (or a haskellized python) with strong nods to smalltalk minimalism. In a word its sort of an incoherent jumble. But I keep circling around and trying new things.
And like I said it's really fun. And I'm learning a lot. (And I've become addicted to starting sentences with "and").
I wonder if this is a common or rare affliction. I've never met anyone who said that they were trying to create their own language. Perhaps others are too smart to go down that road in the first place or too ashamed to admit they did and failed.
In any case, be prepared for the next big thing. Any decade now....
Labels:
haskell,
programming languages,
python,
smalltalk
Friday, August 10, 2007
OSCON Haskell tutorial
I was pretty bummed to have missed the haskell tutorial this year. The one last year was so-so and you can't beat one of the designers speaking about his creation. I was delighted to discover today that the tutorial is available on-line. With a link to the handouts. Hard to beat.
Subscribe to:
Posts (Atom)