6 ms·
Show HN: Farolero – Common Lisp style-conditions and restarts for Clojure
- suskeyhose 5y agofarolero is a full, thread-safe implementation of Common Lisp conditions and restarts for Clojure. Most of the other implementations are incomplete or fail in cases related to threading, or don't include a debugger. This implementation is full. I have plans to make an nrepl-integrated system debugger for integration with cider, although the existing debugger is quite good already. This library has just hit RC3, which includes a test suite adapted from ANSI-TEST, and is ready for release after a tiny bit more testing.
- fiddlerwoaroof 5y agoThis is pretty cool, conditions/restarts were one thing I always missed in my repl-driven workflow when writing Clojure. Now someone just needs to implement a reliable way to add/reload dependencies without restarting the REPL.
- harperlee 5y ago> Now someone just needs to implement a reliable way to add/reload dependencies without restarting the REPL. Alex Miller is working on this as an official clojure functionality, see the add-lib, add-lib2 and add-lib3 branches of deps.alpha. It's just brewing very slowly... hopefully with Tonsky now on board they are able to speed up this and other topics!
- nightwolf 5y agoDo you mean Fogus, or have I missed something?
- harperlee 5y agoYeah sorry; that would have been interesting, but fogus.
- fiddlerwoaroof 5y agoYeah, I’ve seen this work. It’s a bit annoying to me because the boot team basically solved this problem years ago too, but the Clojure core team seems to suffer from NIH syndrome. The other issue, though, is that I think the JVM and a couple of Clojure’s core design decisions are hampering the “everything is reloadable” workflow you get with Common Lisp: in CL, I can leave my REPL running for months and load five or six projects in parallel with no problem. In Clojure, I’ve found that I’m continuously restarting the REPL because things like protocol implementations are hard to reload cleanly.
- fiddlerwoaroof 5y agoAlso, ASDF makes the concept of a “project” a first class feature in the language: of the various Clojure tools around, only boot took this approach.
- NoahTheDuke 5y agoProtocols being tightly bound to their implementation in Java is a real bummer. Makes using them much more difficult and brittle than an equivalent CLOS-style system.
- lenkite 5y agoI believe it would help if you could add a paragraph giving a brief intro to what the condition system means and detailing the advantages of the system for folks who are familiar with Clojure but not with Common LISP.
- jnxx 5y agoHere is an introduction by Peter Seibel: http://www.gigamonkeys.com/book/beyond-exception-handling-conditions-and-restarts.html http://www.gigamonkeys.com/book/beyond-exception-handling-co... (it is a chapter from "Practical Common Lisp", an really excellent book!)
- phoe-krk 5y agoI'm glad to know that my condition system book is of some really concrete use; an independent implementation of CL-style conditions and control flow in Clojure is probably the best example I can imagine for that. Congratulations, and thank you!
- sglisp 5y agoI bought and read your book. Unfortunately it is long winded and poorly written, so I advise others not to spend time and money on it. Bit disappointed that it gets misleading treatment online, I was expecting a book by an expert, but I guess lesson learnt when making judgement based on what is written online - those who post more aren’t necessarily any expert in the field!
- phoe-krk 5y agoSure, please tell me more about it; I'd like to know what in particular can be fixed in it to make it better. I already know that you're dissatisfied with it and you're up for getting personal at me, but I think that I'll need more details to ensure that whatever is wrong with this edition of the book doesn't get replicated in the future.
- sglisp 5y agoYou need to write it a few more times so it is clearer. Also I’m sorry if this is harsh, but technical books should be written by experts who have taught the subject for many years and understand the best way to communicate the subject matter. Otherwise better leave it as a series of blog posts.
- phoe-krk 5y agoI don't understand the first sentence; do you mean writing it several times in succession and completely discarding all results but the last one, or more like an iterative process that actually looks back at what was written previously and improves upon that content? Also, I don't think I can really make use of the latter part; it implies that only people who have taught the subject for years are qualified for writing technical books, which - given that I am not a teacher and likely won't be one - gives the resulting vibe of "just give up" without any possible improvements. I can't make any use of that in order to improve my current or future writing.
- fookinel 5y agoHow well does it play with common java libraries?
- suskeyhose 5y agoThe unwinding mechanism that it uses extends from java.lang.Error, which means most catch blocks in Java code won't catch them, which means it should interact with Java libraries just fine in most cases.
- simplify 5y agoHow does this system compare to algebraic effects?
- moonchild 5y agoThese have also been implemented in pure java - https://github.com/phoe/cafe-latte/ https://github.com/phoe/cafe-latte/
- guenthert 5y agoQuite a feat! Now I like to see one in Python, which ought to be easier.