00:01:28 | * | Onionhammer9 joined #nim |
00:02:45 | * | madprops_ joined #nim |
00:05:31 | FromDiscord | <Elegantbeef> There is no `=destroy` proc for that thype |
00:05:33 | FromDiscord | <Elegantbeef> type\ |
00:05:50 | FromDiscord | <Elegantbeef> Ah nvm there is |
00:09:11 | * | redj_ joined #nim |
00:09:48 | * | redj quit (*.net *.split) |
00:09:49 | * | khazakar quit (*.net *.split) |
00:09:49 | * | madprops quit (*.net *.split) |
00:09:49 | * | Onionhammer quit (*.net *.split) |
00:09:50 | * | systemdsucks quit (*.net *.split) |
00:09:52 | * | Onionhammer9 is now known as Onionhammer |
00:09:57 | * | systemdsucks joined #nim |
00:10:34 | * | marcus quit (Remote host closed the connection) |
00:12:19 | * | marcus joined #nim |
00:15:19 | * | madprops_ is now known as madprops |
00:15:19 | * | madprops quit (Changing host) |
00:15:19 | * | madprops joined #nim |
00:22:23 | * | khazakar joined #nim |
02:42:33 | * | krux02 quit (Remote host closed the connection) |
03:22:09 | FromDiscord | <maxtachine> its so unfortunate its called like that ☠️ https://media.discordapp.net/attachments/371759389889003532/1197742768085278820/image.png?ex=65bc5fe0&is=65a9eae0&hm=723d443996824b3a526760238d87f918e6a2a7374bc3c4c8d43200e71be0813d& |
03:25:03 | * | disso-peach quit (Quit: Leaving) |
05:18:53 | * | flouer quit (Remote host closed the connection) |
05:19:13 | * | flouer joined #nim |
07:09:16 | NimEventer | New thread by xioren: A little guidance on threading needed., see https://forum.nim-lang.org/t/10886 |
07:09:22 | * | rockcavera quit (Remote host closed the connection) |
07:10:27 | * | PMunch joined #nim |
07:11:33 | * | advesperacit joined #nim |
07:29:43 | * | azimut quit (Ping timeout: 240 seconds) |
08:26:20 | * | jjido joined #nim |
09:28:43 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
09:34:01 | * | SchweinDeBurg joined #nim |
09:48:05 | * | rbvrs joined #nim |
09:50:36 | * | rbvrs quit (Client Quit) |
10:37:20 | NimEventer | New thread by Pasu4: Cannot capture a Table[string, string], see https://forum.nim-lang.org/t/10887 |
10:42:23 | * | krux02 joined #nim |
11:03:58 | FromDiscord | <kcvinker5420> @ElegantBeef Here it is https://media.discordapp.net/attachments/371759389889003532/1197858990625927168/image.png?ex=65bccc1e&is=65aa571e&hm=abd9ae8d7d7ff4b05337b8993a1a1d4c406247f08da1d4c95d2ef5e3feaad7b8& |
11:51:04 | * | noeontheend quit (Ping timeout: 268 seconds) |
11:51:12 | * | noeontheend joined #nim |
11:51:13 | * | mhcat quit (Ping timeout: 260 seconds) |
11:51:56 | * | adigitoleo quit (Ping timeout: 258 seconds) |
11:52:55 | * | mronetwo quit (Ping timeout: 268 seconds) |
11:53:13 | * | casaca quit (Ping timeout: 268 seconds) |
11:58:13 | * | noeontheend quit (Ping timeout: 255 seconds) |
11:59:21 | * | mhcat joined #nim |
11:59:22 | * | mronetwo joined #nim |
11:59:25 | * | adigitoleo joined #nim |
11:59:31 | * | noeontheend joined #nim |
12:26:11 | * | casaca joined #nim |
12:47:36 | FromDiscord | <MDuardo> sent a long message, see https://pasty.ee/LiChYubNyEbJ |
12:53:46 | * | azimut joined #nim |
12:56:01 | * | azimut quit (Remote host closed the connection) |
12:56:25 | * | azimut joined #nim |
13:01:20 | NimEventer | New thread by drkameleon: Weird bug(?) with JS backend, see https://forum.nim-lang.org/t/10888 |
13:03:08 | * | azimut quit (Remote host closed the connection) |
13:03:51 | * | azimut joined #nim |
13:05:32 | PMunch | MDuardo, another option is NimScript ;) |
13:08:57 | FromDiscord | <ayex> huh? had never heard of hjson - looks like a nice alternative to yml at first glance. 🤔 |
13:10:52 | * | rockcavera joined #nim |
13:11:46 | PMunch | Certainly interesting |
13:12:01 | PMunch | Has anyone written a HJSON -> JSON parser in Nim? |
13:12:59 | FromDiscord | <MDuardo> I mean, it's just JSON but with comments and commas are optional |
13:13:12 | FromDiscord | <MDuardo> There was a lib but it's deprecated↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
13:13:19 | * | azimut quit (Ping timeout: 240 seconds) |
13:13:37 | FromDiscord | <MDuardo> NimScript, I'll read about it |
13:13:58 | * | azimut joined #nim |
13:14:16 | FromDiscord | <nnsee> am i the only one who doesn't find this syntax intuitive at all? why is the first apostrophe on the same column as the colon? is it always like that or is it because it's four spaces from ^? https://media.discordapp.net/attachments/371759389889003532/1197891778930540604/image.png?ex=65bceaa7&is=65aa75a7&hm=43abd346bd6092db7776609e9983aced85b7e9c770448d43fe1275caff7b7a78& |
13:14:21 | FromDiscord | <nnsee> maybe it's just the example that's a bit confusing |
13:16:19 | PMunch | MDuardo, basically NimScript is what Nimble and Nim uses for configuration. It's also what macros are written in. You would define some global variables that makes up your config, then run the NimScript configuration, and then read out the variables. So the user can write any amount of logic in their configuration file :) |
13:18:23 | FromDiscord | <MDuardo> Maybe it's just the indentation space?↵(@nnsee) |
13:18:41 | FromDiscord | <nnsee> yeah that's what i meant with the latter |
13:18:54 | FromDiscord | <nnsee> that it's one indentation level deeper than the key |
13:18:55 | FromDiscord | <MDuardo> Ok, that would work for me↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
13:21:10 | * | azimut quit (Remote host closed the connection) |
13:22:32 | * | azimut joined #nim |
13:33:23 | * | disso-peach joined #nim |
13:36:17 | * | jjido joined #nim |
13:43:33 | FromDiscord | <summarity> Is there a pragma that is equivalent to / emits a C `#define` |
13:44:07 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=KUOAoUiVWEmk |
13:44:25 | PMunch | `{.emit: "#define <something>".}` is of course on option |
13:44:55 | FromDiscord | <Robyn [She/Her]> For the other various backends, you'll have to keep the fact that it's generating code for that backend, in mind |
13:45:12 | FromDiscord | <.__kenshin__.> https://forum.nim-lang.org/t/4242 |
13:45:27 | FromDiscord | <Robyn [She/Her]> Idk if a C define works in C++ or ObjC, and it definitely won't work on the JS backend or with Nlvm |
13:45:34 | FromDiscord | <.__kenshin__.> (edit) "https://forum.nim-lang.org/t/4242" => "https://forum.nim-lang.org/t/4242↵↵see this" |
13:46:00 | FromDiscord | <.__kenshin__.> https://forum.nim-lang.org/t/4242 |
13:46:17 | FromDiscord | <.__kenshin__.> that was asked here |
13:46:33 | FromDiscord | <Robyn [She/Her]> In reply to @.__kenshin__. "https://forum.nim-lang.org/t/4242": Does a Nim define emit a C define, though? |
13:46:49 | FromDiscord | <.__kenshin__.> no |
13:47:06 | FromDiscord | <.__kenshin__.> but you can make using these mentioned |
13:47:55 | FromDiscord | <Robyn [She/Her]> Assuming that Turbo @summarity specifically needs a C define to be emitted too |
13:48:42 | FromDiscord | <.__kenshin__.> who is that? |
13:49:51 | FromDiscord | <.__kenshin__.> nim in nim..c is c lol |
13:52:15 | FromDiscord | <.__kenshin__.> In reply to @chronos.vitaqua "Idk if a C": no it does work in c++ |
13:52:23 | FromDiscord | <demotomohiro> You can use --passC like `--passC:"-DSOMEDEFINE"` to define. |
13:53:03 | FromDiscord | <Robyn [She/Her]> In reply to @.__kenshin__. "no it does work": Good to know, i didn't know for sure if it worked |
13:53:12 | FromDiscord | <.__kenshin__.> In reply to @chronos.vitaqua "Good to know, i": copl |
13:53:19 | FromDiscord | <.__kenshin__.> (edit) "copl" => "cool" |
13:53:53 | FromDiscord | <.__kenshin__.> In reply to @demotomohiro "You can use --passC": but they wanted something that you could define in the source code itself |
13:53:56 | FromDiscord | <Phil> Unrelated sidenote: Understanding all these low level things one after another is kinda dope.↵Like defining an event-loop in chronos. |
13:54:37 | PMunch | {.passC: "-DSOMEDEFINE".} also works |
13:55:01 | PMunch | Useful with `passL` in modules depending on some C module |
13:55:16 | * | jmdaemon quit (Ping timeout: 246 seconds) |
13:55:44 | PMunch | @Phil, one of the great benefits of doing a CS degree at a good university :) |
13:56:25 | FromDiscord | <Phil> In reply to @PMunch "<@180601887916163073>, one of the": Yeah, this is the kind of shit that I think a CS degree would've helped me with |
13:58:59 | PMunch | Note though that there are plenty of universities which doesn't do low level though |
13:59:01 | FromDiscord | <summarity> In reply to @PMunch "Useful with `passL` in": exactly my case |
14:00:04 | FromDiscord | <nnsee> In reply to @summarity "exactly my case": oh hey, I've seen you on the internet before |
14:00:10 | FromDiscord | <nnsee> you work on codeql, right? |
14:00:13 | FromDiscord | <summarity> yep |
14:00:51 | FromDiscord | <nnsee> neat! i use it for my work quite often (i work as a pentester) |
14:01:25 | FromDiscord | <summarity> Awesome :D. Are you in the SecLab Slack? |
14:01:59 | FromDiscord | <Robyn [She/Her]> CodeQL? |
14:02:05 | FromDiscord | <nnsee> nope, didn't realize it existed to be honest |
14:02:19 | FromDiscord | <nnsee> In reply to @chronos.vitaqua "CodeQL?": https://codeql.github.com |
14:02:47 | FromDiscord | <Robyn [She/Her]> Oh neat |
14:03:55 | FromDiscord | <summarity> In reply to @nnsee "nope, didn't realize it": https://gh.io/securitylabslack |
14:05:03 | FromDiscord | <nnsee> In reply to @summarity "https://gh.io/securitylabslack": cool, thanks! joined |
14:15:17 | FromDiscord | <Phil> In reply to @PMunch "Note though that there": Either way, given that I didn't go to CS universities I'm forced to learn this stuff now |
14:15:31 | FromDiscord | <Phil> Man, I imagine a world where I'd had just... 5 years earlier exposure to programming |
14:16:29 | FromDiscord | <Phil> The levels of competence I'd have, memory management wouldn't be weird to me since I'd most definitely have mastered that by then, I'd be able to write guaranteed correct code even in the eyes of valgrind and sanitizers etc. |
14:17:02 | FromDiscord | <Phil> I'd be able to debug owlkettle memory leak issues that valgrind finds and discern whether they actually are leaks or just resources that don't get cleaned up between GTK shutdown and application end |
14:17:42 | FromDiscord | <Phil> Playing catch up is rough |
14:20:46 | FromDiscord | <Robyn [She/Her]> Ooor your knowledge would be outdated because comp sci is a field that moves fast? |
14:25:00 | PMunch | !remindme 5 years |
14:25:24 | FromDiscord | <summarity> Tiny wrapper thing I need today for another project: https://github.com/turbo/dmon.nim |
14:25:29 | PMunch | I mean these are things which haven't changed much, so by that logic you should be good in five years time |
14:26:03 | PMunch | summarity, oh cool |
14:26:51 | PMunch | There is a lot to learn by hand-wrapping C libraries in Nim, but did you give Futhark a try? |
14:28:19 | FromDiscord | <summarity> The programming language? No |
14:28:43 | FromDiscord | <Robyn [She/Her]> In reply to @PMunch "I mean these are": Fair |
14:28:43 | FromDiscord | <Robyn [She/Her]> Soon ternary computing takes the world by storm /j |
14:29:08 | PMunch | Damn it.. Wish I knew about the language before I named my library.. |
14:29:20 | PMunch | I was talking about this thing: https://github.com/PMunch/futhark |
14:29:28 | PMunch | Automatic C wrapper |
14:29:33 | FromDiscord | <summarity> I only know about the language from the Codegolf SE community 😄 |
14:31:43 | FromDiscord | <summarity> Ah, I see. I think I've come across this before. I found I actually don't mind wrapping by hand. I see Nim more as a convenient pre-processor for C (or C++). I'm working on a very large project where Nim needs to interface with a C++ codebase and C libraries and as you say, I've learned a lot (and discovered some nim bugs that have been fixed). |
14:32:38 | PMunch | Well, if you even want to save a couple hundred hours you know where to find it :P |
14:32:52 | PMunch | Hand wrapping takes a looong time, especially on larger projects |
14:38:41 | FromDiscord | <Phil> In reply to @chronos.vitaqua "Ooor your knowledge would": Sure it moves fast, but principles don't change |
14:38:56 | FromDiscord | <Phil> You may get new ways to do the same thing, but push mechanisms remain push mechanisms and pull mechanisms remain pull mechanisms |
14:39:12 | FromDiscord | <Robyn [She/Her]> Fair |
14:39:30 | FromDiscord | <Phil> It's all about understanding the core problem, then understanding the solutions to them becomes a lot easier |
14:39:35 | FromDiscord | <Phil> (edit) "problem," => "problem first," |
14:48:21 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
14:50:48 | * | flouer quit (Remote host closed the connection) |
14:51:12 | * | flouer joined #nim |
15:06:01 | FromDiscord | <Clonkk> I've got a SIGABORT raised on std/rdstdin, Is it fair to assume it's a RAM issue ? I don't see what else could cause a SIBABRT signal raised on readLineFromStdin |
15:10:01 | FromDiscord | <leorize> it's never lupus |
15:10:23 | * | rockcavera quit (Ping timeout: 256 seconds) |
15:24:50 | * | PMunch quit (Quit: Leaving) |
15:25:09 | FromDiscord | <Phil> In reply to @leorize "it's never lupus": Leorize, does nim has something like threadsignals somewhere or do I need to stitch that together with epoll and whatever the fuck on windows myself? |
15:25:39 | FromDiscord | <Phil> Well I guess I can at the very least try to steal chronos source code to the best of my abilities |
15:25:39 | FromDiscord | <leorize> basically |
15:26:14 | FromDiscord | <Phil> Though that looks like so much code to take responsibility for uuuuuugh |
15:28:11 | FromDiscord | <leorize> well we are getting CPS to run on nimskull \:p |
15:28:15 | FromDiscord | <Phil> I think just not supporting std/asyncdispatch for now may just be the easier solution since it entails having a lot more complex low-level code in my repo than I'd like |
15:28:29 | FromDiscord | <Phil> Id somebody wants it to be supported they can make an issue and PR themselves |
15:28:49 | FromDiscord | <Phil> (edit) "Id" => "If" |
15:36:18 | FromDiscord | <khazakar> In reply to @isofruit "Leorize, does nim has": Selectors won't work here as helper? |
15:38:10 | FromDiscord | <khazakar> And windows have iopoll I think |
15:41:06 | FromDiscord | <leorize> you can always emulate it with a pipe phil |
16:07:46 | FromDiscord | <Phil> In reply to @khazakar "Selectors won't work here": I have so far understood pipes and epoll, not selectors |
16:08:08 | FromDiscord | <Phil> In reply to @leorize "you can always emulate": Yeah I can but do I want to have and be forced to test that code is a different question |
16:08:27 | FromDiscord | <khazakar> In reply to @isofruit "I have so far": But selectors module contains wrappers around epoll etc |
16:09:25 | FromDiscord | <Phil> This may be running into "Docs don't sufficiently explain the way of usage to me" problem |
16:09:59 | FromDiscord | <leorize> you don't want to use selectors unless you're writing your own loop afaik |
16:10:13 | FromDiscord | <leorize> own loop here refers to your own asyncdispatch.poll |
16:18:05 | FromDiscord | <arnetheduck> In reply to @isofruit "<@449019668296892420> Thanks again for": good luck 😉 |
16:18:51 | FromDiscord | <arnetheduck> chronos v4 release candidate: https://github.com/status-im/nim-chronos/pull/494 - release due next week unless something comes up |
16:19:22 | FromDiscord | <arnetheduck> (edit) "In reply to @isofruit "<@449019668296892420> Thanks again for": good luck 😉 ... " added "feel free to improve the docs if you learn something useful" |
16:22:21 | FromDiscord | <Phil> In reply to @arnetheduck "chronos v4 release candidate:": Looking forward to it, particularly since afaik threadSync is only available via #head (at least nimble install chronos does not download you a version with threadsync in it) |
16:29:43 | * | azimut quit (Ping timeout: 240 seconds) |
16:35:13 | * | azimut joined #nim |
16:41:20 | * | flouer quit (Remote host closed the connection) |
16:41:42 | * | flouer joined #nim |
16:45:48 | * | SchweinDeBurg quit (Quit: WeeChat 4.2.0-dev) |
16:57:48 | FromDiscord | <khazakar> In reply to @isofruit "This may be running": It's in docs :p |
16:58:44 | FromDiscord | <khazakar> https://media.discordapp.net/attachments/371759389889003532/1197948268315938876/Screenshot_20240119-175810_Mull_1.png?ex=65bd1f43&is=65aaaa43&hm=e223d9f78dfe353b4618664c3fbd012140620237c1f0e96e0309a2962f1c62c6& |
16:59:05 | FromDiscord | <Phil> That's not a usage explanation |
16:59:25 | FromDiscord | <Phil> That's a hint for when you already know your multithreading primitives and thus know the entire concept |
16:59:30 | FromDiscord | <khazakar> Yes, it's not, just tells what is being wrapped |
16:59:31 | FromDiscord | <Phil> It's docs written for those already in the know |
17:05:15 | FromDiscord | <khazakar> Yeah. For me it's easier to understand it when I compare polling to self-rotating doors at shopping malls |
17:05:49 | FromDiscord | <khazakar> Python docs better explain it tho :p |
17:32:43 | FromDiscord | <Phil> Hmm good names to describe a thread powerding down |
17:32:49 | FromDiscord | <Phil> Can't use sleep, that's a well defined name for a proc |
17:32:55 | FromDiscord | <Phil> That does something very specific |
17:33:34 | FromDiscord | <Phil> Or rather to describe a thread going into a low powered state, aka a name for a proc that does that |
17:33:51 | entikan | what's a good way to get nim bindings for devkitPro's libnds (vanilla c)? futhark? c2nim? |
17:33:55 | FromDiscord | <Phil> (edit) "powerding" => "powering" |
17:34:18 | FromDiscord | <Phil> I tend to summon PMunch for those kinds of questions |
17:34:37 | entikan | oh wait I think it needs to compile to arm9 or something, I'm probably oversimplifying again |
17:34:46 | entikan | but it's still no-frills C |
17:34:50 | FromDiscord | <odexine> In reply to @isofruit "Or rather to describe": Suspend |
17:35:38 | FromDiscord | <Phil> In reply to @odexine "Suspend": perfect! |
17:36:03 | FromDiscord | <odexine> Probably best to refer to how computers refer to them going into those actual states too lol |
17:36:11 | FromDiscord | <odexine> Directly from thinking about how they’re named for laptops |
17:36:51 | FromDiscord | <odexine> Though I don’t understand the idea of a thread going “low power” |
17:40:02 | FromDiscord | <Phil> In reply to @odexine "Though I don’t understand": essentially it awaits a thread-signal and blocks on that in a waitFor block.↵This is essentially me implementing arne's example on how to use chronos in a loop with "interruptable" polling↵https://forum.nim-lang.org/t/10873 |
18:06:19 | * | icebattle joined #nim |
18:22:19 | FromDiscord | <Phil> Is there a way to use a local nimbledeps folder with a nim c command instead of .nimble/pkgs? |
18:22:58 | FromDiscord | <Phil> I know when I launch a command via nimble x it'll use the nimbledeps folder, but if I just do "--path:./nimbledeps" that won't fully work and I don't want to specify a --path flag for every subdir in the nimbledeps folder |
18:24:27 | FromDiscord | <michaelb.eth> could use shell expansion so you specify a path for every subdir, but not manually |
18:25:17 | FromDiscord | <michaelb.eth> I did that very thing for `nim c` many moons ago, can’t recall specifics atm though |
18:32:10 | FromDiscord | <Phil> In reply to @michaelb.eth "I did that very": You don't perchance know if there's a way for chronos to "only do remaining work until dispatcher is empty and then continue" , do you? |
18:32:53 | FromDiscord | <michaelb.eth> what do you mean by “then continue”? |
18:33:04 | FromDiscord | <michaelb.eth> as in not block/park? |
18:33:41 | FromDiscord | <Phil> "Block until all async work is done", basically after the while-loop of the threadServer is broken (aka it is shutting down) I want to wrap up all the async work before finishing |
18:34:33 | FromDiscord | <leorize> run `nimble setup` and it will generate you a nice nim.cfg |
18:35:17 | FromDiscord | <Phil> nope, you get a config.nims |
18:35:22 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#pasty=nTnWTdjbWJEJ |
18:35:45 | FromDiscord | <leorize> nimble.paths is a valid nim.cfg, though ;) |
18:35:50 | FromDiscord | <Phil> Not entirely sure what that does |
18:36:06 | FromDiscord | <leorize> it's a text file, you know |
18:36:19 | FromDiscord | <Phil> nimble.paths? |
18:36:55 | FromDiscord | <Phil> ... it is, how did that full into gitignore territory |
18:37:14 | FromDiscord | <leorize> because nimble setup also setup the ignores |
18:37:23 | FromDiscord | <leorize> which is dumb I tell you |
18:38:47 | FromDiscord | <Phil> So it should now via compiler magic "just know" to import from nimbledeps, right? |
18:39:07 | FromDiscord | <michaelb.eth> hmm, no, I don’t know of such a mechanism, have you tried searching the docs? |
18:39:32 | FromDiscord | <michaelb.eth> whoops, that was supposed to be a reply to Phil |
18:39:32 | FromDiscord | <Phil> I know --path, that's pretty much it |
18:40:33 | FromDiscord | <Phil> nim dump confirmed me most of my stu..... wait a second |
18:40:35 | FromDiscord | <michaelb.eth> In reply to @isofruit ""Block until all async": have you tried searching the chronos API docs? |
18:40:57 | FromDiscord | <Phil> Oh god damnit, threading is an optional dependency depending on the flags the user uses |
18:41:04 | FromDiscord | <Phil> and thus it's not in the paths |
18:42:09 | FromDiscord | <Phil> It also somehow forgot chronos wtf |
18:42:37 | FromDiscord | <Phil> There we go, compiles now |
18:43:28 | * | icebattle quit (Quit: Client closed) |
18:50:15 | * | jjido joined #nim |
18:50:53 | FromDiscord | <Robyn [She/Her]> In reply to @isofruit "Hmm good names to": Suspend, freeze, pause, rest |
18:51:51 | FromDiscord | <Robyn [She/Her]> In reply to @entikan "what's a good way": Futhark would be your best bet, if you want a clean wrapper tho, then you'd wrap it manually↵Futhark does the grunt of the work for you tho so I'd suggest that |
18:52:04 | FromDiscord | <Robyn [She/Her]> In reply to @odexine "Suspend": ah ignore me |
19:05:01 | FromDiscord | <Phil> Okay we're getting somwhere, getting memory leaks from chronos now, I'm assuming this is outstanding work not being cleaned up on thread-exit |
19:06:19 | * | flouer quit (Read error: Connection reset by peer) |
19:07:34 | FromDiscord | <Phil> Its not a per message thing but it still somehow manages to leak 36KB by the end of the test |
19:08:45 | FromDiscord | <Phil> (edit) "36KB" => "19KB" |
19:10:38 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
19:11:06 | FromDiscord | <Phil> Okay, debugging chronos memory leaks is sth else.↵This is the stacktrace of my direct leak (got a bunch of indirect ones): |
19:11:17 | FromDiscord | <Phil> https://media.discordapp.net/attachments/371759389889003532/1197981621735919656/message.txt?ex=65bd3e54&is=65aac954&hm=9852c6f1fbc2647439182e2440a3852387457977b11b75adea3b8d5657c94570& |
19:12:02 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#pasty=UjwjuayyntUk |
19:28:53 | FromDiscord | <Robyn [She/Her]> The futures maybe? |
19:28:57 | FromDiscord | <Robyn [She/Her]> Idk |
19:32:34 | entikan | thanks robyn |
19:32:43 | entikan | I'll give it a whirl |
19:32:55 | * | azimut quit (Ping timeout: 240 seconds) |
19:33:14 | * | azimut_ joined #nim |
19:33:30 | * | azimut_ quit (Remote host closed the connection) |
19:38:31 | * | azimut joined #nim |
19:55:32 | FromDiscord | <Phil> The thing is that with std/asyncdispatch the solution was just to nil the global dispatcher |
19:55:40 | FromDiscord | <Phil> If I pull that with chronos it'll throw an assertiondefect |
20:00:12 | FromDiscord | <Phil> Ohhhhh call `=destroy` on it instead! |
20:00:31 | FromDiscord | <Phil> However, tsan completely blows up, holy crap |
20:02:45 | FromDiscord | <damocles_1605> So Nim does have threading and memory management so long as I want to compile into C++ yes? |
20:07:04 | FromDiscord | <Phil> sent a long message, see https://pasty.ee/qlyMcUxlagkC |
20:07:26 | FromDiscord | <damocles_1605> aight that answers my question. |
20:07:29 | FromDiscord | <Phil> And by threading, I mean you can spawn threads with a proc to execute in any backend that isn't JS (afaik) |
20:07:45 | FromDiscord | <damocles_1605> I probably should have just asked, yes pointers or no pointers. |
20:08:00 | FromDiscord | <Phil> Can pointers but not recommended pointers |
20:08:06 | FromDiscord | <Phil> Nim has ref types instead which are managed |
20:08:14 | FromDiscord | <Phil> via automatically inserted hooks |
20:15:15 | FromDiscord | <damocles_1605> No idea what that means yet. I just know basic Java. But I want to move unto something I might prefer and also expand the scope of experiences. Nim seems to fit the bill. I don't plan on programming as a career but I want to have some understanding of it. |
20:20:56 | FromDiscord | <Phil> In reply to @damocles_1605 "No idea what that": You ever noticed the difference between a java object and an int?↵In how one is pass by value and the other "pass-by-reference", aka if you manipulate an object in a function outside of the function you'll see the object have that change, while if you pass it an int and manipulate that int it won't? |
20:21:24 | FromDiscord | <Phil> Actually never mind, that doesn't describe the difference well, hmm |
20:22:17 | FromDiscord | <Phil> Basically a reference is exactly the same as a pointer, with the difference that nim takes care of dealing with it for you.↵A pointer (derived from what it means in C) just means "points to a piece of memory in C", freeing that is something you must do manually with a proc that deallocates |
20:23:16 | FromDiscord | <damocles_1605> In reply to @isofruit "You ever noticed the": After every comma I feel there are more tenses or subjects missing. What am I passing an int into? |
20:23:36 | FromDiscord | <Phil> Into a function |
20:24:11 | FromDiscord | <luteva> Hi! I am wondering: I have a folder "pkgs" in my ~/.nimble folder with dozens of libs in there and I have a "pkgs2" folder in my ~/.nimble folder with only 3 libs.↵I guesss that this is because i have installed many libs while using nim version 1.x and i only installed a few libs since is installed nim version 2. Is that correct? And if yes: Can I use the libs from nim version 1.x also for nim version 2.x? Or should i install the libs ag |
20:24:59 | FromDiscord | <damocles_1605> In reply to @isofruit "Into a function": Wait so we are talking about changing the original function vs just using the value within a given function and keeping a local reference for it? |
20:25:50 | FromDiscord | <Phil> In reply to @damocles_1605 "Wait so we are": Nah, I fucked up there and tried to go into "pass-by-value" vs. "pass-by-reference" when I actually wanted to explain "managed memory with references" vs "unmanaged memory with pointers" |
20:29:58 | FromDiscord | <Phil> In reply to @luteva "Hi! I am wondering:": Honestly most libs are fine, the jump from 1.6 to 2.0 was not massive |
20:30:09 | FromDiscord | <Phil> If any of you 1.X libs is not ready, you'll notice with compiler errors |
20:30:40 | FromDiscord | <Phil> However, what is far better for your sanity is either using atlas or at the very least adding a nimbledeps folder to your project and running nimble setup |
20:30:55 | FromDiscord | <Phil> Why? Because then you have a directory with all the packages that you use inside it and can check what you're using |
20:31:32 | FromDiscord | <Phil> Believe me, it might take a year or two until you get to that point, but you will eventually get somewhere where a subtle version bug will drive you mad |
20:32:04 | FromDiscord | <Phil> And being able to directly sanity check what code you're using with a nimbledeps directory will help a lot there |
20:32:40 | FromDiscord | <Phil> The mechanism I speak of with nimbledeps is mentioned here: https://github.com/nim-lang/nimble#nimbles-folder-structure-and-packages |
20:32:56 | FromDiscord | <luteva> didn't know atlas at all... gonna have a look at atlas 🙂 |
20:33:53 | FromDiscord | <Phil> It's also safer in some respects, so I'm planning on migrating soon-ish myself once I can spend enough focus on doing so |
20:34:21 | FromDiscord | <Phil> Still utterly stuck on memory leaks. Not drastic ones and in very special, non-standard memory configurations, but still! |
20:36:56 | FromDiscord | <luteva> this one, right? https://github.com/nim-lang/atlas |
20:41:10 | FromDiscord | <luteva> ah ok an isolated workspace. yes that's nice 😄 |
20:41:36 | FromDiscord | <luteva> (edit) "😄" => "👍" |
21:14:09 | * | krux02 quit (Remote host closed the connection) |
21:18:19 | FromDiscord | <nasuray> In reply to @luteva "this one, right? https://github.com/nim-lang/atlas": FYI Seems like Araq is cooking up a big refactor on atlas that will change how it manages state and dependencies (for the better). |
21:47:47 | FromDiscord | <Robyn [She/Her]> ...hm, would it be a stupid idea to glue together something for a chat platform that doesn't have the REST API yet? |
21:48:51 | FromDiscord | <Phil> I am not familiar what you're building, what do you mean? |
21:49:23 | FromDiscord | <Robyn [She/Her]> I dn't even know tbh |
21:49:46 | FromDiscord | <Robyn [She/Her]> Basically a chat platform API with the HTTP layer not included (yet) |
21:50:01 | FromDiscord | <Phil> I mean, chat is typically done via websockets nowadays |
21:50:09 | FromDiscord | <Phil> Strictly speaking you don't need HTTP at all |
21:50:29 | FromDiscord | <Phil> I'd still use it for client --> Server part of the communication, simply because for POST requests I'd want an answer from the server and not have to design my own |
21:50:37 | FromDiscord | <Phil> But it's doable without even that |
21:50:52 | FromDiscord | <Robyn [She/Her]> In reply to @isofruit "I mean, chat is": True but that feels inconvienient :p |
21:52:05 | FromDiscord | <Phil> I'd honestly claim that the alternative isn't really a good idea |
21:52:19 | FromDiscord | <Phil> Like, your ideas there are polling or long polling, both of which will be a PITA |
21:52:19 | FromDiscord | <Robyn [She/Her]> I meant moreso during the dev process |
21:52:29 | FromDiscord | <Robyn [She/Her]> It'd just be functions without the HTTP API implemented yet |
21:52:36 | FromDiscord | <Phil> (edit) "ideas" => "alternatives" |
21:52:56 | FromDiscord | <Robyn [She/Her]> Until I get to a point where I fleshed out enough of the chat server code |
21:53:10 | FromDiscord | <Robyn [She/Her]> Then I'd implement a HTTP layer on top of this :p |
21:53:12 | FromDiscord | <Phil> So is this a question on what backend functionality you need to write if you ignore controllers? |
21:53:23 | FromDiscord | <Phil> Or is this about frontend functionality if you ignore backend? |
21:53:24 | FromDiscord | <nnsee> In reply to @chronos.vitaqua "It'd just be functions": yes that's absolutely fine |
21:53:36 | FromDiscord | <nnsee> it's a separation of implementation from the interface |
21:53:41 | FromDiscord | <Robyn [She/Her]> Ras understands! I'm just so tired and always mushy brained xD |
21:53:46 | FromDiscord | <Phil> Maybe memory leak researching is burning my brain here |
21:53:53 | FromDiscord | <Robyn [She/Her]> In reply to @nnsee "it's a separation of": Yeah ehe |
21:53:59 | FromDiscord | <nnsee> and you can absolutely work on the implementation before the interface |
21:54:20 | FromDiscord | <Phil> In reply to @nnsee "it's a separation of": I mean yeah, but is it abstracting away the backend call in the FE or the control layer for the BE? |
21:54:38 | FromDiscord | <Phil> (edit) "control" => "controller" |
21:54:40 | FromDiscord | <Robyn [She/Her]> This still means I need to figure out how I should handle database stuff... Raw SQL, a query builder or an ORM... |
21:54:49 | FromDiscord | <nnsee> i usually do it the other way around, make stub API endpoints so i have a rough idea and plan on how I'll go about implementing everything |
21:54:50 | FromDiscord | <Robyn [She/Her]> In reply to @isofruit "I mean yeah, but": This is related to the backend |
21:54:58 | FromDiscord | <Phil> Ah, basically you only want to implement the service and repository layers |
21:55:00 | FromDiscord | <Robyn [She/Her]> I do not touch frontend |
21:55:02 | FromDiscord | <Robyn [She/Her]> Yeah! |
21:55:17 | FromDiscord | <Phil> Sure you can implement those first |
21:55:21 | FromDiscord | <Robyn [She/Her]> In reply to @nnsee "i usually do it": I tried doing that for every attempt so far but it gets so convoluted and I lose my motivation sadly |
21:55:32 | FromDiscord | <nnsee> the backend API is just the frontend to the frontend |
21:55:34 | FromDiscord | <Robyn [She/Her]> So I'm gonna try going about it a different way |
21:55:39 | FromDiscord | <nnsee> fair enough |
21:55:57 | FromDiscord | <Phil> In reply to @nnsee "the backend API is": And the backend calls in the frontend are just the backend of the frontend 😄 |
21:56:35 | FromDiscord | <nnsee> i write applications with only backends, no frontends. the frontend? actually a backend |
21:56:53 | FromDiscord | <Phil> "The backend? Also a backend" |
21:57:01 | FromDiscord | <Phil> "This HTML? Believe it or not, also backend" |
21:57:07 | FromDiscord | <Phil> "This JS File? Straight backend" |
21:57:31 | FromDiscord | <Phil> "This file instantiating tons of widgets? Definitely backend" |
21:57:56 | FromDiscord | <Phil> (edit) "Definitely" => "Double" |
21:59:02 | FromDiscord | <nnsee> In reply to @isofruit ""This HTML? Believe it": you jest but recently it's been kind of hard to tell the difference |
21:59:31 | FromDiscord | <Phil> I mean, generally everything in between database and HTML gets kinda wonky in definition |
21:59:49 | FromDiscord | <Phil> HTML itself I haven't yet encountered scenarios where I'd consider it a backend |
22:00:18 | FromDiscord | <Phil> but everything in between? You have layers upon layers that interact and everyone as to one side the FE and to the other the BE |
22:01:57 | FromDiscord | <nnsee> In reply to @isofruit "HTML itself I haven't": may i introduce you to .net blazor, where the only front end is mouse click coordinates and key presses, and everything else (dom rendering, navigating pages, etc) happens on the server side and where existence is hell |
22:02:17 | FromDiscord | <Phil> you lost me at .net |
22:02:27 | FromDiscord | <Phil> Not content-wise, interest-wise |
22:03:05 | FromDiscord | <Phil> Likely a character-flaw of mine, but at this point I look at MS provided frameworks/languages and just go "ehhhhhhhhhhhh I'd rather not" |
22:04:02 | FromDiscord | <muddmaker> Blazor is legendary for its awful performance |
22:04:14 | FromDiscord | <Phil> it is? |
22:04:24 | FromDiscord | <Phil> Isn't it written in C# or sth which should be doing alright in that regard? |
22:04:41 | FromDiscord | <muddmaker> For the frontend, that doesn't translate well |
22:04:41 | FromDiscord | <Phil> I mean sure, could be awful C# but I'd assume MS knows at least somewhat what they're doing |
22:04:51 | FromDiscord | <Phil> The programming paradigm? |
22:05:26 | FromDiscord | <Robyn [She/Her]> In reply to @nnsee "may i introduce you": That sounds horrid |
22:05:35 | FromDiscord | <muddmaker> The only wasm frontend frameworks that get somewhat OK performance are all written in Rust, and they are still around 4% slower at best for non-compute heavy tasks |
22:05:42 | FromDiscord | <Robyn [She/Her]> In reply to @isofruit "Isn't it written in": It's because they shove the .NET runtime into WASM :p |
22:06:11 | FromDiscord | <muddmaker> Wasm doesn't get to share strings with the DOM's runtime, so there's a lot of string copying that has to happen |
22:06:34 | FromDiscord | <Robyn [She/Her]> In reply to @muddmaker "The only wasm frontend": Yeah that's to be expected since it also has to do JS interop for the DOM functionality and stuff, which means a lot of stubs and as Muddmaker said, copying |
22:06:38 | FromDiscord | <Phil> So basically WASM remains in the space of "Only use for number crunch" ? |
22:06:53 | FromDiscord | <Robyn [She/Her]> I'm all for replacing JS with WASM but it needs to mature 😔 |
22:07:05 | FromDiscord | <muddmaker> Sort of... there are some rust frameworks like leptos that are almost competitive |
22:07:17 | FromDiscord | <muddmaker> It performs better than react |
22:07:19 | FromDiscord | <Robyn [She/Her]> In reply to @isofruit "So basically WASM remains": Probably until native DOM APIs for WASM, but there's some that exist so |
22:07:32 | FromDiscord | <Robyn [She/Her]> In reply to @muddmaker "It performs better than": Huh neat! Isn't React loaded though? |
22:08:09 | FromDiscord | <muddmaker> React is fairly slow for a modern JS framework. Still _way_ better than Blazor, though |
22:08:28 | FromDiscord | <muddmaker> Here's the benchmark site that most JS people use: <https://krausest.github.io/js-framework-benchmark/2023/table_chrome_120.0.6099.62.html> |
22:08:35 | FromDiscord | <muddmaker> Doesn't include karax, though |
22:09:41 | FromDiscord | <muddmaker> But compiling to JS would be a generally better tactic for now. Compiling the whole .NET runtime into WASM and running it in the browser is.... uh.... |
22:10:04 | FromDiscord | <muddmaker> There's a lot of fancy stuff that leptos and others have to do to make itself competitive with JS |
22:10:19 | FromDiscord | <Phil> Huh, Angular did better than I anticipated |
22:10:27 | FromDiscord | <Phil> I assumed it to be at best middle of the pack |
22:11:06 | FromDiscord | <Robyn [She/Her]> In reply to @muddmaker "There's a lot of": Fair |
22:12:26 | FromDiscord | <nnsee> I've really been enjoying react (and TS) as of late |
22:12:38 | FromDiscord | <nnsee> has been a really pleasant developer experience |
22:13:07 | FromDiscord | <muddmaker> My favorite web framework is whatever pays the bills |
22:13:12 | FromDiscord | <Robyn [She/Her]> I refuse to touch the realm of JS :p |
22:13:27 | FromDiscord | <Phil> It's.... well it's bad, but it can be alright |
22:13:34 | FromDiscord | <Phil> If you have competent colleagues |
22:13:39 | FromDiscord | <Phil> And not insane deadlines |
22:13:46 | FromDiscord | <muddmaker> They all suck, but some suck less than others |
22:14:02 | FromDiscord | <Phil> That you're supposed to reach while your only FE teammates are junior devs that haven't internalized company standards yet |
22:14:14 | FromDiscord | <Phil> This may be sounding entirely too close to my current situation |
22:14:58 | FromDiscord | <muddmaker> While both are in development, SolidStart + Drizzle are probably going to be the best frameworks to use in combination that the JS world has to offer |
22:15:52 | FromDiscord | <nnsee> In reply to @isofruit "If you have competent": luckily, I'm working alone on this project and don't have any hard deadlines for this. Many soft deadlines, though, that I can just say "oh I haven't finished it yet" |
22:16:02 | FromDiscord | <nnsee> it's been a fun tinkering project |
22:16:16 | FromDiscord | <Phil> In reply to @nnsee "luckily, I'm working alone": Man, I fucking wish |
22:16:26 | FromDiscord | <Phil> One of my juniors is pretty alright and getting up there |
22:16:41 | FromDiscord | <Phil> But the second one actively reduces my productivity by at least 50% whenever I have to help them up |
22:16:44 | FromDiscord | <Phil> (edit) "up" => "out" |
22:17:18 | FromDiscord | <Phil> With nothing sticking that you tell em, so glad I'm finally getting a senior for backup |
22:17:28 | FromDiscord | <Phil> (edit) "em," => "the second one," |
22:17:40 | FromDiscord | <luteva> waht do i have to do to update a depenency where i changed the source? So in my nim app i use a dependency "import mydep" where mydep is not mine, it's installed from github. now, i would like to add a proc to mydep, that i would like to use in my nim app.↵so what do i have to do to use the updated version of mydep in my app?↵- compile the mydep lib, and then ...? |
22:19:29 | FromDiscord | <nnsee> In reply to @isofruit "But the second one": we're not a large enough company to even have juniors or seniors, so yeah |
22:20:12 | FromDiscord | <Phil> In reply to @luteva "waht do i have": Do you use requires in your nimble file? |
22:20:23 | FromDiscord | <luteva> yes |
22:21:07 | FromDiscord | <Phil> Basically:↵1) Fork the project↵2) Do your changes↵3) Replace what's inside the requires block with the HTTP url to your fork |
22:21:34 | FromDiscord | <Phil> Oh wait, you use Atlas, errrr |
22:21:46 | FromDiscord | <Phil> I bet you can `atlas install <http-url>` or so |
22:22:02 | FromDiscord | <luteva> ok but i still have to fork, first? |
22:22:10 | FromDiscord | <nnsee> doesn't atlast have its own vendoring mechanism? |
22:22:13 | FromDiscord | <Phil> Aye, so you have your own version of the package |
22:22:18 | FromDiscord | <nnsee> maybe i'm misremembering |
22:22:19 | FromDiscord | <luteva> i can't use the local environment? |
22:22:23 | FromDiscord | <Phil> In reply to @nnsee "doesn't atlast have its": I'd need to know what that means first |
22:22:45 | FromDiscord | <Phil> In reply to @luteva "i can't use the": Oh you can, having a repo just means you're not screwed if you need to build from another machine |
22:22:55 | FromDiscord | <nnsee> In reply to @isofruit "I'd need to know": https://stackoverflow.com/questions/26217488/what-is-vendoring |
22:23:01 | FromDiscord | <Phil> If having it all local works, well you have some kind of nimbledeps folder right? |
22:23:12 | FromDiscord | <Phil> Something where all your locally used libs are in for this particular project |
22:23:16 | FromDiscord | <Phil> You can just do the changes in there |
22:24:44 | FromDiscord | <Robyn [She/Her]> Atlas seems cool but looking at Cargo when I used it, I liked it |
22:25:59 | FromDiscord | <Robyn [She/Her]> Nimble just feels odd and I'm not sure why |
22:26:40 | FromDiscord | <Phil (he/him)> ping |
22:26:55 | * | rockcavera joined #nim |
22:27:00 | FromDiscord | <Phil> Oh wow, the bridge just did not transfer an entire section of the chat |
22:27:02 | FromDiscord | <nnsee> nimble feels only slightly better than a well written shell script |
22:27:44 | FromDiscord | <Robyn [She/Her]> In reply to @isofruit "Oh wow, the bridge": It does that |
22:27:57 | FromDiscord | <Robyn [She/Her]> In reply to @nnsee "nimble feels only slightly": I avoid bash at all costs |
22:28:03 | FromDiscord | <Robyn [She/Her]> Nimble is better than bash but oof |
22:28:20 | FromDiscord | <Robyn [She/Her]> I think I'd like Cargo for Nim...maybe I should do something like that :P |
22:29:20 | FromDiscord | <Robyn [She/Her]> I keep getting new ideas, I need to put a lid on it |
22:30:39 | FromDiscord | <nnsee> I like to keep a to-do list of all of my ADHD ideas that I re-read every now and then |
22:30:55 | FromDiscord | <Robyn [She/Her]> ...Huh that's genius! |
22:30:57 | FromDiscord | <nnsee> when it still feels like a good idea or something I'd want to do a year later, I'll do it |
22:31:22 | FromDiscord | <Robyn [She/Her]> Thanks for the idea :D |
22:34:24 | FromDiscord | <Robyn [She/Her]> Hm so first thing I need: Account management |
22:43:35 | FromDiscord | <Robyn [She/Her]> `sentinel` shall be the model name :) |
22:43:41 | FromDiscord | <Robyn [She/Her]> What does a `#?` comment mean- |
22:45:06 | FromDiscord | <mratsim> In reply to @chronos.vitaqua "I think I'd like": Cargo is good |
22:49:15 | FromDiscord | <Robyn [She/Her]> Indeed! |
22:52:02 | FromDiscord | <luteva> In reply to @isofruit "If having it all": works now, thx! |
22:55:36 | * | jjido joined #nim |
22:56:45 | FromDiscord | <damocles_1605> So, out of curiosity. I understand Nim can compile into C++, but thats different from it being converted to C++ right? |
22:57:00 | FromDiscord | <damocles_1605> I can't simply make Nim code turn into C++ code for the convenience of non-nim users right? |
23:13:14 | FromDiscord | <Elegantbeef> Damn the bridge missed a lot |
23:13:39 | * | advesperacit quit () |
23:13:56 | FromDiscord | <ElegantBeef> @damocles_1605 it generates C++ code it does not generate idiomatic C++ |