Wednesday, February 28, 2007

Free Pascal with Lazarus IDE

I'm on a Mac, and installing Free Pascal with the Lazarus integrated development environment (IDE) wasn't easy, and really not very automated once installed. It uses GTK+, which has to be installed using Fink. Then three additional files have to be installed (two for Lazarus, and one for the Free Pascal compiler). Lazarus is a X11 application (X11 is equivalent to X on Linux).



I guess this is often the disadvantage of using open source software. It is somewhat more difficult to install, and the user experience is less well defined as with commercial and free software. Designing programs and designing user interfaces are two separate disciplines, few people have mastered both.

I haven't really looked into this, but the Learn Pascal Tutorial by Taoyue.com seems to be a descent introduction into the Pascal Language. Because Pascal is a compiler language, developing small programs is somewhat less comfortable than with an interactive mode, as some of the more modern languages have baked into them. Nevertheless, Pascal is the descendant of Algol, and the forerunner of a plethora of C type languages (e.g. C, C++, Objective-C, C#, etc.).

Should I mention that Free Pascal is compatible to Borland's Delphi? There was the original Pascal by Dr. Niklaus Wirth, Turbo Pascal by Borland Inc., Modula-2 (also by Wirth), and Delphi (by Borland). With both Free Pascal and Delphi it is possible to write GUI driven programs, and both compile lightning fast.

J

J is a powerful abstract language, which is a direct descender of the (in)famous programming language APL (A Programming Language). While APL uses mathematical notation with non-standard characters (which makes it look very cryptic, thus the earlier infamous reference), J uses standard ASCII characters. The free development software (IDE) is governed by JSoftware. It has a graphical user interface and good documentation--even for novice programmers--built in.

Common Lisp with IDE

Through a comment (found through Google) on Lambda the Ultimate I found an integrated development environment (IDE) for Lisp, called LispWorks Personal Edition. It is the free version of a commercial product, which has a few limitations (limited heap stack, five hours continuous operation, after which it shuts down, giving warning after four hours). This is perfect for learning Lisp, at least, for me who is used to GUI environments. I have CMU-Lisp on the command line, but I have no experience with Emacs, which seems to be a prerequisite for effectively programming CMU-Lisp.

A good resource for learning Lisp seems to be Successful Lisp: How to Understand and Use Common Lisp, by David B. Lamkins.

Using DrScheme

Before starting the How to Design Programs course, it is important to get accustomed with the program DrScheme by using the Help menu. You should definitely start by installing the programming environment DrScheme on you computer. The online manuals are somewhat outdated, because they are based on older versions of DrScheme. I advice against using those, and rather use the built-in material, which is much more recent.

For instance, if you--like me--want to know what operators are available for the Student beginner version, look it up in:

Help -> Help Desk -> Manuals -> Beginning Student Language -> PRIM OPs

The Help Desk is a searchable library, which means it has it's own search function. If you have any questions, you should use the Help menu to try to find an answer. You probably will find it, because the Help Desk is pretty extensive.

Why this blog?

The idea for this blog started when I had problems understanding the concept of closure. I came across closure in Chapter 6.1 of Programming in Lua. Lua is the scripting language for the animation program Anime Studio (see my other blogs: Anime Studio Lua Scripting and I want to draw animation).

Anyway, I couldn't understand the concept, and because it came from functional programming, I thought, why not learn that as well? One thing lead to the other, and I found an excellent tutorial on functional programming in How to Design Programs, which uses the programming environment DrScheme. DrScheme is a sandboxed version of Scheme, which has several skill levels, exposing only those features of the language you are supposed to be able to digest at that moment; other features are simply invalid and throw an error message.

I also came across the Wikipedia article on Programming Language, which states:

Although there have been attempts to design one "universal" computer language that serves all purposes, all of them have failed to be accepted in this role. The need for diverse computer languages arises from the diversity of contexts in which languages are used:

  • Programs range from tiny scripts written by individual hobbyists to huge systems written by hundreds of programmers.
  • Programmers range in expertise from novices who need simplicity above all else, to experts who may be comfortable with considerable complexity.
  • Programs must balance speed, size, and simplicity on systems ranging from microcontrollers to supercomputers.
  • Programs may be written once and not change for generations, or they may undergo nearly constant modification.
  • Finally, programmers may simply differ in their tastes: they may be accustomed to discussing problems and expressing them in a particular language.

One common trend in the development of programming languages has been to add more ability to solve problems using a higher level of abstraction. The earliest programming languages were tied very closely to the underlying hardware of the computer. As new programming languages have developed, features have been added that let programmers express ideas that are more removed from simple translation into underlying hardware instructions. Because programmers are less tied to the needs of the computer, their programs can do more computing with less effort from the programmer. This lets them write more programs in the same amount of time.

In my humble opinion this means that to write good programs, you need to use the appropriate language for the situation, and possibly a mix of computer languages. Because trying to learn several programming languages isn't done in a week, I thought keeping a blog would keep me motivated enough to succeed in this mission.

"What mission," you say?
I want to write programs,
computer language programs.