News for hackers. Stuff that matters.

JoshuaRLi

Re:You don't really need a virtualenv on Thursday February 04, 2021 @07:16AM (#26024716)
Happy to see PEP 582 gaining traction, the last attempt I saw in this space was https://github.com/cs01/pythonloc.
Re:How to speed up the Rust compiler one last time on Thursday September 10, 2020 @06:21PM (#24437156)
> The only thing that matters is wall clock time so if cache layout is making a 300% difference to wall clock, focusing on instructions counts will mislead you on the most impactful optimization to make

Ahh, very well said!

Re:How to speed up the Rust compiler one last time on Monday September 07, 2020 @11:55PM (#24405063)
It isn't surprising to me that instruction counts as a performance metric would have less variance than wall time. Did you know that the environment size can actually affect wall time?

> We see that something external and orthogonal to the program, i.e., changing the size (in bytes) of an unused environment variable, can dramatically (frequently by about 33% and once by almost 300%) change the performance of our program. This phenomenon occurs because the UNIX environment is loaded into memory before the call stack. Thus, changing the UNIX environment size changes the location of the call stack which in turn affects the alignment of local variables in various hardware structures.

From https://www.inf.usi.ch/faculty/hauswirth/publications/asplos....

I suspect it might be something mentioned in https://github.com/masukomi/arc90-readability. I believe it's what powers "readability" view in modern browsers (firefox https://github.com/mozilla/readability, safari).
Re:Nano 5.0 on Thursday July 30, 2020 @11:50PM (#24005470)
Have a look at https://github.com/zyedidia/micro, which has those keybindings by default. Mouse support too. Completely eliminated the text editing learning curve for me, and years later, I still use it happily.

Edit: Oh, I see it's been recommended in this thread already.

Re:Lua 5.4.0 on Wednesday July 01, 2020 @04:30AM (#23699220)
Yeah, I was happy to see the switch away from C random/srandom or rand/srand.

Not my area either, but a little surprised why a PCG-family non-CSPRNG algorithm wasn’t used: https://www.pcg-random.org/posts/a-quick-look-at-xoshiro256....

PCG XSL RR 128/64 (MCG) could be used for 64-bit values (albeit with period 2^126 compared to xoroshiro256’s 2^256 − 1) with 128 bits. Half the state size than xoshiro256, and the performance might be comparable (would need benchmarking). LCG version if you want to trade PRNG quality for even more speed.

Love how my old Galaxy S6 is stuck on ancient Android 7. And it's the verizon version too, so I can't unlock the bootloader. Perfectly capable device, what a shame.

Switched to iPhone SE a while ago because of this.

Re:NextDNS Is Out of Beta on Wednesday May 27, 2020 @08:15PM (#23331838)
On my work laptop (macOS Catalina), I get a bunch of `in-addr.arpa` - seems to be reverse lookups. Is that the case for you, too?
Re:Learn Go: Hand-crafted Go exercises and examples on Monday May 18, 2020 @02:14PM (#23226221)
go mod init github.com/your/project

Then, go get -v will download your dependencies to GOPATH, and (re)generate go.mod, go.sum. For info on how to update dependencies, read `go help get`.

When using modules (presence of a valid go.mod file), GOPATH won't be used for resolving imports. So you don't have to actually work in GOPATH anymore, dependencies are just stored there.

Re:NextDNS is my new favourite DNS service on Thursday April 16, 2020 @12:21AM (#22886014)
I switched from pointing various things to cloudflare to simply using NextDNS a while ago, and it's just excellent. The onboarding flow was way faster and easier than I thought it would be (fantastic setup documentation). Configurations are really great for customization at per-device granularity. Extremely slick and fast web UI. Great DNS latency + performance overall.

I was planning on setting up my own recursive resolver one day (tm) but NextDNS really just makes everything so seamless + easy.

Re:NextDNS is my new favourite DNS service on Thursday April 16, 2020 @12:17AM (#22885988)
> Even worse, iOS forces you to use a fake VPN to change DNS servers at all on cellular!

This is a major pain point for me - I'm trying to use both NextDNS and Tailscale on my iPhone SE 2016, and confirmed that they clash with each other. :(

Re:New iPhone SE on Thursday April 16, 2020 @12:06AM (#22885944)
Agree with all these points (also an iPhone SE 2016 user). One more point to consider is whether or not the iPhone SE 2016 will continue to get OS updates.
Re:New iPhone SE on Thursday April 16, 2020 @12:01AM (#22885921)
Yes. I've long been impressed with the single core performance and power efficiency of apple's mobile SoCs. Same-generation SoCs used on a variety of androids can't even compare. Google Maps for example was running like total shit on my old Galaxy S6, switched to iPhone SE (2016) and never looked back.

Really exciting times where an A9-based quality handset can be had for ~$60 on eBay. I expect prices will fall a bit further with this new SE model. And yes, the A9 is completely viable in 2020. Planning on holding onto it for as long as reasonably possible.

Re:Ask HN: What projects are you working on now? on Monday March 30, 2020 @08:29PM (#22733764)
This looks pretty clean! The enhanced readability reminds me of Wikiwand.

If you're looking for a bit of feedback, the search doesn't seem to handle fast typing well. I tried searching for "Frank Chu" and it seems that if I type it really fast, I get either no results or Franks that aren't Frank Chu. If I type slower, Frank Chu shows up.

Re:Ask HN: Configuration Management for Personal Computer? on Monday August 12, 2019 @05:50PM (#20680418)
Shameless plug: I rewrote the "dotfile-relevant" featureset of GNU stow in plain python as a PoC of a simpler batch symlinker: https://github.com/joshuarli/sym-prototype

It's worked really well for me. Used to use stow.

> the general public actually doesn’t care about privacy at all

It's not that people don't care; privacy is probably undervalued in the context of making privacy vs. convenience/utility decisions. (Digital) privacy's value isn't really tangible until it's actively used against you.

Re:How to Enable DNS-over-HTTPS in Firefox on Monday July 08, 2019 @05:08PM (#20386774)
At least on linux, go's native resolver follows a sane subset of glibc conventions like parsing /etc/nsswitch.conf, /etc/resolv.conf, /etc/hosts [1]. As long as your dns configuration is defined there, you won't notice much of a difference between go programs using go's resolver and programs making glibc library calls for dns stuff.

1: https://jrl.ninja/etc/2/strace-go-1.12.3.txt

src for above: https://jrl.ninja/etc/2/getaddrinfo.go.txt

Re:How to Enable DNS-over-HTTPS in Firefox on Monday July 08, 2019 @04:53PM (#20386651)
Hi Dima - I'm assuming you're aware of dnscrypt-proxy and wrote nss-tls because you wanted a lighter weight implementation of a subset of dnscrypt-proxy's features on a specific platform (linux/glibc, for example this won't work on linux/musl afaik)? I use dnscrypt-proxy happily but was interested in nss-tls, yet couldn't find a rationale/comparison in the readme.
Very cool - thanks for sharing, and the shoutout (consider also replacing 38rem/2rem with 70ch/2ch)!
https://github.com/joshuarli/dotfiles/blob/master/misc/firef...

Also have a bunch of umatrix rules, but not inclined on sharing those. Regarding gmail, keep a pinned tab open on about:memory and periodically click on GC and minimize memory, that might be a better solution than reloading.

I have never had any performance or memory related issues with firefox, on a modest xps 13 9343 with 4gb ram. In fact, with regular usage, firefox rarely exceeds 2gb usage, and cpu usage is never an issue. Though I have tweaked my firefox quite a bit, I don't think the core issue is with the browser technology. The technology is fantastic and computers are fast. Rather, I see it is a combination of two things: poor web browsing habits (tabs open, websites visited) and the ever-increasing badness of "modern" websites.
Re:GitHub Sponsors on Thursday May 23, 2019 @11:24AM (#19992592)
Exactly this. The "purity" of OSS development needs to be reflected in the "purity" of donations for this to work. Small donations should represent nothing more than a token of appreciation. Large donations, well... money shouldn't buy project influence, though that is easier said. It's a complicated matter of corporate sponsored engineers contributing both good and bad (influence wise) patches back to OSS, but people need to make a living somehow.
Re:AMD Ryzen Mini-STX: ASRock’s DeskMini A300 on Tuesday May 21, 2019 @03:16PM (#19973792)
Agreed. Although alternatively, some ARM SoCs have relatively weak iGPUs, which make them great hobbyist headless machines.
Re:AMD Ryzen Mini-STX: ASRock’s DeskMini A300 on Tuesday May 21, 2019 @03:11PM (#19973735)
The recent STX form factors are a wonderful boon to SFF consumer computing, and this is a welcome step towards wider SFF adoption. Looking forward to the gradual miniturization of desktops, love efficiency at lower TDPs.
Re:Lsd: The next gen ls command on Tuesday May 21, 2019 @12:12PM (#19971550)
Right, there's always going to be some additional cognitive overhead with every new tool you adopt. The question is how much you value its benefits for your use case, and is it worth those costs. If you're so used to find, and it works great for you, then keep using it! It's indeed more powerful and standard than fd, which I think is well-suited for vast majority of simple use cases (casual use).

However, here's my reasoning for the first of your questions, as a happy fd user who switched from GNU find. Maybe it can give you insight into why the UX is designed as it is.

The extension is distinguished from the filename because it's a common use case (-e jpg less keystrokes than -iname '*.jpg'), it's semantically separate from the filename (IMO) and therefore should not be treated as part of it. And unlike filenames, extensions most often do not need to be pattern matched. If you want to match multiple extensions, just repeat the -e flag e.g. -e jpg -e png.

Re:Lsd: The next gen ls command on Monday May 20, 2019 @11:34PM (#19967394)
fd is excellent for casual interactive use, i've had a great UX with it and performance feels on par with GNU find.

Older »