What kind of a programming language would you design?
Friday, 7. September 2007, 13:36:12
I'm sure all of us who program, and maybe even some who don't, have wanted to change some thing in a language.
What kind of a programming language would you design, if you could just decide the awesome features for the language and have a team of top programmers implement it for you? Well, you could of course do it yourself too if you wanted...
Feel free to pitch in even if you're not a programmer
I really like PHP, Python and C# so my language would be like they are.
Here's some ideas for my dream language:
Strict typing
I would pick strict typing over loose typing, because I feel that strict typing improves code quality and you won't run into situations where a variable is of different type that you expected. It also gives a performance improvement.
The language should still keep it very easy to cast/convert variables from one type to another. Similar to C#'s way of doing things would be nice - it has a full Convert class which handles converting from types to others, such as Convert.ToInt32. It also has things like Float.TryParse and Float.Parse which can be used to parse a variable as a float.
Support for both OOP and Procedural programming
Similar to PHP, my language would support both Object-Oriented and Procedural programming. I favor the OOP approach, but procedural programming can be faster for prototyping or testing things and for small projects. However, unlike the current version of PHP, it would support namespaces and the default library would be class based. Note that namespaces are coming to PHP with PHP6.
Large builtin class library
Similar to all of PHP, Python and C#, the language should come with a big class library.
Automatic memory management
The language should have automatic memory management and garbage collection, similar to all of the three languages mentioned. However, it should provide some access to the routines like C# does.
C#-style syntax
The language syntax would be similar to C#'s. I do like the Python syntax a lot too, so perhaps some ideas from there too.
Good performance
The language should scale quite well and have good performance figures. It's okay if it isn't as fast as C/C++, but it should at least be around the level of C#. If this requires compilation to an intermediate language, that's okay.
Purprose
What would a language be without a purprose? The purprose of this language would be similar to C#'s - It should be easy to do both traditional client/server apps with it for Windows and Linux based systems and it should be possible to use it as a language for dynamic web pages like C# can with ASP.NET
This probably sounds a lot like C# - Yes! C# is great, but it doesn't work very well on Linux (yet?) and doesn't support procedural programming since it's pure OOP, so that's what my language would fix. What would your language be like?








NoteMe # 7. September 2007, 15:26
Anonymous # 7. September 2007, 16:04
(*) I want built in support for contract programming. I think Ada did this, and I guess you could put it into Scheme/Lisp with some macro magic that I'm currently unaware of.
Each function basically has "I require that the arguments passed in conform to these requirements". Nonnegative for an index for example. Given that I'll guarantee that my output will be non-null.
It was covered in the Pragmatic Programmers book but they only gave Java as an example. Few people program Java for fun :D So I never had a chance to try it but it sounds a good idea.
(*) Really tight IDE integration. I love the C# rename and extract method refactoring commands. I hear Eclipse has something similar for Java. I want the debugging in here too, and unit tests and an interpreter to play around with the objects.
(*) Reflection's great, also I'd like the eval function in Scheme that lets you evaluate code at run time. Pretty sure C# has one of these tucked away somewhere too.
(*) I'd like to see some support for Literate Programming too, I know it's seen as old hat these days but I think it could be quite good if it was easy to do. All that CWEB, or whatever it is, stuff wasn't my cup of tea. I don't like Make files and things - I just want it to work, once again tightly integrated into the IDE.
(*) If it's a new language it needs to do something novel about concurrency to make it easy to write a program that can take advantage of however many cores or CPUs are available on the machine it's running on. I hear Erlang really wins here but it's functional in style. I'd prefer procedural, but maybe that's not possible.
(*) Excellent cross platform libraries. C# has great set of libraries (though it's missing a bit from C++'s stl) but they are windows dependant. I'd love to write C# code as I do now and have it run on Mac and Linux without having to change lots of stuff.
and that's all I can think of for now.
zomg # 7. September 2007, 20:01