{"id":2879,"date":"2026-09-17T16:53:41","date_gmt":"2026-09-17T14:53:41","guid":{"rendered":"https:\/\/coding4phone.com\/?p=2879"},"modified":"2026-09-17T16:53:43","modified_gmt":"2026-09-17T14:53:43","slug":"mogwai-nano-0-5-parallel-tasks-an-rfid-badge-reader-and-a-real-graphical-studio","status":"publish","type":"post","link":"https:\/\/coding4phone.com\/?p=2879&lang=en","title":{"rendered":"MOGWAI NANO 0.5: parallel tasks, an RFID badge reader, and a real graphical Studio"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>MOGWAI NANO 0.5<\/strong> is available on the <a href=\"https:\/\/github.com\/Sydney680928\/MogwaiNano\" target=\"_blank\" rel=\"noopener\">GitHub repository<\/a> \u2014 the densest release since launch.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What&rsquo;s new<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The engine can finally run things in parallel.<\/strong> A <code>task 'name' do { ... }<\/code> launches a block of code on its own native thread, with its own fully isolated engine instance \u2014 its own stack, its own variables, everything. No shared state with the parent program at all: all communication goes exclusively through the existing event mechanism (<code>TASK_DID_START<\/code>, <code>TASK_DID_END<\/code>, <code>TASK_DID_PUBLISH<\/code>&#8230;). Measured cost: roughly 10KB per task, which is why this is practical only on boards with PSRAM \u2014 on a plain ESP32, two or three tasks alone would eat up most of the available memory. When a program ends, every task still running is first asked to stop cooperatively, with a 10-second grace period before a last-resort forced kill \u2014 so nothing is ever left running silently in the background.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>SPI has landed \u2014 and not just in theory.<\/strong> <code>spi.open<\/code>\/<code>spi.write<\/code>\/<code>spi.transfer<\/code>, following the same named-channel pattern as I2C, PWM, and ADC. Rather than stopping at a simple round-trip test, validation came from a full MFRC522 RFID reader driver, written entirely in MOGWAI NANO \u2014 module initialization, the chip&rsquo;s internal CRC coprocessor, card presence detection, UID and SAK retrieval \u2014 with no additional C# added to the firmware. A real badge, on a real module, read successfully.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The Studio now has a second face.<\/strong> MOGWAI NANO Studio GUI, a graphical companion built with Avalonia, officially joins the public repository alongside the existing console Studio. Built-in editor, a REPL-style command line with history, separate live views for the device&rsquo;s console and debug output, file management with recent files, light\/dark themes \u2014 both Studios speak the same network protocol, so pick whichever fits your workflow.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"530\" data-attachment-id=\"2875\" data-permalink=\"https:\/\/coding4phone.com\/?attachment_id=2875#main\" data-orig-file=\"https:\/\/i0.wp.com\/coding4phone.com\/wp-content\/uploads\/2026\/09\/studio-gui-screenshot.png?fit=2386%2C1234&amp;ssl=1\" data-orig-size=\"2386,1234\" data-comments-opened=\"1\" data-image-title=\"studio-gui-screenshot\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/coding4phone.com\/wp-content\/uploads\/2026\/09\/studio-gui-screenshot.png?fit=1024%2C530&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/coding4phone.com\/wp-content\/uploads\/2026\/09\/studio-gui-screenshot.png?resize=1024%2C530&#038;ssl=1\" alt=\"Capture d'\u00e9cran de l'interface de programmation Mogwai Nano Studio, affichant des informations sur la version et un code en cours d'ex\u00e9cution sur le terminal.\" class=\"wp-image-2875\" srcset=\"https:\/\/i0.wp.com\/coding4phone.com\/wp-content\/uploads\/2026\/09\/studio-gui-screenshot.png?resize=1024%2C530&amp;ssl=1 1024w, https:\/\/i0.wp.com\/coding4phone.com\/wp-content\/uploads\/2026\/09\/studio-gui-screenshot.png?resize=300%2C155&amp;ssl=1 300w, https:\/\/i0.wp.com\/coding4phone.com\/wp-content\/uploads\/2026\/09\/studio-gui-screenshot.png?resize=768%2C397&amp;ssl=1 768w, https:\/\/i0.wp.com\/coding4phone.com\/wp-content\/uploads\/2026\/09\/studio-gui-screenshot.png?resize=1536%2C794&amp;ssl=1 1536w, https:\/\/i0.wp.com\/coding4phone.com\/wp-content\/uploads\/2026\/09\/studio-gui-screenshot.png?resize=2048%2C1059&amp;ssl=1 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">MOGWAI NANO STUDIO, terminal and GUI version<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>And the language keeps maturing.<\/strong> <code>TRAP<\/code>\/<code>GUARD<\/code> bring real structured error handling, <code>SWITCH<\/code> avoids cascading <code>if<\/code>\/<code>else if<\/code> chains, and <code>eval<\/code> can now interpolate full RPN expressions inside a string. Also new: <code>stopwatch.*<\/code>, <code>DURING<\/code>, <code>purge<\/code>, <code>exists<\/code>, <code>-&gt;str<\/code>, and <code>mogwai.exit<\/code> for cleanly exiting a program without raising an error.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Under the hood<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A genuine root-cause bug, tracked down over several hours: after a long test session with tasks starting and stopping continuously, the device&rsquo;s free memory kept drifting down \u2014 a classic leak symptom, except nothing showed up in the usual managed reference graph. The cause, once found: every engine instance spins up its own internal network-listening thread, including the ones created for a task \u2014 which never actually needs it, since a task is already driven by its own dedicated thread. That unused thread ran forever, keeping the whole instance alive in memory no matter how thoroughly everything else was cleaned up on the managed side. The kind of bug no ordinary reference analysis would ever catch, since the root cause wasn&rsquo;t a stray object reference at all \u2014 it was a live system thread.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What&rsquo;s next<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A proper user guide for the GUI Studio is in the works, to go beyond this README and give the new interface a real walkthrough.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Everything is in the <a href=\"https:\/\/github.com\/Sydney680928\/MogwaiNano\/blob\/main\/CHANGELOG.md\" target=\"_blank\" rel=\"noopener\">CHANGELOG<\/a> for the full detail.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks to everyone following the project, and as always, <a href=\"https:\/\/github.com\/Ellerbach\" target=\"_blank\" rel=\"noopener\">Laurent Ellerbach<\/a> for his invaluable help. \ud83c\udf89<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MOGWAI NANO 0.5 is available on the GitHub repository \u2014 the densest release since launch. What&rsquo;s new The engine can finally run things in parallel. A task &lsquo;name&rsquo; do { &#8230; } launches a block of code on its own native thread, with its own fully isolated engine instance \u2014 its own stack, its own &#8230; <a title=\"MOGWAI NANO 0.5: parallel tasks, an RFID badge reader, and a real graphical Studio\" class=\"read-more\" href=\"https:\/\/coding4phone.com\/?p=2879&#038;lang=en\" aria-label=\"En savoir plus sur MOGWAI NANO 0.5: parallel tasks, an RFID badge reader, and a real graphical Studio\">Lire la suite<\/a><\/p>\n","protected":false},"author":1,"featured_media":2803,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"D\u00e9couvrez les nouveaut\u00e9s de MOGWAI NANO 0.5 : parall\u00e9lisation, support SPI, et une nouvelle interface graphique pour le d\u00e9veloppement simplifi\u00e9.","jetpack_seo_html_title":"MOGWAI NANO 0.5 : Nouveaut\u00e9s et Am\u00e9liorations Importantes","jetpack_seo_noindex":false,"jetpack_seo_schema_type":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_wpcom_ai_launchpad_first_post":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"{title}\n\n{excerpt}\n\n{url}","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false,"jetpack_post_was_ever_published":false},"categories":[181],"tags":[],"class_list":["post-2879","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mogwai-nano-en"],"jetpack_publicize_connections":[],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pfoe4s-Kr","jetpack-related-posts":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/coding4phone.com\/wp-content\/uploads\/2026\/08\/img01.png?fit=300%2C239&ssl=1","_links":{"self":[{"href":"https:\/\/coding4phone.com\/index.php?rest_route=\/wp\/v2\/posts\/2879","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coding4phone.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coding4phone.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coding4phone.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coding4phone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2879"}],"version-history":[{"count":3,"href":"https:\/\/coding4phone.com\/index.php?rest_route=\/wp\/v2\/posts\/2879\/revisions"}],"predecessor-version":[{"id":2882,"href":"https:\/\/coding4phone.com\/index.php?rest_route=\/wp\/v2\/posts\/2879\/revisions\/2882"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/coding4phone.com\/index.php?rest_route=\/wp\/v2\/media\/2803"}],"wp:attachment":[{"href":"https:\/\/coding4phone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2879"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coding4phone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2879"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coding4phone.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}