Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Asymmetrikon
Oct 30, 2009

I believe you're a big dork!

JawnV6 posted:

wait how's that?

give me a language that continues working correctly while someone is beating the computer with a sledgehammer

Adbot
ADBOT LOVES YOU

JawnV6
Jul 4, 2004

So hot ...
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

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!

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

JewKiller 3000
Nov 28, 2006

by Lowtax
ok forget the hardware, what if your program divides by 0

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!

JewKiller 3000 posted:

ok forget the hardware, what if your program divides by 0
i mean, that could be solved by having division be like:
code:
(/) :: Num n => n -> n -> Maybe n
...which probably wouldn't actually be that bad if your code used it rarely

Sapozhnik
Jan 2, 2005

Nap Ghost
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

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!
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

JewKiller 3000
Nov 28, 2006

by Lowtax

Asymmetrikon posted:

i mean, that could be solved by having division be like:
code:
(/) :: Num n => n -> n -> Maybe n
...which probably wouldn't actually be that bad if your code used it rarely

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

MononcQc
May 29, 2007

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

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!
just make all types based on and trivially convertible from arbitrary-length byte strings. that's really all they are anyway

VikingofRock
Aug 24, 2008




my runtime-exception-free language can simulate any turing tape of length zero

JawnV6
Jul 4, 2004

So hot ...

Asymmetrikon posted:

imagine if you could, though. throwing a CosmicRayBitFlipException
yeah, embedded reset handlers generally ask the hardware "so how'd we get here" with answers like "cold boot/warm reset/clock error/brownout"

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

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
"over the network" lol because who could possibly imagine a program that just has to deal with local hardware to be meaningful

JewKiller 3000
Nov 28, 2006

by Lowtax

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)

Ator
Oct 1, 2005

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:
	    try
            {
                ...
            }
            catch (Exception)
            {
		//Console.WriteLine(e.ToString());
            }

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

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

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





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

Athas
Aug 6, 2007

fuck that joker

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.

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Sapozhnik posted:

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

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

Cybernetic Vermin
Apr 18, 2005

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

Turing's proof was an existence proof

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

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

just keep incrementing the integer until it wraps around and get the best of all worlds

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
i wrote eleven thousand words about some dumb bullshit that will turn swift into rust

VikingofRock
Aug 24, 2008




rjmccall posted:

i wrote eleven thousand words about some dumb bullshit that will turn swift into rust

:eyepop: NICE!

gonadic io
Feb 16, 2011

>>=
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

Athas
Aug 6, 2007

fuck that joker
Just a quick note that esr says he's a Python dev again.

AggressivelyStupid
Jan 9, 2012

esr please leave the dumb and bad but also cool and good language I like alone :ohdear:

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



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)

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

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

fast and easy to understand failure modes is really underappreciated aspect to software in general


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

fully total languages exist and can do that ... and more !!!

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

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

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

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

Shaggar
Apr 26, 2006

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.

Shaggar
Apr 26, 2006
also even if it was entirely local any local I/o will be just as unpredictable as network I/o

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

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

Cybernetic Vermin
Apr 18, 2005

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"?

gonadic io
Feb 16, 2011

>>=
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

Cybernetic Vermin
Apr 18, 2005

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)

Smoke_Max
Sep 7, 2011

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

30 TO 50 FERAL HOG
Mar 2, 2005



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

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

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?

Cybernetic Vermin
Apr 18, 2005

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
ordinarily write are already primitive recursive. Many of the others can be reexpressed as
primitive recursive, with same computational complexity, by introducing an intermediate
data structure. (MY CONJECTURE: with more practice we will find this is always true.)

Cybernetic Vermin fucked around with this message at 20:34 on Feb 17, 2017

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=

Cybernetic Vermin posted:

it is readily observed that the author is a fuckwit

lol

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply