mmmh
+ is a floating point add, which is a few cycles, exec2 is just fetching instructions and putting the last value in the active register, so its practically nothing in cpu cycles. But you would have to do a fair bit of it do notice a difference.
Normal AVS Code -> loop() code translator
44 posts
like 20 lines of code in a loop(100)? 🙂
i heard it the first time, christ...x_x
this kicks ass🙂
probably gona save me alot of nervous breakdowns😁
what about support for stuff like
a<b
a==b
for the ifs?
i just hate the damn equal(bla,bla)stuff
nah this is a stupid idea i gues cause theat would just make it another language, nm🙂
nice work dood:thubs up:
probably gona save me alot of nervous breakdowns😁
what about support for stuff like
a<b
a==b
for the ifs?
i just hate the damn equal(bla,bla)stuff
nah this is a stupid idea i gues cause theat would just make it another language, nm🙂
nice work dood:thubs up:
hmm... a<b and a==b and the likes would be quite hard to code. I'd have to parse the whole string for something like == > <
i'd also have to respect precedence
(a+b)==(c+d)
and
a+b==c+d
don't have to be the same 🙂
atm all functions are treated equally: first, they're split to command name and parameter list
commandname(parameterlist)
the program looks for commas and keeps track of the bracket level. If it finds a comma and the current bracket level is 0, the string up to the comma is taken as a command block and translated recursively. when the translation returns, the command is composed from the the command name and the translated parameters.
If someone has a good parsing/replacement algorithm for the comparisons, i'll put it into the program (provided, i have the permission to do so 🙂 ).
Needed is basically something that takes an AVS command block as input and replaces all occurances of some+term-goes*here==another+term-goes*here by equal(some+term-goes*here,another+term-goes*here)
The programming language can be VB, VBA, PHP, Perl, C/++, Pascal/Delphi/Kylix, J(ava)Script, VBScript, and maybe even Java 🙂
(ordered from best to worst 🙂 )
I also found out that some bugs cause certain combinations of code not to translate to what i intended, namely:
both result from a simple (and quite stupid 😁 ) bug and are fixed in 1.10.01
see CHANGELOG.txt for details 🙂
i'd also have to respect precedence
(a+b)==(c+d)
and
a+b==c+d
don't have to be the same 🙂
atm all functions are treated equally: first, they're split to command name and parameter list
commandname(parameterlist)
the program looks for commas and keeps track of the bracket level. If it finds a comma and the current bracket level is 0, the string up to the comma is taken as a command block and translated recursively. when the translation returns, the command is composed from the the command name and the translated parameters.
If someone has a good parsing/replacement algorithm for the comparisons, i'll put it into the program (provided, i have the permission to do so 🙂 ).
Needed is basically something that takes an AVS command block as input and replaces all occurances of some+term-goes*here==another+term-goes*here by equal(some+term-goes*here,another+term-goes*here)
The programming language can be VB, VBA, PHP, Perl, C/++, Pascal/Delphi/Kylix, J(ava)Script, VBScript, and maybe even Java 🙂
(ordered from best to worst 🙂 )
I also found out that some bugs cause certain combinations of code not to translate to what i intended, namely:
does not translate correctly
loop(5,
somefn(param);
otherfn(param);
);
generates an ERR
a=b+loop(5,
assign(a,b);
assign(a,b);
c=d;
);
both result from a simple (and quite stupid 😁 ) bug and are fixed in 1.10.01
see CHANGELOG.txt for details 🙂
what about support for stuff likeThat would be awesome, above(bla,bla) and that crap wastes code space, and those brackets are so annoying.
a<b
a==b
for the ifs?
i just hate the damn equal(bla,bla)stuff
Whooo! Now maybe this'll finally help me understand the whole array thing!
array thing? you mean (g)megabuf?
it's simple:
A (g)megabuf can be seen as a collection of variables (1 million of them 🙂 )
that can be addressed by using an index.
Syntax:
without AVSTrans:
local (only available in this specific component):
local (only available in this specific component):
like the above or:
local:
it's simple:
A (g)megabuf can be seen as a collection of variables (1 million of them 🙂 )
that can be addressed by using an index.
Syntax:
without AVSTrans:
local (only available in this specific component):
global (shared between the components)
assign(megabuf(index), value); // assigns "value" to megabuf entry #index
variable = megabuf(index); // assigns the value of megabuf entry #index to "variable"
local (only available in this specific component):
with AVSTrans 1.11.00:
assign(gmegabuf(index), value); // assigns "value" to gmegabuf entry #index
variable = gmegabuf(index); // assigns the value of gmegabuf entry #index to "variable"
like the above or:
local:
global:
megabuf[index] = value; // assigns "value" to megabuf entry #index
variable = megabuf[index]; // assigns the value of megabuf entry #index to "variable"
note that the above only counts for the newest version (1.11.00) where I fixed that thing i mentioned in the 1.09.00 CHANGELOG entry about those brackets that were needed before 1.11.00.
gmegabuf[index] = value; // assigns "value" to gmegabuf entry #index
variable = gmegabuf[index]; // assigns the value of gmegabuf entry #index to "variable"
i can see myself getting too used to coding with this, then traslating 🙂
there is a serious bug in 1.11.00!
everything is fine as long as you dont use the recursing parser (i.e. write things like loop(n,a=b); )
I'm working on a solution just now
[edit]
The new version (1.11.01) is ready, and is available here
The bug mentioned above isn't limited to the recursing parser, but everything should work fine now with the new version.
[/edit]
everything is fine as long as you dont use the recursing parser (i.e. write things like loop(n,a=b); )
I'm working on a solution just now
[edit]
The new version (1.11.01) is ready, and is available here
The bug mentioned above isn't limited to the recursing parser, but everything should work fine now with the new version.
[/edit]
1.11.02 is available and fixes another bug in the recursing parser. i think i've got all of them now 🙂
[edit]
1.11.02 is done and implements a bracketing check that will mark errors instead of just displaying nothing or even crashing on them 😉
if it finds a bracketing error, it marks the whole block with
no translations are done if there is a bracketing error
[/edit]
[edit]
yet another version (1.11.04) *argh*
After all these structural changes I could now finally implement megabuf assignments the way i meant them to be 🙂
They already worked in 1.11.02 but with the restriction I explained in the 1st addition to the 1.09.00 entry
[/edit]
[edit]
1.11.02 is done and implements a bracketing check that will mark errors instead of just displaying nothing or even crashing on them 😉
if it finds a bracketing error, it marks the whole block with
where n is the number of brackets missing (negative numbers mean too much brackets)
BRACKETS(n)->erronous code<-BRACKETS
no translations are done if there is a bracketing error
[/edit]
[edit]
yet another version (1.11.04) *argh*
After all these structural changes I could now finally implement megabuf assignments the way i meant them to be 🙂
with *round* brackets instead of square brackets 🙂
megabuf(index)=value
They already worked in 1.11.02 but with the restriction I explained in the 1st addition to the 1.09.00 entry
[/edit]
why do you use the bufdist thing in texer2 in your example?
imho it's easier and fSaster to use
n*2, n*3 etc can be pre-calculated on ini.
ex.: buggyAVS2 >> particles-II
imho it's easier and fSaster to use
...where t varies from 0 to (n-1).
megabuf(t);
megabuf(t+n);
megabuf(t+n2); // etc.
n*2, n*3 etc can be pre-calculated on ini.
ex.: buggyAVS2 >> particles-II
The base structure of that texer is quite old *g*
I'd write this differently if i did this now 🙂
It's just 5 points in that texer2... I really don't need to optimize that, do i? 🙂
atm I'm working on a pattern replacement algorithm for AVSTrans, which would allow writing things like
I'd write this differently if i did this now 🙂
It's just 5 points in that texer2... I really don't need to optimize that, do i? 🙂
atm I'm working on a pattern replacement algorithm for AVSTrans, which would allow writing things like
so i think I'm going to switch over to the t+n2 technique, because the interleaving technique(t*n+1) i'm using now is quite hard to pre-cache/optimize if i use pattern matching 🙁
//$AVSTrans_Replacement_Pattern=variable([a-z*/-+()])->megabuf($1+n2)
a=variable(b);
variable(c)=d;
AVSTrans 1.12.00 is out 🙂
Most noticable new feature: Regular Expression Matching/Replacement .
I'm using the RegEx Object from VBScript for that.
For a description of the available Expressions look at the corresponding MSDN site.
The syntax is
a (working) example :
Most noticable new feature: Regular Expression Matching/Replacement .
I'm using the RegEx Object from VBScript for that.
For a description of the available Expressions look at the corresponding MSDN site.
The syntax is
the replacevar may contain things like $1 to get the remembered matches described in the "(pattern)" line in the MSDN document.
//$AVSTrans_Replacement_Pattern=pattern->replacevar
a (working) example :
this translates to
//$AVSTrans_Replacement_Pattern=variable\(([^\)]*)\)->megabuf($1+n2)
a=b;
variable(ab)=d;
e=f
a=b;
assign(megabuf(ab+n2),d);
e=f