Fork me on GitHub
#clojure-europe
<
2020-12-09
>
dharrigan07:12:56

Good Morning!

orestis07:12:27

I haven’t learned a new language for some time now (after Clojure, who cares, right?) - but now I got the itch again. I don’t have time to go into elaborate type systems so I was thinking some small, fast and dynamic language like Lua, probably with Fennel on top. Are there any other worthy contenders in that space?

orestis07:12:08

(If I had time for type systems I’d probably look into Ocaml once more)

plexus07:12:48

Good morning!

plexus07:12:46

If I would pick up another language again it would probably be OCaml or Rust, but it seems that OCaml doesn't have nearly the kind of ecosystem we're used to, and I don't have enough of a use case for systems programming at the moment to learn Rust

plexus07:12:13

Maybe I will end up learning Rust just to target wasm

simongray08:12:11

good morning

hkjels08:12:14

Good morning! I would have tried Unison or Elixir. I think some of the ideas there would be worth exploring in Clojure

orestis08:12:38

I don’t think I have the energy to go into Rust at this point, perhaps when I have a compelling use case and some more proper sleep 😅

simongray08:12:25

I currently have no interest in making the kind of low-level Code that Rust is used for. I do see the appeal of Rust as a C-replacement, though. Elixir (or Erlang) are probably at the top of my list too. I saw one talk about Unison and it sounded interesting, but I’ll wait until it’s more mature. Also, I think I would experience Heroin-like withdrawal symptoms having to move away from Lisp syntax for a longer period of time, so that’s one reason why I’m sticking with Clojure.

orestis08:12:28

I know Elixir already, and Unison seems experimental still...

orestis08:12:06

What’s the point of wasm? I see a lot of noise about it but not enough examples of successful applications.

plexus08:12:23

I think it makes sense, the web is already being used as an application delivery platform, but the compile target is a (glorified) scripting language. If you're really just using the browser as a VM that people can load applications into, then you might as well expose a low level compile target.

plexus08:12:22

(but I'll stick with clojurescript for the time being thank you very much)

dharrigan08:12:25

I am tempted to have a looksee at Elixir these holidays

dharrigan08:12:07

If you want to stick within the JVM ecosystem, I also can recommend Kotlin. I use it daily too (although minimally now, as I'm mostly focused on Clojure) 🙂

mpenet10:12:06

Fennel is fun

mpenet10:12:37

If you are language curious and want something usable for scripting

borkdude10:12:24

If I would invest in a new language, it would probably be Rust or Go, so I am more proficient in writing pods for babashka. Which has an immediate reward and connection to my Clojure work.

borkdude10:12:54

With my limited Rust knowledge, I already made this: https://github.com/babashka/pod-babashka-filewatcher

borkdude10:12:22

The free Rust book is actually good.

borkdude10:12:16

Btw, I'm now experimenting with something:

$ bb "(babashka.deps/clojure '{:deps {medley/medley {:mvn/version \"1.3.0\"}}})"
Clojure 1.10.2-alpha2
user=> (require '[medley.core])
nil
user=>
Maybe this will make it easier to run Clojure in some contexts. E.g. merge deps.edn maps yourself and then start the JVM from bb.

3
ordnungswidrig10:12:23

It’s interesting how you can pick up a new language when you need it to solve your problem. I had used this new MacOS language (Swift?!) to create camera device watcher which would run a script whenever my webcam would turn on. This required even hacking into some undocumented OS calls and stuff like that. But I was able to pull that of with the help of google, copy and paste, and some critical thinking. I still have no clue about that language besides that XCode was super helpful in using it. 😛

ordnungswidrig10:12:03

A little bit like lein trampoline?

ordnungswidrig10:12:16

or actually the non-trampoline bootstrapping by lein?

borkdude10:12:28

just make your own deps.edn data using scripting and then invoke tools.deps. a workaround for some of the limitations. also works cross platform, without additional installs but java

pez11:12:46

Them Swift Playgrounds ❤️

synthomat11:12:17

g’day, g’day

synthomat11:12:58

is it actually common to provide a repl in a running production app for administrative tasks?

synthomat11:12:06

I’m wondering what’s the best approach to fire some ad-hoc commands from cli to change the application state; embed a nrepl?

dharrigan11:12:27

I have, in the past, launched a repl on application startup, but only bound to the loopback address, on a specific port. Then, if I need to connect, I'll do a ssh port forward to connect the streams.

👌 9
dharrigan11:12:08

it worked very well

javahippie12:12:08

I’m feeling a little guilty, because my team bought me a Haskell book as farewell present, and I don’t really know when to get into it, not a good time right now to learn Haskell :thinking_face:

borkdude12:12:59

@javahippie Maybe your team just didn't know you that well and that's the reason you left? ;))

javahippie12:12:44

That would’ve been super-subconscious, the team was great 🙂 And they also gave me a bottle of good scotch, so they know me, in general 😄

javahippie12:12:23

Maybe both gifts have to be used together, I don’t know. Is anybody here with experience in Haskell, what’s your opinion on it?

borkdude12:12:06

I have dabbled with Haskell for a few years and even made a small app that's running on a server: https://github.com/borkdude/balcony-hs But right now I think I could have done this with babashka as well and save a couple of months time of learning about category theory ;)

borkdude12:12:32

It's interesting from an intellectual perspective, but from a software production perspective, I'm staying with Clojure.

borkdude12:12:29

@otfrom You have or had an author of a Haskell book at MastodonC right? When she was interviewed on a podcast, I wondered about her perspective on Haskell / Clojure and production software.

otfrom20:12:59

Elise is really good at using the right tool for the right job and good at learning new ones

javahippie12:12:15

That’s what’s keeping me back. The whole community has this intellectual mathematical aura built around them, and I am just not really interested in that. But maybe I need to drop prejudice and just get to the book over the holidays

borkdude12:12:34

It has a mathematical elegance to it, and your software will be rock solid from a refactoring perspective, but that's also the drawback: making your code rock solid comes with more investment up front.

borkdude12:12:06

And the typical software I write doesn't require or justify that investment.

javahippie12:12:30

Thanks a lot for the perspective!

borkdude12:12:55

@javahippie "Effective programs - 10 years of Clojure" is a nice talk to watch in this context.

borkdude12:12:27

Obviously it's biased from the perspective of Clojure

javahippie12:12:39

The one by Rich? That’s one of him I have not seen, yet, bookmarked! Thanks

borkdude12:12:46

It's always good to find out your own perspective on it, by also watching the other arguments and communities.

borkdude12:12:42

@javahippie So what is your next endeavour if you're able to share it?

javahippie12:12:15

I’m founding my own company right now. In the beginning I will continue doing consulting gigs to get a little money into the company, but the goal is to create and sell / rent software in the next two years and quit the java-consulting-madness. I hope that I can hire the first Clojure developer in late spring / early summer 🙂

🍾 6
9
👏 3
RAMart14:12:00

All the best! If I can be of any help, just let me know. (Founded my company 20 years ago and went through ups and downs. Happy to share the lessons learned.)

❤️ 3
javahippie12:12:37

Thank you! But nothing really happened, yet, currently it’s only plans 😉

borkdude12:12:53

Taking a decision like that is worth congrats anyway

javahippie12:12:45

And that’s another reason why learning Haskell is not that high on the priority list 😄

borkdude12:12:10

The book isn't going anywhere and so isn't Haskell (I didn't mean that insulting to Haskell, haha)

😁 3
orestis15:12:24

@borkdude I was actually curious about your work on babashka/sci — do you actively use it in your day job?

borkdude15:12:52

We are using babashka in our dev setup as a Clojure launcher and I'm planning on using it to work around this problem: https://ask.clojure.org/index.php/9849/teams-common-dependencies-tooling-across-multiple-projects I don't want to force any of my tools upon anyone, so I'm mostly using it for my own purposes, clj-kondo as well

borkdude15:12:05

Any significant bash script that I will have to touch will probably be re-written to babashka on a case by case basis, now that it is a part of our workflow

borkdude15:12:44

I think one or two of my colleagues are using clj-kondo without maybe realizing it, via Calva. Other colleagues are using it consciously, but we're not yet enforcing anything on CI. It has been discussed, just haven't gotten around to it. I personally do use a git commit hook to enforce lint-free code on anything that I touch.

borkdude22:12:15

Basically yes, with maybe a project-specific variation here and there

slipset17:12:29

With all the fuzz around github sponsorships happening, I’m really reluctant to say this, but we’ve switched from Eastwood to clj-kondo at work.

slipset17:12:23

Reason number one was that Eastwood was the limiting factor when it came to build-times, couldn’t get it under six minutes. clj-kondo does the job in under a minute.

slipset17:12:09

A reason that would be the killer argument now, which I was not aware of at the time is the emacs integration. It rocks!

slipset17:12:48

Also, the configurability which makes it possible to gradually make the linting more strict is super helpful when retrofitting clj-kondo onto an existing codebase.

slipset17:12:33

{:linters {:unused-binding {:exclude-destructured-as true}
           :unused-private-var {:level :warning
                                :exclude
                                #{
                                  ;; used by `ardoq.utils` through var
                                  ;; dereferencing to avoid circular
                                  ;; deps
                                  ardoq.schemas/camelize-keys
                                  }}
           :consistent-alias {:aliases {ardoq.utils util
                                        ardoq.utils.request-utils request-util}}
           :unresolved-symbol {:level :error}
           :refer-all {:level :warning
                       :exclude #{clojure.test ardoq.schemas}}}
 :lint-as {liberator.core/defresource clojure.core/defn
           ardoq.test.api/deftest clojure.test/deftest}}

slipset17:12:46

This is our config.

borkdude18:12:51

@slipset Awesome. I would be happy to have you on board as contributor to clj-kondo.

slipset18:12:50

I will contribute when I get an itch I need to scratch. As for now, it’s working just as I want it to. I think.

slipset18:12:56

Problem du jour is that stock circle-ci docker images don’t have /usr/share/dict/words and so aleph doesn’t build on circle-ci 😕

slipset18:12:47

sudo apt-get install wbritish

borkdude18:12:02

why does aleph need that?

slipset18:12:12

I guess it wants some words to play with.

slipset18:12:55

all of ztellmans aleph libs are now up and running in circle ci 🙂

6
genRaiy19:12:10

talking of kondo ... deftest/testing ... linter is saying I'm referring it and not using it but I am ... so what am I holding wrong? (All tests pass so the test framework thinks its OK)

picard-facepalm 3
genRaiy19:12:13

correction ... it's correct 🙂

val_waeselynck21:12:13

Am I evil for doing this?

val_waeselynck21:12:52

(defmacro evaled
  "Compiles an expression into its evaluation (which is hopefully a data structure, effectively hard-coding it).
  Can be useful for CLJS performance,
  as the computation is done statically at macro-expansion time,
  and the dependencies of the computation (e.g the Vars it uses)
  won't be used by the emitted CLJS code, giving opportunities for minification."
  [expr]
  #?(:clj `'~(eval expr)))


(comment

  (macroexpand-1
    `(evaled (filter even? (range 10))))
  => (quote (0 2 4 6 8))


  *e)

dominicm22:12:12

Does #= work in cljs?

dominicm22:12:08

#= is not supported in cljs :(

dominicm22:12:18

cljs.user=> #=(clojure.core/inc 1)
2
I lied, you just gotta be fully qualified.

dominicm22:12:32

cljs.user=> #=(quote (clojure.core/filter clojure.core/even? (clojure.core/range 10)))
(0 2 4 6 8)

val_waeselynck22:12:09

Ah didn't know that, thanks

dominicm22:12:06

I mean, both are evil. :)

val_waeselynck23:12:13

I'm willing to dirty for efficiency 😉 the spirits will forgive me

3