Rasmus.krats.se

English

Skriverier då och då, på webben sedan 1995

Taggat rust

Propagandacykling

Publicerad taggat , , , , , , .

Jag har inte lagt upp någon propagandacykling här på bloggen på ganska länge. Naturligtvis cyklar jag fortfarande till jobbet de flesta av de dagar jag inte jobbar hemifrån, och jag brukar ta en bild och lägga ut på twitter.

Men jag har ett projekt för att organisera mitt bildarkiv på gång också. Det har kommit så långt att det är smidigare att lägga upp mina bilder där än här. Så vill du se mina samlade cykelbilder så finns de där!

Men jag får väl inkludera tre ganska färska bilder här också.

Bild
Bild
Bild

Kommentera inlägget

Rust and the web in 2018

Publicerad taggat , , , .

There is A Call for Community Blogposts over at the Rust Programming Language Blog. This is my entry.

I mainly do "server-based" web service development. The server sends html, css, images, and javascript to the browser. The javascript implements progressive enhancement for the content, but the site should be usable and as nice as possible even with javascript disabled. So while I certainly do RESTful json API:s, I also do server-side html templateing, css (and scss) minification, etc. I think Rust has great potential here, partly because of optimization and execution speed, but mainly because the type safety and fearless concurrency make it easy to actually get things right and avoid unpleasant surprises at runtime.

My wish for Rust in 2018 is a nice and convenient web service framework that runs on stable rust and gets maintenance and regular updates for many years to come. My intent for 2018 is to continue to maintain and improve ructe (and rsass), and try to integrate it with the best such framework i can find.

I currently have two web service projects in rust: homesite is a trivial example using iron and rphotos (https://img.krats.se/) is a more ambitious photo gallery / management app using nickel. Unfortunately, both iron and nickel seems more or less abandoned, as both still depend on hyper version 0.10.

Rocket.rs seems awesome, but requires unstable rust, and I would prefer to build my projects with the stable toolchain.

Maybe gotham can be the framework I'm looking for? I think it needs a lot easier request routing and path extraction, but there seems to be work going on to fix that. And maybe that is something I can help create? There are some issues tagged discussion and help wanted which might provide good starting points. And there is the Gotham book to read.

Or maybe either iron or nickel will make a comeback? There are open issues in both about working with hyper version 0.11 (iron#501 and nickel.rs#402), even if they haven't seen much activity recently.

Kommentera inlägget

A compiling template system in Rust

Publicerad taggat , , , .

When developing web applications, it is often useful to have a template system. Something that lets you write generic versions of web pages, that the application can fill with the specific content for each page it should show. There exists lots of "languages" to write such templates, such as mustache, jinja2, and play 2 scala templates (twirl).

Most fits very well with a dynamic language, where you can get properties from an object, or even call a method, by its name in a plain string. In a statically compiled language, the actual names of fields and methods are not relevant, and generally not present, after compilation. This makes a "dynamic" template language a hard match for a compiling language such as rust. So why not try to create a better match?

Läs och kommentera inlägget A compiling template system in Rust