473,385 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Create own compiler

Hi Group,

I just want to develop a language of my own. Not a big one.. Just I
want to write a line like

printme("Hello World");

I want to create a compiler to compile this and convert into MSIL. As
per CLS, i think we can know what is the format of MSIL. So, if I say,

compileprog.exe mypro.prog

means, it should create mypro.exe. This I should include in any .net
application and use.

How to create a compiler and convert my language to MSIL??

I just want to have a try. So, converting this single line into MSIL is
enough for me...
Regards,
Raja Pandian

Feb 6 '06 #1
3 3023
Hello Raja,

You 'd have to learn Intermediate Language Assembly language first, because
that is the bytecode of managed executables.
What you could do is build a small hello world console application in C#,
and then disassemble it with ildasm.exe
that way you can see how the C# compiler translates your hello world program
into byte code.

That being said, building a compiler is very hard. if you want more
information, you could check out the dotGnu and mono projects on linux, or
rotor on FreeBSD. they are open source C# projects.

--

Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"
"raja_svks" <b.***********@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Hi Group,

I just want to develop a language of my own. Not a big one.. Just I
want to write a line like

printme("Hello World");

I want to create a compiler to compile this and convert into MSIL. As
per CLS, i think we can know what is the format of MSIL. So, if I say,

compileprog.exe mypro.prog

means, it should create mypro.exe. This I should include in any .net
application and use.

How to create a compiler and convert my language to MSIL??

I just want to have a try. So, converting this single line into MSIL is
enough for me...
Regards,
Raja Pandian

Feb 6 '06 #2
>I just want to have a try. So, converting this single line into MSIL is
enough for me...


Then I suggest you start looking at using the System.Reflection.Emit
namespace. It's powerful enough to handle things like this.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Feb 6 '06 #3
> How to create a compiler and convert my language to MSIL??

I just want to have a try. So, converting this single line into MSIL is
enough for me...


another option would be to create a compiler that translates your language
to, let's say, C# and then internally calls C# compilers objects to create a
..net executable. there are at least two interesting .net languages known to
me that started this way and the direct msil generation was added much
later.

Wiktor Zychla

Feb 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: James Proctor | last post by:
Hi there, im brand new to ASP. Ive done loads of VB coding and one of my clients is intrested in a web based application, so im trying to play on and learn it a tad. However im comming across lots...
6
by: Sebastian | last post by:
Do you have a simple example for creating a simple hello world compiler in c# or vb.net? thanks Sebastian
1
by: James Proctor | last post by:
Hi there, im brand new to ASP. Ive done loads of VB coding and one of my clients is intrested in a web based application, so im trying to play on and learn it a tad. However im comming across lots...
1
by: nestle | last post by:
I know how to create a file, by using F=fopen("name of file with extension","w"); , where F is a pointer to the file. But how do I create a folder? Do folders have some kind of special format? Please...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.