Thursday, March 27, 2003

Haha ! I've thought up of another interesting programming language idea ! I'll call it "Curried C" ! ... reminiscent of ML .
Here's the idea: Functions are objects.

structs and unions remain the same ... only they have operator overloading, and returns and parameterization will be C++ style (default arguments, references, etc)

it will support infix functions, infixr functions and priority levels.

it will be even more weakly typed than C. (if possible!)

functions will be objects. you can make new instances of functions (The cool idea is that it'll just be optimized to save and load function states for a given set of variables ... quite reminiscent of C++ and even Javascript :-D ... ),
and will be able to specify variables in 3 ways :
A: local . variables are allocated upon entering the function, and de-allocated upon exiting.
B: static . variables are allocated upon the first time any function of this type is entered, and de-allocated only on exiting the program.
C: member . these variables are static, and remain the same only to the instance of the function they were created in.

It will also contain some of GCC's most excellent tweaks to c++ such as specification of the return object in the function header:
int f(x) :return x
{blah blah x blah}
and it will allow for optional use of brackets under functions (so they can also look like one-line if-statements and such)

Curried C will have a suspend statement similar to Icon's,
as well as anonymous functions, and the ability to declare functions as objects, and finally ... heh heh heh ... I'll include a specific library that'll allow programs to send functions across file descriptors ... I imagine it'll be easier than it seems, at least with Visual Studio.NET ... BUT I'M NOT WRITING THIS JUST for VS.net ... I guess I'll see about making object code in unix ... or maybe just a wrapper translator/compiler and a special library that adds function/object-code-manipulation abilities. Obviously there'd have to be limits, but I'm not worried about them right now ! It's an interesting idea all the same ! :-D

AND NOTHING MORE ! :-D (well , maybe one or two other ideas, but if anything, I'm probably going to toss a few other features OUT !)
However, first things first. I'll make a priority chart of the ideas I have one day, and figure out how the hell I can do all this :-p.
--------
Notepad entry for myself: don't forget to email bilal at email !