There are many dimensions to programming languages that range from systems to scripting, weakly typed to strongly typed, dynamic to static typed, purely functional to statefull, imperative to declarative, etc...<p>There are also very few languages that focus on <i>correctness</i> and <i>contracts</i> to help create programs that have fewer bugs. Yet The mayority of languages simply focus on "getting things done", so to speak, and leave testing and correctness out of the picture or add them later on.<p>Granted, testing support can be added later via libraries and frameworks, but I wonder: in the continuum of program correctness, is there a language that perhaps does not provide full proof/correctness/contract support but does come with testing right out of the box, either in its implementation or philosophy?<p>Also related question: do you know of any language that was specifically <i>designed</i> to encourage and/or make testing easier for its programs?<p>Even though I didn't get the "joke" for a recent post about Go[0], I still think it's interesting to ask.<p>[0] https://news.ycombinator.com/item?id=12371029
I'm not sure this is exactly what you are asking about, but Rust does support testing right in the language. You can add #[test] before a function to make it a test function (tests and regular functions can live together in the same file).<p><a href="https://doc.rust-lang.org/book/testing.html" rel="nofollow">https://doc.rust-lang.org/book/testing.html</a>
Look up "model checking" and see how that compares to what you're thinking about. How would you <i>specify</i> tests (or rather, correct program behavior) in such a language?<p>The languages Alloy and TLA+ come to mind. (So does Coq, which is at the other extreme of actually proving your program correct.)
Clojure's most recent builds include "spec". <a href="http://clojure.org/guides/spec" rel="nofollow">http://clojure.org/guides/spec</a>
> perhaps does not provide full proof/correctness/contract support but does come with testing right out of the box, either in its implementation or philosophy?<p>Python has doctests.<p>Not sure if thats what you mean?