|
JawnV6 posted:wait how's that? give me a language that continues working correctly while someone is beating the computer with a sledgehammer
|
# ? Feb 17, 2017 04:08 |
|
|
# ? Jun 4, 2024 17:26 |
|
ok so the erlang "the physical manifestation of computers is unreliable" model im not sure how meaningful it is to ascribe a runtime error state to "the silicon has been shattered" but sure
|
# ? Feb 17, 2017 04:12 |
|
JawnV6 posted:im not sure how meaningful it is to ascribe a runtime error state to "the silicon has been shattered" but sure imagine if you could, though. throwing a CosmicRayBitFlipException
|
# ? Feb 17, 2017 04:15 |
|
ok forget the hardware, what if your program divides by 0
|
# ? Feb 17, 2017 04:15 |
|
JewKiller 3000 posted:ok forget the hardware, what if your program divides by 0 code:
|
# ? Feb 17, 2017 04:18 |
|
hmm. perhaps we can also add a mode where the compiler determines if the program halts or not wouldn't want to start doing a very long computation that will never finish
|
# ? Feb 17, 2017 04:20 |
|
you jest, but 1. termination checking is super useful in certain cases (even in infinitely-running processes, you might want to check if each task is guaranteed to terminate), and 2. there are languages that allow for subsets of your code to be provably terminating
|
# ? Feb 17, 2017 04:22 |
|
Asymmetrikon posted:i mean, that could be solved by having division be like: alright that one was too easy. how about i'm accessing the 50th element of an array, and the array came over the network so i don't statically know how big it is like, programs are gonna have errors, sure you can make a fancier type system and check more of them at compile-time by forcing the programmer to explicitly prove that the error can't happen... and i'm a huge fan of fancy type systems but i've never heard an advocate argue that they could completely eliminate runtime errors
|
# ? Feb 17, 2017 04:24 |
|
im just gonna write a program that lets me add feet to cm without properly converting units and blow up a full flight crew or something anyway int all the things
|
# ? Feb 17, 2017 04:27 |
|
just make all types based on and trivially convertible from arbitrary-length byte strings. that's really all they are anyway
|
# ? Feb 17, 2017 04:31 |
my runtime-exception-free language can simulate any turing tape of length zero
|
|
# ? Feb 17, 2017 04:31 |
|
Asymmetrikon posted:imagine if you could, though. throwing a CosmicRayBitFlipException JewKiller 3000 posted:alright that one was too easy. how about i'm accessing the 50th element of an array, and the array came over the network so i don't statically know how big it is
|
# ? Feb 17, 2017 04:32 |
|
JawnV6 posted:"over the network" lol because who could possibly imagine a program that just has to deal with local hardware to be meaningful ok fine, it came from another local process that isn't written in your bespoke language the point is not that you could envision a scenario in which one can statically check that x[50] is defined. the point is, if your language ever allows me to write x[50] without proving that it exists, you need some runtime error facility (unless you want to do the C thing and just write to whatever memory that happens to reference, assuming that memory even exists)
|
# ? Feb 17, 2017 04:36 |
|
Asymmetrikon posted:imagine if you could, though. throwing a CosmicRayBitFlipException according to a former coworker of mine, it would be handled just like any other exception: code:
|
# ? Feb 17, 2017 04:45 |
|
yeah i dont know about completely eliminating runtime errors but you can go a pretty long way in getting rid of the vast majority of them. the noredink guys say theyve been using elm for something like 2 years now without encountering a single runtime error
|
# ? Feb 17, 2017 05:29 |
|
fart simpson posted:yeah i dont know about completely eliminating runtime errors but you can go a pretty long way in getting rid of the vast majority of them. the noredink guys say theyve been using elm for something like 2 years now without encountering a single runtime error this is true but also kind of meaningless since elm doesn't have side effects. an elm program is just a pure function of (msg, state) -> (state, effects). you can get plenty of errors in the part that goes (effects) -> ([msg, ...]) and hand wave it away as 'outside' your program you can do this trivially in almost any programming language, but you need that 'outside' part to actually accomplish anything elm does rule tho, i want elm for python real bad
|
# ? Feb 17, 2017 06:48 |
|
JewKiller 3000 posted:alright that one was too easy. how about i'm accessing the 50th element of an array, and the array came over the network so i don't statically know how big it is Either you make array indexing return a Maybe (like with the division example above), or you use fancy dependent types to require the programmer to provide a proof that the 50th element exists (by checking the length of the array at runtime). Either way, you force the program to deal with the potential that the array is malformed. It's not about completely removing errors, but about removing implicit error cases. Of course, the hardware can still break. In the general case, you need some sort of "the world just hosed up"-signal. I think Erlang handles this the right way, by punting it to a higher level. It's very useful to have languages that can guarantee the absence of all non-world-shattering errors.
|
# ? Feb 17, 2017 07:29 |
|
Sapozhnik posted:hmm. perhaps we can also add a mode where the compiler determines if the program halts or not its entirely possible to design a language where all functions terminate or do productive work at each iteration. I think someone did a dsl for Haskell that generated tasks for an RTOS in C that provably run in deadlines Turing's proof was an existence proof
|
# ? Feb 17, 2017 08:25 |
|
having options instead of errors where the invariant assumption of the program is that the operation will yield a result is just creating pointless busywork that does not improve the software in any way fast and easy to understand failure modes is really underappreciated aspect to software in general Malcolm XML posted:its entirely possible to design a language where all functions terminate or do productive work at each iteration. I think someone did a dsl for Haskell that generated tasks for an RTOS in C that provably run in deadlines choose at most two of: being able to increment an integer; being able to decrement an integer; being able to check if an integer is zero. well, or have at most one integer variable i mean, it is clearly possible, but it is not a very good life
|
# ? Feb 17, 2017 09:10 |
|
just keep incrementing the integer until it wraps around and get the best of all worlds
|
# ? Feb 17, 2017 09:21 |
|
i wrote eleven thousand words about some dumb bullshit that will turn swift into rust
|
# ? Feb 17, 2017 09:33 |
rjmccall posted:i wrote eleven thousand words about some dumb bullshit that will turn swift into rust NICE!
|
|
# ? Feb 17, 2017 09:48 |
|
swift is like f# to me in that it's one of those langs where it doesn't seem terrible but i don't really have any reason to pick it up. if i was doing iphone programming i'd be alll over it though, gently caress obj-c
|
# ? Feb 17, 2017 10:06 |
|
Just a quick note that esr says he's a Python dev again.
|
# ? Feb 17, 2017 11:57 |
|
esr please leave the dumb and bad but also cool and good language I like alone
|
# ? Feb 17, 2017 12:45 |
|
Athas posted:Just a quick note that esr says he's a Python dev again. lmao "the whole being-famous nonsense" loving esr also lol nobody gave a poo poo to reply (at least on-list)
|
# ? Feb 17, 2017 12:48 |
|
Cybernetic Vermin posted:having options instead of errors where the invariant assumption of the program is that the operation will yield a result is just creating pointless busywork that does not improve the software in any way fully total languages exist and can do that ... and more !!!
|
# ? Feb 17, 2017 13:22 |
|
Malcolm XML posted:fully total languages exist and can do that ... and more !!! u give up Turing completeness tho bit that's not a big loss
|
# ? Feb 17, 2017 13:24 |
|
gonadic io posted:swift is like f# to me in that it's one of those langs where it doesn't seem terrible but i don't really have any reason to pick it up. if i was doing iphone programming i'd be alll over it though, gently caress obj-c ibm keeps trying to make it work as a web server lang but it's not really catching on
|
# ? Feb 17, 2017 14:57 |
|
JawnV6 posted:"over the network" lol because who could possibly imagine a program that just has to deal with local hardware to be meaningful if all you have to deal with is local hardware than its a trivial problem so who cares.
|
# ? Feb 17, 2017 16:22 |
|
also even if it was entirely local any local I/o will be just as unpredictable as network I/o
|
# ? Feb 17, 2017 16:24 |
|
carry on then posted:ibm keeps trying to make it work as a web server lang but it's not really catching on to be fair, they haven't released anything yet. at this stage, they are trying to get people to help them design a framework for it
|
# ? Feb 17, 2017 17:02 |
|
Malcolm XML posted:fully total languages exist and can do that ... and more !!! rather than following my impulse of spending a lot of time understanding what you are saying here, i will instead admit i don't follow? two integer variables you can increment, decrement, and imperatively branch on a zero check of (and that is all the operators) can simulate an arbitrary turing machine. what is a "fully total language"?
|
# ? Feb 17, 2017 17:19 |
|
total languages are ones which (among many other features) don't let you loop unless you can prove that it's bounded hence it can't simulate a turing machine (consider one that hangs or increments a variable forever) http://stackoverflow.com/questions/18178999/do-agda-programs-necessarily-terminate
|
# ? Feb 17, 2017 17:31 |
|
ah, thank you! ok, weeell, we are slightly talking past each other on that point then while i think there is value to such ideas i will claim that programmers will often be called upon to encode specifications which by their nature are not obvious they terminate, and even if they can be argued to terminate in a formal way the procedure to turn the given argument into the form needed for the language will in itself be undecidable (true for most undecidable languages; reductions between them are undecidable)
|
# ? Feb 17, 2017 18:02 |
|
re: total programming languages, I really like this paper that describes some of their interesting aspects (making a distinction between data and codata, for instance): http://sblp2004.ic.uff.br/papers/turner.pdf
|
# ? Feb 17, 2017 18:49 |
|
so i guess the read/write buffer for serialport is shared in c#? like i have a thread dequeuing commands and writing them, so if im writing something and the datareceived event fires itll get data being written while removing that data from the write buffer, so the command fails because its missing stuff jesus christ microsoft
|
# ? Feb 17, 2017 18:57 |
|
rjmccall posted:i wrote eleven thousand words about some dumb bullshit that will turn swift into rust I got like half an hour in. not only am I not done, I'm too scared to check on the size or location of the scroll thumb it's good poo poo so far though! also I remember asking you around ARC release whether it was for real or whether it was gonna get deprecated like gc. when you said it's for real, were you thinking of swift?
|
# ? Feb 17, 2017 19:09 |
|
e: nm, drunk, unnecessarily feisty e2: gently caress, gonadic quoted me before i realized it was a bad idea, but, man, this statement has no part in any academic paper (and i do on that ground stand by the author being a fuckwit): Paper from above post posted:Efficiency - it is a readily observed that three quarters or more of the algorithms we Cybernetic Vermin fucked around with this message at 20:34 on Feb 17, 2017 |
# ? Feb 17, 2017 20:23 |
|
|
# ? Jun 4, 2024 17:26 |
|
Cybernetic Vermin posted:it is readily observed that the author is a fuckwit lol
|
# ? Feb 17, 2017 20:26 |