Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Yorick (programming language)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{multiple issues| {{notability|date=July 2011}} {{no footnotes|date=January 2018}} }} {{Infobox programming language | name = Yorick | logo = | caption = | file_ext = .i | paradigm = | year = {{Start date and age|1996}} | designer = [[David H. Munro]] | developer = | latest_release_version = 2.2.04 | latest_release_date = {{Start date and age|2015|05}} | latest_test_version = | latest_test_date = | typing = | implementations = | dialects = | influenced_by = | influenced = | operating_system = [[Unix-like]] systems including [[macOS]], [[Microsoft Windows]] | license = [[BSD licenses|BSD]] | website = {{URL|https://github.com/LLNL/yorick}} }} '''Yorick''' is an [[Interpreted language|interpreted]] [[programming language]] designed for [[numerics]], [[graph of a function|graph]] plotting, and steering large scientific simulation codes. It is quite fast due to [[Array data structure|array]] syntax, and extensible via [[C (programming language)|C]] or [[Fortran]] routines. It was created in 1996 by [[David H. Munro]] of [[Lawrence Livermore National Laboratory]]. == Features == === Indexing === Yorick is good at manipulating elements in N-dimensional arrays conveniently with its powerful syntax. Several elements can be accessed all at once: <syntaxhighlight lang="rout"> > x=[1,2,3,4,5,6]; > x [1,2,3,4,5,6] > x(3:6) [3,4,5,6] > x(3:6:2) [3,5] > x(6:3:-2) [6,4] </syntaxhighlight> ;Arbitrary elements <syntaxhighlight lang="rout"> > x=[[1,2,3],[4,5,6]] > x [[1,2,3],[4,5,6]] > x([2,1],[1,2]) [[2,1],[5,4]] > list=where(1<x) > list [2,3,4,5,6] > y=x(list) > y [2,3,4,5,6] </syntaxhighlight> ;Pseudo-index Like "theading" in [[Perl Data Language|PDL]] and "broadcasting" in [[Numpy]], Yorick has a mechanism to do this: <syntaxhighlight lang="rout"> > x=[1,2,3] > x [1,2,3] > y=[[1,2,3],[4,5,6]] > y [[1,2,3],[4,5,6]] > y(-,) [[[1],[2],[3]],[[4],[5],[6]]] > x(-,) [[1],[2],[3]] > x(,-) [[1,2,3]] > x(,-)/y [[1,1,1],[0,0,0]] > y=[[1.,2,3],[4,5,6]] > x(,-)/y [[1,1,1],[0.25,0.4,0.5]] </syntaxhighlight> ;Rubber index ".." is a rubber-index to represent zero or more dimensions of the array. <syntaxhighlight lang="rout"> > x=[[1,2,3],[4,5,6]] > x [[1,2,3],[4,5,6]] > x(..,1) [1,2,3] > x(1,..) [1,4] > x(2,..,2) 5 </syntaxhighlight> "*" is a kind of rubber-index to reshape a slice(sub-array) of array to a vector. <syntaxhighlight lang="rout"> > x(*) [1,2,3,4,5,6] </syntaxhighlight> ;Tensor multiplication [[Tensor]] multiplication is done as follows in Yorick: P(,+, )*Q(, +) means <math>\sum_{j=1}^{j=N}{P_{ijkl}Q_{mnj}}</math> <syntaxhighlight lang="rout"> > x=[[1,2,3],[4,5,6]] > x [[1,2,3],[4,5,6]] > y=[[7,8],[9,10],[11,12]] > x(,+)*y(+,) [[39,54,69],[49,68,87],[59,82,105]] > x(+,)*y(,+) [[58,139],[64,154]] </syntaxhighlight> ==External links== *[http://www.linuxjournal.com/article/2184 Linux Journal Review] *[https://web.archive.org/web/20170102091157/http://www.jeh-tech.com/yorick.html Yorick tutorial on JehTech] {{Lawrence Livermore National Laboratory|state=autocollapse}} {{DEFAULTSORT:Yorick (Programming Language)}} [[Category:Array programming languages]] [[Category:Free and open source interpreters]] [[Category:Lawrence Livermore National Laboratory]] [[Category:Programming languages created in 1996]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Infobox programming language
(
edit
)
Template:Lawrence Livermore National Laboratory
(
edit
)
Template:Multiple issues
(
edit
)