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

MiniD Feature Freeze -- Now in effect!
Goto page 1, 2  Next
 
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: Mon Apr 30, 2007 2:24 pm    Post subject: MiniD Feature Freeze -- Now in effect! Reply with quote

The feature freeze for MiniD is now in effect. The language features that it has now are what will be the 1.0 standard, unless there's a really good reason to add another feature.

The API, however, is still under development. The next thing I'll be working on is the binding library (like Pyd), so if you have any ideas for that, feel free to post them here.


Last edited by JarrettBillingsley on Mon Aug 13, 2007 8:28 am; edited 2 times in total
Back to top
View user's profile Send private message
csauls



Joined: 27 Mar 2004
Posts: 278

PostPosted: Mon Apr 30, 2007 10:34 pm    Post subject: Reply with quote

I don't really have any requests of my own... and actually look forward to the freeze, as it will give me a "stable" target to base MiniD/Tango on. Unfortunately, a friend of mine wants me to forward his request.

He wants to be able to evaluate arbitrary code at run-time, including imports. Essentially, he'd like import to be usable at non-module scope (I'm not sure its restricted anyhow?) and usable with strings as well as identifiers. And he'd like an eval() which would compile-on-the-fly and execute, or perhaps return the code as a closure.

Crazy stuff, but the dynamic importing could be fun.
_________________
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: Tue May 01, 2007 7:40 am    Post subject: Reply with quote

Quote:
He wants to be able to evaluate arbitrary code at run-time, including imports. Essentially, he'd like import to be usable at non-module scope (I'm not sure its restricted anyhow?) and usable with strings as well as identifiers.


That sounds like a job for.. a require() function! I've have also wanted to be able to import stuff in MDCL, since you can't use the import statement. (Well that could be changed as well)

Quote:
And he'd like an eval() which would compile-on-the-fly and execute, or perhaps return the code as a closure.


That's something I've been planning on doing.

[edit]OK, they're in.
Back to top
View user's profile Send private message
csauls



Joined: 27 Mar 2004
Posts: 278

PostPosted: Tue May 01, 2007 11:39 pm    Post subject: Reply with quote

Man, that's fast. Wink

A 'require()' function probably is the best way. Its even kinda PHP'ish, where most of my projects are peppered throughout with require() and require_once() calls.
_________________
Chris Nicholson-Sauls
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
qbert



Joined: 30 Mar 2004
Posts: 209
Location: Dallas, Texas

PostPosted: Wed May 02, 2007 9:22 am    Post subject: Reply with quote

I second that eval() request, that would be very sweet.
Back to top
View user's profile Send private message MSN Messenger
JarrettBillingsley



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

PostPosted: Wed May 02, 2007 11:28 am    Post subject: Reply with quote

Quote:
Man, that's fast.


Hehe. They were deadly easy to implement. Of course, because of the design of MiniD, eval() has some restrictions (can't access locals like in some languages), but I'm sure it's still useful.
Back to top
View user's profile Send private message
csauls



Joined: 27 Mar 2004
Posts: 278

PostPosted: Wed May 02, 2007 3:27 pm    Post subject: Reply with quote

That should be just fine. Particularly if you could eval a function definition... then any dyn-gen'd code that needs to access outside values should just be written as such, and the resulting function called. Smile
_________________
Chris Nicholson-Sauls
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
Skylar



Joined: 24 Apr 2007
Posts: 5

PostPosted: Wed May 02, 2007 3:47 pm    Post subject: Reply with quote

Second for Tango support :[ Ill try compile minid with tangobos tomorrow, does somebody tried it?
Back to top
View user's profile Send private message
JarrettBillingsley



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

PostPosted: Thu May 03, 2007 10:08 am    Post subject: Reply with quote

I hope compiling with tangobos works. It would mean much less work for Chris and fewer angry people Wink
Back to top
View user's profile Send private message
r.lph50



Joined: 27 Nov 2006
Posts: 21
Location: New Zealand

PostPosted: Thu May 03, 2007 6:32 pm    Post subject: Reply with quote

Some ideas:

Can that LZW code be used to load/store compressed bytecode?

One interesting (and useful) feature would be allowing function execution at class declaration time, but without assigning it to a local. Example

Code:

class Base
{
    function mixin(someValue) {
        this.newClassField = function() {.. someValue ..}
        this.anotherNewField = someValue * 5;
    }
}

class Derived : Base
{
    mixin(SomeValue);
}
/* Derived now has Derived.newClassField && Derived.anotherNewField, but Base doesn't */

Oh yeah, is there any such thing as a class method? Say if you call Derived.newClassField directly rather than through an instance, will it work and will the this reference be the class Derived? I think the above 'mixin' would require this behaviour..

Also, I'm working on a FastCGI dispatcher and a goto driven (erm..) XML processor in plain D. I'm not using MiniD at the moment, but I am worried that when I do, MiniD's avoidance of multibyte encodings (due to using utf-32) may begin to hurt me performance and memory wise, since my 'world' is mainly encoded in utf-8. Oh well, I can get by.
Back to top
View user's profile Send private message AIM Address
JarrettBillingsley



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

PostPosted: Thu May 03, 2007 7:19 pm    Post subject: Reply with quote

Quote:
Can that LZW code be used to load/store compressed bytecode?


That was more a proof-of-concept than anything; it's almost a direct translation of pseudocode I took in an algorithms class. I liked how simply it translated to MiniD Smile But compressed bytecode wouldn't be hard to implement and would certainly make the mdm files smaller.

Quote:
One interesting (and useful) feature would be allowing function execution at class declaration time, but without assigning it to a local.


Something like the mixinProperties function in samples\simple.md? It's not in the class, but it can be used on any class after it's been declared.

Quote:
Oh yeah, is there any such thing as a class method? Say if you call Derived.newClassField directly rather than through an instance, will it work and will the this reference be the class Derived?


There aren't static methods per se, but if you call a method of a class like that, the class will be passes as the 'this' pointer. So yes, that's possible (though there are no static data members, making them maybe not as useful as they could be.. though that could be faked with a local outside the class).

Quote:
Also, I'm working on a FastCGI dispatcher and a goto driven (erm..) XML processor in plain D. I'm not using MiniD at the moment, but I am worried that when I do, MiniD's avoidance of multibyte encodings (due to using utf-32) may begin to hurt me performance and memory wise, since my 'world' is mainly encoded in utf-8. Oh well, I can get by.


You might be able to build a (non-standard) build of MiniD by replacing all the dchar[] with char[], and as long as you only deal with non-multibyte text, there shouldn't be any issues. I wonder, though, if it got to be an acceptance issue, I suppose I could support both utf-8 and utf-32 builds of MiniD.
Back to top
View user's profile Send private message
r.lph50



Joined: 27 Nov 2006
Posts: 21
Location: New Zealand

PostPosted: Thu May 03, 2007 7:50 pm    Post subject: Reply with quote

JarrettBillingsley wrote:
Quote:
One interesting (and useful) feature would be allowing function execution at class declaration time, but without assigning it to a local.

Something like the mixinProperties function in samples\simple.md? It's not in the class, but it can be used on any class after it's been declared.

Didn't even look there Smile So I'm guessing (no working DMD or GDC on my machine) this already works. Cool.

JarrettBillingsley wrote:
You might be able to build a (non-standard) build of MiniD ... I suppose I could support both utf-8 and utf-32 builds of MiniD.

Yeah, I was thinking that would end up happening, but I would want to make it utf-8 safe the whole way through; That is good to hear Smile
Back to top
View user's profile Send private message AIM Address
ideage



Joined: 12 Jul 2006
Posts: 63
Location: china

PostPosted: Thu May 03, 2007 8:30 pm    Post subject: Reply with quote

one idea:

A function help Host easy to Extend MiniD. it add D function to a Namespace. like require() function ,but the function load D function.

it will be a good API interface to D.
________
easy vape reviews


Last edited by ideage on Wed Feb 02, 2011 5:08 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
JarrettBillingsley



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

PostPosted: Thu May 03, 2007 9:33 pm    Post subject: Reply with quote

Yes, two of the major things I'm planning on working on -- loading dynamic libraries and the binding library -- should make interfacing to D code from MiniD very easy. Loading dynamic libraries will just be part of the existing import and module system, and the binding library will make it possible to use (many) native D functions from MiniD with no interfacing with the API needed.
Back to top
View user's profile Send private message
r.lph50



Joined: 27 Nov 2006
Posts: 21
Location: New Zealand

PostPosted: Fri May 04, 2007 10:47 pm    Post subject: Reply with quote

I don't know if you have looked at the NekoVM's C FFI? It uses a lot of C text macros in its implementation, but I've always (rightly or wrongly) perceived it as simple and powerful. And I thought it might map nicely onto D templated functions.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MiniD All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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