how to create a c# based programming language

S

Steve Richter

I would like to create a new programming language that is based on
C#. call it XC#. Where the XC# command line compiler, xcsc,
functions as a precompiler that converts the xc# source code to c# and
calls the csc compiler to compile the resulting code.

how would the source code debugger work with such a thing? Where I
would need different source code views of the code being debugged. The
XC# code the programmer coded and the C# code that was actually
compiled. I would want the debugger to show the XC# code but suspect
only the translated to C# code would appear. Does the .NET debugger
support multiple views of the code being debugged?

( on the same note, it would be neat when debugging c# code to switch
to the MSIL view of the code )

xc# would have a feature for interspersing native sql into the c#
source code:
int activityId = 5 ;
DateTime activityDate ;
Decimal activityAmt ;
/sql
select a.activityAmt, a.ActivityDate
into :activityAmt, :activityDate
from Disbursements a
where a.ActivityId = :activityId
/end

In Visual Studio I would want the source to be handled as c# code
until the /sql line is encountered. Then my addin that parses xc#
code would kick in.

Just dreaming. would be great if programming languages could inherit
from base languages just like classes can inherit from base classes.
Interested to know what is doable and what is not.

-Steve
 
P

Paul Hadfield

But don't get disheartened just because MS may have beat you to it, it just
proves that you're thinking along the right lines. One day that idea might
be ahead of everyone else and make you your millions!
 
S

Steve Richter

But don't get disheartened just because MS may have beat you to it, it just
proves that you're thinking along the right lines. One day that idea might
be ahead of everyone else and make you your millions!

thanks. having millions some day will be wonderful.

inline sql code is just an example of what a pre compiler could do.
and it would work completely differently than LINQ. What about
switching inline from C# to HTML or XML? A precompiler could
recognize the embedded HTML code and compile it as C# Form control
equivalents.

to support such a thing you need the debugger to support the different
source code views of the executing code. Is this possible with
the .NET debugger?

The IBM AS400 has very good support for integrating the compiler pre
processor with the debugger: http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/apis/debug2c.htm
( the as400 had some great software technology. IBM also has total
nitwits running the company. )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top