off-topic

https://github.com/clojurians/community-development/blob/master/Code-of-Conduct.md Clojurians Slack Community Code of Conduct. Searchable message archives are at https://clojurians-log.clojureverse.org/
chucklehead 2021-02-20T03:08:20.001Z

Reading a https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7242027/ for completely non-Clojure reasons, when suddenly: > For this, we suggest usage of edn, a serialisation format with parsers available in most mainstream programming languages and then: > A short example written in Clojure is given in Listing 1.1 at which point I was so surprised I nearly missed this footnote at the end: > It would be sensible to define different standard formats for different formalisms. These can be automatically enforced in a CI pipeline, e.g., by Clojure Spec, before pull requests are accepted.

2021-02-20T12:12:16.002200Z

hi, i'm a total newbie here, wanna ask about does node.js and clojure could serve the same purpose?

borkdude 2021-02-20T12:15:48.003100Z

@adrianimanuel It depends on your use case. NodeJS is a JS environment and JS hasn't got threads, which the JVM has. Also the ecosystems are different: available libraries, etc.

borkdude 2021-02-20T12:16:30.003800Z

If you are familiar with NodeJS and you want to use "Clojure" then choosing ClojureScript is a natural choice (possibly with #shadow-cljs for better NPM interop?)

2021-02-20T12:16:56.004500Z

no i never use node.js

borkdude 2021-02-20T12:16:59.004600Z

But if you're more familiar with the JVM, then Clojure on the JVM is a better fit and possibly NodeJS isn't so interesting for you then

2021-02-20T12:17:17.004900Z

does nodejs more to front end?

borkdude 2021-02-20T12:17:44.005500Z

NodeJs is a server technology to run Js on backends.

borkdude 2021-02-20T12:18:21.005900Z

Somehow people loved Js so much that they also wanted to use it on the server / desktop. It's a miracle.

😂 8
2021-02-20T12:21:45.006700Z

guess i need to learn the fundamental first, difference between javascript and jvm

borkdude 2021-02-20T12:22:16.007100Z

A general recommendation: if you don't do front-end, just go with Clojure JVM and start learning from there

2021-02-20T12:23:10.007500Z

ahh okay, thanks so much for the advice

2021-02-20T18:33:34.009500Z

I'm getting the following error when making a POST request to a local server with http://java.net.http, but no such error with clj-http:

connection close, x-websocket-reject-reason Client must provide a value for Sec-WebSocket-Key.
Anyone know what setting might be causing this?

2021-02-20T18:37:26.009600Z

Immediately after asking this I guess it's obvious that the error message itself is telling me what header I need.

2021-02-20T18:43:22.009800Z

Now I'm just curious why a sever would require that key when I don't believe it's using websockets, and why the apache http client clj-http uses does include the websocket headers by default

2021-02-20T21:41:09.010100Z

Sounds like a badly configured server

2021-02-20T21:42:42.010300Z

I doubt clj-http is including that header, but clj-http be speaking http 1.x and the java http client may be trying http2(a wild guess) which might explain getting different behavior

2021-02-20T21:44:29.010500Z

The java http client can be configured to prefer http1 or 2, you could try changing that to see what happens

2021-02-20T22:12:29.010700Z

That did it, it was the version, thanks!