🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Milestone 1 (for real this time)

Published June 01, 2008
Advertisement
After 45 mins more debugging:

And it turns out the instance binding was working fine and the return statements were also working well. The problem was that I was using the instance of the method for all that, but executing the code from the template. I know that doesn't really make sense.... I'm pretty certain this fugly implementation of method instances is counter to how it's supposed to be done and going to cause memory/runtime issues later. But that's later. Gobbling methods now work, meaning I've (finally) hit full Milestone 1.

Unfortunately it's a small tidbit in the larger scheme of things, despite all that's been done. I'm still manually defining classes and method declarations. .NET importing doesn't work. Literals don't work. There's no entrypoint mechanism, no assembly references, no new statements!

So a tentative roadmap:

Milestone 2 - Literals. Support for all .NET literals is ideal. Support for unescaped strings, chars, decimal integers (no hex notation), and floats is sufficient.

Milestone 3 - Local variable declarations in code.

Milestone 4 - Method declarations in code.

Milestone 5 - Class and class member declarations in code. 'new' should work.

Milestone 6 - Support for partial classes and operator overloading. Look into the need for a C++ style functor definitions. Entrypoint handling is likely done here.

Milestone 7 - Class Generics in code and operation requirement syntax. Type parameterization in the interpreter.

Milestone 8 - Method Generics support in the interpreter. Constraints in syntax.

Milestone 9 - Syntactic sugar for properties so that they behave like .NET properties properly. Mostly this is for the 'getter' part of properties since setters are just an overload of op= (though that requires method generics)

Milestone 10 - Indexers.

Milestone 11 - 'using' support and assembly references.

Milestone 12 - Support for Tangent objects in .NET Generics. (which will likely require some dirty hack)


... and that's about as far out as I've thought through. This is still missing some fairly major things; the lock keyword, 'using' blocks, exceptions, yield, anonymous delegates, lambda stuff (unlikely to get done), linq stuff.

Plus I'll need to improve error reporting, some simple standard library stuff, documentation. Which also assumes that this thing doesn't crash down under its own weight somewhere in there due to the ambiguities being too prevalent or the compilation being too slow or the interpreter just running dog slow.


Still, I've got most of the key things working that I wanted to research. The static duck typing works pretty well. The operation inference works nicely (though might be too ambiguous/slow once complexity ramps up). Arbitrary operators work (though might place too much burden on the program designer to work well). Method selection on multiple parameters needs tested more, but should work nicely. Methods/operators and method groups can be passed around wily-nily.

Now to get the rest of this puppy working so I can see if this crap actually proves useful for programming non-trivial projects.
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement