Design the ultimate programming language!!

Status
Not open for further replies.
Anyone with more than a passing knowledge of computers knows that there is a truckload of high-level programming and scripting languages to choose from. (e.g. BASIC, COBOL, C, C++, Pascal, Java, Python, Ruby, Arc, perl, FORTRAN, etc...) Each has different features, differnet advantages, disadvantages, flaws, bugs, shortcuts, etc.

Here's the challenge - How would you design the ultimate programming language? What features (line-numbered/structured/OO, machine-code compiled or interpreted, etc) would it have?

To spice it up, try the question in two parts. First, imagine that there are NO HARDWARE LIMITATIONS. Essentially, picture yourself coding on the GodBox, and describe the language you would use.

Next, be realistic. What kind of language would you cook up to use on current hardware?

...

I have no answers here - too much of a newbie. I'm just gonna sit back and watch :)

-Gabe
 
why?

All these languages are Turing complete and therefore functionally equivalent. So, um, maybe I'd ask Santa for a better JIT Java compiler and a faster JVM...

I don't mean in abstract terms - you are missing the point.

For example, C++'s classes make it possible to create objects, which makes it easier for a person to write a large program than in, say, BASIC. As a result, you might want to include some sort of class functionality in the Ulitmate Language.

If we didn't have to worry about people having to understand and work with code, we'd all program with straight binary instructions - that'd be Turing complete too. I am curious what facets of a language make it easier for A PERSON to use.

-Gabe
 
why?

All these languages are Turing complete and therefore functionally equivalent. So, um, maybe I'd ask Santa for a better JIT Java compiler and a faster JVM...

What does that have to do with anything. Of course they're functionally equivalent you
silly boy, but gredner asked about desinging languages on a programmatic or syntactic level - from the user or programmer's point of view.

Anyways...

You have to define what you mean by ultimate.

1) Fastest to execute: clearly machine code or (slightly worse) assembly
2) Easisest to use: a language that has many built in functions and resembles natural lanagues (i.e. English) and intutive human thinking (ie OO and logic)
3) Smallest code size: see 1)
4) Cross-platform ability: an interpreted language,,,esentially wave goodby to 1) and 3)
5) Power of scope: see 1)

If I were to design a new language, it would: be just like ANSI C, but have cleaner syntax like Java, have the same OO capabilities as Java but NOT C++, and be compiled. Keep in mind that that's for a systems programming language.

As an aside, you forgot to mention VB in your list...watch out, they'll get ya!
 
quote:
--------------------------------------------------------------------------------
As an aside, you forgot to mention VB in your list

--------------------------------------------------------------------------------

Intentional? Maybe...
-Gabe

Edit: It fits nicely in the "etc..."

Damn right, you said it...

;)

[This message was edited by Level_7 on January 23, 2002 at 21:58.]
 

Redshift

Ars Scholae Palatinae
1,260
Eh, it really depends on what you are going to do with it. Where
I work, if we have memory leaks or unhandled exceptions someone could
die. We use Ada, and though I don't like it, it is the best
language for the job. Level_7 described some things he would like
in a systems programing language... the same feature's wouldn't
necessarily be good for programming web apps...

Anyway, all that aside, I like Java. So: Java on speed; java
that compiles and runs as fast as C. And what's exciting is that
Java will _eventually_ be fast enough to make most people happy...
with (in addition to language improvements) computers becoming twice as powerfull ever couple o' years, and programs not increasing in complexity at that rate.
 
Ok, how about a system where you speak in natural English(all other languages be damned) and your GodBox translates this into structured code, and then optimizes the hell out of the bottlenecks using an evolutionary method to find the best one. So basically you could read out a UML diagram and you'd be done. Hopefully you wouldn't even have to even go down to the variable level. Now that's an expert system I'd like to see. While some may say this doesn't qualify as a language, it allows the programmer to translate his ideas into binary code, so it does the same job
 

Trystero

Seniorius Lurkius
11
Here is a list of programming languages we don't want the "ultimate" programming language to be anything like

Evil Programming Languages
A sample from the page:


Kvikkalkul
Revealed to the world via two anonymous postings to Usenet, this language was allegedly used on Swedish submarines for real-time applications, and is also supposedly Top Secret in Sweden--the postings threaten dire consequences for Swedes in possesion of the language. Most likely, it is a joke. The language itself is quite impressively difficult to deal with. For example, i/o is done via Baudot codes (a 5-bit system for character representation!) and all numbers are between 0 and 1, fixed point. There are no letters and very few symbols in the language--multiplication is )( and not-equals is :/:. (Equals is ::.) A very strange language.
 

_klamath_

Ars Scholae Palatinae
770
If I were to design a new language, it would: be just like ANSI C, but have cleaner syntax like Java,

You think Java's syntax is "clean"? What about primitive types? Inner classes? The enormous cludge of anonymous inner classes for closures/first-class functions that was hacked on in Java 1.1 (IIRC)? The contradictory mess of "final" qualifiers (does it mean "inline me"? Or "can't be over-ridden"? Or "field can't be modified after initialization"?)

Perhaps Java's syntax is (somewhat) less of an ugly mess than say, C or C++'s, that doesn't give it anywhere near the cleanliness or beauty of, say Scheme or Python.

have the same OO capabilities as Java

Again, Java's OO capabilities are relatively limited. Smalltalk and Ruby implement cleaner object models, while the object models in Common Lisp and Dylan are more powerful (multi-methods == sweet!).
 

russ-iha

Ars Praefectus
4,407
Subscriptor
Level_7, mmm-hmpf! ;)

The idea programming language would take completely natural english as its input... i.e. we wouldn't even write interpreters to try and read english and deconstruct it into tasks... the compiler itself would understand english. There would have to be some standard vocab though.

ex:

code:<HR>
Code:
<P>x is a number. Count x from 1 to 20 and print 'Hello World' each time.<P>

The compiler would have to understand the is construct .... i.e. that is and all its various verb forms indicate that a variable is being assigned or created. 'And' would tell the compiler to somehow link the next statement to the previous one.

It would be hella complicated to implement :D
 
Design the ultimate programming language!!
C#.

That was easy, who wants donuts?

The idea programming language would take completely natural english as its input... i.e. we wouldn't even write interpreters to try and read english and deconstruct it into tasks... the compiler itself would understand english. There would have to be some standard vocab though.
Programming languages must be precise; the rigid form and syntax helps programmers by making bugs stand out as breaks in the standard rules.
 
The compiler would have to understand the is construct .... i.e. that is and all its various verb forms indicate that a variable is being assigned or created. 'And' would tell the compiler to somehow link the next statement to the previous one.


It would also be crap for programmers.




Who wants all that crap when something like:


Code:
for(int x = 0; x < 20; ++x) cout << "Hello World!" << endl;


Which is easier to parse, shorter to write, and more precise. All of which are good things.




Unlike yours, it specifies the increment, the kind of number, and inserts new lines between each "hello world", which is surely a good thing.

 
D

Deleted member 5324

Guest
I don't think it could get much better than sml-nj with an s-expression based
syntax (and the macros that come with that :)) and a generic system of at least
equivalent power to C++'s templating mechanism.

Some of the compile-time garbage collection action that the MLKit has going on
would be rather interesting too.

Of course, having the cool concurrency and reliability primitives that Erlang
has wouldn't be bad...

And no one can complain about having the standard library of Python to make
commodity programming easier.

Jeremy
 
I've had this one in my head for a while now, at least since seeing all of those _Scientific_American_Frontiers_ shows about robots when i was a kid. Basically, the problem is to design a robot that will be able to respond to commands adaptively, as a person would. For example, if i say to my robot, "Fetch me a shrubbery!", it should be able to look up what a shrubbery is and where to find one, surmount obstacles enroute, call me from the shrubbery store to ask what kind I want, and truck it home (and know not to dump the thing in my living room - this is important).

So, IMHO, an english-language programming language would function in much the same way, just scripted. I might say to my computer, "create a new task - call it 'maintain shrubberies'. Whenever we are short on shrubberies (it would automatically interface with iShrub for this :D ), go online and find the lowest price for a new shrubbery, and order it if I can afford it. Then hire someone to come plant it. End task." The computer would then pipe up and ask for you to fill in necessary specifics (i.e. what kind of shrubbery, what you mean by "if I can afford", etc.) Then you could say, "Maintain shrubberies continuously", and your box would run the task until you, or its good common sense (also important) told it to stop.
There would have to be some standard vocab though.
I disagree. The whole point of makeing the thing fluent in English is so that you can tell it what you want in any form, and (just like a person) it would be able to figure out the best way of doing it. Replace russ-iha's example with:
"Print 'Hello, world!' 20 times, one per line" No x's to deal with - leave that to the compiler.
Programming languages must be precise; the rigid form and syntax helps programmers by making bugs stand out as programmers by making bugs stand out as programmers by making bugs stand out as breaks in the standard rules.
Again - the compiler would be intelligent - it would ask you questions until it understood exactly what you wanted to accomplish. Then, it would write the optimized code itself, bugless and concise. A person would not even need to see it, unless one was writing a compiler.
Who wants all that crap when something like:

for(int x = 0; x < 20; ++x) cout << "Hello World!" << endl;

Which is easier to parse, shorter to write, and more precise. All of which are good things.

Unlike yours, it specifies the increment, the kind of number, and inserts new lines between each "hello world", which is surely a good thing
Refer to above Hello world example. You would rarely, if ever, have to see your commands written. If you were curious, you could ask, "What does the 'maintain shrubbery' task do?", upon which your box would respond, "It checks that we have enough shrubberies, and orders new ones if we run short." You could ask it for more details if you desired.
"Easier to parse" is irrelevant, at least on the GodBox.
Try totally unpossible.
And man will never walk on the moon ;)
seriously, given an exponential increase in computing power, why not? I mean, if people can speak and think inelligently (at least some of the time), why couldn't we one day build a box that simulates a human brain in its entirely? (YES, far fetched. NO, not impossible) That would certainly be able to speak and interpret language, and since it would have the advantages of precise machine memory and logic, it would have no problem writing perfect code from a set of human instructions.


Wow, longest post ever. *whew*

-Gabe
 

Catfish

Ars Tribunus Angusticlavius
9,954
Going back a short way....
All these languages are Turing complete and therefore functionally equivalent
Oh silly me. There was I thinking of buying Visual Studio.net....why don't I just write it all in ASM - they're both Turing complete!!!

Someone's enjoying their computing machinery course a little too much....

[ADDENDUM:
I mean, if people can speak and think inelligently (at least some of the time), why couldn't we one day build a box that simulates a human brain in its entirely? (YES, far fetched. NO, not impossible)
Sticking with the computing machinery coursework for the moment, it can be proven that Turing machines are not capable of completing certain problems that humans can.
A Turing machine covers everything that could be described as a computer, from the first programmable weaving machines, to the state of the art neural net machines, to quantum computing and beyond.
So, unless we see a radical shift in the way computers function, there's no reason to suppose that human-like intelligence is possible.
]

[This message was edited by Catfish on January 24, 2002 at 09:48.]
 

MrMills

Ars Praefectus
3,727
Moderator
Well, here are a number of features that such a language would have, for me:


  • Fast compile times, or fast syntax checking (Delphi)
  • Support for blocks of code such as units or packages (Delphi, Java)
  • Pervasive object-orientedness (Ruby)
  • Properties (Delphi, C#)
  • Language support for creation of fast, good data structures (C++)
  • Several comment operators; one for 'comment to end of line' and at least two nested-type comment operators (Delphi)
  • Flexible for statement (C et al)
  • Universal support for a 'for each' type construct (VBScript, Ruby)
  • Anonymous functions, especially as iterators (JavaScript, Ruby)
  • Ease of moving code around; statements should have terminators, not separators (C et al), and list definitions should have an optional ending separator (haven't seen this one implemented in a language) so I could rearrange the elements quickly without 'fixing' the syntax
  • Built-in support for quick documentation generation (Java, Python, C#)
  • No block terminators; structure inferred from indentation (Python)
  • Powerful macro features (LISP, C et al)
  • Use of English for reserved words, and a more English-like ratio of alphanumeric characters to nonalphanumeric characters (Delphi; opposite: Perl)
  • Non-case-sensitive (Delphi, VBScript); I've had too many times where I had to fix some stupid case issue where I'm calling someone else's code and the proper capitalization isn't completely obvious


I'm sure I have more stuff I'd like in a language, but that will do for now.
 

klimas

Ars Scholae Palatinae
632
Maybe this is just arguing around the issue, but it seems like the hard part of programming is figuring out the algorithm, not typing in the syntax. So I don't really see how making a computer understand English would help.

Unless of course you could say, "Factor this huge number into two primes, use them to decode this message, then email the loser and let him know he's been owned. Also make me a sandwich while you're doing step one. Thanks."
 
Since I started this entire "programming using English" portion of the thread, let me clarify: What I meant was that it had to look like English, meaning not look like machine code or assembly pneumonics.

Programming languages must be precise; the rigid form and syntax helps programmers by making bugs stand out as programmers by making bugs stand out as programmers by making bugs stand out as breaks in the standard rules.

That's absolutely correct.

Level_7, mmm-hmpf!
The idea programming language would take completely natural english as its input... i.e. we wouldn't even write interpreters to try and read english and deconstruct it into tasks... the compiler itself would understand english. There would have to be some standard vocab though.

See my above explanation.

quote:
--------------------------------------------------------------------------------
Originally posted by russ-iha:
My example only works if the compiler completely understands english grammar; since that is nearly impossible to do, there would be a lot of problems.
--------------------------------------------------------------------------------

Try totally unpossible.

Not quite. It is not true that only unambiguous grammars can be parsed.

As I said on the onset, I don't think English is the next programming language, just syntax that is easy to identify as English-like and does not look cryptic. Formal and unambiguous grammars are easiest to program in and create compilers/interpreters for given the current computing architecture and paradigms.

Also....

You think Java's syntax is "clean"? What about primitive types? Inner classes? The enormous cludge of anonymous inner classes for closures/first-class functions that was hacked on in Java 1.1 (IIRC)? The contradictory mess of "final" qualifiers (does it mean "inline me"? Or "can't be over-ridden"? Or "field can't be modified after initialization"?)

I said "cleaner". Also, Java's syntax is clean, on an absolute scale. You're right about the crap in Java1.1, but I don't think you're other points are valid. Finally, its a rather subjective issue...I think assembly has the cleanest and simplest syntax.

C#.
That was easy, who wants donuts?

Yeah, C# is pretty close.
 

MrMills

Ars Praefectus
3,727
Moderator
_klamath_:
The "macros" in C are not powerful, by any strech of the imagination -- nor are they even comparable to Lisp's macros.

I found C's macros useful enough to do the stuff I want macros to do. Shrug. I just meant that I want a powerful macro capability in my ultimate language.

By the way, for the "you should program in English" folks ... check out AppleScript. :)
 
D

Deleted member 5324

Guest
Anonymous functions, especially as iterators (JavaScript, Ruby)

Ruby doesn't have first class or anonymous functions -- its blocks might provide
nearly the same functionality, but they're not first class nor can they be used
anywhere except where they're written.

list definitions should have an optional ending separator (haven't seen this one implemented in a language) so I could rearrange the elements quickly without 'fixing' the syntax

If you mean that lists can be either [1,2,3,] or [1,2,3], then both Python and
O'Caml support that (and I'm sure some other ones do too.)

No block terminators; structure inferred from indentation (Python)

The problem with this is that it seems very hard if not impossible to support
such indentation based syntax and powerful anonymous functions at the same time.
See the restrictions on Python's lambda statement.

Powerful macro features (LISP, C _et al_)

Well, as klamath mentioned, C macros aren't even in the same class as Lisp
macros -- you may have had success with C macros, but they're not very powerful
in the whole grand scheme of macros.

Jeremy
 

newton_meter

Ars Scholae Palatinae
1,424
Originally posted by Level_7:
Since I started this entire "programming using English" portion of the thread, let me clarify: What I meant was that it had to look like English, meaning not look like machine code or assembly pneumonics.

Did you mean "pneumatics"?

They tried that "programs look like English" once. Called it COBOL.

Programming is all about creating abstractions. And composing abstractions. I think the ideal language would be "optimized" for abstraction. English is not.

And, why English? If we're going to make a whole bunch of people learn another natural language, and then try to express themselves unambiguously (yikes!) in that language, why not choose Finnish or Hungarian?

(kg*m*m)/(s*s)
 

MrMills

Ars Praefectus
3,727
Moderator
jemfinch:
If you mean that lists can be either [1,2,3,] or [1,2,3], then both Python and O'Caml support that (and I'm sure some other ones do too.)

Yeah, that's what I meant. But more than that, I'd like any list to allow an extra comma. For instance, a parameter list given to a function (e.g. x = average(3, 4, 5, ) * sum(1, 2, 3, );), or a list of variable declarations (e.g. var x, y, z, ;). Basically anywhere there's commas, I'd like to be able to put an extra one in.

Well, as klamath mentioned, C macros aren't even in the same class as Lisp macros -- you may have had success with C macros, but they're not very powerful in the whole grand scheme of macros.

Sigh. And as I said to _klamath_, I want powerful macros. LISP-like is good, C-like is OK.
 
Originally posted by Thanatos22:
Quote: " Because this is a job for Esperanto! "Arguably the most logical non-computer-related language ever developed. Not one irregular verb in the whole thing. :D

Also in Esperanto's favor, there's a horror movie starring Bill Shatner,
recorded entirely in Esperanto!

Not sure what that has to do with anything, though.

(jfb)
 

MooseAreFun

Ars Legatus Legionis
10,827
Subscriptor
quote:
--------------------------------------------------------------------------------
Because this is a job for Esperanto!
--------------------------------------------------------------------------------

Arguably the most logical non-computer-related language ever developed. Not one irregular verb in the whole thing.

Refer to my not-too recent thread on Esperanto possibly being easier for speech recognition systems...


The ideal programming language would not say:
"Error on line 12, ; expected! Sudden death Program Error E1346532 unknown error occured".
It would say:
"Line 12, ; expected and added (<u>C</u>ontinue Compilation/<u>M</u>odify)?

It would NOT say "Error, class jkl must be in file jkl.java".
It would have nice BASIC-esque syntax such as:
FOR i=1 to 10
instead of:
for(int i=1; i<=10; i++) {}

It would absolutely not, under any circumstances be CASE BLOODY SENSITIVE!

It would have braces {} and be able to contract them at will, so:
public class test {
blah
blah
}

becomes:
public class test {...}

So you can hide code you aren't looking at.
I think this is in VS7, as seen in a post here, and I've fallen in love with the idea. Please, where is a java editor that can do that?
A HTML one that can contract tags, etc.
 
"Since I started this entire "programming using English" portion of the thread..."
I think I was the one to bring the subject up. Taking credit for someone else's idea is kinda lame.

Anyways, although there might be a certain lack of precision in English, with intelligent enough computers it wouldn't matter, and you would always have the ability to tweak whatever it comes up with. The power of abstraction would be much more readily available in such a language, since it is such a large part of English. Also, since it was in English, any programmer would be able to understand your work without having to learn a new language, even if he didn't use it. Computers are going to be powerful enough to do this within about ten years, I don't know if the software will be at the same level though. You might just have a program translating your words into C++ instead of a new language.


Nice name Trystero, I thought I was the only one to read that book.
 

_klamath_

Ars Scholae Palatinae
770
Programming in English is a really bad idea (even if it were possible). First off, English is inprecise: it's often easier to explain technical issues in code than in English, IMHO. The language wasn't designed for precise, technical specifications on the operation of a computer (i.e. code). It would be incredibly difficult for the computer to parse; ultimately, you'd have syntactically-equivelant English constructs resulting in different machine code, which would be chaos. What would eventually happen is people would create dialects for programming specific things; shortcuts and special words would be invented to cut down on verbose instructions; acronyms and metaphors would augment or replace regular English words. What would you get? A programming language

A good programming language would communicate ideas effectively to the programmer, and others reading the code -- but English would not be the best language. Take a verbose language like Cobol -- its syntax is horrible.
 
quote:
--------------------------------------------------------------------------------
"Since I started this entire "programming using English" portion of the thread..."
--------------------------------------------------------------------------------


I think I was the one to bring the subject up. Taking credit for someone else's idea is kinda lame.

Actually I did:

1) Fastest to execute: clearly machine code or (slightly worse) assembly
2) Easisest to use: a language that has many built in functions and resembles natural lanagues (i.e. English) and intutive human thinking (ie OO and logic)

followed by:

Originally posted by russ-iha

Level_7, mmm-hmpf!
The idea programming language would take completely natural english as its input... i.e. we wouldn't even write interpreters to try and read english and deconstruct it into tasks... the compiler itself would understand english. There would have to be some standard vocab though.

Who care's who brought it up...it was me, but I wasn't trying to "take credit", I wanted to expalain what I meant so people wouldn't get the wrong idea.
 
Now now, children, we can't have the two of you carrying on like this...
--------------------------
Back to business at hand:

I think that the discussion of an english (or esperanto, if you'd like) programming language is attacking the idea from an invalid angle. Nobody wants to make a new COBOL or AppleScript - the idea of an english-like language is to have an intelligent compiler that would read ideas from the input, rather than specifics.

Saying:
code:<HR>
Code:
Define an integer x, and assign 0 to it
print "Hello, world!" to the screen
add one to x and repeat until x is greater than 20
is a horrific way to do things. Rather, the english/esperanto compiler would accept
code:<HR>
Code:
 Print "Hello, world!" 20 times
or
code:<HR>
Code:
 Print 20 copies of "Hello world!"
or even
code:<HR>
Code:
 If you don't print 20 copies of "Hello world!" before I count to three, i'm gonna shove your RAM chips so far up your disk drive that...

The idea is to make code shorter by eliminating steps (e.g. the counter) that the compiler can infer and generate for you, invisibly.

-Gabe

[EDIT:] Two stars only? WTF? :mad:
 
Status
Not open for further replies.