Sonar helps you commit clean C++ code every time. With over 550 unique rules to find C++ bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work. Learn more →
Sol2 Alternatives
Similar projects and alternatives to sol2
-
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. (by LuaDist)
-
-
InfluxDB
Build time-series-based applications quickly and at scale.. InfluxDB is the Time Series Platform where developers build real-time applications for analytics, IoT and cloud-native services. Easy to start, it is available in the cloud or on-premises.
-
SWIG
SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages.
-
-
Wren
The Wren Programming Language. Wren is a small, fast, class-based concurrent scripting language.
-
-
-
Sonar
Write Clean C++ Code. Always.. Sonar helps you commit clean C++ code every time. With over 550 unique rules to find C++ bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work.
-
nbind
:sparkles: Magical headers that make your C++ library accessible from JavaScript :rocket:
-
-
-
-
-
-
zig
General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
-
-
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.
-
-
-
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
sol2 reviews and mentions
-
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!
-
Sayonara, C++, and Hello to Rust
I mean, if you could tell from my original post, I like C++ templates. The point is not to constantly write templates in your calling code, the point is to architect a library with templates that affords flexibility and dynamism so that the calling code is easy to write, read, and reason about. Consider, for example, the sol2[0] example usage code vs the actual source code itself[1].
-
Design Issues for Foreign Function Interfaces (2004)
Very interesting article!
Unfortunately, it doesn't mention Lua, which in my opinion has one of the most elegant C APIs that I have seen. It is entirely stack based, which means you only need to work with primitive types, such as numbers, C strings and user provided opaque pointers. As a consequence, you never have to care about memory management because Lua doesn't even let you access the actual Lua objects.
You want to create a table (= Lua's dictionary/array hybrid) and set a field "foo" to 5? lua_newtable() creates a new table and pushes it onto the stack. Then you push "foo" with lua_pushstring() and 5 with lua_pushnumber(). Finally you call lua_settable(), which pops the key and value from the stack, checks if the top of the stack contains a table, and if yes, sets the given field to the given value. The actual table structure is never exposed!
This kind of stack manipulation might seem unusual and a bit unweildy, but what you get is safety. If you mess up the stack or perform illegal operations, Lua will call an error handler, but the VM should never crash. The stack API can be seen as the fundamental layer upon which people can create nice abstractions for their host language of choice. Examples are "sol2" for C++ (https://github.com/ThePhD/sol2) or "lupa" for Python (https://github.com/scoder/lupa)
The public API is contained in "lua.h": https://github.com/lua/lua/blob/master/lua.h. "lauxlib.h" offers some useful helper functions: https://github.com/lua/lua/blob/master/lauxlib.h
For comparison, this is Python's "Limited" C API: https://docs.python.org/3/c-api/stable.html#stable
If you want to learn more about Lua's C API, have a look at section 4 in https://www.lua.org/manual/5.4/manual.html
-
A note from our sponsor - Sonar
www.sonarsource.com | 8 Feb 2023
Stats
ThePhD/sol2 is an open source project licensed under MIT License which is an OSI approved license.