@martintrojer: Your articles are great BTW
@sveri: Sure, I’ve been converting most of the Java code in Cursive to Kotlin as I work on it (no point migrating working code that I don’t touch).
There are lots of things in Cursive that I don’t want to do in Clojure due to startup time - basically anything that’s eagerly loaded at startup.
I only want users to pay the startup time cost when they actually start doing something with Clojure - presumably at that point they’re used to it 🙂
I’m not there yet, a bunch of old decisions still haunting me, but that’s the goal.
So anything that gets eagerly loaded at startup is now Kotlin.
And the more I work in Kotlin, the less I miss Clojure.
@martintrojer: If you’re evaluating backend language options for your series and you need the JVM, Kotlin is the only sane choice IMO.
@seancorfield: @bvulpes: Re: the completion order thing, what Cursive does for interop is it lets you type (object .me|)
, and it will use the type of object
to complete .method
. Then when you select the completion it will swap to: (.method object |)
, where |
is the caret.
cfleming: why did you ping me?
If you had type information of some sort about the target of a (:keyword data)
call you could do the same.
ah
kinda don't really care about completion nearly so much as pre-runtime validation
@bvulpes: Sorry, I thought you were discussing the problems with prefix completion order with seancorfield. Just got invited here and am catching up.
but neat i suppose
mwell a long time ago there was a thread about compile time checking and maps came up
Sure, types help with both (pre-runtime validation and tool support)
"long time ago" ~ 3, 4 wks
i think my personal logs for these channels are longer than slacks
which is shameful
Hehe
Anyway, sorry to ping you about jurassic era history 🙂
yeah whatever
wasn't being snotty i genuinely have a shitty memory
Sure, no snottiness was interpreted - my memory is progressively more subject to cache invalidation too
hyuu
Combination of advancing age and lack of sleep due to a toddler
beep boop
mine has only gained the ability to motor backwards
recently
forwards is soon
"toddler: it's another language"
@cfleming: Interesting approach to method call assistance.
Yeah, it works pretty well.
Cursive will also try to help out if you don’t do that, again using all inferred types in the scope when you complete
And sometimes you don’t need to do that, if you’re doing (-> object .method)
or similar
I just can’t face IDEs any more tho’… I wanted one consistent editor across all my machines a few years ago and my little netbook just didn’t have enough power to run Eclipse or IntelliJ so I switched (back) to Emacs and there I’ve stayed ever since.
There are things you can do, but lack of types hurts a lot though.
IDO mode in Emacs seems to go a long way to helping… and CIDER seems to do some impressive assistance too...
I haven’t looked at Kotlin much. Seems nice but not different enough from Java or Scala to warrant the effort learning it.
What would be your "elevator pitch" for Kotlin in that context?
yeah cider completion is dope
cute lil type annotations: <l> <f>
“90% of the benefit of Scala with 10% of the complexity"
And what I’m finding recently “Perhaps 70% of the benefit of Clojure, but with types"
And it’s null-safe, which is huge.
It’s not really null-safe tho’… you can just use !!.
and it’ll still happily dereference null for you.
Sure, but I’ve never had to do that.
I mean, Haskell has unsafeIO too, but that doesn’t mean we should write off its focus on purity.
If the language helps you 99% of the time and gives you an escape hatch too, that’s better than just throwing your hands up.
A lot better.
Looking through my exception tracker, 19 of 20 exceptions are NPEs
(rough proportion, I have more than 20 sadly)
How many NPEs get reported against Clojure projects I wonder?
I’d expect lots of NPEs against Java code...
My experience says just as many in Clojure as with Java
Why would you expect more in Java than in Clojure?
Because idiomatic Clojure relies on nil-punning and so you’re less likely to get NPEs there.
(sorry for the slow response, was distracted by a bug report)
Ironically a NPE. In Java code.
The problem with nil-punning is that in my experience it just passes logic errors further into your code.
i.e. if you’re passing null where you’re not expecting to, and Clojure silently doesn’t throw an NPE, I’m not sure that’s a win since you’re hiding a problem.
It’s still a bug, you just don’t know about it.