FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

August 14th/15th - IT WORKS!!!

 
Post new topic   Reply to topic     Forum Index -> MiniD
View previous topic :: View next topic  
Author Message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Tue Aug 15, 2006 11:20 am    Post subject: August 14th/15th - IT WORKS!!! Reply with quote

OH sweet, yes, it works!

Yesterday (14th) wasn't ver productive, mostly because I was mulling over how calling and returning worked, and also because of my damned social life Wink but I finished Call and Ret today, and got their support functions done, and..

Code:
void main()
{
   MDGlobalState.initialize();
   MDState state = MDGlobalState().mainThread();
   MDClosure closure = new MDClosure(state, compileFile(`simple.md`));

   int mdwritefln(MDState s)
   {
      int numParams = s.getBasedStackIndex();
      
      for(int i = 0; i < numParams; i++)
         writef(s.getBasedStack(i).toString());

      writefln();
      
      return 0;
   }

   MDClosure writeflnClosure = new MDClosure(state, &mdwritefln);
   state.setGlobal("writefln", writeflnClosure);

   state.call(state.push(closure), 0, 0);
}


plus:

Code:
local function foo()
{
   writefln("hi ", 4, ", ", 5);
}

foo();


equals:

Code:
hi 4, 5


!!!

It works. Smile
Back to top
View user's profile Send private message
pragma



Joined: 28 May 2004
Posts: 607
Location: Washington, DC

PostPosted: Tue Aug 15, 2006 11:25 am    Post subject: Reply with quote

Congrats! Don't you just love it when a concept comes together?

I've been lurking here and I've gotta say: this project is quite interesting.

But have you considered side-stepping the VM completely and go straight for X86 code generation instead?
_________________
-- !Eric.t.Anderton at gmail
Back to top
View user's profile Send private message Yahoo Messenger
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Tue Aug 15, 2006 1:55 pm    Post subject: Reply with quote

That would be awesome, but there are a few issues with it. If I were to make the compiler directly generate machine code.. not only do I not know nearly enough about x86 architecture to write a compiler for it, but it'd also be tying the compiler to one platform. The other option is to have the compiler generate bytecode as it does now, and then run a JIT pass on it using something like libjit, which would basically convert the bytecodes to the native code equivalents. That might produce pretty bloated code (though still faster than interpreted), and porting it to another platform would involve recompiling libjit for the target platform as well - which means that someone has to have made a libjit port, since each port depends upon the platform it's being compiled on!

So for now, at least, or maybe until I take the "compiler design" course in my third year at college Wink MiniD will be just interpreted.
Back to top
View user's profile Send private message
Gregor



Joined: 05 May 2006
Posts: 72
Location: Portland, OR

PostPosted: Tue Aug 15, 2006 5:59 pm    Post subject: Reply with quote

Seems to me like the primary "missing piece" remaining is a robust standard library, no?
Back to top
View user's profile Send private message AIM Address
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Tue Aug 15, 2006 6:30 pm    Post subject: Reply with quote

Jarrett,

I'm happy for your success. Smile

Just want you to know, though, that I find your use of profanity as offensive here as on the newsgroup. I took the liberty of editing out your use of it. Please don't do that in the future. Thanks.

-JJR
Back to top
View user's profile Send private message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Tue Aug 15, 2006 7:43 pm    Post subject: Reply with quote

Quote:
Seems to me like the primary "missing piece" remaining is a robust standard library, no?


Pretty much, yes. The interpreter isn't quite done (still working out bugs and have the exception handling mechanism to implement), and the API needs to be fleshed out, but I'm already starting to think about what needs to be in the standard library. Once the interpreter and API are solidified, real work on the stdlib can begin.

Quote:
Just want you to know, though, that I find your use of profanity as offensive here as on the newsgroup.


Sorry.
Back to top
View user's profile Send private message
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Tue Aug 15, 2006 7:57 pm    Post subject: Reply with quote

JarrettBillingsley wrote:

Quote:
Just want you to know, though, that I find your use of profanity as offensive here as on the newsgroup.


Sorry.

Did I miss something? What profanity?

BTW, MiniD sounds like a fun project. Glad to see you're enjoying it.
_________________
--
Derek
skype name: derek.j.parnell
Back to top
View user's profile Send private message
Gregor



Joined: 05 May 2006
Posts: 72
Location: Portland, OR

PostPosted: Tue Aug 15, 2006 8:45 pm    Post subject: Reply with quote

JarrettBillingsley wrote:
Quote:
Seems to me like the primary "missing piece" remaining is a robust standard library, no?


Pretty much, yes. The interpreter isn't quite done (still working out bugs and have the exception handling mechanism to implement), and the API needs to be fleshed out, but I'm already starting to think about what needs to be in the standard library. Once the interpreter and API are solidified, real work on the stdlib can begin.

Quote:
Just want you to know, though, that I find your use of profanity as offensive here as on the newsgroup.


Sorry.


Dibs on CGI Wink
Back to top
View user's profile Send private message AIM Address
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Tue Aug 15, 2006 9:01 pm    Post subject: Reply with quote

Derek Parnell wrote:
Did I miss something? What profanity?


I edited it out.

Derek Parnell wrote:
BTW, MiniD sounds like a fun project. Glad to see you're enjoying it.


I agree.

-JJR
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MiniD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group