9 ms·
Problem Solving and Clojure 1.9 with Rich Hickey
- grease 8y agoRich made some interesting points on developing libraries in such a manner that it doesn't introduce breaking changes (for the calling code). Does anyone here agree (or have counterpoints) to his suggested approach?
- bpicolo 8y agoThis is essentially the model the Go community is aiming to do with versioning standards. It's also the philosophy the linux kernel takes to e.g. syscalls. It's something a lot of libraries could learn from. Most users want to build software for the long term and tend to avoid upgrading libraries too often. Fwiw, this is a large part of Rich's Spec-ulation [0] talk. [0] https://www.youtube.com/watch?v=oyLBGkS5ICk https://www.youtube.com/watch?v=oyLBGkS5ICk
- sethev 8y agoI don't know the specifics of the Go standards but semantic versioning doesn't add anything if you don't break your consumers.
- tosh 8y agoAround 14:50 in Rich talks about breaking changes and mentions a library he worked on (codec) to track function changes (checksums, not semantically but still) instead of looking at a library as 'changed' as a whole. This makes a ton of sense. Knowing a set of functions I rely on did not change (at all) provides more peace of mind to me than just knowing the function signature is still compatible. Versioning (or at least understanding changes) on the function level in addition to the library level sounds so powerful to me that I wonder why this concept isn't more mainstream yet. Are there other examples? [edit: I found codec: https://github.com/Datomic/codeq#codeq https://github.com/Datomic/codeq#codeq]
- mkobit 8y agoIt sounds like the philosophy is "don't break your consumers", which I agree with. Somebody else already linked his Spec-ulation talk, but I think somewhere in there he compares the 10 minutes a library author spends on deprecating or removing some piece of code versus the 10 minutes each and every one of your consumers spends trying to determine why a dependency they put trust in broke their application. I do think it can be very difficult to know if you, as a producer, are breaking any consumers. I'd love to see some sort of OSS build tool and CI system that automatically rebuilds and tests all consumers of your library to give you, the library author, more information about the changes you make before releasing.
- guipsp 8y agoRust (core) uses the cargo ecosystem as tests
- puredanger 8y agoSimilar idea in ClojureScript: https://github.com/cljs-oss/canary https://github.com/cljs-oss/canary
- Naomarik 8y agoClojure has been the most stable ecosystem I've ever dealt with. Once you get into it it's not uncommon to see libraries that are years old that function perfectly. I'm not even scared to update clojure to the latest alpha builds because things just always work. There's also this to look at on the subject: https://lkml.org/lkml/2018/8/3/621 https://lkml.org/lkml/2018/8/3/621 Reddit discussion: https://www.reddit.com/r/linux/comments/95b1hf/linus_torvalds_on_regressions/ https://www.reddit.com/r/linux/comments/95b1hf/linus_torvald...
- kamaal 8y agoI imagine in case of a Kernel that should be like a rule beyond any scope of discussion. And may be for any piece of software that is at the bottom layers of any stack. You just can't break backwards compatibility. This was a big mistake Python 3 made.
- iwintermute 8y agoThat's why it's called Python 3 and not Python 2.x Think about it like totally new language
- deleted 8y ago[deleted]
- decebalus1 8y agoIf it's like totally a new language, it should be called TotallyNewython 1.0
- iwintermute 8y agoAlmostTotallyNewthon would be better, correct. Would shift discussion from 'upgrade' to 'migration' without all the usual cries. Other than that it's understandable that some architecture decisions from 1991 haven't aged well.
- Roboprog 8y ago
- girishso 8y agoElm goes a step further, it enforces semantic versioning. If the package has any breaking interface changes, it forces major version change.
- jeremiep 8y agoThat's not a step further, you lose the ability to use the latest version without code changes.
- girishso 8y agoWhich in any case you'd have to do in other languages. What Elm provides is a way for library users to decide whether to upgrade the library or not and more importantly not automatically upgrade to a library which needs code changes.
- puredanger 8y agoIf you just don't have breaking interface changes you never need a major version change.
- natbobc 8y agoI agree with the principle that you shouldn't arbitrarily change API's. I disagree if it is extended to being an unbreakable contract. There are specific scenarios where people should consider breaking changes most of which fall under some for of improving usability of the library; 1. improving/providing secure defaults. 2. reducing the API surface so that usage is more evident. 3. refactoring that eases maintenance. 4. improving performance where appropriate. 5. probably others I haven't thought of. In RFC style I would say it's a SHOULD rule rather than a MUST.
- puredanger 8y agoIn all of these cases you can add new functions without removing (and breaking) the old ones.
- natbobc 8y agoAgree in many cases you can do this however with point 2 the removal of a function(s) is literally the aim. The accretion of functions benefits legacy systems however its tradeoff is potential harm to users new and unfamiliar with the library. Accretion creates a cognitive overhead (even if only minor) for both the maintainer and new users. Maintainers when they return to code to update and modify behaviour. New users when they seek to understand the library through documentation, examples, and usage. I don't think it's coincidence that a number of languages and libraries acknowledge this by having "one correct way to do X". Using a concrete example relating to security; libressl maintained much of the API surface that OpenSSL provides. In essence they aimed to provide a "drop-in" replacement. However there were whole families of algorithms and functions which they deemed "unsafe/unfit" for purpose (e.g. FIPS algorithms). I think that's a perfectly valid exception to the rule. It acts as a canary in the coal mine and you have options; fix your code or defer upgrading. I would advocate for thoughtful deprecation cycles over ossification of poor APIs and algorithms.
- filoeleven 8y agoHe’s been thinking some really interesting thoughts about dependency management and libraries. It sounds like if he had his way, library versions might disappear entirely. From the interview: “But there are really two very distinct kinds of change - there are breaking changes, where your expectations have been violated, and there are accretions, where there's just some more stuff where there wasn't stuff before. And in general, accretion is not breaking.” To paraphrase stuff I’ve heard him talk about elsewhere, your library should never change a function to require more input or provide less output. If you decide to do that, call it something else and keep the old function around. He’s talked about function-level versioning too, touches on it here a bit. If I use library functions x y and z and the maintainers only broke (the contract for) functions a b and c, then I probably don’t care and can grab the latest version for its other new goodies. But that decision still requires me to read the library source or at least a changelog, even though it’s simple enough for the right tool to be able to report it to me. Spec looks like a step in that direction.
- tosh 8y agotranscript: https://www.case-podcast.org/20-problem-solving-and-clojure-19-with-rich-hickey/transcript https://www.case-podcast.org/20-problem-solving-and-clojure-...
- deleted 8y ago[deleted]
- btschaegg 8y agoNice, thanks for the link! :) Also: > That is the number one problem in programming - the time [thinking] is not spent, and people flounder around. That's a summary worthy to be framed if I ever heard one.
- kamaal 8y agoOn a tangential note, I'm learning Clojure and kind of just getting started on using it. I like it how its a Lisp, and ever since I've learned Common Lisp, I've been wanting to use Lisp at work for everyday projects, and Clojure seems to fit just perfectly well. As with these new things you are always excited to explore further and see what's about to come next. After searching, I was not able to find anything on the Clojure roadmap anywhere on the internet. I understand that Clojure is largely an Cathedral kind of an open source project, largely developed in private at Cognitect and released to the world. But it was still a little strange to not see anything on Clojure's future plans. Sometimes you also see the Clojure repo on Github go without commits for weeks, for example the last commit as of today is July 4, 2018. Which is like strange for a programming language of this size.
- tosh 8y agoClojure Spec is one of the newer developments in Clojure that is being worked on: https://clojure.org/about/spec https://clojure.org/about/spec On the ClojureScript side there is also a lot of movement. I follow https://twitter.com/mfikes https://twitter.com/mfikes on Twitter to get a heartbeat.
- mi_lk 8y agoI was just considering learning Clojure recently, what resources would you recommend?
- kamaal 8y agoIf you already know a little Lisp, The Joy of Clojure is a very good book to start at. But I went through a complete journey of reading ANSI Common Lisp, The Little Schemer, The Seasoned Schemer, On Lisp and various other scheme material on the internet. So syntax and other Lisp related stuff wasn't the problem. The Joy of Clojure book showed the Clojure way of doing things really well. If you have to start on absolute basics of Lisp, I'd recommend watching the SICP lectures and reading PG's ANSI Common Lisp book.
- Ocerge 8y agoClojure for the Brave and True by Daniel Higginbotham is a wonderful intro into the entire ecosystem (Leiningen, Clojure/lisps in general, Java interop, emacs, etc.). If you're already experienced with Lisps, you could probably start with The Joy of Clojure.
- tudelo 8y agoI'd be interested in clojure if I didn't have to use third party tools to set it up on windows, or if the process was documented so I don't have to.
- puredanger 8y agoStay tuned! Work in progress.
- jhck 8y agoI felt the same way when I first wanted to try the language (have to use Windows for work). I went to clojure.org only to find the message: Installation on Windows: Not yet available - see Leiningen or Boot instead. That was a disappointment to me, seeing as the language has been around for more than 10 years now. Also, when I went to try the Leiningen route I found that the installer wouldn't work on Windows 10: https://github.com/technomancy/leiningen/issues/2412 https://github.com/technomancy/leiningen/issues/2412 So I decided to try another language instead... But eventually I returned to Clojure and managed to get it up and running by using the fix that's suggested in the GitHub issue above. I'm really enjoying the language, but I fully agree that it can be frustrating to install on Windows.
- Fellshard 8y agoThe leiningen setup has been fairly stable, if still a bit obnoxious these days. It's a bit more difficult to get the supporting tools up than the language, in my opinion.
- ilikehurdles 8y agoThat's disappointing. I've been using clojure with windows 10 and didn't run into this problem, but I think I used https://scoop.sh/ https://scoop.sh/ to install it. I'm not really interested in the clj tool and deps.edn until it's gone through a few releases.
- puredanger 8y agoWe've done 13 releases of clj so far. It's pretty stable now.
- dudul 8y agoI'm not an expert in Clojure, I've played with it a little. I think it's one of the best designed languages I've ever seen - and I'm a static-type kind of guy :) However, I have the feeling that its popularity has been decreasing over the past few years. I very rarely see job descriptions mentioning it. Have people observed the same thing?
- fnordsensei 8y agoI have seen this mentioned once or twice before, and I'm scratching my head as to where this perception comes from. Maybe it's because of its position in the hype cycle? My personal impression is the opposite.
- dudul 8y agoInteresting. What do you think its position in "the hype cycle" currently is? No longer cutting-edge and therefor a little "boring"? I also think I saw that it ranked pretty low on various "popular languages" studies. I would be very happy to find out that I am mistaken TBH.
- puredanger 8y agoIt's achieved it's highest rankings ever on TIOBE this year. We have also seen record high numbers of Clojure language, ClojureScript language, and library artifact downloads this summer.
- nudpiedo 8y agoIf I look in LinkedIn I find more job offers for Clojure than golang. For some reasons other metrics do not apply, and I guess golang is more open source related than clojure which is more about building private services.
- puredanger 8y agoI don't think that characterization of use is true for either Go or Clojure.
- wongma 8y agoAny recommended resources for experienced developers on the OO side wanting to learn Clojure?
- DisownedWheat 8y agoClojure For The Brave And True is where I learnt Clojure and I can personally recommend it as a good read. It does start out slowly but the FP concepts can be a little tricky to grok coming from an OO background.
- how_to_bake 8y agoI really didn't enjoy the book when I read it in ~2014 I think. It's a pain to get set up with emacs and then it walks you through functional programs without introducing anything first. And it is indeed difficult to grok, especially because they are toy programs with zero real world value. In that sense, I'd compare it to Learn You A Haskell For Great Good, but with less context. This[0] is a better way to learn, in my opinion. Then after that, maybe check out Brian Will's videos[1]. Then definitely check out this helpful video on web dev[2]. There's a better video somewhere but I can't find it anymore. It's just a guy walking his friend through how to make an isomorphic clojure web app. Very nice pair programming walkthrough guide. But I guess it's forever gone. [0]: https://kimh.github.io/clojure-by-example/ https://kimh.github.io/clojure-by-example/ [1]: https://www.youtube.com/playlist?list=PLAC43CFB134E85266 https://www.youtube.com/playlist?list=PLAC43CFB134E85266 [2]: https://youtu.be/LcpbBth7FaQ https://youtu.be/LcpbBth7FaQ
- _emacsomancer_ 8y agoSide query: are there any good (or any) Lisp-related podcasts? (In the sense of the whole series being Lisp-related rather than a particular episode.)
- vijaykiran 8y agoIf you consider Clojure Lisp-related there's https://m.soundcloud.com/defn-771544745 https://m.soundcloud.com/defn-771544745 (disclaimer: I'm a co-host) and there is http://blog.cognitect.com/cognicast/ http://blog.cognitect.com/cognicast/ from Cognitect (the company that stewards Clojure)
- ballooney 8y agoTrivial asside: almost everyone on this site says ‘disclaimer’ when they mean ‘disclosure’ - unless it’s some cutesy humble tongue-in-cheek thing?
- vijaykiran 8y agoI tend to disown because we call the podcast _irreverant_ for a reason :)
- _emacsomancer_ 8y agoThanks! I had known (but forgotten) about the Cognitect one, but defn is new to me. I also came across (not a Lisp-devoted series admittedly) but an episode of another podcast which focusses on Racket [https://softwareengineeringdaily.com/2015/11/04/racket-with-matthew-flatt/ https://softwareengineeringdaily.com/2015/11/04/racket-with-...]. I haven't found any podcast series devoted to (Common) Lisp or Scheme so far though.