News for hackers. Stuff that matters.
Re:Show HN: Std_net.h – Single-file cross-platform TCP netwo... by freakynit on Tuesday September 09, 2025 @09:48AM (#45181872)
Hi... this is amazing.

What it would take for such a thing to be able to run on small microcontrollers with integrated wifi? For example esp32?

Second, what about bare-metal?

Thanks..

Re:Show HN: Std_net.h – Single-file cross-platform TCP netwo... by Forgret on Tuesday September 09, 2025 @10:13AM (#45182227)
Hi! Thanks for the feedback. To be honest, the current version of std_net won’t run directly on ESP32 or bare-metal — it relies on standard BSD sockets and a full OS environment.

That said, it can serve as a basis:

On ESP32, you could adapt it to use LWIP sockets via ESP-IDF or Arduino, implement non-blocking I/O with FreeRTOS tasks, and reduce buffer sizes.

On bare-metal, it would require a lightweight TCP/IP stack (like lwIP or uIP) and rewriting functions to be fully event-driven and minimal on dynamic memory.

Also, please keep in mind this was the first version — mainly to see if the library idea resonates. I didn’t plan to make it fully optimized or MCU-ready yet. Future versions will definitely include improvements for embedded environments.

Re:Show HN: Std_net.h – Single-file cross-platform TCP netwo... by freakynit on Monday September 15, 2025 @01:07AM (#45246295)
Thanks for the reply. And the first version resonated really well. At least with me :)

Best wishes for the future versions..

Re:Show HN: Std_net.h – Single-file cross-platform TCP netwo... by Forgret on Tuesday September 09, 2025 @10:15AM (#45182245)
Don't worry, I'm already starting work on improving it, your comment motivated me, so maybe in 1 day I'll make what you wanted possible.
Re:Show HN: Std_net.h – Single-file cross-platform TCP netwo... by freakynit on Monday September 15, 2025 @01:08AM (#45246298)
Awesome!! Thank you so much. And glad it was motivating too :)