Fork me on GitHub
#other-languages
<
2016-05-28
>
cfleming00:05:19

@martintrojer: Your articles are great BTW

cfleming00:05:04

@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).

cfleming00:05:46

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.

cfleming01:05:14

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 🙂

cfleming01:05:30

I’m not there yet, a bunch of old decisions still haunting me, but that’s the goal.

cfleming01:05:43

So anything that gets eagerly loaded at startup is now Kotlin.

cfleming01:05:52

And the more I work in Kotlin, the less I miss Clojure.

cfleming01:05:31

@martintrojer: If you’re evaluating backend language options for your series and you need the JVM, Kotlin is the only sane choice IMO.

cfleming01:05:25

@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.

bvulpes01:05:03

cfleming: why did you ping me?

cfleming01:05:06

If you had type information of some sort about the target of a (:keyword data) call you could do the same.

bvulpes01:05:50

kinda don't really care about completion nearly so much as pre-runtime validation

cfleming01:05:51

@bvulpes: Sorry, I thought you were discussing the problems with prefix completion order with seancorfield. Just got invited here and am catching up.

bvulpes01:05:54

but neat i suppose

bvulpes01:05:31

mwell a long time ago there was a thread about compile time checking and maps came up

cfleming01:05:34

Sure, types help with both (pre-runtime validation and tool support)

bvulpes01:05:46

"long time ago" ~ 3, 4 wks

bvulpes01:05:00

i think my personal logs for these channels are longer than slacks

bvulpes01:05:02

which is shameful

cfleming01:05:23

Anyway, sorry to ping you about jurassic era history 🙂

bvulpes01:05:27

yeah whatever

bvulpes01:05:41

wasn't being snotty i genuinely have a shitty memory

cfleming01:05:25

Sure, no snottiness was interpreted - my memory is progressively more subject to cache invalidation too

cfleming01:05:57

Combination of advancing age and lack of sleep due to a toddler

bvulpes01:05:16

mine has only gained the ability to motor backwards

bvulpes01:05:26

forwards is soon

bvulpes01:05:34

"toddler: it's another language"

seancorfield01:05:35

@cfleming: Interesting approach to method call assistance.

cfleming01:05:03

Yeah, it works pretty well.

cfleming01:05:23

Cursive will also try to help out if you don’t do that, again using all inferred types in the scope when you complete

cfleming01:05:45

And sometimes you don’t need to do that, if you’re doing (-> object .method) or similar

seancorfield01:05:59

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.

cfleming01:05:07

There are things you can do, but lack of types hurts a lot though.

seancorfield01:05:57

IDO mode in Emacs seems to go a long way to helping… and CIDER seems to do some impressive assistance too...

seancorfield01:05:36

I haven’t looked at Kotlin much. Seems nice but not different enough from Java or Scala to warrant the effort learning it.

seancorfield01:05:48

What would be your "elevator pitch" for Kotlin in that context?

bvulpes01:05:51

yeah cider completion is dope

bvulpes01:05:10

cute lil type annotations: <l> <f>

cfleming01:05:11

“90% of the benefit of Scala with 10% of the complexity"

cfleming01:05:57

And what I’m finding recently “Perhaps 70% of the benefit of Clojure, but with types"

cfleming01:05:30

And it’s null-safe, which is huge.

seancorfield01:05:25

It’s not really null-safe tho’… you can just use !!. and it’ll still happily dereference null for you.

cfleming01:05:42

Sure, but I’ve never had to do that.

cfleming01:05:04

I mean, Haskell has unsafeIO too, but that doesn’t mean we should write off its focus on purity.

cfleming01:05:41

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.

cfleming01:05:01

A lot better.

cfleming01:05:47

Looking through my exception tracker, 19 of 20 exceptions are NPEs

cfleming01:05:02

(rough proportion, I have more than 20 sadly)

seancorfield01:05:06

How many NPEs get reported against Clojure projects I wonder?

seancorfield01:05:18

I’d expect lots of NPEs against Java code...

cfleming01:05:52

My experience says just as many in Clojure as with Java

cfleming02:05:17

Why would you expect more in Java than in Clojure?

seancorfield02:05:50

Because idiomatic Clojure relies on nil-punning and so you’re less likely to get NPEs there.

seancorfield02:05:24

(sorry for the slow response, was distracted by a bug report)

seancorfield02:05:43

Ironically a NPE. In Java code.

cfleming03:05:07

The problem with nil-punning is that in my experience it just passes logic errors further into your code.

cfleming03:05:44

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.

cfleming03:05:29

It’s still a bug, you just don’t know about it.