This project is created to demonstrate how to create shared libraries in different languages and use them from Ruby and Python
$ bundle exec rake > /dev/null 2>&1
$ pipenv run bundle exec ./rubie.rb
Hello from Rust!
Hello from Crystal!
Hello from Go!
Hello from C!
Hello from C++!
Hello from C#!
Hello from Julia!
Hello from Zig!
Hello from D!
Hello from Swift!
Hello from Haskell!
Hello from LLVM!
Hello from Nim!
Hello from RubyLLVM!
Hello from Ruby!
Hello from Python!
Bye from Ruby!
Bye from Python!
Bye from Crystal!
Bye from Julia!
$ pipenv run ./pythonie.py
Hello from Rust!
Hello from Crystal!
Hello from Go!
Hello from C!
Hello from C++!
Hello from C#!
Hello from Julia!
Hello from Zig!
Hello from D!
Hello from Swift!
Hello from Haskell!
Hello from LLVM!
Hello from Nim!
Hello from Python!
Bye from Python!
Bye from Crystal!
Bye from Julia!
You can use poetry
instead of pipenv
.
You can use pipenv run inv
or poetry run inv
or poetry run poe build
instead of bundle exec rake
. All these commands use tasks.py
for Invoke - and Poe the Poet, configured in the [tool.poe.tasks]
section of the pyproject.toml
for the last one - instead of Rake and Rakefile
.
cmake version 3.22.1
$ sudo apt install cmake=3.22.1-1ubuntu1.22.04.2
$ mise use [email protected]
$ sudo apt install dub='1.27.0-2' ldc='1:1.28.0-1ubuntu1'
or
$ brew install dub ldc # versions dub 1.38.1 and ldc 1.39.0
$ linuxbrew install llvm@15
or
$ brew install llvm@15
$ mise use [email protected]
$ gem install bundler -v 2.4.2 && bundle install
$ mise use [email protected]
$ mise use [email protected] # was 9.2.8, had to upgrade
$ mise use [email protected] # was 1.8.5
$ mise use [email protected]
# use pipenv or poetry
$ mise use [email protected] && pipenv install --dev
# or
$ mise use [email protected] && poetry install
$ mise use [email protected]
$ linuxbrew install swift # 5.10
$ mise use [email protected]
$ mise use [email protected]
- Check
NO_COLOR
everywhere (only Crystal, Swift, RubyLLVM and Ruby implementations do that) - Check
tty?
everywhere (only Swift implementation does that) - Check for truecolor support and fallback to ansi/ascii
- Fix Crystal - impl exit_crystal to make
at_exit
work, get rid of init - Python atexit from pycall (use Py_Finalize)