[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

What is the best scripting language for embedding in an existing

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 15
Thread images: 1

File: Lua-logo-nolabel.svg.png (128KB, 2000x2000px) Image search: [Google]
Lua-logo-nolabel.svg.png
128KB, 2000x2000px
What is the best scripting language for embedding in an existing C/C++ project?

Lua seems like it's the obvious choice - it's easy to embed and used damn near everywhere. The nice thing about Lua is that it's easy to embed, it's not a moving target, and you're not expected to be on the latest and greatest release anyway due to each release being somewhat backwards incompatible.

The only problem is - the language seems a little...spartan. Given the amount of code I want to turn into script, I was thinking about going with a more fully-featured and widely-used language like Python 3 or Javascript. Trouble is, both of those languages seen like a gigantic pain in the neck to embed in an existing language. JS especially - V8 and Spidermonkey look like a pain to get working, and the lightweight implementations like Duktape are stuck on ES5, and I want classes.
>>
>>58989060

>I want classes
So something like this?
http://www.squirrel-lang.org/
>>
>>58989174
There are plenty of class libraries available for lua. Don't rec dialects, the language is fragment enoigh as is.
>>
>>58989060

It goes like this, anon:
most idiomatic C++ integration -> ChaiScript
dynamic typing but static classes -> Wren
static typing, modern lang -> Lily
static typing, C++ specific -> AngelScript
>It's too spartan/slow
just skip right to JVM/Mono then

>b-but I want Smalltalk like objects
better neck yourself, in that case

>>58990390
Squirrel isn't a dialect.
>>
>>58990561
Wait, I almost forgot there is the Dart VM that can also be embedded and is reasonable fast.
>>
>>58990390

OP asked for a different language, I offered a different language.
>>
>>58990742
Shouldn't you of all people suggest mruby anyway?
>>
>>58990561
Squirrel is a dialect.
>>
>>58990959
>has table data structures
>among zillion other things, unlike Lua
>everything else is completely different
>it's a dialect
sure thing, kiddo
>>
>>58989060

You do not need classes for scripting. If you're scripting, you're dealing with raw data and logic. Functional programming essentially.

There's a reason why it's the most widely used. Lua is powerful because it enforces simplicity while allowing flexibility when necessary.

Do not mix your scripts with your engine. You're going to cause a mess.
>>
Chaiscript is the obvious first choice for C++, otherwise guile scheme (or any other embeddable scheme) is a solid choice as well
>>
Hi folks, OP here.

1. I wasn't joking with C/C++. There is an existing codebase that's idiomatic C, and although I can just compile it as C++, I don't think I'm going to be converting the entire thing to idiomatic C++1x anytime soon, so being able to work with C-isms, or even with just plain C is a must.
2. There is a lot of interesting languages here, but I would prefer languages that at least are maybe one step up from obscure. I don't want to hitch my wagon to a language that has a bunch of hidden problems that are only revealed because I'm the second or third person to ever use it in anger, and the developer is nowhere to be found because he coded it in a weekend and has other priorities these days.
3. I'm pretty sure Squirrel is, if not a Lua fork, heavily inspired by it, judging by how it shares a similar stack-based API. There is a lot to like about Squirrel, but the developer of Squirrel's recent GitHub activity is not encouraging at all - the project seems to be something he has very little time for.
>>
>>58993975
>2. There is a lot of interesting languages here, but I would prefer languages that at least are maybe one step up from obscure. I don't want to hitch my wagon to a language that has a bunch of hidden problems that are only revealed because I'm the second or third person to ever use it in anger, and the developer is nowhere to be found because he coded it in a weekend and has other priorities these days.
If your concern is about the languages themselves, they are all better thought through and implemented than Python, hands down. Rich numbers of libraries is a different story, in which case you are limited to a JVM or Mono.

>3. I'm pretty sure Squirrel is, if not a Lua fork, heavily inspired by it, judging by how it shares a similar stack-based API.
Well, it's really just the tables. The stack-based API isn't so much a specialty of Lua, it's more lazyness on their part.
>There is a lot to like about Squirrel, but the developer of Squirrel's recent GitHub activity is not encouraging at all - the project seems to be something he has very little time for.
He also isn't very communicative and his forum is littered with spam since years. I wouldn't recommend it either.
That being said, a couple of games like Left4Dead and Portal 2 worked well with Squirrel.
>>
>>58993975
>1. I wasn't joking with C/C++. There is an existing codebase that's idiomatic C, and although I can just compile it as C++, I don't think I'm going to be converting the entire thing to idiomatic C++1x anytime soon, so being able to work with C-isms, or even with just plain C is a must.
So that only rules out ChaiScript, since it was designed for C++. Literally everything else goes.
>>
>>58989060
Awk & ksh scripting you don't need more.
Thread posts: 15
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.