14

Which dependently typed programming languages could be used for real world application development?

These are some points, that I think are important:

  • documentation
  • example programs
  • a standard library
  • or at least an easy to use foreign function interface
  • a community of people using the language for real world tasks
  • tool support
Kim Stebel
  • 41,826
  • 12
  • 125
  • 142

3 Answers3

21

The accepted answer contains misinformation. Typechecking in Agda is decidable unless you switch off positivity/termination/universe checking. Moreover, infinite processes are programmable in Agda, just as IO processes are programmable in Haskell: the only restriction is that infinite processes cannot be unfolded indefinitely when being executed in the course of typechecking. You can implement a Turing Machine simulator in Agda: you just can't tell the lie that it's guaranteed to terminate or persuade the typechecker to run it in an unbounded way.

I do, however, agree that dependently typed languages are still at the experimental stage when it comes to "real world" programming. We can't yet support heavy duty development, but we can sustain a significant hobby amongst those with an eye to the future, rather like functional languages in the old days.

Idris, as suggested by Twey, is the closest candidate to a "real world" dependently typed language. It's much more focused on getting stuff done than Agda is. I'd recommend Agda as the better vehicle for getting to grips with the ideas behind dependently typed programming, but Idris is the more practical option.

It is, I'm pleased to say, worth considering recent releases of Haskell as a candidate in this discussion. Since GHC 7.4, Haskell has started supporting a useful notion of type level data, and with at least the singleton technique (a kludge though that is), we can really have types depending on run-time values (by making them depend on static variables constrained to equal run-time values). Haskell is thus a real "real world" language in the early phase of experimenting with dependent types.

pigworker
  • 43,025
  • 18
  • 121
  • 214
  • Thanks for the answer. How far do Haskell's capabilities go? It sounds like it is comparable to Scala in this regard. – Kim Stebel Sep 13 '12 at 00:13
  • 1
    I don't know Scala well enough to do that comparison. However, Haskell is moving at quite a speed in the dependently typed direction. Kind polymorphism (as in GHC 7.6) makes it possible to work effectively with all the new kinds created by automatically promoting types to the kind level. My bet would be on Haskell being and staying ahead of Scala in this respect, but I'd be happy to be proven wrong. – pigworker Sep 13 '12 at 00:22
  • 1
    Er, um, let me add that the development https://t.co/fB8sFizL from my ICFP2012 talk http://www.youtube.com/watch?v=XGyJ519RY6Y is an exercise in getting gradually more dependently typed. Haskell can readily get all the way to part 4, but part 5 is too much to hope for. See also http://stackoverflow.com/questions/10656402/is-it-possible-to-program-and-check-invariants-in-haskell/10659438#10659438 for an example of what's possible. – pigworker Sep 13 '12 at 00:28
5

Agda is not designed to be a general-purpose programming language. ATS is a dependently-typed language that is designed for low-level programming, though it's somewhat less elegant than Agda. Idris is a fledgeling dependently-typed language designed for performant applications-level programs.

Twey
  • 388
  • 2
  • 9
5

I would suggest Agda, because it has calling compatibility with Haskell. As such, it's probably the dependently typed language with the best libraries. Documentation and tutorials are a bit lackluster though, and tool support isn't too great either. To be honest, most dependently typed languages aren't very fully developed at the moment.

If you instead went with the slightly weaker demand that your language should have GADT's, there are two very well maintained options: Scala and Haskell. IMHO you get most of the benefits of dependent types by using GADT's, and you keep typechecking decidable to boot.

Scala and Haskell both have large and well documented libraries, a working tool chain, as well as FFI's (to Java and C respectively). Both also have communities using them to solve real-world problems, like parsing and web development.

keiter
  • 3,534
  • 28
  • 38
  • I've been using scala for a while, but I haven't used GADTs. How do they relate to dependent types? – Kim Stebel Mar 29 '11 at 15:41
  • GADT's are a useful intermediate step between dependent types and regular parametric types. You get stronger typing than in most type systems, and stop short of having a type system that is turing complete(undecidable) like dependent typing.Having an undecidable type system is a bit problematic because type-checking has a small chance to loop indefinitely. So unless you know that you will need the extra type info from dependent typing you may be better off stopping at GADT's. Because they allow you to do cooler things than most type systems while still being decidable. – keiter Mar 29 '11 at 16:07
  • 1
    For reference, OCaml now also supports GADTs. – Tikhon Jelvis Sep 13 '12 at 10:30