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

Pages: 1-4041-

What's a bool?

Name: Anonymous 2016-08-03 17:39

a word bloods use, it's basically "Cool" with the "C" replaced by a "B"

aye them niggaz are bool as fuck

Name: Anonymous 2016-08-03 18:41

Implicit booleans is allowing such neat tricks such as
#define cmp(x,y) ((x>y)-(x<y))

Name: Anonymous 2016-08-03 19:50

BOOL = Binary Object-Oriented Logic

Name: Anonymous 2016-08-03 22:36

I'll have you know I identify as logically fluid.

Name: December 1969 errors 2016-08-03 23:36

>>2
it seems kind of neat but cmp is a single CPU instruction on x64

Name: Anonymous 2016-08-04 4:32

>>5
Its not the same;
it converts booleans to -1,0,1 result if its lessthen,equal, greater respectively. There is no need for Jxx instructions.
It creates branchless code.

Name: Anonymous 2016-08-04 8:39

This is why we have better standard libraries than C, to ensure that the compiler is aware of what's going on and can have a well tested implementation. As opposed to leaving the low level common shit to the programmer to reimplement per project with hacks that may or may not optimize as intended.

Name: Anonymous 2016-08-04 14:15

>>7
This is why we have better standard libraries than C
Its actually a part of a set of "standard" headers
https://gist.github.com/FrozenVoid/87e6ad6212ac9ce496e0#file-internal-compare-h

Name: Anonymous 2016-08-04 19:57

>>8
Your shit isn't part of the compiler and you have no guarantees about how that would optimize per processor or per compiler revision. Fuck off with your wanking bullshit.

Name: Anonymous 2016-08-05 5:51

caring about optimization when computers can execute billions of instructions per second

Name: Anonymous 2016-08-05 8:56

>>10
In tight loops, even a few instructions matter.

Name: Anonymous 2016-08-05 9:14

>>10
this. but the only optimizations you should make nowadays should be on the level of O complexity. not mucking about with changing x86 instructions (or something on that level in C) like a fucking Cudder.

Name: Anonymous 2016-08-05 9:19

>>12
those aren't the only optimizations you should care about. you should also care about disk operations, networking and database connections as even a linear algorithm can choke up on needless disk I/O (inb4 SSD; you can't assume everyone has it and it's still not as fast as RAM).

Name: Anonymous 2016-08-05 9:23

>>13
mutating state is for codemonkeys

Name: Anonymous 2016-08-05 19:40

What is bool?
Baby don't XOR me
don't XOR me
no more

Name: Anonymous 2016-08-05 20:19

>>15
That was reddit quality!

Name: Anonymous 2016-08-05 21:27

>>14
Literally the whole purpose of a computer is to mutate state.

Name: Anonymous 2016-08-05 23:58

>>17
not true, the purpose of a computer is to compute. state mutation is just an implementation detail

Name: Anonymous 2016-08-06 2:16

>>18
You cannot perform useful computation without state mutation. At the very least you need to mutate the state of the output device.

Name: Anonymous 2016-08-06 5:51

>>19
That's an implementation detail.

Name: Anonymous 2016-08-06 5:51

>>20
Wrong.

Name: Anonymous 2016-08-06 6:14

­

Name: Anonymous 2016-08-06 9:33

>>18
This one's right. It's possible to envision a computer with infinite memory where no address would ever get overwritten. The computer would always just write to free memory, eternally increasing its accessible store of data. You would need infinite-length addresses though, but that's probably achievable if the memory is infinite in the first place.

>>20
And you would also need an output device with infinite memory. This would also allow to backtrack to any past output from the beginning of time.

Name: Anonymous 2016-08-06 10:14

And you know this how?

Name: Anonymous 2016-08-06 16:38

>>23
Writing to memory is a form of state mutation.

Name: Anonymous 2016-08-06 17:43

>>25
That's state creation, not state mutation, dipshit.
Mutation = change of something that already existed.
Writing to free memory = creation of something where nothing existed.

Name: Anonymous 2016-08-06 18:51

>>26
You're not creating memory, you're just writing to it. The memory already had some value before (even if just a pattern of zeroes), which you're changing when you write to it. As far as the programmer is concerned, you might as well be willing the memory into existence the moment you write to it, but in reality the memory was always there, you're just writing something new to it. The only way you can claim it's not state mutation is if you claim that before the memory is allocated to the program it's not part of the program's state. But the amount of allocated memory is itself part of the program's state, so changing that is still mutation of program state.

Name: Anonymous 2016-08-06 19:26

>>27
Creating state, not memory.

before the memory is allocated to the program it's not part of the program's state
Yes, precisely.

But the amount of allocated memory is itself part of the program's state
Now that's an implementation detail. In many existing runtime systems no program can even reference the amount of allocated memory, and one has to use RTS commands to see it. That is, amount of allocated memory may be entirely external to program state, and such implementations are totally practicable and popular. Certainly there is no dogma that says any program ever written must have access to that information.

Name: Anonymous 2016-08-07 9:12

>>23
This must be how the Haskell Machine would look. I threw up in my mouth a little bit.

It's possible to envision a computer with infinite memory
It's possible to envision you getting pounded by AIDS-infected negroid dicks. That doesn't make infinite memory any more real.

>>27
So your only qualm is that supposedly the amount of allocated memory is somehow different from any other piece of state? Jeesh, it can be written down to a fresh location with every new allocation. Just as immutable as any other state.

Name: Anonymous 2016-08-07 19:08

le state is bad maymay

haskelites pls go

Name: Anonymous 2016-08-07 19:19

>>29
You simply cannot perform useful computation without mutating state. Even adding two integers requires, at the very least, changing the state of a CPU register.

Name: Anonymous 2016-08-07 20:47

Creating state is mutation of the substrate you make state out of, regardless of the nature of the state you're dealing with. Why are there so many fucking mental retards tied to functional programming? I actually use this shit, I seriously doubt you fuckers do except for your own mental masturbation.

Name: Anonymous 2016-08-08 1:16

>>23
You mean something like the universe? Because you can't overwrite shit here, faggot.

Name: Anonymous 2016-08-08 6:57

The universe is stateless. A new one is created every Planck time step based on physical interactions that existed in the last instance.

Name: Anonymous 2016-08-08 8:05

>>34
every Planck time
And what keeps it coherent in-between these times?

Name: Anonymous 2016-08-08 8:54

>>35
Planck's mid-frame coherence function.

Name: Anonymous 2016-08-08 9:10

>>36
And its argument current_state_of_universe?

Name: Anonymous 2016-08-08 9:15

Implicit mutation is allowing such neat tricks such as functions that return not their input

Name: Anonymous 2016-08-08 12:07

>>38
The only function that does return its input is the identity function, which is pretty much worthless for actual computation...at the least, it's not worth wasting a stack frame on.

Name: Anonymous 2016-08-08 14:17

>>35
There is no ``in-between''.

Name: Anonymous 2016-08-09 10:23

>>31
CPU registers don't count as state. They're not even accessible in a real programming language.

Name: Anonymous 2016-08-09 11:46

>>41
CPU registers don't count as state
hahahahahahaahahhaahahahahhahaha

GET THE FUCK OUT

Name: Anonymous 2016-08-10 9:21

>>28

Now that's an implementation detail.

Sure, in the platonic sense every input and output and internal state of your program exists and are related to each other in intricate ways. Using a computer to explore this space is an implementation detail. Using your brain to do so is an implementation detail. Using pen and paper to do so is an implementation detail. And so on. But in the natural world any implementation is going to need change. Pretending otherwise is an intellectual dead end and doesn't lead to greener pastures.

It's only possible to approximate the ideal world with pure code as long as you have full control over the execution environment. In a distributed environment (read: IO) you don't have full control. The environment mutates around you and you have to deal with it. The ideal world is equally equipped to describe our messy universe as a pretty mathematical formula. There's no value judgement.

Name: Anonymous 2016-08-10 9:36

Functional state deniers are worse than climate change deniers.

Name: Anonymous 2016-08-10 12:36

applying climate change is real

Name: Anonymous 2016-08-10 14:46

>>45
:^)

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