Home | Rules and Guide | Sign In/Create Account | Write a Post | Reddit | #ludumdare on irc.afternet.org (Info)

Ludum Dare 26 — April 26th-29th Weekend — Theme: Minimalism

  • Judging Ends: in 1 day, 17 hours, 54 minutes, 45 seconds
  • Play and Rate Games | View All Games | Edit | View My Entry
    Twitter | #ludumdare on irc.afternet.org

    [ Warmup Weekend | Real World Gatherings | Tools | Ludum Deals (yep, we got it) ]


    ExecutionCode experimental script language – not a “I’m in”-Post

    Posted by
    August 11th, 2012 11:44 am

    Hi, I like to introduce to you a new script language: ExecutionCode
    I didn’t inted to create a language for games, but of course it can be used for games. It’s inspired by normal assembly, but cutted down to just one parameter. Also there are huge changes to some other things. But look at your own at a small application (it counts to 10):

    //All commentars are done c-style
    /*so of course these multiline commentars
    are supported!*/

    /*
    programs are not splitted up in functions, okay basically they are,
    but I call them modules and all the functions imported from C++ have their own name :)
    */

    //a command is splitted up in group name and function name
    main {
    //those square brackets indicate variables
    system.alloc [counter]
    system.alloc [isNowEnd]
    //first I push a raw numeric value (here 1) on the param stack
    system.push 1
    /*then the system.set command pops that value from the param stack and copies it to the given
    variable.
    If you put something on the stack, the value! is on the stack so if a command wants to change
    a variable it has to require it as param*/
    system.set [counter]

    //this is a jump mark, because you have to implement your loops on your own
    LoopStart:
    //first I print the variable to the world
    console.println [counter]

    /*a mathematical operation is done by pushing the two values on the stack and give the
    target to the command
    */
    system.push [counter]
    system.push 1
    math.add [counter]

    //and now I want to if [counter] came to 10 so I use the logical.lesser command
    system.push [counter]
    //these brackets indicate a ressource
    system.push
    logical.equal [isNowEnd] //so if counter==11 then isNowEnd=1

    //and if isNowEnd==1
    system.skip [isNowEnd]
    system.jump “LoopStart”

    //don’t forget to free the variables
    system.free [counter]
    system.free [isNowEnd]
    }

    //a ressource can be like variables a number or a string
    //and here is another feature: if you put a ‘#’ in front of a number you can type hexadecimal
    //decimal, this is 11
    ressource #b

    The code might look irritating, if so, delete the commentars and try to understand just the actual code.
    The compiler/interpreter application is done in the meaning that this code can compiled in bytecode and this bytecode can be executed by the virtual machine in the same application, but it isn’t enough finished (particularly the error handling procedures), so it won’t be released now, but I hope I’ll get this done before next LudumDare. I’ll also write a full reference of this lanuage, the bytecode, the virtual machine and the compiler.
    If you have any questions about it just ask me.

    Helco

    Tags: , , , , , , ,

    Leave a Reply

    You must be logged in to post a comment.


    All posts, images, and comments are owned by their creators.

    [cache: storing page]