1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/examples/call_v_from_ruby
Everton J. Carpes 357ac0bb5a
examples: show how to call a simple v module from ruby (#19073) (#19073)
This is a copy/adaptation of the python example (#13105)
2023-08-07 07:07:00 +03:00
..
README.md examples: show how to call a simple v module from ruby (#19073) (#19073) 2023-08-07 07:07:00 +03:00
test.rb examples: show how to call a simple v module from ruby (#19073) (#19073) 2023-08-07 07:07:00 +03:00
test.v examples: show how to call a simple v module from ruby (#19073) (#19073) 2023-08-07 07:07:00 +03:00

A simple example to show how to call a function written in v from ruby

Step 1: Compile the v code to a shared library using v -d no_backtrace -shared test.v

Step 2: Run the ruby file using ruby test.rb

Note: you do not need -d no_backtrace if you use gcc or clang .