HNHacker News
TopNewBestAskShowJobs

arve0

136 karma · joined August 11, 2014

submissionscomments
arve0··on A new hash algorithm for Git
I’m not known with the internal data structure of git, but couldn’t you add the new hash as a commit in a new format “on the side”, leaving the original commit as is?
arve0··on Advent of Code 2019
The problem is trusting the submitter. How do you make sure derivate work is not submitted?
arve0··on Common Mistakes and Missed Optimization Opportunities in SQL
where 1=1 and

  ,first=condition
arve0··on If you're busy, you're doing something wrong (2011)
Same experience. I use to joke about it; “The more crappy lecturer you have, the more you perform.” Understanding that you don’t understand is powerful.
arve0··on Things you probably don't know about Go (2012) [slides]
I went to lib.rs, searched for mock and found this: https://lib.rs/crates/filesystem
arve0··on Sunsetting Python 2
> Compare the situation with Java!

Isn’t that comparable to java? Oracle gives you paid security updates on version 8. You can keep using the previous version without security updates or migrate to OpenJDK 8, which have their own security group. More options, seems better to me.

arve0··on Clojure’s Approach to Identity and State (2008)
> dangerous behavior should be hard to reach and inconvenient to use

I understand your point, but to me that is exactly the case. It requires the extra "mut" (harder to reach) and is inconvenient to use (more compiler errors).

My point is; Rust gives you the choice. If you need mutability due to performance, or something like that, you can have it (at the cost of simplicity and convenience).

Also, "dangerous behavior" is not allowed, in this example threads sharing mutable and immutable reference to the same object.

arve0··on Clojure’s Approach to Identity and State (2008)
> but i just don't ever want to see an error like that

Then, do not mark your variables as mutable. This error only happens if you use `let mut variable_name = ...`

AFAIK, `let var`, e.g. immutable variables, behaves the same as in clojure.

arve0··on Clojure’s Approach to Identity and State (2008)
The borrow checker does not allow that, it will complain "error[E0502]: cannot borrow `vector` as immutable because it is also borrowed as mutable".
arve0··on Developers don't understand CORS
If you need access to the users data on another service, without having their credentials on the other service, CORS is the correct choice.

> Servers can also notify clients whether "credentials" (including Cookies and HTTP Authentication data) should be sent with requests.

https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

arve0··on Developers don't understand CORS
Zoom does not need CORS-headers to fix the vulnerability, rather make the web server running on localhost drop requests with wrong origin header.
arve0··on Svelte is the most beautiful web framework I've seen
Rich Harris addresses scale in the Changelog podcast, and claims it to scale better than regular frameworks.

https://changelog.com/news/a-ui-framework-without-the-framew...

arve0··on Writing a small ray tracer in Rust and Zig
What is the best option, in your opinion?
arve0··on Writing a small ray tracer in Rust and Zig
I find lib.rs mentioned in the article a good tool. Here on concurrency: https://lib.rs/concurrency
arve0··on Tesla Model 3 spoofed off the highway
...and control over your ship motor + steering without computers. I’m not sure that is true on newer larger ships.

Edit: Would of course not be a spoofing attack.

arve0··on Why I don't use web components
Then I read your first comment wrong, I was referring to my quote in https://news.ycombinator.com/item?id=20236130

Regarding the comparison in source bytes, here it is:

minified lit-(element + html)[1]: 21.4k

I'm not sure it "amortizes" svelte when having more components, when runtime in hello world example is less then 8x size. Would love to see an example. Tried finding lit-element in "Real World Example" [2], but did not find it. Maybe you have some pointers?

1: https://bundlephobia.com/result?p=lit-element@2.2.0

2: https://www.freecodecamp.org/news/a-realworld-comparison-of-...

arve0··on Why I don't use web components
> Bundled, minified, and gzipped

Why gzipped? Bytes of source is a fairer comparison. Parsed source code should be the comparison, not transfer time.

> HelloWorld doesn't use much, so it'll be small, but most component are not HelloWorld and most applications will not have only a single component.

Then why dare other to compare sizes of a Hello world example? :-)

arve0··on Why I don't use web components
> ... and smaller size than just about anything else out there. Compare a styled Hello World example to React or any other framework:

Compared with svelte from the article:

    <script>
        export let name;
    </script>

    <style>
        p {
            background: pink;
        }
    </style>

    <p>Hello {name}!</p>
# Size comparison

## lit-element

lit-element.js?module: 8421 bytes

lit-hello.js: 340 bytes

## svelte

bundle.js: 2628 bytes

bundle.css: 72 bytes

arve0··on The PS1 Game Spongebob Squarepants: Supersponge Violates the GPL
227 lines, 4.62 kB. https://github.com/zavg/linux-0.01/blob/5839d67d5825265fc665...
arve0··on Svelte 3: Rethinking Reactivity
Are you mixing up code you write vs the code emitted?

The code you write in Svelte is reactive/declarative, emitted code is regular imperative JS.

arve0··on Rust 1.34.0
> so you want the error type to be !.

For others having trouble to grok that sentence, ! is the never type. Should never happen. https://doc.rust-lang.org/std/primitive.never.html

arve0··on Bootstrap 5 will remove jQuery as a dependency
Missing .abort() on safari is one reason. https://caniuse.com/#feat=abortcontroller
arve0··on Asynchronous Programming in Rust book
> you're talking about one thread per core, not one thread per unit of work?

Yes, a thread pool, consisting of one thread per core/computing unit. The units of work are then scheduled between the threads. Units of work here being some kind of IO, e.g. servicing HTTP requests.

> but if you want to spin up a few hundred thousand of them...

Hm. Thought there was a limit for work that can be done concurrently by the CPU, based on the number of cores/hyper-threads available. Found this on threads and IO performance [1], it seems to make the same point.

What kind of work load is common to spread over so many threads (on the same machine)? Does the OS switch efficiently between hundred of threads on regular CPUs? Genuinely interested.

1: https://www.jstorimer.com/blogs/workingwithcode/7970125-how-...

arve0··on Asynchronous Programming in Rust book
...and of course you know that, being on the Rust core team, just adding the specifics (I did not know the numbers myself).
arve0··on Asynchronous Programming in Rust book
Default stack size for new threads is 2 MB, https://doc.rust-lang.org/std/thread/#stack-size. That means total_memory_usage = 2 MB * number_of_cores, which is not so much on modern hardware.
arve0··on Asynchronous Programming in Rust book
> are you referring to the code you read?

Yes, the code the developer needs to read, write and understand.

I'm not familiar of how async/await will be in Rust, but I guess some code differences/complexities can be:

1. Make sure, manually(?), that all things are async / non-blocking.

2. Implementing Future.poll / wrapping types in Future? (What is Pin? ref https://rust-lang.github.io/async-book/execution/future.html)

3. Async polution, a function that uses async must be async too?

4. Setup some scheduler that maintain how many concurrent async operations one thread has?

5. More verbose error-messages / stack-traces?

arve0··on Asynchronous Programming in Rust book
How much performance is gained by going async instead of blocking threads on modern hardware?

Skimmed through https://vorner.github.io/async-bench.html. If I understand it correctly, one get about twice the performance with async.

Is this correct? Seems like a compromise (code complexity vs performance) not worth taking.

arve0··on Road Tripping Around Europe in a Tesla Is Less Fun Than You’d Think
Because of cost?

1. Cost per charge << per tank, and

2. cost credit car reader >> rfid reader.

arve0··on Web Writable Files API: Simplifying Local File Access
Not parent, but I think you are missing the point parent is making.

Suppose an app which does not really needs file permission to work, like Facebook, but asks anyhow. If you opt out, you cannot access the app.

That pattern does not need to exist.

arve0··on Show HN: Analyze size of NPM packages
It’s a bit hard analyzing total impact of npm install package, so I made this tool that let you view total size of a npm package. The tool resolves the complete dependency tree, deduplicates packages with same same spec (name@version) and gives you the size off all tarballs.
← PreviousPage 2 of 4Next →