Recently I've started studying type theory, and most specifically constructive type theory (CTT) with induction (using Coq).
I have to say.....damn, and I thought learning Haskell was mesmerizing.
I just can't stop thinking about types and dependent types and inductive types and constructing proofs when looking at code. This makes me sad when I have to go back to projects in Java or other languages
On the other hand, I see CTT and I can't help but to think it could be made so much greater. CTT is a lamda calculus, where the only think you have are terms, contexts, and judgements. This can be modeled to a Functional Programming paradigm pretty okay (e.g Coq can be translated to Haskell), but what about other paradigms? Or what about other aspects of programming?
For example, CTT, or lamda calculus, don't have a way to make I/O part of their intrinsic theory. Or how about programs themselves? CTT can't really model a series of instructions as far as I know. Or for example, model threads, and model concurrency.
Imagine being able to use Coq's proof assistant to prove your code is thread-safe and will never result in deadlock or any concurrency baddies?
Imagine being able to model and prove that your background thread is calling a web service appropiately, and does what it specifies?
Imagine being able to create a security system, and prove it can't be hacked, or if it can, know exactly how by proving which scenarios it can happen in?
I would kill to be able to program in that! And like I said, maybe include other paradigms as well, like OO. Include objects, state, behaviour, inheritance, associations, etc into the theory.
I feel like there is such a bigger world to go into! I love learning CTT, but I've searched and I haven't found anything that does the above.
Do you guys know of any new language, theory, research, or something that might tackle issues like that?
Another doubt I have is: Are there any OO languages, or maybe procedural ones, that have an extensive type theory similar to CTTs? I'm thinking dependent types, hierarchy of types, functions as first class citizens, types as first class citizens, etc
I use Java generally, and I can't help but look at generics and sigh in disappointment, knowing all the things I could do if I could use Coq's type theory instead of it.
I've googled but I couldn't really find anything, other than languages similar to Coq (i.e Agda, and Omega or something like that).
Anyways, this may be a little off topic, but it's what my "vision" is:
I imagine a world where a programming language exists, where it can be used for any practical application imaginable, and you can prove it works within the same language (barring some incompleteness it'd carry).
There would be no need for "testing", if you want to test something, you don't create a Unit Test, and hope you didn't miss any case that might brake it, you effortlessly and easily use a proof assistant to prove your code works.
For some subset of programming, specially Functional Programming, this is already done with proof assistants like Agda or Coq. But that subset of programming isn't really practical. I want it to be mainstream, I want it to be used everywhere, I want it to be applied to anything you could want programming applied to.
I'd like to know if there is anything that resembles or tries to resemble that.
Anyways, sorry for rambling so much. I'm basically intending this to be a general discussion of these ideas and subjects, not just a question about a specific problem, error, etc.
Thanks

New Topic/Question
Reply



MultiQuote



|