New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HELP] sol2 Users - Feedback Appreciated!! #189
Comments
Was investigating
Did not use any extensively, however, I was investigating
Syntax is much cleaner than other libraries.
Take the following with a grain of salt, as these are negatives, but I also understand why they exist.
N/A
The documentation has become excellent and you're great at improving it when brought to your attention.
Keep up the activity, it's great to see. What would be helpful is having a means of "asking for help." Github issues don't seem like the place for that and there's a lot of people asking questions. Additionally, there has been a significant amount of "unprofessional" contact within the issues pages and it's off putting for enterprise types to see it. |
While searching around I found this page: http://lua-users.org/wiki/BindingCodeToLua
I used Luabind many years ago. It worked alright at the time.
Header only library, and even single header if you want. This makes it so much easier to integrate with an existing codebase.
I haven't had a ton of time to use it yet, but so far I am pleased with how the code works.
Definitely easier and less verbose.
The docs are a bit messy, but the information is all there and accessible. If I had to suggest something it would be to provide more complex/practical examples. Most of the examples use simple types like integers, floats, strings. Showing how to properly pass/return usertype classes between C++ and Lua would be cool.
Overall I think this is the best Lua binding for C++ right now. I am using it for some server side logic for an online game at the moment (I think games are a pretty common use case for Lua scripting). When I get more time I'd like to read through more of the Sol code to understand how things work under the hood as I think it would be a good way to learn more about C++14 features. |
Keep it up! don't abandon it, even if you're full with work or family! :) |
I googled "C++ lua binding" and sol2 was one of the first few links.
I'm using it in an academic project. The program is a wxWidgets-based tool for natural language processing. Lua is used for plugins, and part of the high-level logic is also written in it.
I did some prototyping using the plain C API, with my own wrappers. Let's just say it wasn't fun...
It's very well written, header-only, there's a nice "getting started" tutorial, and most importantly it is super easy to bind C++ and Lua. Wrapping a class only takes a few minutes. It plays nice with shared_ptr.
Although the tutorial is very nice, I think the documentation itself could be improved. For example,
Far easier. In fact sol2 is the very reason why I decided to stick with Lua as a scripting language.
It's a really great library, keep up the good work! If you do publish a paper about sol2, please put the reference somewhere on the website so that I can cite it... |
I was looking for a good way to bind my C++ APIs to Lua. Then, I googled for C++ bindings and found Sol2.
I am using it for my application based on wxWidgets which can simulate a simple robot in a 2D space, to demonstrate some algorithms on common jobs -such as maze solving, pathfinding, etc. I use Lua and Sol2 to pass algorithms to be tested, and draw using wxWidgets.
I was using Selene before Sol2. I abandoned it after experiencing very simple bugs, and learning about its speed.
I used both the C API and Selene. Of course, Sol2 is much easier to use than C API and it has same easiness level as Selene. (But I must confess that the plain C API is more fun but dangerous.)
They are both definitely helpful. But as I stated before, they can be improved.
It's just a great library. Thank you. |
Was just looking through GitHub for a better library than I had that didn't choke on Union-heavy user types
A small VR game, just want to test some code easier than just doing some recompiling
Selene
It's amazing and not stale so far, very responsive dev.
Nothing at all
It's pretty much the same in the difficulty department
Yes, it's very nice
I will do it if the need arises. Thank you. :) |
I don't exactly remember. I think I was looking for an alternative to luabind, as it was causing several issues for me, when I came across sol2.
I'm using sol2 for making data classes and functionality of a game engine available to lua land for a few mods I'm working on, in order to allow users to more easily modify the game via lua.
I was using luabind (some custom fork, not the latest official one).
I like that it's pretty straight forward, that it supports the vast amount of features my project requires, and that it's actively developed. Even things that were not supported were very quickly introduced by you.
I will have to agree with @Nava2 here. Compile times can be very long and generated code can also be very large. I understand that this is a trade-off of using template metaprogramming, which generates mostly static code in order to avoid performing operations during runtime, but especially for me, where I have projects with over 3000 generated bindings, it gets pretty insane (10GB+ RAM usage to link, about an hour to compile on 12 threads, 150MB+ output binary (with some optimizations on)). I believe there are some things that are inherently too complex for no reason in sol2's codebase, and can be possibly improved upon by simplifying them. Secondly, the codebase itself is rather hard to follow for someone that hasn't been actively involved in the project's development from the beginning. During my attempt to implement member inheritance for #157 I was often lost trying to figure out what something does, and the lack of internal documentation in most places doesn't help either. This is more of a minor complaint, but I think that it could be an important step towards getting more people to actively contribute to this project.
I would say it's pretty similar to how luabind worked. Some things are definitely easier, while some things were slightly confusing when transitioning. Thankfully, the documentation (and yourself) were very helpful when it came to that.
The documentation has improved by orders of magnitude in the past few months. I believe it is now more accessible and more straight forward for people without immediate knowledge of lua or other binding libraries.
After my recent shenanigans with #157 I came across a possibly interesting observation, especially after looking at the benchmarks you posted. I think you should evaluate sol2 performance when accessing bound usertypes with a huge number of members that are dynamically indexed (ie. using |
I found sol2 recommended in an issue report from jeremyong/Selene project.
Plain C API
Best documentation I've seen probably ever- Nearly everything has an example, what doesn't shows up as an issue here. Sometimes those issues turn out to be missing/broken functionality, but the pace at which they are fixed is worth a
C++14- Figuring out how to add this to the ioquake3 build system (a massive hand crafted Makefile) and continuing to cross compile all the binaries via Travis is tough
It is easier to use than the Plain C API.
Yes, thanks!
Great Job! |
Recomendation from a friend.
Most recent use, I wanted to integrate bump.lua into my C++ game. It's not going to be definitive, so I wanted to do something quick.
Mostly C API directly, sometimes some self-made C++ wrappers, and something else made by my aforementioned friend.
Treating lua objects as they were C++ objects. Also, header only!
N/A, didn't use too much.
Easier.
Yes, but somehow I walked in circles for a long before being able to write this: auto file = file_manager()->OpenFile("bump.lua");
L.require_script("bump", file->GetContents());
L.script("world = bump.newWorld(8)");
collision_body_ = L.create_table_with("name", "Player");
L["world"]["add"](L["world"], collision_body_, position_.x, position_.y, width_, height_); Not really sure why...
|
Google + some people on twitter (especially Jason Turner :D) recommended it to me.
I'm using it for my game called Re:creation
LuaBridge
Almost everything. Its interface, capabilities, speed. It has everything I need from the Lua/C++ binding.
It's much easier! Binding classes/functions, iterating over tables, creating new tables, handling state, etc. - everything is much easier and neater.
Yes, they're pretty great, though maybe some of them should be less abstract. And there are some common things people may need to do being left from documentation (e.g. returning table from script and getting it in C++). But I understand that there's work being done in that direction and I'll be happy to help with this once I have more free time on my hands.
Nah! Just keep doing great job @ThePhD, your Lua/C++ binding is the best one in most categories and I hope it gets more users, recognition and praise. |
I googled for methods how to combine C++ and Lua, found that plain C Lua was not compelling and searched for Lua wrappers and decided to take a look at Selene. However for some reason working with it didn't feel comfortable so i looked further and discoverered Sol (Sol1), which was great. After looking for updates i found out that you already released Sol2.
My team recently started working on a Ragnarok Online remake/singleplayer spinoff with the UE4 engine and i'll be using Sol2/LuaJit for moddable features like monster databases, item databases, npc scripts, quest scripts, etc. I will also use it for any other future gaming project or even non-gaming project i'll do where scripting and modding would be useful. Sol2 made C++/Lua interaction really fun for me!
Selene, Sol1
I absolutely love
Currently my biggest problem is that it's not inherently compatible with Unreal 4 because UE4 only uses C++11 and has macro conflicts with Sol2 (as mentioned in one of my issue tickets) but i can't really blame Sol2 for that. Other than that, maybe the usage of protected_function is a bit verbose, because you need to first assign a lua function to it, then an error handler needs to be defined, then you have to call it to get an auto object back, then you have to check if it's valid or not and then finally you can use it. Currently it works like this:
which could be shortened to this: Heck, this could be taken even further by giving sol::state a option for a default error_handler lua function and then every protected function with only one parameter would use the default-ed error_handler:
But other than that nitpicky stuff i'm very, very happy with Sol2. ^___^
I used Selene before Sol2 and for me, absolutely and definitely yes, Sol2 is much more comfortable and easier to use!
Absolutely! In the beginning it was a bit sparse but now it's really useful. I haven't read through all of it yet, though, but for the things i needed so far it's sufficient.
I like the dedication that is put in this library and the continuous development. |
Coworker at Wolfire Games told me about Sol2 when I was picking a scripting engine for my personal project.
Doing a ground-up C++ rebuild of the game engine for https://github.com/kavika13/jumpmanzero - using Lua as the scripting language.
None of them.
I'm a big fan of the transparent smart pointer support. I was skeptical, and expecting missed cases, but so far it's worked out well! There is a lot that looks really promising (and already plenty useful). The syntax and API seem good. The continual attention to performance benchmarking and semantic differences between LUA/C++. The consideration for breaking/non-breaking changes. The direct, suitably brief, not "RTFM", and non-defensive communication on issues is really great. This is a great example of how to talk to your user base I love the very human tagging on issues :) The quick and dirty tutorial and graduating detail pages on C++ support is probably the thing that sold me hardest. Seeing a demo of a usertype front-and-center was the most important thing to me - I was expecting to have to read through those docs more fully before knowing whether I liked that interface or not.
I don't dislike anything, really, but I will describe some of my challenges so far. The C++ STL container support isn't well documented yet, or if it is, I haven't found it. I've only found closed issues on the topic, and it looks like it is somewhat in flux. I'm trying to draft up an issue to discuss this further, though it's hard to tell the current state of the project and future plans on this topics. I want to see a roadmap of things you think will need more work going forward. Even if there aren't any explicit milestones on that roadmap, this would still show where you are most interested in feedback, and where people are going to start hitting the fringes of the library. This probably isn't something you can do much about (I think it might be Lua's problem?), but I am not liking the error messages I'm seeing when doing bone-headed noobish things like accidentally typing From the docs (without having a solid grasp on Lua's user type support), I can't tell how far down the chain of user types I have to define things, and what happens down the line if I don't explicitly declare some types I expose as members. I also can't tell what happens if I choose to define only a few members of a user type, and then pass an instance back and forth between Lua and C++. Does it slice? Does Lua just expose an interface to the underlying C++ memory so I don't need to worry about it? What about cases where I return a struct instance (not a pointer to heap), don't explicilty define that user type, and pass that instance to C++ functions/methods/assignment to members? A clearer and more open support forum might be a good thing. Irc? Slack? ;)
More on the choice of Lua + Sol2 than on Sol2 itself - I haven't embedded Lua before. I used Lua in World of Warcraft a while back, and knew how it worked since I read most of the language spec back then. Lua looks like it is still the de-facto "standard" for game scripting, it's tiny, and generally pleasant enough to work in. Squirrel and Angel Script were the other options I considered, and both look interesting. For my first game script embedding project, I wanted to use something that I would spend as little time as possible banging my head on. Application layer boundaries have been the source of ~90% of my google searches in the past 10 years, so I wanted to make sure I was going to find answers. Sol2 still seems to be quite the work in progress (in the best way). It looks like you're paying plenty of attention to it, and it looks like it is already capable of doing what I need it to do. |
http://lua-users.org/wiki/BindingCodeToLua
I little android/pc game engine I am working on. I'm driving UI, game state, and entity logic with lua. Had very little troubles getting consistent behaviour on both (and you fixed every one I had quickly).
luacppinterface and luawrapper if I recall correctly, but only enough to know they didn't cover all my use cases.
The support, the extensive features, how well complex things like overloading, properties and special functions are simplified.
How it doesn't exist in a vacuum and I might one day have to use lua api without it.
Probably the same for the features from the others that I remember and actually used. I'll put it this way: I haven't so far seen a feature in sol2 that I think could be easier to use.
Helpful enough.
It's pretty awesome. I guess one thing that makes me slightly uneasy is how complex the library is, and that one day I might have to fix a bug in it myself. I don't think it would be impossible but I haven't seen any docs for how the library itself works (I haven't really looked though, as it hasn't been necessary, and that should indicate how slight my unease is). |
Googling around for a C++ Lua binding lib
Adding Lua bindings for a TI calculator emulator, so that (hopefully) both the emu core and GUI can be scripted :)
None (in other things, I've used the plain Lua C API though)
Very easy to use, and the performance is quite awesome
Well that's probably at least partially my fault for not learning all the new tricks in the book, but I've had a bit of a hard time sometimes understanding the fancy C++14 things going on in the code :)
N/A
Yep, definitely (especially the examples)
Keep up the good work, it really is a great lib! |
-How did you find out / hear about sol2? |
|
@shultays The most I can do for you is give you sol2's benchmarks compared to other libraries (available in the benchmarks section of the docs). After that, any performance analysis is something you'll have to insert around your code and the like... |
@ThePhD anyway, great work! thanks for sol2. |
I decided to move from s7 Scheme + my own C++ reflection layer to LuaJIT+l2l + my own reflection layer. I first researched C++ wrappers for Lua before rolling my own, and I discovered sol (mostly by googling), which allows me to avoid writing a large part of the reflection layer (I still use my code to inspect C++ headers and generate the usertype mapping calls).
Wrapping the core C++ classes in a videogame to make them available to Lua code.
None, this is my first Lua project.
Super natural and easy to use, it just feels right.
std::[unordered_]set had no way to perform a lookup from the Lua side (other than iterating), and I saw in #196 it wasn't desired to have table-like access for lookups, so I added a :find to the container metatable. I've submitted a pull request. I also have some very particular legacy requirements in the source I'm porting so I had to hack the metatables sol generates for my C++ classes (basically my old scripting system allowed any C++ instance to be extended on the fly with new scripting-side properties, so my __newindex and __index must lookup a Lua-side table for each instance for possible new fields, then pass control to the sol code). This is not a dislike, more like a resignation on my part, that I will have to follow closely the evolving internals of sol if I want upgrades.
They are!
I'm probably obsessing too much about performance (I'm still porting, so not doing perf work for now), but I've seen class methods and attributes are indexed by string, like map<string, ...>. I was dreaming on having a Lua-side table for this, to take advantage of the string interning, then instead of passing a string to C++, pass an integer ordinal, for a constant lookup into a vector. I may hack on this in the future if I'm not buried under a landslide of work. Thank you for sol, it's top notch work! |
How did you find out / hear about sol2? If you wouldn't mind, it would be great if you can add me on discord. |
How did you find out / hear about sol2? What're you using it for? What Lua library did you use before you found sol2? What do you like about sol2? What do you dislike about sol2? Is it easier or harder from the last Lua library you used? (If you did use a library or the plain C API before this) Is the documentation or examples helpful? Anything else about the library you feel like adding or pointing out? |
How did you find out / hear about sol2? What Lua library did you use before you found sol2?
What do you like about sol2?
What do you dislike about sol2?
Is it easier or harder from the last Lua library you used? (If you did use a library or the plain C API before this)
Is the documentation or examples helpful?
Anything else about the library you feel like adding or pointing out?
and when do I use which?
That being said: |
@mrgreywater I've had the same "issue" about the |
@mrgreywater Thanks for your interest in sol2. I'll try my best to answer your question, and also redirect to new issues I'll open up in case our framework doesn't cover something.
|
How did you find out / hear about sol2? You had mentioned it on the lua-l list. I found your presentation on the LuaWorkshop and "just had to have it". What're you using it for? The lua C API really turns me off. I started using Lua to make my life in C easier, not harder. Having to manage a stack is the opposite of what I wanted. I have been really depressed about that for a while now. What Lua library did you use before you found sol2? I've tried some of the .Net lua wrappers. Very leaky and not great. I could see building a .Net package off of sol2 as being a far better option. What do you like about sol2? Still new. I got it to compile into my qt sample app in 26 minutes! (And I promise you my C++ skills are not going to impress anyone). I've been trying to learn "pure lua" and was very hesitant to walk away from that (even though I don't like the C API). You're presentation is the first thing to convince me there is a better way. What do you dislike about sol2? TBD Is it easier or harder from the last Lua library you used? (If you did use a library or the plain C API before this) I'm avoiding the C API like the plague. I keep piking up PIL and putting it back down... lol Is the documentation or examples helpful? TBD. The 2016 workshop presentation was excellent. Anything else about the library you feel like adding or pointing out? Thank you thank you thank you thank you thank you thank you thank you thank you! |
|
Hi, |
@RussellHaley https://gitter.im/chat-sol2/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge It's no mailing list and it's actually not the BEST of all the electron-based chat apps, but... it gets the job done! I do apologize for quickly closing issues: I don't quite use them as good as other people do, or for their intended purpose. I'm sorry if it feels like I'm cutting things short: but I'm more than happy to keep replying in closed issues if things don't quite pan out fully. |
And you have gone to great lengths accommodating me in closed issues, for which I am grateful. Gitter will be fine for my purposes. See you soon. |
I think the first place I heard of it was from http://lua-users.org/wiki/BindingCodeToLua
The Morrowind Script Extender will be using it (on top of LuaJIT) for its expanded scripting language in its next version. I am binding reverse engineered structures and exposing native functions to get away from the hell that is Morrowind's normal scripting VM.
I've not used any other Lua library before sol2, other briefly testing a few others. Professionally I've used Lua while working at Corona Labs.
Everything is dead simple. Manipulating the stack is fun the first time, but I'd rather just get up and go.
Having to learn the "sol2" way to do things can be annoying, but the docs have helped. So far the only issue I've had is binding (non-std) arrays. That isn't always viable, because I don't get to control the underlying structures viably.
N/A
They are, but they aren't always complete. For example, I couldn't find documentation for
I'm sure I'll find something eventually, and will use the chat room/issues here to bring it up. |
Googled for the terms "lua", "shared_ptr".
Evaluating for use in Leadwerks Game Engine 5
tolua++
Support for shared pointers, very flexible and lets me tune the API to deliver the Lua user experience I want, have not yet found something I could not do with it. Speed is also a big benefit. The ease with which you can expose a new function or class is awesome.
No support for default arguments, necessity to hand-write entire binding code, and shared_ptr support is a bit wonky in places. However, this can be alleviated with a custom header parser once I figure out how everything works.
Harder than tolua++ but the increased flexibility is worth it.
Yes, but a lot of it is over my head.
Not done evaluating it but do far it looks like the best Lua binding library I have ever used. |
I am not currently using sol2 but looking for a good lua binder for an existing game engine / system daemon
running lua scripts to interact with C++ code instead of writing pure C++ plugins
In a previous project, a completely home made solution. Something which I definitely don't want to reproduce in the new project.
Seems straight forward, powerful and does not require a lot of code to do something. Everything I need.
The very high compiler requirements of sol2. When I started to monitor this project, it requires C++11 and it was already a negative point to me. Now I am unable to compile tests on most of platform I am using and I see that sol3 will require even newer compiler. I consider compile time performance as the least significant problem, especially if it's at the expense of other concerns like portability. |
How did you find out / hear about sol2? What're you using it for? What Lua library did you use before you found sol2? What do you like about sol2? Seems pretty easy to use, very little boiler plate, good documentation, reassuringly prompt and professional developer behind it who seems passionate about the library, single header and fast! What do you dislike about sol2? There are still certain things about it that are a bit mystical or over my head, but I've only been using it a week now. Like someone else mentioned, a forum or something would be good for users to help each other. I see that you responded to a similar comment earlier, about a gitter, but still, I wouldn't have known about it without having read that comment. Whenever I'm googling to try and work out sol related stuff, it's usually the docs or github that come up in the search, I haven't seen any community results pop up. And I didn't notice it advertised anywhere on the docs, though that could be my own lack of attention. Is it easier or harder from the last Lua library you used? (If you did use a library or the plain C API before this) very much easier. See my comment above about lack of boiler plate and such. It mostly just feels like Im accessing a lot of really flexible std::map data that's partially heterogeneous. Is the documentation or examples helpful? Yes, the docs are helpful. They're miles ahead of a lot of documentation out there. Some of it is a little unclear though. Like, at the moment, I'm trying to figure out how to return a tuple to lua to access in lua, but the docs about returning data to lua only show it being accessed inside of c++. I might try and find this gitter and ask about it on there. Anything else about the library you feel like adding or pointing out? Colour me subjective, but it's just damn sexy ;) It feels native and like it's oriented with the user in mind. Its also always nice to have an idea of who's behind a library, and I very much enjoyed the videos on youtube of your talks etc. |
Is the documentation or examples helpful? Anything else about the library you feel like adding or pointing out? |
Saw your talk on cppcon :-)
Game engine, code-parsing and automatic lua binding
LuaBridge, SWIG
Simplicity and speed
Sometimes it is a little bit annoying to write the boilerplate code, but i know that without reflection there is not that much you can do :(
Much better
For Sure!
While meta-classes or reflection is on the way - I'd like to suggest implementing some binding generator. It shall be relatively easy to use libclang + python to wrap the least complex libraries. |
@kdudnyk You can use RTTR, then iterate all reflections and bind to sol ;) |
@TheAifam5 have you done this (RTTR -> Sol)? I'm curious about seeing a sample of something like that. Sorry if it's a bother! |
@playmer kinda.... writing something else for now. Can’t find a good IDE |
@TheAifam5 I've already create a very limited script, so you can find an example at https://github.com/kdudnyk/LuaSol3Generator/tree/master/example/Box2D @ThePhD sorry for spamming here - i am just curious whatever you have any plans to automate boiler plate generation ? If yes - i would be glad to help |
@kdudnyk I have no plans on writing external binding generators. In most cases people already have a generator in mind (e.g., UnrealHeaderTool) and have custom logic (e.g., this these things should be properties, these things shouldn't be, and so on so forth...). If I write one, I have to support everyone's use case. If you write one... well, you only have to support you, your syntax, your coding guidelines / styles, and what you want. In short: reward / effort ratio is waaaaaaaaay less than even 0.1 here. With C++ reflection I'll only have to write this once, and everyone else can go nuts. |
Googled for LUA / C++ integration
Scripting in user role management system (some sort of hybrid RBAC/ABAC)
Plain LUA C API
It uses modern C++ features so you need just a few lines of code to solve complex problems.
RAM usage while compiling is immense. I have 32GB installed and have to compile with
Yes! Both are very good.
On this page it says: Is there any ETA on when the transition will happen? This could possibly help a lot with the compile time and RAM usage isses. |
Google search for C++14 Lua wrapper
Make a flexible microservice with C++ framework backend
None
It's great integration with new C++ features (lambda, ...)
None
N/A
Great documentation & examples
Can't use last version as it needs C++17 |
I did a specific search for lua c++ wrappers and happened upon it. (A few years earlier I had done a similar search but failed to find sol2 at that time)
We originally started using sol2 for the scripting side of our menu system. I had wanted a scripting language that could easily bind c++ classes, but the language we were using before finding sol2 wound up being far too slow and was causing slowdowns after just 30+ menu items. Since then, we're also using sol2 as a game object scripting system. Lua's coroutine support allows for scripting things in a task-like manner -- self:WalkToThing() self:PickupThing() can be turned into a coroutine that iterates one step every frame. (C++'s coroutine implementation unfortunately falls short). We'd previously been using lua for just this purpose, but it was plain lua and I begrudged the lack of support for binding c++ classes.
We used vanilla Lua.
As previously mentioned, the ability to directly bind c++ classes and functions is much appreciated. It's also nice that we can send over various object types to lua functions without having to cast -- it requires a little bit of work and c++ templating to get working properly, but is nice once flowing correctly.
Right now sol2 takes a hefty chunk of time to compile object bindings. We're mapping most of our classes to sol2, so there is admittedly a lot of them, but it still feels like it takes a comparitively long amount of time considering the comparitively few bindings (18 usertypes with a total of ~100 bindings = 20-30 second compile time).
Certainly far easier than vanilla lua. I'd say it's also easier to use than the scripting language we used before sol2, which was a language specifically built for c++ bindings, haha.
It is fairly helpful, though I do find myself running into numerous cases not explicitly mentioned in the documentation.
I've had difficulty with calling unnamed/sol::function functions with state_views. I'm not sure if this is possible or I'm just doing it wrong, but the documentation doesn't have this use case. |
@RealmRPGer If you can elaborate on the "unnamed/ |
How did you find out / hear about sol2? |
From a friend while looking for Lua libraries in the Internet.
Storing logic and configuration for C++ home made games and some applications.
Manual Lua stack manipulation and it was painful as hell.
It automates all my interop with Lua. Very easy to use!
Build times and especially linking times are painful. Tried with MSVC and MinGW. LTO in mingw helped a bit, but it's buggy in the newer versions.
So much easier.
Yes! Most examples cover what I need.
My two main issues are:
Thanks to YOU for making this for us :)))))))
|
I've been using sol for a few months now and feel more comfortable being able to answer the questions requested now.
Was recommended by a friend and had seen it used in some other projects before.
I create injected hooks/mods for various games that expand the game client beyond it's normal capabilities in various forms. From API layers that expose game information to modders, to allowing full-on rendering modifications/additions.
Luabind; more specifically the deboostified version because I hate Boost.
I like sol's API and layout. It's fairly easy to jump into and recreate what I've done already in my past projects. I'm currently working on a full rewrite of a project that is moving from Luabind to sol and so far, it's been fairly straight forward/easy to port from one binding to another.
These are probably less of an impact to others and more specific to me but:
At first harder, Luabind has pretty solid straight-forward documentation and since it was a fairly popular library before sol existed, it's got a lot of examples floating around as well. I used the plain C API for a while before that as well, which is ideal for the best performance, but the tradeoff for the ease of binding and such is worth it.
Yes. While sol does have a lot of docs and examples, it feels a bit scattered and unorganized for some topics. Some topics also feel heavily under-documented such as coroutines and dealing with sol's namings for certain things related to Lua threads. But for the most part it's not too bad to find what you're looking for. There's some more recent changes to the code that aren't documented for yet though which can be a tad annoying when looking for information about things such as the configuration changes that were done recently. A lot of the
Just would like to see the compile times and file sizes get some optimization in the future. I understand the reason for them though with sol heavily using std::tuple and such. It's just a bit sad to see how many bloated calls are added to the output to deal with all the argument expansions and such. A large usertype can lead to calls with 60+ arguments, then additional sub-calls for each of those arguments to prepare the stack/etc. This leads to a single usertype generating well over 200 function calls to register itself in the disassembly. A more up to date documentation regarding best-practices for various aspects of the library would be nice to see as well. As I mentioned above, the API is open-ended allowing multiple ways to accomplish the same task. Some more in depth information on which is the best for say speed, file size, etc. would help. Some more specific types such as I have loved the time I've spent with sol so far, and want to again thank you for what you've done and still do for the Lua community. Libraries like this are such a huge asset to making the use of Lua suck less and help speed up development and testing. After the time I've spent with sol testing it out, I'm definitely sold on sticking with it over Luabind so far. :) |
I've been using sol3 for around a month now to make adding Lua scripting to my game engine so much simpler. It takes all of a few minutes to expose even a really convoluted class to Lua.
I heard about it specifically from the benchmarks comparison that you did.
Adding Lua scripting to a game engine
I experimented a tiny bit with LuaBridge, but it was a little too finnicky plus it felt a little too inflexible. Before that I was using the C api, which I'm probably never going to do again because it's far too easy to mess up and there are way too many things to keep track of (well, mostly the stack state, but that's a big one).
Very easy to expose classes to Lua
The documentation sometimes can be a little unclear, it took me a while to realize that if I'm creating a userdata in C++ and passing that to Lua, I should use
Much easier.
They're very helpful, though a few more examples would be nice, plus maybe dividing up the examples so that different use cases are more clearly differentiated.
The heavy use of templating can cause extremely long compile times even for minor changes in a file, though I don't know if there's a solution other than just "divide up your file by concern into smaller, more manageable ones". |
Just googling
Scipting in a cryphtographic app written in cpp
none
super easy integration and use, i really just throw some url links into my custom dependencies manager(just wrappers for some cmake's cool stuff), import some header, and start using it
doesn't have enough xp to dislike anything yet
very
In general very useful and awesome work, thanks and congrats |
For a hobby video game I'm writing from scratch, I decided to use lua as the config data representation language because it basically has introspection and json is also just a bunch of tables anyway, lua is easy to run and modify, much easier than dealing with xml or json in c++. Now you can have function as fields and just run them without any hassle.
I like that it basically makes lua object-oriented, of course you could always emulate this behavior but by accessing it through an OOP language like c++ it makes it so much easier
If I had more than 0 things to list here, I would probably not be using it for everything lua-related like I am now
So much easier than the C-API, the fact it wraps most C++ types is also really nice
The examples are, but I do wish there was inline documentation for all user-facing code. A lot of IDEs have a nice feature where it parses the comment above the function and formats it like a proper documentation, so you can quickly check what a function does or what a parameter means by just hovering over the function name. Going into the sol code in the header usually doesn't answer my question, so I will have to check on the internet, which isn't a huge deal but worth pointing out I think |
Hello, users of sol2! This issue was made so that I could get a better idea of what you all use for Lua and how much you like / dislike sol2 compared to what you used to use (if anything) and sol2 now. If anyone could just reply to this issue with their thoughts, perhaps answer some of the questions below (or go on a tangent, really anything), I'd appreciate it. I'm going to be writing a paper about sol2 and the Lua landscape, so I'd like to get to know what my users use sol2 for:
Thanks for much for reading and considering, and double thanks if you do reply!
If you don't have a github, nag me on twitter with @thephantomderp or just shoot me an e-mail or something.👍
The text was updated successfully, but these errors were encountered: