embedde 4th with esp32-p4

7 views
Skip to first unread message

Alfa Miga

unread,
Jun 29, 2026, 12:53:10 PM (yesterday) Jun 29
to 4tH-compiler
hi ,
I’m a former SAP developer (ABAPer...) who retired three years ago. Back with my first computer (TRS-80 Model I), I used to program in FORTH—with just 16KB of RAM. For the past five years, I’ve been tinkering with small IoT projects using ESP32 and Raspberry Pi Pico boards, primarily within the Arduino framework. A few weeks ago, I spotted a board featuring an MIPI LCD and an ESP32-P4 for €28. I ordered and received it; compared to my other microcontrollers, it’s a powerhouse. I run Home Assistant OS on a NUC to manage my lighting via Zigbee switches and relays, but I felt that solution was overkill. I started building a sort of "micro-HA OS" on the ESP32-P4. My stack involves Mongoose, Duktape (for JS), and creating a BASIC interpreter in JS. I gradually implemented a "BADI" concept, but ran into increasing numbers of bugs, so I put the Duktape approach on hold. I began developing a FORTH kernel (with help from Claude-code) but then remembered 4TH. Would it be reasonable to adapt it for the P4 (32MB Flash, 32MB SPRAM)?

hope some advices,

@+
alfamiga

The Beez

unread,
Jun 29, 2026, 1:20:45 PM (yesterday) Jun 29
to 4tH-compiler
Hi!

Well, given that 4tH doesn't run on any known micro controller, I think it's quite "reasonable" ;-)

But all fun aside, AFAIK "buildroot" supports 4tH -- but it's quite old, and it doesn't support the ESP32-P4 IIRC. Since -- even on a 64-bit processor -- a 4tH executable doesn't even come close to 32 MB, the size issue should be fine. Even more -- 4tH adapts itself automatically to the source it has to compile or run. It even runs fine on MS-DOS. So I don't think all that is an issue.

The worst thing is you have to port it to 4DGL -- which IMHO isn't trivial. A better option is ESP-IDF, I think.

Still, it's not a trivial undertaking. However, if you want to give it a try, I'd welcome that wholeheartedly. But note I don't have a lot of knowledge of this platform.

Hans Bezemer

Alfa Miga

unread,
4:39 AM (13 hours ago) 4:39 AM
to 4tH-compiler

Hi,
thanks for your advices , 
My fingers moved faster than my brain... my hardware is, in fact, woefully unsuited for '4Th'. I created a small Forth with the help of Claude-code, since my skills didn't quite match my ambitions. The core kernel works, but linking it with Mongoose, LVGL (a graphics library optimized for LCDs and microcontrollers), and my little 'BIOS' quickly led to some massive 'rabbit holes'—Claude-code got completely bogged down in recursive bugs! On top of that, my family is asking me to build them a 'BASIC' interpreter... 'FORTH' is just incomprehensible to them... hahaha... even though it's the best medicine for Alzheimer's.

@+
Alfa Miga (.. i'm fan of Alfa Romeo , i own an alfa romeo 1300 GT Junior , i was the first one who bought an Amiga 1000 in my région  .. an Alien in the ocean of PC XT 80800 hahaha..)
Reply all
Reply to author
Forward
0 new messages