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

Pages: 1-4041-

A few facts about Lisp and Haskell

Name: Anonymous 2011-04-18 6:59

Lisp:

* (expt -1 (exp 1))
#C(-0.6332554 0.7739428)


Haskell:

Prelude Data.Complex> (-1) ** exp 1 :: Complex Double
(-0.6332556513148192) :+ (-0.773942685266709)

Name: Anonymous 2011-04-18 7:07


Lisp                        | Haskell
----------------------------|------------------------------------------------------
* (floor (/ 1 0))           | Prelude> floor (1/0)
DIVISION-BY-ZERO signalled  | 1797693134862315907729305190789024733617976978942306572
                            | 7343008115773267580550096313270847732240753602112011387
                            | 9871393357658789768814416622492847430639474124377767893
                            | 4248654852763022196012460941194530829520850057688381506
                            | 8234246288147391311054082723716335051068458629823994724
                            | 5938479716304835356329624224137216

Name: Anonymous 2011-04-18 7:09

A big obstacle within the Lisp community is the fact that we seem to have too many right-thing thinkers, whereas it would be more healthy to stress the diversity that Lisp allows us to have.

Name: Anonymous 2011-04-18 7:21

> (expt -1 (exp 1))
-0.6332556513148192+0.773942685266709i

> (floor (/ 1 .0))
+inf.0


What's the point of this?

Name: Anonymous 2011-04-18 7:41

>>4
SBCL doesn't yield that output.

Name: Anonymous 2011-04-18 7:49

>>5
SBCL doesn't have > as prompt. That was Racket, this is MIT Scheme.
1 ]=> (expt -1 (exp 1))
;Value: -.6332556513148192+.773942685266709i
1 ]=> (floor (/ 1 .0))
Floating point exception

Name: Anonymous 2011-04-18 8:19

>>1
Works fine here (SBCL)

CL-USER> (expt -1 (exp 1))
#C(-0.6332554 0.7739428)
CL-USER> (expt -1 (exp 1.0d0))
#C(-0.6332556513148192d0 0.773942685266709d0)

If you want greater precision, you can get as much as you need if you use some implementation allowing for arbitrary precision (CLISP is one of them, but some may have it available as a library):

[1]> (setf (ext:long-float-digits) 1000)
[2]> (expt -1 (exp 1.0l0))
#C(-0.63325565131482003455221586387628567735988639211576341886045825804185702937821272120217359205393699036520823387683267699270474817719212534837635481841755448651254337491258807459118945922827840765642041394120264007413089579012984077420253480706874872203972770809833002187599896043439198998164240413021982194503L0
  0.77394268526670827825793271720774866145099893995475277126734359502621407976384339614987376269525171149625703363986531499024438903176103407856114984354038551419553115983909019787027150488923326085167062760431552788722548239917674407477700517719629900454875079046934080927802993869382237345209632790390374185827L0)

Name: Anonymous 2011-04-18 8:40

>>6
lol racket sucks.

Name: Anonymous 2011-04-18 8:42

>>7
It isn't about precission, but about haskell typesystem's incapability to infer return value.

Name: Anonymous 2011-04-18 8:55

>>8
That's MIT Scheme, idiot.

Name: Anonymous 2011-04-18 10:50

>>10
I'm talking about >>4 +inf.0, idiot.

Name: Anonymous 2011-04-18 11:01

For the floor thing,  same happens in C and standard is, for floating  point types, to evaluate 1/0 to Infinity, not to raise exception. But yeah, it is stupid.

(-1)**exp 1 correctly evaluates to NaN.

Name: Anonymous 2011-04-18 11:03

>>12
lol c/c++ sucks also.

inferior languages are inferior. they place is in a gas chamber together with their jewish inventors.

Name: Anonymous 2011-04-18 11:14

>>13
lol c/c++ sucks also.
Right.
inferior languages are inferior.
Right.
they place is in a gas chamber
Right.
together with their jewish inventors.
Get out.

Name: Anonymous 2011-04-18 11:57

>>14
I don't take orders from jewish maggots.

Name: Anonymous 2011-04-18 11:58

>>15
Fuck off and get out.

Name: nambla_dot_org_still_rules_you 2011-04-18 11:59

>>12
I thought division by 0 in C resulted in undefined behavior.

Name: Anonymous 2011-04-18 12:00

>>16
I don't take orders from jewish maggots.

Name: Anonymous 2011-04-18 12:00

Didn't C have a _Complex type?

Name: Anonymous 2011-04-18 12:01

>>16
Time to bring out the big guns now.
☣ Please try to ignore troll posts ☣
The code for this is as follows
[o][code]☣ Please try to ignore troll posts ☣ [/codd][/o]

Name: Anonymous 2011-04-18 12:02

>>20
This shabbos goy can't stand it, when I insult his jewish masters.

Name: Anonymous 2011-04-18 12:10

>>20
There's the [#] tag for that.
[o][code]☣ Please try to ignore troll posts ☣ [/code][/o]

Name: Anonymous 2011-04-18 12:11

>>22
Oh yeah, thanks. I never use it so I've forgotten it.

Name: Anonymous 2011-04-18 12:11

>>22
define "troll post"

Name: Anonymous 2011-04-18 14:09

>>9
MAW Lisp is just duck typed since Lisp has strong typing and unless you know what you're doing really well, is far more likely to be buggy. /thread

Name: Anonymous 2011-04-18 14:12

>>1
Cool story brah. Too bad I went through SICP with Haskell. /thread*2

Name: Anonymous 2011-04-18 14:21

>>26
Who cares.

>>25
Read SICP.

Name: Anonymous 2011-04-18 14:23

>>27
lol IHBT. That doesn't make sense. How could you say you don't care about a Haskeller who did SICP and then tell another one to do SICP. Stupid faggot. Go back to /g/

Name: Anonymous 2011-04-18 14:28

>>28
I don't care if you did SICP with Scheme, Haskell, APL, pencil and paper, your mother.
faggot. Go back to /g/
To accompany you there? Sure.

Name: Anonymous 2011-04-18 14:30

>>29
Then shut up about reading SICP and shut up period. This post is a pit of trolls. Ignore and move on.

Name: Anonymous 2011-04-18 14:56

>>30
There are no serious-discussion threads on /prog/ anymore, only trolls and /g/. Let me feed the trolls and shut up.

Name: Anonymous 2011-04-18 15:02

>>31
..... Fine. I'm a Haskeller and I feel adequate about the point I proved about my language. Go on and feed the trolls. No saging, I guess

Name: Anonymous 2011-04-18 15:11

>>25
Duck typing isn't a CL, that's Python.
In most Lisps, including CL, every possible language object (regardless of internal implementation) carries type with it, and variables themselves are untyped, unless you decide to go and force a type into them (for example, for optimization purposes: some compilers may even drop type information if you do that).
In my example, I just shown what happens when different types of floats are used as arguments. Common arithmetic operations are basically generic operations internally (although not so in the spec, despite supporting everything under the sun) which are optimized more heavily. Being such, they tend to support a variety of types for their arguments.

Duck typing as a style is supported in CL, for example through CLOS, but this isn't it.

Name: Anonymous 2011-04-18 15:15

>>33
This guy should read
>>31

Name: Anonymous 2011-04-18 15:16

>>17
gcc manual refers to this about infinities
http://en.wikipedia.org/wiki/IEEE_754-2008

Name: Anonymous 2011-04-18 15:20

>>34
I've been using /prog/ for serious discussion for years. It's getting pretty lonely here lately when only the spammers and low-quality trolls come.

Name: Anonymous 2011-04-18 15:22

>>36
Yeah. Well, I use Haskell, you use Lisp. Both pretty good languages. Can we just agree to agree on that and not waste time on this shit? We could be coding and learning more about our languages instead of talking about pointless bs

Name: Anonymous 2011-04-18 15:25

>>34
Don't use me as excuse to shit in /prog//say /prog/ is dead, thank you.

>>36
I know how you feel, I had some of the best discussions ever here. It's sad that now it's (again) filled with spammers and trolls.

Name: Autistic Duck 2011-04-18 15:25

My toy language is faster, longer and harder

Name: Anonymous 2011-04-18 15:27

>>37
I don't hate on languages, I hate on language advocates/fanboys.

Name: Anonymous 2011-04-18 15:30

>>40
I only defend my language from overly bad and needless trolls who love trolling Lisp and Haskell (yes, I defend other languages too). But i don't advocate. I like my language. Haskell is great for me. Don't like it? Use another one. Overzealous advocation is why macfags are hated

Name: Anonymous 2011-04-18 15:31

>>41
I already like you, and I'll not bitch about that -fag. You're welcome here, please post more.

Name: Anonymous 2011-04-18 15:36

>>42
Nice to be welcomed. Thanks. And to all those who say languages except for C/Sepples are toys has to google bootstrapping. And has to remember that C/C++ is still compiled to assembly. Languages are just the means to an end. Sorry, had to get that out of my system. Because most languages are good enough to do anything if you're good enough in the language.

Name: Anonymous 2011-04-18 15:40

>>43
Cont: I just like Haskell because its very math-oriented and as such, is very intuitive for math-oriented people. I like that. So its my language of choice. But I'll also admit that Lisp is a language of abstraction which focuses on logic and not math. Which is great for other people. OOP allows for cleaner code when done well. If a Java programmer learned Smalltalk and learned it well, he would be a god among men. It just depends on the person you are. So inb4 C/C++ is only real man language when Lisp was there first and language compilers are bootstrapped anyway and the bootstraps are generally supported on assembly for more deep-down compilers. Whew.

Name: Anonymous 2011-04-18 15:49

I dislike both Haskell and Lisp. Let's see if you're going to have the maturity not to flame a perfectly neutral post.

Name: Anonymous 2011-04-18 15:53

>>45
You didn't specify what you like.

Name: Anonymous 2011-04-18 15:55

>>45
Okay. You dislike both. But you didn't say they were bad languages. So I don't care

Name: Anonymous 2011-04-18 16:02

>>45
I don't see any ``LOLOL HASKAL AND LITHP ARE TOY LANGUAGES'' there.

>>43-44
I just like Haskell because its very math-oriented and as such, is very intuitive for math-oriented people.
Lisp is a language of abstraction which focuses on logic and not math.

Interesting point of view, I've never thought that.

Name: Anonymous 2011-04-18 16:07

>>48
Yeah. I may be a Haskeller at heart but obviously I've tried other languages. I prototype code in Scheme sometimes and then translate it to Haskell cause that takes like, seconds. I don't run my mouth about languages because I've tried a few before deciding on sticking to Haskell.

Name: Anonymous 2011-04-18 16:09

>>49
Cont: And I personally think that Lisp is a great language in its own way, its just not for me. So is Scala. And Erlang. And C. C++. Delphi. And the list goes on. I just chose Haskell. That's all. I love it. But I won't shove it down your throat or badmouth your choice like the 0/10 trolls here.

Name: Anonymous 2011-04-18 16:28

>>47
Using one-dimensional qualifiers (,,good'' vs ,,bad'') to describe things as complex as a programming environment is beyond stupid, at least in my opinion. You can tentatively set up a list of criteria and their corresponding weights, but it's hard (if not impossible) to get more than a handful of people to agree on them. Based on my personal set of criteria, I dislike all languages I am aware of. So what?

It's all subjective and it is doing nothing in advancing the situation -- we are no better than Reddit or Slashdot or all these communities of people who do nothing but argue and argue and argue all day without anyone actually stepping up and trying to make a change. I have nothing but respect for the so-called ,,In Lisp'' fellow, who has actually done something -- he hasn't published his findings yet, though I assume he wants to perfect his work before putting it out in the wild.

Programming, in my opinion, is one of the most creative activities in the world, seconded only by mathematics and arts. Many fail to understand this, perhaps the majority of programmers, even. Programming is more of an art than art itself. Seeing a bunch of people waste their time arguing about programming environments makes me think of a bunch of unjustifiably pompous art critics arguing the inner meaning of some modern artist's five and a half smudges of paint on a canvas. Humility is a virtue, and I have yet to see a ,,you're right, C++ does have some design quirks''; or a ,,you're right, Lisp is a bit too unfamiliar and doesn't do much to help it''; or a ,,you're right, Haskell introduces some perhaps unnecessary complexity at times''; or a ,,you're right, Python's block delimiter does make things awfully awkward at times''.

But all these things can be helped! If the languages you are dealing with aren't what you want them to be, then make them be. The maintainer isn't very open to change? Fork it or rewrite it. Unlike most fields of work, you truly have the power to change, maybe even revolutionize, your world -- and it is nothing but keystrokes away. Will you step up to the challenge?

Name: Anonymous 2011-04-18 16:31

>>51
This. I'm happy with Haskell. But if people want to use a language but end up not liking it, use another one or if that doesn't work, find one that's closest and change it until its perfect for you.

Name: Anonymous 2011-04-18 16:34

Oh and my other car is a cdr. I had to

Name: Autistic Duck 2011-04-18 16:44

My other cat is a VCR.

Name: Anonymous 2011-04-18 16:44

Same Haskeller who posted before. Why don't we argue about algorithms instead of programming languages. Far more efficient. I think there are enough "mainstream" languages to satisfy anyone's mindset or style. Maybe we should focus on the math behind it. Maybe I'm only saying this cause I'm a math-drunk Haskeller but that's how I feel. talk about the programs and not the languages behind them.

Name: Anonymous 2011-04-18 16:47

bump

Name: Anonymous 2011-04-18 16:50

>>55
Why don't we argue about algorithms instead of programming languages. Far more efficient.
Forget it, it's NP-complete.

Seriously though, I agree with you.

Name: Anonymous 2011-04-18 16:55

>>55
That's why /prog/ should be renamed /compsci/ and the spammers should get banned.

Name: Anonymous 2011-04-18 16:55

>>57
Alright then! Finally, no moar rage. What do you think of the merge sort. It seems tedious and the whole "keep spreading out the arrays/lists" idea seems too wasteful of space or cycles compared to a quicksort. What do you think?

Name: Anonymous 2011-04-18 16:58

>>58
Lol. I half-agree with that. Because like I said before. Functional programming with the JVM AND Java-like syntax? Scala. Lisp on a JVM? Clojure. Want a fully-loaded Lisp? CL. Want to be more constructive and abstractive with your code, doing more with less code? Scheme. Want low level programming? C. Want to move up from C but still keep many of the same facilities? C++. Like structured programming? Delphi. Like jesus christ. Talk about the math behind it at this point. And don't just go "fucking haskeller thinks he's a math professor." Its just what I think.

Name: Anonymous 2011-04-18 17:00

>>58
spammers should get banned
fuck you faggot

Name: Anonymous 2011-04-18 17:01

>>61
Lol u mad? Get over it. Stop spamming and trolling.

Name: Anonymous 2011-04-18 17:05

>>62
Never.

Name: Anonymous 2011-04-18 17:08

>>59
I kind of like Timsort.

Name: Anonymous 2011-04-18 17:24

>>64
Gtfo

Name: Anonymous 2011-04-18 17:26

>>65
I am superior to you in every way. There is no need for me to give arguments, for I am an expert programmer.

Name: Anonymous 2011-04-18 17:34

>>66
Cute

Name: 67 2011-04-18 17:58

>>66
Nice dubz by the way

Name: Anonymous 2011-04-18 20:03

I use Trolsort everywhere.

Name: Anonymous 2011-04-20 1:38

☣ Please try to ignore troll posts ☣

Name: Anonymous 2011-04-20 5:09

>>70
fuck you faggot

Name: reformed cobosexual 2011-04-20 8:33

>>1
i programmed in cobol once or twice. or was it thrice? i don't remember well, but i still fell ashamed after all these years.

Name: Anonymous 2011-04-20 11:37

>>72 fuck...  wrong thread

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