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

Cracy concept: MiniD module archives?

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



Joined: 27 Mar 2004
Posts: 278

PostPosted: Thu Oct 01, 2009 2:43 pm    Post subject: Cracy concept: MiniD module archives? Reply with quote

I know JAR files are evil. Dire evil. The kind of evil that makes one's mother in law seem like a cute puppy. That said, how hard would it be to create loadable MiniD archives? Might be a "MiniD 3" thing, but it could be very useful for projects that want to distribute pre-compiled modules. (Like, say, a game? Or a web framework?)

Would be more useful if coupled with an ability to insist on using the pre-compiled modules even if a newer source module is available.
_________________
Chris Nicholson-Sauls
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
JarrettBillingsley



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

PostPosted: Thu Oct 01, 2009 2:52 pm    Post subject: Reply with quote

You could do it even now. Just set up a custom module loader. :3 You'd have to be able to access ZIP files, either by writing the loader in D or by binding ZipStream or similar to MiniD.

And yes, you can change the module loader so that it always uses the precompiled version. The module loading mechanism is handled entirely by the standard library, and how it behaves by default is just that - a default. You really can do anything you want Smile At a very high level, the module import mechanism is just a function that maps from strings to namespaces. You can do ANYTHING you want in between there.
Back to top
View user's profile Send private message Visit poster's website
csauls



Joined: 27 Mar 2004
Posts: 278

PostPosted: Thu Oct 01, 2009 9:37 pm    Post subject: Reply with quote

I knew about modules-as-functions, from some of my earlier skulking about with it, doing lots of silly writing, re-writing, and over-writing of metatables just to see how much I can abuse MiniD. (For the record, a frigging lot, which is awesome.) So thanks, can't believe I didn't think about custom loaders, and I'm going to give that a try sometime.

By the way, I think this says plenty about MiniD and why I like it:
Code:

waenyinepu@thanatos:~/Projects/MiniD/sieve$ time ./mdcl.exe sieve2 1000000000
Seeking primes up to 1000000000
There are 3401 primes in this set (0.00034%).

real    0m0.229s
user    0m0.172s
sys     0m0.040s


Sweet.
_________________
Chris Nicholson-Sauls
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
JarrettBillingsley



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

PostPosted: Fri Oct 02, 2009 1:44 am    Post subject: Reply with quote

Hooray, speed! \o/

I REALLY want to work on improving the GC but I haven't had the motivation to work on it in a while. That's really the last major performance bottleneck.
Back to top
View user's profile Send private message Visit poster's website
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