当前位置:网站首页>Interpreting Julia's 2021: step by step towards the mainstream programming language
Interpreting Julia's 2021: step by step towards the mainstream programming language
2022-06-12 02:32:00 【Deep learning and python】
author | Tian Jun 、 Chen jiuning 、 Zhou Kaiyang 、George Datseris、 Luoxiuzhe
edit | Cai Fangfang
Julia Moving towards mainstream programming languages .
This article is about “2021 InfoQ Annual technical inventory and Outlook ” One of a series of articles .
In the past 2021 year ,Julia The programming language community has maintained rapid development . According to statistics , at present Julia The total number of users worldwide has exceeded one million , More than 10000 companies and more than 1500 colleges and universities have downloaded and used Julia. Besides , Some world famous schools , Such as Peking University ,MIT、Stanford and Berkeley etc. , Has been used in teaching Julia Language .
We can experience it from the following dimensions Julia The current activity of the programming language community .
In the past year ,Julia The default registry has added 1128 A package , It's up to 5397 individual . For more information, you can go to JuliaHub.com see , The method of obtaining the download information of each library has also been announced in the official forum .
from Julia In terms of the number of visits to English documents , In the past year , The user traffic increased by about 25%.
In terms of the distribution of users browsing documents , at present Julia The majority of language users are from the United States , Germany and Britain are next , The number of users in Japan and China closely follows .
But at the moment Julia The quality of Chinese document translation is very high , We can take a closer look at the number of Chinese document visits .
Compared to the previous year ,Julia The number of Chinese users has increased by about 28%, The actual number of English users 14.6% about , It should be second only to the number of users in the United States .
From the distribution of domestic users , At present, it is still dominated by users in Beijing .
From the major programming rankings ,Julia The overall ranking of has risen steadily . according to IEEE Spectrum Ranking , This year, Julia New list , Located at 20 position . stay PYPL In the ranking of , at present Julia Located at 24 position , Compared with the same period last year, there is little change , However, the proportion increased from last year 0.26% Increased to 0.36%. And in this month's latest TIOBE In the rankings ,Julia be located 35 name , Compared with last year, it has not changed much .
1 Julia Community progress
Past year , We observed that Julia There are some important new developments in the community , Or will be right Julia Have a positive impact on future development .
Domestic mirror stations are further increased
In the past, domestic users tried to use Julia The biggest obstacle is , Often affected by network environment , Cause download and installation failure . Past year , Domestic right Julia The support of image service is further increased , At present, the following six domestic universities have provided mirror services , To speed up downloading and installation for domestic users Julia Related libraries .
- Beijing Foreign Studies University (https://mirrors.bfsu.edu.cn/julia)
- Tsinghua University (https://mirrors.tuna.tsinghua.edu.cn/julia)
- Shanghai Jiaotong University (https://mirrors.sjtug.sjtu.edu.cn/julia)
- University of science and technology of China (https://mirrors.ustc.edu.cn/julia)
- South University of science and technology (https://mirrors.sustech.edu.cn/julia)
- Nanjing University (https://mirrors.nju.edu.cn/julia)
Users only need to run Julia Before procedure , Good configuration JULIA_PKG_SERVER The environment variable can point to any of the above links , For more information, please go to the relevant discussion posts of the Chinese Forum .
Besides , Beijing 、 Default servers are also deployed in Shanghai and Guangzhou , Even if the user does not configure the mirror station , At present, the domestic download and installation will also enjoy the acceleration effect .
Flux Join in NumFocus
FluxML Community in 12 month 1 It was officially announced on the th that it was attached to NumFocus, To get to this point , Cannot leave the whole Julia Community and developer support .
Flux Has been committed to providing a set of simple 、 Scalable and efficient machine learning solutions , With the help of differential programming, it can be extended to various fields of scientific computing . The with NumFocus Our cooperation will further strengthen the community , Attract more new developers to participate in the whole ecosystem , At the same time, it is conducive to the management of the funds raised for the next few projects , Such as compiler tools related to automatic differentiation , And more general GPU Low precision operation on .
JuliaComputing complete A Round of funding
JuliaComputing from Julia The founders of programming languages 2015 Founded in 2000 , The company mainly focuses on JuliaHub Provide enterprise computing solutions .
Recently, the company focuses on providing a set of modern modeling and simulation tools , Such as for drug simulation Pumas frame , For multi physical simulation JuliaSim And for circuit simulation JuliaSPICE. This year 7 A sum completed in January A Round of funding , To some extent, it dispels people's long-standing concern about Julia Doubts about the prospect of commercial application .
Julia More landing in commercial companies
Julia Language has also been further applied in commercial companies , for example , Star quantum computing company of the cold atom scheme QuEra Computing Inc Use Julia Build their Simulator ;RelationalAI utilize Julia To build their web services and relational databases ; Tongyuan software companies began to use Julia Language development is used to replace MATLAB simulink Software for , Its products have been applied to the modeling of China's aerospace industry , For example, China space station ;Pumas Then use Julia Built their clinical drug research Suite , And based on mRNA Of Moderna The new crown vaccine is also used Pumas Our services complete the data analysis of clinical drugs . Others do not disclose the details of their products but are also in use Julia The company includes all major companies known to all (Google、AWS、 HUAWEI, etc. ), It also includes a number of new start-ups .Julia Relevant Ecology Applied in commercial companies ( For example, private registry 、 Private package management 、 private CI/CD etc. ) It is also improving day by day .
2 Julia Core function evolution
2021 year ,Julia Two important versions have been released , Namely [email protected] and [email protected] Besides , stay [email protected] On 11 month 30 At the same time , The community officially announced [email protected] For the new long-term support version (LTS).Julia The official blog details [email protected] Some new features of , Here we list some points that deserve special attention :
New multithreading features
In the past few Julia In the version , Multithreading related updates have always been the focus .
Abreast of the times [email protected] Version solves many race conditions at runtime , Optimize the scheduling of tasks between multiple threads , At the same time, make the default random number generator more thread friendly , In addition, a kind of atomic operation is added as the basic language feature . With the help of @atomic macro , It is now possible to access and update member variables in variable structures atomically more efficiently . In this year's JuliaCon On ,Jameson Nash Shows you how to use this feature .
There are already a series of Libraries in the community that provide thread safe abstractions , Predictably enough , More and more libraries will use this feature in the future .
Update of package management
In the previous version , If using When a package , This package is not installed in advance in the current environment , You're going to report an error , The new version of the package management tool will automatically identify whether the package has been registered , If so , You will be prompted whether you want to automatically install .
Besides , New version of the Manifest.toml The file has made a big change compared with the previous version : All the package related information is put in [deps] Next , In addition, a new one has been added at the top julia_version entrance , This change has been incorporated into [email protected] Later versions .
Another concern is , The new version of the package manager greatly improves the Windows And distributed file systems ( In especial NFS) Performance in , This is mainly due to decompressing the file in memory rather than directly decompressing the file first .
Yes Apple Silicon Support for
[email protected] Is the first one that can run in Apple Silicon Previous editions . But here's the thing , Although the official download page provides the relevant binary installation files , However, support for the platform is only in the stage of tier 3 ( That is, it is only experimental , compile / The test may fail ).
BLAS/LAPACK: Back end switching at runtime
stay Julia 1.7 Before , If you want to use it MKL, Need to compile a new Julia Image reuse , This brings inconvenience to users to a certain extent .
Julia 1.7 One is provided in libblastrampoline (LBT) The elasticity of BLAS/LAPACK Agent module , Allows users to dynamically select specific call back ends at run time .LBT On the one hand, it improves the convenience of use ( for example MKL.jl You can use it directly without compiling the image ), On the other hand, it also provides “ From many BLAS Call the best one in the implementation ” Such a flexible invocation mechanism . Since there is no need to completely replace the existing BLAS All the functions of , This even provides pure for the future Julia Of BLAS Realization ( For example, based on LoopVectorization Of Octavian) Provides operational possibilities .
stay Julia You can imagine using a dynamic high-level language to write something with comparable performance BLAS What kind of experience is library .
Compile latency and runtime volume optimization
because Julia Dynamic compilation features , The function needs to trigger a compilation operation when it is first executed , So when using some larger toolkits ( for instance Plots、Makie) when , There will be a long waiting period .
The picture below is in Intel 12900k Use Julia 1.7 Time to get , stay Julia 1.5 in using Plots It's about 7s, If your CPU If the dominant frequency is low, the time will be longer .
For server programs or large programs that need to run for a long time , Compilation delay is not a big problem , But for drawing or command-line programs , Compilation delays are bound to make Julia The user experience has become relatively poor .
About compilation delay ,Julia 1.6 There are two major changes brought about by the release : One is the introduction of parallel precompiling mechanism, which can take advantage of CPU The multi-core performance of ( But when loading the package, it is still in single thread mode ), The other is to support manual tuning to reduce the significant impact of method invalidation (method invalidation) Code for , And then improve the utilization of precompiled results . These methods alleviate the problem of compilation delay to some extent , But to do further compilation delay optimization , It may be necessary to pass through Julia To introduce a better interpreter or something like JVM The hot (hotspot) The mechanism of compilation and multi-level execution can solve the problem .
Because will LLVM Packed and stuffed Julia Runtime (runtime), This brings about the use of Julia Another pain point of : Relatively large runtime volume . for example : Just open Julia It takes about 200M Of memory , Compile a minimal hello world The program also generates more than 250M The content of .
In order to solve the problems of compilation delay and large size of runtime , Under development Julia 1.8 A lot of optimizations have been made for compiler performance , By way of LLVM from Julia Separation in runtime , send Julia Can run completely in interpreter mode , This results in smaller binary files .
In the near future , We can expect some code with performance requirements to be statically compiled in advance , The rest of the code runs under the interpreter . This will greatly reduce compilation latency , And make deployment Julia Service is easier .
Better type inference 、 Code analysis and inspection
Julia 1.7 Introduces a number of compiler related optimizations for type inference , The main author is Shuhei Kadowaki, This includes new SORA(Scalar Replacement of Aggregates,) Optimize , The stability of a large number of compiler code types is improved . This can give Julia Code brings near free performance acceleration . Some previously known performance optimization techniques ( For example, in judging singleton Use when equal === Instead of == ) So it becomes redundant .
On the other hand, these optimizations in type inference also promote static code checking tools JET The promotion of . At present, we can manually call JET To do some higher quality code type checking and performance optimization , In the future, it may be integrated into IDE in .
3 Julia Ecological evolution
With Julia Language tends to stabilize gradually , We have seen the whole in the past year Julia Ecology has developed a very rich field of subdivision . in general , In the field of Scientific Computing , More and more Julia Sub domain projects become mature , And catch up with or even surpass similar projects based on other languages . In the next part , We will try to list some of the things that we think are most Julia Areas that users are interested in : Automatic differentiation 、for Cycle optimization 、 Heterogeneous programming 、 Programming theory 、 Editor and drawing toolbox . We also list some areas we know : Deep learning 、 dynamic system .
However, due to the limited scope of knowledge , There are still some Julia Subdivisions in ecology , It is difficult for us to give a general review , for example : With SciML As the core of the differential equation ecology 、 With JuMP The optimization field represented by Turing Programming for the probability of representation , wait . We know it's hard to cover all Julia All the subdivisions of ecology , So here we just hope to let you know Julia The main development trends of ecology and Julia At present, the advantageous fields that have developed well .
Automatic differentiation : Still very active
Julia The exploration in the field of automatic differentiation has been in a relatively frontier and active state : From the finite difference FiniteDiffs And forward mode automatic differential ForwardDiff, Based on the Julia IR Source to source automatic differentiation framework Zygote, Then based on LLVM IR The framework of automatic differentiation supporting multiple languages Enzyme, And this year's proposal to support more efficient generation of higher-order differential Diffractor, And Dr. liujinguo is based on reversible programming (reversible programming) NiLang Automatic differentiation tool created by , These differences are based on the design concept, but the existence of a very good automatic differentiation framework , It's really easy for people to fall into choice difficulties .
This is largely because , stay Julia You don't need to spend too much effort to implement a code framework with good performance . Remove these AD Outside the framework , ChainRules A reusable and extensible automatic differential rule set and testing framework are proposed , It is easier and more reliable to fully connect the whole community ecology to automatic differentiation . In the future, we can expect more ecosystems to introduce automatic differential support and thus burst out some new ideas .
LoopVectorization: efficient for Cycle optimization
LoopVectorization Through to Julia Of for loop IR The expression performs cost analysis to infer the optimal for Loop flat pattern , Thus, a very efficient code generation .
The picture below is LoopVectorization The implementation of matrix multiplication is optimized , ad locum @turbo You can see ,LoopVectorization Have achieved and MKL Close performance .
Since last year LoopVectorization After release , It has received a lot of community attention and praise , At the same time, its author was also rated as JuliaCon 2020 The best contributor to the community . This year, LoopVectorization The biggest new feature is the introduction of support for multithreading @tturbo . In the future, we can expect that more toolkits will be used LoopVectorization To make better use of it CPU Performance of .
Heterogeneous programming :CPU/GPU And quantum computing devices
utilize GPU There are usually two ways of thinking about computing power : One is to write vectorization code to call the existing support GPU Function of , The other is to write directly CUDA kernel Kernel function ( Generally in C/C++ on ). because CUDA.jl Allows you to Julia The code compiles directly to CUDA On the device , This allows us to Julia Write directly on the kernel function . I still remember that this year, it was very popular in the circle of friends OpenAI triton Do you ? Behind it and CUDA.jl The work is very similar .
stay CUDA.jl Provides direct compilation of kernel functions to CUDA After the capability on the equipment , This year, there have been some advanced packaging around this point , for example :KernelAbstractions and ParallelStencil. They provide the ability to compile handwritten kernel functions to CPU、GPU And other heterogeneous devices , This avoids the need to write multiple kernel functions for different computing devices .
Get rid of the classic CPU/GPU Outside of heterogeneous programming , In the field of quantum computing , Yao.jl Also provided will be Julia The ability to compile code directly into quantum devices . In this year JuliaCN Relevant reports can be seen at the organized winter meeting (https://www.bilibili.com/video/BV1vY411W7Dw?p=20).
CUDA.jl and Yao.jl Development of Julia Some additional compiler plug-in requirements are proposed , It also produced JuliaCompilerPlugins Group , Some related language features will be found in Julia 1.8( Development version ) Got support from . it is anticipated that , There will be more in the future Julia IR As a compilation tool for intermediate representation .
Julia Research on formalization of programming theory related to language
Formal research will help to better understand and verify Julia Program , and Julia The related theoretical research of programming language is also advancing steadily , Following 2020 October of Julia Intergenerational (world age) The mechanism is studied (arxiv:2010.07516) And formalization (JULIETTE, a world age calculus) after . Researchers from Northeastern University and Cornell University formalized Julia Type stable subset of , It also shows how type stability produces compiler optimizations , And prove the correctness of the program (arxiv:2109.01950). This paper explains why Julia Be able to use type stable code to achieve performance comparable to traditional static languages .
Editor :VSCODE、Jupyter、Pluto For the mainstream development platform
stay VSCode Not yet mature ,Julia Early recommended use of IDE yes Atom+Juno The combination of , Later, along with VSCode The maturity of and Atom Stop updating gradually ,2020 year Sebastian Pfitzner announce Juno The team joined Julia for Visual Studio Code In plug-in development .
With more Juno function ( As shown in the line 、 Variable workspace 、 The debugger ) stay VSCode The plug-in has been improved , This year, Juno It has basically completed its historical mission , Also in the Julia Of IDE Removed from the list . besides , stay VSCode Has also been added to the list of documents about Julia Description of language .
For programmers who have been exposed to data science , Jupyter Notebook It should be a commonly used development and experimental environment : It provides browser based IDE, And support dozens of programming languages . Compared with tradition IDE Come on , Jupyter Similar to Office The WYSIWYG programming experience of the suite , Thus, the programming difficulty of scientific researchers is greatly reduced .Julia adopt IJulia.jl The plug-in provides Julia Support , And as always very stable , Belong to Julia One of the most popular toolkits in the community .
Compared with Jupyter For projects , Pluto.jl The project is entirely around Julia One created by its own characteristics Jupyter Alternative platforms . Perform dependency analysis based on the execution order of code blocks , It provides a programming experience that automatically executes code and updates results . because Pluto Provides a ratio Jupyter Better responsive programming experience ,Pluto The experience in the teaching and demonstration scenarios is excellent , for example :MIT Of Computational Thinking This course uses Pluto Teaching and got very good results .
Drawing toolbox :Makie Taken on a new look , AlgebraOfGraphics It's a real eye opener
Julia In the relatively stable mainstream toolbox under the drawing ecology ,GR.jl Since last year, I switched to the one that can be distributed with the help of images jll artifacts After the version , The problem of failed construction due to network reasons during packaging, which has been criticized in China, has been properly solved .
all the time ,Julia The main drawing toolkits of are the encapsulation of drawing toolkits of other languages , for example GR.jl be based on C Linguistic GR、PyPlot be based on Python Under the Matplotlib. Compared to these drawing toolkits , Based on pure Julia To build the GPU Drawing library Makie It provides very strong interactive drawing support , And merged this year OpenGL、Cairo and WebGL Back end warehouse for , Made a relatively large document update , Integrated flexible multi graph layout function , This has attracted the contributions and attention of many community developers .
Limited by Julia The compilation delay of itself , stay Makie It takes a few minutes to compile the first drawing under , This has always been Makie One of the main pain points of , Therefore, the user experience is not very ideal . At present, if you need daily use Makie, Consider using PackageCompiler.jl Provided by precompiled image Preload . As more and more Julia Developers started to work on the problem of compilation delays , You can look forward to the future Makie Will become easier to use .
Compared with the traditional drawing toolbox API Drawing mode for documents and examples , be based on Makie Of AlgebraOfGraphics For basic graphic elements ( data 、 Axis 、 Layers ) Addition and multiplication operations are defined , And thus provides an eye-catching drawing based on graphic Algebra API.
Deep learning : Focus on academic exploration , Insufficient industrialization
In the field of deep learning , At present, I can see Julia The main development of has the following three lines :1) adopt PyCall Directly call mature Python Study ecology deeply ;2) Use Julia Re implement some low-level tools such as NNLib, Flux, Augmentor, DataLoaders, FastAI, Dagger+Flux And other basic in-depth learning modules ;3) Develop new areas of in-depth learning and work patterns , Such as a trainable differential equation solver NeuralOperators 、 Deep neural network based on differential equation solver DiffEqFlux And the deep study of geometry GeometircFlux.
Although in the short term Julia Deep learning will not be like MindSpore、PyTorch and TensorFlow These mature deep learning frameworks are as easy to use and deploy , But in terms of customizability and extensibility , Julia But it can always meet the exploration desire of the most cutting-edge researchers without losing performance .
JuliaDynamics: Nonlinear dynamical systems and chaos
This year, JuliaDynamics Probably the most eye-catching work worth noting in Springer Nature Next “ Undergraduate physics handout series ” On the nonlinear dynamic system of the entry-level teaching materials 《Nonlinear Dynamics:A Concise Introduction Interlaced with Code》 The publication of this book .
This book contains a lot of information based on DynamicalSystems.jl Code example of . meanwhile , This year, DynamicalSystems It also launched 2.0 edition , It contains some new features and algorithms , for example : Toolbox for entropy calculation , And a new algorithm for estimating the region of attraction (https://arxiv.org/abs/2110.04358). About textbooks and DynamicalSystems For more detailed information, please refer to discourse Summary of the above . besides , As JuliaDynamics Another major tool box for ,Agents Provides agent-based (agent) A modeling method of . Released at the beginning of this year 4.0 edition , After a lot of feature updates , It has been released to 4.7 edition , And is preparing 5.0 Version update . According to its latest article (https://arxiv.org/pdf/2101.10072.pdf), Whether it's in performance 、 Features, ease of use, etc , Agents.jl Has surpassed other similar toolkits ( Such as Mesa、NetLogo、MASON).
4 summary
Quote open class MIT 6.172 《 Software system performance optimization 》 An introduction to :“ Performance is money in computing ” (performance is the currency of computation). On the one hand, people will never be too rich , On the other hand, people say they are not interested in money when they have enough money . Many times when we say that performance is not important , In fact, it is because we are enjoying the benefits brought by the work of our predecessors , However, once you need to explore new areas of Computing ( For example, quantum computing 、 Automatic differentiation 、 Figure calculation ) when , We were thrown into an unexplored area . Want to go further in this unexplored area , We have to make more efficient use of all the resources around us : Find the right direction to explore , And explore more efficiently .
As a dynamically compiled language ,Julia On the one hand, it gives us something like Python Same development efficiency , On the other hand, it gives us something like C/C++ Same execution efficiency , So it attracts a lot of optimization algorithms 、 Differential equations 、 Automatic differentiation 、 Quantum computing 、 Researchers in computing fields such as machine learning . at present Julia The language has become mature and stable , We have reason to believe that the future will follow Julia Further maturation of Ecology ,Julia The advantages of can be further developed .
Finally, I quote the philosopher Wittgenstein in 《 Philosophy of logic 》 A famous saying in :“ The boundary of language is the boundary of the world ” (the limits of my language mean the limits of my world) . Many times we think of programming languages as mere tools , What one programming language can do must be done in another programming language , Then refuse to learn and use other programming languages . But in fact it is very similar to natural language : You only have to learn a language deeply , In order to better understand the national culture represented by this language and the ideas behind it , Just like people who don't know Chinese may never really understand the ideas behind Confucian culture . As a functional programming language ,Julia Adopted with C/C++/Python These mainstream languages have completely different modes of thinking , When you go deep into understanding and using it , I believe it can always bring you some additional experience and harvest .
Now that the Julia Has been steadily moving towards the mainstream programming language , What are you still hesitating about ?
边栏推荐
- 力扣编程题-解法汇总
- el-upload上传文件
- Force deduction solution summary 942- increase / decrease string matching
- 程序员应该如何解决买菜难问题?手把手带你利用无障碍辅助功能快速下单抢菜
- Force deduction solution summary 497 random points in non overlapping rectangles
- Force deduction solution summary 1728- cat and mouse II
- Ue4\ue5 touch screen touch event: single finger and double finger
- Force deduction solution summary -04.06 Successor
- Intel case
- Bochuang smart sprint technology innovation board: annual revenue of RMB 1.1 billion, book value of accounts receivable of RMB 300million
猜你喜欢

maya前臺渲染插件mel脚本工具

CVPR2022 | iFS-RCNN:一种增量小样本实例分割器

Almost all schools will ask for the second round exam! Come in and recite the answer!

WPS表格 学习笔记 - 高亮显示重复值

A single quarter of educational technology revenue of 230million: a year-on-year decrease of 51% and a sharp narrowing of net loss

程序员应该如何解决买菜难问题?手把手带你利用无障碍辅助功能快速下单抢菜

Introduction to architecture - who moved my cake

RPC 入门

Cvpr2022 | IFS RCNN: an incremental small sample instance splitter

【高代码文件格式API】道宁为您提供文件格式API集——Aspose,只需几行代码即可创建转换和操作100多种文件格式
随机推荐
小红的删数字
Force deduction solution summary -04.06 Successor
CVPR2022 | iFS-RCNN:一种增量小样本实例分割器
How should programmers solve the problem of buying vegetables? Take you hand in hand to quickly order and grab vegetables by using the barrier free auxiliary function
Start stop script and distribution script of shell
What insurance products can you buy at the age of 60?
力扣解法汇总面试题 01.05. 一次编辑
Kubernetes' learning path. Is there any "easy mode" Q recommendation for container hybrid cloud
力扣解法汇总面试题 17.11-单词距离
Swiftyjson parsing local JSON files
android html5页面加载缓存优化
Bochuang smart sprint technology innovation board: annual revenue of RMB 1.1 billion, book value of accounts receivable of RMB 300million
力扣解法汇总358-迷你语法分析器
中国银屑病药物市场评估与投资方向研究报告(2022版)
Ue4\ue5 touch screen touch event: single finger and double finger
Force deduction solution summary 467- unique substring in surrounding string
力扣解法汇总905-按奇偶排序数组
打包一个包含手表端应用的手机端APK应用—Ticwear
Research Report on Chinese psoriasis drug market evaluation and investment direction (2022 Edition)
Xcall cluster script (view JPS command)