”This can result in several different implementations of a function that differ only by type — often, the more idiomatic C approach would be to use macros or void * arguments.”
”Idiomatic” - is a ridiculous tautology I wish people discussing languages would stop using.
The only non-idiomatic code written seriosly is that which the compiler/interpreter does not understand.
Claiming universal superiority of style is shallow and thoughtless.
Sure - when discussing C of all languages this expression felt shallower than usual though.
If you are really enthusiastic you can write _obsfuscated_ C. And people can kind of agree what that is when they see it.
But _idiomatic_ ? Good luck defining what that is.
The term has sort of stuck in Python and there it's purpose is a bit more clear. There is this _object_ way of doing things, there is this _expression_ way of doing things etc and the interaction patterns work really nicely.
But you can't really use that expression in other languages which lack the same level of institutional design without sounding very much out of touch.
In general dubious binaries aren't really a problem, because releases tend to be done by people or groups with reputations. Lots of people are ideologically or technologically motivated to release stuff and have been doing so for many years.
And now a days in the age of Denuvo and things like this, cracked binaries are sometimes even 'cleaner' than the official releases.
Unlikely most of the Denuvo cracks actually remove the virtualized code from the executable. Not feasible without extensive binary rewriter tooling (that, while being sloppable, still takes a lot of time to slop).
Interesting yeah you're right. Looking it up it seems that only 2 of the Denuvo cracks have completely removed Denuvo - oddly enough Assassin's Creed games both times. Usually they just use various tricks to fool the authentication, but leave the performance degradation and other issues of Denuvo.
It'll be interesting to see if LLMs do increase the rate of completely cleans.
I can't edit this post anymore but if you wanna read a bunch of stuff on the topic https://k0mkc.hatenablog.com/ is a nice blog. All in Japanese, but it should be perfectly translatable.
Funny thing is they removed all their blogposts on Griffin (an obfuscator several anticheats, including EA's, Riot's and FaceIT's utilize) for whatever reason.
This is false analogue. Comparing SWE to pianist and using desktop as the similar element is false. Desktop to SWE is like … how the concert pianist arrives at the concert venue. You want the pianist to arrive on time but you really don’t care about their mode of transportation.
Besides it’s good to take things slow when face to face with people.
Yes! Best book ever on how a high technology startup operates. If you are wondering how to create an "internal startup" - that's your guide. It's a people system - so you need to find the people!
"that work does not exist unless an engineer invents it."
This is so strange. To my mind the only purpose companies hire engineers is to support business. The staff engineer should not need a project manager to tell what is interesting for business aspects - even though the goals are likely mostly technical.
I do realize this does not hold up always. But to me if you can't provide some reasoning for your work in business metrics you are participating in an academic exercise.
>To my mind the only purpose companies hire engineers is to support business.
Lots of hires, especially in places big enough to have dedicated teams for platform work, are for empire building, rather than to support business needs. In these situations, companies hire engineers because a higher-level manager needs to increase their headcount, in order to pad out their CV for their next move.
I think you're operating on a different definition of "work".
The OP is discussing tasks to do, you sound like you are discussing things that need to be done. The OP isn't saying there aren't things to be done, they are saying that no one is going to tell them what needs to be done, so they must discover and formalize it.
Well, US did not really have that to start with (Kaiser &co learned fast). So it’s not about having something and losing it as much as bootstrapping and discarding.
For processes that are scalable, well known and industrial, profit motive actually does provide results.
The question is more of are there bottlenecks of skill and maybe secret sauce (eg something like ASML).
The US had the raw materials available in country to support that sort of build out and I don't think that's the case today. It would take kickstarting a lot of prerequisite industries to get back to the point where we could even start to learn how to build ships enmass again.
” that’s too mathy”
I’m not really sure there is any remedy to the fact computer graphics is based on math.
I suck at math myself so can relate. But actually the math you need to learn to be effective at graphics is mostly about understanding _a very small subset_ of a bunch of concepts (such as how 2x2, 3x3 and 4x4 matrices work) and one is set for life,
so I think it’s good to give the formal mathemathical explanation and then Gilbert Strang what it all means.
One just needs to pick any book on computer graphics written in the past 40 years or so.
But camera transform is so unintuitive it really helps if the student tries to work it out for themselves why it works.
For me it’s really weird anyone would write code and _not_ start from reading all of introductory computer graphics literature because it’s so awesome but I realize I’m the outlier here.
The CPU on most machines is quite proprietary. I don’t understand this faux purity dogma.
Practical computing is not and never has been an abstract pure concept. It’s about making machines built by corporations to do usefull things at scale.
There is no ”non proprietary” computing unless you make your own stack.
Yes but there are business costs to using high-level proprietary tools and libraries. If you write your app using win32, you won’t be able to port is very easily. You’re also stuck with whatever bad or bizarre decisions Microsoft made.
It’s even worse for CUDA. GPUs are expensive, and now you’re vendor locked. You’re between a rock and a hard place. Either spend millions in engineering time, or millions on price-gauged hardware.
” If you write your app using win32, you won’t be able to port is very easily.”
This is wrong way around.
If you don’t support the platform your app runs on using the native api:s to the hilt your port is just bad.
If you actually want to support multiple platforms _you actually need to support_ them from the ground up.
This is speaking industrially and businesswise. A professional software business always has per-platform implementation resources. Or they have just one platform. Or they pretend they are multiplatform and then _everybody_ _daily_ fights with the problems this causes.
Obviously those elements that can be portable should be. It’s like Einsteins simplicity maxim - your codebase should be as portable as can be but not more.
” It’s even worse for CUDA…”
No these are just the business and market constraints. If this does not make sense for your offering then don’t use it. This feels like false FOMO - CUDA is not a silver bullet but it might be a specific solution to a specific problem.
It really depends on the application. The reason web is so successful as a platform is because it’s rich enough for most applications, and inherently cross-platform at an OS level.
And Re: CUDA: yes if it doesn’t make sense then dont use it. That’s sort of my whole argument. It might make some level of sense from a technical perspective, but that needs to be balanced with business risk. I’m saying a lot of people aren’t doing the balancing right, which is why these new tools have value.
Correct, most of Linux user land targets API stability, not ABI stability. Windows targets ABI stability because applications are typically distributed as binary blobs. Most applications on Linux are open-source and built per each distro, so it’s a non-issue, just recompile.
This doesn’t work for proprietary software that’s distributed as blobs and rarely updated, like say, video games. But that’s a minority of stuff on Linux. But not on windows.
Realistically, on Linux applications target specific API versions of frameworks. Like Qt 6, or GTK 3, or whatever. Then everything is compiled or dynamically linked at a per-distro level. The ABI compat can bite specifically when distros enforce strict dynamic linking. But then containerization technologies come in.
And there is a difference between API and ABI stability. For example, adding SSO to std::string in C++ broke ABI, not API. If you recompile it’s fine, everything works. If you don’t then it doesn’t.
Dead wrong. Win32 (externally) only seems stable, but internally it changes between Windows releases. Win7 syscalls are completely different from Win11 syscalls, meaning if I want to release a binary _without relying_ on Win32 I need to provide full syscall mappings _for each and every Windows version_. This doesn't happen on Linux.
That's literally the definition of it being stable. Programs written against an interface keep working despite the implementation changing. The Linux kernel also constantly changes internally but programs written against syscalls keep working, so it is stable; that fact doesn't stop being a fact just because I dislike perf_event_open(2) or whatever. This is all very basic and easy to understand.
I wonder which APIs you would use to port easily, because POSIX and Khronos aren't it either, as they are industry standards driven by companies where one has to pay for a seat at Open Group and Khronos offices.
Porting has never been hard. Just follow the platform guidelines. Make sane architecture. Done.
I mean _it's just work_. You don't need to invent anything. Just do the work.
What _is_ hard is when people run after silver bullets to avoid all this work.
Because people who don't understand software decide it would be cheaper to implement something only once. Or someone who does not really understand what they are doing insists that same C++ code runs automatically on all platforms.
AI has given the software engineers permit from the beancounters to do the sane thing.
Good software development orgs _have always_ done proper per platform ports.
Also - there is nothing wrong in supporting only one platform as such!
> Good software development orgs _have always_ done proper per platform ports.
I really wonder why this was never fundamentally fixed. How performant a certain instruction on a specific platform is, how well it is supported and potential equivalents or sets of other instructions to emulate an equivalent are usually all very well understood.
So there should be some graph of operations which can transform any software from and to the specifics of each platform. Especially because firmware + compliers + platform abstracting libraries are basically already just that graph, although (usually?) to lossy to be applied in reverse. Add the recent developments in very large scale statistics to it and it'd probably be quite possible to transform from and to generic intent in the implementation to the uniqueness of each platform. E.g. the theming differences between a MacOS UI and a terminal application served over serial or the processing capabilities of a VLIW CPU compared to a FPGA or a GPU server.
Considering the enormous amount of work that went into compilers, better debugging and intermediate representations it seems like a huge missed opportunity nobody seriously asked the question whether information could be emitted that would allow for decompiling all the way back to the generic intent.
The hard part of porting to a different platform is usually not the instruction set. It’s the OS and system abstractions.
For example, if you have a program that just does raw math and pointer arithmetic and data structure manipulation —- that is, pure computation — then porting it to a different CPU might well be trivial. Just recompile. As long as your language toolchain supports it, this will Just Work.
But if your program works with the filesystem and sockets and threads, then it’s less likely to work. This is the promise of POSIX: if your program uses only what’s offered by the POSIX standard and uses those functions correctly, then it’s supposed to work on any POSIX-compliant system. Just recompile.
But if your program has a GUI, or does 3D graphics, or uses special methods for high-performance networking, or accesses gyroscopes or accelerometers or touch sensors, well then you have to do work to port. And notice that this work isn’t about which CPU instruction to use. It’s about figuring out —- deciding —- what the right thing to do is, for your app, given a slightly different set of available system capabilities.
I can program all my non-CUDA GPUs use completely open non-proprietary toolchains. And if that ceases to be the case on one platform I can switch platforms without having to rewrite all my code.
SketchUp does not really have that either if you are expecting something else than triangles. Since sketchup has polygons you could argue they are brep but even then only accidentally.
Architecture works with a bit different ruleset than mechanical cad.
”Idiomatic” - is a ridiculous tautology I wish people discussing languages would stop using.
The only non-idiomatic code written seriosly is that which the compiler/interpreter does not understand.
Claiming universal superiority of style is shallow and thoughtless.
Intentional obfuscation is a different thing.
reply