<< 20-01-2024 >>

00:16:32*SchweinDeBurg joined #nim
00:18:33*fallback quit (Read error: Connection reset by peer)
00:48:59*rockcavera quit (Read error: Connection reset by peer)
00:49:30*rockcavera joined #nim
00:49:55FromDiscord<damocles_1605> I see.
00:50:04FromDiscord<damocles_1605> Well then. I will stick with C++ for the time being.
01:30:45Amun-Rait's rather used for interop the other way around
01:57:00FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#pasty=gijEGJQGlKoI
02:07:50arkanoidI know very little about frontend development, but I'm peeking into karax and it's uti karun. Do you know if autoreload is implemented here? I see that karun process remains open after creating html + javascript and summoning the default web browser
02:11:21arkanoidnevermind, it's karun -r -w myapp.nim
02:37:35arkanoidspent the initial 15 minutes to fight nimsuggests blaming conflicts and errors in my code running karax helloworld, which runs as expected
02:41:30arkanoidhttps://play.nim-lang.org/#pasty=RtLnYPhUwych
02:48:44FromDiscord<nasuray> In reply to @arkanoid "spent the initial 15": Are you targeting the js or c backend? I usually need to add `--backend:js` to `nim.cfg` or the nimble file so nimsuggest doesn't immediately panic with Karax.
02:49:02arkanoidthe editor is runnig nimsuggest as "nimsuggest karax_playground/src/helloworld.nim --v3 --autobind"
02:49:39arkanoidI though the same, but I was trying adding backend = "js" to .nimble file instead
02:51:09FromDiscord<nasuray> In reply to @arkanoid "I though the same,": Might try adding it to a project wide `nim.cfg`
02:52:42arkanoiddone that. Weird, the problem went away, but htop shows that nimsuggest is still executed as "nimsuggest karax_playground/src/helloworld.nim --v3 --autobind"
02:53:58arkanoidthanks for the suggestion
02:55:34arkanoidbtw I'm testing the new official vscode extension. nimsuggest processes are still hanging around clogging my memory. Trivial steps: open vscode, open nim file, watch nimsuggest process spawn, close vscode, watch nimsuggest process not killed, repeat, wait for OOM
02:56:59FromDiscord<nasuray> In reply to @arkanoid "done that. Weird, the": Also I like watchexec for working on Karax projects...an example config.nims https://github.com/nimpkgs/website/blob/main/config.nims
02:58:57arkanoidnasuray, thanks! what's the advantge over karun -w -r ? that also recompiles, but also refresh frowser
03:01:41FromDiscord<nasuray> Does it launch a web server? I can't recall my exact qualms with it.
03:01:54arkanoidare you the author of nimpkgs.dayl.in ?
03:03:11arkanoidnasuray, yes it runs a static web server, creates html + app.js, opens your browser on it, and refresh page on changes (-w option)
03:04:23FromDiscord<nasuray> In reply to @arkanoid "are you the author": Indeed!
03:06:06arkanoidthanks for that!
03:07:19*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
03:14:43*azimut quit (Remote host closed the connection)
03:15:19*azimut joined #nim
03:55:19*azimut quit (Ping timeout: 240 seconds)
03:55:41arkanoidwhat is char `+` doing here? https://github.com/CEShahed/linear-barcode/blob/6d5768554fb61e5ca7dde6c627b8de45b60da23e/play.nim#L99C3-L99C5
04:09:40*azimut joined #nim
04:09:54FromDiscord<.__kenshin__.> sent a code paste, see https://play.nim-lang.org/#pasty=WwnlQRRPZXKA
04:10:31*pbsds quit (Quit: The Lounge - https://thelounge.chat)
04:11:14*pbsds joined #nim
04:11:39arkanoidnasuray, do you know why the example on the main page suggests to wrap kdom.setInterval instead of calling redraw(kxi) inside the update() proc? https://github.com/karaxnim/karax/tree/master#reactivity
04:22:36FromDiscord<nasuray> In reply to @arkanoid "<@372579559645773828>, do you know": It's a specific case of utilizing the browser API it wraps to call update repeatedly at a given interval.
04:25:33arkanoidnasuray, sure, I know what setInterval does, but here I don't get if there's a technical difference in calling redraw inside wrapper setInterval or inside the update function
04:26:48FromDiscord<nasuray> In reply to @arkanoid "<@372579559645773828>, sure, I know": Ah ya I don't think that makes a difference
04:32:42arkanoidnasuray, thanks
04:43:00FromDiscord<wick3dr0se> Is it possible to change directory with Nim? Like setCurrentDir() of course does for the program but not in the interactive shell. Normally in a script you would execute something like `bash --login` to solve this I think. Is a `cd` implementation better written in nimscript vs nim for accessing envs and such?
05:21:27*fallback joined #nim
05:25:40FromDiscord<zectbumo> maybe you should start with what you are trying to achieve
05:47:35FromDiscord<wick3dr0se> In reply to @zectbumo "maybe you should start": Me? I did, I thought o_O. Changing a directory within the interactive shell is the simplest I think I can explain it. `cd` just changes directories and setCurrentDir(), well doesn't, at least in the shell
05:48:00FromDiscord<zectbumo> it's an odd request so it leaves me to wonder what you are actually trying to achieve
05:48:14FromDiscord<zectbumo> are you trying to write your own shell?
05:48:23FromDiscord<wick3dr0se> Just that really. Not planning to actually use it lol
05:48:41FromDiscord<wick3dr0se> I am writing my own distribituon and decided to write my own coreutils
05:48:48FromDiscord<wick3dr0se> So that is the motive lol
05:49:02FromDiscord<zectbumo> okay so you are writing your own shell
05:49:43FromDiscord<wick3dr0se> Well I would love to go to that extent but for now it's just a series of programs intended to work with Bash shell
05:50:07FromDiscord<zectbumo> why not use cd in bash then?
05:50:54FromDiscord<wick3dr0se> Well I think `cd` isn't fully builtin to bash. Like it's made a builtin just to be able to manipulate the shell environment I think
05:51:06FromDiscord<Elegantbeef> It is apart of your shell
05:51:53FromDiscord<zectbumo> cd is bash
05:52:11FromDiscord<wick3dr0se> Ok well then I guess I should drop the `cd` one. Although writing a new shell and `cd` program would definitely be more intriguing
05:53:03FromDiscord<zectbumo> want to see magic? echo $PWD↵PWD=/tmp↵now you are in /tmp 😄↵that's all cd does
05:53:35FromDiscord<wick3dr0se> Changing $PWD will change your directory? 😮
05:54:13FromDiscord<zectbumo> 🤯 I know
05:54:27FromDiscord<wick3dr0se> I worked with it quite a bit.. Sad I never knew that lol
05:54:50FromDiscord<zectbumo> more like the other way around, PWD is your current directory
05:57:22FromDiscord<wick3dr0se> Yea I wrote a file manager in bash that uses `$PWD/` to check files in current directory. If thats the case I could just update $PWD and it'll jump to whichever directory without `cd`. But I may have misunderstood you
05:59:52FromDiscord<zectbumo> btw, cd does actually do more than just that. it also sets your last dir, located in OLDPWD, so when you `cd -` it PWD=$OLDPWD
06:02:26FromDiscord<wick3dr0se> Ok thats sick! I'll dive into the `man` pages a bit next time first 😅
06:05:49*rockcavera quit (Remote host closed the connection)
06:51:35NimEventerNew thread by enaaab460: Trying multiple compilation settings in parallel, see https://forum.nim-lang.org/t/10890
07:02:31*azimut quit (Ping timeout: 240 seconds)
07:35:16*redj_ quit (Quit: No Ping reply in 180 seconds.)
07:36:48*redj joined #nim
07:36:49NimEventerNew Nimble package! mummy_utils - Utility package for mummy multithreaded server, see https://github.com/ThomasTJdev/mummy_utils
08:58:45*advesperacit joined #nim
09:00:10*disso-peach quit (Ping timeout: 276 seconds)
09:05:29*jjido joined #nim
09:26:49*jmdaemon joined #nim
09:57:54*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
10:07:31FromDiscord<sOkam! 🫐> what type should be used for storing key+value pairs where the key might exist multiple times?↵Do tables support multiple instances of the same key with a different (or same) value?
10:08:04FromDiscord<sOkam! 🫐> I'm reading the `std/tables` manual, but there is no single example with repeated keys, so its making me doubt what I'm understanding
10:08:14FromDiscord<Phil (he/him)> Conceptually, what value would you even expect to get out of a table with multiple entries for the same key?
10:08:43FromDiscord<sOkam! 🫐> true that
10:08:48FromDiscord<odexine> https://nim-lang.org/docs/tables.html#add%2CTable%5BA%2CB%5D%2CA%2CsinkB
10:09:08FromDiscord<sOkam! 🫐> what type would you use to store `--path:something --path:else`?
10:09:18FromDiscord<Phil (he/him)> Okay can somebody sanity check this for me, I feel like I'm going insane, it is really minimal
10:09:26FromDiscord<sOkam! 🫐> i was thinking as `path` as they key of a table. but you raised a good point
10:09:34FromDiscord<odexine> In reply to @heysokam "what type would you": string key w/ seq string value
10:09:52FromDiscord<odexine> In reply to @Phil (he/him) "Okay can somebody sanity": this = ?
10:09:56FromDiscord<Phil (he/him)> sent a code paste, see https://play.nim-lang.org/#pasty=rLwjnjwxDAbS
10:10:01FromDiscord<sOkam! 🫐> In reply to @odexine "string key w/ seq": ty
10:10:17FromDiscord<odexine> sent a code paste, see https://play.nim-lang.org/#pasty=lolkRdaqBvGP
10:10:34FromDiscord<Phil (he/him)> Cowaaaaaard
10:10:49FromDiscord<odexine> its a saturday smh
10:12:45FromDiscord<sOkam! 🫐> you lost me at the `Channel` phil, so wont be able to give any sanity there 😔
10:13:00FromDiscord<Phil (he/him)> It's mostly whether your computers do the same as mine
10:13:19FromDiscord<sOkam! 🫐> oh just to run it? let me try
10:13:23FromDiscord<Phil (he/him)> if I'm having some setup specific issues or somehow tsan is now completely screwed
10:14:13advesperacitYes, "FATAL: ThreadSanitizer: unexpected memory mapping 0x5a26c31ee000-0x5a26c320e000"
10:14:41FromDiscord<Phil (he/him)> What system are you on, which kernel?
10:14:49FromDiscord<Phil (he/him)> Or even better if its windows tbh
10:15:20advesperacit6.7.0-zen3-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Sat, 13 Jan 2024 14:36:54 +0000 x86_64 GNU/Linux
10:15:33FromDiscord<Phil (he/him)> 6.7.0-arch3-1
10:15:36FromDiscord<Phil (he/him)> Hmm
10:16:11FromDiscord<Phil (he/him)> I mean a Kernel caused these kinds of issues in the past but that was 7 years ago
10:17:39FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=UjMbVYXmTcgX
10:17:40FromDiscord<Phil (he/him)> https://github.com/google/sanitizers/issues/1716↵GOD↵FUCKING↵DAMNIT
10:18:34FromDiscord<sOkam! 🫐> personally i would try with zigcc just to double check, Phil
10:18:44FromDiscord<sOkam! 🫐> their sanitizing setup is on point
10:18:54FromDiscord<Phil (he/him)> sent a code paste, see https://play.nim-lang.org/#pasty=HJaDTJyxzfLg
10:19:06FromDiscord<Phil (he/him)> Hell, it'll trigger on an empty file
10:19:41FromDiscord<odexine> xd
10:19:50FromDiscord<odexine> i can check in a moment cuz fuck you
10:20:12FromDiscord<Phil (he/him)> Ah so now you're back on board when it comes to dunking on me!
10:21:41FromDiscord<sOkam! 🫐> seems like nim is getting confused in how to passc the options to clang, it gives them between "" and it breaks
10:22:01FromDiscord<odexine> yeah indeed it runs fine on a non-6.6+ kernel
10:22:27FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=rvmcMEgUqdaR
10:22:42FromDiscord<odexine> it runs just fine iirc
10:22:53FromDiscord<odexine> i mean, with the quotes
10:23:04FromDiscord<sOkam! 🫐> then it might be my setup, since i don't have nim installed officially
10:23:23FromDiscord<Phil (he/him)> there should be a passc in there somewhere↵(@sOkam! 🫐)
10:23:34FromDiscord<Phil (he/him)> the "" is the value for the passc and passl flags
10:23:40FromDiscord<sOkam! 🫐> In reply to @Phil (he/him) "there should be a": there is, but that's what the final command for clang is
10:23:43FromDiscord<Phil (he/him)> the "" is the value for the passc and passl flags
10:23:57FromDiscord<sOkam! 🫐> yeah i know, but its passing it literally with "" to clang
10:23:59FromDiscord<Phil (he/him)> weird, might be more setup related in your case though
10:24:09FromDiscord<sOkam! 🫐> rika said that should work, but the command is crashing there for some reason
10:24:20FromDiscord<sOkam! 🫐> yeah probably
10:24:31FromDiscord<sOkam! 🫐> well, i guess i wasn't useful. sry about that
10:24:42FromDiscord<Phil (he/him)> All good, don't worry
10:25:59FromDiscord<odexine> sent a code paste, see https://play.nim-lang.org/#pasty=BcPeunzhEnuR
10:26:01FromDiscord<odexine> seems fine
10:26:20FromDiscord<odexine> not sure whats up with your setupt
10:26:21FromDiscord<odexine> (edit) "setupt" => "setup"
10:27:17FromDiscord<sOkam! 🫐> that doesn't have the ""
10:27:26FromDiscord<sOkam! 🫐> for some reason mine is sending them to clang itself
10:27:34FromDiscord<odexine> i know
10:27:44FromDiscord<odexine> thats what i intended to convey
10:27:49FromDiscord<sOkam! 🫐> ah kk
10:44:20FromDiscord<sOkam! 🫐> the table,seq[string] thing worked, rika. ty
11:09:07FromDiscord<Phil> Welp, wrote an SO question on what you can do regarding the tsan issue
11:09:28FromDiscord<Phil> Let's see if I get slaughtered for that since that's my first question in a while that doesn't have the nim tag
11:23:07FromDiscord<odexine> Duplicate, closing
11:23:14FromDiscord<Phil> noooooooo
11:34:59FromDiscord<Phil> Oh hey, I was told to write a minimal example in C and start adding that tag instead
11:35:17FromDiscord<Phil> Not a complete slaughterfest!
11:44:04*azimut joined #nim
11:47:46FromDiscord<Phil> I kinda anticipated the C tag to have a lot more acitvity than it does
11:50:52FromDiscord<sOkam! 🫐> @Phil #c-lang in the Programmer's Hangout discord has a ton of activity. Big recommend for C specific questions
11:51:31FromDiscord<sOkam! 🫐> The guys helped me a ton when I had an issue with my C code compiled with zigcc
11:51:49FromDiscord<sOkam! 🫐> It was related to asan/ubsan that zigcc has by default
11:52:46FromDiscord<sOkam! 🫐> hmmm, is there anything that can exit an `if ...` block, but not the function?↵i thought `break` would do that, but apparently the compiler no likey
11:52:58FromDiscord<Phil> I'll likely go there after lunch
11:53:27FromDiscord<Phil> Man, it's kinda nuts how just somebody asking "I want to be able to run a chess-engine outside of my main-thread" leads down such a massive rabbit hole
11:53:45FromDiscord<sOkam! 🫐> also, big recommend that you try zigcc, for real. you are DIY what zigcc has by default
11:54:06FromDiscord<Phil> Not quite, what I'm actually doing is using balls
11:54:15FromDiscord<Phil> Which does asan, tsan and valgrind on -d:danger builds
11:54:41FromDiscord<Phil> It's just that balls is currently blowing up all my tsan checks and also asan on --mm:arc (because all our async libs in nim leak without orc)
11:54:49FromDiscord<Phil> (edit) "orc)" => "orc/a cycle collector)"
11:54:52FromDiscord<sOkam! 🫐> kk
11:55:41FromDiscord<Phil> Not gonna lie, even being able to comprehend these problems does make me feel smart though
11:55:55FromDiscord<Phil> (edit) "Not gonna lie, even being able to comprehend these problems does make me feel ... smart" added "like I'm"
11:55:58FromDiscord<sOkam! 🫐> C is really cool in that way. teaches you a ton
12:02:24*azimut quit (Remote host closed the connection)
12:02:53*azimut joined #nim
12:48:59*jmdaemon quit (Ping timeout: 252 seconds)
12:50:29FromDiscord<sOkam! 🫐> how would you handle passing multiple items to a single option using nim std/parseopts system? 🤔↵meaning `--hereGoes:[my, list, of, things]`
12:50:49FromDiscord<sOkam! 🫐> is some array/seq syntax supported?
13:04:05FromDiscord<Phil> In reply to @heysokam "how would you handle": Worst case scenario, pass a string
13:04:13FromDiscord<Phil> Can always go comma separated values
13:04:18FromDiscord<Phil> So that's a solid backup plan
13:47:29NimEventerNew Nimble package! jesterfork - Fork of jester with Nim v2.x support, see https://github.com/ThomasTJdev/jester_fork
13:52:30NimEventerNew Nimble package! httpbeastfork - Fork of httpbeast with Nim v2.x support, see https://github.com/ThomasTJdev/httpbeast_fork
14:25:19*rockcavera joined #nim
14:28:23*jjido joined #nim
14:40:58*junaid_ joined #nim
14:45:31FromDiscord<ebahi> sent a code paste, see https://play.nim-lang.org/#pasty=fnlTkpcYtyGR
14:45:52FromDiscord<ebahi> (edit) "https://play.nim-lang.org/#pasty=XGDyvVClPnNK" => "https://play.nim-lang.org/#pasty=JHKlMUHHTZct"
14:46:35FromDiscord<ebahi> idk if im explaining correctly sorry for the bad english
14:49:49advesperacitno, but you can create one proc login*(token: string) and one proc login*(email, password: string)
14:51:19FromDiscord<ebahi> is there no way of making a single proc be able to do both at the same time?
14:52:56advesperacitonly as login*(email, password, token: string), but I'd do two separate procs and if they share logic make them call a third proc that implements that logic
15:00:52*asvln joined #nim
15:25:47*asvln quit (Read error: Connection reset by peer)
15:27:50*asvln joined #nim
15:50:39FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=UsIsUnSuFTgS
15:51:11FromDiscord<sOkam! 🫐> That is also assuming that you pass the data directly, not the enum
15:51:54FromDiscord<sOkam! 🫐> the enum is not needed, you can just use union types and filter inside the proc with `when val is Type` blocks
15:52:30*asvln quit (Read error: Connection reset by peer)
15:54:19FromDiscord<sOkam! 🫐> as for the arguments, you can make them have a default value and ignore them for the case where you don't use them. could work if you don't have a ton of arguments
15:54:36*asvln joined #nim
15:54:49FromDiscord<sOkam! 🫐> proc overloads are probably a cleaner solution, as advesperacit mentioned, though
15:58:13*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
16:09:22*asvln quit (Read error: Connection reset by peer)
16:12:16*asvln joined #nim
16:12:46*azimut quit (Quit: ZNC - https://znc.in)
16:13:19*azimut joined #nim
16:17:04*azimut quit (Remote host closed the connection)
16:17:25*azimut joined #nim
16:19:41*asvln quit (Read error: Connection reset by peer)
16:21:58*asvln joined #nim
16:27:14*asvln quit (Read error: Connection reset by peer)
16:29:36*asvln joined #nim
16:36:00*asvln quit (Read error: Connection reset by peer)
16:37:38*junaid_ quit (Remote host closed the connection)
16:39:33*asvln joined #nim
16:44:46*asvln quit (Read error: Connection reset by peer)
17:01:03*junaid_ joined #nim
17:36:47*jjido joined #nim
17:41:53FromDiscord<user2m> In reply to @.__kenshin__. "bro next time just": hmmm maybe I'm a little dense, but I'm not sure how that helped? I read through the compiler switches was there supposed to be one there that I need to use?
17:48:13*krux02 joined #nim
17:54:37*rockcavera quit (Remote host closed the connection)
17:58:35*asvln joined #nim
18:03:27*asvln quit (Read error: Connection reset by peer)
18:05:53*asvln joined #nim
18:19:11FromDiscord<Robyn [She/Her]> In reply to @heysokam "<@1108388240769175594> `loginType: Token |": I'd say it's just better to have 2 separate procs unless there's only very slight differences in the process
18:19:24FromDiscord<Robyn [She/Her]> In reply to @heysokam "proc overloads are probably": Yeah
18:22:14FromDiscord<nnsee> In reply to @user2m "hmmm maybe I'm a": i don't know why they said that, rude and unhelpful
18:24:29*asvln left #nim (#nim)
18:28:15FromDiscord<Robyn [She/Her]> In reply to @nnsee "i don't know why": Vibes of condecension :P
18:29:26FromDiscord<user2m> In reply to @nnsee "i don't know why": a little bit, but I'll take help any way I can get it!
18:29:53FromDiscord<Phil> Looking back, your issue appears to have been
18:29:55FromDiscord<Phil> ...
18:30:07FromDiscord<Phil> Yeah I don't get it, it's not finding stuff in the cache files it generates itself?
18:30:40FromDiscord<Phil> Have you tried just having a nimbledeps folder and running nimble setup?
18:33:02FromDiscord<user2m> In reply to @isofruit "Have you tried just": not yet but it doesn't look like there's any dependencies that nimble would help with. It depends on the simdjson cpp / .h files but @saint._. included them
18:33:04FromDiscord<user2m> https://media.discordapp.net/attachments/371759389889003532/1198334394721632296/image.png?ex=65be86df&is=65ac11df&hm=fab964a3dfc468c47e8de083fbbd3b83bf077a3d976561eff81e4cb76882a2e5&
18:33:34FromDiscord<Phil> In reply to @user2m "not yet but it": Ohhhh now that makes more sense
18:34:40FromDiscord<Phil> I can't give too much help here since I don't know the direct solution, but this at least hints at the problem being that those compiled files are missing.↵↵More specifically:↵The cpp files are not being compiled into object files
18:34:52FromDiscord<Phil> Potentially because they're not being linked against properly or sth
18:36:19FromDiscord<Phil> As in, the core problem is not static lib files for simdjson
18:36:25FromDiscord<Phil> (edit) "not" => "no" | "nostatic lib files ... for" added "available"
18:36:43FromDiscord<user2m> yeah I'm just now taking a look at the compile.nim and it looks like it's not tested to compile for windows, but I tried WSL as well and that gave me a simlar err https://media.discordapp.net/attachments/371759389889003532/1198335312275984535/image.png?ex=65be87ba&is=65ac12ba&hm=fbea7aed6db4139430b24a31606b08b34057b58ff565be117d3efafa8be248ed&
18:38:21FromDiscord<Phil> In reply to @user2m "yeah I'm just now": Something you could try out would be:↵- Look up how to compile static libraries from cpp files and do so↵- Look up how to tell nim "hey, here is the .o file for linking"↵- Compile with a command that uses that flag pointing to the .o file you compiled
18:38:35FromDiscord<Phil> This is assuming Saint includes the source-code file
18:39:12FromDiscord<Phil> This is an article that contains how to do so for C:↵https://internet-of-tomohiro.netlify.app/nim/clibrary.en↵C++ should work very similar
18:39:19FromDiscord<Phil> But likely with g++ or sth
18:55:59*rockcavera joined #nim
19:16:19FromDiscord<user2m> In reply to @isofruit "Something you could try": thanks finally got it working! Like you said I just had to manually go in and compile the cpp / .h file . not sure why the compile script was failing
19:16:51FromDiscord<Phil> In reply to @user2m "thanks finally got it": Awesome that it helped!↵And hey, on the bright side you learned something really valuable in a nice easy fashion
19:17:13FromDiscord<Phil> Because compiling static libraries and using them is something that becomes very relevant the more you interact with C/C++ stuff
19:22:07FromDiscord<user2m> In reply to @isofruit "Awesome that it helped!": Thanks again! I've compiled a dll to use in a lib before, but I always get a bit confused when stepping into the c/ c++ world.
19:23:11FromDiscord<Phil> In reply to @user2m "Thanks again! I've compiled": Yeah I can relate.↵I swear 95% of the shit I learned in the last 6 weeks I would never have figured out if I hadn't had leorize's guidance and easier examples than the ones I had when I first encountered the stuff (valgrind, memory leak detection etc.)
21:13:19arkanoidwhich web frontend libraries do we have in nim? I only know karax and happyx, is there any other you know of?
21:19:07NimEventerNew thread by guzba: Show Nim: Curly, an efficient thread-ready parallel HTTP client, see https://forum.nim-lang.org/t/10893
21:20:39*redj quit (Ping timeout: 260 seconds)
21:20:54*junaid_ quit (Remote host closed the connection)
21:22:27FromDiscord<Phil> In reply to @arkanoid "which web frontend libraries": I assume you mean HTML frontend?
21:22:40FromDiscord<Phil> If so, any template engine - nimja and more
21:23:19FromDiscord<user2m> In reply to @arkanoid "which web frontend libraries": what exactly do you mean by frontend library? as in SPA library? or like a frontend ui lib?
21:33:49FromDiscord<tauruuuuuus> Hi everyone, what would be the preferred way to handle out of bounds checks in custom objects where I define `[]` operators for indexing purposes?
21:39:51FromDiscord<Elegantbeef> Raise a range defect inside of a `when compileOption("rangeChecks"):`
21:43:32arkanoidPhil, I mean interactive frontend. SPA, for example
21:44:10arkanoidtemplate/html/SSR engine doesn't do reactive/interactive
22:11:24NimEventerNew question by Nino van Hooff: lldb in vscode: how to show string values on hover?, see https://stackoverflow.com/questions/77852930/lldb-in-vscode-how-to-show-string-values-on-hover
22:16:10FromDiscord<tauruuuuuus> In reply to @Elegantbeef "Raise a range defect": Thanks, makes sense
22:16:26FromDiscord<piman_discriminator_1010> are nim objects reference or value types?
22:16:38FromDiscord<Elegantbeef> They're value types
22:16:51FromDiscord<Elegantbeef> but that does not mean they're passed as values always
22:17:10FromDiscord<Elegantbeef> Since Nim has immutable parameters the compiler passes by reference based off if it's faster
22:17:45FromDiscord<demotomohiro> When you add ref like '`ref object`', it become reference.
22:17:54FromDiscord<piman_discriminator_1010> if I want to make a ref to an object type, would it be..... lol thanks
22:18:27FromDiscord<Elegantbeef> Worth noting that in Nim `ref` is an always heap allocated block that is managed by the memory management
22:18:45FromDiscord<piman_discriminator_1010> oh, how do I get a reference to a stack object then?
22:18:48FromDiscord<Elegantbeef> So you cannot raise a value type to ref without copying
22:18:57FromDiscord<Elegantbeef> There is no safe way to do that in nim
22:19:06FromDiscord<Elegantbeef> You can use `addr` to get the ptr to it
22:19:08FromDiscord<Elegantbeef> But that's unsafe
22:19:10FromDiscord<piman_discriminator_1010> 🤔 interesting
22:19:30FromDiscord<piman_discriminator_1010> so you can't have a recursive object on stack without being unsafe
22:19:36FromDiscord<Elegantbeef> Well to safely capture stack values you need a borrow checker, which Nim has a very experimental one that explodes
22:20:04FromDiscord<Elegantbeef> I mean if you use DOD principles you can have a recursive data type using `int` instead of `ptr T`
22:20:12FromDiscord<Elegantbeef> then you just have an array of your nodes 😄
22:20:39FromDiscord<piman_discriminator_1010> I'm trying to make a tree structure
22:20:54FromDiscord<piman_discriminator_1010> sent a code paste, see https://play.nim-lang.org/#pasty=JUuNGOoyRzlL
22:21:05FromDiscord<piman_discriminator_1010> but if `ref` is heap, then that's not really what I want
22:21:16FromDiscord<Elegantbeef> I mean that is what you want cause you want a tree
22:21:38FromDiscord<Elegantbeef> A stack based tree is relatively limited although possible of course
22:21:48FromDiscord<Elegantbeef> just change those to `ptr` instead of `ref` and there you go
22:22:08FromDiscord<piman_discriminator_1010> hmm, or the other option is just make the root also a ref?
22:22:39FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=PNGsRGMbyscz
22:23:03FromDiscord<Elegantbeef> But you're using `seq` so why do you care that it's 'stack'
22:23:12FromDiscord<piman_discriminator_1010> oh, lol, I already have a list of all the objects, I could actually do that
22:23:31FromDiscord<piman_discriminator_1010> In reply to @Elegantbeef "But you're using `seq`": just because I instinctively put the root on stack
22:23:31FromDiscord<Elegantbeef> Data oriented design is lovely! 😄
22:23:55FromDiscord<piman_discriminator_1010> I'm actually building the tree from the object list
22:23:55FromDiscord<Elegantbeef> I mean who cares where it's at you can just do `new Type` `myVal[] = data` 😄
22:25:18FromDiscord<piman_discriminator_1010> oh wait, the list of the BACnetObject, not the ObjectTree objects
22:25:28FromDiscord<piman_discriminator_1010> I'll just use ref for the root then
22:26:09FromDiscord<piman_discriminator_1010> `var tree: ref ObjectTree` this defaults to `nil` right?
22:26:17FromDiscord<Elegantbeef> Yes
22:28:39FromDiscord<piman_discriminator_1010> errrrrr, how do I make a new ref object?
22:29:07FromDiscord<Elegantbeef> `RefType(field: ...)`
22:29:36FromDiscord<piman_discriminator_1010> `var newNode = new ObjectTree` seems to have worked
22:29:59FromDiscord<Elegantbeef> You also can do `(ref Type)(field: ...)`
22:35:01FromDiscord<tauruuuuuus> In reply to @Elegantbeef "Raise a range defect": So now the point is, can this be allocated non dynamically in some way? Meaning without newException?
22:35:31FromDiscord<Elegantbeef> Nim exceptions are heap allocated, in the case of a defect it does not matter since they're supposed to be fatal
22:38:09FromDiscord<Elegantbeef> You can pre allocate exceptions of course and just do `raise myException`
23:21:05FromDiscord<Robyn [She/Her]> Hm... Unique username system? Or a username + discriminator combo?
23:21:42FromDiscord<Robyn [She/Her]> So multiple ppl can have the same username, but must have a unique discriminator
23:23:18FromDiscord<Phil> In reply to @chronos.vitaqua "Hm... Unique username system?": Imo the latter
23:23:26FromDiscord<Phil> Unique usernames scale about not at all well
23:23:45FromDiscord<Robyn [She/Her]> In reply to @isofruit "Unique usernames scale about": Oh? Why? But fair
23:23:46FromDiscord<Elegantbeef> I mean they should be the same in the end 😄
23:24:19advesperacitdepends on the application and purpose of the username
23:24:27FromDiscord<Phil> In reply to @chronos.vitaqua "Oh? Why? But fair": Because the 50 marks you're going to have on your platform will have to have the weirdest fucking names if they all want to have Mark.↵I remember so many butchered spelling of names in WoW
23:24:51FromDiscord<Phil> (edit) "marks" => "Marks"
23:25:10FromDiscord<Robyn [She/Her]> Also another question: Is it better to stre my ULID types as UUIDs in databases that have native UUID types (like PostgreSQL) instead of bytes? Hm...
23:25:12FromDiscord<Phil> I'll admit that it can make sense for some applications, particularly if you don't expect to be the largest game in town or want to expeeriment, just not my preferred compo
23:25:20FromDiscord<Robyn [She/Her]> In reply to @advesperacit "depends on the application": Chat application, mostly real-time chat
23:25:21FromDiscord<Phil> to stre?
23:25:56FromDiscord<Robyn [She/Her]> In reply to @isofruit "I'll admit that it": Compo? :p
23:26:27FromDiscord<Phil> combo
23:26:29advesperacityea, a generated id and a user set display name seems like the best approach
23:28:53FromDiscord<Robyn [She/Her]> Fair, thanks y'all!
23:29:39FromDiscord<Robyn [She/Her]> In reply to @chronos.vitaqua "Also another question: Is": Though for this I'm not super sure, I think the benefit is that if I really wanted to, I could sort the db by UUID (since a ULID is based on time)
23:41:04FromDiscord<Robyn [She/Her]> Hey @Phil, does arc/orc leak with asyncdispatch? I think you mentioned that
23:41:24FromDiscord<Phil> In reply to @chronos.vitaqua "Hey <@180601887916163073>, does arc/orc": Only arc does, and every async environment leaks under arc currently
23:41:30FromDiscord<Phil> atleast address sanitizer says so
23:41:38FromDiscord<Phil> With ORC you're fine
23:41:56FromDiscord<Phil> Because ORC collects cycles and both chronos as well as std/asyncdispatch have cycles in the way they handle async
23:42:07FromDiscord<Robyn [She/Her]> Ah fun
23:43:46FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=FlQhEVcfqvpd
23:44:05FromDiscord<Phil> Ignore the `"` around all of them, I copy pasted them out of my task.json file
23:44:22FromDiscord<Robyn [She/Her]> Oh, thanks!
23:44:32FromDiscord<Robyn [She/Her]> Idk what these mean! :P
23:47:05FromDiscord<Phil> sent a long message, see https://pasty.ee/PzSPMrZCiHll
23:56:13FromDiscord<Robyn [She/Her]> We use Zig anyway so that has clang support
23:56:27FromDiscord<Robyn [She/Her]> Aren't there Nim allocator specific bugs?
23:58:31FromDiscord<Phil> There are, one of the other reasons why I've begun to shift more and more to malloc by default