This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-18
Channels
- # announcements (22)
- # asami (7)
- # babashka (43)
- # beginners (68)
- # biff (2)
- # calva (10)
- # clj-kondo (7)
- # cljdoc (29)
- # clojure (41)
- # clojure-austin (1)
- # clojure-brasil (2)
- # clojure-europe (25)
- # clojure-gamedev (3)
- # clojure-nl (2)
- # clojure-norway (9)
- # clojure-uk (31)
- # clojurescript (3)
- # community-development (7)
- # cursive (3)
- # data-science (4)
- # datomic (17)
- # emacs (30)
- # honeysql (10)
- # hyperfiddle (39)
- # introduce-yourself (1)
- # jobs-discuss (5)
- # kaocha (1)
- # lsp (11)
- # malli (12)
- # pathom (18)
- # pedestal (3)
- # proletarian (2)
- # quil (11)
- # rdf (46)
- # reitit (8)
- # releases (2)
- # shadow-cljs (34)
- # sql (3)
- # squint (10)
- # tools-deps (24)
- # xtdb (10)
what's the most used framework these days for the web services swiss army knife, where you have to compose several REST calls, and create REST apis out of those responses
Those aren't frameworks though. Pedestal is commonly suggested in such cases. There's also Biff but I have never read anything about it myself. And Fulcro but it's more for full-stack apps rather than just for the backend. But also, you might not need a framework at all. What you describe is quite trivial and is possible to build using Ring with any HTTP server and maybe a routing library (the aforementioned Reitit being one of them).
> where you have to compose several REST calls, and create REST apis out of those responses So, some sort of middleman? That might be less of a common case, as you'd have to deal with failure and concurrency e.g. what happens if you want to compose two calls to two APIs and one of them fails, or times out, or is a touch slower than expected Web 'frameworks' don't have an opinion for such concerns, although the Pedestal/Reitit interceptor design pattern might be 'stretched' to help with that.
I did a commercial Clojure project last year that composed several API calls to create another. I used http-kit as the server, with reitit (reitit-ring) to manage requests (routing, middleware, content negotiation, validation, etc.) and http-kit client to call out to other APIs. Swagger (openapi) was used to generate documentation from the Clojure API code
TL;DR: It’s Xiana by Flexiana, maybe? On the other hand; I don’t think there is a much choice if we intentionally filtering options with framework. I am writing one, but not for Clojure, it’s in JS ecosystem, in ClojureScript. Flexiana is still developing one, I believe. As you fellow Clojurians know, a Framework is a complex piece of software made with one beautiful, elegant, elusive idea. It’s a huge gap and lot’s of choices have to be made in order to develop one. We all benefit the already written libraries to fulfil our real-world needs. We compose them to solve real-world problems. As a former member of a good initiative in order to solve this gap in the industry, I believe so many odds have to align in front of us if we want to create one, beyond just a bunch of bad written wrappers and naive partial functions around the libraries. I’m hoping to see more projects that aims the be a good Framework for our beloved community. And I’m hoping to release a beta version of my naive project soon, if I’m getting any help financially, or a job/project.
Aleph. Aleph is built on Netty -- a client and server in one -- and has a beautiful, cohesive, superb async arrangement (including errors and exceptions) via Manifold.
But also, forgot to mention - these exact discussions appear in this very channel once a month. Should be easy to find.
thanks for the suggestions, I'll take a look at them... and yeah this is one of the typical service broker type servers I need to put together, service on one side, client on the other
How often do you guys pull out Clojure core.async these days? What do you like to use it for?
I haven't pulled it out in a while because most of my work lately has had a parallelism framework based on thread pools and executors, or I've done data parallelism with reducers. I really liked working with it for the CSP functionality when I wrote discljord though.
(I say directly, because a couple of libraries I used in the past effectively required using core.async with them)
I had a ball with https://tilton.medium.com/backpressure-99501f23881f. Highly recommended.
but using promesa in js land and native java queues w/ v threads make it...not obsolete but certainly required in fewer scenarios
If it was distributed, that would probably help with all my queueing problems, otherwise I just use j.u.c.*Queue
directly. Luckily I don't have to touch JS that much
I don’t use it a ton, but for some things, like ETL type jobs or bulk file processing it works great as one of my go-tos.
It's great for software that should be clj/cljs compatible. And it's great, in either clj or cljs, if its algebra significantly unburdens your program.
How to not include nil in an array? I have a [for ... (when-not ...)]
but the when-not outputs a nil in the array.
I think the solution would be to filter out the collections used in the for loop instead of within
There's no :when-not?
(for [x (range 5)]
(when-not (odd? x) "\uD83D\uDC4D"))
; => ("👍" nil "👍" nil "👍")
(for [x (range 5)
:when (not (odd? x))]
"\uD83D\uDC4D")
; => ("👍" "👍" "👍")
also, what I had is not really what you'd want if you'd want to process false
values as well.
(for [x [1 2 nil true false]
:when (some? x)]
x)
(1 2 true false)
Thanks!
user> (filter identity [1 2 nil 4])
(1 2 4)
Hello. Can I ask a question here? The jdbc.postgresql driver says that it is pure-java and platform independent: PostgreSQL® JDBC Driver (pgJDBC for short) allows Java programs to connect to a PostgreSQL® database using standard, database independent Java code. Is an open source JDBC driver written in Pure Java (Type 4), and communicates in the PostgreSQL® native network protocol. Because of this, the driver is platform independent; once compiled, the driver can be used on any system. This looks great. So I put my clojure app inside a docker container, and the jdbc posgresql fails: org.postgresql.util.PSQLException: ERROR: could not load library "/usr/lib/postgresql/13/lib/llvmjit.so": /lib/x86_64- linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libz3.so.4) Isn't the JDBC driver supposed to be pure java? Why is it trying to look up some non-java shared library?
this is #C03S1KBA2 for discussing clojure. the jdbc postgres driver isn't part of clojure. there is #C1Q164V29 were this might be notionally more on topic, but even there you will find users of the postgres jdbc driver, not the people who wrote it.
the postgresql jdbc driver is a product of the postgres project, I know they have some mailing lists, not sure where else they hang out
it is surprising that the jdbc driver would want llvmjit though, are you sure you aren't using some kind of embedded postgres thing so you are running the client and server in the same process?
What container version are you using? I had glibc issues with Amazon Linux images - even if JDBC driver is pure Java, your JVM isn’t. Can you try using a different image?
Openjdk for sure doesn't use llvmjit, and definitely doesn't look for such libraries on paths that have "postgresql" in them
My reading of that error is the library can’t be loaded because of glibc version issues not that it doesn’t exist? Although I don’t understand why a native lib is being loaded in first place.
It turns out that the error was on the server side, I was confused because I saw the error on the client. Thanks everyone for all the replies and sorry for the noise.