HNHacker News
TopNewBestAskShowJobs

smasher164

1,521 karma · joined August 13, 2015

akhil.cc
submissionscomments
smasher164··on Elastic Tab Stops (2017)
A great idea hindered by the lack of adoption in tools.
smasher164··on Clang-expand: Expand function invocations into current scope
This is so cool! I want this for every language now.
smasher164··on Fixing for loops in Go 1.22
you stick this in your struct

    type noCopy struct{}
    func (*noCopy) Lock()   {}
    func (*noCopy) Unlock() {}
smasher164··on Fixing for loops in Go 1.22
> we're still inventing languages where local variables can be mutated

Local mutability is probably one of the most common uses of mutability. A lot of it is using local state to build up a more complicated structure, and then getting rid of that state. Getting rid of that use-case is just giving up performance.

smasher164··on I think I kind of hate lazy loading
Even if network conditions are great, lazy loading breaks browser operations like "Find" with Ctrl-F. It's only gonna search what's in the viewport. I think lazy loading should only be used when there's an actually infinite stream of content to load. But stuff like the twitter replies section shouldn't be this way. I shouldn't have to scroll all the way down to make sure search works.
smasher164··on Philosophy of Coroutines
Single-shot continuations in the form of lexical effect handlers would be a good fit for a systems language nowadays. I feel it's a bit too late to staple that onto Rust though.
smasher164··on Chidori – Declarative framework for AI agents (Rust, Python, and Node.js)
I love the Naruto reference.
smasher164··on Octox: Unix-like OS in Rust inspired by xv6-riscv
It’s hard enough to learn osdev. If you have a concrete design to fall back on, you can focus on implementation.

Coming up with an original design for OSes is like a 3rd project thing.

smasher164··on NixOS and my descent into insanity
Yeah, I admit that home-manager is already decked out with all of these options. There's some more manual effort that goes into using configuration.nix here. That being said, I've been seeing more software being packaged up as nixos modules. For example, you can configure a git installation globally now.
smasher164··on NixOS and my descent into insanity
I don't really have a need for home-manager on a single-user NixOS system. Whatever configuration home-manager would typically manage is now contained in my global configuration.nix.
smasher164··on Designing a Language Without a Parser
> I don't think removing the parser will take you across the finish line if you otherwise were running out of steam.

Everyone's different. The problem with parsing isn't the difficulty, but rather the potential for endless bikeshedding. You're having to make a ton of opinionated decisions that in turn produce more questions about your syntax. If your personality is like mine in that it's a bit obsessive "completing" a phase, then parsing feels like an endless quagmire. In comparison, AST -> type inference -> codegen feels more structured and straightforward.

smasher164··on So you want to write a GUI framework (2021)
My one gripe with this article is that it doesn't really explain why a wrapper over native toolkits is untenable. There haven't been many attempts of this idea, of which wxWidgets and libui are a couple. Yes, it exposes its own complexity, but I would rather start with a GUI that's portable/accessible, and then worry about its look-and-feel.
smasher164··on The Rust I wanted had no future
I admire Graydon's humility on the subject--and sure enough, I disagree with some of his ideas in this post, and agree with other ones.

- Explicit lifetimes are what make rust what it is. It would have surely failed had they not been introduced.

- I disagree about having a first-class module system instead of traits. Coherence and implicit instance resolution are a core value of Rust. `Send / Sync` are key examples of that.

- Green threads probably wouldn't been viable for rust, given the kind of programs it's targeting.

- Pretty much everything else however, I agree with.

smasher164··on Why is Swift so slow (timeout) in compiling this code? (2022)
My thinking for ways to avoid this scenario are:

- If there is no concrete type that you can infer for the given literal, throw a type error.

- If there is no concrete type that you can infer for the given literal, fall back to a default, e.g. Int.

But this sort of situation is why backtracking during type inference can lead to pathological behavior.

smasher164··on Purely Functional Data Structures (1996) [pdf]
RRB trees in particular allow you to benefit from some of the cache efficiency of regular vectors, while supporting operations like immutable update. They are used in languages like Clojure and Scala.
smasher164··on Programming in Standard ML (2011) [pdf]
Regardless, I would prioritize learning OCaml. The only thing SML has going for it is nicer syntax, and less stapled-on OOP stuff. OCaml's better in almost every way for day-to-day programming.
smasher164··on Super Colliding Nix Stores: Nix Flakes for Millions of Developers
I love Nix as a package manager, and flakes are awesome for setting up environments. I wish it had more affordances for being a proper build system. If only there were a Buck2 and Nix hybrid.
smasher164··on The tiny corp raised $5.1M
Right, but the type system is the constraint. Nobody's gonna take the untyped lambda calculus and run it on an accelerator. Even something like turing-completeness can be a type annotation, for example, the totality effect provided by languages like Koka.
smasher164··on The tiny corp raised $5.1M
Turing-completeness != un-optimizable! Literally the areas of type systems and compilers exist to serve this endeavor. It's gotta be a meme at this point every time someone brings up the halting problem or rice's theorem.
smasher164··on CRDT-richtext: Rust implementation of Peritext and Fugue
Yeah, I think a good step would be to integrate a rich CRDT into sqlite, whether that's through CTEs, a custom extension, or library code that manages the tables.

Layering a CRDT on top of an existing schema might not be very efficient though. You'd likely need to modify the db's internals. I have no evidence for this statement though :)

smasher164··on Are We Sixel Yet
Sorry about this. I assumed that checkmark/cross would compensate for this color combination, but I agree that better colors would make this more accessible for everyone. From what I'm reading online, Blue / Red is a better combination here?
smasher164··on Are We Sixel Yet
Yeah, sorry about that. I threw this together with the first terminal-like Hugo theme I could find, since I wanted to focus on getting the info out there. I'd probably either have to create a custom theme, or just rewrite the site from scratch. Your point is noted though--others have brought this up.
smasher164··on Are We Sixel Yet
I was debating whether or not I should mention iTerm's image protocol, since iTerm already supports SIXEL.
smasher164··on PlanD: Plan9 from Containerspace
> How then would one leverage 9p filesystems to solve the containerization problem?

In Plan 9, processes are sandboxed by default, so they only see what is exposed to them. You utilize mounts to attach filesystems to processes, and since all APIs are done through the filesystem, you can trivially wrap/extend/replace those APIs with different implementations.

Essentially, everything-is-a-filesystem + 9p gave you a kind of capability-based security.

smasher164··on MINIX from Scratch
I think xv6 is a much more palatable intro to operating systems than minux. It's a tiny codebase, with an annotated guide, and a book explaining its core ideas and implementation in a very direct way.
smasher164··on Comparing Objective Caml and Standard ML
Tbf, I've only seen decent implementations of it over the past couple of years, with Koka and OCaml. There's still work to do to get it to interact nicely with a low-level language, but I'd argue that they're the way forward for newer GC'ed languages.
smasher164··on Comparing Objective Caml and Standard ML
Exceptions will come back, but in the form of algebraic effects. All of the work that goes into error handling, asynchrony, mutable state, and IO will be generalized by effects.
smasher164··on Comparing Objective Caml and Standard ML
Remember that this is only comparing the languages. If you actually try to write code in Standard ML, you come to a rude awakening as to how poor the tooling is.

Libraries are underdocumented and unavailable. The build system and package management is arcane. SML feels like a toy language compared to working in OCaml.

smasher164··on Google’s fully homomorphic encryption compiler – a primer
Combinatorial circuits aren't turing complete. The novelty of mov being turing complete is that they were able to do conditional branching with just loads and stores. In the FHE case, they can't read and write to parts of memory, so it's a no-go.

This is why their compiler essentially only works on pure functions whose inputs have a statically known size.

smasher164··on Go 1.20 released
I use generics all the time in my Go code, in particular with the exp/slices library and lo. I do not find it less readable. I think readability is subjective based on people's programming experience and familiarity with type systems.
← PreviousPage 2 of 9Next →