Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C > Haskell

Name: Anonymous 2015-10-17 14:21

C can do arrays and trees. Haskell can do trees but cannot do arrays. C is the winner.

Name: Anonymous 2015-10-17 14:24

Arrays are specified in the Haskell2010 standard.
See <https://www.haskell.org/onlinereport/haskell2010/haskellch14.html>

Name: Anonymous 2015-10-17 14:26

>>2
Immutable arrays are a joke.

Name: Anonymous 2015-10-17 14:27

Python has to do indentation but can avoid parentheses. Lisp has to do indentation too but cannot avoid parentheses. Python is the winner.

Name: Anonymous 2015-10-17 15:05

Name: Anonymous 2015-10-17 18:03

>>5
Those are based on C FFI. They are C arrays, because Haskell cannot do arrays.

Name: Anonymous 2015-10-17 18:47

but can C do monads?

Name: Anonymous 2015-10-17 19:25

>>7
Obviously. Even the Haskellists admit it.

http://blog.sigfpe.com/2007/02/monads-in-c-pt-ii.html

Name: Anonymous 2015-10-17 19:26

Haskell is just a C program.
You can do everything Haskell does (and much more) using C.

Name: Anonymous 2015-10-17 19:43

C can do manual memory management and GC. Haskell can do only GC. C is winner.

Name: Anonymous 2015-10-17 20:10

>>4
lisp doesnt't require indentation though mega retard

Name: Anonymous 2015-10-17 20:24

>>11
It does in practice. Look at any real Lisp code and it's indented like Python because otherwise it would be unreadable. Parentheses only help the computer, the human needs the indentation.

Name: Anonymous 2015-10-17 20:30

>>11
You probably have never seen real Lisp. Have a look here, it's all Python with extra parentheses:

https://github.com/edicl/drakma/blob/master/read.lisp

Name: Anonymous 2015-10-18 12:06

Every language has its indentation conventions. That doesn't mean FOIC.

Name: Anonymous 2015-10-18 12:15

>>14
Try to write Lisp without Python-style indentation for a day. You'll howl.
Besides, admitting that Lisp has an indentation convention is already a failure on your part, because that means the parentheses should be optional not mandatory.

Name: Anonymous 2015-10-18 13:01

emacs can automatically indent your lisp for you.

Name: Anonymous 2015-10-18 13:05

>>16
But can it eliminate unnecessary parentheses?

Name: Anonymous 2015-10-18 19:55

>>17
Yes, but that feature is only supported by the ocamlc Lisp compiler.

Name: Anonymous 2015-10-18 23:58

>>15
How would you propose writing an expression like (+ 1 2 3 (* 4 5 6) 7 8 9) without parens?

+ 1 2 3 * 4 5 6 7 8 9 does not work

+ 1
2
3
* 4
5
6
7
8
9

works but cannot be on one line.

+ 1 2 3 * 4
5
6
7 8 9
just looks extraordinarily strange to me, and would get worse with more complicated expressions.

In Lisp, you could write the expression with the original spacing, or like this:
(+ 1
2
3
(* 4
5
6)
7
8
9)


or like this:
(+ 1 2 3 (* 4
5
6)
7 8 9)


and it is simple to write an interpreter -- the spacing does not matter. Writing an interpreter to work without parens would be much more complicated and error prone. The parens allow the programmer to choose whatever indentation style makes the most sense for the application.

Name: Anonymous 2015-10-19 0:04

>>19
As an after-thought, how could you maintain the first-class citizenship of functions without parens? How would you know whether a function name is being passed as a parameter or if it is being called? With parens it is simple -- see if there is an open paren directly before the function name.

Name: Anonymous 2015-10-19 0:15

>>19
FIOC
>>20
FIOC

Name: Anonymous 2015-10-19 2:44

>>19
1 2 3 + + 4 5 6 * * 7 8 9 + + +

Name: Anonymous 2015-10-19 4:07

>>20
How would you know whether a function name is being passed as a parameter or if it is being called?
#'my-function

Name: Anonymous 2015-10-19 4:11

>>19
1 2 + 3 + 4 5 * 6 * + 7 + 8 + 9 +

Name: Anonymous 2015-10-19 5:13

>>22,24
So, not Lisp.

Name: Anonymous 2015-10-19 20:05

>>25
Nor Python. NEXT!

Name: Anonymous 2015-10-22 4:59

>>15
I inline Lisp all the time. No indentation, or any other special characters (like Python's semicolon bullshit) required. Plus, I can put a lambda on one line or as many lines as I like, unlike FOIC.

Also, Python simply cannot do a multi-line lambda, purely because of FIOC. I know I already mentioned that, but it's an important enough example to bring it up again.

Name: Anonymous 2015-10-22 6:15

L B
A D
M A

Name: Anonymous 2015-10-22 6:18

L
A
D M
A B

Name: Anonymous 2015-10-22 17:16

L A M B A D A

Name: Anonymous 2015-10-22 17:22

Why wouldn't you want all strings to be represented as lists? It's not that much overhead, and the performance loss of having to traverse a list that will never change or be reordered isn't that important.

Name: Anonymous 2015-10-22 17:42

'(You are now aware Lisp does not need strings)

Name: Anonymous 2015-10-22 18:59

>>32
'|It does not even need lists.|

Name: Anonymous 2015-10-22 20:21

>>33
That's an unportable CLism, though.

Name: Anonymous 2015-10-22 20:49

>>34
No it isn't.
CHICKEN
(c) 2008-2015, The CHICKEN Team
(c) 2000-2007, Felix L. Winkelmann
Version 4.10.0 (rev b259631)
#;1> '|a symbol|
|a symbol|

Welcome to Racket v6.2.1.
-> '|hax my anus|
'|hax my anus|

Name: Anonymous 2015-10-22 23:03

>>32
Why would you do that? How are you going to access that character by character?

Name: Anonymous 2015-10-22 23:39

>>36
'( '(Y o u) '(a r e) '(n o w) '(a w a r e) '(L i s p) '(d o e s) '(n o t) '(n e e d) '(c h a r a c t e r s))

Name: Anonymous 2015-10-23 6:23

Erlang stores strings as lists of integers. But it is not a Lisp, and can go fuck itself up its own monitor port.

Name: Anonymous 2015-10-24 8:57

>>19
foldl '+ '(1 2 3
(* 4 5 6)
7 8 9)

Name: Anonymous 2015-10-24 9:02

>>19
Writing an interpreter to work without parens would be much more complicated and error prone
As always, the Lisp excuse is "we're shitty programmers and cannot solve any complicated problem waahaaa".

The parens allow the programmer to choose whatever indentation style
But they don't allow him to choose a style without parentheses in case he indents following a certain convention which is what most Lispers do.

>>20
If it's first on the line or follows a parenthesis, it's called. Otherwise, it's passed. You should really learn Haskell syntax.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List