bloom-lang / bud

Prototype Bud runtime (Bloom Under Development)
http://bloom-lang.net
Other
854 stars 60 forks source link

Hard to Sequence #239

Closed jonathandinu closed 12 years ago

jonathandinu commented 12 years ago

So I tried to implement a simple FizzBuzz (http://c2.com/cgi/wiki?FizzBuzzTest) using bud for fun but ran into some quirky behavior.

It is difficult to output the same value multiple time to stdio (since it is a set) and the only way around this is to output unique values and format it after in ruby or to use time (and possibly a queue) to output the duplicates at distinct timesteps.

Even just generating a sequence is hard to find in the sandbox (ordering -> assign.rb -> sortAssignPersist).

neilconway commented 12 years ago

As far as duplicates in stdio, I think a set is not quite the right abstraction for representing an I/O device. For one thing, there is the duplicate issue; I/O is also inherently ordered (if one execution places "x" and then "y" in stdout and another places "y" then "x", we are not correct to regard the executions as producing equivalent results). Some sort of ordered stream primitive might be a better fit, although it isn't clear to me how that would fit into the rest of the language (#7).

Aside from the dups-in-stdio issue, is there anything else to fix here?

jonathandinu commented 12 years ago

not that I can really think of. I talked to Joe about this issue a little and he kinda had the same reaction, that maybe there are just some things that bloom can't be good at and for those things to breakout of it and use plain old Ruby (which is what I ended up doing using a puts)

neilconway commented 12 years ago

Closing in the absence of an actionable TODO item here.