Monday, August 15, 2005

The Perfect Programming Language

I have a very clear idea on how a perfect language should look. Actually, the design is so simple that it is altogether more annoying that something like this isn't already out there. I will call it the Perfect programming language.

1) The Perfect programming language should be compact and elegant. Good examples are Python, C and Lisp. If it fits inside someone's head with ease, it is compact. Perl and C++ are NOT good examples.

2) The Perfect programming language should be interpreted most of the time but it should be compiled whenever necessary. Lisp is the only one with a similar feature.

3) The Perfect programming language should have a large user community and a mechanism for distribution similar to CPAN. Also it should have something similar to sourceforge. C/C++, Java and Perl are where people should look for. Lisp is exactly what I don't want my language to look (i.e. fragmented in 1001 pieces).

4) The Perfect programming language should be dynamically typed. I don't want ugly templates similar to those that can be found in C++. Dynamic typing is the future. People should look for this at Lisp and Python.

5) The Perfect programming language should treat code as data. Lisp only makes the cut here.

6) The Perfect programming language should have objects. You should be able to do anything you want with those objects. Add methods to certain objects, create classes, inherit, extend, etc. CLOS, C++, Python and Ruby have all some interesting stuff in it. Perl does NOT look good from this point of view..

7) The Perfect programming language should be relatively easy to read. Any of the languages mentioned above (including Perl and Lisp) make the cut. Of course, something like Python is desirable. Actually I would love it if Python would have ';' (semicolon) removed. In this way you wouldn't be able to obfuscate the code. Of course, you wouldn't be able to write in-line code, but I wouldn't mind this very much. After all, people already have Perl and bash for in-line commands, I need a programming tool.

This is almost everything.

3 Comments:

At 2:36 AM, Anonymous Anonymous said...

"6) The Perfect programming language should have objects. You should be able to do anything you want with those objects. Add methods to certain objects, create classes, inherit, extend, etc. CLOS, C++, Python and Ruby have all some interesting stuff in it. Perl does NOT look good from this point of view.."

I really don't see why Perl doesn't "look good". It surely has every feature Python has OO-wise, although I must admit that the OO syntax is badly designed (feels like they were too lazy to add keywords/grammar rules).

I think if the syntax was changed a little bit (that's possible with filters) it would be on your list. Anyway, Perl6 is a complete redesign and if it is ready by the time we retire, you'll add it to your list of languages with great OO features ;)

 
At 6:06 AM, Anonymous Anonymous said...

What semicolons should python remove?

I think Lisp doesn't look that good in comparison to python. Python can look like pseudo code.

While python is my favorite, i am currently looking into Lisp and lisp rocks! I want to get my hands dirty before i change my favorite, but Lisp is nearly there.

I don't want to be rude, but most of the perl scripts, i have seen, look more like a comic character was curseing than coding.

 
At 7:03 AM, Blogger Doru said...

I agree with most of andrei says. I only object to Perl OO features because (while the language is supposed to be complete rather than minimal) the feared to add a little bit of extra syntax (which would make things clearer). Until Perl 6 appears, I will continue to write larger projects in Python and smaller stuff in Perl.

beza1e1:
I am talking about the semicolons at the end of each line. They are optional in Python for now (i.e. you can write this:

print "hello, world";

or

print "hello, world"
)

IMHO, these semicolons at the end of the line allow you to write more statements on the same line. However, they allow you to obfuscate code this way. I want to make it practically impossible to write obfuscated code in the Perfect language. Python comes close to this.

Some might argue that this is a bad idea because some simple instructions might look better on one line. I think this is usually a bad idea. The only time I used this was when swapping variables in C. (and now in Python I can write stuff like a,b = b,a) so this goes out of questions.

 

Post a Comment

<< Home