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

Pages: 1-4041-

Show me functional IO

Name: Anonymous 2007-08-17 0:27 ID:qrTUeVE5

IO is not referentially transparent. Show me functional I/O. Then show me the same thing imperatively. Which is simpler.

Name: Anonymous 2007-08-17 1:11 ID:yt3VJBYn

I/O isn't really done in functional languages, because those languages only exist for theoretical purposes.

Name: Anonymous 2007-08-17 8:25 ID:Heaven

Show me an oxymoron.

Name: Anonymous 2007-08-17 10:12 ID:u+rS1G9h

C io: printf("%d", 3);
Haskell io: print 3

lol

Name: Anonymous 2007-08-17 10:19 ID:lQfsGlCa

The idea (in Haskell):

doSomething :: World -> World

print :: a -> World -> World

It's very simple really.

Name: Anonymous 2007-08-17 10:25 ID:/4AmOB2A

>>1
Judging from >>4 , I'd say Haskell is clearly simpler. Are you trying to make some sort of statement? Speak your mind.

Name: Anonymous 2007-08-17 10:32 ID:dducprHi

Only novice programmers care about their programs' output.  Satori programmers don't even write their programs down, they don't even have to think about the programs -- they already know the answer.

Name: Anonymous 2007-08-17 13:55 ID:2n0j+IS/

No program can be truly functional, because time passes destructively and irreversibly as it runs.

Disclaimer:  I am a functional programmer.

Name: Anonymous 2007-08-17 14:01 ID:p1ALdnL5

Does LISP has STDIN?

Name: Anonymous 2007-08-17 14:04 ID:Heaven

>>9
*facepalm*

Name: Anonymous 2007-08-17 14:16 ID:u+rS1G9h

>>9
Is STDIN a list?

Name: Anonymous 2007-08-17 14:18 ID:u+rS1G9h

>>9
Does it bug anyone else how Lisp is the first thing that pops into everyone's mind when the words "functional programming" appear?

Name: Anonymous 2007-08-17 14:25 ID:qXou5ahM

>>12
Kind of yes. It does both functional programming and Lisp a great disservice.

Name: Anonymous 2007-08-17 14:26 ID:u+rS1G9h

>>13
Yes. It's a LIST PROCESSING language, people. That happens to be flexible enough to allow something resembling FP, but that's not what it is.

Name: Anonymous 2007-08-17 15:01 ID:8sTPQtT/

IM READING YOUR FUNCTIONAL PROGRAMMING THINKING ABOUT LISP

Name: Anonymous 2007-08-17 15:10 ID:Heaven

>>15
Show me other functional languages that don't suck..

Name: Anonymous 2007-08-17 15:28 ID:Heaven

>>7
God damn that joke is old.

Do you tell the same joke over and over to your friends?

Do they stay friends with you?

Name: Anonymous 2007-08-17 15:37 ID:Heaven

>>16
ECMAScript
Factor
C#

unless you want purely functional languages, but lisp isn't purely functional.

Name: Anonymous 2007-08-17 15:42 ID:Heaven

>>16
PHP

Name: Anonymous 2007-08-17 16:03 ID:Heaven

>>17
My other car is a cdr.

I have no friends, that why I'm here at /prog/.

Name: Anonymous 2007-08-17 16:11 ID:qrTUeVE5

>>6
print 3 is not a valid answer. Only 5 bothered trying to give a real answer.

Well the printing is a side effect. The return of print is an arbitrary value, the IO occurred externally. Which is silly because if you rely on laziness you need to know when the side effects of IO are required or not.

Try reading a list in.

Name: Anonymous 2007-08-17 16:47 ID:Heaven

>>19
Enjoy your flawed security.

Name: Anonymous 2007-08-17 21:51 ID:kcSOtizV

(input)
 )out(

Name: Anonymous 2007-08-17 22:11 ID:1Zd6TYY6

>>8
Win

>>14
Lisp is like most languages that borrow from it (Python, Ruby, JavaScript, Lua): a bit of everything, so you can use the right tool for the right job at the right time.

Name: Anonymous 2007-08-17 23:29 ID:djIfg4hV

>>13
>>14
it's one of the oldest, if not the oldest, language that supports functional programming. not pure, but still. it supports it.

Name: Anonymous 2007-08-17 23:39 ID:Heaven

The best program in the whole eternity (written in lisp) -- behold:
x

Name: Anonymous 2007-08-17 23:57 ID:u+rS1G9h

>>26
That variable doesn't even seem to be bound.

Name: Anonymous 2007-08-19 23:51 ID:h072jnb6

Programs that do I/O aren't purely functional. But programs that don't do I/O are boring and pointless. Therefore it's better to specify I/O in a manner that preserves referential transparency and obeys most of the conventions of the functional language underneath. Hence the IO monad in Haskell.

That good enough? No? Then go suck on some "uniqueness types" in Clean. Hint: they don't do parser monads in Clean.

Name: Anonymous 2007-08-20 5:32 ID:mLERogCq

Omae monad

Name: Anonymous 2007-08-20 5:52 ID:XE/iz0zI

>>29
I see what you did there.

Name: Anonymous 2007-08-20 5:53 ID:XE/iz0zI

>>30
also,  my ID is awesome

Name: Anonymous 2007-08-20 11:53 ID:UYyo6+r0

NP Type System

Name: Anonymous 2007-08-20 11:54 ID:UYyo6+r0

>>28
Right but monadic style is not simple. You can't do functional I/O in a simple manner without taking massive hits.

Name: Anonymous 2007-08-20 11:58 ID:jizBIDBZ

>>33
So? If your brain is underdeveloped, maybe you should quit programming.

Name: Anonymous 2007-08-20 16:17 ID:q9T/u4Uk

>>34

Yet the computer is not a functional device and you're adding unnecessary semantics for the sake of a methodology which doesn't even help you finish programs!

Name: herc 2007-08-20 16:32 ID:ZE+6eXHy

there are chips optimized for functional programming ( haskell, if i remember right) . those chips might be fast enough

Name: Anonymous 2007-08-20 17:23 ID:1vtoBzcw

>>35

Yet the problems we want to solve with computers are many times not imperative.  Fuck if the CPU isn't functional; it's a better layer to work with.

Name: Anonymous 2007-08-20 19:33 ID:i+RACIuI

>Fuck if the CPU isn't functional; it's a better layer to work with.

Well, then your solution will be so slow that you might as well not use a computer to solve it.  </thread></forum></internet></known-universe></entirety-of-all-existences></essence-of-matter-space-energy>

Name: Anonymous 2007-08-20 20:18 ID:ledHqLSz

>>38 lol how do i look clueless on internet?

Name: Anonymous 2007-08-20 20:56 ID:zApKazP0

>>38
ONE WORD, THE LAMBDA PAPERS, THREAD OVER

Name: Anonymous 2007-08-20 21:05 ID:UYyo6+r0

Your CPU knows about IO as a concept, it is a fundamental aspect of computation, if you're going to make it difficult then you've already lost.

Name: Anonymous 2007-08-20 21:38 ID:ledHqLSz

>>41
You're not making sense.

Name: Anonymous 2007-08-20 21:46 ID:dcZzKZON

>>41
You seem to be confusing implementation details with theory. Would you like to take CS 101 again?

Name: Anonymous 2007-08-21 3:51 ID:Iofj9bBk

>>35
It's not object-oriented either, nor metaprogrammable, nor a grammar parser, nor an array of cellular automata, nor a sequential machine, nor a simple stack machine, nor a DSP, nor anything we use it for dozens of times a day, knowingly or not.

Also, do you think an advanced, flexible, dynamic, functional programming language such as Lisp is hard to do with an average CPU, or even slow? Think again.

Also, any good programmer using a "slow" programming language such as Python or Perl has good chances of outperforming any OMG OPTIMIZED C faggot teenager because he hasn't achieved Satori and his programs will operate very fast, but very stupidly.

Name: Anonymous 2007-08-21 3:53 ID:uAAgSo8P

>>41

I/O is not a fundamental aspect of computation, it is a fundamental aspect of communication and storage, which are usually just artifacts of the computation at hand since CPUs aren't infinitely large and fast.

Name: Anonymous 2007-08-21 10:37 ID:mieLXlJp

>>43
You seem to be confusing hilarious high level abstractions which don't naturally map to the processors you are using with code that performs well.

Some of us have real work todo, some of us have jobs that run for weeks on huge clusters of PCs, we care about performance because if we don't we could easily increase the time our jobs take by 10 to 100 times.

Languages like OCaml understood this, sometimes you needed performance so here do it the imperative way. Even LISP understood this, CL has tonnes of imperative constructs specifically for performance reasons.

>>44

You used satori, you fail.
Lisp fails on Intel CPUs because you have to use your stack properly due to shadowed registers if you ignore the stack and use it just for your GC (like chicken scheme can do with the trampolines) you slow everything down because the processor was not setup to handle everything in the heap.

>>45

Input/Output is pretty fundamental.

Name: Anonymous 2007-08-21 10:54 ID:g5DHMLWF

>>26
some of us have jobs that run for weeks on huge clusters of PCs, we care about performance
What are your USE flags?

Name: Anonymous 2007-08-21 13:02 ID:Heaven

>>47
Good job clicking on the post number, instead of typing it by hand and fucking it up.
Oh wait, never mind.

Name: Anonymous 2007-08-21 13:21 ID:g5DHMLWF

>>48
Lol, come to think of it, where did that 2 come from? I hadn't even clicked on "Read this thread from the beginning" so I had to type it by hand.

Name: Anonymous 2009-03-06 7:03


The recursive failing meme.

Name: Anonymous 2009-09-19 0:48

Lain.

Name: Anonymous 2009-09-19 0:49

Lain.

Name: Anonymous 2009-09-19 0:49

Lain.

Name: Anonymous 2009-09-19 0:49

Lain.

Name: Anonymous 2009-09-19 0:50

Lain.

Name: Anonymous 2009-09-19 0:50

Lain.

Name: Anonymous 2009-09-19 0:50

Lain.

Name: Anonymous 2009-09-19 0:50

Lain.

Name: Anonymous 2009-09-19 0:51

Lain.

Name: Anonymous 2009-09-19 0:51

Lain.

Name: Anonymous 2010-01-30 21:03

test

Name: Anonymous 2010-01-30 21:05

test
test

Name: Anonymous 2010-01-30 21:06

test[aa]
test

Name: Anonymous 2010-01-30 21:07

test
test

Name: Anonymous 2010-01-30 21:07

test
test

Name: Anonymous 2010-01-30 21:07

test
test
test hgggh

Name: Anonymous 2010-01-30 21:11

The current syntax: instead of writing
(register-groups-bind (method url version-major version-minor)
("(\\S+)\\s+(\\S+)\\s+HTTP/(\\d+).(\\d+)$" line)
...)

write
(match-bind (method (+ (space)) url (+ (space)) "HTTP/" (version-major (integer)) "." (version-minor (integer)) (last))
line
...)


What do you think?

Name: ​​​​​​​​​​ 2010-10-26 10:57

Name: Anonymous 2013-08-31 17:40


Apparently I went to Japan to take a class in "gun control." But the first few days of classes is all squirting each other with water pistols and even plastic syringes. During one of the classes I overhear classmates saying they want to go to the club after class. I deduce that the club is actually the arcade at the mall. The group needed one more person for some reason, and I was about to volunteer myself, but I notice one of my classmates on the other side of the room looks like a girl I knew in elementary school.

Name: Anonymous 2013-08-31 19:11


I have a problem with the game. So i DL the game the same time it released on previous Comiket. Patch it to 1.01, play a bit and stop playing it for a long time... Until recently

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