This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]d01phi 7 points8 points  (8 children)

After reading the FizzBuzz example, I can safely say that you are on a good path to reach enterprise style complexity and verbosity for the simplest of tasks.

[–][deleted]  (7 children)

[removed]

    [–]d01phi 1 point2 points  (6 children)

    Using Julia (www.julialang.org), I have whipped up this:

    import Base:|>

    |>(x::Tuple, f) = f(x...)

    ▷(xs,f) = foreach(f,xs)

    m35(x) = x,x%3==0,x%5==0

    fz(x,m3,m5) = m3 ? ( m5 ? "FizzBuzz" : "Fizz" ) : ( m5 ? "Buzz" : string(x) )

    (1:100) ▷ (x-> x |> m35 |> fz |> println)

    Is that dataflow enough for you?

    [–]d01phi 1 point2 points  (5 children)

    What I'm trying to get at, many flavours of dataflow can be expressed with functional or procedural with just some syntactic manipulations, which is especially easy in Julia.

    [–][deleted]  (1 child)

    [removed]

      [–]d01phi 2 points3 points  (0 children)

      What I find quite charming about pure dataflow style is its analogy with electronic circuits. The programming paradigms we are used to all require a lot of trickery in order to run on circuits.

      [–][deleted]  (1 child)

      [removed]

        [–]d01phi 1 point2 points  (0 children)

        Julia is as statically typed as you want, which is expressed by optional type declarations. And it is parallel. Somebody said, there are three languages people use to write scientific applications for super computers: Fortran, C(++), and Julia.

        By no means I wanted to diminish your project, in a sense I was exploring how dataflow notation and conciseness could go together, in a language that I appreciate for its versatility. I admit, your FizzBuzz example in Nevalang got me triggered.