If it turns out like that you win a free trip to hell.
.
function actions takes nothing returns nothing
//Some actions
call SomeTimerFunction(periodic,2.50)
endfunction
function periodic
call BJDebugMsg("blablabla")
endfunction
#include "aids.j"
The system in now included.
lib // Library names? Naw... auto detect everything.
int TempStore 0 // global declaration with initial value.
expose doubleMyInt int start int // public function doublyMyInt takes integer start returns integer
start start * 2 // doubling start. there is no '=' required
= start // return start
expose setGlobal int to // expose is like public. but you don't need lib prefixes, conflicts throw errors instead
TempStore to // set TempStore = to
expose multiplyByGlobal int start int
= start * TempStore
expose multiplyThings int a int b int
= a * b
lib
expose class IntObj
.int val // nonstatic, has . prefix
int stackLevel 0 // static, has no prefix
type[] stack
type next
allocate type // private static method returning "thistype"
if stackLevel = 0 // using a static var is like using a global
next next + 1 // in fact, they are globals
= next
stackLevel stackLevel - 1
= type[stack]
expose create int val type // public static method returning thistype
type this allocate
this.val val
= this
expose .timesTwo // public non-static method
this.val doubleMyInt(this.val) // uses the other lib
expose .complicatedTimesTwo
setGlobal(2)
this.val multiplyByGlobal(this.val)
lib
expose class Object
type[] recycleStack
int recycleStackLevel 0
type lastCreated 0
expose allocate type
if recycleStackLevel = 0
lastCreated . + 1
= lastCreated
recycleStackLevel . - 1
= recycleStack[recycleStackLevel]
expose .deallocate
recycleStack[recycleStackLevel] this
recycleStackLevel . + 1
lib
expose class Int Object
.int val
expose create int val type
type this allocate
this.val val
= this
expose .destroy
.deallocate
expose .value int
= .val
expose .value= int val
.val val
// Bad syntax abuse (if I allow things to add onto the end of a line instead):
lib expose class Int Object expose .int value 0
// Compiles to:
library B requires A
struct Int extends Object
integer value=0
endstruct
endlibrary
// XD
#include "aids.j"
#include "pui.j"
#include "kt.j"
BJDebugMsg("This will loop 3x") ^ 3
As you can see, it's great for development, and I actually find it kind of readable. Well, if you seriously consider it, I'll re-draft it and make it properly readable with some minimal changes (like an = operator for setting things).As for that language, I would seriously consider that as a secondary language for the parser.