Linux Has Finally Lost Its MAGIC!?!

preview_player
Показать описание
MAGIC numbers were a big part of Linux development for a very long time very long time but that's finally coming to an end with a recent patch set but what are MAGIC numbers anyway

==========Support The Channel==========

==========Resources==========

=========Video Platforms==========

==========Social Media==========

==========Credits==========
🎨 Channel Art:
Profile Picture:

#Linux #OpenSource #LinuxKernel #FOSS

🎵 Ending music

DISCLOSURE: Wherever possible I use referral links, which means if you click one of the links in this video or description and make a purchase I may receive a small commission or other compensation.
Рекомендации по теме
Комментарии
Автор

It's really infuriating that it's not even a year in and Rust has already removed the magic from the Linux kernel. Those kids ruin everything they touched.

ensnep
Автор

I am so happy this is going away. Magic is a form of witchcraft and that’s not okay in my book. I would prefer angel_numbers, or prophet_numbers.

JoshDoingLinux
Автор

"What does that 10 actually mean? Is it your number of fingers? Is it the number of toes you have? [...] What if that number changes? Well, now you need to go and manually change all of those loops."
Honestly, I think if my number of fingers or toes changes, I've got bigger things to worry about 😉

kpcraftster
Автор

Interesting. When I hear the term "magic numbers" in relation to Linux the first thing I'd think of are the bytes at the start of many file formats that indicate what type of file it is e.g. PNGs starting with \x89PNG or WebAssembly files starting with \0asm which allows tools like "file" or e.g. image viewers to figure out what something is.

vader
Автор

"Being over 30 years old..." <starts to feel personally attacked> ..." Linux has been through many developmental changes...." <oh thank god it wasn't actually about me!!>

StarlordStavanger
Автор

What we need is a GPT3-Doc A.I to go through and auto document the code. It could also write to developers to tell them where they were documentation deficient.

DrWrapperband
Автор

When I read "magic numbers" my first thought is just the concept in fighting games,
which varies in name between franchises. But the original term often just shortened to magic
is what's commonly used, essentially. A sequence of inputs that always guarantees they will connect
(Blocking and such not withstanding) bread and butter inputs basically. This is just as interesting tho

RadikAlice
Автор

We should have a Gathering to discuss the Magic

esra_erimez
Автор

A bunch of very modern APIs, I'm thinking recent Khronos Group ones like Vulkan or OpenXR has, for the first field of every single structure, a type number that is more or less a magic number.

They are used because, every single structure in these API could be aliased as a pointer to meaningless types like "VkBaseInStructure*".

Also, every structure passed to any API command may be the start of a structure chain (basically a linked list), This is how arguments are passed to API calls in both OpenXR and Vulkan. The structure chain system allows the runtimes to implement extensions that makes API calls do "more stuff" and thus require more input or output arguments.

In all cases, since any type can be aliased, and because these APIs are defined in "pure old C" language, this is the only way to recover the intended type of a struct from a typeless pointer.

Ybalrid
Автор

Thanks. I have heard (read) the term 'magic numbers' a few times, but I was never sure what they meant.

Kneedragon
Автор

2:35. This magic number is not a "checksum" (that would change depending on the contents), but a type identifier used in a manner as it would be done in RTTI (Run-Time Type Identification). It was kernel developers inventing OOP in C.

Gregorius
Автор

At least we still have user level magic.
Thanks file(1). :-)

billeterk
Автор

I almost forgot that programming term. Looking at the Lua scripts I’ve seen in Open Hexagon, they are almost all magic numbers.

OcteractSG
Автор

Since you mentioned it at the beginning, what do you think the ideal versioning system for Linux should be?
Do you think they should actually try to figure out the major minor system and match changes major and minor changes for compatibility?
Should they do like Year Month Day or something like that?
Should they just switch to numbers? It'd be something like 115 or so now I think. The first 6 was 108 I believe.
I'm partial to just a straight numeric myself

DylanMatthewTurner
Автор

My colleagues often use magic numbers in their code. But we have tools that reports errors when it finds magic numbers. So, my colleagues start to introduce global constants for those numbers: TEN = 10. Mission accomplished, right? 🤦🏼

marloelefant
Автор

Interesting history of which I was unaware.

Omnifarious
Автор

Today I woke up to an urge of creating 3 new linux 3 do the same and are just renamed fedora

arkvsi
Автор

Magic is not a weird practice. It's actually very sensible to identify things

casperes
Автор

Nice blue wizard hat Brodie, what’s your magic level?

tormstorm
Автор

I still dont understand what MAGIC actually is

yamaddie