02:38:34 | FromDiscord | <tsoj> when using `--mm:none` how do I know if I accidentally use something from the stdlib which uses the GC? Do I have to just check for leaks using sanitizers, or is there a more direct way to know? |
02:43:41 | FromDiscord | <nervecenter> In reply to @tsoj "when using `--mm:none` how": If you don't get a response here, might also be a good question for #internals |
02:44:04 | FromDiscord | <ElegantBeef> Ah bridge fun |
02:44:13 | FromDiscord | <tsoj> no, i prefer chess |
02:44:18 | FromDiscord | <ElegantBeef> The compiler has a warning |
02:44:26 | FromDiscord | <Elegantbeef> The compiler has a warning |
02:44:26 | FromDiscord | <ElegantBeef> Stop using no gc though |
02:44:26 | FromDiscord | <Elegantbeef> But really stop using `none` |
02:44:31 | FromDiscord | <ElegantBeef> Ah there it is |
02:45:27 | FromDiscord | <tsoj> In reply to @elegantbeef "Stop using no gc": its for a challenge with some arbitrary size limits, so I will be writing unusual code :) |
02:45:28 | FromDiscord | <Elegantbeef> `Warning: 'add(a, "hmm")' uses GC'ed memory [GcMem]` so you can do `--warningAsError:GcMem: on` if you want |
02:45:34 | FromDiscord | <Elegantbeef> So what? |
02:45:46 | FromDiscord | <Elegantbeef> Arc is practically free and does not bloat the GC |
02:45:55 | FromDiscord | <Elegantbeef> bloat with the GC\ |
02:48:41 | FromDiscord | <tsoj> it seems to crash when I enable arc with all the other flags I have set |
02:48:58 | FromDiscord | <Elegantbeef> A simple program that concatenates a string is 40 bytes larger when compiled with `-d:danger -d:lto --cc:clang --opt:size -d:strip -d:useMalloc` with arc enabled 😄 |
02:48:58 | FromDiscord | <tsoj> i will check, could be of course that my code does something wrong |
02:49:25 | FromDiscord | <Elegantbeef> If it crashes with arc enabled you're likely doing some UB |
02:49:58 | FromDiscord | <Elegantbeef> Arc is likely modifying your stack which is showing an issue that you have in your logic |
02:50:55 | FromDiscord | <tsoj> oh, do closures rely on the GC? |
02:51:01 | FromDiscord | <Elegantbeef> Yes |
02:51:11 | FromDiscord | <Elegantbeef> Closures allocate their environment on the heap |
02:51:42 | FromDiscord | <tsoj> yeah that makes sense, haven't been thinking about that |
02:51:54 | FromDiscord | <Elegantbeef> They also can be cyclical |
02:52:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=QrkDryiA |
02:53:05 | FromDiscord | <Elegantbeef> Should be `proc(args: T){.nimcall.}` |
02:53:29 | FromDiscord | <Elegantbeef> Actually should be `var T` 😄 |
02:57:37 | * | SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev) |
02:58:01 | * | SchweinDeBurg joined #nim |
03:01:06 | FromDiscord | <tsoj> what the heck, now the binary size increases by 4000 bytes when using --mm:none instead of --mm:arc |
03:01:51 | FromDiscord | <Elegantbeef> None uses the old runtime iirc so it's not as efficient |
03:03:13 | FromDiscord | <nervecenter> In reply to @tsoj "what the heck, now": Also keep in mind the default for dynamic types is a hidden unique pointer, so the GC will only activate if you use an explicit `ref`. Not sure if LTO cuts out the GC routines. |
03:05:12 | FromDiscord | <Elegantbeef> Well that's not exactly true since we're talking about arc 😄 |
03:05:18 | FromDiscord | <Elegantbeef> The GC is arc |
03:05:46 | FromDiscord | <Elegantbeef> It inserts destructor calls so there is no "activate" |
03:08:53 | FromDiscord | <tsoj> sent a code paste, see https://play.nim-lang.org/#pasty=Dpneyrbw |
03:09:05 | FromDiscord | <Elegantbeef> No clue |
04:55:17 | * | tiorock joined #nim |
04:55:17 | * | rockcavera quit (Killed (copper.libera.chat (Nickname regained by services))) |
04:55:17 | * | tiorock is now known as rockcavera |
04:57:24 | * | tiorock joined #nim |
04:57:24 | * | rockcavera is now known as Guest8049 |
04:57:24 | * | Guest8049 quit (Killed (osmium.libera.chat (Nickname regained by services))) |
04:57:24 | * | tiorock is now known as rockcavera |
06:31:16 | * | disso-peach joined #nim |
06:34:03 | * | tiorock joined #nim |
06:34:03 | * | rockcavera quit (Killed (copper.libera.chat (Nickname regained by services))) |
06:34:03 | * | tiorock is now known as rockcavera |
07:03:38 | * | kenran joined #nim |
07:47:55 | FromDiscord | <TFed> How to sort sequence? and which lib i need to import |
07:48:13 | FromDiscord | <TFed> to sort from small to the biggest |
07:48:28 | FromDiscord | <TFed> to sort from the smallest one to the biggest |
08:03:58 | FromDiscord | <Elegantbeef> `std/algorithm` |
08:04:52 | FromDiscord | <TFed> sent a code paste, see https://play.nim-lang.org/#pasty=kouLpurR |
08:05:41 | FromDiscord | <Elegantbeef> That's a hell of an error |
08:05:43 | FromDiscord | <TFed> it says that seq isn't an openArray |
08:06:42 | FromDiscord | <johnsley> sent a long message, see https://pasty.ee/NZlmUQnd |
08:06:55 | FromDiscord | <Elegantbeef> It's not a openarray it converts to one |
08:06:57 | FromDiscord | <TFed> ..... |
08:07:35 | FromDiscord | <TFed> sent a code paste, see https://play.nim-lang.org/#pasty=jlujVvwK |
08:07:46 | FromDiscord | <TFed> sent a code paste, see https://play.nim-lang.org/#pasty=KjOOJASD |
08:08:11 | FromDiscord | <Elegantbeef> stop converting it |
08:09:50 | FromDiscord | <TFed> sent a code paste, see https://play.nim-lang.org/#pasty=SzfMoZRu |
08:10:05 | FromDiscord | <Elegantbeef> `'getFirst(list)' is immutable, not 'var'` |
08:10:10 | FromDiscord | <Elegantbeef> you want `sorted` |
08:11:25 | FromDiscord | <TFed> finally works, thanks |
08:15:56 | * | ntat joined #nim |
09:06:02 | * | tiorock joined #nim |
09:06:02 | * | rockcavera is now known as Guest1076 |
09:06:02 | * | tiorock is now known as rockcavera |
09:08:09 | * | tiorock joined #nim |
09:08:09 | * | rockcavera is now known as Guest1832 |
09:08:09 | * | tiorock is now known as rockcavera |
09:09:55 | * | Guest1076 quit (Ping timeout: 244 seconds) |
09:10:57 | * | Guest1832 quit (Ping timeout: 244 seconds) |
09:13:49 | FromDiscord | <k0ts> https://nim-lang.org/docs/theindex.html#sort |
09:13:52 | FromDiscord | <k0ts> https://nim-lang.org/docs/manual.html#types-open-arrays |
10:29:49 | * | disso-peach quit (Quit: Leaving) |
11:04:14 | * | ntat quit (Quit: Leaving) |
13:03:01 | * | tiorock joined #nim |
13:03:02 | * | tiorock quit (Changing host) |
13:03:02 | * | tiorock joined #nim |
13:03:02 | * | rockcavera is now known as Guest6611 |
13:03:02 | * | Guest6611 quit (Killed (calcium.libera.chat (Nickname regained by services))) |
13:03:02 | * | tiorock is now known as rockcavera |
13:06:33 | * | nils` quit (Ping timeout: 244 seconds) |
13:33:16 | * | kenran quit (Remote host closed the connection) |
14:14:33 | * | rockcavera is now known as Guest8661 |
14:14:33 | * | tiorock joined #nim |
14:14:33 | * | Guest8661 quit (Killed (osmium.libera.chat (Nickname regained by services))) |
14:14:33 | * | tiorock is now known as rockcavera |
14:16:39 | * | tiorock joined #nim |
14:16:39 | * | rockcavera quit (Killed (copper.libera.chat (Nickname regained by services))) |
14:16:39 | * | tiorock is now known as rockcavera |
15:00:52 | * | ntat joined #nim |
15:12:02 | * | kotrcka joined #nim |
15:53:04 | FromDiscord | <nervecenter> In reply to @Elegantbeef "It inserts destructor calls": I guess I need to get clarification from Araq, are destructors always managed by the GC? Or can they be done without invoking it? |
15:53:44 | FromDiscord | <nervecenter> If something is destroyed by leaving scope, I guess...maybe it needs to run to do compaction and avoid fragmentation? |
16:11:35 | FromDiscord | <wug.s> is there some kind of defaultdict thing in nim |
16:11:36 | FromDiscord | <wug.s> like in python? |
16:11:45 | FromDiscord | <wug.s> that seems really useful idk |
16:19:02 | FromDiscord | <bostonboston> In reply to @wug.s "is there some kind": `getOrDefault()` |
16:19:30 | FromDiscord | <bostonboston> https://nim-lang.org/docs/tables.html#getOrDefault,Table[A,B],A |
16:33:25 | FromDiscord | <0ffh> If you want to avoid using getOrDefault everywhere in your code, you can always just write a thing wrapper for the standard dict. |
16:33:39 | FromDiscord | <0ffh> If you want to avoid using getOrDefault everywhere in your code, you can always just write a thin wrapper for the standard dict. |
16:34:21 | FromDiscord | <0ffh> Or, rather, table. |
16:44:23 | FromDiscord | <wug.s> In reply to @0ffh "If you want to": wdym? |
16:44:25 | FromDiscord | <wug.s> sorry im like |
16:44:28 | FromDiscord | <wug.s> super super new to nim |
16:44:31 | FromDiscord | <wug.s> im trying to learn it via the AOC |
16:56:47 | FromDiscord | <requiresupport> have a windows api function that returns a list of pointers to an object, how would i convert that pointer value to the list of `ptr object` |
17:20:32 | * | rockcavera is now known as Guest3273 |
17:20:32 | * | tiorock joined #nim |
17:20:32 | * | Guest3273 quit (Killed (mercury.libera.chat (Nickname regained by services))) |
17:20:32 | * | tiorock is now known as rockcavera |
17:22:39 | * | tiorock joined #nim |
17:22:39 | * | rockcavera is now known as Guest5883 |
17:22:39 | * | tiorock is now known as rockcavera |
17:25:22 | * | Guest5883 quit (Ping timeout: 252 seconds) |
17:48:23 | * | krux02 joined #nim |
17:52:37 | FromDiscord | <bostonboston> sent a long message, see https://pasty.ee/dtaSdrkw |
17:54:36 | FromDiscord | <bostonboston> So you could make your own `[]` that uses mixin to find your own defined default, which I would call the fastest but least robust way to do it.↵↵Alternatively you could make your own object that contains a table field and a default field that you write all your own operators for. I'm sure someone else has better solutions than mine |
18:15:53 | * | kotrcka quit (Remote host closed the connection) |
18:30:58 | * | nils` joined #nim |
18:44:04 | * | krux02 quit (Quit: Leaving) |
18:48:40 | * | def- quit (Quit: -) |
18:50:21 | * | def- joined #nim |
18:53:25 | * | def- quit (Client Quit) |
18:58:44 | * | tiorock joined #nim |
18:58:44 | * | rockcavera quit (Killed (lithium.libera.chat (Nickname regained by services))) |
18:58:44 | * | tiorock is now known as rockcavera |
19:00:51 | * | tiorock joined #nim |
19:00:51 | * | rockcavera is now known as Guest355 |
19:00:51 | * | tiorock is now known as rockcavera |
19:01:17 | * | def- joined #nim |
19:03:47 | * | Guest355 quit (Ping timeout: 244 seconds) |
21:22:14 | * | fallback quit (Read error: Connection reset by peer) |
21:46:22 | * | fallback joined #nim |
21:51:21 | FromDiscord | <bostonboston> I got home and tried to make a quick example but I dont know how to program and it doesnt work↵↵https://play.nim-lang.org/#pasty=WhzYYusD |
21:53:31 | FromDiscord | <Elegantbeef> The issue is the `lent` it's not capable of borrowing |
21:55:28 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#pasty=LhivQNaC works around that in a odd way |
21:56:25 | FromDiscord | <bostonboston> https://tenor.com/view/why-didnt-i-think-of-that-gif-27711265 |
21:56:41 | FromDiscord | <bostonboston> Thank you |
22:01:52 | * | ntat quit (Quit: Leaving) |
23:18:53 | * | attah quit (Ping timeout: 252 seconds) |
23:21:45 | * | attah joined #nim |