Description
Call c++ functions from a shell with any arguments of any types parsed automatically
Declare a variable or define a function and register it in shpp with a simple command. Your function will be available to be called by a shell that parses the arguments automatically to the types of the arguments of your function.
shpp alternatives and similar libraries
Based on the "Scripting" category.
Alternatively, view shpp alternatives based on common mentions on social networks and blogs.
-
ChakraCore
ChakraCore is an open source Javascript engine with a C API. [Moved to: https://github.com/chakra-core/ChakraCore] -
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. -
Duktape
Duktape - embeddable Javascript engine with a focus on portability and compact footprint -
djinni
A tool for generating cross-language type declarations and interface bindings. [Apache2] -
sol2
Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation: -
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. -
nbind
:sparkles: Magical headers that make your C++ library accessible from JavaScript :rocket: -
Boost.Python
A C++ library which enables seamless interoperability between C++ and the Python programming language. [Boost]
Collect and Analyze Billions of Data Points in Real Time
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of shpp or a related project?
Popular Comparisons
README
shpp
Call c++ functions from a shell with any arguments of any types parsed automatically
Declare a variable or define a function and register it in shpp with a simple command. Your function will be available to be called by a shell that parses the arguments automatically to the types of the arguments of your function.
Usage
git clone --recursive https://github.com/GrossoMoreira/shpp
cd shpp
make
bin/example
Features
- list available functions, including their return type and parameter types
- call functions with any number of arguments of any primitive types or stl-like non-associative containers
- read and write variables (const/read-only variables supported)
- when a function is called, output its return value (of any supported type)
- interactive and non interactive mode
- auto-complete
- command history
- reverse search
- sourcing commands from files
Interface
#include "shpp/shpp.h"
shpp::service svc; // create a service
svc.provide_command("function_name", function_ptr);
svc.provide_value("variable_name", variable_ref);
shpp::shell sh(svc); // create a shell for this service
sh.start(); // start shell
Interactive shell
Supported types
- primitive types
- stl-like non-associative containers (std::vector, std::list...) that implement the push_back() method, parsed/serialized as JSON objects
- containers of containers
Sample std::vector<std::list<int>> :
[[0,2,4],[1,3,5],[]]
..can be used as a function parameter or return type.
Dependencies
- GNU readline
Todo
- support arguments of user-defined types
- support asynchronous execution of commands
- call functions remotely