I wrote about this a bit on the ML recently:
https://groups.google.com/d/msg/clojure/Dxk-rCVL5Ss/NqF-Na9ABQAJ

TL;DR - you really need types for this, and it's very difficult to add
types to a Clojure-like language without losing what makes it Clojure. In
particular, if you want to maintain Java interop then the type system
becomes very, very complex.

I'm in a similar boat - I would trade types, spec etc for just the
null-safety feature. The only way I could think of to create essentially a
two-type system (nullable and non-nullable) would be using a naming
convention - var% accepts nulls and var doesn't or something like that. But
you still need to know which functions can return null and so on, you'd
need to use a similar :key/:key% convention for map access - it's far from
trivial, and I haven't thought it through properly.

One thing I'm becoming increasingly convinced of - my null problems aren't
due to interop. I've paid attention to the last couple of NPEs I've fixed,
and they're generally just common or garden bugs that types would catch.
Cursive is probably unusual in the large input space it deals with (all
code that anyone might write anywhere, in any state of brokenness while the
user is editing) and the code is very complex - that seems to be what
provokes the bugs.

On 31 December 2016 at 12:19, James Reeves <ja...@booleanknot.com> wrote:

> Well, if you use Typed Clojure you get static null checking. Clojure spec
> can give you dynamic null checking you can turn on during development and
> turn off during production. There's also Spectrum, which statically checks
> Clojure spec, but obviously it can't handle all eventualities.
>
> - James
>
>
>
> On 30 Dec 2016 8:53 p.m., "gvim" <gvi...@gmail.com> wrote:
>
> On 30/12/2016 19:19, James Reeves wrote:
>
>> Well, Kotlin is statically typed, and Clojure is dynamically typed. Null
>> checking on dynamically typed languages is hard (impossible?) to achieve
>> without impacting performance.
>>
>> - James
>>
>>
> Personally, I'd trade the whole of clojure.spec & core.typed for this
> feature of Kotlin.
>
>
> gvim
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to