"Hello, World" in 20 languages - need help.

1 points by rzwitserloot ↗ HN
I'm planning on giving a small (barcamp-level) talk on the intricacies of varying programming languages. The basic setup is going to be 'hello, world' in various languages.

I've already picked a small set of esoterics to throw in there more as comic relief ('piet' in Piet is definitely nice, for example), but I'm trying to find short but profound snippets in various languages. So far I have:

* Java: "Hello, World".toCharArray().each(c -> System.out.print(c)); <--- these are java 8 closures, and would let me expand on how java closures in java 8 require a single interface type with 1 method to match, which then in turn lets you omit the type of the parameters. Closures without first-class functions.

* Fortress: Turn "Hello, World!" into a conclist, then print the list as 'self, left, right', which produces something like " lHeol,loWrd!" reliably. Explain what makes conclists so interesting from a parallelizing perspective. Take-away lesson: Conc lists; how anything with accumulators is not practically parallelizable, and that conslists are thus not that great, at least for parallelization purposes.

* Scala: turn hello world into a .par() list of characters then print those. Explain how at least in theory the output will be "Hello, World!" but with the string jumbled up non-deterministically. Take-away lesson: Parallelism can be that simple.

* ObjC or smalltalk: A random messagesend with colons in the method name to highlight this creative and somewhat unique way of providing named parameters. Take-away lesson: Sometimes weird design choices lead to elegant solutions.

* Javascript: Do something pretty profound using no actual alphanums anywhere - just wonky symbols. Explain how this was used to hack facebook at some point. Take-away lesson: Security is a heck of a lot harder than you think it is. Use deny-all with whitelists, not allow-all with blacklists.

.... but that's where I'm kind of stranded. I'd prefer it if I can show more tidbits of code that let me explain a relatively profound idea (such as conclists and parallel processing) in a relatively short amount of time.

So, hackernews: I'm looking for more ideas.

2 comments

[ 2.1 ms ] story [ 15.3 ms ] thread