问答交流

C++,Java,Python,Go,Rust,哪种语言更适合高频量化交易领域?

由ftkj2018创建,最终由ftkj2018 被浏览 63 用户

问题

于我而言,我更倾向于Rust,因为Rust很适合用在量化的交易或生产阶段,因为Rust可以很好地降低交易代码中潜在的Bug,也容易进行生产调试。

  1. 与C++相比,Rust的性能相差无几,但是在安全性方面更优,特别是使用第三方库时,Rust的严格要求会让第三方库的质量明显提高。
  2. 与Java相比,除了部分纯粹的数字计算性能,Rust性能全面领先于Java,同时Rust占用内存更小,因此如果想实现同等规模的服务,Rust所需的硬件成本显然更低。
  3. 与Python相比,性能方面Rust完胜,同时Rust对运行环境要求较低,从这两点上就基本可以做出选择了,因为Python和Rust的彼此适用面其实并不冲突。
  4. 与Go相比,Rust语言表达能力更强,性能更高,同时线程安全方面Rust也更强,不容易写出错误的代码,包管理Rust也更好,Go虽然在1.10版本后提供了包管理,但目前还比不上Rust的。

对于Rust在高频量化交易领域的应用,也许大家的看法各有不同,在未来既是机遇也是挑战。对此,你怎么看?

解答

对于高频交易来说,python/GO/Java是不够用的,目前市场上主流的仍然是C++,Rust作为后起之秀,确实有许多特有的特点,但Rust的崛起甚至代替C++在高频量化中的地位可能还是需要天时地利人和等条件的。借用国外网友的一句话,Rust的安全性在高频交易里面其实也是一把双刃剑:It really depends on the amount of speed that you need for your trading strategy. The safety precautions built into Rust are both a blessing and a curse. While the safety increases your production stability and also developer productivity, those same mechanisms also limit your maximum possible speed. There’s the quote by Dave Herman regarding Rust vs C++ performance, “competing with C++ when you’re safe is fighting with one arm tied behind your back.

标签

PythonRust量化交易
评论
  • rust好像要被选入做linux内核语言了
  • 事实是人们先选用库多的,造轮子的太少了
  • 对于高频交易来说,python/GO/Java是不够用的,目前市场上主流的仍然是C++,Rust作为后起之秀,确实有许多特有的特点,但Rust的崛起甚至代替C++在高频量化中的地位可能还是需要天时地利人和等条件的。借用国外网友的一句话,Rust的安全性在高频交易里面其实也是一把双刃剑:It really depends on the amount of speed that you need for your trading strategy. The safety precautions built into Rust are both a blessing and a curse. While the safety increases your production stability and also developer productivity, those same mechanisms also limit your maximum possible speed. There’s the quote by Dave Herman regarding Rust vs C++ performance, “competing with C++ when you’re safe is fighting with one arm tied behind your back.
  • 十八般武器 各有优势 量化领域也是如此
{link}