0 Members and 2 Guests are viewing this topic.
"1234"[n] now works to access a specific character in a string with no memory copy.
FF()BEGIN MSGBOX("OH MY");END;GLOBALVAR=FF();
I have a few ideas about how this might come in handy.
Crap!That might be quite problematic since the code gets compiled when you send it across... I'll have to check that.Also, I think storing a char directly also does not require any memory allocations since the size isn't changing.
field x as real = 3function test() { x = 1 + 1}
#pragma mode( separator(.,;) integer(h32) )test();x:=3;test()BEGIN LOCAL TMP_1:=1; LOCAL TMP_2:=1; LOCAL TMP_0:=TMP_1+TMP_2; x:=TMP_0;END;
Ooh that is awesome . It seems the code gets smaller, right? How well does it get optimized for particularly complex programs?
@exportfunction hello() { print("Hello, Source!")}
#pragma mode( separator(.,;) integer(h32) )hello();EXPORT hello()BEGIN LOCAL TMP_1:="Hello, Source!"; LOCAL TMP_0:=print(TMP_1);END;
FUNC hello [] []:MOVS TMP_1 Hello, Source!CALL TMP_0 print TMP_1END
@inlinefunction test() { local a = 1 return a + 1}@exportfunction hello() { print(test()+1)}
#pragma mode( separator(.,;) integer(h32) )hello();EXPORT hello()BEGIN LOCAL %TMP0:=1; LOCAL a:=%TMP0; LOCAL %TMP2:=a; LOCAL %TMP3:=1; LOCAL %TMP1:=%TMP2+%TMP3; LOCAL %TMP6:=%TMP1; LOCAL %TMP7:=1; LOCAL %TMP5:=%TMP6+%TMP7; LOCAL %TMP4:=print(%TMP5);END;
@exportfunction hello() { local a,b = 1,2 b,a = a,b print(a+" "+b)}
#pragma mode( separator(.,;) integer(h32) )hello();EXPORT hello()BEGIN LOCAL a:=1; LOCAL b:=2; b:=a; a:=b; print(a+" "+b);END;
Nice so far. By the way at one point you should try to make an example program, such as a port of the "famed" Wacky Fun Random Numbar Generator v1.000069. Perhaps a graphical demo too to showcase the speed and size.
Nice. Would you mind pull requests in the future?