thekaigonzalez / fun3

fun3 - memory safe, dynamic programming language based on the fun language spec.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fun3 - the final iteration of the fun programming language

what is fun?
        fun is a programming language based on princple. it uses simple
        goto/retrieve statements to execute code. if not maintained well code
        can quickly get out of hand.

        fun3 is memory safe, fun3 has no recursion which means there are
        practically no possible ways to crash a fun3 program, this makes it good
        to use as either a foundation or as a learning tool for more beginner individuals.

        for example, this code:

                fn main {
                    print [add 1 2];
                }

        is valid code.

        and this:

                fn n {
                    print [add 1 2];
                    main;
                }

                fn main {
                    n;
                }

        is also valid. except it will never stop running due to main calling `n'
        and `n' calling `main'.

        HOWEVER, fun3 fixes these issues by disallowing usage of functions
        defined after the other, that will now print an error message:

                fun3: in invocation of ('main')
                fun3: function 'main' not found
                fun3: did you mean 'join'?
        
        fun3 has no true concept of recursion, so even this code itself:

                fn main {
                    main;
                }

        will not work. this prevents exhaustion of the call stack and prevents
        memory stack overflows.

        (specifically) fun3 contains

                * code blocks
                * builtin functions like `print' and `add'
                * keywords like `fn' to manage said code blocks
                * variables (in previous versions they were stored in a global
                scope, with fun3 they are now returned by the parser/evaluator)

        here is a display of all the features mentioned above:

                fn main {
                        print "Hello, world!";
                        next;
                }

                fn next {
                        # allows movement to different blocks throughout the
                        # code, this language is very recursive and while it is
                        # a benefit, it can get out of hand if not used properly.
                        # but as a foundation it is good to teach other people
                        # using the language itself.
                        print "call from (next)";
                }

        :============================================================================:

        fun3 vs. awe & funLang

                fun3 aims to support all of the functionality from funLang &
                awe, while still keeping simplicity and maintainability.

                the standard library of fun3 is still very very minimal but is
                growing slightly. with the very extensible API it is easy to add
                much more functionality to the language itself.

About

fun3 - memory safe, dynamic programming language based on the fun language spec.

License:GNU Affero General Public License v3.0


Languages

Language:D 98.1%Language:Standard ML 1.2%Language:Shell 0.5%Language:Makefile 0.2%