Sunday, December 12, 2010

Learning Scheme

I decided to do something programming-related. I don't exactly remember where I left off on my experimental project, which I still plan to revisit, but soon I'll be going to a university.

I'll be attending the TU Darmstadt and I'll be majoring in Computer Science.


There, so I've heard, we'll be learning Java and Scheme. Now, Java I kinda know already, but Scheme not so much. I actually don't know any functional language.
If it wasn't for the CS courses there, I'd probably have chosen Common Lisp or Haskell. Possibly F#. The reason is that I've heard of those before, while I never before heard of Scheme.

People seem to be complaining about different operator notation (e.g. to add two numbers x and y you write (+ x y) in Scheme, while in for example C or Pascal it'd just be x + y).
However, doing it the 'Scheme-way' makes sense in the way that you call to other functions, which are not represented as simple symbols, the same way (e.g. (square-root x), while in C or Pascal that'd be square-root(x)).

And I heard people complaining about lots and lots of parenthesis.
At first I though you can probably get through with it if you indent the code properly, but there's really a shitton of parenthesis.


While I do wonder if this language has any value for bigger, serious projects, I can't compare it to any other functional language, since it is the only one I know so far. At least it make me think of different approaches to programming problems; the language is basically centered around using recursion.
I've read about 1/3 of the introduction I am using and so far had no problems understanding everything.


The next blog-post will be a follow-up. I could write it right now, but this would make this post larger and this way I can also claim to post a tad more frequently than I really am :3

2 comments:

chaotika said...

I think Scheme is an academic programming language. And i don't like it. The syntax is very ugly. It seems Scheme is just about to torture computer science students. Just my two cents...

z33ky said...

Well, the company who coded the ypsilon interpreter/compiler also provides a bunch of library bindings since they coded it to make a (3D?) pinball game in scheme.
Besides, there are still new revisions on the way afaik. If it was an academic language, I don't think people would still work on it after a working paper has been released; there seem to be 6 revisions so far, all called rnrs, n being the revision number.

Also, most of the syntax was inherited from Lisp I think. I have not learned Lisp, but looking at some code it could almost be Scheme; the list also seems to be Lisps 'main' datatype for arrays.