Category:Nickle: Difference between revisions
Content added Content deleted
No edit summary |
(Update some details for Nickle) |
||
Line 1: | Line 1: | ||
{{language |
|||
|site=http://nickle.org/ |
|site=http://nickle.org/ |
||
|gc=yes |
|||
|parampass=value |
|||
|express=implicit |
|||
|checking=dynamic |
|||
}} |
}} |
||
Nickle is a numerically oriented prototyping and scripting environment, with a syntax resembling C. |
|||
By Keith Packard and Bart Massey. Debuted in 2001, the most common version in use is probably 2.79 from 2017. 2.85 was tagged on 2019-07-31 |
|||
Originally a command line desk calculator, Nickle was extended with more sophisticated programming features. |
|||
The numeric datatypes within Nickle make it a good choice for the design and implementation of numeric algorithms. Nickle provides three numeric data types: arbitrary precision integers, arbitrary-precision rationals and unbounded floating-point "reals" with specifiable precision. |
|||
Other datatypes include multi-dimensional arrays, strings, structures, tagged unions and pointers. Higher level types include file, semaphore and thread. Functions are fully call by value, arrays and structures are copied, not referenced. |
|||
The reference implementation includes an interactive top level with byte code compilation before evaluation. |
|||
Example: |
|||
<lang c>/* Arrays to JSON */ |
|||
autoimport JSON; |
|||
int [*] d = {1,2,3}; |
|||
poly [*] p = {1, "abc", 42}; |
|||
printf("%s\n", to_json(d)); |
|||
printf("%s\n", to_json(p)); |
|||
/* Digits */ |
|||
printf("%g\n", 1/3); |
|||
printf("%d\n", 10**50); |
|||
/* looping */ |
|||
for (int i = 0; i < dim(d); i++) { |
|||
printf("%d ", d[i]); |
|||
} |
|||
printf("\n");</lang> |
|||
{{out}} |
|||
<pre>prompt$ nickle sampler.5c |
|||
[ |
|||
1, |
|||
2, |
|||
3 |
|||
] |
|||
[ |
|||
1, |
|||
"abc", |
|||
42 |
|||
] |
|||
0.333333333333333 |
|||
100000000000000000000000000000000000000000000000000 |
|||
1 2 3</pre> |
|||
Suitable of general purpose programming, Nickle excels at prototyping numeric algorithms, and can be a nice complement to tools like Perl and AWK. |