[HN Gopher] Glimmer: DSL Framework for Ruby GUI and More
       ___________________________________________________________________
        
       Glimmer: DSL Framework for Ruby GUI and More
        
       Author : thunderbong
       Score  : 132 points
       Date   : 2025-01-10 09:02 UTC (13 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | davidsojevic wrote:
       | In case anyone is like me and wanted to see some more usage
       | examples, the author of Glimmer seems to have a few games he's
       | put together using the gem:
       | 
       | https://github.com/AndyObtiva/glimmer_klondike_solitaire
       | 
       | https://github.com/AndyObtiva/glimmer_wordle
       | 
       | https://github.com/AndyObtiva/glimmer_tetris
       | 
       | https://github.com/AndyObtiva/glimmer_snake
       | 
       | https://github.com/AndyObtiva/glimmer_hangman
       | 
       | https://github.com/AndyObtiva/glimmer_metronome
        
       | artemonster wrote:
       | How debuggable is this (besides sifting through wall of debug log
       | text)? Can you step through your declarative GUI building process
       | inside DSL or its like this: "DSL text goes into magic
       | magic...POOF! here is the result. hopefully nothing went wrong or
       | glhf"
        
         | chao- wrote:
         | The popular debugger for Ruby is a combination of two
         | libraries: byebug and pry. Using these should allow you to step
         | into/over code in a familiar way, if you've used most
         | breakpoint-based debuggers.
         | 
         | If you end up giving it a try, please report back!
        
           | 3ds wrote:
           | These two gems have been superseded by the `debug` gem.
           | 
           | https://github.com/ruby/debug
        
             | runako wrote:
             | Could you say more about that? I have been using pry, and
             | it appears to still be updated. Is there a reason to stop
             | using pry, or are you expressing a preference for the
             | official debug gem?
             | 
             | Thanks!
        
               | Nuzzerino wrote:
               | Seems like the latter to me. One or the other gem is fine
               | depending on your preferred interface.
        
         | verdverm wrote:
         | I've built a DSL engine on top of CUE + Go's text/template [1].
         | This largely becomes feeding data into a set of templates, and
         | even this can be hard to debug because template engines often
         | lack the extras needed to support it.
         | 
         | I'd be curious to see if a more code based DSL engine has
         | better debug support. I would imagine you would be stepping
         | through both the DSL code and the engine, if it is more dynamic
         | (i.e. there is not a two step process for DSL authoring)
         | 
         | What I like about a text/template engine is that anyone can use
         | it (create new DSLs) without knowing the language the engine is
         | implemented in. CUE appeals to me as the language for
         | writing/using the DSL because (1) I don't have to learn a new
         | syntax per DSL and (2) it becomes data (json/yaml) I can use
         | anywhere for other purposes beyond generating code.
         | 
         | [1] https://github.com/hofstadter-io/hof
        
           | artemonster wrote:
           | my experience with interpreter pattern is that you will be
           | spending 90% of debugger time stepping through abstract
           | "eval" functions that are irrelevant to what you want debug.
        
             | sitkack wrote:
             | I solved this by writing code to walk the stack and extract
             | the information I needed (this was Python, but am sure it
             | would translate to Ruby).
        
       | msie wrote:
       | This is great! Just yesterday I was looking at wxruby3 but I
       | didn't see a way to package/distribute apps. This does solve that
       | problem.
        
       | jonkoops wrote:
       | Note there is already UI component framework called Glimmer that
       | is used by Ember.js: https://glimmerjs.com/. It's pretty much
       | upstreamed into Ember itself these days, but the devs also have a
       | big Rails background so I found the coincidence funny.
        
         | xinuc wrote:
         | As a long time rubyist, I know that Andy's Glimmer preceded
         | Yehuda's.
        
           | caseyohara wrote:
           | The first commit to the Ruby Glimmer project (2008-11-25 is
           | the earliest I found) long predates the first commit to even
           | Ember itself (2011-04-30).
        
         | leeoniya wrote:
         | what's even more weird is there was a similar naming situation
         | with another wycats-associated project: Handlebarsjs:
         | https://news.ycombinator.com/item?id=1677499
        
       | flippyhead wrote:
       | And only 21,000+ commits. Nice!
        
         | qup wrote:
         | What a strange criticism.
        
       | desireco42 wrote:
       | Congrats Andy for consistently shipping! He has been working on
       | this and perfecting it for years.
        
       | sandropuppo wrote:
       | Nice work!
        
       | jimbokun wrote:
       | From that little demo looks like a lot of fun to develop.
        
       | Alifatisk wrote:
       | Looks really fun, I have to try it
        
       | weatherlight wrote:
       | That's one hell of a introduction                   Glimmer
       | started out as a GUI Library and grew into a full-fledged DSL
       | Framework with support for multiple GUI DSLs. Glimmer's namesake
       | is                  referring to the Glimmer of Ruby in Graphical
       | User Interfaces (contrary to                      popular myth
       | perpetrated by Charles Nutter, Glimmer has nothing to do with
       | the ill-fated Whitney Houston movie, which does not in fact share
       | the same                      name)
        
       ___________________________________________________________________
       (page generated 2025-01-10 23:00 UTC)