9,664 karma · joined Jun 14, 2010 (16y ago) · 1,504 submissions
comment 6y ago · link · parent
comment 6y ago · link · parent
comment 6y ago · link · parent
Presumably, the C++ wrappers suggested here would not even be safe in that sense. They would use a lot of pointers, and cause UB if passed the wrong one. The article argues that using unsafe correctly is impractical for Chromium because basically every Rust function would have to be marked unsafe to call into these raw C++ APIs.
Whether that’s the right call, I don’t know. I see the practical argument, but I also think that a lot of common Rust idioms, especially around memory management, depend on these safety guarantees. For example, field destruction order in Rust is weird and you often don’t control it as carefully as you would in C++. That’s usually fine in normal Rust code, but might not be if lots of marked-as-safe-but-actually-unsafe code is flying around.
comment 6y ago · link · parent
comment 6y ago · link · parent
comment 6y ago · link · parent
What batteries allow you to do is to perform time arbitrage in this market. As with many other forms of arbitrage, this should lower average prices, though some specific current uses could suffer. For example, if this is deployed at scale, electricity might no longer be all that much cheaper at night.
comment 6y ago · link · parent
comment 6y ago · link · parent
> Huh? exhibits linguistic conventions that speakers need to learn in order to use the form properly. A learner of Spanish has to know that repair is initiated with the mid front unrounded vowel ‘‘e8’’, a learner of Cha’palaa has to know that the form is more like ‘‘aQ’’ with falling intonation, and a learner of Dutch has to know that a glottal fricative at onset is common: ‘‘h38’’. Its acquisition follows a normal trajectory, at least in American English-speaking children [37]. Second language learners’ reports confirm that the precise form of this interjection has to be learnt, and that intuitions are not necessarily a reliable guide in this process [38].
> Perhaps there is a continuum from non-linguistic vocalisations like sneezing and crying to prototypical conventional lexical items like bless you and pain [39]. Our evidence suggests that huh? is more on the word side of that continuum. Based on the fact that huh? is integrated in multiple linguistic subsystems and conventionalised in language-specific ways we conclude that huh? a lexical word.
comment 6y ago · link · parent
One common mistake is to not think in floating point coordinates all the way through. E.g. a rectangle that covers a single pixel should have coordinates like (100.0,100.0)-(101.0,101.0), NOT involving a 0.5 offset. You almost never offset anything by 0.5 in this convention. 1 pixel wide lines are an exception, but only because then the edges of the line are exactly at pixel boundaries.
comment 6y ago · link · parent
It’s a bit if an oversimplification to say that the Rust community complained about the amount of “unsafe” code in Actix. It was more about the how and why.
From what I gather, the author didn’t accept patches that fixed safety/soundness bugs when they had even a small impact on performance. That’s a trade-off that one is allowed to make in my opinion (if clearly communicated, so that people can make informed decisions on whether to use a piece of code).
I think this difference in values (or rather, engineering goals) explains in part why this escalated so badly. But a healthy software ecosystem should have room for libraries that make different trade-offs. Zealotry (in the form of “There’s one right way”) doesn’t encourage experimentation, and shrinks communities instead of growing them.
comment 6y ago · link · parent
Should CPUs include more masking instructions for regular, non-vectorized code as well?
comment 6y ago · link · parent
It used to be the case that the CRT shipped with Windows (msvcrt.dll). That file is now considered legacy/deprecated and is no longer supported by current compilers. For several years after that, you always had to redistribute the CRT (msvcrtXXX.dll), even for pure C support.
The current state of affairs is that the CRT is split into several files, some of which come with Windows update (the so-called UCRT) and some of which are compiler-specific and have to be redistributed. C++ std support requires yet more files.
This document gives an overview: https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-l...
comment 6y ago · link · parent
comment 6y ago · link · parent
The good news is that every problem I found had an actively discussed GitHub issue and the community is active, so there will be progress.
comment 6y ago · link · parent
comment 6y ago · link · parent
Edit: Not even the DLL name of Microsoft’s libc is stable (msvcrt140.dll etc.), leading to all kinds of wild goose chases when trying to run old binaries.
comment 6y ago · link · parent
comment 6y ago · link · parent
My understanding is that Go doesn’t use the libc at all and makes system calls directly, which IMO is the correct decision in a modern systems programming language that doesn’t want to be limited by 40 years of cruft.
comment 6y ago · link · parent
And just to be clear, Dhall, the configuration language we’re talking about, is not TC, but powerful enough to compute the Ackermann function: https://gist.github.com/Gabriel439/77f715350ecc0443eed5fa613...
Add “ackermann 10 10” to your configuration file and you have something that’s technically proven to terminate, but won’t do so before the sun burns out. No security properties are gained here.
comment 6y ago · link · parent
Now I could claim on the contrary that whenever you're using "security" and "non-Turing completeness" in that way together, the only thing you're actually signaling is that you don't know WTF you're talking about.
comment 6y ago · link · parent
For example, it's a lot easier to write a secure Brainfuck interpreter (a very simple Turing complete language that can only access STDIN and STDOUT) than a program that securely extracts a ZIP file to disk.
comment 6y ago · link · parent
One, can certain input data cause a large usage of computing resources (processing time or memory)? Non-TC mechanisms have repeatedly failed this test: ZIP bombs and XML entity bombs are notorious examples. On the other hand, you can easily put a resource cap on an interpreter of a theoretically TC language and be safe.
Two, can the untrusted code access resources that it shouldn’t (memory, files, sockets)? That’s mostly a quality of implementation issue, not one of Turing completeness. JavaScript interpreters have certainly been vulnerable to various exploits, but so have JPEG decoders. I don’t think TC is the issue here. (However, this is complicated a bit by side-channel attacks à la Spectre. I’m not sure how TC factors into those.)
In summary, I’m not convinced that Turing completeness is all that relevant for security. Am I wrong here?
comment 6y ago · link · parent
Publications want to use these benchmarks as a convenient proxy for real-world performance. Phones have "benchmark detection" and run their power management with different settings when they detect that a benchmark is running, defeating the purpose of running the benchmark.
BTW, I don't think this is about gaming vs. non-gaming workloads (there are different benchmarks for those), or even running plugged-in vs. on battery. My understanding is that some of these "benchmark modes" are so aggressive that the phones would become too hot to hold in your hands. No sane phone manufacturer could use settings like these for real-world usage.
comment 6y ago · link · parent
Perhaps interestingly, you can create a discovered check with two pieces on the same square, say two rooks. Like a double check in regular chess, you can’t remove the check by capturing, because you would only capture one of the rooks.