The Labyrinth Architect Solves Everything
Description
A multi-panel medieval comic shows a king, a servant, a messenger, and a newly revealed monster, with the servant repeatedly proposing labyrinths for wildly inappropriate things. The visible dialogue reads: "Allow me to present you this enormous cheese", "Sire, I will build a labyrinth to house the cheese!", "No! The kitchen will do fine", "My master also sends his regards", "Sire! I will build a labyrinth to house the regards!", "What is it with you and this labyrinth?", "Labyrinths are awesome!", and finally "Sire! The queen has given birth to a monster!" The final silent reaction implies that the servant has finally found the one situation where a labyrinth might be useful. For software engineers, the comic maps cleanly to overzealous architecture: applying the same favorite pattern everywhere until reality accidentally supplies a valid use case.
Comments
68Comment deleted
Every platform team has met the engineer who sees a cheese and immediately opens an RFC for service discovery.
What is (or was) special with C# that got it so popular? How is it different from Java? Comment deleted
mostly just lots of smaller improvements in language design ig. well and because Microsoft pushed it for quite some time Comment deleted
Its a mix of 3 languages if I remember correctly Comment deleted
Java had one dramatic disadvantage: it was not invented by Microsoft. C# got this deficiency fixed. Comment deleted
Lol Comment deleted
ah, yes, nih Comment deleted
I stopped using Java as soon as I realized you don’t have decimal and that you have to import BigDecimal and it has no operators because operator overloading isnt suppirted Comment deleted
Well, I don't remember about Decimal, but .Net did not have BigInteger until version 4.0, and still does not have BigUInteger. Comment deleted
What is biguinteger Comment deleted
Like BigInteger, but without that ugly sign and signed-only semantics not needed for unsigned applications. BigInteger is more about regular, abstract math. Real-world apps, like cryptography, need BigUInteger instead, with pre-computations and other high performance stuff. Comment deleted
Noice thx Comment deleted
meanwhile python: not even sure which values are Decimals and which are regular bigints/floats Comment deleted
Meanwhile JavaScript: not even sure which values are numbers and which are strings. Comment deleted
Lol js be like: 0.1 + 0.2 == 0.3 true Also JS: 0.1 + 0.2 0.3000000…00004 Comment deleted
same in python, but it rounds the last few digits to not seem weird Comment deleted
Looool thats even more evil when debugging Comment deleted
not really… it only does that when printing directly ig and float comparison has some weird rules too (you shouldn't be doing that anyway) Comment deleted
that's not js's fault Comment deleted
it is like that in every language Comment deleted
yes, that's what I said. read a bit upwards Comment deleted
it's not unique to python too Comment deleted
ye, but I said it's due to how float works - in general Comment deleted
null == 0 is false null > 0 is false null < 0 is false null >= 0 is true Comment deleted
in python, null doesn't even exist. haha! but None does. 💀 Comment deleted
Looool Comment deleted
Meanwhile Bash: not even sure which values are not strings (unless they are indexed arrays or associative arrays). Comment deleted
Meanwhile asm: not even sure of what is value and what is instruction Comment deleted
Not on every architecture. Some distinguish program space and data space, some have separate stacks for code and data. Comment deleted
these architechtures famously suck for emulating because JITs have to work around that (at least on M1 macs afaik) Comment deleted
depends if program space is read-only ig Comment deleted
why should you have a stack for code Comment deleted
To be resistant to "arbitrary code execution by stack overflow" at least. Comment deleted
ooh, you mean shadow stacks Comment deleted
Well yeah but it isnt that seperated either Comment deleted
The address space is shared in this case, the stacks are not. Comment deleted
not necessarily Comment deleted
You still could end up at a spot where an old code was but its not there anymore Comment deleted
That would trigger an exception even on x86, I think. However, to be sure one cannot call an arbitrary address, or access arbitrary data by manually constructed pointer (byte-grained), or to use uninitialized data (word-grained), there are hardware-enforced protection technologies. Comment deleted
Lol no Comment deleted
nx-bit is required Comment deleted
But you can’t declare that for evey single byte right? Comment deleted
you declare it for a page Comment deleted
Yeah thats the problem Comment deleted
how is it a problem? Comment deleted
Read above Comment deleted
just map your code as executable, and your heap and stack as non-executable Comment deleted
If you mix code and data within a page, you are screwed anyway. Comment deleted
Well instructions are followed by parameters Comment deleted
these are embedded within an instruction, and you really really should not overwrite them. it's not like you can do that, anyway Comment deleted
Umm what about JIT? Comment deleted
you map that code as rwx, and then remap it as r-x Comment deleted
you can actually not remap it, if you trust your jit to produce valid code Comment deleted
If you worry about passing control inside a variable-length instruction, then use an architecture with fixed-length instruction or EPIC / VLIW. 😁 Comment deleted
epic does not have a fixed length Comment deleted
But you cannot successfully jump into an instruction word, I suppose. Comment deleted
you can always do that regardless of the arch, if you have the permission to do so Comment deleted
The instruction decoder will throw "An illegal instruction" exception upon seeing an arbitrary garbage, unless you are [un]lucky enough to hit a purely valid pattern. Comment deleted
that will occur only after the jump, the only thing that prevents you from doing the jump itself is mmu Comment deleted
and if you don't have that, nothing will prevent you from doing anything Comment deleted
- Has less stupid restrictions - Has "structs" and more memory control in general - Looks better - Has operator overloading Comment deleted
-Pawn of Microsoft Comment deleted
I hope this supposed to be a joke Comment deleted
Yes, it is Comment deleted
It's just satisfying to write tbh, also in small cities and any other country than USA you have two career options: .Net and JS. Choose wisely as they say Comment deleted
In fact, BigInteger is internally implemented as BigUInteger + sign logic. (Well, in fact it is more complex than that, but the basic idea is similar.) Unfortunately, with opaque implementation, it is not possible to not use the things you don't need, nor to add advanced functions (operators), nor extract the values that system implementation computes but discards, returning only one of them. So rolling out your own math library (or using third-party one) instead of System.Numerics is the only way to overcome the basic design. Comment deleted
I will still this and Clear Watermark from it Comment deleted
Nobody See me Comment deleted