avatar
anyone using Scala ?# Java - 爪哇娇娃
c*n
1
twitter 用,
不知道真是有什么好处还是fad
avatar
m*t
2

I looked at it a while ago but haven't used
on any real project. Neat language features
but, from I read, when they are heavily used
the performance becomes an issue.

【在 c******n 的大作中提到】
: twitter 用,
: 不知道真是有什么好处还是fad

avatar
k*r
3
twitter's been saying that it's great and performant.
I'm very not used to the syntax of the language. It looks
so odd - I'm coming from Python and Java

【在 m******t 的大作中提到】
:
: I looked at it a while ago but haven't used
: on any real project. Neat language features
: but, from I read, when they are heavily used
: the performance becomes an issue.

avatar
m*t
4

If you come from python, you should be comfortable with
list comprehension which I believe scala has for one of the
core concepts.
I still don't know about it being performant. To my taste,
scala puts too much emphasis on recurse, which can be
fairly expensive if not done right. Also functional
programming being neat and cool and all, it comes with
a performance penalty.

【在 k***r 的大作中提到】
: twitter's been saying that it's great and performant.
: I'm very not used to the syntax of the language. It looks
: so odd - I'm coming from Python and Java

avatar
k*r
5
I think the reason people think it's performant is that
its data types are closer to that of Java's. Not much
heavy translation is needed, as in Jython or JRuby's case.
It's also strongly and statically typed. This helps a lot.
Have you looked at Lift, the web framework? The simplicity
in Lift makes me want to check out Scala.

【在 m******t 的大作中提到】
:
: If you come from python, you should be comfortable with
: list comprehension which I believe scala has for one of the
: core concepts.
: I still don't know about it being performant. To my taste,
: scala puts too much emphasis on recurse, which can be
: fairly expensive if not done right. Also functional
: programming being neat and cool and all, it comes with
: a performance penalty.

avatar
b*y
6
seems scala could be run both interpreted or compiled, right?
avatar
b*y
7

Yes, I am a believer the more complication a language is, the less efficient
it will be.
But that being said, seems like scala is a good language that is worth to
checkout.
Maybe we should make this board a forum both for java and for close
languages such as scala ;-)

【在 m******t 的大作中提到】
:
: If you come from python, you should be comfortable with
: list comprehension which I believe scala has for one of the
: core concepts.
: I still don't know about it being performant. To my taste,
: scala puts too much emphasis on recurse, which can be
: fairly expensive if not done right. Also functional
: programming being neat and cool and all, it comes with
: a performance penalty.

avatar
k*r
8
It's compiled. The way it "interprets" it is to compile
it in memory, which is neat.

【在 b******y 的大作中提到】
: seems scala could be run both interpreted or compiled, right?
avatar
N*D
9
未必"the more complication, the less efficient"吧。这个是syntax复杂在front e
nd,compile之后还是byte code在JVM上执行。不好说这个scala的compiler好还是java
的compiler好。而且写这个的人是java compiler原作者,俺合理的推断,有些前面的e
xperience,这个scala的compiler可能更好。

Yes, I am a believer the more complication a language is, the less efficient
it will be.
But that being said, seems like scala is a good language that is worth to
checkout.
Maybe we should make this board a forum both for java and for close
languages such as scala ;-)

【在 b******y 的大作中提到】
:
: Yes, I am a believer the more complication a language is, the less efficient
: it will be.
: But that being said, seems like scala is a good language that is worth to
: checkout.
: Maybe we should make this board a forum both for java and for close
: languages such as scala ;-)

avatar
k*r
10
compiler效率在scala中不是priority。我记得看到一篇文章说
作者想把直接compile成bytecode改成compile成java source,
然后用javac。其实scala是wrap java data types,会慢一些,
但因为是statically typed,还是比jython/jruby之类的快很多。

e
java
的e
efficient

【在 N*D 的大作中提到】
: 未必"the more complication, the less efficient"吧。这个是syntax复杂在front e
: nd,compile之后还是byte code在JVM上执行。不好说这个scala的compiler好还是java
: 的compiler好。而且写这个的人是java compiler原作者,俺合理的推断,有些前面的e
: xperience,这个scala的compiler可能更好。
:
: Yes, I am a believer the more complication a language is, the less efficient
: it will be.
: But that being said, seems like scala is a good language that is worth to
: checkout.
: Maybe we should make this board a forum both for java and for close

avatar
N*D
11
scala不是wrap java,it跟java是parallel的。比如scala里面没有primary type,即
使x = y + z也是三个objects。但compile成byte code后,和java的是一摸一样的。不
存在wrap一说。JVM类似提供了一个ISA,scala实在没必要转成java first,当然it可
能会使用一些java compiled bytecode的template,而且只会使用安全高效的。比如it
取消了static,加入了singleton的object,他compile出来的bytecode肯定是安全和高
度优化的,会比大多数的developer写出来的强。
俺也是在学习过程中,一些拙见,呵呵。

compiler效率在scala中不是priority。我记得看到一篇文章说
作者想把直接compile成bytecode改成compile成java source,
然后用javac。其实scala是wrap java data types,会慢一些,
但因为是statically typed,还是比jython/jruby之类的快很多。

【在 k***r 的大作中提到】
: compiler效率在scala中不是priority。我记得看到一篇文章说
: 作者想把直接compile成bytecode改成compile成java source,
: 然后用javac。其实scala是wrap java data types,会慢一些,
: 但因为是statically typed,还是比jython/jruby之类的快很多。
:
: e
: java
: 的e
: efficient

avatar
k*r
12
i've seen a presentation that quotes some benchmark numbers.
Basically in those tests Java has around 41% of the performance
of C while scala has 40%. So they are fairly close.

it

【在 N*D 的大作中提到】
: scala不是wrap java,it跟java是parallel的。比如scala里面没有primary type,即
: 使x = y + z也是三个objects。但compile成byte code后,和java的是一摸一样的。不
: 存在wrap一说。JVM类似提供了一个ISA,scala实在没必要转成java first,当然it可
: 能会使用一些java compiled bytecode的template,而且只会使用安全高效的。比如it
: 取消了static,加入了singleton的object,他compile出来的bytecode肯定是安全和高
: 度优化的,会比大多数的developer写出来的强。
: 俺也是在学习过程中,一些拙见,呵呵。
:
: compiler效率在scala中不是priority。我记得看到一篇文章说
: 作者想把直接compile成bytecode改成compile成java source,

avatar
F*n
13
Declarative Programming is not a new thing, and declarative / procedural
programming are conceptually different. To mix them together in one language
like Scala, is not necessarily a good thing, because it will only create
conceptual confusion and implementation nightmare (anyone has experience
with Lisp / Prolog would know what I am talking about).
The cleaner solution is to incorporate declarative features at the meta
level for a procedural language. Probably they should work on something
base

【在 k***r 的大作中提到】
: i've seen a presentation that quotes some benchmark numbers.
: Basically in those tests Java has around 41% of the performance
: of C while scala has 40%. So they are fairly close.
:
: it

avatar
k*r
14
您老说的我还不了解,不过scala除了看上去怪一点,好像是我想
用的high level language that has static typing,而且library
很rich (all Java libraries available)。感觉太学术的东西
好像也不一定实用,这一点scala looks promising

language

【在 F****n 的大作中提到】
: Declarative Programming is not a new thing, and declarative / procedural
: programming are conceptually different. To mix them together in one language
: like Scala, is not necessarily a good thing, because it will only create
: conceptual confusion and implementation nightmare (anyone has experience
: with Lisp / Prolog would know what I am talking about).
: The cleaner solution is to incorporate declarative features at the meta
: level for a procedural language. Probably they should work on something
: base

avatar
F*n
15
Hoho, there is another language that is a high-level language with static
typing and with all Java libraries available: Java

【在 k***r 的大作中提到】
: 您老说的我还不了解,不过scala除了看上去怪一点,好像是我想
: 用的high level language that has static typing,而且library
: 很rich (all Java libraries available)。感觉太学术的东西
: 好像也不一定实用,这一点scala looks promising
:
: language

avatar
k*r
16
level 还不够 high,打字太多,呵呵

【在 F****n 的大作中提到】
: Hoho, there is another language that is a high-level language with static
: typing and with all Java libraries available: Java

avatar
m*t
17

I found some benchmarks on a site which I can't seem to find
any more. Basically the takeaway point from those benchmarks
was that scala and java are pretty close for mostly procedural
code, but as soon as you get into functional programming,
scala's performance starts dropping.
That's not saying scala is an inefficient language. It's
just the fact well-known-for-four-decades that functional
programming provides convenience and conceptual simplicity
at the price of efficiency.

【在 k***r 的大作中提到】
: i've seen a presentation that quotes some benchmark numbers.
: Basically in those tests Java has around 41% of the performance
: of C while scala has 40%. So they are fairly close.
:
: it

avatar
k*r
18
Interesting. Can I attribute the slowness in functional tests
to manipulating existing objects is faster than copying objects
and then making changes to them?

【在 m******t 的大作中提到】
:
: I found some benchmarks on a site which I can't seem to find
: any more. Basically the takeaway point from those benchmarks
: was that scala and java are pretty close for mostly procedural
: code, but as soon as you get into functional programming,
: scala's performance starts dropping.
: That's not saying scala is an inefficient language. It's
: just the fact well-known-for-four-decades that functional
: programming provides convenience and conceptual simplicity
: at the price of efficiency.

avatar
F*n
19
Declarative programming is slow because modern computers are procedural in
nature. Declarative programming needs very complicated indexing / caching
structure to optimize queries. It's an advanced AI topic. It is impossible
to solve based on good implementation. Someone will win 2-3 Turing Awards if
he / she develops a declarative programming model as fast as procedural
languages. That's why the innovative part of Scala is dubious.

【在 k***r 的大作中提到】
: Interesting. Can I attribute the slowness in functional tests
: to manipulating existing objects is faster than copying objects
: and then making changes to them?

avatar
b*y
20
"It's an advanced AI topic"
haha, love it Foxman, you hit the nail onto the head.
我觉得其实computing 40多年以来,最好的还是good old c programming. Java也不错
。但scala学习一下不错,不知道将来是否会有市场。
我曾今学过Prolog, 觉得和AI相关的东西太深的都是忽悠。工业界和现实当中,最可靠
最好的还是扎扎实实的procedural programming. 加点儿Object oriented也就不错了
avatar
b*y
21
另外,我只对high performance computing感兴趣,所以对于我来说,任何
inefficient的programming language或者tools都没有太大的吸引力。
avatar
k*r
22
我对high productivity更感兴趣,呵呵,因为很多情况下可以
用好机器或者多台机器提高performance,却不容易提高一个
developer,比如我自己,的productivity。所以dynamic language
或者不那么dynamic但是省很多typing的language,比如scala,
有用武之地。

【在 b******y 的大作中提到】
: 另外,我只对high performance computing感兴趣,所以对于我来说,任何
: inefficient的programming language或者tools都没有太大的吸引力。

avatar
F*n
23
Actually declarative programming can be extremely difficult to debug, which
may drop your productivity.

【在 k***r 的大作中提到】
: 我对high productivity更感兴趣,呵呵,因为很多情况下可以
: 用好机器或者多台机器提高performance,却不容易提高一个
: developer,比如我自己,的productivity。所以dynamic language
: 或者不那么dynamic但是省很多typing的language,比如scala,
: 有用武之地。

avatar
k*r
24
To be honest, and I'm sure this has something to do with
the fact that I'm not an expert of programming languages,
I haven't found a great deal of differences between scala
and Java, or between scala and Python, given that the syntax
of Scala is the oddest of the three.
Of course they are all different, but not in big ways to me,
especially between scala and Java, both of which are statically
typed. Scala's advantages such as type inference, and other
form of simplifications (omission of bracket

【在 F****n 的大作中提到】
: Actually declarative programming can be extremely difficult to debug, which
: may drop your productivity.

avatar
F*n
25
Declarative programming is what they advocate Scala for. If you don't use DP
, then why invest huge time on another dialect of Java or Python or Smalltalk. If you use DP, it
will give your headache sooner or later. That's Scala's dilemma.

【在 k***r 的大作中提到】
: To be honest, and I'm sure this has something to do with
: the fact that I'm not an expert of programming languages,
: I haven't found a great deal of differences between scala
: and Java, or between scala and Python, given that the syntax
: of Scala is the oddest of the three.
: Of course they are all different, but not in big ways to me,
: especially between scala and Java, both of which are statically
: typed. Scala's advantages such as type inference, and other
: form of simplifications (omission of bracket

avatar
k*r
26
I've already explained why lah. Much less typing for Scala.
Much shorter and more flexible code for Python, well worth it
for some projects even w/o any benefit of DP.

DP
Smalltalk. If you use DP, it

【在 F****n 的大作中提到】
: Declarative programming is what they advocate Scala for. If you don't use DP
: , then why invest huge time on another dialect of Java or Python or Smalltalk. If you use DP, it
: will give your headache sooner or later. That's Scala's dilemma.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。