Page 5 of 10

Re: New scripting engine - testers wanted!

Posted: Sat Jan 06, 2018 3:24 pm
by srod
New test version added (ver. 1.0.3)

Atop of a bunch of bug fixes I have added bitwise operators (~, &, |, !, << and >>), user-defined 'pseudo' keywords, a couple of additional functions to the standard run-time (HEX() and FINDSTRING()) and support for hexadecimal numbers (must prefix a hex number with '0x').

I do not intend adding new features before the first proper release (ver 1.0) so it is just bug fixes until then. :)

DOWNLOAD minScript

Re: New scripting engine - testers wanted!

Posted: Sat Jan 06, 2018 10:20 pm
by HeX0R
There seems to be something wrong, I get a compilation (syntax-) error here?!

Code: Select all

dim con_state as integer

function init()
  con_state = 0
endfunction

Re: New scripting engine - testers wanted!

Posted: Sun Jan 07, 2018 12:02 am
by srod
Whoa, that's a bad one! :) Bit of a show stopper that one.

Fixed.

Please download again.

Re: New scripting engine - testers wanted!

Posted: Tue Jan 09, 2018 11:14 am
by HeX0R
Next syntax error:

Code: Select all

function test()
  Dim regs as string
  
  regs = "test" + "-" 

endfunction
(Same if I would use "+")

Re: New scripting engine - testers wanted!

Posted: Tue Jan 09, 2018 7:09 pm
by srod
:) Another good one.

Actually, that shone some light on a much larger bug! Doh. You can put keywords in quotes and the darn script still compiles and runs!

Honestly, I give jibbering idiots a bad name sometimes!

All fixed.

I will upload a version with the fixes (1.0.4) when I can.

Thanks.

Re: New scripting engine - testers wanted!

Posted: Tue Jan 09, 2018 7:59 pm
by HeX0R
Is it by design or a lack of feature that, toreal () doesn't work with scientific notations like "1.123E-02"?

Re: New scripting engine - testers wanted!

Posted: Tue Jan 09, 2018 10:00 pm
by srod
Both.

minScript doesn't support scientific notation at this moment.

Re: New scripting engine - testers wanted!

Posted: Sun Jan 14, 2018 11:51 am
by srod
Version 1.0.4 uploaded (bug fix version).

DOWNLOAD minScript

Re: New scripting engine - testers wanted!

Posted: Thu Jan 18, 2018 9:26 pm
by HeX0R
Can't find any more bugs.
Only bad side was, that it took me quite some time to finde the source of those annoying thousands of debug lines appearing when loading a module.

My host app is running fine, seems a little slower then LUA, I didn't took a deeper look, but I knew, that I was quite impressed about the string concatenation speed of LUA.
Unfortunately my app has to add strings quite heavily.
But this is something special anyway, I will add a runtime function maybe to see if speed gets improved.

I think the only thing now missing is the documentation.

btw.:
Where exactly can we benefit from poKeywords over runtime functions?

Re: New scripting engine - testers wanted!

Posted: Fri Jan 19, 2018 9:44 am
by srod
Whoops - forgot about those debugs! Those particular ones (in the compiler class source) give me a huge head start when tracking down a bug. Doh!

Make sure you disable the debugger when testing out the speed of minScript, but, yes, perhaps I should add a 'string builder' user-defined type. I will look into it. Then again, minScript doesn't use any PB strings when concatenating strings; it uses direct memory copy's combined with pre-stored byte lengths (as with BSTRs) so it won't be as slow as using PB strings.

A string builder class with suitable buffers would probably help though. What are we talking about in terms of the string sizes you are working with? (I shall set up initial string builder buffers accordingly).

I have started the docs. I am about 4 pages in; only about another 100 to go! :)

poKeywords were added for my own benefit really. They are similar to a user-defined function, but with a simpler prototype and can be used in script without enclosing any (optional) parameter in brackets. I couldn't allow this for a run-time function because of the various short-cut statements that minScript allows (e.g. x + 1 as a shortcut to x = x + 1 etc.) which would upset the parser.

So, for example, if you have a poKeyword 'PRINT' then the following is valid :

Code: Select all

PRINT x+1
whereas if PRINTN is a run-time function, the following is NOT valid (you must enclose the parameter in brackets) :

Code: Select all

PRINTN x+1

Re: New scripting engine - testers wanted!

Posted: Sat Jan 20, 2018 4:30 pm
by HeX0R
I need to create vector paths from points I get.
Those are 1024 points, which means the string will be around 15000 characters in the end.

A string builder class would be great, but seriously, at the time being this is just a feeling, I didn't investigate deeper into the time consumption, the slow-down could also be somewhere else (in my own code e.g.).
I had to change quite huge parts in my code to switch from LUA to minScript, there are possibilities enough that the root cause is somewhere else.

Regarding poKeywords:
O.k., for now I will ignore them, I see no reason to use them (but take it in mind :))

Re: New scripting engine - testers wanted!

Posted: Sat Jan 20, 2018 4:39 pm
by srod
I've sped up the basic string concatenation and am now thinking about a string builder type class and the fastest way of offering up appending strings and the like which supports native minScript strings, literal strings and arbitrary string buffers etc. A little trickier than I thought it would be. :)

Re: New scripting engine - testers wanted!

Posted: Mon Jan 29, 2018 11:53 pm
by HeX0R
Any news?
I'm really interested in checking the performance of your string builder.

If it is still ongoing, I would also be happy if I could test your latest version with the improved string concatenation.

Re: New scripting engine - testers wanted!

Posted: Tue Jan 30, 2018 12:13 am
by srod
Hi,

yea sorry for the slow progress; very busy at the moment.

I have just uploaded V1.0.5. This contains the beginnings of a string builder type. It is not complete, but it allows you to append strings and to serialise the object to a string variable when ready. Enough perhaps for you to try it. The two string builder demos which you can run with qdMin will show you what is what. The 2 demos are identical except for the fact that the second demo shows how to get the best performance from the string builder type.

It will be the weekend before I can continue work on the string builder type.

Re: New scripting engine - testers wanted!

Posted: Thu Feb 01, 2018 1:09 pm
by Joubarbe
Really interesting, I've always wanted a scripting engine for PB. Good luck with the doc :)