Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dependently typed language best suited to "real world" programming? [closed]

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
like image 701
Kim Stebel Avatar asked Jan 08 '11 14:01

Kim Stebel


People also ask

What is a dependently typed language?

In computer science and logic, a dependent type is a type whose definition depends on a value. It is an overlapping feature of type theory and type systems. In intuitionistic type theory, dependent types are used to encode logic's quantifiers like "for all" and "there exists".

Why is strongly typed language better?

A key advantage of strong data typing is that it enforces a rigorous set of rules to ensure a certain consistency of results. Further, a compiler can quickly detect an object being sent a message to which it will not respond, preventing runtime errors.

Why loosely typed language is better?

Loosely typed languages are usually way faster and provide a lot more flexibility, but errors might slip during compilation time producing runtime errors or strange behaviors in the application.

What does dynamically typed language means?

Dynamically-typed languages are those (like JavaScript) where the interpreter assigns variables a type at runtime based on the variable's value at the time.

Which programming language is best for coding?

What coding and programming language should i learn? JavaScript and Python, two of the most popular languages in the startup industry, are in high demand. Most startups use Python-based backend frameworks such as Django (Python), Flask (Python), and NodeJS (JavaScript).

What is the most strongly typed language?

Smalltalk, Ruby, Python, and Self are all "strongly typed" in the sense that typing errors are prevented at runtime and they do little implicit type conversion, but these languages make no use of static type checking: the compiler does not check or enforce type constraint rules.


2 Answers

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.

like image 92
pigworker Avatar answered Sep 23 '22 15:09

pigworker


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.

like image 36
keiter Avatar answered Sep 19 '22 15:09

keiter