News for hackers. Stuff that matters.

karl42

Re:Lua as a practical "soft-bedrock" language on Saturday May 09, 2026 @06:35AM (#48073801)
The link is an HTTP proxy to the original content at gemini://zaibatsu.circumlunar.space/~solderpunk/gemlog/lua-as-a-practical-soft-bedrock-language.gmi
> What is the better alternative?

One alternative is https://self.xyz . It generates ZK proofs from the digital signature on your e-passport or national ID card. That allows you to prove "human" or "over 18" or "not on the OFAC list" without revealing your name, date of birth or nationality.

Disclosure: I'm an advisor for Self

Re:Why the heck are we still using Markdown? on Saturday April 04, 2026 @03:25PM (#47642417)
Do you see a way to help and improve the situation?
Re:Why the heck are we still using Markdown? on Saturday April 04, 2026 @05:24AM (#47637400)
https://djot.net/ seems to be very sane and still very similar to markdown. And after reading the CommonMark spec, I appreciate the saneness very much. CommonMark did a great job at describing all the rules and edge cases, but it clearly shows how messy markdown is.

What do you all think of Djot?

Fortunately, AI can also be used to reduce complexity. The case I noticed most often is to use the slightly more ugly API, or duplicate some generic code, but avoid pulling in a dependency. Examples are avoiding UI frameworks and directly accessing the DOM in simple web projects, using the CLI arg parser from the stdlib or adding simple helper functions rather than pulling in left-pad like dependencies.

Since managing dependencies is one of the major maintenance burdens in some of my projects (updating them, keeping their APIs in mind, complexity due to overgeneralization), this can help quite a lot.

See also https://www.karl.berlin/simplicity-by-llm.html for some of my thoughts regarding this.

Re:Stack Traces Are Underrated on Monday March 10, 2025 @06:34AM (#43318908)
You could combine both by adding a stack frame each time the error is returned one level up. This could be done explicitly (cumbersome and not everyone will do it) or automatically by the language (weird magic, but useful).
In a similar vein, I made https://www.wikdict.com/reader/sv-en/ , which adds translation pop-ups to each word in the input text. The cool thing compared to manually looking up words is that it will translate idioms/phrases (if they are in the dictionary) and split compound words (if they are not in the dictionary) into their translatable parts.

I also have some code to add the translations as pop-up footnotes to epub files (I like to use that on my e-reader). That is not mature enough yet for public usage, but if anyone wants to help testing it, I can run some e-books through it. Just let me know!

Re:Python dependency management is a dumpster fire on Sunday December 15, 2024 @11:41AM (#42424386)
It doesn't have to. But if it does not end in .py, you have to add the --script (or -s for short) flag to tell it to interpret the file as a python script.
You can install to your path with 'uv tool install'.

uvx is just an alias for 'uv tool run'.

Re:Visual Studio Code is designed to fracture on Monday September 30, 2024 @07:29AM (#41695944)
Debian splits their distribution into three components:

  * main (free software)
  * non-fee
  * contrib (free software that depends on software outside of main, so usually non-free software)
While I am not fond of the "contrib" terminology, I think this categorization makes a lot of sense.
Re:Use Timestamps on Wednesday November 15, 2023 @06:50AM (#38275720)
It shows "2023-11-15" below the title for me.
Re:How to Compete with Patreon on Sunday October 08, 2023 @10:22AM (#37810694)
The creators are encouraged to create engaging/addicting/long content if that is what causes higher payments. Therefore, I much preferred the original Flattr where I defined which creator was beneficial to me.

I don't think that Flattr2 is more true to a free markets vision than Flattr1. Neither do I believe that a free market is necessarily better than a regulated market. Markets are a highly useful tool, not a goal themselves.

Re:How to Compete with Patreon on Sunday October 08, 2023 @08:47AM (#37809981)
I do not want to support anything that optimizes for "engagement". It penalized all the really useful offerings that I use for a minute to solve my problem and then don't touch again in a long time and instead encourages addictiveness.
Re:“Make” as a Static Site Generator on Monday September 11, 2023 @04:45AM (#37464549)
I agree that `envsubst` is a good choice for this. Unfortunately, it is not part of posix, so you can't rely on it being present everywhere. But as part of gettext, it is still very common.
Re:“Make” as a Static Site Generator on Sunday September 10, 2023 @12:30PM (#37457419)
Author here. Nice to see people appreciate simplicity. If you have any questions, feel free to ask!
Re:“Make” as a Static Site Generator on Sunday September 10, 2023 @12:21PM (#37457332)
> I found his GEMINI approach quite funny - it strips out most of the formatting with a regexp.

Do you mean the regexp in https://github.com/karlb/karl.berlin/blob/master/blog.sh#L4 ? It doesn't remove the formatting, just HTML comments (because they would show up on the page, otherwise) and rel="me" attributes (because they don't work with md2gemini). Feel free to read the blog post about adding Gemini support for more details: https://www.karl.berlin/gemini-blog.html

Re:Mastering Emacs: What's new in Emacs 29.1 on Friday September 08, 2023 @11:28AM (#37434839)
Did you try fugitive as a Magic replacement?

https://github.com/tpope/vim-fugitive

Re:fish-shell: the user-friendly command-line shell on Saturday August 26, 2023 @12:33PM (#37274319)
The one thing that keeps me from using it more often for scripting is the lack of a fail-on-error mode (similar to `set -e` on bash). I know it is hard to get this to behave well in all cases (e.g. pipefail) but I don't want to do much scripting without it.
> If you can figure out a protocol where ads don't work, I'm in.

Is it even theoretically possible to create such a protocol? Preventing tracking is feasible, but telling apart ads from real content does not sound solvable on a protocol level.

Re:Thinking hard makes the brain tired on Sunday April 02, 2023 @02:12PM (#35413426)
I have that problem, too. Can you recommend any counter-measures?
Re:sqlean: A set of SQLite extensions on Wednesday March 01, 2023 @01:37AM (#34979423)
Python packages are available for sqlean as well: https://github.com/karlb/sqlite-sqlean/.
Re:Making SQLite extensions pip install-able on Tuesday February 07, 2023 @02:19AM (#34689732)
If you are interested in pip installable versions of SQLite's spellfix and ICU extensions, have a look at https://github.com/karlb/sqlite-spellfix https://github.com/karlb/sqlite-icu
I fully agree. The parent wrote "before changing directory", so I assumed we are talking about the case where changing directory was necessary.
> - It may be useful to copy `$PWD` into a variable before changing directory

Why not use pushd/popd instead?

Older »