Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Statically-typed cross-OS Web platforms: Java, Mono, and what else? [closed]

I appreciate this question may get closed due to its open-ended nature, but I'm curious none-the-less.

If I wanted to develop a cross-platform Web application using a statically-typed language, what would my choices be? I'm aware of Mono and Java, but what else is there?

(When I say cross-platform, I mean Windows and at least one common flavour of Linux)

like image 571
Lawrence Wagerfield Avatar asked May 17 '12 11:05

Lawrence Wagerfield


4 Answers

You can use single language for the both client and server parts:

  1. Java
  2. C#
  3. Google's Go
  4. Scala
  5. GWT(Java framework)
  6. Haskell web frameworks
like image 84
GingerHead Avatar answered Dec 02 '22 12:12

GingerHead


There are several high-performance Haskell web frameworks that emphasise strong static correctness:

  • snap
  • yesod
  • happstack

The goal is to lean on the type system to provide highly optimzied code, and zero chance of runtime failure.

To quote the Yesod web site:

Turn runtime bugs into compile-time errors

Yesod believes in the philosophy of making the compiler your ally, not your enemy. We use the type system to enforce as much as possible, from generating proper links, to avoiding XSS attacks, to dealing with character encoding issues. In general, if your code compiles, it works. And instead of declaring types everywhere you let the compiler figure them out for you with type inference.

like image 24
Don Stewart Avatar answered Dec 02 '22 13:12

Don Stewart


If you mean statically typed, there isn't that much choice unfortunately. Google's Go language seems to begin growing into the web application space (there is Go support for Google's App Engine and projects such as GoWeb), but these efforts are probably not very mature yet.

Scala might be another possible option. While it also runs on the JVM, its web frameworks are very different due to the language's advanced features (see e.g. Lift) and might be worth a separate look.

like image 25
Denis Washington Avatar answered Dec 02 '22 12:12

Denis Washington


In addition to Java and C# (via mono), you could also use (modern) C++ in the form of the
Wt (C++ Web Toolkit). Now the C backwards-compatibility part of C++ is not strongly typed, but otherwise C++ programs are type safe.

If you want really strong type safety, you can use Haskell with Yesod. The goal of Yesod is to use strong types to prevent common errors in programming web applications. URLs, for instance, are type checked. You cannot construct an intra-application link without supplying the correct parameters. Escaping of user-content when rendering the web page is another situation where the Haskell compiler is used to ensure that strings are properly escaped before being included in a rendered page.

like image 36
Christian Klauser Avatar answered Dec 02 '22 12:12

Christian Klauser