Ruby在Erlang [英] Ruby in Erlang

查看:115
本文介绍了Ruby在Erlang的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以将Ruby嵌入Erlang吗? Yecc会成为正确的工具吗?如果可能需要多少个工作小时,粗略估计?

Is it possible to embed Ruby into Erlang? Would Yecc be the correct tool for that? If it is possible how many man hours would it take, rough estimate?

推荐答案

Jose Valim有一个叫Elixir的URL url <一个href =http://elixir-lang.org/ =nofollow> http://elixir-lang.org/ 这可以让你编写像ruby一样的代码,并在erlang VM上运行

There is something called Elixir by Jose Valim url http://elixir-lang.org/ this lets you write code that is ruby like and run it on erlang VM.

所以在许多地方,代码看起来类似于:

So code looks similar in many places like:

iex> name = "world"
iex> "hello #{name}"
"hello world"

在许多更多的Erlang' y:

in many is more Erlang'y:

# function
iex> x = fn(a, b) -> a + b end
#Fun<erl_eval.12.111823515>
iex> x.(1, 2)
3

和modules =):

and modules =) :

iex> defmodule Math do
...>   def sum(a, b) do
...>     a + b
...>   end
...> end    
iex> Math.sum(1, 2)
3

这可以帮助您。我知道Jose最近在他停下来重点关注Rails之后再次开始大规模的工作。他可能会得到Riak的整合和某种Web框架。这可能很有趣!

It that helps you in any way. I know Jose recently started again massive work on it after he stopped to focus so much on Rails. Probably he will get Riak integration and some sort of a web framework. That could be interesting!

这篇关于Ruby在Erlang的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆