Julia (programming language): Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 110:
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 /> 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)|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'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 web |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>
Line 223:
 
===Interoperability===
Julia has built-in support for calling [[C (programming language)|C]] or [[Fortran]] language libraries using the <syntaxhighlight lang="julia" inline="">@ccall</syntaxhighlight> macro. Additional libraries allow users to call to or from other languages such as [[Python (programming language)|Python]],<ref>{{Cite web |title=PythonCall & JuliaCall |date=2023-10-29 |url=https://github.com/JuliaPy/PythonCall.jl |access-date=2023-10-30 |publisher=JuliaPy |archive-date=31 October 2023 |archive-url=https://web.archive.org/web/20231031010517/https://github.com/JuliaPy/PythonCall.jl |url-status=live }}</ref> [[C++]],<ref>{{Cite web |last=Cords |first=Clem |title=Clemapfel/jluna |date=2024-11-12 |url=https://github.com/Clemapfel/jluna |access-date=2024-11-26}}</ref><ref>{{Cite web |title=CxxWrap |date=2023-10-28 |url=https://github.com/JuliaInterop/CxxWrap.jl |access-date=2023-10-30 |publisher=JuliaInterop}}</ref> [[Rust (programming language)|Rust]], [[R (programming language)|R]],<ref>{{Cite web |title=RCall.jl |date=2023-10-16 |url=https://github.com/JuliaInterop/RCall.jl |access-date=2023-10-30 |publisher=JuliaInterop |archive-date=30 April 2019 |archive-url=https://web.archive.org/web/20190430053549/https://github.com/JuliaInterop/RCall.jl |url-status=live }}</ref> or to call/use [[Java (programming language)|Java]],<ref>{{Cite web |date=2020-06-02 |title=Julia and Spark, Better Together |url=https://juliacomputing.com/blog/2020/06/02/julia-spark.html |archive-url=https://web.archive.org/web/20200714205019/https://juliacomputing.com/blog/2020/06/02/julia-spark.html |archive-date=14 July 2020 |website=juliacomputing.com}}</ref> and to use with [[SQL]].<ref>{{Cite web |last=Foster |first=Claire |title=SQLREPL.jl |date=2023-10-23 |url=https://github.com/c42f/SQLREPL.jl |access-date=2023-10-31 |archive-date=27 September 2022 |archive-url=https://web.archive.org/web/20220927085821/https://github.com/c42f/SQLREPL.jl |url-status=live }}</ref><ref>{{Cite web |last=Noh |first=WooKyoung |title=Octo.jl |date=2023-10-18 |url=https://github.com/wookay/Octo.jl |access-date=2023-10-31}}</ref><ref>{{Cite web |title=Usage Guide · FunSQL.jl |url=https://mechanicalrabbit.github.io/FunSQL.jl/stable/guide/#Why-FunSQL? |access-date=2023-10-31 |website=mechanicalrabbit.github.io |archive-date=31 October 2023 |archive-url=https://web.archive.org/web/20231031175900/https://mechanicalrabbit.github.io/FunSQL.jl/stable/guide/#Why-FunSQL? |url-status=live }}</ref><ref>{{Cite web |date=21 October 2022 |title=Using Julia with Oracle Databases |url=https://blogs.oracle.com/timesten/post/using-julia-with-oracle-database |access-date=8 November 2022 |archive-date=8 November 2022 |archive-url=https://web.archive.org/web/20221108125241/https://blogs.oracle.com/timesten/post/using-julia-with-oracle-database |url-status=live }}</ref>
 
===Separately-compiled executables option===
Line 250:
 
===Use with other languages===
Julia is in practice [[interoperability|interoperable]] with other languages, in fact the majority of the top 20 languages in popular use. Julia can be used to call shared library functions individually, such as those written in C or Fortran, and packages are available to allow calling other languages (which do not provide C-exported functions directly), e.g. Python (with PythonCall.jl), R<!-- Works with 1.11.x (and 1.10.5 presumably too, but not for all) for at least some users, unclear why not for all, user on discource confimed worked on macOS, and I on Linux. -->,<ref>{{Cite web |date=2024-10-21 |title=Julia crashes on installation of the RCall module |url=https://discourse.julialang.org/t/julia-crashes-on-installation-of-the-rcall-module/121560/6 |access-date=2024-10-22 |website=Julia Programming Language |language=en |quote=For me RCall loads without issue on Julia 1.11 on MacOS}}</ref> MATLAB, C# (and other .NET languages with DotNET.jl, from them with JdotNET), JavaScript, Java (and other JVM languages, such as [[Scala (programming language)|Scala]] with JavaCall.jl). And packages for other languages allow to call to Julia, e.g. from Python, R (to Julia 1.10.x currently possible<!--JuliaCall/r-juliacall likely used an internal/"non-public", non-API, though exported, since removed, i.e. the package was broken by Julia 1.11; the fix is trivial, though the maintainer absent, and I've suggested a workaround, *other* package to call from R to Julia should work for Julia 1.11 still. ---><ref>{{Cite web |title=juliacall fails in julia 1.11 with `undefined symbol: jl_stdout_obj` · Issue #234 · Non-Contradiction/JuliaCall |url=https://github.com/Non-Contradiction/JuliaCall/issues/234 |access-date=2024-10-22 |website=GitHub |language=en}}</ref>), [[Rust (programming language)|Rust]], Ruby, or C#. Such as with juliacall (part of PythonCall.jl<!-- , pyjulia is a different option -->) to call from Python and a different JuliaCall package for calling, Julia up to 1.10.x, from R. Julia has also been used for hardware, i.e. to compile to [[VHDL]], as a [[high-level synthesis]] tool, for example [[field-programmable gate array|FPGA]]s.<ref name="HLS/FPGA" />
 
Julia has packages supporting markup languages such as [[HTML]] (and also for [[HTTP]]), [[XML]], [[JSON]] and [[BSON]], and for [[database]]s (such as PostgreSQL,<ref>{{Cite web |title=Home · LibPQ.jl |url=https://invenia.github.io/LibPQ.jl/stable/ |access-date=2022-11-08 |website=invenia.github.io |archive-date=8 November 2022 |archive-url=https://web.archive.org/web/20221108125236/https://invenia.github.io/LibPQ.jl/stable/ |url-status=dead }}</ref> Mongo,<ref name="FunSQL" /> Oracle, including for [[TimesTen]],<ref>{{Cite web |last=Hood |first=Doug |date=21 October 2022 |title=Using Julia with Oracle Databases |url=https://blogs.oracle.com/timesten/post/using-julia-with-oracle-database |access-date=8 November 2022 |archive-date=8 November 2022 |archive-url=https://web.archive.org/web/20221108125241/https://blogs.oracle.com/timesten/post/using-julia-with-oracle-database |url-status=live }}</ref> MySQL, SQLite, Microsoft SQL Server,<ref name="FunSQL">{{Cite web |title=Home · FunSQL.jl |url=https://docs.juliahub.com/FunSQL/HGzDG/0.9.2/ |access-date=2022-11-08 |website=docs.juliahub.com |archive-date=8 November 2022 |archive-url=https://web.archive.org/web/20221108125240/https://docs.juliahub.com/FunSQL/HGzDG/0.9.2/ |url-status=live }}</ref> Amazon Redshift, Vertica, ODBC) and web use in general.<ref>{{Cite web |title=Genie Builder - Visual Studio Marketplace |url=https://marketplace.visualstudio.com/items?itemName=GenieBuilder.geniebuilder |access-date=2022-11-08 |website=marketplace.visualstudio.com |language=en-us |archive-date=8 November 2022 |archive-url=https://web.archive.org/web/20221108123305/https://marketplace.visualstudio.com/items?itemName=GenieBuilder.geniebuilder |url-status=live }}</ref><ref>{{Cite web |date=2022-02-01 |title=How to Build Your First Web App in Julia with Genie.jl |url=https://www.freecodecamp.org/news/how-to-build-web-apps-in-julia/ |access-date=2022-11-08 |website=freeCodeCamp.org |language=en |archive-date=8 November 2022 |archive-url=https://web.archive.org/web/20221108123305/https://www.freecodecamp.org/news/how-to-build-web-apps-in-julia/ |url-status=live }}</ref>