Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Embedded scripting languages

Name: Anonymous 2014-11-06 8:40

What scripting language would you embed to a program? The performance would not be main issue, since the compiled part of the program would worry about that.

The scripting language would call many functions written in C, C++, or whatever lang that can compile C-like functions (so there needs to be some kind of easy to use FFI).

I thought about options here:
- Lua
- Scheme (tinyscheme or whatever)
- Something else?

Now, what would /prog/ use, and why? ("Read SICP" is not a valid answer here)

Name: Anonymous 2014-11-06 9:51

Make your own based on sexpressions or use a pre-made scheme implementation.
Or just... use C.

Name: Huskellfaggot 2014-11-06 11:37

I'm currently using haskell as my scripting language. It /can/ call C++, but its a bit of a pain. You have to write the bindings yourself, most of the time.

Name: Anonymous 2014-11-06 19:08

You should first ask yourself if you really need an embedded scripting language. If you don't need to expose scripting functionality to end users, then you'll probably be better served by keeping everything in C or C++ and at most using a higher level language for compile-time data generation. And think hard about that, because a lot of the reasons people give for including scripting support (like data entry) can be trivially solved without a complete programming language.

Name: Anonymous 2014-11-06 19:12

>>4
and I should add that in my experience, the complexity of marshaling data between the main application and the scripting language, scheduling garbage collection, and whatnot usually outweighs the concision gained by writing part of the program in a higher level language, so it's really not going to be a win unless you write most of the program in the scripting language, or you truly need scripting to extend i.e. your editor.

Name: Anonymous 2014-11-06 19:13

Lua is utter fucking shit, don't use it under any circumstances.

Name: Anonymous 2014-11-06 19:18

Javascript via v8.

Name: Anonymous 2014-11-06 22:49

>>7
kill yourself

Name: Anonymous 2014-11-07 0:13

>>6
What's wrong with Lua? Serious question, I'm not really familiar with it.

Name: Anonymous 2014-11-07 0:23

Talking about "embedding"...

http://www.youtube.com/watch?v=5GJGDw1mEjc

Name: Anonymous 2014-11-07 0:24

Name: Anonymous 2014-11-07 1:03

>>11
You're a fucking retard.
1. That presentation is from 4 years ago, and it's about a fucking Xbox 360, hardware from almost a decade ago
2. It's profiling Lua, not Luajit, which is able to eliminate most of those indirections for constant key lookups nowadays.
3. If you really need the performance, luajit's FFI lets you use C structs with the expected semantics and performance.
4. Lua's syntax is fine.

The only real problems I have with luajit are that arrays start from 1, that the standard library is practically nonexistent, and that it's not a lisp.

Name: Anonymous 2014-11-07 1:06

4. Lua's syntax is fine.
Hah!

Name: Anonymous 2014-11-07 1:24

>>13
It's just Algol with keywords instead of brackets. If you're a lisper that's cool, but you really have nothing to complain about if you prefer Python or whatever.

Name: Anonymous 2014-11-07 1:29

>>1-15
Read SICP.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List