HNHacker News
TopNewBestAskShowJobs

michidk

701 karma · joined May 15, 2021

michael@lohr.dev https://lohr.dev

meet.hn/city/de-Munich

Socials:

- https://github.com/michidk/

- https://www.linkedin.com/in/michael-lohr/

- https://x.com/miichidk/

Interests:

Cloud, Entrepreneurship, IoT, Open Source, Programming, Startups, Web Development, Freelancing

submissionscomments
michidk··on Show HN: Better Hub – A better GitHub experience
Is there any reason you could not self-host it?
michidk··on Show HN: RenderCV – Open-source CV/resume generator, YAML to PDF
Why invent a new file format when there is https://jsonresume.org/? Its also quite easy to customize and add more things as it does not prohibit extra values
michidk··on Rouille – Rust Programming, in French
fk lese(&selbst, schlsl: Zeichenkette) -> Ergebnis<Möglichkeit<&Zeichenkette>, Zeichenkette> { wenn lass Etwas(wöbu) = gefährlich { WÖRTERBUCH.als_ref() } { Gut(wöbu.hole(&schlsl)) } anderenfalls { Fehler("Holt das Wörterbuch".hinein()) } }

https://github.com/michidk/rost

michidk··on Can “second life” EV batteries work as grid-scale energy storage?
see https://stabl.com/
michidk··on A CLI to quickly launch VSCode/cursor devcontainers
those devcontainer are no vscode devcontainers though. they use the vscode remote feature
michidk··on Hitting OKRs vs. Doing Your Job
Yes, exactly this! We are actually spending soo much time deriving, thinking, formulating & refining OKRs from roadmap items that we could just declare as simple "Goals". We could get so much shit done during that time.

Most of the time as the quarter goes on, we then scrap those OKRs anyway because we didn't manage to do them or they were too specific and requirements changed.

I always had the feeling that what we are doing is bullshit. So great to finally hear it from someone else.

I wonder how many engineering companies actually use OKRs though.

michidk··on The smallest Hello World program
okay, I didn't know that, thanks for the background. I wonder why the assembler would not optimize this though.

I noticed that I then could also shave of one byte more by using lea esi, [rel msg] instead of lea rsi, [rel msg].

michidk··on How Nat Traversal Works (2020)
Such a great explanation. Wish I would have had something like this back in my gamedev days.
michidk··on The smallest Hello World program
I think your statement might only apply to 32 bit (one of the constraints mentioned early in the blog post was 64 bit).

But even if it was 32 bit, then we would't have to copy a 1, since the syscall number for sys_write would be 4 instead of 1.

I get the same total size with both variants in 64 bit mode.

  push 1
  pop rax
  mov rdi, rax
Assembling to 48 89 C7 (3 bytes)

seems to be same in size as

  push 1
  pop rax
  push 1
  pop rdi
Assembling to 6A 01 5F (3 bytes)
michidk··on The smallest Hello World program
should be ... push 1 ; syscall: sys_write pop rax push 1 pop rdi

of course

michidk··on The smallest Hello World program
Of course - you are completely right, an oversight in wanting to correct my mistake as quickly as possible.

With that fixed, is there any reason not to use push here?

michidk··on The smallest Hello World program
Yeah I thought sth like this is possible, but (correct me if I'm wrong) this (ab)uses the ELF header and punts data in there, which goes against my requirement

> It should be a ‘proper‘ executable binary according to the spec

michidk··on The smallest Hello World program
Hehe a nice idea. But then it would not always print Hello World and you cannot execute it directly.
michidk··on The smallest Hello World program
I was able to shave off one additional byte with this:

  ...
  xor rax, rax       ; = 0
  inc rax            ; = 1 - syscall: sys_write
  mov rdi, rax       ; copy 1 - file descriptor: stdout
  lea rsi, [rel msg] ; pointer to message
  mov rdx, 14        ; message length
  syscall
  ...

  $ nasm -f bin -o elf elf.asm; wc -c elf; ./elf
  166 elf
  Hello, World!
So I guess NASM already optimizes this quite well

However, using the stack-based instructions as xpasky hinted at:

  ...
  push 1             ; syscall: sys_write
  pop rax
  pop rdi       ; copy 1 - file descriptor: stdout
  lea rsi, [rel msg] ; pointer to message
  push 14            ; message length
  pop rdx
  syscall
  ...
I get down to 159 bytes! I updated the article to reflect that
michidk··on The smallest Hello World program
Thanks, that makes total sense. I was so focused on the ELF part that I didn't even consider optimizing the initial assembly further. Will fix it and edit the article.
michidk··on Talking to Your Mailserver Is Not as Hard as You Think
A short introduction to the IMAP protocol.
michidk··on Are character count line limits stupid?
There are actually IDE plugins which perform 'semantic line wrapping'. But that is besides the point. Of course, it can make sense to add manual line wraps, especially if the developer intends to make his intentions clearer by using line breaks at specific points.

But lots of developers use formatting plugins to force line breaks anyways - and they are no better then the IDE linewrapping.

michidk··on Show HN: The Case Against Character Count Line Limit
It would perfectly if you enable line wrapping, which is basically a dynamic client-side character line limit!
michidk··on Ask HN: Is there any software you only made for your own use but nobody else?
https://github.com/michidk/vscli

It allows me to launch vscode projects and devcontainers I often work on very quickly. Saves me so much time!

michidk··on Ask HN: Is there a service to quickly build APIs from Docker containers?
And I want it to be able to handle lots of connections. One server might not be enough, so it needs to scale. The process could also take a while, so I need a queue. Yeah I could setup, AWS API Gateway, SQS, ECS with Autoscaling etc. But that's a lot of boilerplate.
michidk··on Baltimore's Key Bridge struck by cargo ship, collapses
https://www.reuters.com/world/us/16-mile-bridge-baltimore-co...
michidk··on Ask HN: Did you turn off Google activity tracking?
I turned it on.
michidk··on Ask HN: Cleanest way to manage Windows OS?
Devenv in WSL is the way to go
michidk··on Ask HN: Best Time to Post on HN?
Clearly not now ... :')
michidk··on An AI designed keyboard layout (2021)
I used Colemak for one year. Now since 5 years I am using Halmak. I used to use custom softaware, but nowadays I use a programmable keyboard (Ergodox EZ).
michidk··on Almost every infrastructure decision I endorse or regret
> Code is of course powerful, but I’ve found the restrictive nature of Terraform’s HCL to be a benefit with reduced complexity.

No way. We used Terraform before and the code just got unreadable. Simple things like looping can get so complex. Abstraction via modules is really tedious and decreases visibility. CDKTF allowed us to reduce complexity drastically while keeping all the abstracted parts really visible. Best choice we ever made!

michidk··on Show HN: After a day of Zig – a review by a Rust enthusiast
This issue is very interesting, thanks for linking it! Hopefully this will change in future...
michidk··on Show HN: After a day of Zig – a review by a Rust enthusiast
True, I added some more!
michidk··on Which Website Builder?
Divi Theme with Wordpress is great. Allows for quick prototyping but is used for many production websites as well.
michidk··on Show HN: A CLI project tool for VSCode with devcontainer support
We have them know: https://github.com/michidk/vscli/releases/tag/v0.1.7 Just not integrated into homebrew, since then we could not automatically update our formula anymore :/
Page 1 of 2Next →