News for hackers. Stuff that matters.
Re:Clojure's core.typed vs Haskell by adambard on Monday September 30, 2013 @12:22PM (#6470429)
Really, the post is about Clojure; these toy problems represent the breadth of my experience with Haskell, so I'm not really qualified to go into more depth. Certainly Haskell is said to have the most powerful type system going, and I don't see any (mainstream-ish) language displacing it any time soon.

Still, I think core.typed does pretty damn well for being a standalone library.

Re:Clojure's core.typed vs Haskell by acomar on Monday September 30, 2013 @12:30PM (#6470485)
> Certainly Haskell is said to have the most powerful type system going,

Nah, Coq, Agda, Idris and any dependently typed language have Haskell beat -- their type systems are designed to be just as expressive as their value language. Haskell is certainly moving in this direction, especially with modern extensions. The issue is of course type inference breaks down in the face of these extensions, and Haskell is trying to maintain its powerful type inference as best it can. Certain combinations of extensions already force type annotations.

> Still, I think core.typed does pretty damn well for being a standalone library.

This is true, and I think the comparison to Haskell actually hurts the greater point you're trying to make. Haskell has full static types at its disposal, and comparing them to the optional typing of Clojure will always leave something wanting -- why draw that comparison when competing with Haskell is not the intention of the library?

Re:Clojure's core.typed vs Haskell by chongli on Monday September 30, 2013 @12:35PM (#6470524)
Nah, Coq, Agda, Idris and any dependently typed language have Haskell beat -- their type systems are designed to be just as expressive as their value language.

That may be true, but it comes at a big cost: inference and decidability. Haskell's type system is designed to very carefully butt up against the limits of these features. Once you go full-spectrum dependent types, you lose all that.

Re:Clojure's core.typed vs Haskell by acomar on Monday September 30, 2013 @12:43PM (#6470615)
Agda and Coq retain inference and decidability by sacrificing Turing completeness. Terminating programs must terminate provably, and non-terminating programs must make concrete progress on every iteration. I'm not familiar enough with Idris to say how it tackles this issue - I do know that it is Turing complete.

So with that said, you're absolutely right.

Re:Clojure's core.typed vs Haskell by polymatter on Monday September 30, 2013 @01:07PM (#6470768)
Another language with a Turing complete type system is Shen [1] (previous life as Qi). Just wanted to put that out there as its a Lisp dialect that really pushes Lisp out there.

[1] http://shenlanguage.org/

Re:Clojure's core.typed vs Haskell by autodidakto on Monday September 30, 2013 @03:22PM (#6471686)
When it comes to awesomeness to fame ratio, I can't think of a language with a higher one than Shen. It's odd how little people talk about it. I, unfortunately, suspect it has to do with the people leading it.
Re:Clojure's core.typed vs Haskell by tel on Monday September 30, 2013 @04:43PM (#6472241)
I've looked at Shen a few times and, honestly, I always get turned off by the syntax. There's not enough out there explaining why I should continue past that concern, and it seems to throw out what's nice about Lisp syntax in order to get halfway to Haskell's.

I'm sure I'll take a look at it again sometime, but I'd really love some kind of intro that helped me to understand why it was worth the time investment to get to know it.

Re:Clojure's core.typed vs Haskell by vdm on Tuesday October 01, 2013 @05:31AM (#6475085)
License has been a major turn off, just like Plan 9. Did they fix that yet?
Re:Clojure's core.typed vs Haskell by nimble on Monday September 30, 2013 @06:36PM (#6472828)
> Agda and Coq retain inference and decidability by sacrificing Turing completeness.

I don't know if I would phrase it that way, but there's a more important slight of hand going on here and I think chongli was right in spirit. Haskell takes care of (most) type level things for you with inference. Coq and Agda allow you to give very precise types to things, but those very precise types involve values that are not automatically inferred for you. It's certainly not the case that you can write the same annotation-free function in Coq that you would have written in Haskell and have a very precise type inferred for you.

Re:Clojure's core.typed vs Haskell by adambard on Monday September 30, 2013 @12:44PM (#6470625)
> Nah, Coq, Agda, Idris and any dependently typed language have Haskell beat

I just knew someone was going to correct me on that statement, hence my "mainstream-ish" qualification.

> why draw that comparison when competing with Haskell is not the intention of the library?

I've got an unhealthy obsession with syntax, and I wanted to have a reference for people to see how things look in a "real" typed language. But, while I'm here, here's a bit I just wrote on /r/haskell (someone put this link there, but of course the haskellers were unimpressed) in defense of the library:

---

Developing in Clojure tends to be a bit of an organic process, thanks to the deep REPL integration in many tools. You can evaluate arbitrary bits of your code as you go, swap things out, tweak whatever you like, and through a more-or-less exploratory process end up with a working bit of code. It's very freeing and very efficient, but if you've ever used a dynamic language for a large project, you know that this tends to create issues refactoring later unless every component is attached to a unit test. The power of core.typed is to let you, after the fact, lock down those function signatures and create what amounts to an automatic test suite.

Re:Clojure's core.typed vs Haskell by helloTree on Monday September 30, 2013 @01:47PM (#6471030)
This is the same for Haskell where it's also convenient to develop in the repl (ghci).
Re:Clojure's core.typed vs Haskell by adambard on Monday September 30, 2013 @01:59PM (#6471125)
There's the repl, and then there's nREPL. I do like ghci, but I can't execute arbitrary chunks of Haskell directly from Vim.
Re:Clojure's core.typed vs Haskell by freyrs3 on Monday September 30, 2013 @02:21PM (#6471274)
This isn't a function of ghci or Haskell, that's an editor feature. If you want that kind of functionality than emacs is probably your best bet.

Though you can send arbitrary code blocks from vim using vim-slime.

[1] https://github.com/jpalardy/vim-slime

Re:Clojure's core.typed vs Haskell by tel on Monday September 30, 2013 @04:47PM (#6472267)
Though you can't execute arbitrary blocks of text in Haskell. Almost everything non-trivial will require adding a slew of "let"s, not all statements are available in GHCi, and state gets wiped on every reload.

When I first began developing Haskell, coming from Clojure, these issues drove me crazy. Nowadays I don't miss them too much and doubt that they're really such good features to begin with...

But it's decidedly false to claim that GHCi is as flexible as Clojure's repl. Nowadays, Clojure's repl would make me anxious. It reminds me a bit of people doing live code edits on a production server. You can't ever be quite sure what you get.

Re:Clojure's core.typed vs Haskell by lmm on Monday September 30, 2013 @05:25PM (#6472480)
It doesn't feel like you're pushing the type system though. Can it do generics? Covariance? Higher-kinded types?

(Serious questions, though even if the answer is yes I can't really see it drawing me away from scala)