Page 1 of 1

DracScript Preview! (Now released, check announcements)

Posted: Tue Mar 07, 2006 7:41 pm
by dracflamloc
[edit]
See here for the full release: http://www.purebasic.fr/english/viewtopic.php?t=20312
[/edit]


Hey you don't need to report errors you get with this. Its just a test build to give you guys a little taste of what will soon be public domain for all to enjoy!

Read the readme.txt!


Let me know what you think! Obviously speed improvements are on the way. But its pretty quick so far.

Currently it runs in pb 3.94, and should be real easy to use in pb 4.0 once I've released the code.

sweeeeet

Posted: Tue Mar 07, 2006 7:52 pm
by Shannara
This is niiice ...

In future releases, is it possible to cal PB functions directly? Are they exposed to the engine? How about Structures? Those are a few things missing in other PB based scripting languages that I have seen on these forums so far ... what about the ability to read/write to pb linklists or arrays? Im curious as to how far this has one ..

If it made it that far, then it is definately a contender to VBScript :)

Posted: Tue Mar 07, 2006 8:02 pm
by dracflamloc
PB has no reflection so its not possible to call pb functions directly but it would be very simple to make those functions available to the scripting engine. There is a command:

DS_RegisterCommand(@Proc(),commandname.s,numParams.l)

This will allow any pb procedures to be commands in the scripting language that you like. The default functions like Mod, Mid, etc, are actually optional and can be stripped out to make the engine even more lightweight if needed.

No structures yet. Not sure if ever, but since its open source maybe someone will add it. The key is for this language to be light and quick and easy to implement into a project. Its possible though for a command to be created using the above DS_ procedure that passes addresses to pointers and such.

So in the script you could do:
SetPlayerX(playerStruct,10)

playerStruct could be set as a constant or set as a variable during the script.

In PB the Procedure could look like:

Code: Select all

Procedure SetPlayerX(*playerAddr.PLAYER_STRUCT,newx.l)
DS_RegisterCommand(@SetPlayerX(),"SetPlayerX",2)

Posted: Tue Mar 07, 2006 8:06 pm
by Killswitch
Looks great - but no source?

Posted: Tue Mar 07, 2006 8:08 pm
by dracflamloc
I'm not done with it yet =) Its just a preview

Posted: Tue Mar 07, 2006 9:40 pm
by Shannara
Actually ... I was trying to compare this against the WSH for VBScript.. and with what you told me, basically neither have reflection, but both allows you to register functions in the script, which is awesome :) The only difference I can see now is that WSH allows classes/structures to be registered and passed back and forth the registered functions.

But that's ok if this doesnt provide that, because its fairly easy to wrap a structure or a linklist/array object around a registered function :) This is great news!

Another one is .. can you load multiple scripts at once? With the ability to reload individual scripts as warrented?

Sorry, one more question, I have to prod after having a taste :D

Can the engine load script files from memory, given a memory pointer and length? This would be helpful loading script files from packed files :)

Posted: Thu Mar 09, 2006 7:55 pm
by dracflamloc
While right now it can't, It should be relatively simple to add that stuff. The first release will be one script at a time. You can load from the buffer probably by doing a peeks(*buffer,length) and passing it to the DS_LoadScriptString() procedure.

Posted: Fri Mar 10, 2006 3:13 am
by Shannara
Hmm, cool. cant wait for the release.