View previous topic :: View next topic |
Author |
Message |
JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Sun Jul 22, 2007 5:12 pm Post subject: July 22 -- Binding lib, nice bugfixes, toJSON, some docs |
|
|
Added/Removed
- Added the baslib toJSON() function. This will take either an array or table as the root element, and will return a JSON string representation of the data. The data is checked for cycles, and can output either pretty (indented) JSON, meant for human-readability, or compact JSON, good for sending over web connections or so.
- Added io.OutputStream.writeJSON() (and by proxy, io.Stream.writeJSON()). This is more efficient than writing the result of toJSON(), as it skips the creation of a temporary string.
- Added class wrapping. Supports constructors, methods, and properties. No overloaded operator binding yet. Deriving a MiniD class from a wrapped D class will result in undefined behavior, but that is a very large and tricky problem to solve, so that might not come until much later. Wrapping constructors is more powerful than in Pyd in that multiple constructors with the same number of arguments but with different argument types can be wrapped. This is probably all I'll work on the binding lib until after 1.0 is released.
Changed
- loadJSON() now uses a much quicker way of compiling the JSON into a MiniD value. It skips parsing the tokens into an AST, bytecode generation, and interpretation stages entirely and simply builds the MiniD values as it parses the JSON.
- All the methods of io.OutputStream (and by proxy, those methods of Stream) now return a chaining reference.
- io.listDir has been split into two functions, io.listFiles and io.listDirs. These will list all the files and all the folders in the given directory, respectively. It was this, or adding another optional flags parameter to io.listDir.. but that was too ugly, so I split it up. Both functions still allow the use of patterns to match file and folder names.
Fixed
- When returning from a function normally, any pending finally blocks are now executed.
- Conditional ( ?: ) expressions now behave properly. Before, a ? b : c was rewritten as a && b || c, but Armin Ronacher (mitsuhiko) pointed out that this doesn't work right when b is false. They are no longer rewritten as any other kind of expression.
- Fixed the long-standing (and no, I hadn't forgotten about it!) bug where "a[b], b = f()" would overwrite b before indexing a with it. Now these kinds of assignments, where destinations depend on the values of destinations to their right work properly.
- Fixed some function call epilogue issues when exceptions were thrown from class ctors and coroutines.
In addition, I've documented large parts of the native API with ddoc comments. Haven't generated any pretty documentation from it but you can have a look at it in types.d and utils.d. Hope to finish the docs and have some examples maybe after the 1.0 release.
Speaking of which, this is probably about all the further the binding library will go at least until after the 1.0 release (which is really kind of a 'token' thing which say "hey, you can probably use this in a project now"). Besides it's not like the binding library has anything to do with the language itself.
The only things I'd like to add before 1.0 are (1) some way to do sandboxing, by creating 'safe' state which doesn't have access to all the libraries that an 'unsafe' state would (this will probably involve re-introducing per-state global tables...), and (2) native coroutines. Fibers are just so damn cool I can't not do it. |
|
Back to top |
|
|
csauls
Joined: 27 Mar 2004 Posts: 278
|
Posted: Mon Jul 23, 2007 3:43 pm Post subject: |
|
|
Just gets better and better. _________________ Chris Nicholson-Sauls |
|
Back to top |
|
|
Linker
Joined: 06 Nov 2006 Posts: 29 Location: Almaty, Kazakhstan
|
Posted: Tue Jul 24, 2007 11:53 am Post subject: |
|
|
Sorry for off-topic.
The whole language looks impressive to me... but where's all the documentation? (I could only find the language spec; but nothing about the API) How do I embed it into my (future) project? Are there any tools to ease development (I'm talking about something bigger than tests -- like, scripting for visualization system/game renderer)? |
|
Back to top |
|
|
JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Tue Jul 24, 2007 9:51 pm Post subject: |
|
|
That's what I plan on working on in the next couple of weeks leading up to and after the 1.0 release -- docs, examples, etc. I've begun the documentation of the API, and most of the public interface of types.d (where the main portion of the user API resides) has been documented. You can either have a look at the comments in types.d directly or compile MiniD with the DDoc flag enabled for your compiler. There's still a lot that needs to be explained, though, and a lot which can only really be shown as examples.
I'll be making simple examples in the next couple weeks, and am hoping that people will come up with some questions and use cases that I haven't thought of |
|
Back to top |
|
|
|
|
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
|