fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

10K
active users

Replied in thread

@davedelong, they mention @rust #Serde framework, so they are not too far from your idea.

“The Serde ecosystem consists of data structures that know how to serialize and deserialize themselves along with data formats that know how to serialize and deserialize other things.”

Continued thread

Ok, a (half a) day of satisfaction was enough.
Everything works well still, but there is room for optimization. Not the optimization of #rust code, but of the RMI structure itself. There needs to be a family of RMI request structs, and I'm thankful to #rust for not providing me with #oop stuff, because I really don't need going down that rabbithole.
Containment will suffice, I'm just eager to see what #serde will have to say about it...

EDIT: answer found, please see downthread

Coding question: is there something for #python like #serde where the serialized version of the data can be a format you define, not Just Fucking JSON

Before you ask: no I can't change the format to JSON, it's hardcoded into this DVD player I have. Yes, you read that right.

Написать X-docker-isolation-provider сложно — но не невозможно

Вы когда-нибудь чувствовали себя пионерами? Вот именно так я себя и ощущал, когда писал docker-isolation-provider для платформы ассоциативного программирования Deep . Все было так: в один прекрасный день у нас на платформе связей решили - было бы славно портировать нашего бота в Deep . А для этого нужно было написать так называемые провайдеры . Провайдеры нужны лишь для одной цели - дать возможность пользователю выполнять пользовательские хэндлеры на любом языке. Тогда я просто подумал, что было бы неплохо помочь парням, которые вероятно Rust никогда в жизни не видели . Ох, как же я тогда ошибался…

habr.com/ru/articles/822093/

ХабрНаписать X-docker-isolation-provider сложно — но не невозможноВы когда-нибудь чувствовали себя пионерами? Вот именно так я себя и ощущал, когда писал docker-isolation-provider для платформы ассоциативного программирования Deep . Все было так: в один прекрасный...

TPM2 command encoding with #bincode and #serde:

            let options = DefaultOptions::new()
                .with_fixint_encoding()
                .with_big_endian();
            buf.extend(&options.serialize(&(Tag::NoSessions as u16)).unwrap());
            buf.extend(&options.serialize(&22_u32).unwrap());
            buf.extend(
                &options
                    .serialize(&(CommandCode::GetCapability as u32))
                    .unwrap(),
            );
            buf.extend(&options.serialize(&(Capability::Handles as u32)).unwrap());
            buf.extend(&options.serialize(&HR_PERSISTENT).unwrap());
            buf.extend(&options.serialize(&1_u32).unwrap());

Form data (x-www-form-urlencoded) support in #Axum is a bit disappointing. It uses #serde’s serde_urlencoded underneath, which in principle is fine. But the problem is that HTML forms don’t let you *not send* a value, which makes the whole thing useless with optional fields. You can set a field in a form to not be required and send an empty value (`?foo&bar=3&…` or `?foo=&bar=3&…` for empty `foo`) but then serde treats it as a present empty string and fails deserialization.

I've just tagged a new release of Crell/Serde, version 1.2.

This release includes support for Unix timestamps, makes TypeFields more flexible and customizable, and fixes an issue with handling null values. Note that the latter fix has a very small BC break that only impacts a select number of custom Importers, so odds are you won't notice.

Get it while it's hot!

github.com/Crell/Serde

GitHubGitHub - Crell/Serde: Robust Serde (serialization/deserialization) library for PHP 8.Robust Serde (serialization/deserialization) library for PHP 8. - Crell/Serde
Continued thread

And I’ve thrown out that solution again. Instead of messing with serde::Deserialize which never quite works as it should, I’ve decided to extend the API and support flattened structs properly. I’ve added my solution to this already much too long thread where lots of people spent lots of time trying to make things somehow work with Serde’s APIs.

GitHubAvoid lossy buffering in #[serde(flatten)] · Issue #2186 · serde-rs/serdeBy sfackler

I finally managed to create a serde::Deserialize implementation that would support flatten and deny_unknown_fields at the same time. The issue was mostly how the Serde API makes this task difficult for no good reason from what I can tell.

I sort of see why it has to be static strings everywhere, but why static slices as well? That’s an implementation detail of the default implementation and IMHO not actually required anywhere. And why is it so hard to get to the list of fields supported by an implementation?

I guess this use case was never a priority, but configuration files where a typo in a field name won’t be recognized are a major PITA…

Кратко про Serde в Rust

Serde — это высокопроизводительная библиотека для сериализации и десериализации данных в Rust. Она поддерживает различные форматы данных, включая JSON , YAML , TOML , BSON и многие другие. В этой статье рассмотрим основы Serde в Rust.

habr.com/ru/companies/otus/art

ХабрКратко про Serde в RustПривет, Хабр! Serde — это высокопроизводительная библиотека для сериализации и десериализации данных в Rust. Она поддерживает различные форматы данных, включая JSON , YAML , TOML , BSON и многие...