views:

176

answers:

6

What programming language + web framework combinations support static type-checking? I'm not scared of functional programming (I'd prefer it), however I'm looking for a mature framework with the bells and whistles we've come to expect. Obviously this includes security and efficiency concerns.

EDIT: Just for informational purposes.... In the end I settled on the Yesod web framework in my favorite statically typed language Haskell. So far it's been working very nicely for me. Absolutely love the statically typed urls, quasi-quotations and of course Hackage.

+3  A: 

.Net platform, MVC framework (or other frameworks)

Messa
Java and .Net are statically typed, but the template engines (* server pages) are dynamically invoked (although sometimes precompiled).
Gabriel Ščerbák
+2  A: 

You might be interested in ocsigen, coupled with the Eliom web programming framework and ocamlduce. This provides a framework to develop web application using the ocaml language, with features like:

  • Continuation-based Web programming
  • Static checking of XHTML (using OCaml or OCamlDuce)
  • Automatic management of sessions
  • Concise and modular programming

Coupled with ocamlduce, this can be very powerful. Ocamlduce is an extension to ocaml that provides type safe xml manipulation. With this, the type checker can guarantee for example that a function generates an xhtml valid page, in every situation.

It can be used with macaque, which is not as mature as the rest of ocsigen, but provies type safe database manipulation, using comprehensions.

With this, you can have static type checking of your program, and also data-level type checking, where you can have strong guaranties the date you generate is correct.


Another interesting framework is hop, where you can use scheme to code both server side, and client side, with on the fly compilation to javascript. However, scheme is a language from the lisp family, and does not provide real static type checking, but hop provides tools to ensure the data you generate is correctly formed.

tonio
This seems very promising. Thank you
Rehno Lindeque
SO locked my vote to 0 :(. This is by far the best answer so far.
Rehno Lindeque
@Rehno: I hate it when that happens. Given that this is community wiki, you can just edit the answer (remove or add a comma or something) and then vote again.
sepp2k
@sepp2k, Thanks :)
Rehno Lindeque
+2  A: 

Have a look at the Ur programming language:

From the webpage

Ur/Web supports construction of dynamic web applications backed by SQL databases. The signature of the standard library is such that well-typed Ur/Web programs "don't go wrong" in a very broad sense. Not only do they not crash during particular page generations, but they also may not:

  • Suffer from any kinds of code-injection attacks
  • Return invalid HTML
  • Contain dead intra-application links
  • Have mismatches between HTML forms and the fields expected by their handlers
  • Include client-side code that makes incorrect assumptions about the "AJAX"-style services that the remote web server provides
  • Attempt invalid SQL queries
  • Use improper marshaling or unmarshaling in communication with SQL databases or between browsers and web servers
aioobe
I was thinking about suggesting this too, but I don't think it's a good fit if the OP is looking for maturity and bells and whistles.
sepp2k
Ah, I remember Ur now. Love the idea, but it seems a bit new at the moment. They would do well to try and spruce up their website and community.
Rehno Lindeque
A: 

(/me dons flame-retardant suit)

Why? I'd agree that using strongly typed languages are very useful as a teaching (learning) tool, however too many people confuse strongly typed with bug-free. Yes they do show up type related issues at compile time, but at the expense of a lot productivity. And, IMHO, strongly typed, object oriented languages are an oxymoron.

However there other people out there who are equally mad - one of them wrote phplint which provides (tunable) strong type checking for PHP (natively dynamically typed).

Although there used to be some frameworks for Objective C (which is so much more pleasant to work with than C++) they seem to have all died out.

Java is PITA for developing web applications. The only reasonable way to get any sort of performance/scalability is to run the code inside a container - which adds all sorts of overheads elsewhere.

symcbean
..and before anyone tries to suggest that strongly-typed languages are more secure - on the contrary, strong-typing opens up security vulnerabilities such as buffer overflows.
symcbean
First of all, I think you're confusing strong and static typing. Second I don't agree that static typing necessarily means a loss of productivity (think type inference). Third who said anything about OO?
sepp2k
Why does strong (or static) typing open up the possibility of buffer overflows? static typing != lack of bounds checking
sepp2k
My question isn't intended to start a debate on the usefulness of type systems. I'm well aware of the trade-offs and I agree with you on some points (OOP languages generally don't have great type systems and Java is certainly not one of my favorites in this regard). Personally I find strong type systems quite pleasant for maintenance and general peace of mind. Unit testing also takes up quite a bit of time when all is said and done.
Rehno Lindeque
+2  A: 

Look at the WebDSL http://webdsl.org/home

Gabriel Ščerbák
+1  A: 
  • Scala -> [Java framework here]
  • F# -> ASP.NET / ASP MVC

I'm sure there are a ton of others. (F# / Scala are hybrid languages, not pure functional languages)

Justin