It is currently Wed Jun 19, 2013 12:26 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Any usable scripting language for PB?
PostPosted: Tue Mar 06, 2012 5:02 pm 
Offline
User
User

Joined: Sun Jan 24, 2010 11:12 pm
Posts: 44
Hi,

I'm currently working on a project which badly needs a scripting language for design and to call functions from the host application (i.e. from the pb compiled program).
I've tried Lua, as it is quite popular and easy to learn, however I'm unable to retrieve any error string upon a syntax/runtime error, as the stack returns only an error code, I assume.
My question is, does anyone know any, possibly painless scripting language which could interface with pb with the following features?
1. Possibly no C-like syntax.
2. Is able to call functions from the host application.
3. Has typeless variables, or as few types as possible
4. Not a requirement, but oop for faster development.
If the language is good enough, I'm willing to sacrifice the no C syntax :)

Any help is appreciated.
Erion


Top
 Profile  
 
 Post subject: Re: Any usable scripting language for PB?
PostPosted: Tue Mar 06, 2012 5:07 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Aug 15, 2009 6:59 pm
Posts: 1028
There are actualy PB script engines. I remember Operno and PaladiumX.
A search for those words might help you.


Top
 Profile  
 
 Post subject: Re: Any usable scripting language for PB?
PostPosted: Tue Mar 06, 2012 5:46 pm 
Offline
Addict
Addict

Joined: Sun Dec 12, 2010 12:36 am
Posts: 1309
Location: Waterloo, WI - USA
I think I looked at those before, and while they were off to a good start I'm not sure if they are actively maintained which could be a problem when trying to use for more than experimentation.

It really would be nice if we had an easy way to integrate LUA, Python, or Ruby :? Something with no hassles and easy setup..

I know several people have worked on Python includes (wrappers?) so you may want to try searching for that as well.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Any usable scripting language for PB?
PostPosted: Tue Mar 06, 2012 5:58 pm 
Offline
User
User

Joined: Sun Jan 24, 2010 11:12 pm
Posts: 44
Thanks, I'll have a go at the pb engines and wrappers.
Python, Lua and Ruby would be the best indeed, though they have a really painful API. Especially python, where you have dozens of nested structures and macros, procedures with structure parameters, etc.

Erion


Top
 Profile  
 
 Post subject: Re: Any usable scripting language for PB?
PostPosted: Tue Mar 06, 2012 7:36 pm 
Offline
Addict
Addict

Joined: Sun Dec 12, 2010 12:36 am
Posts: 1309
Location: Waterloo, WI - USA
Personally, I loved the time that I spent learning Python.. I didn't learn a whole lot, in terms of using more advanced stuff or anything like that, but for an Object Oriented language it was the most fun I've had, and most progress I ever made learning a language.

Ruby on the other hand, in a lot of ways seems so easy that I'm too stupid to learn it.. I don't know why, but it always frustrates me the way it does a lot of things, and the way some of the syntax is setup.

LUA I've never really played with because it looked a lot more terse as a language, and cryptic to understand. But I know it is used in lots of games and such.

But realistically I'd take any of the 3 above, with Python being my favorite for now.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Any usable scripting language for PB?
PostPosted: Fri Mar 09, 2012 3:12 pm 
Offline
User
User

Joined: Thu Sep 30, 2010 9:21 pm
Posts: 11
Probably not what you're looking for but you could also take a look at some of the numerous Scheme implementations out there.

Small ones: e.g. SIOD, TinyScheme, Scheme 9 from Empty Space (http://www.t3x.org/index.html) -- the last one is kinda cool, it's super-small and still comes with big number support :D, but you can probably only make sense of it if you buy the accompanying 30$ book.

Bigger extension languages: Elk, Guile

Huge with JiT compiler: Racket

Extensible Scheme to C compilers: Chicken scheme, Stalin (produces C code that is often faster than handcrafted C)

I understand many people don't like LISP syntax but they have one advantage, they allow you to define your own domain-specific language very easily, i.e. you can abstract the interface to your app to a very high-level. Some of them like Racket are also pretty fast, faster than Python and Lua, but I guess only the smaller ones are easy to embed. AFAIK, none of them have been interfaced with PB yet.

_________________
-----
i7 920 6GB ATI 5870 with Ubuntu 12.04 (primary platform) and Win 7 64, Intel iMac 2GB ATI X1600 with OS X 10.5, EEE PC with Ubuntu 11.10, Powerbook G4 OS X 10.4


Top
 Profile  
 
 Post subject: Re: Any usable scripting language for PB?
PostPosted: Sat Mar 10, 2012 2:23 am 
Offline
Enthusiast
Enthusiast

Joined: Sat Jul 09, 2011 7:57 am
Posts: 276
actually python is the best overall language you could find. python has everything and a very huge community which do a lot of open works but the main problem is that you will probably need a DLL written with C to interface python with purebasic. Otherwise, Guile is quite good and can compile Emacs Lisp and ECMAScript (Lua support coming soon) but still not widely know. If you want the most simple but still power full, choose Lua. Lua would be my choice for purebasic, the interface is very easy to implement and there are a lot of examples and tools.

_________________
http://www.mediafire.com/pbstuff


Top
 Profile  
 
 Post subject: Re: Any usable scripting language for PB?
PostPosted: Sat Mar 10, 2012 3:44 am 
Offline
User
User
User avatar

Joined: Sat Jul 23, 2011 1:13 am
Posts: 61
Choosing a scripting language is not enough.
You need a way to interact with the script.
Simply running a script is not enough in most cases (especially in game programming).

Here's a LUA implementation. Unfortunately it hasn't been updated. It's for PB 4.0 and the LUA version is also older.
http://www.realsource.de/index.php/down ... pb-include

I have researched a way to use python with PB. No luck. There's no simple library to interpret python.

And then there's this: http://translate.google.com/translate?h ... 6t%3D21646

_________________
PB 4.6b3 - Win7 32


Top
 Profile  
 
 Post subject: Re: Any usable scripting language for PB?
PostPosted: Sat Mar 10, 2012 12:19 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Apr 26, 2003 2:15 pm
Posts: 354
Location: Vancouver Island, Canada
You may want to search for "Autowin"... a PureBasic scripting language. The source is also included in the ZIP from ts-soft on this site.

_________________
- It was too lonely at the top.


Top
 Profile  
 
 Post subject: Re: Any usable scripting language for PB?
PostPosted: Sat Mar 10, 2012 3:22 pm 
Offline
User
User
User avatar

Joined: Sat Jul 23, 2011 1:13 am
Posts: 61
Not sure if this is suitable.
It's like AutoIt. There's no math, no strings, I don't even know if you can share variables.

Here's the command list:

http://www.realsource.de/index.php/down ... 24-autowin

AW_ChangeMatchMode
AW_FindHiddenWindow
AW_ControlClick
AW_ControlDisable
AW_ControlEnable
AW_ControlFocus
AW_ControlGetHandle
AW_ControlGetText
AW_ControlHide
AW_ControlMove
AW_ControlSetText
AW_ControlShow
AW_MouseClick
AW_MouseDown
AW_MouseMove
AW_MouseUp
AW_SendKeys
AW_WinActivate
AW_WinActive
AW_WinClose
AW_WinExists
AW_WinGetProcess
AW_WinGetState
AW_WinGetStateEx
AW_WinGetTitle
AW_WinHandle
AW_WinHideFromTaskBar
AW_WinKill
AW_WinMinimizeAll
AW_WinMinimizeAllUndo
AW_WinMove
AW_WinSetOnTop
AW_WinSetState
AW_WinSetStateEx
AW_WinSetTitle
AW_WinWait
AW_WinWaitActive
AW_WinWaitClose
AW_WinWaitNotActive

_________________
PB 4.6b3 - Win7 32


Top
 Profile  
 
 Post subject: Re: Any usable scripting language for PB?
PostPosted: Sat Mar 10, 2012 4:51 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4740
Location: Berlin - Germany
The functions in autowin a like autoit, but it is no scripting language, it is a lib for pb users :wink:

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Linux Mint 15 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject: Re: Any usable scripting language for PB?
PostPosted: Sat Mar 10, 2012 8:26 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 27, 2010 9:00 am
Posts: 186
There is actually a fast way to make your own, that is stable and fast. Make a stack-machine with symbol tables and internal pointers. There is also a way to use bison and flex to generate them in C++.

There are no easy ones. Gamemonkey and Lua are the easiest, and Lua is better cause you can disable modules for different security domains and it has an army of veteran engineers as developers..

_________________
so many ideas so little time..


Top
 Profile  
 
 Post subject: Re: Any usable scripting language for PB?
PostPosted: Sun Mar 11, 2012 12:37 am 
Offline
Enthusiast
Enthusiast

Joined: Sat Aug 27, 2011 9:50 pm
Posts: 107
Location: Washington, USA
ultralazor wrote:
There is actually a fast way to make your own, that is stable and fast. Make a stack-machine with symbol tables and internal pointers.


This is what I'm doing. I've already got a language+VM capable of integer and floating point math, string manipulation, and recursion.

forth-like languages are very good at rapid DSL work, too, if you aren't challenged by stack-based programming.


Top
 Profile  
 
 Post subject: Re: Any usable scripting language for PB?
PostPosted: Thu Apr 26, 2012 11:47 pm 
Offline
Addict
Addict

Joined: Sun Dec 12, 2010 12:36 am
Posts: 1309
Location: Waterloo, WI - USA
I've never attempt anything like stack-based programming.. I'd probably suck at it, but at the same time I'd be interested in any newbie type links on the subject.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Any usable scripting language for PB?
PostPosted: Sat Apr 28, 2012 12:59 am 
Offline
Enthusiast
Enthusiast

Joined: Sat Aug 27, 2011 9:50 pm
Posts: 107
Location: Washington, USA
Zach wrote:
I've never attempt anything like stack-based programming.. I'd probably suck at it, but at the same time I'd be interested in any newbie type links on the subject.


This is in assembly, but the principles are pretty easy to follow.
http://git.annexia.org/?p=jonesforth.git;a=tree

The files to read are jonesforth.S and jonesforth.F

They're more documentation than actual code.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: Exabot [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye