Live data from Hacker News

Streem – a new programming language from Matz

github.com

51–60 of 199 posts

Re: Streem – a new programming language from Matz

#51

I am glad that someone is working on a new stream processing language, it is a very interesting paradigm. However I hope that they provide some very robust tools for controlling input splitting. As I have spent too much time fighting with awk and wishing it was more flexible(it is frustrating always having exactly two levels of splitting with only matchers on the first and only inverse splitting on the second). As is…

> However I hope that they provide some very robust tools for controlling input splitting

Yes, splitting and combining. Looking at the code example, I feel like so much opportunity is just being squandered, where something like Rust's mapping constructs would feel so much better. Yours is definitely more in that vein, here's something a little closer:

  STDIN | /\w+/{|word|
    /house/   => "foo"
    /car/     => "bar"
    "literal" => "baz"
    _         => "dib"
    # (where _ is a magical symbol for the default case... could be anything)
  }

Re: Streem – a new programming language from Matz

#52

I am glad that someone is working on a new stream processing language, it is a very interesting paradigm. However I hope that they provide some very robust tools for controlling input splitting. As I have spent too much time fighting with awk and wishing it was more flexible(it is frustrating always having exactly two levels of splitting with only matchers on the first and only inverse splitting on the second). As is…

Sounds like a job for structural regex: http://doc.cat-v.org/bell_labs/structural_regexps/se.pdf

Re: Streem – a new programming language from Matz

#53
post #29
post #8

Reminds me a lot of Elixir's |> operator, which does the exact same thing. Nice! Curious how it'll turn out to compare with Elixir on other areas.

I've never heard of Elixir, but I always assumed that the |> originated in F#. Ocaml has it pretty much standard, too, although you can define it in one line in Ocaml: let (|>) x f = f x

Also in Haskell [0]:

    (|>) :: Seq a -> a -> Seq a
    O(1). Add an element to the right end of a sequence. Mnemonic: a triangle with the single element at the pointy end. 
It seems to be in the containers package since 2005: [1]

[0]: http://hackage.haskell.org/package/containers-0.5.5.1/docs/D...

[1]: https://github.com/haskell/containers/commit/1e61853dbd4b9fc...

Re: Streem – a new programming language from Matz

#54
post #26

Earlier quoted context omitted.

It's not any shorter. The extra check as to whether or not to print the line break cancels out the mod 15 check. In my opinion, it's cleaner to have three conditionals of the same type than two checking mods and a third checking the OR of the first two. Of course, it can be actually shorter with a goto.

Whether you print the number, Fizz, Buzz or FizzBuzz you are going output a line break, so I'm not sure what you would be checking for. Output \n unconditionally.

[deleted]

Re: Streem – a new programming language from Matz

#55
post #6

I'm not really a programming language expert, but it seems to me that having an implementation being the spec wouldn't be a good idea. If the Streem implementation has a bug, then the bug becomes the authoritative behavior. Any platform specific quirks would also make it difficult to have defined behavior.

It looks like a weekends worth of work for Matz, I doubt he's even thinking of a spec at this point.

Re: Streem – a new programming language from Matz

#56
post #53
post #29

Earlier quoted context omitted.

I've never heard of Elixir, but I always assumed that the |> originated in F#. Ocaml has it pretty much standard, too, although you can define it in one line in Ocaml: let (|>) x f = f x

Also in Haskell [0]: (|>) :: Seq a -> a -> Seq a O(1). Add an element to the right end of a sequence. Mnemonic: a triangle with the single element at the pointy end. It seems to be in the containers package since 2005: [1] [0]: http://hackage.haskell.org/package/containers-0.5.5.1/docs/D... [1]: https://github.com/haskell/containers/commit/1e61853dbd4b9fc...

Which has a totally different meaning from the F# usage.

'|>' from F# is the same as 'flip $' in haskell, or (&) imported from the lens library

Re: Streem – a new programming language from Matz

#57

true{TRAIL} return keyword_false; Well, this will be fun to debug

This is indeed one of the nicest typos I've seen, but note that there's already a pull request. I suppose bugs can become shallow when your 3 file repo reaches the first page of hn. https://github.com/matz/streem/pull/4/files

Re: Streem – a new programming language from Matz

#59

I am glad that someone is working on a new stream processing language, it is a very interesting paradigm. However I hope that they provide some very robust tools for controlling input splitting. As I have spent too much time fighting with awk and wishing it was more flexible(it is frustrating always having exactly two levels of splitting with only matchers on the first and only inverse splitting on the second). As is…

> However I hope that they provide some very robust tools for controlling input splitting Yes, splitting and combining. Looking at the code example, I feel like so much opportunity is just being squandered, where something like Rust's mapping constructs would feel so much better. Yours is definitely more in that vein, here's something a little closer: STDIN | /\w+/{|word| /house/ => "foo" /car/ => "bar" "literal" =>…

Streaming, pattern matching, and regex combined in one sounds pretty damn cool.

Might also be nice to borrow some of Scala's features for terser code than Ruby, like

    ary | { _ + 5 }
instead of

    ary | { |el| el + 5 }

Re: Streem – a new programming language from Matz

#60

It's definitely a good idea. Pipes are both very powerful and very simple to use and debug, yet they are not very common in general purpose programming languages (examples?). I'm not surprised that someone is trying to build a language around them. I'll follow that, but for now it's a bit too early to judge.

See node.js streams.
Post reply on HN