Live data from Hacker News

Rewriting my blog in Rust for fun and profit

jonashietala.se

21–30 of 116 posts

Re: Rewriting my blog in Rust for fun and profit

#21

It’s refreshing to see a front-page Rust piece that just nails it on promoting the language. It cites concrete examples of where the rubber really meets the road: e.g. Cargo as a one-stop-shop for platform insensitive, “just works” build and dep management. It acknowledges that it’s ok for fun and novelty to be features, which it is! It steers well clear of A >> B nonsense. No preachy TED talk about memory safety. It…

(Ignoring the language itself for a moment) I absolutely love cargo. It’s so productive & easy to use. I have never had the pleasure of using such a painless cross platform build system. I’m neutral on Rust itself but Cargo is awesome.

Re: Rewriting my blog in Rust for fun and profit

#22
post #7

I've been trying to make a cool static site generator numerous times. Well, yes, it actually is a quite fun thing to tinker with, but I've found myself struggling to decide on what do I want to see in the final app and what I do not; what features might be needed by other users and what features might be an overkill. So I ultimately went with Zola[1] and encourage you to try it too! Aaaand it is written in Rust, too.…

I plan on writing a static site generator soon myself. And I briefly wondered the same thing and realized that I could very easily answer that question: ruthlessly build whatever I personally need and not what others need. I don't usually follow that line of thinking, but the static site generator space is so full of so many great tools that I don't think there's really anything for me to contribute to it. Instead, I…

You should check out what fasterthanlime does for their blog. Theirs uses sqlite for storing all state and the write plugins into the Rust Liquid template implementation to directly query sqlite so they could do whatever they wanted without recompiling. It was pretty neat.

I have been looking to break out parts of static-site-generators to make it easier to bring one up. So far I only have two primitive building blocks

- https://docs.rs/engarde/latest/engarde/ - https://docs.rs/file-serve/latest/file_serve/

Re: Rewriting my blog in Rust for fun and profit

#23
post #7

I've been trying to make a cool static site generator numerous times. Well, yes, it actually is a quite fun thing to tinker with, but I've found myself struggling to decide on what do I want to see in the final app and what I do not; what features might be needed by other users and what features might be an overkill. So I ultimately went with Zola[1] and encourage you to try it too! Aaaand it is written in Rust, too.…

I plan on writing a static site generator soon myself. And I briefly wondered the same thing and realized that I could very easily answer that question: ruthlessly build whatever I personally need and not what others need. I don't usually follow that line of thinking, but the static site generator space is so full of so many great tools that I don't think there's really anything for me to contribute to it. Instead, I…

I've done exactly what you describe and I highly recommend it.

My personal website is served by a couple hundred lines of Rust. There is no database or ORM -- I just defined structs like `BlogPost` or whatever and stuck a `#[derive(Serialize, Deserialize)]` on it and use the `serde` library to JSONify it, store it flat in a hard-coded folder.

I even wrote my own dead-simple Markdown-ish flavor that is tailored exactly to my writing style. I use a lot of em-dashes, for example, so it translates `--` into `—` (rather, &mdash). Or, since a lot of my posts link to other posts, I can do `[post title_of_other_post]` and it'll generate the appropriate link.

Whenever I want a new feature while writing a particular blog post, e.g. pretty inline SVG, I just go add it and then keep writing.

Re: Rewriting my blog in Rust for fun and profit

#24
post #17
post #13

Earlier quoted context omitted.

I moved from Jekyll to Zola and it's been great until I started tinkering with templates and stuff recently. Single binary and simple themes were main reasons to choose this. Wanted a feature that wasn't present in the version I started with (about 2 years ago). So, I got the newest version and a few things broke subtly (ex: syntax highlighting). Which led me to tinkering (I don't know much about HTML/CSS/etc). It wa…

That's exactly why I never used Jekyll and don't really understand people that use it nowadays. It is AWFUL. Not only it uses greatly outdated Ruby, you also HAVE to install outdated Ruby on your machine to play with themes, serve, compile and are forced to use RVM. I know GitHub Pages can compile the page for you, but when you want to customize a theme you have to go through all that hell. It's just a terrible exper…

I use Jekyll for a few sites and it works perfectly. Design is bootstrap and so nothing to do with Jekyll and it always compiles the site, takes a few seconds. Works fine on my mac and linux.

Would I have picked Jekyll today? no. Is it worth the cost of switching? no.

Re: Rewriting my blog in Rust for fun and profit

#25

It’s refreshing to see a front-page Rust piece that just nails it on promoting the language. It cites concrete examples of where the rubber really meets the road: e.g. Cargo as a one-stop-shop for platform insensitive, “just works” build and dep management. It acknowledges that it’s ok for fun and novelty to be features, which it is! It steers well clear of A >> B nonsense. No preachy TED talk about memory safety. It…

Your comment helped me want to click through and read the post. I'm very tired of all the recent Rust fanboy posts, but level-headed and earnest comparisons against real implementations make for much better understanding of a new concept or language. Here are some select quotes from the article: > Please note that this is not to say that Rust this [sic] much faster than Haskell, instead see it as a comparison of two…

The author is clearly an experienced and mature hacker who knows many languages well. It’s pretty difficult to maintain the shrill “X is better than everything” tone you’re referring to with a diverse portfolio of marketable skills.

I don’t know how Rust, which is quite a cool language, attracted this sizable bloc of aggressively intermediate jihadis, but it’s really worrying because Rust is in fact innovative and important, but epic languages have crashed and burned over less.

Re: Rewriting my blog in Rust for fun and profit

#26
I enjoyed this post. The premise is a good one, as in for fun. A lot of these "I wrote X in Y" go on some spree of questionable assertions but "because I wanted to" is intellectually honest and understandable.

I agree with a lot of the points about Rust too. Every language is a selection of tradeoffs and for me Rust's chosen tradeoffs I think are both important (eg memory safety) and reasonable.

Take something like Cargo. The author says "It just works". This is my experience as well. But more importantly, dependency management and packaging were built into the language and ecosystem from the start. It still boggles my mind that any language that came after Java didn't do this (yes, I'm looking at you, Go).

My heart did sink a little bit at "Using Regex of course!" though.

Re: Rewriting my blog in Rust for fun and profit

#27
post #7

I've been trying to make a cool static site generator numerous times. Well, yes, it actually is a quite fun thing to tinker with, but I've found myself struggling to decide on what do I want to see in the final app and what I do not; what features might be needed by other users and what features might be an overkill. So I ultimately went with Zola[1] and encourage you to try it too! Aaaand it is written in Rust, too.…

Finding a good static site generator wasn't really the author's point. It was more for the fun of writing something in Rust.

But I appreciate the link to Zola. I haven't looked in this space for awhile and it looks good.

Re: Rewriting my blog in Rust for fun and profit

#28
post #21

It’s refreshing to see a front-page Rust piece that just nails it on promoting the language. It cites concrete examples of where the rubber really meets the road: e.g. Cargo as a one-stop-shop for platform insensitive, “just works” build and dep management. It acknowledges that it’s ok for fun and novelty to be features, which it is! It steers well clear of A >> B nonsense. No preachy TED talk about memory safety. It…

(Ignoring the language itself for a moment) I absolutely love cargo. It’s so productive & easy to use. I have never had the pleasure of using such a painless cross platform build system. I’m neutral on Rust itself but Cargo is awesome.

Cargo takes a rather brute-force approach to the hard problems, but it generally just fucking works, which is a comically under-rated feature!

On the one hand, it’s depressing that Cargo is forced to “go it’s own way” in order to achieve some sanity because it can’t can’t trust the platforms, but working is working and I can’t remember more than one or two times I’ve seen it shit the bed. It’s pragmatic, useable, discoverable, and industrial strength.

Re: Rewriting my blog in Rust for fun and profit

#29
post #27
post #7

I've been trying to make a cool static site generator numerous times. Well, yes, it actually is a quite fun thing to tinker with, but I've found myself struggling to decide on what do I want to see in the final app and what I do not; what features might be needed by other users and what features might be an overkill. So I ultimately went with Zola[1] and encourage you to try it too! Aaaand it is written in Rust, too.…

Finding a good static site generator wasn't really the author's point. It was more for the fun of writing something in Rust. But I appreciate the link to Zola. I haven't looked in this space for awhile and it looks good.

You’re welcome! Just wanted to share what did I come to in the end following the same route.

Re: Rewriting my blog in Rust for fun and profit

#30
post #26

I enjoyed this post. The premise is a good one, as in for fun. A lot of these "I wrote X in Y" go on some spree of questionable assertions but "because I wanted to" is intellectually honest and understandable. I agree with a lot of the points about Rust too. Every language is a selection of tradeoffs and for me Rust's chosen tradeoffs I think are both important (eg memory safety) and reasonable. Take something like C…

I honestly highly recommend the approach. Anytime I get excited about a new technology, I rewrite my blog in it. Gives me a simple live project with real traffic and all the right moving parts.

Last time I did it was with Elixir + Phoenix + PostgreSQL, without any standard or reasonable approach. It was a lot of fun and still using it today.

https://www.brightball.com/articles/insanity-with-elixir-pho...

Post reply on HN