Julia (programming language): Difference between revisions

Content deleted Content added
Citation bot (talk | contribs)
Altered template type. Add: date, authors 1-1. | Use this bot. Report bugs. | Suggested by Dominic3203 | Linked from User:LinguisticMystic/cs/outline | #UCB_webform_linked 1072/2277
Kisequé (talk | contribs)
m Interaction: code formatting and closed leaking parenthesis
Line 242:
 
==Interaction==
The Julia official distribution includes an interactive command-line [[read–eval–print loop]] (REPL),<ref>{{Cite web|url=https://docs.julialang.org/en/v1/stdlib/REPL/|title=The Julia REPL · The Julia Language|website=docs.julialang.org|access-date=2019-09-22|archive-date=22 September 2019|archive-url=https://web.archive.org/web/20190922175929/https://docs.julialang.org/en/v1/stdlib/REPL/|url-status=live}}</ref> with a searchable history, [[command-line completion|tab completion]], and dedicated help and [[shell (computing)|shell]] modes,<ref>{{Cite web|url=https://en.wikibooks.org/wiki/Introducing_Julia/The_REPL|title=Introducing Julia/The REPL - Wikibooks, open books for an open world|website=en.wikibooks.org|quote=you can install the Julia package OhMyREPL.jl [..] which lets you customize the REPL's appearance and behaviour|access-date=2019-09-22|archive-date=23 June 2019|archive-url=https://web.archive.org/web/20190623142710/https://en.wikibooks.org/wiki/Introducing_Julia/The_REPL|url-status=live}}</ref> which can be used to experiment and test code quickly.<ref>{{Cite web|url=https://docs.julialang.org/en/v1/manual/getting-started/|title=Getting Started · The Julia Language|website=docs.julialang.org|language=en|access-date=2018-08-15|archive-date=10 August 2019|archive-url=https://web.archive.org/web/20190810173026/https://docs.julialang.org/en/v1/manual/getting-started/|url-status=live}}</ref> The following fragment represents a sample session example where strings are concatenated automatically by <code>println</code>:<ref>See also: {{URL|https://docs.julialang.org/en/v1/manual/strings/}} for string interpolation and the <code>string(greet, ", ", whom, ".\n")</code> example for preferred ways to concatenate strings. <!--While the <code>+</code> operator is not used for string concatenation, it could easily be defined to do so.--> Julia has the println and print functions, but also a @printf macro (i.e., not in function form) to eliminate run-time overhead of formatting (unlike the same function in C).</ref>
 
<syntaxhighlight lang="jlcon">
Line 256:
</syntaxhighlight>
 
Julia uses [[UTF-8]] and [[LaTeX]] codes, allowing it to support common math symbols for many operators, such as ∈ for the <code>in</code> operator, typable with <code>\in</code> then pressing {{keypress|TAB}} (i.e. uses [[LaTeX]] codes, or also possible by simply copy-pasting, e.g. {{not a typo|√ and ∛}} possible for [[square root|sqrt]] and [[cube root|cbrt]] functions). Julia has support for [[Unicode]] 15.1 (Julia&nbsp;1.12-DEV<!--alpha1--> supports latest 16.0 release<ref>{{Cite web |title=support Unicode 16 via utf8proc 2.10.0 by stevengj · Pull Request #56925 · JuliaLang/julia |url=https://github.com/JuliaLang/julia/pull/56925 |access-date=2025-01-08 |website=GitHub |language=en}}</ref>) for the languages of the world, even for source code, e.g. variable names (while it's recommended to use English for public code, and e.g. package names).
 
Julia is supported by ''[[Project Jupyter|Jupyter]]'', an online interactive "notebooks" environment,<ref>{{Cite web |url=https://jupyter.org/ |title=Project Jupyter |access-date=19 August 2015 |archive-date=29 June 2017 |archive-url=https://web.archive.org/web/20170629054445/https://jupyter.org/ |url-status=live }}</ref> and ''[https://github.com/fonsp/Pluto.jl Pluto.jl]'', a "reactive notebook" (where notebooks are saved as pure Julia files), a possible replacement for the former kind.<ref>{{Cite web|last=Boudreau|first=Emmett|date=2020-10-16|title=Could Pluto Be A Real Jupyter Replacement?|url=https://towardsdatascience.com/could-pluto-be-a-real-jupyter-replacement-6574bfb40cc6|access-date=2020-12-08|website=Medium|language=en|archive-date=12 April 2023|archive-url=https://web.archive.org/web/20230412112240/https://towardsdatascience.com/could-pluto-be-a-real-jupyter-replacement-6574bfb40cc6|url-status=live}}</ref> In addition Posit's (formerly [[RStudio]] Inc's) Quarto publishing system supports Julia, Python, R and Observable [[JavaScript]] (those languages have official support by the company, and can even be weaved together in the same notebook document, more languages are unofficially supported).<ref>{{Cite web |last=Machlis |first=Sharon |date=2022-07-27 |title=RStudio changes name to Posit, expands focus to include Python and VS Code |url=https://www.infoworld.com/article/3668252/rstudio-changes-name-to-posit-expands-focus-to-include-python-and-vs-code.html |access-date=2023-01-18 |website=InfoWorld |language=en}}</ref><ref>{{Cite web |date=2022-07-20 |title=Heads up! Quarto is here to stay. Immediately combine R & Python in your next document: An extension on a recent post. |url=https://www.ds-econ.com/quarto/ |access-date=2023-01-18 |website=ds-econ |language=en |archive-date=31 January 2023 |archive-url=https://web.archive.org/web/20230131161337/https://www.ds-econ.com/quarto/ |url-status=live }}</ref>