We can also end up with things like HTML templates compiled into your binary and the HTML validated at compile time. Even things as precise as type checking on something like <time datetime="{{ time }}"> can be managed with Rust. And I intend to.
I’ll be talking about how some of these sorts of things can work out at Strange Loop this year: https://thestrangeloop.com/sessions/fast-secure-safe-the-web....
That said, could you explain how Go's type system is weaker than Rust's?
Extensive use of reflection (in Go, this takes the form of type assertions) proceed to make it fundamentally possible again, but they have lost a lot of conciseness, certainty of safety and correctness in the process.
Personally, though, I've been migrating to "SQL calls" and "some support code to manage the rows coming back" even when not using Go. ORMs are this enormous pile of complexity, and it's amazing how easy it is to recover the vast bulk of their utility just by writing a bit of SQL. Use a decent SQL generator (as opposed to bashing strings together) and you're even closer. By no means is it a "full replacement", but I'm increasingly of the opinion that the costs of ORMs tend towards the staggering and the benefits minimal, for any nontrivial project. Possible exception for the really good ones that have been developed for a long time, but most of the ones used in the open source world are pretty dubious, IMHO.
OTOH, I'm not particular fond of ORM as a universally right solution for dealing with DBs (its a solution which makes sense for some DB-related issues in some OO languages, but isn't something that should be reflexive "deal with DB, need ORM"), and its probably not a solution I would reach for for any problem in Go even whether or not you could reasonable do it in Go.
I'm not ready to say that Rust's type system lends itself perfectly well to ORM's, as I haven't really seen an ORM as convenient as ActiveRecord in any statically typed language. (This is one of the reasons I like both statically and dynamically typed languages.) But I'm happy to see people try, of course, and I'd love to be surprised.
http://ocharles.org.uk/blog/posts/2013-12-06-24-days-of-hack...
More in-depth interactive tutorial:
https://www.fpcomplete.com/school/starting-with-haskell/libr...
That talk looks really nice too, a shame it's in several months.
Continue the good work !
I’m definitely in with Rust and HTTP for the long haul. Hang round, things will get better.
I don't understand what the type system has to do with building a fancy ORM. Do you mind elaborating?
These things are already done in several of the Haskell frameworks. There's even Blaze, which is a Haskell DSL that allows you to write HTML entirely in Haskell. Personally, static verification of HTML doesn't seem that necessary, but I suppose it has its merits (possibly for security?).
However, due to the JVM nature, one could use some of the well-tested and well-defined Java Web Framework from Clojure (with a lightweight wrapper, of course). I'm not really sure if people are actually doing that in production, though. [6] [7]
[1] http://caribou.github.io/caribou/docs/outline.html
[3] http://www.luminusweb.net/
[4] https://github.com/pedestal/pedestal
[5] https://news.ycombinator.com/item?id=7472841
[6] https://github.com/apache/tapestry-5/tree/master/tapestry-cl...
Clojure has Korma[0], Common Lisp has Crane[1] and Integral[2].
[0] https://github.com/korma/Korma
It's fast, expressive, and the modern Mono+ASP.Net web-stack is open-source (older stuff is still proprietary).