HNHacker News
TopNewBestAskShowJobs

r4victor

891 karma · joined January 9, 2018

I write about how things work at https://tenthousandmeters.com/.

--

submissionscomments
r4victor··on Parse, Don't Validate (2019)
That's exactly the problem. Thanks for describing! What I find is people using linters to ensure all struct fields are initialized explicitly (e.g. https://github.com/GaijinEntertainment/go-exhaustruct), which is uhh...
r4victor··on Parse, Don't Validate (2019)
It seems modern statically-typed and even dynamically-typed languages all adopted this idea, except Go, where they decided zero values represent valid states always (or mostly).

A sincere question to Go programmers – what's your take on "Parse, Don't Validate"?

r4victor··on Show HN: Similarity = cosine(your_GitHub_stars, Karpathy) Client-side
Super cool! It recommended me Scalene Python profiler (https://github.com/plasma-umass/scalene), which looks very interesting – I haven't heard about it before..
r4victor··on I switched from VSCode to Zed
Working now? It's a 1cpu/1gb VPS – maybe too small to handle hn hugs.

The website repo is public, so it's also available on github: https://github.com/r4victor/tenthousandmeters/blob/master/we...

r4victor··on I switched from VSCode to Zed
Yes! I also got bitten by format_on_save when working with legacy projects with inconsistent formatting. Given another discussion I saw, the maintainers didn't think about this use case much, i.e. "why don't you want to have a proper formatting?". It can be turned off now, so not sure if they'll change the default.
r4victor··on I switched from VSCode to Zed
Hmm, I found Zed to consume battery less than VScode on my M1 MBP. It's ~100 vs ~200 12h power consumption on average according to Activity Monitor. Do you compare it to VSCode?
r4victor··on I switched from VSCode to Zed
That's a good idea. I considered VSCodium but the issue is that I used VSCode's proprietary extensions such as Pylance. So it would require to switch to OSS replacements at which point I decided why wouldn't give Zed a try – it has a better feeling by not being an Electron app.

I think VSCodium is a good option if you need extensions not available in Zed.

r4victor··on I switched from VSCode to Zed
Hi, I'm the author of the post. I hope it resonates with many who got tired of VSCode and found Zed.

I'd also like to add there are many small features I miss in Zed that I don't go over in the post, e.g. autodetect and respect file's indentation (https://github.com/zed-industries/zed/issues/4681). But I see Zed is actively shipping the missing features, so I believe they'll improve significantly over the next year.

r4victor··on I switched from VSCode to Zed
Is it on linux?
r4victor··on We need a clearer framework for AI-assisted contributions to open source
So far I prefer the Hashimoto's solution to this that "AI tooling must be disclosed for contributions": https://news.ycombinator.com/item?id=44976568

I use it like this: If a PR is LLM-generated, you as a maintainer either merge it if it's good or close if it's not. If it's human-written, you may spend some time reviewing the code and iterating on the PR as you used to.

Saves your time without discarding LLM PRs completely.

r4victor··on 0-click deanonymization attack targeting Signal, Discord, other platforms
Their twitter says

> Joined November 2017

so likely a bit older :)

r4victor··on Ask HN: Why did K8s win against Docker Swarm?
I agree - “failed” may be not the best word. I mean failed only compared to the k8s abundance.

Anyway, impressive scale for Swarm! Are there any crucial features you miss in Swarm?

r4victor··on Show HN: An open-source, self-hostable synced narration platform for ebooks
Amazing! I've made a similar ebooks-audiobooks aligner years ago: https://github.com/r4victor/syncabook. At that time, I chose to synthesize the text and align two audio sequences because I found texts-alignment approaches (including ML-based ones) too compute-intensive and inadequate for long texts. I see Storyteller works by aligning the texts. Could you give some view on how long it takes to sync a book?

Also, my experience was that audio and text versions are often very different (e.g. the audio having an intro missing from the text). It'd be very interesting to know how well Storyteller handles such cases. Does it require manual audio/text editing or handle the differences automatically?

r4victor··on The Computer Science Book (2020)
You're welcome! I'm collecting learning resources on tech topics at https://bestresourcestolearnx.com and I was looking for a book on CS like this one for a long time. Further readings are especially good – I'm going to steal some of your recommendations ;)
r4victor··on The Computer Science Book (2020)
Indeed! I found this book completely accidentally via google and it seems to be largely unknown. Let's fix it!

It's really hard to attack such a vast subject and produce something valuable. The author did a great job.

r4victor··on Ask HN: What are you working on this year?
I'll continue to go through books, docs, courses, and other resources on programming, CS, and math topics and share the best ones on https://bestresourcestolearnx.com to help people learn more effectively.
r4victor··on Ask HN: How to tell the world about your project?
Think of other resources besides money that you can use for promoting projects: 1) your time and energy and 2) creativity. A reliable way to get traffic is to produce valuable content such as articles and videos. Sure, they also need promotion, but you can post them to HN, reddit, etc from time to time and it will be more reliable and sustainable source of traffic than a one-time link to the project. It's a hard way but it works 100%.

Look for new platforms and communities that are not sick of things being promoted. There is an excellent observation about Mastodon now in the comments.

SEO works. I've prototyped a new project recently – a collection of learning resources on IT topics (https://bestresourcestolearnx.com) – I haven't even started to promote it yet but it gets some relevant SEO traffic anyway.

Creative promotion ideas are project-specific, but I would think about how you can collaborate with people with some audience in your field. Like game developers giving away their games to streamers and influencers.

And mention your project when the opportunity arises (if appropriate, of course).

r4victor··on The GIL and its effects on Python multithreading
This is a WIP. Here's how it's going on: https://pythondev.readthedocs.io/subinterpreters.html
r4victor··on The GIL and its effects on Python multithreading
As far as I understand, Ruby's Ractors are what Python is now trying to do with subinterpreters (https://lwn.net/Articles/820424/). I mention them in the post.
r4victor··on The GIL and its effects on Python multithreading
Hi! I'm the author of this article. Thanks for posting it.

The GIL is an old topic, but I was surprised to learn recently that it's much more nuanced than I thought. So, here is my little research.

This article is a part of my series that dives deep into various aspects of the Python language and the CPython interpreter. The topics include: the VM; the compiler; the implementation of built-in types; the import system; async/await. Check out the series if you liked this post: https://tenthousandmeters.com/tag/python-behind-the-scenes

I welcome your feedback and questions, thanks!

r4victor··on How async/await works in Python
Hi! I'm the author of this post. I've been writing asynchronous Python code with async/await for quite a while but didn't have a perfect understanding of how it actually works: what await does; what an event loop really is and how it runs coroutines; what coroutines are; why Python has native coroutines as well as generator-based coroutines; how asyncio works; and so forth... In this post I've tried to answer all these questions. After reading it, you should be able to reason about async/await code almost as easily as you reason about regular Python code.

If you liked this post, you may also like other posts in my Python behind the scenes series: https://tenthousandmeters.com/tag/python-behind-the-scenes/

As always, I welcome your feedback and questions. Thanks!

r4victor··on How the Python import system works
Hi! I'm the author of this article. Thanks for posting it.

I've been programming in Python for quite a while but didn't really understand how the import system works: what modules and packages are exactly; what relative imports are relative to; what's in sys.path and so on. My goal with this post was to answer all these questions.

I welcome your feedback and questions. Thanks!

r4victor··on How the Python import system works
Thank you! I left out `import xx as y` on purpose. It's obvious how this feature is implemented – Python just saves the imported module under another name.
r4victor··on How the Python import system works
Hi! This is part 11 of my Python behind the scenes series. I've been programming in Python for quite a while but didn't really understand how the import system works: what modules and packages are exactly; what relative imports are relative to; what's in sys.path and so on. My goal with this part was to answer all these questions. After you read it, you should be able to tell what exactly happens during the import process.

I welcome your feedback and questions. Thanks!

r4victor··on How Python strings work
Hi! This is part 9 of my Python behind the scenes series. Each part of the series covers how some aspect of the language is implemented in the CPython interpreter. This time we'll study how Python strings work. Here's a quick summary of what you'll find in the post:

  * What the problem of text encoding is.
  * What Unicode is and why we need it.
  * How Unicode works.
  * How Python strings worked in the past and how they work now.
  * Is Python's approach to implement strings the best? How modern languages such as Go, Rust and Swift implement strings.
I really enjoyed working on this post. I welcome your feedback and questions. Thanks!
r4victor··on How Python strings work
Hi! This is part 9 of my Python behind the scenes series. Each part of the series covers how some aspect of the language is implemented in the CPython interpreter. This time we'll study how Python strings work. Here's a quick summary of what you'll find in the post:

  * What the problem of text encoding is.
  * What Unicode is and why we need it.
  * How Unicode works.
  * How Python strings worked in the past and how they work now.
  * Is Python's approach to implement strings the best? How modern languages such as Go, Rust and Swift implement strings.
I really enjoyed working on this post. I welcome your feedback and questions. Thanks!
r4victor··on Python behind the scenes #8: how Python integers work
I assumed the readers would follow the link to see the original results. GMP is undoubtedly the state-of-the-art of arbitrary-precision arithmetic. The point of this table was to compare bignum implementations provided by different languages, so programs that use GMP bindings are excluded. Probably it would make sense to include the best result that uses GMP, but I think GHC is quite representative of GMP's performance.

I'm not the first one who draw such a comparison. This article goes into some more detail: http://www.wilfred.me.uk/blog/2014/10/20/the-fastest-bigint-...

r4victor··on Python behind the scenes #8: how Python integers work
Hi, the author here. Thanks for posting this! The Python behind the scenes series covers how different aspects of Python are implemented in the CPython interpreter. This time we'll ask and answer the following question: How is Python able to support arbitrary large integers? More specifically, we'll learn:

  * How CPython represents arbitrary-precision integers.
  * How CPython implements arbitrary-precision arithmetic, such as addition and multiplication.
  * How CPython's implementation of arbitrary-precision arithmetic compares to other implementations.
I welcome your feedback and questions. Thanks!
r4victor··on How Python attributes work
Sorry for being misleading. I didn't think about the other interpretation. It sounds intriguing, by the way. I'm thinking I'd like to learn more about it.
r4victor··on How Python attributes work
Pelican. It took me an hour or two to set up this blog. Intuitive, flexible and well-documented.
Page 1 of 2Next →