Very nice write up. As a Go programmer, Rust is really interesting. Can't wait until you can build web APIs with it.
Writing a website in Rust
41–50 of 141 posts
Re: Writing a website in Rust
#42Earlier quoted context omitted.
Super fast, type safe (and thread safe in Rust), compiled, low/no cost abstractions
Super fast? More like Java ballpark: http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...
Re: Writing a website in Rust
#43Earlier quoted context omitted.
Hmm.. Rust was created to support the new browser, browsers mainly manage DOM objects.. I wonder why you are using a legacy garbage collector in order to handle primary tasks rather than having that part of your core design?
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?
Re: Writing a website in Rust
#44Well, 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.
Out of curiosity (I've never done systems programming), what are some of the things that make a language more suited to systems programming rather than web (other than libraries and community support - I'm more interested in the intrinsic qualities of the language)?
Re: Writing a website in Rust
#45There also was [this plugin](http://www.reddit.com/r/rust/comments/2krdbu/rest_easy_a_lin...), but it's outdated at the moment (I can upgrade it later).
Regarding imports, `use foo::bar::*` works.
Re: Writing a website in Rust
#46Earlier quoted context omitted.
While I agree with some of your arguments, namely that "popularity and merit are not the same thing", I think saying that Mozilla is "trapped in a pseudo-C++ mindset" and that its new browser would ideally be written in Nim is plain wrong. The fact that using Rust to write a simple website isn't very handy doesn't mean it's a bad language. Web development simply isn't its primary focus: this is a systems programming…
The idea that you can't get something good without a trade-off involving something bad is a false belief, an over-generalization that is very popular among people from all walks of life, including, unfortunately, technologists. Trade-offs do exist, but even a sword in fact has many more than two aspects.
Re: Writing a website in Rust
#47Earlier quoted context omitted.
Out of curiosity (I've never done systems programming), what are some of the things that make a language more suited to systems programming rather than web (other than libraries and community support - I'm more interested in the intrinsic qualities of the language)?
Outside of userland tasks like file manipulation, it is impractical to use the popular web application languages like Java or scripting languages such as Javascript or PHP or Python for systems programming without employing interfaces or hooks to libraries or programs written in languages that are compiled to machine code, simply because programs in those languages are commonly deployed using virtual machines or inte…
Re: Writing a website in Rust
#48Earlier 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.
For Servo we need a javascript engine. We're already using Spidermonkey. It has a GC for Javascript; we're already paying those costs. The Rust-side representation of DOM objects is also managed by the GC; that makes sense because these are tied to Javascript things.
We don't use the GC elsewhere. I think at some point we did, but the only place now in Servo where GC is used is where the data is strongly connected to data already managed by the SM GC.
Nim's GC is for general-purpose use in a language. Spidermonkey's GC is for GCing javascript, which already has an extensive runtime (which the GC ties into heavily). "Nim's GC is better than Spidermonkey's" is a statement of no value (and oversimplifies the situation) unless the context is specified. Using the SM GC to collect random Rust objects would be a bad idea. Somehow rigging up spidermonkey to use a Nim-like GC in Rust (all other things being the same) would also be a bad idea. Two different scenarios, two different GCs.
Re: Writing a website in Rust
#49The tooling for the web written in JavaScript is excellent, so I was curious, are there any options there are for calling JavaScript from Rust code? I know there is the ffi module for NodeJS that allows you to call Rust from JavaScript, but I was wondering if there is something that works well in the other direction.