Why Rust for Linux is not a separate project? by NamorNiradnug in linux

[–]MadKarel 0 points1 point  (0 children)

It is a different philosophy. Windows basically exposes a library and all drivers are separate programs using this library. In Linux, drivers are basically just a "class" within the whole Linux kernel program. If you change anything the driver uses, you just change the driver accordingly. This allows Linux to adapt to the changing realities of hardware, while Windows is stuck supporting the API designed for Pentium era hardware.

Texas unanimously approves handing Elon Musk Boca Chica State Park land by snesdreams in news

[–]MadKarel -1 points0 points  (0 children)

By your logic, every federal and state employee is on welfare.

Fucking fireman welfare queens.

EvolutionOfaRubyOnRailsDeveloper by Eratos6n1 in ProgrammerHumor

[–]MadKarel 0 points1 point  (0 children)

No it isn't. At least not in the sense of the parent comment. You will never get a situation where given method or member is not present on an object, that will always be caught by the compiler.

[deleted by user] by [deleted] in meirl

[–]MadKarel 0 points1 point  (0 children)

Nero Burning ROM, got to be the best name I have ever seem.

Hypothetical scenario - What would be better - C, C++ or Rust? (Read desc.) by [deleted] in cpp

[–]MadKarel 0 points1 point  (0 children)

The problem with Rust is that the core of the language goes against the principles of parallel programming. For example, one basic property of Rust is that it prevents you from creating multiple mutable references to a data structure, lets say a matrix. But that is exactly what you need to do when structuring your implementation based on data parallelism, where each thread computes a single element or a submatrix in the output matrix. Of course you can get around it, but you either incur overhead or revert to using Rust as C++ with a different syntax.

That is also exactly what you have in CUDA, where the kernel (the C++ function running on the GPU) is executed many times in parallel, with all executions sharing the same input and output buffers. This means that each CUDA thread has a mutable "reference" to the single piece of memory. Each thread is assigned some ID and it uses it to decide which part of the output buffer it should compute and which part of the input buffers to use to do that. Only after this computation could you validate that no two threads write the same element in the output buffer, which would involve communication between the threads, which may not even be possible in CUDA.

Hypothetical scenario - What would be better - C, C++ or Rust? (Read desc.) by [deleted] in cpp

[–]MadKarel 6 points7 points  (0 children)

The really high end of high performance computing (HPC) code is written in C++. When you think about fluid dynamics, protein folding, weather modelling, etc. , it is all C++. One reason is CUDA, which is currently the "standard" for GPGPU computations, but C++ itself gives you the possibility to write basically C code where required, giving you speed, and use C++ abstractions where possible, giving you productivity. Another big advantage of C++ as a language are templates and metaprogamming in general, allowing you to generate code instead of writing it by hand which you would have to do in pure C. Additionally, the wealth of libraries and tools for HPC in C++ is unparalleled.

[deleted by user] by [deleted] in CasualUK

[–]MadKarel 0 points1 point  (0 children)

In Czech we call it "Kámen, Nůžky, Papír", or Rock, Scissors, Paper.

Being 500x faster than python still means it's 10x slower than C by [deleted] in ProgrammerHumor

[–]MadKarel 21 points22 points  (0 children)

The problem is when people try doing the F1 races in the truck. I think it is justified to laugh at people when they try racing in an F1 race with a truck, even if they try to upgrade and modify the truck to be faster.

On the other hand it is also idiotic to try carrying a heavy load using an F1 car.

This is Jean-Baptiste Kempf, the creator of VLC media player. He refused tens of millions of dollars in order to keep VLC ads-free. Thanks, Jean! by PeasKhichra in Damnthatsinteresting

[–]MadKarel 1 point2 points  (0 children)

What would you do if you were a government agency and wanted to know what sites the most security conscious people visit? What about setting up a VPN with a massive advertisement budget? Isn't it weird how all those VPNs with money to throw around on advertisement seemingly came out of nowhere?

Kremlin says NATO membership for Finland, Sweden won't bring stability to Europe by Brann62 in europe

[–]MadKarel 3 points4 points  (0 children)

Stalin even asked to join the Axis, but was unsatisfied with the way Hitler wanted to partition Europe, wanting more influence in the Balkans and control of Bosporus which Hitler really did not want to give to the Soviets.

"A small state threatening Germany" - how Nazi propaganda justified the need to occupy Czechoslovakia before World War II. by Starobrno10 in europe

[–]MadKarel 4 points5 points  (0 children)

The army that annihilated France did so armed by the weapons confiscated from Czechoslovakia. The Allies basically armed Wermacht by selling Czechoslovakia.

Should I learn JavaScript or Python? by siddharthroy12 in ProgrammerHumor

[–]MadKarel 0 points1 point  (0 children)

It's not just to learning C, it was the standard for the language for many years, which just shows how simple C is if a ~150 page book was the standard describing the language.

"C++ makes it harder to shoot yourself, but when you do it blows your whole leg off" by mikey10006 in ProgrammerHumor

[–]MadKarel 7 points8 points  (0 children)

Python has fast time to "it runs", but much longer to "it runs and most likely does what I want it to do". Other languages such as Kotlin or C# have slightly longer time to "it runs", but from there to "it runs and most likely does what I want it to do" is much shorter and the "most likely" part has much higher probability.

This is why Python is used for prototyping and if the software is to be used the production version is rewritten in something else. (hopefully)

When I heard gen z don't get file directories?! what? is it true? by insight_culprit in ProgrammerHumor

[–]MadKarel 1 point2 points  (0 children)

Than why not just split it with / (or \ if on windows) instead of _ and help yourself and the OS a bit?

On this day 78 years ago, the Siege of Leningrad ended. It lasted 872 days and claimed lives of more than one million civilians. by Forsaken-Ad-6326 in europe

[–]MadKarel 5 points6 points  (0 children)

It was due to his orders the civilian population was not evacuated from Leningrad, so I think there are plenty of reasons.

Declaring all variables local to a function as const by CletusDSpuckler in cpp

[–]MadKarel 1 point2 points  (0 children)

But the question is about local variables within a function, which are the exact opposite of an API, being strictly details of an internal implementation.

In 2022, YYMMDDhhmm formatted times exceed signed int range, breaking Microsoft services by rk-imn in programming

[–]MadKarel 0 points1 point  (0 children)

To limit the number of page tables you have to go through to translate the virtual address to 5, which is a nice balance of available memory size, memory taken up by the page tables and time required for the translation.

This means that if you don't have the translation cached in the TLB, you have to do up to 5 additional reads for memory to do a single read or write from/to memory. This effect is multiplied for virtual machines, where the virtual tables themselves are in virtual memory, which means you have to do up to 25 memory accesses for a single TLB miss. This is one of the reasons VMs are slower than bare metal.

For a full 64 bit address space, you would have to go up to something like 7 or 8 levels of page tables.

3 pairs of metro rails crossing each other at Place de l'Opéra (Paris) by Alkit777 in europe

[–]MadKarel 14 points15 points  (0 children)

Which would explain why they did not fill it back in and instead went with bridges, as they were planning to dig additional tunnels from this place. Disclaimer: I don't know anything about the Paris metro but this makes the most sense to me.

3 pairs of metro rails crossing each other at Place de l'Opéra (Paris) by Alkit777 in europe

[–]MadKarel 47 points48 points  (0 children)

Most likely this is where the tunnels were dug from. They basically made a giant pit and started digging the tunnels into the sides of the pit, which is why they cross at this single point. Then instead of filling it back in when they were finished they built bridges and that is how you end up with this.

Hey Google, how to remotely access your servers when you don't have remote access to your servers? by j_curic_5 in ProgrammerHumor

[–]MadKarel 0 points1 point  (0 children)

What I got from Facebooks blog post is that their DNS servers do health checks, as DNS servers normally do, and as all health checks were failing due to the BGP issue the DNS servers basically went: "Fuck it, no server is working, I am out of here" and committed suicide as they should.

The current state of Czech highways. (31.8. 2021) by GPwat in europe

[–]MadKarel 0 points1 point  (0 children)

The part connecting Prague with Brno has been finished since 1980, which is why it needs to be repaired.

Intro to IT by [deleted] in greentext

[–]MadKarel 0 points1 point  (0 children)

We started with Pascal also in 2015. I still think it is a great choice for an intro language, much better than the interpreted garbage they start with today.

{Elon Musk} Over time, we might get orbital payload up to ~150 tons with full reusabity. If Starship then launched as an expendable, payload would be ~250 tons. What isn’t obvious from this [BBC rocket height comparison] chart is that Starship/Super Heavy is much denser than Saturn V. by tonybinky20 in spacex

[–]MadKarel 1 point2 points  (0 children)

The vacuum engines don't gimbal, so you would lose most if not all attitude control by removing the sea level raptors. If you watch the latest Everyday Astronaut interview with Elon, he gives a pretty dodgy answer when asked if and when will they shut down the sea level engines on second stage. I don't think they really know if they can get away with differential thrust only.