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

Pages: 1-4041-

Schemeing in Haskell

Name: Anonymous 2013-07-15 14:44

Well, I guess this settles it. Anything Scheme can do, Haskell can do better. I think it's time to stop using a weenie language like Scheme and start programming like real men.

http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours

Write Yourself a Scheme in 48 Hours

Most Haskell tutorials on the web seem to take a language-reference-manual approach to teaching. They show you the syntax of the language, a few language constructs, and then have you construct a few simple functions at the interactive prompt. The "hard stuff" of how to write a functioning, useful program is left to the end, or sometimes omitted entirely.

This tutorial takes a different tack. You'll start off with command-line arguments and parsing, and progress to writing a fully-functional Scheme interpreter that implements a good-sized subset of R5RS Scheme. Along the way, you'll learn Haskell's I/O, mutable state, dynamic typing, error handling, and parsing features. By the time you finish, you should be fairly fluent in both Haskell and Scheme.

There are two main audiences targeted by this tutorial:
People who already know Lisp or Scheme and want to learn Haskell
People who don't know any programming language, but have a strong quantitative background and are familiar with computers

Name: Anonymous 2013-07-15 15:10

static typing
instant fail.

Name: Anonymous 2013-07-15 15:11

call-by-name evaluation
impractical.

Name: Anonymous 2013-07-15 15:34

Monads are stupid.

Name: Anonymous 2013-07-15 15:34

>>2
dynamic typing
instant fail.

Name: Anonymous 2013-07-15 15:41

Anything Haskell can do, C can do eventually.

Name: Anonymous 2013-07-15 15:52

>>6
I doubt that. It is very hard to write slow code in plain C.

Name: Anonymous 2013-07-15 16:33

<Riastradh> yes, I've seen http://jonathan.tang.name/files/scheme_in_48/tutorial/overview.html, and I think it's a great way to give a completely bogus characterization of Scheme implemented in very badly written Haskell, and my response is http://mumble.net/~campbell/tmp/Scheme.hs .

Name: Anonymous 2013-07-15 17:00

like real men
check your privilege

Name: Anonymous 2013-07-15 17:07

>>9
Fuck you and die.

Name: Anonymous 2013-07-15 17:45

>>10
``real man'' is outdated arbitrary bullshit that is harmful to the INDIVIDUAL

Name: Anonymous 2013-07-15 17:45

>>8
C/C++ version: https://gist.github.com/ofan/721464

Moral: use Haskell is when you want artificial problems.

Name: Anonymous 2013-07-15 17:53

>>11
ORLY

Name: Anonymous 2013-07-15 17:58

in fact, von neumann's architecture can express any conceptions, so that OOP and FP is most publicized special case of pointer to functions

Name: Anonymous 2013-07-15 18:03

also antisemites are subhuman people and live near the toilet

Name: Anonymous 2013-07-15 18:04

>>14>>15
Shalom, Hymie!

Name: Anonymous 2013-07-15 18:05

Anything Scheme can do, Haskell can do better.
Except implement Scheme.

Name: Anonymous 2013-07-15 18:13

>>17
But Haskell can implement a Scheme which can implement the Scheme. Simple and easy. How difficult would it be to implement Haskell in Scheme?

Name: Anonymous 2013-07-15 18:49

>>4
This, fuck Monads.

Name: Anonymous 2013-07-15 19:55

придумывают разные хачкели-хуйчкели, мондады-хуйячкили
а программы все также разрабатываются медленно дорого и получается таже хуйня
потомушто все далвют неправильна !!!
надо всех ненужных гуманитариев отправить в концлагеря на стройки века
а людаям с нормальными мозгами назначить 3 государственных жены
пройдет 23 года и проблема высокой стоимости разработки и низкого качества программ будет навсегда решена

Name: Anonymous 2013-07-15 19:57

>>20
Shalom, Hymie!

Name: Anonymous 2013-07-15 20:20

check em

Name: Anonymous 2013-07-15 22:31

Don't listen to this guy >>19
Once you put your dick in a Monad you'll never get it out

Name: Anonymous 2013-07-15 23:05

1. для типичного посетителя раздела проблема реальная написать факториал - область его интересов языки которые позволяют писать факториалы без нания архитектуры фон-неймана
2.нормальный человек может написать фаеторрила и более сложные программы
область его интересов как сделать ето лучше, чтобы израсходовать метьше памяти и времени и дать процессору ресурсы для других задачь
3.всвязи с вышеизложеным прошу личностей описаных в 1м пункте проследовать на парашу и не кукарекать

Name: Anonymous 2013-07-16 0:31

>>24
Stop generalizing here, everyone on /prog/ can write simple C style multiplication factorial in a minute.Factorials and fibs are trivial algorithms.
Its would be useless since it wouldn't handle numbers above 12(int32),20(int64) and 170(double). The logical idea is to use optimized factorial from GMP and don't reinvent the wheel(reimplementing bignums,fast factorials and fast multiplication algos).

Name: Anonymous 2013-07-16 14:14

>>25
I can't, and won't. Programming is for losers.

Name: Anonymous 2013-07-18 1:14

>>26
My mom said I'm a winner...

Name: Anonymous 2013-07-18 1:27

>>27
Only if your mom Jеwish.

Name: Anonymous 2013-07-18 3:38

The learning curve with Haskell is brutal. More of a wall than a curve. When you start, the compiler error messages seem cryptic and completely unhelpful. For bonus points, getting a development environment setup can be a complete pain on anything other than a very recent Linux box and there are a whole host of very similar sounding libraries (should you use Data.Map or Data.HashTables or Data.HashMap? As a beginner, you can’t tell). Doing basic IO is a complete nightmare and you can’t even change the value of a variable.

It’s pretty telling that both of the main textbooks for learning Haskell put of doing simple IO until quite a way into the book. Real World Haskell includes exercises like calculating the convex hull of a set of points before doing IO.

Convex hull? What?

Oh. Yes. There’s a lot of maths involved.

Mostly I think this is a reflection of the background of the people involved, but there is no doubt that the nature of the language requires a fair about of maths to learn. You really do need to understand what a monad is. And a functor. And an applicative functor. And most of the stuff in the Typeclassopedia (I confess to not having got as far as co-monads myself)

There’s a level of abstraction that needs mathematical sophistication. How much formal maths it needs, I really don’t know. A final year undergrad course in abstract algebra is sufficient

Name: Anonymous 2013-07-18 3:42

Unlike Python (or Java), there doesn’t seem to be a small subset of the language that works and which lets someone plod along solving real problems. Maybe not solving them in the best way, but getting stuff done. With Haskell, my experience is that it’s a big language and it’s only after gaining familiarity with a decent amount of it that it starts to feel like it hangs together and makes sense.

Name: Anonymous 2013-07-18 4:15

>>28
angry reply

Name: Anonymous 2013-07-18 4:46

>>7
I doubt that. It is very hard to write slow code in plain C.
Ahahahahaha oh wow dude really I'm crying, I'm crying tears.

Inexperienced programmer confronted with C produces code that'd make your hair fall off an slither away. Strcats everywhere, linked lists instead of dynamically resizing arrays, functions with five to twenty `char buffer[2048 + 2];` (why "+2"? fucked if I know) and again strcats everywhere...

Name: Anonymous 2013-07-18 5:16

>>32
Inexperienced programmer confronted with Ruby...

Name: Anonymous 2013-07-18 6:44

>>33
def kawaii($spagetti)
   return "code"

Name: Anonymous 2013-07-18 7:13

>>32
The code performs as expected though. You are missing the point. Code is not slow because it failed to be the optimal solution; it is slow because of the compiler and whatever.

Name: Anonymous 2013-07-18 7:21

>>35
Or just untrained programmer, which is what >>32 is complaining about: "It's not easy to learn"-excuse

He was baiting you, he "interpreted" text as "It is very hard to write [] code [slow] in plain C." Instead of "It is very hard to write slow [programs, when coded] in plain C."

Name: Anonymous 2013-07-18 7:57

>>36
Your post is 100% nonsense. Fuck the fuck off.

Name: Anonymous 2013-07-18 11:23

>>35,36
Are you both retarded?

The statement was, "It is very hard to write slow code in plain C" -- this is bullshit, and I don't mean it any autistic sense, like that it's easy to write slow code if you want it. My point is that the language actively encourages both novice and experienced programmers to write abysmally ineffective code.

Contrast C to C++: you want to work with strings, the path of least resistance in C++ is to use std::string, problem solved. The path of least resistance in C is to use huge stack-allocated buffers and strcat (or worse, strlen-strlen-realloc-strcat, and yeah, I've seen that in the wild). It takes a lot of conscious effort to choose one of the efficient string-manipulation libraries (and God have mercy on your soul if someone else in your project chooses a different one), and it is still harder to use than the inefficient method. Same shit for, say dynamic arrays -- if you have std::vector you use std::vector, case closed, if you work in C you're more likely to thrash all your cache with your linked lists, either because you're thinking yourself very clever, or because even if you bothered to find a library implementing dynamic arrays, the plain list manipulation code still looks better. Same for linear searches vs using a dictionary.

Haskell sucks too in this respect somewhat, but at least at intermediate level nice-looking code is also reasonably fast code.

Name: Anonymous 2013-07-18 14:09

>>38
You fucking piece of shit you have no idea who you are responding to. That's okay, such is life here on /prog/.

My point is that the language actively encourages both novice and experienced programmers to write abysmally ineffective code.
No it does not. How the fuck does a language encourage you for anything is beyond my comprehension, fuck. Surely the seasoned programmer is not to fuq with.

I am not sure what this path of least resistance bullshit thing is. There is only one true path and that is the path of correct code implementing optimal solutions.

(or worse, strlen-strlen-realloc-strcat, and yeah, I've seen that in the wild)
That is why it is called 'the wild`, because things are fucking wild. Having a project though is something different. If some fucking idiot has chosen a different library than yours in the fucking project you clearly lack the communication/management skills required for a basic effort at writing a simple fucking 10000loc program. Fuck off. There's a great string library by the way by Paul Hsieh, who I do not expect you to have heard of since you are a teenagerous imbecile from some fuqin low-level university. http://bstring.sourceforge.net/

Oh, abouy your remark regarding linked lists and dynamic arrays, I am sick of reading your stupid samefag comments that dynamic arrays are better than linked lists for every task. Why don't you fucking fuck off instead? Write me a lisp implementation using dynamic arrays you stupid fucking faggot and we will see how that compares to my 1000loc implementation of r5rs scheme.

You fucking motherfucker, you just had to angry me didn't yuo?

Name: Anonymous 2013-07-18 15:19

>>32
dynamically resizing arrays
They are slow. C programmer allocates everything he needs at the start of program. A good example is a DOS program, which allocates all memory and uses it to limit.

Name: Anonymous 2013-07-18 15:29

>>40
And if C programmer doesnt know what he needs, then he shouldn't be writing the code in the first place.

Name: Anonymous 2013-07-18 16:36

>>39
You say fuck too much.

Name: Anonymous 2013-07-18 17:04

>>32
do you have some kind of problem with strcat? because if you have a problem with strcat, then you have a problem with me.

Name: Anonymous 2013-07-18 22:57

fucking fucking fuck fucking check fucking my fucking shit fucking fuck fuck fucking dubs you fucking fuck fucking fag fucking got.

Name: Anonymous 2013-07-19 0:53

>>44
told

Name: Anonymous 2013-07-19 0:58

HELP! I was using tor and got a child porn popup?
I was just using tor to look around the secret internet some (I've never been there before, do I downloaded tor and looked around some) and after a while a site poped up, and it was full of child porn. I looked around a little to make sure I knew what I was seeing, and now I'm really worried. Do you guys think I could get in any serious trouble? Could anyone even catch it because of tor?

Name: Anonymous 2013-07-19 1:02

>>46
Well, you were safe before, but now that you announced it here, moot is going to call his buddies in the FBI and they're going to lock you up and throw away the key for sure.

Name: Anonymous 2013-07-19 1:04

>>46
If you saw the picture, it was downloaded to your computer.

Answer the door. It's the cops.

Name: Anonymous 2013-07-19 1:08

>>47
Actually, no. A few pedos already got jail sentences for browsing TOR with pants off.
http://www.wcpo.com/dpp/news/region_northern_kentucky/burlington/Tor-network-at-heart-of-Northern-Kentucky-child-porn-case

Name: Anonymous 2013-07-19 2:36

>>49
99% sure they didn't catch them through technical means. probably just infiltrated the group as a sysadmin and added a little web bug to track them (because paedos are dumb). that's how I'd do it anyway.

>>46
first erase your browser cache and cookies and everything. if you're on linux, use "dd if=/dev/urandom of=/path/to/file bs=1M" to make a large file that takes up all the free space on the partition you have your browser data on. delete the file afterwards (obviously you fucking retard). also report the URL like a good citizen and stop clicking random ads like a spazing monkey.

Name: Anonymous 2013-07-19 2:52

>>50
paedos are dumb
Richard Goldberg was an aerospace engineer. Although I doubt Goldberg was a pedo himself. Just had a Geschäft selling CP.

Name: Anonymous 2013-07-19 9:15

>>46
How in the name of the specification is that even achievable?

>>50
Tell that to your Public officials, including education officials. The dumb ones are clergy types.

Also, the circumvention is easy, host the content over seas like in India. Kiddi porn is legal and taxed there. Great for the economy too.

Dumb politicians. The serious crime is the huge human trafficing industries right in the heart of the countries that ``ban′′ kiddi porn.

Name: Anonymous 2013-07-19 14:51

>>51
Still dumb

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