サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
Wikipedia
puddleofcode.com
After that, we need to configure our MRuby build. We need to modify build_config.rb. At the end of the file, let’s add our build specification. MRuby::Build.new('mrubyvst') do |conf| toolchain :gcc conf.gembox 'default' conf.gem :core => 'mruby-eval' conf.gem :github => 'iij/mruby-dir' conf.gem :github => 'iij/mruby-io' end In this case, we specify that we will use a gcc toolchain. Also, we will i
require 'rubygems' require 'erlectricity' receive do |f| f.when([:sum_two_integers, Integer, Integer]) do |a, b| f.send!([:result, [:ok, a+b]]) f.receive_loop end end As you can see, Ruby DSL is more like the Elixir. We’re creating a receive loop, match incoming messages, and if matched, send a message back. I this example, we’re waiting for the message like this {:sum_two_integers, 1, 2} and send
This article describes another way, how Elixir and Ruby can talk to each other. We will use Erlix this time. This method makes Ruby process act like the Erlang node, which is connected to Erlang VM over the network. We will make some kind of chat between Ruby and Elixir. There will be two separate parts. Elixir and Ruby project. Elixir ProjectWe need to create new Elixir project. defmodule ChatEx.
Elixir, Ruby, don’t fight. Talk… with Export/Erlport There are still a lot of things in Ruby world, that don’t exist in Elixir yet. To resolve that problem. I’ve done a research. Tried to figure it out if both worlds can talk to each other. And the answer is yes. They can. I’ll try to describe few ways how to do it. I decided to split things up, each article describes one method, the first one is
このページを最初にブックマークしてみませんか?
『puddleofcode.com』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く