Swift vs Go vs Python vs Ruby

At this week's GTALUG meeting a couple of people asked what Swift looked like compared to other languages here is an example of a nursery rhyme: Swift: <https://github.com/myles/five-little-monkeys/blob/master/five-little-monkeys.swift> Go: <https://github.com/myles/five-little-monkeys/blob/master/five-little-monkeys.go> Python: <https://github.com/myles/five-little-monkeys/blob/master/five-little-monkeys.py> Ruby: <https://github.com/myles/five-little-monkeys/blob/master/five-little-monkeys.rb> I also mistakenly said that Go and Swift look like Python but Go and Swift look nothing a like. After some more research I should have said Go and Swift look the same but take a lot of influence from Python and C.

2015-06-12 14:06 GMT-03:00 Myles Braithwaite <me@mylesbraithwaite.com>:
At this week's GTALUG meeting a couple of people asked what Swift looked like compared to other languages here is an example of a nursery rhyme:
Swift: <https://github.com/myles/five-little-monkeys/blob/master/five-little-monkeys.swift>
Go: <https://github.com/myles/five-little-monkeys/blob/master/five-little-monkeys.go>
Python: <https://github.com/myles/five-little-monkeys/blob/master/five-little-monkeys.py>
Ruby: <https://github.com/myles/five-little-monkeys/blob/master/five-little-monkeys.rb>
I also mistakenly said that Go and Swift look like Python but Go and Swift look nothing a like. After some more research I should have said Go and Swift look the same but take a lot of influence from Python and C. ---
Cool. A few weeks ago I was reading about it. Well, not about all the 4, but about a few differences between Go and Swift, and I found an interesting article about it. If anyone is interested, there“s a good reading: http://blog.translusion.com/posts/a_comparison_of_go_and_swift/

Stacks and RPN are still the best thing ever*: %! % monkeys.ps % best run with % gs -q -dNODISPLAY monkeys.ps % if at all ... /verse { dup print ( little monkey) print dup (One) ne { (s) print } if ( jumping on the bed\n) print dup (One) ne { (One fell off and bumped his head\n) } { (They fell off and bumped their head\n) } ifelse print (Mama called the doctor,\nAnd the doctor said\n) print (One) ne { (No more monkeys jumping on the bed\n) } { (Put those monkeys right to bed\n) } ifelse print (\n) print } def [ (Five) (Four) (Three) (Two) (One) ] { verse } forall quit cheers, Stewart *: for job security, that is.

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thanx Myles! (since it was me who asked for a comparison) - --Bob, who's thinking of submitting a pull request to fix those monekys. On 12/06/15 01:06 PM, Myles Braithwaite wrote:
At this week's GTALUG meeting a couple of people asked what Swift looked like compared to other languages here is an example of a nursery rhyme:
Swift: <https://github.com/myles/five-little-monkeys/blob/master/five-little-monkeys.swift>
Go: <https://github.com/myles/five-little-monkeys/blob/master/five-little-monkeys.go>
Python: <https://github.com/myles/five-little-monkeys/blob/master/five-little-monkeys.py>
Ruby: <https://github.com/myles/five-little-monkeys/blob/master/five-little-monkeys.rb>
I also mistakenly said that Go and Swift look like Python but Go and Swift look nothing a like. After some more research I should have said Go and Swift look the same but take a lot of influence from Python and C. --- Talk Mailing List talk@gtalug.org http://gtalug.org/mailman/listinfo/talk
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (GNU/Linux) Comment: Ensure confidentiality, authenticity, non-repudiability iEYEARECAAYFAlV/gVgACgkQuRKJsNLM5epZjgCg3wnPiLXPY1Pgc1aB2C4Hza+O WywAnRtlQJPlpkI9QZmF9ROvuYnjehWq =RQ1L -----END PGP SIGNATURE-----
participants (4)
-
Bob Jonkman
-
Marcelo Cavalcante
-
Myles Braithwaite
-
Stewart C. Russell