This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-02-23 12:22:17

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

C# help

I am designing my own programmming language, and making an editor for it in C#.
I want to add a compiler to the editor, so the code can be made into an exe.
Any ideas on how to do the compiler?

I have never used C# before, but it is pretty similar to Java so the editor's going well. However, I am still new so please don't make it really complicated!

Thanks in advance.  smile

Last edited by TheSuccessor (2011-02-23 12:39:07)


/* No comment */

Offline

 

#2 2011-02-23 12:35:26

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: C# help

*Whistles* that's quite a task you're trying! I don't have a lot of knowledge to share on the matter (even though I know C#.NET really well), but I'll do my best.

Probably, the easiest way to create this compiler is to fake it. This means doing what Jens did with Scratch2Exe, so you pack all of the files required (the user's code + a minimal code interpreter) into a self-extracting, self-running EXE using a language like NSIS (I don't think it's easily done with C#).

If you want to do it the hard way, I suggest you ask some professionals. Compiling a language is one of the hardest things to do for the average programmer, and it also requires (I believe) a thorough knowledge of assembly.

Offline

 

#3 2011-02-23 12:42:19

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: C# help

Thanks! I think I might "fake" the exe, as you suggested.


/* No comment */

Offline

 

Board footer