1. 8
  1.  

  2. 2

    After reading the headline, my first thought was, whatever happened to duby? Apparently it’s called mirah now: https://github.com/mirah/mirah

    1. 2

      Okay, I decided to give it a test-drive on OS X.

      • Code-Style in the example is mixed (I don’t bother about the style of the author in their own code). The example creates files in /lib and /ruby in an unclear format. Some files are CamelCased, others not, some mixed case (Infra_spec). Indentation is tab, which is very unusual for Ruby, where 2-space, lower_case rules the world.
      • Beyond the stylistic, I can’t get a lot of things to run. It generates a default Rakefile with multiple compile tasks, of which I could get only one working (the one for the library files).

      Example:

      [ skade infra ] rake -T
      rake library:core:compile                # compile library
      rake program:infra-main:core:compile     # compile infra-main
      rake program:infra-main:core:execute     # execute infra-main
      rake program:infra-main:interpret:jruby  # interpret infra-main with jruby
      rake program:infra-main:interpret:ruby   # interpret infra-main with ruby
      rake spec:core:compile                   # compile specs
      rake spec:core:execute                   # execute specs
      rake spec:interpret:jruby                # interpret specs with jruby
      rake spec:interpret:ruby                 # interpret specs with ruby
      [ skade infra ] rake spec:core:compile
      [ skade infra ] rake spec:core:execute
      Exception in thread "main" java.lang.ClassNotFoundException: ruby.spec
      

      It seems to compile alright, but the jars seem empty.

      They are not depending on each other, so running the wrong one first will throw warnings before running the one that should be compiled first.

      • The only thing I could get working properly are the interpret tasks, which use CRuby or JRuby instead.
      • It is not compliant to any relevant spec. e.g. RUBY_ENGINE is missing.
      • It’s very unclear to me what the actual gains over another compiler/runtime are.
      • The LICENSE is unclear until you actually open up the compiler gem. It reads:
      Copyright (C) 2011-2015 InfraRuby Vision
      
      This agreement in respect of the InfraRuby compiler (hereinafter "the
      Compiler") is between InfraRuby Vision (hereinafter "the Vendor") and any
      natural person who enters into this agreement at any time while the Vendor
      offers this agreement (hereinafter "the Developer").
      
      The Vendor hereby grants to the Developer a non-exclusive, non-transferable
      licence for the Compiler under the following terms:
      
          THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
          OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
          MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
          IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
          CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
          TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
          SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
      
          The Developer may use the Compiler, provided that the source of each
          input to the Compiler satisfies one of these conditions:
      
            * it is written entirely by the Developer;
      
            * it is written entirely by any third party to whom the Vendor has
              also granted a license for the Compiler;
      
            * it is publically available under any license approved by the Open
              Source Initiative; or
      
            * it is generated by a program, provided the source of the program
              and the source of each input to the program satisfy one of these
              same conditions.
      
          The Developer may not use the Compiler with any other input or permit
          any third party to use the Compiler.
      
          The Developer may not modify the Compiler or produce derivative works
          of the Compiler. The Developer may not distribute, transfer,
          sublicense, sell, rent, lease or lend the Compiler to any third party.
      
      This agreement is the entire agreement and supersedes all previous
      agreements between the Vendor and the Developer in respect of the Compiler.
      This agreement shall be governed by the laws of New Zealand. In any legal
      dispute arising out of this agreement, the courts of New Zealand shall have
      exclusive jurisdiction.
      

      YMMV here.

      I must say that I still find the whole thing intriguing. The developer seems to be very knowledgeable and a lot of the things above can be fixed by clearer documentation/QA.

      1. 1

        I understand what it is trying to say, but pedantically speaking, how can it be Ruby if it is statically typed?

        1. 1

          It uses comments for annotating the methods. So it’s more a type-hint system.

          Original post was: Ruby has enough syntactical flexibility to allow type hints in a way where they can be introduced at most places in a backwards-compatible fashion.