Scala的伸缩性是否优于其他JVM语言? [英] Does Scala scale better than other JVM languages?

查看:85
本文介绍了Scala的伸缩性是否优于其他JVM语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我目前唯一询问的方法.可以理解,Scala使用Java虚拟机.我以为朱鲁比也这么做. Twitter将其中间件切换为Scala. 他们能做同样的事情并使用Jruby吗?

Here is the only way I know to ask it at the moment. As Understand it Scala uses the Java Virtual Machine. I thought Jruby did also. Twitter switched its middleware to Scala. Could they have done the same thing and used Jruby?

他们是否可以从Jruby入手,而不会遇到导致他们首先从Ruby迁移到Scala的扩展问题?我不明白Jruby是什么吗?我假设这是因为Jruby可以使用Java,所以它将在Ruby无法扩展的地方进行扩展.

Could they have started with Jruby to start with and not had their scaling problems that caused them to move from Ruby to Scala in the first place? Do I not understand what Jruby is? I'm assuming that because Jruby can use Java it would have scaled where Ruby would not.

在这种情况下,是否全部归结为静态类型还是动态类型?

Does it all boil down to the static versus dynamic types, in this case?

推荐答案

Scala是可扩展的",因为可以通过使库看起来像扩展这样的方式来改进语言它们是语言的一部分.这就是为什么演员看起来像是语言的一部分,还是为什么BigInt看起来像是语言的一部分的原因.

Scala is "scalable" in the sense that the language can be improved upon by libraries in a way that makes the extensions look like they are part of the language. That's why actors looks like part of the language, or why BigInt looks like part of the language.

这也适用于大多数其他JVM语言.它不适用于Java,因为它对基本类型(Int,Boolean等),运算符,笨拙的语法(这些语言清楚地说明了语言中的内在内容和库是什么)都有特殊的对待.

This also applies to most other JVM languages. It does not apply to Java, because it has special treatment for it's basic types (Int, Boolean, etc), for operators, cumbersome syntax that makes clear what is built in the language and what is library, etc.

现在,Scala在JVM上比动态语言 更具性能,因为JVM不支持它们. JVM上的动态语言必须依靠反射,这很慢.

Now, Scala is more performatic than dynamic languages on the JVM because the JVM has no support for them. Dynamic languages on JVM have to resort t reflection, which is very slow.

这篇关于Scala的伸缩性是否优于其他JVM语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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