[Pharo-project] Fwd: Lua scripting with nativeboost?
<quote author="Jacob Wagner"> Hello. Is anyone interested in getting lua scripting to work with pharo, using nativeboost? I do not think it should be very difficult, but it is beyond my knowledge of c and lua and nativeboost. The reason I would like this is for possible gaming applications. I am already trying my hand at writing games with amber smalltalk as a client and pharo + websockets as a server, but it would be very cool if the users could write some lua 'sandboxed' scripts that run on the server. </quote>
On 12 December 2012 01:44, DeNigris Sean <sean@clipperadams.com> wrote:
<quote author="Jacob Wagner"> Hello. Is anyone interested in getting lua scripting to work with pharo, using nativeboost? I do not think it should be very difficult, but it is beyond my knowledge of c and lua and nativeboost.
The reason I would like this is for possible gaming applications. I am already trying my hand at writing games with amber smalltalk as a client and pharo + websockets as a server, but it would be very cool if the users could write some lua 'sandboxed' scripts that run on the server. </quote>
just one question: why you need lua if you have smalltalk? and sure thing, one can implement bindings to lua C API. http://www.lua.org/notes/ltn004.html -- Best regards, Igor Stasenko.
Why not use pharo itself? Scripting languages are used in static-typed systems as a way to avoid their complexity, so I understand clearly why c++ games provide lua (or python) as a script language... but I do not understand which benefit would bring using lua as a scriptiong on pharo (and yes, I do have gaming in mind). also, a non-programer will find a lot easier to learn pharo than lua. Esteban On Dec 12, 2012, at 1:44 AM, DeNigris Sean <sean@clipperadams.com> wrote:
<quote author="Jacob Wagner"> Hello. Is anyone interested in getting lua scripting to work with pharo, using nativeboost? I do not think it should be very difficult, but it is beyond my knowledge of c and lua and nativeboost.
The reason I would like this is for possible gaming applications. I am already trying my hand at writing games with amber smalltalk as a client and pharo + websockets as a server, but it would be very cool if the users could write some lua 'sandboxed' scripts that run on the server. </quote>
I was thinking about making a MUD / MOO type game with pharo as the server and scripting language. Any ideas on how this should be done? How would you make sure the user scripts are sandboxed? Would you have an image running the server and a separate image for each user? On 12 December 2012 08:05, Esteban Lorenzano <estebanlm@gmail.com> wrote:
Why not use pharo itself?
Scripting languages are used in static-typed systems as a way to avoid their complexity, so I understand clearly why c++ games provide lua (or python) as a script language... but I do not understand which benefit would bring using lua as a scriptiong on pharo (and yes, I do have gaming in mind).
also, a non-programer will find a lot easier to learn pharo than lua.
Esteban
On Dec 12, 2012, at 1:44 AM, DeNigris Sean <sean@clipperadams.com> wrote:
<quote author="Jacob Wagner"> Hello. Is anyone interested in getting lua scripting to work with pharo, using nativeboost? I do not think it should be very difficult, but it is beyond my knowledge of c and lua and nativeboost.
The reason I would like this is for possible gaming applications. I am already trying my hand at writing games with amber smalltalk as a client and pharo + websockets as a server, but it would be very cool if the users could write some lua 'sandboxed' scripts that run on the server. </quote>
On 12 December 2012 09:31, Peter H. Meadows <peter.h.meadows@googlemail.com> wrote:
I was thinking about making a MUD / MOO type game with pharo as the server and scripting language. Any ideas on how this should be done? How would you make sure the user scripts are sandboxed? Would you have an image running the server and a separate image for each user?
i think the easiest solution is to run a separate image. if you want to run in same image, then you have to modify compiler/environment for sandboxed code, where nothing can sneak through and access private data. -- Best regards, Igor Stasenko.
On 12 December 2012 09:47, Igor Stasenko <siguctua@gmail.com> wrote:
On 12 December 2012 09:31, Peter H. Meadows <peter.h.meadows@googlemail.com> wrote:
I was thinking about making a MUD / MOO type game with pharo as the server and scripting language. Any ideas on how this should be done? How would you make sure the user scripts are sandboxed? Would you have an image running the server and a separate image for each user?
i think the easiest solution is to run a separate image. if you want to run in same image, then you have to modify compiler/environment for sandboxed code, where nothing can sneak through and access private data.
And Dave Lewis wrote some stuff recently to easily spawn images: http://forum.world.st/Course-grained-multiprocessing-with-RemoteTask-td40367... frank
-- Best regards, Igor Stasenko.
And this is the biggest reason to use Lua as a scripting language. Marten On 12.12.2012 10:47, Igor Stasenko wrote:
i think the easiest solution is to run a separate image. if you want to run in same image, then you have to modify compiler/environment for sandboxed code, where nothing can sneak through and access private data.
and is still a bad reason :) are you going to use a dynamic language (lua), to script a dynamic language (pharo)? if you launch a lua interpreter to run a script, you are in practice doing exactly the same as launching a new image to run your script. So you are doing exactly the same as Igor suggested, but replacing one dynamic language with another. and of course, you are "buying" the extra problem of: 1) interact with another language and define the input and output and conversions between one and the other. 2) downgrade the power of pharo into a language who is more limitated. IMO, that's non-sense. Esteban On Dec 12, 2012, at 4:35 PM, Marten Feldtmann <marten@schrievkrom.de> wrote:
And this is the biggest reason to use Lua as a scripting language.
Marten
On 12.12.2012 10:47, Igor Stasenko wrote:
i think the easiest solution is to run a separate image. if you want to run in same image, then you have to modify compiler/environment for sandboxed code, where nothing can sneak through and access private data.
<marten.vcf>
On 12.12.2012 17:18, Esteban Lorenzano wrote:
IMO, that's non-sense.
Well, that is a matter of view. I've done this also with Lua and VASmalltalk and I did this not because of other Smalltalkers in mind using my software, but perhaps of potential end users willing to enhance the application in a more known language. Because of this I also tried to use Rexx as an extension language, which is in my view even more suitable to be used as an embedded language - but the market decided to use Lua and not Rexx. Marten
On Dec 12, 2012, at 7:27 PM, Marten Feldtmann <marten@schrievkrom.de> wrote:
On 12.12.2012 17:18, Esteban Lorenzano wrote:
IMO, that's non-sense.
Well, that is a matter of view.
no, it is not. Is a matter of making a technical choice or a marketing one. You know than while a lot before any scripting language were used in gaming the "common sense" and "marketing choice" was not using anyone because "it was too slow"? if we follow what marketing says, you should do your game in C++ (or even better, plain C) and provide hooks to lua/python/whatever... technically, you lose power by choosing lua (or anything) instead pharo in an application made in pharo. people choice depends much more on the success of the game/app than the platform to make it/create extensions. I can say it not because I have the theoretical tools, I say it because I can see my nephew (9 years old) creating plugins for one game he plays, then just jump to another game and make plugins with another complete different language... what has "the marketing" to do with that? he likes his games, and he like extend them... all the other is "collateral".
I've done this also with Lua and VASmalltalk and I did this not because of other Smalltalkers in mind using my software, but perhaps of potential end users willing to enhance the application in a more known language.
potencial users who does not know about programming will feel a lot more comfortable smalltalk than ant algol-based language.
Because of this I also tried to use Rexx as an extension language, which is in my view even more suitable to be used as an embedded language - but the market decided to use Lua and not Rexx.
no idea about REXX... but I repeat: if the game is successful, no one cares the plugin language (and lua is not the unique scripting language for gaming around you know that) Esteban
Marten <marten.vcf>
I was ready to disagree , but you do make a valid point. Also going down the pharo route you dont offer games only a better language but also a development enviroment and that is a double win. I am suprised that pharo is not used heavily for games. And no I dont believe sandbox is the reason. Afterall python is very popular with games too and has no sandbox. ________________________________ From: Esteban Lorenzano <estebanlm@gmail.com> To: Pharo-project@lists.gforge.inria.fr Sent: Thursday, 13 December 2012, 1:45 Subject: Re: [Pharo-project] Fwd: Lua scripting with nativeboost? On Dec 12, 2012, at 7:27 PM, Marten Feldtmann <marten@schrievkrom.de> wrote:
On 12.12.2012 17:18, Esteban Lorenzano wrote:
IMO, that's non-sense.
Well, that is a matter of view.
no, it is not. Is a matter of making a technical choice or a marketing one. You know than while a lot before any scripting language were used in gaming the "common sense" and "marketing choice" was not using anyone because "it was too slow"? if we follow what marketing says, you should do your game in C++ (or even better, plain C) and provide hooks to lua/python/whatever... technically, you lose power by choosing lua (or anything) instead pharo in an application made in pharo. people choice depends much more on the success of the game/app than the platform to make it/create extensions. I can say it not because I have the theoretical tools, I say it because I can see my nephew (9 years old) creating plugins for one game he plays, then just jump to another game and make plugins with another complete different language... what has "the marketing" to do with that? he likes his games, and he like extend them... all the other is "collateral".
I've done this also with Lua and VASmalltalk and I did this not because of other Smalltalkers in mind using my software, but perhaps of potential end users willing to enhance the application in a more known language.
potencial users who does not know about programming will feel a lot more comfortable smalltalk than ant algol-based language.
Because of this I also tried to use Rexx as an extension language, which is in my view even more suitable to be used as an embedded language - but the market decided to use Lua and not Rexx.
no idea about REXX... but I repeat: if the game is successful, no one cares the plugin language (and lua is not the unique scripting language for gaming around you know that) Esteban
Marten <marten.vcf>
On 13 December 2012 09:54, dimitris chloupis <thekilon@yahoo.co.uk> wrote:
I was ready to disagree , but you do make a valid point.
Also going down the pharo route you dont offer games only a better language but also a development enviroment and that is a double win. I am suprised that pharo is not used heavily for games.
And no I dont believe sandbox is the reason. Afterall python is very popular with games too and has no sandbox.
indeed, its all about marketing and having 'killer app', and then you wont notice how eagerly new people will jump into bandwagon. -- Best regards, Igor Stasenko.
Τhe success of Java shows that marketing is all you need to make something popular. Its funny because after web development (html/js/php) , Java is the most hated thing out there. Both are extremely popular :D Even if python has not been embrassed by google and used in behemoth projects like Youtube, I dont think that it would be as remotely as close to being popular as it is today. ________________________________ From: Igor Stasenko <siguctua@gmail.com> To: Pharo-project@lists.gforge.inria.fr; dimitris chloupis <thekilon@yahoo.co.uk> Sent: Thursday, 13 December 2012, 10:58 Subject: Re: [Pharo-project] Fwd: Lua scripting with nativeboost? On 13 December 2012 09:54, dimitris chloupis <thekilon@yahoo.co.uk> wrote:
I was ready to disagree , but you do make a valid point.
Also going down the pharo route you dont offer games only a better language but also a development enviroment and that is a double win. I am suprised that pharo is not used heavily for games.
And no I dont believe sandbox is the reason. Afterall python is very popular with games too and has no sandbox.
indeed, its all about marketing and having 'killer app', and then you wont notice how eagerly new people will jump into bandwagon. -- Best regards, Igor Stasenko.
On 12/13/12 1:58 AM, Igor Stasenko wrote:
On 13 December 2012 09:54, dimitris chloupis <thekilon@yahoo.co.uk> wrote:
I was ready to disagree , but you do make a valid point.
Also going down the pharo route you dont offer games only a better language but also a development enviroment and that is a double win. I am suprised that pharo is not used heavily for games.
And no I dont believe sandbox is the reason. Afterall python is very popular with games too and has no sandbox. indeed, its all about marketing and having 'killer app', and then you wont notice how eagerly new people will jump into bandwagon.
until certain issues with garbage collection are fixed, there will be no playable realtime games on any of the OSS Smalltalks. L -- Squeak from the very start (introduction to Squeak and Pharo Smalltalk for the (almost) complete and compleate beginner). https://www.youtube.com/playlist?list=PL6601A198DF14788D&feature=view_all "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian Kernighan
On 14 December 2012 20:26, Lawson English <lenglish5@cox.net> wrote:
On 12/13/12 1:58 AM, Igor Stasenko wrote:
On 13 December 2012 09:54, dimitris chloupis <thekilon@yahoo.co.uk> wrote:
I was ready to disagree , but you do make a valid point.
Also going down the pharo route you dont offer games only a better language but also a development enviroment and that is a double win. I am suprised that pharo is not used heavily for games.
And no I dont believe sandbox is the reason. Afterall python is very popular with games too and has no sandbox.
indeed, its all about marketing and having 'killer app', and then you wont notice how eagerly new people will jump into bandwagon.
until certain issues with garbage collection are fixed, there will be no playable realtime games on any of the OSS Smalltalks.
Details please! Does the time taken to GC vary too wildly, for example? frank
L
-- Squeak from the very start (introduction to Squeak and Pharo Smalltalk for the (almost) complete and compleate beginner). https://www.youtube.com/playlist?list=PL6601A198DF14788D&feature=view_all
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian Kernighan
Several months ago I made a prototype of a small game in amber. (To play my prototype, download it, run index.html and click Multiplayer>beta fight. The source is here : https://github.com/clementbera/easnoth:. It uses Jquery.getJSON() so it might not work on some web browsers/computers) I asked several smalltalkers why there was no game in Smalltalk. Most of them answered me it was because Smalltalk is too slow to run video game. It may be because of the GC as Lawson English said. If you want to do a game that requires a lot of performance (for example realtime + 3d), you should care. But if you want to do a small game, as the games we can find on smartphone or on website like armor games it is enough. I don't think that running a Lua script through native Boost is a good idea. It will work, but will be slower than pure Smalltalk. But I'm not a pro :) 2012/12/14 Frank Shearar <frank.shearar@gmail.com>
On 14 December 2012 20:26, Lawson English <lenglish5@cox.net> wrote:
On 12/13/12 1:58 AM, Igor Stasenko wrote:
On 13 December 2012 09:54, dimitris chloupis <thekilon@yahoo.co.uk>
wrote:
I was ready to disagree , but you do make a valid point.
Also going down the pharo route you dont offer games only a better language but also a development enviroment and that is a double win. I am
suprised
that pharo is not used heavily for games.
And no I dont believe sandbox is the reason. Afterall python is very popular with games too and has no sandbox.
indeed, its all about marketing and having 'killer app', and then you wont notice how eagerly new people will jump into bandwagon.
until certain issues with garbage collection are fixed, there will be no playable realtime games on any of the OSS Smalltalks.
Details please! Does the time taken to GC vary too wildly, for example?
frank
L
-- Squeak from the very start (introduction to Squeak and Pharo Smalltalk for the (almost) complete and compleate beginner).
https://www.youtube.com/playlist?list=PL6601A198DF14788D&feature=view_all
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian Kernighan
On 14 December 2012 21:26, Lawson English <lenglish5@cox.net> wrote:
On 12/13/12 1:58 AM, Igor Stasenko wrote:
On 13 December 2012 09:54, dimitris chloupis <thekilon@yahoo.co.uk> wrote:
I was ready to disagree , but you do make a valid point.
Also going down the pharo route you dont offer games only a better language but also a development enviroment and that is a double win. I am suprised that pharo is not used heavily for games.
And no I dont believe sandbox is the reason. Afterall python is very popular with games too and has no sandbox.
indeed, its all about marketing and having 'killer app', and then you wont notice how eagerly new people will jump into bandwagon.
until certain issues with garbage collection are fixed, there will be no playable realtime games on any of the OSS Smalltalks.
and why you assuming that "killer game" should be realtime? But even if that.. i do not agree with you. You can always write a heavy numeric crunching stuff in C, but write game logic in smalltalk. Most of AAA games i seen, paying a lot of attention to crunching, and little to logic.. and then people like get bored after 10 minutes of play. Because running twice as fast don't converts into "playing twice as fun".
L
-- Best regards, Igor Stasenko.
Some of these games are fun: http://scratch.mit.edu/ On 15 December 2012 05:43, Igor Stasenko <siguctua@gmail.com> wrote:
On 14 December 2012 21:26, Lawson English <lenglish5@cox.net> wrote:
On 12/13/12 1:58 AM, Igor Stasenko wrote:
On 13 December 2012 09:54, dimitris chloupis <thekilon@yahoo.co.uk> wrote:
I was ready to disagree , but you do make a valid point.
Also going down the pharo route you dont offer games only a better language but also a development enviroment and that is a double win. I am suprised that pharo is not used heavily for games.
And no I dont believe sandbox is the reason. Afterall python is very popular with games too and has no sandbox.
indeed, its all about marketing and having 'killer app', and then you wont notice how eagerly new people will jump into bandwagon.
until certain issues with garbage collection are fixed, there will be no playable realtime games on any of the OSS Smalltalks.
and why you assuming that "killer game" should be realtime? But even if that.. i do not agree with you. You can always write a heavy numeric crunching stuff in C, but write game logic in smalltalk.
Most of AAA games i seen, paying a lot of attention to crunching, and little to logic.. and then people like get bored after 10 minutes of play. Because running twice as fast don't converts into "playing twice as fun".
L
-- Best regards, Igor Stasenko.
participants (9)
-
Clément Bera -
DeNigris Sean -
dimitris chloupis -
Esteban Lorenzano -
Frank Shearar -
Igor Stasenko -
Lawson English -
Marten Feldtmann -
Peter H. Meadows