I just bought the first non-fiction book in ages: „Zero To Production In Rust“ (https://www.zero2prod.com/index.html)
I just bought the first non-fiction book in ages: „Zero To Production In Rust“. I'm eager to read it!
Open Source Software and publications by Christian Kruse
This page contains random thoughts and impressions by me.
I just bought the first non-fiction book in ages: „Zero To Production In Rust“. I'm eager to read it!
After years of listening to the Linux Unplugged podcast I had to remove it from my feed today. Their Bitcoin praise just got unbearable. :(
I really like the SwiftUI tutorial videos by Martin Lexow, e.g. this one. He doesn't waste much time and just shows what SwiftUI is capable of and how to work with it.
„Nun sag doch etwas“. Tidbit:
Und ich habe keine Ahnung. Und ich möchte nicht Teil einer Desinformation sein.
Darf ich Sie um etwas bitten? Halten Sie es genau so. Das Web ist nur dann ein guter Platz, wenn wir es dazu machen.
The last few days I had a lot of fun with Relm4. It is an Elm inspired GTK abstraction.
The main problem I had when using gtk-rs directly was managing state. Either you use a Rc<RefCell<_>>
and pass it around or you use a background thread managing the state and channels to communicate with it.
Both ways are tedious.
Relm4 abstracts that away and helps managing state in a much better way:
use gtk::prelude::{BoxExt, ButtonExt, GtkWindowExt, OrientableExt};
use relm4::{send, AppUpdate, Model, RelmApp, Sender, WidgetPlus, Widgets};
#[derive(Default)]
struct AppModel {
counter: u8,
}
enum AppMsg {
Increment,
Decrement,
}
impl Model for AppModel {
type Msg = AppMsg;
type Widgets = AppWidgets;
type Components = ();
}
impl AppUpdate for AppModel {
fn update(&mut self, msg: AppMsg, _components: &(), _sender: Sender<AppMsg>) -> bool {
match msg {
AppMsg::Increment => {
self.counter = self.counter.wrapping_add(1);
}
AppMsg::Decrement => {
self.counter = self.counter.wrapping_sub(1);
}
}
true
}
}
#[relm4::widget]
impl Widgets<AppModel, ()> for AppWidgets {
view! {
gtk::ApplicationWindow {
set_title: Some("Simple app"),
set_default_width: 300,
set_default_height: 100,
set_child = Some(>k::Box) {
set_orientation: gtk::Orientation::Vertical,
set_margin_all: 5,
set_spacing: 5,
append = >k::Button {
set_label: "Increment",
connect_clicked(sender) => move |_| {
send!(sender, AppMsg::Increment);
},
},
append = >k::Button {
set_label: "Decrement",
connect_clicked(sender) => move |_| {
send!(sender, AppMsg::Decrement);
},
},
append = >k::Label {
set_margin_all: 5,
set_label: watch! { &format!("Counter: {}", model.counter) },
}
},
}
}
}
fn main() {
let model = AppModel::default();
let app = RelmApp::new(model);
app.run();
}
I really like that approach!
After about 20 years of using Emacs (not always exclusively) I now dabble into Neovim. 🤯
It's a bit sad how today everybody does a Twitter thread instead of writing a blog post. IMHO most Twitter threads should be blog posts. Same for Mastodon.
A pretty interesting article about Free Software, Open Source and the jndi issue. It sums up the reason why I don‘t want to be payed for my FLOSS projects.
Back to work… feels a bit unreal. Didn't have to work „between the years“ for ages.
Just released Webmentions 2.0.0 and Microformats 1.0.0. Be aware: support for Elixir below version 1.10 and OTP below version 23 has been dropped. Besides that it is just a maintenance release with updated dependencies.
Merry christmas, everyone! 🎄
„The Web3 Fraud“: another take why web3 is utterly bullshit. Tidbit:
So in the end web3 is a con job, a technological edifice that is beyond useless as anyone who attempts to deploy a real application will quickly discover. It is, however, an amazingly effective form of Nerd Sniping.
„The Third Web“ – a very interesting analysis by tante of the web3 hype and why it is bullshit. Everybody should read this.
„Good and bad Elixir“ - a blog post about what makes Elixir code good or bad. I don't agree with everything, but with most of it and I enjoyed the read.
Baldur Bjarnason wrote a pretty interesting article about the state of OSS in web development: „The Open-Source Software bubble that is and the blogging bubble that was“
A tidbit:
We’re working in an unstable industry, surviving at the whim of callous mega-corporations, and we spend our days treating people like shit.
And then again, there are things like this
It's fascinating to see how far we've come. I started programming during a school project, we visualized fractals like the Sierpinski triangle or the Julia set, and it took our computers hours, sometimes even days, to generate those images.
To learn GTK and Rust I implemented a Sierpinski triangle today myself, and I can't even see the program painting so fast is it.
This is still mind blowing to me.
I've been trying to grasp how to structure a Rust GTK application for some time now. The basic grasp was to use Rc<RefCell<_>>
to pass around application state. That seemed error-prone and cumbersome to me, and I was looking how other applications do it.
Today I stumbled upon an approach using message passing, which looks pretty promising to me. Have a look at this blogpost and this github repository. It seems to make handling state much more easy and less error-prone.
I think I will try to implement this approach in a beginner project.
Is there a goto way to create a wireguard VPN which fails over to a different endpoint when the original IP isn't reachable/loses packets?
Magit 3.0 released! Magit is just the best Git interface I've encountered. Magit alone is a reason to install Emacs on a machine.
Sacha Chua (@sachac on twitter) does so much good work with her Emacs news blog posts. If you are slightly interested in the Emacs ecosystem, I totally can recommend to read it.