Hey guys, can anyone give me a reference as to how Executable files are processed by a modern Windows operating system? The reason for this is that I plan to make a compiler in C# to compiler code from a my own scripting language to executable.
I don't intend to use IL code either...
I do understand that this would be VERY complex to make...
Exe help [SOLVED]
Moderator: Coders of Rage
-
- Chaos Rift Junior
- Posts: 204
- Joined: Mon Nov 21, 2011 3:01 pm
- Current Project: Web browser from scratch
- Favorite Gaming Platforms: SNES, PSP, PS1 and 3
- Programming Language of Choice: C#
- Location: A house near me
- Contact:
Exe help [SOLVED]
Last edited by tappatekie on Tue May 15, 2012 5:21 pm, edited 1 time in total.
- bbguimaraes
- Chaos Rift Junior
- Posts: 294
- Joined: Wed Apr 11, 2012 4:34 pm
- Programming Language of Choice: c++
- Location: Brazil
- Contact:
Re: Exe help
Usually you just pass the file as an argument to the interpreter. So:
And I don't know about windows, but in unix you can begin the file with the line
That line tells which program to use to interpret the file, so you can execute it directly:
Code: Select all
$ plywood file
I'm running your file! =)
Code: Select all
#!/bin/plywood
Code: Select all
$ chmod +x file
$ file
I'm running your file! =)
-
- Chaos Rift Junior
- Posts: 204
- Joined: Mon Nov 21, 2011 3:01 pm
- Current Project: Web browser from scratch
- Favorite Gaming Platforms: SNES, PSP, PS1 and 3
- Programming Language of Choice: C#
- Location: A house near me
- Contact:
Re: Exe help
Erm... I meant actually writing my own compiler in c# to generate an executable (.exe) version of the plywood script. Was looking for any references to get me started writing this compiler to be understood as an exe...bbguimaraes wrote:Usually you just pass the file as an argument to the interpreter. So:
And I don't know about windows, but in unix you can begin the file with the lineCode: Select all
$ plywood file I'm running your file! =)
That line tells which program to use to interpret the file, so you can execute it directly:Code: Select all
#!/bin/plywood
Code: Select all
$ chmod +x file $ file I'm running your file! =)
Or, I choose an easier way out :L, use .Net's CodeDomCompiler class to compile converted plywood source code to c#?
- bbguimaraes
- Chaos Rift Junior
- Posts: 294
- Joined: Wed Apr 11, 2012 4:34 pm
- Programming Language of Choice: c++
- Location: Brazil
- Contact:
Re: Exe help
Oh, I thought you just wanted to make it "executable". Sorry.
Generating machine language would be really hard, as it is completely platform dependant (requiring one implementation for each platform), as far as I know. You could translate it to another language that is already portable, like C# (or ANSI C ), then compile it. But take a look at existing interpreted languages that offer pre-compilation to see how they handle it.
Generating machine language would be really hard, as it is completely platform dependant (requiring one implementation for each platform), as far as I know. You could translate it to another language that is already portable, like C# (or ANSI C ), then compile it. But take a look at existing interpreted languages that offer pre-compilation to see how they handle it.
-
- Chaos Rift Junior
- Posts: 204
- Joined: Mon Nov 21, 2011 3:01 pm
- Current Project: Web browser from scratch
- Favorite Gaming Platforms: SNES, PSP, PS1 and 3
- Programming Language of Choice: C#
- Location: A house near me
- Contact:
Re: Exe help
Will do (c#), i'l start developing the compiler later :Dbbguimaraes wrote:You could translate it to another language that is already portable, like C# (or ANSI C ), then compile it. But take a look at existing interpreted languages that offer pre-compilation to see how they handle it.
And maybe, you'l see the compiler in action for Episode 2 :O
- OmenFelix
- Chaos Rift Cool Newbie
- Posts: 59
- Joined: Fri May 04, 2012 1:42 pm
- Current Project: Arcadian Descent(C++, SDL, KOS)
- Favorite Gaming Platforms: PS2, PC, XBOX, NDS
- Programming Language of Choice: C/C++
Re: Exe help
I'd highly suggest you use IL and base your compiler on this source: http://msdn.microsoft.com/en-us/magazine/cc136756.aspx. I've made many a simple .net language using that. If you struggle understanding the code then I'd advise you check out: http://www.youtube.com/casandramartappatekie wrote:Will do (c#), i'l start developing the compiler later :Dbbguimaraes wrote:You could translate it to another language that is already portable, like C# (or ANSI C ), then compile it. But take a look at existing interpreted languages that offer pre-compilation to see how they handle it.
And maybe, you'll see the compiler in action for Episode 2 :O
Casandramar is an old friend, and through working on a compiler with him, I grew greater knowledge of compiler development --a long time ago though. He doesn't update his channel any more, but nonetheless he has videos on using that source to make his own .net compiler and one you can make. Through watching his videos or just general-research you will gain knowledge of EBNF and BNF.
Anyway, good luck with your endeavours.
Why not check out my game-development forum at: http://f1rel0ck.netai.net
Or my 2D RPG at: https://www.facebook.com/pages/Arcadian ... 6873806531
Or my 2D RPG at: https://www.facebook.com/pages/Arcadian ... 6873806531
-
- Chaos Rift Junior
- Posts: 204
- Joined: Mon Nov 21, 2011 3:01 pm
- Current Project: Web browser from scratch
- Favorite Gaming Platforms: SNES, PSP, PS1 and 3
- Programming Language of Choice: C#
- Location: A house near me
- Contact:
Re: Exe help
Will do, however I won't be developing the compiler yet for a while :POmenFelix wrote:I'd highly suggest you use IL and base your compiler on this source: http://msdn.microsoft.com/en-us/magazine/cc136756.aspx. I've made many a simple .net language using that. If you struggle understanding the code then I'd advise you check out: http://www.youtube.com/casandramartappatekie wrote:Will do (c#), i'l start developing the compiler later :Dbbguimaraes wrote:You could translate it to another language that is already portable, like C# (or ANSI C ), then compile it. But take a look at existing interpreted languages that offer pre-compilation to see how they handle it.
And maybe, you'll see the compiler in action for Episode 2 :O
Casandramar is an old friend, and through working on a compiler with him, I grew greater knowledge of compiler development --a long time ago though. He doesn't update his channel any more, but nonetheless he has videos on using that source to make his own .net compiler and one you can make. Through watching his videos or just general-research you will gain knowledge of EBNF and BNF.
Anyway, good luck with your endeavours.