[HN Gopher] Redbean web server debugging with ZeroBrane Studio
       ___________________________________________________________________
        
       Redbean web server debugging with ZeroBrane Studio
        
       Author : paulclinger
       Score  : 41 points
       Date   : 2022-08-16 15:35 UTC (7 hours ago)
        
 (HTM) web link (notebook.kulchenko.com)
 (TXT) w3m dump (notebook.kulchenko.com)
        
       | AMICABoard wrote:
       | Redbean and Cosmopolitan is like magical alien technology that
       | unites all computing on earth! Now we have a visual debugging
       | method, good work kind ladies & gentleman!
       | 
       | The team is like nuts aliens and I admire their brains.
        
         | giraffe_lady wrote:
         | I love redbean and am actively using it on a project,
         | completely in awe. _BUT_ I 'm a little put off by the claims
         | that it is so universal when it doesn't support arm.
         | 
         | This would have been a reasonable claim even a few years ago
         | but specifically because of m1 macs arm is becoming much more
         | common. It also prevents it from being used in one of the
         | situations where you would most want a high performance
         | standalone binary server & environment: raspberry pi.
         | 
         | There are technical solutions to this limitation and they are
         | fine. But they significantly break the universality illusion
         | and benefits.
        
           | tepitoperrito wrote:
           | My question is, how portable is the lua code written for
           | redbean to a GNU/Systemd environment running something like
           | LuaJIT or whichever interpreter would be more compatible.
           | Forgive my lack of knowledge of the lua ecosystem, and not
           | checking out more of the redbean docs.
        
             | giraffe_lady wrote:
             | I may not be understanding the concern correctly so forgive
             | me if not.
             | 
             | Lua code pretty much always ends up tightly coupled to the
             | embedding environment and the API exposed by it. Running a
             | bare lua script against an unmodified interpreter supplied
             | by the OS is just not the normal use case, though certainly
             | possible.
             | 
             | So it's as portable as all lua code, which is up to you but
             | there's rarely a reason to prioritize that too highly. For
             | example the two kinds of lua I've done professionally are
             | web servers and industrial automation. What does it even
             | mean for code to be "portable" between those two? A web
             | server doesn't have a motor and so doesn't expose functions
             | to control one. A conveyor belt doesn't handle http
             | requests so has no functions to send one.
             | 
             | You can definitely come up with library code-type
             | functionality that you'd want in both, and if you write it
             | carefully not to depend on anything outside of the core lua
             | implementation it will run on both. Nothing special about
             | redbean here among the many many other niche uses of lua.
        
               | jart wrote:
               | Redbean embraces and extends Lua. That's good since Lua
               | by itself is the most austere language. For instance,
               | here's Lua's standard library as shown by redbean auto-
               | completion: https://redbean.dev/img/lua-stdlib.png You're
               | pretty much limited to just stdio functionality, since
               | that's traditionally the only thing that's been portable
               | across platforms. What we did with Cosmopolitan Libc was
               | make POSIX as a whole portable to things like Windows.
               | Redbean takes advantage of that, to offer you the nearly
               | complete breadth of things like unix across platforms:
               | https://redbean.dev/img/redbean-unixlib.png We've also
               | added language features to Lua that we borrowed from C
               | and Python. https://redbean.dev/#enhancements
               | 
               | If you want to move your code to a different Lua
               | environment, then you can take these APIs with you. For
               | instance, our enhancements to Lua are all open source. We
               | even offer a 420kb build of the lua command + our unix
               | module. Just in case you only want Lua and our APIs but
               | not the web server too. https://redbean.dev/lua.com
        
           | jart wrote:
           | Redbean runs on M1 Macs with ARM. Daniil Kulchenko pulled off
           | an impressive hack to make that possible.
           | https://github.com/jart/cosmopolitan/issues/429 Redbean also
           | works great on Windows ARM https://youtu.be/CQ7Npip88Yw As
           | for Linux ARM, we're working on it.
           | 
           | If you can point me to any place where we've claimed it's
           | "universal" rather than "runs on nearly all PCs and servers"
           | then let me know and I'll correct the language. It wasn't my
           | intent to put Redbean on the same level as Turing's universal
           | machine. Systems engineering isn't the same thing as computer
           | science, but I think Redbean will help elevate it as a field.
        
             | giraffe_lady wrote:
             | Oh interesting, I didn't realize it was supposed to work on
             | arm. It crashes for me after a minute or two and I didn't
             | see arm explicitly mentioned so figured it wasn't
             | supported. I'll open an issue about it.
        
               | jart wrote:
               | Raspberry Pi is only supported with Windows. We intend to
               | support RasPi + Linux in the future. So any time you
               | invest in Redbean today, will pay dividends as support
               | expands in the future.
        
       | elitepleb wrote:
       | absolutely loving your work on
       | https://github.com/pkulchenko/fullmoon and redbean, keep it up!
        
       | riidom wrote:
       | Nice to see Zerobrane is still around. I moved a bit away (for
       | now) from the Lua world, but working with Zerobrane was a blast
       | at that time.
        
       | grimgrin wrote:
       | A nice way to debug is just what we needed.
       | 
       | Paul has been very foundational to a positive spirit in the
       | cosmo/redbean community. Besides this cool work, they're also the
       | author of fullmoon, a web framework for redbean
       | 
       | https://github.com/pkulchenko/fullmoon
        
         | paulclinger wrote:
         | Thanks @grimgrin! BTW, Fullmoon scripts can be debugged too.
        
           | grimgrin wrote:
           | And I'll reply here to say that though the article mentions
           | "should work on Linux", I have tested and it _does work on
           | linux_.
        
             | paulclinger wrote:
             | Nice; I'll update to mention that. Thank you!
        
         | jart wrote:
         | Paul's the top contributor to Redbean. He's always believed in
         | and supported the project, even while I was on my SectorLISP
         | hiatus. He's an artist with APIs and I couldn't have designed
         | the Redbean UNIX module as well as I did without his help. It's
         | very welcome to see his ZeroBrane IDE being used to debug
         | Redbean. It's a multiplatform IDE but if you run it on Windows,
         | I like how it has the classic vibe of legendary tools like
         | Borland Delphi or Visual Basic 6. It fills a similar niche as
         | SerenityOS in that sense.
        
           | paulclinger wrote:
           | Thank you, Justine, for your kind words and all the work you
           | put into Redbean and Cosmopolitan!
        
       ___________________________________________________________________
       (page generated 2022-08-16 23:01 UTC)