|
|
| A Scripting Language. |
|
Marcello
Member #1,860
January 2002
|
Didja try the makefile spellcaster pasted earlier? Here's my slightly modified version. Marcello |
|
curtis warren
Member #3,898
September 2003
|
Yep. I get this error: C:\spidermonkey>make -f makefile.txt makefile.txt:42: *** missing separator. Stop. Which is this line: # Pattern rules COMPILE=gcc -c -g -ggdb -Wall -Werror -w -o "$(OUTDIR)/$(*F).o" $(CFG_INC) "$<" -DXP_PC -DWIN32 -DEXPORT_JS_API -D_declspec=__declspec ... $(OUTDIR)/%.o : spidermonkey/%.c $(COMPILE) # <----- this one
|
|
Marcello
Member #1,860
January 2002
|
That's cause you need to convert the spaces to tabs. Try my version. Marcello |
|
curtis warren
Member #3,898
September 2003
|
Yeah, your version worked. One question, though. Do you happen to know the command to make a shared library in gcc? Thanks, btw. |
|
Karadoc ~~
Member #2,749
September 2002
|
Just while we have so many people all fired up talking about scripting languages, I have a small question: Is there an easy way to remove functionality from embedded Lua, or from Python or JavaScript for that matter? ----------- |
|
Korval
Member #1,538
September 2001
|
Quote: I mean, if I use some scripting language, and I don't want the user to have the ability to erase files using a script in my program, then is there an easy way for me to just say "look. I want you as the scripting language, but you can't bring the following functions with you: fopen(), system(), ..." or whatever. In Lua, you just don't give the script that ability. The way it works, you have an object called the "lua_state". This object, conceptially, represents an instance of the interpreter. To give a script the ability to call a particular function, you register it with Lua. Now, Lua comes with a library of standard functions, one of which is for IO. If you don't register the IO library, and you don't expose user-defined functions to allow the script to write to a file, then it can't have IO. If you want to have some scripts that can do this and others that can't, then you have several "lua_state" objects. For some "lua_state" objects, you allow IO, for others, you don't. |
|
Thomas Fjellstrom
Member #476
June 2000
|
Quote: In Lua, you just don't give the script that ability. Yes, we all know how much you love lua, time to stop ranting. -- |
|
Marcello
Member #1,860
January 2002
|
javascript doesn't have fopen/system/etc. Plus it has a security interface thingy: from the very very bottom of http://www.mozilla.org/js/spidermonkey/apidoc/jsguide.html said: With JavaScript 1.3, the JS engine added security-enhanced API functions for compiling and evaluating scripts and functions passed to the engine. The JS security model is based on the Java principals security model. This model provides a common security interface, but the actual security implementation is up to you. One common way that security is used in a JavaScript-enabled application is to compare script origins and perhaps limit script interactions. For example, you might compare the codebase of two or more scripts in an application and only allow scripts from the same codebase to modify properties of scripts that share codebases. http://www.mozilla.org/js/spidermonkey/apidoc/jsguide.html Although it doesn't seem uber-simple, I'm not sure how powerful you need that stuff in a game. That security manager is so you can have like core scripts in the game which can't be screwed up by scripts users load in. Marcello |
|
Zaphos
Member #1,468
August 2001
|
Python also has a system to run 'untrusted' scripts without being a security threat. By default, however, python lets a script do anything, so it would be a good idea to remember to implement that if you want to implement a user addon system. TF: Actually, his comment was a relevant and good answer to the question, I thought. He probably only mentioned LUA because that's what he knows about. -- |
|
Mark Robson
Member #2,150
April 2002
|
Bear in mind the NJS Javascript interpreter (google for it) It's probably not as complete as the Mozilla one, but a lot smaller, simpler, and can be extended by adding new classes quite easily. There is a class which enables File I/O, but I'm sure it can be removed at compiletime (or possibly runtime, by just setting its constructor to null) Mark |
|
Thomas Fjellstrom
Member #476
June 2000
|
Quote: TF: Actually, his comment was a relevant and good answer to the question, I thought. He probably only mentioned LUA because that's what he knows about. What I read of that post, he's already said at least once in this thread. -- |
|
Marcello
Member #1,860
January 2002
|
Does njs javascrit interpreter have a compiler? Marcello |
|
Korval
Member #1,538
September 2001
|
Quote: Yes, we all know how much you love lua, time to stop ranting. I appologize for answering his question. Quote: What I read of that post, he's already said at least once in this thread. Where? I may have mentioned that it was possible using Lua, but I certainly didn't mention the specific mechanics involved in actually accomplishing the task. And the specific mechanics involved are important to know when one is evaluating a language for use, based on a set of critera. |
|
Karadoc ~~
Member #2,749
September 2002
|
Come on guys, stop the bickering. Sure it might be entertaining for you guys, but for the rest of us it's just spam. "Hey, how's it going?" heh. As for the scripting stuff, thanks for the reply. If I feel like using one of those things, I think I'll go with PYTHON! It seems that it is just as good a language as the others, and perhaps a more useful language outside of scripting. I'd rather learn a useful language than a language just for the few games with scripts that I make. Well. Back to lurking for me. ----------- |
|
Marcello
Member #1,860
January 2002
|
Heh, I use javascript more frequently than any other scripting language. Mainly because I can use java and C++ for serious stuff. But between web and flash, javascript is used quite a bit. I guess now that I have this possibility I should go back to paper and start designing the interface. Marcello |
|
|
|