a word bloods use, it's basically "Cool" with the "C" replaced by a "B"
aye them niggaz are bool as fuck
Name:
Anonymous2016-08-03 18:41
Implicit booleans is allowing such neat tricks such as #define cmp(x,y) ((x>y)-(x<y))
Name:
Anonymous2016-08-03 19:50
BOOL = Binary Object-Oriented Logic
Name:
Anonymous2016-08-03 22:36
I'll have you know I identify as logically fluid.
Name:
December 1969 errors2016-08-03 23:36
>>2 it seems kind of neat but cmp is a single CPU instruction on x64
Name:
Anonymous2016-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:
Anonymous2016-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.
>>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:
Anonymous2016-08-05 5:51
caring about optimization when computers can execute billions of instructions per second
Name:
Anonymous2016-08-05 8:56
>>10 In tight loops, even a few instructions matter.
>>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:
Anonymous2016-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).
>>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.
>>23 Writing to memory is a form of state mutation.
Name:
Anonymous2016-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:
Anonymous2016-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.
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:
Anonymous2016-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.
>>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:
Anonymous2016-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:
Anonymous2016-08-08 1:16
>>23 You mean something like the universe? Because you can't overwrite shit here, faggot.
Name:
Anonymous2016-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.
Implicit mutation is allowing such neat tricks such as functions that return not their input
Name:
Anonymous2016-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.
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:
Anonymous2016-08-10 9:36
Functional state deniers are worse than climate change deniers.