views:

270

answers:

5

Just curious. If you had the time and inclination to create a programming language, what characteristics would it have?

One language I would like to see would borrow as much from the syntax of Python as possible but compile to machine code that runs as fast as C or C++.

+4  A: 

A mix of COBOL and XML, for the lulz

<program>
    <data>
        <const>
            <name>myStr</name>
            <value><[CDATA[Hello, World!]]></value>
        </const>
    </data>
    <sub>
        <name>main</name>
        <params />
        <return />
        <code>
            <call>
                <name>writeline</name>
                <params>
                    <var>myStr</var>
                </params>
                <giving />
            </call>
        </code>
    </sub>
    <meta>
        <entrypoint>main</entrypoint>
    </meta>
</program>
Charlie Somerville
That would be a blast.
Eric W.
See the hello world I added ;)
Charlie Somerville
Now that looks intuitive ;)
Georg Fritzsche
Oh, of course. It's even enterprise-enabled already!
Charlie Somerville
+5  A: 

I would limit my language to one statement:

Solve my problem.

Maybe i'd add one modifier though, in case its urgent:

Solve my problem, please.
Georg Fritzsche
... sorry, but i couldn't resist.
Georg Fritzsche
A: 
  1. Programmer would be able to explicitly set the types of vars. And of the arguments in a cool way, like

    (string str, array(int)|int someint_or_more, any some_strange_argument)
    

    something like this :)

  2. Programmer would be able to use lambdas, closures, etc at least as in JS

  3. It would have protytipes-based OOP (like in JS)
  4. Blocks (if { ... }, etc) would act like a closures!
  5. It would have a special keyword to define a function which return constant value (if arguments haven't been changed) so It can be cached by compiler/interpreter without any programmers thought about it. It would be very useful, you would be able to use recursion for almost anything and don't really suck with perfomance!
valya
A: 

It should be fast and lightweight (not like the .NET Framework), but you should still be able to create fully functional and flexible GUI apps.

eWolf
A: 

A simple block for defining things that can run in parallel, so if I write:

parallel{
  do_x();
  do_y();
}
something_else();

do_x() and do_y() would be executed in parallel, but something_else() would only be run after both of them complete.

Brendan Long
I wrote a scripting language like this a while back. I called it psh or "pourne shell" as a bourne shell with parallel for loops. It worked wonderfully for me. I should clean up the page I had for it and put the repo up somewhere.
Dustin
I just wish I could do this in C++ or Java. It's not like it's *hard* to write things to execute in parellel, it just takes way more effort than it should for something this simple.
Brendan Long
You can do it in C++ - write your function template `parallel()` that takes e.g. multiple `boost::function` as arguments.
Georg Fritzsche
I wrote something like this in the early 90's for VAX/VMS. We had a project whose build times ran about 6 or 7 hours, and so I wrote a processor that would spread this across 8 or 9 uVAXes, based on `!FORK` and `!JOIN` comments in the build script - cut the build down to about an hour.
Paul McGuire