>>21
I don't have to give reasons for anything I say, because I am an EXPERT PROGRAMMER.
Name:
Anonymous2007-05-04 12:11 ID:1rCA1Ovu
>>21
You can't claim to be an EXPERT PROGRAMMER unless all your code randomly segfaults.
Name:
Anonymous2007-05-04 12:58 ID:3sRJYHaM
>>23
sorry but EXPERT PROGRAMMERS use type safe languages and prove that thier programs terminate.
Name:
Anonymous2007-05-04 13:55 ID:HNZ1Q9Iz
>>24
sorry but TYPE SAFE LANGUAGES are not enough to prove that programs do indeed terminate. The current state of research on languages that would potentially fix that is pitiful. I've read a paper on that and it took (if I remember correctly) six pages to go to a + b. No, I don't remember the link. Use programming.reddit search.
WHO CARES IF IT TERMINATES? compute_ :: Int -> String -> IO () -> IO ()
compute_ limit failmsg !computation = do
ended <- newQSem 0
computation <- forkIO $ do computation
signalQSem ended
reader <- forkIO $ do threadDelay limit
killThread computation
signalQSem ended
fail failmsg
waitQSem ended
killThread reader
killThread computation
Name:
Anonymous2007-05-04 14:13 ID:wpnu/sqG
Shut up, namefag
Name:
Anonymous2007-05-04 14:43 ID:3sRJYHaM
>>25
You can prove specific code terminates, we just have to extend the proof to anything acceptable by the type system, then any type safe program terminates!
Name:
Anonymous2007-05-04 14:49 ID:HNZ1Q9Iz
>>28
Well, yeah. You don't even need static typing for that. Plain strong typing is enough. That doesn't mean a human being could prove that for any non-trivial program using any current language.
Name:
Anonymous2007-05-04 15:15 ID:3sRJYHaM
>>29
maybe that would make more sense if you define 'trivial'
Name:
Anonymous2007-05-04 15:33 ID:HNZ1Q9Iz
>>30
Anything beyond a composition of ~two functions.
Actually, the whole set of processes will terminate as long as at least one number in the random sequence seeded at the start has the highest two bits set to zero (what >>30 is testing.) This can be proved by examining the characteristics of rand()'s algorithm.
The reason: as the child process doesn't call srand() again, it will continue to use the same random number sequence as the parent. So they all terminate simultaneously.