Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Initial Release of Fexl (Function EXpression Language) (fexl.com)
1 point by fexl on May 10, 2011 | hide | past | favorite | 1 comment


This is an interpreter for a functional programming language in which everything is a function, including data itself.

The grammar (implemented in parse.c) is:

  exp  => [empty]
  exp  => term exp
  exp  => \ sym exp
  exp  => \ sym = term exp
  exp  => ; exp

  term => sym
  term => ( exp )
The interpreter is based entirely on combinatorics. All symbol references are abstracted out, leaving only basic combinators such as S, C, L, R, I, and Y as control structures.

As an example, here is the function which appends two lists:

  \append = (\x\y x y \h\t item h; append t y)
Note the use of the ';' operator, also known as "right-pivot", to avoid parentheses on expressions nested toward the right. Without the ';', the function would be:

  \append = (\x\y x y \h\t item h (append t y))
It doesn't make a lot of difference there, but it comes in very handy with highly sequential functions such as:

  print "The value of x is "; print x; nl;
  print "The value of y is "; print y; nl;
  stop
It currently has built-in functions for manipulating long, double, and string values.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: