Question

A problem is what Ruby does at run time. It is an interpreted language as compared to C, which is a compiled language. How feasible would it be? Ruby is getting faster every year, but how? What is being done? Are the methods we use a lot (each, map, etc.) being written in C, speeding up everything? Is the long-term goal to let Ruby be as fast as C by being C? What are the biggest problems when trying to convert what is written in Ruby to C, then getting it run? Or, does this question not make any sense? If so, why?

No correct solution

OTHER TIPS

Ruby gives you a lot more functionality than C. For example, one of the downsides of programming in C is that the programmer has to do the memory management. This requires time, self disipline, and skill. Lack of any of those results in bugs and security holes. But it produces fast runtimes because it is tailored to a specific case rather than a general one.

With Ruby you can concentrate on the application, rather than the mechanics. It does the memory management for you, and this means (generally) fewer bugs and more secure code. But there is no free lunch - you pay for that with increased runtime.

C is a static language - decisions on types and operation have to be taken at compile time. Ruby is a dynamic language, where decisions can be deferred until runtime, which leads to a more flexible and reactive language. Comparing C and Ruby is like comparing apples and oranges.

Sure, you can do all that in C, Ruby is written in C as you point out, but it is a lot of work and you had better be a damn good programmer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top