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

You can't create 'idiomatic polyglots'. You just hack things together until they sorta work, for more than few languages this basically involves large strings and lots of backslashes, or base64 or something like that. (Writing a polyglot that does something more clever is obviously much better style, but it's incredibly hard.)


"Polyglot" in this case is referring to a person who can write in multiple languages, not a program written in multiple languages.


The site doesn't mention which meaning of "polyglot" the people behind it had in mind.

I assumed it was for people writing "polyglot" toy programs, because it'd be very useful resource.

I very rarely encounter uses of the term "polyglot" referring to people knowing large number of programming languages, so I didn't think of this use. Looking at it now, from this perspective, I have to say that I don't think it would be useful for these people, not enough depth.


> I assumed it was for people writing "polyglot" toy programs, because it'd be very useful resource.

It isn't so in this case, as the code for each language is clearly different. It's more of a 'construct translator' kind of thing.


> the code for each language is clearly different.

It's always the case. That's why writing them is interesting.


Different definitions. You seem to be thinking of programs that are valid in multiple languages. The page is more of a dictionary of language constructs.


> The page is more of a dictionary of language constructs.

Which would come incredibly useful if you wanted to write a polyglot program.

Why else would you use a reference like this? If you wanted to learn a language, or had to hack something in a language you don't know, you'll be better off using resources specific to given language(s).


One would use this when writing a new program or modifying an existing one in a language one doesn't know, but when one does know another one well. Seems quite obvious.




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

Search: