什么是最好的用例使用Scala新的发展? [英] What are the best use cases for using Scala for new development?

查看:133
本文介绍了什么是最好的用例使用Scala新的发展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为什么要选择在斯卡拉另一种语言的一个新的项目?在哪些领域它在Excel中?

注意

有分别获得了一些不错的答案,可惜我只能标记一个作为接受的答案。不过,总体而言,它看起来像Scala的吸引力来自于两个主要方面:


  1. 并发出色的支持

  2. 吸引顶尖人才工程


解决方案

首先阅读:免费的午餐结束

并发正变得日益重要。我们早就被证明了1000年核处理器,什么电脑如今已不配备能够高度并行运算的GPU?

为了把未来机器的优势,你的软件必须能够充分利用所有这些并发性和Java目前的线程原语只是不打算在这里帮助。让我们面对现实吧,在目前的主流范式并发编程是疯了硬。

Scala是一种功能性的语言。因此,它完全包含了概念,如不变性,对于-COM prehensions,关闭等,还拥有4个原生提供男主角库(最新统计)。所有这一切都非常适合下一代并行编程的。你不能在沙和pretend埋葬你的头,没有这样的存在 - 的这将会像1995年编写一个程序,只存储2位数字的年份的 - 势在必行循环简单AREN' ŧ削减它了!

Scala的2.9,由于被释放2011年初,将支持并行操作如:

 列表(1,2,3,4).PAR图{2 * _} //一个线程列表中的每个输入值!

在最严重的是,斯卡拉可以做Java那样,通常以更清洁的语法一切。它也远不止Java面向对象(与原语和静态方法),这往往是在面向对象和函数式编程是错误的信念忽视的一个事实是互斥的。

在什么领域不擅长斯卡拉?我想这方面必须是未来......

Why should I choose Scala over another language for a new project? In what areas does it excel in?

Note

There were a few nice answers given, sadly I could only mark one as the accepted answer. However, overall it looks like Scala's appeal comes from two primary things:

  1. Excellent support for concurrency
  2. Attracting top engineering talent

解决方案

First read this: The free lunch is Over

Concurrency is becoming ever-more important. Already we have 1000 core processors being demonstrated, and what computer nowadays doesn't already come with a GPU capable of highly-parallel operations?

In order to take advantage of future machines, your software has to be able to make use of all this concurrency, and Java's current threading primitives just aren't going to help here. Let's face it, concurrent programming under current mainstream paradigms is crazy-hard.

Scala is a functional language. As such it fully embraces concepts such as immutability, for-comprehensions, closures, etc. It also has 4 native actor libraries available (at last count). All of this is perfectly suited to the next generation of concurrent programming. You can't bury your head in the sand and pretend that none of this exists - that would be like writing a program in 1995 that only stores 2-digit years - imperative loops simply aren't going to cut it any more!

Scala 2.9, due to be released early 2011, will support parallel operations such as:

List(1,2,3,4).par map { 2 * _ }  //one thread for each input value in the list!

On top of all that, Scala can do everything that Java does, typically with a much cleaner syntax. It's also far more object-oriented than Java (with its primitives and static methods), a fact which is often overlooked in the false belief that object orientation and functional programming are mutually exclusive.

In what area does Scala excel? I guess that area would have to be "the future"...

这篇关于什么是最好的用例使用Scala新的发展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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