HNHacker News
TopNewBestAskShowJobs

saynsedit

412 karma · joined May 31, 2016

submissionscomments
saynsedit··on Sandstorm – An open source operating system for personal and private clouds
Yeah, the iPhone was also a dangerous fad that everyone bought into. There was precedent with Newton and palm pilot.
saynsedit··on How becoming a pilot made me a better programmer
Coffee works wonders my friend.
saynsedit··on Apple Open-Sources its Compression Algorithm LZFSE
Undefined type-punning cringes me out. memcpy is your well-defined friend.
saynsedit··on Minnesota woman broadcasts police stop and shooting on Facebook Live
Why has HN taken this off the front page without explanation?
saynsedit··on A practical use of multiplicative inverses (2013)
A feistel cipher is a similarly compact yet cryptographically strong pseudorandom permutation.
saynsedit··on Excel: Error when CSV file starts with “I” and “D”
This is why HN is cool. You see a Microsoft knowledgebase article documenting an obsolete enterprise software's bug and its workaround, then an anonymous account takes credit for it. This is what I come here for.
saynsedit··on Integer percentages as fingerprints of electoral falsification
If you look at the demographics of the people who voted for sanders you'll find its representative of the overall population.

I.e. 50% of sanders' voters were women. You'll get similar proportional percentages of minorities.

Simpson's paradox creates the perception that sanders' voters are composed of mostly white males. It's untrue.

saynsedit··on Why is Python slow
What's expensive about the runtime is the redundant type/method-dispatch not the opcode dispatch. The runtime is constantly checking types and looking up methods in hash tables.

Gains can be made by "inter-bytecode" optimization in the same vein as inter-procedural optimization.

If you can prove more assumptions about types between the execution of sequential opcodes, you can remove more type checks and reduce the amount of code that must be run and make it faster.

E.g.:

    01: x = a + b
    02: y = x + c
If we have already computed that a and b are Python ints, then we can assume that x is a Python int. To execute line 2, we just then need to compute the type of c, thus saving time.

The larger the sequence of opcodes you are optimizing over, the better gains you can make.

Right now I think Pyston uses a traditional inline-cache method. This only works for repeated executions. The code must eagerly fill the inline cache of each opcode to get the speed I'm talking about.

Another reason Python's runtime is slow is because there is no such thing as undefined behavior and programming errors are always checked against. E.g. The sqrt() function always checks if its argument is >= 0, even though it's programming error to use it incorrectly and should never happen. This can't be fixed by a compiler project, it's a problem at the language level.

Being LLVM based, I think Pyston has its greatest potential for success as an ahead-of-time mypy compiler (with type information statically available). IMO leave the JITing to PyPy.

saynsedit··on Final features of C++17
Oh tricky! I did write that code on my phone so hopefully you'll excuse the sloppiness. Thanks to HN I have miraculously learned a new thing about C++ when I was sure I knew it all; though, not surprised.

Also this dependent name behavior of static_assert seems to be a precedent for always checking static_assert in constexpr if.

saynsedit··on Baseline JIT and inline caches
Thanks for replying, I agree with this.
saynsedit··on Baseline JIT and inline caches
Not sure if a portable jit-constructed interpreter can reach the performance of the hand-written assembly interpreter of LuaJIT. My assumption is that what makes LuaJIT fast is careful consideration of architecture specific details.

Maybe you've seen this already: http://nominolo.blogspot.co.uk/2012/07/implementing-fast-int... (notice the part about portability)

saynsedit··on Final features of C++17
No, I'm saying static_assert in non-instantiated templates would not trigger.

  template<class T>
  class foo;

  template<>
  class foo<int> {
    static_assert(false, "bad");
  };

  template<>
  class foo<float> {};

  template<class T>
  foo<T> foo_fn(T v) {
    if constexpr (std::is_same<T, int>::value) {
      return foo<int>{};
    }
    else if constexpr (std::is_same<T, float>::value) {
      return foo<float>{};
    }
    else {
      return foo<T>{};
    }
  }
  foo_fn(1.0); // <-- does not trigger static assert
  foo_fn(1); // <-- triggers static assert
This is consistent with the wording of the proposal.
saynsedit··on Final features of C++17
The technique for static polymorphism is known as CRTP in C++
saynsedit··on Final features of C++17
Since the intended use of constexpr if is to block template instantiations, static_assert is kind of orthogonal to that. static_asserts in non-instantiated templates are ignored, as you would expect.
saynsedit··on FAQ from Guccifer 2.0
“Let’s spell this out,” Rid said. “We have a foreign intelligence agency that is picking sides, that is doing a sophisticated hack and influence operation in support of the presumptive nominee of the Republican Party in the US general elections. That’s craziness, if that’s actually the case.”

Yeah, having foreign intelligence agencies interfere in sovereign elections does suck.

saynsedit··on Lossless compression with Brotli
Defacto secure doesn't mean "has no buffer overflows." It just means it's already a prevalent security risk outside of your system.
saynsedit··on Lossless compression with Brotli
On the client side there is already a vast amount of C-code that is interpreting file data, the brotli portion is a minimal part of that security risk. Porting brotli to rust for the purposes of increased security is like optimizing the part of your program that takes the least time. Lots of effort for minimal gain.
saynsedit··on Lossless compression with Brotli
Binaries in a SECCOMP cannot by any means read/write arbitrary files. They would need access to open(), socket(), etc. there is only read(), write(), exit() and sigreturn(). Only the intentionally inherited file descriptors are accessible.

As for your "kernel attack surface is lowered" argument, it's incredibly silly. If read() and write() ever had a vulnerability we have much bigger problems than binaries in a SECCOMP. It's like saying SHA256 isn't secure because there is technically a risk of collision.

Determinism and robustness aren't valid, they can use checksums to verify data coming out of the SECCOMP container. Same effect, much less effort.

And for your argument against de facto security: security reasoning isn't binary. It's a risk based assessment. Nothing is 100% secure and context matters. Binary thinking and dogma are incredibly dangerous. Spouting "Rust is secure" is dogma, it's not true. Rust is "99%" secure, unknown unknowns will always be out there.

In this case, context is important. My point isn't that c-brotli is as secure as rust-brotli. My point is that using c-brotli doesn't introduce any significant new security risk on the client-side given that there are lots of other c-based libraries already interpreting file data. Given that context, reimplementing brotli in rust for the purposes of increased security only marginally accomplishes its goal. It's like optimizing the part of your program that takes the least time, lots of effort for almost no gain.

On the server side, there's no gain at all to porting c-brotli to rust since you can already use SECCOMP and checksums. It's just wasted effort.

Am I saying there is no valid reason to port things to Rust? No. I'm saying it's invalid to port a library to rust for security reasons if you already have effective means of mitigating binary attacks, I.e. SECCOMP and checksums.

saynsedit··on Lossless compression with Brotli
That's assuming this library will change often which I doubt since it's not upstream. Cost-benefit falls short here.

This "future changes" logic would apply better if this were an upstream library that were expected to change often enough to offset the upfront cost of porting an entire library.

saynsedit··on Eggs Don’t Cause Heart Attacks – Sugar Does
Admittedly not holding my breath but even if I were, 32 BILLION chicks will die before 2020
saynsedit··on Lossless compression with Brotli
Is the brotli decompression step really the most dangerous vector on the client-side? What about all the non-verified client-side native code that actually interprets file data? From a practical perspective using the C code doesn't deteriorate existing conditions and using the Rust code doesn't improve them.
saynsedit··on Lossless compression with Brotli
Preventing compromise and ensuring determinism using checksums and SECCOMP is more reliable and easier to implement than reimplementing in rust an already de-facto secure library used millions of times every day.

I'm sorry but the Rust rationale just isn't there. Porting to Rust is a strictly less efficient way of accomplishing the same exact goal.

Now, writing a new library in rust, that's a different story and actually is reasonable.

saynsedit··on Lossless compression with Brotli
I'm having a hard time understanding the motivations for porting to rust...

If they were going to run the whole thing in a SECCOMP container anyway, there is little damage a compromised C library could do.

If reasoning about uninitialized memory would take a review of the entire brotli code base, didn't the rust port require that anyway? (speaking as someone who has done a couple of cross-language rewrites)

saynsedit··on Eggs Don’t Cause Heart Attacks – Sugar Does
The male chicks that are incidentally born in the egg industry are usually ground up alive or gassed https://en.wikipedia.org/wiki/Chick_culling http://youtu.be/IOZEP9AGxrw

The scale is literally 8 billion.

saynsedit··on The Brexit Possibility
The assumption that exporting manufacturing to the third-world is generally good for humanity is a bit hard to stomach.
saynsedit··on Eggs Don’t Cause Heart Attacks – Sugar Does
Eggs don't kill humans, but they kill an ungodly amount of chickens: 8 Billion of them per year, roughly. http://usda.mannlib.cornell.edu/usda/current/PoulSlauSu/Poul...
saynsedit··on Reasons not to use (i.e., be used by) Facebook
I don't agree with this post because its tone threatens my ego. There is hope for humanity.
saynsedit··on Reasons not to use (i.e., be used by) Facebook
I guess? If you believe that so much then have fun discussing the "RMS rhetoric problem," that will definitely help humanity make forward progress. The lot of us who already get his point will be discussing the Facebook privacy monopoly that actually affects humanity.

Btw, in case you didn't notice, I didn't like your rhetoric and I ignored all the logic in your post because it came across as preachy, or whatever. Next time be less preachy, or whatever, that will help, maybe?

saynsedit··on Reasons not to use (i.e., be used by) Facebook
Yes, let's criticize arbitrary off-topic things ad infinitum, because we can.
saynsedit··on Reasons not to use (i.e., be used by) Facebook
If the OP doesn't intend to defend Facebook against RMS's claims, his criticism of RMS's rhetorical style is wholly irrelevant to his core point and, in turn, this discussion.
← PreviousPage 7 of 9Next →