J (programming language)
From Bauman National Library
This page was last modified on 1 June 2016, at 17:14.
This page was last modified on 1 June 2016, at 17:14.
Paradigm | Array, functional, function-level, tacit |
---|---|
Designed by | Kenneth E. Iverson, Roger Hui |
Developer | JSoftware |
First appeared | 1990 |
Stable release | J804 / 4.012016 |
Typing discipline | dynamic |
License | GPLv3 |
Filename extensions | .ijs |
Website | jsoftware.com |
Influenced by | |
APL, FP, FL | |
Influenced | |
K, NumPy |
J - vector functional programming language. It is dialect APL. Unlike APL does not require a special keyboard to enter mathematical symbols, because it uses ASCII characters. The programming language J was developed in the early 1990s by Kenneth Iverson and Roger Hui (Roger Hui) (Eng.), As a synthesis of the APL (also developed by Iverson) and combinatorial programming languages FP and the FL , developed by Backus. Its main features - a focus on the MIMD instruction, the functional approach.
Data types
J supports three simple types:
- Numeric
- Literal (Character)
- Boxed
Vocabulary
Constantes Controles Foreigns Partes de un programa
Examples
An example of "Hello, world!" Program
#!/bin/jc
echo 'Hello, world!'
exit ''
Some examples of use avg
:
v=: ?. 20 $100 NB. a random vector
v
46 55 79 52 54 39 60 57 60 94 46 78 13 18 51 92 78 60 90 62
avg v
59.2
4 avg\ v NB. moving average on periods of size 4
58 60 56 51.25 52.5 54 67.75 64.25 69.5 57.75 38.75 40 43.5 59.75 70.25 80 72.5
m=: ?. 4 5 $50 NB. a random matrix
m
46 5 29 2 4
39 10 7 10 44
46 28 13 18 1
42 28 10 40 12
The implementation of quicksort:
sel=: adverb def 'u # [' quicksort=: verb define
if. 1 >: #y do. y
else.
(quicksort y <sel e),(y =sel e),quicksort y >sel e=.y{~?#y
end.
)
Control structures
J provides control structures, similar to other procedural languages. For example:
*assert.
*break.
*continue.
*for.
*goto_label.
*if. else. elseif.
*return.
*select. case.
*throw.
*try. catch.
*while. whilst.
Присоединяйся к команде
ISSN:
Следуй за Полисом
Оставайся в курсе последних событий
License
Except as otherwise noted, the content of this page is licensed under the Creative Commons Creative Commons «Attribution-NonCommercial-NoDerivatives» 4.0 License, and code samples are licensed under the Apache 2.0 License. See Terms of Use for details.