dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[DotGNU]C@


From: Peter Minten
Subject: [DotGNU]C@
Date: Sat, 10 Aug 2002 18:03:10 +0200

Hi,

again a pnet meeting has given me an idea. We were joking a bit about the
successor of C#, I first called it D#, but after Rhys pointed out there is
already a D language the name was changed to C@, pronounced cat. We came to that
discussion because once again the C# specs didn't permit something rather
logically (if (!object) to see if an object == null). And since it actually
seems a good idea to invent an improved C# language to me I decided to give C@ a
try.

The features list included below is the result of a preliminary brainstorm, it's
of course far from complete so if anybody has something to add to it please say
it. If the features list is big enough and investigation shows that it can be
done a C@ compiler could be build (giving us a competitive advantage over MS in
the languages field). Note that C@ is just like C# with exception from the
features on the list.

FEATURE LIST:

* Expression !object is a shortcut for object == null .

* Methods from other classes can be built into a class without inheriting the
complete other class by using an 'include ClassIdentifier.MethodName;'
statement. Such inherited methods are called mixins. Note that this will work
for every 'public' declared part of a class (thus also for delegates, events,
properties). This is actually a workaround for the C# rule against multiple
inheritance of classes and is based on Ruby mixins.

* C@ can compile to IL and use IL methods.

* You can use the 'prefer NamespaceName;' statement to make the compiler chose
for a class in a certain namespace when a namespace conflict occurs (solving
the preference issue).

* It has C like preprocessor that allows #include to be used to insert text
into a file before compiling and #define to replace strings in the text with
other strings (note that I'm not talking about member of the String class here).

* It has a #pragma preprocessor directive that can be used to control compiler
behavior.

* Build in support for regular expressions (like Perl, Python and Ruby have).
This makes C@ a good option for building parsers in. To pattern match the
following system is used:
A regular expression is a string with the following syntax: /regex/. To include
a slash in the regex you need to escape ('//').
A string is matched against a regex using the =~ operator which
returns the char number where the match started if a match occurred.
The regular expression functionality is put into a class, the =~ operator
is defined in the compiler as an alias for a function in the Regex class.
The Regex class will be in the C@ standard library using intercalls.
Note that if C@ gets regex functionality the C@ Standard Lib will offer this
functionality to all IL programs making the dotgnu.pm library superfluous.

END FEATURE LIST


Greetings,

Peter

PS: C@ is not perfect, but is it more perfect than C#. Since the # sign is
placed above key 3 and the @ sign is placed above key 2, the name for the most
perfect C like language would then logically be C! :-)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]