TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Weird architectures weren’t supported to begin with (2021)

107 点作者 dbaupp大约 2 年前

17 条评论

ris大约 2 年前
I never agreed with this. Who defines what is considered &quot;weird&quot;? Should all projects declare up-front that it only is designed to work on: - x86_64 and aarch64 - linux, darwin and windows - glibc (no musl) - binutils x.xx - ...<p>... where do you stop before you&#x27;re defining an exact linux distribution?<p>If it weren&#x27;t for people building and using packages for architectures that are &quot;unsupported&quot;, I should point out that there would <i>be</i> no good userspace support for ARM or aarch64. These too were once &quot;weird architectures&quot; that only have good support now because of people building for (and using) these architectures without permission, then shaking all the bugs out. This is currently <i>still happening</i> for risc-v.<p>I have to contrast this attitude to CPython, who, while I&#x27;m sure they never originally <i>said</i> that their code was designed to run on s390 (risc-v, pick your architecture..), would not go ahead with a change that froze out these users.<p>I also don&#x27;t think the &quot;we&#x27;re just a poor bunch of small-time package maintainers whose package accidentally became popular&quot; angle quite works, because they call themselves the &quot;Python Cryptographic Authority&quot; and use the prominent package name `cryptography`, which certainly appears to imply some sort of official status. I wouldn&#x27;t blame people for inferring that its support policies were somewhat aligned with the python foundation&#x27;s.
评论 #34846877 未加载
评论 #34846863 未加载
评论 #34847350 未加载
评论 #34846896 未加载
评论 #34855751 未加载
评论 #34846771 未加载
zamalek大约 2 年前
&gt; The security of a program is a function of its own design and testing, as well as the design, testing, and basic correctness of its underlying platform: everything from the userspace, to the kernel, to the compilers themselves.<p>You don&#x27;t even have to worry about bugs. There are many cryptography primitives that require constant-time to guarantee security. That means that the latency of each machine code instruction could be vital to security. The latency of instructions between vendors within the <i>same architecture</i> is already a concern.
评论 #34838905 未加载
评论 #34847492 未加载
jameshart大约 2 年前
There’s always been a weird double standard in open source software where it has been seen as ‘reasonable’ to expect the same code to compile and work on everything from an Arduino to an IBM mainframe, PDP11 to a RISC-V.<p>..But getting it to work on <i>Windows</i>? What? Do you expect the developers to fork out for Windows licenses? Don’t be ridiculous. Heck, some software is still downright snooty about the absurd idea that it should run cleanly on a Mac.
评论 #34847904 未加载
评论 #34847434 未加载
评论 #34848154 未加载
评论 #34847805 未加载
cwzwarich大约 2 年前
&gt; The C abstract machine, despite looking a lot like a PDP-11, leaks the underlying memory and ordering semantics of the architecture being targeted. The result is that even seasoned C programmers regularly rely on architecture-specific assumptions when writing ostensibly cross-platform code: assumptions about the atomicity of reads and writes, operation ordering, coherence and visibility in self-modifying code, the safety and performance of unaligned accesses, and so forth. Each of these, apart from being a potential source of unsafety, are impossible to detect statically in the general case: they are, after all, perfectly correct (and frequently intended!) on the programmer’s host architecture.<p>I don&#x27;t disagree with his general point that C isn&#x27;t really cross-platform, but these are bad examples:<p>- The C memory model addresses the issues regarding atomicity, memory ordering, and the safety of unaligned accesses (although users might not like the answer for the last one).<p>- Coherence within a C program is guaranteed by the language, so issues with coherence only arise when interacting with an incoherent external agent. How could any language solve this?<p>- Are there any examples of self-modifying code that don&#x27;t already make assumptions about the underlying ISA? If you&#x27;re already doing that, dealing with data&#x2F;instruction memory consistency doesn&#x27;t seem particularly onerous. Even when only targeting AArch64, it isn&#x27;t possible to write platform-independent userspace <i>assembly</i> code that does this because instruction cache maintenance instructions might not be enabled for EL0.
评论 #34846724 未加载
dwheeler大约 2 年前
A lot of the problem is that GCC hasn&#x27;t supported Rust, and LLVM doesn&#x27;t support many platforms. Since this article was written (2021), there&#x27;s been work to implement Rust fully in GCC, as well as ways to call from LLVM the GCC backend (which supports far more architectures). So there&#x27;s a reasonable expectation that some of this problem will be fixed in the long-term.<p>IBM mainframes write most paychecks, and companies <i>do</i> pay some OSS developers to support some of the architectures the author doesn&#x27;t like. Making it impossible is different.
docandrew大约 2 年前
I think the frustrating thing is that, while rust may consider one of these architectures “tier 2” or unsupported or whatever, there’s a Python interpreter that presumably doesn’t, and whoever is using the Python cryptography package expects it to work the same place all their other code does. And very likely it’s some dependency several layers deep. If my code is going to end up architecture-dependent then why bother with an interpreted language in the first place?
评论 #34847694 未加载
评论 #34847962 未加载
CJefferson大约 2 年前
I&#x27;ve been trying to officially mark some open source software I work on as not supporting big endian. We don&#x27;t test it, and I think it&#x27;s very likely there are some subtle bugs.<p>Sometimes someone will ask for support, but (unsurprisingly, I don&#x27;t blame them) they don&#x27;t want to put the work into testing up to the standard we achieve on ARM and x64.
评论 #34846631 未加载
johnklos大约 2 年前
That&#x27;s an interesting take. It seems like a modern slant on the old trope of &quot;all the world&#x27;s a VAX&quot;, then &quot;who cares if it&#x27;s not i386?&quot;, and now, &quot;of course it&#x27;s portable - we support both kinds - amd64 AND aarch64&quot;.<p>But it&#x27;s a bit disingenuous. Are developers being overwhelmed by problem reports for things that hardly matter? Looking at NetBSD&#x27;s pkgsrc, which supports more OSes than just NetBSD, we see about 64,000 patch files for about 26,000 packages. While many packages don&#x27;t require any patches, some require many.<p>This is because for many programs, upstream just don&#x27;t care. It&#x27;s not just about odd architectures - they just don&#x27;t care about NetBSD support, or support for different, alternative OSes. Perhaps that&#x27;s fine, but consider this - the patches already exist and are tested, and they&#x27;re maintained in pkgsrc.<p>There are times people become indignant about being told how to fix their software for use under systems other than Windows, common Linux and macOS, on CPUs other than amd64 and aarch64. Yes, indignant. Some Python folks don&#x27;t want to consider anyone would want to use Python on systems (like embedded) that don&#x27;t have full IEEE floating point emulation. postgresql would rather mark platforms as broken than just let them compile the standard c portions of their code.<p>People like to say, &quot;they don&#x27;t want to spend the time and energy&quot;, as if it adds work. No - there are examples where people choose the broken path when the not broken path is just as easy if not easier. Nobody is obligated to add or patch anything, even if the patches are freely given and well tested. But the fact that some people actively fight against portability is disturbing, and should be viewed with suspicion.<p>The author of the article seems to have forgotten some history. They mention downsides of the c ecosystem, like the lack of standardized ways to build, the lack of consistent package management, and so on. But in every instance where those things have been imposed, the imposition has been problematic, has it not? Have we not seen security issues with PyPi? Have we not seen the dependency hell which is Ruby?<p>The point is that nobody can tell anybody else how to do open source, so we&#x27;ll always have a hundred different ways to do things. We also can&#x27;t help that some people will be gatekeepers. But we personally can ignore the gatekeepers and help make things portable.<p>Making excuses for why portability is somehow extra work is only encouraging gatekeeping. We don&#x27;t need to do that - gatekeepers already have enough energy on their own.
wizzard0大约 2 年前
One more example that security cannot be abstracted, packaged and bought in a box.<p>The same goes for performance (but that one can be packaged at least sometimes)
ergonaught大约 2 年前
&gt; As someone who likes C: this is all C’s fault. Really.<p>I think I agree with almost everything in this post except this sentiment.<p>Blaming the tool is silly. You may as well blame assembly language, and if you&#x27;re doing that you may as well blame CPUs and electricity and you know what, physics is harmful, we should rewrite it in Rust.
评论 #34847609 未加载
Karellen大约 2 年前
&gt; Imagine, for a moment, that you’re a maintainer of a popular project. [...] You’ve also got a CI&#x2F;CD pipeline that produces canonical releases of your project on tested architectures; [...] Because your project is popular, others also distribute it: Linux distributions, third-party package managers, and corporations seeking to deploy their own controlled builds.<p>&gt; You don’t know about any of the above until the bug reports start rolling in: users will report bugs that have already been fixed, bugs that you explicitly document as caused by unsupported configurations, bugs that <i>don’t make any sense whatsoever</i>.<p>If 3rd-party build recipients are sending their bugs directly to you, that&#x27;s a failure of the 3rd-party builders to take responsibility for their packages. They should be telling you to submit your bugs to <i>them</i>, so they can check their packaging, and then the packagers should talk to upstream only if there are issues to be resolved there.<p>&gt; You struggle to debug your users’ reports, since you don’t have access to the niche hardware, environments, or corporate systems that they’re running on.<p>Yes, C supports lots of environments, and Rust supports quite a few (and hopefully more, soon), but I think it&#x27;s perfectly fine for an upstream author to only support a subset of those. The benefits of Free Software is that if you want to get some software running on platforms the original author doesn&#x27;t support but the language does, <i>you can do that</i>.<p>Investigate the bug yourself. Figure out if it&#x27;s in the app, or a 3rd-party library, or even the toolchain. Submit a patch.<p>A good proportion of authors will happily accept patches for systems they themselves can&#x27;t test on, if it&#x27;s not too intrusive, and doesn&#x27;t cause regressions on the platforms the author does support. They might be willing to entertain an intrusive patch series that allows for better cross-arch support, if you&#x27;re willing to work with them on that.<p>And if an author is not interested in helping you scratch your itch (ew! :-), create a fork. That should be easier than ever these days with the version control tools we have now, so much more than when Free Software was first envisioned. The author may even be willing to point other people who want to use their software on your platform your way (e.g. in their README), if only to get those users of their back!
评论 #34847297 未加载
rbanffy大约 2 年前
&gt; Give up on weird ISAs and platforms<p>NEVER!
评论 #34846544 未加载
phkahler大约 2 年前
Yeah why should we even care about s390 for some things?<p><a href="https:&#x2F;&#x2F;github.com&#x2F;solvespace&#x2F;solvespace&#x2F;issues&#x2F;1264">https:&#x2F;&#x2F;github.com&#x2F;solvespace&#x2F;solvespace&#x2F;issues&#x2F;1264</a><p>I don&#x27;t think big commercial customers are designing airplanes with it.
评论 #34847150 未加载
PaulHoule大约 2 年前
Personally C for Arduino programming drives me up the wall. With 32 general purpose registers in assembly language you can often keep all the variables in your inner loop in registers and still have a few left over for the interrupt handler. In C on the other hand you know it is moving the stack pointer around meaninglessly just so it can support recursive functions which aren’t really appropriate for embedded systems.<p>I still write C for it because as beautiful as AVR-8 is, it is a dead end and if I need more capability I can take my C program to an ARM and maybe someday a RISC-V board. (I dream of embedding a soft AVR-8 on an FPGA with some special logic but the engineering students I know tell me that the Verilog class was like getting mauled by a bear.). At least gcc meets me halfway and has 24 bit ints in AVR-8.<p>For that matter I just got a VisionFive 2 board that I need to put in a case and bring up with Linux. It has been a long time since I had to mess with other peoples C programs and bring them up on a new architecture but I think I’ll be doing it again.
pornel大约 2 年前
Are there architectures which LLVM doesn&#x27;t support, which aren&#x27;t retrocomputing or 16-bit microcontrollers?
评论 #34847047 未加载
评论 #34847051 未加载
DerekL大约 2 年前
Title needs (2021).
pyuser583大约 2 年前
If only we had stuck with Ada.