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

Identity Crisis?

 
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 Jul 10, 2006 12:29 pm    Post subject: Identity Crisis? Reply with quote

As of late, I've started to realize the complexity of MiniD. As the (far-from-finished) compiler source approaches 6000 (non-blank) lines of code and 140KB, I'm beginning to wonder if all this complexity is worth it. Thinking about the implementation of some of the features, I've come to realize that I'd have to also implement things like RTTI, as well as a slew of things to consider since MD modules should be dynamically importable and linkable. It's getting to be downright scary.

So I'm thinking, "why not make it more Squirrel-like?" Then, the more I think about it, the more I wonder if it's even worth making another language that's kind of like Squirrel and kind of like Lua, which doesn't really offer anything new and which (of course) isn't compatible with either. Hm.

Sooooo...... even with all of that, I'd still like to make something of MiniD. I'm thinking Lua-esque, with just about everything in tables, but with a more robust (read: more than virtually nonexistant) module system, and with objects like in Squirrel. Something like:

Code:
module test;
import io;
import string;

def fork(x, y)
{
   // "Default parameter"
   if(y is null)
      y = 10;

   io.writefln("fork: ", x + y);
}

// A class!
class A
{
   this()
   {
      io.writefln("A ctor");
   }

   def mValue = 0;
   def mName = "";

   // "Properties"
   def value()
   {
      return mValue;
   }

   def name(val)
   {
      if(val is null)
         return mName;
      else if(typeof(val) == "string")
         return mName = val;
      else if(typeof(val) == "integer")
         return mName = string.toString(val);
      else
         throw "Invalid type for A.name"
   }

   // A plain old method
   def incValue()
   {
      ++mValue;
   }
}

// Inheritance
class B : A
{
   this()
   {
      super();
      io.writefln("B ctor");
   }
}

main()
{
   fork(5);
   fork(8, 3);

   def a = new A();
   a.name("Hello");
   io.writefln("a is called \"", a.name(), "\"");
   a.name(4);
   io.writefln("a is now called \"", a.name(), "\"");
   io.writefln("a's value is ", a.value());
   a.incValue();
   io.writefln("a's value is now ", a.value());
}


It looks kinda cool. Smile
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Wed Jul 12, 2006 9:43 am    Post subject: Reply with quote

The main thing I'm looking forward in MiniD is to be able to easily use it with D. Very Happy As long as you got that in, I'm sold.
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
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