iarticle-tgtimes-Embedded-Forth-Programming.mw - tgtimes - The Gopher Times Err bitreich.org 70 hgit clone git://bitreich.org/tgtimes git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/tgtimes URL:git://bitreich.org/tgtimes git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/tgtimes bitreich.org 70 1Log /scm/tgtimes/log.gph bitreich.org 70 1Files /scm/tgtimes/files.gph bitreich.org 70 1Refs /scm/tgtimes/refs.gph bitreich.org 70 1Tags /scm/tgtimes/tag bitreich.org 70 1README /scm/tgtimes/file/README.md.gph bitreich.org 70 i--- Err bitreich.org 70 iarticle-tgtimes-Embedded-Forth-Programming.mw (5994B) Err bitreich.org 70 i--- Err bitreich.org 70 i 1 .SH tgtimes Err bitreich.org 70 i 2 Embedded Forth Programming Err bitreich.org 70 i 3 .2C 10v Err bitreich.org 70 i 4 . Err bitreich.org 70 i 5 .PP Err bitreich.org 70 i 6 Big computers can run large and complex programming languages, Err bitreich.org 70 i 7 so what can small computer run? Err bitreich.org 70 i 8 . Err bitreich.org 70 i 9 .PP Err bitreich.org 70 i 10 Compiled languages, in particular those with a small runtime are often chosen. Err bitreich.org 70 i 11 But the interpreted languages also have an audience willing to code with their favorite programming environment for them. Err bitreich.org 70 i 12 Programming languages as big as Python have their embedded counterpart (MicroPython) thanks to significant efforts. Err bitreich.org 70 i 13 They serve their purpose to embedded enthusiasts as educational and scripting languages to many. Err bitreich.org 70 i 14 . Err bitreich.org 70 i 15 .PP Err bitreich.org 70 i 16 But small "language in a nutshell" are fitting right the small resources of microcontrollers. Err bitreich.org 70 i 17 This is the case of Forth and its stack-machine approach. Err bitreich.org 70 i 18 . Err bitreich.org 70 i 19 .1C Err bitreich.org 70 i 20 . Err bitreich.org 70 i 21 .IP Mecrisp Forth - http://mecrisp.sourceforge.net/ Err bitreich.org 70 i 22 This implementation immediately targets microcontrollers. Err bitreich.org 70 i 23 See for instance the work of librehacker.com author Christopher Howard. Err bitreich.org 70 i 24 .FS Err bitreich.org 70 i 25 gemini://gem.librehacker.com/gemlog/tech/20220331-0.gmi Err bitreich.org 70 i 26 gemini://gem.librehacker.com/gemlog/tech/20220305-0.gmi Err bitreich.org 70 i 27 .FE Err bitreich.org 70 i 28 . Err bitreich.org 70 i 29 .IP chipFORTH Err bitreich.org 70 i 30 Another implementation of Forth, which were used by NASA Err bitreich.org 70 i 31 .FS Err bitreich.org 70 i 32 https://www.forth.com/space-shuttle-instrumentation-interface/ Err bitreich.org 70 i 33 .FE Err bitreich.org 70 i 34 for improving reliability of its flight control system, Err bitreich.org 70 i 35 among the mosts critical pieces of software of a shuttle. Err bitreich.org 70 i 36 . Err bitreich.org 70 i 37 .IP https://github.com/corecode/forth Err bitreich.org 70 i 38 Among notable Forth projects is Simon "corecode" Schubert's nimble forth implementation Err bitreich.org 70 i 39 as well as hardware code describing the working of a CPU that executes Forth natively Err bitreich.org 70 i 40 .FS Err bitreich.org 70 i 41 https://github.com/corecode/forth-cpu Err bitreich.org 70 i 42 .FE Err bitreich.org 70 i 43 . Err bitreich.org 70 i 44 .IP https://forth.chat/ Err bitreich.org 70 i 45 If feeling like having a taste of Forth and Forth community, there are several channels Err bitreich.org 70 i 46 featuring forth that you could enjoy, Err bitreich.org 70 i 47 some of which are oriented toward hardware projects directly Err bitreich.org 70 i 48 .FS Err bitreich.org 70 i 49 ircs://irc.hackint.org/#forth-hardware-projects Err bitreich.org 70 i 50 .FE. Err bitreich.org 70 i 51 . Err bitreich.org 70 i 52 .IP https://github.com/chmykh/apl-life Err bitreich.org 70 i 53 This is Conway Game of Life in APL in Forth Err bitreich.org 70 i 54 What a long chain! It is APL programming language implemented in Forth, Err bitreich.org 70 i 55 and Conway game of life implemented in APL Err bitreich.org 70 i 56 . Err bitreich.org 70 i 57 .IP https://github.com/remko/waforth Err bitreich.org 70 i 58 Feeling like pushing the irony of "Web" assembly even further? Err bitreich.org 70 i 59 Why not blasting a Forth implementation at it? Err bitreich.org 70 i 60 .FS Err bitreich.org 70 i 61 https://el-tramo.be/waforth/ Err bitreich.org 70 i 62 https://el-tramo.be/thurtle/ Err bitreich.org 70 i 63 .FE Err bitreich.org 70 i 64 This proves Forth as the new programming language \fIen vogue\fR Err bitreich.org 70 i 65 . Err bitreich.org 70 i 66 .IP http://collapseos.org/ Err bitreich.org 70 i 67 What else does a programming language need to prove itself useful? Err bitreich.org 70 i 68 A kernel? Check! Err bitreich.org 70 i 69 Collapse OS Err bitreich.org 70 i 70 is an operating system targetting resilience beyond extreme, Err bitreich.org 70 i 71 as it is designed to resist everything around it tearing apart, Err bitreich.org 70 i 72 including the whole civilisation. Err bitreich.org 70 i 73 When nothing remains but wastelands, Err bitreich.org 70 i 74 CollapseOS will be there for a rebirth of civilisation out of computers made from scavenged parts. Err bitreich.org 70 i 75 Civilisation is rising and falling all of the time, just not all parts at the same time. Err bitreich.org 70 i 76 . Err bitreich.org 70 i 77 .QP Err bitreich.org 70 i 78 Forth is, to my knowledge, the most compact language allowing high level constructs. -- Collapse OS author. Err bitreich.org 70 i 79 . Err bitreich.org 70 i 80 .IP "gopher://retroforth.org/ https://retroforth.org/" Err bitreich.org 70 i 81 A forth implemented in C, Python, C#, Nim, JavaScript and Pascal! Err bitreich.org 70 i 82 The C version permits to embed the script into a binary along with the interpreter, Err bitreich.org 70 i 83 for a single-binary deployment process. Err bitreich.org 70 i 84 The more classic way to use it is to use shebangs scripts to have executable scripts. Err bitreich.org 70 i 85 . Err bitreich.org 70 i 86 .PP Err bitreich.org 70 i 87 Many smaller utilities can already provide something you needed: Err bitreich.org 70 i 88 . Err bitreich.org 70 i 89 .IP http://retroforth.org/examples/Casket-HTTP.retro.html Err bitreich.org 70 i 90 An HTTP server Err bitreich.org 70 i 91 . Err bitreich.org 70 i 92 .IP http://retroforth.org/examples/Atua-WWW.retro.html Err bitreich.org 70 i 93 A Gopher to HTTP+HTML Proxy on top of Atua. Err bitreich.org 70 i 94 . Err bitreich.org 70 i 95 .IP http://retroforth.org/examples/Atua.retro.html Gopher server Err bitreich.org 70 i 96 A gopher server, already listed on the Gopher index of links, the Gopher Lawn Err bitreich.org 70 i 97 .FS Err bitreich.org 70 i 98 bitreich.org/1/lawn/c/gopher.gph Err bitreich.org 70 i 99 .FE Err bitreich.org 70 i 100 . Err bitreich.org 70 i 101 .IP http://retroforth.org/examples/7080.retro.html Err bitreich.org 70 i 102 A s Err bitreich.org 70 i 103 . Err bitreich.org 70 i 104 .IP https://gitlab.com/goblinrieur/spreedsheet/ Err bitreich.org 70 i 105 A spreadsheet application in the terminal. Err bitreich.org 70 i 106 . Err bitreich.org 70 i 107 .IP gopher://forth.works:100 http://forthworks.com/ Err bitreich.org 70 i 108 This is a collection of code blocks written in the Retro Forth's author (crc) newest Forth implementation. Err bitreich.org 70 i 109 It is itself served by a gopher server (blocks 203-205 on the list above) in Forth. Err bitreich.org 70 i 110 . Err bitreich.org 70 i 111 .IP https://github.com/oriontransfer/pl0-language-tools Err bitreich.org 70 i 112 A PL/0 implementation in Python that can emmit Retro Forth code as ouput. Err bitreich.org 70 i 113 It looks like Forth simplicity, portability, stability and speed of execution made it a good candidate as a target language. Err bitreich.org 70 i 114 The PL/0 language is known for the book \fIAlgorithms + Data Structures = Programs\fR Err bitreich.org 70 i 115 from Niklaus Wirth, himself famous for the Wirth Law: Err bitreich.org 70 i 116 . Err bitreich.org 70 i 117 .QP Err bitreich.org 70 i 118 The hope is that the progress in hardware will cure all software ills. Err bitreich.org 70 i 119 However, a critical observer may observe that software manages to outgrow hardware in size and sluggishness. Err bitreich.org 70 i 120 -- https://en.wikipedia.org/wiki/Wirth's_law Err bitreich.org 70 i 121 . Err bitreich.org 70 i 122 .IP https://ribccs.com/candy/ Err bitreich.org 70 i 123 If you were doubting about Forth being fit for the industry, bear in mind that the above is Err bitreich.org 70 i 124 a very-large scale VFX Forth project with over a million lines of code! Err bitreich.org 70 i 125 . Err bitreich.org 70 i 126 .IP http://sam-falvo.github.io/kestrel/2016/03/29/vibe-2.2 Err bitreich.org 70 i 127 Why not spin a vi-like text editor itself in forth? Err bitreich.org 70 i 128 See how few code it takes to implement one. Err bitreich.org 70 i 129 . Err bitreich.org 70 i 130 .IP https://git.sr.ht/~vertigo/shoehorn Err bitreich.org 70 i 131 An answer to the bootstrapping problem: how to get from no software to a complete system? Err bitreich.org 70 i 132 Which compiler compiles the first compiler? Err bitreich.org 70 i 133 Forth's simplicity is a good candidate for solving this problem. Err bitreich.org 70 i 134 . Err bitreich.org 70 i 135 .IP https://git.sr.ht/~vertigo/forthbox Err bitreich.org 70 i 136 Software environment for computers to base upon right after booting: Err bitreich.org 70 i 137 a system shell in forth with real hardware projects dedicated to it. Err bitreich.org 70 i 138 Think of a LISP machine, but instead being a Forth machine. Err bitreich.org 70 i 139 . Err bitreich.org 70 i 140 .IP http://deathroadtocanada.com/ Err bitreich.org 70 i 141 This video-game uses Forth as a scripting language. Err bitreich.org 70 i 142 When a whole scripting language fits on a thumb, putting it everywhere costs nothing! Err bitreich.org 70 i 143 . Err bitreich.org 70 i 144 .2C 4v Err bitreich.org 70 i 145 . Err bitreich.org 70 i 146 .PP Err bitreich.org 70 i 147 Such a large tool chest for such a small language. Err bitreich.org 70 i 148 With the Covid, Wars under disguise, and other supply chain troubles, Err bitreich.org 70 i 149 the demand of feature stability rises face to the traditionnal "more features". Err bitreich.org 70 i 150 In these trying times, anyone is welcome to go Forth. Err bitreich.org 70 .