English
About codestation.org

The codestation.org service is intended as storage place for various software projects.

The full list of projects may be found under Projects tab.

You can see some of forementioned projects in action on this very page, examples are:

  • hector - this whole service is generated with help of hector software
  • gameground - just click on GameGround tab to play in one of excellent logic games

huginn - język programowania bez psikusów, tak prosty że każde dziecko może go opanować.
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 is a computer programming language with following traits:

  • interpretedmultiplatform, what you type is what you got
  • imperativeuse statements to change a program's state
  • functional stylefunctions, lambdas and closures are first class citizens
  • object orienteduser defined types, composition, inheritance, exceptions
  • introspective, non-reflective type systemuser defined types are fixed and immutable at runtime,
    no monkey patching
  • strongly typedabsolutely no implicit value conversions and no implicit type coercion
  • dynamically typedfinal type consistency checks are done at runtime
  • duck typinga set of members determine the valid semantics of a type
  • no quirks guaranteesemantics is consistent across types in all contexts
  • support arbitrary precision calculations per built-in type precision is restricted only by the amount of hardware resources
  • interpreter/executor trivially embeddable in C++ code
    #include <yaal/tools/hhuginn.hxx>
    void foo( HStreamInterface& src_ ) {
    	HHuginn h;
    	h.load( src_ );
    	h.preprocess();
    	if ( h.parse() && h.compile() && h.execute() ) {
    		cout << "ok" << endl;
    	}
    }

Example program written in Huginn language:

Editor (vim) - pow.hgn (Try it online!) [+line no]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#! /bin/sh
exec huginn -E "${0}" "${@}"
#! huginn

/* First Huginn program. */

import Algorithms as algo;

main( argv_ ) {
	print( "Hello World!\n" );
	argc = size( argv_ );
	print( "number of arguments: {}\n".format( argc ) );
	for ( i, arg : algo.enumerate( argv_ ) ) {
		print( "argv_[{}]: {}\n".format( i, arg ) );
	}
	if ( argc >= 3 ) {
		base = number( argv_[1] );
		exp = number( argv_[2] );
		print( "{} ^ {} = {}\n".format( argv_[1], argv_[2], base ^ exp ) );
	} else {
		print( "Not enough arguments to calculate power.\n" );
	}
	return ( 0 );
}

Output:

Terminal - shell session [–line no]
[amok@vegeta](2/1)~/$ ./pow.hgn 3 333
Hello World!
number of arguments: 3
argv_[0]: ./pow.hgn
argv_[1]: 3
argv_[2]: 333
3 ^ 333 = 76098802313205980972042586726503278072789635637207786511701003\
703579163143930619961304414564937852255793535157094995201000183376930256\
6531786879537190794573523