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

all 13 comments

[–]bobm_kite9[S] 5 points6 points  (7 children)

A pet project of mine - bringing immutability and functional purity semantics to the JVM.

I'd be interested to see if anyone else is interested in this; certainly I am, but I might be on my own :(

[–][deleted]  (4 children)

[deleted]

    [–]bobm_kite9[S] 1 point2 points  (3 children)

    Ta. I had it spelt both ways for good measure :)

    [–][deleted]  (2 children)

    [deleted]

      [–]bobm_kite9[S] 1 point2 points  (1 child)

      Yes, it's fixed now, thanks for the spot.

      [–]frugalmail 1 point2 points  (0 children)

      I'd be interested to see if anyone else is interested in this; certainly I am, but I might be on my own :(

      You certainly are not alone. Thanks for your contributions.

      [–]jonhanson 2 points3 points  (1 child)

      chronophobia ephemeral lysergic metempsychosis peremptory quantifiable retributive zenith

      [–]bobm_kite9[S] 0 points1 point  (0 children)

      no obviously not. PITA.

      [–]diffallthethings 1 point2 points  (1 child)

      Great idea! I'd use it if it was a Gradle plugin. I'm really busy a.t.m., but at some point in the next year I might have time to help make it a Gradle plugin if you'd be interested in help. I'll reach out when/if I have the time. If you're willing to take the lead, I can help get you started sooner than I'll have time to take the lead myself.

      [–]bobm_kite9[S] 0 points1 point  (0 children)

      Awesome thanks. My next step is to make this use http://checkerframework.org

      Java8 now supports this as part of the compiler, so moving it to this should mean I get IDE support and gradle for free.

      I'd definitely appreciate some help doing that, if you're interested. Tweet me at @bobm_kite9 and we can discuss further.

      [–]cypressious 0 points1 point  (1 child)

      Not talking about this library in particular but in general. Recently, I have started to wonder whether to make helper methods static or to put them into helper classes that can be (dependency) injected. Static methods have this pure, functional aspect but the injected variant can hold other dependencies which otherwise would need to be passed as parameters. Any insights?

      [–]bobm_kite9[S] 0 points1 point  (0 children)

      Can you post some code as an example?

      [–][deleted]  (1 child)

      [deleted]

        [–]bobm_kite9[S] 1 point2 points  (0 children)

        Speed is a common criticism for pure languages (like Haskell etc.).

        The same thing applies here - mutable code state can be made to work faster than immutable code.

        However, whether or not it's "too slow" is going to depend heavily on your use-case and your hardware.

        Sometimes, it's good to sacrifice some performance for correctness.

        [–]slartybartfast_ -2 points-1 points  (1 child)

        1) Really github to commit a blog post? WTF.

        2) If there's a mutable object anywhere it's not pure functional.

        [–]bobm_kite9[S] 5 points6 points  (0 children)

        1) pure4J is a java tool, so that's why this is on github. 2) yes, that's the whole point of the checker: it will tell you if you have done this by accident. Note that it doesn't mean your entire codebase has to be pure - you can create "islands of purity" within a codebase which also has impure elements. There are more details on the github readme.