Arwalk on Nostr: > You can't have a generic vector or map, and just destroy it. But you can? This test ...
> You can't have a generic vector or map, and just destroy it.
But you can?
https://gist.github.com/Arwalk/69f58af46563dd56e80e4485963a1b56
This test would fail to run if there were any leak, that's what the testing allocator is for.
hasFn is also completely solved at compile time so there is no extra overhead for the list if it has no need to be deinit.
You've been talking about about zig recently, and i'm sorry to be blunt but you've been wrong on a lot of things.
First, zig is to C what rust is to C++. Trying to compare both language when they do not live in the same paradigm (one being imperative, the other object oriented) is simply a bad idea.
You should probably stop fueling the fire and showing that you haven't taken the proper time to explore zig.
I'm not telling you to use zig if you don't want to or that zig is better than rust. Programming languages are tool that fit many uses, and different approaches. If you were more confident in the results of your code using Rust, it's perfectly fine. Just like if someone else could have made it in zig.
But just like i avoid making bold assumptions about rust considering my lack of deep knowledge and experience on it, maybe you should also abstain from doing the same?
Don't feed the trolls, the only answer for the question "why not zig" should have been "because rust fits the needs i have as a developper, and the use case as a tool for what i'm doing".
Published at
2024-10-18 09:14:50Event JSON
{
"id": "253ef7944ae29dd38f0ca02c9da9e619de1831d9124e8bd36bc15c20f647a9bc",
"pubkey": "e2f70faa0e86a23f56aec4f1e0b978c83ba024b2532fe6bbb770e9c5ebda0949",
"created_at": 1729242890,
"kind": 1,
"tags": [
[
"p",
"c1812ca9433e5d31c5e35e9546d0f819d016ca6eabe98053daa6d40831179ec2"
],
[
"e",
"a06f2965a6f563e6b3411a35954b50bc4c2e67ee43e8fc73e601b6cadf7099d7",
"",
"reply",
"c1812ca9433e5d31c5e35e9546d0f819d016ca6eabe98053daa6d40831179ec2"
],
[
"e",
"916ef1ae066cc47e798614903515a0047a5e1b9b960662ba9d7cebeb3f3bf4cf",
"",
"root",
"c1812ca9433e5d31c5e35e9546d0f819d016ca6eabe98053daa6d40831179ec2"
],
[
"proxy",
"https://outerheaven.club/objects/909d1746-a856-4984-8a58-be4214014fe9",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://outerheaven.club/objects/909d1746-a856-4984-8a58-be4214014fe9",
"pink.momostr"
],
[
"-"
]
],
"content": "\u003e You can't have a generic vector or map, and just destroy it.\r\n\r\nBut you can?\r\n\r\nhttps://gist.github.com/Arwalk/69f58af46563dd56e80e4485963a1b56\r\n\r\nThis test would fail to run if there were any leak, that's what the testing allocator is for.\r\nhasFn is also completely solved at compile time so there is no extra overhead for the list if it has no need to be deinit.\r\n\r\nYou've been talking about about zig recently, and i'm sorry to be blunt but you've been wrong on a lot of things.\r\n\r\nFirst, zig is to C what rust is to C++. Trying to compare both language when they do not live in the same paradigm (one being imperative, the other object oriented) is simply a bad idea.\r\n\r\nYou should probably stop fueling the fire and showing that you haven't taken the proper time to explore zig. \r\n\r\nI'm not telling you to use zig if you don't want to or that zig is better than rust. Programming languages are tool that fit many uses, and different approaches. If you were more confident in the results of your code using Rust, it's perfectly fine. Just like if someone else could have made it in zig.\r\n\r\nBut just like i avoid making bold assumptions about rust considering my lack of deep knowledge and experience on it, maybe you should also abstain from doing the same?\r\n\r\nDon't feed the trolls, the only answer for the question \"why not zig\" should have been \"because rust fits the needs i have as a developper, and the use case as a tool for what i'm doing\".",
"sig": "de0ae9133c78061ca303c9029eeb78b915ed6945a1f3a4563f92ccfbff6f3892ae8edc8eb88b1ce97e67ec892738c28f5e5357503869399d99fb39f433725261"
}