Skip to content

uvlad7/ffie

Repository files navigation

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!
teminal output

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.

Installation

C, C++

cmake version 3.22.1

$ sudo apt install cmake=3.22.1-1ubuntu1.22.04.2

Crystal

D

$ 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

Ruby, LLVM

$ linuxbrew install llvm@15

or

$ brew install llvm@15
$ mise use [email protected]
$ gem install bundler -v 2.4.2 && bundle install

Go

Haskell

$ mise use [email protected] # was 9.2.8, had to upgrade

Julia

$ mise use [email protected] # was 1.8.5

Python

$ mise use [email protected]
# use pipenv or poetry
$ mise use [email protected] && pipenv install --dev
# or
$ mise use [email protected] && poetry install

Rust

Swift

$ linuxbrew install swift # 5.10

Zig

Nim

$ mise use [email protected]

Todo:

  • 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)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published