Building a fast Electron app with Rust
- For an entirely data-driven application like Finda, having the ability to visually sketch and play in the production medium is essential — it’s impossible to effectively prototype a search-based interaction by pushing pixels around a graphic design tool.
Making WebAssembly better for Rust and for all languages
- If you add a few annotations to your Rust code, it will automatically create the code that’s needed (on both sides) to make more complex types work.
- Plus, if we’ve added any npm dependencies, we need to put those into the package.json manifest file.
- Make it easy to add the WebAssembly package as a dependency… to include it in JS module dependency graphs.
- That’s because bundlers reduce the number of requests that you have to make for module files, which means it takes less time to download your code.
- We’ll need to add some features to WebAssembly to make it easier for bundlers to emulate ES modules.
Repl.It 1.0: IDE that Grows from Playgrounds to Fullstack Apps
- If you want to use files, write to files, split your code into modules, etc., you just do that and behinds the scenes the environment will switch to one where you're interacting with the filesystem.
- You use it to listen on a port, any port you'd like; we'll detect that, host your server/repl on your Repl.it subdomain (forever!) and that's it you're developing/deploying an application.
- We also know that not all applications will grow incrementally so in typical Repl.it one-click-start fashion we've pre-setup a Django, Rails, Express, and Sinatra apps.
- Repl.it serverless apps are unique in that they're stateful and that the same repl, same protocol, same everything, that you use in development is deployed and running in production.
- After getting user-interest @pyelias is starting to explore building a full stack application using Django.
Rust's 2018 roadmap
- Part of the goal with the Rust 2018 release is to provide high quality documentation for the full set of new and improved features and the idioms they give rise to.
- The Rust Programming Language book has been completely re-written over the last 18 months, and will be updated throughout the year as features reach the stable compiler.
- Building on our work from last year, we will publish a 1.0 version of the Rust API guidelines book, continue pushing important libraries to 1.0 status, improve discoverability through a revamped cookbook effort, and make heavy investments in libraries in specific domains—as we’ll see below.
- The roadmap does not stipulate exactly what these resources should look like — probably there should be several kinds — but commits us as a community to putting significant work into this space, and ending the year with some solid new material.
Writing a Microservice in Rust
- With microservice, I mean an application that speaks HTTP, accepts requests, speaks to a database, returns a response (possibly serving HTML), packaged up in a Docker container and ready to be dropped somewhere in the cloud.
- Since we’re building a chat application, the two kinds of requests we’ll want to handle are POST requests, with form data containing the user’s name and the message, and GET requests with optional before and after parameters to filter by time.
- We’ll accept POST requests to our service’s root path ("/") and expect them to contain a username and message field in their form data.
- In such a case, parse_query will return an error message, which we can forward to the make_error_response function we wrote earlier.
- If the messages option contains a value, we can pass the messages on to render_page, which will return an HTML page that forms the body of our response, showing the messages in a simple HTML list.
Should you Rust in embedded yet?
- Rust managed to reduce presence of these bugs in the user-space software and is well positioned to work its magic on embedded firmware as well.
- Before rewriting all your embedded projects in Rust, it is prudent to consider Rust’s support for your hardware.
- Among the architectures natively supported by the Rust compiler ARM and MSP430 are the ones interesting for embedded use cases.
- Registers, however are not the end of the story… As I mentioned earlier, manufacturer libraries also provide convenience library functions as well as example driver implementations.
- Even then, if the pure Rust libraries do not serve your needs well enough, Rust’s great FFI support provides all means necessary to include the popular C libraries into your project.
- Minor changes to, say, linking or code generation, while compatible in the user-space world, may often cause issues for embedded firmware.