other-languages

here be heresies and things we have to use for work
cfleming 2016-05-28T00:58:19.001064Z

@martintrojer: Your articles are great BTW

đź‘Ť 1
cfleming 2016-05-28T00:59:04.001065Z

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

cfleming 2016-05-28T00:59:46.001066Z

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.

cfleming 2016-05-28T01:00:14.001067Z

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 🙂

cfleming 2016-05-28T01:00:30.001068Z

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

cfleming 2016-05-28T01:00:43.001069Z

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

cfleming 2016-05-28T01:00:52.001070Z

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

cfleming 2016-05-28T01:01:31.001071Z

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

cfleming 2016-05-28T01:04:25.001072Z

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

2016-05-28T01:05:03.001073Z

cfleming: why did you ping me?

cfleming 2016-05-28T01:05:06.001074Z

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

2016-05-28T01:05:27.001075Z

ah

2016-05-28T01:05:50.001076Z

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

cfleming 2016-05-28T01:05:51.001077Z

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

2016-05-28T01:05:54.001078Z

but neat i suppose

2016-05-28T01:06:31.001079Z

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

cfleming 2016-05-28T01:06:34.001080Z

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

2016-05-28T01:06:46.001081Z

"long time ago" ~ 3, 4 wks

2016-05-28T01:07:00.001082Z

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

2016-05-28T01:07:02.001083Z

which is shameful

cfleming 2016-05-28T01:07:07.001084Z

Hehe

cfleming 2016-05-28T01:07:23.001085Z

Anyway, sorry to ping you about jurassic era history 🙂

2016-05-28T01:07:27.001086Z

yeah whatever

2016-05-28T01:07:41.001087Z

wasn't being snotty i genuinely have a shitty memory

cfleming 2016-05-28T01:08:25.001088Z

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

2016-05-28T01:08:31.001089Z

hyuu

cfleming 2016-05-28T01:08:57.001090Z

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

2016-05-28T01:09:05.001092Z

beep boop

2016-05-28T01:09:16.001093Z

mine has only gained the ability to motor backwards

2016-05-28T01:09:24.001094Z

recently

2016-05-28T01:09:26.001095Z

forwards is soon

2016-05-28T01:09:34.001096Z

"toddler: it's another language"

seancorfield 2016-05-28T01:09:35.001097Z

@cfleming: Interesting approach to method call assistance.

cfleming 2016-05-28T01:10:03.001098Z

Yeah, it works pretty well.

cfleming 2016-05-28T01:10:23.001099Z

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

cfleming 2016-05-28T01:10:45.001100Z

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

seancorfield 2016-05-28T01:10:59.001101Z

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.

cfleming 2016-05-28T01:11:07.001102Z

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

seancorfield 2016-05-28T01:11:57.001103Z

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

seancorfield 2016-05-28T01:12:36.001104Z

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

seancorfield 2016-05-28T01:12:48.001105Z

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

2016-05-28T01:12:51.001106Z

yeah cider completion is dope

2016-05-28T01:13:10.001107Z

cute lil type annotations: <l> <f>

cfleming 2016-05-28T01:13:11.001108Z

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

cfleming 2016-05-28T01:13:57.001109Z

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

cfleming 2016-05-28T01:14:30.001110Z

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

seancorfield 2016-05-28T01:20:25.001111Z

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

cfleming 2016-05-28T01:20:42.001112Z

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

cfleming 2016-05-28T01:21:04.001113Z

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

cfleming 2016-05-28T01:21:41.001114Z

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.

cfleming 2016-05-28T01:22:01.001115Z

A lot better.

cfleming 2016-05-28T01:37:47.001116Z

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

cfleming 2016-05-28T01:38:02.001117Z

(rough proportion, I have more than 20 sadly)

seancorfield 2016-05-28T01:59:06.001118Z

How many NPEs get reported against Clojure projects I wonder?

seancorfield 2016-05-28T01:59:18.001119Z

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

cfleming 2016-05-28T01:59:52.001120Z

My experience says just as many in Clojure as with Java

cfleming 2016-05-28T02:00:17.001121Z

Why would you expect more in Java than in Clojure?

seancorfield 2016-05-28T02:33:50.001122Z

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

seancorfield 2016-05-28T02:34:24.001123Z

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

seancorfield 2016-05-28T02:34:43.001124Z

Ironically a NPE. In Java code.

cfleming 2016-05-28T03:11:07.001125Z

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

đź’Ż 1
cfleming 2016-05-28T03:11:44.001126Z

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.

cfleming 2016-05-28T03:13:29.001127Z

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