Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the Ruby language be used to build operating systems?

Can the Ruby language be used to create an entire new mobile operating system or desktop operating system i.e. can it be used in system programming?

like image 325
Kshitiz Rimal Avatar asked Jun 28 '11 17:06

Kshitiz Rimal


People also ask

Is Ruby an operating system?

Ruby is an interpreted, high-level, general-purpose programming language which supports multiple programming paradigms. It was designed with an emphasis on programming productivity and simplicity. In Ruby, everything is an object, including primitive data types.

Is Ruby more powerful than Python?

There is a perception that Python is faster than Ruby, and this has often led teams to prefer it over Ruby for web development. The Ruby community is painfully aware of this, and Ruby has gotten way faster over the years. Now, in benchmarks, Ruby performs just about as well as Python, if not better.

Is Ruby on Rails a operating system?

Ruby on Rails is software code built on top of Ruby. Technically, it is defined as a package library called RubyGem, installed using the command line interface of the operating system. Ruby on Rails is an open-source web development framework, which provides Ruby developers a timesaving alternative to develop code.

Is Ruby harder than Python?

Without a doubt, Python is much easier to learn because of how the language is structured - and how explicit it is. One can literally become proficient in two to three months. Ruby takes much longer to learn due to its flexibility.


1 Answers

Well there are a few operating systems out there right now which use higher-level languages than C. Basically the ruby interpreter itself would need to be written in something low-level, and there would need to be some boot-loading code that loaded a fully-functional ruby interpreter into memory as a standalone kernel. Once the ruby interpreter is bootstrapped and running in kernel-mode (or one of the inner rings), there would be nothing stopping you from builing a whole OS on top of it.

Unfortunately, it would likely be very slow. Garbage collection for every OS function would probably be rather noticeable. The ruby interpreter would be responsible for basic things like task scheduling and the network stack, which using a garbage-collecting framework would slow things down considerably. To work around this, odds are good that the "performance critical" pieces would still be written in C.

So yes, technically speaking this is possible. But no one in their right mind would try it (queue crazy person in 3... 2...)

like image 54
Chris Eberle Avatar answered Oct 12 '22 12:10

Chris Eberle