Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I’m a little confused about this project. I’m trying to build the most complete list of programming languages out there (currently working on it via my favorites, it you want to have a look), and I’m trying to figure out if this qualifies.

Usually it’s pretty easy to get on my list: if you call your project a language I add it to the list.

But this one gives me a little pause, because it seems like this language is not distinct from Ruby at all. Rather this is a straight up Ruby -> C++.

Is it fair to call this a language rather than a compiler? To me, a language is more than syntax and semantics, but includes an library ecosystem, tooling, and community. Does Natalie aim to grow a community, or will it exist fully within the Rudy ecosystem?



In a strict CS sense, languages are defined by what they accept, and how they parse what they accept.

Given that this will only accept and correctly parse a subset of the Ruby language, in a strict CS sense, it accepts a different language to Ruby.

In time, this difference may shrink (as Natalie becomes more complete), become larger (as Ruby gets more fully featured) or diverge so that Natalie isn't a subset (e.g. if Natalie decides for some reason to parse some Ruby construct differently to Ruby).


This isn't the first time something like this has been done; for a while Facebook used a PHP to C++ compiler before switching to compiling it directly to native code via a JIT:

https://en.wikipedia.org/wiki/HipHop_for_PHP https://en.wikipedia.org/wiki/HHVM


> because it seems like this language is not distinct from Ruby at all

I don't think it claims to be - it's a compiler for Ruby.


The domain is Natalie-lang.org and the header on that page is “Natalie Programming Language”, so that’s where I’m a little confused. Maybe the goal isn’t to be a Ruby compiler but to transition into something more, so I was wondering if anyone had any idea.


And the text immediately underneath the the header is “Natalie is a work-in-progress Ruby implementation, compiled to C++”.


In the JavaScript world this would be called a transpiler. Instead of compiling a newer version of JS into an older one this compiles Ruby in a totally different language, C++. However the Ruby interpreter (MRI) is written in C so C++ is less far away from it than, let's say, Java. I didn't check the code but I wonder if they inlined some code from MRI.


It is Ruby implementation if I got it right, not a Ruby-like language.

Not the first and probably not the last one (jRuby, Rubinius, MacRuby etc.).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: