huginn - język programowania bez psikusów, tak prosty że każde dziecko może go opanować.

git clone https://codestation.org/repo/huginn.git
git clone https://github.com/AmokHuginnsson/huginn.git
git clone https://bitbucket.org/huginn/huginn.git
Huginn implementation provides four modes of operation:
Scripts
Shortest possible valid huginn program:
1
main(){}
To execute this program one must explicitly invoke huginn interpreter, e.g.:
[amok@vegeta](2/1)~/$ huginn --no-argv shortest.hgn [amok@vegeta](2/1)~/$ echo 'main(){}' | huginn [amok@vegeta](2/1)~/$
Shortest possible "standalone" huginn program:
1
2
#! /path/to/huginn main(a){a;}
To execute this program one can run this program directly:
[amok@vegeta](2/1)~/$ ./shortest-standalone.hgn [amok@vegeta](2/1)~/$
Shortest possible portable huginn program:
1
2
3
4
#! /bin/sh exec huginn --no-argv -E "${0}" "${@}" #! huginn main(){}
This form shall work as long as huginn
interpreter can be found in user's $PATH
.
[amok@vegeta](2/1)~/$ ./shortest-portable.hgn [amok@vegeta](2/1)~/$
Canonical Hello World program written in huginn, from now on we use suggested coding style:
1
2
3
4
5
6
7
8
9
10
11
12
#! /bin/sh exec huginn -E "${0}" "${@}" #! huginn main( argv_ ) { if ( size( argv_ ) > 1 ) { print( "Hello {}!\n".format( argv_[1] ) ); } else { print( "Hello World!\n" ); } return ( 0 ); }
Program output:
[amok@vegeta](2/1)~/$ ./hello.hgn Hello World! [amok@vegeta](2/1)~/$ ./hello.hgn Huginn Hello Huginn! [amok@vegeta](2/1)~/$
REPL

Stream editor
[amok@vegeta](2/1)~/$ cat equations.txt eq1: 2^8 pi: arctg( 1 ) * 4 mod: 177 % 23 ord: 2 + 2 * 2 [amok@vegeta](2/1)~/$ huginn -F": " -aple '"{}: {}".format( F[0], real( F[1] ) )' equations.txt eq1: 256.0 pi: 3.14159265359 mod: 16.0 ord: 6.0 [amok@vegeta](1/2)~/(local)$