Skip to content
Cecil edited this page Sep 16, 2018 · 1 revision

Some thoughts on a newer version of Shoes. First a quick review of what's good and what's not so good. Then I present some 'facts' that are not likely to change and then some ideas.

Review

  1. Cross platform GUI
    • for those who care for x-platform
    • for those who don't care about x-platform
    • distribution/packaging
    • LCD restricted functionality
  2. Scripting and interpretive
    • quick to write
    • lacks REPL or IDE integration
    • doesn't scale up.
  3. Ruby
    • Everybody loves Ruby
    • Rich collection of Gems.
    • Gems not used by Shoes users.
    • pain in the behind MRI internals
    • Ruby is fast moving target
  4. Community issues
    • There is a community - size is unknown
    • Not enough developers
      • C is too hard to write?
      • objective-c

Immutable.

  1. Gtk is written in C. Cocoa is Objective C.
  2. Qt is C++, wxWidgets is C++. Fewer C++ developers in FOSS
  3. Cross platform is Least Common Denominator. It just is.

Current Architecture

Shoes isn't badly badly designed - FOR WHAT IT DOES.

Implementation       Purpose                      Project Location
    C             main()                          main.c
                    init MRI, load Shoes.rb
                    init graphics
                    load user script (if any)     world.c
                    MRI eval()
                    
    MRI Ruby -C   Shoes classes, methods          ruby.h, ruby.c, lib/*.rb
    
    C             implements Shoes classes.       app.c, canvas.c, image.c
                                                  types/*.c
    
    C              shoes_native_code              native/gtk/*.c
                          |
                   C-GTK  |  Objc, Cooca          native/cocoa/*.m

One Reimplementation

mRuby is designed for embedded usage, unlike MRI. There are a lot of trade offs:

    • no threads, no requires, Gems are not alike. No rubygems repo.
    • There are mruby gems to do some of those things.
    • Stable api

MRI Ruby and Shoes works. We could hold Shoes to what it is now.

Implementation       Purpose                      Project Location
    Rust          fn main()                       main.rs
                    init mruby
                    init graphics
                    load New-Shoes byte code (mrb)
                    compile user script (if any)
                    mrb eval                      world.rs ?

    mruby C        New-Shoes classes, methods     
    
    Rust/C         implements Shoes classes.      
                   
    Rust/C/Objc    shoes_native_code
                   C-GTK  |  Objc, Cooca         
                   Gtk-rs |  rust-objc

The rust-C interoperability is high once it's understood. It should be possible to implement rust replacements, bottom up, one widget at a time. Do all the natives then do the next level up (in types/*). Or, start with type/widget-X and re-implement it and both natives in rust. I lean to the latter approach.

Things could get difficult with the next layer up - canvas.c, image.c, app.c. The real problem with bottom up is that we never address the top down concerns (LCD, scaling, REPL)

Clone this wiki locally