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

This returns me to the question I asked here: http://news.ycombinator.com/item?id=1361382

If I'm compiling, what should I target?

I could target LLVM, C, some high-level compilable langauge, or now, Parrot.

There doesn't seem to be any cogent, clear, knowledgable discussion of the various features and merits. I suppose asking for one is like asking "which language is best," and the answer will always be "it depends."



I've used Parrot as a target for a language implementation. It supports a lot of stuff out of the box (even multimethods!) and it's quite easy to get started. It also provides tools to help you build a compiler, like a parser generator integrated with the rest of the system. The problem is that right now it is quite slow, slower than Perl or Python, and a bit buggy. It would be an ideal target platform for dynamic languages otherwise. I wouldn't use it for something needed in production at the moment.


> a bit buggy

Anything off the top of your head that you've been bit by?


Threading just doesn't work (it's going to be rewritten from scratch). Sometimes there are segfaults within managed code and sometimes there are memory leaks. Sometimes an assertion in the VM fails, causing the program to halt with a stack trace. A few releases ago the compiler of Parrot's assembly language reported wrong line numbers in error messages, but this has been fixed.


All those "sometimes" seems to suggest that Parrot is much more than a bit buggy.

A memory leak is one thing, but segfaults and assertion failures... Down to brass tacks: is this thing usable in its current state?


> Down to brass tacks: is this thing usable in its current state?

Experimentation and quick and dirty prototypes? Yes. Production code? No.


For the more static languages, LLVM seems hot and well-supported right now. There is a rich tradition of compiling via C, with good and bad results.

Gambit Scheme compiles via C and is one of the fastest Scheme systems around, with good interoperability via C. The Glassgow Haskell Compiler can also compile via C, but that's, AFAIK, an unmaintainable mess (search for "evil mangler").


Whatever seems like the most fun to you, of course.

Also: there are many more possible compilation targets than ones you list.


Yes, exactly, and that's why I was asking for recommendations and suggestions. I have been largely unable to find anything that gives a sensible overview of the technology and the various trade-offs.

Hence my question, although it seems like this is the wrong audience/forum.


There is no technical answer. OK, there are terrible answers, but not everyone agrees about which those are. In the end making a compiler is a world-affecting act: both to your own, and to those of others. You have to decide socially which group you want to associate yourself with, what kind of world you want.




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

Search: