16 ms·
Sapper, a lightweight web framework written in Rust
- mikerichards 10y agoCan someone recommend a good IDE or editor with good IDE-like features for Rust? I think it's time for me to take the plunge and start learning a little bit about Rust. Also, I'm assuming the windows support is good these days?
- frewsxcv 10y agoRegarding your IDE question: https://areweideyet.com/ https://areweideyet.com/
- kibwen 10y agoAnd also https://www.rust-lang.org/ides.html https://www.rust-lang.org/ides.html
- kibwen 10y agoWindows is a first-tier platform, and can be counted on to work since Windows is the largest platform for Firefox, and hence enormously important for Mozilla. For working with Windows APIs, see https://github.com/retep998/winapi-rs https://github.com/retep998/winapi-rs
- zxcvcxz 10y agoEvery OS is a first tier platform for mozilla.
- nickpsecurity 10y agoMozilla is a business. They likely prioritize where they invest effort based on where their ad revenue comes from. Doing otherwise can hurt the business. kibwen implies that most revenue is from Windows users. So, Mozilla wants the Windows experience rock solid. That they have two, serious competitors on that platform reinforces that need. Fortunately for us, they also put plenty of effort into making it work on less-popular platforms like my Linux desktop. I'm grateful even if it's lower priority. :) Note: I'd be curious what OS's most Firefox and Rust developers use.
- dikaiosune 10y agoThat question may be answered soon (although the survey is also targeted at people not using Rust): http://blog.rust-lang.org/2016/05/09/survey.html http://blog.rust-lang.org/2016/05/09/survey.html I think it's about to close in the next couple of days. wink wink nudge nudge
- zxcvcxz 10y agoWell I've used Firefox on both Linux and Windows for years and the Linux version is better than the Windows version. More polished, faster, feels better integrated. The windows version is great too, but I believe a lot of the developers respect open source philosophy and therefore we get first class software for opensource operating systems. Chrome on the other hand sucked on Linux for a long time (but was really good when it first came out). Chrome is pretty good nowadays but still takes three minutes to start, whereas firefox just opens up. I don't use a lot of other mozilla software except rust (a little) and from what I remember they had spotty support for Windows when Rust first came out, but this is true of pretty much all new languages unless Microsoft creates it.
- nickpsecurity 10y agoI also thought Firefox ran better on Linux a bit. I decided to test your Chrome claim on my Core Duo 2 box running Ubuntu. I just downloaded Chrome from Software Center. First run took 2-3 seconds to usable browser. Something is wrong with your PC, distro, or installation. "but I believe a lot of the developers respect open source philosophy and therefore we get first class software for opensource operating systems" That's probably true to some degree. That the least, there might be more developers on FOSS boxes testing it which spots more problems. Hypothetical as I have no data on Rust to test it with.
- zokier 10y ago> Well I've used Firefox on both Linux and Windows for years and the Linux version is better than the Windows version. More polished, faster, feels better integrated Do you have any numbers on the "faster" aspect? Most comparisons I've seen put the Linux version solidly behind Windows version. As for features, for example video playback on Linux Firefox has severely lagged behind Windows version. It's not very long time ago that I needed to make some "non-recommended" about:config changes to get youtube working. Even integration-wise I think I have had more problems on Linux than on Windows, file associations, copy-paste, and misapplied themes being most notable issues that come to mind. I'm pretty sure that I've seen even Mozilla say that majority of developer effort goes to Windows first, and it shows. While you anecdotally might have had good luck, I'd claim that is atypical
- ch4s3 10y agoEmacs and Atom seem to have the most complete offerings via plugins like Racer. I'm quite happy with my Atom setup, but it is pretty far from turn key. 1.) You need to `cargo install racer` and add the bin to your path 2.) Clone the Rust source of your version of Rust, and add that to your path 3.) Install the plugin and set the paths in Atom
- quadrature 10y agomost of the popular editors have racer(autocomplete) integration. Personally I've found visual studio code to have a good mix of light weight and functional.
- deleted 10y ago[deleted]
- dikaiosune 10y agoI'm using Atom (on a fairly speedy machine, VS Code has some solid plugin support too) with: * atom-beautify (with rustfmt installed, `cargo install rustfmt`) * language-rust * linter + linter-rust (using cargo check, `cargo install cargo-check`) * you-complete-me (but YCM is not fun to install, so I'd recommend the racer plugin, both require the Rust source cloned and installed somewhere) Altogether, those plugins give a pretty good Rust experience.
- aji 10y ago+1 for racer, I use it with atom and it makes writing rust so much nicer. can't comment on the comparison with YCM, though
- dikaiosune 10y agoYCM uses racerd (https://github.com/jwilm/racerd https://github.com/jwilm/racerd) which keeps everything in a daemon process's memory instead of reparsing every time. It's a good bit faster (at least on my machine), but it uses racer under the hood for recommendations.
- aji 10y agosounds interesting, I'll have to give it a shot!
- TylerE 10y agoIs this like anywhere even close to the functionality of something like IntelliJ? Doesn't really sound like it. Linting and formatting, and completion does not an IDE make. How much code intelligence and introspection is there?
- dikaiosune 10y agoNot nearly as much as intellij. However the "linting" in this case is really just highlighting for compiler warnings and errors which are quite good in Rust. That said, you can use clippy (https://github.com/Manishearth/rust-clippy https://github.com/Manishearth/rust-clippy) to get some pretty solid static code analysis as a compiler plug in. Also, I am very closely following the progress of the rust intellij project, it's coming along nicely.
- m0th87 10y agoI've had a great time with Tokamak: https://vertexclique.github.io/tokamak/ https://vertexclique.github.io/tokamak/
- Thaxll 10y agoThe more I look at Rust the less I like the syntax, what are those? "Ok(())"
- nemaar 10y agoIt's an empty tuple stuffed into an enum variant called Ok. The empty tuple plays the role of the traditional void.
- dikaiosune 10y agoImportantly, it's the Ok variant of the Result<(), SomeError> type, which is richer than a boolean because it carries information about why/where an operation failed, not just whether it succeeded or failed. It's similar to (but not identical to): public void someOperation() throws SomeException { ... }
- cfallin 10y agoI like to compare it to the "comma error" idiom in Go, i.e., `result, err = doStuff(...)`. The Rust prelude's Result enum is a less ad-hoc version of that.
- dikaiosune 10y agoRight, and the Rust result also produces a compile-time warning (which can be escalated to an error) if the value isn't checked.
- yarper 10y agoIt supports that kind of error handling too, fn something() -> (String, String) ... let (result, err) = something() It's just that Result is preferable because you can pattern match on it
- kazagistar 10y agoThat would be fn something() -> (Option<String>, Option<String>) Because the Rust types aren't nullable by default. But that more clearly demonstrates that Result types are better since they enforce that the error and result are mutually exclusive.
- killercup 10y agoIt's good to see new web-focused projects in Rust, I think it can be a really great language for this kind of thing. But to be honest, I'm looking forward to seeing what will be considered the go-to approach for Rust web applications _in a year_ or so. There is much experimentation going on right now, with cool little innovations here and there, but I have yet to see an approach that looks really new and Rust-y to me. For example: Rust's type system certainly has some nice properties to track dependencies between middlewares[^1] but I'm not convinced middlewares are even the best approach possible here. Also, it will be interesting how a framework based on async IO will look and what tricks/syntactic sugar/macros will be employed to keep boilerplate code down. This is a pretty big order, of course: While I enjoy using small libraries, a well designed web framework requires a lot of organisational effort for all the small pieces to fit together nicely. I think most of the 'small pieces' are already there or at least well under way, by the way. For example: The async (mio) branch of hyper looks pretty solid for HTTP1/2, the Diesel ORM is fantastic (and will, according to creator Sean Griffin, soon hit 1.0), and handling JSON will only get better with future versions of serde. [^1]: As recently discussed in https://chrismorgan.info/blog/tween.html https://chrismorgan.info/blog/tween.html and some other posts concerning the use of sessions types in Rust.
- bjz_ 10y ago> For example: Rust's type system certainly has some nice properties to track dependencies between middlewares[^1] but I'm not convinced middlewares are even the best approach possible here. There's a good discussion of this on /r/rust: https://www.reddit.com/r/rust/comments/4lz92j/tween_a_middleware_library_experiment/ https://www.reddit.com/r/rust/comments/4lz92j/tween_a_middle... I'm pretty interested in tomakas's approach, which seems to avoid the approach of middlewares, in favor of explicitness: https://www.reddit.com/r/rust/comments/4lz92j/tween_a_middleware_library_experiment/d3rhglt https://www.reddit.com/r/rust/comments/4lz92j/tween_a_middle...
- steveklabnik 10y agoFun fact: crates.io is written with a Rust + Ember + Postgres stack, though with its own framework, condiut, rather than Sapper. It uses about 30 megabytes of memory resident. Coming from Rails world, this was... quite the change. Also fun fact: we had a small amount of downtime today :( Type safety can't protect you from everything. https://users.rust-lang.org/t/crates-io-is-down-fixed/6060/6?u=steveklabnik https://users.rust-lang.org/t/crates-io-is-down-fixed/6060/6...
- yarper 10y agoThis framework seems to have practically the same API as nickel.rs https://github.com/nickel-org/nickel.rs https://github.com/nickel-org/nickel.rs
- Corianderine 10y agoInteresting, when would I use this (and Rust) over some other new web frameworks like Amethyst (Crystal) and Jester (Nim)? https://github.com/Codcore/amethyst https://github.com/Codcore/amethyst https://github.com/dom96/jester https://github.com/dom96/jester