looking at Kotlin libs, I'm kinda frustrated that ...
# random
b
looking at Kotlin libs, I'm kinda frustrated that they try to add as many Kotlin language features as possible
a
why does that lead to frustration?
b
it's difficult to help coworkers adopt it
they first need to know all of the intricacies to understand what's happening
been taking a look at https://github.com/JetBrains/Exposed#sql-dsl and even I have a bit of trouble really grokking how it works at a first glance
a
And how would you expect libraries like exposed be??
b
close to the OOP we're used to from other languages with additional cherries on top to solve which use more advanced language features
t
the typesafe dsl is one of the selling points though, without that there would not really be a reason to use the library (I think)
b
agree, it's more like the combined package is too much
property delegation + DSL + infix functions for instance
DSL in particular is really hard to explain
that one requires you to understand extension functions + how the scope works
a
ahaaa, I think I understand you. in regards to the infix function, you can use it as regular (lowers the infix function skill)
b
spring sorta dice it nicely: you can use their traditional java builder APIs but they also give you neat extension functions and DSLs to opt in
in a way you pitch Kotlin as a better yet very similar option to Java that everyone can pick up quickly, then place them in front of the Kotlin parts that don't exist in Java and maybe not even in other popular languages (delegation)
t
I think it's different though, spring has to serve java as well. asking kotlin lib maintainer to fully support java syntax as well it's a toll ask. might make sense for adoption, but otoh in my experience you will end up not using the java-similar option
👆 2
for other libs that are only java, we usually end up implementing some more idiomatic kotlin wrapper ourselves
it definitely comes with "experience", we are doing spring-kotlin backend since 5+ years
b
indeed, I'm not complaining about Arrow or other libs, it's sort of more the core Kotlin stuff like Ktor, Coroutines or Expose
t
so I might be under-estimating the barrier for newcomers
b
as in: the barrier of entry of the "default" stack shouldn't be as high as it is right now
s
@Bernhard How satisfied are you with https://github.com/Ashampoo/kim in that regard? Coming from Java I try to use Kotlin to make the code as clear as possible, but not too fancy going overboard with complex language features.
b
@Stefan Oltmann perfectly fine, I see nothing that does not translate 1:1 from other languages in the usage description 🙂
👍 1
b
I don’t have much experience with Kotlin besides a single toy project, yet everything is easily understandable to me. IMO, the DSL in Kotlin has rules to it and makes sense unlike languages with AST macros.