Live data from Hacker News

Writing a website in Rust

blog.viraptor.info

71–80 of 141 posts

Re: Writing a website in Rust

#71

Well, IMHO, "the right hammer for the right nail". Rust is a great systems language (besides the lack of bitfields) but I wouldn't use it as a web language. Just as much as I wouldn't use C++ to develop webapps. Sure you can do it but then again there are far easier ways to achieve your goal.

I think I saw an article about people using c++14 as a scripting language since infered type, closures and other syntax niceties can make simple c++ as short as python.

Re: Writing a website in Rust

#72
post #39

Very nice write up. As a Go programmer, Rust is really interesting. Can't wait until you can build web APIs with it.

Crates.io is built this way: Rust serving JSON on the back end, Ember consuming it on the front end.

How mature could this setup be considered? Thanks for pointing it out.

Re: Writing a website in Rust

#73

Earlier quoted context omitted.

Last I checked, a 'rails new' gives you over 40 dependencies off the bat.

Yes, the Rails and Node communities are known for insanity.

Node/npm is terrible. Look at Popcorn Time. This client app has over 4000 files in npm_modules. Most of them totally unneeded, and many of them tiny and for things that should be in a stdlib or rolled with others.

I think it's the same kind of folks that create a huge Java object model, always one file per type. Gives the feeling of being big and doing real work, even when you're not.

Re: Writing a website in Rust

#74
post #43

Earlier quoted context omitted.

Spidermonkey uses generational gc with some kind of compacting these days. Why do you think that's legacy? What models are strictly better than that?

Nim's garbage collector is better than Spidermonkey's.

No, it's not. Generational, incremental, precise GC generally outperforms non-generational, non-incremental, conservative deferred reference counting.

Re: Writing a website in Rust

#76
post #15

Earlier quoted context omitted.

If you're going to write a block of text like that, you could at least fact check the main premise. Rust had GC. They started off with GC, so it wasn't the very first decision that "no code can perform with garbage collection". Here's a post about removing GC from core rust 2 years ago: http://pcwalton.github.io/blog/2013/06/02/removing-garbage-c... Next: they didn't kill GC. They removed it from core, because rust i…

Ok thanks. It was not the first decision then, just one of the early main design decisions. I edited the text to reflect that.

It was not an early main decision. Rust has been actively developed for a full decade now, GC was removed from stdlib 2 years ago.

The decision was only done at the point when the devs were confident that the ownership/borrowing system could manage all the normal workloads done by GC, and that GC could now be implemented well into the language as a library.

Re: Writing a website in Rust

#77

Well, IMHO, "the right hammer for the right nail". Rust is a great systems language (besides the lack of bitfields) but I wouldn't use it as a web language. Just as much as I wouldn't use C++ to develop webapps. Sure you can do it but then again there are far easier ways to achieve your goal.

Some would say Scala is not a "web language" either, but I think Play Framework developers would disagree. The rules of the game are not as clear as they used to be. For instance - web frontend is being dominated by JS frameworks and all the backend does is handling REST calls. I would argue that when you need scalability/performance/reliability, when milliseconds start to count - static languages make very much sens…

[deleted]

Re: Writing a website in Rust

#78
post #65

Earlier quoted context omitted.

I'm a Python/Flask dev who has knowledge of the basics of Scala. Which web framework and ORM would you recommend to develop a (potentially) non-trivial web app?

If you want to use Scala, Play Framework 2.4 + Slick 3.0 would be the deadliest combination in my opinion.

Second, I'd certainly recommend play framework.

Re: Writing a website in Rust

#79

Well, IMHO, "the right hammer for the right nail". Rust is a great systems language (besides the lack of bitfields) but I wouldn't use it as a web language. Just as much as I wouldn't use C++ to develop webapps. Sure you can do it but then again there are far easier ways to achieve your goal.

Bitfields are evil...the fact that the language designer left them out signals he/they have good taste...I have to get around to trying out Rust.
Post reply on HN