Live data from Hacker News

Show HN: Rocket – Web Framework for Rust

rocket.rs

21–30 of 123 posts

Re: Show HN: Rocket – Web Framework for Rust

#23

One of my influences, Armin Ronacher, has been doing a lot of Rust work lately, so I've been thinking about looking at it more closely since I appreciate his Python tastes. Is Rust simple and elegant in the sense that Python is? I've also heard it's for systems programming, which makes me think of C and has kept me away from it. I like how I can bang out scripts quickly in Python. Is the same true of Rust? edit: foun…

> I've also heard it's for systems programming, which makes me think of C and has kept me away from it. One of its major goals is making systems programming more accessible. So you shouldn't dismiss it because "systems programming = C", it's trying to change that! :) That's not to say it won't involve learning some systemsy concepts. But it won't be as scary as C. You can't necessarily bang out scripts quickly. A typ…

There's nothing that makes typed languages inherently more verbose; a Haskell script will tend to be substantially shorter than the equivalent Python.

Rust gives you much more control over how your program runs, but this necessarily means paying a price in expressiveness.

Re: Show HN: Rocket – Web Framework for Rust

#24

Are dynamic params enforced at compile time? I.e. will the compiler ensure that the route "/ " has a matching id parameter?

Yes! Here's what happens when you don't do the right thing:

  error: 'id' is declared as an argument...
   --> src/main.rs:8:9
    |
  8 | #[get("/")]
    |         ^^^^

  error: ...but isn't in the function signature.
    --> src/main.rs:9:1
     |
  9  |   fn hello() -> &'static str {
     |  _^ starting here...
  10 | |     "Hello, world!"
  11 | | }
     | |_^ ...ending here

Re: Show HN: Rocket – Web Framework for Rust

#25

Earlier quoted context omitted.

> I've also heard it's for systems programming, which makes me think of C and has kept me away from it. One of its major goals is making systems programming more accessible. So you shouldn't dismiss it because "systems programming = C", it's trying to change that! :) That's not to say it won't involve learning some systemsy concepts. But it won't be as scary as C. You can't necessarily bang out scripts quickly. A typ…

I guess I'm contrasting Python with my Java experience so far as banging out prototypes quickly. In Java, I don't think the type system gets in the way so much as its classpath. It's been a long time since I've done Java, but you'd have to get your jars in order and write an ant or maven script to do the compile/run steps (or at least a bash script). I like that with Python I can just do pip install whatever and begi…

I believe Rust's package manager, Cargo, is quite similar to pip in functionality. I haven't used it myself, so I could be wrong.

Re: Show HN: Rocket – Web Framework for Rust

#26
Just a comment on the pastebin example ( https://rocket.rs/guide/pastebin/#uploading ):

UUIDs seem like it would be easier to use for demonstration : https://doc.rust-lang.org/uuid/uuid/index.html

And Cargo.toml declaration might need an extra sentence or two to explain the "features" part but that shouldn't be too bad:

    [dependencies]
    uuid = { version = "*", features = ["v4"] }

Re: Show HN: Rocket – Web Framework for Rust

#27

Syntax is amazing! Hope (so much) to see it possible on beta soon. Maybe for somebody it's not a new thing, but for me this: struct Message { contents: String, } #[put("/ ", data = " ")] fn update(id: ID, message: JSON ) where message is auto-decoded - it's awesome!

[deleted]

Re: Show HN: Rocket – Web Framework for Rust

#28

Earlier quoted context omitted.

> I've also heard it's for systems programming, which makes me think of C and has kept me away from it. One of its major goals is making systems programming more accessible. So you shouldn't dismiss it because "systems programming = C", it's trying to change that! :) That's not to say it won't involve learning some systemsy concepts. But it won't be as scary as C. You can't necessarily bang out scripts quickly. A typ…

I guess I'm contrasting Python with my Java experience so far as banging out prototypes quickly. In Java, I don't think the type system gets in the way so much as its classpath. It's been a long time since I've done Java, but you'd have to get your jars in order and write an ant or maven script to do the compile/run steps (or at least a bash script). I like that with Python I can just do pip install whatever and begi…

Calling `cargo run` has made it easier for me to treat it as a scripting language since it combines the build and run steps in a single command. Good luck with it!

Re: Show HN: Rocket – Web Framework for Rust

#29

Earlier quoted context omitted.

> I've also heard it's for systems programming, which makes me think of C and has kept me away from it. One of its major goals is making systems programming more accessible. So you shouldn't dismiss it because "systems programming = C", it's trying to change that! :) That's not to say it won't involve learning some systemsy concepts. But it won't be as scary as C. You can't necessarily bang out scripts quickly. A typ…

I guess I'm contrasting Python with my Java experience so far as banging out prototypes quickly. In Java, I don't think the type system gets in the way so much as its classpath. It's been a long time since I've done Java, but you'd have to get your jars in order and write an ant or maven script to do the compile/run steps (or at least a bash script). I like that with Python I can just do pip install whatever and begi…

[deleted]

Re: Show HN: Rocket – Web Framework for Rust

#30

One of my influences, Armin Ronacher, has been doing a lot of Rust work lately, so I've been thinking about looking at it more closely since I appreciate his Python tastes. Is Rust simple and elegant in the sense that Python is? I've also heard it's for systems programming, which makes me think of C and has kept me away from it. I like how I can bang out scripts quickly in Python. Is the same true of Rust? edit: foun…

It really dedends on what you are doing, but if you are building small scripts that aren't necessarily reliant on specific libraries, Nim is probably better than Rust.
Post reply on HN