<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Serge Hulne on Medium]]></title>
        <description><![CDATA[Stories by Serge Hulne on Medium]]></description>
        <link>https://medium.com/@serge-hulne?source=rss-32ca07294e2b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*1oBdn_Jlnisp0ufaki1Mrg.jpeg</url>
            <title>Stories by Serge Hulne on Medium</title>
            <link>https://medium.com/@serge-hulne?source=rss-32ca07294e2b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 00:35:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@serge-hulne/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[SwiftlyGo: Declarative WebAssembly UI in Pure Go]]></title>
            <link>https://serge-hulne.medium.com/swiftlygo-declarative-webassembly-ui-in-pure-go-478103663b67?source=rss-32ca07294e2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/478103663b67</guid>
            <category><![CDATA[go]]></category>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[gui]]></category>
            <category><![CDATA[wasm]]></category>
            <dc:creator><![CDATA[Serge Hulne]]></dc:creator>
            <pubDate>Wed, 11 Jun 2025 05:00:51 GMT</pubDate>
            <atom:updated>2025-06-11T05:20:16.782Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="SwiflyGo" src="https://cdn-images-1.medium.com/max/1024/1*kkM5pk7VBWC8-93oQlrDSg.png" /></figure><p><strong>By Serge Hulne</strong></p><p>WebAssembly is opening doors for programming languages to run efficiently in the browser, and Go is among those making serious strides in this domain. <strong>SwiftlyGo</strong> is an experimental, minimalistic toolkit I created to explore how far we can push Go in the browser — using only Go, and no JavaScript.</p><p>💡 The Problem</p><ul><li>Modern frontend development often demands:</li><li>A Node.js toolchain</li><li>JavaScript frameworks like React, Vue, or Solid</li><li>Transpilers, bundlers, linters, plugins, and loaders</li><li>HTML/CSS/JS separated from your backend logic</li></ul><p>Even for simple dashboards or admin tools, the setup cost is massive — especially for teams that primarily use Go on the backend.</p><h3>SwiftlyGo is a declarative UI toolkit written in Go and compiled to WebAssembly, enabling developers to build browser apps using a design style inspired by SwiftUI or Jetpack Compose.</h3><p>It uses :</p><ul><li>❌ No Node.js</li><li>❌ No npm</li><li>❌ No bundler (Webpack, Parcel, etc.)</li><li>❌ No React, Vue, or JSX</li><li>❌ No VDOM</li><li>❌ No build pipeline beyond make wasm</li></ul><h3>🔍 What Is SwiftlyGo?</h3><p>SwiftlyGo provides:</p><ul><li><strong>A declarative widget tree</strong> defined entirely in Go</li><li><strong>Two-way reactive state</strong> using observables</li><li><strong>Browser-native rendering</strong> through Go’s syscall/js and honnef.co/go/js/dom/v2</li><li>A small, composable widget system (button, label, layout containers, etc.)</li></ul><p>It’s lightweight, dependency-free, and matches Go’s philosophy: keep it simple, readable, and fast.</p><h3>🧠 Design Philosophy</h3><p>Most frontend frameworks abstract away the DOM through virtual layers. While this is powerful, it introduces runtime complexity and large JS bundles. SwiftlyGo takes a different approach:</p><ul><li><strong>Direct DOM binding</strong>: no virtual DOM, no diffing algorithm — just observable bindings.</li><li><strong>Minimal runtime</strong>: reactivity is handled via explicit observables and callback hooks.</li><li><strong>Composition over configuration</strong>: layout is done via containers (horizontal, vertical), each built with native HTML semantics under the hood.</li></ul><h3>📁 Project Structure</h3><p>The repository has a flat structure with a central demo in app/main.go:</p><pre>SwiftlyGo/<br>├── core/         # Widget definitions, observables, DOM glue<br>├── ui/           # Layout helpers and composition primitives<br>└── app/          # Demo application: tasks, counter, layout showcase</pre><h3>🧪 Demo Application (in app/main.go)</h3><p>The demo file contains a practical showcase of the toolkit. It includes:</p><h3>✔️ Features</h3><ul><li>Diverse snippets illustrating the reactive aspects of the widgets</li><li>A counter.</li><li>A simple todo list.</li><li>A version of Conways “Game of life cellulqr automaton”.</li></ul><h3>✨ Code Highlights</h3><h4>State definition using observables:</h4><pre>package main</pre><pre>import (<br>	&quot;fmt&quot;<br>	&quot;gocore/core&quot;<br>	&quot;gocore/ui&quot;<br>)</pre><pre>func OneWay() {<br>	source := core.NewObservable(&quot;&quot;)</pre><pre>	in := ui.NewTextField()<br>	in.BindTo(source)</pre><pre>	out := ui.NewTextField()</pre><pre>	btn := ui.NewButton(&quot;Copy&quot;)<br>	btn.OnClick(func() {<br>		fmt.Println(&quot;Clicked:&quot;, source.Get())<br>		out.SetText(source.Get())<br>	})</pre><pre>	w := ui.NewWindow()<br>	w.Add(in, out, btn)<br>	w.Run()<br>}</pre><h4>A declarative UI tree:</h4><pre>ui := core.NewVBox(<br>    core.NewText(&quot;Todo App&quot;).FontSize(20),<br>    core.NewHBox(<br>        input.BindTo(taskText),<br>        core.NewButton(&quot;➕&quot;).OnClick(func() {<br>            // Logic to add new task<br>        }),<br>    ),<br>    // Render the list<br>)</pre><h4>Auto-updating reactive views:</h4><pre>core.NewTextBound(remainingText)</pre><p>This updates automatically when remainingText changes — no manual refresh needed.</p><h3>⚙️ Running the App</h3><p>SwiftlyGo comes with a <strong>command-line development tool</strong> located in the cmd/ directory. This tool launches a local development server and handles <strong>automatic rebuilding and live-reloading</strong> whenever you modify your Go code.</p><p>To get started:</p><pre>git clone https://github.com/serge-hulne/SwiftlyGo<br>cd SwiftlyGo<br>go run ./cmd/coredev</pre><p>Then open your browser at:</p><pre>http://localhost:8090</pre><h3>🛠 What’s in cmd/coredev?</h3><p>The development tool does the following:</p><ul><li>Watches the app/ folder for changes to .go files</li><li>Automatically rebuilds the WASM binary using GOOS=js GOARCH=wasm</li><li>Serves index.html, main.wasm, and wasm_exec.js</li><li>Triggers a page reload in the browser when changes are detected</li></ul><p>This creates a smooth workflow similar to what frontend developers expect from modern tools like Vite or Parcel, but tailored for Go+WASM development.</p><h3>📈 Future Improvements</h3><p>I plan to explore:</p><ul><li>Theme support and dark mode</li><li>Component abstraction with reusability</li><li>Form widgets (checkbox, radio, dropdown)</li><li>Improved layout options (grid, scroll view)</li></ul><h3>📎 Repository</h3><p>🔗 <a href="https://github.com/serge-hulne/SwiftlyGo">GitHub: serge-hulne/SwiftlyGo</a></p><h3>📸 Banner</h3><p>You can use this image when publishing the article on Medium:</p><h3>🎯 Why It Matters</h3><p>SwiftlyGo shows that Go can be used not just for backend logic or computation, but for full UI applications. It demonstrates a model where developers can <strong>write frontend UI logic in the same language and mindset as their backend</strong>, simplifying full-stack development.</p><p>It’s also a useful playground to experiment with ideas around declarative UI, state reactivity, and WASM ergonomics in Go — without involving JavaScript or large toolchains.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=478103663b67" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DES RESSOURCES DANS LE MONDE DE L’APRÈS PÉTROLE]]></title>
            <link>https://serge-hulne.medium.com/des-ressources-dans-le-monde-de-lapr%C3%A8s-p%C3%A9trole-7de5c470ff23?source=rss-32ca07294e2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7de5c470ff23</guid>
            <dc:creator><![CDATA[Serge Hulne]]></dc:creator>
            <pubDate>Sun, 08 Jun 2025 11:24:22 GMT</pubDate>
            <atom:updated>2025-06-08T13:20:54.961Z</atom:updated>
            <content:encoded><![CDATA[<p>Energie, alimentation, chaînes d’approvisionnement: Mythes et réalités.</p><p>Le décès de PIERRE RABHI, figure emblématique de l’écologie Française, appelle quelques réflexions sur les mythes et réalités entourant la perception de l’écologie par les média et la société.</p><p>Force est de rendre homage à un homme de bien qui a voué son existence à faire connaître les enjeux de l’écologie auprès du grand public.</p><p>Comme tous les grands hommes qui ont contribué à se faire les apôtres d’une cause qui est à la fois cruciale mais méconnue à un un moment donné de l’histoire et qui, de ce fait, ont été exposés aux feux de la rampe, cette figure emblématique d’une partie du mouvement écologique en France n’est pas sans controverse Pierre Rabhi, wikipédia</p><p>Je crains qu’on ne puisse dire des choses analogues pour nombre de promoteurs et d’acteurs de la scène écologique au sens large, dans des contextes comme celui des « villages en transition » ou encore des élus de village écologistes, des promoteurs de parcs d’éoliennes et/ou de panneaux solaires, etc.</p><p>Quand on regarde de près, ces approches sont souvent utopiques, empruntes d’amateurisme; elles sont souvent le fait d’idéologues, limite sectaires, sous pression de résultats (et donc tentés de falsifier leurs résultats).</p><p>Des élus écologistes font quelquefois aussi figure de despotes imposant leur vision des choses à leurs administrés (des controverses qui ne manquent pas voir le jour à l’encontre de personnages tel que le maire de Ungersheim, par exemple) -à tort ou à raison- l’histoire nous l’apprendra.</p><p>Un autre exemple est celui de l’île de El Hierro (éoliennes plus STEP),une île soi-disante autonome en énergie, en réalité : un fiasco économique, écologique, financier sur arrière-plan d’escroqueries, qui à longtemps été montré comme un modèle de système « résilient, autonome » par des journalistes négligeant tous les signe ostensibles avertisseurs d’escroquerie et de manipulation idéologique.</p><p>On a dit de Pierre Rabhi : « Son exploitation ne fournissait pas de quoi nourrir ses employés » , c’est le aussi cas de néo-ruraux qui retournent vivre en ville après avoir risqué (paradoxalement) de mourir de faim, de froid en dépit de leurs potagers, de leurs panneaux solaires et de leur basse-cour (faute d’avoir prévu un nombre de panneaux solaires nécessaire pour fournir une énergie suffisante et faute d’avoir prévu l’acquisition d’un nombre d’hectares suffisants pour assurer leur alimentation).</p><p>Bernard Friot : « La ZAD ne peut pas fournir les outils de production de la ZAD ».</p><p>La décroissance, la sobriété sont vraisemblablement nécessaires pour essayer de construire un monde de l’après-pétrole.</p><p>Toutefois :</p><ol><li>Les EnR butent sur le problème du pic des métaux (cuivre, etc.) et les impératifs d’une économie circulaire. Donc au vu d’un simple bilan des ressources en métaux et en béton, il est clair que le éoliennes ou les panneaux solaires à eux seuls ne peuvent pas permettre un transition vers l’après pétrole.</li></ol><p>2. La globalisation est une nécessité pour l’échange de ressources nécessaires pour affronter l’après pétrole. Il devrait y avoir une loi rendant obligatoire l’affichage (via code QR) de la chaîne d’apprivoisement de tous les produits, avec en plus:</p><ul><li>Le calcul de l’emprunte carbone correspondante.</li><li>Le calcul, plus généralement de l’emprunte énergétique correspondante.</li></ul><p>Exemple affichage de la chaine d’approvisionnement d’une usine de panneaux solaire en Allemagne (Ref 1):</p><p>Quand on considère cet exemple, on s’aperçoit que c’est très loin d’être du 100% « Made in Germany »</p><p>3. Une certaine autonomie industrielle au niveau des nations est aussi nécessaire (ce n’est pas antagoniste : les deux sont nécessaires. l’autonomie « absolue » est un mythe, une pathologie. C’est du survivalisme déguisé; c’est une pathologie de la pensée d’extrême droite)</p><p>4. Une approche de l’agriculture plus respectueuse des sols est indispensable à la survie du genre humain, mais la permaculture de base appliquée littéralement n’est pas la solution (pas plus que les engrais chimiques ou les OGM, ou les monocultures à long terme).</p><p>Il faut un nouveau modèle (qui n’a pas encore été trouvé).</p><p>Dans ce cadre les OGM sont peut-être un moindre mal mais encore faut-il rendre l’accès à ces technologies elles-mêmes «durable», perenne, en faire une priorité au sens des ressources critiques (à meme titre que les matières premieres critiques).</p><p>Les dirigeants qui ignorent ce genre de contraintes physiques incontournables seront confrontés à:</p><ul><li>Des prix délirants de l’énergie (paralysant tout).</li><li>L’inflation galopante que ces prix induisent inévitablement.</li><li>Des pénuries alimentaires prolongées, à l’échelle nationale, voir continentale.</li><li>Des disruptions de leur industrie dues aux manques d’approvisionnement en matières premières, en pièces, en composants et entrants divers : Métaux, semi-conducteurs, blé, sucre, etc.</li><li>Les troubles économiques, sociaux, alimentaires qui vont avec.</li><li>Les conflicts et guerres (guerres économiques et guerres tout court) qui en résultent. Cf V. Mignerot et al.</li></ul><p>Ungersheim:</p><p>https://www.lemoniteur.fr/article/ungersheim-le-village-ou-la-transition-energetique-est-une-realite.1491949</p><p>https://fr.wikipedia.org/wiki/Ungersheim</p><p>Rabhi:</p><p>https://fr.wikipedia.org/wiki/Pierre_Rabhi</p><p>El_Hierro:</p><p>https://fr.wikipedia.org/wiki/El_Hierro</p><p>https://www.bbc.com/news/magazine-34424606</p><p>http://euanmearns.com/an-independent-evaluation-of-the-el-hierro-wind-pumped-hydro-system/</p><p>Friot_Lordon:</p><p>https://youtu.be/2_kaRuDNdno</p><p>Neo_ruraux:</p><p>https://www.lemonde.fr/livres/article/2006/10/17/neo-ruraux-gare-aux-desillusions_824426_3260.html</p><p>Pic_metaux:</p><p>https://www.lemonde.fr/blog/petrole/2012/05/08/rarefaction-des-metaux-demain-le-peak-all/</p><p>https://reporterre.net/La-croissance-verte-est-une-mystification-absolue</p><p>https://www.lemonde.fr/culture/article/2020/11/24/les-metaux-rares-la-face-noire-des-energies-vertes-devoilee-sur-arte_6060981_3246.html</p><p>https://youtu.be/E1iphq6THdc</p><p>https://mrmondialisation.org/reouverture-des-mines-en-france-un-formidable-operation-de-greenwashin/</p><p>Supply_chains:</p><p>(Ref 1) https://open.sourcemap.com/maps/5877c865325110eb1f1dd998?fbclid=IwAR0fgU_uPVNgG5KqbHpO_sibZZB1Sv5hJUCojReiOzo4OslcnFKlEnvMCdw</p><p>https://shellyfaganaz.medium.com/why-you-should-be-very-worried-about-the-supply-chain-39ee38f95fa7</p><p>Autonomy_myth:</p><p>https://www.resilience.org/stories/2019-10-18/the-myth-of-autonomy</p><p>https://energypost.eu/roadmap-to-nowhere-the-myth-of-powering-the-nation-with-renewable-energy/</p><p>prix_des_renouvelables:</p><p>https://jancovici.com/publications-et-co/articles-de-presse/pas-chere-mon-electricite-decarbonee/</p><p>https://courrierdeuropecentrale.fr/un-expert-francais-defend-le-nucleaire-les-renouvelables-sont-une-diversion/</p><p>https://courrierdeuropecentrale.fr/un-expert-francais-defend-le-nucleaire-les-renouvelables-sont-une-diversion/</p><p>Agriculture:</p><p>https://www.geo.fr/environnement/agriculture-durable-definition-principes-et-enjeux-193859</p><p>https://www.fao.org/sustainable-development-goals/overview/fao-and-post-2015/sustainable-agriculture/fr/</p><p>Mignerot:</p><p>https://www.presages.fr/blog/2018/vincent-</p><p>Ressources_critiques:</p><p>https://fr.wikipedia.org/wiki/Matières_premières_critiques</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7de5c470ff23" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Physics Without a universal clock: Rethinking Conway’s Game of Life.]]></title>
            <link>https://serge-hulne.medium.com/physics-without-a-universal-clock-rethinking-conways-game-of-life-044da4592869?source=rss-32ca07294e2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/044da4592869</guid>
            <category><![CDATA[physics]]></category>
            <category><![CDATA[simulation]]></category>
            <category><![CDATA[code]]></category>
            <dc:creator><![CDATA[Serge Hulne]]></dc:creator>
            <pubDate>Wed, 28 May 2025 21:25:44 GMT</pubDate>
            <atom:updated>2026-07-05T09:00:28.003Z</atom:updated>
            <content:encoded><![CDATA[<h3>Physics without a universal clock. Rethinking Conway’s Game of Life.</h3><h3>Asynchronous Cellular Automata: An Alternative to Synchronous Update Schemes in Conway’s Game of Life.</h3><p><strong>Author</strong>: Serge Hulne<br><strong>Date</strong>: 2025<br><strong>Duration</strong>: 5 minute read</p><h3>Abstract</h3><p>This paper presents an implementation of Conway’s Game of Life using asynchronous update mechanisms, departing from the traditional synchronous approach. The model employs concurrent processing where each cell operates independently with species-specific timing parameters. This approach provides a framework for studying emergent behaviors in systems without global synchronization, with potential applications in distributed computing and biological modeling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*31ML6aTvf78E_kaymq_Xrw.gif" /></figure><h3>1. Introduction</h3><p>Conway’s Game of Life, introduced by John Horton Conway in 1970, represents a foundational model in cellular automaton theory. The traditional implementation employs synchronous updates where all cells transition states simultaneously at discrete time steps. This paper explores an alternative approach using asynchronous updates, where each cell operates on an independent schedule.</p><p>The motivation for this approach stems from observations in natural systems where synchronous behavior is rare. Biological systems, from neural networks to bacterial colonies, typically exhibit asynchronous dynamics. Additionally, modern distributed computing systems operate without global clocks, making asynchronous models increasingly relevant.</p><h3>2. Background</h3><h3>2.1 Traditional Conway’s Game of Life</h3><p>The standard Game of Life operates on a two-dimensional grid where each cell exists in one of two states (alive or dead). State transitions follow deterministic rules based on the count of living neighbors in the Moore neighborhood (8 adjacent cells).</p><h3>2.2 Limitations of Synchronous Models</h3><p>Synchronous cellular automata assume:</p><ul><li>Universal time steps</li><li>Simultaneous state updates across all cells</li><li>Perfect information propagation</li></ul><p>These assumptions do not align with:</p><ul><li>Distributed systems where communication has latency</li><li>Biological systems with variable reaction times</li><li>Physical systems where information propagates at finite speed</li></ul><h3>3. Model Description</h3><h3>3.1 Asynchronous Update Mechanism</h3><p>Our implementation replaces the global update cycle with independent cell processes. Each cell:</p><ol><li>Maintains its own update schedule</li><li>Reads neighbor states asynchronously</li><li>Updates based on local observations</li></ol><p>Implementation in Go:</p><pre>func (c *Cell) run(wg *sync.WaitGroup) {<br>    defer wg.Done()<br>    for {<br>        time.Sleep(c.reactionTime())<br>        c.computeNextState()<br>        c.applyNextState()<br>    }<br>}</pre><h3>3.2 Multi-Species Extension</h3><p>The model incorporates three cell species with distinct timing parameters:</p><ul><li>Species 1 (Green): 101ms update interval</li><li>Species 2 (Red): 102ms update interval</li><li>Species 3 (Blue): 102ms update interval</li></ul><p>Birth rules incorporate species competition through majority voting with stochastic tie-breaking.</p><h3>3.3 Concurrency Management</h3><p>The system employs:</p><ul><li>One goroutine per cell (lightweight threads in Go)</li><li>Mutex-based synchronization for state access</li><li>Read-write locks for grid-level operations</li></ul><h3>4. Implementation</h3><h3>4.1 Technical Architecture</h3><ul><li><strong>Language</strong>: Go (chosen for native concurrency support)</li><li><strong>Visualization</strong>: Terminal-based using tcell library</li><li><strong>Grid Size</strong>: Configurable, typically 50×50 cells</li><li><strong>Memory Usage</strong>: Approximately 2–4KB per goroutine</li></ul><h3>4.2 Synchronization Protocol</h3><pre>func (c *Cell) countAliveNeighbors() (green, red, blue int) {<br>    c.gridMu.RLock()<br>    defer c.gridMu.RUnlock()<br>    <br>    for _, offset := range c.neighbour8 {<br>        neighbor.mu.Lock()<br>        // Read neighbor state<br>        neighbor.mu.Unlock()<br>    }<br>    return<br>}</pre><h3>4.3 Visualization</h3><p>The system renders to terminal with:</p><ul><li>Color-coded species representation</li><li>20Hz refresh rate</li><li>Double-width characters for aspect ratio correction</li></ul><h3>5. Observed Behaviors</h3><h3>5.1 Emergent Phenomena</h3><p>The asynchronous model exhibits several distinct behaviors:</p><ol><li><strong>Propagation Delays</strong>: Information spreads through the grid at finite speed rather than instantaneously</li><li><strong>Local Synchronization</strong>: Adjacent cells may spontaneously synchronize through mutual interaction</li><li><strong>Species Boundaries</strong>: Interfaces between species territories show complex dynamics</li><li><strong>Temporal Heterogeneity</strong>: Different regions evolve at different rates</li></ol><h3>5.2 Comparison with Synchronous Model</h3><p>Key differences include:</p><ul><li>Absence of perfectly periodic patterns</li><li>Emergence of timing-dependent behaviors</li><li>More gradual pattern evolution</li><li>Potential for metastable states</li></ul><h3>6. Applications</h3><h3>6.1 Distributed Systems</h3><ul><li>Modeling consensus protocols without global clocks</li><li>Studying fault tolerance in asynchronous networks</li><li>Analyzing propagation delays in distributed algorithms</li></ul><h3>6.2 Biological Systems</h3><ul><li>Neural network dynamics with realistic propagation delays</li><li>Bacterial colony growth with variable cell division rates</li><li>Ecological models with species-specific time scales</li></ul><h3>6.3 Theoretical Computer Science</h3><ul><li>Exploring computational universality in asynchronous systems</li><li>Studying emergence in non-synchronized automata</li><li>Analyzing complexity measures for concurrent systems</li></ul><h3>7. Performance Analysis</h3><ul><li><strong>Scalability</strong>: Linear with grid size (O(n) goroutines for n cells)</li><li><strong>Memory</strong>: 2–4KB per cell, totaling ~10MB for 50×50 grid</li><li><strong>CPU Usage</strong>: Dependent on update frequencies and mutex contention</li><li><strong>Synchronization Overhead</strong>: Minimal due to fine-grained locking</li></ul><h3>8. Future Research Directions</h3><ol><li><strong>Parameter Studies</strong>: Systematic analysis of timing parameter effects</li><li><strong>Scaling Behavior</strong>: Investigation of large-scale emergent properties</li><li><strong>Energy Models</strong>: Introduction of resource constraints</li><li><strong>3D Extensions</strong>: Three-dimensional grids with additional propagation dynamics</li><li><strong>Adaptive Timing</strong>: Dynamic adjustment of update rates based on local activity</li></ol><h3>9. Installation and Usage</h3><pre>git clone https://github.com/serge-hulne/Non-Newtonian-cellular-automata<br>cd Non-Newtonian-cellular-automata<br>go mod tidy<br>go run main.go</pre><p>Command-line options:</p><ul><li>--invert: Reverse color scheme for light terminals</li><li>Exit: Press ‘q’ or ESC</li></ul><h3>10. Conclusion</h3><p>This implementation demonstrates that cellular automata can operate effectively without global synchronization. The asynchronous approach:</p><ul><li>Provides a more realistic model for natural systems</li><li>Enables new types of emergent behaviors</li><li>Offers insights into distributed computation</li></ul><p>The model serves as a platform for investigating questions in complex systems, distributed computing, and theoretical biology where synchronous assumptions are limiting.</p><h3>References</h3><p>Source code available at: <a href="https://github.com/serge-hulne/Non-Newtonian-cellular-automata">https://github.com/serge-hulne/Non-Newtonian-cellular-automata</a></p><h3>Acknowledgments</h3><p>Implementation utilizes the Go programming language and tcell terminal library.</p><p><strong>Keywords</strong>: Cellular automata, asynchronous systems, Conway’s Game of Life, concurrent programming, emergent behavior, distributed systems</p><p><em>Implementation available in Go using goroutines and tcell. Code features per-cell concurrency, race-free updates, and terminal UI. For experimental setups, CLI flags and visualization tools are extendable.</em></p><p><strong>GitHub</strong>: [<a href="https://github.com/serge-hulne/Non-Newtonian-cellular-automata">https://github.com/serge-hulne/Non-Newtonian-cellular-automata</a>]</p><p><strong>Contact</strong>: [<a href="https://github.com/serge-hulne">https://github.com/serge-hulne</a>] for collaboration or feedback.</p><p>D. Hofstadter : Consciousness, self-reference, Gődel, IA. https://youtu.be/R6e08RnJyxo?is=nxM57I2R0e8GXXGT</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=044da4592869" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Au-delà de l’impossible : Les enquêtes occultes de Sherlock Holmes »]]></title>
            <link>https://serge-hulne.medium.com/au-del%C3%A0-de-limpossible-les-enqu%C3%AAtes-occultes-de-sherlock-holmes-d53a970eb7e9?source=rss-32ca07294e2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d53a970eb7e9</guid>
            <dc:creator><![CDATA[Serge Hulne]]></dc:creator>
            <pubDate>Tue, 06 May 2025 15:12:24 GMT</pubDate>
            <atom:updated>2025-05-06T15:14:40.142Z</atom:updated>
            <content:encoded><![CDATA[<h3>Au-delà de l’impossible : Les enquêtes occultes de Sherlock Holmes »</h3><figure><img alt="Illustration de l&#39;auteur." src="https://cdn-images-1.medium.com/max/700/0*xUhYyoOW2BjIiPWL" /></figure><p>Durant cet hiver particulièrement rigoureux de 1895, alors que nous nous apprêtions à entamer notre repas du soir, un fracas précipité et insistant à la porte d’entrée résonna dans toute la maison, provoquant un sursaut violent de la bonne Mrs Hudson, qui faillit lâcher le plateau portant son ragoût irlandais, l’un de ses chefs-d’œuvre culinaires les plus appréciés.<br>Mrs Hudson, robuste dame d’origine écossaise, était ordinairement d’un tempérament flegmatique, mais les menaces redoutables que nous avions subies durant l’affaire que j’ai relatée sous le titre « Le Signe des Quatre » avaient mis ses nerfs à rude épreuve.</p><p>J’étais sur le point de plonger ma cuillère dans ce savoureux mets lorsque Mrs Hudson reparut, précédant l’inspecteur Lestrade. Ce dernier fit irruption dans notre salon dans un état de grand désarroi : son chapeau de travers, ses vêtements en désordre, et son visage livide. Le déluge qui s’abattait sur Londres depuis l’aube avait trempé son manteau jusqu’à l’os, et des filets d’eau dévalaient sa moustache frémissante. Son apparence débraillée contrastait vivement avec le soin méticuleux qu’il apportait habituellement à sa tenue.<br>Holmes, la main posée sur le dossier d’un fauteuil, l’observa avec un mélange de curiosité et d’amusement.</p><p>— Mon cher Lestrade, on dirait que vous avez traversé la Tamise à la nage. Je vous en prie, éclairez-nous : quel mauvais vent vous pousse jusqu’à Baker Street à pareille heure ? dit-il en désignant d’un geste distrait le fauteuil près de la cheminée.<br>L’inspecteur s’y effondra lourdement, sans même songer à se débarrasser de son manteau détrempé. Son regard hagard passa de Holmes à moi, puis à la table dressée, comme s’il ne prenait que vaguement conscience d’interrompre notre repas. Il sortit un mouchoir de sa poche et s’épongea le front, bien que la pièce fût loin d’être surchauffée.</p><p>— Je vous prie de m’excuser pour cette intrusion, messieurs, balbutia-t-il d’une voix rauque d’émotion. Mais l’affaire ne souffre aucun délai — pas une minute de plus.</p><p>— Holmes, dit Lestrade, c’est le cauchemar Bruce-Partington tout recommencé, mais en pire cette fois.</p><p>— Ne me dites pas que l’Amirauté a encore égaré des documents d’importance nationale, Lestrade ? Allons, j’ose espérer que la marine n’a pas perdu sa flotte… murmura Holmes, un léger plissement au coin des lèvres trahissant son amusement.</p><p>— Ce n’est pas une affaire à plaisanter, Monsieur Holmes, protesta Lestrade en s’épongeant de nouveau le front. Il est vrai que des documents ont disparu… mais ce n’est pas tout…<br>Le sourcil droit de Holmes se haussa de cette manière caractéristique qui invitait l’interlocuteur à poursuivre son récit.<br>Je notai l’étincelle d’intensité familière dans son regard — ce petit éclat qui signifiait, pour qui savait l’interpréter, que son esprit était déjà en pleine ébullition.</p><p>— Il y a aussi, s’exclama Lestrade, ce détail infime de plusieurs tonnes de lingots d’or qui se sont volatilisées !<br>Un fracas de vaisselle brisée suivi d’un bruit sourd nous apprit que Mrs Hudson venait de s’évanouir.</p><p>Réprimant un juron surpris, je saisis la carafe de cognac des mains de notre hôte sans cérémonie pour porter secours à notre logeuse en syncope. Sachant qu’une main ferme est un prérequis pour tout médecin, je pris au passage la précaution d’en avaler une gorgée salutaire.<br>Avec l’aide de Holmes, nous parvînmes à installer Mrs Hudson sur le canapé. Quant à l’inspecteur Lestrade, il resta figé dans son fauteuil, le visage figé dans une expression de consternation absolue.<br>Pendant que je vérifiais le pouls de Mrs Hudson, j’entendis Holmes dire à Lestrade :</p><p>— Reprenez-vous, inspecteur. À présent… éclairez-nous.</p><p>— Une tonne d’or volée à la Royal Bank of Scotland alors que mes hommes et moi étions postés à l’intérieur comme à l’extérieur ! s’exclama Lestrade. Puis, submergé par l’émotion, il poursuivit : Holmes, c’est ma perte assurée ! Ma réputation est en lambeaux — le chef de la police exigera ma démission après une telle catastrophe. On parle d’anarchistes, de complots… certains vont même jusqu’à chuchoter qu’il y a des traîtres dans la police ! Et Jenny… Si je suis révoqué, ils risquent de la renvoyer, elle aussi — et notre petit Tommy, que va-t-il devenir ? L’asile, l’usine, la mine… Mon Dieu…<br>Holmes, imperturbable, servit une généreuse mesure de cognac et la tendit d’une main aussi calme que s’il offrait un biscuit.</p><p>À cet instant, Mrs Hudson entrouvrit les paupières. Elle se redressa, tenta de se lever, réussit avec mon aide, puis déclara avec cette dignité tranquille de qui est résolu à maintenir les convenances en toutes circonstances : « Messieurs, jamais une affaire de cette gravité ne trouvera son dénouement le ventre vide. Je vous en prie, honorez mon ragoût irlandais. Je vais chercher une assiette supplémentaire sur-le-champ. »</p><p>— Deux, je vous prie, Mrs Hudson, ajouta Holmes d’un ton absent, le regard déjà ailleurs. Je crois que vous aussi avez besoin de vous remettre de vos émotions.</p><p>— Mais… mais… qu’en est-il de la confidentialité de l’enquête, Monsieur Holmes ? demanda-t-elle, son accent écossais légèrement plus prononcé sous le coup de l’émotion.</p><p>— J’ai bien peur, Mrs Hudson, que vous n’ayez déjà été mise au courant des aspects les plus graves. N’est-ce pas, Lestrade ?<br>Lestrade acquiesça d’un signe de tête. Bien qu’encore visiblement secoué, un peu de couleur revenait peu à peu à ses joues.</p><p>- D’ailleurs, continua Holmes, tirant pensivement sur sa pipe, vous reprendrez votre récit après dîner. Il vous faut d’abord reprendre des forces.<br>Le repas achevé, Holmes servit à chacun de nous une tasse du café fraîchement préparé par Mrs Hudson avant qu’elle ne se retirât dans ses quartiers, après nous avoir souhaité une bonne soirée et adressé ses sympathies à l’inspecteur Lestrade.</p><p>Sortant le tabac de son unique tabatière — un vieux chausson persan en cuir passablement usé — Holmes invita Lestrade à reprendre le fil de son récit.</p><p>— Il y a trois semaines, j’ai été convoqué par le commissaire Llewelyn-Jones, commença Lestrade, sa voix plus assurée après le repas.</p><p>Je remarquai qu’à l’évocation de cet aristocrate, connu pour son mépris sans bornes envers ses subalternes, qu’il considérait comme de simples domestiques, les narines de Holmes frémirent légèrement — unique indice de son désaveu.</p><p>Celui-ci m’a informé que Sir Reginald Fitzpatrick — le directeur de la Royal Bank of Scotland — avait sollicité de l’aide au sujet de vols commis dans son établissement. Sir Reginald était convaincu que ses employés dérobaient des objets de valeur, mais il ne comprenait pas comment ils pouvaient échapper à la vigilance des détectives internes, pourtant aux aguets depuis les premiers disparus.</p><p>Le pauvre homme était au bord de la crise de nerfs, poursuivit Lestrade en secouant la tête. Il a d’abord accusé les caissiers, puis les comptables, ensuite les veilleurs de nuit, et enfin les détectives eux-mêmes. À présent, il est persuadé qu’il s’agit d’un vaste complot. Il a même pris l’habitude de se promener armé dans les bureaux, menaçant plus d’un employé.<br>Le commissaire m’a donc chargé d’enquêter discrètement.<br> Comme tous les vols étaient découverts au petit matin, j’ai jugé plus prudent de monter la garde à l’intérieur du coffre pendant la nuit, accompagné de deux de mes meilleurs agents. J’ai choisi Wilkins et Hobbes. Deux excellents éléments.<br>Pendant une semaine, nous avons monté la garde dans ce coffre, nuit après nuit, sans le moindre incident… jusqu’à ce que…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d53a970eb7e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shadows of the impossible : The occult cases of Sherlock Holmes. Chapter 1.]]></title>
            <link>https://serge-hulne.medium.com/the-new-occult-adventures-of-sherlock-holmes-chapter-1-7b1473d703df?source=rss-32ca07294e2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b1473d703df</guid>
            <dc:creator><![CDATA[Serge Hulne]]></dc:creator>
            <pubDate>Sun, 04 May 2025 08:41:08 GMT</pubDate>
            <atom:updated>2025-05-06T14:46:20.836Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Illustration by the author." src="https://cdn-images-1.medium.com/max/1024/0*TueXYKMF4wW30G02" /></figure><p>A NOVEL</p><p>During that particularly bitter winter of 1895, as we were about to partake of our evening repast, a most frantic and insistent rapping upon the front door resounded throughout the house, causing the good Mrs. Hudson to start violently, very nearly relinquishing her grasp upon the tray bearing the Irish Stew, which was one of her most lauded culinary accomplishments.</p><p>Mrs. Hudson was a stalwart lady of Scottish extraction, ordinarily possessed of a rather phlegmatic disposition, but the dire threats we had suffered during the affair I have chronicled under the title “The Sign of the Four” had sorely taxed her nerves.</p><p>I was on the verge of plunging my spoon into the savoury concoction when Mrs. Hudson reappeared, preceding Inspector Lestrade. The latter burst into our drawing-room in a state of considerable discomposure, his hat awry, his garments in disarray, and his countenance ashen. The deluge that had been assailing London since the early hours had thoroughly saturated his greatcoat, and rivulets of water trickled from his quivering moustache. His dishevelled appearance stood in marked contrast to his customary fastidiousness in matters of attire.</p><p>Holmes, who had been poised with one hand upon the chair back, regarded our visitor with a gleam of mingled curiosity and amusement.<br>“My dear Lestrade, you look as though you have wrestled with the Thames itself. Pray, what ill wind has blown you to Baker Street at such an hour?” he remarked, gesturing languidly toward the armchair nearest the hearth.<br>The inspector collapsed heavily into it, neglecting even to divest himself of his sodden overcoat. His harrowed gaze shifted from Holmes to myself, then to the appointed table, as if he were only dimly cognizant that he was interrupting our evening meal. He extracted a handkerchief from his pocket and mopped his brow, though the chamber was by no means overheated.</p><p>“I beg your pardon for intruding like this, gentlemen,” he stammered, his voice rough with agitation. “But the matter cannot wait — not for another moment.”<br>“Holmes,” said Lestrade, “it’s that Bruce Partington nightmare all over again, only this time, worse.”<br>“Surely not another lapse in Her Majesty’s defences, Lestrade? Tell me the Navy has not misplaced its fleet.” Holmes murmured, a faint twitch at the corner of his mouth betraying his amusement.<br>“This is no matter for jest, Mr. Holmes,” Lestrade protested, mopping his brow again. “There are indeed papers missing… but that’s not the whole of it…”<br>Holmes’s right eyebrow arched in that characteristic manner which bade his interlocutor continue with his narrative.<br>I detected the familiar sharpening of his gaze — the restless brilliance that signalled his faculties were already engaged.<br>“There is also,” Lestrade blurted out, “the small matter of several tons of gold bullion having vanished without trace!”<br>A cacophony of crashing crockery followed by a dull thud informed us that Mrs. Hudson had swooned away.</p><p>Suppressing a startled oath, I seized the decanter of brandy from our host’s hands without ceremony in order to hasten to the aid of our landlady in her state of syncope. Mindful that steadiness of hand is a prerequisite for any physician, I took the liberty of a swift restorative myself before attending to her pulse.<br>With Holmes’s assistance, we contrived to settle Mrs. Hudson upon the settee. Inspector Lestrade, for his part, remained immobile in his chair, a look of utter consternation upon his visage.<br>As I ascertained Mrs. Hudson’s pulse, I heard Holmes address Lestrade:<br>“Compose yourself, Inspector. Now — elucidate.”<br>“A ton of gold stolen from the Royal Bank of Scotland while my men and I were stationed both inside and out!” Lestrade exclaimed. Then, suddenly overcome with emotion, he continued, “Holmes, this will be the ruin of me! My reputation is in shreds — the Chief Inspector will demand my resignation over this catastrophe. There’s talk of anarchists and plots. Some are even whispering about traitors in the force! And what of Jenny…? They may well dismiss her as well over the disgrace — and our little Tommy, what will become of him? The workhouse, the factories, the mines… God help us.”</p><p>Holmes, unperturbed, decanted a generous measure of brandy and extended it with a hand as steady as though he were offering a biscuit.<br>At this juncture, Mrs. Hudson’s eyelids fluttered open. She straightened herself, made as if to rise, succeeding with my assistance, and then declared with the dignified air of one accustomed to maintaining decorum under all circumstances: “Gentlemen, no affair of gravity has ever reached a satisfactory conclusion on an empty stomach. I beseech you to do justice to my Irish Stew. I shall fetch an additional cover forthwith.”<br>“Two, if you please, Mrs. Hudson,” Holmes added absently, his gaze already distant. “I believe you too are in need of fortification after such a shock.”<br>“But… but… what of the confidential nature of the investigation, Mr. Holmes?” she asked, her Scottish brogue slightly more pronounced in her distress.<br>“I fear you have already been apprised of the most grievous aspects, Mrs. Hudson. Is that not so, Lestrade?”<br>Lestrade signified his assent with an inclination of his head. Though still visibly shaken, a modicum of colour was gradually returning to his cheeks.<br>“Moreover,” said Holmes, drawing thoughtfully upon his pipe, “you shall resume your account once we have dined. You must first replenish your strength.”</p><p>The repast concluded, Holmes dispensed to each of us a cup of the coffee recently prepared by Mrs. Hudson before she retired to her quarters, having wished the assembled company a pleasant evening and extended her sympathies to Inspector Lestrade.<br>Extracting tobacco from his singular snuffbox, which was naught but a well-worn leather Persian slipper, Holmes encouraged Lestrade to recommence the narration of his misfortunes.<br>“Three weeks ago, I was summoned to see Commissioner Llewelyn-Jones,” Lestrade began, his voice steadier after the meal.<br>I observed that at the mention of this aristocrat, notorious for his unbridled contempt for those he deemed subordinate, whom he regarded as mere menials, Holmes’s nostrils flared ever so slightly — the only outward sign of his distaste.<br>“This Llewelyn-Jones informed me that Sir Reginald Fitzpatrick — the head of the Royal Bank of Scotland — had sought assistance regarding thefts at his institution. Sir Reginald was convinced his staff were pilfering valuables, yet he could not fathom how they were passing undetected by the bank’s own detectives, who had been watching most carefully since the first items were reported missing.<br>“The poor man was nearly at his wit’s end,” Lestrade continued, shaking his head. “He began by suspecting the cashiers, then the accountants, then the night watchmen, and at last even the detectives themselves. Now he’s certain there’s some great conspiracy at work. Lately, he’s taken to carrying a pistol about the place, and has threatened his own employees more than once.<br>“So the Commissioner asked me to investigate the affair discreetly.<br>“Given that all the thefts were discovered in the morning, I judged it prudent to keep watch inside the vault at night, accompanied by two of my best men. I took Wilkins and Hobbes — excellent officers, both of them.<br>“For a week we maintained our vigil in that vault, night after night, without the slightest disturbance… until…”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b1473d703df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Golid — A Minimal Frontend Framework for Go Developers]]></title>
            <link>https://serge-hulne.medium.com/golid-a-minimal-frontend-framework-for-go-developers-e90bb3350bdd?source=rss-32ca07294e2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e90bb3350bdd</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[wasm]]></category>
            <dc:creator><![CDATA[Serge Hulne]]></dc:creator>
            <pubDate>Thu, 01 May 2025 09:45:24 GMT</pubDate>
            <atom:updated>2025-06-23T10:46:18.738Z</atom:updated>
            <content:encoded><![CDATA[<h3>Golid — A Minimal Frontend Framework for Go Developers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jbfDaj9X3iekivwtrshGpg.png" /></figure><p><em>What if building reactive web frontends didn’t require Node.js, npm, React, or JSX?</em></p><p>Meet <strong>Golid</strong>, a lightweight, idiomatic frontend framework written entirely in Go, compiled to WebAssembly.</p><h4><strong><em>Update 1<br>See also </em>SwiflyGo<em> for more functional variant</em>:</strong></h4><p><a href="https://medium.com/@serge-hulne/swiftlygo-declarative-webassembly-ui-in-pure-go-478103663b67"><strong>https://medium.com/@serge-hulne/swiftlygo-declarative-webassembly-ui-in-pure-go-478103663b67</strong></a></p><h4><strong><em>Update 2:<br>The the Golid code base has been modified.<br>There are new examples in the main.go file.</em></strong></h4><p>See also updated example hereunder in this article.</p><h3>💡 The Problem</h3><p>Modern frontend development often demands:</p><ul><li>A Node.js toolchain</li><li>JavaScript frameworks like React, Vue, or Solid</li><li>Transpilers, bundlers, linters, plugins, and loaders</li><li>HTML/CSS/JS separated from your backend logic</li></ul><p>Even for simple dashboards or admin tools, the setup cost is massive — especially for teams that primarily use <strong>Go</strong> on the backend.</p><h3>✅ The Golid Approach</h3><p><strong>Golid</strong> (short for <strong>Go + Solid</strong>) takes inspiration from <a href="https://solidjs.com/">Solid.js</a> but keeps things radically simple.</p><h3>What it offers:</h3><ul><li>🔁 <strong>Reactive components</strong> built with native Go types</li><li>💡 <strong>Signals</strong> for state and reactivity (no VDOM)</li><li>🧩 Components written with <a href="https://github.com/maragudk/gomponents">Gomponents</a> — a pure-Go HTML DSL</li><li>🪶 <strong>WebAssembly-based rendering</strong> — no JS needed</li><li>🛠️ TinyGo support for blazing-fast, small .wasm binaries</li></ul><h3>🔨 What Golid Does Not Use</h3><p>Let’s be clear — Golid is not your average frontend framework:</p><ul><li>❌ No Node.js</li><li>❌ No npm</li><li>❌ No bundler (Webpack, Parcel, etc.)</li><li>❌ No React, Vue, or JSX</li><li>❌ No VDOM</li><li>❌ No build pipeline beyond make wasm</li></ul><p>Just:</p><ul><li>✅ Go</li><li>✅ TinyGo (optional)</li></ul><h3>🧪 What Golid Code Looks Like</h3><p>A simple counter component looks like this</p><pre><br>func CounterComponent() Node {<br> // Observable (represents the state of the app)<br> count := golid.NewSignal(0)<br><br> return Div(<br>  Style(&quot;border: 1px solid orange; padding: 10px; margin: 10px;&quot;),<br><br>  // Bind text Element to the reactive count signal (observable)<br>  golid.Bind(func() Node {<br>   return Div(Text(fmt.Sprintf(&quot;Count = %d&quot;, count.Get())))<br>  }),<br><br>  // [+] Button element<br>  Button(<br>   Style(&quot;margin: 3px;&quot;),<br>   Text(&quot;+&quot;),<br>   golid.OnClick(func() {<br>    count.Set(count.Get() + 1)<br>   }),<br>  ),<br><br>  // [-] Button element<br>  Button(<br>   Style(&quot;margin: 3px;&quot;),<br>   Text(&quot;-&quot;),<br>   golid.OnClick(func() {<br>    count.Set(count.Get() - 1)<br>   }),<br>  ),<br> )<br>}</pre><p>You define your UI and logic in one place, using Go.<br>No macros. No templates. No transpilation.</p><h3>⚡ Why Use Golid?</h3><p>🧱 <strong>Simple</strong>Pure Go. No JS toolchain</p><p>🧠 <strong>Familiar</strong>Works like Solid.js or Svelte, but in Go</p><p>🔒 <strong>Predictable</strong>Explicit state, no magic</p><p>⚡ <strong>Fast</strong>Fine-grained reactivity, no virtual DOM</p><h3>Quick Start</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*XoPhnJiiFvnVi_MZqvtcsw.png" /></figure><h3>🌐 Try It Out</h3><p>You can check out the GitHub repo here:<br>👉 <a href="https://github.com/serge-hulne/Golid">https://github.com/serge-hulne/Golid</a></p><h3>🎯 The Vision</h3><p>Golid isn’t trying to replace React or Vue. It’s for people who love Go and want to build UI with:</p><ul><li>Less complexity</li><li>More clarity</li><li>Minimal setup</li></ul><p>As the framework matures, expect:</p><ul><li>More built-in components</li><li>Routing</li><li>Developer tools</li><li>More examples and docs</li></ul><h3>❤️ Open Source and Ready for Feedback</h3><p>Golid is licensed under GPL and open to contributions.<br>If you’re tired of 1000-dependency node_modules hell, give it a try.</p><p>👉 <a href="https://github.com/serge-hulne/Golid">github.com/serge-hulne/Golid</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e90bb3350bdd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unwrap for Go]]></title>
            <link>https://serge-hulne.medium.com/unwrap-for-go-6f25cd2ff7a6?source=rss-32ca07294e2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f25cd2ff7a6</guid>
            <dc:creator><![CDATA[Serge Hulne]]></dc:creator>
            <pubDate>Wed, 19 Mar 2025 13:29:49 GMT</pubDate>
            <atom:updated>2025-03-19T13:29:49.614Z</atom:updated>
            <content:encoded><![CDATA[<p>Unwrap for Go</p><p>Implementing a unwrap function in Go which emulates the corresponding Rust method can be done as follows:</p><pre>package unwrap<br><br>import (<br> &quot;errors&quot;<br>)<br><br>// UnwrapRaw simply returns the value or panics if there&#39;s an error.<br>func UnwrapRaw[T any](value T, err error) T {<br> if err != nil {<br>  panic(err)<br> }<br> return value<br>}<br><br>// Unwrap checks for nil values, but only for pointer types.<br>func Unwrap[T any](value T, err error) T {<br> if err != nil {<br>  panic(err)<br> }<br><br> // This avoids nil checking for non-pointer types<br> if isNil(value) {<br>  panic(errors.New(&quot;nil value returned&quot;))<br> }<br> return value<br>}<br><br>// isNil checks if a generic value is nil, but only for pointer or interface types.<br>func isNil[T any](value T) bool {<br> // Convert to interface{} before checking for nil<br> return (any(value) == nil)<br>}</pre><p>I put this code on Github. It can be used like this:</p><pre>package main<br><br>import (<br> . &quot;github.com/serge-hulne/go_unwrap&quot;<br> &quot;fmt&quot;<br> &quot;strconv&quot;<br>)<br><br>func main() {<br> fmt.Printf(&quot;Result = %v\n&quot;, Unwrap(strconv.Atoi(&quot;2&quot;))*Unwrap(strconv.Atoi(&quot;3&quot;)))<br> fmt.Printf(&quot;Result = %v\n&quot;, strconv.Itoa(Unwrap(strconv.Atoi(&quot;42&quot;))))<br>}</pre><p>The repositery is located at: <br><a href="https://github.com/serge-hulne/go_unwrap/tree/main">https://github.com/serge-hulne/go_unwrap/tree/main</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f25cd2ff7a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ngiu, GUI (graphical use interface) library for Go, borrowing from SwiftUI, Compose and Flutter.]]></title>
            <link>https://serge-hulne.medium.com/ngiu-a-swiftui-inspired-gui-library-for-go-based-on-giu-ebc42323adbc?source=rss-32ca07294e2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebc42323adbc</guid>
            <dc:creator><![CDATA[Serge Hulne]]></dc:creator>
            <pubDate>Fri, 15 Nov 2024 11:15:38 GMT</pubDate>
            <atom:updated>2024-11-16T09:03:46.031Z</atom:updated>
            <content:encoded><![CDATA[<h4>Goal</h4><p>My goal was to build a GUI which is:</p><ul><li>Portable (muti-platform).</li><li>Simple.</li><li>Minimalist.</li><li>Self-explanatory.</li><li>In which the state of the app is trivial to code (simple variables as in Svelte).</li></ul><h4>About ngiu</h4><p>After studying, Flutter, SwiftUI and JetPack Compose, I set out to create my own library for coding GUIs for desktop apps.</p><p>The complete code of the the library (Go packge) plus an example (in the README) is available on GitHub: <a href="https://github.com/serge-hulne/ngiu">https://github.com/serge-hulne/ngiu</a></p><p>ngiu extends giu (github.com/AllenDang/giu) and brings SwiftUI-like coding style to giu.</p><h4>Why the name ngiu ?</h4><p>ngiu stands for &quot;new giu&quot;, (just like ncurses stands for new curses).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*CaoEocEvkexwcHqjP_7l2Q.png" /><figcaption>Example.</figcaption></figure><pre>func main() {<br> wnd := giu.NewMasterWindow(&quot;Password encrypted wallet&quot;, 600, 400, 0)<br> wnd.Run(loop)<br>}<br><br>func loop() {<br> giu.SingleWindow().Layout(<br>  VStack(<br>   giu.Label(&quot;Enter a new service / password combination&quot;),<br><br>   // Main widget<br>   NewWidget(formData.FormDataLayout()).<br>    PaddingTop(10).<br>    PaddingLeft(50),<br><br>   // Flexible spacer to push items below it to the bottom<br>   giu.Custom(func() {<br>    _, height := giu.GetAvailableRegion()<br>    giu.Dummy(0, height-30).Build() // Adjust height to control space<br>   }),<br><br>   // Status label at the bottom<br>   NewWidget(giu.Label(&quot;Status: OK&quot;)).<br>    BackgroundColor(NewColorByName(ColorNames.Basic.Blue)).<br>    ForegroundColor(NewColorByName(ColorNames.Vivid.Lime)).<br>    FontWeight(&quot;bold&quot;).<br>    PaddingTop(10),<br>  ),<br> )<br>}</pre><p>With ngiu, you can add padding in a fashion similar to SwiftUI:</p><pre>NewWidget(formData.FormDataLayout()).<br>    PaddingTop(10).<br>    PaddingLeft(50),</pre><p>Also ngiu allows you to manage a widget&#39;s colour as in SwiftUI</p><pre>NewWidget(giu.Label(&quot;Status: OK&quot;)).<br>    BackgroundColor(NewColorByName(ColorNames.Basic.Blue)).<br>    ForegroundColor(NewColorByName(ColorNames.Vivid.Lime)).<br>    FontWeight(&quot;bold&quot;).<br>    PaddingTop(10),</pre><p>This is made possible by the use of ngiu&#39; widget which extends giu&#39;s Layout type, providing an expressive SwiftUI-like coding style:</p><pre>// Constructor for creating a CustomWidget<br>func NewWidget(w giu.Widget) *Widget {<br> return &amp;Widget{w}<br>}</pre><p>This way of structuring the code helps developers in that layout and styling benefit from auto-completion (also, it looks more familiar to a SwiftUI developer or a JetPack Compose or Flutter developer) :</p><h4><strong>Layout code auto-complete:</strong></h4><figure><img alt="Layout code auto-complete." src="https://cdn-images-1.medium.com/max/866/1*SUqMe99qFN2IEMVGCnsz1w.png" /></figure><h4><strong>Styling code auto-complete:</strong></h4><figure><img alt="Styling code auto-complete." src="https://cdn-images-1.medium.com/max/838/1*p5VNYV2isXZ_pc9XKdiYSw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebc42323adbc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Coding a simple text editor in Go (using Giu) : Quick and dirty.]]></title>
            <link>https://serge-hulne.medium.com/coding-a-simple-text-editor-in-go-using-giu-quick-and-dirty-b9b97ab41e4a?source=rss-32ca07294e2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9b97ab41e4a</guid>
            <category><![CDATA[gui]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[giu]]></category>
            <dc:creator><![CDATA[Serge Hulne]]></dc:creator>
            <pubDate>Sat, 02 Nov 2024 14:07:53 GMT</pubDate>
            <atom:updated>2024-11-07T06:09:59.027Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Coding a simple text editor in Go (using Giu) the easy way.</strong></p><p>The comple code of the app is available here:<br><a href="https://github.com/serge-hulne/giu-editor">https://github.com/serge-hulne/giu-editor</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*VpbpmbfomWtok973SLLuJw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*YtqeR6eyjvkF4jxlIJl22w.png" /></figure><ol><li>Using giu, the GUI of a simple text editor can be as simple as:</li></ol><pre>//*******************<br>// App visual layout :<br>//*******************<br><br>func Body() g.Widget {<br> X, Y := wnd.GetSize()<br> return g.Layout{<br>  g.Column(<br>   g.InputTextMultiline(&amp;text).Size(float32(X-50), float32(Y-70)),<br>   g.Label(&quot;Status : &quot;+status),<br>  ),<br> }<br>}</pre><p>2. The corresponding menu can be as simple to code as:</p><pre>{<br>  &quot;menus&quot;: [<br>    {<br>      &quot;label&quot;: &quot;File&quot;,<br>      &quot;submenus&quot;: [<br>        { &quot;label&quot;: &quot;Open&quot;, &quot;action&quot;: &quot;OpenFile&quot; },<br>        { &quot;label&quot;: &quot;Save&quot;, &quot;action&quot;: &quot;SaveFile&quot; },<br>        { &quot;label&quot;: &quot;Save as&quot;, &quot;action&quot;: &quot;SaveFileAs&quot; },<br>        { &quot;Label&quot;: &quot;Quit&quot;, &quot;Action&quot;: &quot;quit&quot;}<br>      ]<br>    },<br>    {<br>      &quot;label&quot;: &quot;Help&quot;,<br>      &quot;submenus&quot;: [<br>        { &quot;label&quot;: &quot;About&quot;, &quot;action&quot;: &quot;About&quot; }<br>      ]<br>    }<br>  ]<br>}</pre><p>3. Defining he state of the app can be as simple as declaring a few global vars:</p><pre>//-----------------------------------------<br><br>//************<br>// App state :<br>//************<br><br>var text string<br>var filePath string<br>var AboutText string<br>var SizeX int = 800<br>var SizeY int = 600<br>var wnd *g.MasterWindow<br>var status string = &quot;OK.&quot;<br><br>//-----------------------------------------</pre><p>4. Each meu item needs a corresponding action, in the shape of a method:</p><pre>//**************<br>// Save File :<br>//**************<br><br>func SaveFile() {<br> // Check if filePath is set<br> if filePath == &quot;&quot; {<br>  log.Println(&quot;No file path specified. Use &#39;Save As&#39; to specify a file name.&quot;)<br>  return<br> }<br><br> fmt.Println(&quot;Saving file:&quot;, filePath)<br> f, err := os.Create(filePath)<br> if err != nil {<br>  log.Println(&quot;Failed to create file:&quot;, err)<br>  status = fmt.Sprintf(&quot;Failed to create file: %s&quot;, err)<br>  return<br> }<br><br> _, err = f.WriteString(text)<br> if err != nil {<br>  log.Println(&quot;Failed to write to file:&quot;, err)<br>  status = fmt.Sprintf(&quot;Failed to write to file: %s&quot;, err)<br>  f.Close()<br>  return<br> }<br><br> err = f.Close()<br> if err != nil {<br>  log.Println(&quot;Failed to close file:&quot;, err)<br>  status = fmt.Sprintf(&quot;Failed to close file: %s&quot;, err)<br> }<br> fmt.Println(&quot;File saved successfully!&quot;)<br> status = &quot;File saved successfully!&quot;<br>}</pre><p>The management of the menu can be abstracted away (once and for all) in its own file or package:</p><pre>package main<br><br>import (<br> &quot;encoding/json&quot;<br> &quot;log&quot;<br><br> _ &quot;embed&quot;<br><br> g &quot;github.com/AllenDang/giu&quot;<br>)<br><br>// Define structs to represent the menu and submenu structure<br>type SubmenuItem struct {<br> Label  string `json:&quot;label&quot;`<br> Action string `json:&quot;action&quot;`<br>}<br><br>type MenuItem struct {<br> Label    string        `json:&quot;label&quot;`<br> Submenus []SubmenuItem `json:&quot;submenus&quot;`<br>}<br><br>type MenuData struct {<br> Menus []MenuItem `json:&quot;menus&quot;`<br>}<br><br>// Actions for submenu items<br>func submenuAction(actionName string) func() {<br> return func() {<br>  ActionMap[actionName]()<br>  menu_choice = 0<br>  g.Update()<br> }<br>}<br><br>var menuData MenuData<br>var menu_choice = 0<br>var showAboutPopup bool // State variable to control the &quot;About&quot; popup<br><br>//go:embed menu.json<br>var menuJSON []byte<br><br>func loadMenu() {<br> // Parse the embedded JSON file<br> err := json.Unmarshal(menuJSON, &amp;menuData)<br> if err != nil {<br>  log.Fatalf(&quot;Failed to parse JSON: %v&quot;, err)<br> }<br>}<br><br>func loop() {<br> // Create a slice for main menu buttons<br> var mainMenuItems []g.Widget<br> for idx, menu := range menuData.Menus {<br>  // Capture index and label for each main menu button<br>  i := idx<br>  label := menu.Label<br><br>  // Append an asterisk to the label of the selected menu item<br>  if menu_choice == i+1 {<br>   label = &quot;&lt;&quot; + label + &quot;&gt;&quot;<br>  }<br><br>  // Create the button for the menu item<br>  mainMenuItems = append(mainMenuItems, g.Button(label).OnClick(func() {<br>   menu_choice = i + 1<br>   g.Update() // Force redraw of the UI when menu changes<br>  }))<br> }<br><br> // Layout for the main menus (horizontal)<br> g.SingleWindow().Layout(<br>  g.Row(mainMenuItems...),<br>  g.Separator(),<br>  g.Row(<br>   g.Column(<br>    // Layout for submenus (vertical)<br>    func() g.Widget {<br>     if menu_choice &gt; 0 &amp;&amp; menu_choice &lt;= len(menuData.Menus) {<br>      submenu := menuData.Menus[menu_choice-1].Submenus<br>      var submenuWidgets []g.Widget<br>      for _, sub := range submenu {<br>       // Add each submenu button and its associated action<br>       submenuWidgets = append(submenuWidgets, g.Button(sub.Label).OnClick(submenuAction(sub.Action)))<br>      }<br>      return g.Column(submenuWidgets...)<br>     }<br>     return g.Label(&quot;&quot;)<br>    }()),<br>   g.Column(Body())),<br> )<br><br> // Check if we should open the &quot;About&quot; popup<br> if showAboutPopup {<br>  showAboutPopup = false // Reset the flag<br>  g.OpenPopup(&quot;About&quot;)<br>  g.Update()<br> }<br><br> // Define the &quot;About&quot; popup modal<br> g.PopupModal(&quot;About&quot;).Layout(<br>  g.Label(AboutText),<br>  g.Button(&quot;Close&quot;).OnClick(func() {<br>   g.CloseCurrentPopup() // Close the popup when &quot;Close&quot; is clicked<br>  }),<br> ).Build() // Ensure Build is called on the PopupModal<br>}</pre><p>Last but not least, the actions have to be connected to the menu entries:</p><pre>package main<br><br>// Auto-generated action map<br>var ActionMap = map[string]func(){<br> &quot;OpenFile&quot;: OpenFile,<br> &quot;SaveFile&quot;: SaveFile,<br> &quot;SaveFileAs&quot;: SaveFileAs,<br> &quot;quit&quot;: quit,<br> &quot;About&quot;: About,<br>}</pre><p>And this &quot;registering&quot; of menu actions, can be automated with an other Go app, as simply as in :</p><pre>package main<br><br>import (<br> &quot;encoding/json&quot;<br> &quot;fmt&quot;<br> &quot;io/ioutil&quot;<br> &quot;log&quot;<br> &quot;os&quot;<br>)<br><br>// Define structs to parse the menu.json file<br>type SubmenuItem struct {<br> Label  string `json:&quot;label&quot;`<br> Action string `json:&quot;action&quot;`<br>}<br><br>type MenuItem struct {<br> Label    string        `json:&quot;label&quot;`<br> Submenus []SubmenuItem `json:&quot;submenus&quot;`<br>}<br><br>type MenuData struct {<br> Menus []MenuItem `json:&quot;menus&quot;`<br>}<br><br>// Function to generate action_map.go<br>func main() {<br> // Read menu.json<br> menuJSON, err := ioutil.ReadFile(&quot;menu.json&quot;)<br> if err != nil {<br>  log.Fatalf(&quot;Failed to read menu.json: %v&quot;, err)<br> }<br><br> // Parse JSON into MenuData<br> var menuData MenuData<br> err = json.Unmarshal(menuJSON, &amp;menuData)<br> if err != nil {<br>  log.Fatalf(&quot;Failed to parse JSON: %v&quot;, err)<br> }<br><br> // Create or overwrite action_map.go<br> file, err := os.Create(&quot;action_map.go&quot;)<br> if err != nil {<br>  log.Fatalf(&quot;Failed to create action_map.go: %v&quot;, err)<br> }<br> defer file.Close()<br><br> // Write the package declaration and imports<br> fmt.Fprintln(file, &quot;package main\n&quot;)<br> fmt.Fprintln(file, &quot;// Auto-generated action map&quot;)<br> fmt.Fprintln(file, &quot;var ActionMap = map[string]func(){&quot;)<br><br> // Collect unique action names and generate the map entries<br> actionSet := make(map[string]bool)<br> for _, menu := range menuData.Menus {<br>  for _, submenu := range menu.Submenus {<br>   if _, exists := actionSet[submenu.Action]; !exists {<br>    actionSet[submenu.Action] = true<br>    fmt.Fprintf(file, &quot;\t\&quot;%s\&quot;: %s,\n&quot;, submenu.Action, submenu.Action)<br>   }<br>  }<br> }<br><br> // Close the map<br> fmt.Fprintln(file, &quot;}&quot;)<br><br> fmt.Println(&quot;action_map.go generated successfully!&quot;)<br>}</pre><p><strong>Conclusion :</strong></p><p>When coding a simple app this way, only steps 1–4 are required. The rest of the code (the menu code utils) can be downloaded from:</p><p><a href="https://github.com/serge-hulne/giu-editor">https://github.com/serge-hulne/giu-editor</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9b97ab41e4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Consciousness hypothesis (draft)]]></title>
            <link>https://serge-hulne.medium.com/consciousness-hypothesis-draft-84ca1d4a405f?source=rss-32ca07294e2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/84ca1d4a405f</guid>
            <category><![CDATA[philosophy]]></category>
            <category><![CDATA[neuroscience]]></category>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[mindfulness]]></category>
            <dc:creator><![CDATA[Serge Hulne]]></dc:creator>
            <pubDate>Thu, 04 Jul 2024 07:43:58 GMT</pubDate>
            <atom:updated>2026-07-05T06:03:41.718Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*9zT-YRZ2Z4gCCv2U4sImdA@2x.jpeg" /></figure><p>This is a short, informal draft about a hypothesis of mine regarding the nature of consciousness. It is philosophical, speculative, intuitive. It is not supposed to be rigorous, hard science at all at this stage.</p><p>it is highly speculative and subject to change.</p><p>My aim is to attempt to write a series of essays in which I will try to develop progressively a sort of logical, formal, axiomatic approach to questions like :</p><ul><li>Can we logically, axiomatically, mathematically define consciousness?</li><li>How does it work, what causes it?</li><li>Is consciousness physical? biological? material? or something else?</li><li>Is consciousness some kind of an abstraction which could occur in a non-biological systems (computers, AI, cosmological objects) regardless of of the actual underlying physical substrate?</li><li>Does the way we understand consciousness influence our actions, moral systems, philosophy, politics?</li><li>Does it influence the way we distinguish between human beings and animals and by extension, the way we distinguish between man and nature?</li></ul><p>Another aspect of this planned series of essays about consciousness is to have a look at the panorama of contemporary theories about consciousness, such as books by Sir Roger Roger Penrose “The shadows of the mind”, Daniel Dennett Consciousness explained”, the works of Donald Hoffman, David Chalmers, Robert Lawrence Kuhn and many more and to try to get the gist of it.</p><p>Conversely, another aim of that series of novels is debunking theories which are purely speculative or simply misleading.</p><p>A first aspect of my hypothesis is as follows: The difference between an automaton, or a “philosophical zombie” (in the sense of David Chalmers), on the one hand, and consciousness, on the other hand, is that an automaton is a “system which processes information”, whereas consciousness is (a formal system wherein) “information processes information” (in a recursive, fractal manner).</p><p>In other words, a first aspect of my hypothesis is that consciousness is “software running on software”.</p><p>To put it another way, this hypothesis postulates that consciousness emerges when a system (a collection of hardware, neurons, etc.) is at the same time the software and the hardware and when said system is capable of producing a self-referential (recursive/fractal) representation of itself), together with the representation (based on sensory input), it builds from the outside world.</p><p>To put it yet another way, consciousness is “very deep feedback”, essentially, infinitely deep feedback (fractal-like feedback).</p><p>To put it yet another way, consciousness -as such- does not exist; it is more like a placeholder for “consciousness of consciousness of consciousness…” It is a mechanism, a process, not an object.</p><p>The fractal nature of consciousness (if my hypothesis has any merit) explains the algebraic/combinatory nature of consciousness:</p><p>- a conscious system split in two, results in two consciousnesses (https://youtu.be/0qa_bHMtDcc?si=TVFFvWCJJGIpszy1)</p><p>- conversely, a collection of conscious systems connected to each other or exchanging information, results automatically in a higher-order consciousness (like an ant colony or any society, for that matter).</p><p>If this hypothesis is correct to some extent , Donald Hoffman’s conjecture about conscious agents is likely both right and wrong. It is correct because conscious agents exist and can be combined into higher-order states of consciousness, but it is wrong in that said conscious agents are purely virtual (not primitives), they exist only within the confines of a self-referential formal system, which has the property of building a representation of itself.</p><p>I wouldn’t just reduce consciousness to awareness; I would reduce it further, to a mere potential for awareness (a precursor of awareness , a prerequisite of sorts). I agree that consciousness is often mistaken for higher-order manifestations of the mind, such as memory, cognition, or emotions.</p><p>To put it another way: awareness of consciousness is a mechanism, but consciousness itself might not be one. From that point of view, materialism and idealism might just be pointless semantics, meaningless categories. On the other hand, if we can only ever experience awareness of thought processes — awareness of consciousness — then perhaps consciousness is just a construct of the mind: an extrapolation, a virtual, perhaps even imaginary, construct.</p><p>[Ref 1] Fractals structures in the brain:</p><p>https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3059969/</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84ca1d4a405f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>