123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|530|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Concept/Design -> perfect 'fictional' programming languages

Fri, 15 May 2009, 08:21
JL235
As some people know I've been very interested in programming languages for some time. I'm often thinking of how I'd improve on a programming language. So for this discussion I was wondering, given an infinite amount of time and resources what would your perfect language be like?

For me two things come to mind. First for a typical language it'd have to be very terse like Ruby but would also be static because of all the checks the compiler can do. I'd also add some functional elements, like the pattern matching abilities so you can overload functions not just based on the type of the parameters but based on the value of the parameters (i.e. if 0 do this, otherwise do that). I'd also make all non-local variables final because again for the safety it can impose. I'd also try to emulate Erlangs concurrency in some sort of OO model, where perhaps every object's code is run in it's own seperate thread. When you call a method it just sends a message over and then the code continues on.

But second I've always been interested in languages that went further then just text. Something where the programming interface can be more natural or more powerful by offering something quite different. For a long time I've liked the idea of a grid based language that looks like an Excel worksheet, where program flow would travel from cell to cell. Essentially a higher-level version of Befunge.

To end, here is the source code for hello world in
Piet:

What would be your favourite fictional language?
Fri, 15 May 2009, 10:27
Jayenkai
The thing with Piet is that, not only do you have to code the thing, but you also need to ensure the resulting image looks nice.
Can't be easy to do!

It's a nice concept, but... wowsers!!!

-=-=-
''Load, Next List!''
Fri, 15 May 2009, 13:57
Phoenix
I've been twisting and bending my head over and over again on this matter, trying to think of language innovations. The conclusion I've come to is that you can add static type checks, object orientation, functional elements and so forth, mixing different "components" commonly found in programming languages. You can add slight syntactical variations of your everyday imperative language, but in essence, there's rarely anything new added to the scene. Piet, Befunge, Brainfuck, HQ9+ and other esoteric languages may be creative ideas, but they aren't really practical.

What I'd like to see is something completely original, perhaps not even 100% text based. Since no new language created by an indie (or home-dev, which might be a more appropriate word) will ever reach the level where it can can contend with the giants such as C++, C#, Java, Python, or any other one with a large user base, one might as well focus on more experimental features. To be honest though, I don't have many exciting ideas. I'm devoid of creativity.
Fri, 15 May 2009, 18:23
CodersRule
Oh yeah I've heard of Piet before... lol.
Sun, 17 May 2009, 03:57
Mog
Mindfuck. Best of all esoteric languages, or LolWut

-=-=-
I am Busy Mongoose - My Website

Dev PC: AMD 8150-FX, 16gb Ram, GeForce GTX 680 2gb

Current Project: Pyroxene
Sun, 17 May 2009, 04:06
cthug
brainfuck
Sun, 17 May 2009, 18:04
Mog
Whatever...
Sun, 17 May 2009, 19:29
JL235
I wasn't thinking so much estoric languages, but what languages you think would be cool if they existed.
Mon, 18 May 2009, 06:57
steve_ancell
A programming language that does what you tell it in plain English would be cool. But computers and software that intelligent don't exist yet, do they ?
Mon, 18 May 2009, 07:29
JL235
I've always wanted something like that, but I think it's only a way off for full blown programming. Lots of interactive AIs exist now and so I've thought it would be nice for something like a GUI generator. You'd talk to it:
When done it would just dump the code behind the resulting GUI to a file where you can add the event code.
Mon, 18 May 2009, 09:50
steve_ancell
It would be great if it was that simple though
Mon, 18 May 2009, 10:10
Jayenkai
That's nice.
But I'd probably shorten it a bit, 'cos "I want the label to say" seems super lengthy to type in!

|edit| Although.. If you were 'saying' it... ... |edit|

-=-=-
''Load, Next List!''
Mon, 18 May 2009, 19:38
JL235
These would all be valid alternatives:

Which is what would make the GUI AI so useful.
Mon, 18 May 2009, 20:56
cthug
problems with a language like that,

* It would have to be compiled, imagine the overhead of an interpreter neeeding to parse all that.
* external libraries.
* The amount of keywords, The label displays "Hello World", three keywords for one instruction. I think that this could be more confusing, how these sentences are supposed to be organised

plus BASIC dialects almost read as english anyway

-=-=-
CTHUG.co.nr
Get Ubuntu
Mon, 18 May 2009, 22:53
JL235
My example wasn't a programming language, but using natural (proper) English for interactively building small parts of a program (like a GUI). The keywords are the same ones you would use for describing it in real life. The grammar of the language would be the same as proper English (although probably a bit more like you were talking to a simpleton).

There are lots of AI bots today which are more then fast enough for you to have real-time conversations with (although very few are any good). So I don't think speed is an issue. Plus as I said above, when done it could dump the source code of the resulting frame (i.e. C, VB, Java, XAML, whatever).

It could be very useful for rapid development of small applications. Describe GUI -> dump code -> program in your app specific code. Especially if you hooked it up use with voice writing software.
Mon, 18 May 2009, 23:29
cthug
I though that was the whole language; nvm
Tue, 19 May 2009, 21:18
mindstorm8191
I was actually trying to make a language of my own, for a while. My plan was to allow the code to modify itself, or at least be able to. With a basic syntax, you could start fetching lines of code, for various functions, and then add / delete / replace the lines in there.

For running the code, it would be entirely interpreted (after all, the code could be modified at high-level language). I was actually getting a proper interpreter started, but had some issues putting my design to practice. Since the language would allow multiple threads as well, I couldn't simply handle various tasks by function calls. I'd have to handle everything on one thread, and then jump to another. I began building this intricate data structure which could handle it all, even function calls nested into lengthy expressions. But, somehow, things didn't seem to take off right...

-=-=-
Vesuvius web game
Sat, 23 May 2009, 15:19
CodersRule
I always wanted to be able to make a language that could write its own code, like this:

so basically, if i was 12, the variable u12 would be set to 18, and if i was 18, the variable u18 would be set to 18.
(a pretty bad example, but you get the idea)
Sat, 23 May 2009, 15:40
Phoenix
This is possible in many scripting languages, including ActionScript, JavaScript and Python, and is commonly called the "eval" function. This ultimately leads to code which is slightly less readable than Sanskrit written backwards by a penguin with boxing gloves using hollandaise sauce.
Sat, 23 May 2009, 20:59
JL235
Languages which have eval are often very difficult to compile. This was one (of many) complaints that the writer of PHC (the PHP compiler) had about PHP. It's also something that makes code very difficult to optimize because the program can be fundamentally changed to anything in a completely unknown way. Essentially there is no way (or it's extremely difficult) to predict what the structure of the program will be after the eval has occured.

In contrast evals are pretty trivial to implement in interpreters which is why they are so common in many scripting languages.

One thing I liked about Ruby is that there were lots of alternatives to eval such as methods for just creating a new variables or adding methods to an indevidual object. I think it might be interesting to see a language which takes this (and eval) further. I'm thinking something more advanced then just generating some text and sending it back into the interpreter.