Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Different projects have different needs. My current game project requires complex game code. I don't want to write complex code in Lua, but I also don't want to kill my productivity with raw C++. Therefore, I prototype and experiment with a scripting language that fits my needs.

In my case, it is Wren. Some people prefer Chai, AngelScript, Lua, mruby, etc.



Very interesting, can you outline your thought process on why you did not want to write complex code in lua? It's very stable and fast, and has many language constructs etc? It would be completely understandable if your answer is just "this other thing looked cool and I wanted to try it", which is everyone's own choice, but I am wondering if there were any technical reasons for that decision?


I can't talk about the others, so I'll compare Wren and Lua. I dislike Lua's approach to objects, feels clunky and prototype-ish. I also dislike the local/global stuff.

Wren has exception-like error handling and concurrency. And the object model is very similar to C#.


I used to develop a game engine that used an embedded version of Visual Studio to allow C/C++ scripting which compiled into dlls and were hot loaded with any change. And if I recall correctly, that is exactly how the feature film compositor Shake worked: their shader language and entire node graph system is C macros and templates to disguise the fact that it's really C++, and one's compositor projects are really disguised visual studio projects.



Yep. I write my engine in D, which is nicer than c++ for prototyping, but regardless I embed a scheme for scripting.


could you tell me more about the D/scheme integration - specifically what scheme you used, and what you had to do to integrate it with D? i spent a couple of days trying to integrate chibi with D, but gave up because it made too much use of preprocessor macros.


I shopped around quite a bit and eventually decided that s7 scheme[1] would be the best for me. It's been fairly painless to integrate so far, I've just copy-pasted the function prototypes I've needed, as I've needed them. No macros. Engine is closed-source atm so I can't show code, but it's a pretty straight translation from the c examples.

1: https://ccrma.stanford.edu/software/snd/snd/s7.html


thanks, that looks great!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: