from Hacker News

Matz's programming language based on prototype of stream

by DAddYE on 6/6/16, 3:46 AM with 2 comments

  • by geophile on 6/6/16, 4:09 AM

    Looks a lot like osh (https://github.com/geophile/osh). Here is the osh version of the FizzBuzz example (run in a Linux shell):

        osh gen 100 1 ^ f 'x: "FizzBuzz" if x % 15 == 0 else "Fizz"  if x % 3 == 0 else "Buzz" if x % 5 == 0 else x' $
    
    The function in single quotes is a python function, and in fact osh streams python tuples between commands (which are separated by ^).

    While this example runs on the command line, there is also a python API.