John Bayko
Posts: 13
Nickname: tau
Registered: Mar, 2005
|
|
Re: What would it take for a new language to impress you?
|
Posted: Jul 28, 2005 6:57 PM
|
|
I like statically typed languages, but think a lot more could be done with type inference. I'd like to go further, and have types specified without reference to hardware - for example, give them value ranges instead. I think it's good practice to spend a thought as to whether your variable's values will actually fit, but it's far too easy to skip that if you just assume "int" is always big enough. Granted, I've used systems with a type system like that, and someone somewhere usually declares a generic "int" type, but I think a lot of that would go away if you could also specify type ranges in terms of number of bits as a syntactic sugar for value ranges. If you're happy declaring a lot of int:32 variables, at least this way you can later change them to int:48 if it turns out you need a bigger one, and all the other int:32 declarations are unaffected.
I'd like to see all values support units attributes. Almost all values measure some actual thing, not just metres or degrees, but pixels, record count, ASCII or Unicode values, and so on. You can almost always attach a units attibute (which could be compound, such as miles/hour). This would probably catch a whole new class of type errors, and if conversion rules are given, would make a lot of math much more seamless. It would not need to be a static type, it could be dynamic as well. Sun's Fortress language seems to support this to a degree.
I think languages which need external files or command strings to program certain things, such as object-relational mapping schemes, or XPath queries, or rule processing engines (possibly GUI definition languages, though there's a partial case for those), are a symptom that there's something fundamentally broken with language support in that area. This shows up a lot in statically typed languages, though I think there are programming strategies that could reduce that a lot, if they were explored. However, dynamic language also suffer a bit - look at the handling of regular expressions in some of them.
Still, it seems only C++ has explored trying to bridge that gap, with its template system. Unfortunately it's power and flexibility leads to confusion, as you can no longer tell if << means shift left, write to output, or format hard drive.
In short, I think I'd like to see a language which has the ability to map language constructs to external concepts in an integrated and natural way, but that didn't disguise itself as part of the language itself - that is, you could tell what it was doing from looking at it. The metadata annotations in C# and Java 5 might be a step in the right direction, but are far from being more than a start. The meta-programming layer would definitely have a syntax distinct from the programming layer.
Finally, I'd like the visual representation, including punctuation, keywords, and so on, to be completely unrelated to its storage format. The editor would present the language according to a programmers defined preferences for syntax and formatting. The thing that would horrify most programmers is the idea that the source is not human readable, but that doesn't mean unrecoverable - a default syntax could be used for storage, or something XML based. However, it would be stored without formatting, so even the most dedicated programmers would prefer to view and edit it with an editor.
This is not really very strange. Everyone uses word processors, which present the document in a format completely different from what's stored in the file. And usually gives a number of formatting and viewing options. And web browsers give users the ability to magnify all text or scale images, change width and height, even block some things from being displayed (banners or popup ads). And most code editors today colour the text, even though you won't find this colour information stored anywhere in the source code file. This would solve all formatting wars, as every programmer sees exactly what they want to (editor wars would increase to compensate).
Is that impressive enough?
|
|