Julia (programming language): Difference between revisions

Content deleted Content added
1.11.5 is now released, and binaries downloadable.
Officially supported now by Google Colab.
Line 107:
Distinctive aspects of Julia's design include a type system with [[parametric polymorphism]] and the use of [[multiple dispatch]] as a core [[programming paradigm]], a default [[just-in-time compilation|just-in-time]] (JIT) compiler<ref name="general purpose" /><ref>{{Cite web |title=Sysimages · PackageCompiler |url=https://julialang.github.io/PackageCompiler.jl/stable/sysimages.html#Creating-a-sysimage-using-PackageCompiler |access-date=2023-04-10 |website=julialang.github.io |archive-date=10 April 2023 |archive-url=https://web.archive.org/web/20230410160253/https://julialang.github.io/PackageCompiler.jl/stable/sysimages.html#Creating-a-sysimage-using-PackageCompiler |url-status=live }}</ref> (with support for [[ahead-of-time compilation]]<ref name="PackageCompiler.jl" /><ref>{{Cite web |title=julia/doc/src/devdocs/aot.md at master · JuliaLang/julia |url=https://github.com/JuliaLang/julia/blob/master/doc/src/devdocs/aot.md |access-date=2023-10-03 |website=GitHub |language=en |archive-date=3 October 2023 |archive-url=https://web.archive.org/web/20231003164500/https://github.com/JuliaLang/julia/blob/master/doc/src/devdocs/aot.md |url-status=live }}</ref><ref>{{Cite web |title=System Image Building · The Julia Language |url=https://docs.julialang.org/en/v1/devdocs/sysimg/ |access-date=2023-10-03 |website=docs.julialang.org}}</ref>) and an [[tracing garbage collection|efficient (multi-threaded) garbage collection]] implementation.<ref>{{Cite newsgroup |url=https://groups.google.com/forum/#!topic/julia-users/6_XvoLBzN60 |title=Suspending Garbage Collection for Performance...good idea or bad idea? |website=Groups.google.com |access-date=2017-05-31 |archive-date=14 February 2012 |archive-url=https://web.archive.org/web/20120214124121/http://groups.google.com/group/web2py/browse_thread/thread/c81061bc00c6181e#!topic/julia-users/6_XvoLBzN60 |url-status=live }}</ref> Notably Julia does not support classes with encapsulated methods and instead it relies on structs with generic methods/functions not tied to them.
 
By default, Julia is run similarly to scripting languages, using its runtime, and allows for [[read–eval–print loop|interactions]],<ref name="PackageCompiler.jl" /> but Julia programs/[[source code]] can also optionally be sent to users in one ready-to-install/run file, which can be made quickly, not needing anything preinstalled.<ref name=AppBundler.jl /> <!-- controversial on Talk, page, for now commenting out, may move out of lead: Julia programs can also be (separately) compiled to [[binary executable]]s, even allowing no-source-code distribution, and the executables can get much smaller with Julia 1.12. Such compilation is not needed for speed, though it can decrease constant-factor startup cost, since Julia is also compiled when running interactively, but it can help with hiding source code. Features of the language can be separately compiled, so Julia can be used, for example, with its runtime or without it (which allows for smaller executables and libraries but is limited in capabilities). -->
 
Julia programs can reuse libraries from other languages by calling them, e.g. calling [[C (programming language)|C]] or [[Rust (programming language)|Rust]] libraries, and Julia (libraries) can also be called from other languages, e.g. [[Python (programming language)|Python]] and [[R (programming language)|R]], and several Julia packages have been made easily available from those languages, in the form of Python and R [[library (computing)|libraries]] for corresponding Julia packages. Calling in either direction has been implemented for many languages, not just those and [[C++]].
 
Julia is supported by programmer tools like IDEs (see below) and by notebooks like Pluto.jl, Jupyter, and since 2025 Google Colab officially supports Julia natively.
<!--
It is recommended to install Julia with juliaup (which installs and takes care of Julia version updates), it is recommended NOT to install Julia through Linux distro's package managers. Juliaup is available in the Microsoft Store under the name Julia, which installs both.
 
Julia works on the [[Raspberry Pi]] computer, and is e.g. supported in [[Raspbian]].<ref>{{cite web |url=https://julialang.org/blog/2017/05/raspberry-pi-julia |title=Julia available in Raspbian on the Raspberry Pi |quote=Julia works on all the Pi variants, we recommend using the Pi 3.}}</ref>
 
<!- For now also commented out (see Talk, and above shorter text):
Julia's [[Visual Studio Code]] extension provides a fully-featured [[integrated development environment]] with "built-in dynamic autocompletion, inline results, plot pane, integrated REPL, variable view, code navigation, and many other advanced language features"<ref>{{Cite news |title=Julia in Visual Studio Code |url=https://code.visualstudio.com/docs/languages/julia}}</ref> e.g. debugging is possible, [[lint (software)|linting]], and [[profiling (computer programming)|profiling]].<ref>{{Cite web|last=Holy|first=Tim|title=GitHub - timholy/ProfileView.jl: Visualization of Julia profiling data.|website=[[GitHub]]|date=2019-09-13|url=https://github.com/timholy/ProfileView.jl|access-date=2019-09-22|archive-date=31 January 2020|archive-url=https://web.archive.org/web/20200131231452/https://github.com/timholy/ProfileView.jl|url-status=live}}</ref><ref>{{Cite web|last=Gregg|first=Brendan|title=GitHub - brendangregg/FlameGraph: Stack trace visualizer.|website=[[GitHub]]|date=2019-09-20|url=https://github.com/brendangregg/FlameGraph|access-date=2019-09-22|archive-date=26 September 2019|archive-url=https://web.archive.org/web/20190926230048/https://github.com/brendangregg/FlameGraph|url-status=live}}</ref><ref>{{Cite web|url=https://julialang.org/blog/2019/03/debuggers|title=A Julia interpreter and debugger|website=julialang.org|access-date=2019-04-10}}</ref><ref>{{Cite web|url=https://timholy.github.io/Rebugger.jl/dev/|title=Home · Rebugger.jl|website=timholy.github.io|access-date=2019-04-10|archive-date=31 March 2019|archive-url=https://web.archive.org/web/20190331171846/https://timholy.github.io/Rebugger.jl/dev/|url-status=live}}</ref>
->
 
Some state-of-the-art software has already been written in Julia, because it's considered easier to do then in the other popular languages. Some of it can also be used from other languages like Python or R. Julia was designed to be unusually easy to work with other languages, i.e. to benefit from code already written in other languages, to "reuse" their code.
 
It is recommended to install Julia with juliaup (which installs and takes care of Julia version updates), it is recommended NOT to install Julia through Linux distro's package managers. Juliaup is available in the Microsoft Store under the name Julia, which installs both.
 
Julia works on the [[Raspberry Pi]] computer, and is e.g. supported in [[:en:Raspbian|Raspbian]].<ref>{{cite web |url=https://julialang.org/blog/2017/05/raspberry-pi-julia |title=Julia available in Raspbian on the Raspberry Pi |quote=Julia works on all the Pi variants, we recommend using the Pi 3.}}</ref>
 
<!- For now also commented out (moved below, see Talk, and above shorter text):
Julia's [[Visual Studio Code]] extension provides a fully-featured [[integrated development environment]] with "built-in dynamic autocompletion, inline results, plot pane, integrated REPL, variable view, code navigation, and many other advanced language features"<ref>{{Cite news |title=Julia in Visual Studio Code |url=https://code.visualstudio.com/docs/languages/julia}}</ref> e.g. debugging is possible, [[lint (software)|linting]], and [[profiling (computer programming)|profiling]].<ref>{{Cite web|last=Holy|first=Tim|title=GitHub - timholy/ProfileView.jl: Visualization of Julia profiling data.|website=[[GitHub]]|date=2019-09-13|url=https://github.com/timholy/ProfileView.jl|access-date=2019-09-22|archive-date=31 January 2020|archive-url=https://web.archive.org/web/20200131231452/https://github.com/timholy/ProfileView.jl|url-status=live}}</ref><ref>{{Cite web|last=Gregg|first=Brendan|title=GitHub - brendangregg/FlameGraph: Stack trace visualizer.|website=[[GitHub]]|date=2019-09-20|url=https://github.com/brendangregg/FlameGraph|access-date=2019-09-22|archive-date=26 September 2019|archive-url=https://web.archive.org/web/20190926230048/https://github.com/brendangregg/FlameGraph|url-status=live}}</ref><ref>{{Cite web|url=https://julialang.org/blog/2019/03/debuggers|title=A Julia interpreter and debugger|website=julialang.org|access-date=2019-04-10}}</ref><ref>{{Cite web|url=https://timholy.github.io/Rebugger.jl/dev/|title=Home · Rebugger.jl|website=timholy.github.io|access-date=2019-04-10|archive-date=31 March 2019|archive-url=https://web.archive.org/web/20190331171846/https://timholy.github.io/Rebugger.jl/dev/|url-status=live}}</ref>
-->
 
==History==
Line 243 ⟶ 261:
 
The REPL can be extended with additional modes, and has been with packages, e.g. with an [[SQL]] mode,<ref>{{Cite web |first=Chris |last=Foster |title=SQLREPL.jl |website=[[GitHub]] |date=2022-04-04 |url=https://github.com/c42f/SQLREPL.jl |access-date=2022-09-27 |archive-date=27 September 2022 |archive-url=https://web.archive.org/web/20220927085821/https://github.com/c42f/SQLREPL.jl |url-status=live }}</ref> for database access, and ''RCall.jl'' adds an {{nowrap|R mode}}, to work with the [[R (programming language)|R language]].<ref>{{Cite web |title=Getting Started · RCall.jl |url=https://juliainterop.github.io/RCall.jl/latest/gettingstarted.html#Several-Ways-to-use-RCall-1 |access-date=2022-09-27 |website=juliainterop.github.io |archive-date=4 September 2024 |archive-url=https://web.archive.org/web/20240904035201/https://juliainterop.github.io/RCall.jl/latest/gettingstarted.html#Several-Ways-to-use-RCall-1 |url-status=live }}</ref>
 
Julia's [[Visual Studio Code]] extension provides a fully-featured [[integrated development environment]] with "built-in dynamic autocompletion, inline results, plot pane, integrated REPL, variable view, code navigation, and many other advanced language features"<ref>{{Cite news |title=Julia in Visual Studio Code |url=https://code.visualstudio.com/docs/languages/julia}}</ref> e.g. debugging is possible, [[lint (software)|linting]], and [[profiling (computer programming)|profiling]].<ref>{{Cite web|last=Holy|first=Tim|title=GitHub - timholy/ProfileView.jl: Visualization of Julia profiling data.|website=[[GitHub]]|date=2019-09-13|url=https://github.com/timholy/ProfileView.jl|access-date=2019-09-22|archive-date=31 January 2020|archive-url=https://web.archive.org/web/20200131231452/https://github.com/timholy/ProfileView.jl|url-status=live}}</ref><ref>{{Cite web|last=Gregg|first=Brendan|title=GitHub - brendangregg/FlameGraph: Stack trace visualizer.|website=[[GitHub]]|date=2019-09-20|url=https://github.com/brendangregg/FlameGraph|access-date=2019-09-22|archive-date=26 September 2019|archive-url=https://web.archive.org/web/20190926230048/https://github.com/brendangregg/FlameGraph|url-status=live}}</ref><ref>{{Cite web|url=https://julialang.org/blog/2019/03/debuggers|title=A Julia interpreter and debugger|website=julialang.org|access-date=2019-04-10}}</ref><ref>{{Cite web|url=https://timholy.github.io/Rebugger.jl/dev/|title=Home · Rebugger.jl|website=timholy.github.io|access-date=2019-04-10|archive-date=31 March 2019|archive-url=https://web.archive.org/web/20190331171846/https://timholy.github.io/Rebugger.jl/dev/|url-status=live}}</ref>
 
===Use with other languages===