A Rubyist walks into an Erlang
1
Name:
Anonymous
2013-06-10 17:13
2
Name:
Anonymous
2013-06-10 17:59
``Syntactic sugar'' is shit for retards.
3
Name:
Anonymous
2013-06-10 22:48
``Sugary shit'' is syntax for retards.
4
Name:
Anonymous
2013-06-11 0:20
(bon)Erlang is a fun language, but if you want to get something done, you should just use Ruby (and Rails if doing webshit).
5
Name:
Anonymous
2013-06-11 0:30
Thanks for reminding me why I hate Ruby.
6
Name:
Anonymous
2013-06-11 0:52
Erlang:
lists:map(fun(N) ->
N * 2
end, [1,2,3,4,5]).
Ruby:
[1,2,3,4,5].map do |n|
n * 2
end
Python:
[n * 2 for n in [1, 2, 3, 4, 5]]
7
Name:
Anonymous
2013-06-11 1:17
>>6
Erlang:
[2*N || N <- [1,2,3,4,5]].
8
Name:
Anonymous
2013-06-11 1:27
K:
{2*x}'!6
9
Name:
Anonymous
2013-06-11 1:27
K:
{2*x}'!6
10
Name:
Anonymous
2013-06-11 1:58
Well, my apologies, but I'm having a bit of trouble wrapping my brain around the lack of aesthetic sense here. So forgive me for overreacting.
God! Why can't everybody as AESTHETICALLY SENSITIVE as me! I write BEAUTIFUL frontend WEB APPS with TWITTER BOOTSTRAP and RUBY ON RAILS on HEROKU with my MACBOOK for Jobs sake! Am I the only one with any
TASTE ?!
11
Name:
Anonymous
2013-06-11 2:17
>>10
write
What a vulgar word. I don't write , I compose beautiful symphonies of elegant abstraction. Writing is for people who soulessly peck away in C and FORTRAN for T he M an. Each work of art I create is a poem to Nature herself, who reveals her mysteries to us through jQuery , Rails , and Node.js . Hold on, let me Tweet through my iPhone on my todolist.io page.
12
Name:
Anonymous
2013-06-11 11:38
>>11
Fucking kill yourself.
13
Name:
Anonymous
2013-06-11 11:55
>>12
Fucking learn to appreciate sarcasm.
14
Name:
Anonymous
2013-06-11 12:00
>>11
Can I follow you on
Forrst ?
15
Name:
Anonymous
2013-06-11 12:29
>>6
How G-d would write it:
(map (lambda (n) (* 2 n)) '(1 2 3 4 5))
16
Name:
Anonymous
2013-06-11 12:37
>>15
Hnnng, dat homoiconicity.
17
Name:
Anonymous
2013-06-11 15:59
Symta: [1 2 3 4 5] map: N => N * 2
Ruby: [1,2,3,4,5].map do |n| n * 2 end
Python: [n * 2 for n in [1, 2, 3, 4, 5]]
Lisp: (map (lambda (n) (* n 2)) '(1 2 3 4 5))
Erlang: lists:map(fun(N) -> N * 2 end, [1,2,3,4,5]).
C#: (new List<int>() {1, 2, 3, 4, 5}).ConvertAll(n => n * 2);
18
Name:
Anonymous
2013-06-11 16:05
>>8
Symta: X 2*?
K: {2*x}'!6
19
Name:
Anonymous
2013-06-11 16:07
>>17
Perl: map { $_ * 2 } qw(1 2 3 4 5)
20
Name:
Anonymous
2013-06-11 16:09
>>19
No. You dont.
Symta: [1 2 3 4 5]{? * 2}
Perl: map { $_ * 2 } qw(1 2 3 4 5)
21
Name:
Anonymous
2013-06-11 16:17
>>19
Perl version would look like:
Perl: map (sub {my ( $x ) = @_; $x * 2 }) qw(1 2 3 4 5)
Because Perl functions have no argument lists, so binding requires explicit pattern-matching.
22
Name:
Anonymous
2013-06-11 16:19
>>21
Calling Perl's lambda looks even uglier:
perl -e 'print ((sub {my ( $x ) = @_; $x * 2 })->(123))'
23
Name:
Anonymous
2013-06-11 16:19
>>20
Perl: map{$_*2}1..5
Symta: [1 2 3 4 5]{? * 2}
24
Name:
Anonymous
2013-06-11 16:20
>>22
And there are no macros to abstract away the horror.
25
Name:
Anonymous
2013-06-11 16:22
>>23
Symta: (1 to 5) ?*2
Perl: map{$_*2}1..5
told'ya.
26
Name:
Anonymous
2013-06-11 16:22
D :
[1, 2, 3, 4, 5].map!(a => a * a)
27
Name:
Anonymous
2013-06-11 16:25
Haskell: map (*2) [1, 2, 3, 4, 5]
Symta: [1 2 3 4 5] map: N => N * 2
28
Name:
Anonymous
2013-06-11 16:26
>>27
Symta: [1 2 3 4 5] map ?*2
Haskell: map (*2) [1, 2, 3, 4, 5]
29
Name:
Anonymous
2013-06-11 16:27
Perl6: (1..5).map(* *2)
30
Name:
Anonymous
2013-06-11 16:27
>>26
a * a
your code is broken.
31
Name:
Anonymous
2013-06-11 16:28
>>29
Perl6
(* *2)
I'll take APL or K any day!
32
Name:
Anonymous
2013-06-11 16:33
>>25
Golden changes symta in real time.
33
Name:
Anonymous
2013-06-11 16:43
In the end, only lisp is truly beautiful.
34
Name:
Anonymous
2013-06-11 17:51
>>33
if with lisp you mean scheme you are right
35
Name:
Anonymous
2013-06-11 18:07
36
Name:
Anonymous
2013-06-11 19:06
>>31
(1..5)
Range from 1 to 5
map(* *2)
"whatever" times 2
I also hate that * means more than one thing
I would have written it like this
2 Z* (1..5)
37
Name:
Anonymous
2013-06-14 16:33
in this ITT thread we found that fangled anal toys for retards PYSTHON and HACHKELL suck in old mega-languages for all times C and Perl all times
---
best variant in PYSTHON:
http://ideone.com/udDJ9 (imperative diarrhea)
two variants in HACHKELL:
1. fucking fucked in all senses and imperative shit:
http://ideone.com/M42su (suck C)
2. declarative fuck
http://ideone.com/0e3qE (suck in declarative fuck in perl)
---
for comparison:
perl:
http://ideone.com/i0ob4 http://ideone.com/olq5B
C:
http://ideone.com/ap43H
LUA:
http://ideone.com/DVdhr http://ideone.com/Xkj4D
---
http://ideone.com/6cZYq lisp suck as expected, and probably not the right option
(some lousy options with 33-fold nesting brackets were faster but such garbage nobody wants when there is a simple solution in C)
Newer Posts