[HN Gopher] Fullmoon - Redbean-based Lua web framework deployed ...
       ___________________________________________________________________
        
       Fullmoon - Redbean-based Lua web framework deployed as single file
        
       Author : keb_
       Score  : 105 points
       Date   : 2022-02-18 14:04 UTC (8 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | laerus wrote:
       | the best part is you can use Fennel lang for this.
        
       | Shadonototra wrote:
       | not slow enough to compile, is there a rust rewrite please? /s
       | 
       | lua is a lovely scripting language, i was looking at replacing my
       | bash scripts the other day in my project, lua could be a solid
       | candidate..
        
       | christophilus wrote:
       | This looks great.
       | 
       | > Highly experimental with everything being subject to change.
       | 
       | Makes me a little hesitant to give the tires a serious kick,
       | though.
        
         | paulclinger wrote:
         | Don't be. I just want to provide a fair warning, but some of my
         | other projects (wxlua and ZeroBrane Studio already mentioned in
         | other comments) maintain compatibility with dependency versions
         | released 8 years ago. The API is also more stable than it was
         | at v0.10 when the warning was added, even though I do expect
         | changes, as both Fullmoon and redbean continue to be developed
         | and new features are being added.
        
       | rainingmonkey wrote:
       | Very nice!
       | 
       | Apart from using Redbean (which looks interesting itself), could
       | you summarize the differences between Fullmoon and Lapis?
        
         | paulclinger wrote:
         | (Fullmoon author here) I actually started with integrating
         | Lapis into redbean (I have redlapis module that mimics a subset
         | of openresty API over redbean to Lapis, so I can run it over
         | Redbean), but it led to too much work given the difference in
         | the underlying server architecture, so I abandoned this effort
         | in favor of the redbean-focused one (can publish what I have if
         | someone is interested to give it a try). There were also some
         | philosophical differences; for example, I preferred a different
         | routing implementation (with specific routing order) and it was
         | difficult to change or re-configure the one in Lapis.
         | 
         | In terms of the differences, Lapis is definitely the more
         | feature rich one, as it includes its own ORM and integration
         | with various back-ends (including data access and migration).
         | Lapis is largely class-based and Fullmoon is taking a more
         | procedural approach, which I think aligns better with redbean's
         | simplicity and performance. Lapis provides session support,
         | which Fullmoon currently doesn't have, but it's one of the next
         | functions I plan to implement. Routing and templating
         | capabilities are similar in both, even though the approaches
         | taken are quite different.
         | 
         | Fullmoon is likely to be noticeably faster (at least based on
         | my local tests) and can leverage some of the components already
         | available in redbean out of the box (for example, argon2, hmac
         | functions, and direct SSL integration). Lapis is well
         | documented and has several interesting projects built on it, so
         | it's much more battle tested. fullmoon is only 3 months old and
         | is being actively worked on. Its code is also much shorter, so
         | it may be easier to study and tweak. Fullmoon also includes
         | 150+ tests that one can run locally or from redbean.
         | 
         | Hope this helps as a quick overview, but if there are more
         | detailed questions, let me know.
        
       | lxe wrote:
       | Anything from the cosmopolitan/actually pdrtable executable world
       | is always a delight.
        
         | john-tells-all wrote:
         | Seconded. Paul's contribution of the Fullmoon web framework is
         | a great way to promote the stunning Cosmopolitan viewpoint.
        
       | synergy20 wrote:
       | Need : sudo sh -c "echo ':APE:M::MZqFpD::/bin/sh:'
       | >/proc/sys/fs/binfmt_misc/register" to run redbean, this really
       | should be documented for linux
       | 
       | to run the demo, still I got lots of warning about
       | "tool/net/redbean.c:1034:redbean:68740] (lua) failed to run lua
       | code: /.init.lua:1: module 'fullmoon' not found", adding the path
       | to LUA_PATH and LUA_CPATH did not help.
       | 
       | last, is there a lua version requirement for this? My system
       | default to lua 5.1.
       | 
       | I was thinking about using this for an embedded board, but the
       | code is actually quite large, 1.6M after zipped, which is too
       | much for small boards.
        
         | paulclinger wrote:
         | Yes, that register patch may be needed on some Linux systems;
         | I'll add this to the documentation.
         | 
         | Redbean can't use the system Lua, so it comes bundled with its
         | own Lua interpreter (Lua 5.4; there is also work being done to
         | allow LuaJIT or Luau to be embedded instead).
         | 
         | The modules need to be put in the .lua directory within redbean
         | archive; redbean searches within its archive, so you don't need
         | to set LUA_PATH/LUA_CPATH. I have instructions on how to get
         | examples working included in the examples
         | (https://github.com/pkulchenko/fullmoon/tree/more-
         | links#examp...) section.
         | 
         | In terms of the size, this includes MbedTLS and SQLite, so if
         | you don't need those modules, you can compile redbean without
         | them, which should reduce the size considerably.
        
       | simonw wrote:
       | The documentation for this (all in the README) is really, really
       | good.
        
       | dingdingdang wrote:
       | Just looked over the github page, showcase examples include https
       | usage and a LOT of practical details on how to make practical use
       | of Redbean/Cosmopolitan ecosystem. Thanks a lot to Kulchenko for
       | the work done on Fullmoon!
        
         | paulclinger wrote:
         | Thank you for the feedback and all the kind words. @jart did a
         | great job on Redbean/Cosmopolitan, so it's a delight to use and
         | build on top of.
        
       | kissgyorgy wrote:
       | It's a little bit tricky to put Redbean in a Docker container, if
       | you want to do so, check out this repo, it might help doing that:
       | https://github.com/kissgyorgy/redbean-docker
        
       | keb_ wrote:
       | In case anyone didn't know, as another user rightfully mentioned,
       | this is by Paul Kulchenko who is widely known for his work on the
       | very impressive, very lightweight, and very robust Lua IDE,
       | ZeroBrane Studio[1]. The man has a pretty amazing track record.
       | 
       | [1] https://studio.zerobrane.com/
        
         | dingdingdang wrote:
         | Thanks for introducing Zerobrane, really looks fantastic. Also
         | by extension introduced me to https://makeself.io/ for making
         | Linux installations.
        
       | robbedpeter wrote:
       | Paul Kulchenko is a wonderful human being - zerobrane is a joy to
       | use.
       | 
       | This looks like it could mesh very well with Node Red, or really
       | any Lua scripted environment. Thanks!
        
       ___________________________________________________________________
       (page generated 2022-02-18 23:01 UTC)