Advertising (This ad goes away for registered users. You can Login or Register)

Implementing arrays and functions?

Programming on your favorite platform, for your favorite platform? Post here
Post Reply
Nickolas
Posts: 174
Joined: Sat Jan 22, 2011 3:14 pm
Location: In a black hole...

Implementing arrays and functions?

Post by Nickolas » Mon Dec 26, 2011 9:40 pm

Hey everybody... I've recently read this article http://msdn.microsoft.com/en-us/magazine/cc136756.aspx and I extended the compiler by adding if statements and more commands... I noticed that there's special IL code for functions with arguments and arrays... Could anybody show me how to implement those in my language?
Advertising
Image
Image
Image
Image

User avatar
m0skit0
Guru
Posts: 3817
Joined: Mon Sep 27, 2010 6:01 pm

Re: Implementing arrays and functions?

Post by m0skit0 » Tue Dec 27, 2011 8:03 am

IL code? Can you please specify more what you mean?
Advertising
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"

Nickolas
Posts: 174
Joined: Sat Jan 22, 2011 3:14 pm
Location: In a black hole...

Re: Implementing arrays and functions?

Post by Nickolas » Tue Dec 27, 2011 9:01 am

m0skit0 wrote:IL code? Can you please specify more what you mean?
You probably already know that, but the whole .NET Framework (Languages and Libraries) is translated to IL code before compilation and is then JIT-Compiled. That problem was solved by MONO using AOT-Compilation. I prefer the first method for my language. So, after the code has passed through my lexer and parser I use reflection Libraries to emit IL code that is "interpreted" by the .NET Framework runtime "compiler". I've researched the matter a bit and I found out that there's special IL code for arrays and functions with arguments and fields. I've managed to implement variables but I can't understand how to implement the stuff mentioned before... I've also looked a bit at the source code of Boo but it is too messy. :lol:
Image
Image
Image
Image

User avatar
m0skit0
Guru
Posts: 3817
Joined: Mon Sep 27, 2010 6:01 pm

Re: Implementing arrays and functions?

Post by m0skit0 » Tue Dec 27, 2011 9:24 am

Well I have no idea about .NET to be honest, but that seems a lot like Java. I'm sorry but I can't help further, but this should be very well documented by M$ anyway.
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"

Nickolas
Posts: 174
Joined: Sat Jan 22, 2011 3:14 pm
Location: In a black hole...

Re: Implementing arrays and functions?

Post by Nickolas » Tue Dec 27, 2011 9:27 am

m0skit0 wrote:Well I have no idea about .NET to be honest, but that seems a lot like Java.
.NET is a copy of Java... Just like Windows is a copy of Mac OS..

Does anybody here know about the .NET? Also, I am thinking of changing it to target a framework of my own... Is this too difficult?
Image
Image
Image
Image

devshelper
Posts: 134
Joined: Sat Mar 19, 2011 12:09 pm

Re: Implementing arrays and functions?

Post by devshelper » Tue Dec 27, 2011 12:34 pm

you wanna make your own framework?

Nickolas
Posts: 174
Joined: Sat Jan 22, 2011 3:14 pm
Location: In a black hole...

Re: Implementing arrays and functions?

Post by Nickolas » Tue Dec 27, 2011 1:31 pm

devshelper wrote:you wanna make your own framework?
Nope I want what I described in the past posts...
Image
Image
Image
Image

Post Reply

Return to “Programming”