Clojupyter Logo

Like many programmers I fell in love with Clojure. Before I fell in love with Ruby and this framework Ruby on Rails, but when I worked in companies like a big corp , I encountered Rails apps with 0.2 million lines of code, having no test, thus practically unmaintainable, my boss was finding scapegoats to blame and was firing people. To mitigate the slow development speeds, a project that could have been done with 3 - 5 people had kind of 10+ developers, a dozen or so testers, and huge ops team! Yes that’s right. Ruby on Rails was supposed be a cost effective framework which few people could use to create great apps, but here they used lot of people to create a waste and muddled app.

I desperately wanted a maintainable code and I landed up on Clojure and I am learning it. One advantage of Clojure is, if you know it well, you can use ClojureScript instead of JavaScript. Framework like Ruby on Rails does not promise you out of the box that you can replace JavaScript, JavaScript an ill made up language that gives pain to developers, and hence should be eliminated.

I started with Clojure using Clojupyter that runs on Jupyter notebook, and it was very good. It’s like REPL on steroids. I installed it with conda, and it seems to work all well. Than I got this error all of a sudden:

[I 2022-01-25 10:21:54.017 LabApp] Build is up to date
[I 2022-01-25 10:21:57.063 ServerApp] Creating new notebook in
[I 2022-01-25 10:21:57.529 ServerApp] Kernel started: 271c0671-68c9-4ebc-b92d-9d8fe5b86837
[E 04:52:08.886 Clojupyter] c8r.messages -- Invalid message signature
[E 04:52:08.932 Clojupyter] c8r.util-actions --
                                        java.lang.Thread.run              Thread.java:  745
          java.util.concurrent.ThreadPoolExecutor$Worker.run  ThreadPoolExecutor.java:  617
           java.util.concurrent.ThreadPoolExecutor.runWorker  ThreadPoolExecutor.java: 1142
                                                         ...
                           clojure.core.async/thread-call/fn                async.clj:  443
                                     clojupyter.zmq/start/fn                  zmq.clj:  108
                                      clojure.core.async/>!!                async.clj:  143
     clojure.core.async.impl.channels.ManyToManyChannel/put!             channels.clj:  143
                    clojure.core.async.impl.channels/chan/fn             channels.clj:  300
                                      clojure.core/map/fn/fn                 core.clj: 2742
                                                         ...
clojupyter.util-actions/wrap-report-and-absorb-exceptions/fn         util_actions.clj:  239
                                          clojure.core/apply                 core.clj:  665
                                                         ...
                                        clojure.core/comp/fn                 core.clj: 2569
         clojupyter.kernel.core/wrap-skip-shutdown-tokens/fn                 core.clj:   83
                                        clojure.core/comp/fn                 core.clj: 2569
                                     clojure.core/partial/fn                 core.clj: 2624
                                                         ...
                 clojure.spec.test.alpha/spec-checking-fn/fn                alpha.clj:  142
                                                         ...
                       clojupyter.messages/fn/frames->jupmsg             messages.clj:  288
java.lang.Exception: Invalid message signature

[E 04:52:09.009 Clojupyter] c8r.util-actions --
                                        java.lang.Thread.run              Thread.java:  745
          java.util.concurrent.ThreadPoolExecutor$Worker.run  ThreadPoolExecutor.java:  617
           java.util.concurrent.ThreadPoolExecutor.runWorker  ThreadPoolExecutor.java: 1142
                                                         ...
                           clojure.core.async/thread-call/fn                async.clj:  443
                                     clojupyter.zmq/start/fn                  zmq.clj:  108
                                      clojure.core.async/>!!                async.clj:  143
     clojure.core.async.impl.channels.ManyToManyChannel/put!             channels.clj:  143
                    clojure.core.async.impl.channels/chan/fn             channels.clj:  300
                                      clojure.core/map/fn/fn                 core.clj: 2742
                                                         ...
clojupyter.util-actions/wrap-report-and-absorb-exceptions/fn         util_actions.clj:  239
                                          clojure.core/apply                 core.clj:  665
                                                         ...
                                        clojure.core/comp/fn                 core.clj: 2569
         clojupyter.kernel.core/wrap-skip-shutdown-tokens/fn                 core.clj:   83
                                        clojure.core/comp/fn                 core.clj: 2569
                                     clojure.core/partial/fn                 core.clj: 2624
                                                         ...
                 clojure.spec.test.alpha/spec-checking-fn/fn                alpha.clj:  142
                                                         ...
                       clojupyter.messages/fn/frames->jupmsg             messages.clj:  288
java.lang.Exception: Invalid message signature

Exception in thread "async-thread-macro-11" java.lang.AssertionError: Assert failed: handle-request - internal error (':shell_port' neq '')

It has been very long since I worked with Java and I couldn’t find head or tail of it. I asked it in ClojureVerse, none responded. I put it in Clojupyter github, and none responded. I was bit desperate, here was a language that seemed to be good, and it could harness the power of Jupyter, so learning could be fast, but I wasn’t getting enough help.

I am a Rubyist, the Ruby community is very good, you get response in your emails if you poat a problems, perhaps that’s not the case yet with Clojure community, that’s sad. I wish it improves.

Finally I used Clojupyter as library and it worked! I hope it doesnt’t screw up. First I got something like zeqomq error, but then when I did conda upgrade ipykernel, it got fixed. I got a help from this blog.

For now I am okay, but it would be great if clojure community is becomes more helpful in the future. Right now I feel barrier for entry into Clojure, despite the language’s simplicity is high.