JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Sun Dec 24, 2006 12:52 pm Post subject: Just hold on! It takes a while. |
|
|
Yes, it's been more than a week since the last update. No, I haven't forgot about MiniD. Development has been a bit.. slow, for several reasons -- it's Christmas vacation, so there's lots of distractions. And I just can't seem to get into a roll on my laptop like I can on my desktop.
Anyway I thought I'd post some updates on where this is going and what my plans are for MiniD for the near future.
First of all, I'm working on a module system. One of the things that the developers of Lua said that they wished they had implemented much earlier is a proper module system. I'm building it in as a core part of the language. Modules and imports will function very similarly to D.
Because of this, the declaration system is changing. Functions and classes will now default to "local" -- that is, visible only within the module. There is also a new "global" attribute which will make the declaration a module member, and so it will be accessible after the module has been initialized. These kind of mirror public vs. private module members in D.
Similarly, you can have global and local imports -- just like in D, a global (public) import will mean the imported module will be imported when another module imports this one, and a local (private) import will only be visible within the module. There will be selective import, import renaming, and an "import attributes" thing that allows for further extensions to the import system as needed. Right now there's only one attribute: "full", which will import all the symbols from the module as locals into this module, which makes it somewhat like D. The default is more like "static import" in D, where you have to use the FQN.
All this is based on a new namespace type, which is like a table, but the keys must all be strings and values can be null. This means tables will probably go back to the old behavior where accessing a nonexistant key will simply return null instead of throwing an error, and where setting a value to null will remove the value. Namespaces will be used wherever it makes sense -- globals, classes and instances, modules and "packages". Classes and instances already limit keys to strings, so nothing really changes there. There will probably also be namespace declarations and namespace constructors, similar to table constructors.
Another one of the things I hope to accomplish is to get rid of the colon to call methods (like obj:method()). It's been a sore spot for me since I implemented it. I've come up with some solutions, some of which involve making a much more robust type system in MiniD, something like Python. I'm also curious as to how Python implements its classes and instances, since apparently, Python used to have classes and instances the way MiniD has them now, and they're now being deprecated in favor of the new way to do classes.
Lastly, there's the binding library. That will probably not get done before the first release. That might also be dependent upon this theoretical new typing system, especially with regards to binding classes.
So here's hoping I can get on track in the next week or so! |
|