ScriptVM, a script language

Developed or developing a new product in PureBasic? Tell the world about it.
User Mike
User
User
Posts: 68
Joined: Mon Jan 26, 2004 7:06 pm

Post by User Mike »

Wow, I'm impressed.

Worked great for me, and I ran most the examples. I'm always interested in scipting and compiler building. I'll keep my eye on this project.

;)
-Pure Basic User and loving it!-
RJP Computing
Enthusiast
Enthusiast
Posts: 202
Joined: Sun Apr 27, 2003 4:44 am
Location: Michigan, USA
Contact:

Post by RJP Computing »

I too can't wait to see how to do this. I am really getting into compiler/interpeter design. I would love to see how you did this.

Thanks for your hard work.
-Ryan
RJP Computing

Ubuntu 8.10/WinXP, AMD Athlon 64 3000+, 1000MB RAM, AC 97 Audio, nVidia GeForce 7600GT 512MB
BalrogSoft
Enthusiast
Enthusiast
Posts: 203
Joined: Sat Apr 26, 2003 6:33 pm
Location: Spain
Contact:

Post by BalrogSoft »

Hi, i published on this forums a previous version of the language, its a code to execute a virtual code, with nested functions like add(3,add(5,3)), and variable handling, but it dont have the compiler, it could be easy to understand than ScriptVM source code on actual version (because it dont have any comment, i never comment my code unless i make public my source code, and a script language with the virtual machine and the compiler its difficult to comment it for people)

The source of the little code snippet is here:
viewtopic.php?t=9565

And a new version of ScriptVM (v0.3) its available here (with source code available, but without any comment, sorry):

http://www.balrogsoftware.com/downloads/ScriptVM.zip
User Mike
User
User
Posts: 68
Joined: Mon Jan 26, 2004 7:06 pm

Post by User Mike »

Thanks so much Balrog.

This is going to be very helpful to me.

Again, thanks for all your support you've provided me. Now I must soon order PB!

8)
-Pure Basic User and loving it!-
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Can't compile the code with the 3v89beta.
Changed the 'memory' related stuff because Fred changed it, but no go... :cry:
User Mike
User
User
Posts: 68
Joined: Mon Jan 26, 2004 7:06 pm

Post by User Mike »

It doesn't compile for me for 1 of 2 reasons.

1.) There's a mistake in the source.

2.) I'm using the demo version at the moment.

No worries though, I don't need it to compile. ;) I'm just trying to learn all I can from it.

8)
-Pure Basic User and loving it!-
BalrogSoft
Enthusiast
Enthusiast
Posts: 203
Joined: Sat Apr 26, 2003 6:33 pm
Location: Spain
Contact:

Post by BalrogSoft »

Hi, i compiled this program with PB 3.81, i not use PB 3.89b to compile my projects, try again with PB 3.81.

User Mike: You say that dont work because source have mistakes, are you sure? With PB 3.81 (complete version, not demo) works peferctly, im sure that have bugs, but not compiler mistakes.

Anyway, i will test it on PB 3.89.
User Mike
User
User
Posts: 68
Joined: Mon Jan 26, 2004 7:06 pm

Post by User Mike »

If it compiles for you fine, then there are no source code mistakes. Those were just the 2 possibilites of what I thought could have caused the problem.

No more worries though, I'm going to order the full version of PureBasic this weekend. Until then, I'll keep analyzing your souce.

;)
-Pure Basic User and loving it!-
BalrogSoft
Enthusiast
Enthusiast
Posts: 203
Joined: Sat Apr 26, 2003 6:33 pm
Location: Spain
Contact:

Post by BalrogSoft »

I tried to compile it with PB 3.89B, and the compiler dont generate the virtual code, at this moment i dont know what is the problem, it can be a bug of PB 3.89Beta, or can be a problem with commands changed on this version.
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Maybe Fred could use this code to test the stability of the PureBasic Compiler 8O

Pedro, have you worked on your 3D engine lately, perhaps doing a real PB Library with El_Choni's wonderful Tailbite tool :?:

Keep up the good work man :wink:
BalrogSoft
Enthusiast
Enthusiast
Posts: 203
Joined: Sat Apr 26, 2003 6:33 pm
Location: Spain
Contact:

Post by BalrogSoft »

Hi, i uploaded a new version of ScriptVM (v0.31) to my site, the link is the same that other versions, some bugs with floats numbers are solved, i added some features to ScriptVM Editor, and a better help file, its compiled with PB 3.81, i dont know if it will work with PB 3.89b, if i have time, i will port an opengl example to ScriptVM.

fsw: I dont work on my 3d engine since months, i think that would be better to rewrite it and planning it on a different way, and about make a PB library, you can try it, the source code is available on my site.
BalrogSoft
Enthusiast
Enthusiast
Posts: 203
Joined: Sat Apr 26, 2003 6:33 pm
Location: Spain
Contact:

Post by BalrogSoft »

Hi, i added a opengl example, it works peferctly, and i added a new command, ProcessEvent(), its like WindowEvent() for PB(but using API and PeekMessage), the address is the same, like other versions.

A little screenshot of ScriptVM in action, with OpenGL, iCamPlay and Window example working:
Image
User Mike
User
User
Posts: 68
Joined: Mon Jan 26, 2004 7:06 pm

Post by User Mike »

That's really awesome Balrog. Just started reading a book and following the NeHe tutorials for OpenGL.

You're really inspiring me.

:)
-Pure Basic User and loving it!-
BalrogSoft
Enthusiast
Enthusiast
Posts: 203
Joined: Sat Apr 26, 2003 6:33 pm
Location: Spain
Contact:

Post by BalrogSoft »

Hi, a new version of ScriptVM is available on my web: http://www.balrogsoftware.com/scriptvm
The source code is available on the web too, the new version features:
Procedures parameters are now local variables.
Recursive procedures, a procedures can call itself, because ScriptVM makes a new instance of local variables when a procedure is called.
Support for CDECL libraries types using only & prefix.
ScriptVM now have a intaller tool, better than zip distribution.

Bye and enjoy, if someone have some questions about source code, only email me.
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Very nice job Pedro 8)
I appreciate every piece of code where I can learn from.
Thanks

BTW:
can somebody please explain (maybe Fred :wink: ) why the following code, from the scriptvm.pb file, works with 3.81 but not with the fully updated 3.9 :?:

Code: Select all

Procedure.b FPeekB(Address.l)
  *PtrB.BYTE=Address.l
  ProcedureReturn *PtrB\b
EndProcedure
It crashes on ProcedureReturn 8O
It's not possible to return a pointer anymore :?:
Last edited by fsw on Fri Apr 23, 2004 8:26 pm, edited 1 time in total.
Post Reply