Newest at the top
| 2025-11-21 04:25:15 +0100 | <monochrom> | "permission denied" |
| 2025-11-21 04:24:34 +0100 | <fgarcia> | Do as I say. delete cosmic! |
| 2025-11-21 04:23:23 +0100 | <monochrom> | Yes default Integer. |
| 2025-11-21 04:23:13 +0100 | <monochrom> | Without type signature, everything resolves to Integer. And monomorphized. (I checked the Core code.) |
| 2025-11-21 04:23:05 +0100 | vanishingideal | (~vanishing@user/vanishingideal) vanishingideal |
| 2025-11-21 04:22:48 +0100 | <sam113101> | I did use Int, not sure if the compiler defaulted to Integer? |
| 2025-11-21 04:22:18 +0100 | <monochrom> | Is that just because you say "Int" not "Integer"? |
| 2025-11-21 04:21:41 +0100 | vanishingideal | (~vanishing@user/vanishingideal) (Ping timeout: 264 seconds) |
| 2025-11-21 04:20:58 +0100 | <EvanR> | I delete all my type signatures, dare the compiler to do what I mean, without even my knowing what I mean |
| 2025-11-21 04:20:50 +0100 | <sam113101> | wow it really did |
| 2025-11-21 04:20:46 +0100 | <sam113101> | Executed in 1.36 secs |
| 2025-11-21 04:20:44 +0100 | Googulator96 | (~Googulato@2a01-036d-0106-0231-4475-80b4-5cdc-43d6.pool6.digikabel.hu) |
| 2025-11-21 04:20:44 +0100 | chromoblob | (~chromoblo@user/chromob1ot1c) chromoblob\0 |
| 2025-11-21 04:20:39 +0100 | Googulator87 | (~Googulato@2a01-036d-0106-0231-4475-80b4-5cdc-43d6.pool6.digikabel.hu) (Quit: Client closed) |
| 2025-11-21 04:20:06 +0100 | chromoblob | (~chromoblo@user/chromob1ot1c) (Ping timeout: 265 seconds) |
| 2025-11-21 04:19:38 +0100 | fgarcia | hides code without signatures |
| 2025-11-21 04:18:40 +0100 | <Leary> | (the compiler can infer types, but that doesn't mean it can read your mind to infer the type you wanted to use) |
| 2025-11-21 04:17:32 +0100 | <EvanR> | of a linked list |
| 2025-11-21 04:17:24 +0100 | <EvanR> | for lists it will count the elements |
| 2025-11-21 04:17:10 +0100 | <monochrom> | What is Enum.count in Elixir? |
| 2025-11-21 04:17:02 +0100 | <Leary> | sam113101: Next suggestion: write some type signatures. Believe it or not, they make your code faster. |
| 2025-11-21 04:16:01 +0100 | <EvanR> | that was my first suggestion! smh |
| 2025-11-21 04:15:45 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds) |
| 2025-11-21 04:15:31 +0100 | <sam113101> | I got it dows to 6s with -O2 |
| 2025-11-21 04:15:11 +0100 | <monochrom> | Although, I would bet it only causes 2->4 not 2->30. |
| 2025-11-21 04:15:08 +0100 | <EvanR> | it could be worse |
| 2025-11-21 04:14:41 +0100 | <monochrom> | Yikes, core says not evaluated until next time it hits the x==1 test. |
| 2025-11-21 04:12:11 +0100 | <monochrom> | Oh I didn't know that backpack can do that. :) |
| 2025-11-21 04:12:05 +0100 | <EvanR> | and does collatz grow large enough to matter (and leave the small int case of Integer's backend) |
| 2025-11-21 04:11:37 +0100 | <EvanR> | elixir's "int" or whatever it's called is notionally unlimited precision |
| 2025-11-21 04:11:33 +0100 | <fgarcia> | making a collatzChain' with an accumulator might speed things up but i am not sure |
| 2025-11-21 04:10:59 +0100 | <probie> | monochrom: I know this isn't actually what you want, but https://paste.tomsmeding.com/oqM6JwKf |
| 2025-11-21 04:10:30 +0100 | <EvanR> | xs not used, it's not even clear how it could compile that in any other way than "not" |
| 2025-11-21 04:10:00 +0100 | <monochrom> | Is it just because GHC uses multi-precision integers and Elixir uses 32-bit or 64-bit? |
| 2025-11-21 04:09:59 +0100 | <c_wraith> | It's a lot harder to do flow analysis to determine usage patterns across recursive calls |
| 2025-11-21 04:09:30 +0100 | <c_wraith> | It's easy to detect a symbol is bound and not used. |
| 2025-11-21 04:09:16 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
| 2025-11-21 04:09:15 +0100 | <c_wraith> | It's worth spending some time learning about things that are easy to detect vs things that are hard to detect. |
| 2025-11-21 04:08:29 +0100 | <fgarcia> | i think ghc might be detecting a lot of things. it would warn me about changing 'collatzChain lst@(x:xs)' to 'collatzChain lst@(x:_)' because xs it not used |
| 2025-11-21 04:07:46 +0100 | <jreicher> | And for that reason I really wouldn't code this with a list. |
| 2025-11-21 04:07:01 +0100 | <jreicher> | I also have no idea how much static analysis either language can do; they might figure out the list is actually discarded. |
| 2025-11-21 04:06:20 +0100 | <EvanR> | I refuse to say more until I see the two programs properly compared |
| 2025-11-21 04:06:08 +0100 | <EvanR> | evaluation |
| 2025-11-21 04:05:58 +0100 | <EvanR> | I refuse to say more until I see the properly |
| 2025-11-21 04:04:45 +0100 | <EvanR> | still worth a shot because the field is full of dead attempts to predict what GHC does |
| 2025-11-21 04:04:06 +0100 | <jreicher> | Oh. :) |
| 2025-11-21 04:04:06 +0100 | <EvanR> | monochrom, oh... |
| 2025-11-21 04:03:55 +0100 | <EvanR> | it's an eager language |
| 2025-11-21 04:03:44 +0100 | <jreicher> | EvanR: how is that automatic in Elixir? |
| 2025-11-21 04:03:42 +0100 | <monochrom> | Probably not. the "x==1" test that happens right away will evaluate it. With -O1, the strictness analyzer will notice that and kill the laziness altogether. We can check this... |