Live data from Hacker News

Streem – a new programming language from Matz

github.com

61–70 of 199 posts

Re: Streem – a new programming language from Matz

#61
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.

then you'd get \n \n fizz\n \n buzz\n rather than fizz\n buzz\n

Re: Streem – a new programming language from Matz

#63
post #31

I see this as a very good alternative to traditional shell scripting languages.

Anything that beats Bash's ugliness I'm all for.

it would also be nice if it had a static type system, but given that it's Matz, it's unlikely...

Re: Streem – a new programming language from Matz

#64
post #61

Earlier quoted context omitted.

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.

then you'd get \n \n fizz\n \n buzz\n rather than fizz\n buzz\n

The canonical FizzBuzz wants

1\n2\nFizz\n4\nBuzz\n...\nFizzBuzz\n

If you did not print anything for some cases, you're right that it could not be unconditional (though it could still be done at the end with a flag).

Re: Streem – a new programming language from Matz

#65
post #40
post #2

Whatever, https://github.com/ekmett/machines https://github.com/scalaz/scalaz-stream

This is newsworthy because Matz is developing a new language, not because such a thing doesn't already exist.

who is matz and why should i care?

Re: Streem – a new programming language from Matz

#66
post #61

Earlier quoted context omitted.

then you'd get \n \n fizz\n \n buzz\n rather than fizz\n buzz\n

The canonical FizzBuzz wants 1\n2\nFizz\n4\nBuzz\n...\nFizzBuzz\n If you did not print anything for some cases, you're right that it could not be unconditional (though it could still be done at the end with a flag).

oops, yes, my mistake.

Re: Streem – a new programming language from Matz

#67
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

In Elixir, |> does not flip arguments. It lets you chain together multiple functions by inserting the result of the previous function as the first argument of the following function. Here's an example from http://www.theerlangelist.com/2014/01/why-elixir.html

The following code computes the sum of squares of all positive numbers of a list:

list |> Enum.filter(&(&1 > 0)) |> Enum.map(&(&1 * &1)) |> Enum.reduce(0, &(&1 + &2))

Re: Streem – a new programming language from Matz

#68
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.

Right now, the closest thing to a spec is the sample FizzBuzz code (as an implicit spec that "this code will solve FizzBuzz"); there is no implementation (just work-in-progress parser/lexer code.)

So, while I'll agree that there are issues that come from the implementation being the spec of a language in general, I would say we are well earlier than the point at which we can identify that as a problem with Streem.

Re: Streem – a new programming language from Matz

#69

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…

Awesome ! Let's call it sed !

Reference: https://www.gnu.org/software/sed/manual/sed.html#Examples

Sorry, I couldn't miss that one. :) Really, check the example. Sed is most powerful tool and can do astonishing work.

Post reply on HN