AdvSys2 Development

13»

Comments

  • I think he's referring to the _STACK constant which you can set (along with a related constant _FREE). _STACK just tells the compiler how much space will be needed for the stack, so that if the sum of the code size, data size, _STACK, and _FREE value is more than 32KB it can report an error. It doesn't actually reserve any space, just makes sure that the program will fit in a certain amount of memory. It might be kind of useful if you link your bytecode program to a certain fixed address, say $1000 (4K); then you can set _FREE to $7000 (28 K) and _STACK to what you think the interpreter needs for stack, and then openspin will let you know if the interpreter is too big to fit in its 4K space.
  • OK, thanks. I never knew about _STACK or _FREE. This is the first time I've ever heard it mentioned.
  • David BetzDavid Betz Posts: 12,510
    edited September 29 Vote Up0Vote Down
    I've updated the compiler to produce Propeller .binary files directly and have also made it possible to build it for Windows. I guess I should write a document describing the language and post a package so those not comfortable checking code out of GitHub and building it could try it. I suppose I could build a Propeller loader in as well so you could do everything with a single executable.
  • David BetzDavid Betz Posts: 12,510
    edited October 1 Vote Up0Vote Down
    I changed the method invocation syntax to look more like C++. The old syntax was pretty ugly. The object "proto" is the prototype object. The object "obj" inherits from it but adds its own properties and a method. Obviously, this is just a test program but it shows how methods are invoked.
    object proto {
    p1: 1;
    p2: 2;
    m1: method(a) {
            return self.p1;
        };
    m2: method(b) {
            var res = self.p1 + b;
            println "proto.m2 ", b, " -> ", res;
            return res;
        };
    }
    
    proto obj {
    p1: 3;
    p3: 4;
    m2: method(x) {
            var res = super.m2(x) + self.p1;
            println "obj.m2 ", x, " -> ", res;
            return res;
        };
    }
    
    def main()
    {
        println proto.m1(100);
        println obj.m1(200);
        println obj.m2(10);
    }
    
  • Finally finished adding the vocabulary statements that will allow me to parse English commands instead of single-letter ones. These are the first statements that are mostly useful to people writing text adventure games although I suppose other programs that require language parsing could use them as well. Infocom used its language to write a database program! Anyway, my next task is to actually use my language to write a parser. For the moment, I'm done with language implementation and can now become a language user.
  • Here is some rather ugly test code that shows the vocabulary feature. Note that the compiler automatically creates the arrays "_words" and "_wordTypes" if you use any of these vocabulary features. If you don't use them the arrays are not created.
    var myString[16]; // 64 byte string
    
    noun "fred", "george", "troll";
    verb "take", "drop";
    
    object obj1 {
    p1: 2;
    p2: 1;
    noun: "herbert";
    verb: { "swing", "throw", "shout", "gurgle" };
    }
    
    def main()
    {
        var i, j;
        
        println _words[-1], " words";
        for (i = 0; i < _words[-1]; ++i)
            println #_words[i], " ", _wordTypes[i];
            
        for (i = 0; i < obj1.verb[-1]; ++i)
            println #obj1.verb[I];
    
        for (i = 0; i < obj1.verb[-1]; ++i) {
            for (j = 0; j < obj1.verb[i].byte[j] != 0; ++j) {
                myString.byte[0] = obj1.verb[i].byte[j];
                myString.byte[1] = 0;
                println "'", #myString, "'";
            }
            println;
        }
    }
    
  • David BetzDavid Betz Posts: 12,510
    edited October 14 Vote Up0Vote Down
    I've disabled WordFire/Quby support in the advsys2 GitHub repository for the time being because it depends on a keyboard driver that is not open source. That means that anyone who didn't have the driver got an error when they tried to build the advsys2 tools. This change makes the repository build for everyone. I will enable it again once I have a chance to write an open source keyboard driver. This should not slow down my parser development because I can always test using an ActivityBoard with serial I/O.
Sign In or Register to comment.