Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - lefticus

Pages: [1]
1
General / Scripting module for SFML
« on: August 14, 2009, 08:05:06 pm »
Quote from: "VelcroMan"
I must say tha ChaiScript seems like it would be very easy to implement, and i do like the syntax. And as i have the Boost library avilable, it's no problem for me. I dont know if i even need to write a custom scripting module for sfml, as ChaiScript basically has what i planned to write. :)


Let me know if you have any questions or need any help, things are pretty quiet still with the project.

-Jason

2
General / Scripting module for SFML
« on: August 12, 2009, 07:36:42 pm »
Hi, I'm one of the co-developers of ChaiScript so I thought I would answer some of the questions coming up here.

Yes, the syntax is C and javascript-like. Semicolons are optional. I personally do tend to use them when I'm programming, out of habit.

There is a page in the documentation about the standard library: http://www.chaiscript.com/node/3.

The standard library is intentionally kept very simple. ChaiScript is meant quite simply as a tool for scripting C++ applications. As such, we made the ability to add new features extraordinarily simple and kept the built-ins low. I have not used LuaBind, but from what I know it comes the closest to ChaiScript, but still does not quite hit the same mark.

Example, if you want to add the C standard library functions fabs and abs to the ChaiScript runtime, and give them the same name, allowing the runtime to choose the appropriate function to call:

Code: [Select]

ChaiScript chai;
chai.add(fun(&abs), "abs");
chai.add(fun(&fabs), "abs");

chai.call("print(abs(-5.2))");


(The above represents an almost complete C++ application using ChaiScript, all that is missing is main and the include).

Regarding "no external dependencies": ChaiScript is a header only library. Yes, it does rely on parts of boost, but only the header-only pieces of it. There are no runtime dependencies. So, yes, the building process does require that you have the boost headers available, it actually does not require you to build or install any part of the boost libraries.

None of the other examples that are mentioned can make that claim, they all at least require the language libraries itself (libpython.so, liblua.so, etc).

The language was really designed around my personal usage requirements. I wanted something that provided the same functionality that Lua does, for embedding, but I wanted it designed for C++ (as opposed to C, as Lua is) and I wanted to avoid the overhead of something like SWIG, which I have used in many projects myself already.

I'm glad that there seems to be some interest in the language, anyhow, so thanks _seb_ for mentioning it in the first place. Let me know if anyone has any questions I can help with.

Pages: [1]
anything