Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
Hello everybody, I really need some help here..

well I'm working on a project with VB.Net (or C#, I didn't decide yet), it's a programming contests desktop judge like "pc²" if you know it.

I'm wondering if I can find C, C++ and Java compilers code source programmed using Vb.Net (or C# if possible).
I did some research, but seems i'm a bad Googler :D
Thank you !
Posted

1 solution

While it is possible to do, I don't believe anybody has written a C/C++/Java compiler in VB.NET or C#. Writing a compiler is quite an undertaking, if you are wanting to go down that road then I would suggest learning ANTLR[^].

However due to the question itself, I'm pretty sure that this may be a task that is a bit over your head. If you want to study how compilers work there are many books on the subject (but fair warning, most are theoretical in nature). Assembly is the easiest compiler to start with, if you can write that one, then move on to the next.

[Edit]

BTW, Java is not a compiled language so-to-speak, its an interpreted one. The Java "compiler" compiles the source to bytecode, which is then interpreted by the Java VM. To make Java work on a different OS, you don't port the Java compiler, you port the Java virtual machine. Depending on the OS and architecture, this is either relatively simple or extremely complex.

This is why Java is an operating system independent programming language. You compile it once and run it anywhere. The JVM is what does the hard lifting.

[/Edit]
 
Share this answer
 
v3
Comments
pasztorpisti 18-Aug-13 9:44am    
+5 but unfortunately writing a compiler without knowing the machine code of at least one machine (let it be x86, arm, or a .net vm or java vm) isn't fun. Maybe writing a source-to-srouce compiler would be easier this way...
H.Brydon 18-Aug-13 22:51pm    
To expand on your thought ... Compilers are usually either written in a hardware specific language such as assembler for the target machine, or (after a brief minimal bootstrap process) in the same programming language as that being compiled. For example, the first FORTRAN compiler was written in FORTRAN. I wrote a C++ compiler in C++. et cetera... I would not expect a C++ compiler to be written in VB.NET or C#.
Philippe Mori 19-Aug-13 19:03pm    
Well I would think that many language compiler are written in C++ using some kind of libraries for lexing and parsing or relying on precompilation step (LEX, Yacc...)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900