Hacker News new | past | comments | ask | show | jobs | submit login

For comparison's sake I just compiled the Jester hello world example using Nim:

    import asyncdispatch

    import jester

    routes:
      get "/":
        resp "Hello World"

    runForever()
Command: nim c -d:release --opt:size file.nim

The size on my Mac is 349K and that's with very little tweaking.




This comparison is impossible without knowing the relative sizes of jester vs rocket, and how much space they take up of their effective binaries.[1] As I mentioned below, Rocket isn't really size-optimized yet, maybe it would be significantly smaller if it were. Maybe Jeseter is just far more lean-and-mean than Rocket is.

You can't draw whole conclusions between two languages with just one tiny command; even the OP, comparing a language to itself, ran a whole lot more in-depth analysis to figure out what costs were being paid where.

It is cool it’s that small so easily though!

1: shout-out to https://crates.io/crates/cargo-bloat which is very cool


I agree to a certain extent, but it's still a useful look at how Nim's leading web framework compares to Rust's leading web framework.

I'm not saying we should draw conclusions based on just this comparison. But it is an additional nugget of information and an invitation for others to also give Nim a try when targeting embedded systems :)


> it's still a useful look at how Nim's leading web framework compares to Rust's leading web framework.

I'm not sure Rocket is Rust's leading framework. It certainly looks nicer than some, but still requires Rusts's nightly build, IIRC. I'm sure that means a lot of people opt for something like actix-web, or just fall back on hyper. My impression is that Rust's users are pretty widely spread across the frameworks that exist, so it may not be that you picked the wrong framework, but that isn't really a "leading" framework yet.

Someone might jump in with better info on the usage rates than me and correct me though, since this is mostly observational on my part. :)


I'd say that would be splitting hairs. But arewewebyet has downloads badges for the frameworks. If we go by those numbers, Iron has significant lead and Rocket coming second.

http://www.arewewebyet.org/topics/frameworks/

Also just for fun I did try out Iron, Actix-web, and Gotham, and they all put out pretty similar figures (iron&gotham bit smaller, actix-web bit bigger). I do feel like Rocket is being a good representative example here.

That being said, I wouldn't be surprised if Rocket would be bit more feature-packed than Jester.


Fair enough. I just know that the main complaint I see against Rocket here is that it requires nightly (and supposedly enough nightly features that it may be a while before it doesn't). As something that requires a developmental build of the compiler, it didn't seem like the best representative sample to me, but if it's about par with other frameworks, then it works well enough.

Thanks for the leg work. :)


Many people have complained about the Rust Evangelism Strikeforce, but the few nim users here on HN are taking it to the next level…


I don't think that's fair towards GP – they only provided a data point using a language that is competing with Rust in some areas.

(Unless I misread your comment, and "RustEvStrFo" doesn't have the same negative connotation to you...)


You're right, it not really nice on that specific comment. I just noticed this trend the past few months, and this time I reacted.

Edit: if you look at the commenter's profile, you'll see that he does that really often, on threads talking about Rust, Go or C. I think the comparison to the Rust Evangelism Strikeforce holds.


I think there is a difference between a core developer of Nim (me) trying to raise some awareness, by showing how easy it is to achieve what the article achieves in Nim, vs. a random developer proclaiming "Why haven't you written this in Rust?".

Isn't that what the Rust Evangelism Strikeforce is known for?


It's what people think the "RESF" does, but as is consistently mentioned whenever it is brought up, there seems to be more people replying to any comment about Rust with complaints of "RESF" (even if the original comment is just "trying to raise some awareness", etc.) than people actually proposing rewriting anything/everything in Rust.

In any case, I think being a core developer on something means a much higher bar for accuracy/relevance/general public behaviour when discussing it and its competitors: everything one says about the project is a semi-official representation of it. Certainly the Rust core developers try to be careful about conveying an accurate picture of costs as well as benefits when answering questions or correcting misconceptions[1]. That is certainly something I found weighed on my mind a lot when I was on the Rust teams: anything I said about it could become part of "the Rust project" (as an idea people have) itself.

[1]: One extra point is that, IME, this is often how Rust team members interact with social media: they won't be the first person to bring up Rust in a thread. Of course, it's fair to say that Rust has a bigger mindshare and more people outside the project team members will bring it up/compare to it than Nim, but one possible alternative approach to awareness is more whole threads (i.e. submitted articles) about Nim rather than just comments within threads about other technologies.

(To be clear, this is just a reply to the parent comment, I'm not trying to say the original Nim comment was "NESF"-ish or "RiiN".)


> there seems to be more people replying to any comment about Rust with complaints of "RESF"

https://www.reddit.com/r/programming/comments/83n32i/the_def...


I didn't say it didn't happen. I acknowledge it, and I've even personally written many, many comments calling out/correcting comments that are too enthusiastic in their promotion of Rust.

In any case, for that specific comment, see Steve's analysis in response to your ping:

> But a brand new account with three trolly comments is different than an actual Rust advocate. Just like I'd ignore our local anti-rust trolls, I'd also ignore any pro-Rust trolls.


Binary size was one of the main reasons I started using Nim.


I'm sorry if I offended you so much you had to revive a dormant account that had been untouched for 4 years.


It's a perfectly valid comparison though.

Your comment on the other hand...


And, with every single of your comments being related to the Nim language, I guess you are objective.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: