Git Product home page Git Product logo

Comments (6)

robmoffat avatar robmoffat commented on July 3, 2024 1

Well I'm really interested to know how you get on with this - let me know how it goes either way!

from pure4j.

robmoffat avatar robmoffat commented on July 3, 2024

Hi Boris,

Answering your question first, I haven't written a gradle plugin, but it should be a fairly trivial thing to just write a bit of gradle script to do the same thing: the code you'd need to Groovy-ise is here:

https://github.com/pure4j/pure4j/blob/master/pure4j-maven-plugin/src/main/java/org/pure4j/maven/Pure4JProcessMojo.java

More generally, I've not really been looking at Pure4j much of late - it was an idea I really wanted to try out to see if it worked (and it does), but I've got other projects I'm working on that have taken priority.

I was trying to convert Pure4J to using the Checker Framework, but this was really making my head hurt. That would have got it working in Eclipse/Idea as well as natively in Gradle too.. but it was really complex and I didn't see much upside in finishing it over my other pet projects, sorry.

from pure4j.

boris-petrov avatar boris-petrov commented on July 3, 2024

Hi, thanks for the answer!

Does that mean that pure4j is dead in some sense and it's not wise to use in production? I understand that it's stable and working, but I have to ask that question. :)

This Checker Framework looks impressive and would have been nice if you'd ported pure4j to it. You have no plans of continuing work on that?

I saw that class, yes, and figured that it was what I had to implement in Gradle. I'll be looking into it at some point for sure.

By the way, I can't imagine what could be more important than pure4j. :D That's possibly the best library I've seen for Java, like, ever. And Java is the most used programming language, like, ever. :D

from pure4j.

robmoffat avatar robmoffat commented on July 3, 2024

These are very kind words, thanks.

I would be cautious about using Pure4J in "production" for a couple of reasons:

Firstly, although I'm happy to look at bugs and fix them, there's not really a community around Pure4J. Whenever I look for a 3rd-party library to use in my own code, this is something I look for above pretty much anything else. Although Pure4J received some interest when I posted it on HackerNews, there wasn't really much uptake in the java world, so I can only assume this is because either I have not pushed it hard enough, or it doesn't really solve a problem that lots of people have.

Secondly, I would be wary for a second reason, and that is that Pure4J will change the way you write Java: you are going to end up writing more immutable structures and thinking about functional purity a lot more. The problem is, idiomatically this is not how people write Java code, and that might be frustrating, or prevent you from writing the Java you want to write. Also, it may be itself incompatible with third-party libraries you want to use. There is probably quite a narrow use case for the kind of strictness checks Pure4J is bringing.

If you look at Frege, they have ported Haskell to the JVM, which goes even further in the direction of making you re-think your approach to Java.. perhaps a bit too far for most people... have you considered that at all?

from pure4j.

robmoffat avatar robmoffat commented on July 3, 2024

Btw, the other project is a new version of http://kite9.com, which is my big time-suck

from pure4j.

boris-petrov avatar boris-petrov commented on July 3, 2024

For me the fact that you're willing to fix bugs and support the library is good enough. I would never expect a project like this to have a big community - Java programmers tend to be more old-school/conservative than most and, as you mentioned in your second point, this changes too much of the way you write Java. Hence the adoption is going to be low for sure no matter how much you shout on HN. :)

I definitely do think it solves a lot of problems and, as I mentioned in my first post, in our project we're already doing all that - using immutable data structures in like 95% of the code, thinking about purity, etc. And that's why I wanted a Gradle plugin - because I want to put a ton of @ImmutableValue in our code, run your tool and get actual proof that our code is pure as I'm pretty sure it is. :)

I've considered Clojure and Scala, but I've come to the exact same conclusions you have described in one of your documents here. I've also written Haskell in production and I think this is going a bit further than needed. As I said, our code is 95% immutable/pure, not 100, and I don't think going 100 is going to make it better in any way. That's why I loved the idea of pure4j - the islands of purity has always been my favorite idea and having it implemented (with a static checker on top of that!) for the JVM - that sounds like paradise. :)

Anyway, thanks for your time, good luck with any project that you begin! :) I'll be in touch here if I find any problems!

from pure4j.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.