BriskVM 2 released

Community Forums/Showcase/BriskVM 2 released

Koriolis(Posted 2008) [#1]
Hello everyone.
I am pleased to announce the release of BriskVM 2.
If you haven't heard of BriskVM yet, this is a scripting engine targetted mainly at (but not limited to) game scripting.
The library is multi-platform (Windows, Linux and MacOs X) and multi-language (currently comes with bindings for BlitzMax, Blitz3D/BlitzPlus, PureBasic and C++).

So what are the specific strength of BriskVM I hear you ask.
If I were to give just two, it would be:
- It greatly simplifies the integration of scripts into an application, by drastically reducing the amount of glue code that one needs to write.
This is achieved in particular through the use of a special file in which you list everything that is to be accessible to the scripts (being functions, global variables or types).
Everything is then generated from this description. With this approach, you can focus on the WHAT, not the HOW (what to expose, not how to do it).
- The script language (BriskSL) is a BASIC dialect that is both easy and powerful.
In fact, the core of the language is BlitzBasic itself, augmented with a set of powerful extensions
such as Object Oriented Programming, reflection, serialization...

I invite anyone with an interest in scripts to give a whirl to the trial version, which will let you try every aspect of BriskVM (it is not feature limited).
Please note that the trial version is currently available for windows only, although the full version already comes for the three mentioned platforms.

For any question, suggestion, or whatever, feel free to come to the BriskVM forum:
http://koriolis-fx.com/forum

As for owners of a BriskVM 1 license (precedently known as "Blitz Virtual Machine"), they will benefit from a free upgrade to the equivalent BriskVM 2 license.
Simply send a mail with your licensing information (key and user name) at my contact address (see my profile) and you will receive a new license key, and
instructions to download BriskVM 2.


@rtur(Posted 2008) [#2]
Great! :)


@rtur(Posted 2008) [#3]
You forgot to include resources for B3D sample- Bouncey.bsl


nrasool(Posted 2008) [#4]
Hi Koriolis, Might I make a friendly suggestion, on your site, where you list the product, http://www.koriolis-fx.com/index.php?id=97, I would suggest putting the prices on the product on there, so potential customers know how much it is, rather than for them to click on the shareit link.

Saying that, looks great and very very reasonable price :)

Good Luck with it, hope it goes well. Will prob get this


nrasool(Posted 2008) [#5]
Koriolis, please could you explain the difference between independent and commercial version of your licence?


@rtur(Posted 2008) [#6]
And there is small mistake in "Menu.bsl" in line: Using "Balls.bbm" (.bbm instead of .bvm)


Koriolis(Posted 2008) [#7]
You forgot to include resources for B3D sample- Bouncey.bsl
And there is small mistake in "Menu.bsl" in line: Using "Balls.bbm" (.bbm instead of .bvm)
Thanks, I will correct this.

where you list the product, http://www.koriolis-fx.com/index.php?id=97, I would suggest putting the prices on the product on there
Good suggestion, done. I also detailed the differences between the different licenses (which was already described in the License.txt file which comes with the trial version).


nrasool(Posted 2008) [#8]
Nice on Koriolis, Thanks for this. Expect payment for me in the next few days, this looks great


nrasool(Posted 2008) [#9]
Koriolis, just to add, I purchased it, and on full version setup, it incorrectly setup the script editor on desktop to

""C:\Program Files\BriskVM 2\ScriptEditor.exe""

when it should be:

"C:\Program Files\BriskVM 2\bin\win32\ScriptEditor.exe"

So when you launch, you get Windows trying to find the application :)


Koriolis(Posted 2008) [#10]
Oops. I checked the quick launch shortcut and it was OK, I forgot to check the desktop shortcut, silly me.
OK I'll fix that asap too. Thank you.


popcade(Posted 2008) [#11]
Sounds cool, if there's static version available?

I tend to buy one soon.


Koriolis(Posted 2008) [#12]
No static version yet, but I might do one in a future release.


Nack(Posted 2008) [#13]
this seems really cool. I havent tried this to the fullest extend but I remember coming across a few problems in script languages, wondering if they exist or not in Brisk. Better to ask then endlessly testing it out LOL

1. Is there a line limit per script? Like a max set of instructions?
2. I remember in the previous script engine i was using. Massive condition, loop statements, for loops etc will be very slow and sometimes crashes. Is there such a problem? like for ex.
<presudo code>
for i = 1 to 1000
if i = 500
for loop 1 to 3000
select value:
case 1
do
loop
case 2
end
nxt
endif
next
etc.

3. How many script can be run simulatiously? or is there a limit? lol

4. I think you can tell of what I plan to do with scripts. RPG builder with NPC, events, auto events etc. I presume it safe to say user can wrote scripts for their own events, npc for my engine? Any licensing issue about this part?

5. As for as I understand of the license, if I am an indi developer (one/two man team LOL), the independent lience is rite for me rite? commerical license is for those who have their stuff published or seomthing and sold thru publisher?

now.....back to tryin out ur demo ^^

Nack


Koriolis(Posted 2008) [#14]
1. No
2. Not that I'm aware of. If bugs are discovered, they will be fixed.
3. No limit other than what is sensible given the available CPU power. However you say "simunatenously", so to keep things clear I must say that there is (currenty) no proper support for concurrency. If you want to have different scripts run "simunatenously", you would do just like in standard BlitzMax/Blitz3D (such as having an "Update" function scripts, called each frame). Also in my opinion it is best here to take advantage of the OOP support: rather than creating one script per "entity", write a new type per kind of entity. It's more manageable, and even more resource friendly. But it's just an advice, you may integrate scripts as you see fit.
4. Absolutely. Giving the end user the ability to MOD your game is one the biggest intended use for BriskVM. No licensing problem here. Only the developer(s) integrating BriskVM need a license, the runtime is then free to use and redistribute. As stated in the EULA, you can actually redistribute pretty much everything except the "bvmtools" shared library (which is only needed for the developer integrating BriskVM, and unneeded for cscript compilation nor execution).

5. Exact. One point though: as the license states, established game portals are also interpreted as commercial, so if you get a deal with such a portal you should have a commercial license. If on the other hand you distribute your games via your site you certainly qualify as "indie" :)
In any case, there is an upgrade from "indie" to "commercial", so you don't have to worry about wether you'll go "commercial" or not in the future. You can switch when you want and only pay the difference.


ziggy(Posted 2008) [#15]
That looks awesome. I would like to add a parser for your script language to BLIde Plus. Any chance to get a detailed explanation on the language syntax?


Dreamora(Posted 2008) [#16]
Congratulation Koriolis
Have been waiting for its full release after some "tinker tests" with the open beta.
It might not be of much use for my current project but for the future one and I think its definitely worth buying it even when only considering to use it :)

Ziggy: That indeed would be great :)
I am already able to use Blide for nearly anything I need (BMX, XML in most cases) and if BriskVM scripts were possible as well this would round it up to "all you could need" :)


Koriolis(Posted 2008) [#17]
@Ziggy: This would be really great :)
I haven't got a simple grammar to give, but the script language manual ( http://www.koriolis-fx.com/index.php?id=94 ) details the language syntax (though not with a formal BNF specification). Tell me if it's good enough for you to write the syntax highlighter/intellisens/whatever. For any remaining question we can discuss by mail, I am very wlling to help, as you can imagine :)

@Dreamora & others: Thanks for the support.


Nack(Posted 2008) [#18]
Also in my opinion it is best here to take advantage of the OOP support: rather than creating one script per "entity", write a new type per kind of entity. It's more manageable, and even more resource friendly. But it's just an advice, you may integrate scripts as you see fit.

Brisk HAVE OOP??? and here i am tryin to fake oop scripts....
Hmm, tell me more about this idea...cus the way I am doing now, as you said, each "npc/event" have its own script file. when user "approach/activite" it, the script will run and auto flush itself afterwards for memory purpose. How will OOP help? I am just tryin to grasp the idea, kinda interesting....and interested if its more manageable

Also, we often include some third party dll (fastlibs, winblitz3d etc). can your script handle it? I tried testing out some examples from fastlibs and it seems to crash. Maybe I am doing something wrong (most likely i am lol)

The blitz3d's famous "INCLUDE" command LOL. Can your script include other script and stuff? Because scripts can get big.....very fast.

Finally, the script editor. How customize can I get with it? Also, does it support unicode? Because the editor will be available to end user. By unicode, the engine will handle displaying stuff, its just the editor need to allow users to input unicode. So its just need to "show" the unicode and nothing else.


Sorry for so many questions, Its just I well into my new engine, and if I want to switch script engine it has to be now before its too intergrated. So got to see if it can do what I want it to do before purchase lol


GW(Posted 2008) [#19]
Nack, You should really read the docs the came with the demo or view them online at http://www.koriolis-fx.com/
All your questions are answered there. There are lot of examples that explain how to bind your application with BVM and detail the power of the scripting language.


ziggy(Posted 2008) [#20]
Koriolis, for what I've seen, it is very similar to BMX, so maybe the best way to go would be if I could know exactly wich syntax diferences there are and I think a way to implement them. If I could create a parser that inherits the BMX existing one, and just add the changes, this could be done very easily.


Koriolis(Posted 2008) [#21]
@Nack: OOP really shines when it comes to manage concrete entites, such as NPCs adn the like. Just as an example, you can have a base TEntity type, a TEnemy type derived from it, a TPlayer type, a TTroll type derived from Tenemy, end so ona, everything forming a natural hierarchy. Behaviour can then be written in terms of methods of these types. In particular, the "Update" function I was talking about would then become an "Update" *method*, and in your main loop you would loop over each entity and call their "Update" method in turn.

Also, we often include some third party dll (fastlibs, winblitz3d etc). can your script handle it?
If you can call the function from your host application, you can make it available to scripts. In Blitz3D it means that what you have in the .decls file, you can put in the command set file, and that's about it.


The blitz3d's famous "INCLUDE" command LOL. Can your script include other script and stuff?
Yes, it's supported. As GW suggested, you should really have a look at the documentation, there is a manual dedicated entirely to the script language.

How customize can I get with it?
You can add menu entries and the like. When you're ready to customize it, you can ask for precise information and help on the forum.

Also, does it support unicode?
No, the editor doesn't support it (yet). Making it support unicode should be relatively easy for me I guess, but scripts source files don't support Unicode anyway. Note however that it doesn't mean that Unicode is not supported at all: scripts strings are unicode, so you can share unicode strings with the host application. But this, too may change : I'm thinking to support UTF-8 in source files (so that you can directly type unicode strings in your scripts), the priority I give to this will depend on the demand.


Nack(Posted 2008) [#22]
oh this script is awesome. yea, sorry, i should really look at the documentation, just that I am on a business trip rite now, not much computer time...got too excited when I see this lol. I will definately purchase this when I return home next week! Expect a payment next week =]


JoshK(Posted 2008) [#23]
I have been beta testing this, and it is really amazing. The first BVM was pretty good, but BVM2 supports so many new features and is so much easier to integrate with BlitzMax. I am using it in Leadwerks Engine.


plash(Posted 2008) [#24]
I noticed an error in BriskVM Manual -> Linking with the library. The first code example, in blitzmax, says "Using koriolis.briskvm" when it should be "Import koriolis.briskvm".


Naughty Alien(Posted 2008) [#25]
..im really impressed..I may buy this..


Koriolis(Posted 2008) [#26]
@Ziggy: sorry, I missed your post, maybe you sent it while I was writing my own post.
I'll write a little BMX<->BriskVM language comparison soon, and send it to you by mail.
@Plash: thanks, I will fix the docs.


ziggy(Posted 2008) [#27]
Great!


N(Posted 2008) [#28]
Trying to use the demo just through the script editor. Pretty buggy editor, guess that's why I don't use editors that come with stuff most of the time. Anyway, I wanted to try and get familiar with extended methods, so I looked at the documentation, which already confused me because I think it by itself is confused, and doesn't know what to open or close the function/method with:

' Extension method (defined outside TEntity)
Method Move(Self:TEntity, x:Int, y:Int)
    Self.x = x
    Self.y = y
End Function


So I wrote the following using Function first, assuming that End Function probably means 1) it's a function and 2) this is probably just syntactic sugar detected by the compiler/interpreter/what have you (since it doesn't say). This is wrong, it's Method. Confusing. In addition to that, the language documentation does not explain the little !flags at all (note: language, not the other thing, which should be merged so it makes sense), which lead me to believe that you hated explicitly declaring variables and momentarily caused me to shake my fist feebly at the ceiling.

Type CColor
	Field r,g,b
End Type

Method SetColor(Self:CColor, nr,ng,nb)
	Self.r = nr
	Self.g = ng
	Self.b = nb
End Method

Local c:CColor = New CColor

c.SetColor( 5, 10, 15 )

Print c.r
Print c.g
Print c.b


The editor gives me this:
Error: Script file 'C:/Users/Noel/Documents/woop.bsl', not found

I assure you, editor, this file does exist. You happen to be modifying it! O_o But fine, I can accept that, default editors hate me, fine, be that way.

So I went to the command line, and thankfully after about 40 minutes of fiddling with your bloody evil bvmcmd.exe (which, by the way, refers me to bvmcc.exe at times, which clearly does not exist) and its habit of not accepting absolute paths with -m ("C:\...\woop.bsl" isn't accepted, and apparently will only allow me to use "woop.bsl," which leads me to believe that your editor does not know how to use the compiler or your compiler does not know how to determine whether or not a path is relative).

That aside, wonderful language and I'll probably buy it. But good god man, the editor!

Note: Editing this post as I go.

Reading the documentation off your site is painful. Extremely painful.

Do you have a grammar for the language? (Just curious. Wouldn't be of any actual use.)


Koriolis(Posted 2008) [#29]
Pretty buggy editor
The editor is pretty much a bonus, and a work in progress. It is maybe maybe not good enough yet for using beyond simple source code edition (what I mean is that it certainly can't be seen yet as a full blwon IDE, but is already much better than using notepad, or any editor that has no syntax highlighting for BriskSL). Other than that, if you find sever bugs I'd be thankfull for you to report them on the BriskVM forum.
By the way, at one point I may open source the editor, so that if anyone feels like he could enhance it further.

which already confused me because I think it by itself is confused
In all honesty I don't think the script language manual is that bad. There are necessarily some typos left here and there, and I correct them as they are reported. Thanks to report the error about the extension method, I fixed the docs, it will be in the next release (ad is already fixed on the online help). If you have other complaints I invite you to detail how you think I can enhance it, this would very much help me.
(note: language, not the other thing, which should be merged so it makes sense)
Here I have to disagree. I separated the language manual and the library manual on purpose, because the angle is not the same, and so that you can redistribute the script language manual along with your briskvm-powered application (a modder doesn't care about the brisvm library, all he cares about is the script language).
And the "!flag" thing (that is, "command set options") are something a modder as no way to modify, it's totally in the handds of the devloper that integrates BriskVM, hence why it's explained in the BriskVM manual, not in the script language manual. That said, I alsa have included notes here and there in the language manual to warn that feature X is only available if option Y is specified in the command set.

I think your problem may be due to the fact that you specified repository directories inside the script editor. When repositories are specified, *only* scripts (or command sets, or modules) within the repository are accepted. This is for security reasons (this is a bit like in Java where classes must all be within the classpath). Your problem with bvmcmd may be the same : if you specified a repository earlier on the command line, no script outside this repository will be accepted.

Reading the documentation off your site is painful. Extremely painful.
I agree it could be more comfortable. But come on, *all* the docs comme with the trial version, so it's seriously no big deal. Thanks to report though, it confirms my own thoughts.

For the grammar: no, I have no formal grammar for the language (well I have one, but it's not the "clean grammar", as it's the grammar I actually use for the parsing and compiling, which is unnecessarily complex for mere reading).


N(Posted 2008) [#30]
I think your problem may be due to the fact that you specified repository directories inside the script editor.
Looking at the options for that, it appears that it is set by default to have the repository path as ".". You can't set it to nothing in the editor, and it appears your default is the bin\win32 folder. I didn't set it, so I'm blaming you for that.

One question I have for you is in regards to handling multiple script files (because, obviously, packing everything into one gigantic script is stupid). Can the compiler be set up such that if a script includes a BSL file, it searches for an existing BVM. If the BVM's timestamp is older than the BSL's timestamp (or the BVM doesn't exist), the BSL is recompiled on the spot and the new BVM is included.

That would require the BSL to exist, so it could be handled such that in the case the BSL doesn't exist, the BVM is just used as-is. (And if neither exist, the compiler shakes its head and asks if you're insane.)

The way it is now (as far as I've seen, since I haven't gone through the docs entirely), it seems that you have to have the host application check all the files and recompile them if necessary before actually loading the scripts. This isn't really convenient because it means that, as a solution, I still have to spend a lot of time including functionality that I think should be part of the compiler. It'd be like getting a vacuum cleaner, except it has no handle, so you tape a broom handle to it. Should have come with a handle, but instead you're forced into adding functionality to the vacuum in a way.

For example, BlitzMax will recompile imported source files if it has to, or just link to the objects that were already compiled (or compile them if the objects simply don't exist). What I'm more or less hoping for is something similar to this, if the above didn't make much sense.

And it looks like the end of the month timestamp-screwy just happened...


GW(Posted 2008) [#31]
One question I have for you is in regards to handling multiple script files (because, obviously, packing everything into one gigantic script is stupid). Can the compiler be set up such that if a script includes a BSL file, it searches for an existing BVM. If the BVM's timestamp is older than the BSL's timestamp (or the BVM doesn't exist), the BSL is recompiled on the spot and the new BVM is included.

Thats just being lazy.

You could
1) just use the BVM panel to compile your scripts.
2) have your own code in your host application compile your scripts on startup.
3) Export the BVM compiler command to BVM and write a script to compile your scripts, then just call that script at runtime.


N(Posted 2008) [#32]
Another thing: why is there no support for 64-bit data types? This is kind of a big problem for me.

1) just use the BVM panel to compile your scripts.
I would prefer not to have my users have to compile their scripts manually.
2) have your own code in your host application compile your scripts on startup.
I'm saying there should be an option so that I don't have to do this. If it's going to look like BASIC, you may as well include that simplicity in its use as well.


Nack(Posted 2008) [#33]
No limit other than what is sensible given the available CPU power. However you say "simunatenously", so to keep things clear I must say that there is (currenty) no proper support for concurrency. If you want to have different scripts run "simunatenously", you would do just like in standard BlitzMax/Blitz3D (such as having an "Update" function scripts, called each frame).

Hmm just hit me, I want to make sure our defination of "simunatenoously" is the same. By simuatenously, I mean Multi-Threading. In my Nream Engine, one "event" constantly having 2+ script running at the same time. One mite be for movement, and another for acuatl events etc. I want to make sure Brisk can Multi-Thread. Because so far, from what I seen in the demo, both (rain, bouncy) are ran one after the other. And if one script have like "repeat; forever" loop in it, the program will run/stuck in that script forever. I read over the manual multiple times, and cant seem to find such answer/solution. I was wondering, does it support multi-thread?


Koriolis(Posted 2008) [#34]
@Noel/Dingbat Blump:
One question I have for you is in regards to handling multiple script files (because, obviously, packing everything into one gigantic script is stupid). Can the compiler be set up such that if a script includes a BSL file, it searches for an existing BVM. If the BVM's timestamp is older than the BSL's timestamp (or the BVM doesn't exist), the BSL is recompiled on the spot and the new BVM is included.
Actually I was already thinking about doing this. See my Public TODO list
However, please note that comparing this with BlitzMax is unfair, because as GW hinted BriskVM *already* lets you compile a whole repository recursively, just use the BriskVM control panel. So typically you would just have to run this "repository recompiling" before recompiling your application. And because this operation is also available through the command line front end, you can even integrate this as a thrid party tool in most editors.
As for the BriskVM script Editor, I'm going to add a menu entry for this operation (I just added this to my TODO list)

I'm saying there should be an option so that I don't have to do this. If it's going to look like BASIC, you may as well include that simplicity in its use as well.
I actually agree, entirely. This is why it's in my TODO-list.

@Nack:
There is no proper support for multithreading yet. This is mostly because I'm still wondering what is the best in terms of API for this, rather than hard technical problems.
Indeed, BriskVM already supports the bases for multithreading: you can schedule the timed execution of a function (I call this "tickers", you may know this better as "timers").
In addition, you can also execute scripts with a timeout, so with short timeouts you can simulate multithreading.
However this is not very user firendly, hence why I certainly don't consider it a true feature I can bragg about.

So, in the current state of BriskVM, the best thing to do is probably to do just like in BlitzMax of BlitzBasic, as I said.

However, since I'm very interested in adding some form of concurrency, I'd really like to discuss with you (and others) about what would be the best API for this.
----------------------------------------------------
(...going into the details...)
As I hinted in my public TODO-list, I'm thinking about a dual solution:
- concurrency at the level of a whole execution context, that is the host could say something like "these three contexts", I'd like you to run them concurrently. This part is technically pretty easy for me as I already have everything to handle the timeouts. If I can settle on the best API quickly, this can really be added very soon (no kidding). An additional related question is: should I provide some kind of mutex? I tend to think it's less of an issue in our case, as scripts will never run in parallel with the host (even if they run in parallel with one another), so a mutex is less of a need tha for say a C++ application.
- a more fine grained concurrency, probably synchronous (most people would not call this "true" concurrency, but this is still really usefull). I'm still very unsure about this one, and it will probably take quite some tries and discussions with BriskVM users before I come up with something I'm pleased with (or before I toss it entirely).

I'll stop here with this, as I'm going to frighten potential users who may be made to believe that BriskVM is awfuly complex (when I'm merely digressing).
If you want to discuss about the issue (and possibly have an influence on the final API for concurrency), you can come on the forum and give me your view on this.


Koriolis(Posted 2008) [#35]
Ziggy, I sent the BriskVM-BlitzMax syntax comparison that you asked for.


N(Posted 2008) [#36]
Bought after fiddling around with it most of the night. Obviously there are some weak points, but I can still make use of it, and I think the language features make up for a lot.


Dreamora(Posted 2008) [#37]
Definitely. Its far simpler to integrate than anything I tried given the features it brings in with OO and the like. And the IDE + especially debugger are definitely features that you won't find that often on other script languages.


N(Posted 2008) [#38]
Wrote a program to take my source code, read off various special comments within it, and generate the command set for the code afterward. Rather happy with how that turned out. Smooth sailing so far.

If anyone is interested in using such a thing, I'll see about modifying it to not rely on my speshul code and post it somewhere.


Beaker(Posted 2008) [#39]
Dingbat - sounds useful.


fredborg(Posted 2008) [#40]
I've made a simple command set generator (like noels I assume) which runs through selected files and spits out the nescessary invoker + command set along with some very basic documentation.

Tag functions, types, fields, or methods with 'expose to let the script access them.

Here's the source along with a simple example which uses the source code itself as a demonstration...



Remember to copy bvmtools.dll and briskvm.dll to the same folder as the source code, otherwise it won't run...

BriskVM2 is superb!


Koriolis(Posted 2008) [#41]
He he, this is great. Thanks to both of you to share this.


N(Posted 2008) [#42]
You did close to the exact same thing as me. Creepy.

Latest version of my BCS thingamajigger. The code is terrible, I won't deny that, but then it wasn't really intended for use by others:


The way it works is that inside of the code, you place a comment block like this:

You can have as many blocks of those in a file as you want, although it probably makes the most sense to stick to one and keep its contents relevant to the file (not that this is enforced, just a good idea).

You will need to have SParse: http://www.blitzbasic.com/codearcs/codearcs.php?code=2217

Frankly, I'm probably going to swap this out for fredborg's now.

Edit: And mine has no support for arrays, since I'm not sure that they're accepted as arguments to host functions (or script functions yet, even- haven't tried it yet, guess I will).
Edit 2: And consider this public domain, obviously.


plash(Posted 2008) [#43]
Here's a version of fredborg's code that allows drop on builds: