13 ms·
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 a
by phaker 15y ago
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.)
- lubutu 15y ago"Polyglot" in this case is referring to a person who can write in multiple languages, not a program written in multiple languages.
- phaker 15y agoThe 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.
- tincholio 15y ago> 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.
- phaker 15y ago> the code for each language is clearly different. It's always the case. That's why writing them is interesting.
- jsnell 15y agoDifferent definitions. You seem to be thinking of programs that are valid in multiple languages. The page is more of a dictionary of language constructs.
- phaker 15y ago> 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).
- roel_v 15y agoOne 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.