Go concurrency in Ruby

huangapple go评论77阅读模式
英文:

Go concurrency in Ruby

问题

我希望在我的Ruby on Rails项目中使用Go语言的线程和并发特性。我有几个选择,其中之一是jRuby。但是,我不喜欢Java(个人偏好)。我听说Go语言是Java的完美替代品。它甚至比Java更快、更安全。我看到有人将其速度与C++相比,因为它的一部分甚至是用汇编语言编写的。人们甚至可以用Go从头开始编写一个完整的Web服务器,就像Apache一样。

我真正计划的是:将所有底层的东西用Go来实现,其余部分使用Ruby on Rails。我仍然希望能够享受RoR提供的开发便利性。

英文:

I wish to use threads and concurrency features of Go language in my Ruby on Rails project. I have several alternatives, one of them is jRuby. But, I don't like Java (personal preference). I have heard that Go Lang is a perfect replacement for Java. Its even more faster & secure than Java. I saw people comparing its speed to C++ as some of its part is in Assembly itself. People can even write a complete web server like Apache from scratch in Go.

What I am really planning for is: All the low level stuff in Go and rest of it Ruby on Rails. I still want to have the ease of development that RoR has to offer.

答案1

得分: 4

从Go 1.5开始,有一种名为c-shared的构建模式,它允许你在Go中构建C共享库。然后可以使用FFI将这些库加载到Ruby中,并在Rails应用程序中使用。请参阅这个简短的概念介绍

英文:

Starting in Go 1.5, there is a build mode called c-shared, which allows you to build C shared libraries in Go. These can then be loaded into Ruby using FFI and used in your Rails app. See this brief introduction to the concept.

huangapple
  • 本文由 发表于 2016年1月29日 12:37:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/35076977.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定