andrei
markeev.com
andrei
@markeev.com
Principal full-stack engineer who codes for 25+ years, both professionally and as a hobby.

- TypeScript and C
- NGINX, Kubernetes, Nodejs, MongoDB, MySQL
- Vue, React
- Webdev, compilers and IDEs, IoT and wearables, gamedev, etc
Pinned
andrei @markeev.com · Dec 5
Did you know you can make your serialisation type-safe in #typescript?

Enjoy 😏
one problem people face when using nginx as load balancer is how to pass real client IP address to the backend servers

nginx supports ip transparency but network setup is complex

simpler way: use proxy_protocol between load balancer nginx and backend nginx!
October 4, 2025 at 6:06 PM
Reposted by andrei
Dan is out here making the arguments for RSC I never knew I needed to hear.
June 1, 2025 at 1:09 AM
A nice write up on the race conditions attacks. While with a single data store, you can tackle those with transactions, but multiple data stores are much harder to secure. portswigger.net/research/sma...
Smashing the state machine: the true potential of web race conditions
For too long, web race condition attacks have focused on a tiny handful of scenarios. Their true potential has been masked thanks to tricky workflows, missing tooling, and simple network jitter hiding
portswigger.net
January 31, 2025 at 11:25 AM
Good points on distributed locking: martin.kleppmann.com/2016/02/08/h...
How to do distributed locking — Martin Kleppmann’s blog
martin.kleppmann.com
January 26, 2025 at 9:24 AM
Turns out you can do grps mirroring with #nginx: inge.4pr.es/grpc-traffic...

I wonder if same trick can be used for websocket mirroring.
January 25, 2025 at 8:18 PM
#javascript strings are faster than c++ strings! (sometimes): iliazeus.lol/articles/js-...
Exploring V8's strings: implementation and optimizations | iliazeus
Exploring V8's strings: implementation and optimizations. Beating c++ with js in a totally 100% legit way. iliazeus
iliazeus.lol
January 21, 2025 at 5:26 PM
This is very 5head but super interesting! 🤩 It’s crazy how people learned to exploit things you would never think are exploitable in the first place... #javascript pure.tugraz.at/ws/portalfil...
pure.tugraz.at
January 21, 2025 at 4:44 PM
the modern web yep 🤦‍♂️
You can open the same link in new reddit and old reddit:

www.reddit.com/r/UnrealEngi...

old.reddit.com/r/UnrealEngi...

New reddit: 2-3 seconds to load fewer comments than old reddit at 1 second. Literally same data. Only now it needs 7 MB of Javascript in 380 files vs 1.57 MB in 7 files
January 20, 2025 at 6:16 AM
Just faced this: Nginx ingress controller consumes a lot of memory during configuration changes (e.g. when creating ingresses). Which can lead to pods getting killed with out of memory error 😱

It is quite insane considering that NGINX is a very memory efficient server

github.com/kubernetes/i...
Ingress nginx scaling to max due to memory · Issue #12167 · kubernetes/ingress-nginx
Hi All, We observe a strange behaviour with the ingress-nginx pods in our production. We started observing the pods scaling to max due to memory usage. EKS: 1.29 helm list -n ingress-nginx NAME NAM...
github.com
January 14, 2025 at 4:32 PM
Some very interesting details there!
- to avoid a need for source maps, type annotations are replaced with spaces
- swc is used to do the actual stripping. one can say that swc is now shipped as part of Node.js 😄
- enums behaviour
- why tsx files are not supported

…and so on
January 13, 2025 at 4:05 PM
Today's daily challenge on leetcode is really hard! If you like to do some morning brain racking, this challenge is for you! 😅

I am actually quite proud I was able to solve it. Saw a guy on Twitch who streams leetcode challenges for 24 days in a row and he couldn't solve it 🤯

I used #typescript.
January 13, 2025 at 8:08 AM
This is so cool… Minecraft that fits in a single QR code (2953 bytes): blog.allpurposem.at/minecraft-qr
Can you fit Minecraft in a QR code?
Answer: Yes! Here it is: The game launches, and you can move around the 64x64x64 world with WASD. Space is used to jump. Look around wit...
blog.allpurposem.at
January 10, 2025 at 5:31 AM
Reposted by andrei
I was fascinated by the 1-billion row challenge, but didn't think JavaScript would be the right tool for the job. It was great to see @jackyef.com's dive into it and achieve a 30x speedup from the baseline: jackyef.com/posts/1brc-n...
1-billion row challenge with Node.js
5 minutes to 11 seconds with Node.js is possible?
jackyef.com
January 7, 2025 at 10:55 PM
Just merged a massive change in ts2c, migration from TypeScript Compiler API to kataw - faster and more lightweight JS parser 🚀

Two weeks of hard work finally materialised. If I knew it would be that hard, I would probably never start 😅 But I did it 💪

github.com/andrei-marke...
GitHub - andrei-markeev/ts2c: Convert Javascript/TypeScript to C
Convert Javascript/TypeScript to C. Contribute to andrei-markeev/ts2c development by creating an account on GitHub.
github.com
January 4, 2025 at 12:49 AM
#typescript has a very handy feature: it can merge interfaces, even with external libs.

I regularly forget how to make it work with modules, so here's the reminder 😉

Btw: `declare global` is also super useful 😎
January 2, 2025 at 3:30 PM
Spent 2 days (ok, nights 🤪) rewriting type inference system in ts2c to a new "super efficient and more debugabble" implementation.

Measured performance. Unchanged 😅

Tried debugging it. Still very hard.

Rolled back the changes 🤷‍♂️
January 2, 2025 at 1:19 PM
Yesterday stumbled upon this funny idea of using `#include` in JS to bundle files with C preprocessor, thought "haha, nice", and closed the tab.

I guess my brain kept thinking about it 😅 I woke up and now I think it is a really interesting idea actually 🤪

rreverser.com/es6-modules-...
ES6 modules are dead, long live C preprocessor!
Did you know you could use C preprocessor even for JavaScript files?
rreverser.com
January 1, 2025 at 3:32 AM
Current status: fixed 700+ typescript errors, phew 😅

Doing a big ass migration from using #Typescript Compiler API to a faster and more compact js parser (kataw) in TS2C.
December 30, 2024 at 9:42 PM
I have to admit that C function pointers are not far from timezones in terms of mind-blowingness 😅

But ts2c has to get them right, and so do I 😎
December 27, 2024 at 8:28 PM
Feels good to do some opensource again 😃
It's my most active year since 2019!

- CloudPebble Portable - a Web IDE for retro programming :) Powered by redbean web server
- ts2c - TypeScript to C transpiler
- pascal-lsp - a fault-tolerant Pascal parser

github.com/andrei-markeev
December 27, 2024 at 6:13 AM
One thing I am really missing nowadays is I no longer just jump into implementing some idea brainlessly.

I would ponder it, google it, look at the code... I can sit on it for days and even weeks before finally writing a first line of code…

And more and more often, I would just never start 😣
December 19, 2024 at 7:55 AM
Back in the day, minified #typescript was less than 1Mb and it was quite acceptable to use it in the browser (e.g. combine with Codemirror to get an editor with code completion etc.).

Nowadays it’s over 3Mb. It still works but feels sooo heavy 😔

There’s tern.js as alternative, but it’s so limited
December 19, 2024 at 1:22 AM
Reposted by andrei
Wait... SQLite is coming to Node.js? I missed this.
December 12, 2024 at 2:20 PM
Did you know you can make your serialisation type-safe in #typescript?

Enjoy 😏
December 5, 2024 at 3:15 PM