MacRuby: objective-c runtime is the same as ruby ​​runtime

I do not have a formal education in computer science, but I have programmed for a long time in Java, Ruby, jQuery.

I was looking through the macruby project. I continue to work on statements that are similar to "MacRuby objective-c has the same runtime as Ruby runtime."

I understand what MRI is. I understand what Ruby 1.9 brings to the table. However, I do not understand how a virtual machine for one language can support another language.

I know that I am asking the question on which the years of study rest. However, any pointers and any discussion will help.

I also like what I see in macruby.

+3
source share
2 answers

Well,

The simplest explanation is that MacRuby is a Ruby 1.9 VM. In earlier versions, it was a modified version of YARV (ruby version 1.9), which, instead of using custom types for things like ruby ​​strings, hashes, etc., used equivalents found in apple foundation classes such as NString. With the advent of version 0.5, a whole new LLVM-based virtual machine was created, again compatible with ruby ​​1.9, which is based on the base classes of apples.

1.9 VM. - api-, , , MacRuby (, HotCocoa).

+1

, .

.

VM . . Java (JVM) - Java. javac - -. , - :

JVM .class .jar, JVM, " " (JIT), Sun HotSpot. JIT, , JVM . , , .

, (, Clojure, Scala, Rhino, ...), . Microsoft.NET Common Intermediate Language (CIL).

, .

0

Source: https://habr.com/ru/post/1726445/


All Articles