Treelang is a historical programming language created in 1988.

31Years Old 1,020Users 0Jobs
  • Treelang ranks in the top 50% of languages
  • the Treelang wikipedia page
  • Treelang first appeared in 1988
  • See also: c
  • I have 20 facts about Treelang. just email me if you need more.

Example code from Wikipedia:

// function prototypes
     // function 'add' taking two ints and returning an int
     external_definition int add(int arg1, int arg2);
     external_definition int subtract(int arg3, int arg4);
     external_definition int first_nonzero(int arg5, int arg6);
     external_definition int double_plus_one(int arg7);
     external_definition int main();

     // function definition
       // return the sum of arg1 and arg2
       return arg1 + arg2;
       return arg3 - arg4;

       // aaa is a variable, of type integer and allocated at the start of the function
       automatic int aaa;
       // set aaa to the value returned from add, when passed arg7 and arg7 as the two parameters
       aaa=add(arg7, arg7);
       aaa=add(aaa, aaa);
       aaa=subtract(subtract(aaa, arg7), arg7) + 1;
       return aaa;
       // C-like if statement
       if (arg5)
           return arg5;
       return arg6;

     // Like C, 'gtreelang' needs the main to be defined to create an executable.
          return double_plus_one(5);

Last updated February 11th, 2019