英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论