New scripting engine - testers wanted!

Everything else that doesn't fall into one of the other PB categories.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: New scripting engine - testers wanted!

Post 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
I may look like a mule, but I'm not a complete ass.
User avatar
HeX0R
Addict
Addict
Posts: 979
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: New scripting engine - testers wanted!

Post 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
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: New scripting engine - testers wanted!

Post by srod »

Whoa, that's a bad one! :) Bit of a show stopper that one.

Fixed.

Please download again.
I may look like a mule, but I'm not a complete ass.
User avatar
HeX0R
Addict
Addict
Posts: 979
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: New scripting engine - testers wanted!

Post by HeX0R »

Next syntax error:

Code: Select all

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

endfunction
(Same if I would use "+")
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: New scripting engine - testers wanted!

Post 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.
Last edited by srod on Wed Jan 10, 2018 12:21 am, edited 1 time in total.
I may look like a mule, but I'm not a complete ass.
User avatar
HeX0R
Addict
Addict
Posts: 979
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: New scripting engine - testers wanted!

Post by HeX0R »

Is it by design or a lack of feature that, toreal () doesn't work with scientific notations like "1.123E-02"?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: New scripting engine - testers wanted!

Post by srod »

Both.

minScript doesn't support scientific notation at this moment.
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: New scripting engine - testers wanted!

Post by srod »

Version 1.0.4 uploaded (bug fix version).

DOWNLOAD minScript
I may look like a mule, but I'm not a complete ass.
User avatar
HeX0R
Addict
Addict
Posts: 979
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: New scripting engine - testers wanted!

Post 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?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: New scripting engine - testers wanted!

Post 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
I may look like a mule, but I'm not a complete ass.
User avatar
HeX0R
Addict
Addict
Posts: 979
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: New scripting engine - testers wanted!

Post 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 :))
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: New scripting engine - testers wanted!

Post 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. :)
I may look like a mule, but I'm not a complete ass.
User avatar
HeX0R
Addict
Addict
Posts: 979
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: New scripting engine - testers wanted!

Post 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.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: New scripting engine - testers wanted!

Post 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.
I may look like a mule, but I'm not a complete ass.
Joubarbe
Enthusiast
Enthusiast
Posts: 555
Joined: Wed Sep 18, 2013 11:54 am
Location: France

Re: New scripting engine - testers wanted!

Post by Joubarbe »

Really interesting, I've always wanted a scripting engine for PB. Good luck with the doc :)
Post Reply