<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: feeley</title><link>https://news.ycombinator.com/user?id=feeley</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Sat, 20 Jun 2026 02:53:42 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=feeley" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by feeley in "To study how chips work, MIT researchers built their own operating system"]]></title><description><![CDATA[
<p>I'm really excited about this work, although I haven't read the code or paper yet. It seems to me Fractal would be ideal for running benchmarks for compilers so that the OS-induced noise is kept to a minimum.<p>Author: do you see issues with that use case?</p>
]]></description><pubDate>Fri, 19 Jun 2026 08:02:01 +0000</pubDate><link>https://news.ycombinator.com/item?id=48596059</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=48596059</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48596059</guid></item><item><title><![CDATA[New comment by feeley in "Web Embeddable Common Lisp"]]></title><description><![CDATA[
<p>Related:<p>The Gambit Scheme REPL that comes with a tutorial, supports threads in the browser and has a JS FFI: <a href="https://try.gambitscheme.org" rel="nofollow">https://try.gambitscheme.org</a><p>Gambit in emacs in the browser: <a href="https://feeley.github.io/gambit-in-emacs-in-the-browser/" rel="nofollow">https://feeley.github.io/gambit-in-emacs-in-the-browser/</a></p>
]]></description><pubDate>Wed, 25 Jun 2025 21:46:09 +0000</pubDate><link>https://news.ycombinator.com/item?id=44382101</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=44382101</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=44382101</guid></item><item><title><![CDATA[New comment by feeley in "Scrappy - make little apps for you and your friends"]]></title><description><![CDATA[
<p>An alternative to Scrappy is the free CodeBoot web app (<a href="https://codeboot.org" rel="nofollow">https://codeboot.org</a>), which allows you to create web apps in Python that are fully encapsulated in a URL. No installation is required—neither for the developer nor the user. Below is an example of a math practice app with simple user interaction through dialogs. To create a web app URL, right-click the "play" button and choose the type of link you want to generate.<p><a href="https://app.codeboot.org/5.3.1/?init=.fbWF0aF9wcmFjdGljZS5weQ==~XQAAgACHAwAAAAAAAAAzHIoib6qqLFJ_xaFdldRPILGcLuHBL4hAwh22DGarMgBOVDH8Qf77xQIryBTJV3oeXtaMrqQj0BDENpgOeYsgR6p_pIzVMpBryov0dQXOnbb_E6e4XKYJ5bCpVNQYJ8TYSL_KYWTy0HehJrXFWnRjw84tG7f_KmS9Wq4E5xF37jFMUbBI4ac-ZGvr_AcZGtgdFjY3MXlZ685OBMIHiurw090-o5VsqnmxpkgFRrMWjy7o2xPi7NUH7CnueCFX-SvsXL9sQDGG9WwJRTzG5lzIt1WOvb9QWozipT_Lwz8odMuO-vFg8CJkudzOcGMdhKY4A437-dorv8zPh7YIX-mUeqf3FEVeXRXqdH9upbPgtTXaPkT3pWGTcGPZHv7r5bokYGpEkL7cNeyKGHGPKERiy5lUHvYk1Nnw1eVhvBWGSbxPvweiRon94-0-PClaP0iOBpjtXxOJkAQeZM4wPEzv0rBiW3_hD50i28g9VN3O6rBqmnymHKDYkWBMBAwoxJG1QHRt87A52DLo0NczktU2X0MMRM3TgFXschQflfsRf1ErmBEHGYPl9OnAtXHF6Ff9QN93.~lang=py-novice.~hidden=true.e" rel="nofollow">https://app.codeboot.org/5.3.1/?init=.fbWF0aF9wcmFjdGljZS5we...</a><p>For more complex UIs, CodeBoot provides an FFI for accessing the DOM directly from Python code. For example here is a dice throwing app with a button to roll the dice again. The text in the button has translations to multiple languages and will adjust to the browser's default.<p><a href="https://app.codeboot.org/5.3.1/?init=.fZGljZS5weQ==~XQAAgADqBQAAAAAAAAARiAcIgVlWj7jS6sYVLZtrrl4JB_3o9hH7W_FNfjGEfCi1pI7PRujU0bNIqnPUt4tnqyi0vxNkmJYx9Ng8hD7Hq69KpZLR0ZjOA4fnqjC_po-cjiaq_WNugg7xZYF9LzTJn-rLJcfu_uxLBRnkM23wOAh74BkxMQO6D04aisAbgZY3adUzQ_mI6ZyjTNZIGtslUv1Mj5W96xvnaPXhzbukw_4MKThRo6HRvY1wZho6LKtRy4iBYcGN-KtWVEimM02DCq9RkbtDa1tew2hstbIIYB0uJgSCSYNP9vH9cu0XxV-B01mqGhCuMl6L0avTcNn67MsHIPFa8jkgXiHJYYA6vUmdxQIu6AVSbAbln-YObXstpu3LpOwyo7VcUnlGH_3y7xAMHgMlz8aJf6VI0LKZhrOs33x6ExDxHXqZHB-zQbaTDOaQbJxfFZTRppDZbGBxuxslQI9E3DMmlLpQ3h7Y2Fa2vNEh2xYL46jvzXoBLjNFU0DNcEfPW-fmK2qqS7xqO_YeipL8stLzawNlwzbEgagjhTwaILWIiD4MFn748l_pUzMUecqCHSx4bTeMlVTQqp8WP1pldydThr15kg1tunEDojhwUWygL63Czk6wa_rvyB6jYxkYmI2eKTaBMF0wFGVAVSLYBGxdRa5D1-y9OgnzyEvp_e-MdxpMt0DXNaM5JvNYelzzeDmg3_poOyZVfK1UXzXduxgV6ztZY3NBZgB8cAa20mkZ4P5XIsYtgXYHTAS0nRUaRIB4H2lJVVgVHlzSTIL-L0YLbXp3G3mPcflba10QAJpmGBrTKMvJllB1jzQJapZxizI4CCTqLShODduV7nCVHRZetxFhFdzwV36n2vM0C5KX0HR5NfHhsmOOM5ki-7Xm5wYftra8Ts5nZzk9JpOIEIFr1Ch2jNJsDhphpbbeBtoF3vZFnExPJ3yD6r1rW88Tc9pLCb0LnRTi_R4esgP5FRY1_wUKxYYsrB-Nm2tdQ_Ug9s5mBs3tzH0pMVo_ieFBj8Qr1mBC_P0_lvRN7uxDVcextsuCR7C7WmgmiRni3WdbXPkTvg1r_F6H5w==.~lang=py-novice.~hidden=true.e" rel="nofollow">https://app.codeboot.org/5.3.1/?init=.fZGljZS5weQ==~XQAAgADq...</a></p>
]]></description><pubDate>Wed, 18 Jun 2025 09:51:31 +0000</pubDate><link>https://news.ycombinator.com/item?id=44308295</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=44308295</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=44308295</guid></item><item><title><![CDATA[Pnut: A C to POSIX shell compiler you can trust]]></title><description><![CDATA[
<p>Article URL: <a href="https://pnut.sh">https://pnut.sh</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=41052446">https://news.ycombinator.com/item?id=41052446</a></p>
<p>Points: 193</p>
<p># Comments: 118</p>
]]></description><pubDate>Wed, 24 Jul 2024 00:22:04 +0000</pubDate><link>https://pnut.sh</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=41052446</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=41052446</guid></item><item><title><![CDATA[New comment by feeley in "In-browser code playgrounds"]]></title><description><![CDATA[
<p>I have designed 2 web based code playgrounds that you may find interesting.<p><a href="https://try.gambitscheme.org" rel="nofollow">https://try.gambitscheme.org</a> is a playground for the Scheme language (specifically Gambit Scheme). It has a REPL and a code editor that saves files in the browser local storage. It also has a tutorial for learning the basics of Scheme.<p><a href="https://codeboot.org" rel="nofollow">https://codeboot.org</a> is a playground for Python (there's an old version that supports JavaScript and we may resurrect it at some point). It was specifically designed as a simple IDE to teach programming to beginners and is in use at the Université de Montréal. Aside from the simple and intuitive UI, it has two important features for teaching:<p>1) Fine granularity single-stepping of Python code to help teach students how the computer goes about executing the code. It displays a bubble containing the variables in scope and their values.<p>2) It can bundle programs and the current state of execution in a URL that can be embedded in documents (HTML, PDF, PowerPoint, Keynote, etc) so that coding examples can be executed by the students in a single click. It also allows students to create simple web apps that require no installation and can easily be shared with others (because the URL contains all the relevant code of the app). You will find examples of this feature on the following pages:<p><a href="https://codeboot-org.github.io/presentations/" rel="nofollow">https://codeboot-org.github.io/presentations/</a><p><a href="https://codeboot-org.github.io/cegep/" rel="nofollow">https://codeboot-org.github.io/cegep/</a>  (in french, but just click on the images)</p>
]]></description><pubDate>Sat, 06 Jan 2024 19:42:42 +0000</pubDate><link>https://news.ycombinator.com/item?id=38894626</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=38894626</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38894626</guid></item><item><title><![CDATA[New comment by feeley in "Why Object-Oriented Languages Need Tail Calls (2009)"]]></title><description><![CDATA[
<p>I just posted the same link to HN 3 days after you, purely by coincidence. Does it mean we are stuck in an endless tail-call loop on this topic?</p>
]]></description><pubDate>Thu, 04 Jan 2024 17:37:05 +0000</pubDate><link>https://news.ycombinator.com/item?id=38869859</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=38869859</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38869859</guid></item><item><title><![CDATA[Why Object-Oriented Languages Need Tail Calls]]></title><description><![CDATA[
<p>Article URL: <a href="https://eighty-twenty.org/2011/10/01/oo-tail-calls">https://eighty-twenty.org/2011/10/01/oo-tail-calls</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=38867688">https://news.ycombinator.com/item?id=38867688</a></p>
<p>Points: 1</p>
<p># Comments: 0</p>
]]></description><pubDate>Thu, 04 Jan 2024 14:52:52 +0000</pubDate><link>https://eighty-twenty.org/2011/10/01/oo-tail-calls</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=38867688</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38867688</guid></item><item><title><![CDATA[New comment by feeley in "LIPS: Scheme based Lisp interpreter in JavaScript"]]></title><description><![CDATA[
<p>The try.gambitscheme.org web app has most of these features and more:<p>- REPL history with up/down arrows (explained on the landing page's README)<p>- You can use the "help" procedure to browse the full documentation<p>- TAB key for autocompletion<p>- In addition to the REPL there is a code editor to edit programs stored in the browser<p>- The system supports multiple threads, one REPL per thread<p>- There is a builtin tutorial to learn the basics of Scheme with examples executable in the REPL with a single click on a "run" button<p>- The REPL supports single stepping the execution of code<p>- Easy interface to JS with the SIX syntax extension, e.g. (let ((msg "hello")) \console.log(`msg, 1+2/3))<p>- The error messages are clear and precise giving the file and line number and highlighting in yellow the piece of code (in the REPL or file) that raised the exception. Just try this in both systems to see the difference:<p><pre><code>    > (define (f x) (/ 1 (* x x)))
    > (f 5)
    > (f "hello") ;; the * procedure will raise an exception and highlight "(* x x)"</code></pre></p>
]]></description><pubDate>Wed, 03 Jan 2024 15:16:29 +0000</pubDate><link>https://news.ycombinator.com/item?id=38855013</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=38855013</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38855013</guid></item><item><title><![CDATA[New comment by feeley in "LIPS: Scheme based Lisp interpreter in JavaScript"]]></title><description><![CDATA[
<p>How does it compare to <a href="https://try.gambitscheme.org" rel="nofollow">https://try.gambitscheme.org</a> ?</p>
]]></description><pubDate>Sat, 30 Dec 2023 22:08:20 +0000</pubDate><link>https://news.ycombinator.com/item?id=38819732</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=38819732</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38819732</guid></item><item><title><![CDATA[New comment by feeley in "Tiny-C Compiler (2001)"]]></title><description><![CDATA[
<p>I'm not sure what you mean by "minimal set of instructions". What is more important for bootstrapping is to restrict the programming style used to write the compiler. So if that was the goal I would implement pointers and maybe arrays, and not implement other types such as structs (which can be useful but add complexity to the compiler, i.e. it is no longer the case that a value fits in a machine word). Functions and function call would obviously be useful to add.  But that's about it.<p>What I'd love to do someday is to write a compiler for a fairly complete C subset in POSIX shell. The goal would be to use only a POSIX shell and this compiler to compile TCC, and then use TCC to bootstrap gcc, all from source. This would be a great tool for reproducible builds from source. If someone here finds this interesting and would like to help out, please reach out to me.</p>
]]></description><pubDate>Tue, 14 Mar 2023 20:37:27 +0000</pubDate><link>https://news.ycombinator.com/item?id=35158109</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=35158109</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=35158109</guid></item><item><title><![CDATA[New comment by feeley in "Tiny-C Compiler (2001)"]]></title><description><![CDATA[
<p>tinyc.c was designed to illustrate three things at once in a second year course on concepts of programming languages. The course had 4 parts: imperative programming (using C), functional programming (using Scheme), and logic programming (using Prolog), and programming language implementation. For the imperative programming part it was important to show enough of the C language for the following operating systems course, so we needed to show C manual memory management and pointers in a rather detailed way. So tinyc.c was principally an example of programming with pointers, including pointer arithmetic such as *pc++. It was indirectly an example of compiler and interpreter, subjects we also covered in the course. I have also used parts of the compiler in a third year compiler course but not as the basis of a project. I have always asked (forced?) my students to use Scheme to implement their compiler projects... a much friendlier language than C for compiler writing.</p>
]]></description><pubDate>Tue, 14 Mar 2023 20:27:02 +0000</pubDate><link>https://news.ycombinator.com/item?id=35157933</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=35157933</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=35157933</guid></item><item><title><![CDATA[New comment by feeley in "Tiny-C Compiler (2001)"]]></title><description><![CDATA[
<p>Haven't looked at what it would take to support C89 (or other) fully. Certainly it is possible to extend the compiler in small increments to implement more stuff: all the operators, local variables, arrays, pointers, functions, etc. The hardest part I would say is implementing types (starting with the C syntax for types!) and also handling the memory allocation for them. Nothing too complex when you know what you are doing.
My personal interest is with higher-level languages and I have worked on various Scheme systems over the last 30 years. If you like small language implementations then take a look at Ribbit which is feature-full with a tiny VM. Also check out sectorlisp (not my work) which is a fascinating tour de force.</p>
]]></description><pubDate>Mon, 13 Mar 2023 23:30:00 +0000</pubDate><link>https://news.ycombinator.com/item?id=35144780</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=35144780</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=35144780</guid></item><item><title><![CDATA[New comment by feeley in "Tiny-C Compiler (2001)"]]></title><description><![CDATA[
<p>To be clear, I'm not claiming to be the first to have used the name Tiny-C, just that the confusion with TCC is not intentional.  Your links to DDJ are great an bring back memories of the good old days when there was much to learn from reading DDJ and Byte magazine!</p>
]]></description><pubDate>Mon, 13 Mar 2023 23:15:44 +0000</pubDate><link>https://news.ycombinator.com/item?id=35144585</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=35144585</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=35144585</guid></item><item><title><![CDATA[New comment by feeley in "Tiny-C Compiler (2001)"]]></title><description><![CDATA[
<p>That's not on my TODO! But Gambit does have support for TCC. For example you can use TCC to compile a file to a dynamically loadable object file (aka shared library). The compilation is faster than gcc and the code size is typically smaller too:<p><pre><code>  $ cat hello.scm
  (display "hello!\n")
  $ gsc hello.scm
  $ gsi hello.o1
  hello!
  $ ls -l hello.o1   # this is generated by gcc
  -rwxrwxr-x 1 feeley feeley 18152 Mar 13 17:16 hello.o1
  $ rm hello.o1
  $ gsc -cc "tcc -shared" hello.scm
  $ gsi hello.o1
  hello!
  $ ls -l hello.o1   # this is generated by tcc
  -rwxrwxr-x 1 feeley feeley 4432 Mar 13 17:17 hello.o1</code></pre></p>
]]></description><pubDate>Mon, 13 Mar 2023 21:22:12 +0000</pubDate><link>https://news.ycombinator.com/item?id=35142932</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=35142932</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=35142932</guid></item><item><title><![CDATA[New comment by feeley in "Tiny-C Compiler (2001)"]]></title><description><![CDATA[
<p>Author here. Just for context tinyc.c was created in 2000 (I found the file in my archives and the last modification date is January 12, 2001). I was not aware at the time of Fabrice Bellard's work which after all won the IOCCC in 2001, so the confusion with TCC was not intentional. My tinyc.c was meant to teach the basics of compilers in a relatively accessible way, from parsing to AST to code generation to bytecode interpreter. And yes it is the subset of C that is tiny, not a tiny compiler for the full C language.</p>
]]></description><pubDate>Mon, 13 Mar 2023 20:46:42 +0000</pubDate><link>https://news.ycombinator.com/item?id=35142293</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=35142293</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=35142293</guid></item><item><title><![CDATA[New comment by feeley in "Racketscript"]]></title><description><![CDATA[
<p>If you want full Scheme running on top of JS in the browser: <a href="https://try.gambitscheme.org" rel="nofollow">https://try.gambitscheme.org</a><p>It has tail calls, continuations and even green threads (SRFI 18 compliant), and a decentralized module system that can load libraries directly from github and a JS FFI!  See this paper for advanced examples that you can copy-paste to the REPL: <a href="http://www.iro.umontreal.ca/~feeley/papers/BelangerFeeleyELS21.pdf" rel="nofollow">http://www.iro.umontreal.ca/~feeley/papers/BelangerFeeleyELS...</a></p>
]]></description><pubDate>Tue, 01 Nov 2022 15:18:14 +0000</pubDate><link>https://news.ycombinator.com/item?id=33422403</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=33422403</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=33422403</guid></item><item><title><![CDATA[New comment by feeley in "Ask HN: Anarki or Racket?"]]></title><description><![CDATA[
<p>Gambit supports the R7RS module system and has a decentralized module system that can automatically download libraries from git repositories.  Take a look at the "Libraries" section of the online REPL's tutorial for a few examples, or just type at the REPL:<p><pre><code>  > (module-whitelist-add! '(github.com/feeley))
  > (import (github.com/feeley/roman demo))
</code></pre>
This paper might be helpful if you want to know why it was designed that way:<p><a href="https://www.iro.umontreal.ca/~feeley/papers/HamelFeeleyELS20.pdf" rel="nofollow">https://www.iro.umontreal.ca/~feeley/papers/HamelFeeleyELS20...</a></p>
]]></description><pubDate>Fri, 28 Oct 2022 03:49:43 +0000</pubDate><link>https://news.ycombinator.com/item?id=33367448</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=33367448</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=33367448</guid></item><item><title><![CDATA[New comment by feeley in "Ask HN: Anarki or Racket?"]]></title><description><![CDATA[
<p>The FFI with JavaScript is nice.  Have a look at this paper, in particular the examples that can be copy-pasted to <a href="https://try.gambitscheme.org" rel="nofollow">https://try.gambitscheme.org</a>:<p><a href="https://www-labs.iro.umontreal.ca/~feeley/papers/BelangerFeeleyELS21.pdf" rel="nofollow">https://www-labs.iro.umontreal.ca/~feeley/papers/BelangerFee...</a></p>
]]></description><pubDate>Thu, 27 Oct 2022 19:25:17 +0000</pubDate><link>https://news.ycombinator.com/item?id=33362717</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=33362717</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=33362717</guid></item><item><title><![CDATA[New comment by feeley in "Ask HN: Anarki or Racket?"]]></title><description><![CDATA[
<p>I'm not sure what part of your project is web-based and what you mean by "web-based".  Do you mean executing Lisp/Scheme code on the browser side or the server side?  In any case you should consider Gambit Scheme that has a complete JavaScript backend.  For example check out the <a href="https://try.gambitscheme.org" rel="nofollow">https://try.gambitscheme.org</a> site to see the online REPL in action.</p>
]]></description><pubDate>Thu, 27 Oct 2022 18:46:21 +0000</pubDate><link>https://news.ycombinator.com/item?id=33362137</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=33362137</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=33362137</guid></item><item><title><![CDATA[New comment by feeley in "Ribbit Scheme bootstraps with Posix shell while supporting TCO, call/cc and GC"]]></title><description><![CDATA[
<p>An important design goal for the POSIX shell version of the RVM is to depend on the fewest external tools possible. Each dependency brings with it a portability risk because unix tools can be subtly different between environments (for example macOS vs linux, and even between linuxes, and even between versions of the same distribution of linux).<p>So the core of the RVM has no dependencies with external tools (i.e. it is in "pure" shell script).  The only dependencies are for I/O, namely for the "putchar" RVM primitive and the "getchar" RVM primitive (both of which do byte-at-a-time binary I/O on stdin and stdout).  For putchar the shell "printf" (which is usually builtin) command is used, specifically<p><pre><code>    printf \\$((byte/64))$((byte/8%8))$((byte%8))
</code></pre>
For getchar is is not possible to use the shell "read" command because it does not handle null bytes on stdin (and we want Ribbit to support binary I/O).  This is admittedly somewhat of an artificial constraint given that Ribbit will probably be mostly used for text processing, like to write compilers that map source code text to target code text.  So getchar is implemented with<p><pre><code>    set `sed q | od -v -A n -t u1`
</code></pre>
and then the next byte on stdin is available using $1 and "shift" is used to move to the next byte.  The call to sed is to read each line separately (useful to implement a REPL where you enter a command which is executed before having to enter the next command).  Both "sed" and "od" are standard unix tools.  Moreover we checked that those set of options have existed for a long time (at least the early 1990's).  It would be interesting to test many POSIX shells to verify Ribbit's portability (we used bash, dash, zsh and ksh for our testing).<p>The low performance of the POSIX shell RVM is due to two things.  First, the shell's interpreter is not fast.  The simple loop<p><pre><code>    n=10000000; while [ $n -gt 0 ]; do n=$((n-1)); done
</code></pre>
runs about 5000 times slower with bash than the equivalent JavaScript code run with nodejs, which is implemented with a JIT.  Secondly, the POSIX shell does not have arrays so it is necessary to use the shell "eval" command to do indexing.  For example a[i]=0 becomes<p><pre><code>    eval a$i=0
</code></pre>
As you can imagine the RVM implementation uses arrays all over the place for implementing access to the RVM's stack and Scheme objects (both of which are implemented using a garbage collected heap, which is conceptually an array of 3 field records and implemented in the shell as 3 "arrays").<p>The POSIX shell version of Ribbit was designed to be as portable as possible, only relying on a POSIX shell to run Scheme code.  This can be useful in a context where you only have a POSIX shell at hand and you want to bootstrap a more efficient set of development tools (C compiler, editor, etc) and you don't mind waiting a day or two for the build to complete.  It is also useful when you want a reproducible build pipeline and the only tool you trust is the shell.</p>
]]></description><pubDate>Sat, 23 Apr 2022 11:59:46 +0000</pubDate><link>https://news.ycombinator.com/item?id=31133503</link><dc:creator>feeley</dc:creator><comments>https://news.ycombinator.com/item?id=31133503</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=31133503</guid></item></channel></rss>