• 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 Scheme with me

25 February 2008 By Avinash Meetoo 13 Comments

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.

I started four weeks ago with a general introduction on programming paradigms and on the necessity to at least know the most important ones in order to become a decent programmer. As my students had already studied imperative and object-oriented programming become coming to my class, I offered them to teach functional programming (using Scheme), logic programming (using Prolog in principle) and scripting (using Ruby). This first lecture can be downloaded here.

The following week, I introduced Scheme by putting a lot of accent on the evaluation of expression and the definition of simple (mathematical functions). The lecture, which is available here, was followed by a lab sheet where the students were introduced to DrScheme and were asked to write a number of simple functions (like fahrenheit->celcius).

The next lecture was on recursion and I focussed on a number of mathematical functions like factorial, fibonacci, square root using Newton’s successive approximation etc. I spent some time introducing the concept of tail-recursion to them as well as the tail-recursion optimization that Scheme has to do.

As an example, this:

(define (o+ n m)
  (cond ((zero? m) n)
        (else (o+ (add1 n) (sub1 m)))))

runs in constant space (i.e. there are no recursive function calls at runtime) even though it is expressed recursively. During the lab, the students implemented and traced a number of recursive functions (using the tracing facilities found in MzScheme). They implemented o+’s friends, o-, o*, o/, o^, o=, o< and o> (corresponding, of course, to our usual +, -, *, /, ^, =, < and >) using tail-recursion so that they run as quickly as possible.

The last lecture which I had last Friday was on pairs and lists, the most fundamental compound data structures found in Scheme. I introduced them to car and cdr and showed them a number of fundamental algorithms acting on lists (like length). During the lab, I asked the students to implement a simple database of students and marks and this is inspired by what I read in Practical Common Lisp.

My observations

My lectures have been cool up to now. The students are lively and responsive to my jokes and “parentheses”. The labs also are going on nicely with students who are really learning new things and having fun in the process.

It’s too early to say whether they’ll become better programmers eventually but I feel they are on the right track…

Filed Under: Education, Programming, Technology

Reader Interactions

Comments

  1. Harry says

    26 February 2008 at 20:53

    I confirm scheme is really beautiful compared to c++ wer there are so many libraries, declaration types, variables and so on. scheme is really simple and easy to use. So far so good., im enjoying the labs and lectures. Thanks Sir. n i do hope we’l have fun also wiv the other two languages that we’l study…

  2. selven says

    28 February 2008 at 00:26

    flame me if you want, but i have never managed to understand that way of thinking
    “MIT does it this way so does Berkeley, they are the best, so we must follow”

    Why do we always have to follow, am not saying that mit dudes and berkeley dudes don’t deserve there place, but what am saying is that, instead of following, why not lead? why not find better alternatives instead, following following following, one day we might start saying “beuhhhh beuhhhh like sheep”

  3. avinash says

    28 February 2008 at 09:55

    Simply because the MIT and Berkeley lecturers have more experience than me :-)

    Of course, I’m not paraphrasing a MIT lecture (this would have been easy actually with OpenCourseWare). Rather, nanos gigantium humeris insidentes which as Samuel Taylor Coleridge put it in The Friend (1828) “The dwarf sees farther than the giant, when he has the giant’s shoulder to mount on.”

    So I not exactly doing “beuhhhh beuhhhh”. Rather I’m adapting what the best do to cater for our own students.

    What’s nice is that the latter like the lectures and the lab sessions. I can easily see that in their eyes. And they are actually learning very important programming techniques.

    I’m happy.

  4. flyjason says

    29 February 2008 at 10:11

    Looking at the first slide “…lists 8512 programming languages!”, which is wow a huge and very impressive number indeed!!, reminds me about a telling article (http://www.bitwisemag.com/2/The-Next-Big-Thing-In-Programming) which I recently read on bitwisemag. I recommend everyone of you to have a glimpse at it (actually it may perhaps unlock the future).

    So why are there so many PLs??! Hmm simply because most of them are YACLL (‘Yes Another C-Like Language’)!!! How do these languages really differ? Yeah you got it…a great deal of them are structured the same way with slight variations in the syntax.

    Here is an excerpt of the article (The Next Big Thing in Programming):
    /*
    …In the long history of programming they will, ultimately, all be seen as ‘more or less the same thing’ doing ‘more or less the same job’.

    …These are all, in their way, useful languages. But they are devoid of Big Ideas.
    */

    Yes, all of us must be wondering about what Big thing or breakthrough to loom up next in programming, if any?!!! Up to now, “…the goal has been to get the job done rather than to change the nature of the job itself”.

    The future is perhaps already set – and it’s YACLL!!! I desperately hope I’m wrong on that.

  5. avinash says

    29 February 2008 at 11:20

    What about this? Or this?

    Or simply this (or this)?

  6. flyjason says

    29 February 2008 at 14:31

    Languages always crop up…but will they stand the test of time? This is what is at stakes!! For example, logic programming languages (such as PROLOG) which were praised decades ago and indeed looked evenly promising are almost obsolete today.

    Exploratory programming looks equally promising. Will it shape the programming world to new heights? Will it be adopted by professionals? Is it a Big Idea? Let’s see if it lives up to expectation.

  7. avinash says

    29 February 2008 at 15:13

    My feeling is that people have missed the point for a long time. You can’t really write a complete application productively using only one programming language. For instance, a game’s 3D engine can be written in C++, the AI part using Scheme and Prolog and everything glued using Ruby. And plugins would be written in Lua. The languages only have to share the same “object model” whatever that may mean…

    It seems that Microsoft was ahead of the rest after all with its .NET architecture :-)

  8. Sandeep says

    1 March 2008 at 11:19

    I find scheme to be a good way of exploring other ways of programming. The teach-pack in Scheme make programs more obvious to understand… you remember the celsius program?

    You are the only lecturer who talks about technology and the people who developed them. Its encouraging and insightful.

  9. avinash says

    1 March 2008 at 23:30

    Nice of you to say that.

    I think it’s essential that students know who have invented the tools they use and why. It’s a good way to appreciate the tool and to (maybe) predict what the future will be.

  10. selven says

    7 March 2008 at 21:46

    what i find even more interesting (compared to know who invented it), is to re invent that tool, atleast, that gives me a sense of “that’s no big deal, he only did it coz he was born first” :p

  11. avinash says

    9 March 2008 at 11:47

    What is more interesting is to invent something new.

    Alan Kay said: “The best way to predict the future is to invent it.”

    And Coluche said (I’m translating): “It’s easy to be intelligent: think of something really dumb and say the exact inverse”

    As for “that’s no big deal, he only did it coz he was born first”, I’m not too sure about that or else there would have been nothing else to invent… because there were so many people born before us ;-)

  12. Ashesh says

    12 March 2008 at 08:40

    Hello Sir,

    After Scheme, are you planning or do you have in mind to teach Ruby/Rails?

  13. avinash says

    12 March 2008 at 08:52

    Hi Ashesh,

    I will teach Prolog for the next two week and then swiftly move to Ruby for one month. I don’t intend to teach Rails though. I’ll focus on the scripting and metaprogramming capabilities of Ruby.

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 ThumbnailScheme is a good language for beginners Default ThumbnailLearning by experimenting (with Scheme) Default ThumbnailAnswers for my Scheme and Prolog test Default ThumbnailThe best way to introduce programming

Random Posts

Should Liverpool buy Lukas Klostermann?

Orange expo 2009. What for?

Teaching to university students again (on a part-time basis)

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.