Anybody tried the Crystal Programming Language (machine-code compiled Ruby)? [closed]

 ̄綄美尐妖づ 提交于 2019-12-03 04:11:46

问题


Like many others, I always hold true that "A pure compiler will never exist for Ruby because the language is far too dynamic for a static compiler to work."

But I recently stumbled upon these:

The Crystal programming language at GitHub

Statically compiled Ruby

Both projects seem to be very interesting. They could give us the speed of a native-compiled language (and the often commercially-required, obfuscated code of a compiled language) while keeping all (or most) of the elegance and flexibility of Ruby. Add a good support library (or, more likely, the possibility to access the existing C++ libraries) and you can easily understand why this stuff could be interesting.

Has anybody tried the Crystal language? (I didn't yet, because of compilation problems with ruby-llvm)

Which was his/her feeling about it?

Do you think that, given those design choices, would it be actually possible to develop a native-code (machine-code) compiler for Ruby (with a reasonable effort and in a reasonable amount of time)? Would it be meaningful?


回答1:


I'm the developer of crystal. Currently not everything is implemented from the bulleted point list. In fact classes were just started to be implemented.

I really like the idea of it though. But I need to think more about how to implement it. And I also need more time, hehe.

The second article has a completely different approach because it won't introduce a new language: it'll just try to compile a subset of Ruby, or maybe will be compiled to native code but still allow some dynamism with performance costs (I talked to the author of that article some months ago).

My feeling toward both approaches: I really with it could happen. We need a fast language with an elegant, readable, joy to use syntax and library (like what Ruby offers).




回答2:


I'm the developer of Foundry; the second article is mine.

A more recent article on the same topic would be "A language for embedded developers"; or you could also track development progress by subscribing at foundry-lang.org.

Please note, however, that my project is commercial, (at least initially) not open-source, and is primarily focused on embedded development. You could still use it on desktops or servers, of course.

I'm also one of ruby-llvm maintainers; please report the problems you've encountered as bugs on the project page.



来源:https://stackoverflow.com/questions/9463543/anybody-tried-the-crystal-programming-language-machine-code-compiled-ruby

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!