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

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

Avinash Meetoo

The Logo programming language

20 October 2007 By Avinash Meetoo 8 Comments

The other day, while visiting the new Editions de l’Océan Indien bookstore (appropriately called The Bookstore) in Rose-Hill, I discovered its basement containing lots of old books at very cheap prices.

I bought 5-6 books at Rs. 10 each among which Logo for Beginners by J.W. Penfold.

As you can guess by the name of the book, it talks of the Logo programming language, developed by Seymour Papert to teach programming to students.

To be frank, I did not have a very positive opinion of Logo prior to reading that book. It’s only when I came across page 3 that I realized that Logo was something special:

“LOGO derives from a family of languages known as ‘list processing’ languages, and these are the languages of so-called artificial intelligence”

What??? LOGO is a derivative of LISP!?! I couldn’t believe it. As you have gathered by now, I am very very fond of LISP and its children: Scheme, Haskell, Erlang and Ruby.

Programming in Logo

Logo, when used to teach programming, is very straightforward. For instance, this is the body of a procedure, called square, which draws a square:

repeat 4 [forward 100 right 90]

The following code then draws the figure that you can see above:

repeat 72 [square right 5]

It’s not complicated and, arguably, can really teach the basic concepts of computation very easily. No wonder lots of schools (especially in the UK) still use Logo.

Of course, Logo being a LISP derivative, can be used to solve very complex problems. It has higher-order functions for instance and this opens the world of map and reduce (and even Google).

Where to get Logo?

There are many free implementations of Logo. The “standard” seems to be UCBLogo also known as Berkeley Logo which works on lots of different platforms (Linux and Windows for example). I did not use that one.

Instead I found ACSLogo which is a fantastic Logo implementation for Mac OS X. It’s so good that it even won a Mac OS X Innovators Contest award in 2003!

Final thoughts

Try Logo. I think you’ll be impressed. And, in case you come across that Rs. 10 book, buy it. Rs. 10 is so little to pay to access such a wonderful world…

Filed Under: Apple, Education, Programming, Technology

Beware of type erasure in Java

14 October 2007 By Avinash Meetoo 13 Comments

This Java program I got from a blog does not compile:

import java.util.*;

class Egg
{
}

class Muffin
{
}

public class Breakfast
{
  private List<Egg> eggs;
  private List<Muffin> muffins;

  public void add(List<Egg> moreEggs) {
    this.eggs.addAll(moreEggs);
  }

  public void add(List<Muffin> moreMuffins) {
    this.muffins.addAll(moreMuffins);
  }
}

The error message is:

name clash: add(java.util.List<Muffin>) and add(java.util.List<Egg>) have the same erasure

I was amazed when I saw that. I finally found an explanation in this forum.

What is happening is that (I quote) “Parameterized types (aka Generics) are only to restrict the use to enter the right object into the collection. All the generic information is erased by the compiler.”

So that why I got a name clash error. Both add(java.util.List<Muffin>) and add(java.util.List<Egg>) are in fact the same method add(java.util.List)!!!

Generics in Java are only used at compile time. They don’t even exist at run time!

PS:

I am a fan of Erasure, the group. Vince Clark was the initiator of Depeche Mode after all…

Filed Under: Education, Programming, Technology

How I became a programmer

10 October 2007 By Avinash Meetoo 18 Comments

It all started around 1986 (when I was 13) when my dad bought me a Sanyo MBC-16 PC. It had an Intel 8088 processor running at 8MHz (compared to the 2000MHz Intel Core Duo I am using now), 640kb of RAM (I now have 2,000,000kb) and ran MS-DOS 3.22.

One nice “feature” of that PC was that it came with two floppies only (it didn’t have a hard disk). The first floppy contained the operating system and the second one was GW-BASIC.

GW-BASIC (do you know what GW means?) was without doubt the reason I became a Computer Scientist (so, thanks Bill!). Remember, I bought that PC when I was 13 and the only way for me to play was to write my own games. So this is what I did. I wrote numerous Space Invaders clones and I wrote my own version of Tron with a very slow collision detection algorithm…

I had one friend at Royal College Curepipe who was also a computer maniac. I think his name was Harry and he died when we were still in college… Anyway, one day he gave me one floppy containing one executable: turbo.com

I went home and ran it. It was Turbo Pascal 1.0 and I couldn’t program anything as I didn’t know the Pascal language. I did what all good geek would do: I looked inside the executable and I found a data segment containing all the Pascal keywords (program, var, type, writeln, etc.).

I guess I tried all kinds of combinations for days until I became a fairly good Pascal programmer. I then wrote my own Mastermind game. I also fondly remember typing a maze-generating and -solving program I got from SVM magazine. Those were the great pre-Internet and pre-Google days where you really had to be motivated to learn something new…

This PC had two graphical modes: one was 320×200 with 4 colors out of 16 and the other one was 640×200 monochrome. This was the CGA standard.

As the color palette was so limited (4 out of 16 colors compared to the 16,777,216 we have today), games tended to look the same :-)

I fondly remember King’s Quest I by Sierra and Karateka by Jordan Mechner:

My next computer was a Commodore Amiga 500 but I’ll write about it in a future post…

Filed Under: News, Programming, Technology

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 158
  • Page 159
  • Page 160
  • Page 161
  • Page 162
  • Interim pages omitted …
  • Page 273
  • Go to Next Page »

Primary Sidebar

Our Personal Websites

Avinash Meetoo
Christina Meetoo
Anya Meetoo
Kyan Meetoo

Archives

  • May 2025 (1)
  • April 2025 (4)
  • January 2025 (3)
  • December 2024 (2)
  • November 2024 (2)
  • October 2024 (3)
  • September 2024 (7)
  • August 2024 (1)
  • July 2024 (1)
  • June 2024 (2)
  • May 2024 (3)
  • January 2024 (2)
  • December 2023 (1)
  • October 2023 (1)
  • September 2023 (4)
  • August 2023 (3)
  • July 2023 (1)
  • June 2023 (4)
  • May 2023 (1)
  • April 2023 (1)
  • March 2023 (5)
  • February 2023 (1)
  • December 2022 (1)
  • November 2022 (1)
  • October 2022 (4)
  • August 2022 (4)
  • 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 (2)
  • 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.