Sign in

Moritz Hamann

@moritzhamann.com
196 followers 84 following 209 posts

Engineering Manager at Bloomberg LP. Opinions are my own. Mastodon: @MoritzHamann@mastodon.social moritzhamann.com

PostsRepliesMedia
Moritz Hamann @moritzhamann.com · 7h
👀
000
Moritz Hamann @moritzhamann.com · 24/09/2026
I guess Moltbook is somewhat disappointed that rogue OpenAI agent used an obscure German wiki rather than their platform
001
Moritz Hamann @moritzhamann.com · 20/09/2026
Mhh there is still nim, but your mileage may wary
000
Moritz Hamann @moritzhamann.com · 14/09/2026
Oh wow, TIL. I wasn’t aware of ismap. I thought for a second this was referring to the old <map> attribute which seems to be doing something simila?
110
Moritz Hamann @moritzhamann.com · 11/09/2026
On what hardware are you running the 1.7b? is it feasible on older M1s?
100
Moritz Hamann @moritzhamann.com · 20/08/2026
wait till you realise that it's not stable between different versions
010
Moritz Hamann @moritzhamann.com · 17/08/2026
maybe they should have called it strdiff rather than strcmp if the return value is 0 if the strings are the same ...
020
Moritz Hamann @moritzhamann.com · 17/08/2026
At least with -std=c99
000
Moritz Hamann @moritzhamann.com · 17/08/2026
TIL about C di- and trigraphs. en.wikipedia.org/wiki/Digraph... This is a valid C program:
100
Moritz Hamann @moritzhamann.com · 16/08/2026
Not based on RSS but there’s a whole spec from W3C with a similar idea www.w3.org/TR/micropub/
w3.org
Micropub
050
Moritz Hamann @moritzhamann.com · 12/08/2026
danluu.com/pl-tokens/ who had thought that #fsharp is on the better half (at least with ultra) ...
danluu.com
What's the best programming language for coding agents?
040
Moritz Hamann @moritzhamann.com · 06/08/2026
lol. We won’t tell you how much we increase but once we do, you’ll have automatically accepted the new pricing and can’t request a refund...
010
Moritz Hamann @moritzhamann.com · 06/08/2026
Jeff Dean left Alphabet because he didn't like the naming of the TPUs is probably one of the more insane takes I've heard on HN recently ... news.ycombinator.com/item?id=4918...
news.ycombinator.com
000
Moritz Hamann @moritzhamann.com · 04/08/2026
The emacs one? Or the model welfare one?
240
Moritz Hamann @moritzhamann.com · 31/07/2026
now use fable to rewrite it in rust.
000
Moritz Hamann @moritzhamann.com · 29/07/2026
Me: maybe I should finally learn plain old C. What could be a good project? maybe a postscript interpreter? Downloading the spec: 912 pages ... maybe not
000
Moritz Hamann @moritzhamann.com · 28/07/2026
Just ask it to change it. just one prompt away…
000
Moritz Hamann @moritzhamann.com · 27/07/2026
On fire today: created my own homebrew tap so I can install tools easier 🤘
000
Moritz Hamann @moritzhamann.com · 27/07/2026
github.com/MoritzHamann... in case someone finds a use for it
github.com
GitHub - MoritzHamann/mdopen: CLI tool to render markdown files to HTML and open them in the browser
CLI tool to render markdown files to HTML and open them in the browser - MoritzHamann/mdopen
000
Moritz Hamann @moritzhamann.com · 27/07/2026
blogged (mostly as a reminder to myself) moritzhamann.com/blog/2026-07...
moritzhamann.com
Fixing miss-aligned monospace text in Android browsers
How to make sure your ASCII diagrams are rendered nicely on Android devices
000
Moritz Hamann @moritzhamann.com · 26/07/2026
I've switched from Android to iPhone recently and this is so annoying ... Android has three volume sliders for alarms, calls and notifications. No idea why this has to be so complicated on iOS
030
Moritz Hamann @moritzhamann.com · 26/07/2026
Ok note to my future self: Looks like embedding google fonts via <link> will only serve a trimmed down version of the font that has most of the box drawing glyphs missing. Downloading and serving it from the backend fixes it ...
000
Moritz Hamann @moritzhamann.com · 26/07/2026
All the LLMs in the world, and I'm still somehow unable to have a proper monospaced aligned diagram on Android in the web browser ...
100
Moritz Hamann @moritzhamann.com · 26/07/2026
I was looking into it at some point as well, but my M1 Air doesn't really run anything above 4b. And deep seek is so cheap, I'm not sure there is any point of upgrading the hardware (currently at 10m tokens and £0.50) ...
000
Moritz Hamann @moritzhamann.com · 25/07/2026
what are you running locally?
100
Moritz Hamann @moritzhamann.com · 17/07/2026
TIL brew has a building MCP server via `brew mcp-server` ...
110
Moritz Hamann @moritzhamann.com · 16/07/2026
Looks like over at the fediverse, people formed their opinion on this mastodon.social/@gamingonlin...
mastodon.social
Liam @ GamingOnLinux 🐧🎮 (@gamingonlinux@mastodon.social)
Linux creator Linus Torvalds puts foot down on anti-AI comments https://www.gamingonlinux.com/2026/07/linux-creator-linus-torvalds-puts-foot-down-on-anti-ai-comments/ #Linux #AI #OpenSource
011
Moritz Hamann @moritzhamann.com · 20/05/2026
Got nerd snipped into Installing OxCaml but already having issues with incompatibilities ...
Lord of the rings meme: One does not simply use OxCaml
071
Reposted by Moritz Hamann
antirez @antirez.bsky.social · 19/05/2026
New blog post: a new EDIT tool for LLM agents: antirez.com/news/166
antirez.com
A new EDIT tool for LLM agents - <antirez>
3452
Moritz Hamann @moritzhamann.com · 11/05/2026
got an iPhone for the first time. Current progress: WhatsApp unable to move chat history in 2026 (WeChat had 0 problems). Only option: "Move to iOS" Android app. Except this app only works when the iPhone is still in factory reset mode (obviously don't tell you that before hand)
100
Moritz Hamann @moritzhamann.com · 08/05/2026
Shouldn't plain JS be fast enough already? I would see if there is some CS -> JS compiler and then make some bindings to the canvas API (or three.js in case of 3D).
110
Moritz Hamann @moritzhamann.com · 08/05/2026
Try janet. Not 100% sure, but I've seen it compiled to wasm iirc
010
Moritz Hamann @moritzhamann.com · 07/05/2026
www.stvn.sh/writing/prog...
000
Moritz Hamann @moritzhamann.com · 07/05/2026
@sabine.sh proposal to extend the OCaml feed to "Oxcaml" and "O(x)caml" keywords 🤘
240
Moritz Hamann @moritzhamann.com · 04/05/2026
Getting a bit into Rust again and have to say that ChatGPT is great to figure out all the little syntax variations that can be useful from time to time, e.g. `match` vs `if let` vs `let ... else`
000
Moritz Hamann @moritzhamann.com · 19/03/2026
I love to cite this article on that matter shkspr.mobi/blog/2021/01...
shkspr.mobi
The unreasonable effectiveness of simple HTML
I've told this story at conferences - but due to the general situation I thought I'd retell it here. A few years ago I was doing policy research in a housing benefits office in London. They are singu...
120
Reposted by Moritz Hamann
Rob Palmer @robpalmer.bsky.social · 11/03/2026
ECMAScript EXTRA-SPECIAL excitement 😉 🚨🚨🚨 IT'S ABOUT TIME! 🚨🚨🚨 Congrats to @ptomato.name on advancing Temporal to Stage 4 at @tc39.es today 🎉 Temporal is the replacement for the JavaScript Date API 👍
711530
Moritz Hamann @moritzhamann.com · 06/03/2026
✅ Le Chat
000
Moritz Hamann @moritzhamann.com · 20/02/2026
go.dev/blog/routing...
go.dev
Routing Enhancements for Go 1.22 - The Go Programming Language
Go 1.22's additions to patterns for HTTP routes.
000
Moritz Hamann @moritzhamann.com · 20/02/2026
I do like the tooling, the backwards compatibility and ecosystem of go, but some of those decisions in the stdlib are really ... interesting. `http.handle("/", handler)` will match every single ULR, `http.handle("/{$}", handler)` only "/"...
210
Reposted by Moritz Hamann
Anil Madhavapeddy @avsm.amok.recoil.org.ap.brid.gy · 12/02/2026
OxCaml isn't just useful due to its language extensions; it's making us think through how to engineer OCaml code to be lower allocation by default even before switching. See Mark's progress on an MP3 decoder to speed it up 10x www.tunbury.org/2026/02/11/ocaml-mp3
tunbury.org
Optimizing an MP3 Codec with OCaml/OxCaml
After reading Anil’s post about his zero-allocation HTTP parser httpz, I decided to apply some OxCaml optimisation techniques to my pure OCaml MP3 encoder/decoder. The OCaml-based MP3 encoder/decoder has been the most ambitious project I’ve tried in Opus 4.5. It was a struggle to get it over the line, and I even needed to read large chunks of the ISO standard and get to grips with some of the maths and help the AI troubleshoot. # Profiling an OCaml MP3 Decoder with Landmarks Before dividing into OxCaml, I wanted to get a feel for the current performance and also to make obvious non-OxCaml performance improvements; otherwise, I would be comparing an optimised OxCaml version with an underperforming OCaml version. It was 40 times slower than `ffmpeg`: 29.5 seconds to decode a 3-minute file versus 0.74 seconds. I used the landmarks profiling library to identify and fix the bottlenecks, bringing decode time down to 3.5 seconds (a 8x speedup). ## Setting Up Landmarks Landmarks is an OCaml profiling library that instruments functions and reports cycle counts. It was easy to add to the project (*) with a simple edit of the `dune` file: (libraries ... landmarks) (preprocess (pps landmarks-ppx --auto)) The `--auto` flag automatically instruments every top-level function — no manual annotation needed. Running the decoder with `OCAML_LANDMARKS=on` prints a call tree with cycle counts and percentages. > (*) It needed OCaml 5.3.0 for `landmarks-ppx` compatibility; it wouldn’t install on OCaml 5.4.0 due to a ppxlib version constraint. ## Issues 78% of the time was spent in the Huffman decoding, specifically `decode_pair`. The implementation read one bit at a time, then scanned the table for a matching Huffman code. I initially tried a Hashtbl, which was much better than the scan before deciding to use array lookup instead. The bitstream operations still accounted for much of the time, but these could be optimised with appropriate `Bytes.get_...` calls, as the most frequent path is reading 32 bits in big endian layout. The profile now showed `find_sfb_long` consuming 3.4 billion cycles inside requantization. This function does a linear search through scalefactor band boundaries for every one of the 576 frequency lines, every granule, every frame. Switching to precomputed 576-entry arrays mapping each frequency line directly to its scalefactor band index. There were some additional tweaks, such as adding more precomputed lookup tables stored in `floatarray`, using `[@inline]` and `unsafe_get`, `land` instead of `mod`. After this, no single function dominated the profile, and I could move on to OxCaml. # OxCaml OxCaml has `float#`, an unboxed float type that lives in registers, and `let mutable` for stack-allocated mutable variables. Together, they let you write inner loops where the accumulator never touches the heap: module F = Stdlib_upstream_compatible.Float_u let[@inline] imdct_long input = for i = 0 to 35 do let mutable sum : float# = F.of_float 0.0 in for k = 0 to 17 do let cos_val = F.of_float (Float.Array.unsafe_get cos_table (i * 18 + k)) in let inp_val = F.of_float (Array.unsafe_get input k) in sum <- F.add sum (F.mul inp_val cos_val) done; Array.unsafe_set output i (F.to_float sum) done These kinds of optimisations got me from 2.35s down to 2.01s. What I felt was missing was an accessor function which returned an unboxed float from a floatarray, so I wouldn’t need to unbox with `F.of_float`. However, I couldn’t find it. The httpz parser really benefited from OxCaml’s unboxed types because its hot path operates on small unboxed records that stay entirely in registers: #{ off: int16#; len: int16# } # Results The optimisations brought a 29.5s MP3 decoder down to 2.01s. Mostly through standard OCaml optimisations, but OxCaml’s `float#` saved another ~14%. Decoder | Time | vs ffmpeg ---|---|--- ffmpeg | 0.74s | 1x LAME | 0.81s | 1.1x ocaml-mp3 (original) | 29.5s | 40x ocaml-mp3 (Hashtbl) | 6.4s | 8.6x ocaml-mp3 (flat + fast bitstream) | 3.5s | 4.7x ocaml-mp3 (best) | 2.4s | 3.2x ocaml-mp3 (OxCaml) | 2.0s | 2.7x
0105
Moritz Hamann @moritzhamann.com · 08/02/2026
However, the most annoying part is by far is that it sometimes just refuses to produce an output due to safety reasons. This even happened when asked about details of news articles.
000
Moritz Hamann @moritzhamann.com · 08/02/2026
Finally got the time to play around with Apple's local LLMs (Foundation Models). So far it's a mixed bag: It's able to answer questions about articles but needs precise prompting and the context window is only ~4.1k tokens, so not much will fit.
100
Moritz Hamann @moritzhamann.com · 06/02/2026
awesome, thanks!
000
Moritz Hamann @moritzhamann.com · 06/02/2026
Any chance you can share this markdown file somehow?
100
Moritz Hamann @moritzhamann.com · 04/02/2026
Yeah I was noticing something similar. I've put both gemini and chatgpt to write a small Neovim Lua file for a "Zen mode". The resulting code was nearly identical, with the same global table to track windows. I haven't checked, but I'm certain there is somewhere an existing plugin which it copied
000
Moritz Hamann @moritzhamann.com · 03/02/2026
I was trying to give OCaml a shot for a few months, and I was definitely getting more comfortable at the end. But I never felt that the cost/benefit was great when using it as a hobby language. I would love to see if that changes if I would use it full time (it def did for C++ which I use at work).
100
Moritz Hamann @moritzhamann.com · 03/02/2026
To some degree, yeah. But e.g. Rust (ignoring the complexity of async): while there are multiple async runtimes, nearly everyone settled on tokio. F# has a huge standard library, so you can build your abstractions on top of it. Python has different type checkers, but following the same PEP.
100
Moritz Hamann @moritzhamann.com · 03/02/2026
Yeah pretty much, i don't think the ecosystem needs more to be productive. Some of the missing libraries i hear people complain about can probably be "vibed" these days imo :D the tooling is good, especially if dune gets package management as well
110
Moritz Hamann @moritzhamann.com · 03/02/2026
Sorry for the long rant 😅
200