🎉 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!

Tangent: Creeping towards hello world.

Published May 15, 2008
Advertisement
Work on Tangent progresses more rapidly now. I have the infrastructure in place and tested... a little independently. But now I have 5 disparate parts (parsing, tokens, type inference, types, code-dom-ish stuff) and none of them work together. They're well designed though, so the steps of stringing them together is fast.

I've even got dotNet invocation working, and hard-coded a 'print "foo" to screen' test which uses the underlying bits of the language. My next milestone is taking a block of code in Tangent and running it. Hard-coded type declarations, no assignment, no literals, hard-coded data...

This actually:
 class int{    // hard-coded from dotnet-int's storage and method;    public ToString(){...}}class string{    // hard-coded from dotnet-string's storage and method;    public ToString(){...}}interface AnythingWithToString{    // hard-coded duck-typing interface    public ToString();   }void discard(Any x){    return();}print print(AnythingWithToString x){    Console.Write(x.ToString());    return(print);}void print(AnythingWithToString x){    discard print x;}int a = 42; string b = "moo.";    // And then I want this parsed and executable with the above declared.print a b;


Which by all testing will work fine and print '42moo.' to the console. Plus it's a simple example that shows a little of the language features like duck typing, and the user-defined operators. Now it's just a matter of stringing those bits together and making it work.
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