Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-05-17 00:26:16 <boxscape> join #ghc
2021-05-17 00:26:21 <boxscape> whoops
2021-05-17 00:26:38 <Axman6> Urgh, I'm so sick of compiler spam on freenode :P
2021-05-17 00:28:00 elliott_ joins (~elliott_@pool-108-18-30-46.washdc.fios.verizon.net)
2021-05-17 00:28:55 × Chai-T-Rex quits (~ChaiTRex@gateway/tor-sasl/chaitrex) (Remote host closed the connection)
2021-05-17 00:29:11 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 240 seconds)
2021-05-17 00:29:21 Chai-T-Rex joins (~ChaiTRex@gateway/tor-sasl/chaitrex)
2021-05-17 00:30:26 × geowiesnot quits (~user@87-89-181-157.abo.bbox.fr) (Ping timeout: 260 seconds)
2021-05-17 00:31:41 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-05-17 00:31:41 × star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Ping timeout: 240 seconds)
2021-05-17 00:36:11 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-05-17 00:36:39 cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net)
2021-05-17 00:37:54 <monochrom> C's void is not to be confused with Haskel's () in the first place.
2021-05-17 00:38:07 <Axman6> yeah I did think that was a bit of an odd statement
2021-05-17 00:38:19 <Axman6> you can't have a value of type void in C right?
2021-05-17 00:38:34 <monochrom> There is a general theme. People also confuse Java interface with Haskell type class.
2021-05-17 00:39:03 <monochrom> Generally, when two different solutions solve the same problem, people will conflate the two solutions.
2021-05-17 00:39:25 <monochrom> You can't even declare a variable of type void. "void x".
2021-05-17 00:41:30 ddellacosta joins (~ddellacos@ool-44c73afa.dyn.optonline.net)
2021-05-17 00:42:51 dwt joins (~dwt@c-98-200-58-177.hsd1.tx.comcast.net)
2021-05-17 00:43:10 falafel joins (~falafel@2603-8001-ca00-f555-b4a5-fa93-bc1a-b3d6.res6.spectrum.com)
2021-05-17 00:43:27 <monochrom> I can argue that void is not even a type. With that, "does void have values?" is not even a valid question.
2021-05-17 00:43:44 ddellac__ joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
2021-05-17 00:43:44 star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com)
2021-05-17 00:43:49 CrazyPython joins (~crazypyth@206.214.238.6)
2021-05-17 00:44:58 <monochrom> Reason being void cannot be used at most places where all other types can be used. "void x;", "int f(void y, void z)", "struct S { void a; };"
2021-05-17 00:45:34 rajivr joins (uid269651@gateway/web/irccloud.com/x-eilhkhwsqqonwkqr)
2021-05-17 00:46:50 <olligobber> % data Void
2021-05-17 00:46:50 <yahb> olligobber:
2021-05-17 00:46:57 <olligobber> % :t undefined :: Void
2021-05-17 00:46:57 <yahb> olligobber: Void
2021-05-17 00:47:07 <olligobber> I made something of type Void, yay
2021-05-17 00:47:13 × ddellacosta quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Ping timeout: 240 seconds)
2021-05-17 00:47:20 <monochrom> % data Voila
2021-05-17 00:47:20 <yahb> monochrom:
2021-05-17 00:47:22 <Axman6> prove it
2021-05-17 00:47:36 <pjb> Yes, in C, void is just a keyword that means different things depending on the context.
2021-05-17 00:47:38 <monochrom> You made Void a type. Voila!
2021-05-17 00:47:48 <pjb> void f(); means f doesn't return a value.
2021-05-17 00:47:52 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
2021-05-17 00:48:13 × ddellac__ quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 240 seconds)
2021-05-17 00:48:16 <pjb> f(void); means f doesn't take any argument (vs f() which means that f can take any number of arguments).
2021-05-17 00:48:33 <pjb> void* denotes a type of pointer to anything.
2021-05-17 00:48:42 <olligobber> Axman6, the compiler said the type of my thing is Void, so it is
2021-05-17 00:48:43 <monochrom> Let's be semantic. "void f()" means that the function analogy really breaks down, f is a procedure not a function.
2021-05-17 00:48:52 <pjb> exactly.
2021-05-17 00:50:13 <monochrom> It is somewhat cute that with void you can get rid of two verbose reserved words "function" and "procedure" from Pascal. There is credit for that.
2021-05-17 00:51:21 <monochrom> This is also where Dunning-Kruger is right about syntax doing brainwashing.
2021-05-17 00:53:11 × star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Ping timeout: 240 seconds)
2021-05-17 00:53:58 geowiesnot joins (~user@i15-les02-ix2-87-89-181-157.sfr.lns.abo.bbox.fr)
2021-05-17 00:54:14 star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com)
2021-05-17 00:54:24 <pjb> monochrom: it's just an after the fact kludge.
2021-05-17 00:55:49 <pjb> It took about ten years for void to appear in C.
2021-05-17 00:55:53 <monochrom> The road to hell is paved with well-intended kludges >:)
2021-05-17 00:56:14 × ericsagn1 quits (~ericsagne@2405:6580:0:5100:b6b3:41e:9821:2954) (Ping timeout: 245 seconds)
2021-05-17 00:59:38 <boxscape> what did C do before void?
2021-05-17 00:59:52 <boxscape> ..just have int as return type I guess?
2021-05-17 00:59:53 <geekosaur> not bother to return int
2021-05-17 00:59:59 <boxscape> okay
2021-05-17 01:00:12 <boxscape> right return is optional..
2021-05-17 01:00:47 × hiroaki quits (~hiroaki@2a02:8108:8c40:2bb8:c2b0:caa:38f9:fe49) (Ping timeout: 260 seconds)
2021-05-17 01:01:24 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Remote host closed the connection)
2021-05-17 01:01:32 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
2021-05-17 01:02:12 bearcarl joins (716a6a62@113.106.106.98)
2021-05-17 01:02:18 <pjb> boxscape: yes, by default f(); returns an int. But if you don't use return n; the result is just what is in the register.
2021-05-17 01:02:25 <boxscape> I see
2021-05-17 01:02:50 <Axman6> what id you don't have registers
2021-05-17 01:02:52 <Axman6> if*
2021-05-17 01:02:55 <pjb> boxscape: of course, it would be bad style to int r=f(); if f doesn't contain a return n; … Some compilers started to issue warning.
2021-05-17 01:03:02 <pjb> then AT& introduced void.
2021-05-17 01:03:13 <pjb> Axman6: whatever there was on the stack then.
2021-05-17 01:03:46 <monochrom> I don't know whether I should also ask "what if there is no stack" :)
2021-05-17 01:03:47 <pjb> It's was just kludges upon kludges really.
2021-05-17 01:04:03 × star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Excess Flood)
2021-05-17 01:04:05 <monochrom> I agree.
2021-05-17 01:04:24 <pjb> Eg. the declaration matches use form, was just a kludge to use the same parsing code for both, in early compilers that had to run with 4kw of RAM…
2021-05-17 01:04:43 <monochrom> generally s/register/whatever default place the caller expects to find return values/
2021-05-17 01:05:13 <geekosaur> which was memory on some IBM CPUs iirc
2021-05-17 01:05:44 <pjb> or on the PDP-7 they started unix on.
2021-05-17 01:06:03 <monochrom> Yeah. Recall that before Peter Naur taught the world how to support recursion, ...
2021-05-17 01:06:13 <pjb> Mind you, at the time, unix sources contained in general a single function per source file! Check them in git!
2021-05-17 01:06:40 <pjb> Well, it was already implemented in lisp in 1959…
2021-05-17 01:06:43 <monochrom> Each procedure is given a static memory area for being passed parameters and passing return values.
2021-05-17 01:06:58 <monochrom> and is exactly why people couldn't support recursion.
2021-05-17 01:07:41 <pjb> https://github.com/dspinellis/unix-history-repo
2021-05-17 01:08:06 sheepduck joins (~sheepduck@2607:fea8:2a60:b700::cafd)
2021-05-17 01:09:02 × malumore quits (~malumore@151.62.113.85) (Ping timeout: 268 seconds)
2021-05-17 01:09:40 star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com)
2021-05-17 01:09:45 ericsagn1 joins (~ericsagne@2405:6580:0:5100:e36f:f64f:f933:dd5f)
2021-05-17 01:13:00 hiroaki joins (~hiroaki@2a02:8108:8c40:2bb8:896b:c6c8:9998:8716)
2021-05-17 01:13:33 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Remote host closed the connection)
2021-05-17 01:14:19 <boxscape> pretty weird to see "52 years ago" in a github repo
2021-05-17 01:14:55 <monochrom> and don't forget https://github.com/dmr-1941-2011 :)
2021-05-17 01:15:09 <monochrom> "wow you can do that?!"
2021-05-17 01:15:18 DTZUZU_ joins (~DTZUZO@207.81.119.43)
2021-05-17 01:15:26 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 240 seconds)
2021-05-17 01:17:08 × CrazyPython quits (~crazypyth@206.214.238.6) ()
2021-05-17 01:17:18 × jpds quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
2021-05-17 01:17:40 × DTZUZU quits (~DTZUZO@205.ip-149-56-132.net) (Ping timeout: 268 seconds)
2021-05-17 01:17:41 jpds joins (~jpds@gateway/tor-sasl/jpds)

All times are in UTC.