Quick status update

39 views
Skip to first unread message

Bob Nystrom

unread,
Dec 29, 2012, 4:32:24 AM12/29/12
to magpi...@googlegroups.com
I don't think of Magpie as having a "community" (at least, not yet) so I don't do a good job of telling people what's going on.

But since there are a few people subscribed to this, why not?

I've been quiet lately, but that doesn't mean I haven't been working on Magpie. I've been working on getting the C++ VM to a point where you can write non-trivial programs in it. It still needs a ton of work, but here's some stuff that works now:

1. You can define and instantiate classes. Inheritance is just starting to get there.

2. Multimethods are working, including basic method sorting.

3. Records, tuples, destructuring and all of that are in good shape.

4. List literals and some basic list operations are working. Ditto for strings.

5. In addition to floating point numbers, I've added a couple more basic types: characters and ints. Mixed arithmetic operations between ints and floats do the right thing (trivially easy given multimethods!).

6. "for" loops desugar to a nice simple iterator protocol (that I need to document somewhere).

7. I've added ".." and "..." operators and a little Range class that uses them. So you can do stuff like for i in 1..3 do print(i) now.

8. Exception-handling is working.

9. Top-level definitions and mutual recursion work.

10. Very rudimentary support for importing other modules works, including handling private variables. (But not yet private methods.)

11. Functions and closures.

12. I've started working on CSP-like concurrency. There is an "async" keyword that creates a new fiber that can be cooperatively scheduled. Channels can be used to synchronize between fibers. I ported Go's concurrent prime sieve to Magpie as an example. This is something I'm super super excited about. It's lots of fun to spin up fibers and let them talk to each other.

13. I've taken the first baby steps towards IO. The idea is to use non-blocking IO under the hood like Go/node.js do and schedule fibers appropriately on top of that. That lets you simple blocking-style code and have it run other fibers automatically when you do. I'm also super pumped about this, but there's piles of work to do here since it's all platform-specific and hairy.

There's still a near-infinite amount of work to do, but the VM is getting close to being able to let you write real programs which do useful stuff, which is of course the point of it all.

Cheers and happy New Year's!

- bob


Reply all
Reply to author
Forward
Message has been deleted
0 new messages