My functional language is actually coming along almost disturbingly well. A lot of the features are theoretical or sketchily implemented at the moment, but it's list-oriented like LISP, stack-oriented like Forth (but in polish notation, instead of reversed -) and pattern-matching like Haskell (except it matches against the stack).
Here are some syntactical examples:
Code: Select all
# A function that sums all numbers on the stack
define [ top @rest ] sum + top sum rest ;
define [ top ] sum top ;
# The following function would calculate a factorial:
define [ 0 @rest ] fac 1 rest;
define [ n @rest ] fac * n [ fac + -1 n ] rest;
# The following duplicates the topmost element on the stack:
define [ top @rest] dup top top rest;
# Did I mention that truth values are also operators?
define [ [ expression condition ] @rest ] select
define [ [ expression condition ] ] select
select [ [ say hello ] [ > 5 2 ] ]
[ [ say does-not-compute ] [ < 5 2 ] ];
-- edit --
I also just noticed that this is the 1,000:th reply to this thread. Happy post-iversary Fleeting Thoughts.