今天终于写了一篇烂东西交上去了,内容空洞,语言乏味~~
2010-01-27 04:54
399 查看
This
is not really a research proposal about specific area of functional
programming, but a short essay to show my understanding of functional
programming, Haskell, and some preliminary thinking.
The understanding of functional
programming
Functional
programming is considered as a no assignment statements, no side effects, and
referentially transparent programming paradigm. [1]
Its special
characters and advantages distinguish itself from other programming paradigms,
such as imperative programming languages like C.
In
reality, modular top-to-bottom design can not only reduce the difficulty of
programming and testing, but also improve efficiency by re-use modules. The
most powerful tools in functional programming should be higher-order function
and lazy evaluation, which can improve program modularization greatly. [1]
Higher-order function provides the tool of high degree abstraction, which could
combine existed small modules to build a complex larger module. The lazy
programming style helps to improve the separation of the definition and the use
of computations.
The understanding of Haskell
Haskell
is widely known as a purely functional programming language, which obeys almost
all principles of functional programming paradigm but for side effects in IO
monad. Moreover, it is a very high level language that really close to human
thinking. Although lots of programmers think that their knowledge of lower
level languages are what make them very different from normal computer user, it
is hardly to deny the power and efficiency of abstract thinking, which could be
achieved much easier in humanlike higher level languages, such as Haskell.
Haskell,
as a functional programming language, is more mathematic traceable than other
languages in different programming paradigms. In another word, it is more
suitable to represent mathematical models. This advantage could easily be seen
in the abstract syntax representation in Haskell, which is simpler and clearer
than representations in other languages, such as JAVA. From this point, Haskell
naturally is an efficiently creator of domain-specific embedded languages. Moreover,
considering its mathematical nature, Haskell could also be a great tool for some
other applications, such as image processing.
Why Haskell is not that popular
There
is no doubt that Haskell is such a powerful programming language with unique characters.
However, it is also true that Haskell is not as widely known and used as some other
languages, such as C or JAVA. In my opinion, the reason for this might be
complicated.
There
was a quite interesting question pop up in the class of programming language
technology. Considering Haskell as a very high level language, which should be
very close to human languages, why is it so difficult to manage compare to
other programming languages? The answer from the lecturer was that it takes
time to learn, just like human languages. That is very true; at least I cannot
see anything special when I start with Haskell. In the opposite, some features,
such as the strict type checker, were really annoyed and made me felt tied. It
takes time to see the beauty of Haskell and consume even more time to get
control of them.
Moreover,
compare with other popular programming languages, such as Java, the platform of
Haskell is not that strong, which means programmer might need to do lots of
work all by themselves. The good thing of this is that each time they can pick
and combine very small size modules to achieve their purpose with more
independence and less redundancy. In the other side, this also means lots of
programmers might be doing similar work in different projects, which is another
form of repetition.
What could we do for improvement
There
are at least two things that I think might be helpful for the development of
Haskell.
One
thing is that platform should be continuing completed. More libraries might be
help for reducing the difficulty of programming, especially for people who are
not experts. In additional, a friendly relationship between different
components might be appreciated. For example, I am having a problem with using
ghci and wxHaskell together at the moment. Last but not least, a more
comfortable UI might be very helpful to attract people to use. This could be
very easily ignored by programmers because they already get used to the existed
interface and it does not really matter for them. However, generally speaking,
the more people contribute their efforts in the language, the faster it grows.
I truly believe a better UI could help people to keep developing their
knowledge about this language until they can see its beauty inside.
Another
part that might be optimized is the compiler. In recursive program, even a tiny
ineffective part exists, might reduce the whole program efficiency
dramatically. This amplification forces programmers spent more time on code
optimization. However, their optimization is heavily depended on their
knowledge and experiences, which is not always reliable. In the same time,
similar work is also done by compilers. In a normal compiler, there is a code
optimizer between the intermediated code generator and the code generator,
which makes compilers very different from each other. It takes intermediated
representation as input and sends them out after optimized follow their special
algorithms. [2]
For instance, the worker/ wrapper transformation is
used in compiler optimization. [3]
Considering the optimization work
done by compilers generally has better design and test in advance, it should
have a very stable performance in a certain level. Therefore, the more work
done by compiler automatically, the less that programmers need to worry about.
There
are other problems still leaved open. As I have mentioned above, higher-order
function and lazy evaluation are the most powerful tools in functional
programming, which is also true for Haskell. However, everything is a
double-edged sword. For example, one “side effect” could be caused by lazy evaluation
is running out of memory. As far as I know, no compilers or interpreters could
pop up warning messages for this kind of situations in advance and programmers
need to always keep an eye on their code. There might be some solutions for
this kind of problem, which could be very useful in the improvement of user
experiences and program performances.
References:
[1]
John Hughes, Why Functional Programming
Matters
[2]
Alfred V. Aho, Monica S. Lam, Ravi Sethi, Jeffrey D. Ullman, Compilers Principles, Techniques, & Tool
s,
Second Edition, Chapter 1, Chapter 4
[3]
Andy Gill and Graham Hutton,
The worker/wrapper transformation
is not really a research proposal about specific area of functional
programming, but a short essay to show my understanding of functional
programming, Haskell, and some preliminary thinking.
The understanding of functional
programming
Functional
programming is considered as a no assignment statements, no side effects, and
referentially transparent programming paradigm. [1]
Its special
characters and advantages distinguish itself from other programming paradigms,
such as imperative programming languages like C.
In
reality, modular top-to-bottom design can not only reduce the difficulty of
programming and testing, but also improve efficiency by re-use modules. The
most powerful tools in functional programming should be higher-order function
and lazy evaluation, which can improve program modularization greatly. [1]
Higher-order function provides the tool of high degree abstraction, which could
combine existed small modules to build a complex larger module. The lazy
programming style helps to improve the separation of the definition and the use
of computations.
The understanding of Haskell
Haskell
is widely known as a purely functional programming language, which obeys almost
all principles of functional programming paradigm but for side effects in IO
monad. Moreover, it is a very high level language that really close to human
thinking. Although lots of programmers think that their knowledge of lower
level languages are what make them very different from normal computer user, it
is hardly to deny the power and efficiency of abstract thinking, which could be
achieved much easier in humanlike higher level languages, such as Haskell.
Haskell,
as a functional programming language, is more mathematic traceable than other
languages in different programming paradigms. In another word, it is more
suitable to represent mathematical models. This advantage could easily be seen
in the abstract syntax representation in Haskell, which is simpler and clearer
than representations in other languages, such as JAVA. From this point, Haskell
naturally is an efficiently creator of domain-specific embedded languages. Moreover,
considering its mathematical nature, Haskell could also be a great tool for some
other applications, such as image processing.
Why Haskell is not that popular
There
is no doubt that Haskell is such a powerful programming language with unique characters.
However, it is also true that Haskell is not as widely known and used as some other
languages, such as C or JAVA. In my opinion, the reason for this might be
complicated.
There
was a quite interesting question pop up in the class of programming language
technology. Considering Haskell as a very high level language, which should be
very close to human languages, why is it so difficult to manage compare to
other programming languages? The answer from the lecturer was that it takes
time to learn, just like human languages. That is very true; at least I cannot
see anything special when I start with Haskell. In the opposite, some features,
such as the strict type checker, were really annoyed and made me felt tied. It
takes time to see the beauty of Haskell and consume even more time to get
control of them.
Moreover,
compare with other popular programming languages, such as Java, the platform of
Haskell is not that strong, which means programmer might need to do lots of
work all by themselves. The good thing of this is that each time they can pick
and combine very small size modules to achieve their purpose with more
independence and less redundancy. In the other side, this also means lots of
programmers might be doing similar work in different projects, which is another
form of repetition.
What could we do for improvement
There
are at least two things that I think might be helpful for the development of
Haskell.
One
thing is that platform should be continuing completed. More libraries might be
help for reducing the difficulty of programming, especially for people who are
not experts. In additional, a friendly relationship between different
components might be appreciated. For example, I am having a problem with using
ghci and wxHaskell together at the moment. Last but not least, a more
comfortable UI might be very helpful to attract people to use. This could be
very easily ignored by programmers because they already get used to the existed
interface and it does not really matter for them. However, generally speaking,
the more people contribute their efforts in the language, the faster it grows.
I truly believe a better UI could help people to keep developing their
knowledge about this language until they can see its beauty inside.
Another
part that might be optimized is the compiler. In recursive program, even a tiny
ineffective part exists, might reduce the whole program efficiency
dramatically. This amplification forces programmers spent more time on code
optimization. However, their optimization is heavily depended on their
knowledge and experiences, which is not always reliable. In the same time,
similar work is also done by compilers. In a normal compiler, there is a code
optimizer between the intermediated code generator and the code generator,
which makes compilers very different from each other. It takes intermediated
representation as input and sends them out after optimized follow their special
algorithms. [2]
For instance, the worker/ wrapper transformation is
used in compiler optimization. [3]
Considering the optimization work
done by compilers generally has better design and test in advance, it should
have a very stable performance in a certain level. Therefore, the more work
done by compiler automatically, the less that programmers need to worry about.
There
are other problems still leaved open. As I have mentioned above, higher-order
function and lazy evaluation are the most powerful tools in functional
programming, which is also true for Haskell. However, everything is a
double-edged sword. For example, one “side effect” could be caused by lazy evaluation
is running out of memory. As far as I know, no compilers or interpreters could
pop up warning messages for this kind of situations in advance and programmers
need to always keep an eye on their code. There might be some solutions for
this kind of problem, which could be very useful in the improvement of user
experiences and program performances.
References:
[1]
John Hughes, Why Functional Programming
Matters
[2]
Alfred V. Aho, Monica S. Lam, Ravi Sethi, Jeffrey D. Ullman, Compilers Principles, Techniques, & Tool
s,
Second Edition, Chapter 1, Chapter 4
[3]
Andy Gill and Graham Hutton,
The worker/wrapper transformation
相关文章推荐
- 今天心血来潮,重新弄安卓环境,发现只有4.4的版本,怎么装都不见其他版本,找了N多方法,加host文件,选择https/http也不行,最后找到了一篇终于搞定,底下加黄的就是亲测解决
- 今天在使用iscroll4 做一个简单触屏滚动demo,发现上下拖动的时候总是会回弹,不能看到下面的内容.这个问题苦恼了很久,终于解决
- 今天看了李想的一篇采访学习到了挺多东西
- CSDN博客今天终于登录上去了,搬回去了。
- 当时遇到的主要难点在于TextView的内容不会刷新改变值,今天终于通过Timer和Handler实现了,分享给大家
- 今天终于鼓起勇气开始写一些东西了
- 哎。。开始换语言了。。python 今天开始正式做东西。
- 当时遇到的主要难点在于TextView的内容不会刷新改变值,今天终于通过Timer和Handler实现了,分享给大家
- 今天终于完成了美的网站的维护工作,工作中感觉又学到了点东西
- 今天逛博客时看到一篇不错的C语言知识点总结,借来看看
- 当时遇到的主要难点在于TextView的内容不会刷新改变值,今天终于通过Timer和Handler实现了,分享给大家
- 今天很累呀,不过终于又做了点东西了.
- 今天终于可以正常下班了
- 转发一篇关于正则的文章,很好,刚好用上,但是内容好多,以后随用随查吧
- tomcat的Context配置今天终于搞定Tomcat的Context了,conf/Context.xml是Tomcat公用的环境配置;
- 今天看到的关于深度学习的一篇文章,可以好好学习下
- 今天写一篇关于IO的文件拷贝
- 终于从语言之争的思想里跳出来了
- 今天发现我8年前制作的视频教程与2011年的一篇文章很巧合~~
- 今天才知道原来还有一种东西叫"设计模式"