Fork me on GitHub
#core-typed
<
2020-02-24
>
ambrosebs01:02:25

and fully automated maven release script to clojars. I'm in heaven. README even bumps versions https://github.com/typedclojure/typedclojure/commits/master

👌 4
jeroenvandijk08:02:37

I'm looking forward to copy that flow 🙂

👍 4
whilo10:02:16

regarding clj-kondo, i had also added datalog "type checking" to it, which was fairly straightforward: https://lambdaforge.io/2019/11/08/clj-kondo-datalog-support.html

whilo10:02:54

there has been done a lot of work to plug it into all kinds of clojure tooling, which would be very valuable to have for core.typed as well, i think. one problem i had with core.typed was to get it to run in this linting mode, i tried a few times with eastwood.

whilo10:02:38

i planned to collect some type system related information with @borkdude here, but have not yet found the time: https://github.com/borkdude/clj-kondo/wiki

whilo10:02:00

@ambrosebs what is your opinion on linear types? rust seems to get a lot of attention at the moment and i see the value of automatically tracking external resources (not necessarily GC collected memory) with the type system

borkdude10:02:40

recent addition to clj-kondo: return type inference:

$ clj-kondo --lint - <<< '(defn foo [] :foo) (inc (foo))'
<stdin>:1:25: error: Expected: number, received: keyword.
linting took 9ms, errors: 1, warnings: 0

👍 12
ambrosebs13:02:06

@borkdude nice! what's the idea behind determining the return type? do you do it in advance or wait until you know the type of args?

borkdude15:02:42

@ambrosebs clj-kondo will try to figure out the return type of a function while it's going through the AST. if that function is then used and the expected argument type does not match with what the function returns, clj-kondo will emit a warning

👍 4
rickmoynihan09:02:29

Are you planning to flow these types at all, or is that out of scope just now? e.g.

$ clj-kondo --lint - <<< '(defn foo [] :foo) (let [a (foo)] (inc a))'
linting took 10ms, errors: 0, warnings: 0

rickmoynihan09:02:51

This is great btw; I had no idea kondo was doing this stuff yet… just upgraded!

borkdude09:02:26

That is supposed to work, but I'm not sure why it doesn't in this case. I'll make an issue for it.

borkdude11:02:47

@U06HHF230 Fixed it. Are you running linux or mac?

borkdude11:02:58

It was a minor glitch.

rickmoynihan12:02:52

wow that was quick

rickmoynihan12:02:00

can I brew upgrade?

rickmoynihan12:02:37

hmm looks like I can’t

borkdude12:02:02

It’s not released yet.

rickmoynihan12:02:17

ahh no worries 🙂

rickmoynihan15:02:50

Upgraded:

$ clj-kondo --lint - <<< '(defn foo [] :foo) (let [a (foo)] (inc a))'
<stdin>:1:40: error: Expected: number, received: keyword.
linting took 47ms, errors: 1, warnings: 0
:thumbsup:

ambrosebs23:02:44

1.0.4-1.0.6 don't exist