@galdor@emacs.ch
@galdor@emacs.ch avatar

galdor

@galdor@emacs.ch

Contrarian software engineer. Hire me to solve your technical problems.

$argon2id$v=19$m=64,t=512,p=2$0rwNagYG9nw58bd3D5HBfw$ZDMVWlX+adPhtQKcnrqI5A

This profile is from a federated server and may be incomplete. Browse more on the original instance.

galdor, to random
@galdor@emacs.ch avatar

In #Go, you cannot call the String method on a literal URL struct ("cannot call pointer method String on url.URL") because the String method has a pointer receiver. String does not modify the object, but it uses a pointer receiver to avoid copying the object for each call.

This is what you get when 1/ you design a language with pointers (why would you do that in 2009?) and 2/ you do not have "const".

Just bad design.

galdor, to emacs
@galdor@emacs.ch avatar

While the LSP protocol is useful for completion or access to symbol definitions, some of its features are less appealing. In , you can instruct Eglot to ignore any feature you dislike.

E.g. (setq eglot-ignored-server-capabilities '(:inlayHintProvider)) to remove annoying hints mixed with the code in c-mode with clangd.

galdor, to random
@galdor@emacs.ch avatar

I had some fun: went through chapter 2 (Syntax) of the #CommonLisp standard and bootstrapped a reader. I learned a few things:

  • Pure C99 is (still) easy to read and to write.
  • The standard is very well written: just do what is described and it works.
  • If you did not read the standard, there are a lot of things you do not know about Common Lisp.

Now I need minimal support for arbitrary-precision arithmetic, and I do not want any dependency.

galdor, to random
@galdor@emacs.ch avatar

I was playing again with my HTTP implementation and I've made my peace with its blocking nature. It is irrelevant with a buffering reverse proxy (HAProxy or NGINX), performances are excellent and the code of the server stays simple.

Here, 210k+ req/s on 64 connection handling threads with 390µs P90 latency and sub-ms P99 (Linux amd64, SBCL 2.4.1).

Of course I can't use the same approach for my SMTP server (too many parallel connections that stay alive and no buffering proxy possible), but not all software have to use the same language.

galdor, to random
@galdor@emacs.ch avatar

I love SQLite, but everytime I see someone claiming you do not need PostgreSQL, I feel the need to remind them that SQLite has very limited type handling and that you'll seriously miss row locking as soon as you want HA. And it's just the tip of the iceberg.

galdor, to random
@galdor@emacs.ch avatar

Some say you must start with a simple programming language and learn your way up. Others tell you to learn a low level language such as C to understand how everything works.

I've seen plenty of developers who started with Python or JS, and some who started with C. Comparing them, there is no doubt about which method yields the best developers.

The good news is that it's never too late to go back to the fundamentals.

galdor, to random
@galdor@emacs.ch avatar

Firefox tip of the day: create/update "userChrome.css" in the "chrome" subdirectory of your profile directory and add:

moz-input-box.urlbar-input-box {
font-family: monospace !important;
}

Do not forget to set "toolkit.legacyUserProfileCustomizations.stylesheets" to "true" in "about:config" (blame Mozilla for this BS).

Because yes, URIs should be readable in your browser.

galdor, to emacs
@galdor@emacs.ch avatar

The value of is not in the packages that are available (Gnus, org-mode, Magit, etc.). It is the fact that these packages live in the same application, manipulate text the same way, and can interact with each other to do exactly what you want them to do.

galdor, to random
@galdor@emacs.ch avatar

There is a fundamental misconception about how software licenses and copyright work. Since Redis Labs relicensed Redis, I've read multiple times that it would not have happened if Redis had been GPL-licensed. This is incorrect. The entity (or entities if they all agree when there are multiple copyright holders) owning the software, company or individual, can relicense it at any time, and no license can change that.

Using the GPL license would also not have prevented Amazon from making money by hosting Redis (nothing wrong with that btw). Making it AGPL would have forced them to release any modification, but then again if it was AGPL, lots of companies would not have touch it (for good reasons).

There is absolutely nothing stopping anyone from forking the last BSD-licensed release of Redis and continuing the work with another name ("Redis" is a trademark that belongs to Redis Labs).

galdor, to random
@galdor@emacs.ch avatar

I've seen too many managers complain about engineers being "difficult" for being exigent about work environment and tools. Developers are not machines, and their tools are important to them even if you do not understand why.

(source: @dhh in https://world.hey.com/dhh/finding-the-last-editor-dae701cc)

galdor, to random
@galdor@emacs.ch avatar

REST does not make any sense for HTTP APIs. A request is just data: encode it in the request, use the request path as the name of the operation you are performing, the end. Same thing for responses. Forget about nested routes, query strings, path variables… They just make your life more complicated and do not bring anything to the table.

I've been using this model for multiple HTTP APIs and I only regret I did not realize that sooner. BTW I'm not alone, see the AWS API or the Telegram one.

Also makes writing API clients magnitude order easier.

galdor, to emacs
@galdor@emacs.ch avatar

I find it hilarious that people perceive Firefox as a bastion of freedom when it makes it impossible to install add-ons which have not been signed by Mozilla. You cannot add new signing keys. You cannot event install your own unsigned add-on on your own Firefox instance on your own computer.

Imagine if did not let you install a package if it was not signed by the FSF…

galdor, to programming
@galdor@emacs.ch avatar

First reaction after installing 27 rc1 (kerl build-install 27.0-rc1 27): yes ~"foo" is shorter than <<"foo">>. But 1/ it's a lot less ergonomic to type (try it!) and 2/ the default printer is still going to spit out <<"foo">>.

Using b"foo" would have so much better.

galdor, to random
@galdor@emacs.ch avatar

An unexpected problem with event-based IO in is that it breaks the condition/restart system. E.g. you upload a file using HTTP and a non-blocking client. The state machine to handle the flow (send request, read HTTP 100 response, send body, read reponse, execute callback) is running in the IO thread. If anything signals a condition, it has to be handled in the IO thread, completely decorrelated from the code that initiated the HTTP request.

Extrapolate that to a server running multiple complex IO flows in parallel. This is really not good, the language just does not match the problem.

galdor, to random
@galdor@emacs.ch avatar

The slices package makes common operations much more compact, this is good. If you're still using 1.20 or older (what's your excuse?), you can use golang.org/x/exp/slices instead.

But there is no Map method. Or Filter (which should always be two functions, Select and Reject). Or Fold. They were proposed more than 2y ago and of course rejected by Go developers because they should be part of a "stream API" (???) which of course never manifested. As it was for packages, it is going to take years to get what is standard in most sane languages.

galdor, to random
@galdor@emacs.ch avatar

I just got bit by a common bug in . encoding/json accepts the null JSON value for a slice. As a result, [] is decoded to an empty slice and null to a nil slice. And while both can be used as a zero-length slice, only one of them will be considered equal to nil. Inconsistent.

galdor, to random
@galdor@emacs.ch avatar

TIL you can pass parameters to each public key in ~/.ssh/authorized_keys files. For example you can restrict connections based on the source address with from="<addr1>, <addr2>,…".

See the man page of sshd ("AUTHORIZED_KEYS FILE FORMAT") for documentation.

galdor, to random
@galdor@emacs.ch avatar

Careful, do not use the url.URL type in structures if you expect to encode them in JSON. For some incredibly stupid reason, it will be serialized as a JSON object and not as the expected string representation. Forces you to use strings everywhere. So much for type safety…

galdor, to emacs
@galdor@emacs.ch avatar

You're probably familiar with filling in . Lets you properly wrap text to a fixed width. This is how to do the opposite.

Very useful when you need to copy text to software that will use a variable-width font for display.

galdor, to random
@galdor@emacs.ch avatar

When someone tells you "I don't have time to do X", rephrase it as "everything in my life is more important than X". Then everything becomes clear.

galdor, to random
@galdor@emacs.ch avatar

Go has neither algebraic data type nor unions. So if you want to represent an IMF address which is either a mailbox or a group, you'll end up with an interface{} meaning you are losing type safety. The language is just not expressive enough to represent the problem space.

At least C had unions, this is clearly something it did better (and also const, enums…).

galdor, to random
@galdor@emacs.ch avatar

This morning I had to edit a list in Notion: transform elements using a regexp and sort them. of course impossible in Notion. Took less than a minute to copy in Emacs, do the work, and paste back in Notion.

Notion Labs is a $10B company, and yet their product cannot do a fraction of what I can do with free tools. Oh and what I write in these free tools is not locked in a proprietary ecosystem…

galdor, to random
@galdor@emacs.ch avatar

You'd think that busy professionals have no time for communication, but in my experience is it the other way around: most high performers respond quickly as long as you don't waste their time with stupid questions.

It's crazy how better things are when people communicate efficiently.

galdor, to random
@galdor@emacs.ch avatar

If you're either:

  • a mostly backend Python developer able to build non-trivial web applications without all the "modern" complexity;
  • or an ML engineer able to build complex components and not just connect existing ones.

And you're tired of corporate BS and want to get shit done (full remote), DM me and convince me that you're the one.

galdor, to random
@galdor@emacs.ch avatar

Funny how so many whine about SBCL executable cores. But with compression, my example program is 12MB even though it comes with a complete compiler. In comparison Go static binaries can easily grow beyond 100MB and I don't remember anyone complaining.

Lots of complaints are just a way to avoid saying "I don't like parentheses".

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • magazineikmin
  • InstantRegret
  • GTA5RPClips
  • ethstaker
  • Youngstown
  • everett
  • slotface
  • osvaldo12
  • rosin
  • mdbf
  • kavyap
  • DreamBathrooms
  • provamag3
  • ngwrru68w68
  • Durango
  • modclub
  • cubers
  • khanakhh
  • Leos
  • tacticalgear
  • cisconetworking
  • vwfavf
  • tester
  • anitta
  • normalnudes
  • JUstTest
  • All magazines