<< 18-03-2023 >>

00:04:19FromDiscord<Yepoleb> I get paid in exposure, not money
00:04:38FromDiscord<Elegantbeef> No one ever pays when I expose to them
00:04:44FromDiscord<Elegantbeef> Oddly i get a fine
00:04:54FromDiscord<Yepoleb> Maybe we can arrange something
00:05:27FromDiscord<Yepoleb> Are you not unattractive?
00:05:42FromDiscord<Elegantbeef> Lol
00:11:10FromDiscord<morgan> is there a way to have an array in a variant object have a different length but same name for different kinds?
00:12:18FromDiscord<Elegantbeef> Nope
00:12:22FromDiscord<morgan> darn
00:12:38FromDiscord<morgan> might just make it a seq
00:12:44FromDiscord<morgan> and not have a fixed length
00:12:56FromDiscord<Elegantbeef> I'd suggest just having the array of the largest size then implement `[]` that checks the length
00:13:01FromDiscord<morgan> well, not have the length enforced by the compiler
00:13:07FromDiscord<Elegantbeef> The largest size is going to be allocated likely anyway
00:13:16FromDiscord<morgan> oh yea good point
00:13:24FromDiscord<Elegantbeef> I'm curious can you share the typedef?
00:13:51FromDiscord<morgan> sent a code paste, see https://paste.rs/E6L
00:14:08FromDiscord<Elegantbeef> Oh lord jeebus
00:14:25FromDiscord<morgan> yea the sheer number is why i don't wanna have another case of lol
00:14:34FromDiscord<morgan> i have a proc for the length already
00:14:52FromDiscord<morgan> so i can just use that for the length instead of using len anywhere
00:15:41FromDiscord<morgan> the naming is basically info is something that is fixed and connect is one or more connections, which would be a number that says what thing it's connected to
00:16:03FromDiscord<morgan> its for a genetic algorithm to make circuits i can't figure out
00:16:57FromDiscord<morgan> oh and the var ones are numbers that can be tweaked by the selection and mutation processes to refine what each does
00:17:02FromDiscord<Elegantbeef> I'd argue some of the branches do not make much sense 😄
00:17:40FromDiscord<morgan> i could remove the two spst switches
00:18:18FromDiscord<Elegantbeef> `res, cap, capp, inductor` are all the same branch
00:18:21FromDiscord<morgan> and maybe make power inputs a special case of signal inputs
00:18:30FromDiscord<Elegantbeef> Those could be merged together and you could write accessors or just access those names
00:18:49FromDiscord<morgan> so i think that will be necessary to have split apart for other stuff
00:18:57FromDiscord<morgan> i can always remove them later on
00:19:15FromDiscord<Elegantbeef> Yea i was just giving some insights to possibly make it less tall
00:19:43FromDiscord<Elegantbeef> It barely fits on my portrait monitor! 😛
00:20:08FromDiscord<morgan> same here
00:20:17FromDiscord<morgan> it doesn't fit in vscode
00:20:40FromDiscord<morgan> but removing all the separate connections variables will really cut the length down
00:32:31NimEventerNew Nimble package! noptics - Linear algebra, classical and quantum optics simulation package, see https://gitlab.com/OFThomas/noptics
00:34:36FromDiscord<Yepoleb> another one \:)
00:41:43FromDiscord<morgan> aaaa just spend like 10 minutes confused and eventually figured out a function i was calling to get the slice end (to index and array and add to a seq) had the wrong input
00:41:57FromDiscord<morgan> :pain:
00:48:51FromDiscord<Gumbercules> welcome to programming
00:49:46FromDiscord<Gumbercules> I once spent almost a month chasing down a bug that resulted from me multiplying by `1.0` instead of `-1.0`
00:50:16FromDiscord<Gumbercules> (edit) "a" => "an entire"
00:50:29FromDiscord<Gumbercules> I'm sure people dwarf me on that too
00:50:40*ltriant quit (Ping timeout: 268 seconds)
01:02:02*Zevv quit (Ping timeout: 252 seconds)
01:07:59NimEventerNew thread by alexeypetrushin: Do you miss these compact syntaxes?, see https://forum.nim-lang.org/t/10018
02:11:35FromDiscord<Elegantbeef> @Gumbercules\: https://github.com/beef331/constructor/blob/master/tests/tstructinits.nim#L21 ehhh
02:11:55*rockcavera quit (Read error: Connection reset by peer)
02:12:19FromDiscord<Gumbercules> Nice - can it handle multidimensional arrays?
02:13:08*rockcavera joined #nim
02:13:08*rockcavera quit (Changing host)
02:13:08*rockcavera joined #nim
02:16:13FromDiscord<ElegantBeef> God damn this bridge really likes to die
02:16:28FromDiscord<ElegantBeef> Nah it doesnt presently, need a to think about that
02:20:31FromDiscord<ElegantBeef> It does now
02:22:12FromDiscord<!&luke> what do i do with this code?
02:22:29FromDiscord<ElegantBeef> With what code?
02:22:40FromDiscord<!&luke> discord replies broke
02:23:06FromDiscord<!&luke> sent a code paste, see https://play.nim-lang.org/#ix=2MXN
02:23:14FromDiscord<ElegantBeef> Gumber you use C style declarations more than I have ever is there anything else they do over there?
02:24:07FromDiscord<Gumbercules> Mmmm probably. I'll keep my eyes peeled for any new ones I run into and compile a list for you
02:24:15FromDiscord<Gumbercules> newer C specifications introduced all sorts of fun init shortcuts
02:24:29FromDiscord<ElegantBeef> Sounds Fun
02:24:59FromDiscord<ElegantBeef> If it's not evident doing expressions stops positional from working
02:25:13FromDiscord<ElegantBeef> So like `MyArr.init(myArr[0] = 300, 1)` is invalid
02:25:28FromDiscord<Gumbercules> yeah I figured as much
02:25:52FromDiscord<Gumbercules> still better than nothing
02:25:58FromDiscord<Gumbercules> or the alternative
02:27:06FromDiscord<Iliketwertles> why can this work fine when called in a pipe but doesnt print file contents till after you hit enter?
02:27:24FromDiscord<Iliketwertles> https://media.discordapp.net/attachments/371759389889003532/1086475913438433421/message.txt
02:30:51FromDiscord<Iliketwertles> prob something silly im missing
02:31:01FromDiscord<Yardanico> what's the supposed usage of this?
02:31:19FromDiscord<Yardanico> like how do I call it to test the stdin, just with no arguments or some other way?
02:32:02FromDiscord<Iliketwertles> just like the `cat` command
02:32:09FromDiscord<Iliketwertles> so a file path after it as a arg
02:36:43*rockcavera quit (Remote host closed the connection)
02:38:54FromDiscord<Yardanico> well I think it's because you're trying to always read stdin
02:39:16FromDiscord<Yardanico> also the code is structured kinda weirdly, is there a reason you need to have CLI argument parsing inside of the loop itself?
02:39:30FromDiscord<Iliketwertles> not really
02:39:43FromDiscord<Iliketwertles> try taking out the while loop then?
02:39:47FromDiscord<Iliketwertles> thats kinda what i was thinking
02:39:56FromDiscord<Iliketwertles> that or how its reading stdin
02:40:29*rockcavera joined #nim
02:42:21FromDiscord<Yardanico> well how about this for a start
02:42:27FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Nr6
02:42:42FromDiscord<Yardanico> also it's easy to refactor away all the try/except, you can instead check if the file exists, it'll look nicer then
02:43:09FromDiscord<Elegantbeef> But but what about the race conditions! 😛
02:43:37FromDiscord<Yardanico> also judging your code you should check for paramCount == 3 for the color branch, not just 1
02:45:01FromDiscord<Iliketwertles> it broke codiums terminal 💀
02:45:21FromDiscord<Iliketwertles> fonts a little messed up https://media.discordapp.net/attachments/371759389889003532/1086480431895035934/screenshot_2023-03-17-224505.png
02:45:47FromDiscord<Elegantbeef> If it survives a `reset` get the flamethrower
02:45:55FromDiscord<Iliketwertles> also get a really crypted long output when i just put a string in like `test`
02:46:07FromDiscord<Iliketwertles> ill try to show
02:46:52FromDiscord<Iliketwertles> but its fine in a normal terminal
02:46:59FromDiscord<Iliketwertles> nvm then ig its codiums fault
02:47:54FromDiscord<Iliketwertles> In reply to @Yardanico "also it's easy to": i agree the structure of it before wasnt the best
02:47:57FromDiscord<Yardanico> i'm gonna move some code around in your case
03:01:27FromDiscord<Yardanico> how about something like this? I haven't tested it extensively, but still
03:01:48FromDiscord<Yardanico> @Iliketwertles https://play.nim-lang.org/#ix=2Ry7
03:03:16FromDiscord<Yardanico> ah right there's parseEnum instead of doing it with an option, smh
03:03:40FromDiscord<Yardanico> hm, but it will require changing some logic or outputting with the default color
03:04:20FromDiscord<Yardanico> also yeah my usage of fileExists is probably questionable because I don't know how it will behave with huge file sizes, ideally the code should be changed to not read everything like your original did
03:04:30FromDiscord<Yardanico> i mean if we pass a 100+line file to fileExists
03:05:41FromDiscord<Yardanico> and stdout.write instead of echo because echo will always add an extra newline, but we want to print the content we got as-is (excluding the added color)
03:15:44FromDiscord<Yardanico> also neofetch doesn't work with this because neofetch itself has ANSI colors
03:16:41FromDiscord<Iliketwertles> just put that in the help thing as an example lol
03:17:05FromDiscord<Yardanico> did it work with your code?
03:17:25FromDiscord<Yardanico> i mean it's not hard to make it work, we just have to strip all the original ansi colors
03:45:36*arkurious quit (Quit: Leaving)
03:56:02FromDiscord<Iliketwertles> In reply to @Yardanico "did it work with": i think
03:56:27FromDiscord<Iliketwertles> nvm it messes up with some characters lol
04:05:34*azimut quit (Remote host closed the connection)
04:07:31*azimut joined #nim
04:37:53*azimut_ joined #nim
04:41:44*azimut quit (Ping timeout: 255 seconds)
04:51:21FromDiscord<Yardanico> btw, nim still compiles just fine with gcc with -std=c89 (-ansi) , there are only 2 thins (both in nimbase.h) that need change to make it compile with that - remove C++ style comments from nimbase.h (they're C99) and remove inline keyword for GCC (not present in C89)
04:51:36FromDiscord<Yardanico> although I only tested compiling the compiler itself
05:07:43FromDiscord<Elegantbeef> Could one make an inline noop macro?
05:35:46NimEventerNew thread by guaracy: Any way to implement `=` in the follow exampĺe?, see https://forum.nim-lang.org/t/10019
06:03:24*rmt joined #nim
06:49:06*mahlon quit (Ping timeout: 255 seconds)
06:54:51*mahlon joined #nim
06:55:40FromDiscord<sOkam!> In reply to @ripluke "what do i do": you put it in your nimble file, and replace each line with your source files and binaries you need to output
06:56:05FromDiscord<!&luke> Yea I figured it out
06:56:09FromDiscord<!&luke> Thx a lot tho
06:56:15FromDiscord<sOkam!> ah nice 👌
07:23:17*Zevv joined #nim
07:33:04NimEventerNew Nimble package! climinesweeper - Play MineSweeper on CLI, see https://github.com/KerorinNorthFox/MineSweeper_on_CLI
08:04:32*junaid_ joined #nim
08:04:58*tiorock joined #nim
08:04:58*tiorock quit (Changing host)
08:04:58*tiorock joined #nim
08:04:58*rockcavera is now known as Guest8617
08:04:58*tiorock is now known as rockcavera
08:05:56*jmdaemon quit (Ping timeout: 250 seconds)
08:07:39*Guest8617 quit (Ping timeout: 248 seconds)
08:49:08FromDiscord<planetis> there are more terminal plotting libraries https://gitlab.com/OFThomas/nimtui
08:55:36*junaid_ quit (Remote host closed the connection)
08:57:51FromDiscord<planetis> In reply to @NimEventer "New Nimble package! noptics": this numerical package is amazing
09:14:26NimEventerNew thread by gowthamanb: Background tasks in jester, see https://forum.nim-lang.org/t/10020
09:29:56FromDiscord<sOkam!> Is there a way to access `arg0` from Nim code?↵_(i know about parseopts, but this is for gcnone)_
09:30:34FromDiscord<sOkam!> (edit) "Is there a way to access ... `arg0`" added "C's"
09:30:57FromDiscord<sOkam!> (edit) "C's" => "the C main()"
09:38:22FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/os.nim#L2956-L2965
10:03:46FromDiscord<sOkam!> are those two a thing in C? never heard about thiem
10:07:48FromDiscord<sOkam!> wait, are those from C or from Nim's compiled code generation?
10:18:02*genpaku quit (Read error: Connection reset by peer)
10:18:51*genpaku joined #nim
10:25:01*rockcavera quit (Remote host closed the connection)
10:31:25FromDiscord<Yardanico> In reply to @sOkam! "wait, are those from": this, but they are literally mapped to argc/argv
10:31:41FromDiscord<Yardanico> <https://github.com/nim-lang/Nim/blob/devel/compiler/cgen.nim#L1480>
10:36:08FromDiscord<firasuke> how do you create multiple progress bars each updating on its own output line?
10:47:22FromDiscord<sOkam!> wait, posixCmain... is this not the same in windows?
10:47:51FromDiscord<sOkam!> (edit) removed "wait," | "not the same" => "name different"
10:48:11FromDiscord<sOkam!> (edit) "windows?" => "windows, @Yardanico?"
10:55:10*PMunch joined #nim
11:09:33*ltriant joined #nim
11:29:48FromDiscord<firasuke> what does `onProgressChanged` do?
11:35:21PMunchWild guess is register a callback to be fired on progress change
11:41:39*junaid_ joined #nim
11:56:57PMunchHmm, for my template thing I'm thinking of maybe creating a template engine generator
11:57:36*junaid_ quit (Remote host closed the connection)
11:58:17PMunchBasically a small framework for setting a start sequence, a stop sequence, an escape sequence, and a callback. The callback would then receive a called for each found template replacement part
12:06:20*rmt quit (Ping timeout: 246 seconds)
12:40:44FromDiscord<firasuke> In reply to @PMunch "Wild guess is register": oh ok thanks
12:41:07FromDiscord<firasuke> what's the default method for getting the basename from a path or a url? something like nix's `basename`?
12:42:48FromDiscord<firasuke> lastPathPart seems to be working fine, but if the var is a uri, should I use it?
12:45:50FromDiscord<Nerve> Has anyone done a comparison between disassemblies of Nim and of handwritten C?
12:55:35FromDiscord<federico3> what would you expect to see?
13:09:04FromDiscord<firasuke> what should you use asyncdispatch or chronos?
13:14:27*luis_ joined #nim
13:35:35FromDiscord<auxym> In reply to @firasuke "what's the default method": look at stuff in std/os, like splitPath etc
13:37:12FromDiscord<firasuke> In reply to @auxym "look at stuff in": ok thanks
13:42:04*sagax quit (Quit: Konversation terminated!)
13:42:33FromDiscord<auxym> for URIs we also have https://nim-lang.org/docs/uri.html
13:42:37FromDiscord<auxym> @firasuke
13:43:17FromDiscord<firasuke> I see, but what if I have a string that contains a uri, should I use splitPath from os, or parseUri then get the filename from the end using uri?
13:43:18FromDiscord<auxym> In reply to @firasuke "what should you use": no personal experience, but probably chronos. the stdlib async doesn't have great reputation
13:44:28FromDiscord<auxym> In reply to @firasuke "I see, but what": you have a URI that contains a filepath? I'd probably start with using the URI module to extract the path
13:45:13FromDiscord<firasuke> In reply to @auxym "you have a URI": alright, thanks for all the anwers
13:45:15FromDiscord<firasuke> much appreciated
13:47:24FromDiscord<auxym> note that std/os is dependent on the platform OS. eg. if your program is running on linux is you're trying to parse a Windows path it might do weird stuff
13:47:45PMunch@firasuke, probably use the URI module to get the path, then use lastPathPart on that: https://nim-lang.org/docs/uri.html
13:47:50FromDiscord<firasuke> In reply to @auxym "you have a URI": I have `someurl = "https://someurl.something/path/to/fileVersion.gz` I want to extract `fileVersion.gz`
13:48:16FromDiscord<firasuke> In reply to @PMunch "<@248208053952970752>, probably use the": epic I just found out about that, apparently I can use it on the string itself without parsing it as a uri
13:48:57PMunchYou might be able to for a trivial string, but I wouldn't trust it unless you're absolutely sure it will work for any UR
13:48:58PMunchURI*
13:49:09FromDiscord<auxym> In reply to @firasuke "I have `someurl =": that's just a URI. you don't need to use std/os
13:49:11FromDiscord<firasuke> oh I see
13:50:44FromDiscord<firasuke> I have a bunch of async download functions that rely on `onProgressChanged` to `eraseLine` and output progress and stuff, however they are overwriting each others output, and I couldn't find a nice way to make each function's output on a separate line, while updating concurrently
13:51:05FromDiscord<firasuke> I realize I have to mess with cursor position, but it's getting tricky
13:51:07FromDiscord<auxym> I thought you meant something like `https://someurl.something/?path=c:\users\to\fileVersion.gz`
13:51:15FromDiscord<firasuke> In reply to @auxym "I thought you meant": oh sorry no
13:51:32FromDiscord<auxym> that would be "a URI containing a full file path"
13:55:06FromDiscord<firasuke> In reply to @firasuke "I have a bunch": I tried using some libraries like `progress` and `suru` but wasn't successful
13:55:14FromDiscord<firasuke> should I resort to threads?
13:55:30FromDiscord<firasuke> also are nim applications multithreaded by default?
13:57:40*nanxiao joined #nim
14:01:32FromDiscord<firasuke> `testament --print` isn't showing output when running single tests?
14:13:50FromDiscord<auxym> In reply to @firasuke "also are nim applications": depdends what you mean by multithreaded. nim devel / 2.0 has `--threads:on` by default, but it won't create threads and dispatch work for you
14:14:42FromDiscord<Ayy Lmao> How do I go about debugging a dll hosted in another program? I have been trying to use a c debugger but with no success so far. Right now when something bad happens the dll just silently crashes the program it is hosted in. I would at least like to be able to see the error messages.
14:16:43FromDiscord<firasuke> In reply to @auxym "depdends what you mean": I mean that if I run my nim application, I expect it to use all threads by default, not just one thread/logical cpu
14:17:48FromDiscord<auxym> yeah that's not happening. In fact I'm not sure I know any language that does that, except labview
14:22:56FromDiscord<firasuke> In reply to @auxym "yeah that's not happening.": oh ok
14:48:47*nanxiao quit (Quit: Client closed)
14:50:03FromDiscord<firasuke> where can I read more about the `--define` pragmas at compile time? also what's the difference between `--gc` and `--mm`?
14:56:00FromDiscord<Gumbercules> There is no difference to my knowledge
14:56:16FromDiscord<Gumbercules> mm is definitely newer but tmk just an alias
14:56:51FromDiscord<Gumbercules> The define pragmas allow to you to check for them in code with when defined(yourDefHere)
14:57:02FromDiscord<Gumbercules> Similar to C preprocessor defines
14:57:23FromDiscord<Gumbercules> Nim defines however are only available to Nim and not to C/C++
14:57:59FromDiscord<Gumbercules> If you want to pass a define to the C preprocessor you'd do so with passC or compile a C source file that includes the define
14:58:44FromDiscord<Gumbercules> In reply to @firasuke "where can I read": Hope that helps - as usual the manual and tutorial are the best places to read more about any Nim feature. I know it can be painful to find what you're looking for at times though.
14:58:50FromDiscord<firasuke> I see, where can I find a list of available define switches?
14:59:24FromDiscord<Gumbercules> You can put whatever you want there
14:59:36FromDiscord<Gumbercules> There are no built-ins
14:59:55FromDiscord<Gumbercules> There are defines from the compiler and stdlib and user libri
15:00:00FromDiscord<Gumbercules> (edit) "libri" => "libraries"
15:00:12FromDiscord<Gumbercules> But it's not like you have to pick a define from a list
15:00:26FromDiscord<firasuke> what?
15:00:34FromDiscord<firasuke> what if I put a define that doesn't exist?
15:00:43FromDiscord<Gumbercules> I could define flippity floppity and the compiler would be fine
15:01:01FromDiscord<Gumbercules> Now it exists and I can check in code if it's defined
15:01:17FromDiscord<Gumbercules> With - when defined (flippityfloppity)
15:01:32FromDiscord<Gumbercules> Or if defined - when is a compile time check
15:02:00FromDiscord<Gumbercules> The same way C preprocessor defines work
15:02:37FromDiscord<Gumbercules> In reply to @Ayy Lmao "How do I go": Same answer I gave you yesterday unfortunately
15:02:54FromDiscord<Gumbercules> There's no magic way to get a DLL to behave different
15:03:06FromDiscord<firasuke> In reply to @Gumbercules "With - when defined": oh ok got it
15:03:07FromDiscord<firasuke> thanks
15:03:18FromDiscord<Gumbercules> You could try to write some hooks for segfaults
15:03:58FromDiscord<Gumbercules> But you're not going to stumble across some option that will make the DLL start to report errors in a more verbose way
15:05:04FromDiscord<Gumbercules> What trouble are you running into regarding the debugger route? Honestly, learning how to use a debugger is going to level you up and will allow you to debug issues much more efficiently.
15:05:37FromDiscord<Gumbercules> In reply to @firasuke "thanks": Np! Glad I could help
15:05:39FromDiscord<Rika> In reply to @firasuke "what if I put": Nothing happens
15:06:59FromDiscord<Gumbercules> Probably the only other thing I can think of would be to run the app with asan / valgrind
15:07:36FromDiscord<Gumbercules> Often these types of analyzers will also report memory access issues
15:07:38FromDiscord<auxym> In reply to @firasuke "I see, where can": https://nim-lang.org/0.20.0/nimc.html#additional-compilation-switches
15:08:25FromDiscord<Gumbercules> So if your program is crashing due to doing something bad in relation to memory, which is most likely the case, you might be able to find the issue that way
15:08:44FromDiscord<Gumbercules> But this is probably just as much work as using a debugger
15:08:55FromDiscord<Gumbercules> And isn't exclusive to using a debugger either
15:09:13FromDiscord<Gumbercules> If you're on Windows, debugging Nim programs is stupid easy as is memory analysis
15:09:23FromDiscord<firasuke> In reply to @auxym "https://nim-lang.org/0.20.0/nimc.html#additional-co": I found this:↵- https://nim-lang.org/docs/nimc.html↵- `nim --fullhelp`
15:11:23FromDiscord<firasuke> will `mimalloc` be available in future nim versions?
15:11:41FromDiscord<Gumbercules> I mean you can already use it
15:11:51FromDiscord<Gumbercules> It just requires some configuration
15:12:13FromDiscord<Gumbercules> But Araq just wrote a new general purpose allocator
15:12:38FromDiscord<Gumbercules> Last time I tried to use it, it crashed on Windows but I'm guessing that's fixed by now
15:14:04FromDiscord<Gumbercules> There's a thread on the forums about it. I'm on my phone atm otherwise I'd link you to it
15:16:44FromDiscord<Ayy Lmao> In reply to @Gumbercules "Same answer I gave": I actually miraculously got it working just now. The nim VSCode extension had some instructions on how to set it up that I was able to adapt. I am still not sure how to get stack traces but I can at least see where the code is failing now I think.
15:17:14FromDiscord<Gumbercules> What debugger are you using?
15:17:25FromDiscord<Gumbercules> I think for GDB it's bt
15:17:38FromDiscord<Ayy Lmao> LLDB, I wasn't able to get GDB to work
15:17:45FromDiscord<Gumbercules> To get a backtrace when paused
15:18:45FromDiscord<Gumbercules> It should be bt for LLDB too
15:18:48FromDiscord<Ayy Lmao> It is showing me where it crashed and when I click on certain areas it seems to be going to specific lines in code
15:18:58FromDiscord<Ayy Lmao> I am just not familiar with the interface
15:19:25FromDiscord<firasuke> In reply to @Gumbercules "But Araq just wrote": oh great, how do you use it?
15:19:29FromDiscord<Gumbercules> Gotcha, yeah I'm not either. I haven't used VS Code with LLDB or GDB before
15:19:42FromDiscord<firasuke> I saw somewhere that it was inspired from mimalloc
15:19:45FromDiscord<Gumbercules> In reply to @firasuke "oh great, how do": You probably already are
15:19:57FromDiscord<firasuke> https://nim-lang.org/blog/2022/11/11/a-cost-model-for-nim.html
15:19:58FromDiscord<Gumbercules> Especially if you're compiling with thread support
15:20:11FromDiscord<firasuke> oh cool, so no need to use mimalloc
15:20:23FromDiscord<Gumbercules> The old Nim allocator was not threadsafe
15:20:40FromDiscord<Gumbercules> If you're using a newer version of Nim, nope not needed
15:20:57FromDiscord<Gumbercules> Assuming that Windows bug is fixed / you don't care about Windows
15:21:30FromDiscord<firasuke> In reply to @Gumbercules "Assuming that Windows bug": exactly
15:21:54FromDiscord<firasuke> In reply to @Gumbercules "If you're using a": I am on 1.6.10
15:22:10FromDiscord<Gumbercules> Sounds pretty new
15:22:51FromDiscord<Gumbercules> It should be easy to find out if you're on Windows. Just make a heap allocation and if your program doesn't crash with threads on you're probably fine.
15:22:55FromDiscord<firasuke> is there a speculated release date for nim 2.0?
15:23:06FromDiscord<Gumbercules> When it's ready I imagine
15:23:53FromDiscord<firasuke> awesome, thanks for taking the time to answer my many questions
15:23:56FromDiscord<firasuke> much appreciated
15:25:35FromDiscord<Gumbercules> No problemo
15:26:24FromDiscord<auxym> In reply to @firasuke "is there a speculated": araq has stated on the forum that there are two remaining "showstopper" bugs in ORC, once those are fixed then 2.0 will be released
15:26:40FromDiscord<Gumbercules> We had to wait years for 1.0 and it was always just around the corner. Scope creep is a bitch, and I think 2.0 will arrive sooner than later but you never know....
15:26:56FromDiscord<firasuke> understandable
15:26:58FromDiscord<Gumbercules> Someone could get hit by a bus
15:27:09FromDiscord<firasuke> hopefully not lol
15:27:10FromDiscord<Gumbercules> And Nim definitely has some bus factor going for it
15:27:17FromDiscord<Gumbercules> Well yeah...
15:27:22FromDiscord<auxym> possibly just one remaining atm: https://github.com/nim-lang/Nim/labels/Showstopper
15:32:25FromDiscord<sOkam!> that list had like 7 just a couple of days ago 👀 👀
15:33:23FromDiscord<firasuke> In reply to @auxym "possibly just one remaining": isn't this bug in ARC the older/previous mm model?
15:35:28FromDiscord<Yardanico> In reply to @firasuke "isn't this bug in": ARC is the new model
15:35:29FromDiscord<Yardanico> the old is refc
15:35:41FromDiscord<Yardanico> both ARC and ORC are new, ARC is the base and ORC is based on ARC and adds cycle collection
15:38:36FromDiscord<firasuke> Ahhh I see
15:40:49FromDiscord<Nilts> @ElegantBeef I solved the issue from yesterday, apparently, i was calling it, i forgot to remove the calls from the old structure
15:41:37*arkurious joined #nim
15:50:40FromDiscord<Nilts> But now I am getting this (different error):↵Error: attempting to call routine: 'resp`gensym14'
16:00:59FromDiscord<demotomohiro> @Nilts If you are usig `gensym`, it might being called with wrong kind: https://nim-lang.org/docs/macros.html#genSym%2CNimSymKind%2Cstring
16:01:54FromDiscord<Nilts> In reply to @demotomohiro "<@910899642236043294> If you are": I am not using gensym, i am using templates
16:36:28*luis_ quit (Quit: Leaving)
16:39:06FromDiscord<auxym> odd, IIRC templates don't gensym proc names by default
16:49:02*PMunch quit (Quit: leaving)
17:21:02FromDiscord<Nilts> In reply to @auxym "odd, IIRC templates don't": it is a template name, not a proc name
17:32:14*jmdaemon joined #nim
17:46:51*junaid_ joined #nim
17:55:08FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4raj
17:58:29FromDiscord<sOkam!> hmm, just realized that the loop is just adding at the end, without inserting. totally wrong
17:59:00FromDiscord<Rika> `static array[...]`?
17:59:31FromDiscord<Rika> its not the same meaning as in C
18:01:15FromDiscord<sOkam!> don't know how to achieve the same, tbh
18:03:58FromDiscord<sOkam!> i guess i could compile it from some c file and import it, to avoid translating. feels like a hack, but might be simpler
18:05:03Amun-RaC static in function? no equivalent, the closes is the method system/once uses, var foo {.global.}: …
18:05:21Amun-Rahttps://github.com/nim-lang/Nim/blob/version-1-6/lib/system.nim#L3021-L3036
18:05:29FromDiscord<Rika> maybe?
18:05:31FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4ram
18:05:50FromDiscord<Rika> In reply to @Amun-Ra "C static in function?": or just use real globals or w/e
18:05:58Amun-Rasure
18:08:53FromDiscord<sOkam!> In reply to @Amun-Ra "C static in function?": why exacly "closest" but not equivalent?
18:09:25Amun-RaI was referring to static array inside the function
18:09:54FromDiscord<sOkam!> yeah, what i meant is why is that global pragma closest but not equivalent to C static
18:10:10FromDiscord<sOkam!> to me they look the exact same
18:10:28Amun-Rait has global scope in Nim
18:10:43FromDiscord<sOkam!> oh i see
18:11:00Amun-Raor 'file scope' in C terms
18:11:26FromDiscord<sOkam!> global has file scope or global scope?
18:11:33FromDiscord<sOkam!> that confused me
18:11:42Amun-RaI mean in C these are the same
18:12:28FromDiscord<sOkam!> so global is actually global, like c file, but in nim file refers to the file itself only. is that correct?
18:12:42FromDiscord<sOkam!> mixing the terminology confused me a lot there
18:13:11Amun-Rasorry, I shouldn't have used new term meaning the same as the other one
18:13:46FromDiscord<sOkam!> kk, makes sense then
18:13:50FromDiscord<sOkam!> tyty
18:13:57Amun-Rain C there are four kinds of scopes: block scope, file scope, function scope and function prototype scope
18:14:05Amun-Raglobal is file one
18:14:55Amun-Rayou can't have an object with static storage duration in file scope in nim
18:15:19Amun-Ra(apart from const ofc) ;>
18:17:28FromDiscord<jmgomez> any clean way to capture a global in a `cdecl`?
18:20:21Amun-Rasomething like?: var foo {.importc, dynlib: ….}: ptr cint
18:21:46FromDiscord<jmgomez> dont follow, I also ment a non global
18:21:56FromDiscord<jmgomez> globals can be captured, but otherwise will just use a global
18:21:59Amun-Raah, I think I didn't get the question
18:27:56FromDiscord<sOkam!> If I add a local header file to a subfolder relative to the current `.nim` file where I'm calling for a `{.compile: ....}` pragma, where should that header file go so that the compiler knows how to read it?
18:30:14FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4rao
18:30:44FromDiscord<jmgomez> probably you need to add an abs path
18:31:06FromDiscord<sOkam!> oh, true with an `-I`
18:31:37FromDiscord<sOkam!> is there a pragma to do `--passC:...` from a file, instead of from the nim.cfg?
18:31:51FromDiscord<jmgomez> so the header has to be included but the c file I think it also needs a full path on the compile pragma
18:32:14FromDiscord<jmgomez> you could read it and pass it as argument to nim
18:32:56FromDiscord<sOkam!> last time i was using the compile pragma it wasn't needing a full path
18:34:38FromDiscord<sOkam!> wait, or maybe it did
18:38:53Amun-Ras0kam: {.passc: "…".}
18:39:44FromDiscord<sOkam!> ty ✍️
18:39:49Amun-Rayw
18:40:03Amun-Rabtw, "ty" in polish means "you" ;)
18:41:22FromDiscord<sOkam!> lol didn't know
18:45:04FromDiscord<jmgomez> I always forgot, does it handle relatives then?
18:46:20FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4ras
18:51:26FromDiscord<Hourglass [She/Her]> I want to continue working on the server but the shared library dependency system doesn't work and that's a bit annoying hm
18:53:06Amun-Rado you have that audio plugin system in mind?
18:55:58FromDiscord<Hourglass [She/Her]> Audio plugin system?
18:56:24Amun-Rathan no, in that case ;>
18:58:17FromDiscord<Hourglass [She/Her]> What is that lol
18:58:49Amun-RaI mean that must have been someone else
18:59:00FromDiscord<Hourglass [She/Her]> Ah yeah then probably
18:59:18FromDiscord<Hourglass [She/Her]> Mine is at https://github.com/Yu-Vitaqua-fer-Chronos/NimPluginSystem
18:59:25FromDiscord<Hourglass [She/Her]> I should probably polish it and make it into a library
19:02:53FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4rau
19:03:55FromDiscord<jmgomez> In reply to @Hourglass, When the Hour Strikes "I want to continue": what doesnt work? I have a plugin dll system for NUE
19:06:55FromDiscord<sOkam!> In reply to @jmgomez "yeah, but you are": yes yes, i was totally misremembering. i was indeed using a full path before, like you mentioned
19:08:06FromDiscord<sOkam!> i checked the other code I had from before, and it was indeed using absolute paths. so i just reused that and it worked
19:22:06FromDiscord<Hourglass [She/Her]> Wait I can't uninstall my older Nimberite install
19:22:10FromDiscord<Hourglass [She/Her]> That is so odd what
19:31:08*junaid_ quit (Remote host closed the connection)
19:31:10FromDiscord<Hourglass [She/Her]> My project doesn't have that `requires` statement but Nimble still says that my project is depending on it
19:32:42FromDiscord<Hourglass [She/Her]> In reply to @jmgomez "what doesnt work? I": My issue was that a certain plugin field for the server (object) wasn't being set, but i can't fix it like this
19:35:17FromDiscord<Hourglass [She/Her]> Just used `rm` to clear that
19:41:40*pbsds6 joined #nim
19:41:52*pbsds quit (Ping timeout: 250 seconds)
19:41:52*pbsds6 is now known as pbsds
19:42:26FromDiscord<sramsay (Steve)> All the init procs for tables say, "Starting from Nim v0.20, tables are initialized by default and it is not necessary to call this function explicitly." So how does one create a new, empty table? Say, a new, empty OrderedTable?
19:42:58*derpydoo quit (Ping timeout: 276 seconds)
19:46:07FromDiscord<Hourglass [She/Her]> `var myOTbl: OrderedTable[string, string]`
19:46:24FromDiscord<Hourglass [She/Her]> Just using the type on an uninitialised variable
19:50:34FromDiscord<Hourglass [She/Her]> I can't be bothered to deal with my project now because Nimble keeps ignoring `nimble install` when compiling another project using that local library as a dependency
19:54:21FromDiscord<Hourglass [She/Her]> I have discovered `nimble develop`
19:55:02FromDiscord<Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4raL
19:55:11FromDiscord<Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4raM
19:55:19FromDiscord<Nilts> pls help, and ping on reply
19:56:51FromDiscord<Hourglass [She/Her]> Well Nimble develop is broken?
19:57:03FromDiscord<Hourglass [She/Her]> `Error: cannot open file: nimberitepkg/api/pluginmanager` even though `nimble install` makes this work just fine
20:00:21FromDiscord<sramsay (Steve)> In reply to @Hourglass, When the Hour Strikes "Just using the type": Thank you!
20:00:45FromDiscord<Hourglass [She/Her]> Np!
20:43:18FromDiscord<Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=4rcN
20:44:08FromDiscord<Ayy Lmao> Not sure what to make of it, I mean it looks like it is accessing nil or something but I don't know how to find the cause of it.
20:48:10FromDiscord<hykq19> there seems to be a situation when framePtr.prev is nil but you try to access it anyway
20:50:07FromDiscord<Ayy Lmao> The thing is framePtr and this function is inside a nim compiler file, it's not something that I am interacting with in my code.
20:52:50FromDiscord<hykq19> segfaults are never very informative on their own, try using a debugger to see where exactly it is happening
20:53:39FromDiscord<Ayy Lmao> I am using LLDB in VSCode and that is what it is telling me. I am not sure how I can get it to be more informative about the error.
20:55:10FromDiscord<hykq19> LLDB is telling you that the error occurs when accessing framePtr.prev?
20:55:38FromDiscord<Ayy Lmao> Yeah it puts a yellow arrow there and that's where the execution stops.
20:56:24FromDiscord<hykq19> and in which file exactly is that code
20:56:53FromDiscord<Ayy Lmao> `excpt.nim`
20:58:45FromDiscord<hykq19> have you tried printing a stack trace to see what part of your code is accessing anything in excpt.nim
20:58:58FromDiscord<Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=4rcP
20:59:36FromDiscord<Ayy Lmao> In reply to @hykq19 "have you tried printing": That's what I am trying to figure out how to do. I don't know how to do that.
21:00:37FromDiscord<michaelb.eth> when `importc`'ing a function from a C lib, if it's known to not have side-effects, is it appropriate to declare it in Nim with `func` instead of `proc`?
21:00:37FromDiscord<hykq19> try 'thread backtrace'
21:02:18FromDiscord<Ayy Lmao> sent a code paste, see https://paste.rs/z2b
21:02:38FromDiscord<Ayy Lmao> I am trying to get it to crash again so I can try that after it crashes
21:05:19FromDiscord<Elegantbeef> Yep↵(@michaelb.eth)
21:05:32FromDiscord<michaelb.eth> thanks
21:08:37FromDiscord<Ayy Lmao> In reply to @hykq19 "try 'thread backtrace'": That seems to give me some information. It is hard to tell what's going on still but I think I know the function that is causing it at least.
21:09:48FromDiscord<michaelb.eth> in what contexts is it appropriate/important to specify `noconv` instead of `cdecl` for a proc?
21:11:52FromDiscord<michaelb.eth> e.g. I'm writing a type def for a proc that will be a callback invoked by a C lib, is it better to use `noconv`?
21:12:00FromDiscord<michaelb.eth> (edit) "e.g. ... I'm" added "if"
21:12:17NimEventerNew post on r/nim by boozzeeboom: Nim and leetcode, see https://reddit.com/r/nim/comments/11v0yc5/nim_and_leetcode/
21:30:45FromDiscord<I have 50GB of nothing on my PC> how do you tell karax to chill out about a dom node managed by external code?
21:34:40FromDiscord<I have 50GB of nothing on my PC> setForeignNodeId
21:34:42FromDiscord<I have 50GB of nothing on my PC> thanks
21:40:39FromDiscord<I have 50GB of nothing on my PC> but how do you create js arrays from nim?
21:49:59*azimut_ quit (Ping timeout: 255 seconds)
22:10:25*terza joined #nim
22:13:32*ltriant quit (Ping timeout: 250 seconds)
22:13:38*terza left #nim (#nim)
23:05:35*beholders_eye joined #nim
23:14:53FromDiscord<michaelb.eth> I'm curious about this approach: https://github.com/nim-lang/Nim/issues/4441#issuecomment-230856546
23:16:15FromDiscord<michaelb.eth> I realize that's from quite some time ago, but I was interested to see if it works, so was trying it with e.g. LC_COLLATE which in C++ is in the `<clocale>` header as opposed to `<locale.h>`
23:17:42FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4rdq
23:17:58arkanoidthis is the most confusing aspect of Nim asynchronous programming, in my opinion https://play.nim-lang.org/#ix=4rdo
23:18:19FromDiscord<michaelb.eth> there's probably something I don't understand about how to use that technique, or it no longer works with the C backend, or...
23:18:42arkanoidin almost all other programming languages futures are not executed until awaited, but Nim puts futures on the event loop no matter what
23:19:23FromDiscord<michaelb.eth> at least in JS, the same thing would happen if you invoke but don't await an async function
23:20:30arkanoidafaik, it does not happen in Rust, C#, Python
23:21:02FromDiscord<michaelb.eth> fwiw, same is true if you use nim-chronos instead of std/asyncdispatch
23:21:08FromDiscord<michaelb.eth> I mean behavior is the same
23:22:01arkanoidhere the Rust docs for async https://doc.rust-lang.org/std/keyword.async.html "Use async in front of fn, closure, or a block to turn the marked code into a Future. As such the code will not be run immediately, but will only be evaluated when the returned future is .awaited."
23:22:28FromDiscord<michaelb.eth> yeah, that's definitely a different design
23:23:11FromDiscord<michaelb.eth> the way to think about it is that when you invoke an async proc, it begins running right away until it hits the first await inside it
23:23:30FromDiscord<michaelb.eth> at that point it returns control to the code that invoked it
23:24:02arkanoidthis is very error prone, in my opinion
23:25:58FromDiscord<michaelb.eth> I can't really defend it vs. Rust, etc., but the way asyncdispatch/chronos does it is very familiar if you've done web/js programming, so I guess it's about trade-offs and having the right mental model for what it does
23:27:45FromDiscord<michaelb.eth> in chronos, there's `asyncSpawn` for when you don't intend to do anything with the returned Future
23:27:46FromDiscord<michaelb.eth> https://github.com/status-im/nim-chronos/blob/master/chronos/asyncfutures2.nim#L551
23:32:41arkanoidhere another example with Python https://play.nim-lang.org/#ix=4rdr
23:33:27arkanoidconsidering that "Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula." I'd like to do same test on Ada and Modula
23:33:40arkanoidbut I don't know how to write those languages
23:37:30FromDiscord<alcatraz> anyone have good resources to learn nim
23:39:52arkanoidalcatraz, it depends on type of learner you are. If you like small incremental task, I suggest you exercism.io. If you like books, there are 3, one is online and free, one is paper or ebook, one is paper only
23:49:04arkanoidmicharld.eth, I've asked in #ada, I'm quite curios
23:51:12FromDiscord<Elegantbeef> Arkanoid you know Nim that's like knowing Ada
23:51:52arkanoidElegantbeef, really?
23:53:59FromDiscord<Elegantbeef> Ada and Nim share a lot
23:55:25arkanoidElegantbeef, maybe, but I find quite hard to answer my question reading the manual section http://www.ada-auth.org/standards/12rm/html/RM-D-11.html
23:57:14FromDiscord<Elegantbeef> I was somewhat joking, didnt see this was concerning asnyc
23:58:21arkanoidI didn't get the /s
23:58:50FromDiscord<Elegantbeef> I was also somewhat sincere
23:58:54FromDiscord<Elegantbeef> Ada is very similar to Nim