从知乎上讨论的Python统治科学计算说开去

最近,在知乎上参与讨论了Python与科学计算语言,本人对于人云亦云的风气感到深恶痛绝。由于我国的计算机科学与技术专业的理论基础和技术基础均源自于西方计算机理论界和工业界的研究成果。因此,本人对于科学计算的表述为追求客观,在这里使用英语表述,同时避免网络暴力和表述过程中对于计算技术的表述因技术术语翻译不同而有失公正。

1、Unix and C
Unix evolved to be a very productive software development environment based on two programming tools of different nature: the classical system programming language C for CPU-critical tasks, often involving nontrivial data structures, and the Unix shell for gluing C programs to form new applications.C is a low-level language, often claimed to be designed for computers and not humans. However, low-level system programming languages like C and Fortran 77 were introduced as alternatives to the much more low-level assembly languages and have been successful for making computationally fast code, yet with a reasonable abstraction level. Fortran 77 and C give nearly complete control of memory usage and CPU-critical program segments, but the amount of details at a low code level is unfortunately huge. The need for programming tools that increase the human productivity led to a development of more powerful languages, both for classical system programming and for scripting.
2、Windows and C++
Under the Windows family of operating systems,efficient program development evolved as a combination of the type-safe language C++ for classical system programming and the VisualBasic language for scripting. C++ is a richer (and much more omplicated)language than C and supports working with high-level abstractions through concepts like object-oriented and generic programming.VisualBasic is also a richer language than Unix shells.
3、Java
Especially for tasks related to Internet programming, Java was from the mid 1990s taking over as the preferred language for building large software systems. Many regard JavaScript as some kind of scripting companion in web pages. PHP and Java are also a popular pair. However, Java is much of a selfcontained language, and being simpler and safer to apply than C++, it has become very popular and widespread for classical system programming.
4、Modern Scripting Languanges
During the last decade several powerful dynamically typed languages have emerged and developed to a mature state.Bash, Perl, Python (and Jython), Ruby, Scheme, and Tcl are examples of general-purpose, modern, widespread languages that are popular for scripting tasks. PHP is a related language, but more specialized towards making web application.
计算潮流:
1、Scientists Are on the Move 
During the last decade, the popularity of scientific computing environments such as IDL, Maple, Mathematica, Matlab,Octave, and S-PLUS/R has increased considerably. Scientists and engineers simply feel more productive in such environments. One reason is the simple and clean syntax of the command languages in these environments. Another factor is the tight integration of simulation and visualization: in Maple, Matlab, S-PLUS/R and similar environments you can quickly and conveniently visualize what you just have computed. 
2、Scientific Computing Is More Than Number Crunching. 
Many computational scientists work with their own numerical software development and realize that much of the work is not only writing computationally intensive number-crunching loops. Very often programming is about shuffling data in and out of different tools, converting one data format to another, extracting numerical data from a text, and administering numerical experiments involving a large number of data files and directories. Such tasks are much faster to accomplish in a language like Python than in Fortran, C, C++, C#, or  Java.
3、Graphical User Interfaces 
GUIs are becoming increasingly more important  in scientific software, but (normally) computational scientists and engineers  have neither the interest nor the time to read thick books about GUI programming. What you need is a quick “how-to” description of wrapping GUIs  to your applications. The Tk-based GUI tools available through Python make  it easy to wrap existing programs with a GUI. 
结论:Python versus Matlab.
Some readers may wonder why an environment such as Matlab or something similar (like Octave, Scilab, Rlab, Euler, Tela, Yorick) is not sufficient. Matlab is a de facto standard, which to some extent offers many of the important features mentioned in the previous paragraphs. Matlab and Python have indeed many things in common, including no declaration of variables, simple and convenient syntax, easy creation of GUIs, and gluing of simulation and visualization. Nevertheless, in my opinion Python has some clear advantageous over Matlab and similar environments:the Python programming language is more powerful,the Python environment is completely open and made for integration with external tools,a complete toolbox/module with lots of functions and classes can be contained in a single file (in contrast to a bunch of M-files),transferring functions as arguments to functions is simpler,nested, heterogeneous data structures are simple to construct and use,object-oriented programming is more convenient,interfacing C, C++, and Fortran code is better supported and therefore simpler,scalar functions work with array arguments to a larger extent (without modifications of arithmetic operators),the source is free and runs on more platforms.
Having said this, we must add that Matlab appears as a more self-contained environment, while Python needs to combined with several additional packages to form an environment of competitive functionality. There is an interface pymat that allows Python programs to use Matlab as a computational
and graphics engine . At the time of this writing, Python’s support for numerical computing and visualization is rapidly growing, especially through the SciPy project .
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值