sol2
pybind11
Our great sponsors
sol2 | pybind11 | |
---|---|---|
20 | 42 | |
3,927 | 14,708 | |
- | 1.5% | |
3.9 | 8.7 | |
27 days ago | 3 days ago | |
C++ | C++ | |
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
sol2
-
Any tips for how to make moddable games?
As someone said, make the game data-driven is a good first step but I will say, also have some sort of way to add additional game logic. For C++ games, lua is really easy to embed the interpreter in your C++ binary, read in the files from a directory (like /mods) with the C++ filesystem api new in C++17, and it's very easy to use SoL to write an API for lua specific to your game. Many games use lua in this way and it's probably the most common mod path setup.
-
Script Interoperability
I've only ever done this from C++, but it's using the same lua C library, so should be durable from C as well. You can look up how sol2 or any other wrapper libraries do it.
-
CBN Changelog: December 3, 2022. Improved LUA support in progress!
This version relies on a Lua C++ wrapper called sol2 to hide Lua stack management from the developer, so creating new bindings can be done by adding a few lines of human-readable C++. It still has to be done manually, but at least sol2 is able to automatically figure out types of objects being bound, so it's not much different from our de-/serialization code.
- RTS programming game where you write real C++ code to control your player.
-
Tools for rolling your own engine
Here is link number 2 - Previous text "Sol"
Sol for fast lua embedding
-
jluna: a new Julia <-> C++ Wrapper
It is half of a pun as I was inspired by [sol3](https://github.com/ThePhD/sol2) which is a lua <-> c++ wrapper. Sol means sun and the julia c-api prefixes all it's functions with jl, luna means moon so it is pronounced "jay luna"
So far, it has been cumbersome to embed it into C-language projects, because it's C-interface is hard to use and poorly documented. Because of this, many choose to just use python or lua instead.
-
A new C++ <-> Julia Wrapper: jluna
If you want to be portable I'd recommend C++ and Lua, I used those for years and it runs on everything and there's this most amazing wrapper API which was a huge inspiration
-
Why the C Language Will Never Stop You from Making Mistakes
Off topic, but this is the author of my favourite Lua C++ binding library (https://github.com/ThePhD/sol2). Great guy!
pybind11
-
Experience using crow as web server
I'm investigating using C++ to build a REST server, and would love to know of people's experiences with Crow-- or whether they would recommend something else as a "medium-level" abstraction C++ web server. As background, I started off experimenting with Python/FastAPI, which is great, but there is too much friction to translate from pybind11-exported C++ objects to the format that FastAPI expects, and, of course, there are inherent performance limitations using Python, which could impact scaling up if the project were to be successful.
- Swig – Connect C/C++ programs with high-level programming languages
-
I created smooth_lines python module, great for drawing software
This is based on the Google Ink Stroke Modeler C++ library, and using pybind11 to make it available on python.
-
Using pybind11 with minGW to cross compile pyhton module for Windows
I have a python module for which the logic is written in C++ and I use pybind11 to expose the objects and functions to Python.
-
IPC communication between rust, c++, and python
Reading from Python requires a wrapper, using pybind11 this is fairly done.
-
Is Pycharm an okay IDE to use?
That said, if you need to write a Python module in a compiled language, it's much easier and more fun these days to write in C++. pybind11 is extremely mature and even fun system to write Python objects in C++.
-
Roast my resume
There will be specific technologies you used in your data pipelining: Parquet? Did you use Pandas to manipulate your data? Did you optimise some aspects with C++? If so did you use PyBind11 to integrate it?
-
Pybind11 error | Compatibility and/or Linker issue | Mac M1 (But running X86_64 using Rosetta 2)
git clone https://github.com/pybind/pybind11.git
-
How to make C++ communicate with Python?
I would say that pybind11 is precisely what you want here. If you don’t want to write the bindings yourself, you could try Tolc.
Pybind11 https://github.com/pybind/pybind11 is an easy way to expose c++ functions in python.
What are some alternatives?
PyO3 - Rust bindings for the Python interpreter
nanobind - nanobind: tiny and efficient C++/Python bindings
Optional Argument in C++ - Named Optional Arguments in C++17
Lua - Lua is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description.
setuptools-rust - Setuptools plugin for Rust support
PEGTL - Parsing Expression Grammar Template Library
ChaiScript - Embedded Scripting Language Designed for C++
SWIG - SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages.
sparsehash - C++ associative containers
py2many - Transpiler of Python to many other languages
dynamic_bitset - Simple Useful Libraries: C++17/20 header-only dynamic bitset
wasmtime - A fast and secure runtime for WebAssembly