• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Noulakaz

The blog of Avinash, Christina, Anya and Kyan Meetoo.

  • Home
  • About
  • People
    • Christina & Avinash Meetoo
    • Avinash Meetoo
    • Christina Meetoo
    • Anya Meetoo
    • Kyan Meetoo
  • General
    • News
    • Mauritius
    • Politics
    • Education
    • Business
    • Travel
  • Computing
    • Apple
    • Linux
    • LUGM
    • Programming
    • Web
    • Technology
    • Knowledge Seven
  • Entertainment
    • Music
    • Movies
    • Photography
    • Sports

Learning by experimenting (with Scheme)

31 January 2008 By Avinash Meetoo 12 Comments

In his beautiful essay, The Art of Lisp & Writing, Richard Gabriel makes a strong case for the use of programming mediums instead of programming languages when either introducing programming to students or starting a new project.

He says:

“The difference between Lisp and Java, as Paul Graham has pointed out, is that Lisp is for working with computational ideas and expression, whereas Java is for expressing completed programs. As James [Gosling] says, Java requires you to pin down decisions early on. And once pinned down, the system which is the set of type declarations, the compiler, and the runtime system make it as hard as it can for you to change those assumptions, on the assumption that all such changes are mistakes you’re inadvertently making.


There are, of course, many situations when making change more difficult is the best thing to do: Once a program is perfected, for example, or when it is put into light-maintenance mode. But when we are exploring what to create given a trigger or other impetus—when we are in flow—we need to change things frequently, even while we want the system to be robust in the face of such changes. In fact, most design problems we face in creating software can be resolved only through experimentation with a partially running system. Engineering is and always has been fundamentally such an enterprise, no matter how much we would like it to be more like science than like art.”

[Highlights mine]

I too believe that learning and experimenting require a Language like Lisp, Scheme, Smalltalk, Python and Ruby which offer a read-eval-print-loop (i.e. an interactive shell). Naturally, you’ll always need the big-iron compilers but only when the program is perfected…

As Frederick Brooks writes in The Mythical Man-Month, plan to throw one away, you will anyhow…. In most engineering fields, prototypes are routinely built using more malleable materials than the ones that are going to be used in production (for e.g. airplane prototypes made of wood). It’s only in our field, Programming, that people build prototypes using production-quality (but extremely rigid and constraining) languages like C++ and Java and spend so much time and money in this process that they are forced to ship the prototypes to customers with obvious consequences!

Using a malleable programming language

This semester, I am going to teach Programming Languages to second year university students. Those students have been exposed to C++ in the first year and Java at the beginning of the second year. Both programming languages are good for expressing perfected programs but are bad for experimenting.

(By coincidence, there were two interesting discussions on Slashdot (One Two.) following an article by some professors criticizing Java. Joel Spolsky thinks that it is perilous to use Java at school. I won’t even mention C++ as I personally think it’s the worst (by far) language to be used for teaching programming!

Together with Pascal Grosset who will be handling one of the lab sessions, I have been thinking a lot about what paradigms (and, hence, what programming languages) to use for my lecture. I think that I’ll only have time to introduce three paradigms and, hence, at most three programming languages (or mediums).

This is what we have come up with:

  • Functional programming with Scheme
  • Logic programming with Prolog (or, maybe, Kanren)
  • Scripting with Ruby

The first lecture

I did my first Programming Languages lecture last Friday and I enjoyed it a lot. I arrived in the lecture theatre at around 9:00 and I quickly installed OpenOffice.org on the Windows laptop there as I had prepared my presentation using OO Impress.

During the installation, I asked the 180 students how many of them found programming easy and only a few raised their hands (remember – those are second year students). I was a little surprised because I thought there were more. Anyway, I told them about my little theory that they should make a lot of effort now to acquire knowledge to be effective when they work so that they can return home early and enjoy life instead of having to stay overtime everyday :-)

I also told them that we were going to focus a lot on the functional, logic and scripting paradigms. And I also tried to make them understand that becoming a competent programmer require practice like all artistic endeavors. My first real lecture on Scheme will only begin next Friday as tomorrow is a public holiday.

Why Scheme?

I have been a fan of the Scheme programming language since I was introduced to it during my first year as a university student in France. Since then I’ve found out that Scheme is used at top universities like MIT and Berkeley to teach programming. Why is that so? Because Scheme is easy to learn yet, easy to use yet powerful!

I have decided to use the fantastic DrScheme IDE. It is multi-platform (Linux, Mac OS X and Windows) and is a joy to use. It’s, naturally, open source software. I am currently in the process of installing DrScheme in all the Computer Science labs.

I am still wondering what textbook I’ll use… I bought “How to Design Programs” by Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, Shriram Krishnamurthi a year ago and it is an excellent book written by some of the makers of DrScheme. I am a little bit hesitant to use it as it uses slightly customized versions of Scheme instead of the standardized Scheme. Anyway, I’m still making my mind.

I have also ordered the Schemer triumvirate through Amazon and I expect to receive them in one or two weeks.

“The Little Schemer” is a little book (how surprising!) that covers functions (closures) and recursion. Many of you may feel that recursion is simple but Scheme guarantees that tail-recursive functions are executed without using increasing stack space hence the book goes into a lot of detail.

The second book, “The Seasoned Schemer”, talks about mutable state (i.e. variables) and about the special control flow constructs based on the continuations found in Scheme. Continuations allow for coroutines, concurrency, etc. and are important to understand if one really wants to be a Schemer (a Scheme programmer).

The final book is “The Reasoned Schemer” which is a book on reasoning (aha!). It introduces Kanren, a small library to transform Scheme into a better-than-Prolog programming language for logic and inference.

Why not Lisp?

I’ve also ordered “Practical Common Lisp” by Peter Siebel from Amazon. I have decided not to use Lisp because the de-facto IDE, Emacs + Slime, while extremely powerful, is too intimidating for young students. Another reason is that Common Lisp is a beast and is tough to learn…

Conclusion

Learning by experimenting is the best way to learn. Learning programming using Scheme is fun and rewarding as the language is so malleable. A University is not only a place where people go to get a degree. Rather it’s a place where intelligent people (students + academics) meet to share knowledge. Someone wrote on Slashdot:

“When Plato and Aristotle founded their schools, they didn’t put up a big sign that said “When you’re done, you get more money.” That wasn’t the promise. The promise was that by teaching you about the world, you would become a better person. That is to say, the founding concept of the University was that education lead to human excellence.”

My students will become better persons by experimenting with Scheme :-)

Filed Under: Education, News, Programming, Technology

Reader Interactions

Comments

  1. Raj says

    31 January 2008 at 12:31

    I like the “And I also tried to make them understand that becoming a competent programmer require practice like all artistic endeavors. “, specially the artistic bit.

    What a coincidence, on Sunday I launched a challenge to my niece to learn Scheme in two weeks and I downloaded DrScheme :-). I was drawn to Scheme based on what I read in your blog and of course pointed her to your site to get some idea about how computer science is taught at UOM.

  2. Alex Ciarlillo says

    31 January 2008 at 21:26

    I am a CS student at Ohio University in my senior year and would just like to add my thoughts coming from experiences I’ve had here.

    Last year I had my first encounter with functional languages in a university class. We used MzScheme and wrote our own language interpreters. As a programmer I’m very familiar with abstraction but in Scheme it took on a whole new meaning. We used Scheme for the entire course and at times I found it frustrating, (cadr, cddr, caadr, and a screaming sack of parentheses still haunt me) but it really opened me up to approaching problems in a new way and with a whole new bag of tricks. And for some reason it also prompted me to learn Vim :)

    As for Ruby… this is the language I use on a daily basis for office work and I really feel that it can be used as an excellent tool for a wide variety of tasks from simple text/excel processing to light user apps. However, what I find really nice about the language and why I am happy to hear you are considering introducing it to students is that just like scheme it offers a really nice playground to experiment in (much love for irb). It also looks a lot like pseudo-code that one sees in classes on algorithms and theory and I don’t see why it cannot be used more often to highlight conceptual material like this so that students can be less concerned with the intricacies and syntax of languages like C/C++/Java and can more clearly see the problem and its solution in a concise and readable way. Also if you do use ruby there are many really cool lightweight libraries capable of doing really neat things from retrieving AudioScrobbler data (my latest interest) to browsing iTunes shares via DAAP and tagging MP3s. I’m not sure that any of those type of things will fit it in at all with the course material, but maybe you could come up with some projects or assignments that are not only useful but also interesting or useful to students.

    Okay that was a bit long winded… and liberating in an odd way :)

  3. Kailash says

    31 January 2008 at 23:22

    Worked on building an introductory programming language for my undergrad project some years back.

    I thought that I’d ask a true hacker, Richard Stallman about the features he might foresee in the “ideal” introductory programming language. Interestingly he replied that there was little need to create anything… use Scheme. hehe!

    Damian Conway, the man behind OO Perl and who also happens to work on introductory programming at Monash University, however thought that Stallman was wrong. Scheme is semantically challenging for beginners. You cannot expect students to make sense of a series of nested brackets. His paper about seven deadly sins of introductoy programming language design was somewhat the basis behind my dissertation.

    Maybe now we can have some insight which is which. Would the non “hackers” like scheme?

  4. avinash says

    1 February 2008 at 09:37

    To Raj:

    How old is your niece?

    To Alex and Kailash:

    Thanks for your comment Alex. I also have some problems with the parentheses but using a good editor like the one in DrScheme (which features automatic indenting and parentheses-matching) makes life easier.

    I don’t see the parentheses after some time. Indentation is much for important for comprehension. And I’ve discovered the Ctrl-I shortcut in DrScheme which automatically indents your program and make errors so much obvious…

    Thanks Alex for your idea of giving meaningful and interesting projects to the students. I’ll explore some of the most interesting Ruby libraries.

    As for the paper by Damian Conway, it’s a nice read (I read it some months ago). But it’s easy to criticize but so much more difficult to come up with something perfect. Scheme is not perfect. But it’s good enough for introducing functional programming and this is sufficient for me.

    As for “would the non-Hackers like Scheme?”, I never equated Scheme with hackers. For me, Scheme is the programming language invented to introduce programming. I learnt Scheme in my first year of university in France. I know this is also done at MIT and Berkeley. There must be a reason.

    Incidentally Ruby, Haskell, Python etc. are also nice. In fact, any language with a REPL is good enough to be used to introduce programming like I wrote above.

    Kailash, did you read Richard Gabriel’s essay?

  5. Raj says

    1 February 2008 at 16:16

    Avinash

    My niece is waiting for her HSC results and is considering a degree in IT hence my challenge to her to make sure she’ll be up to the standard and not be one of those who finish a degree and want to become a manager or project leader after 6 months programming.

  6. avinash says

    2 February 2008 at 00:10

    Excellent!

    Dijkstra always told people that he was a programmer even though he was one of the gods of Computer Science. I guess most people are not like Dijkstra: they feel Programmer is not a good title and that Manager or Project Leader sound much better :-)

  7. kailash says

    24 February 2008 at 08:30

    So how did scheme turn up to be? Do they like it?

  8. avinash says

    25 February 2008 at 22:41

    Hi Kailash, check this blog entry.

  9. Insah says

    1 March 2008 at 21:28

    Hi Mr Meetoo,
    Thanks for inspiring n motivating us in programming. Im a 2nd year student in Electronics and Computer Science at UOM and i study programming languages with u. I love scheme a lot. I have a different and interesting view and trend of thought of programming, and it is becoming a way of life instead of just cramming syntax in our heads only to pass exams. Im very happy to have you as a lecturer who teaches us the essence of things and how blissful it is. Every friday from 9am to 11am, i have a great time with the way you teach us computer science which is not just science but a ingenious invention of man that when he uses it correctly, he can do almost anything. It would be great if u keep on motivating and helping us to achieve greatness. Have a nice evening.

    Regards,
    Insah Bhurtah
    ECS 2
    UOM

  10. avinash says

    1 March 2008 at 23:32

    Thanks for this very nice comment.

    It’s great to know that students appreciate the way I teach. My objective is to make you become autonomous and be able to learn any programming language or paradigm by yourself and have fun in the process…

Trackbacks

  1. Avinash Meetoo: Blog » Blog Archive » Learning Scheme with me says:
    25 February 2008 at 13:20

    […] As you all know by now, I am currently teaching the Scheme programming language to my 2nd year students as a means to master the functional programming paradigm. […]

  2. Scheme for Fun!! « :: Ashesh Ramjeeawon :: says:
    4 December 2008 at 16:53

    […] main reason for me to have such a keen interest to learn Scheme lies in the following quote: “Learning by experimenting is the best way to learn. Learning programming using Scheme is […]

Leave a Reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Our Personal Websites

Avinash Meetoo
Christina Meetoo
Anya Meetoo
Kyan Meetoo

You may also like

Default ThumbnailLearning Scheme with me Default ThumbnailScheme is a good language for beginners Default ThumbnailJohn McCarthy is dead Default ThumbnailWas the C Programming Language one of the best and, at the same time, one of the worst things to happen?

Random Posts

Another Earth

Liverpool wins the Champions League 2004/2005

Liverpool Champions League Round of 16

Recent Comments

  • Memento Mori by Depeche Mode on My Top 50 Depeche Mode songs
  • Memento Mori by Depeche Mode on I have my dream HiFi setup: Audiolab and Elac
  • Avinash Meetoo on High-End Hi-Fi Audio Companies

Archives

  • March 2023 (5)
  • February 2023 (1)
  • December 2022 (1)
  • November 2022 (1)
  • October 2022 (4)
  • August 2022 (3)
  • July 2022 (3)
  • June 2022 (5)
  • May 2022 (5)
  • January 2022 (3)
  • December 2021 (2)
  • November 2021 (1)
  • October 2021 (1)
  • September 2021 (4)
  • August 2021 (2)
  • July 2021 (14)
  • May 2021 (2)
  • April 2021 (4)
  • March 2021 (9)
  • February 2021 (2)
  • January 2021 (1)
  • October 2020 (1)
  • September 2020 (1)
  • August 2020 (2)
  • July 2020 (5)
  • June 2020 (3)
  • May 2020 (5)
  • April 2020 (6)
  • March 2020 (2)
  • February 2020 (2)
  • January 2020 (2)
  • October 2019 (1)
  • September 2019 (2)
  • July 2019 (2)
  • June 2019 (1)
  • May 2019 (3)
  • April 2019 (2)
  • March 2019 (1)
  • February 2019 (1)
  • January 2019 (3)
  • December 2018 (1)
  • October 2018 (3)
  • August 2018 (2)
  • July 2018 (2)
  • June 2018 (1)
  • May 2018 (1)
  • April 2018 (1)
  • February 2018 (1)
  • December 2017 (1)
  • October 2017 (1)
  • September 2017 (1)
  • August 2017 (1)
  • July 2017 (1)
  • May 2017 (4)
  • April 2017 (3)
  • March 2017 (4)
  • February 2017 (5)
  • January 2017 (3)
  • October 2016 (1)
  • September 2016 (1)
  • August 2016 (4)
  • July 2016 (1)
  • June 2016 (1)
  • March 2016 (3)
  • February 2016 (3)
  • January 2016 (1)
  • December 2015 (1)
  • November 2015 (2)
  • September 2015 (1)
  • August 2015 (3)
  • March 2015 (1)
  • December 2014 (1)
  • November 2014 (4)
  • October 2014 (1)
  • March 2014 (2)
  • February 2014 (3)
  • December 2013 (1)
  • October 2013 (1)
  • September 2013 (1)
  • August 2013 (1)
  • July 2013 (1)
  • June 2013 (2)
  • May 2013 (1)
  • March 2013 (3)
  • January 2013 (2)
  • December 2012 (3)
  • November 2012 (4)
  • September 2012 (3)
  • August 2012 (2)
  • July 2012 (3)
  • June 2012 (2)
  • May 2012 (1)
  • April 2012 (2)
  • February 2012 (1)
  • January 2012 (4)
  • December 2011 (2)
  • November 2011 (1)
  • October 2011 (4)
  • September 2011 (2)
  • August 2011 (1)
  • July 2011 (2)
  • June 2011 (4)
  • April 2011 (7)
  • March 2011 (2)
  • February 2011 (1)
  • January 2011 (3)
  • November 2010 (3)
  • October 2010 (1)
  • September 2010 (2)
  • August 2010 (4)
  • July 2010 (2)
  • June 2010 (1)
  • May 2010 (3)
  • April 2010 (4)
  • March 2010 (3)
  • February 2010 (3)
  • January 2010 (5)
  • December 2009 (2)
  • November 2009 (3)
  • October 2009 (1)
  • September 2009 (5)
  • August 2009 (3)
  • July 2009 (1)
  • June 2009 (3)
  • May 2009 (2)
  • April 2009 (7)
  • March 2009 (12)
  • February 2009 (10)
  • January 2009 (5)
  • December 2008 (4)
  • November 2008 (11)
  • October 2008 (6)
  • September 2008 (7)
  • August 2008 (3)
  • July 2008 (8)
  • June 2008 (6)
  • May 2008 (5)
  • April 2008 (7)
  • March 2008 (6)
  • February 2008 (3)
  • January 2008 (6)
  • December 2007 (11)
  • November 2007 (10)
  • October 2007 (7)
  • September 2007 (9)
  • August 2007 (3)
  • July 2007 (7)
  • June 2007 (8)
  • May 2007 (14)
  • April 2007 (11)
  • March 2007 (18)
  • February 2007 (14)
  • January 2007 (15)
  • December 2006 (16)
  • November 2006 (10)
  • October 2006 (7)
  • September 2006 (8)
  • August 2006 (8)
  • July 2006 (6)
  • June 2006 (4)
  • May 2006 (13)
  • April 2006 (10)
  • March 2006 (11)
  • February 2006 (7)
  • January 2006 (14)
  • December 2005 (8)
  • November 2005 (6)
  • October 2005 (7)
  • September 2005 (2)
  • August 2005 (6)
  • July 2005 (2)
  • June 2005 (6)
  • May 2005 (15)
  • April 2005 (12)
  • March 2005 (3)
  • February 2005 (8)
  • January 2005 (3)
  • December 2004 (1)
  • November 2004 (2)
  • October 2004 (2)
  • September 2004 (3)
  • August 2004 (3)
  • July 2004 (3)
  • June 2004 (3)
  • May 2004 (6)
  • April 2004 (10)
  • March 2004 (12)
Creative Commons License This work is licensed by Avinash Meetoo under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 Unported License.