6 ms·
I haven't found a web server language to my liking yet. Maybe I'm too picky, but I'd like to satisfy all of these requirements: - Static typing -- I want to e
by zingermc 10y ago
I haven't found a web server language to my liking yet. Maybe I'm too picky, but I'd like to satisfy all of these requirements:
- Static typing -- I want to eliminate as many runtime bugs as I can
- Type inference -- Like in SML and Haskell
- No JVM -- Personal preference, but I'd rather not pull in this monster if I don't have to.
- Good pre-made web framework -- I've briefly looked at OCaml but the web frameworks seem disappointing. Tell me if I'm wrong!
- supster 10y agoI have very similar requirements, and I think within the next few years, Swift will fill this niche very well.
- AsyncAwait 10y agoAgreed, Vapor[1] is coming along nicely. 1 - https://github.com/qutheory/vapor https://github.com/qutheory/vapor
- orclev 10y agoThere are a couple Haskell frameworks that might fit the bill. Yesod is a big one, although some take issue with its excessive use of Template Haskell. Others to look at would include Servant, and the very confusingly named rest framework.
- rzhikharevich 10y agoDoesn't Go fit these requirements?
- deleted 10y ago[deleted]
- AsyncAwait 10y agoGo has a relatively weak, unsafe type system despite being statically typed. Also, lack of generics, optionals or tagged unions is kind of a bummer.
- beefhash 10y agoWith .NET Core having recently hit 1.0[1], wouldn't C#/ASP.NET Core fit the bill now? [1] https://blogs.msdn.microsoft.com/dotnet/2016/06/27/announcing-net-core-1-0/ https://blogs.msdn.microsoft.com/dotnet/2016/06/27/announcin...
- wtetzner 10y agoIt sounds like they might prefer F# over C#. Also, if they're not willing to pull in the JVM, it seems unlikely they'd be happy about pulling in the CLR.
- nbarbettini 10y ago.NET Core makes the CLR dependency a little easier to swallow. It's modular, so you can only pull in the stuff (packages) you need. Cuts down on the bloat and "CLR kitchen sink" quite a bit.
- cel1ne 10y agoThe nice thing about the JVM is that it's contained and has excellent monitoring and profiling tools. Anyway: What about kotlin [0]? * 100% java compatible * can compile to the JVM and javascript, so you should be able to run it with node. [0]: https://kotlinlang.org/ https://kotlinlang.org/ Googling found this: https://jonninja.github.io/node.kt/ https://jonninja.github.io/node.kt/
- eatonphil 10y agoI will be revisiting OCaml sometime in the near future to write a more solid web framework for it (compared to OWebl). This time it will be based on FastCGI rather than doing the networking itself I think. In the meantime, I'm more actively working on Ponyo for Standard ML right now. Take a look at the ponyo.org server[0] for a brief glance at what it can do today. Check out the /r/sml wiki if you are trying to get started. And please join #sml on Freenode if you have any questions! [0] https://github.com/eatonphil/ponyo/blob/master/site/server/server.sml https://github.com/eatonphil/ponyo/blob/master/site/server/s...
- gshulegaard 10y agoWith type hints in Python 3.5+, does Python fit your list? Genuinely curious.
- gshulegaard 10y agoJust to add some details: - Static typing -- Type hints enable restriction of the dynamic typing behavior of default Python to mimic static types - Type inference -- Not familiar with the particular behavior of type inference of Haskell, but yes. - No JVM -- Definitely no JVM, but not particularly high performance so...there is that. - Good pre-made web framework -- Lots of good ones, Python ecosystem is fairly rich in general, but ones I have used: Django, Pyramid, Flask, etc.
- zingermc 10y agoThat's a really good point! I have used the CherryPy framework before, but I've never used Python type hints before.
- ShirsenduK 10y agoYou need Elixir with the Phoenix framework!
- lkitching 10y agoIsn't Elixir dynamically typed?
- electrotype 10y agoModern JVM based frameworks are far from being "monsters", and you have a lot, lot of choices! Many of them have an embedded HTTP server so they are very easy to develop and deploy. In case you want to investigate some: - https://grails.org https://grails.org - http://sparkjava.com http://sparkjava.com - https://www.playframework.com https://www.playframework.com - http://projects.spring.io/spring-boot http://projects.spring.io/spring-boot - https://www.spincast.org https://www.spincast.org - http://jooby.org http://jooby.org - http://www.ninjaframework.org/ http://www.ninjaframework.org/ - http://www.dropwizard.io/0.9.3/docs/ http://www.dropwizard.io/0.9.3/docs/
- frankpf 10y agoCheck out Ur/Web[1]. It's a functional, pure and statically typed language inspired by Haskell. It claims that programs that compile successfully cannot: - 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 [1]: http://www.impredicative.com/ur/ http://www.impredicative.com/ur/
- outworlder 10y agoWhat about Rust? It has static typing, limited type inference (function parameters need their types declared - by design - will infer otherwise), no JVM, and has several web frameworks. Not sure if any of them would be considered "good" by your definition, but check it out: https://github.com/flosse/rust-web-framework-comparison https://github.com/flosse/rust-web-framework-comparison
- Cshelton 10y agoRust is exactly the language I want for the web. Unfortunately, the ecosystem is still a little too immature. In time...someday... I've already decided my next service/api will be in Rust.
- steveklabnik 10y agoFor an ecosystem overview: http://www.arewewebyet.org/ http://www.arewewebyet.org/ Still is early days, but there's a lot of stuff too. Excited to see it develop further.
- montyedwards 10y agoRust has: - Static typing - Type inference (and pattern matching) - No dependency on JVM, .NET, or BEAM But the number of web frameworks, etc. for Rust sucks compared to that of older languages like Go. Go 1.0 was released in early 2012 and Rust 1.0 in May 2015. Rust is more verbose than Go, but Go's FFI to functions written in C isn't as efficient and since "cgo isn't go", I'm not sure cgo covered by Go 1.0 compatibility guarantee. On the other hand, Go has tons of "batteries included" plus web frameworks so that is pretty awesome to have on stable platforms (I don't consider Windows a stable platform for Go and got burned several times, but Go works great on FreeBSD & Ubuntu.) I suspect Go & Swift won't have robust reliability on Windows (compared to other platforms) but they'll be rock solid on the ones they favor. Rust may have better prospects regarding this, but Rust still too new this year for web server language -- wait until MIR is integrated and a couple more releases after that.
- yozhik 10y agoI've just started using D for this sort of thing. It has web framework called Vibe.d (http://vibed.org/ http://vibed.org/). I'm pretty happy with it, and it seems to satisfy all of your requirements. Note that I've only just started to use it, so I don't know how well it will hold up over time, but I'm enjoying it so far.
- WayneBro 10y agoMaybe Typescript? (On Node.js obviously for server side).