HNHacker News
TopNewBestAskShowJobs

unrealhoang

779 karma · joined March 24, 2015

submissionscomments
unrealhoang··on Dow plunges 2,200 points, Nasdaq enters bear market
There is, and it’s much more than an unknown penguin island.
unrealhoang··on Hyperlight WASM: Fast, secure, and OS-free
nah, web developers that aren't doing simple CRUD are using interesting libraries powered by wasm without even care that it's powered by wasm: opencv, sqlite, duckdb, imagemagick, ffmpeg, ... anything AI/using GPU: tensorflowjs.

Those libraries are not something will be able to be JS only anytime soon, and no, Java applets has never allowed us to use C/C++ libraries on the web before.

unrealhoang··on Zlib-rs is faster than C
So static typing is stupid because at the end of the line your program must interface with stream of untyped bits (i/o)?

Once you can internalize that you could unlock the power of encapsulation.

unrealhoang··on Rust inadequate for text compression codecs?
I think tfa hasn’t considered the advantages of enforcing the correct usage of the codecs library. Most of the time memory safety issues are caused not in the codecs code itself but the user code using the codecs incorrectly.

Unsafe Rust is still improving on its ergonomics (handling uninitialized memory) but the current capacity should be enough to implement anything.

unrealhoang··on Abusing C to implement JSON parsing with struct methods
Isn’t rust’s serde what you are looking for?

https://serde.rs/data-model.html

unrealhoang··on Resigning as Asahi Linux project lead
Because that’s all your brain are capable of recalling, the ones with Rust-tagging.

With just a google search away you can dismiss your claim of 90% but you don’t want to do it because you only believe what you want to believe.

unrealhoang··on Resigning as Asahi Linux project lead
Get an article about Rust, and there’s going to be comments about how drama, zealous Rust is from people that never use Rust. Regardless of its content.

So yeah, typical internet houlier than thou reactions, I wouldn’t read much into them.

unrealhoang··on Show HN: WASM-powered codespaces for Python notebooks on GitHub
can I config sql cells to use different data source (remote DB/APIs) instead of local duckdb?
unrealhoang··on Luigi Mangione's account has been renamed on Stack Overflow
Why would they (the companies) have to do anything should be the question.
unrealhoang··on Rust, Reflection and Access Rules
No language since assembly enables new features that you could not have done in assembly.

Languages are invented to enforce standard and build higher level abstraction aka disable feature.

unrealhoang··on C "clockwise/spiral" rule to understand declarations
And type declarations are s-exprs.

The advantage of type after name is that it keeps the traversing order consistently pre-order (node, left, right), instead of either:

- the notoriously ridiculous spiral cdecl: reading stuff right (output), node (func name) and left (input)

- create a new name to describe the function in pre-order: Func<Input, Output>

unrealhoang··on Static search trees: faster than binary search
Yes, there is, just use plain old pointers. Who cares about UB anyway.
unrealhoang··on C "clockwise/spiral" rule to understand declarations
you should just see &mut and & as 2 separate modifier, maybe that'd help.

- & &mut doesn't make sense: and a variable of type & &mut can't mutate the underlying object, it's practically equivalent to a & &, even worse, since the inner is &mut, you can't have 2 & &mut that point to the same &mut (mut xor shared).

- &mut &: mutable reference that point to a shared reference, means you can change the outer to point to another shared reference, but you can't change content of the inner, for example:

    let a: &str = "hello";
    let b: &str = "world";
    let mut c = &a;
    let d = &mut c;
    *d = &b;
    // (*d).make_ascii_lowercase(); // not allowed
- &mut &mut: similar to the above, but you can also change the content of the inner.
unrealhoang··on C "clockwise/spiral" rule to understand declarations
declare the type separately didn't solve the of hard-to-read cdecl problem.
unrealhoang··on C "clockwise/spiral" rule to understand declarations
that's the beauty of type after name, it's all left to right, even in special-cases of array, references, and the most confusing-contributor to cdecl: functions `func(int)[5]*string`: perfectly clear, just read left to right.
unrealhoang··on C "clockwise/spiral" rule to understand declarations
yes, read it from left to right, don't use spiral.
unrealhoang··on C "clockwise/spiral" rule to understand declarations
hence why every recent programming languages are type after name (go included).
unrealhoang··on Static search trees: faster than binary search
Suck to be you, I guess? If you don’t care enough then you don’t care. You wouldn’t bitch when there’s an article written in Italian with good knowledge inside: “but Italian”. You either trying to read using translation tool or ignore it entirely.

I didn’t say python has anything to do with LLVM, it’s just a technique, read about it, or not.

unrealhoang··on Static search trees: faster than binary search
What a weird thing to complain about. The Rust code in TFA are purely arithmetic and imperative function calls. Any C developer that is good enough to care about the algorithm mentioned will have no issue reading such Rust code, heck, they could even throw the code to chatgpt to translate for them no problem.

Such a good and detailed article that packed with techniques that are applicable everywhere yet the complaints are: “but rust”.

Regarding Python, how could such optimizations be implemented in Python? Generating LLVM bytecodes directly aside.

unrealhoang··on Show HN: Simple live calculator in Tree-sitter and cranelift JIT
It calculates
unrealhoang··on C Gibberish to English
for declaring function pointer?

Any language with type after name :

    // c
    char (*(*x[3])())[5];
    // golang
    var x [3]func() *[5]byte
unrealhoang··on The English Paradox: Four decades of life and language in Japan
Not really, there's little to almost no difference in English literacy between Viet, Korea & China. Yet there's a big gap compare to Japan, the reason is either culture and economic incentive rather than because of the native script.

In Japanese TV, you can even see that for influencers (idols, singers, comedians) being bad in English is considered a cute "feature", this is uniquely apply to Japan.

unrealhoang··on Trump wins presidency for second time
How come? Trump’s just won an election with it.
unrealhoang··on Using Rust in non-Rust servers to improve performance
lifetime checking is only done locally (inside function definition), not globally so it's relatively fast.
unrealhoang··on Using Rust in non-Rust servers to improve performance
> As Rusty as possible without having to worry about lifetimes, the borrow checker

It's Ocaml

unrealhoang··on Japan introduces enormous humanoid robot to maintain train lines
What's the advantages of head tracking though? I don't see it's in anyway better than just joystick to control robot head movement.
unrealhoang··on Eradicating N+1s: The Two-Phase Data Load and Render Pattern in Go
TFA is using raw SQL (via sqlc) if you read carefully. And no, raw SQL doesn't get rid of N+1 issues.
unrealhoang··on How much memory does a graph take?
After convert the keys to u32, they can use more specialized data structure like croaring to get an order of magnitude faster.
unrealhoang··on A proposal to add signals to JavaScript
The problem with events handling are, you don't actually know what needs to be done when the event trigger. Let's say you have 20 components, on counterChange, which of the 20 components need to be updated? And how? You can either do it the simple (and very inefficient), and it's React conceptually way by render all 20 of your components again with new value of counter, i.e.

    window.addEventListener('counterChange', () => {
        element.innerHTML = 20components.map(|c| c.renderHTML(newCounterValue)).join('');
    });
or, you have to check the components on case by case basis on a. if the component need to be updated or not, and b. how is the most efficient way to update such component. And in TFA, if counter is changed from odd to odd, the label doesn't need to be updated.

Also, multiply the number of events to the number of components can make the application go out of hand very quickly.

unrealhoang··on A proposal to add signals to JavaScript
> Right, the only thing that convinces me is team and hiring dynamics. But that’s not what these tools advertise.

And that's fine, these tools don't solve what you search for.

A dozens of controls multiply with a dozens of events are already a quite big amount of points of failure, so people gladly trade it with the dependencies (what's the issues with dependencies anyway?).

So yeah, not many people want to be good, and only hire good people like you to use the hand tools and "just do it correctly". Most acknowledge their downsides and use proper tools to aide them.

← PreviousPage 2 of 10Next →