Julia is a high-level, high-performance dynamic programming language for technical computing, with syntax that is familiar to users of other technical
http://julialang.org/
julia | source | downloads | docs | blog | community | teaching | publications | gsoc | juliacon | rss
Julia is a high-level, high-performance dynamic programming language for technical computing, with syntax that is familiar to users of other technical computing environments. It provides a sophisticated compiler, distributed parallel execution, numerical accuracy, and an extensive mathematical function library. The library, largely written in Julia itself, also integrates mature, best-of-breed C and Fortran libraries for linear algebra, random number generation, signal processing, and string processing. In addition, the Julia developer community is contributing a number of external packages through Julia’s built-in package manager at a rapid pace. IJulia, a collaboration between the IPython and Julia communities, provides a powerful browser-based graphical notebook interface to Julia.
Julia programs are organized around multiple dispatch; by defining functions and overloading them for different combinations of argument types, which can also be user-defined. For a more in-depth discussion of the rationale and advantages of Julia over other systems, see the following highlights or read the introduction in the online manual.
A Summary of Features
- Multiple dispatch: providing ability to define function behavior across many combinations of argument types
- Dynamic type system: types for documentation, optimization, and dispatch
- Good performance, approaching that of statically-compiled languages like C
- Built-in package manager
- Lisp-like macros and other metaprogramming facilities
- Call Python functions: use the PyCall package
- Call C functions directly: no wrappers or special APIs
- Powerful shell-like capabilities for managing other processes
- Designed for parallelism and distributed computation
- Coroutines: lightweight “green” threading
- User-defined types are as fast and compact as built-ins
- Automatic generation of efficient, specialized code for different argument types
- Elegant and extensible conversions and promotions for numeric and other types
- Efficient support for Unicode, including but not limited to UTF-8
- MIT licensed: free and open source
High-Performance JIT Compiler
Julia’s LLVM-based just-in-time (JIT) compiler combined with the language’s design allow it to approach and often match the performance of C. To get a sense of relative performance of Julia compared to other languages that can or could be used for numerical and scientific computing, we’ve written a small set of micro-benchmarks in a variety of languages: C, Fortran,Julia, Python, Matlab/Octave, R, JavaScript, Go, and Mathematica. We encourage you to skim the code to get a sense for how easy or difficult numerical programming in each language is. The following micro-benchmark results were obtained on a single core (serial execution) on an Intel® Xeon® CPU E7-8850 2.00GHz CPU with 1TB of 1067MHz DDR3 RAM, running Linux:
| Fortran | Julia | Python | R | Matlab | Octave | Mathe-matica | JavaScript | Go | |
|---|---|---|---|---|---|---|---|---|---|
| gcc 4.8.1 | 0.2 | 2.7.3 | 3.0.2 | R2012a | 3.6.4 | 8.0 | V8 3.7.12.22 | go1 | |
| fib | 0.26 | 0.91 | 30.37 | 411.36 | 1992.00 | 3211.81 | 64.46 | 2.18 | 1.03 |
| parse_int | 5.03 | 1.60 | 13.95 | 59.40 | 1463.16 | 7109.85 | 29.54 | 2.43 | 4.79 |
| quicksort | 1.11 | 1.14 | 31.98 | 524.29 | 101.84 | 1132.04 | 35.74 | 3.51 | 1.25 |
| mandel | 0.86 | 0.85 | 14.19 | 106.97 | 64.58 | 316.95 | 6.07 | 3.49 | 2.36 |
| pi_sum | 0.80 | 1.00 | 16.33 | 15.42 | 1.29 | 237.41 | 1.32 | 0.84 | 1.41 |
| rand_mat_stat | 0.64 | 1.66 | 13.52 | 10.84 | 6.61 | 14.98 | 4.52 | 3.28 | 8.12 |
| rand_mat_mul | 0.96 | 1.01 | 3.41 | 3.98 | 1.10 | 3.41 | 1.16 | 14.60 | 8.51 |
Figure: benchmark times relative to C (smaller is better, C performance = 1.0).
C compiled by gcc 4.8.1, taking best timing from all optimization levels (-O0 through -O3). C, Fortran and Julia use OpenBLAS v0.2.8. The Python implementations of rand_mat_stat and rand_mat_mul use NumPy (v1.6.1) functions; the rest are pure Python implementations.
Benchmarks can also be seen here as a plot created with Gadfly.
These benchmarks, while not comprehensive, do test compiler performance on a range of common code patterns, such as function calls, string parsing, sorting, numerical loops, random number generation, and array operations. It is important to note that these benchmark implementations are not written for absolute maximal performance (the fastest code to computefib(20) is the constant literal 6765). Rather, all of the benchmarks are written to test the performance of specific algorithms, expressed in a reasonable idiom in each language. In particular, all languages use the same algorithm: the Fibonacci benchmarks are all recursive while the pi summation benchmarks are all iterative; the “algorithm” for random matrix multiplication is to call LAPACK, except where that’s not possible, such as in JavaScript. The point of these benchmarks is to compare the performance of specific algorithms across language implementations, not to compare the fastest means of computing a result, which in most high-level languages relies on calling C code. Raw benchmark numbers in CSV format are available here. Various other Julia benchmarks, tracked over time can be found at speed.julialang.org.
To give a quick taste of what Julia looks like, here is the code used in the Mandelbrot and random matrix statistics benchmarks:
function mandel(z)
c = z
maxiter = 80
for n = 1:maxiter
if abs(z) > 2
return n-1
end
z = z^2 + c
end
return maxiter
end
function randmatstat(t)
n = 5
v = zeros(t)
w = zeros(t)
for i = 1:t
a = randn(n,n)
b = randn(n,n)
c = randn(n,n)
d = randn(n,n)
P = [a b c d]
Q = [a b; c d]
v[i] = trace((P.'*P)^4)
w[i] = trace((Q.'*Q)^4)
end
std(v)/mean(v), std(w)/mean(w)
end
The code above is quite clear, and should feel familiar to anyone who has programmed in other mathematical languages. The Julia implementation of randmatstat is considerably simpler than the equivalent C implementation, without giving up much performance. Planned compiler optimizations will close this performance gap in the future. By design, Julia allows you to range from tight low-level loops, up to a high-level programming style, while sacrificing some performance, but gaining the ability to express complex algorithms easily. This continuous spectrum of programming levels is a hallmark of the Julia approach to programming and is very much an intentional feature of the language.
Designed for Parallelism and Cloud Computing
Julia does not impose any particular style of parallelism on the user. Instead, it provides a number of key building blocks for distributed computation, making it flexible enough to support a number of styles of parallelism, and allowing users to add more. The following simple example demonstrates how to count the number of heads in a large number of coin tosses in parallel.
nheads = @parallel (+) for i=1:100000000
int(randbool())
end
This computation is automatically distributed across all available compute nodes, and the result, reduced by summation (+), is returned at the calling node.
Here is a screenshot of a web-based interactive IJulia session, using Gadfly to produce various plots with D3 as a rendering backend in the browser (SVG, PDF, PNG and various other backends are also supported):

This paves the way for fully cloud-based operation, including data management, code editing and sharing, execution, debugging, collaboration, analysis, data exploration, and visualization. The eventual goal is to let people stop worrying about administering machines and managing data and get straight to the real problem.
Free, Open Source and Library-Friendly
The core of the Julia implementation is licensed under the MIT license. Various libraries used by the Julia environment include their own licenses such as the GPL, LGPL, and BSD (therefore the environment, which consists of the language, user interfaces, and libraries, is under the GPL). The language can be built as a shared library, so users can combine Julia with their own C/Fortran code or proprietary third-party libraries. Furthermore, Julia makes it simple to call external functions in C and Fortran shared libraries, without writing any wrapper code or even recompiling existing code. You can try calling external library functions directly from Julia’s interactive prompt, getting immediate feedback. See LICENSE for the full terms of Julia’s licensing.
Julia is a high-level, high-performance dynamic programming language for technical computing, with syntax that is familiar to users of other technical的更多相关文章
- Dynamic programming language
动态改变运行时结构 Dynamic programming language, in computer science, is a class of high-level programming la ...
- Speeding Up The Traveling Salesman Using Dynamic Programming
Copied From:https://medium.com/basecs/speeding-up-the-traveling-salesman-using-dynamic-programming-b ...
- 动态规划 Dynamic Programming
March 26, 2013 作者:Hawstein 出处:http://hawstein.com/posts/dp-novice-to-advanced.html 声明:本文采用以下协议进行授权: ...
- Dynamic Programming
We began our study of algorithmic techniques with greedy algorithms, which in some sense form the mo ...
- HDU 4223 Dynamic Programming?(最小连续子序列和的绝对值O(NlogN))
传送门 Description Dynamic Programming, short for DP, is the favorite of iSea. It is a method for solvi ...
- hdu 4223 Dynamic Programming?
Dynamic Programming? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Oth ...
- 算法导论学习-Dynamic Programming
转载自:http://blog.csdn.net/speedme/article/details/24231197 1. 什么是动态规划 ------------------------------- ...
- Dynamic Programming: From novice to advanced
作者:Dumitru 出处:http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=dynProg An impo ...
- HDU-4972 A simple dynamic programming problem
http://acm.hdu.edu.cn/showproblem.php?pid=4972 ++和+1还是有区别的,不可大意. A simple dynamic programming proble ...
随机推荐
- [MFC]获取一些用户文件夹
(Owed by: 春夜喜雨 http://blog.csdn.net/chunyexiyu 转载请注明出处) 在window7中.进入命令行cmd模式,输入set到多个系统文件夹定义: 比如: Wi ...
- 【Struts2学习笔记(2)】Action默认值和配置Action于result各种转发类型
一.Action缺省配置值 <span style="font-size:18px;"><package name="itcast" name ...
- obj-c编程04:类的继承
这第4篇内容比較少,主要说的是obj-c中的类的继承,须要说明的是我仅仅是写了继承中最简单的形式,假设所有展开来说,那就多了去了!关键是如今肚子里还没装够墨水,没法展开啊! 以下的代码中,我们写了2个 ...
- Struts1和Struts2对照
最近学习Struts1和Struts2.好多人.提到非常多的信息. Struts2不从Struts1进化. Struts2的前身WebWork. 呢,看了一些资料,下边就来比較比較. 一.架构分析 S ...
- 使用 CodeIgniter 框架快速开发 PHP 应用(五)
原文:使用 CodeIgniter 框架快速开发 PHP 应用(五) 简化 HTML 页面和表格设计这一章介绍了又一个节约你的时间而且使你的代码更具安全性和逻辑性的领域.第一,我们将会介绍创建视图的各 ...
- 现代JVM内存管理方法的发展历程,GC的实现及相关设计概述(转)
JVM区域总体分两类,heap区和非heap区.heap区又分:Eden Space(伊甸园).Survivor Space(幸存者区).Tenured Gen(老年代-养老区). 非heap区又分: ...
- hdu1297 Children’s Queue
再加上男人:dp[i-1]: 加2一个女人:dp[i-2]+x. 上述的另一种情况下dp[i-2]它不仅包括加2女人对法律状况.和x是一个加号ff原违法的法律案后加入,这最后是mf案例,然后,x=dp ...
- 你可以不知道原因,但是,我们不能停止努力。httplook抓取路由配置界面信息
因为实验室的项目要求,需要动态控制路由的配置信息,我们知道.路由选择需要购买的访问后,:http://192.168.1.1 路由配置页面.配置,不须要人手工操作.甚至定时任务配置的时候,就须要进一步 ...
- MVC 编程模型及其变种
MVC 编程模型及其变种 MVC全称是Model View Controller, 这是一个模型(model)-查看(view)-调节器(controller)缩写,这是通过通用的编程模型非.MVC当 ...
- crawler_浅谈网络爬虫
题记: 1024,今天是个程序猿的节日 ,哈哈,转为正题,从事了一线网络爬虫开发有近1000天.简单阐述下个人对网络爬虫的理解. 提纲: 1:是什么 2:能做什么 3:怎么做 4:综述 1:是什么 w ...