Fork me on GitHub
#announcements
<
2021-10-12
>
mauricio.szabo02:10:19

So, years ago I made a project as a joke. But then, a friend started to work with Ruby and was missing Clojure libs. So I decided to see how far the two languages can co-exist: presenting Clojuby: https://gitlab.com/mauricioszabo/clojuby It's quite alpha, quite new, and probably will change the API, but it kinda works (even with Rails)! Your app needs to run on JRuby, but other than that almost everything you can do in Ruby is supported!

🚀 5
💎 1
🌹 1
🤯 2
mauricio.szabo02:10:59

I also made a test playground for Rails here, querying things from ActiveRecord and rendering with hiccup (oh my!): https://gitlab.com/mauricioszabo/clojuby-on-clails-example

Carsten Behring07:10:32

When it becomes more stable, maybe we can add it here: https://github.com/behrica/clj-py-r-template PRs welcome

plexus07:10:21

Fun fact, http://lambdaisland.com has been using JRuby since 2016 to run the Kramdown markdown parser

👀 2
mauricio.szabo21:10:11

@U7CAHM72M sure! To be honest, I'm not sure where to go with this library (I mean, originally it was supposed to be a joke, so it's already way past what I originally intended 😄). I talked with some people that miss some Clojure killer libs like Malli, Pathom, Clara-Rules, Datalog dbs, etc and it seems that a good fit would be to slowly replace a Rails app running at JRuby with fragments in Clojure (you can hook into some controllers and add make it respond to a Clojure code instead, Ruby being as dynamic as it is) so that's one of the possibilities. It's still quite lacking on interop (you have to use rb/send or rb/eval to evaluate things) and some patterns still don't work well (for example, Rails' params don't map to Clojure maps) but it's a start!

Jakub Holý12:10:45

defdecoratorhttps://gist.github.com/holyjak/81c6e439192da00c8106cc3ce960b8f0#file-defdecorator-clj-L63 (wrappers) for Java interfaces. Example output (elided):

(binding [*print-meta* true] (prn (macroexpand-1 '(defdecorator WrappedConnection java.sql.Connection))))
; =>
  (deftype WrappedConnection [^java.sql.Connection target]
    java.sql.Connection
    (abort [_ arg0] (. target abort arg0))
    (beginRequest [_] (. target beginRequest))
    ...
    ;; the following are type hinted due to overloaded arities:
    (^java.sql.PreparedStatement prepareStatement [_ ^java.lang.String arg0 ^int arg1] (. target prepareStatement arg0 arg1))
    (^java.sql.PreparedStatement prepareStatement [_ ^java.lang.String arg0 ^ints arg1] (. target prepareStatement arg0 arg1))
    (^java.sql.PreparedStatement prepareStatement [_ ^java.lang.String arg0 ^\"[Ljava.lang.String;\" arg1] (. target prepareStatement arg0 arg1))
    ...
    java.sql.Wrapper
    (isWrapperFor [_ arg0] (. target isWrapperFor arg0))
    (unwrap [_ arg0] (. target unwrap arg0)))

🙂 3
catjam 1
1
😎 2
tengstrand20:10:23

I’ve just released https://github.com/polyfy/polylith/releases/tag/v0.2.13-alpha of the poly tool. The highlights are: • A new user friendly shell command with support for history and auto-complete. • The poly tool documentation is improved and has moved to https://polylith.gitbook.io/poly. • We have switched to tools.build, thanks to @seancorfield’s excellent PR.

polylith 21
🎉 10
clojure-spin 8
💯 4