HNHacker News
TopNewBestAskShowJobs

huyage

18 karma · joined August 25, 2021

submissionscomments
huyage··on Netherlands returns control of Nexperia to Chinese owner
Anybody with an opinion I don't like is a Chinese bot.
huyage··on Berkeley Out-of-Order RISC-V Processor (Boom) (2020)
Thanks. Looks good! Are you aware of any 64-bit options?
huyage··on Berkeley Out-of-Order RISC-V Processor (Boom) (2020)
If I want to do systems research that needs a simple and synthesizable RISC-V design, what are some good options? BOOM seems to be pretty complicated and I don't really need the out-of-order execution.

I also want to be able to run it on a cheap FPGA, something like Artix A7.

huyage··on Busy Bar
I personally was intrigued by this by the first HN post months ago. Then I showed my wife the website, to which she said, "This looks like a parody product." If only it's more affordable.
huyage··on Several Russian developers lose kernel maintainership status
Harmony on mobile is pretty sweet.
huyage··on iPhone maker Wistron quits, saying Apple didn't let it make a profit
Isn't wistron literally a taiwanese company?
huyage··on A dad took photos of his toddler for a doctor – Google flagged him as a criminal
Can you recommend you provider? I've been wanting to do the same thing for a while.
huyage··on Rust 1.63
> Do you find the 'stubbornness' of the compiler frustrating at all?

I actually love it. The more work I can offload to compiler the better. One simple example that frustrated me in Go was adding a field to a struct. You add the field the the whole thing still compiles even though the zero-initialized value probably broke your app logic. In Rust if I add a field to a struct, the compiler warns me about all the places that I need to double check.

> Would you mind sharing some of your experiences?

I highly recommend zero2prod book which is well-written, practical, but still teaches the essential principles (https://www.zero2prod.com/). You basically deploy a CRUD app to DigitalOcean from scratch. The best way to ramp up IMHO.

> How do you find the tooling?

Cargo is sweet. rust-analyzer is all I need. I need less extraneous tooling to be effective. For example, in Go I might use a task runner to watch the repo and run tests when I change a file. But in Rust I can just follow the rust-analyzer highlights and manually compile less-frequently.

> Also, I've considered Diesel for ORM, so was wondering if you've been using that too.

I was not happy with GORM (https://gorm.io/index.html) and never had a satisfactory experience with any ORM. I'm a fan of writing plain SQL, even in Go. It's just that with Rust sqlx I can get compile-time checks against the schema. It's not anything new (see Haskell), but it tightens the feedback loop and I have full control of the performance.

huyage··on Rust 1.63
I'm building an HTTP CRUD app on top of PostgreSQL. I have previously used Go for various CRUD apps. The experience is better except for compile time. My favorites:

1. Much more expressive type system: no more `interface{}`.

2. Algebraic data type with `enum`. Exhaustive check.

3. `serde` crate is lightyears ahead of Go's `json:"wtf"`.

4. Compile-time checks against DB with `sqlx` crate.

5. Logging is a breeze with `tracing::instrument`.

6. Using macros to reduce boilerplate has better UX than Go codegen.

What these give me is more confidence in development/refactoring because the compiler can guide me most of the way.

Low lights:

1. Build time.

2. Async is still clunky. e.g. Try to implement an `actix-web` extractor or middleware.

3. Please just stablize nightly rustfmt features already.

huyage··on An ARM Server That Is Banned in the US
Except Huawei is 99% owned by employees (https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3856761) and paid out $9B+ to employees last year (https://www.scmp.com/business/article/3173121/huawei-pays-ou...).
huyage··on K Programming Language
Clicking on examples gives me 403.