avatar
functional programming?# Programming - 葵花宝典
b*3
1
大家如果有需要机场接送机或者其他短程接送等等可以找我啊
业余时间做个兼职,挣点外快 纽约,新泽西均可,有需要可以发邮件
给我:a*************[email protected] 或者加QQ: 38765618 敲门: MITBBS 欢迎捧场
如果BOTHER 到大家,还请见谅
avatar
G*d
3
落地 vs 书架?
功放?
2-way vs 3-way?
avatar
W*N
4
my small company had no income just some operating cost last year. but a
little confused with how to fill the 1065,tax form. anyone might be able to
help a little? thanks.
avatar
l*m
5
是不是在Turbo Tax里不用报成今年 IRA 的 contribution 啊?
avatar
f*t
6
这编剧一点逻辑都没有。结尾真郁闷。去趟美国跟去外太空似的。这种情况放三十年前
还说得过去,现在是信息时代,哪里至于这样?就为了表现最后一幕,硬是让个秘书插
了一脚,简直莫名其妙。好在男女主角演得好,尤其是宋丹丹,演得真好...
avatar
c*n
7
I don't really see the point of using functional programming languages for
real production projects, though clojure is very popular now.
my point is that in a few cases you do need to operate on functions, all
languages have such features: C has function pointers, java has anonymous
inner classes, python has lambda. it's just that they do not openly
advertise them as "functional".
but even clojure itself does not recommend using non-named functions
recursive, but isn't operating on functions themselves the real power of
functional programming?
clojure is popular, and handy, but I feel a large part of that comes from
the easiness of kind of using java as a scripting language , so that u don't
need to go through the compile/build/run cycle, and the iteration is much
faster, kind of like for prototyping purposes. the only real difference of
clojure to java, I feel, is the annoying prefix notation, which is
completely useless, and the syntax could have been completely re-designed to
be like most languages to give users a more natural, intuitive feeling.
The prefix notation and endless "()" is just an archaic legacy left over
from when LISP was created.
avatar
t*n
8
要不版主搞个置顶吧,哪个城市,谁,提供接送业务,以及联系方式;

【在 b********3 的大作中提到】
: 大家如果有需要机场接送机或者其他短程接送等等可以找我啊
: 业余时间做个兼职,挣点外快 纽约,新泽西均可,有需要可以发邮件
: 给我:a*************[email protected] 或者加QQ: 38765618 敲门: MITBBS 欢迎捧场
: 如果BOTHER 到大家,还请见谅

avatar
d*w
9
上面信息有点问题,st成功那个股票是2006年停盘的,今天开盘涨5倍了。两市破净的
只有四川长虹了。
avatar
D*s
10
频响范围和喇叭单元的素质关系最大,能生产好单元的就那么几家,门槛高,几十家都
在用人家的喇叭,做成各种各样的箱子。
avatar
W*N
11
it is a multi member llc.

to

【在 W*N 的大作中提到】
: my small company had no income just some operating cost last year. but a
: little confused with how to fill the 1065,tax form. anyone might be able to
: help a little? thanks.

avatar
J*i
12
you mean distribution? It is not current year contributions. you actually
will receive 1099-R for the rollover with a rollover distribution code,
which makes it non-taxable.

【在 l*m 的大作中提到】
: 是不是在Turbo Tax里不用报成今年 IRA 的 contribution 啊?
avatar
g*u
13
是这么回事。
avatar
d*x
14
铜球fp达人来解释

【在 c******n 的大作中提到】
: I don't really see the point of using functional programming languages for
: real production projects, though clojure is very popular now.
: my point is that in a few cases you do need to operate on functions, all
: languages have such features: C has function pointers, java has anonymous
: inner classes, python has lambda. it's just that they do not openly
: advertise them as "functional".
: but even clojure itself does not recommend using non-named functions
: recursive, but isn't operating on functions themselves the real power of
: functional programming?
: clojure is popular, and handy, but I feel a large part of that comes from

avatar
D*E
15
各个机场都可以?

【在 b********3 的大作中提到】
: 大家如果有需要机场接送机或者其他短程接送等等可以找我啊
: 业余时间做个兼职,挣点外快 纽约,新泽西均可,有需要可以发邮件
: 给我:a*************[email protected] 或者加QQ: 38765618 敲门: MITBBS 欢迎捧场
: 如果BOTHER 到大家,还请见谅

avatar
G*d
16
那几家生产好的单元?

【在 D**********s 的大作中提到】
: 频响范围和喇叭单元的素质关系最大,能生产好单元的就那么几家,门槛高,几十家都
: 在用人家的喇叭,做成各种各样的箱子。

avatar
W*N
17
Any help please? I know hiring an account could solve the problem, but I
only have about 800 dollars spent on various buys, registrations, etc. just
want a tip to fill them in the right place.
Thanks.
avatar
l*m
18
谢了

actually
code,

【在 J*****i 的大作中提到】
: you mean distribution? It is not current year contributions. you actually
: will receive 1099-R for the rollover with a rollover distribution code,
: which makes it non-taxable.

avatar
z*c
19
我觉得这片就宋丹丹一家人,包括宋丹丹,没法看。

【在 f*******t 的大作中提到】
: 这编剧一点逻辑都没有。结尾真郁闷。去趟美国跟去外太空似的。这种情况放三十年前
: 还说得过去,现在是信息时代,哪里至于这样?就为了表现最后一幕,硬是让个秘书插
: 了一脚,简直莫名其妙。好在男女主角演得好,尤其是宋丹丹,演得真好...

avatar
p*2
20
FP这几年越来越流行不就是主要因为parallelism 和 concurrency吗? 传统的
imperative programming不适合做并行计算。
avatar
b*3
21
JFK, EWR, LGA 或者附近的短途都可以
长途估计就不合适了 还不如自己租车了

【在 D*****E 的大作中提到】
: 各个机场都可以?
avatar
W*N
22
my small company had no income just some operating cost last year. but a
little confused with how to fill the 1065,tax form. anyone might be able to
help a little? thanks.
avatar
b*e
23
嗯,片子很多硬伤,不过男女主角表现太好了,楞是让我看下去了。

【在 f*******t 的大作中提到】
: 这编剧一点逻辑都没有。结尾真郁闷。去趟美国跟去外太空似的。这种情况放三十年前
: 还说得过去,现在是信息时代,哪里至于这样?就为了表现最后一幕,硬是让个秘书插
: 了一脚,简直莫名其妙。好在男女主角演得好,尤其是宋丹丹,演得真好...

avatar
n*t
24
我认为fp比impertive language来说和当前实际计算机差得更远。
和一般人的思维也不那么接近,但是比较接近数学的思维。
所以相应的结果就是两个,第一效率不会很高,第二比较expressive。
最近的机器越来越快,所以fp开始流行起来了。

【在 p*****2 的大作中提到】
: FP这几年越来越流行不就是主要因为parallelism 和 concurrency吗? 传统的
: imperative programming不适合做并行计算。

avatar
W*N
25
it is a multi member llc.

to

【在 W*N 的大作中提到】
: my small company had no income just some operating cost last year. but a
: little confused with how to fill the 1065,tax form. anyone might be able to
: help a little? thanks.

avatar
w*i
26
此片剩女和中年女最爱

【在 f*******t 的大作中提到】
: 这编剧一点逻辑都没有。结尾真郁闷。去趟美国跟去外太空似的。这种情况放三十年前
: 还说得过去,现在是信息时代,哪里至于这样?就为了表现最后一幕,硬是让个秘书插
: 了一脚,简直莫名其妙。好在男女主角演得好,尤其是宋丹丹,演得真好...

avatar
p*2
27

基本这么回事。但是貌似不是机器越来越快造成的吧?机器越来越快已经持续很多年了
。相反是因为机器不能越来越快了,因此现在的趋势是core越来越多,所以fp流行起来
了。

【在 n******t 的大作中提到】
: 我认为fp比impertive language来说和当前实际计算机差得更远。
: 和一般人的思维也不那么接近,但是比较接近数学的思维。
: 所以相应的结果就是两个,第一效率不会很高,第二比较expressive。
: 最近的机器越来越快,所以fp开始流行起来了。

avatar
W*N
28
Any help please? I know hiring an account could solve the problem, but I
only have about 800 dollars spent on various buys, registrations, etc. just
want a tip to fill them in the right place.
Thanks.
avatar
x*i
29
海归的福音。
avatar
x*u
30
core多不会提高fp速度啊。现实点说,不在乎速度的场合才能用FP。

【在 p*****2 的大作中提到】
:
: 基本这么回事。但是貌似不是机器越来越快造成的吧?机器越来越快已经持续很多年了
: 。相反是因为机器不能越来越快了,因此现在的趋势是core越来越多,所以fp流行起来
: 了。

avatar
h*x
31
I have a similar situation that we only have a few thousands of expense for
the year 2011.

to

【在 W*N 的大作中提到】
: my small company had no income just some operating cost last year. but a
: little confused with how to fill the 1065,tax form. anyone might be able to
: help a little? thanks.

avatar
m*h
32
真没看出来主角哪里演的好了。宋非要拌嫩,怎么看怎么别扭。男主角整天一痞子样,
不知道凭啥发的大财....

【在 f*******t 的大作中提到】
: 这编剧一点逻辑都没有。结尾真郁闷。去趟美国跟去外太空似的。这种情况放三十年前
: 还说得过去,现在是信息时代,哪里至于这样?就为了表现最后一幕,硬是让个秘书插
: 了一脚,简直莫名其妙。好在男女主角演得好,尤其是宋丹丹,演得真好...

avatar
p*2
33

core多就需要更好的并行计算了。FP在单线程上确实效率没法跟OO的比,但是多线程具
有先天的优势。这也是为什么随着core越来越多,fp越来越流行的真正原因。

【在 x****u 的大作中提到】
: core多不会提高fp速度啊。现实点说,不在乎速度的场合才能用FP。
avatar
b*s
34
您好说的不对互相讨论。
1) multi member llc 税法处理视同parntership,公司层面填写1065,
2) 按照partner share allocate 到1065 k-1,每个partner 一个;
3) 每个partner 根据K1 填写schedule E, 将公司损失流转到个人层面;
4) 将schedule E 最后一页40行填入1040 line 17。
收入要纳入税基,损失冲减其他来源的收入。如果是passive loss,可以抵扣的金额有
个限制。
此外,合伙人获得的工资要纳入 W2收入,不冲减其在合伙企业的base,但是公司的收
入冲减,损失增加base,将来转让公司的时候按照个人capital gain 来交税。
希望能帮助到你们。

to

【在 W*N 的大作中提到】
: my small company had no income just some operating cost last year. but a
: little confused with how to fill the 1065,tax form. anyone might be able to
: help a little? thanks.

avatar
G*e
35
最后硬插女秘书当然是为了烘托最后的浪漫,但我也没觉得那段很不合理啊,李和梁就
是前半辈子一个糊涂宽容一个坎坷扭曲,俩人认识以后在摩擦蹉跎中产生复杂的感情,
在最后时刻被不约而同的心灵相吸点破,我觉得特完美~作为一个女生挺符合我对浪漫
邂逅的fantasy的~一定一辈子都回味不完

【在 f*******t 的大作中提到】
: 这编剧一点逻辑都没有。结尾真郁闷。去趟美国跟去外太空似的。这种情况放三十年前
: 还说得过去,现在是信息时代,哪里至于这样?就为了表现最后一幕,硬是让个秘书插
: 了一脚,简直莫名其妙。好在男女主角演得好,尤其是宋丹丹,演得真好...

avatar
x*u
36
FP和并行有什么关系。

【在 p*****2 的大作中提到】
:
: core多就需要更好的并行计算了。FP在单线程上确实效率没法跟OO的比,但是多线程具
: 有先天的优势。这也是为什么随着core越来越多,fp越来越流行的真正原因。

avatar
W*N
37
Thank you so much. So I guess I need to file in 1065 and attach statements?
Since we do not have any income, so line 1-8 are all 0, and since we only
bought some stationaries, registered company and bought website addresses,
that would come under line 20 Other deductions? All others are 0? And then
fill in k-1 for each member for loss according to each's percentage?
Thank you! Really appreciate it.

【在 b*********s 的大作中提到】
: 您好说的不对互相讨论。
: 1) multi member llc 税法处理视同parntership,公司层面填写1065,
: 2) 按照partner share allocate 到1065 k-1,每个partner 一个;
: 3) 每个partner 根据K1 填写schedule E, 将公司损失流转到个人层面;
: 4) 将schedule E 最后一页40行填入1040 line 17。
: 收入要纳入税基,损失冲减其他来源的收入。如果是passive loss,可以抵扣的金额有
: 个限制。
: 此外,合伙人获得的工资要纳入 W2收入,不冲减其在合伙企业的base,但是公司的收
: 入冲减,损失增加base,将来转让公司的时候按照个人capital gain 来交税。
: 希望能帮助到你们。

avatar
S*d
38
我老婆看得津津有味
我说:您不用看这些剩女的片子找安慰吧

【在 G**********e 的大作中提到】
: 最后硬插女秘书当然是为了烘托最后的浪漫,但我也没觉得那段很不合理啊,李和梁就
: 是前半辈子一个糊涂宽容一个坎坷扭曲,俩人认识以后在摩擦蹉跎中产生复杂的感情,
: 在最后时刻被不约而同的心灵相吸点破,我觉得特完美~作为一个女生挺符合我对浪漫
: 邂逅的fantasy的~一定一辈子都回味不完

avatar
p*2
39

imperative对并行计算有先天的缺陷呀。这些缺陷FP上都没有呀。如果你这个还有疑问
的话,最好先看看FP的基本概念。

【在 x****u 的大作中提到】
: FP和并行有什么关系。
avatar
G*e
40
别鄙视人家剩女啊
人家剩不剩女的跟这个故事没多大关系啊,我也不明白为什么因为这个那么多人骂宋丹
丹啊

【在 S*******d 的大作中提到】
: 我老婆看得津津有味
: 我说:您不用看这些剩女的片子找安慰吧

avatar
x*u
41
先天缺陷什么啊,VC都支持lambda了。

【在 p*****2 的大作中提到】
:
: imperative对并行计算有先天的缺陷呀。这些缺陷FP上都没有呀。如果你这个还有疑问
: 的话,最好先看看FP的基本概念。

avatar
p*2
42

这个跟lambda没啥关系。支持lambada的语言多了,有几个敢说自己是FP呢?

【在 x****u 的大作中提到】
: 先天缺陷什么啊,VC都支持lambda了。
avatar
n*t
43
每一个core不能变快,但是对于大部分应用还是太快。
所以core多,和处理能力强很多时候是一样的。
此外,大部分fp对list和vector支持比较好,所以对于自然并行化的
问题,比较容易scale.

【在 p*****2 的大作中提到】
:
: 这个跟lambda没啥关系。支持lambada的语言多了,有几个敢说自己是FP呢?

avatar
p*2
44

core多也需要application的优化才能转化为更好的性能。即使在OS的level也需要支持
multi core,不然也获得不了应有的benefit。OS支持了,你可以认为处理能力更强了
。但是那是从OS的角度来说的。从application角度也需要支持multi core,否则这个
application就没有take multi core的benefit。而FP正是从application level来讲的
。显然FP做不了底层。

【在 n******t 的大作中提到】
: 每一个core不能变快,但是对于大部分应用还是太快。
: 所以core多,和处理能力强很多时候是一样的。
: 此外,大部分fp对list和vector支持比较好,所以对于自然并行化的
: 问题,比较容易scale.

avatar
p*2
45

关键不是对list vector支持好。

【在 n******t 的大作中提到】
: 每一个core不能变快,但是对于大部分应用还是太快。
: 所以core多,和处理能力强很多时候是一样的。
: 此外,大部分fp对list和vector支持比较好,所以对于自然并行化的
: 问题,比较容易scale.

avatar
n*t
46
fp常常是用来计算已经被分拆之后的task,也就是一个core上跑的任务。

【在 p*****2 的大作中提到】
:
: 关键不是对list vector支持好。

avatar
p*2
47

拆分之后为什么只在一个core上跑?

【在 n******t 的大作中提到】
: fp常常是用来计算已经被分拆之后的task,也就是一个core上跑的任务。
avatar
x*u
48
VC支持lambda是为了应对多核,和FP没关系。

【在 p*****2 的大作中提到】
:
: 拆分之后为什么只在一个core上跑?

avatar
x*u
49
不说别的,OS启动这一块的支持就不好。

【在 n******t 的大作中提到】
: 每一个core不能变快,但是对于大部分应用还是太快。
: 所以core多,和处理能力强很多时候是一样的。
: 此外,大部分fp对list和vector支持比较好,所以对于自然并行化的
: 问题,比较容易scale.

avatar
t*a
50
I don't really see the point of using functional programming languages for
real production projects, though clojure is very popular now.
好问题,但也许你尝试用FP语言做一做事情,亲身体验一下,会有不同的感觉。
my point is that in a few cases you do need to operate on functions, all
languages have such features: C has function pointers, java has anonymous
inner classes, python has lambda. it's just that they do not openly
advertise them as "functional".
FP和上述冯诺依曼机式语言有好些地方不一样。最主要之一是immutable的数据结构。
个人的体会是它使得写程序减少了变量,强迫程序员用类似数学推理的方式写程序,提
高了程序的正确性。
在写Clojure程序的时候,我的体会是应该考虑“是什么”,而不是“怎么做”,这点
和冯诺依曼机式语言明显不同。
but even clojure itself does not recommend using non-named functions
recursive, but isn't operating on functions themselves the real power of
functional programming?
真的吗?我没看到这个recommend,能给个出处好么?我通常用anonymous function和
map函数配合,譬如(map #(+ x 2) (list 1 2 3)),如果有其他推荐的方法,请教教我。
clojure is popular, and handy, but I feel a large part of that comes from
the easiness of kind of using java as a scripting language , so that u don't
need to go through the compile/build/run cycle, and the iteration is much
faster, kind of like for prototyping purposes. the only real difference of
clojure to java, I feel, is the annoying prefix notation, which is
completely useless, and the syntax could have been completely re-designed to
be like most languages to give users a more natural, intuitive feeling.
The prefix notation and endless "()" is just an archaic legacy left over
from when LISP was created.
JVM的scripting language由来已久。如果你喜欢偏java格式的语法,可以尝试
beanshell, groovy。你也有其他选择比如Jython, JRuby。
简单就是美。Prefix notation使得Lisp/Clojure用统一的格式,不受语法的限制,个
人以为这正是它美的地方。而且,如果没有了Prefix notation,还如何能使用macro,
operate code as data呢?
刚接触Lisp的同学可能会有些排斥lisp古怪的括号。当你习惯了它的时候,你会喜欢上
它的。
心得:
1. 你需要一个好的编辑器,推荐emacs。NREPL,或者slime+swank-clojure让我感觉超
越了python, R的交互环境,也许你也会这么觉得。
2. 手工配对括号是很麻烦的事情,需要自动配对工具。在emacs下推荐paredit +
rainbow-delimiter。
avatar
b*n
51
scala 中一个 par 指令就可以做并行运算了。

【在 n******t 的大作中提到】
: fp常常是用来计算已经被分拆之后的task,也就是一个core上跑的任务。
avatar
x*u
52
FP除了效率不行外,没有任何缺点。

【在 t****a 的大作中提到】
: I don't really see the point of using functional programming languages for
: real production projects, though clojure is very popular now.
: 好问题,但也许你尝试用FP语言做一做事情,亲身体验一下,会有不同的感觉。
: my point is that in a few cases you do need to operate on functions, all
: languages have such features: C has function pointers, java has anonymous
: inner classes, python has lambda. it's just that they do not openly
: advertise them as "functional".
: FP和上述冯诺依曼机式语言有好些地方不一样。最主要之一是immutable的数据结构。
: 个人的体会是它使得写程序减少了变量,强迫程序员用类似数学推理的方式写程序,提
: 高了程序的正确性。

avatar
p*2
53

大牛终于出现了。

【在 t****a 的大作中提到】
: I don't really see the point of using functional programming languages for
: real production projects, though clojure is very popular now.
: 好问题,但也许你尝试用FP语言做一做事情,亲身体验一下,会有不同的感觉。
: my point is that in a few cases you do need to operate on functions, all
: languages have such features: C has function pointers, java has anonymous
: inner classes, python has lambda. it's just that they do not openly
: advertise them as "functional".
: FP和上述冯诺依曼机式语言有好些地方不一样。最主要之一是immutable的数据结构。
: 个人的体会是它使得写程序减少了变量,强迫程序员用类似数学推理的方式写程序,提
: 高了程序的正确性。

avatar
p*2
54

这个不是这样子的吧?lambda本来就是fp的东西吧?怎么能说没关系呢?

【在 x****u 的大作中提到】
: VC支持lambda是为了应对多核,和FP没关系。
avatar
p*2
55

这个不一定吧?
FP效率不高并不是绝对的,而且在并行计算有先天的优势。效率应该比imperative的更
高才对。
FP的缺点其实也不少,不然OO早被干掉了。

【在 x****u 的大作中提到】
: FP除了效率不行外,没有任何缺点。
avatar
x*u
56
匿名函数和fp没什么必然联系。

【在 p*****2 的大作中提到】
:
: 这个不一定吧?
: FP效率不高并不是绝对的,而且在并行计算有先天的优势。效率应该比imperative的更
: 高才对。
: FP的缺点其实也不少,不然OO早被干掉了。

avatar
x*u
57
就算是并行,分到每个核上面还是冯诺依曼架构。

【在 p*****2 的大作中提到】
:
: 这个不一定吧?
: FP效率不高并不是绝对的,而且在并行计算有先天的优势。效率应该比imperative的更
: 高才对。
: FP的缺点其实也不少,不然OO早被干掉了。

avatar
p*2
58

这个有什么根据吗?

【在 x****u 的大作中提到】
: 匿名函数和fp没什么必然联系。
avatar
p*2
59

但是并行以后性能可以提升呀。所以不是FP就性能一定差呀。

【在 x****u 的大作中提到】
: 就算是并行,分到每个核上面还是冯诺依曼架构。
avatar
x*u
60
FP的问题是计算量越大,CPU越不是图灵机。

【在 p*****2 的大作中提到】
:
: 但是并行以后性能可以提升呀。所以不是FP就性能一定差呀。

avatar
p*2
61

这是刚从wiki上查的
First class functions have slowly been added to mainstream languages. For
example, in early 1994, support for lambda, filter, map, and reduce was
added to Python. Then during the development of Python 3000, Guido van
Rossum called for the removal of these features.[40][41] So far, only the
reduce function has been removed, but remains accessible via the functools
standard library module.[42] First class functions were also introduced in
PHP 5.3, Visual Basic 9, C# 3.0, and C++11.
The Language Integrated Query (LINQ) feature, with its many incarnations, is
an obvious and powerful use of functional programming in .NET.

【在 x****u 的大作中提到】
: 匿名函数和fp没什么必然联系。
avatar
p*2
62

太高深了。不明白。跟我们讨论的并行有什么关系吗?

【在 x****u 的大作中提到】
: FP的问题是计算量越大,CPU越不是图灵机。
avatar
x*u
63
这是什么乱七八糟的。JavaScript也支持匿名函数,莫非JS也是FP?

is

【在 p*****2 的大作中提到】
:
: 太高深了。不明白。跟我们讨论的并行有什么关系吗?

avatar
x*u
64
就是说FP在极端条件下不好用,因为整个架构就不是为它设计的。你要是用过以前的计
算机就明白了。

【在 p*****2 的大作中提到】
:
: 太高深了。不明白。跟我们讨论的并行有什么关系吗?

avatar
p*2
65

好了。终于明白你的逻辑了。I服了Y。

【在 x****u 的大作中提到】
: 这是什么乱七八糟的。JavaScript也支持匿名函数,莫非JS也是FP?
:
: is

avatar
x*u
66
你悲愤也没用。
90年代的C++也支持匿名函数,只要按照COM的Automation规范写即可。

【在 p*****2 的大作中提到】
:
: 好了。终于明白你的逻辑了。I服了Y。

avatar
g*g
67
FP的最大缺点,不是慢,而是太难。太难的语言,想找够人写个大项目都不可能,想找
个有10年经验的来带项目市面上不存在。
不是没有例外呀,Erlang就算一个。但例外终究是例外,不是主流。
avatar
x*u
68
就是一个慢。想快的话就不能顺着FP的自然思路写,那就是自己整自己了。

【在 g*****g 的大作中提到】
: FP的最大缺点,不是慢,而是太难。太难的语言,想找够人写个大项目都不可能,想找
: 个有10年经验的来带项目市面上不存在。
: 不是没有例外呀,Erlang就算一个。但例外终究是例外,不是主流。

avatar
g*g
69
Scala的性能接近Java,比Python, Ruby之类的scripting语言快,不能算慢了。

【在 x****u 的大作中提到】
: 就是一个慢。想快的话就不能顺着FP的自然思路写,那就是自己整自己了。
avatar
x*u
70
做个大东西,就有差距了。类似的例子任何两个语言都能找出来。

【在 g*****g 的大作中提到】
: Scala的性能接近Java,比Python, Ruby之类的scripting语言快,不能算慢了。
avatar
g*g
71
性能不是唯一重要的东西,特别差别没超过一个数量级的情况下。就如java性能永远比
不上C++,照样在很多领域取代C++没有压力。开发快速,维护容易,永远是最重要的。
FP简洁是做到了,是否快速要看什么领域。

【在 x****u 的大作中提到】
: 做个大东西,就有差距了。类似的例子任何两个语言都能找出来。
avatar
x*u
72
所以说JavaScript也能长盛不衰,主要是特定场合有特定用处。

【在 g*****g 的大作中提到】
: 性能不是唯一重要的东西,特别差别没超过一个数量级的情况下。就如java性能永远比
: 不上C++,照样在很多领域取代C++没有压力。开发快速,维护容易,永远是最重要的。
: FP简洁是做到了,是否快速要看什么领域。

avatar
t*s
73
最近在学Haskell
看learn yourself a haskell七八章了。到现在为止没看到Python没有的feature.
Python里面partial, list comprehension, map, reduce, filter都有
什么Eq Ord Show这种Python也有,例如, 一个类如果定义了 __lt__ 等等就能比较
所谓Monad也是故弄玄虚,我专门去看了Philp Wadler (principle designer of
Haskell)的Monads for functional programming。Monad两个字就能解释: annotated
data. 顶多把那三个laws再加上。
Maybe有点意思,但imperative的Exceptional Handling更方便,更有效率。
最不爽的是Haskell readability sucks。
唯一Haskell比Python舒服的地方我觉得是函数定义强制
->a->a->a->b 这个背后的点子非常聪明,非常mathematically beautiful
另外就是匹配中的_符号很符合数学规范。

【在 c******n 的大作中提到】
: I don't really see the point of using functional programming languages for
: real production projects, though clojure is very popular now.
: my point is that in a few cases you do need to operate on functions, all
: languages have such features: C has function pointers, java has anonymous
: inner classes, python has lambda. it's just that they do not openly
: advertise them as "functional".
: but even clojure itself does not recommend using non-named functions
: recursive, but isn't operating on functions themselves the real power of
: functional programming?
: clojure is popular, and handy, but I feel a large part of that comes from

avatar
s*o
74
刚跟stackoverflow上的“专家”交流了一下关于Java8跟Scala,专家坚持认为java is
slow, slow, slow...
"chat with an expert" 是stackoverflow 今天推出来的一个新服务,有兴趣的可以去
试一试

【在 g*****g 的大作中提到】
: Scala的性能接近Java,比Python, Ruby之类的scripting语言快,不能算慢了。
avatar
E*m
75

行行行! 你回去拜耶穌比你講你不懂的圖靈機實際點。

【在 x****u 的大作中提到】
: FP的问题是计算量越大,CPU越不是图灵机。
avatar
E*m
76
Abstract data type, pattern matching, guard, laziness...
你用 Python 做這些看看。

annotated

【在 t*s 的大作中提到】
: 最近在学Haskell
: 看learn yourself a haskell七八章了。到现在为止没看到Python没有的feature.
: Python里面partial, list comprehension, map, reduce, filter都有
: 什么Eq Ord Show这种Python也有,例如, 一个类如果定义了 __lt__ 等等就能比较
: 所谓Monad也是故弄玄虚,我专门去看了Philp Wadler (principle designer of
: Haskell)的Monads for functional programming。Monad两个字就能解释: annotated
: data. 顶多把那三个laws再加上。
: Maybe有点意思,但imperative的Exceptional Handling更方便,更有效率。
: 最不爽的是Haskell readability sucks。
: 唯一Haskell比Python舒服的地方我觉得是函数定义强制

avatar
d*i
77
OpenMP不就是为了多核并行计算提出来的吗?

【在 p*****2 的大作中提到】
: FP这几年越来越流行不就是主要因为parallelism 和 concurrency吗? 传统的
: imperative programming不适合做并行计算。

avatar
E*m
78

沒哪個語言不能做並行,好不好做的差別而已。

【在 d****i 的大作中提到】
: OpenMP不就是为了多核并行计算提出来的吗?
avatar
e*o
79
直接从clojure doc 上拿个例子。
(((person :employer) :address) :city)
clojure 提供了个 macro ->
所以可以这样写。
(-> person :employer :address :city)
在别的语言中,大致类似的写法是 person.employer.address.city
你喜欢哪个写法? 这个例子说明什么呢?

【在 t****a 的大作中提到】
: I don't really see the point of using functional programming languages for
: real production projects, though clojure is very popular now.
: 好问题,但也许你尝试用FP语言做一做事情,亲身体验一下,会有不同的感觉。
: my point is that in a few cases you do need to operate on functions, all
: languages have such features: C has function pointers, java has anonymous
: inner classes, python has lambda. it's just that they do not openly
: advertise them as "functional".
: FP和上述冯诺依曼机式语言有好些地方不一样。最主要之一是immutable的数据结构。
: 个人的体会是它使得写程序减少了变量,强迫程序员用类似数学推理的方式写程序,提
: 高了程序的正确性。

avatar
t*s
80
python的duck type更general.
pattern matching在imperative语言中根本不是问题。也更灵活。
不光可以pattern matching, 还可以value matching
laziness python也有, generator.
guard是啥不知道

【在 E*****m 的大作中提到】
: Abstract data type, pattern matching, guard, laziness...
: 你用 Python 做這些看看。
:
: annotated

avatar
t*a
81
我看到的多数人采用->的写法,它的好处可能有
1. 减少了小括号的数目
这是Clojure比Common Lisp改进的方向。Clojure在语言设计上已经想办法减少()的数
目。
2. 提高可读性。
这种写法有点像OOP语言里访问成员的方式。联想到很多Clojure程序员是从Java语言转
过来的,很多人喜欢这样写也就很自然了。

【在 e*******o 的大作中提到】
: 直接从clojure doc 上拿个例子。
: (((person :employer) :address) :city)
: clojure 提供了个 macro ->
: 所以可以这样写。
: (-> person :employer :address :city)
: 在别的语言中,大致类似的写法是 person.employer.address.city
: 你喜欢哪个写法? 这个例子说明什么呢?

avatar
p*2
82
一个最基本的尾递归就把python秒了吧

annotated

【在 t*s 的大作中提到】
: 最近在学Haskell
: 看learn yourself a haskell七八章了。到现在为止没看到Python没有的feature.
: Python里面partial, list comprehension, map, reduce, filter都有
: 什么Eq Ord Show这种Python也有,例如, 一个类如果定义了 __lt__ 等等就能比较
: 所谓Monad也是故弄玄虚,我专门去看了Philp Wadler (principle designer of
: Haskell)的Monads for functional programming。Monad两个字就能解释: annotated
: data. 顶多把那三个laws再加上。
: Maybe有点意思,但imperative的Exceptional Handling更方便,更有效率。
: 最不爽的是Haskell readability sucks。
: 唯一Haskell比Python舒服的地方我觉得是函数定义强制

avatar
E*m
83

這怎麼來的?
你到底讀了那本書沒有? 我覺得你沒有。
我說的 pattern matching 是這種
sum [] = 0
sum x:xs = x + sum xs
python 的太有限, 你看看這個經典算 Fibonacci series 的
fibs :: [Integer]
fibs = 1:1:zipwith (+) fibs (tail fibs)
python 做不到這麼精簡的
Learn You a Haskell for Great Good! 第四章
我不是Python 黑,事實上我是Python 粉, 不過各有
長處罷了。

【在 t*s 的大作中提到】
: python的duck type更general.
: pattern matching在imperative语言中根本不是问题。也更灵活。
: 不光可以pattern matching, 还可以value matching
: laziness python也有, generator.
: guard是啥不知道

avatar
A*t
84
您学过theory of computation或者mathematical logic吗?

【在 x****u 的大作中提到】
: FP的问题是计算量越大,CPU越不是图灵机。
avatar
A*t
85
求问GADT, template Haskell, type based reflection, quasiquoting 在python里面
是咋做的。

【在 t*s 的大作中提到】
: python的duck type更general.
: pattern matching在imperative语言中根本不是问题。也更灵活。
: 不光可以pattern matching, 还可以value matching
: laziness python也有, generator.
: guard是啥不知道

avatar
E*m
86

他上次已經發貼曝露他沒搞懂啥教 Turing Machine 了。

【在 A*******t 的大作中提到】
: 您学过theory of computation或者mathematical logic吗?
avatar
L*n
87
那位就是灌水扯淡的

【在 E*****m 的大作中提到】
:
: 他上次已經發貼曝露他沒搞懂啥教 Turing Machine 了。

avatar
E*m
88
他是信耶穌的, 凡事講信仰,不講證據。

【在 L***n 的大作中提到】
: 那位就是灌水扯淡的
avatar
t*s
89
google了一下
这个是haskell编译懂得优化,还是需要人为的写,例如用fold?
如果是用fold, python也有,但只是从左到右
要reverse效率会下降。

【在 p*****2 的大作中提到】
: 一个最基本的尾递归就把python秒了吧
:
: annotated

avatar
t*s
90
一个都没听说过

【在 A*******t 的大作中提到】
: 求问GADT, template Haskell, type based reflection, quasiquoting 在python里面
: 是咋做的。

avatar
e*o
91
我开始看的时候也没懂pattern matching。
-----------
我也秀几个fibs,从长到短。
@fibs1 := 1, 1, -> $a, $b { $a + $b } ... * ;
@fibs2 := 1, 1, {$^a + $^b } ... * ;
@fibs3 := 1, 1, * + * ... * ;
@fibs4 := 1, 1, &[+] ... * ;
这就是臭名昭著的perl6。
perl6 也支持pattern matching的。

【在 E*****m 的大作中提到】
: 他是信耶穌的, 凡事講信仰,不講證據。
avatar
t*s
92
sum [] = 0
sum x:xs = x + sum xs
我说的就是这种,这类型的在python/c/java里面就是if if 的事情
if 还不光看pattern, value也能一并看了。
fibs :: [Integer]
fibs = 1:1:zipwith (+) fibs (tail fibs)
python里面yield from, yield来构建generator也很方便,例如
def fibs():
a,b=1,1
yield from (a,b)
while True:
a,b=b,a+b
yield b
guard我去看了一下,这也叫feature? 难怪我不记得。就是switch case case

【在 E*****m 的大作中提到】
: 他是信耶穌的, 凡事講信仰,不講證據。
avatar
g*r
93
Functional Language都出来40年了,很多概念模式被其他语言也吸收了不少,比如JS
和C#里就有大量Functional的feature和用法,估计Python里应该也有不少吧
imperative语言的特点就是你告诉计算机怎么去做一件事,if..else就是告诉计算机先
比较这俩数,如果true就干这个事;functional的特点就是只告诉计算机要完成的任务
是啥,pattern matching就是定义一个函数,然后计算机来帮你分析执行;我感觉
functional的写法还是更high level、更简洁一点,当然区别可能也没那么大,所以很
多人觉得这是脱裤子放屁
要说实现都能实现,有啥不能实现的,用汇编也就是几个CMP,JNE
说来也就是你喜欢那种,那个效率高,对于某些特定的问题哪个更有优势。通用语言肯
定还是用得最广的,但通用语言也是不断的在加入Functional Programming的概念,以
后我觉得也是multi paradigm语言的有点前途,比如F#和Scala这种,纯粹的
Functional Language比如haskell,我觉得很难在工业界流行开来,当然作为业余爱好
,搞点小东西,作为学习研究对象还是有价值的

【在 t*s 的大作中提到】
: sum [] = 0
: sum x:xs = x + sum xs
: 我说的就是这种,这类型的在python/c/java里面就是if if 的事情
: if 还不光看pattern, value也能一并看了。
: fibs :: [Integer]
: fibs = 1:1:zipwith (+) fibs (tail fibs)
: python里面yield from, yield来构建generator也很方便,例如
: def fibs():
: a,b=1,1
: yield from (a,b)

avatar
E*m
94

沒什麼是 Python (或任何 TM-complete 語言) 一定做不到的,差別
就是簡潔易懂否, 你那個 fibs 例子就長了幾倍,不是嗎?
還有個 laziness 的例子 python 更難做的, 用 sieve 來求質數
primesT = sieve [2..] where
sieve (p:xs) = p : sieve [x | x 然後求前 100 個質數就是
take 100 primesT
當然, 我不否認不是所有東西都需要 laziness,只是有時 laziness
會讓題目比較好解。

【在 t*s 的大作中提到】
: sum [] = 0
: sum x:xs = x + sum xs
: 我说的就是这种,这类型的在python/c/java里面就是if if 的事情
: if 还不光看pattern, value也能一并看了。
: fibs :: [Integer]
: fibs = 1:1:zipwith (+) fibs (tail fibs)
: python里面yield from, yield来构建generator也很方便,例如
: def fibs():
: a,b=1,1
: yield from (a,b)

avatar
w*w
95
给个简单例子:
20年前,你写了个复杂的SQL query,在当时的sql server上要运行2个月。现在同样的
query用不同的硬件和database engine,两秒钟就出来了。FP只告诉计算机要什么,至
于怎么做就不管了。系统软件硬件发展越快,FP的优势就会越来越明显。
avatar
p*2
96

JS
大牛说的很好。

【在 g****r 的大作中提到】
: Functional Language都出来40年了,很多概念模式被其他语言也吸收了不少,比如JS
: 和C#里就有大量Functional的feature和用法,估计Python里应该也有不少吧
: imperative语言的特点就是你告诉计算机怎么去做一件事,if..else就是告诉计算机先
: 比较这俩数,如果true就干这个事;functional的特点就是只告诉计算机要完成的任务
: 是啥,pattern matching就是定义一个函数,然后计算机来帮你分析执行;我感觉
: functional的写法还是更high level、更简洁一点,当然区别可能也没那么大,所以很
: 多人觉得这是脱裤子放屁
: 要说实现都能实现,有啥不能实现的,用汇编也就是几个CMP,JNE
: 说来也就是你喜欢那种,那个效率高,对于某些特定的问题哪个更有优势。通用语言肯
: 定还是用得最广的,但通用语言也是不断的在加入Functional Programming的概念,以

avatar
l*s
97
enlightening

JS

【在 g****r 的大作中提到】
: Functional Language都出来40年了,很多概念模式被其他语言也吸收了不少,比如JS
: 和C#里就有大量Functional的feature和用法,估计Python里应该也有不少吧
: imperative语言的特点就是你告诉计算机怎么去做一件事,if..else就是告诉计算机先
: 比较这俩数,如果true就干这个事;functional的特点就是只告诉计算机要完成的任务
: 是啥,pattern matching就是定义一个函数,然后计算机来帮你分析执行;我感觉
: functional的写法还是更high level、更简洁一点,当然区别可能也没那么大,所以很
: 多人觉得这是脱裤子放屁
: 要说实现都能实现,有啥不能实现的,用汇编也就是几个CMP,JNE
: 说来也就是你喜欢那种,那个效率高,对于某些特定的问题哪个更有优势。通用语言肯
: 定还是用得最广的,但通用语言也是不断的在加入Functional Programming的概念,以

avatar
c*n
98
I think a big problem with the FP camp is that they keep peddling the old
stuff, which, as you said, may be brilliant in the 60's, but are so common
today that the listener find it hard to understand why the FP enthusiasts
say it's a big deal.
FP camp should look at the world today and sell the true deltas above other
languages.

JS

【在 g****r 的大作中提到】
: Functional Language都出来40年了,很多概念模式被其他语言也吸收了不少,比如JS
: 和C#里就有大量Functional的feature和用法,估计Python里应该也有不少吧
: imperative语言的特点就是你告诉计算机怎么去做一件事,if..else就是告诉计算机先
: 比较这俩数,如果true就干这个事;functional的特点就是只告诉计算机要完成的任务
: 是啥,pattern matching就是定义一个函数,然后计算机来帮你分析执行;我感觉
: functional的写法还是更high level、更简洁一点,当然区别可能也没那么大,所以很
: 多人觉得这是脱裤子放屁
: 要说实现都能实现,有啥不能实现的,用汇编也就是几个CMP,JNE
: 说来也就是你喜欢那种,那个效率高,对于某些特定的问题哪个更有优势。通用语言肯
: 定还是用得最广的,但通用语言也是不断的在加入Functional Programming的概念,以

avatar
t*a
99
你能否说具体一点?比如哪些是old stuff,brilliant in the 60's但是今天so
common?如果你说的是你原文中给出的那些材料,那么这些回帖里面已经说的很清楚了
:今天的language并没有完全实现那些feature。
另外,FP中有趣的概念很多,不仅仅是你的帖子中说到的那些。

other

【在 c******n 的大作中提到】
: I think a big problem with the FP camp is that they keep peddling the old
: stuff, which, as you said, may be brilliant in the 60's, but are so common
: today that the listener find it hard to understand why the FP enthusiasts
: say it's a big deal.
: FP camp should look at the world today and sell the true deltas above other
: languages.
:
: JS

avatar
t*a
100
市场上可用的语言越来越多是不争的事实。通用语言可以保证容易找到饭碗,专用语言
在专有领域具有优势。
另外FP和Imperative语言的差别..个人觉得还是蛮大的,最主要的是会改变程序员思考
问题的方式。
如果哪个程序员说他很随意的在纯FP语言和纯Imperative语言之间转换思维,从而总是
能在合适的地方用最适合的方式,那倒真是令人佩服。

JS

【在 g****r 的大作中提到】
: Functional Language都出来40年了,很多概念模式被其他语言也吸收了不少,比如JS
: 和C#里就有大量Functional的feature和用法,估计Python里应该也有不少吧
: imperative语言的特点就是你告诉计算机怎么去做一件事,if..else就是告诉计算机先
: 比较这俩数,如果true就干这个事;functional的特点就是只告诉计算机要完成的任务
: 是啥,pattern matching就是定义一个函数,然后计算机来帮你分析执行;我感觉
: functional的写法还是更high level、更简洁一点,当然区别可能也没那么大,所以很
: 多人觉得这是脱裤子放屁
: 要说实现都能实现,有啥不能实现的,用汇编也就是几个CMP,JNE
: 说来也就是你喜欢那种,那个效率高,对于某些特定的问题哪个更有优势。通用语言肯
: 定还是用得最广的,但通用语言也是不断的在加入Functional Programming的概念,以

avatar
g*g
101
说Java慢看跟什么比,跟C比自然是慢的。我见过的benchmark,都比Scala快一点。

is

【在 s***o 的大作中提到】
: 刚跟stackoverflow上的“专家”交流了一下关于Java8跟Scala,专家坚持认为java is
: slow, slow, slow...
: "chat with an expert" 是stackoverflow 今天推出来的一个新服务,有兴趣的可以去
: 试一试

avatar
s*o
102
that's a stackoverflow "new feature" available on April 1 :)
不过我的确是去看java 8对scala能造成啥影响的话题的。好虫说一下,scala还有没有
成为主流的可能,或者一直这么不温不火下去?

【在 g*****g 的大作中提到】
: 说Java慢看跟什么比,跟C比自然是慢的。我见过的benchmark,都比Scala快一点。
:
: is

avatar
x*u
103
你这就不是扯淡,是发paper。

【在 L***n 的大作中提到】
: 那位就是灌水扯淡的
avatar
a*e
104
你有这样的感觉没错,Python 的这些概念都来源于 FP,事实上,从 Lisp 引入 GC 开
始,非常多的 FP 的特征,已经越来越普遍地进入到其它非 FP 的语言。
我想你要问的是,既然这样,为什么要学习 Haskell 或者 FP?
我给几个 Haskell 有,但是你在 python 里面学不到的东西吧:
1. Strong type system
duck typing 看似更灵活,但是实际上它只是一个 sum of all types,没办法保证
type safty。有时候更 general 不是好事情,反而是有限制,尤其是编译器能够通过
静态检查就能确保程序遵守了这些限制,更有益处。举个例子,很多语言都有 SQL 的
库可用,但有几个能够静态检查,确保所有发出的 SQL 查询都是合法的?再比如,一
个程序需要处理平衡二叉树,你能够通过静态检查就确保不会发生不平衡的情况出现吗
?这些只有强类型的 abstract datatype 才能做到。
如果你要进一步学习 type system,那么 LYAH 这本书是不够的,需要看一些程序语言
的教科书。
2. Monad
首先,这个概念本身是超出计算机语言的,无论你用那种方式写程序,只要有满足
monad 的结构,它就在那里,无非是作为一个程序员,你是否意识到了,意识到之后是
否能够利用 monad 的特征来完成想要完成的任务。
Monad 最先用于编程就是在 Haskell 里,这不是一个巧合。只有 Haskell 如此偏执地
追求无副作用操作,才有 Monad,以及更多 category 理论概念存在的土壤。
到底 Monad 有什么用?我举个例子。如果你学习一下 CPS Monad,然后实现一个 co-
routine 到 event loop 的变换,就能够了解由 Node.js 引发的 async 编程潮流,只
是一个浮夸的假象。在 Haskell 里面,根本无需语言本身支持,直接能够写出 co-
routine 程序,以 async 方式执行。
3. Fusion
这个牵涉到编译器的技术,可能不是所有人感兴趣。不过那些认为高级语言,或者是抽
象层高的编程方式,肯定是没有效率的说法,可以休矣。
举个我今天遇到的例子,一个 image convolution 的 Haskell 程序,居然把 memory
bandwidth 耗尽,比 C 程序快了近十倍,然后 4 thread 和 1 thread 执行起来时间
是一样的,完全没有道理,让我同事很伤脑筋。后来经过分析机器码发现,是因为源程
序里用来测试的 image 也是写在程序里通过一个函数生成的,编译器居然把所有的计
算(从 src image 读入数据,计算,写入 dst image)化简为直接向 dst image 写入
constant。
虽然是个极端的例子,但是这种对源程序进行推理,利用代数性质做等效变换,最后能
够生成非常高效代码的方式,只有在纯 FP 语言里才有可能做到。
当然反过来说,认为 FP 的效率已经比 C 好了,也是没有什么道理的。但一个不争的
事实是,符合高层次逻辑的程序更容易写,更容易维护,而另一方面 CPU 的发展导致
只有紧贴机器层面才能够高效发挥硬件潜力。这两者之间的 gap 越来越大,而 FP 的
理论可以把人从 SIMD/Cache Miss/Multi-Core 等等调优的繁琐过程中解放出来,从而
维持原代码的模块和逻辑清晰。
4. DSL
这个是我喜欢 Haskell 的主要原因。没有任何一个语言能够像 Haskell 这样灵活
地实现 DSL/eDSL,对程序做分析,重组,解释甚至和元语言一块儿编译执行。因为
DSL 本身是直接以 combinator 或者 monad 方式写在 Haskell 程序里面的,
无须另外做 lexer/parser,连类型检查都是免费得来。
Haskell 的类型系统在这里帮了很多忙,它的 type class 让很多繁复的 AST
操作变得非常模块化,对副作用的严格控制也让 DSL 更加安全可靠。所以
Simon PJ 说 Haskell is the best imperative programming language
不是没有道理的。

annotated

【在 t*s 的大作中提到】
: 最近在学Haskell
: 看learn yourself a haskell七八章了。到现在为止没看到Python没有的feature.
: Python里面partial, list comprehension, map, reduce, filter都有
: 什么Eq Ord Show这种Python也有,例如, 一个类如果定义了 __lt__ 等等就能比较
: 所谓Monad也是故弄玄虚,我专门去看了Philp Wadler (principle designer of
: Haskell)的Monads for functional programming。Monad两个字就能解释: annotated
: data. 顶多把那三个laws再加上。
: Maybe有点意思,但imperative的Exceptional Handling更方便,更有效率。
: 最不爽的是Haskell readability sucks。
: 唯一Haskell比Python舒服的地方我觉得是函数定义强制

avatar
r*n
105
我觉得尾递归还不如上loop。

【在 p*****2 的大作中提到】
: 一个最基本的尾递归就把python秒了吧
:
: annotated

avatar
p*2
106

一个东西

【在 r*******n 的大作中提到】
: 我觉得尾递归还不如上loop。
avatar
f*o
107
google trampoline

【在 p*****2 的大作中提到】
:
: 一个东西

avatar
n*w
108
这里常有人用“x能做到的y也能做到为自己辩护”。所有图灵完备的语言都可以做到相
同的事情。不同的是语义,表达能力,等方面的差异。

【在 E*****m 的大作中提到】
:
: 沒什麼是 Python (或任何 TM-complete 語言) 一定做不到的,差別
: 就是簡潔易懂否, 你那個 fibs 例子就長了幾倍,不是嗎?
: 還有個 laziness 的例子 python 更難做的, 用 sieve 來求質數
: primesT = sieve [2..] where
: sieve (p:xs) = p : sieve [x | x : 然後求前 100 個質數就是
: take 100 primesT
: 當然, 我不否認不是所有東西都需要 laziness,只是有時 laziness
: 會讓題目比較好解。

avatar
g*g
109
看你怎么定义主流,到今天ruby的流行程度是很有可能的,超越java是没有可能的。

【在 s***o 的大作中提到】
: that's a stackoverflow "new feature" available on April 1 :)
: 不过我的确是去看java 8对scala能造成啥影响的话题的。好虫说一下,scala还有没有
: 成为主流的可能,或者一直这么不温不火下去?

avatar
x*o
110
写的真不错

【在 a*****e 的大作中提到】
: 你有这样的感觉没错,Python 的这些概念都来源于 FP,事实上,从 Lisp 引入 GC 开
: 始,非常多的 FP 的特征,已经越来越普遍地进入到其它非 FP 的语言。
: 我想你要问的是,既然这样,为什么要学习 Haskell 或者 FP?
: 我给几个 Haskell 有,但是你在 python 里面学不到的东西吧:
: 1. Strong type system
: duck typing 看似更灵活,但是实际上它只是一个 sum of all types,没办法保证
: type safty。有时候更 general 不是好事情,反而是有限制,尤其是编译器能够通过
: 静态检查就能确保程序遵守了这些限制,更有益处。举个例子,很多语言都有 SQL 的
: 库可用,但有几个能够静态检查,确保所有发出的 SQL 查询都是合法的?再比如,一
: 个程序需要处理平衡二叉树,你能够通过静态检查就确保不会发生不平衡的情况出现吗

avatar
t*s
111
干straw man有意思么?
我的意思就是相对于其他语言(例如Python),Haskell卖点不足, 绝大多数程序员没理
由去学Haskell。
fp的卖点有些什么? pure function, curry, laziness, 常见工具list
comprehension, map, reduce, filter。 这些python都支持。
同时,Haskell有致命的缺点,因为有些算法本身就不适合FP。
遇到适合fp的问题, python程序员也可以写fp风格的code。遇到不适合fp的问题,
Haskell程序员就要头大了。
作为一个Haskell没入门的,我只能说到目前为止, Haskell吸引我的是三点
1 编译语言做科学计算快
2 作为数学出身,Haskell看起来美
3 Haskell的type system很好
Haskell community关键是没有一个好tutorial. 至少我没找到。
learn your a haskell是很烂的tutorial
我review这个tutorial的话我会提如下意见
1. 重点介绍独特的feature, 重点讲motivation
2. remove all unnecessary details, or move ot the reference -- 为什么第二章
就讲一大堆list的库函数?
教c语言的会开篇就把strings.h里面的函数一一列举的么?

【在 n*w 的大作中提到】
: 这里常有人用“x能做到的y也能做到为自己辩护”。所有图灵完备的语言都可以做到相
: 同的事情。不同的是语义,表达能力,等方面的差异。

avatar
E*m
112
我認為 Haskell 的最大賣點應該是不讓你做某些事, 強迫你別弄出
不該有的錯誤。
再說一次, Python 的 laziness 不是同個等級的, 完全不能比。
Haskell 的速度也比 Python 快得多。
Real World Haskell 比 Learn yourself a Haskell 更好點。

【在 t*s 的大作中提到】
: 干straw man有意思么?
: 我的意思就是相对于其他语言(例如Python),Haskell卖点不足, 绝大多数程序员没理
: 由去学Haskell。
: fp的卖点有些什么? pure function, curry, laziness, 常见工具list
: comprehension, map, reduce, filter。 这些python都支持。
: 同时,Haskell有致命的缺点,因为有些算法本身就不适合FP。
: 遇到适合fp的问题, python程序员也可以写fp风格的code。遇到不适合fp的问题,
: Haskell程序员就要头大了。
: 作为一个Haskell没入门的,我只能说到目前为止, Haskell吸引我的是三点
: 1 编译语言做科学计算快

avatar
p*2
113

Haskell不行,不代表FP不行呀。上边不是已经说了吗,python吸收了大量FP的feature
。FP的很多feature还是很有用的,不然Python吸收干嘛?当然了,我也认为混合型的
语言更现实,比如python,ruby,scala这些。

【在 t*s 的大作中提到】
: 干straw man有意思么?
: 我的意思就是相对于其他语言(例如Python),Haskell卖点不足, 绝大多数程序员没理
: 由去学Haskell。
: fp的卖点有些什么? pure function, curry, laziness, 常见工具list
: comprehension, map, reduce, filter。 这些python都支持。
: 同时,Haskell有致命的缺点,因为有些算法本身就不适合FP。
: 遇到适合fp的问题, python程序员也可以写fp风格的code。遇到不适合fp的问题,
: Haskell程序员就要头大了。
: 作为一个Haskell没入门的,我只能说到目前为止, Haskell吸引我的是三点
: 1 编译语言做科学计算快

avatar
L*n
114
做科学计算的用haskell需要很大勇气...

【在 t*s 的大作中提到】
: 干straw man有意思么?
: 我的意思就是相对于其他语言(例如Python),Haskell卖点不足, 绝大多数程序员没理
: 由去学Haskell。
: fp的卖点有些什么? pure function, curry, laziness, 常见工具list
: comprehension, map, reduce, filter。 这些python都支持。
: 同时,Haskell有致命的缺点,因为有些算法本身就不适合FP。
: 遇到适合fp的问题, python程序员也可以写fp风格的code。遇到不适合fp的问题,
: Haskell程序员就要头大了。
: 作为一个Haskell没入门的,我只能说到目前为止, Haskell吸引我的是三点
: 1 编译语言做科学计算快

avatar
E*m
115

除了做練習以外, 用 Haskell 都需要勇氣。

【在 L***n 的大作中提到】
: 做科学计算的用haskell需要很大勇气...
avatar
m*t
116
我怎么听起来觉得你在举反例呢。。。。这个 case 里面编译器干的是多余(可能不安
全)的事情吧。
“编译器居然把所有的计
算(从 src image 读入数据,计算,写入 dst image)化简为直接向 dst image 写入
constant。

最终程序得到想要的结果呢还是不是?你觉得这个是好事?

3. Fusion
这个牵涉到编译器的技术,可能不是所有人感兴趣。不过那些认为高级语言,或者是抽
象层高的编程方式,肯定是没有效率的说法,可以休矣。
举个我今天遇到的例子,一个 image convolution 的 Haskell 程序,居然把 memory
bandwidth 耗尽,比 C 程序快了近十倍,然后 4 thread 和 1 thread 执行起来时间
是一样的,完全没有道理,让我同事很伤脑筋。后来经过分析机器码发现,是因为源程
序里用来测试的 image 也是写在程序里通过一个函数生成的,编译器居然把所有的计
算(从 src image 读入数据,计算,写入 dst image)化简为直接向 dst image 写入
constant。
虽然是个极端的例子,但是这种对源程序进行推理,利用代数性质做等效变换,最后能
够生成非常高效代码的方式,只有在纯 FP 语言里才有可能做到。
当然反过来说,认为 FP 的效率已经比 C 好了,也是没有什么道理的。但一个不争的
事实是,符合高层次逻辑的程序更容易写,更容易维护,而另一方面 CPU 的发展导致
只有紧贴机器层面才能够高效发挥硬件潜力。这两者之间的 gap 越来越大,而 FP 的
理论可以把人从 SIMD/Cache Miss/Multi-Core 等等调优的繁琐过程中解放出来,从而
维持原代码的模块和逻辑清晰。

【在 a*****e 的大作中提到】
: 你有这样的感觉没错,Python 的这些概念都来源于 FP,事实上,从 Lisp 引入 GC 开
: 始,非常多的 FP 的特征,已经越来越普遍地进入到其它非 FP 的语言。
: 我想你要问的是,既然这样,为什么要学习 Haskell 或者 FP?
: 我给几个 Haskell 有,但是你在 python 里面学不到的东西吧:
: 1. Strong type system
: duck typing 看似更灵活,但是实际上它只是一个 sum of all types,没办法保证
: type safty。有时候更 general 不是好事情,反而是有限制,尤其是编译器能够通过
: 静态检查就能确保程序遵守了这些限制,更有益处。举个例子,很多语言都有 SQL 的
: 库可用,但有几个能够静态检查,确保所有发出的 SQL 查询都是合法的?再比如,一
: 个程序需要处理平衡二叉树,你能够通过静态检查就确保不会发生不平衡的情况出现吗

avatar
a*e
117
运行结果完全正确,程序没有任何问题,编译器进行这种程度的优化都是基于数理逻辑
的推断,确保安全。
唯一的问题是运行时间不符合事先的期望,没想到会 saturate memory bandwidth。后
来发现是因为用于测试的 src image 写在了程序里,如果从文件读取,则编译器不会
把这部分也优化掉。

【在 m*********t 的大作中提到】
: 我怎么听起来觉得你在举反例呢。。。。这个 case 里面编译器干的是多余(可能不安
: 全)的事情吧。
: “编译器居然把所有的计
: 算(从 src image 读入数据,计算,写入 dst image)化简为直接向 dst image 写入
: constant。
: ”
: 最终程序得到想要的结果呢还是不是?你觉得这个是好事?
:
: 3. Fusion
: 这个牵涉到编译器的技术,可能不是所有人感兴趣。不过那些认为高级语言,或者是抽

avatar
m*t
118
其实你们应该多说说:什么样的问题用 FP 来解决很合适,和 OOP 比较呢?。内核以
及嵌入式? 前端? game?数据分析?复杂的并行和需要大量内存的科学计算? 我看
到一些 haskell 的例子内存占用似乎比 C 要多好几倍(是不是 immutable 的原因?
),这样对于 memory bandwidth limit
的计算程序怎么弄?
还有说说这东西在大规模开发的时候代码可读性和可维护性?

【在 a*****e 的大作中提到】
: 运行结果完全正确,程序没有任何问题,编译器进行这种程度的优化都是基于数理逻辑
: 的推断,确保安全。
: 唯一的问题是运行时间不符合事先的期望,没想到会 saturate memory bandwidth。后
: 来发现是因为用于测试的 src image 写在了程序里,如果从文件读取,则编译器不会
: 把这部分也优化掉。

avatar
g*g
119
Actor model在Erlang上的使用,是我知道的唯一有说服力的例子。Scala火起来同样也
是因为Actor model的实现(Akka)。除此之外,FP基本上都用在语言相关的领域。

【在 m*********t 的大作中提到】
: 其实你们应该多说说:什么样的问题用 FP 来解决很合适,和 OOP 比较呢?。内核以
: 及嵌入式? 前端? game?数据分析?复杂的并行和需要大量内存的科学计算? 我看
: 到一些 haskell 的例子内存占用似乎比 C 要多好几倍(是不是 immutable 的原因?
: ),这样对于 memory bandwidth limit
: 的计算程序怎么弄?
: 还有说说这东西在大规模开发的时候代码可读性和可维护性?

avatar
E*m
120

隨便舉兩個商用例子, ITA 和 Jane Street 都不是處理語言的。

【在 g*****g 的大作中提到】
: Actor model在Erlang上的使用,是我知道的唯一有说服力的例子。Scala火起来同样也
: 是因为Actor model的实现(Akka)。除此之外,FP基本上都用在语言相关的领域。

avatar
g*g
121
They are not exactly industry-leading companies or applications. ITA was
acquired for 700 Million, PCLN is worth 35 Billion. Jane Street has 280
employees. GS has 30K. Just some perspectives to look at.

【在 E*****m 的大作中提到】
:
: 隨便舉兩個商用例子, ITA 和 Jane Street 都不是處理語言的。

avatar
E*m
122

You forgot what you claimed?
So, which industry leader use FP for language?
I never said FP is already very successful in industry.

【在 g*****g 的大作中提到】
: They are not exactly industry-leading companies or applications. ITA was
: acquired for 700 Million, PCLN is worth 35 Billion. Jane Street has 280
: employees. GS has 30K. Just some perspectives to look at.

avatar
g*g
123
Erlang's usage in Ericsson is an industry leading example. It's high
availability is hard to achieve with other languages. I stress industry
leading because that's only way to convince adoption.

【在 E*****m 的大作中提到】
:
: You forgot what you claimed?
: So, which industry leader use FP for language?
: I never said FP is already very successful in industry.

avatar
E*m
124
Obviously, it's not the only way. Otherwise, how did Java come along?

【在 g*****g 的大作中提到】
: Erlang's usage in Ericsson is an industry leading example. It's high
: availability is hard to achieve with other languages. I stress industry
: leading because that's only way to convince adoption.

avatar
g*g
125
So you don't know nothing about history. Java came along as the industry
leading enterprise application language on server side. C++ was the primary
contest at the time, but it's quickly overcame by Java's reliability and
fast time-to-market.

【在 E*****m 的大作中提到】
: Obviously, it's not the only way. Otherwise, how did Java come along?
avatar
E*m
126

primary
I started programming Java sometime in '96 or so. I know it quite well.
And you forgot your claim again. What convinced the first industry leader
to use Java?

【在 g*****g 的大作中提到】
: So you don't know nothing about history. Java came along as the industry
: leading enterprise application language on server side. C++ was the primary
: contest at the time, but it's quickly overcame by Java's reliability and
: fast time-to-market.

avatar
g*g
127
Everything starts as an experiment. But it didn't take long before Java
dominated in the enterprise market. Java was released in 1995. J2EE 1.2 spec
was out in 1999 and I used that for websites in 2000. Your hello world
experience in school doesn't count.
In comparison, which FP today is a Spring chicken?

【在 E*****m 的大作中提到】
:
: primary
: I started programming Java sometime in '96 or so. I know it quite well.
: And you forgot your claim again. What convinced the first industry leader
: to use Java?

avatar
E*m
128

spec
Thank you for your wrong speculation. I wrote my thesis work in Java, which
is a little bit more than hello world.
So, what convinced the first industry leader to use Java?
I'd say Scala is promising. But I am not a coder, I don't need to bet on it.

【在 g*****g 的大作中提到】
: Everything starts as an experiment. But it didn't take long before Java
: dominated in the enterprise market. Java was released in 1995. J2EE 1.2 spec
: was out in 1999 and I used that for websites in 2000. Your hello world
: experience in school doesn't count.
: In comparison, which FP today is a Spring chicken?

avatar
g*g
129
Your thesis, LOL. Wonder what's the usage of your thesis in industry? Sorry,
does it hurt to talk about reality?
Sun invented Java. Obviously they had interests in Java, much like M$ on .
Net. Sun happened to be an industry leader in enterprise space at that time.
In fact, IBM joined the force in no time and M$ wanted to adopt it too with
their own variation. The rest is history.

which
it.

【在 E*****m 的大作中提到】
:
: spec
: Thank you for your wrong speculation. I wrote my thesis work in Java, which
: is a little bit more than hello world.
: So, what convinced the first industry leader to use Java?
: I'd say Scala is promising. But I am not a coder, I don't need to bet on it.

avatar
g*g
130
I worked on Scala for 2 years, long before you exist here. And I am talking
about industry projects.
Scala got hot due to Akka, which is a good and bad thing. On one hand, it's
promising like how Erlang was proven in telecom industry. On the other hand,
the majority of applications don't need Akka, which makes Scala less
attractive as a general purpose language.

which
it.

【在 E*****m 的大作中提到】
:
: spec
: Thank you for your wrong speculation. I wrote my thesis work in Java, which
: is a little bit more than hello world.
: So, what convinced the first industry leader to use Java?
: I'd say Scala is promising. But I am not a coder, I don't need to bet on it.

avatar
E*m
131

Sorry,
It's funny that you can never remember what we are discussing.
time.
with
So, you are saying it's possible to use a new language when there are no
other
industry leader using it. Right?

【在 g*****g 的大作中提到】
: Your thesis, LOL. Wonder what's the usage of your thesis in industry? Sorry,
: does it hurt to talk about reality?
: Sun invented Java. Obviously they had interests in Java, much like M$ on .
: Net. Sun happened to be an industry leader in enterprise space at that time.
: In fact, IBM joined the force in no time and M$ wanted to adopt it too with
: their own variation. The rest is history.
:
: which
: it.

avatar
g*g
132
You can always use a new or old language in a new or old area. And there's
always a chance of success. It's only that I wouldn't claim their
superiority before their success. Let the reality do the talk, that's my
stance.

【在 E*****m 的大作中提到】
:
: Sorry,
: It's funny that you can never remember what we are discussing.
: time.
: with
: So, you are saying it's possible to use a new language when there are no
: other
: industry leader using it. Right?

avatar
a*e
133
如果你要问我,我会说几乎没有什么是 FP 不适合的,就连内核以及嵌入式,FPGA 等
都有 FP 的解决方案。
这里我并不是说内核或者嵌入设备去跑 FP 语言的 runtime,而是说用 FP 的工具设计
的 DSL 跑在内核和嵌入设备上。比如你可以搜一下 se4L,它的一个实现是用 Haskell
写的,被用于证明所生成的内核的正确性。
I'm a big believer in DSL. 合理设计的 DSL 能够快速完成目标 domain 的编程要求
,所需要的只是一个有效的 DSL 开发环境,FP 在这方面非常适合。就象是一套合理设
计的库函数或者框架什么的,能够大幅度提高开发效率。但是库函数的组合调用通常都
是写在源程序里,写好就不可以改动。而 DSL 则是它本身可以被分析重组,写好之后
,还可以用程序处理变换,验证性质,生成高效代码等。元语言 (meta programming)
的技术目前也在抬头,但我认为还是 DSL 更灵活,因为 meta programming 所操作的
对象还是一个 general purpose 的语言所写的程序结构,很多时候我们只需要 domain
specific.
你说内存用得多,应该是 Copying GC 带来的,Java 这方面也是一样的,消耗内存总
是会比 C 多。Haskell 还有一个问题是 memory leak,这是 lazy language 的一个硬
伤。正确的程序不会有这种问题,虽然如何书写正确的 memory leak free 的 Haskell
程序有时候是一个 black art。
关于 immutable 的问题,如果你对现代的编译技术有了解,比如 SSA 什么的,就会发
现在编译局部变量时,其实 C 里面那些看起来是 mutable 的变量,都已经被转化成只
能赋值一次的虚拟寄存器了,所以是否 mutable 只影响需要共享数据的全局变量。
这方面,采取 immutable 的数据结构也会更适合 modern CPU,比如 cache-friendly
(sharing, no read/write barrier),比如 SIMD ,比如 thread 间数据的交换,可
以尽量避免 CAS 等。就连 Garbage Collection 也可以针对 cache 进行优化,而不需
要修改应用层面的东西。Scientific Computing 很多时候追求高效,结果把 C 或者
Fortran 的源程序调得乱糟糟,事后很难维护,长远来看是得不偿失的。
immutable 不占优势的一个情况,就是迅速产生大量垃圾,给 GC 造成负担过大。但这
毕竟很少见,通过 profiling 等技术也可以迅速发现问题所在,从应用层面可以调整
,比如适度允许 mutable 的结构,避免反复的 allocation。
还有一个弱点,主要是从算法层面,比如 graph 和 hashtable 的结构用 immutable
不能做,或者比较没效率。
所以 FP 也不是说拒绝 mutable,而是说如果以 immutable 为主,好处多多。

【在 m*********t 的大作中提到】
: 其实你们应该多说说:什么样的问题用 FP 来解决很合适,和 OOP 比较呢?。内核以
: 及嵌入式? 前端? game?数据分析?复杂的并行和需要大量内存的科学计算? 我看
: 到一些 haskell 的例子内存占用似乎比 C 要多好几倍(是不是 immutable 的原因?
: ),这样对于 memory bandwidth limit
: 的计算程序怎么弄?
: 还有说说这东西在大规模开发的时候代码可读性和可维护性?

avatar
d*i
134
你说的FPGA都有FP的解决方案我倒是闻所未闻,FPGA一般用Verilog或者VHDL, 或者
SystemC,都是工业界的标准。

等都有 FP 的解决方案。

【在 a*****e 的大作中提到】
: 如果你要问我,我会说几乎没有什么是 FP 不适合的,就连内核以及嵌入式,FPGA 等
: 都有 FP 的解决方案。
: 这里我并不是说内核或者嵌入设备去跑 FP 语言的 runtime,而是说用 FP 的工具设计
: 的 DSL 跑在内核和嵌入设备上。比如你可以搜一下 se4L,它的一个实现是用 Haskell
: 写的,被用于证明所生成的内核的正确性。
: I'm a big believer in DSL. 合理设计的 DSL 能够快速完成目标 domain 的编程要求
: ,所需要的只是一个有效的 DSL 开发环境,FP 在这方面非常适合。就象是一套合理设
: 计的库函数或者框架什么的,能够大幅度提高开发效率。但是库函数的组合调用通常都
: 是写在源程序里,写好就不可以改动。而 DSL 则是它本身可以被分析重组,写好之后
: ,还可以用程序处理变换,验证性质,生成高效代码等。元语言 (meta programming)

avatar
a*e
135
不算是业界主流,多数还是 research 性质,顺手搜一下
http://raintown.org/lava/
http://cufp.org/conference/sessions/2012/peter-braam-parallel-s
ICFP/POPL 这类的 conference 上经常有这类的,也算热点之一吧

【在 d****i 的大作中提到】
: 你说的FPGA都有FP的解决方案我倒是闻所未闻,FPGA一般用Verilog或者VHDL, 或者
: SystemC,都是工业界的标准。
:
: 等都有 FP 的解决方案。

avatar
L*n
136
比如?你所说的问题,即使存在,解决办法也应该是由专家维护高质量的库,而不是
使用DSL,在学术界,使用DSL的问题包括没有统一标准,混用DSL和已有语言C/C++
的代价,代码效率,等等,都是无法接受的。我本人倒是用过不少设计的不那么优美的
库,也试过一些DSL, 我宁愿用界面乱糟糟一些的C/C++/Fortran库,也不愿在我的代码
里用我自己都不知道怎么debug的DSL
avatar
t*n
137
这方面,采取 immutable 的数据结构也会更适合 modern CPU,比如 cache-friendly
(sharing, no read/write barrier),比如 SIMD ,比如 thread 间数据的交换,可
以尽量避免 CAS 等。就连 Garbage Collection 也可以针对 cache 进行优化,而不需
要修改应用层面的东西。Scientific Computing 很多时候追求高效,结果把 C 或者
Fortran 的源程序调得乱糟糟,事后很难维护,长远来看是得不偿失的。
真能码字。不过计算远没有你想的那么差。只有低水平的编程者,没有生来就乱的语言
。高手写的fortran,远胜入门者写的fp。

Haskell
)

【在 a*****e 的大作中提到】
: 如果你要问我,我会说几乎没有什么是 FP 不适合的,就连内核以及嵌入式,FPGA 等
: 都有 FP 的解决方案。
: 这里我并不是说内核或者嵌入设备去跑 FP 语言的 runtime,而是说用 FP 的工具设计
: 的 DSL 跑在内核和嵌入设备上。比如你可以搜一下 se4L,它的一个实现是用 Haskell
: 写的,被用于证明所生成的内核的正确性。
: I'm a big believer in DSL. 合理设计的 DSL 能够快速完成目标 domain 的编程要求
: ,所需要的只是一个有效的 DSL 开发环境,FP 在这方面非常适合。就象是一套合理设
: 计的库函数或者框架什么的,能够大幅度提高开发效率。但是库函数的组合调用通常都
: 是写在源程序里,写好就不可以改动。而 DSL 则是它本身可以被分析重组,写好之后
: ,还可以用程序处理变换,验证性质,生成高效代码等。元语言 (meta programming)

avatar
G*l
138
我最近也在做DSL,请问有什么好的讲FP实现DSL的书吗?以前用OO的语言做过,实现起
来比较麻烦。用了antlr做parser generator会好一些,但是还是挺麻烦的。

Haskell
)

【在 a*****e 的大作中提到】
: 如果你要问我,我会说几乎没有什么是 FP 不适合的,就连内核以及嵌入式,FPGA 等
: 都有 FP 的解决方案。
: 这里我并不是说内核或者嵌入设备去跑 FP 语言的 runtime,而是说用 FP 的工具设计
: 的 DSL 跑在内核和嵌入设备上。比如你可以搜一下 se4L,它的一个实现是用 Haskell
: 写的,被用于证明所生成的内核的正确性。
: I'm a big believer in DSL. 合理设计的 DSL 能够快速完成目标 domain 的编程要求
: ,所需要的只是一个有效的 DSL 开发环境,FP 在这方面非常适合。就象是一套合理设
: 计的库函数或者框架什么的,能够大幅度提高开发效率。但是库函数的组合调用通常都
: 是写在源程序里,写好就不可以改动。而 DSL 则是它本身可以被分析重组,写好之后
: ,还可以用程序处理变换,验证性质,生成高效代码等。元语言 (meta programming)

avatar
a*e
139
你说的也对,要是有方便用的,有稳定技术支持,已经被业界普遍采纳的产品就好了。
目前勉强能满足的也就是你说的这些设计上有缺陷的 C/C++/Fortran 库了。
但是 status quo 并非一成不变,没有理由不期待它朝更好的方向发展。
我谈的也都是一些 FP 的发展方向和(个人浅见)优势所在,并非都有成熟的产品。

【在 L***n 的大作中提到】
: 比如?你所说的问题,即使存在,解决办法也应该是由专家维护高质量的库,而不是
: 使用DSL,在学术界,使用DSL的问题包括没有统一标准,混用DSL和已有语言C/C++
: 的代价,代码效率,等等,都是无法接受的。我本人倒是用过不少设计的不那么优美的
: 库,也试过一些DSL, 我宁愿用界面乱糟糟一些的C/C++/Fortran库,也不愿在我的代码
: 里用我自己都不知道怎么debug的DSL

avatar
a*e
140
当然也不好一棒子全部打倒,我也就是最近接触这方面,有感而发。
为了追求效率全部改用 SIMD intrinsic 写东西,还真不是人干的事儿。

【在 t*****n 的大作中提到】
: 这方面,采取 immutable 的数据结构也会更适合 modern CPU,比如 cache-friendly
: (sharing, no read/write barrier),比如 SIMD ,比如 thread 间数据的交换,可
: 以尽量避免 CAS 等。就连 Garbage Collection 也可以针对 cache 进行优化,而不需
: 要修改应用层面的东西。Scientific Computing 很多时候追求高效,结果把 C 或者
: Fortran 的源程序调得乱糟糟,事后很难维护,长远来看是得不偿失的。
: 真能码字。不过计算远没有你想的那么差。只有低水平的编程者,没有生来就乱的语言
: 。高手写的fortran,远胜入门者写的fp。
:
: Haskell
: )

avatar
E*m
141

Sounds right to me.
But then why you have to bash those languages you don't know much?

【在 g*****g 的大作中提到】
: You can always use a new or old language in a new or old area. And there's
: always a chance of success. It's only that I wouldn't claim their
: superiority before their success. Let the reality do the talk, that's my
: stance.

avatar
g*g
142
Since when saying these languages are unproven is a bash?
In case you don't understand, all languages are unproven until proven
otherwise. FP or not.

【在 E*****m 的大作中提到】
:
: Sounds right to me.
: But then why you have to bash those languages you don't know much?

avatar
a*e
143
书这方面我也不是特别了解,都是从 conference paper 和项目代码看过来的。你可以
搜索 IFIP DSL Conference,有 proceeding 什么的。
如果你用 Haskell,基础的理论就是 Monad, Applicative Functor, Arrow 这些。更
基础的是解释器的实现,Oleg 的网站上有些 paper: http://okmij.org/ftp/tagless-final/
而且要看你想做什么,Haskell 这边 parser 类的 DSL 已经很成熟了,hackage 上很
多。电子设计和 control 方面的 DSL 也比较多,上面提到的 Lava, 还有 Atom 都是。

【在 G***l 的大作中提到】
: 我最近也在做DSL,请问有什么好的讲FP实现DSL的书吗?以前用OO的语言做过,实现起
: 来比较麻烦。用了antlr做parser generator会好一些,但是还是挺麻烦的。
:
: Haskell
: )

avatar
E*m
144

You know you said more than "unproven".

【在 g*****g 的大作中提到】
: Since when saying these languages are unproven is a bash?
: In case you don't understand, all languages are unproven until proven
: otherwise. FP or not.

avatar
g*g
145
Right, and I am just being honest. If that hurts your feeling, you are too
sensitive.

【在 E*****m 的大作中提到】
:
: You know you said more than "unproven".

avatar
m*t
146
为啥非要强调 “勉强能满足” 以及 “设计有缺陷呢” :p

【在 a*****e 的大作中提到】
: 你说的也对,要是有方便用的,有稳定技术支持,已经被业界普遍采纳的产品就好了。
: 目前勉强能满足的也就是你说的这些设计上有缺陷的 C/C++/Fortran 库了。
: 但是 status quo 并非一成不变,没有理由不期待它朝更好的方向发展。
: 我谈的也都是一些 FP 的发展方向和(个人浅见)优势所在,并非都有成熟的产品。

avatar
E*m
147

If you actually know those languages you bashed, it's a good thing.

【在 g*****g 的大作中提到】
: Right, and I am just being honest. If that hurts your feeling, you are too
: sensitive.

avatar
a*e
148
因为用起来不方便啊。脚本语言比如 python, R 之类的都能够进军这个领域不是正因
为 C/C++/Fortran 的库用起来不方便吗

【在 m*********t 的大作中提到】
: 为啥非要强调 “勉强能满足” 以及 “设计有缺陷呢” :p
avatar
G*l
149
简答来说就是做一个parser生成AST,跟相应的interpreter。比如一个basic语法的dsl
,当然我的肯定不会有一个正式的语言那么复杂。

是。

【在 a*****e 的大作中提到】
: 书这方面我也不是特别了解,都是从 conference paper 和项目代码看过来的。你可以
: 搜索 IFIP DSL Conference,有 proceeding 什么的。
: 如果你用 Haskell,基础的理论就是 Monad, Applicative Functor, Arrow 这些。更
: 基础的是解释器的实现,Oleg 的网站上有些 paper: http://okmij.org/ftp/tagless-final/
: 而且要看你想做什么,Haskell 这边 parser 类的 DSL 已经很成熟了,hackage 上很
: 多。电子设计和 control 方面的 DSL 也比较多,上面提到的 Lava, 还有 Atom 都是。

avatar
G*l
151
我想了解的就是如何用pattern matching之类的高级特性,高效的写出一个dsl。可惜
目前好像还没有这方面的书。

【在 a*****e 的大作中提到】
: BASIC 已经有了,Lennart Augustsson 写的在这儿:
: http://hackage.haskell.org/package/BASIC-0.1.5.0
: http://augustss.blogspot.com/search/label/BASIC
: 这个实现很有趣,连 syntax 都和 BASIC 非常接近,虽然是 embeded DSL,也就是说
: 直接跳过了 parser 这部分

avatar
a*e
152
如果你说的高效是指快速实现一个DSL的解释器,那么上面我给的那个blog链接是个很
好的例子。
首先,它绕过了 parser,因为程序本身虽然看起来象 BASIC,但实际上都是 Haskell
,直接代表 AST,所以省去很多前期的麻烦。这就叫做 embeded DSL。只需要定义
合适的 AST,然后对之进行 pattern match 解释执行就好了。
其次,embedded DSL 可以直接使用 host language 里面的值和函数,比如数字表达式
什么的,直接用,无须单独处理。你要做的工作可以完全放在你所定义的 DSL 的核心语
义上面。
最后,如果你追求 DSL 本身运行起来的效率,那么可以采取 finally taggless 的方
式,定义 combinator 来组建 DSL,它们本身就是 host language 里的函数,由
host language 的编译器直接编译,无须另写 AST 和解释器。我上面给的 Oleg 的链
接里有这个 paper。
所以从 embedded DSL 入手,实现一个新的 DSL 过程被大大简化,应该是相当有效率
的。
如果你不是打算用 Haskell,其它语言也可以,比如 scheme 这样的,macro 处理也相
当强大。

【在 G***l 的大作中提到】
: 我想了解的就是如何用pattern matching之类的高级特性,高效的写出一个dsl。可惜
: 目前好像还没有这方面的书。

avatar
G*l
153
这个是很好,但是好像也偶缺陷。比如我以前用Java写,用户输入是各种文本,然后在
后台程序里,我在Java里面把这些文本parse成AST并且interpret,最后得到他们的结
果,比如:
用户写的dsl是MonthDiff(Date1, Date2) + 1 > SomeValue
我读入这个文本到monthControl, 并且在inputData里放入Date1, Date2, SomeValue的
值(从数据库或者什么地方读过来的)。然后写,
//evaluate里做parsing和interpret
result = evaluate(monthControl, inputData)
if(result)
{
//do business logic
}
这样用户就可以写dsl直接控制我程序里的logic。假如改用haskell用embedded的话,
我的haskell程序没法直接调用那个dsl,除非把那个dsl写到我的source code,然后动
态编译运行,但是我不想要那样。或者可以有什么类似swig之类的东西让我动态调用
haskell code,但是我没法把inputData传过去。
。用这种embedded dsl的方式好像就不能那样做了。

Haskell
心语

【在 a*****e 的大作中提到】
: 如果你说的高效是指快速实现一个DSL的解释器,那么上面我给的那个blog链接是个很
: 好的例子。
: 首先,它绕过了 parser,因为程序本身虽然看起来象 BASIC,但实际上都是 Haskell
: ,直接代表 AST,所以省去很多前期的麻烦。这就叫做 embeded DSL。只需要定义
: 合适的 AST,然后对之进行 pattern match 解释执行就好了。
: 其次,embedded DSL 可以直接使用 host language 里面的值和函数,比如数字表达式
: 什么的,直接用,无须单独处理。你要做的工作可以完全放在你所定义的 DSL 的核心语
: 义上面。
: 最后,如果你追求 DSL 本身运行起来的效率,那么可以采取 finally taggless 的方
: 式,定义 combinator 来组建 DSL,它们本身就是 host language 里的函数,由

avatar
g*g
154
I don't need to know those languages to know how much they are being used in
the industry. Simple as that.

【在 E*****m 的大作中提到】
:
: If you actually know those languages you bashed, it's a good thing.

avatar
a*e
155
你说的这个是经典的解释器,用户并不直接接触到实际的编译器,而是通过网站或什么
别的途径输入写好的脚本,你在后台来执行它。我这样理解没错吧?
你可以分两步走,第一步,先把 DSL AST 所需要的 data type 定义出来,然后对此写
一个解释器。调试过程中,可以直接用 datatype 写 AST,省去写 parser 的麻烦。
第一步做好了,然后就可以用 haskell parsec 之类的库把程序输入的字串转换为 AST
,略为学习一下 parsec 的用法就好了,简单的 recursive descent。
做 embeded DSL 可以省去第二步,但的确,在你的情况中,还是需要一个 parser 的
部分。

【在 G***l 的大作中提到】
: 这个是很好,但是好像也偶缺陷。比如我以前用Java写,用户输入是各种文本,然后在
: 后台程序里,我在Java里面把这些文本parse成AST并且interpret,最后得到他们的结
: 果,比如:
: 用户写的dsl是MonthDiff(Date1, Date2) + 1 > SomeValue
: 我读入这个文本到monthControl, 并且在inputData里放入Date1, Date2, SomeValue的
: 值(从数据库或者什么地方读过来的)。然后写,
: //evaluate里做parsing和interpret
: result = evaluate(monthControl, inputData)
: if(result)
: {

avatar
d*i
156
我看到 functional programming 好处。
* immutable. 这点在并行运算中力量很大. 试想如果保证所有的arguments 都没有
state change那传统一以上的locking, synchronization就不存在了或没必要了。 大
大提高了程序可读性和可维护性。
* First class/Hight order functions. function 可以作为argument。 好处是大大
提高function 的易重用行和简便性。
* Syntax 简单。 上边讲过AST, Java 有很多事先制定 好的keyword match 到AST。
不过clojure 自己就是一个AST, 程序员可以自己定制macros, 所以程序syntax 很简
单又很flexible. 学一种语言不用象Java 那样去记它特定的语法。
由于强调 immutable , no state. FP 在现实production中多用于后台数据处理。 现
在在Big data 里很吃香。 但是有些时候是不可能完全no state, 比如你的程序调用
3rd party web service, 你就得持有一个state 去调用它, 在这个层级上
imperative
programming 就比较好一些。
avatar
E*m
157

in
So, after 10 years, you regress from a visionary who can predict Java's
success to
a trend follower.

【在 g*****g 的大作中提到】
: I don't need to know those languages to know how much they are being used in
: the industry. Simple as that.

avatar
m*t
158
What about memory bandwith limit if you use all pure immutable objects? e.g.
I have a parallel gpu program that read + write 200 GB/s on the GDDR5 RAM.

【在 d*******i 的大作中提到】
: 我看到 functional programming 好处。
: * immutable. 这点在并行运算中力量很大. 试想如果保证所有的arguments 都没有
: state change那传统一以上的locking, synchronization就不存在了或没必要了。 大
: 大提高了程序可读性和可维护性。
: * First class/Hight order functions. function 可以作为argument。 好处是大大
: 提高function 的易重用行和简便性。
: * Syntax 简单。 上边讲过AST, Java 有很多事先制定 好的keyword match 到AST。
: 不过clojure 自己就是一个AST, 程序员可以自己定制macros, 所以程序syntax 很简
: 单又很flexible. 学一种语言不用象Java 那样去记它特定的语法。
: 由于强调 immutable , no state. FP 在现实production中多用于后台数据处理。 现

avatar
g*g
159
I am not being stubborn. I am being consistent. I saw Java succeeded 10
years ago the same reasons I don't see FP languages succeed today.
I have mentioned these reasons in many posts, for a language to be adopted
by massive as a general purpose language, it should be/have
1. Easy to learn, easy to use, easy to maintain
2. Big or quickly growing community
3. Killer framework or application
4. Adequate libraries
5. Company backing
Now Scala is the only FP language I know that has 2/3/4/5, that's one of the
reasons why I picked it up and used it for 2 years. Then I realize 1 is a
very big hurdle in a team setup with a big project, which can still be
overcame in a top notch company with top talents but the growth is hindered
nonetheless.
Other FP languages don't even come close. And none of them ever achieve 1.
Now maybe in the future there'll be new languages change all these. But I
can say for sure all well-known FP languages don't. For that reason they'll
remain niche languages. The best they can be is like javascript/Objective C
that excels in a specialized domain.

【在 E*****m 的大作中提到】
:
: in
: So, after 10 years, you regress from a visionary who can predict Java's
: success to
: a trend follower.

avatar
d*x
160
人总是在遇到问题的时候才想起来前人总结的经验。。。
编译原理一上来就说了语言的第一大concern就是learning cost...

the

【在 g*****g 的大作中提到】
: I am not being stubborn. I am being consistent. I saw Java succeeded 10
: years ago the same reasons I don't see FP languages succeed today.
: I have mentioned these reasons in many posts, for a language to be adopted
: by massive as a general purpose language, it should be/have
: 1. Easy to learn, easy to use, easy to maintain
: 2. Big or quickly growing community
: 3. Killer framework or application
: 4. Adequate libraries
: 5. Company backing
: Now Scala is the only FP language I know that has 2/3/4/5, that's one of the

avatar
E*m
161
I think you really need to put a quantifier "For enterprise software"
for almost everything you said.
In your 5 criteria, only (1) is forward looking. Others are just saying
"I follow the crowd", which is not really a bad thing, for a trend follower.
I guess people who create killer frameworks and libraries might
think differently.

the

【在 g*****g 的大作中提到】
: I am not being stubborn. I am being consistent. I saw Java succeeded 10
: years ago the same reasons I don't see FP languages succeed today.
: I have mentioned these reasons in many posts, for a language to be adopted
: by massive as a general purpose language, it should be/have
: 1. Easy to learn, easy to use, easy to maintain
: 2. Big or quickly growing community
: 3. Killer framework or application
: 4. Adequate libraries
: 5. Company backing
: Now Scala is the only FP language I know that has 2/3/4/5, that's one of the

avatar
g*g
162
Obviously I put a quantifier there, general purpose programming. e.g. Java
is much more than enterprise software, it's very successful on Android
platform as a UI language for personal software, gaming etc. It's not as
successful on PC/Mac but there are famous software like Eclipse and TurboTax
on Mac.
And no, I am not following the crowd. You can see all my criteria fit around
02, 03 already for Java, when I started promoting Java on this board. Yet I
am an early adopter, and not many people listened to me at that time.

follower.

【在 E*****m 的大作中提到】
: I think you really need to put a quantifier "For enterprise software"
: for almost everything you said.
: In your 5 criteria, only (1) is forward looking. Others are just saying
: "I follow the crowd", which is not really a bad thing, for a trend follower.
: I guess people who create killer frameworks and libraries might
: think differently.
:
: the

avatar
E*m
163

TurboTax
around
I
I've the same question as the other guy. How can promoting java in 02 03 be
called "early"? When you are later than IBM, don't you think you're really
really late?

【在 g*****g 的大作中提到】
: Obviously I put a quantifier there, general purpose programming. e.g. Java
: is much more than enterprise software, it's very successful on Android
: platform as a UI language for personal software, gaming etc. It's not as
: successful on PC/Mac but there are famous software like Eclipse and TurboTax
: on Mac.
: And no, I am not following the crowd. You can see all my criteria fit around
: 02, 03 already for Java, when I started promoting Java on this board. Yet I
: am an early adopter, and not many people listened to me at that time.
:
: follower.

avatar
d*i
164
Not quite understanding what you mean. Answer your question in assumption.
immutable objects does not mean that can not be garbage collected. I would
rather call it as immutable arguments rather than objects. As long as you do
not have reference with that argument, it can be garbage collected. On the
other hand, it saves memory, since you can only keep one copy of that object
and being reused by all the threads/cores, same concept as singleton.
Talking about performance. People do criticize the the way of "change"
immutable value, since you have to create another value by using the deep
copies. But clojure using some techniques called "Sharing Tech" to avoid
deep copy which is fast

g.

【在 m*********t 的大作中提到】
: What about memory bandwith limit if you use all pure immutable objects? e.g.
: I have a parallel gpu program that read + write 200 GB/s on the GDDR5 RAM.

avatar
g*g
165
Just ask how many people on this BBS have 10+ years of Java experience.
And you know why I am an early adopter.
BTW, academic experience doesn't count. I can see you don't have much
industry experience that's why you make a fuss on everything.

be
really

【在 E*****m 的大作中提到】
:
: TurboTax
: around
: I
: I've the same question as the other guy. How can promoting java in 02 03 be
: called "early"? When you are later than IBM, don't you think you're really
: really late?

avatar
r*g
166
这个,在一个版面混了十年的本来就不多。。。

【在 g*****g 的大作中提到】
: Just ask how many people on this BBS have 10+ years of Java experience.
: And you know why I am an early adopter.
: BTW, academic experience doesn't count. I can see you don't have much
: industry experience that's why you make a fuss on everything.
:
: be
: really

avatar
g*g
167
好吧,如果你招人,你就会知道想招一个有10年java经验的人有多么难。

【在 r*g 的大作中提到】
: 这个,在一个版面混了十年的本来就不多。。。
avatar
d*i
168
As a programmer, being consistent is being stubborn :) The learning cost to
use a new tool for a 0 experience worker compared with experience worker
using the same tool consistently for 100 years is way much lower.
Talking about big team and big enterprise, you are putting yourself as
mostly an application maintainer or consumer of "Adequate libraries" rather
than programmers or developers.
Anyway, it is the same topic of between doing job and enjoying your career.
The topic is talking about why functional programming is good and why is bad
rather than whether it will be successful in fuc*ng big enterprise. By the
way, killer framework was never wrote by a big team.

the

【在 g*****g 的大作中提到】
: I am not being stubborn. I am being consistent. I saw Java succeeded 10
: years ago the same reasons I don't see FP languages succeed today.
: I have mentioned these reasons in many posts, for a language to be adopted
: by massive as a general purpose language, it should be/have
: 1. Easy to learn, easy to use, easy to maintain
: 2. Big or quickly growing community
: 3. Killer framework or application
: 4. Adequate libraries
: 5. Company backing
: Now Scala is the only FP language I know that has 2/3/4/5, that's one of the

avatar
r*g
169
我觉得真神说的一点有道理。这里是programming版,不是programmer版。你自然是资
深高手,但你看这么多问excel/matlab/c input问题的,我觉得超过一半来这里的,不
是职业程序员。那么你的职业建议就难免被一部分人当成废话。

【在 g*****g 的大作中提到】
: 好吧,如果你招人,你就会知道想招一个有10年java经验的人有多么难。
avatar
g*g
170
Talk is cheap. If you are talking about niche language in niche domain, set
the context straight. The reality is that none of these FP languages have
seen massive adoption in the industry. In fact, none of them cracked top 10
in this famous index.
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.htm
Killer framework can be done by small team, killer app rarely is nowadays,
and when it is, it's usually due to brilliant idea, not the language. I
mentioned big team and big project due to practical reason for massive
adoption. It has nothing to do with my job.

to
rather
.
bad
the

【在 d*******i 的大作中提到】
: As a programmer, being consistent is being stubborn :) The learning cost to
: use a new tool for a 0 experience worker compared with experience worker
: using the same tool consistently for 100 years is way much lower.
: Talking about big team and big enterprise, you are putting yourself as
: mostly an application maintainer or consumer of "Adequate libraries" rather
: than programmers or developers.
: Anyway, it is the same topic of between doing job and enjoying your career.
: The topic is talking about why functional programming is good and why is bad
: rather than whether it will be successful in fuc*ng big enterprise. By the
: way, killer framework was never wrote by a big team.

avatar
d*i
171
* Not having preference of functional programming vs object oriented
functional programming
* Not Talking which language is better than the other. They have different
ways/benefits/tradeoff to resolve the issues.
* Just want the topic of functional programming to be technical oriented.
* Industrial wide popularity does not mean any success of the language.
Actually it is a sadness of the language. I like Java, but when I worked
with a global fortune 100 client who has 3000 offshore cheap "developers"
fuc*Ng up Java everyday, I do not like my daily job any more. But that is
how enterprise makes the popular language and their standards.
:)

set
10

【在 g*****g 的大作中提到】
: Talk is cheap. If you are talking about niche language in niche domain, set
: the context straight. The reality is that none of these FP languages have
: seen massive adoption in the industry. In fact, none of them cracked top 10
: in this famous index.
: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.htm
: Killer framework can be done by small team, killer app rarely is nowadays,
: and when it is, it's usually due to brilliant idea, not the language. I
: mentioned big team and big project due to practical reason for massive
: adoption. It has nothing to do with my job.
:

avatar
g*g
172
I am not against anyone using FP in a niche domain. I am merely talking why
existing FPs won't see massive adoption as a general purpose language.
I tend to quantify the success of the language to the values of projects
built on top of it. To that extent, the success of the language is also
largely correlated to its popularity.
At the end of the day, 3000 bad Java developers are still manageable. I
doubt you want to work with 3000 bad FP developers at all. Exactly one of
the reason FP is not going anywhere.

【在 d*******i 的大作中提到】
: * Not having preference of functional programming vs object oriented
: functional programming
: * Not Talking which language is better than the other. They have different
: ways/benefits/tradeoff to resolve the issues.
: * Just want the topic of functional programming to be technical oriented.
: * Industrial wide popularity does not mean any success of the language.
: Actually it is a sadness of the language. I like Java, but when I worked
: with a global fortune 100 client who has 3000 offshore cheap "developers"
: fuc*Ng up Java everyday, I do not like my daily job any more. But that is
: how enterprise makes the popular language and their standards.

avatar
E*m
173

Let me put it this way, you don't know my job and I've no interest to
tell you. But your speculations are all wrong.
And, I can assure you I've know enough people with more than 10 years
of java experience.
Let me say that again. Your prediction about Java was about
5 YEARS AFTER IBM rolled out its Java product. You call that "early"! Why?

【在 g*****g 的大作中提到】
: Just ask how many people on this BBS have 10+ years of Java experience.
: And you know why I am an early adopter.
: BTW, academic experience doesn't count. I can see you don't have much
: industry experience that's why you make a fuss on everything.
:
: be
: really

avatar
m*t
174
比如我有一个 float 数组(长度大约 10^8 to 10^9,占用几个 G 的内存),然后我用
成千上万个 thread 来计算然后 update 数组里面元素的内容(为了保证 thread 不冲
突算法和 sync 都需要考虑)。而如果用 immutable 在这个情况怎么处理?

do
the
object

【在 d*******i 的大作中提到】
: Not quite understanding what you mean. Answer your question in assumption.
: immutable objects does not mean that can not be garbage collected. I would
: rather call it as immutable arguments rather than objects. As long as you do
: not have reference with that argument, it can be garbage collected. On the
: other hand, it saves memory, since you can only keep one copy of that object
: and being reused by all the threads/cores, same concept as singleton.
: Talking about performance. People do criticize the the way of "change"
: immutable value, since you have to create another value by using the deep
: copies. But clojure using some techniques called "Sharing Tech" to avoid
: deep copy which is fast

avatar
g*g
175
你小被鄙视,就是因为明明没啥业界经验,还要成天指点江山。我老00年开始用jsp写
网站,只不过02年才觉得java比C++有前途。你觉不觉我是不是early有用吗?看看你周
围有多少人有10年java经验不就得了。

?

【在 E*****m 的大作中提到】
:
: Let me put it this way, you don't know my job and I've no interest to
: tell you. But your speculations are all wrong.
: And, I can assure you I've know enough people with more than 10 years
: of java experience.
: Let me say that again. Your prediction about Java was about
: 5 YEARS AFTER IBM rolled out its Java product. You call that "early"! Why?

avatar
s*o
176
I agree with most of you points.
but the last one just has no base at all. bad developers are bad developers,
they are cancer no matter what language they use.

why

【在 g*****g 的大作中提到】
: I am not against anyone using FP in a niche domain. I am merely talking why
: existing FPs won't see massive adoption as a general purpose language.
: I tend to quantify the success of the language to the values of projects
: built on top of it. To that extent, the success of the language is also
: largely correlated to its popularity.
: At the end of the day, 3000 bad Java developers are still manageable. I
: doubt you want to work with 3000 bad FP developers at all. Exactly one of
: the reason FP is not going anywhere.

avatar
s*o
177
这好像已经超出了编程解决实际问题的范畴,而是艺术欣赏的范畴了。不然不可能得出
这个结论:
”Industrial wide popularity does not mean any success of the language.
Actually it is a sadness of the language“

【在 d*******i 的大作中提到】
: * Not having preference of functional programming vs object oriented
: functional programming
: * Not Talking which language is better than the other. They have different
: ways/benefits/tradeoff to resolve the issues.
: * Just want the topic of functional programming to be technical oriented.
: * Industrial wide popularity does not mean any success of the language.
: Actually it is a sadness of the language. I like Java, but when I worked
: with a global fortune 100 client who has 3000 offshore cheap "developers"
: fuc*Ng up Java everyday, I do not like my daily job any more. But that is
: how enterprise makes the popular language and their standards.

avatar
y*a
178
you would probabaly be intereted in delite project

dsl

【在 G***l 的大作中提到】
: 简答来说就是做一个parser生成AST,跟相应的interpreter。比如一个basic语法的dsl
: ,当然我的肯定不会有一个正式的语言那么复杂。
:
: 是。

avatar
g*g
179
There's a difference on how much a bad developer can kill a project.

【在 s***o 的大作中提到】
: 这好像已经超出了编程解决实际问题的范畴,而是艺术欣赏的范畴了。不然不可能得出
: 这个结论:
: ”Industrial wide popularity does not mean any success of the language.
: Actually it is a sadness of the language“

avatar
E*m
180

真的不騙你, 我周遭超過10年Java 經驗的車載斗量, 我自己在 02年以前就做了幾個
Java 業界的項目, 你鄙視有用嗎?
02 年也好意思叫預測, 你的臉皮厚度可以直接當裝甲防護罩了。

【在 g*****g 的大作中提到】
: 你小被鄙视,就是因为明明没啥业界经验,还要成天指点江山。我老00年开始用jsp写
: 网站,只不过02年才觉得java比C++有前途。你觉不觉我是不是early有用吗?看看你周
: 围有多少人有10年java经验不就得了。
:
: ?

avatar
t*s
181
俺家当初订阅了一份报纸,叫电脑商情报
我记得97 98年开始,那报纸上面就整天宣传java改变世界了。国内最开始java的那批
人我认为是从1.0开始就追捧的。

【在 E*****m 的大作中提到】
:
: 真的不騙你, 我周遭超過10年Java 經驗的車載斗量, 我自己在 02年以前就做了幾個
: Java 業界的項目, 你鄙視有用嗎?
: 02 年也好意思叫預測, 你的臉皮厚度可以直接當裝甲防護罩了。

avatar
p*2
182

我应该是98年学的Java,当时觉得确实简单。随便看了看书做了一个东西花了两个多小
时,后来转到VC上花了我一晚上,况且我还是搞VC的。不过后来总觉得语言不灵活,所
以一直不太愿意转过去。但是有的时候想做点小程序,还是觉得Java比C++方便和快速
很多。后来接触了了脚本语言,发觉做点小东西脚本就够了。

【在 t*s 的大作中提到】
: 俺家当初订阅了一份报纸,叫电脑商情报
: 我记得97 98年开始,那报纸上面就整天宣传java改变世界了。国内最开始java的那批
: 人我认为是从1.0开始就追捧的。

avatar
E*m
183

goodbug 會說別人都是跟風,只有他才是實在的。 等等看是不是這樣。

【在 t*s 的大作中提到】
: 俺家当初订阅了一份报纸,叫电脑商情报
: 我记得97 98年开始,那报纸上面就整天宣传java改变世界了。国内最开始java的那批
: 人我认为是从1.0开始就追捧的。

avatar
a*e
184
LOL, 这是要比谁最先搞 java 吗?我 97 年写的 Java 程序后来卖给Yahoo和华渊网。
后来再也没碰过 Java,所以 J2EE 这些我完全没接触过,不敢再古德霸面前抖啊,哈
哈哈

【在 p*****2 的大作中提到】
:
: 我应该是98年学的Java,当时觉得确实简单。随便看了看书做了一个东西花了两个多小
: 时,后来转到VC上花了我一晚上,况且我还是搞VC的。不过后来总觉得语言不灵活,所
: 以一直不太愿意转过去。但是有的时候想做点小程序,还是觉得Java比C++方便和快速
: 很多。后来接触了了脚本语言,发觉做点小东西脚本就够了。

avatar
g*r
185
ca,这里全是前辈啊,我98年才摸到电脑这个东西,99年才在中学的机房里开始敲
basic,,,

【在 a*****e 的大作中提到】
: LOL, 这是要比谁最先搞 java 吗?我 97 年写的 Java 程序后来卖给Yahoo和华渊网。
: 后来再也没碰过 Java,所以 J2EE 这些我完全没接触过,不敢再古德霸面前抖啊,哈
: 哈哈

avatar
p*2
186

BSO年轻呀

【在 g****r 的大作中提到】
: ca,这里全是前辈啊,我98年才摸到电脑这个东西,99年才在中学的机房里开始敲
: basic,,,

avatar
t*n
187
用tubro c++的飘过。。。

【在 p*****2 的大作中提到】
:
: BSO年轻呀

avatar
l*s
188
BSO老江湖阿

【在 t*****n 的大作中提到】
: 用tubro c++的飘过。。。
avatar
g*g
189
LOL,不是读书写过一个applet就叫业界经验了,省省吧。02年在这BBS看好java的人很
少,要不然我
何必写那样的帖子。我老说的东西,好歹有10年前的帖子为证。你小明明半路出家,还
车载斗量呢,装逼有意思吗。

【在 E*****m 的大作中提到】
:
: goodbug 會說別人都是跟風,只有他才是實在的。 等等看是不是這樣。

avatar
g*g
190
如果我是跟风的,精华区也轮不到我来鼓吹。JSP 99年才出来的,我00年初用JSP写网
站的时候,是国内最早的一批,那时候更流行的是ASP和PHP。而在JSP出来之前,Java
的定位还局限于applet,没多大前途。你一吹就吹破了。

【在 E*****m 的大作中提到】
:
: goodbug 會說別人都是跟風,只有他才是實在的。 等等看是不是這樣。

avatar
E*m
191

你不是真神,亂猜做啥? 誰告訴你是 applet 了? 是正經用來賺錢的東西。
你也不知道我在哪幹, 氣急敗壞的跳上跳下是覺得人品還沒丟光嗎?
這 BBS 就是你的全部社會關係是嗎? 02 年在這裡『預測』Java 也好意思說?
真是好了不起, 連自己在丟人現眼都還不自覺,還留著丟人的證據到處獻寶,
不服你還真不行。

【在 g*****g 的大作中提到】
: LOL,不是读书写过一个applet就叫业界经验了,省省吧。02年在这BBS看好java的人很
: 少,要不然我
: 何必写那样的帖子。我老说的东西,好歹有10年前的帖子为证。你小明明半路出家,还
: 车载斗量呢,装逼有意思吗。

avatar
r*n
192
拆分后每个子任务在一个core上以独占方式跑

【在 p*****2 的大作中提到】
:
: BSO年轻呀

avatar
E*m
193

Java
你的志氣大概就是『國內』,『mitbbs』 這些地方是吧?
2002, Eclipse 都出來了, 更早前, Java 市場早就已經一片火熱了,Visual J++,
Visual Age for Java, Borland Jbuilder 這些早就 出好幾版了, MS 都已經推出 C
#了。
用 Java 寫 desktop application 早就流行了。 你要是 00 年給大家推薦用 Java

web 倒也還算早, 02 年就算太晚了。

【在 g*****g 的大作中提到】
: 如果我是跟风的,精华区也轮不到我来鼓吹。JSP 99年才出来的,我00年初用JSP写网
: 站的时候,是国内最早的一批,那时候更流行的是ASP和PHP。而在JSP出来之前,Java
: 的定位还局限于applet,没多大前途。你一吹就吹破了。

avatar
g*g
194
LOL,我老是有帖子做证据的,你小全靠上下嘴皮一翻,还证据呢?
我老00年开始写jsp应用,还不能叫early adopter,你丫不装逼会死吗?

【在 E*****m 的大作中提到】
:
: Java
: 你的志氣大概就是『國內』,『mitbbs』 這些地方是吧?
: 2002, Eclipse 都出來了, 更早前, Java 市場早就已經一片火熱了,Visual J++,
: Visual Age for Java, Borland Jbuilder 這些早就 出好幾版了, MS 都已經推出 C
: #了。
: 用 Java 寫 desktop application 早就流行了。 你要是 00 年給大家推薦用 Java
: 寫
: web 倒也還算早, 02 年就算太晚了。

avatar
g*g
195
我老00年写的网站就用jsp,还不算早?我老觉得Java写desktop app没前途,所以更早
没吹呀,要不
怎么说比你小有眼光呢?

,
C

【在 E*****m 的大作中提到】
:
: Java
: 你的志氣大概就是『國內』,『mitbbs』 這些地方是吧?
: 2002, Eclipse 都出來了, 更早前, Java 市場早就已經一片火熱了,Visual J++,
: Visual Age for Java, Borland Jbuilder 這些早就 出好幾版了, MS 都已經推出 C
: #了。
: 用 Java 寫 desktop application 早就流行了。 你要是 00 年給大家推薦用 Java
: 寫
: web 倒也還算早, 02 年就算太晚了。

avatar
E*m
196

jsp 寫個 hello world? 那麼愛講有存貼證據, 你把 00 年寫 JSP 的證據拿出來看
一下。

【在 g*****g 的大作中提到】
: 我老00年写的网站就用jsp,还不算早?我老觉得Java写desktop app没前途,所以更早
: 没吹呀,要不
: 怎么说比你小有眼光呢?
:
: ,
: C

avatar
g*g
197
00年ChinaRen有一部分是用JSP写的,现在网站是大不一样了,但还是JSP。
http://class.chinaren.com/index.jsp?bru=%2Fhome.do
你小02年拿Java写业界项目的证据呢?

【在 E*****m 的大作中提到】
:
: jsp 寫個 hello world? 那麼愛講有存貼證據, 你把 00 年寫 JSP 的證據拿出來看
: 一下。

avatar
c*e
198
黄金时代阿, 那个时候给chinaren作parttime也有几千块一个月。

【在 g*****g 的大作中提到】
: 00年ChinaRen有一部分是用JSP写的,现在网站是大不一样了,但还是JSP。
: http://class.chinaren.com/index.jsp?bru=%2Fhome.do
: 你小02年拿Java写业界项目的证据呢?

avatar
b*e
199
That's controversial. Why would there be 3k bad Java developer at first
place? Maybe it's too easy to be a bad Java developer. For Haskell, you
either are a good developer, or you cannot use it at all coz you're just too
dumb to understand it.

why

【在 g*****g 的大作中提到】
: I am not against anyone using FP in a niche domain. I am merely talking why
: existing FPs won't see massive adoption as a general purpose language.
: I tend to quantify the success of the language to the values of projects
: built on top of it. To that extent, the success of the language is also
: largely correlated to its popularity.
: At the end of the day, 3000 bad Java developers are still manageable. I
: doubt you want to work with 3000 bad FP developers at all. Exactly one of
: the reason FP is not going anywhere.

avatar
g*g
200
It's simply demand and supply. When demand is way over than supply,
everybody and their grandma can be a java developer. On the other hand, it
may take a genius to understand Haskell, yet some of them are still jobless,
too bad.

too

【在 b***e 的大作中提到】
: That's controversial. Why would there be 3k bad Java developer at first
: place? Maybe it's too easy to be a bad Java developer. For Haskell, you
: either are a good developer, or you cannot use it at all coz you're just too
: dumb to understand it.
:
: why

avatar
b*e
201
Hmmm...I've seen enough java developers out of job, never seen a Haskell
developer out of job.

jobless,

【在 g*****g 的大作中提到】
: It's simply demand and supply. When demand is way over than supply,
: everybody and their grandma can be a java developer. On the other hand, it
: may take a genius to understand Haskell, yet some of them are still jobless,
: too bad.
:
: too

avatar
g*g
202
You probably know more java developers than total Haskell positions existing.

【在 b***e 的大作中提到】
: Hmmm...I've seen enough java developers out of job, never seen a Haskell
: developer out of job.
:
: jobless,

avatar
b*e
203
That's true. I know tons of J2EE experts who used to be tailors or chefs or
mailmen from "you know where". Guess that's why people are complaining H1B
is used up. But the point is, I did never see "some of the functional
programmers cannot land a job", while I do see quite "some of the (claimed
to be) Java developers cannot land a job". I personal interviewed many Java
developers with more than 10 year experience, and they cannot write a
simple exponential function correctly.

existing.

【在 g*****g 的大作中提到】
: You probably know more java developers than total Haskell positions existing.
avatar
g*g
204
If your so claimed functional programmers did not land a job as a functional
programmer, they are not a functional programmer. Or they are a jobless
functional programmer. Plain and simple.
When you can find a ton of bad java programmers employed, you know for sure
a good java programmer can get a good paycheck. That's the point.
The remaining Cobol programmers are probably very good, that doesn't mean
Cobol isn't dead.

or
H1B
Java

【在 b***e 的大作中提到】
: That's true. I know tons of J2EE experts who used to be tailors or chefs or
: mailmen from "you know where". Guess that's why people are complaining H1B
: is used up. But the point is, I did never see "some of the functional
: programmers cannot land a job", while I do see quite "some of the (claimed
: to be) Java developers cannot land a job". I personal interviewed many Java
: developers with more than 10 year experience, and they cannot write a
: simple exponential function correctly.
:
: existing.

avatar
d*i
205
Talking with goodbug is like talking with American Java Enterprise architect
working in a same company for many years. As I do short term consulting, I
know a lot of these dudes.
Basically the words are dictating and no logic. Like "Plain and simple", "
You know for sure", "That is the point". If you see those statements, not
plain, either simple. I can not know for sure and not that point. In a real
life, you can beat the architects by using codes and white board. But in
BBS, you have to lose to someone with 10 years bbs tenure, while same cases
you have to back out when at client sites, the 10 years chief architects
saying, this is the point, you do not understand since I've been here 1
million years.
Bye!~ Backing out.

functional
sure

【在 g*****g 的大作中提到】
: If your so claimed functional programmers did not land a job as a functional
: programmer, they are not a functional programmer. Or they are a jobless
: functional programmer. Plain and simple.
: When you can find a ton of bad java programmers employed, you know for sure
: a good java programmer can get a good paycheck. That's the point.
: The remaining Cobol programmers are probably very good, that doesn't mean
: Cobol isn't dead.
:
: or
: H1B

avatar
g*g
206
LOL, are you serious about logic? Ironically I am the one who always brings
out numbers and killers app when comparing languages. Programming is all
about practicability. All these functional languages provocatives, they talk
about art and beauty instead.
I use the same arguments ten years ago, simply because history proved my
principles were correct, while people in opposition was wrong. Now time has
changed, but the stance isn't. I am merely asking one question, what changes
have given FP new edge? I haven't heard any.
Learning a language is like buying a stock. You can pick a winner and
constantly compare it to its competition. Or you can pick a loser and boast
it all day long. We all hope to make money out of it, and the feeling is
hurt when we are on the wrong side.

architect
I
real
cases

【在 d*******i 的大作中提到】
: Talking with goodbug is like talking with American Java Enterprise architect
: working in a same company for many years. As I do short term consulting, I
: know a lot of these dudes.
: Basically the words are dictating and no logic. Like "Plain and simple", "
: You know for sure", "That is the point". If you see those statements, not
: plain, either simple. I can not know for sure and not that point. In a real
: life, you can beat the architects by using codes and white board. But in
: BBS, you have to lose to someone with 10 years bbs tenure, while same cases
: you have to back out when at client sites, the 10 years chief architects
: saying, this is the point, you do not understand since I've been here 1

avatar
b*e
207
Well, if that's by definition your logic, then I certainly cannot beat you
on it. But I disagree. To your point, you can similarly argue most of the
PHDs hired by Google or Facebook are jobless computer science researchers.
In my opinion, a functional developer, as smart and capable she/he is,
usually lands a good job easily, regardless if the job is directly related
to functional programming or not. The thoughts and insights gained from
understanding functional languages is beyond merely using them as
development tools.

functional
sure

【在 g*****g 的大作中提到】
: If your so claimed functional programmers did not land a job as a functional
: programmer, they are not a functional programmer. Or they are a jobless
: functional programmer. Plain and simple.
: When you can find a ton of bad java programmers employed, you know for sure
: a good java programmer can get a good paycheck. That's the point.
: The remaining Cobol programmers are probably very good, that doesn't mean
: Cobol isn't dead.
:
: or
: H1B

avatar
g*g
208
Your logic is twisted. A good developer is good because he/she can get the
job done. Not because he/she can do FP. Do you have any statistics to prove
developers that know FP are better? If not, this self-claimed superiority is
nothing but zhuangbility.

the

【在 b***e 的大作中提到】
: Well, if that's by definition your logic, then I certainly cannot beat you
: on it. But I disagree. To your point, you can similarly argue most of the
: PHDs hired by Google or Facebook are jobless computer science researchers.
: In my opinion, a functional developer, as smart and capable she/he is,
: usually lands a good job easily, regardless if the job is directly related
: to functional programming or not. The thoughts and insights gained from
: understanding functional languages is beyond merely using them as
: development tools.
:
: functional

avatar
E*m
209

prove
is
Question for you. Does arguing this make more money for you?
If yes, how? If not, are you 裝B ing ?

【在 g*****g 的大作中提到】
: Your logic is twisted. A good developer is good because he/she can get the
: job done. Not because he/she can do FP. Do you have any statistics to prove
: developers that know FP are better? If not, this self-claimed superiority is
: nothing but zhuangbility.
:
: the

avatar
g*g
210
Java developers make much more money than Haskell developers, that's just a
fact.
Since when stating fact is also zhuangbility?
http://www.indeed.com/salary?q1=java&l1=&q2=haskell&l2=&tm=1
Where's your proof of industry java project in 2002 BTW? You were exposed
the other day and now you are back again?

【在 E*****m 的大作中提到】
:
: prove
: is
: Question for you. Does arguing this make more money for you?
: If yes, how? If not, are you 裝B ing ?

avatar
E*m
212

a
Now you think there are other thing than money that you care?
If you didn't understand the question, I'm asking does YOU arguing this
make YOU more money? Can you answer this?
Did I promise I'll prove it to you? No. You don't need to believe me. It's
not even
the point. You can't defend your own argument, so you have to resort to
personal attach. So pathetic.

【在 g*****g 的大作中提到】
: Java developers make much more money than Haskell developers, that's just a
: fact.
: Since when stating fact is also zhuangbility?
: http://www.indeed.com/salary?q1=java&l1=&q2=haskell&l2=&tm=1
: Where's your proof of industry java project in 2002 BTW? You were exposed
: the other day and now you are back again?

avatar
a*i
213
you need not answer this nonsense question
everyone posts here for money or zhuangB?
Did he try to answer the question before he asked?
or M$ pays him for arguing here

a

【在 g*****g 的大作中提到】
: Java developers make much more money than Haskell developers, that's just a
: fact.
: Since when stating fact is also zhuangbility?
: http://www.indeed.com/salary?q1=java&l1=&q2=haskell&l2=&tm=1
: Where's your proof of industry java project in 2002 BTW? You were exposed
: the other day and now you are back again?

avatar
E*m
214

Actually, this is goodbug's idea. He thinks only money is
important, everything else is zhuangB.

【在 a****i 的大作中提到】
: you need not answer this nonsense question
: everyone posts here for money or zhuangB?
: Did he try to answer the question before he asked?
: or M$ pays him for arguing here
:
: a

avatar
g*g
215
Not really, I am just disgusted by someone's self-claim superiority.
Some people feel they are better programmers because they know FP, but they
don't have any number to back it up, they don't even program FP for a living
. Now that's textbook zhuangB.
Money is not everything. But at least that's a number that's objective and
easy to find on Internet.

【在 E*****m 的大作中提到】
:
: Actually, this is goodbug's idea. He thinks only money is
: important, everything else is zhuangB.

avatar
b*e
217
I didn't get it where my logic is twisted. Therefore I prefer to question
your skills of reading comprehension. Nonetheless, with my limited personal
experience, I do observe average FP developers exhibiting much more
superior smartness and capability over Java developers (I did work in both
contexts for non-trivial/significant time). Also, to my observation FP
developers are either making more of a fortune or getting a better social
status than mere Java developers.

prove
is

【在 g*****g 的大作中提到】
: Your logic is twisted. A good developer is good because he/she can get the
: job done. Not because he/she can do FP. Do you have any statistics to prove
: developers that know FP are better? If not, this self-claimed superiority is
: nothing but zhuangbility.
:
: the

avatar
g*g
218
Your observation. LOL. Do you know 4 big cows in this BBS?
My friends, my relatives, my neighbors and my classmates.
I show numbers to prove FP programmers would have a hard time to find a job.
Many of your brilliant FP programmers are stuck in thousand year postdoc,
you can't find a good explanation otherwisefor $28K average salary for
Haskell jobs.
And to show you why personal observation can be so biased. Most of java
programmers in my company make more than $200K a year. If they work for more
than 3 years in the company they are most likely a millionaire due to stock
option. But I wouldn't use that personal observation to generalize social
status for a language's developers like you just did.

personal

【在 b***e 的大作中提到】
: I didn't get it where my logic is twisted. Therefore I prefer to question
: your skills of reading comprehension. Nonetheless, with my limited personal
: experience, I do observe average FP developers exhibiting much more
: superior smartness and capability over Java developers (I did work in both
: contexts for non-trivial/significant time). Also, to my observation FP
: developers are either making more of a fortune or getting a better social
: status than mere Java developers.
:
: prove
: is

avatar
E*m
219

they
living
Hitting strawman?
NOW money is not everything? So, what else is important?

【在 g*****g 的大作中提到】
: Not really, I am just disgusted by someone's self-claim superiority.
: Some people feel they are better programmers because they know FP, but they
: don't have any number to back it up, they don't even program FP for a living
: . Now that's textbook zhuangB.
: Money is not everything. But at least that's a number that's objective and
: easy to find on Internet.

avatar
g*g
220
Like humble and not zhuangB even if you know how to kill a dragon.

【在 E*****m 的大作中提到】
:
: they
: living
: Hitting strawman?
: NOW money is not everything? So, what else is important?

avatar
b*e
221
I question the accuracy of the Haskell developer salary report, well, yes,
depending on how do you classify Haskell developers. Most of the Haskell
developers are truly academic researchers. Those people who worked with me
before are mostly tenure professors at some universities. So far I didn't
find a single case in my list of 4 big cows who's "thousand years of post-
doc". This is not biology (sorry for my candor, biologists). They might
not be making as high as 200k per year as far as base salary is concerned,
but undeniably, they are at a higher social status and earn more
professional respects than mere Java developers. Their contribution to
science and to the development of human society is not measured through how
many dollars they make per year.
On the other hand, even if people who are a bit dumber than those smart
asses, like me, who ended up in the software industry, are benefiting from
the valuable experience from programming functional languages. As I said in
another post, the insights that people gain from understanding how FPLs
work can great improve the personal's vision in software engineering. For
an instance, like Wang Yin said, visitor pattern doesn't exist in Haskell (
as a representative of FPL), because it's just a language feature. That
being said, if you did program Haskell and understand how pattern matching
works there, you would have a much better understanding of why the visitor
pattern is constructed that way. That's know-why, which beyond a mere know-
how. Furthermore, with the involvement of Java generics, sometimes there
are variants of visitor patterns that are pretty hacky and tricky. But if
you did know that there's something call Generalized Algebraic Datatype (
GADT) in Haskell, you would realized those hacks are not totally out of
nowhere from some smart-ass' mind. They are just mimicking the enhanced
pattern matching in GADT. This is know-why again, which is beyond a mere
know-how. Only with know-how can you be original and creative to create new
patterns that suite new needs.
I do not merely take a programming language as a development tool and get
religious about it. I tend to see through the surface and reach the essence
. When I look at Haskell, I see Algebraic Data Type and type directed
pattern matching, I see non-strictness/lazy evaluation, I see functional
closures and lambda lifting, I see type/constructor class based overloading,
I see implicit parameters, I see monad based side effects. When I look at
Lisp, I see meta programming, I see macros, I see CLOS, I see explicit
continuation passing. When I see Java, I see object oriented paradigm, I
see OO based encapsulation, I see inclusion polymorphism (subtyping), I see
singly inheritance hierarchy with interfaces, I see garbage collection, I
see just-in-time compilation, and I see weak references. When I see Scala,
I see mixins, I see type inference for second order polymorphism, I see
light-weight lock free processes.
If your final career goal is to be a senior^n Java engineer and get
comfortable with 200k yearly income and enjoy it for the rest of your life,
that's good for you. I had been there and done that years ago, and I moved
on beyond that.

job.
more
stock

【在 g*****g 的大作中提到】
: Your observation. LOL. Do you know 4 big cows in this BBS?
: My friends, my relatives, my neighbors and my classmates.
: I show numbers to prove FP programmers would have a hard time to find a job.
: Many of your brilliant FP programmers are stuck in thousand year postdoc,
: you can't find a good explanation otherwisefor $28K average salary for
: Haskell jobs.
: And to show you why personal observation can be so biased. Most of java
: programmers in my company make more than $200K a year. If they work for more
: than 3 years in the company they are most likely a millionaire due to stock
: option. But I wouldn't use that personal observation to generalize social

avatar
g*g
222
It's one thing saying learning FP can benefit programming skills, which I
definitely agree. It's another thing saying FP programmers are better than
Java programmers, which is really a joke. They can't even find a job as a FP
programmers, if better means killing dragon, sure, but nobody really cares.
There are a lot of things to learn and all of them can have some benefits,
the question is how much? Personally I believe no matter what programming
language you are using, mastering the mainstream frameworks and getting keen
on the hot technologies like NoSQL, Cloud etc. is more beneficial than
learning FP. But it's your own choice.
At the end of the day, however, programming is an engineering practice. The
end products prove the usefulness of the language and the skills the
programmers practicing them. It's not that difficult to quantify. You just
have nothing to back up your claims with the worlds full of Java products
and FP products hard to find. Talk is cheap. How much you or me earn is not
the matter. The matter is not to talk bullshit and only proof is the four
big cows you know, which is still all you have with your long thesis, that's
not gonna work for techies.

me
how

【在 b***e 的大作中提到】
: I question the accuracy of the Haskell developer salary report, well, yes,
: depending on how do you classify Haskell developers. Most of the Haskell
: developers are truly academic researchers. Those people who worked with me
: before are mostly tenure professors at some universities. So far I didn't
: find a single case in my list of 4 big cows who's "thousand years of post-
: doc". This is not biology (sorry for my candor, biologists). They might
: not be making as high as 200k per year as far as base salary is concerned,
: but undeniably, they are at a higher social status and earn more
: professional respects than mere Java developers. Their contribution to
: science and to the development of human society is not measured through how

avatar
n*t
223
But not many people make money directly from knowing functional programming
language. On the other hand, I think any job,that pays your directly because
you are using a particular language, is not so good as a job. It can give
you are decent life maybe, but might be not all that interesting.
Knowing a language that is not popular in industry and still learning or
even mastering it, could be an evidence the learner is interested in various
programming aspects and are probably more skillful than the normal
"learn-something-to-get-a-job" type of programmer. Very few programmers who
know FP just know FP. Most of them knows enough C/C++/Java before that and
they are probably going to learn a lot more in the future. So in this
regard, it is probably right to say FP programmer are usually better in
probablity. It does not mean learning Java means you are stupid though.

FP
cares.
keen
The

【在 g*****g 的大作中提到】
: It's one thing saying learning FP can benefit programming skills, which I
: definitely agree. It's another thing saying FP programmers are better than
: Java programmers, which is really a joke. They can't even find a job as a FP
: programmers, if better means killing dragon, sure, but nobody really cares.
: There are a lot of things to learn and all of them can have some benefits,
: the question is how much? Personally I believe no matter what programming
: language you are using, mastering the mainstream frameworks and getting keen
: on the hot technologies like NoSQL, Cloud etc. is more beneficial than
: learning FP. But it's your own choice.
: At the end of the day, however, programming is an engineering practice. The

avatar
G*l
224
你又犯晕了。我没看到有人说FP programmer programmer比java好,至少几个发言比较
多的id都没这么说。事实上除了acdemic之外,绝大多数fp progammer同时也大量使用
java,c#,c++,python这些非fp语言。完全是你有受迫害妄想症,看到别人说fp好,就偏
要往别人意思是java不好联想,看到比人说fp有前途就往java没前途去理解。我对这个
thread里面你的观点鉴定完毕。

FP
cares.
keen
The

【在 g*****g 的大作中提到】
: It's one thing saying learning FP can benefit programming skills, which I
: definitely agree. It's another thing saying FP programmers are better than
: Java programmers, which is really a joke. They can't even find a job as a FP
: programmers, if better means killing dragon, sure, but nobody really cares.
: There are a lot of things to learn and all of them can have some benefits,
: the question is how much? Personally I believe no matter what programming
: language you are using, mastering the mainstream frameworks and getting keen
: on the hot technologies like NoSQL, Cloud etc. is more beneficial than
: learning FP. But it's your own choice.
: At the end of the day, however, programming is an engineering practice. The

avatar
g*g
225

你就别圆了,这位底下写得清清楚楚,FP programmer从IQ,fortune, social status
全方
位完灭java developer。我老就是要他提供一些数字来证明一下,这位就开始玩四大牛
人的把戏。
我没啥迫害妄想症,那位blaze 10年前就鼓吹过Haskell,跟我争过FP会如何牛逼云云
,你不信可以去google,事实上是这10年,FP的地位几乎没有提高,倒是他看不起的
Java地位提高了很多。他就是老脸拉不下来。
personal

【在 G***l 的大作中提到】
: 你又犯晕了。我没看到有人说FP programmer programmer比java好,至少几个发言比较
: 多的id都没这么说。事实上除了acdemic之外,绝大多数fp progammer同时也大量使用
: java,c#,c++,python这些非fp语言。完全是你有受迫害妄想症,看到别人说fp好,就偏
: 要往别人意思是java不好联想,看到比人说fp有前途就往java没前途去理解。我对这个
: thread里面你的观点鉴定完毕。
:
: FP
: cares.
: keen
: The

avatar
g*g
226
As I mentioned, there are so much to learn in programming. What's so special
about FP? There's simply no proof learning FP is more beneficial than using
the time to learn other things like new frameworks and technologies.

programming
because
various
who

【在 n******t 的大作中提到】
: But not many people make money directly from knowing functional programming
: language. On the other hand, I think any job,that pays your directly because
: you are using a particular language, is not so good as a job. It can give
: you are decent life maybe, but might be not all that interesting.
: Knowing a language that is not popular in industry and still learning or
: even mastering it, could be an evidence the learner is interested in various
: programming aspects and are probably more skillful than the normal
: "learn-something-to-get-a-job" type of programmer. Very few programmers who
: know FP just know FP. Most of them knows enough C/C++/Java before that and
: they are probably going to learn a lot more in the future. So in this

avatar
g*t
227
计算机本科的计算理论基础什么的,一般都要学FP吧?
就算不学商用FP,Lambda Calculus之类的东西,很多基础课本都有包括.
这个和图灵机类似.属于基本的基础.一个程序员,能没学过Turing机么?
虽然不一定有用.

As I mentioned, there are so much to learn in programming. What's so special
about FP? There's simply no proof learning FP is more beneficial than using
the time to learn other things like new frameworks and technologies.
programming
because
various
who

【在 g*****g 的大作中提到】
: As I mentioned, there are so much to learn in programming. What's so special
: about FP? There's simply no proof learning FP is more beneficial than using
: the time to learn other things like new frameworks and technologies.
:
: programming
: because
: various
: who

avatar
g*g
228
计算理论本来就不是必修课。就跟图像处理,图形学,人工智能,这些都是专业方向,
不是CS本科必修课。
我打赌这版上大多数人都没学过图像处理和图形学,但我不会说什么学过图形学的秒杀
没学过的云云。

special
using

【在 g****t 的大作中提到】
: 计算机本科的计算理论基础什么的,一般都要学FP吧?
: 就算不学商用FP,Lambda Calculus之类的东西,很多基础课本都有包括.
: 这个和图灵机类似.属于基本的基础.一个程序员,能没学过Turing机么?
: 虽然不一定有用.
:
: As I mentioned, there are so much to learn in programming. What's so special
: about FP? There's simply no proof learning FP is more beneficial than using
: the time to learn other things like new frameworks and technologies.
: programming
: because

avatar
g*t
229
CS哪个课学图灵机? (或者哪个程序员对图灵机感兴趣。)
一般也都会学到Lambda Calculs,部分递归函数什么的。

计算理论本来就不是必修课。就跟图像处理,图形学,人工智能,这些都是专业方向,
不是CS本科必修课。
我打赌这版上大多数人都没学过图像处理和图形学,但我不会说什么学过图形学的秒杀
没学过的云云。
special
using

【在 g*****g 的大作中提到】
: 计算理论本来就不是必修课。就跟图像处理,图形学,人工智能,这些都是专业方向,
: 不是CS本科必修课。
: 我打赌这版上大多数人都没学过图像处理和图形学,但我不会说什么学过图形学的秒杀
: 没学过的云云。
:
: special
: using

avatar
g*g
230
形式语言与自动机,选修课。

【在 g****t 的大作中提到】
: CS哪个课学图灵机? (或者哪个程序员对图灵机感兴趣。)
: 一般也都会学到Lambda Calculs,部分递归函数什么的。
:
: 计算理论本来就不是必修课。就跟图像处理,图形学,人工智能,这些都是专业方向,
: 不是CS本科必修课。
: 我打赌这版上大多数人都没学过图像处理和图形学,但我不会说什么学过图形学的秒杀
: 没学过的云云。
: special
: using

avatar
A*t
231
说得好像学了fp,连java都不会写了似的

a

【在 g*****g 的大作中提到】
: Good find. Though only 43 jobs compared to 66K for Java. It's more or less a
: skill to kill the dragon.
: http://www.indeed.com/jobs?q=Ocaml&l=

avatar
b*e
232
事实上scala和javascript都属于FP,只不过不像Haskell那么纯粹。FP的本质在于对
first class function和higher order function的支持。
我对四大牛人什么的说实话不感兴趣。我十年前也并非鼓吹FP。当年你挑起一个帖子,
说你认为functional language programmer都是"freaks who cannot think straight"
(大体是你的原话吧)。我路见不平而已。其中是非曲直有目共睹。
我职业潜水员,一向不太发帖子,这次多说几句主要是你们这些Java轮bash FP过激了
。我一向鼓励对FP的兴趣和探究,不愿看到这些志向过早的为世俗所羁。或有矫枉过正
。言止此尔。

status

【在 g*****g 的大作中提到】
: 形式语言与自动机,选修课。
avatar
s*o
233
why is there a line drawn between functional language programmers and non
functional language programmers? It's the first time I've heard of it. It's
stupid.

straight"

【在 b***e 的大作中提到】
: 事实上scala和javascript都属于FP,只不过不像Haskell那么纯粹。FP的本质在于对
: first class function和higher order function的支持。
: 我对四大牛人什么的说实话不感兴趣。我十年前也并非鼓吹FP。当年你挑起一个帖子,
: 说你认为functional language programmer都是"freaks who cannot think straight"
: (大体是你的原话吧)。我路见不平而已。其中是非曲直有目共睹。
: 我职业潜水员,一向不太发帖子,这次多说几句主要是你们这些Java轮bash FP过激了
: 。我一向鼓励对FP的兴趣和探究,不愿看到这些志向过早的为世俗所羁。或有矫枉过正
: 。言止此尔。
:
: status

avatar
h*i
234
I can understand your frustration.
But, the truth of the matter is that a programmer who is versed in FP is
indeed considered by almost every employer as a better programmer than one
who is not versed in FP, everything else being equal. This is simply a fact.
You can be disgusted about the fact, but it does not change the fact.
If you are really practical minded as you seem to claim yourself to be, you
may want to work with the reality rather than whine about it.

they
living

【在 g*****g 的大作中提到】
: Not really, I am just disgusted by someone's self-claim superiority.
: Some people feel they are better programmers because they know FP, but they
: don't have any number to back it up, they don't even program FP for a living
: . Now that's textbook zhuangB.
: Money is not everything. But at least that's a number that's objective and
: easy to find on Internet.

avatar
h*i
235
I am among those people who wrote almost exclusively in Java since 1997. I
was invited to Sun's dinners in Beijing and totally bought their propaganda
(compare with C++, Java was so much better). In those days, one could
easily win awards by writing Java applets, which I got a couple myself.
Later on, I even wrote 3D games in Java. Fun times...
Then Java became enterprisy, with all those frameworks and architecture
astronauts running the show, and lost all of its charm...
Now I wrote almost exclusively in Clojure...

【在 t*s 的大作中提到】
: 俺家当初订阅了一份报纸,叫电脑商情报
: 我记得97 98年开始,那报纸上面就整天宣传java改变世界了。国内最开始java的那批
: 人我认为是从1.0开始就追捧的。

avatar
h*i
236
There isn't a line, but "FP programmers" are those programmers who can do FP
, "non-FP programmers" are those who cannot. Because all programmers can do
non-FP, and only "FP programmers" can do FP, "FP programmers" are normally
considered better programmers, everything else being equal.

s

【在 s***o 的大作中提到】
: why is there a line drawn between functional language programmers and non
: functional language programmers? It's the first time I've heard of it. It's
: stupid.
:
: straight"

avatar
h*i
237
There's no such thing as a FP programmer who does not know how to program in
Java if they need to. If they can make a good living without doing that,
why should they. After all, a Java programmer is like a janitor these days,
it's a replaceable commodity because every one can do it.
Truth hurts.

FP
cares.
keen
The

【在 g*****g 的大作中提到】
: It's one thing saying learning FP can benefit programming skills, which I
: definitely agree. It's another thing saying FP programmers are better than
: Java programmers, which is really a joke. They can't even find a job as a FP
: programmers, if better means killing dragon, sure, but nobody really cares.
: There are a lot of things to learn and all of them can have some benefits,
: the question is how much? Personally I believe no matter what programming
: language you are using, mastering the mainstream frameworks and getting keen
: on the hot technologies like NoSQL, Cloud etc. is more beneficial than
: learning FP. But it's your own choice.
: At the end of the day, however, programming is an engineering practice. The

avatar
g*g
238
I am not frustrated, and why should I? If you are at all being about
practical, you should notice functional languages ain't spring chicken, in
fact, they've existed for much longer time than OO languages and they never
took off. Plus, there's absolutely no data supporting FP programmers are
better. If anything, the salary on indeed suggests their market value is
just lower, much lower. Now that's some fact.

fact.
you

【在 h*i 的大作中提到】
: I can understand your frustration.
: But, the truth of the matter is that a programmer who is versed in FP is
: indeed considered by almost every employer as a better programmer than one
: who is not versed in FP, everything else being equal. This is simply a fact.
: You can be disgusted about the fact, but it does not change the fact.
: If you are really practical minded as you seem to claim yourself to be, you
: may want to work with the reality rather than whine about it.
:
: they
: living

avatar
g*g
239
LOL, truth hurts, doesn't it?
http://www.indeed.com/salary?q1=haskell&l1=&q2=java&l2=&q3=sche
Not to mention Java jobs are like 10 times than all these languages combined.
If you are really good, in the normal distribution you can get in the far
right end.
By the way, your clojure peers ain't doing very well either. I feel sorry
for them.

in
,

【在 h*i 的大作中提到】
: There's no such thing as a FP programmer who does not know how to program in
: Java if they need to. If they can make a good living without doing that,
: why should they. After all, a Java programmer is like a janitor these days,
: it's a replaceable commodity because every one can do it.
: Truth hurts.
:
: FP
: cares.
: keen
: The

avatar
g*g
240
There's no such things as all things being equal. When people start marking
themselves "FP programmers" for self-claimed superiority while not holding
such a a job, it's like one boasting his dragon killing skills.
Normal people would be proud of what they do and do well, not what they don'
t do but they could do. I see severe confidence lacking here.

FP
do
normally

【在 h*i 的大作中提到】
: There isn't a line, but "FP programmers" are those programmers who can do FP
: , "non-FP programmers" are those who cannot. Because all programmers can do
: non-FP, and only "FP programmers" can do FP, "FP programmers" are normally
: considered better programmers, everything else being equal.
:
: s

avatar
c*n
241
I don't really see the point of using functional programming languages for
real production projects, though clojure is very popular now.
my point is that in a few cases you do need to operate on functions, all
languages have such features: C has function pointers, java has anonymous
inner classes, python has lambda. it's just that they do not openly
advertise them as "functional".
but even clojure itself does not recommend using non-named functions
recursive, but isn't operating on functions themselves the real power of
functional programming?
clojure is popular, and handy, but I feel a large part of that comes from
the easiness of kind of using java as a scripting language , so that u don't
need to go through the compile/build/run cycle, and the iteration is much
faster, kind of like for prototyping purposes. the only real difference of
clojure to java, I feel, is the annoying prefix notation, which is
completely useless, and the syntax could have been completely re-designed to
be like most languages to give users a more natural, intuitive feeling.
The prefix notation and endless "()" is just an archaic legacy left over
from when LISP was created.
avatar
d*x
242
铜球fp达人来解释

【在 c******n 的大作中提到】
: I don't really see the point of using functional programming languages for
: real production projects, though clojure is very popular now.
: my point is that in a few cases you do need to operate on functions, all
: languages have such features: C has function pointers, java has anonymous
: inner classes, python has lambda. it's just that they do not openly
: advertise them as "functional".
: but even clojure itself does not recommend using non-named functions
: recursive, but isn't operating on functions themselves the real power of
: functional programming?
: clojure is popular, and handy, but I feel a large part of that comes from

avatar
p*2
243
FP这几年越来越流行不就是主要因为parallelism 和 concurrency吗? 传统的
imperative programming不适合做并行计算。
avatar
n*t
244
我认为fp比impertive language来说和当前实际计算机差得更远。
和一般人的思维也不那么接近,但是比较接近数学的思维。
所以相应的结果就是两个,第一效率不会很高,第二比较expressive。
最近的机器越来越快,所以fp开始流行起来了。

【在 p*****2 的大作中提到】
: FP这几年越来越流行不就是主要因为parallelism 和 concurrency吗? 传统的
: imperative programming不适合做并行计算。

avatar
p*2
245

基本这么回事。但是貌似不是机器越来越快造成的吧?机器越来越快已经持续很多年了
。相反是因为机器不能越来越快了,因此现在的趋势是core越来越多,所以fp流行起来
了。

【在 n******t 的大作中提到】
: 我认为fp比impertive language来说和当前实际计算机差得更远。
: 和一般人的思维也不那么接近,但是比较接近数学的思维。
: 所以相应的结果就是两个,第一效率不会很高,第二比较expressive。
: 最近的机器越来越快,所以fp开始流行起来了。

avatar
x*u
246
core多不会提高fp速度啊。现实点说,不在乎速度的场合才能用FP。

【在 p*****2 的大作中提到】
:
: 基本这么回事。但是貌似不是机器越来越快造成的吧?机器越来越快已经持续很多年了
: 。相反是因为机器不能越来越快了,因此现在的趋势是core越来越多,所以fp流行起来
: 了。

avatar
p*2
247

core多就需要更好的并行计算了。FP在单线程上确实效率没法跟OO的比,但是多线程具
有先天的优势。这也是为什么随着core越来越多,fp越来越流行的真正原因。

【在 x****u 的大作中提到】
: core多不会提高fp速度啊。现实点说,不在乎速度的场合才能用FP。
avatar
x*u
248
FP和并行有什么关系。

【在 p*****2 的大作中提到】
:
: core多就需要更好的并行计算了。FP在单线程上确实效率没法跟OO的比,但是多线程具
: 有先天的优势。这也是为什么随着core越来越多,fp越来越流行的真正原因。

avatar
p*2
249

imperative对并行计算有先天的缺陷呀。这些缺陷FP上都没有呀。如果你这个还有疑问
的话,最好先看看FP的基本概念。

【在 x****u 的大作中提到】
: FP和并行有什么关系。
avatar
x*u
250
先天缺陷什么啊,VC都支持lambda了。

【在 p*****2 的大作中提到】
:
: imperative对并行计算有先天的缺陷呀。这些缺陷FP上都没有呀。如果你这个还有疑问
: 的话,最好先看看FP的基本概念。

avatar
p*2
251

这个跟lambda没啥关系。支持lambada的语言多了,有几个敢说自己是FP呢?

【在 x****u 的大作中提到】
: 先天缺陷什么啊,VC都支持lambda了。
avatar
n*t
252
每一个core不能变快,但是对于大部分应用还是太快。
所以core多,和处理能力强很多时候是一样的。
此外,大部分fp对list和vector支持比较好,所以对于自然并行化的
问题,比较容易scale.

【在 p*****2 的大作中提到】
:
: 这个跟lambda没啥关系。支持lambada的语言多了,有几个敢说自己是FP呢?

avatar
p*2
253

core多也需要application的优化才能转化为更好的性能。即使在OS的level也需要支持
multi core,不然也获得不了应有的benefit。OS支持了,你可以认为处理能力更强了
。但是那是从OS的角度来说的。从application角度也需要支持multi core,否则这个
application就没有take multi core的benefit。而FP正是从application level来讲的
。显然FP做不了底层。

【在 n******t 的大作中提到】
: 每一个core不能变快,但是对于大部分应用还是太快。
: 所以core多,和处理能力强很多时候是一样的。
: 此外,大部分fp对list和vector支持比较好,所以对于自然并行化的
: 问题,比较容易scale.

avatar
p*2
254

关键不是对list vector支持好。

【在 n******t 的大作中提到】
: 每一个core不能变快,但是对于大部分应用还是太快。
: 所以core多,和处理能力强很多时候是一样的。
: 此外,大部分fp对list和vector支持比较好,所以对于自然并行化的
: 问题,比较容易scale.

avatar
n*t
255
fp常常是用来计算已经被分拆之后的task,也就是一个core上跑的任务。

【在 p*****2 的大作中提到】
:
: 关键不是对list vector支持好。

avatar
p*2
256

拆分之后为什么只在一个core上跑?

【在 n******t 的大作中提到】
: fp常常是用来计算已经被分拆之后的task,也就是一个core上跑的任务。
avatar
x*u
257
VC支持lambda是为了应对多核,和FP没关系。

【在 p*****2 的大作中提到】
:
: 拆分之后为什么只在一个core上跑?

avatar
x*u
258
不说别的,OS启动这一块的支持就不好。

【在 n******t 的大作中提到】
: 每一个core不能变快,但是对于大部分应用还是太快。
: 所以core多,和处理能力强很多时候是一样的。
: 此外,大部分fp对list和vector支持比较好,所以对于自然并行化的
: 问题,比较容易scale.

avatar
t*a
259
I don't really see the point of using functional programming languages for
real production projects, though clojure is very popular now.
好问题,但也许你尝试用FP语言做一做事情,亲身体验一下,会有不同的感觉。
my point is that in a few cases you do need to operate on functions, all
languages have such features: C has function pointers, java has anonymous
inner classes, python has lambda. it's just that they do not openly
advertise them as "functional".
FP和上述冯诺依曼机式语言有好些地方不一样。最主要之一是immutable的数据结构。
个人的体会是它使得写程序减少了变量,强迫程序员用类似数学推理的方式写程序,提
高了程序的正确性。
在写Clojure程序的时候,我的体会是应该考虑“是什么”,而不是“怎么做”,这点
和冯诺依曼机式语言明显不同。
but even clojure itself does not recommend using non-named functions
recursive, but isn't operating on functions themselves the real power of
functional programming?
真的吗?我没看到这个recommend,能给个出处好么?我通常用anonymous function和
map函数配合,譬如(map #(+ x 2) (list 1 2 3)),如果有其他推荐的方法,请教教我。
clojure is popular, and handy, but I feel a large part of that comes from
the easiness of kind of using java as a scripting language , so that u don't
need to go through the compile/build/run cycle, and the iteration is much
faster, kind of like for prototyping purposes. the only real difference of
clojure to java, I feel, is the annoying prefix notation, which is
completely useless, and the syntax could have been completely re-designed to
be like most languages to give users a more natural, intuitive feeling.
The prefix notation and endless "()" is just an archaic legacy left over
from when LISP was created.
JVM的scripting language由来已久。如果你喜欢偏java格式的语法,可以尝试
beanshell, groovy。你也有其他选择比如Jython, JRuby。
简单就是美。Prefix notation使得Lisp/Clojure用统一的格式,不受语法的限制,个
人以为这正是它美的地方。而且,如果没有了Prefix notation,还如何能使用macro,
operate code as data呢?
刚接触Lisp的同学可能会有些排斥lisp古怪的括号。当你习惯了它的时候,你会喜欢上
它的。
心得:
1. 你需要一个好的编辑器,推荐emacs。NREPL,或者slime+swank-clojure让我感觉超
越了python, R的交互环境,也许你也会这么觉得。
2. 手工配对括号是很麻烦的事情,需要自动配对工具。在emacs下推荐paredit +
rainbow-delimiter。
avatar
b*n
260
scala 中一个 par 指令就可以做并行运算了。

【在 n******t 的大作中提到】
: fp常常是用来计算已经被分拆之后的task,也就是一个core上跑的任务。
avatar
x*u
261
FP除了效率不行外,没有任何缺点。

【在 t****a 的大作中提到】
: I don't really see the point of using functional programming languages for
: real production projects, though clojure is very popular now.
: 好问题,但也许你尝试用FP语言做一做事情,亲身体验一下,会有不同的感觉。
: my point is that in a few cases you do need to operate on functions, all
: languages have such features: C has function pointers, java has anonymous
: inner classes, python has lambda. it's just that they do not openly
: advertise them as "functional".
: FP和上述冯诺依曼机式语言有好些地方不一样。最主要之一是immutable的数据结构。
: 个人的体会是它使得写程序减少了变量,强迫程序员用类似数学推理的方式写程序,提
: 高了程序的正确性。

avatar
p*2
262

大牛终于出现了。

【在 t****a 的大作中提到】
: I don't really see the point of using functional programming languages for
: real production projects, though clojure is very popular now.
: 好问题,但也许你尝试用FP语言做一做事情,亲身体验一下,会有不同的感觉。
: my point is that in a few cases you do need to operate on functions, all
: languages have such features: C has function pointers, java has anonymous
: inner classes, python has lambda. it's just that they do not openly
: advertise them as "functional".
: FP和上述冯诺依曼机式语言有好些地方不一样。最主要之一是immutable的数据结构。
: 个人的体会是它使得写程序减少了变量,强迫程序员用类似数学推理的方式写程序,提
: 高了程序的正确性。

avatar
p*2
263

这个不是这样子的吧?lambda本来就是fp的东西吧?怎么能说没关系呢?

【在 x****u 的大作中提到】
: VC支持lambda是为了应对多核,和FP没关系。
avatar
p*2
264

这个不一定吧?
FP效率不高并不是绝对的,而且在并行计算有先天的优势。效率应该比imperative的更
高才对。
FP的缺点其实也不少,不然OO早被干掉了。

【在 x****u 的大作中提到】
: FP除了效率不行外,没有任何缺点。
avatar
x*u
265
匿名函数和fp没什么必然联系。

【在 p*****2 的大作中提到】
:
: 这个不一定吧?
: FP效率不高并不是绝对的,而且在并行计算有先天的优势。效率应该比imperative的更
: 高才对。
: FP的缺点其实也不少,不然OO早被干掉了。

avatar
x*u
266
就算是并行,分到每个核上面还是冯诺依曼架构。

【在 p*****2 的大作中提到】
:
: 这个不一定吧?
: FP效率不高并不是绝对的,而且在并行计算有先天的优势。效率应该比imperative的更
: 高才对。
: FP的缺点其实也不少,不然OO早被干掉了。

avatar
p*2
267

这个有什么根据吗?

【在 x****u 的大作中提到】
: 匿名函数和fp没什么必然联系。
avatar
p*2
268

但是并行以后性能可以提升呀。所以不是FP就性能一定差呀。

【在 x****u 的大作中提到】
: 就算是并行,分到每个核上面还是冯诺依曼架构。
avatar
x*u
269
FP的问题是计算量越大,CPU越不是图灵机。

【在 p*****2 的大作中提到】
:
: 但是并行以后性能可以提升呀。所以不是FP就性能一定差呀。

avatar
p*2
270

这是刚从wiki上查的
First class functions have slowly been added to mainstream languages. For
example, in early 1994, support for lambda, filter, map, and reduce was
added to Python. Then during the development of Python 3000, Guido van
Rossum called for the removal of these features.[40][41] So far, only the
reduce function has been removed, but remains accessible via the functools
standard library module.[42] First class functions were also introduced in
PHP 5.3, Visual Basic 9, C# 3.0, and C++11.
The Language Integrated Query (LINQ) feature, with its many incarnations, is
an obvious and powerful use of functional programming in .NET.

【在 x****u 的大作中提到】
: 匿名函数和fp没什么必然联系。
avatar
p*2
271

太高深了。不明白。跟我们讨论的并行有什么关系吗?

【在 x****u 的大作中提到】
: FP的问题是计算量越大,CPU越不是图灵机。
avatar
x*u
272
这是什么乱七八糟的。JavaScript也支持匿名函数,莫非JS也是FP?

is

【在 p*****2 的大作中提到】
:
: 太高深了。不明白。跟我们讨论的并行有什么关系吗?

avatar
x*u
273
就是说FP在极端条件下不好用,因为整个架构就不是为它设计的。你要是用过以前的计
算机就明白了。

【在 p*****2 的大作中提到】
:
: 太高深了。不明白。跟我们讨论的并行有什么关系吗?

avatar
p*2
274

好了。终于明白你的逻辑了。I服了Y。

【在 x****u 的大作中提到】
: 这是什么乱七八糟的。JavaScript也支持匿名函数,莫非JS也是FP?
:
: is

avatar
x*u
275
你悲愤也没用。
90年代的C++也支持匿名函数,只要按照COM的Automation规范写即可。

【在 p*****2 的大作中提到】
:
: 好了。终于明白你的逻辑了。I服了Y。

avatar
g*g
276
FP的最大缺点,不是慢,而是太难。太难的语言,想找够人写个大项目都不可能,想找
个有10年经验的来带项目市面上不存在。
不是没有例外呀,Erlang就算一个。但例外终究是例外,不是主流。
avatar
x*u
277
就是一个慢。想快的话就不能顺着FP的自然思路写,那就是自己整自己了。

【在 g*****g 的大作中提到】
: FP的最大缺点,不是慢,而是太难。太难的语言,想找够人写个大项目都不可能,想找
: 个有10年经验的来带项目市面上不存在。
: 不是没有例外呀,Erlang就算一个。但例外终究是例外,不是主流。

avatar
g*g
278
Scala的性能接近Java,比Python, Ruby之类的scripting语言快,不能算慢了。

【在 x****u 的大作中提到】
: 就是一个慢。想快的话就不能顺着FP的自然思路写,那就是自己整自己了。
avatar
x*u
279
做个大东西,就有差距了。类似的例子任何两个语言都能找出来。

【在 g*****g 的大作中提到】
: Scala的性能接近Java,比Python, Ruby之类的scripting语言快,不能算慢了。
avatar
g*g
280
性能不是唯一重要的东西,特别差别没超过一个数量级的情况下。就如java性能永远比
不上C++,照样在很多领域取代C++没有压力。开发快速,维护容易,永远是最重要的。
FP简洁是做到了,是否快速要看什么领域。

【在 x****u 的大作中提到】
: 做个大东西,就有差距了。类似的例子任何两个语言都能找出来。
avatar
x*u
281
所以说JavaScript也能长盛不衰,主要是特定场合有特定用处。

【在 g*****g 的大作中提到】
: 性能不是唯一重要的东西,特别差别没超过一个数量级的情况下。就如java性能永远比
: 不上C++,照样在很多领域取代C++没有压力。开发快速,维护容易,永远是最重要的。
: FP简洁是做到了,是否快速要看什么领域。

avatar
t*s
282
最近在学Haskell
看learn yourself a haskell七八章了。到现在为止没看到Python没有的feature.
Python里面partial, list comprehension, map, reduce, filter都有
什么Eq Ord Show这种Python也有,例如, 一个类如果定义了 __lt__ 等等就能比较
所谓Monad也是故弄玄虚,我专门去看了Philp Wadler (principle designer of
Haskell)的Monads for functional programming。Monad两个字就能解释: annotated
data. 顶多把那三个laws再加上。
Maybe有点意思,但imperative的Exceptional Handling更方便,更有效率。
最不爽的是Haskell readability sucks。
唯一Haskell比Python舒服的地方我觉得是函数定义强制
->a->a->a->b 这个背后的点子非常聪明,非常mathematically beautiful
另外就是匹配中的_符号很符合数学规范。

【在 c******n 的大作中提到】
: I don't really see the point of using functional programming languages for
: real production projects, though clojure is very popular now.
: my point is that in a few cases you do need to operate on functions, all
: languages have such features: C has function pointers, java has anonymous
: inner classes, python has lambda. it's just that they do not openly
: advertise them as "functional".
: but even clojure itself does not recommend using non-named functions
: recursive, but isn't operating on functions themselves the real power of
: functional programming?
: clojure is popular, and handy, but I feel a large part of that comes from

avatar
s*o
283
刚跟stackoverflow上的“专家”交流了一下关于Java8跟Scala,专家坚持认为java is
slow, slow, slow...
"chat with an expert" 是stackoverflow 今天推出来的一个新服务,有兴趣的可以去
试一试

【在 g*****g 的大作中提到】
: Scala的性能接近Java,比Python, Ruby之类的scripting语言快,不能算慢了。
avatar
E*m
284

行行行! 你回去拜耶穌比你講你不懂的圖靈機實際點。

【在 x****u 的大作中提到】
: FP的问题是计算量越大,CPU越不是图灵机。
avatar
E*m
285
Abstract data type, pattern matching, guard, laziness...
你用 Python 做這些看看。

annotated

【在 t*s 的大作中提到】
: 最近在学Haskell
: 看learn yourself a haskell七八章了。到现在为止没看到Python没有的feature.
: Python里面partial, list comprehension, map, reduce, filter都有
: 什么Eq Ord Show这种Python也有,例如, 一个类如果定义了 __lt__ 等等就能比较
: 所谓Monad也是故弄玄虚,我专门去看了Philp Wadler (principle designer of
: Haskell)的Monads for functional programming。Monad两个字就能解释: annotated
: data. 顶多把那三个laws再加上。
: Maybe有点意思,但imperative的Exceptional Handling更方便,更有效率。
: 最不爽的是Haskell readability sucks。
: 唯一Haskell比Python舒服的地方我觉得是函数定义强制

avatar
d*i
286
OpenMP不就是为了多核并行计算提出来的吗?

【在 p*****2 的大作中提到】
: FP这几年越来越流行不就是主要因为parallelism 和 concurrency吗? 传统的
: imperative programming不适合做并行计算。

avatar
E*m
287

沒哪個語言不能做並行,好不好做的差別而已。

【在 d****i 的大作中提到】
: OpenMP不就是为了多核并行计算提出来的吗?
avatar
e*o
288
直接从clojure doc 上拿个例子。
(((person :employer) :address) :city)
clojure 提供了个 macro ->
所以可以这样写。
(-> person :employer :address :city)
在别的语言中,大致类似的写法是 person.employer.address.city
你喜欢哪个写法? 这个例子说明什么呢?

【在 t****a 的大作中提到】
: I don't really see the point of using functional programming languages for
: real production projects, though clojure is very popular now.
: 好问题,但也许你尝试用FP语言做一做事情,亲身体验一下,会有不同的感觉。
: my point is that in a few cases you do need to operate on functions, all
: languages have such features: C has function pointers, java has anonymous
: inner classes, python has lambda. it's just that they do not openly
: advertise them as "functional".
: FP和上述冯诺依曼机式语言有好些地方不一样。最主要之一是immutable的数据结构。
: 个人的体会是它使得写程序减少了变量,强迫程序员用类似数学推理的方式写程序,提
: 高了程序的正确性。

avatar
t*s
289
python的duck type更general.
pattern matching在imperative语言中根本不是问题。也更灵活。
不光可以pattern matching, 还可以value matching
laziness python也有, generator.
guard是啥不知道

【在 E*****m 的大作中提到】
: Abstract data type, pattern matching, guard, laziness...
: 你用 Python 做這些看看。
:
: annotated

avatar
t*a
290
我看到的多数人采用->的写法,它的好处可能有
1. 减少了小括号的数目
这是Clojure比Common Lisp改进的方向。Clojure在语言设计上已经想办法减少()的数
目。
2. 提高可读性。
这种写法有点像OOP语言里访问成员的方式。联想到很多Clojure程序员是从Java语言转
过来的,很多人喜欢这样写也就很自然了。

【在 e*******o 的大作中提到】
: 直接从clojure doc 上拿个例子。
: (((person :employer) :address) :city)
: clojure 提供了个 macro ->
: 所以可以这样写。
: (-> person :employer :address :city)
: 在别的语言中,大致类似的写法是 person.employer.address.city
: 你喜欢哪个写法? 这个例子说明什么呢?

avatar
p*2
291
一个最基本的尾递归就把python秒了吧

annotated

【在 t*s 的大作中提到】
: 最近在学Haskell
: 看learn yourself a haskell七八章了。到现在为止没看到Python没有的feature.
: Python里面partial, list comprehension, map, reduce, filter都有
: 什么Eq Ord Show这种Python也有,例如, 一个类如果定义了 __lt__ 等等就能比较
: 所谓Monad也是故弄玄虚,我专门去看了Philp Wadler (principle designer of
: Haskell)的Monads for functional programming。Monad两个字就能解释: annotated
: data. 顶多把那三个laws再加上。
: Maybe有点意思,但imperative的Exceptional Handling更方便,更有效率。
: 最不爽的是Haskell readability sucks。
: 唯一Haskell比Python舒服的地方我觉得是函数定义强制

avatar
E*m
292

這怎麼來的?
你到底讀了那本書沒有? 我覺得你沒有。
我說的 pattern matching 是這種
sum [] = 0
sum x:xs = x + sum xs
python 的太有限, 你看看這個經典算 Fibonacci series 的
fibs :: [Integer]
fibs = 1:1:zipwith (+) fibs (tail fibs)
python 做不到這麼精簡的
Learn You a Haskell for Great Good! 第四章
我不是Python 黑,事實上我是Python 粉, 不過各有
長處罷了。

【在 t*s 的大作中提到】
: python的duck type更general.
: pattern matching在imperative语言中根本不是问题。也更灵活。
: 不光可以pattern matching, 还可以value matching
: laziness python也有, generator.
: guard是啥不知道

avatar
A*t
293
您学过theory of computation或者mathematical logic吗?

【在 x****u 的大作中提到】
: FP的问题是计算量越大,CPU越不是图灵机。
avatar
A*t
294
求问GADT, template Haskell, type based reflection, quasiquoting 在python里面
是咋做的。

【在 t*s 的大作中提到】
: python的duck type更general.
: pattern matching在imperative语言中根本不是问题。也更灵活。
: 不光可以pattern matching, 还可以value matching
: laziness python也有, generator.
: guard是啥不知道

avatar
E*m
295

他上次已經發貼曝露他沒搞懂啥教 Turing Machine 了。

【在 A*******t 的大作中提到】
: 您学过theory of computation或者mathematical logic吗?
avatar
L*n
296
那位就是灌水扯淡的

【在 E*****m 的大作中提到】
:
: 他上次已經發貼曝露他沒搞懂啥教 Turing Machine 了。

avatar
E*m
297
他是信耶穌的, 凡事講信仰,不講證據。

【在 L***n 的大作中提到】
: 那位就是灌水扯淡的
avatar
t*s
298
google了一下
这个是haskell编译懂得优化,还是需要人为的写,例如用fold?
如果是用fold, python也有,但只是从左到右
要reverse效率会下降。

【在 p*****2 的大作中提到】
: 一个最基本的尾递归就把python秒了吧
:
: annotated

avatar
t*s
299
一个都没听说过

【在 A*******t 的大作中提到】
: 求问GADT, template Haskell, type based reflection, quasiquoting 在python里面
: 是咋做的。

avatar
e*o
300
我开始看的时候也没懂pattern matching。
-----------
我也秀几个fibs,从长到短。
@fibs1 := 1, 1, -> $a, $b { $a + $b } ... * ;
@fibs2 := 1, 1, {$^a + $^b } ... * ;
@fibs3 := 1, 1, * + * ... * ;
@fibs4 := 1, 1, &[+] ... * ;
这就是臭名昭著的perl6。
perl6 也支持pattern matching的。

【在 E*****m 的大作中提到】
: 他是信耶穌的, 凡事講信仰,不講證據。
avatar
t*s
301
sum [] = 0
sum x:xs = x + sum xs
我说的就是这种,这类型的在python/c/java里面就是if if 的事情
if 还不光看pattern, value也能一并看了。
fibs :: [Integer]
fibs = 1:1:zipwith (+) fibs (tail fibs)
python里面yield from, yield来构建generator也很方便,例如
def fibs():
a,b=1,1
yield from (a,b)
while True:
a,b=b,a+b
yield b
guard我去看了一下,这也叫feature? 难怪我不记得。就是switch case case

【在 E*****m 的大作中提到】
: 他是信耶穌的, 凡事講信仰,不講證據。
avatar
g*r
302
Functional Language都出来40年了,很多概念模式被其他语言也吸收了不少,比如JS
和C#里就有大量Functional的feature和用法,估计Python里应该也有不少吧
imperative语言的特点就是你告诉计算机怎么去做一件事,if..else就是告诉计算机先
比较这俩数,如果true就干这个事;functional的特点就是只告诉计算机要完成的任务
是啥,pattern matching就是定义一个函数,然后计算机来帮你分析执行;我感觉
functional的写法还是更high level、更简洁一点,当然区别可能也没那么大,所以很
多人觉得这是脱裤子放屁
要说实现都能实现,有啥不能实现的,用汇编也就是几个CMP,JNE
说来也就是你喜欢那种,那个效率高,对于某些特定的问题哪个更有优势。通用语言肯
定还是用得最广的,但通用语言也是不断的在加入Functional Programming的概念,以
后我觉得也是multi paradigm语言的有点前途,比如F#和Scala这种,纯粹的
Functional Language比如haskell,我觉得很难在工业界流行开来,当然作为业余爱好
,搞点小东西,作为学习研究对象还是有价值的

【在 t*s 的大作中提到】
: sum [] = 0
: sum x:xs = x + sum xs
: 我说的就是这种,这类型的在python/c/java里面就是if if 的事情
: if 还不光看pattern, value也能一并看了。
: fibs :: [Integer]
: fibs = 1:1:zipwith (+) fibs (tail fibs)
: python里面yield from, yield来构建generator也很方便,例如
: def fibs():
: a,b=1,1
: yield from (a,b)

avatar
E*m
303

沒什麼是 Python (或任何 TM-complete 語言) 一定做不到的,差別
就是簡潔易懂否, 你那個 fibs 例子就長了幾倍,不是嗎?
還有個 laziness 的例子 python 更難做的, 用 sieve 來求質數
primesT = sieve [2..] where
sieve (p:xs) = p : sieve [x | x 然後求前 100 個質數就是
take 100 primesT
當然, 我不否認不是所有東西都需要 laziness,只是有時 laziness
會讓題目比較好解。

【在 t*s 的大作中提到】
: sum [] = 0
: sum x:xs = x + sum xs
: 我说的就是这种,这类型的在python/c/java里面就是if if 的事情
: if 还不光看pattern, value也能一并看了。
: fibs :: [Integer]
: fibs = 1:1:zipwith (+) fibs (tail fibs)
: python里面yield from, yield来构建generator也很方便,例如
: def fibs():
: a,b=1,1
: yield from (a,b)

avatar
w*w
304
给个简单例子:
20年前,你写了个复杂的SQL query,在当时的sql server上要运行2个月。现在同样的
query用不同的硬件和database engine,两秒钟就出来了。FP只告诉计算机要什么,至
于怎么做就不管了。系统软件硬件发展越快,FP的优势就会越来越明显。
avatar
p*2
305

JS
大牛说的很好。

【在 g****r 的大作中提到】
: Functional Language都出来40年了,很多概念模式被其他语言也吸收了不少,比如JS
: 和C#里就有大量Functional的feature和用法,估计Python里应该也有不少吧
: imperative语言的特点就是你告诉计算机怎么去做一件事,if..else就是告诉计算机先
: 比较这俩数,如果true就干这个事;functional的特点就是只告诉计算机要完成的任务
: 是啥,pattern matching就是定义一个函数,然后计算机来帮你分析执行;我感觉
: functional的写法还是更high level、更简洁一点,当然区别可能也没那么大,所以很
: 多人觉得这是脱裤子放屁
: 要说实现都能实现,有啥不能实现的,用汇编也就是几个CMP,JNE
: 说来也就是你喜欢那种,那个效率高,对于某些特定的问题哪个更有优势。通用语言肯
: 定还是用得最广的,但通用语言也是不断的在加入Functional Programming的概念,以

avatar
l*s
306
enlightening

JS

【在 g****r 的大作中提到】
: Functional Language都出来40年了,很多概念模式被其他语言也吸收了不少,比如JS
: 和C#里就有大量Functional的feature和用法,估计Python里应该也有不少吧
: imperative语言的特点就是你告诉计算机怎么去做一件事,if..else就是告诉计算机先
: 比较这俩数,如果true就干这个事;functional的特点就是只告诉计算机要完成的任务
: 是啥,pattern matching就是定义一个函数,然后计算机来帮你分析执行;我感觉
: functional的写法还是更high level、更简洁一点,当然区别可能也没那么大,所以很
: 多人觉得这是脱裤子放屁
: 要说实现都能实现,有啥不能实现的,用汇编也就是几个CMP,JNE
: 说来也就是你喜欢那种,那个效率高,对于某些特定的问题哪个更有优势。通用语言肯
: 定还是用得最广的,但通用语言也是不断的在加入Functional Programming的概念,以

avatar
c*n
307
I think a big problem with the FP camp is that they keep peddling the old
stuff, which, as you said, may be brilliant in the 60's, but are so common
today that the listener find it hard to understand why the FP enthusiasts
say it's a big deal.
FP camp should look at the world today and sell the true deltas above other
languages.

JS

【在 g****r 的大作中提到】
: Functional Language都出来40年了,很多概念模式被其他语言也吸收了不少,比如JS
: 和C#里就有大量Functional的feature和用法,估计Python里应该也有不少吧
: imperative语言的特点就是你告诉计算机怎么去做一件事,if..else就是告诉计算机先
: 比较这俩数,如果true就干这个事;functional的特点就是只告诉计算机要完成的任务
: 是啥,pattern matching就是定义一个函数,然后计算机来帮你分析执行;我感觉
: functional的写法还是更high level、更简洁一点,当然区别可能也没那么大,所以很
: 多人觉得这是脱裤子放屁
: 要说实现都能实现,有啥不能实现的,用汇编也就是几个CMP,JNE
: 说来也就是你喜欢那种,那个效率高,对于某些特定的问题哪个更有优势。通用语言肯
: 定还是用得最广的,但通用语言也是不断的在加入Functional Programming的概念,以

avatar
t*a
308
你能否说具体一点?比如哪些是old stuff,brilliant in the 60's但是今天so
common?如果你说的是你原文中给出的那些材料,那么这些回帖里面已经说的很清楚了
:今天的language并没有完全实现那些feature。
另外,FP中有趣的概念很多,不仅仅是你的帖子中说到的那些。

other

【在 c******n 的大作中提到】
: I think a big problem with the FP camp is that they keep peddling the old
: stuff, which, as you said, may be brilliant in the 60's, but are so common
: today that the listener find it hard to understand why the FP enthusiasts
: say it's a big deal.
: FP camp should look at the world today and sell the true deltas above other
: languages.
:
: JS

avatar
t*a
309
市场上可用的语言越来越多是不争的事实。通用语言可以保证容易找到饭碗,专用语言
在专有领域具有优势。
另外FP和Imperative语言的差别..个人觉得还是蛮大的,最主要的是会改变程序员思考
问题的方式。
如果哪个程序员说他很随意的在纯FP语言和纯Imperative语言之间转换思维,从而总是
能在合适的地方用最适合的方式,那倒真是令人佩服。

JS

【在 g****r 的大作中提到】
: Functional Language都出来40年了,很多概念模式被其他语言也吸收了不少,比如JS
: 和C#里就有大量Functional的feature和用法,估计Python里应该也有不少吧
: imperative语言的特点就是你告诉计算机怎么去做一件事,if..else就是告诉计算机先
: 比较这俩数,如果true就干这个事;functional的特点就是只告诉计算机要完成的任务
: 是啥,pattern matching就是定义一个函数,然后计算机来帮你分析执行;我感觉
: functional的写法还是更high level、更简洁一点,当然区别可能也没那么大,所以很
: 多人觉得这是脱裤子放屁
: 要说实现都能实现,有啥不能实现的,用汇编也就是几个CMP,JNE
: 说来也就是你喜欢那种,那个效率高,对于某些特定的问题哪个更有优势。通用语言肯
: 定还是用得最广的,但通用语言也是不断的在加入Functional Programming的概念,以

avatar
g*g
310
说Java慢看跟什么比,跟C比自然是慢的。我见过的benchmark,都比Scala快一点。

is

【在 s***o 的大作中提到】
: 刚跟stackoverflow上的“专家”交流了一下关于Java8跟Scala,专家坚持认为java is
: slow, slow, slow...
: "chat with an expert" 是stackoverflow 今天推出来的一个新服务,有兴趣的可以去
: 试一试

avatar
s*o
311
that's a stackoverflow "new feature" available on April 1 :)
不过我的确是去看java 8对scala能造成啥影响的话题的。好虫说一下,scala还有没有
成为主流的可能,或者一直这么不温不火下去?

【在 g*****g 的大作中提到】
: 说Java慢看跟什么比,跟C比自然是慢的。我见过的benchmark,都比Scala快一点。
:
: is

avatar
x*u
312
你这就不是扯淡,是发paper。

【在 L***n 的大作中提到】
: 那位就是灌水扯淡的
avatar
a*e
313
你有这样的感觉没错,Python 的这些概念都来源于 FP,事实上,从 Lisp 引入 GC 开
始,非常多的 FP 的特征,已经越来越普遍地进入到其它非 FP 的语言。
我想你要问的是,既然这样,为什么要学习 Haskell 或者 FP?
我给几个 Haskell 有,但是你在 python 里面学不到的东西吧:
1. Strong type system
duck typing 看似更灵活,但是实际上它只是一个 sum of all types,没办法保证
type safty。有时候更 general 不是好事情,反而是有限制,尤其是编译器能够通过
静态检查就能确保程序遵守了这些限制,更有益处。举个例子,很多语言都有 SQL 的
库可用,但有几个能够静态检查,确保所有发出的 SQL 查询都是合法的?再比如,一
个程序需要处理平衡二叉树,你能够通过静态检查就确保不会发生不平衡的情况出现吗
?这些只有强类型的 abstract datatype 才能做到。
如果你要进一步学习 type system,那么 LYAH 这本书是不够的,需要看一些程序语言
的教科书。
2. Monad
首先,这个概念本身是超出计算机语言的,无论你用那种方式写程序,只要有满足
monad 的结构,它就在那里,无非是作为一个程序员,你是否意识到了,意识到之后是
否能够利用 monad 的特征来完成想要完成的任务。
Monad 最先用于编程就是在 Haskell 里,这不是一个巧合。只有 Haskell 如此偏执地
追求无副作用操作,才有 Monad,以及更多 category 理论概念存在的土壤。
到底 Monad 有什么用?我举个例子。如果你学习一下 CPS Monad,然后实现一个 co-
routine 到 event loop 的变换,就能够了解由 Node.js 引发的 async 编程潮流,只
是一个浮夸的假象。在 Haskell 里面,根本无需语言本身支持,直接能够写出 co-
routine 程序,以 async 方式执行。
3. Fusion
这个牵涉到编译器的技术,可能不是所有人感兴趣。不过那些认为高级语言,或者是抽
象层高的编程方式,肯定是没有效率的说法,可以休矣。
举个我今天遇到的例子,一个 image convolution 的 Haskell 程序,居然把 memory
bandwidth 耗尽,比 C 程序快了近十倍,然后 4 thread 和 1 thread 执行起来时间
是一样的,完全没有道理,让我同事很伤脑筋。后来经过分析机器码发现,是因为源程
序里用来测试的 image 也是写在程序里通过一个函数生成的,编译器居然把所有的计
算(从 src image 读入数据,计算,写入 dst image)化简为直接向 dst image 写入
constant。
虽然是个极端的例子,但是这种对源程序进行推理,利用代数性质做等效变换,最后能
够生成非常高效代码的方式,只有在纯 FP 语言里才有可能做到。
当然反过来说,认为 FP 的效率已经比 C 好了,也是没有什么道理的。但一个不争的
事实是,符合高层次逻辑的程序更容易写,更容易维护,而另一方面 CPU 的发展导致
只有紧贴机器层面才能够高效发挥硬件潜力。这两者之间的 gap 越来越大,而 FP 的
理论可以把人从 SIMD/Cache Miss/Multi-Core 等等调优的繁琐过程中解放出来,从而
维持原代码的模块和逻辑清晰。
4. DSL
这个是我喜欢 Haskell 的主要原因。没有任何一个语言能够像 Haskell 这样灵活
地实现 DSL/eDSL,对程序做分析,重组,解释甚至和元语言一块儿编译执行。因为
DSL 本身是直接以 combinator 或者 monad 方式写在 Haskell 程序里面的,
无须另外做 lexer/parser,连类型检查都是免费得来。
Haskell 的类型系统在这里帮了很多忙,它的 type class 让很多繁复的 AST
操作变得非常模块化,对副作用的严格控制也让 DSL 更加安全可靠。所以
Simon PJ 说 Haskell is the best imperative programming language
不是没有道理的。

annotated

【在 t*s 的大作中提到】
: 最近在学Haskell
: 看learn yourself a haskell七八章了。到现在为止没看到Python没有的feature.
: Python里面partial, list comprehension, map, reduce, filter都有
: 什么Eq Ord Show这种Python也有,例如, 一个类如果定义了 __lt__ 等等就能比较
: 所谓Monad也是故弄玄虚,我专门去看了Philp Wadler (principle designer of
: Haskell)的Monads for functional programming。Monad两个字就能解释: annotated
: data. 顶多把那三个laws再加上。
: Maybe有点意思,但imperative的Exceptional Handling更方便,更有效率。
: 最不爽的是Haskell readability sucks。
: 唯一Haskell比Python舒服的地方我觉得是函数定义强制

avatar
r*n
314
我觉得尾递归还不如上loop。

【在 p*****2 的大作中提到】
: 一个最基本的尾递归就把python秒了吧
:
: annotated

avatar
p*2
315

一个东西

【在 r*******n 的大作中提到】
: 我觉得尾递归还不如上loop。
avatar
f*o
316
google trampoline

【在 p*****2 的大作中提到】
:
: 一个东西

avatar
n*w
317
这里常有人用“x能做到的y也能做到为自己辩护”。所有图灵完备的语言都可以做到相
同的事情。不同的是语义,表达能力,等方面的差异。

【在 E*****m 的大作中提到】
:
: 沒什麼是 Python (或任何 TM-complete 語言) 一定做不到的,差別
: 就是簡潔易懂否, 你那個 fibs 例子就長了幾倍,不是嗎?
: 還有個 laziness 的例子 python 更難做的, 用 sieve 來求質數
: primesT = sieve [2..] where
: sieve (p:xs) = p : sieve [x | x : 然後求前 100 個質數就是
: take 100 primesT
: 當然, 我不否認不是所有東西都需要 laziness,只是有時 laziness
: 會讓題目比較好解。

avatar
g*g
318
看你怎么定义主流,到今天ruby的流行程度是很有可能的,超越java是没有可能的。

【在 s***o 的大作中提到】
: that's a stackoverflow "new feature" available on April 1 :)
: 不过我的确是去看java 8对scala能造成啥影响的话题的。好虫说一下,scala还有没有
: 成为主流的可能,或者一直这么不温不火下去?

avatar
x*o
319
写的真不错

【在 a*****e 的大作中提到】
: 你有这样的感觉没错,Python 的这些概念都来源于 FP,事实上,从 Lisp 引入 GC 开
: 始,非常多的 FP 的特征,已经越来越普遍地进入到其它非 FP 的语言。
: 我想你要问的是,既然这样,为什么要学习 Haskell 或者 FP?
: 我给几个 Haskell 有,但是你在 python 里面学不到的东西吧:
: 1. Strong type system
: duck typing 看似更灵活,但是实际上它只是一个 sum of all types,没办法保证
: type safty。有时候更 general 不是好事情,反而是有限制,尤其是编译器能够通过
: 静态检查就能确保程序遵守了这些限制,更有益处。举个例子,很多语言都有 SQL 的
: 库可用,但有几个能够静态检查,确保所有发出的 SQL 查询都是合法的?再比如,一
: 个程序需要处理平衡二叉树,你能够通过静态检查就确保不会发生不平衡的情况出现吗

avatar
t*s
320
干straw man有意思么?
我的意思就是相对于其他语言(例如Python),Haskell卖点不足, 绝大多数程序员没理
由去学Haskell。
fp的卖点有些什么? pure function, curry, laziness, 常见工具list
comprehension, map, reduce, filter。 这些python都支持。
同时,Haskell有致命的缺点,因为有些算法本身就不适合FP。
遇到适合fp的问题, python程序员也可以写fp风格的code。遇到不适合fp的问题,
Haskell程序员就要头大了。
作为一个Haskell没入门的,我只能说到目前为止, Haskell吸引我的是三点
1 编译语言做科学计算快
2 作为数学出身,Haskell看起来美
3 Haskell的type system很好
Haskell community关键是没有一个好tutorial. 至少我没找到。
learn your a haskell是很烂的tutorial
我review这个tutorial的话我会提如下意见
1. 重点介绍独特的feature, 重点讲motivation
2. remove all unnecessary details, or move ot the reference -- 为什么第二章
就讲一大堆list的库函数?
教c语言的会开篇就把strings.h里面的函数一一列举的么?

【在 n*w 的大作中提到】
: 这里常有人用“x能做到的y也能做到为自己辩护”。所有图灵完备的语言都可以做到相
: 同的事情。不同的是语义,表达能力,等方面的差异。

avatar
E*m
321
我認為 Haskell 的最大賣點應該是不讓你做某些事, 強迫你別弄出
不該有的錯誤。
再說一次, Python 的 laziness 不是同個等級的, 完全不能比。
Haskell 的速度也比 Python 快得多。
Real World Haskell 比 Learn yourself a Haskell 更好點。

【在 t*s 的大作中提到】
: 干straw man有意思么?
: 我的意思就是相对于其他语言(例如Python),Haskell卖点不足, 绝大多数程序员没理
: 由去学Haskell。
: fp的卖点有些什么? pure function, curry, laziness, 常见工具list
: comprehension, map, reduce, filter。 这些python都支持。
: 同时,Haskell有致命的缺点,因为有些算法本身就不适合FP。
: 遇到适合fp的问题, python程序员也可以写fp风格的code。遇到不适合fp的问题,
: Haskell程序员就要头大了。
: 作为一个Haskell没入门的,我只能说到目前为止, Haskell吸引我的是三点
: 1 编译语言做科学计算快

avatar
p*2
322

Haskell不行,不代表FP不行呀。上边不是已经说了吗,python吸收了大量FP的feature
。FP的很多feature还是很有用的,不然Python吸收干嘛?当然了,我也认为混合型的
语言更现实,比如python,ruby,scala这些。

【在 t*s 的大作中提到】
: 干straw man有意思么?
: 我的意思就是相对于其他语言(例如Python),Haskell卖点不足, 绝大多数程序员没理
: 由去学Haskell。
: fp的卖点有些什么? pure function, curry, laziness, 常见工具list
: comprehension, map, reduce, filter。 这些python都支持。
: 同时,Haskell有致命的缺点,因为有些算法本身就不适合FP。
: 遇到适合fp的问题, python程序员也可以写fp风格的code。遇到不适合fp的问题,
: Haskell程序员就要头大了。
: 作为一个Haskell没入门的,我只能说到目前为止, Haskell吸引我的是三点
: 1 编译语言做科学计算快

avatar
L*n
323
做科学计算的用haskell需要很大勇气...

【在 t*s 的大作中提到】
: 干straw man有意思么?
: 我的意思就是相对于其他语言(例如Python),Haskell卖点不足, 绝大多数程序员没理
: 由去学Haskell。
: fp的卖点有些什么? pure function, curry, laziness, 常见工具list
: comprehension, map, reduce, filter。 这些python都支持。
: 同时,Haskell有致命的缺点,因为有些算法本身就不适合FP。
: 遇到适合fp的问题, python程序员也可以写fp风格的code。遇到不适合fp的问题,
: Haskell程序员就要头大了。
: 作为一个Haskell没入门的,我只能说到目前为止, Haskell吸引我的是三点
: 1 编译语言做科学计算快

avatar
E*m
324

除了做練習以外, 用 Haskell 都需要勇氣。

【在 L***n 的大作中提到】
: 做科学计算的用haskell需要很大勇气...
avatar
m*t
325
我怎么听起来觉得你在举反例呢。。。。这个 case 里面编译器干的是多余(可能不安
全)的事情吧。
“编译器居然把所有的计
算(从 src image 读入数据,计算,写入 dst image)化简为直接向 dst image 写入
constant。

最终程序得到想要的结果呢还是不是?你觉得这个是好事?

3. Fusion
这个牵涉到编译器的技术,可能不是所有人感兴趣。不过那些认为高级语言,或者是抽
象层高的编程方式,肯定是没有效率的说法,可以休矣。
举个我今天遇到的例子,一个 image convolution 的 Haskell 程序,居然把 memory
bandwidth 耗尽,比 C 程序快了近十倍,然后 4 thread 和 1 thread 执行起来时间
是一样的,完全没有道理,让我同事很伤脑筋。后来经过分析机器码发现,是因为源程
序里用来测试的 image 也是写在程序里通过一个函数生成的,编译器居然把所有的计
算(从 src image 读入数据,计算,写入 dst image)化简为直接向 dst image 写入
constant。
虽然是个极端的例子,但是这种对源程序进行推理,利用代数性质做等效变换,最后能
够生成非常高效代码的方式,只有在纯 FP 语言里才有可能做到。
当然反过来说,认为 FP 的效率已经比 C 好了,也是没有什么道理的。但一个不争的
事实是,符合高层次逻辑的程序更容易写,更容易维护,而另一方面 CPU 的发展导致
只有紧贴机器层面才能够高效发挥硬件潜力。这两者之间的 gap 越来越大,而 FP 的
理论可以把人从 SIMD/Cache Miss/Multi-Core 等等调优的繁琐过程中解放出来,从而
维持原代码的模块和逻辑清晰。

【在 a*****e 的大作中提到】
: 你有这样的感觉没错,Python 的这些概念都来源于 FP,事实上,从 Lisp 引入 GC 开
: 始,非常多的 FP 的特征,已经越来越普遍地进入到其它非 FP 的语言。
: 我想你要问的是,既然这样,为什么要学习 Haskell 或者 FP?
: 我给几个 Haskell 有,但是你在 python 里面学不到的东西吧:
: 1. Strong type system
: duck typing 看似更灵活,但是实际上它只是一个 sum of all types,没办法保证
: type safty。有时候更 general 不是好事情,反而是有限制,尤其是编译器能够通过
: 静态检查就能确保程序遵守了这些限制,更有益处。举个例子,很多语言都有 SQL 的
: 库可用,但有几个能够静态检查,确保所有发出的 SQL 查询都是合法的?再比如,一
: 个程序需要处理平衡二叉树,你能够通过静态检查就确保不会发生不平衡的情况出现吗

avatar
a*e
326
运行结果完全正确,程序没有任何问题,编译器进行这种程度的优化都是基于数理逻辑
的推断,确保安全。
唯一的问题是运行时间不符合事先的期望,没想到会 saturate memory bandwidth。后
来发现是因为用于测试的 src image 写在了程序里,如果从文件读取,则编译器不会
把这部分也优化掉。

【在 m*********t 的大作中提到】
: 我怎么听起来觉得你在举反例呢。。。。这个 case 里面编译器干的是多余(可能不安
: 全)的事情吧。
: “编译器居然把所有的计
: 算(从 src image 读入数据,计算,写入 dst image)化简为直接向 dst image 写入
: constant。
: ”
: 最终程序得到想要的结果呢还是不是?你觉得这个是好事?
:
: 3. Fusion
: 这个牵涉到编译器的技术,可能不是所有人感兴趣。不过那些认为高级语言,或者是抽

avatar
m*t
327
其实你们应该多说说:什么样的问题用 FP 来解决很合适,和 OOP 比较呢?。内核以
及嵌入式? 前端? game?数据分析?复杂的并行和需要大量内存的科学计算? 我看
到一些 haskell 的例子内存占用似乎比 C 要多好几倍(是不是 immutable 的原因?
),这样对于 memory bandwidth limit
的计算程序怎么弄?
还有说说这东西在大规模开发的时候代码可读性和可维护性?

【在 a*****e 的大作中提到】
: 运行结果完全正确,程序没有任何问题,编译器进行这种程度的优化都是基于数理逻辑
: 的推断,确保安全。
: 唯一的问题是运行时间不符合事先的期望,没想到会 saturate memory bandwidth。后
: 来发现是因为用于测试的 src image 写在了程序里,如果从文件读取,则编译器不会
: 把这部分也优化掉。

avatar
g*g
328
Actor model在Erlang上的使用,是我知道的唯一有说服力的例子。Scala火起来同样也
是因为Actor model的实现(Akka)。除此之外,FP基本上都用在语言相关的领域。

【在 m*********t 的大作中提到】
: 其实你们应该多说说:什么样的问题用 FP 来解决很合适,和 OOP 比较呢?。内核以
: 及嵌入式? 前端? game?数据分析?复杂的并行和需要大量内存的科学计算? 我看
: 到一些 haskell 的例子内存占用似乎比 C 要多好几倍(是不是 immutable 的原因?
: ),这样对于 memory bandwidth limit
: 的计算程序怎么弄?
: 还有说说这东西在大规模开发的时候代码可读性和可维护性?

avatar
E*m
329

隨便舉兩個商用例子, ITA 和 Jane Street 都不是處理語言的。

【在 g*****g 的大作中提到】
: Actor model在Erlang上的使用,是我知道的唯一有说服力的例子。Scala火起来同样也
: 是因为Actor model的实现(Akka)。除此之外,FP基本上都用在语言相关的领域。

avatar
g*g
330
They are not exactly industry-leading companies or applications. ITA was
acquired for 700 Million, PCLN is worth 35 Billion. Jane Street has 280
employees. GS has 30K. Just some perspectives to look at.

【在 E*****m 的大作中提到】
:
: 隨便舉兩個商用例子, ITA 和 Jane Street 都不是處理語言的。

avatar
E*m
331

You forgot what you claimed?
So, which industry leader use FP for language?
I never said FP is already very successful in industry.

【在 g*****g 的大作中提到】
: They are not exactly industry-leading companies or applications. ITA was
: acquired for 700 Million, PCLN is worth 35 Billion. Jane Street has 280
: employees. GS has 30K. Just some perspectives to look at.

avatar
g*g
332
Erlang's usage in Ericsson is an industry leading example. It's high
availability is hard to achieve with other languages. I stress industry
leading because that's only way to convince adoption.

【在 E*****m 的大作中提到】
:
: You forgot what you claimed?
: So, which industry leader use FP for language?
: I never said FP is already very successful in industry.

avatar
E*m
333
Obviously, it's not the only way. Otherwise, how did Java come along?

【在 g*****g 的大作中提到】
: Erlang's usage in Ericsson is an industry leading example. It's high
: availability is hard to achieve with other languages. I stress industry
: leading because that's only way to convince adoption.

avatar
g*g
334
So you don't know nothing about history. Java came along as the industry
leading enterprise application language on server side. C++ was the primary
contest at the time, but it's quickly overcame by Java's reliability and
fast time-to-market.

【在 E*****m 的大作中提到】
: Obviously, it's not the only way. Otherwise, how did Java come along?
avatar
E*m
335

primary
I started programming Java sometime in '96 or so. I know it quite well.
And you forgot your claim again. What convinced the first industry leader
to use Java?

【在 g*****g 的大作中提到】
: So you don't know nothing about history. Java came along as the industry
: leading enterprise application language on server side. C++ was the primary
: contest at the time, but it's quickly overcame by Java's reliability and
: fast time-to-market.

avatar
g*g
336
Everything starts as an experiment. But it didn't take long before Java
dominated in the enterprise market. Java was released in 1995. J2EE 1.2 spec
was out in 1999 and I used that for websites in 2000. Your hello world
experience in school doesn't count.
In comparison, which FP today is a Spring chicken?

【在 E*****m 的大作中提到】
:
: primary
: I started programming Java sometime in '96 or so. I know it quite well.
: And you forgot your claim again. What convinced the first industry leader
: to use Java?

avatar
E*m
337

spec
Thank you for your wrong speculation. I wrote my thesis work in Java, which
is a little bit more than hello world.
So, what convinced the first industry leader to use Java?
I'd say Scala is promising. But I am not a coder, I don't need to bet on it.

【在 g*****g 的大作中提到】
: Everything starts as an experiment. But it didn't take long before Java
: dominated in the enterprise market. Java was released in 1995. J2EE 1.2 spec
: was out in 1999 and I used that for websites in 2000. Your hello world
: experience in school doesn't count.
: In comparison, which FP today is a Spring chicken?

avatar
g*g
338
Your thesis, LOL. Wonder what's the usage of your thesis in industry? Sorry,
does it hurt to talk about reality?
Sun invented Java. Obviously they had interests in Java, much like M$ on .
Net. Sun happened to be an industry leader in enterprise space at that time.
In fact, IBM joined the force in no time and M$ wanted to adopt it too with
their own variation. The rest is history.

which
it.

【在 E*****m 的大作中提到】
:
: spec
: Thank you for your wrong speculation. I wrote my thesis work in Java, which
: is a little bit more than hello world.
: So, what convinced the first industry leader to use Java?
: I'd say Scala is promising. But I am not a coder, I don't need to bet on it.

avatar
g*g
339
I worked on Scala for 2 years, long before you exist here. And I am talking
about industry projects.
Scala got hot due to Akka, which is a good and bad thing. On one hand, it's
promising like how Erlang was proven in telecom industry. On the other hand,
the majority of applications don't need Akka, which makes Scala less
attractive as a general purpose language.

which
it.

【在 E*****m 的大作中提到】
:
: spec
: Thank you for your wrong speculation. I wrote my thesis work in Java, which
: is a little bit more than hello world.
: So, what convinced the first industry leader to use Java?
: I'd say Scala is promising. But I am not a coder, I don't need to bet on it.

avatar
E*m
340

Sorry,
It's funny that you can never remember what we are discussing.
time.
with
So, you are saying it's possible to use a new language when there are no
other
industry leader using it. Right?

【在 g*****g 的大作中提到】
: Your thesis, LOL. Wonder what's the usage of your thesis in industry? Sorry,
: does it hurt to talk about reality?
: Sun invented Java. Obviously they had interests in Java, much like M$ on .
: Net. Sun happened to be an industry leader in enterprise space at that time.
: In fact, IBM joined the force in no time and M$ wanted to adopt it too with
: their own variation. The rest is history.
:
: which
: it.

avatar
g*g
341
You can always use a new or old language in a new or old area. And there's
always a chance of success. It's only that I wouldn't claim their
superiority before their success. Let the reality do the talk, that's my
stance.

【在 E*****m 的大作中提到】
:
: Sorry,
: It's funny that you can never remember what we are discussing.
: time.
: with
: So, you are saying it's possible to use a new language when there are no
: other
: industry leader using it. Right?

avatar
a*e
342
如果你要问我,我会说几乎没有什么是 FP 不适合的,就连内核以及嵌入式,FPGA 等
都有 FP 的解决方案。
这里我并不是说内核或者嵌入设备去跑 FP 语言的 runtime,而是说用 FP 的工具设计
的 DSL 跑在内核和嵌入设备上。比如你可以搜一下 se4L,它的一个实现是用 Haskell
写的,被用于证明所生成的内核的正确性。
I'm a big believer in DSL. 合理设计的 DSL 能够快速完成目标 domain 的编程要求
,所需要的只是一个有效的 DSL 开发环境,FP 在这方面非常适合。就象是一套合理设
计的库函数或者框架什么的,能够大幅度提高开发效率。但是库函数的组合调用通常都
是写在源程序里,写好就不可以改动。而 DSL 则是它本身可以被分析重组,写好之后
,还可以用程序处理变换,验证性质,生成高效代码等。元语言 (meta programming)
的技术目前也在抬头,但我认为还是 DSL 更灵活,因为 meta programming 所操作的
对象还是一个 general purpose 的语言所写的程序结构,很多时候我们只需要 domain
specific.
你说内存用得多,应该是 Copying GC 带来的,Java 这方面也是一样的,消耗内存总
是会比 C 多。Haskell 还有一个问题是 memory leak,这是 lazy language 的一个硬
伤。正确的程序不会有这种问题,虽然如何书写正确的 memory leak free 的 Haskell
程序有时候是一个 black art。
关于 immutable 的问题,如果你对现代的编译技术有了解,比如 SSA 什么的,就会发
现在编译局部变量时,其实 C 里面那些看起来是 mutable 的变量,都已经被转化成只
能赋值一次的虚拟寄存器了,所以是否 mutable 只影响需要共享数据的全局变量。
这方面,采取 immutable 的数据结构也会更适合 modern CPU,比如 cache-friendly
(sharing, no read/write barrier),比如 SIMD ,比如 thread 间数据的交换,可
以尽量避免 CAS 等。就连 Garbage Collection 也可以针对 cache 进行优化,而不需
要修改应用层面的东西。Scientific Computing 很多时候追求高效,结果把 C 或者
Fortran 的源程序调得乱糟糟,事后很难维护,长远来看是得不偿失的。
immutable 不占优势的一个情况,就是迅速产生大量垃圾,给 GC 造成负担过大。但这
毕竟很少见,通过 profiling 等技术也可以迅速发现问题所在,从应用层面可以调整
,比如适度允许 mutable 的结构,避免反复的 allocation。
还有一个弱点,主要是从算法层面,比如 graph 和 hashtable 的结构用 immutable
不能做,或者比较没效率。
所以 FP 也不是说拒绝 mutable,而是说如果以 immutable 为主,好处多多。

【在 m*********t 的大作中提到】
: 其实你们应该多说说:什么样的问题用 FP 来解决很合适,和 OOP 比较呢?。内核以
: 及嵌入式? 前端? game?数据分析?复杂的并行和需要大量内存的科学计算? 我看
: 到一些 haskell 的例子内存占用似乎比 C 要多好几倍(是不是 immutable 的原因?
: ),这样对于 memory bandwidth limit
: 的计算程序怎么弄?
: 还有说说这东西在大规模开发的时候代码可读性和可维护性?

avatar
d*i
343
你说的FPGA都有FP的解决方案我倒是闻所未闻,FPGA一般用Verilog或者VHDL, 或者
SystemC,都是工业界的标准。

等都有 FP 的解决方案。

【在 a*****e 的大作中提到】
: 如果你要问我,我会说几乎没有什么是 FP 不适合的,就连内核以及嵌入式,FPGA 等
: 都有 FP 的解决方案。
: 这里我并不是说内核或者嵌入设备去跑 FP 语言的 runtime,而是说用 FP 的工具设计
: 的 DSL 跑在内核和嵌入设备上。比如你可以搜一下 se4L,它的一个实现是用 Haskell
: 写的,被用于证明所生成的内核的正确性。
: I'm a big believer in DSL. 合理设计的 DSL 能够快速完成目标 domain 的编程要求
: ,所需要的只是一个有效的 DSL 开发环境,FP 在这方面非常适合。就象是一套合理设
: 计的库函数或者框架什么的,能够大幅度提高开发效率。但是库函数的组合调用通常都
: 是写在源程序里,写好就不可以改动。而 DSL 则是它本身可以被分析重组,写好之后
: ,还可以用程序处理变换,验证性质,生成高效代码等。元语言 (meta programming)

avatar
a*e
344
不算是业界主流,多数还是 research 性质,顺手搜一下
http://raintown.org/lava/
http://cufp.org/conference/sessions/2012/peter-braam-parallel-s
ICFP/POPL 这类的 conference 上经常有这类的,也算热点之一吧

【在 d****i 的大作中提到】
: 你说的FPGA都有FP的解决方案我倒是闻所未闻,FPGA一般用Verilog或者VHDL, 或者
: SystemC,都是工业界的标准。
:
: 等都有 FP 的解决方案。

avatar
L*n
345
比如?你所说的问题,即使存在,解决办法也应该是由专家维护高质量的库,而不是
使用DSL,在学术界,使用DSL的问题包括没有统一标准,混用DSL和已有语言C/C++
的代价,代码效率,等等,都是无法接受的。我本人倒是用过不少设计的不那么优美的
库,也试过一些DSL, 我宁愿用界面乱糟糟一些的C/C++/Fortran库,也不愿在我的代码
里用我自己都不知道怎么debug的DSL
avatar
t*n
346
这方面,采取 immutable 的数据结构也会更适合 modern CPU,比如 cache-friendly
(sharing, no read/write barrier),比如 SIMD ,比如 thread 间数据的交换,可
以尽量避免 CAS 等。就连 Garbage Collection 也可以针对 cache 进行优化,而不需
要修改应用层面的东西。Scientific Computing 很多时候追求高效,结果把 C 或者
Fortran 的源程序调得乱糟糟,事后很难维护,长远来看是得不偿失的。
真能码字。不过计算远没有你想的那么差。只有低水平的编程者,没有生来就乱的语言
。高手写的fortran,远胜入门者写的fp。

Haskell
)

【在 a*****e 的大作中提到】
: 如果你要问我,我会说几乎没有什么是 FP 不适合的,就连内核以及嵌入式,FPGA 等
: 都有 FP 的解决方案。
: 这里我并不是说内核或者嵌入设备去跑 FP 语言的 runtime,而是说用 FP 的工具设计
: 的 DSL 跑在内核和嵌入设备上。比如你可以搜一下 se4L,它的一个实现是用 Haskell
: 写的,被用于证明所生成的内核的正确性。
: I'm a big believer in DSL. 合理设计的 DSL 能够快速完成目标 domain 的编程要求
: ,所需要的只是一个有效的 DSL 开发环境,FP 在这方面非常适合。就象是一套合理设
: 计的库函数或者框架什么的,能够大幅度提高开发效率。但是库函数的组合调用通常都
: 是写在源程序里,写好就不可以改动。而 DSL 则是它本身可以被分析重组,写好之后
: ,还可以用程序处理变换,验证性质,生成高效代码等。元语言 (meta programming)

avatar
G*l
347
我最近也在做DSL,请问有什么好的讲FP实现DSL的书吗?以前用OO的语言做过,实现起
来比较麻烦。用了antlr做parser generator会好一些,但是还是挺麻烦的。

Haskell
)

【在 a*****e 的大作中提到】
: 如果你要问我,我会说几乎没有什么是 FP 不适合的,就连内核以及嵌入式,FPGA 等
: 都有 FP 的解决方案。
: 这里我并不是说内核或者嵌入设备去跑 FP 语言的 runtime,而是说用 FP 的工具设计
: 的 DSL 跑在内核和嵌入设备上。比如你可以搜一下 se4L,它的一个实现是用 Haskell
: 写的,被用于证明所生成的内核的正确性。
: I'm a big believer in DSL. 合理设计的 DSL 能够快速完成目标 domain 的编程要求
: ,所需要的只是一个有效的 DSL 开发环境,FP 在这方面非常适合。就象是一套合理设
: 计的库函数或者框架什么的,能够大幅度提高开发效率。但是库函数的组合调用通常都
: 是写在源程序里,写好就不可以改动。而 DSL 则是它本身可以被分析重组,写好之后
: ,还可以用程序处理变换,验证性质,生成高效代码等。元语言 (meta programming)

avatar
a*e
348
你说的也对,要是有方便用的,有稳定技术支持,已经被业界普遍采纳的产品就好了。
目前勉强能满足的也就是你说的这些设计上有缺陷的 C/C++/Fortran 库了。
但是 status quo 并非一成不变,没有理由不期待它朝更好的方向发展。
我谈的也都是一些 FP 的发展方向和(个人浅见)优势所在,并非都有成熟的产品。

【在 L***n 的大作中提到】
: 比如?你所说的问题,即使存在,解决办法也应该是由专家维护高质量的库,而不是
: 使用DSL,在学术界,使用DSL的问题包括没有统一标准,混用DSL和已有语言C/C++
: 的代价,代码效率,等等,都是无法接受的。我本人倒是用过不少设计的不那么优美的
: 库,也试过一些DSL, 我宁愿用界面乱糟糟一些的C/C++/Fortran库,也不愿在我的代码
: 里用我自己都不知道怎么debug的DSL

avatar
a*e
349
当然也不好一棒子全部打倒,我也就是最近接触这方面,有感而发。
为了追求效率全部改用 SIMD intrinsic 写东西,还真不是人干的事儿。

【在 t*****n 的大作中提到】
: 这方面,采取 immutable 的数据结构也会更适合 modern CPU,比如 cache-friendly
: (sharing, no read/write barrier),比如 SIMD ,比如 thread 间数据的交换,可
: 以尽量避免 CAS 等。就连 Garbage Collection 也可以针对 cache 进行优化,而不需
: 要修改应用层面的东西。Scientific Computing 很多时候追求高效,结果把 C 或者
: Fortran 的源程序调得乱糟糟,事后很难维护,长远来看是得不偿失的。
: 真能码字。不过计算远没有你想的那么差。只有低水平的编程者,没有生来就乱的语言
: 。高手写的fortran,远胜入门者写的fp。
:
: Haskell
: )

avatar
E*m
350

Sounds right to me.
But then why you have to bash those languages you don't know much?

【在 g*****g 的大作中提到】
: You can always use a new or old language in a new or old area. And there's
: always a chance of success. It's only that I wouldn't claim their
: superiority before their success. Let the reality do the talk, that's my
: stance.

avatar
g*g
351
Since when saying these languages are unproven is a bash?
In case you don't understand, all languages are unproven until proven
otherwise. FP or not.

【在 E*****m 的大作中提到】
:
: Sounds right to me.
: But then why you have to bash those languages you don't know much?

avatar
a*e
352
书这方面我也不是特别了解,都是从 conference paper 和项目代码看过来的。你可以
搜索 IFIP DSL Conference,有 proceeding 什么的。
如果你用 Haskell,基础的理论就是 Monad, Applicative Functor, Arrow 这些。更
基础的是解释器的实现,Oleg 的网站上有些 paper: http://okmij.org/ftp/tagless-final/
而且要看你想做什么,Haskell 这边 parser 类的 DSL 已经很成熟了,hackage 上很
多。电子设计和 control 方面的 DSL 也比较多,上面提到的 Lava, 还有 Atom 都是。

【在 G***l 的大作中提到】
: 我最近也在做DSL,请问有什么好的讲FP实现DSL的书吗?以前用OO的语言做过,实现起
: 来比较麻烦。用了antlr做parser generator会好一些,但是还是挺麻烦的。
:
: Haskell
: )

avatar
E*m
353

You know you said more than "unproven".

【在 g*****g 的大作中提到】
: Since when saying these languages are unproven is a bash?
: In case you don't understand, all languages are unproven until proven
: otherwise. FP or not.

avatar
g*g
354
Right, and I am just being honest. If that hurts your feeling, you are too
sensitive.

【在 E*****m 的大作中提到】
:
: You know you said more than "unproven".

avatar
m*t
355
为啥非要强调 “勉强能满足” 以及 “设计有缺陷呢” :p

【在 a*****e 的大作中提到】
: 你说的也对,要是有方便用的,有稳定技术支持,已经被业界普遍采纳的产品就好了。
: 目前勉强能满足的也就是你说的这些设计上有缺陷的 C/C++/Fortran 库了。
: 但是 status quo 并非一成不变,没有理由不期待它朝更好的方向发展。
: 我谈的也都是一些 FP 的发展方向和(个人浅见)优势所在,并非都有成熟的产品。

avatar
E*m
356

If you actually know those languages you bashed, it's a good thing.

【在 g*****g 的大作中提到】
: Right, and I am just being honest. If that hurts your feeling, you are too
: sensitive.

avatar
a*e
357
因为用起来不方便啊。脚本语言比如 python, R 之类的都能够进军这个领域不是正因
为 C/C++/Fortran 的库用起来不方便吗

【在 m*********t 的大作中提到】
: 为啥非要强调 “勉强能满足” 以及 “设计有缺陷呢” :p
avatar
G*l
358
简答来说就是做一个parser生成AST,跟相应的interpreter。比如一个basic语法的dsl
,当然我的肯定不会有一个正式的语言那么复杂。

是。

【在 a*****e 的大作中提到】
: 书这方面我也不是特别了解,都是从 conference paper 和项目代码看过来的。你可以
: 搜索 IFIP DSL Conference,有 proceeding 什么的。
: 如果你用 Haskell,基础的理论就是 Monad, Applicative Functor, Arrow 这些。更
: 基础的是解释器的实现,Oleg 的网站上有些 paper: http://okmij.org/ftp/tagless-final/
: 而且要看你想做什么,Haskell 这边 parser 类的 DSL 已经很成熟了,hackage 上很
: 多。电子设计和 control 方面的 DSL 也比较多,上面提到的 Lava, 还有 Atom 都是。

avatar
G*l
360
我想了解的就是如何用pattern matching之类的高级特性,高效的写出一个dsl。可惜
目前好像还没有这方面的书。

【在 a*****e 的大作中提到】
: BASIC 已经有了,Lennart Augustsson 写的在这儿:
: http://hackage.haskell.org/package/BASIC-0.1.5.0
: http://augustss.blogspot.com/search/label/BASIC
: 这个实现很有趣,连 syntax 都和 BASIC 非常接近,虽然是 embeded DSL,也就是说
: 直接跳过了 parser 这部分

avatar
a*e
361
如果你说的高效是指快速实现一个DSL的解释器,那么上面我给的那个blog链接是个很
好的例子。
首先,它绕过了 parser,因为程序本身虽然看起来象 BASIC,但实际上都是 Haskell
,直接代表 AST,所以省去很多前期的麻烦。这就叫做 embeded DSL。只需要定义
合适的 AST,然后对之进行 pattern match 解释执行就好了。
其次,embedded DSL 可以直接使用 host language 里面的值和函数,比如数字表达式
什么的,直接用,无须单独处理。你要做的工作可以完全放在你所定义的 DSL 的核心语
义上面。
最后,如果你追求 DSL 本身运行起来的效率,那么可以采取 finally taggless 的方
式,定义 combinator 来组建 DSL,它们本身就是 host language 里的函数,由
host language 的编译器直接编译,无须另写 AST 和解释器。我上面给的 Oleg 的链
接里有这个 paper。
所以从 embedded DSL 入手,实现一个新的 DSL 过程被大大简化,应该是相当有效率
的。
如果你不是打算用 Haskell,其它语言也可以,比如 scheme 这样的,macro 处理也相
当强大。

【在 G***l 的大作中提到】
: 我想了解的就是如何用pattern matching之类的高级特性,高效的写出一个dsl。可惜
: 目前好像还没有这方面的书。

avatar
G*l
362
这个是很好,但是好像也偶缺陷。比如我以前用Java写,用户输入是各种文本,然后在
后台程序里,我在Java里面把这些文本parse成AST并且interpret,最后得到他们的结
果,比如:
用户写的dsl是MonthDiff(Date1, Date2) + 1 > SomeValue
我读入这个文本到monthControl, 并且在inputData里放入Date1, Date2, SomeValue的
值(从数据库或者什么地方读过来的)。然后写,
//evaluate里做parsing和interpret
result = evaluate(monthControl, inputData)
if(result)
{
//do business logic
}
这样用户就可以写dsl直接控制我程序里的logic。假如改用haskell用embedded的话,
我的haskell程序没法直接调用那个dsl,除非把那个dsl写到我的source code,然后动
态编译运行,但是我不想要那样。或者可以有什么类似swig之类的东西让我动态调用
haskell code,但是我没法把inputData传过去。
。用这种embedded dsl的方式好像就不能那样做了。

Haskell
心语

【在 a*****e 的大作中提到】
: 如果你说的高效是指快速实现一个DSL的解释器,那么上面我给的那个blog链接是个很
: 好的例子。
: 首先,它绕过了 parser,因为程序本身虽然看起来象 BASIC,但实际上都是 Haskell
: ,直接代表 AST,所以省去很多前期的麻烦。这就叫做 embeded DSL。只需要定义
: 合适的 AST,然后对之进行 pattern match 解释执行就好了。
: 其次,embedded DSL 可以直接使用 host language 里面的值和函数,比如数字表达式
: 什么的,直接用,无须单独处理。你要做的工作可以完全放在你所定义的 DSL 的核心语
: 义上面。
: 最后,如果你追求 DSL 本身运行起来的效率,那么可以采取 finally taggless 的方
: 式,定义 combinator 来组建 DSL,它们本身就是 host language 里的函数,由

avatar
g*g
363
I don't need to know those languages to know how much they are being used in
the industry. Simple as that.

【在 E*****m 的大作中提到】
:
: If you actually know those languages you bashed, it's a good thing.

avatar
a*e
364
你说的这个是经典的解释器,用户并不直接接触到实际的编译器,而是通过网站或什么
别的途径输入写好的脚本,你在后台来执行它。我这样理解没错吧?
你可以分两步走,第一步,先把 DSL AST 所需要的 data type 定义出来,然后对此写
一个解释器。调试过程中,可以直接用 datatype 写 AST,省去写 parser 的麻烦。
第一步做好了,然后就可以用 haskell parsec 之类的库把程序输入的字串转换为 AST
,略为学习一下 parsec 的用法就好了,简单的 recursive descent。
做 embeded DSL 可以省去第二步,但的确,在你的情况中,还是需要一个 parser 的
部分。

【在 G***l 的大作中提到】
: 这个是很好,但是好像也偶缺陷。比如我以前用Java写,用户输入是各种文本,然后在
: 后台程序里,我在Java里面把这些文本parse成AST并且interpret,最后得到他们的结
: 果,比如:
: 用户写的dsl是MonthDiff(Date1, Date2) + 1 > SomeValue
: 我读入这个文本到monthControl, 并且在inputData里放入Date1, Date2, SomeValue的
: 值(从数据库或者什么地方读过来的)。然后写,
: //evaluate里做parsing和interpret
: result = evaluate(monthControl, inputData)
: if(result)
: {

avatar
d*i
365
我看到 functional programming 好处。
* immutable. 这点在并行运算中力量很大. 试想如果保证所有的arguments 都没有
state change那传统一以上的locking, synchronization就不存在了或没必要了。 大
大提高了程序可读性和可维护性。
* First class/Hight order functions. function 可以作为argument。 好处是大大
提高function 的易重用行和简便性。
* Syntax 简单。 上边讲过AST, Java 有很多事先制定 好的keyword match 到AST。
不过clojure 自己就是一个AST, 程序员可以自己定制macros, 所以程序syntax 很简
单又很flexible. 学一种语言不用象Java 那样去记它特定的语法。
由于强调 immutable , no state. FP 在现实production中多用于后台数据处理。 现
在在Big data 里很吃香。 但是有些时候是不可能完全no state, 比如你的程序调用
3rd party web service, 你就得持有一个state 去调用它, 在这个层级上
imperative
programming 就比较好一些。
avatar
E*m
366

in
So, after 10 years, you regress from a visionary who can predict Java's
success to
a trend follower.

【在 g*****g 的大作中提到】
: I don't need to know those languages to know how much they are being used in
: the industry. Simple as that.

avatar
m*t
367
What about memory bandwith limit if you use all pure immutable objects? e.g.
I have a parallel gpu program that read + write 200 GB/s on the GDDR5 RAM.

【在 d*******i 的大作中提到】
: 我看到 functional programming 好处。
: * immutable. 这点在并行运算中力量很大. 试想如果保证所有的arguments 都没有
: state change那传统一以上的locking, synchronization就不存在了或没必要了。 大
: 大提高了程序可读性和可维护性。
: * First class/Hight order functions. function 可以作为argument。 好处是大大
: 提高function 的易重用行和简便性。
: * Syntax 简单。 上边讲过AST, Java 有很多事先制定 好的keyword match 到AST。
: 不过clojure 自己就是一个AST, 程序员可以自己定制macros, 所以程序syntax 很简
: 单又很flexible. 学一种语言不用象Java 那样去记它特定的语法。
: 由于强调 immutable , no state. FP 在现实production中多用于后台数据处理。 现

avatar
g*g
368
I am not being stubborn. I am being consistent. I saw Java succeeded 10
years ago the same reasons I don't see FP languages succeed today.
I have mentioned these reasons in many posts, for a language to be adopted
by massive as a general purpose language, it should be/have
1. Easy to learn, easy to use, easy to maintain
2. Big or quickly growing community
3. Killer framework or application
4. Adequate libraries
5. Company backing
Now Scala is the only FP language I know that has 2/3/4/5, that's one of the
reasons why I picked it up and used it for 2 years. Then I realize 1 is a
very big hurdle in a team setup with a big project, which can still be
overcame in a top notch company with top talents but the growth is hindered
nonetheless.
Other FP languages don't even come close. And none of them ever achieve 1.
Now maybe in the future there'll be new languages change all these. But I
can say for sure all well-known FP languages don't. For that reason they'll
remain niche languages. The best they can be is like javascript/Objective C
that excels in a specialized domain.

【在 E*****m 的大作中提到】
:
: in
: So, after 10 years, you regress from a visionary who can predict Java's
: success to
: a trend follower.

avatar
d*x
369
人总是在遇到问题的时候才想起来前人总结的经验。。。
编译原理一上来就说了语言的第一大concern就是learning cost...

the

【在 g*****g 的大作中提到】
: I am not being stubborn. I am being consistent. I saw Java succeeded 10
: years ago the same reasons I don't see FP languages succeed today.
: I have mentioned these reasons in many posts, for a language to be adopted
: by massive as a general purpose language, it should be/have
: 1. Easy to learn, easy to use, easy to maintain
: 2. Big or quickly growing community
: 3. Killer framework or application
: 4. Adequate libraries
: 5. Company backing
: Now Scala is the only FP language I know that has 2/3/4/5, that's one of the

avatar
E*m
370
I think you really need to put a quantifier "For enterprise software"
for almost everything you said.
In your 5 criteria, only (1) is forward looking. Others are just saying
"I follow the crowd", which is not really a bad thing, for a trend follower.
I guess people who create killer frameworks and libraries might
think differently.

the

【在 g*****g 的大作中提到】
: I am not being stubborn. I am being consistent. I saw Java succeeded 10
: years ago the same reasons I don't see FP languages succeed today.
: I have mentioned these reasons in many posts, for a language to be adopted
: by massive as a general purpose language, it should be/have
: 1. Easy to learn, easy to use, easy to maintain
: 2. Big or quickly growing community
: 3. Killer framework or application
: 4. Adequate libraries
: 5. Company backing
: Now Scala is the only FP language I know that has 2/3/4/5, that's one of the

avatar
g*g
371
Obviously I put a quantifier there, general purpose programming. e.g. Java
is much more than enterprise software, it's very successful on Android
platform as a UI language for personal software, gaming etc. It's not as
successful on PC/Mac but there are famous software like Eclipse and TurboTax
on Mac.
And no, I am not following the crowd. You can see all my criteria fit around
02, 03 already for Java, when I started promoting Java on this board. Yet I
am an early adopter, and not many people listened to me at that time.

follower.

【在 E*****m 的大作中提到】
: I think you really need to put a quantifier "For enterprise software"
: for almost everything you said.
: In your 5 criteria, only (1) is forward looking. Others are just saying
: "I follow the crowd", which is not really a bad thing, for a trend follower.
: I guess people who create killer frameworks and libraries might
: think differently.
:
: the

avatar
E*m
372

TurboTax
around
I
I've the same question as the other guy. How can promoting java in 02 03 be
called "early"? When you are later than IBM, don't you think you're really
really late?

【在 g*****g 的大作中提到】
: Obviously I put a quantifier there, general purpose programming. e.g. Java
: is much more than enterprise software, it's very successful on Android
: platform as a UI language for personal software, gaming etc. It's not as
: successful on PC/Mac but there are famous software like Eclipse and TurboTax
: on Mac.
: And no, I am not following the crowd. You can see all my criteria fit around
: 02, 03 already for Java, when I started promoting Java on this board. Yet I
: am an early adopter, and not many people listened to me at that time.
:
: follower.

avatar
d*i
373
Not quite understanding what you mean. Answer your question in assumption.
immutable objects does not mean that can not be garbage collected. I would
rather call it as immutable arguments rather than objects. As long as you do
not have reference with that argument, it can be garbage collected. On the
other hand, it saves memory, since you can only keep one copy of that object
and being reused by all the threads/cores, same concept as singleton.
Talking about performance. People do criticize the the way of "change"
immutable value, since you have to create another value by using the deep
copies. But clojure using some techniques called "Sharing Tech" to avoid
deep copy which is fast

g.

【在 m*********t 的大作中提到】
: What about memory bandwith limit if you use all pure immutable objects? e.g.
: I have a parallel gpu program that read + write 200 GB/s on the GDDR5 RAM.

avatar
g*g
374
Just ask how many people on this BBS have 10+ years of Java experience.
And you know why I am an early adopter.
BTW, academic experience doesn't count. I can see you don't have much
industry experience that's why you make a fuss on everything.

be
really

【在 E*****m 的大作中提到】
:
: TurboTax
: around
: I
: I've the same question as the other guy. How can promoting java in 02 03 be
: called "early"? When you are later than IBM, don't you think you're really
: really late?

avatar
r*g
375
这个,在一个版面混了十年的本来就不多。。。

【在 g*****g 的大作中提到】
: Just ask how many people on this BBS have 10+ years of Java experience.
: And you know why I am an early adopter.
: BTW, academic experience doesn't count. I can see you don't have much
: industry experience that's why you make a fuss on everything.
:
: be
: really

avatar
g*g
376
好吧,如果你招人,你就会知道想招一个有10年java经验的人有多么难。

【在 r*g 的大作中提到】
: 这个,在一个版面混了十年的本来就不多。。。
avatar
d*i
377
As a programmer, being consistent is being stubborn :) The learning cost to
use a new tool for a 0 experience worker compared with experience worker
using the same tool consistently for 100 years is way much lower.
Talking about big team and big enterprise, you are putting yourself as
mostly an application maintainer or consumer of "Adequate libraries" rather
than programmers or developers.
Anyway, it is the same topic of between doing job and enjoying your career.
The topic is talking about why functional programming is good and why is bad
rather than whether it will be successful in fuc*ng big enterprise. By the
way, killer framework was never wrote by a big team.

the

【在 g*****g 的大作中提到】
: I am not being stubborn. I am being consistent. I saw Java succeeded 10
: years ago the same reasons I don't see FP languages succeed today.
: I have mentioned these reasons in many posts, for a language to be adopted
: by massive as a general purpose language, it should be/have
: 1. Easy to learn, easy to use, easy to maintain
: 2. Big or quickly growing community
: 3. Killer framework or application
: 4. Adequate libraries
: 5. Company backing
: Now Scala is the only FP language I know that has 2/3/4/5, that's one of the

avatar
r*g
378
我觉得真神说的一点有道理。这里是programming版,不是programmer版。你自然是资
深高手,但你看这么多问excel/matlab/c input问题的,我觉得超过一半来这里的,不
是职业程序员。那么你的职业建议就难免被一部分人当成废话。

【在 g*****g 的大作中提到】
: 好吧,如果你招人,你就会知道想招一个有10年java经验的人有多么难。
avatar
g*g
379
Talk is cheap. If you are talking about niche language in niche domain, set
the context straight. The reality is that none of these FP languages have
seen massive adoption in the industry. In fact, none of them cracked top 10
in this famous index.
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.htm
Killer framework can be done by small team, killer app rarely is nowadays,
and when it is, it's usually due to brilliant idea, not the language. I
mentioned big team and big project due to practical reason for massive
adoption. It has nothing to do with my job.

to
rather
.
bad
the

【在 d*******i 的大作中提到】
: As a programmer, being consistent is being stubborn :) The learning cost to
: use a new tool for a 0 experience worker compared with experience worker
: using the same tool consistently for 100 years is way much lower.
: Talking about big team and big enterprise, you are putting yourself as
: mostly an application maintainer or consumer of "Adequate libraries" rather
: than programmers or developers.
: Anyway, it is the same topic of between doing job and enjoying your career.
: The topic is talking about why functional programming is good and why is bad
: rather than whether it will be successful in fuc*ng big enterprise. By the
: way, killer framework was never wrote by a big team.

avatar
d*i
380
* Not having preference of functional programming vs object oriented
functional programming
* Not Talking which language is better than the other. They have different
ways/benefits/tradeoff to resolve the issues.
* Just want the topic of functional programming to be technical oriented.
* Industrial wide popularity does not mean any success of the language.
Actually it is a sadness of the language. I like Java, but when I worked
with a global fortune 100 client who has 3000 offshore cheap "developers"
fuc*Ng up Java everyday, I do not like my daily job any more. But that is
how enterprise makes the popular language and their standards.
:)

set
10

【在 g*****g 的大作中提到】
: Talk is cheap. If you are talking about niche language in niche domain, set
: the context straight. The reality is that none of these FP languages have
: seen massive adoption in the industry. In fact, none of them cracked top 10
: in this famous index.
: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.htm
: Killer framework can be done by small team, killer app rarely is nowadays,
: and when it is, it's usually due to brilliant idea, not the language. I
: mentioned big team and big project due to practical reason for massive
: adoption. It has nothing to do with my job.
:

avatar
g*g
381
I am not against anyone using FP in a niche domain. I am merely talking why
existing FPs won't see massive adoption as a general purpose language.
I tend to quantify the success of the language to the values of projects
built on top of it. To that extent, the success of the language is also
largely correlated to its popularity.
At the end of the day, 3000 bad Java developers are still manageable. I
doubt you want to work with 3000 bad FP developers at all. Exactly one of
the reason FP is not going anywhere.

【在 d*******i 的大作中提到】
: * Not having preference of functional programming vs object oriented
: functional programming
: * Not Talking which language is better than the other. They have different
: ways/benefits/tradeoff to resolve the issues.
: * Just want the topic of functional programming to be technical oriented.
: * Industrial wide popularity does not mean any success of the language.
: Actually it is a sadness of the language. I like Java, but when I worked
: with a global fortune 100 client who has 3000 offshore cheap "developers"
: fuc*Ng up Java everyday, I do not like my daily job any more. But that is
: how enterprise makes the popular language and their standards.

avatar
E*m
382

Let me put it this way, you don't know my job and I've no interest to
tell you. But your speculations are all wrong.
And, I can assure you I've know enough people with more than 10 years
of java experience.
Let me say that again. Your prediction about Java was about
5 YEARS AFTER IBM rolled out its Java product. You call that "early"! Why?

【在 g*****g 的大作中提到】
: Just ask how many people on this BBS have 10+ years of Java experience.
: And you know why I am an early adopter.
: BTW, academic experience doesn't count. I can see you don't have much
: industry experience that's why you make a fuss on everything.
:
: be
: really

avatar
m*t
383
比如我有一个 float 数组(长度大约 10^8 to 10^9,占用几个 G 的内存),然后我用
成千上万个 thread 来计算然后 update 数组里面元素的内容(为了保证 thread 不冲
突算法和 sync 都需要考虑)。而如果用 immutable 在这个情况怎么处理?

do
the
object

【在 d*******i 的大作中提到】
: Not quite understanding what you mean. Answer your question in assumption.
: immutable objects does not mean that can not be garbage collected. I would
: rather call it as immutable arguments rather than objects. As long as you do
: not have reference with that argument, it can be garbage collected. On the
: other hand, it saves memory, since you can only keep one copy of that object
: and being reused by all the threads/cores, same concept as singleton.
: Talking about performance. People do criticize the the way of "change"
: immutable value, since you have to create another value by using the deep
: copies. But clojure using some techniques called "Sharing Tech" to avoid
: deep copy which is fast

avatar
g*g
384
你小被鄙视,就是因为明明没啥业界经验,还要成天指点江山。我老00年开始用jsp写
网站,只不过02年才觉得java比C++有前途。你觉不觉我是不是early有用吗?看看你周
围有多少人有10年java经验不就得了。

?

【在 E*****m 的大作中提到】
:
: Let me put it this way, you don't know my job and I've no interest to
: tell you. But your speculations are all wrong.
: And, I can assure you I've know enough people with more than 10 years
: of java experience.
: Let me say that again. Your prediction about Java was about
: 5 YEARS AFTER IBM rolled out its Java product. You call that "early"! Why?

avatar
s*o
385
I agree with most of you points.
but the last one just has no base at all. bad developers are bad developers,
they are cancer no matter what language they use.

why

【在 g*****g 的大作中提到】
: I am not against anyone using FP in a niche domain. I am merely talking why
: existing FPs won't see massive adoption as a general purpose language.
: I tend to quantify the success of the language to the values of projects
: built on top of it. To that extent, the success of the language is also
: largely correlated to its popularity.
: At the end of the day, 3000 bad Java developers are still manageable. I
: doubt you want to work with 3000 bad FP developers at all. Exactly one of
: the reason FP is not going anywhere.

avatar
s*o
386
这好像已经超出了编程解决实际问题的范畴,而是艺术欣赏的范畴了。不然不可能得出
这个结论:
”Industrial wide popularity does not mean any success of the language.
Actually it is a sadness of the language“

【在 d*******i 的大作中提到】
: * Not having preference of functional programming vs object oriented
: functional programming
: * Not Talking which language is better than the other. They have different
: ways/benefits/tradeoff to resolve the issues.
: * Just want the topic of functional programming to be technical oriented.
: * Industrial wide popularity does not mean any success of the language.
: Actually it is a sadness of the language. I like Java, but when I worked
: with a global fortune 100 client who has 3000 offshore cheap "developers"
: fuc*Ng up Java everyday, I do not like my daily job any more. But that is
: how enterprise makes the popular language and their standards.

avatar
y*a
387
you would probabaly be intereted in delite project

dsl

【在 G***l 的大作中提到】
: 简答来说就是做一个parser生成AST,跟相应的interpreter。比如一个basic语法的dsl
: ,当然我的肯定不会有一个正式的语言那么复杂。
:
: 是。

avatar
g*g
388
There's a difference on how much a bad developer can kill a project.

【在 s***o 的大作中提到】
: 这好像已经超出了编程解决实际问题的范畴,而是艺术欣赏的范畴了。不然不可能得出
: 这个结论:
: ”Industrial wide popularity does not mean any success of the language.
: Actually it is a sadness of the language“

avatar
E*m
389

真的不騙你, 我周遭超過10年Java 經驗的車載斗量, 我自己在 02年以前就做了幾個
Java 業界的項目, 你鄙視有用嗎?
02 年也好意思叫預測, 你的臉皮厚度可以直接當裝甲防護罩了。

【在 g*****g 的大作中提到】
: 你小被鄙视,就是因为明明没啥业界经验,还要成天指点江山。我老00年开始用jsp写
: 网站,只不过02年才觉得java比C++有前途。你觉不觉我是不是early有用吗?看看你周
: 围有多少人有10年java经验不就得了。
:
: ?

avatar
t*s
390
俺家当初订阅了一份报纸,叫电脑商情报
我记得97 98年开始,那报纸上面就整天宣传java改变世界了。国内最开始java的那批
人我认为是从1.0开始就追捧的。

【在 E*****m 的大作中提到】
:
: 真的不騙你, 我周遭超過10年Java 經驗的車載斗量, 我自己在 02年以前就做了幾個
: Java 業界的項目, 你鄙視有用嗎?
: 02 年也好意思叫預測, 你的臉皮厚度可以直接當裝甲防護罩了。

avatar
p*2
391

我应该是98年学的Java,当时觉得确实简单。随便看了看书做了一个东西花了两个多小
时,后来转到VC上花了我一晚上,况且我还是搞VC的。不过后来总觉得语言不灵活,所
以一直不太愿意转过去。但是有的时候想做点小程序,还是觉得Java比C++方便和快速
很多。后来接触了了脚本语言,发觉做点小东西脚本就够了。

【在 t*s 的大作中提到】
: 俺家当初订阅了一份报纸,叫电脑商情报
: 我记得97 98年开始,那报纸上面就整天宣传java改变世界了。国内最开始java的那批
: 人我认为是从1.0开始就追捧的。

avatar
E*m
392

goodbug 會說別人都是跟風,只有他才是實在的。 等等看是不是這樣。

【在 t*s 的大作中提到】
: 俺家当初订阅了一份报纸,叫电脑商情报
: 我记得97 98年开始,那报纸上面就整天宣传java改变世界了。国内最开始java的那批
: 人我认为是从1.0开始就追捧的。

avatar
a*e
393
LOL, 这是要比谁最先搞 java 吗?我 97 年写的 Java 程序后来卖给Yahoo和华渊网。
后来再也没碰过 Java,所以 J2EE 这些我完全没接触过,不敢再古德霸面前抖啊,哈
哈哈

【在 p*****2 的大作中提到】
:
: 我应该是98年学的Java,当时觉得确实简单。随便看了看书做了一个东西花了两个多小
: 时,后来转到VC上花了我一晚上,况且我还是搞VC的。不过后来总觉得语言不灵活,所
: 以一直不太愿意转过去。但是有的时候想做点小程序,还是觉得Java比C++方便和快速
: 很多。后来接触了了脚本语言,发觉做点小东西脚本就够了。

avatar
g*r
394
ca,这里全是前辈啊,我98年才摸到电脑这个东西,99年才在中学的机房里开始敲
basic,,,

【在 a*****e 的大作中提到】
: LOL, 这是要比谁最先搞 java 吗?我 97 年写的 Java 程序后来卖给Yahoo和华渊网。
: 后来再也没碰过 Java,所以 J2EE 这些我完全没接触过,不敢再古德霸面前抖啊,哈
: 哈哈

avatar
p*2
395

BSO年轻呀

【在 g****r 的大作中提到】
: ca,这里全是前辈啊,我98年才摸到电脑这个东西,99年才在中学的机房里开始敲
: basic,,,

avatar
t*n
396
用tubro c++的飘过。。。

【在 p*****2 的大作中提到】
:
: BSO年轻呀

avatar
l*s
397
BSO老江湖阿

【在 t*****n 的大作中提到】
: 用tubro c++的飘过。。。
avatar
g*g
398
LOL,不是读书写过一个applet就叫业界经验了,省省吧。02年在这BBS看好java的人很
少,要不然我
何必写那样的帖子。我老说的东西,好歹有10年前的帖子为证。你小明明半路出家,还
车载斗量呢,装逼有意思吗。

【在 E*****m 的大作中提到】
:
: goodbug 會說別人都是跟風,只有他才是實在的。 等等看是不是這樣。

avatar
g*g
399
如果我是跟风的,精华区也轮不到我来鼓吹。JSP 99年才出来的,我00年初用JSP写网
站的时候,是国内最早的一批,那时候更流行的是ASP和PHP。而在JSP出来之前,Java
的定位还局限于applet,没多大前途。你一吹就吹破了。

【在 E*****m 的大作中提到】
:
: goodbug 會說別人都是跟風,只有他才是實在的。 等等看是不是這樣。

avatar
E*m
400

你不是真神,亂猜做啥? 誰告訴你是 applet 了? 是正經用來賺錢的東西。
你也不知道我在哪幹, 氣急敗壞的跳上跳下是覺得人品還沒丟光嗎?
這 BBS 就是你的全部社會關係是嗎? 02 年在這裡『預測』Java 也好意思說?
真是好了不起, 連自己在丟人現眼都還不自覺,還留著丟人的證據到處獻寶,
不服你還真不行。

【在 g*****g 的大作中提到】
: LOL,不是读书写过一个applet就叫业界经验了,省省吧。02年在这BBS看好java的人很
: 少,要不然我
: 何必写那样的帖子。我老说的东西,好歹有10年前的帖子为证。你小明明半路出家,还
: 车载斗量呢,装逼有意思吗。

avatar
r*n
401
拆分后每个子任务在一个core上以独占方式跑

【在 p*****2 的大作中提到】
:
: BSO年轻呀

avatar
E*m
402

Java
你的志氣大概就是『國內』,『mitbbs』 這些地方是吧?
2002, Eclipse 都出來了, 更早前, Java 市場早就已經一片火熱了,Visual J++,
Visual Age for Java, Borland Jbuilder 這些早就 出好幾版了, MS 都已經推出 C
#了。
用 Java 寫 desktop application 早就流行了。 你要是 00 年給大家推薦用 Java

web 倒也還算早, 02 年就算太晚了。

【在 g*****g 的大作中提到】
: 如果我是跟风的,精华区也轮不到我来鼓吹。JSP 99年才出来的,我00年初用JSP写网
: 站的时候,是国内最早的一批,那时候更流行的是ASP和PHP。而在JSP出来之前,Java
: 的定位还局限于applet,没多大前途。你一吹就吹破了。

avatar
g*g
403
LOL,我老是有帖子做证据的,你小全靠上下嘴皮一翻,还证据呢?
我老00年开始写jsp应用,还不能叫early adopter,你丫不装逼会死吗?

【在 E*****m 的大作中提到】
:
: Java
: 你的志氣大概就是『國內』,『mitbbs』 這些地方是吧?
: 2002, Eclipse 都出來了, 更早前, Java 市場早就已經一片火熱了,Visual J++,
: Visual Age for Java, Borland Jbuilder 這些早就 出好幾版了, MS 都已經推出 C
: #了。
: 用 Java 寫 desktop application 早就流行了。 你要是 00 年給大家推薦用 Java
: 寫
: web 倒也還算早, 02 年就算太晚了。

avatar
g*g
404
我老00年写的网站就用jsp,还不算早?我老觉得Java写desktop app没前途,所以更早
没吹呀,要不
怎么说比你小有眼光呢?

,
C

【在 E*****m 的大作中提到】
:
: Java
: 你的志氣大概就是『國內』,『mitbbs』 這些地方是吧?
: 2002, Eclipse 都出來了, 更早前, Java 市場早就已經一片火熱了,Visual J++,
: Visual Age for Java, Borland Jbuilder 這些早就 出好幾版了, MS 都已經推出 C
: #了。
: 用 Java 寫 desktop application 早就流行了。 你要是 00 年給大家推薦用 Java
: 寫
: web 倒也還算早, 02 年就算太晚了。

avatar
E*m
405

jsp 寫個 hello world? 那麼愛講有存貼證據, 你把 00 年寫 JSP 的證據拿出來看
一下。

【在 g*****g 的大作中提到】
: 我老00年写的网站就用jsp,还不算早?我老觉得Java写desktop app没前途,所以更早
: 没吹呀,要不
: 怎么说比你小有眼光呢?
:
: ,
: C

avatar
g*g
406
00年ChinaRen有一部分是用JSP写的,现在网站是大不一样了,但还是JSP。
http://class.chinaren.com/index.jsp?bru=%2Fhome.do
你小02年拿Java写业界项目的证据呢?

【在 E*****m 的大作中提到】
:
: jsp 寫個 hello world? 那麼愛講有存貼證據, 你把 00 年寫 JSP 的證據拿出來看
: 一下。

avatar
c*e
407
黄金时代阿, 那个时候给chinaren作parttime也有几千块一个月。

【在 g*****g 的大作中提到】
: 00年ChinaRen有一部分是用JSP写的,现在网站是大不一样了,但还是JSP。
: http://class.chinaren.com/index.jsp?bru=%2Fhome.do
: 你小02年拿Java写业界项目的证据呢?

avatar
b*e
408
That's controversial. Why would there be 3k bad Java developer at first
place? Maybe it's too easy to be a bad Java developer. For Haskell, you
either are a good developer, or you cannot use it at all coz you're just too
dumb to understand it.

why

【在 g*****g 的大作中提到】
: I am not against anyone using FP in a niche domain. I am merely talking why
: existing FPs won't see massive adoption as a general purpose language.
: I tend to quantify the success of the language to the values of projects
: built on top of it. To that extent, the success of the language is also
: largely correlated to its popularity.
: At the end of the day, 3000 bad Java developers are still manageable. I
: doubt you want to work with 3000 bad FP developers at all. Exactly one of
: the reason FP is not going anywhere.

avatar
g*g
409
It's simply demand and supply. When demand is way over than supply,
everybody and their grandma can be a java developer. On the other hand, it
may take a genius to understand Haskell, yet some of them are still jobless,
too bad.

too

【在 b***e 的大作中提到】
: That's controversial. Why would there be 3k bad Java developer at first
: place? Maybe it's too easy to be a bad Java developer. For Haskell, you
: either are a good developer, or you cannot use it at all coz you're just too
: dumb to understand it.
:
: why

avatar
b*e
410
Hmmm...I've seen enough java developers out of job, never seen a Haskell
developer out of job.

jobless,

【在 g*****g 的大作中提到】
: It's simply demand and supply. When demand is way over than supply,
: everybody and their grandma can be a java developer. On the other hand, it
: may take a genius to understand Haskell, yet some of them are still jobless,
: too bad.
:
: too

avatar
g*g
411
You probably know more java developers than total Haskell positions existing.

【在 b***e 的大作中提到】
: Hmmm...I've seen enough java developers out of job, never seen a Haskell
: developer out of job.
:
: jobless,

avatar
b*e
412
That's true. I know tons of J2EE experts who used to be tailors or chefs or
mailmen from "you know where". Guess that's why people are complaining H1B
is used up. But the point is, I did never see "some of the functional
programmers cannot land a job", while I do see quite "some of the (claimed
to be) Java developers cannot land a job". I personal interviewed many Java
developers with more than 10 year experience, and they cannot write a
simple exponential function correctly.

existing.

【在 g*****g 的大作中提到】
: You probably know more java developers than total Haskell positions existing.
avatar
g*g
413
If your so claimed functional programmers did not land a job as a functional
programmer, they are not a functional programmer. Or they are a jobless
functional programmer. Plain and simple.
When you can find a ton of bad java programmers employed, you know for sure
a good java programmer can get a good paycheck. That's the point.
The remaining Cobol programmers are probably very good, that doesn't mean
Cobol isn't dead.

or
H1B
Java

【在 b***e 的大作中提到】
: That's true. I know tons of J2EE experts who used to be tailors or chefs or
: mailmen from "you know where". Guess that's why people are complaining H1B
: is used up. But the point is, I did never see "some of the functional
: programmers cannot land a job", while I do see quite "some of the (claimed
: to be) Java developers cannot land a job". I personal interviewed many Java
: developers with more than 10 year experience, and they cannot write a
: simple exponential function correctly.
:
: existing.

avatar
d*i
414
Talking with goodbug is like talking with American Java Enterprise architect
working in a same company for many years. As I do short term consulting, I
know a lot of these dudes.
Basically the words are dictating and no logic. Like "Plain and simple", "
You know for sure", "That is the point". If you see those statements, not
plain, either simple. I can not know for sure and not that point. In a real
life, you can beat the architects by using codes and white board. But in
BBS, you have to lose to someone with 10 years bbs tenure, while same cases
you have to back out when at client sites, the 10 years chief architects
saying, this is the point, you do not understand since I've been here 1
million years.
Bye!~ Backing out.

functional
sure

【在 g*****g 的大作中提到】
: If your so claimed functional programmers did not land a job as a functional
: programmer, they are not a functional programmer. Or they are a jobless
: functional programmer. Plain and simple.
: When you can find a ton of bad java programmers employed, you know for sure
: a good java programmer can get a good paycheck. That's the point.
: The remaining Cobol programmers are probably very good, that doesn't mean
: Cobol isn't dead.
:
: or
: H1B

avatar
g*g
415
LOL, are you serious about logic? Ironically I am the one who always brings
out numbers and killers app when comparing languages. Programming is all
about practicability. All these functional languages provocatives, they talk
about art and beauty instead.
I use the same arguments ten years ago, simply because history proved my
principles were correct, while people in opposition was wrong. Now time has
changed, but the stance isn't. I am merely asking one question, what changes
have given FP new edge? I haven't heard any.
Learning a language is like buying a stock. You can pick a winner and
constantly compare it to its competition. Or you can pick a loser and boast
it all day long. We all hope to make money out of it, and the feeling is
hurt when we are on the wrong side.

architect
I
real
cases

【在 d*******i 的大作中提到】
: Talking with goodbug is like talking with American Java Enterprise architect
: working in a same company for many years. As I do short term consulting, I
: know a lot of these dudes.
: Basically the words are dictating and no logic. Like "Plain and simple", "
: You know for sure", "That is the point". If you see those statements, not
: plain, either simple. I can not know for sure and not that point. In a real
: life, you can beat the architects by using codes and white board. But in
: BBS, you have to lose to someone with 10 years bbs tenure, while same cases
: you have to back out when at client sites, the 10 years chief architects
: saying, this is the point, you do not understand since I've been here 1

avatar
b*e
416
Well, if that's by definition your logic, then I certainly cannot beat you
on it. But I disagree. To your point, you can similarly argue most of the
PHDs hired by Google or Facebook are jobless computer science researchers.
In my opinion, a functional developer, as smart and capable she/he is,
usually lands a good job easily, regardless if the job is directly related
to functional programming or not. The thoughts and insights gained from
understanding functional languages is beyond merely using them as
development tools.

functional
sure

【在 g*****g 的大作中提到】
: If your so claimed functional programmers did not land a job as a functional
: programmer, they are not a functional programmer. Or they are a jobless
: functional programmer. Plain and simple.
: When you can find a ton of bad java programmers employed, you know for sure
: a good java programmer can get a good paycheck. That's the point.
: The remaining Cobol programmers are probably very good, that doesn't mean
: Cobol isn't dead.
:
: or
: H1B

avatar
g*g
417
Your logic is twisted. A good developer is good because he/she can get the
job done. Not because he/she can do FP. Do you have any statistics to prove
developers that know FP are better? If not, this self-claimed superiority is
nothing but zhuangbility.

the

【在 b***e 的大作中提到】
: Well, if that's by definition your logic, then I certainly cannot beat you
: on it. But I disagree. To your point, you can similarly argue most of the
: PHDs hired by Google or Facebook are jobless computer science researchers.
: In my opinion, a functional developer, as smart and capable she/he is,
: usually lands a good job easily, regardless if the job is directly related
: to functional programming or not. The thoughts and insights gained from
: understanding functional languages is beyond merely using them as
: development tools.
:
: functional

avatar
E*m
418

prove
is
Question for you. Does arguing this make more money for you?
If yes, how? If not, are you 裝B ing ?

【在 g*****g 的大作中提到】
: Your logic is twisted. A good developer is good because he/she can get the
: job done. Not because he/she can do FP. Do you have any statistics to prove
: developers that know FP are better? If not, this self-claimed superiority is
: nothing but zhuangbility.
:
: the

avatar
g*g
419
Java developers make much more money than Haskell developers, that's just a
fact.
Since when stating fact is also zhuangbility?
http://www.indeed.com/salary?q1=java&l1=&q2=haskell&l2=&tm=1
Where's your proof of industry java project in 2002 BTW? You were exposed
the other day and now you are back again?

【在 E*****m 的大作中提到】
:
: prove
: is
: Question for you. Does arguing this make more money for you?
: If yes, how? If not, are you 裝B ing ?

avatar
E*m
421

a
Now you think there are other thing than money that you care?
If you didn't understand the question, I'm asking does YOU arguing this
make YOU more money? Can you answer this?
Did I promise I'll prove it to you? No. You don't need to believe me. It's
not even
the point. You can't defend your own argument, so you have to resort to
personal attach. So pathetic.

【在 g*****g 的大作中提到】
: Java developers make much more money than Haskell developers, that's just a
: fact.
: Since when stating fact is also zhuangbility?
: http://www.indeed.com/salary?q1=java&l1=&q2=haskell&l2=&tm=1
: Where's your proof of industry java project in 2002 BTW? You were exposed
: the other day and now you are back again?

avatar
a*i
422
you need not answer this nonsense question
everyone posts here for money or zhuangB?
Did he try to answer the question before he asked?
or M$ pays him for arguing here

a

【在 g*****g 的大作中提到】
: Java developers make much more money than Haskell developers, that's just a
: fact.
: Since when stating fact is also zhuangbility?
: http://www.indeed.com/salary?q1=java&l1=&q2=haskell&l2=&tm=1
: Where's your proof of industry java project in 2002 BTW? You were exposed
: the other day and now you are back again?

avatar
E*m
423

Actually, this is goodbug's idea. He thinks only money is
important, everything else is zhuangB.

【在 a****i 的大作中提到】
: you need not answer this nonsense question
: everyone posts here for money or zhuangB?
: Did he try to answer the question before he asked?
: or M$ pays him for arguing here
:
: a

avatar
g*g
424
Not really, I am just disgusted by someone's self-claim superiority.
Some people feel they are better programmers because they know FP, but they
don't have any number to back it up, they don't even program FP for a living
. Now that's textbook zhuangB.
Money is not everything. But at least that's a number that's objective and
easy to find on Internet.

【在 E*****m 的大作中提到】
:
: Actually, this is goodbug's idea. He thinks only money is
: important, everything else is zhuangB.

avatar
b*e
426
I didn't get it where my logic is twisted. Therefore I prefer to question
your skills of reading comprehension. Nonetheless, with my limited personal
experience, I do observe average FP developers exhibiting much more
superior smartness and capability over Java developers (I did work in both
contexts for non-trivial/significant time). Also, to my observation FP
developers are either making more of a fortune or getting a better social
status than mere Java developers.

prove
is

【在 g*****g 的大作中提到】
: Your logic is twisted. A good developer is good because he/she can get the
: job done. Not because he/she can do FP. Do you have any statistics to prove
: developers that know FP are better? If not, this self-claimed superiority is
: nothing but zhuangbility.
:
: the

avatar
g*g
427
Your observation. LOL. Do you know 4 big cows in this BBS?
My friends, my relatives, my neighbors and my classmates.
I show numbers to prove FP programmers would have a hard time to find a job.
Many of your brilliant FP programmers are stuck in thousand year postdoc,
you can't find a good explanation otherwisefor $28K average salary for
Haskell jobs.
And to show you why personal observation can be so biased. Most of java
programmers in my company make more than $200K a year. If they work for more
than 3 years in the company they are most likely a millionaire due to stock
option. But I wouldn't use that personal observation to generalize social
status for a language's developers like you just did.

personal

【在 b***e 的大作中提到】
: I didn't get it where my logic is twisted. Therefore I prefer to question
: your skills of reading comprehension. Nonetheless, with my limited personal
: experience, I do observe average FP developers exhibiting much more
: superior smartness and capability over Java developers (I did work in both
: contexts for non-trivial/significant time). Also, to my observation FP
: developers are either making more of a fortune or getting a better social
: status than mere Java developers.
:
: prove
: is

avatar
E*m
428

they
living
Hitting strawman?
NOW money is not everything? So, what else is important?

【在 g*****g 的大作中提到】
: Not really, I am just disgusted by someone's self-claim superiority.
: Some people feel they are better programmers because they know FP, but they
: don't have any number to back it up, they don't even program FP for a living
: . Now that's textbook zhuangB.
: Money is not everything. But at least that's a number that's objective and
: easy to find on Internet.

avatar
g*g
429
Like humble and not zhuangB even if you know how to kill a dragon.

【在 E*****m 的大作中提到】
:
: they
: living
: Hitting strawman?
: NOW money is not everything? So, what else is important?

avatar
b*e
430
I question the accuracy of the Haskell developer salary report, well, yes,
depending on how do you classify Haskell developers. Most of the Haskell
developers are truly academic researchers. Those people who worked with me
before are mostly tenure professors at some universities. So far I didn't
find a single case in my list of 4 big cows who's "thousand years of post-
doc". This is not biology (sorry for my candor, biologists). They might
not be making as high as 200k per year as far as base salary is concerned,
but undeniably, they are at a higher social status and earn more
professional respects than mere Java developers. Their contribution to
science and to the development of human society is not measured through how
many dollars they make per year.
On the other hand, even if people who are a bit dumber than those smart
asses, like me, who ended up in the software industry, are benefiting from
the valuable experience from programming functional languages. As I said in
another post, the insights that people gain from understanding how FPLs
work can great improve the personal's vision in software engineering. For
an instance, like Wang Yin said, visitor pattern doesn't exist in Haskell (
as a representative of FPL), because it's just a language feature. That
being said, if you did program Haskell and understand how pattern matching
works there, you would have a much better understanding of why the visitor
pattern is constructed that way. That's know-why, which beyond a mere know-
how. Furthermore, with the involvement of Java generics, sometimes there
are variants of visitor patterns that are pretty hacky and tricky. But if
you did know that there's something call Generalized Algebraic Datatype (
GADT) in Haskell, you would realized those hacks are not totally out of
nowhere from some smart-ass' mind. They are just mimicking the enhanced
pattern matching in GADT. This is know-why again, which is beyond a mere
know-how. Only with know-how can you be original and creative to create new
patterns that suite new needs.
I do not merely take a programming language as a development tool and get
religious about it. I tend to see through the surface and reach the essence
. When I look at Haskell, I see Algebraic Data Type and type directed
pattern matching, I see non-strictness/lazy evaluation, I see functional
closures and lambda lifting, I see type/constructor class based overloading,
I see implicit parameters, I see monad based side effects. When I look at
Lisp, I see meta programming, I see macros, I see CLOS, I see explicit
continuation passing. When I see Java, I see object oriented paradigm, I
see OO based encapsulation, I see inclusion polymorphism (subtyping), I see
singly inheritance hierarchy with interfaces, I see garbage collection, I
see just-in-time compilation, and I see weak references. When I see Scala,
I see mixins, I see type inference for second order polymorphism, I see
light-weight lock free processes.
If your final career goal is to be a senior^n Java engineer and get
comfortable with 200k yearly income and enjoy it for the rest of your life,
that's good for you. I had been there and done that years ago, and I moved
on beyond that.

job.
more
stock

【在 g*****g 的大作中提到】
: Your observation. LOL. Do you know 4 big cows in this BBS?
: My friends, my relatives, my neighbors and my classmates.
: I show numbers to prove FP programmers would have a hard time to find a job.
: Many of your brilliant FP programmers are stuck in thousand year postdoc,
: you can't find a good explanation otherwisefor $28K average salary for
: Haskell jobs.
: And to show you why personal observation can be so biased. Most of java
: programmers in my company make more than $200K a year. If they work for more
: than 3 years in the company they are most likely a millionaire due to stock
: option. But I wouldn't use that personal observation to generalize social

avatar
g*g
431
It's one thing saying learning FP can benefit programming skills, which I
definitely agree. It's another thing saying FP programmers are better than
Java programmers, which is really a joke. They can't even find a job as a FP
programmers, if better means killing dragon, sure, but nobody really cares.
There are a lot of things to learn and all of them can have some benefits,
the question is how much? Personally I believe no matter what programming
language you are using, mastering the mainstream frameworks and getting keen
on the hot technologies like NoSQL, Cloud etc. is more beneficial than
learning FP. But it's your own choice.
At the end of the day, however, programming is an engineering practice. The
end products prove the usefulness of the language and the skills the
programmers practicing them. It's not that difficult to quantify. You just
have nothing to back up your claims with the worlds full of Java products
and FP products hard to find. Talk is cheap. How much you or me earn is not
the matter. The matter is not to talk bullshit and only proof is the four
big cows you know, which is still all you have with your long thesis, that's
not gonna work for techies.

me
how

【在 b***e 的大作中提到】
: I question the accuracy of the Haskell developer salary report, well, yes,
: depending on how do you classify Haskell developers. Most of the Haskell
: developers are truly academic researchers. Those people who worked with me
: before are mostly tenure professors at some universities. So far I didn't
: find a single case in my list of 4 big cows who's "thousand years of post-
: doc". This is not biology (sorry for my candor, biologists). They might
: not be making as high as 200k per year as far as base salary is concerned,
: but undeniably, they are at a higher social status and earn more
: professional respects than mere Java developers. Their contribution to
: science and to the development of human society is not measured through how

avatar
n*t
432
But not many people make money directly from knowing functional programming
language. On the other hand, I think any job,that pays your directly because
you are using a particular language, is not so good as a job. It can give
you are decent life maybe, but might be not all that interesting.
Knowing a language that is not popular in industry and still learning or
even mastering it, could be an evidence the learner is interested in various
programming aspects and are probably more skillful than the normal
"learn-something-to-get-a-job" type of programmer. Very few programmers who
know FP just know FP. Most of them knows enough C/C++/Java before that and
they are probably going to learn a lot more in the future. So in this
regard, it is probably right to say FP programmer are usually better in
probablity. It does not mean learning Java means you are stupid though.

FP
cares.
keen
The

【在 g*****g 的大作中提到】
: It's one thing saying learning FP can benefit programming skills, which I
: definitely agree. It's another thing saying FP programmers are better than
: Java programmers, which is really a joke. They can't even find a job as a FP
: programmers, if better means killing dragon, sure, but nobody really cares.
: There are a lot of things to learn and all of them can have some benefits,
: the question is how much? Personally I believe no matter what programming
: language you are using, mastering the mainstream frameworks and getting keen
: on the hot technologies like NoSQL, Cloud etc. is more beneficial than
: learning FP. But it's your own choice.
: At the end of the day, however, programming is an engineering practice. The

avatar
G*l
433
你又犯晕了。我没看到有人说FP programmer programmer比java好,至少几个发言比较
多的id都没这么说。事实上除了acdemic之外,绝大多数fp progammer同时也大量使用
java,c#,c++,python这些非fp语言。完全是你有受迫害妄想症,看到别人说fp好,就偏
要往别人意思是java不好联想,看到比人说fp有前途就往java没前途去理解。我对这个
thread里面你的观点鉴定完毕。

FP
cares.
keen
The

【在 g*****g 的大作中提到】
: It's one thing saying learning FP can benefit programming skills, which I
: definitely agree. It's another thing saying FP programmers are better than
: Java programmers, which is really a joke. They can't even find a job as a FP
: programmers, if better means killing dragon, sure, but nobody really cares.
: There are a lot of things to learn and all of them can have some benefits,
: the question is how much? Personally I believe no matter what programming
: language you are using, mastering the mainstream frameworks and getting keen
: on the hot technologies like NoSQL, Cloud etc. is more beneficial than
: learning FP. But it's your own choice.
: At the end of the day, however, programming is an engineering practice. The

avatar
g*g
434

你就别圆了,这位底下写得清清楚楚,FP programmer从IQ,fortune, social status
全方
位完灭java developer。我老就是要他提供一些数字来证明一下,这位就开始玩四大牛
人的把戏。
我没啥迫害妄想症,那位blaze 10年前就鼓吹过Haskell,跟我争过FP会如何牛逼云云
,你不信可以去google,事实上是这10年,FP的地位几乎没有提高,倒是他看不起的
Java地位提高了很多。他就是老脸拉不下来。
personal

【在 G***l 的大作中提到】
: 你又犯晕了。我没看到有人说FP programmer programmer比java好,至少几个发言比较
: 多的id都没这么说。事实上除了acdemic之外,绝大多数fp progammer同时也大量使用
: java,c#,c++,python这些非fp语言。完全是你有受迫害妄想症,看到别人说fp好,就偏
: 要往别人意思是java不好联想,看到比人说fp有前途就往java没前途去理解。我对这个
: thread里面你的观点鉴定完毕。
:
: FP
: cares.
: keen
: The

avatar
g*g
435
As I mentioned, there are so much to learn in programming. What's so special
about FP? There's simply no proof learning FP is more beneficial than using
the time to learn other things like new frameworks and technologies.

programming
because
various
who

【在 n******t 的大作中提到】
: But not many people make money directly from knowing functional programming
: language. On the other hand, I think any job,that pays your directly because
: you are using a particular language, is not so good as a job. It can give
: you are decent life maybe, but might be not all that interesting.
: Knowing a language that is not popular in industry and still learning or
: even mastering it, could be an evidence the learner is interested in various
: programming aspects and are probably more skillful than the normal
: "learn-something-to-get-a-job" type of programmer. Very few programmers who
: know FP just know FP. Most of them knows enough C/C++/Java before that and
: they are probably going to learn a lot more in the future. So in this

avatar
g*t
436
计算机本科的计算理论基础什么的,一般都要学FP吧?
就算不学商用FP,Lambda Calculus之类的东西,很多基础课本都有包括.
这个和图灵机类似.属于基本的基础.一个程序员,能没学过Turing机么?
虽然不一定有用.

As I mentioned, there are so much to learn in programming. What's so special
about FP? There's simply no proof learning FP is more beneficial than using
the time to learn other things like new frameworks and technologies.
programming
because
various
who

【在 g*****g 的大作中提到】
: As I mentioned, there are so much to learn in programming. What's so special
: about FP? There's simply no proof learning FP is more beneficial than using
: the time to learn other things like new frameworks and technologies.
:
: programming
: because
: various
: who

avatar
g*g
437
计算理论本来就不是必修课。就跟图像处理,图形学,人工智能,这些都是专业方向,
不是CS本科必修课。
我打赌这版上大多数人都没学过图像处理和图形学,但我不会说什么学过图形学的秒杀
没学过的云云。

special
using

【在 g****t 的大作中提到】
: 计算机本科的计算理论基础什么的,一般都要学FP吧?
: 就算不学商用FP,Lambda Calculus之类的东西,很多基础课本都有包括.
: 这个和图灵机类似.属于基本的基础.一个程序员,能没学过Turing机么?
: 虽然不一定有用.
:
: As I mentioned, there are so much to learn in programming. What's so special
: about FP? There's simply no proof learning FP is more beneficial than using
: the time to learn other things like new frameworks and technologies.
: programming
: because

avatar
g*t
438
CS哪个课学图灵机? (或者哪个程序员对图灵机感兴趣。)
一般也都会学到Lambda Calculs,部分递归函数什么的。

计算理论本来就不是必修课。就跟图像处理,图形学,人工智能,这些都是专业方向,
不是CS本科必修课。
我打赌这版上大多数人都没学过图像处理和图形学,但我不会说什么学过图形学的秒杀
没学过的云云。
special
using

【在 g*****g 的大作中提到】
: 计算理论本来就不是必修课。就跟图像处理,图形学,人工智能,这些都是专业方向,
: 不是CS本科必修课。
: 我打赌这版上大多数人都没学过图像处理和图形学,但我不会说什么学过图形学的秒杀
: 没学过的云云。
:
: special
: using

avatar
g*g
439
形式语言与自动机,选修课。

【在 g****t 的大作中提到】
: CS哪个课学图灵机? (或者哪个程序员对图灵机感兴趣。)
: 一般也都会学到Lambda Calculs,部分递归函数什么的。
:
: 计算理论本来就不是必修课。就跟图像处理,图形学,人工智能,这些都是专业方向,
: 不是CS本科必修课。
: 我打赌这版上大多数人都没学过图像处理和图形学,但我不会说什么学过图形学的秒杀
: 没学过的云云。
: special
: using

avatar
A*t
440
说得好像学了fp,连java都不会写了似的

a

【在 g*****g 的大作中提到】
: Good find. Though only 43 jobs compared to 66K for Java. It's more or less a
: skill to kill the dragon.
: http://www.indeed.com/jobs?q=Ocaml&l=

avatar
b*e
441
事实上scala和javascript都属于FP,只不过不像Haskell那么纯粹。FP的本质在于对
first class function和higher order function的支持。
我对四大牛人什么的说实话不感兴趣。我十年前也并非鼓吹FP。当年你挑起一个帖子,
说你认为functional language programmer都是"freaks who cannot think straight"
(大体是你的原话吧)。我路见不平而已。其中是非曲直有目共睹。
我职业潜水员,一向不太发帖子,这次多说几句主要是你们这些Java轮bash FP过激了
。我一向鼓励对FP的兴趣和探究,不愿看到这些志向过早的为世俗所羁。或有矫枉过正
。言止此尔。

status

【在 g*****g 的大作中提到】
: 形式语言与自动机,选修课。
avatar
s*o
442
why is there a line drawn between functional language programmers and non
functional language programmers? It's the first time I've heard of it. It's
stupid.

straight"

【在 b***e 的大作中提到】
: 事实上scala和javascript都属于FP,只不过不像Haskell那么纯粹。FP的本质在于对
: first class function和higher order function的支持。
: 我对四大牛人什么的说实话不感兴趣。我十年前也并非鼓吹FP。当年你挑起一个帖子,
: 说你认为functional language programmer都是"freaks who cannot think straight"
: (大体是你的原话吧)。我路见不平而已。其中是非曲直有目共睹。
: 我职业潜水员,一向不太发帖子,这次多说几句主要是你们这些Java轮bash FP过激了
: 。我一向鼓励对FP的兴趣和探究,不愿看到这些志向过早的为世俗所羁。或有矫枉过正
: 。言止此尔。
:
: status

avatar
h*i
443
I can understand your frustration.
But, the truth of the matter is that a programmer who is versed in FP is
indeed considered by almost every employer as a better programmer than one
who is not versed in FP, everything else being equal. This is simply a fact.
You can be disgusted about the fact, but it does not change the fact.
If you are really practical minded as you seem to claim yourself to be, you
may want to work with the reality rather than whine about it.

they
living

【在 g*****g 的大作中提到】
: Not really, I am just disgusted by someone's self-claim superiority.
: Some people feel they are better programmers because they know FP, but they
: don't have any number to back it up, they don't even program FP for a living
: . Now that's textbook zhuangB.
: Money is not everything. But at least that's a number that's objective and
: easy to find on Internet.

avatar
h*i
444
I am among those people who wrote almost exclusively in Java since 1997. I
was invited to Sun's dinners in Beijing and totally bought their propaganda
(compare with C++, Java was so much better). In those days, one could
easily win awards by writing Java applets, which I got a couple myself.
Later on, I even wrote 3D games in Java. Fun times...
Then Java became enterprisy, with all those frameworks and architecture
astronauts running the show, and lost all of its charm...
Now I wrote almost exclusively in Clojure...

【在 t*s 的大作中提到】
: 俺家当初订阅了一份报纸,叫电脑商情报
: 我记得97 98年开始,那报纸上面就整天宣传java改变世界了。国内最开始java的那批
: 人我认为是从1.0开始就追捧的。

avatar
h*i
445
There isn't a line, but "FP programmers" are those programmers who can do FP
, "non-FP programmers" are those who cannot. Because all programmers can do
non-FP, and only "FP programmers" can do FP, "FP programmers" are normally
considered better programmers, everything else being equal.

s

【在 s***o 的大作中提到】
: why is there a line drawn between functional language programmers and non
: functional language programmers? It's the first time I've heard of it. It's
: stupid.
:
: straight"

avatar
h*i
446
There's no such thing as a FP programmer who does not know how to program in
Java if they need to. If they can make a good living without doing that,
why should they. After all, a Java programmer is like a janitor these days,
it's a replaceable commodity because every one can do it.
Truth hurts.

FP
cares.
keen
The

【在 g*****g 的大作中提到】
: It's one thing saying learning FP can benefit programming skills, which I
: definitely agree. It's another thing saying FP programmers are better than
: Java programmers, which is really a joke. They can't even find a job as a FP
: programmers, if better means killing dragon, sure, but nobody really cares.
: There are a lot of things to learn and all of them can have some benefits,
: the question is how much? Personally I believe no matter what programming
: language you are using, mastering the mainstream frameworks and getting keen
: on the hot technologies like NoSQL, Cloud etc. is more beneficial than
: learning FP. But it's your own choice.
: At the end of the day, however, programming is an engineering practice. The

avatar
g*g
447
I am not frustrated, and why should I? If you are at all being about
practical, you should notice functional languages ain't spring chicken, in
fact, they've existed for much longer time than OO languages and they never
took off. Plus, there's absolutely no data supporting FP programmers are
better. If anything, the salary on indeed suggests their market value is
just lower, much lower. Now that's some fact.

fact.
you

【在 h*i 的大作中提到】
: I can understand your frustration.
: But, the truth of the matter is that a programmer who is versed in FP is
: indeed considered by almost every employer as a better programmer than one
: who is not versed in FP, everything else being equal. This is simply a fact.
: You can be disgusted about the fact, but it does not change the fact.
: If you are really practical minded as you seem to claim yourself to be, you
: may want to work with the reality rather than whine about it.
:
: they
: living

avatar
g*g
448
LOL, truth hurts, doesn't it?
http://www.indeed.com/salary?q1=haskell&l1=&q2=java&l2=&q3=sche
Not to mention Java jobs are like 10 times than all these languages combined.
If you are really good, in the normal distribution you can get in the far
right end.
By the way, your clojure peers ain't doing very well either. I feel sorry
for them.

in
,

【在 h*i 的大作中提到】
: There's no such thing as a FP programmer who does not know how to program in
: Java if they need to. If they can make a good living without doing that,
: why should they. After all, a Java programmer is like a janitor these days,
: it's a replaceable commodity because every one can do it.
: Truth hurts.
:
: FP
: cares.
: keen
: The

avatar
g*g
449
There's no such things as all things being equal. When people start marking
themselves "FP programmers" for self-claimed superiority while not holding
such a a job, it's like one boasting his dragon killing skills.
Normal people would be proud of what they do and do well, not what they don'
t do but they could do. I see severe confidence lacking here.

FP
do
normally

【在 h*i 的大作中提到】
: There isn't a line, but "FP programmers" are those programmers who can do FP
: , "non-FP programmers" are those who cannot. Because all programmers can do
: non-FP, and only "FP programmers" can do FP, "FP programmers" are normally
: considered better programmers, everything else being equal.
:
: s

avatar
c*9
450
牛。你通过什么样的渠道卖的?

【在 a*****e 的大作中提到】
: LOL, 这是要比谁最先搞 java 吗?我 97 年写的 Java 程序后来卖给Yahoo和华渊网。
: 后来再也没碰过 Java,所以 J2EE 这些我完全没接触过,不敢再古德霸面前抖啊,哈
: 哈哈

avatar
c*9
451
你说的没错,我以前的同事中,会FP的java programmer明显水平比不会的高很多。

personal

【在 b***e 的大作中提到】
: I didn't get it where my logic is twisted. Therefore I prefer to question
: your skills of reading comprehension. Nonetheless, with my limited personal
: experience, I do observe average FP developers exhibiting much more
: superior smartness and capability over Java developers (I did work in both
: contexts for non-trivial/significant time). Also, to my observation FP
: developers are either making more of a fortune or getting a better social
: status than mere Java developers.
:
: prove
: is

avatar
c*9
452
你说的没错,我以前的同事中,会FP(比如scheme)的java programmer明显水平比不
会的高很多。

personal

【在 b***e 的大作中提到】
: I didn't get it where my logic is twisted. Therefore I prefer to question
: your skills of reading comprehension. Nonetheless, with my limited personal
: experience, I do observe average FP developers exhibiting much more
: superior smartness and capability over Java developers (I did work in both
: contexts for non-trivial/significant time). Also, to my observation FP
: developers are either making more of a fortune or getting a better social
: status than mere Java developers.
:
: prove
: is

avatar
c*9
453
说得好。人不能和猪一样,要有点更高的追求。

me
how

【在 b***e 的大作中提到】
: I question the accuracy of the Haskell developer salary report, well, yes,
: depending on how do you classify Haskell developers. Most of the Haskell
: developers are truly academic researchers. Those people who worked with me
: before are mostly tenure professors at some universities. So far I didn't
: find a single case in my list of 4 big cows who's "thousand years of post-
: doc". This is not biology (sorry for my candor, biologists). They might
: not be making as high as 200k per year as far as base salary is concerned,
: but undeniably, they are at a higher social status and earn more
: professional respects than mere Java developers. Their contribution to
: science and to the development of human society is not measured through how

avatar
z*e
454
追求不在语言这种层面上啊
谁没事老倒腾这种东西
就一工具
利用工具去实现什么
那才是真正的追求

【在 c*******9 的大作中提到】
: 说得好。人不能和猪一样,要有点更高的追求。
:
: me
: how

avatar
c*9
455
没错。认识一些java或c++ programmer认识到java或c++的不足才去学functional
programming。

programming
because
various
who

【在 n******t 的大作中提到】
: But not many people make money directly from knowing functional programming
: language. On the other hand, I think any job,that pays your directly because
: you are using a particular language, is not so good as a job. It can give
: you are decent life maybe, but might be not all that interesting.
: Knowing a language that is not popular in industry and still learning or
: even mastering it, could be an evidence the learner is interested in various
: programming aspects and are probably more skillful than the normal
: "learn-something-to-get-a-job" type of programmer. Very few programmers who
: know FP just know FP. Most of them knows enough C/C++/Java before that and
: they are probably going to learn a lot more in the future. So in this

avatar
g*g
456
弄半天还停留语言层次上呢,我说了平台之争说了多少年,说了前端风水轮流转,后端
jvm 独大。争来争去还不是拾我牙慧。要装逼也要点 track record吧。

【在 c*******9 的大作中提到】
: 没错。认识一些java或c++ programmer认识到java或c++的不足才去学functional
: programming。
:
: programming
: because
: various
: who

avatar
c*9
457
这里是Programming版,也就谈语言了。
从一个小的方面的讨论可以看出一个人在其他方面的思维方式。支持FP的多数是比较理
想主义。
支持流行语言的多数是比较现实主义。持哪种主义在生存发展上站优势不好说,似乎现
实主义者大多适合当manager,理想主义者大多适合学术和艺术,但最伟大的manager像
jobs还是理想主义者。从我对周围人的观察来看,理想主义者虽然会在不完美的现实中
会更多碰壁,但内心往往更宁静快乐。
再说“实现什么”,一些FP的支持者也是因为自己要实现的东西用非FP实现不方便,才
去花时间精力去学习FP。

【在 z****e 的大作中提到】
: 追求不在语言这种层面上啊
: 谁没事老倒腾这种东西
: 就一工具
: 利用工具去实现什么
: 那才是真正的追求

avatar
c*9
458
语言层次说大可大,说小可小。这里讨论要什么track record是没意思的,又不是找人
要投资。
bill gate,jobs成功前能有多少 值得track record的东西,如果不是事后诸葛的话。

【在 g*****g 的大作中提到】
: 弄半天还停留语言层次上呢,我说了平台之争说了多少年,说了前端风水轮流转,后端
: jvm 独大。争来争去还不是拾我牙慧。要装逼也要点 track record吧。

avatar
g*g
459
不懂是小事,非要不懂装懂闹笑话,就不要怪我打脸。鼓吹 fp 的没几年就有一拨,吹
来吹去除了现在能在 jvm 上跑了,也没看出什么大的进步。

【在 c*******9 的大作中提到】
: 语言层次说大可大,说小可小。这里讨论要什么track record是没意思的,又不是找人
: 要投资。
: bill gate,jobs成功前能有多少 值得track record的东西,如果不是事后诸葛的话。

avatar
c*9
460
这有谁不懂装懂?讨论中有些细节错误难免。有什么打脸不打脸了的,多知道些细节就
很牛逼了?

【在 g*****g 的大作中提到】
: 不懂是小事,非要不懂装懂闹笑话,就不要怪我打脸。鼓吹 fp 的没几年就有一拨,吹
: 来吹去除了现在能在 jvm 上跑了,也没看出什么大的进步。

avatar
g*g
461
还是那句话,说啥都行,愿意闹笑话也由你。事实胜于雄辩。fp 程序员明明都快饿死
了,还成天以更好的程序员自居,莫非是精神胜利发法?

【在 c*******9 的大作中提到】
: 这有谁不懂装懂?讨论中有些细节错误难免。有什么打脸不打脸了的,多知道些细节就
: 很牛逼了?

avatar
c*9
462
我不道说什么了让您奸笑了。我说过仅仅通过我的观察的一些观点。你如果什么都要所
谓统计支持才可信,
我也想要个统计支持说明你不是发帖机器人,见到支持FP的就自动发帖反对。你说的
java在业界流行,我一点都不反对,
那是显而易见的事实,反复说就是bullshit,没一点有价值的信息。

【在 g*****g 的大作中提到】
: 还是那句话,说啥都行,愿意闹笑话也由你。事实胜于雄辩。fp 程序员明明都快饿死
: 了,还成天以更好的程序员自居,莫非是精神胜利发法?

avatar
g*g
463
这个bbs上最不靠谱的例子就是四大牛人了,你是新警察吧。我老看不惯的就是几个装B
的半吊子程序员,学了点屠龙技,就自以为比别人牛逼,成天来踩俺们java 码农。
真让拿点统计,立刻尿了。
我老熟悉大量 java轮子,论实用无出其右。结果使出来还要被鄙视是拼凑方案。倒是
什么fp 屠龙技,没几个真工作里用过,偏偏成天有捧臭脚的。板上装B之风可以休矣。

【在 c*******9 的大作中提到】
: 我不道说什么了让您奸笑了。我说过仅仅通过我的观察的一些观点。你如果什么都要所
: 谓统计支持才可信,
: 我也想要个统计支持说明你不是发帖机器人,见到支持FP的就自动发帖反对。你说的
: java在业界流行,我一点都不反对,
: 那是显而易见的事实,反复说就是bullshit,没一点有价值的信息。

avatar
c*9
464
他们什么水平我不了解,和你比哪个更牛逼我也不关心。装B不装B更不是我关心的事,
装B可以说是人的本性,也可以说是一种本能。我关心的是论点是否informative,让我
长些见识,而不是每次都说些老生常谈的东西。

装B

【在 g*****g 的大作中提到】
: 这个bbs上最不靠谱的例子就是四大牛人了,你是新警察吧。我老看不惯的就是几个装B
: 的半吊子程序员,学了点屠龙技,就自以为比别人牛逼,成天来踩俺们java 码农。
: 真让拿点统计,立刻尿了。
: 我老熟悉大量 java轮子,论实用无出其右。结果使出来还要被鄙视是拼凑方案。倒是
: 什么fp 屠龙技,没几个真工作里用过,偏偏成天有捧臭脚的。板上装B之风可以休矣。

avatar
q*c
465
儿皇帝能当皇帝是因为爹牛。js 就是运气好认了 开国皇帝 netscape 当爹。
对比 java 那是千军万马杀出来自己开国当皇帝,完全没有可比性。

【在 x****u 的大作中提到】
: 所以说JavaScript也能长盛不衰,主要是特定场合有特定用处。
avatar
b*e
466
这个不好说是认的吧,应该说是亲生的。

【在 q*c 的大作中提到】
: 儿皇帝能当皇帝是因为爹牛。js 就是运气好认了 开国皇帝 netscape 当爹。
: 对比 java 那是千军万马杀出来自己开国当皇帝,完全没有可比性。

avatar
q*c
467
总有时间比钱多的愣头青说:用最合适的语言解决某个问题。
问题是熟悉工具本身就是问题的一部分,甚至是大部分。

【在 d**********x 的大作中提到】
: 人总是在遇到问题的时候才想起来前人总结的经验。。。
: 编译原理一上来就说了语言的第一大concern就是learning cost...
:
: the

avatar
q*c
468
30 个 bad fp 就能把你干的死定。
只要多来几个匿名函数嵌套回调, 夹杂着 implicit parameter conversion,,就能让
你的大脑 stack overflow.

why

【在 g*****g 的大作中提到】
: I am not against anyone using FP in a niche domain. I am merely talking why
: existing FPs won't see massive adoption as a general purpose language.
: I tend to quantify the success of the language to the values of projects
: built on top of it. To that extent, the success of the language is also
: largely correlated to its popularity.
: At the end of the day, 3000 bad Java developers are still manageable. I
: doubt you want to work with 3000 bad FP developers at all. Exactly one of
: the reason FP is not going anywhere.

avatar
q*c
469
you can live till death with some cancer.
you can barely see next month sunlight with other cancer..
不同的癌症,效果是天地的差别。混淆程度是不对的。

developers,

【在 s***o 的大作中提到】
: I agree with most of you points.
: but the last one just has no base at all. bad developers are bad developers,
: they are cancer no matter what language they use.
:
: why

avatar
c*9
470
fp 程序员明明都快饿死了?这个没听说。
fp 程序员少不能说都快饿死吧,就像CEO少,不能说CEO说都快饿死了。当然CEO自己这
么说也对。。。。

【在 g*****g 的大作中提到】
: 还是那句话,说啥都行,愿意闹笑话也由你。事实胜于雄辩。fp 程序员明明都快饿死
: 了,还成天以更好的程序员自居,莫非是精神胜利发法?

avatar
n*1
471
他没用考虑一众excel程序猿,人赚得可不少。

【在 c*******9 的大作中提到】
: fp 程序员明明都快饿死了?这个没听说。
: fp 程序员少不能说都快饿死吧,就像CEO少,不能说CEO说都快饿死了。当然CEO自己这
: 么说也对。。。。

avatar
c*9
472
jobs “stay hungry”, 明显就是饿死的。。。。

【在 c*******9 的大作中提到】
: fp 程序员明明都快饿死了?这个没听说。
: fp 程序员少不能说都快饿死吧,就像CEO少,不能说CEO说都快饿死了。当然CEO自己这
: 么说也对。。。。

avatar
q*c
473
总长见识可不一定是好事。
good stuff many times are boring.

【在 c*******9 的大作中提到】
: 他们什么水平我不了解,和你比哪个更牛逼我也不关心。装B不装B更不是我关心的事,
: 装B可以说是人的本性,也可以说是一种本能。我关心的是论点是否informative,让我
: 长些见识,而不是每次都说些老生常谈的东西。
:
: 装B

avatar
m*t
474
excel算FP,是指excel本身,还是指VBA?给展开说说吧

【在 n****1 的大作中提到】
: 他没用考虑一众excel程序猿,人赚得可不少。
avatar
n*w
477
excel本身,很早以前看到过有人这么说。
google到这个
“While most people don't call it programming, technically excel
spreadsheets comprise a functional programming language, and like most
functional programming languages, it excels (pun intended) at numerical
calculations. Each cell contains a constant or a formula, which is a pure
function since it has no side effects. Whenever a cell is changed, the "
program" executes. Selection is done via functions like IF or HLOOKUP.
Sequence is determined by formula dependencies, and "iteration" is done via
a fill.”
http://programmers.stackexchange.com/questions/125990/questions

【在 m******t 的大作中提到】
: excel算FP,是指excel本身,还是指VBA?给展开说说吧
avatar
f*x
478
It's meaningless to invoke tenure, years of experience, market dominance or
salary in a discussion about technologies. The world is never short of
examples of stupid but highly paid people, or stupid but commercially
successful products. Commercial success does not necessarily mean
technological superiority, similarly the programmer's salary is just a
reflection of market supply and demand, nothing more. Invoking tenure or
salary is the quickest and surest way to degenerate an otherwise informative
discussion in to inflammatory nonsense.
To share some of my own experience, I have been programming C++/java/python
for a long time, and I recently learned Clojure on my own out of curiosity.
I did experience the "profound enlightening experience" that is best
summarized by Eric Raymond: "Lisp is worth learning for the profound
enlightenment experience you will have when you finally get it; that
experience will make you a better programmer for the rest of your days, even
if you never actually use Lisp itself a lot."
I may never got to use Clojure in my work, but there is no doubt that
learning Clojure made me a much much better programmer. My team primarily
uses Python, I would hire a programmer who is fluent in Clojure (or other FP
like Lisp/Haskell) in a heart beat over a C++/java/Python only programmer,
even if all he will be doing in the team is Python.
avatar
t*a
479
excel还真是有FP的味道,而且还挺高级的叫做reactive functional programming。本
质上是一个会自动触发的计算workflow。
javalin这个clojure library就在模仿excel的计算概念:
https://github.com/tailrecursion/javelin

【在 g*****g 的大作中提到】
: 表上带几个函数就FP了?I 服了U。
avatar
t*a
480
谢谢分享,我也有相同的体会。

or
informative
python
.

【在 f******x 的大作中提到】
: It's meaningless to invoke tenure, years of experience, market dominance or
: salary in a discussion about technologies. The world is never short of
: examples of stupid but highly paid people, or stupid but commercially
: successful products. Commercial success does not necessarily mean
: technological superiority, similarly the programmer's salary is just a
: reflection of market supply and demand, nothing more. Invoking tenure or
: salary is the quickest and surest way to degenerate an otherwise informative
: discussion in to inflammatory nonsense.
: To share some of my own experience, I have been programming C++/java/python
: for a long time, and I recently learned Clojure on my own out of curiosity.

avatar
p*2
481

or
informative
python
.
顶大牛。看来学习Clojure才是王道。

【在 f******x 的大作中提到】
: It's meaningless to invoke tenure, years of experience, market dominance or
: salary in a discussion about technologies. The world is never short of
: examples of stupid but highly paid people, or stupid but commercially
: successful products. Commercial success does not necessarily mean
: technological superiority, similarly the programmer's salary is just a
: reflection of market supply and demand, nothing more. Invoking tenure or
: salary is the quickest and surest way to degenerate an otherwise informative
: discussion in to inflammatory nonsense.
: To share some of my own experience, I have been programming C++/java/python
: for a long time, and I recently learned Clojure on my own out of curiosity.

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