HNHacker News
TopNewBestAskShowJobs

steinuil

1,047 karma · joined April 23, 2016

I tend fat-finger the "flag" button a lot on my phone, sorry about that!
submissionscomments
steinuil··on Stop Killing Games
To all the comments who expressed doubts on how this would work in practice: please read the FAQ, it answers a lot of questions and gives concrete examples.

https://www.stopkillinggames.com/faq

steinuil··on Switching from Arch to NixOS
I was almost a bit shocked when I wanted to install vaultwarden on my VPS that I hadn't touched in months and all I had to do was set `services.vaultwarden.enable = true` and reverse proxy it in the nginx config. It was like "...that's it?"
steinuil··on Switching from Arch to NixOS
I don't think the benefits of defining your system config in this way are immediately visible after one month. I kind of loathed reinstalling Linux before NixOS because I knew I'd have to spend a lot of time remembering how to reinstall and configure my desktop environment, reconfiguring sshd, fixing font rendering and setting a fallback I liked, reinstalling all my terminal utilities and copying their config files over, setting caps lock to esc, and all those little changes I made to my previous installation that I'd inevitably forgot to record.

For servers that's even more relevant: I usually logged into my home raspberry pi every once in a while because I needed to fix something and I didn't even know what services were running on it!

With NixOS it's all comparatively simple: I switched my gaming PC to NixOS a few months ago and while I had to reconfigure some things like display settings, everything else just immediately worked exactly the same as on my laptop after installing.

I set up nix-darwin on my work macbook and share all my dev environment's configuration with my other computers. Now if I change some Helix settings on the macbook, I just have to commit them to my flake (which is just a git repo) and to get those changes on my desktop as well I just have to pull and rebuild.

If I want to install some new service on my home server I just open the relevant configuration.nix file in my config, enable an option, build it locally to check that everything's working, and push the changes to my server.

I don't ever feel the need to do a clean reinstall of my system because everything is already as clean as can be, and if I really wanted to it'd just be a matter of backing up /var and /home, putting the nixos installer on a usb stick, and running nixos-rebuild from there.

I think the benefits of NixOS come into play months down the line, when a problem comes up and all the specific knowledge about what you did with your setup has faded from memory, but all the operational knowledge on how to use Nix is still there.

Edit: I'd recommend trying out NixOS a server or VPS and installing Nix with home-manager on your usual distro for a while. That might give you a taste of what you can do with NixOS without having to fully commit to having it as your main OS and doing everything the "nix way".

steinuil··on I Hope Rust Does Not Oxidize Everything
I say this as a Rust enjoyer, but I think what most people mean when they say this is that there's a lot going on, especially in the function definition syntax. When you start adding in lifetimes and generics with bounds, async, &muts, where clauses... it really does become unreadable. I don't really see a way to fix this without making the syntax even more verbose, or aggressively simplifying the type system to the point that function argument inference becomes viable, but then you might end up in a situation like Swift's where type checking a simple expression takes an excessively long time.

That and the colon-colons (::), probably. Those can add a lot of noise.

steinuil··on SCIM: Ncurses based, Vim-like spreadsheet
That's really neat, I've been looking exactly for a spreadsheet TUI to browse and edit SQLite dbs. Cheers!
steinuil··on Comparing OCaml and Standard ML (2008)
dune supports Reason syntax out of the box, you just have to change the file extension to .re.

https://dune.readthedocs.io/en/stable/reference/dune-project...

steinuil··on The Swift compiler is slow due to how types are inferred
I'm not an expert on the theory, but OCaml has a very fast compiler and while it is (almost) capable of fully reconstructing the types from a program with no annotations, it doesn't have to deal with ad-hoc polymorphism and takes some shortcuts like weak polymorphism when it gets too hard: https://www.ocaml.org/manual/5.2/polymorphism.html
steinuil··on The dire state of NixOS's moderation culture
I think the main objection was Anduril sponsoring NixCon, because a lot of people see it as the Nix community advertising a miltech company in exchange for money the foundation doesn't necessarily need.
steinuil··on The dire state of NixOS's moderation culture
I personally hope some sort of reasonable policy will come from this whole situation and that the community will be stronger for it. I've seen some discussions over this on Discourse, but the community doesn't seem to be in any state to agree on something like this currently.
steinuil··on The dire state of NixOS's moderation culture
I coincidentally started lurking and responding to some support threads the NixOS discourse a few weeks ago, because I appreciate the project and I wanted to get more involved in it. In the past couple days I've seen this train wreck play out in real time, both on discourse and on github discussions.

From what I could gather, the main factor that led the community to this point is Anduril's involvement in the community. Anduril is a miltech company and a contractor of the USA DoD. It looks like they use Nix extensively to train ML models and deploy combat drones, and several of their employees have very close ties to the Nix community; Jon Ringer (an Anduril employee, who is mentioned several times in this document) has recently been a release manager for three versions of NixOS, and was nominated to become a release manager for the upcoming 24.05 release.

Anduril wanted to sponsor NixCon last year because of this deep involvement in the community. I was not there to see it, but from what I've seen lately, many members of the community were not happy about it. The sponsorship was eventually pulled, because the on-site video team for the conference (https://c3voc.de/) threatened to pull out on their own over this sponsorship.

From my understanding there has been no official decision taken over Anduril's sponsorship since last year's debacle. Many people in the community think that this is because Eelco Dolstra, the creator and de-facto BDFL of Nix, is currently employed by Determinate Systems, which is rumored to have a contract with Anduril.

Edit: I just want to make it clear that I don't agree with what is presented in this document. I just wanted to present an overview of what, from my perspective, happened up to this point.

steinuil··on Prolog language for PostgreSQL proof of concept
If you're interested in this I would also recommend you check out Logica[0], which is a datalog-like language that is explicitly made to compile to SQL queries.

0: https://logica.dev/

steinuil··on [dead]
I just looked it up. Looks like he didn't get banned for anything related to Linux or programming, but for posting a video titled "71% of Gaza wants all Jews to die (according to new Gaza polling)".

https://rumble.com/v4kuyhr-youtube-removes-video-and-locks-c...

Make of it what you will.

steinuil··on Winning a hackathon, losing my sanity
Definitely agree. My first few gigs were in consultancy and after seeing how the sausage is made I don't feel much like calling out these kinds of old systems anymore. The budgets and deadlines are tight, the people working on them are often inexperienced and underpaid and have little time to sit down and think things through, and when they have to work on an old system to add some features they have little time and incentives to improve the overall state of things.
steinuil··on Returns: Brings functional programming to Python land
There's libraries like these for many languages and no, they are not satire. I see it as a misguided attempt to bring some patterns from languages that are "better" (by some metrics) into a language that doesn't have good support for them.

By my experience, younger programmers are more likely to want to do this. I fell into this trap myself with a similar library for TypeScript, and discovered the hard way that code written this way was much less readable and debuggable.

Less readable because you're essentially reimplementing variable assignment and control flow with lambdas and bespoke syntax that looks out of place. Less debuggable because the stack traces from these things blow up exponentially, and make it very hard to understand where an error came from.

So yeah, it's not satire, just misguided. If you have to use Python you're much better off sticking to the usual patterns and apply more static analysis on top rather than trying to reinvent the language this way.

steinuil··on We Have to Start Over: From Atom to Zed
ed is the standard text editor.
steinuil··on Rust wont save us, but its ideas will
> trusting a URL which you shouldn't trust

That's actually a feature in Ur/Web, which is a (very niche) language explicitly built for making web servers. It's sort of a domain-specific language though, so maybe it doesn't count.

> making a function public when it should be private

Nothing's gonna stop a programming mistake like that, but in languages with capabilities[0] you can restrict some functions to only be called when you have certain capabilities, and these capabilities can only be made to be acquired after authenticating a user, for example.

[0]: https://borretti.me/article/introducing-austral#cap

steinuil··on Rust wont save us, but its ideas will
This post is not very good, sorry.

Let's start with the first example about IEF: first of all, I think that the security advisory was mostly referring to web APIs that allow users without the necessary permissions to perform actions they shouldn't be able to. If you can already call Java APIs you already have access to the machine so it matters little what visibility the method was declared with. And as somebody else mentioned, the default visibility for Java methods is package-private.

Second example about the URL interception: first of all, you could have `match`ed on the result of `strip_prefix` instead of checking `starts_with` and then `unwrap`ping the result of the former. Second, why not use a URI parsing library? And third: that is not what checking the source of the URL means in this context! I'm assuming there's a way to tell what is the URL currently shown on the webview, and that you should check that before doing an RPC.

The Rust code example shown in the post is functionally identical to the Java version. Also, `&str` doesn't mean the string size is known at compile time, the bounds checks are all performed at runtime.

Third example about path traversal: again, that's functionally the same code as the Java version. What is missing in both is a check that the path is relative to a well-known list of paths and doesn't contain any `..` which could possibly lead to, well, a path traversal vulnerability!

I appreciate the effort that went into the post and I agree that Rust is still better than many other languages out there (because of its API design in many important areas), but man, this ain't it.

steinuil··on Framework Laptop 16 Review
Sorry, didn't notice the reply; if you let it running for a few while eventually it'll collect enough samples to show you the power consumption of the processes you have running in the terminal UI. Then you just look at the top ones in the list and see if there's a way to reduce power consumption, or quit using them altogether. I haven't used it enough to figure out how the reports work.
steinuil··on The Ur Programming Language Family
I've used Ur/Web for an old project (https://github.com/steinuil/negoto). It's a very cool language with a lot of great ideas, and once you get going it really makes it easy to set up a server that interacts with a DB and dynamic frontend features.

The compiler, and its error messages, are somewhat inscrutable if you don't fully understand some of the more advanced features of the language, and some stuff I felt I was honestly not smart enough to figure out after a while. There was a point for me where most of it clicked together, but it took a long while to get there.

Ultimately what made me stop using it after that project was the features of the server itself. You can compile it to a self-contained HTTP server, but some issues that I don't remember right now made it unfit to use outside of development, so you're left with CGI and FastCGI. Like another comment mentioned, there's some stuff you can only do using the C/JS FFI, and Ur/Web's transactional nature sometimes makes it hard to tie these additions into the rest of the language. There's also some things (such as submitting a form with multiple files, IIRC) that are not supported by the compiler, and even after submitting a patch to fix some issues with the SQLite backend I didn't feel comfortable enough with the big pile of terse SML to patch those in.

steinuil··on Framework Laptop 16 Review
I have a Framework 13 12th gen i5 as well, running NixOS, but I definitely get a lot more than 3 hours! I'm usually running some terminals and Firefox.

I definitely had to play with powertop a bit and remove some programs that consumed a lot of battery (for example, the blueman tray applet had to go). I'd recommend setting powerManagement.enable = true and powerManagement.powertop.enable = true, and letting powertop run in the background while on battery for a few hours to identify the worst offenders.

This is my configuration: https://kirarin.hootr.club/git/steinuil/flakes/src/branch/ma...

steinuil··on Was Rust Worth It?
That is also not shared by everyone. If you have written enough Rust to have internalized designing for the borrow checker, you don't have to spend much time in a design phase.

The only time I find I have to "fight the compiler" is when I write concurrent code, and you can sidestep a lot of issues by starting with immutable data and message passing through channels as a primitive. It's a style you have to get used to, but once you build up a mental library of patterns you can reasonably be as fast in Rust as you are in Python.

steinuil··on How (not) to apply for a software job
I actually just looked at their application form for a systems software developer position. They really want to know how good you were at maths and native language in high school for some reason, and not only do they ask what top percentage you were in (whatever that means, high schools in my country don't do that), but they also ask you to directly point to evidence for these scores.

Right before the application form they say "We are proud to foster a workplace free from discrimination." Not everybody had the luck to be able to perform at their best in high school, so that looks like a pretty big discriminant right away! And for most people applying to that kind of job that was more than 10 years ago, so I fail to see how it is relevant to a job application.

steinuil··on Thinking about God increases acceptance of AI in decision-making
...I completely forgot that I was also introduced to Last and First Men by that same dialogue in Deus Ex. It's a great book!
steinuil··on Bram Moolenaar has died
A lot of this advice is about turning vim into a "modern" text editor with a language server configured.

I used to use vim but lately I switched to Helix, which is basically vim but with all the good features and plugins built into it and without a configuration/extension language. Almost all of the features are easily discoverable by just pressing spacebar, and the rest by browsing the (small) documentation, and I can think of a way to do all the things Bram talks about from within Helix, often better (because it's relying on the language server).

Still, the main point about learning your tools by detecting inefficiencies and searching for a better way is always valid, and I'm sure that all these things Vim was already doing at the time helped pave the way for modern editors. RIP.

steinuil··on Splitting the Web
Sure, you can write or run your own fediverse server that renders HTML-only page, and every time you see a Mastodon link you paste it in your server's lookup form and browse it from there. Honk (https://humungus.tedunangst.com/r/honk) is HTML only and very minimalistic. I'm sure there's frontends or clients for Mastodon that use less HTML as well, so you can also swap out Mastodon's default frontend for a less heavy one.
steinuil··on Why F# evangelism isn't working (2015)
That is a matter of habit and not something that is "easier for humans", I think. I've written enough OCaml, which also enforces linear dependence of modules and definitions, that I often find it jarring to read code the other way around and I'd be lost without an IDE that lets me jump to definitions.

I'm not particularly attached to order of definitions within a module, but I definitely like the linear ordering of modules. Without the compiler enforcing that you always end up with cross dependencies between modules, which I think makes it much harder for humans to read the code.

I've had similar conversations about variable shadowing. I find it natural and it bothers me when I can't do it, especially in functional languages, but I have a friend who really doesn't like it and finds it jarring. I think his dislike stems from having learned Erlang before any language that has shadowing, because in Erlang when you reuse a variable name it'll be checking for equality with the value you're "assigning" it to.

steinuil··on Ask HN: Are alternative (oil, nu, etc.) shells usable as daily drivers?
I've been using nushell for a couple of weeks and I'm finding it good enough for a daily driver. I was never much of a shell script person so I don't miss any bash-isms, on the contrary I find that I can easily perform some tasks I'd normally have fired up a Ruby REPL to do, both because the language is much more sane and because it handles structured data and file formats natively. As for normal shell usage (running commands) I definitely prefer it to bash, the completion UI is much nicer and you can set it up very easily for external commands. Also it supports Windows so I don't have to switch to powershell mode when I'm on my gaming PC.

Again, I'm not a shell script person and I never liked sh/bash so I don't have any 1000 line shell scripts that I'll be porting over to nu, and if I need to do something that would take more than a couple lines of code I'll switch to a proper programming language. I definitely wouldn't ship nushell scripts in production or for anything that isn't my local configuration because the commands and the language itself are far from having a stable API.

steinuil··on Automatic1111's GitHub account suspended for "ToS violations" [restored]
For what it's worth, Usada Pekora is a vtuber (a streamer who presents themselves as a mocapped anime/cartoon/3D avatar) who is never implied to be underage. Not that I'm defending whatever Automatic1111 does.
steinuil··on The Twitter Files
> A healthier starting point is a philosophical and systems examination of transparency, censorship, and how information proliferates, followed by systems and mechanisms that facilitate a favorable outcome.

I mostly agree with this, but the rest of your comment reads to me as "everybody else does it so it's fine", which is exactly the mindset that leads to this conversation not being had. A sensationalist story might lean the narrative one way and might be "out of touch with reality" but it's a much better starting point than nothing.

steinuil··on Wordle for Poker
I love that one! I find it kind of amazing that it works at all with so many possible tiles and hands, though I guess them being in order helps a lot.
← PreviousPage 2 of 8Next →