For faster navigation, this Iframe is preloading the Wikiwand page for Julia (编程语言).

Julia (编程语言)

维基百科,自由的百科全书

此条目翻译品质不佳。翻译者可能不熟悉中文或原文语言,也可能使用了机器翻译,请协助翻译本条目或重新编写,并注意避免翻译腔的问题。明显拙劣的翻译请改挂((d|G13))提交删除。
Julia
Julia prog language.svg
编程范型多范式多分派, 过程式, 函数式, 元编程, 多阶段编程英语Multi-stage_programming
设计者Jeff Bezanson, Alan Edelman, Stefan Karpinski, Viral B. Shah
实现者Jeff Bezanson, Stefan Karpinski, Viral B. Shah等[1][2]
发行时间2012年,​10年前​(2012[3]
稳定版本
1.7.3在维基数据编辑
( 2022年5月25日, 41天前 )
实现语言Julia, C, C++, Scheme, LLVM[4]
系统平台x86-64, IA-32, ARM v8(64位), CUDA, ARM (32位), PowerPC, 网页浏览器 (JavaScriptWebAssembly)[5]
操作系统macOS, Windows, Linux, FreeBSD[6], Android[7]
许可证MIT许可证
文件扩展名.jl
网站JuliaLang.org
启发语言

Julia是一种高级通用[12]动态编程语言,它最初是为了满足高性能数值分析计算科学的需要而设计的,不需要解释器,速度快[13][14][15][16],也可用于客户端和服务器的Web用途[17][18]、低级系统编程或用作规约语言[19]

Julia设计的独特之处包括,参数多态的类型系统,完全动态语言中的类型,以及它多分派的核心编程范型。它允许并发并行分布式计算,并直接调用CFortran库而不使用粘合代码

Julia拥有垃圾回收机制[20],使用及早求值,包含了用于浮点计算、线性代数随机数生成正则表达式匹配的高效库。有许多库可以使用,其中一些(如用于快速傅里叶变换的库)已经预先捆绑在Julia里[21]

历史

一群拥有各种语言丰富编程经验的Matlab高级用户,对现有的科学计算编程工具感到不满——这些软件对自己专长的领域表现得非常棒,但在其它领域却非常糟糕。他们想要的是一个开源的软件,它要像C语言一般快速而又拥有如同Ruby动态性;要具有Lisp般真正的同像性而又有Matlab般熟悉的数学记号;要像Python般通用、像R般在统计分析上得心应手、像Perl般自然地处理字符串、像Matlab般具有强大的线性代数运算能力、像shell胶水语言的能力,易于学习而又不让真正的黑客感到无聊;还有,它应该是交互式的,同时又是编译型的。[22]

该项目大约于2009年中开始。

功能

主要用于数值计算。

特点

  • 核心语言非常小。标准库用的是Julia语言本身写的
  • 调用许多其它成熟的高性能基础代码。如线性代数随机数生成快速傅里叶变换、字符串处理。
  • 丰富的用于创建或描述对象的类型语法
  • 高性能,接近于静态编译型语言。包括用户自定义类型等
  • 为并行计算和分布式计算而设计
  • 轻量级协程
  • 优雅的可扩展的类型转换/提升
  • 支持Unicode,包括但不限于UTF-8
  • 可直接调用C函数(不需要包装或是借助特殊的API
  • 有类似shell的进程管理能力
  • 有类似Lisp以及其它元编程工具
  • 可与Jupyter notebook 一起使用

示例

生成Mandelbrot集合

function mandel(z)
    c = z
    max = 80
    for n = 1:max
        if abs(z) > 2
            return n-1
        end
        z = z^2 + c
    end
    return max
end

随机矩阵统计

using LinearAlgebra: tr
using Statistics #导入std, mean等函数

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] = tr((P'*P)^4)
        w[i] = tr((Q'*Q)^4)
    end
    std(v)/mean(v), std(w)/mean(w)
end

参考资料

  1. ^ LICENSE.md. GitHub. [2020-03-24]. (原始内容存档于2021-01-23). 
  2. ^ Contributors to JuliaLang/julia. GitHub. [2020-03-24]. (原始内容存档于2021-01-23). 
  3. ^ 3.0 3.1 3.2 3.3 3.4 3.5 3.6 Why We Created Julia. Julia website. February 2012 [2013-02-07]. (原始内容存档于2019-02-19). 
  4. ^ Julia. Julia. NumFocus project. [9 December 2016]. (原始内容存档于2017-02-21). Julia's Base library, largely written in Julia itself, also integrates mature, best-of-breed open source C and Fortran libraries for ... 
  5. ^ Fischer, Keno. Running julia on wasm. 2019-07-22 [2019-07-25]. (原始内容存档于2020-11-21). 
  6. ^ Download Julia - Currently supported platforms. Julia. [2020-03-24]. (原始内容存档于2021-01-26). 
  7. ^ The Julia Language: A fresh approach to technical computing. Termux/Android. Github. [2020-03-24]. (原始内容存档于2020-12-27). 
  8. ^ Stokel-Walker, Chris. Julia: The Goldilocks language. Increment. Stripe. [23 August 2020]. (原始内容存档于2020-11-09). 
  9. ^ 9.0 9.1 9.2 9.3 Home · The Julia Language. docs.julialang.org. [2018-08-15]. (原始内容存档于2021-01-11) (英语). 
  10. ^ Programming Language Network. GitHub. [6 December 2016]. (原始内容存档于2020-12-20). 
  11. ^ JuliaCon 2016. JuliaCon. [6 December 2016]. (原始内容存档于2021-02-03). He has co-designed the programming language Scheme, which has greatly influenced the design of Julia 
  12. ^ The Julia Language (official website). [2018-09-22]. (原始内容存档于2017-02-21). General Purpose [..] Julia lets you write UIs, statically compile your code, or even deploy it on a webserver. 
  13. ^ Bryant, Avi. Matlab, R, and Julia: Languages for data analysis. O'Reilly Strata. 15 October 2012 [2018-09-22]. (原始内容存档于2013-05-24). 
  14. ^ Singh, Vicky. Julia Programming Language – A True Python Alternative. Technotification. 23 August 2015 [2018-09-22]. (原始内容存档于2020-11-09). 
  15. ^ Krill, Paul. New Julia language seeks to be the C for scientists. InfoWorld. 18 April 2012 [2018-09-22]. (原始内容存档于2014-09-13). 
  16. ^ Finley, Klint. Out in the Open: Man Creates One Programming Language to Rule Them All. Wired. 3 February 2014 [2018-09-22]. (原始内容存档于2016-12-20). 
  17. ^ Escher : With Escher you can build beautiful Web Uls entirely in Julia. Shasi.github.io. [2017-05-31]. (原始内容存档于2016-03-04). 
  18. ^ Getting Started with Node Julia · Node Julia. Node-julia.readme.io. [2017-05-31]. (原始内容存档于2020-10-21). 
  19. ^ Moss, Robert. Using Julia as a Specification Language for the Next-Generation Airborne Collision Avoidance System. 26 June 2015 [29 June 2015]. (原始内容存档于2015-07-01). Airborne collision avoidance system 
  20. ^ Suspending Garbage Collection for Performance...good idea or bad idea?. Groups.google.com. [2017-05-31]. (原始内容存档于2011-01-22). 
  21. ^ (now available with using FFTW in current versions; that dependency is one of many moved out of the standard library to a package because it is GPL licensed, and thus is not included in Julia 1.0 by default.) Remove the FFTW bindings from Base by ararslan · Pull Request #21956 · JuliaLang/julia. GitHub. [2018-03-01]. (原始内容存档于2019-02-16) (英语). 
  22. ^ Why We Created Julia. [2012-04-19]. (原始内容存档于2016-01-18). 

参阅

外部链接

{{bottomLinkPreText}} {{bottomLinkText}}
Julia (编程语言)
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.