473,598 Members | 2,953 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3033
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************* *********@hotma il.com
Remove only "_nos_pam"
"raja_svks" <b.***********@ gmail.com> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.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.Reflecti on.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
2651
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 of problems. Up until now ive managed to sort most of them, but now im strugling. When i run my application i keep getting this. Server Error in '/WebApplication1' Application....
6
3399
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
3399
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 of problems. Up until now ive managed to sort most of them, but now im strugling. When i run my application i keep getting this. Server Error in '/WebApplication1' Application...
1
1888
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 someone tell me if it's possible to create a folder in C, and if yes then how?
0
7981
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8392
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8262
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6711
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5437
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3938
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2410
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1500
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1245
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.