Never had one, just partied in the uni and dropped out :D
Never had one, just partied in the uni and dropped out :D
So basically your typical network protocol is something that converts an async stream of bytes into things like Postgres Row objects. What you do then is you write a synchronous library that does the byte conversion, then you write an asynchronous library that talks with the database with async functions, but most of the business logic is sync for converting the data coming from the async pipe.
Now, this can also be done in a higher level application. You do a server that is by nature async in 2024. Write the server part in async, and implement a sync set of mapping functions which take a request coming in and returns a response. This can be sync. If you need a database, this sync set of functions maps a request to a database query, and your async code can then call the database with the query. Another set of sync functions maps the database result into http response. No need to color everything async.
The good part with this approach is that if you want to make a completely sync version of this library or application, you just rewrite the async IO parts and can reuse all the protocol business logic. And you can provide sync and async versions of your library too!
That’s why you write your protocol as a sync library, then implement the async IO separately and mapping the data over the protocol modules.
Divide and conquer…
Ugh, luckily I’ve been able to choose my hardware and OS for the past… 16 years at work. I would hate to use somebody else’s choice of desktop for programming. Actually once said no to a work offer when they said they’ll give only MacBooks for the people.
Yep. But you pay only for the CPU time you use and very often the only IO you can do is HTTP due to the runtime.
Don’t forget mailing lists! LKML FTW
If you want something that is quite a nice editor too but doesn’t require hundreds of lines of configuration, try helix. It also has nice help menus so it’s fast to learn. I’ve used vim since the 90’s and Emacs for many years, but nowadays I kinda just like hx how it just works with zero configuration for any programming language I need to work with.
Refactoring that parser you did for the internal DSL in 2011.
I’m a vim and emacs user for some decades already. I had this urge one day to try and work with helix. It kind of misses some things such as file manager or editorconfig support. Nine months later I’m still using helix. It still misses these things, but I really started to like how I don’t need any plugins to work with it and I need about five lines of configuration to have a usable editor. Probably going to continue using it.
And it is written in Rust, which is my main language and I can just jump in to the editor source and fix things if needed.
I miss magit and org from emacs a lot though. Every time I need to write an article, I do it in emacs.
Took me the whole day. The new migrations require PostgreSQL version 15, and my Akkoma and Lemmy are using a shared database server of version 13. First shut down both services, then update Debian from 11 to 12, PostgreSQL from 13 to 15 and after all this, redeploy Lemmy to start the migrations. The new Lemmy queries use more RAM compared to the previous version, so the database was getting OOM and I needed to upgrade to a bigger instance.
Not fun, but everything works now and is stable.
Ping @codinghorror@infosec.exchange
And now everybody can access it with the original link. It’s not super convenient yet when the community is not federated, I hope it’ll get better in the future versions of Lemmy.
You should use the search first. Search for https://lemmy.world/c/dfw and wait until it appears in the results. Then click the link and subscribe.
It might take a few secs, depending on the server load.
It kind of fails with certain protocols. I once wrote an async MSSQL client for Rust, and some data doesn’t say its size in the headers. So this kind of forced the business logic to be async too.