Monday, November 27, 2006

Smach Down!

Me putting the smack down on some clay pigeons. I went with “the men” and did some “sporting clays” while “the wimmen” did a baby shower (not ours!) for a friend of joys…

I had a blast, liked the gas operated 20ga semi automatic shotgun over the 12ga pump by a mile! I got between 50-60% for a first time out doing doubles on report… On a real sporting clays course I’d probably do a lot worse.

image

Posted by Stu on 11/27 at 03:01 PM Permalink to this post.
Filed Under : Life
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

Wednesday, November 22, 2006

Bytecode

I have a nice little object base bytecode lang/interp working..

Right now I am writing test bytecode files in assembler, which is helping me see what works and what doesnt regarding the bytecode format and the interpreter which will dictate how the compiler produces output. Internally each function is an indexed block of code, so technically the interpreter can pass functions around as parameters in some form of ‘functional programming’.

Just to be clear smile You can pass predefined functions around, but you cant pass an entire function as a parameter… But I guess you could and the compiler can generate an anonymous unnamed function and just pass that index… (design? what?)…

Right now I have global/local scoping, try/catch passing back up the path, exceptions, garbage collection working on a scope level. Variables are all local EXCEPT code written outside of functions in the top level block. Local scope being the current function, global being the top level.

I’m running a global string table, so there is only ever 1 copy of any given string in memory at any given point, no duplicates.

I have four internal types (number, boolean, string, and kinda, Error which is an internal/half external type, aka the only iternal type with an init routine). External supplied types, Console (only for printing text right now), AppContext and Random. Working on a Date object type.

There is no inbuilt method for singletons but you will be able to use a factory function in conjunction with the AppContext (it holds interp state info, and has a meta table of the counts of each object creation.

There is no explicit singleton keyword, it just seems like a hack to add a keyword just to try and create a set feature just to force only one instance of an object..

There is an implicit self in everything as well…

Im thinking of creating an interation object to work with a foreach method…
eg: 1.to(5).foreach(k,v,f) would return a list [1,2,3,4,5] which iteration would walk across it where f would be an anonymous function called with k,v as passed parameters… which leads into another whole area of thinking (I need blocks without contexts that can be flattened into the main block, or I will need a new scope, global, local function, anonymous func…

eg:

var A;

def myfunc(strV)
{
    
var Q;
    
    
1.to(10).foreach(k,v)
    
{
        
var Z1;
        
        
1.to(10).foreach(k1,v1)
        
{
            
var Z2;
            
            
1.to(10).foreach(k2,v3)
            
{
                
var Z3;
                ** 
at this pointAQk,vZ1k1v1Z2k2k3 Z3 all need to be visible. **
            
}
        }
    }
}

Aaah I see a way out, since scoped vars should just be a list of references to the real vars… Some more thinking required…

Posted by Stu on 11/22 at 12:01 PM Permalink to this post.
Filed Under : Development
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

little one

I guess I didn’t blog about it, but we are expecting a little one. Due around June 20something.

Much excitement. My Parental Units are way beyond excited.

Posted by Stu on 11/22 at 11:44 AM Permalink to this post.
Filed Under : Life
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

Page 1 of 1 pages