HNHacker News
TopNewBestAskShowJobs

smasher164

1,521 karma · joined August 13, 2015

akhil.cc
submissionscomments
smasher164··on Zero to Nix, an unofficial, opinionated, gentle introduction to Nix
I see. Yeah that's a shame.
smasher164··on Zero to Nix, an unofficial, opinionated, gentle introduction to Nix
I use configuration on macos as well, so I'm not sure what you mean?
smasher164··on Zero to Nix, an unofficial, opinionated, gentle introduction to Nix
Usually you’re on a single-user system anyway though. You should be able to manage all that with your global configuration.nix. You’ll also get the benefit of rollbacks.
smasher164··on Zero to Nix, an unofficial, opinionated, gentle introduction to Nix
I'm glad this guide is focused on flakes. If you're starting out with Nix, forget about home-manager, nix-env, and the pre-flake configuration model.
smasher164··on A command line tool that draw plots on the terminal
Thanks! Added it: https://github.com/smasher164/arewesixelyet/commit/4e8f68e98....
smasher164··on A command line tool that draw plots on the terminal
Yeah, in an effort to spur adoption, I built (shameless plug) https://www.arewesixelyet.com/. What’s interesting is that if VTE gets support, a lot of other terminals will, since they depend on it.
smasher164··on Linux /proc/pid/stat parsing bugs
makes you wonder if it's really that valuable to have all our infrastructure built on parsing text
smasher164··on Rust: State of GUI, December 2022
It looks like the author of wxRust is attempting another go at bindings with https://github.com/kenz-gelsoft/wxRust2.
smasher164··on Rust: State of GUI, December 2022
I agree that GUIs have gotten more complicated nowadays, but I don't think the existence of platform-specific APIs is mutually exclusive with cross-platform abstractions. If anything, you should be able to specialize behavior for a certain platform.
smasher164··on Rewriting TypeScript in Rust?
My favorite language in this category is MLscript. The best part is that type-checking it is decidable! https://github.com/hkust-taco/mlscript
smasher164··on Rust: State of GUI, December 2022
One thing I'd like to see are Rust bindings for wxWidgets. Contrary to the prevailing opinion, I think wrappers over native toolkits are a fine approach for cross-platform development.
smasher164··on Advent of q 2022
Is there an open-source implementation of Q? Syntactically, it seems more approachable than other array languages, especially due to the use of identifiers instead bespoke symbols for non-standard operators.
smasher164··on APL deserves its renaissance too (2018)
I like Ivy's[0] approach by using keywords instead of symbols. I feel like something like APL should either be embedded in some host language, be given lots of functionality for I/O, or some static type system with rank polymorphism.

[0]: https://github.com/robpike/ivy

smasher164··on Crsql – Multi-writer and CRDT support for SQLite
That would be cool. One I issue I could see coming up is that automerge and yjs keep everything in memory (the reason why a DB CRDT is preferable in the first place), so I'm wondering how you'd make use of their APIs without doing a bunch of (de)serialization.
smasher164··on Crsql – Multi-writer and CRDT support for SQLite
It looks like it doesn't have sequence support? Dang -- I'll wait a while then.
smasher164··on Crsql – Multi-writer and CRDT support for SQLite
This is phenomenal! I'm going to try experimenting with this. Hats off to the author.

I was trying to re-implement a JSON CRDT on top of SQLite for my notes app, but this just made the whole database a CRDT!

smasher164··on Thirteen Years of Go
I agree that a stack trace is useful, but I disagree that automatic bubbling is universally good. If you look at well-written Go, context is added to every site where you bubble up an error.
smasher164··on Thirteen Years of Go
I don’t think the original commenter said anything about “automatic”. That’s more of a subjective decision—whether or not you manually bubble up an error, or it just floats up because of the exception handler.

Empirically, java code has had terrible error handling, because people just stick one catch statement at the root of their program. Go atleast confronts you with the error at every step.

smasher164··on Thirteen Years of Go
> A pragmatic “handle it here or bubble it up” is a much better approach

This is exactly the approach used in Go code, so I'm not sure what you're referring to. If you're talking about the fact that you can technically ignore an error result like

    res, _ := doWork()
then that's a fair point. But we still have https://staticcheck.io/docs/checks#SA4006 for that.
smasher164··on No safe efficient ways to do three-way string comparisons in Go
Another option is to use `go:linkname` and call the runtime function yourself.

//go:linkname cmpstring runtime.cmpstring func cmpstring(a, b string)

smasher164··on Virtual Threads: New Foundations for High-Scale Java Applications
> Green threads were always better

There’s a lot of people who advocate otherwise, but I don’t think we have the mechanisms for effect polymorphism in current languages good enough to make effects ergonomic.

> Most of the point of green threads is to avoid the OS getting in the way.

I see the OS as an environment to help me run programs. Language runtimes have been taking over that role over the last few decades, sure. However, whether or not unikernels are the way forward remains to be seen. I still see it worthwhile to improve the OS, however.

smasher164··on Virtual Threads: New Foundations for High-Scale Java Applications
I said in a sibling comment that scheduler activations may have been a flawed idea, but I don’t think the space of user-space scheduling APIs is fully explored. Google’s ghOSt work is an example of that. If io-uring is proof of anything, it’s that there’s still fundamental changes we can make in how we schedule work with the kernel.
smasher164··on Virtual Threads: New Foundations for High-Scale Java Applications
Project Loom experimentally proved that the benefit of virtual lies not in its fast context switches, but in the throughput afforded by having so many threads executed at once.

I am aware of GC-aware green threads. They allow you to combine your GC pause and scheduler pause into one. Again, this is not the end of the world, even when you don’t have shared mutable state. If anything, it makes it easier to build a runtime on top of.

smasher164··on Virtual Threads: New Foundations for High-Scale Java Applications
Yeah, scheduler activations were one approach, albeit one that wasn't deemed effective. I think FreeBSD ended up removing the feature.

A more recent attempt that's interesting is ghOSt from Google: https://storage.googleapis.com/pub-tools-public-publication-....

smasher164··on Virtual Threads: New Foundations for High-Scale Java Applications
> still lock the go VM with an infinite loop

This is no longer an issue now with Go's async preemption. Also, this is less a "language-level concern" and more a consequence of a poor implementation of preemptive scheduling. Moreover, this is something OS threads already support.

smasher164··on Virtual Threads: New Foundations for High-Scale Java Applications
Preemptive threads with growable stacks. There was some discussion around getting segmented stacks into the kernel, but I'm not sure that's the best approach. There might have to be some novel work done in making contiguous stacks work in a shared address space.
smasher164··on Virtual Threads: New Foundations for High-Scale Java Applications
Not really tbh. The Go runtime has a work-stealing scheduler and does a lot of work to provide the same abstractions that pthreads have, but for goroutines.
smasher164··on Virtual Threads: New Foundations for High-Scale Java Applications
> If that's the sense that's meant

Yeah that's what I meant, a lightweight threading mechanism provided by the OS.

> there's probably not much reason to add them when user space lightweight concurrency mechanisms already exist

Yeah... I don't think there's consensus on that. It seems that many people find OS threads to be an understandable concurrency model, but find them too heavyweight. So the languages end up introducing other abstractions at either the type-level (which has other benefits mind you!) or runtime to compensate.

smasher164··on Virtual Threads: New Foundations for High-Scale Java Applications
After all the hoopla surrounding concurrency models, it seems that languages are conceding that green threads are more ergonomic to work with. Go and Java have it, and now .NET is even experimenting with it.

How long until OS vendors introduce abstractions to make this easier? Why aren't there OS-native green threads, or at the very least user-space scheduling affordances for runtimes that want to implement them without overhead in calling blocking code?

smasher164··on Open Source PC That Fits in Your Pocket
This is cool, but a 5 hour battery life is kind of a dealbreaker for a device I would be very mobile with.

The 11 inch macbook air used to get over 11 hours, and netbooks used to get like at least 4 hours.

← PreviousPage 3 of 9Next →