Why is calling my asm function from Rust slower than calling it from C?
57 points
1 day ago
| 2 comments
| ohadravid.github.io
| HN
saghm
2 hours ago
[-]
Not related to the topic, but seeing this tidbit in the article took me by surprise;

> PSA: if you don’t see syntax highlighting, disable the 1Password extension.

This linked to the following discussion that's been ongoing for over a week (with acknowledgement from 1password that they're looking into it but as far as can tell no ETA on the fix or explanation for why it's happening in the first place):

https://www.1password.community/discussions/developers/1pass...

I know that browser extensions are in general a pretty terrible ecosystem in terms of security, but am I off-base for thinking this is not a great look for 1password? Maybe I'm just underestimating how hard this is to solve generally, but my expectation would be that it shouldn't be that hard to keep track of which circumstances you're loading entire external scripts to manipulate the DOM and not do it accidentally in places you have no need for it.

reply
dmitrygr
8 hours ago
[-]

   For example, before we had something like:
     top: *const FFISafe<WithOffset<&'a u8>>
   We can change that to:
     top: WithOffset<*const FFISafe<&'a u8>>

rust, you were meant to replace c++, not join it...
reply
saghm
2 hours ago
[-]
The point of Rust is ostensibly to provide a safer version of C++-like semantics, not necessarily to avoid the same level of complexity. Especially if you're directly using unsafe code (which is necessary in some cases, like FFI), it's not really clear to me that Rust was "meant" to be doing something wildly different here. The large majority of the code not needing to use unsafe will still be better off even if this type of thing is necessary in some places.

(To preempt any potential explanations about this: yes, I understand the reference being made with that quote. I just don't think it actually applies here at all)

reply