Skip to main content
gamedev.net
🔒 Locked

Design your ideal script/programming language!

Started by CGameProgrammer 76 replies 1.1k views
Original Post
CGameProgrammer
CGameProgrammer
Sometimes I like to design a language just for fun. I whipped up this HTML file showing an example of a language I think would make a good replacement for QBasic. Specifically, a high-level Windows programming language friendly to newbies. A number of things in the code may seem like the kinds of things we really hate, but it is geared towards people new to programming. ~CGameProgrammer( );
~CGameProgrammer( ); Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
CGameProgrammer
CGameProgrammer
By the way, the point of this thread is to post your designs for languages and what their purpose is (mine is not a C++ killer, it'' just a newbie language, basically).

Also, some notes on mine:

1) The variables can be of undefined types, and you can reassign the same variable to different types at any time. But to assign it as a type, you say "variable = type". In function definitions and type definitions, doing that limits the variable to that type. I could have said "Name = text" in the Person definition for example.

2) Blocks of code use tabs to separate them. There''s no { or } or "end if" type stuff. But my idea was the code IDE would use borders, like in the HTML file, to make the blocks of code more apparent.

3) "my" works like "this->" in C++.

I have a bunch of other ideas not shown in that code. For example, end of line characters separate statements (as opposed to semicolons) but the exception is in parentheses. In other words, this would be allowed:

function Average = number ( N1 = number,
N2 = number,
N3 = number )

result = (N1 + N2 + N3) / 3

You could also put parentheses around any piece of code to allow you to split it among multiple lines. Within them, all end-of-line characters are ignored.

~CGameProgrammer( );
~CGameProgrammer( ); Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
Arild Fines
Arild Fines
Looks a bit like Python...



God puts an apple tree in the middle of the Garden of Eden and says, do what you like guys, oh, but don''t eat the apple. Surprise surprise, they eat it and he leaps out from behind a bush shouting "Gotcha." It wouldn''t have made any difference if they hadn''t eaten it... because if you''re dealing with somebody who has the sort of mentality which likes leaving hats on the pavement with bricks under them you know perfectly well they won''t give up. They''ll get you in the end. -- Douglas Adams
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
Brobanx
Brobanx
My favourite language would be Ruby, only instead of the "end" keyword to designate blocks of code, it works based on indentation.
Mayrel
Mayrel
My favourite language would my language-I''m-never-going-to-get-around-to-writing-a-compiler-for. Failing that, I think UnrealScript is real sweet. At a pinch, C#.

What I actually use is C++. If it had GC and constructors could be inherited, I''d be a happy man.

For scripting my game, I rather like the Quake3 solution - use the same language for native code and vm code. A scripting language would have to have GC, IMHO, or not be allowed to allocate memory dynamically (which is the restriction Quake3 imposes). I like UnrealScript because it has syntax for everything. C# doesn''t come with game-related syntax, but since you can add custom attributes, there''s no reason you couldn''t simulate the UnrealScript attributes in C# -- i.e. a suitable subset of C# could be compiled for the Unreal VM. Which would be cool.



Hail Eris! All fnord hail Discordia!
Machaira
Machaira
quote:
Original post by CGameProgrammer
...Specifically, a high-level Windows programming language friendly to newbies.

Sounds like you''re talking about Visual Basic.

Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development
Mayrel
Mayrel
I don''t like that VisualBasic is controlled by Microsoft.

VisualBasic .NET has inheritance, at last, so the language is more or less acceptable (although I think its too verbose). AFAIK, VB doesn''t yet have operator overloading, which also puts me off.




Hail Eris! All fnord hail Discordia!
CWizard
CWizard
I designed (and made a compiler for!!!) a modified version of the excellent BrainFuck language, where I added time control, functions, and a few other things. Nothing for a newbie though. On a second thought, not gurus either, or anyone for that matter .


CGameProgrammer
CGameProgrammer
I don''t like Visual Basic. It''s a very good Windows adaptation of QBasic, but I simply don''t like BASIC and its derivations. It''s newbie-friendly but it certainly could be better.

~CGameProgrammer( );
~CGameProgrammer( ); Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
Arild Fines
Arild Fines
quote:
Original post by Mayrel
AFAIK, VB doesn''t yet have operator overloading, which also puts me off.

It''s not going to happen either.



God puts an apple tree in the middle of the Garden of Eden and says, do what you like guys, oh, but don''t eat the apple. Surprise surprise, they eat it and he leaps out from behind a bush shouting "Gotcha." It wouldn''t have made any difference if they hadn''t eaten it... because if you''re dealing with somebody who has the sort of mentality which likes leaving hats on the pavement with bricks under them you know perfectly well they won''t give up. They''ll get you in the end. -- Douglas Adams
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
RuneLancer
RuneLancer
My favorite language is definitively BrainF*ck ^-^ While it isn''t one bit practical, it''s FUN! A REAL challenge. A fully Turing-complete language with just 8 instructions...

< ( p-- )
> ( p++ )
- ( *p-- )
+ ( *p++ )
[ ( begin looping )
] ( end loop; exit if *p == 0 )
. ( output a character using *p as the ASCII value )
, ( input the ASCII value of a single character into *p )

For the record, here''s a BrainF*ck program. It counts from 0 to 9 and outputs that. In other words the output is "0123456789" without the quotes.

++++++++++++++++++++++++++++++++++++++++++++++++
>++++++++++
[-<.+>]

Enjoy.
NaliXL
NaliXL
Hmm, I think mine would be Delphi with a short C++ style notation, and the possibility to evaluate in the form of "0 = false, anything else = true".
I know there's C++ Builder, but I think C++ itself is way too complex. I guess some kind of mix between Delphi and PHP would be ideal...
I think especially declarations in C++ are hard to read. Take those the Delphi way. Further, the obligation of a symbol before a variable, like the $ in PHP, makes code also much clearer, and also would make the delphi "var" keyword at declarations obsolete. An example class-declaration :

type TWhatever = class{
public
constructor Create($Arg1, $Arg2 : Integer); // Constructor
function SayHello($Times : Integer);
private
function SayBye() : String;
}
constructor TWhatever.Create($Arg1, $Arg2 : Integer){
if ($Arg1 && $Arg2) writeln('Class-instance created!');
}
function TWhatever.SayHello($Times : Integer){
for (($A : Integer) = 0;$A < $Times;A++) writeln('Hello!');
}
function TWhatever.SayBye() : String {
$SayBye := 'bye';
}


[edited by - NaliXL on November 26, 2002 9:08:39 AM]
Newbie programmers think programming is hard.Amature programmers think programming is easy.Professional programmers know programming is hard.
stodge
stodge
Personally I'd like to "re-create" the Torque scripting language. It's C/C++ like, weakly typed and very flexible. In case anyone doesn't know, it's part of the engine that powered Tribes 2 and hence is fast enough to use in Games. I believe it drove a lot of the Tribes 2 game logic.

Definitely I would create a language that lets me:

- call script functions from C/C++
- call script functions from other script functions
- call C/C++ functions from script functions
- access C/C++ variables from the scripts
- access script variabes from C/C++
- access script variables from other script functions
- load compiled or un-compiled script files from other script files

http://www.stodge.net - the powerhouse in personal commentary

[edited by - stodge on November 26, 2002 10:53:38 AM]
---------------------http://www.stodge.net
Oluseyi
Oluseyi
Scripting/Applications Programming language: Throw Perl, Python, Ruby and PHP in a blender. Skim the fat (excess, unituitive and non-intentional features). Serve chilled with a slice of SWT.

Systems Programming language:
Apply the following to C++
  • eliminate forward declarations (add a multi-pass compiler);
  • null references;
  • replace operator -> with operator . globally;
  • the ability to define new symbolic and textual operators (dot, cross, ** for exponentiation);
  • a cleaned up standard library (improve the definition and implementation of std::string, etc);
  • threading support;
  • a binary packaging system (eliminate header files); and
  • a standard binary ABI to facilitate language bindings.


[Edit: Formatting.]

[edited by - Oluseyi on November 26, 2002 12:18:30 PM]
Machaira
Machaira
quote:
Original post by CGameProgrammer
... but it certainly could be better.


You can say that about almost any programming package.
Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development
prh99
prh99
quote:
Original post by RuneLancer
My favorite language is definitively BrainF*ck ^-^ While it isn''t one bit practical, it''s FUN! A REAL challenge. A fully Turing-complete language with just 8 instructions...

< ( p-- )
> ( p++ )
- ( *p-- )
+ ( *p++ )
[ ( begin looping )
] ( end loop; exit if *p == 0 )
. ( output a character using *p as the ASCII value )
, ( input the ASCII value of a single character into *p )

For the record, here''s a BrainF*ck program. It counts from 0 to 9 and outputs that. In other words the output is "0123456789" without the quotes.

++++++++++++++++++++++++++++++++++++++++++++++++
>++++++++++
[-<.+>]

Enjoy.


I have a copy of the DeCSS algorithm writting in BF. It''s certainly and interesting language.
Patrick
Machaira
Machaira
quote:
Original post by Arild Fines
It''s not going to happen either.


The lack of operator overloading hasn''t hurt it''s popularity in the least, however. VB was never meant to be a hard-core language so things like that weren''t important. The fact that you can still do things like write good small games with it makes it even better.
Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development
Arild Fines
Arild Fines
That was my point. MS needs to differentiate between C# and VB.NET lest they become merely two syntaxes for the same language. The core audience for VB''esque languages never cared much for operator overloading(hell, it''s not all that commonly used in C# either) so it''s highly unlikely that MS will ever add it.
A more interesting discussion is whether VB.NET will get generics as scheduled in .NET 2.0. Initial comments from MS people seem to indicate it won''t. This of course means that VB.NET will not be able to use any .NET classes written using generics.



God puts an apple tree in the middle of the Garden of Eden and says, do what you like guys, oh, but don''t eat the apple. Surprise surprise, they eat it and he leaps out from behind a bush shouting "Gotcha." It wouldn''t have made any difference if they hadn''t eaten it... because if you''re dealing with somebody who has the sort of mentality which likes leaving hats on the pavement with bricks under them you know perfectly well they won''t give up. They''ll get you in the end. -- Douglas Adams
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
CGameProgrammer
CGameProgrammer
quote:
You can say that about almost any programming package.


Yes, that''s why I posted this topic! I was wondering if anyone else liked drafting original (or semi-original) languages. It wasn''t really about the pros and cons of existing languages, though obviously to create a new language it helps to see what works and doesn''t work with existing languages.

~CGameProgrammer( );
~CGameProgrammer( ); Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.