3 ms·
I think that despite the constraints imposed by the lack of GC, Rust is seen as more approachable than more functional langauges to those coming from a C/Java/J
by nicoburns 9y ago
I think that despite the constraints imposed by the lack of GC, Rust is seen as more approachable than more functional langauges to those coming from a C/Java/JavaScript etc background. And the only similar language with an ML type system is Swift which isn't quite there with libraries for backend stuff.
Also, have you seen the sample code for Rocket based webapps? I haven't seen much nicer in any language. The async ecosystem isn't nearly as nice yet, but it should get much nicer once async-await lands.
- lmm 9y ago> Also, have you seen the sample code for Rocket based webapps? I haven't seen much nicer in any language. Had a quick look just now. Clean syntax for the implementation, but routing and parameters are relying on magic # annotations. Compare with e.g. https://doc.akka.io/docs/akka-http/current/routing-dsl/index.html#longer-example https://doc.akka.io/docs/akka-http/current/routing-dsl/index... where you can do the routing in plain old code (also async is already there).
- kbenson 9y ago> routing and parameters are relying on magic # annotations Actually, as someone almost finished with the book, that brings up an interesting point. What controls # annotations and how do you hook into them (which also answers the question of how magic they are)? If it's fairly standard and obvious how to look up, I think I might not classify them as much "magic", but truthfully, I have no idea at all. Maybe I'm just not remembering that part of the book (I did take a break for a month), or maybe I didn't make a connection that was implied?
- jrhurst 9y agoLook into macros 1.1 to see how they're use for `#derived` they're not particularly super magical. Though unstable stuff rocket uses is a bit more magical.
- steveklabnik 9y agoRight now, those annotations (attributes in Rust parlance) are only made available by the compiler, but this year, the feature Rocket uses to define your own will be stable. You write a function that takes the code as input and produces code as output, to put it in the simplest of terms.
- NiceGuy_Ty 9y agoI love me some akka. Actix would be the actual rust comparison, since it's also an actor system being leveraged to provide web features. You have to dig into Tokio/futures to get access to streams, which atm is still not at 1.0.
- lmm 9y agoI'm not comparing it as an "actor thing", I'm comparing it as a server-side HTTP framework; the part I care about is not whether the implementation uses actors underneath, but whether the routing and logic can be expressed in plain old code that can be refactored according to the normal rules of the language, with full type safety, with the ability to handle effect-like types... (I hate akka and actors, but as a user of akka-http you don't have to touch them.)