-login:
user: password:
Polski
huginn - programming language with no quirks, so simple every child can master it.
Fork me on GitHub
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:

Editor (vim) - shortest.hgn [+line no]
1
main(){}

To execute this program one must explicitly invoke huginn interpreter, e.g.:

Terminal - shell session [–line no]
[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:

Editor (vim) - shortest-standalone.hgn [+line no]
1 2
#! /path/to/huginn
main(a){a;}

To execute this program one can run this program directly:

Terminal - shell session [–line no]
[amok@vegeta](2/1)~/$ ./shortest-standalone.hgn
[amok@vegeta](2/1)~/$

Shortest possible portable huginn program:

Editor (vim) - hello-shortest-portable.hgn [+line no]
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.

Terminal - shell session [–line no]
[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:

Editor (vim) - hello.hgn [+line no]
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:

Terminal - shell session [–line no]
[amok@vegeta](2/1)~/$ ./hello.hgn
Hello World!
[amok@vegeta](2/1)~/$ ./hello.hgn Huginn
Hello Huginn!
[amok@vegeta](2/1)~/$


REPL

Terminal - shell session


Stream editor

Terminal - shell session [–line no]
[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)$