julia语言介绍
This draft covers the history of Julia, it’s strengths & weaknesses.
该草案涵盖了Julia的历史,它的长处和短处。
This is part 1 of the Julia Tutorials (a series of tutorials on Julia).
这是Julia教程(有关Julia的一系列教程)的第1部分。
Feel free to check out the complete series @ —
随时查看完整的系列@ —
Julia是什么? (What is Julia?)
Julia is a free, open-source language that is extremely easy to use. This allows researchers with low technical expertise to easily create and share programs that others will be able to use for free and improve upon. Julia uses multiple dispatch as a paradigm, making it easy to express many object-oriented and functional programming patterns. It provides asynchronous I/O, debugging, logging, profiling, a package manager, and more. Julia also uses the JIT (Just in Time) — compiler which generates native machine code. The JIT compiler provides stability via multiple dispatches, which makes it easy to compile the code to an efficient one. Julia supports multiple tools, editors (Vim, Emacs, etc) as well as IDEs (Juno, Microsoft Visual Studio, etc).
Julia是一种免费的开源语言,非常易于使用。 这使技术专业知识不足的研究人员可以轻松创建和共享程序,其他人可以免费使用和改进程序。 Julia使用多重调度作为范例,可以轻松地表达许多面向对象和功能的编程模式。 它提供异步I / O,调试,日志记录,性能分析,程序包管理器等。 Julia还使用JIT(及时)编译器生成本地机器代码。 JIT编译器通过多次调度来提供稳定性,这使得将代码轻松编译为高效代码变得很容易。 Julia支持多种工具,编辑器(Vim,Emacs等)以及IDE(Juno,Microsoft Visual Studio等)。
While it is a general-purpose language and can be used to write any application, many of its features are well-suited for numerical analysis and computational science. Among Julia’s many claims to fame include its membership in the “petaflop club” which was achieved by a Julia application called Celeste. The Celeste team achieved peak performance of 1.54 petaflops using 1.3 million threads on 9,300 Knights Landing (KNL) nodes of the Cori supercomputer at NERSC.
虽然它是一种通用语言,可用于编写任何应用程序,但其许多功能非常适合于数值分析和计算科学。 Julia(Julia)的许多成名主张包括其加入“ petaflop俱乐部 ”的会员资格,这是通过Julia(Julia)的一项申请Celeste实现的 。 Celeste团队在NERSC的Cori超级计算机的9,300个Knights Landing(KNL)节点上使用130万个线程,实现了1.54 petaflops的最高性能。
Julia什么时候发生的? (When did Julia happen?)
Work on Julia was started in 2009 by MIT researchers Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and Alan Edelman. Julia was envisioned as an open-source (i.e., free) computing language that was both fast and worked at a high level. In 2012, the computer language made its debut to the public and has since climbed up the ranks as one of the world’s most popular programming languages, to the point that many programmers now see it as a potential rival to Python, a stalwart language.
麻省理工学院的研究人员Jeff Bezanson,Stefan Karpinski,Viral B. Shah和Alan Edelman于2009年开始研究Julia。 Julia被设想为一种开源的(即免费的)计算语言,既快速又可以在较高水平上使用。 2012年,计算机语言首次向公众亮相,此后逐渐成为世界上最受欢迎的编程语言之一 ,以至于许多程序员现在都将其视为强大的Python的潜在竞争对手。
为什么是Julia? (Why Julia?)
The idea of Julia was born when it’s creators realized that though computationally expensive tasks like scientific and numerical computing required high performance, domain experts usually went with slower, more dynamic languages for daily programming. While Julia’s creators understood the reasons for programmers to prefer dynamic languages for certain applications, they were still determined in leveraging modern language design and compiler techniques for a single environment that’s powerful enough for prototyping but also had the efficiency for performance-intensive applications.
茱莉亚(Julia)的想法诞生于其创造者意识到,尽管诸如科学和数值计算之类的计算量大的任务需要高性能,但领域专家通常会采用速度较慢,动态性更强的语言进行日常编程。 尽管Julia的创建者理解了程序员在某些应用程序中偏爱动态语言的原因,但他们仍然决心将现代语言设计和编译器技术用于一个环境,该环境足以进行原型设计,但对于性能密集型应用程序也具有效率。
Here’s the idea behind Julia in the words of it’s creators,
这是Julia(Julia)的创造者的话,
We want a language that’s open source, with a liberal license. We want the speed of C with the dynamism of Ruby. We want a language that’s homoiconic, with true macros like Lisp, but with obvious, familiar mathematical notation like Matlab. We want something as usable for general programming as Python, as easy for statistics as R, as natural for string processing as Perl, as powerful for linear algebra as Matlab, as good at gluing programs together as the shell. Something that is dirt simple to learn, yet keeps the most serious hackers happy. We want it interactive and we want it compiled. It should be as fast as C. Read more…
我们需要一种具有自由许可的开源语言。 我们想要C的速度和Ruby的活力。 我们需要一种同调的语言,具有像Lisp这样的真实宏,但又具有类似Matlab这样的显而易见的熟悉的数学符号。 我们想要的东西像Python一样适用于常规编程,像R一样易于统计,像Perl一样对字符串处理很自然,像Matlab一样对线性代数同样强大,并且希望像Shell一样将程序粘合在一起。 简单易学的东西,却让最严肃的黑客高兴。 我们希望它是交互式的,我们希望它是编译的。 它应该和C一样快。 阅读更多…
Julia是如何实现这些愿望的? (How Julia achieved those aspirations?)
Julia has multiple dispatch. One of the most powerful aspects of Julia is its multiple dispatch paradigm which proved to be one of the most polymorphic, extensible, and composable type systems out there.
Julia有多次派遣。 Julia的最强大方面之一是其多重调度范式,它被证明是目前最多态,可扩展和可组合的类型系统之一。
Julia is compiled, not interpreted. For faster runtime performance, Julia is just-in-time (JIT) compiled using the LLVM compiler framework. At its best, Julia can approach or match the speed of C.
Julia是经过编译的,没有解释。 为了提高运行时性能,使用LLVM编译器框架对Julia进行了实时(JIT)编译。 在最佳状态下,Julia可以接近或匹配C的速度。
Julia is interactive. Julia includes a REPL (read-eval-print loop), or interactive command line, similar to what Python offers. Quick one-off scripts and commands can be punched right in.
Julia是互动的。 Julia包含一个REPL(读评估打印循环)或交互式命令行,类似于Python提供的功能。 快速一次性脚本和命令可以直接输入。
Julia has a straightforward syntax. Julia’s syntax is similar to Python’s — terse, but also expressive and powerful.
Julia的语法简单明了。 Julia的语法类似于Python的语法-简洁,但也富有表现力和功能。
Julia combines the benefits of dynamic typing and static typing.
Julia结合了动态键入和静态键入的优点。
Julia has foreign function interfaces. Julia can interface directly with external libraries written in C/Fortran, C++, Python, R, Java, and many other languages.
Julia具有外部功能接口。 Julia可以直接与用C / Fortran , C ++ , Python , R , Java和许多其他语言编写的外部库交互。
Julia supports metaprogramming. Julia programs can generate other Julia programs, and even modify their own code, in a way that is reminiscent of languages like Lisp.
Julia支持元编程。 Julia程序可以生成其他Julia程序 ,甚至可以以类似于Lisp之类的方式修改自己的代码。
Julia的一些缺点 (Some downsides of Julia)
Compiler latency: Compiler latency has been one of the high priority issues in Julia. It is a lot slower when compared to other languages like Python(~27x slower) or C( ~187x slower).
编译器延迟 :编译器延迟一直是Julia的高优先级问题之一。 与其他语言(例如Python (慢27倍)或C(慢187倍))相比,它要慢得多。
Static compilation support: Of Course, Julia can be compiled. Unlike the language C which is compiled before execution, Julia is compiled at runtime. Thus Julia provides poor support for static compilation.
静态编译支持 :当然,Julia可以编译。 与在执行之前编译的语言C不同,Julia在运行时进行编译。 因此,Julia为静态编译提供了较差的支持。
Array optimizations: To get good performance, Julia users have to use manually in-place operations to get high performance array code.
数组优化 :为了获得良好的性能,Julia用户必须手动执行就地操作才能获得高性能的数组代码。
Incomplete notations: Many codes in Julia have incomplete notations. For eg. N-d array
不完整的符号 :Julia中的许多代码都具有不完整的符号。 例如。 ND阵列
翻译自: https://medium.com/swlh/introduction-to-julia-946c242ddac1
julia语言介绍