<< 20-06-2022 >>

00:18:18FromDiscord<treeform> its cool, people talk about it, rather then boring names
00:41:32NimEventerNew thread by Elcritch: Repurposing CDecl, now it's the 'Commonly Desired Edge Case Library', see https://forum.nim-lang.org/t/9249
00:49:33NimEventerNew thread by Morturo: Read and write from/to seq[byte], see https://forum.nim-lang.org/t/9250
01:02:26*ehmry quit (Ping timeout: 246 seconds)
01:07:03*ehmry joined #nim
01:15:16FromDiscord<Elegantbeef> I assume morturo doesnt use realtime chats?
01:20:58FromDiscord<Elegantbeef> Hmm can anyone email them to tell them to stop deleting their posts? πŸ˜„
01:43:27FromDiscord<treeform> why do they delete post?
01:43:49FromDiscord<Elegantbeef> I assume cause they got their answer
01:45:13FromDiscord<treeform> hmm
01:51:20*mahlon quit (Ping timeout: 248 seconds)
01:52:19*wallabra_ joined #nim
01:52:32*wallabra_ quit (Remote host closed the connection)
01:54:01*wallabra quit (Ping timeout: 248 seconds)
02:02:40*wallabra joined #nim
02:08:15FromDiscord<ripluke> How can I convert a float to an int
02:08:24FromDiscord<Elegantbeef> `int(myFloat)`
02:08:54FromDiscord<ripluke> Oh... Lol I tried parseInt but it only works for strings
02:09:20FromDiscord<Elegantbeef> Type conversions in Nim are done the above way
02:09:56FromDiscord<ripluke> Yea but strutils has a parseInt() and other functions
02:11:22FromDiscord<haskellandchill> that's not a type conversion
02:11:27FromDiscord<haskellandchill> it's parsing
02:13:36FromDiscord<haskellandchill> you are free to do `int("1")` but it's not gonna work
02:15:14FromDiscord<Elegantbeef> I mean you're free to try but that's a compile time error πŸ˜„
02:18:58*krux02 quit (Quit: Leaving)
02:34:32FromDiscord<Prestige> Elegantbeef: (possibly) a challenge - with the current mock, we can only substitute the calls at compile time, yes? Ideally for tests, we would change what the mocked function returns for each test. I've just started contemplating a solution, don't know if you have any thoughts on this
02:35:29FromDiscord<Elegantbeef> You cannot really
02:36:12FromDiscord<Prestige> Was thinking maybe a global variable that's generated by the macro, or maybe a table to lookup the caller and the return value
02:37:42FromDiscord<Elegantbeef> I guess you can inject a table access instead of a call
02:43:02*arkurious quit (Quit: Leaving)
02:49:13FromDiscord<Elegantbeef> You could also just use a function pointer of course
02:49:33FromDiscord<Prestige> Good point
03:11:43FromDiscord<Prestige> I still haven't figured out how to import this mocker file btw
03:12:04FromDiscord<Elegantbeef> You have to use the `--import:mocker` part of the compiler
03:14:40FromDiscord<Prestige> So I've added `--import:mocker` to my `config.nims` and I have `mocker.nim` in the `src` dir of my `nimtest` project (which is the testing suite library/binary)
03:16:41FromDiscord<Prestige> ah changed to `switch("import", "mocker")` but
03:17:09FromDiscord<Prestige> `Error: expression ' {.noRewrite.}: newStmtList([])' is of type 'NimNode' and has to be used (or discarded)`
03:17:26FromDiscord<Prestige> Getting this from one of the files from my nimtest library
03:17:50FromDiscord<Elegantbeef> Annotate the template with `: untyped`
03:18:07FromDiscord<Elegantbeef> the template didnt have a return value since it didnt need one when i was using it
03:20:12FromDiscord<Elegantbeef> But like i said buh bye compile times due to that pesky noRewrite not being respected
03:20:40FromDiscord<Prestige> Like this will increase compile times using it?
03:20:58FromDiscord<Elegantbeef> Yea
03:21:06FromDiscord<Prestige> Getting an error in my little test example for some reason, about using `..<` or `countup`
03:21:20FromDiscord<Elegantbeef> Someone broke the `{.noRewrite.}` pragma apparently
03:21:47FromDiscord<Prestige> aw dang
03:22:01FromDiscord<Elegantbeef> Oh perhaps i never worked
03:22:19FromDiscord<Elegantbeef> I just tested on the playground and it applies it recursively all the way back to 1.0
03:23:01FromDiscord<Prestige> πŸ€”
03:23:24FromDiscord<Prestige> How can I convert an int to a char equivalent
03:23:30FromDiscord<Prestige> like uh, 64 = a or whatever
03:24:44FromDiscord<Prestige> oh I got it
03:25:38FromDiscord<Prestige> https://play.nim-lang.org/#ix=40vk
03:26:08FromDiscord<Prestige> Works in the playground but not locally
03:26:21FromDiscord<Prestige> `attempting to call routine: '..<' found ..<...<(a: int, b: int) [iterator declared in /home/avahe/.choosenim/toolchains/nim-1.6.6/lib/system/iterators_1.nim(117, 10)]`
03:26:51FromDiscord<Prestige> Stacktrace back to `mocker.nim replaceProcImpl`
04:21:58*euantorano quit (*.net *.split)
04:21:59*drewr quit (*.net *.split)
04:22:13*euantorano joined #nim
04:23:39*drewr joined #nim
04:27:00*nullsh quit (*.net *.split)
04:27:00*madprog quit (*.net *.split)
04:27:01*madprops quit (*.net *.split)
04:27:01*notchris quit (*.net *.split)
04:27:01*DixieFlatline quit (*.net *.split)
04:27:12*madprops joined #nim
04:27:18*DixieFlatline joined #nim
04:27:28*notchris joined #nim
04:27:36*madprog joined #nim
04:27:44*madprops quit (Changing host)
04:27:44*madprops joined #nim
04:28:05*nullsh joined #nim
04:30:08*dtomato quit (*.net *.split)
04:30:08*dom96 quit (*.net *.split)
04:30:08*dithpri[m] quit (*.net *.split)
04:30:09*gshumway quit (*.net *.split)
04:30:40*dtomato joined #nim
04:31:22*gshumway joined #nim
04:32:28*dom96 joined #nim
04:37:55FromDiscord<haskellandchill> works for me locally
04:38:33FromDiscord<haskellandchill> you might have copied the `..<` part wrong somehow
04:39:28FromDiscord<Elegantbeef> eh he's using a very wacky macro
04:42:23FromDiscord<Prestige> yah
04:42:37FromDiscord<Prestige> Elegantbeef what are you using for 3d in your game?
04:43:07FromDiscord<Elegantbeef> My framework
04:43:15FromDiscord<Elegantbeef> opengl
04:43:37*dithpri[m] joined #nim
04:44:01*dithpri[m] is now known as Guest6357
04:44:15FromDiscord<Prestige> Was it difficult to get models properly rendering?
04:45:18FromDiscord<Elegantbeef> No libassimp is quite lovely
04:47:17*mahlon joined #nim
04:48:05FromDiscord<Prestige> https://github.com/barcharcraz/nim-assimp ?
04:48:16FromDiscord<Elegantbeef> I use my own fork but yea
04:48:42FromDiscord<Prestige> Neat, I'll look into this
04:49:23FromDiscord<Elegantbeef> https://github.com/beef331/truss3d/blob/master/src/truss3D/models.nim is how i handle uploading to the gpu
04:49:31FromDiscord<Elegantbeef> It's really quite simple with assimp
04:49:46FromDiscord<Elegantbeef> Are you thinking about making shade3d?
04:50:13*termer_ joined #nim
04:50:30FromDiscord<Prestige> Yeah
04:50:43FromDiscord<Prestige> Was thinking of maybe using vulkan, though
04:50:59FromDiscord<Elegantbeef> Well have fun with the 3 weeks to render a single triangle
04:51:13FromDiscord<Elegantbeef> I barely have the willpower to work with opengl vulkan is 99% boilerplate
04:51:38*greaser|q joined #nim
04:51:43FromDiscord<Prestige> Yep lol it's crazy verbose
04:51:43FromDiscord<Elegantbeef> opengl is good enough for most things people will work on
04:52:24*djanatyn1 joined #nim
04:53:04*djanatyn quit (Ping timeout: 272 seconds)
04:53:04*Amun-Ra quit (Ping timeout: 272 seconds)
04:53:05*termer quit (Ping timeout: 272 seconds)
04:53:05*GreaseMonkey quit (Ping timeout: 272 seconds)
04:53:07FromDiscord<Elegantbeef> Like yes opengl is just a giant state machine and it's just the worst, but it's also relatively easy to get anything done and has many features that are relatively easy to implement
04:53:18FromDiscord<Prestige> Hmm
04:53:50FromDiscord<Elegantbeef> Most of my code in truss3D is probably for GUI πŸ˜„
04:54:31*Amun-Ra joined #nim
04:56:05FromDiscord<Elegantbeef> My view is mostly that of indies and the like are better off spending their time with opengl as you actually can make a game instead of making a vulkan wrapper
04:57:34FromDiscord<Elegantbeef> But then again you arent making a game you're making tooling
04:57:37FromDiscord<Elegantbeef> So i guess you do you
05:14:37FromDiscord<Prestige> Any thoughts on the macro issue btw?
05:14:48FromDiscord<Elegantbeef> Cant say much without a repro
05:15:51FromDiscord<Prestige> I provided the code so you can repro
05:16:27FromDiscord<Elegantbeef> You did?
05:17:27FromDiscord<Prestige> https://play.nim-lang.org/#ix=40vk
05:18:04FromDiscord<Prestige> Erroring on the for line, when having the mocks file imported with config.nims
05:18:15FromDiscord<Elegantbeef> Can i get the mock file again?
05:18:16FromDiscord<Prestige> mocker.nim I mean
05:18:18FromDiscord<Prestige> sure
05:18:39FromDiscord<Elegantbeef> I think i know the issue, but we'll see
05:18:49FromDiscord<Prestige> https://play.nim-lang.org/#ix=40vy
05:23:16FromDiscord<Elegantbeef> Hmmm this breaks iterator calls
05:24:00FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40vz
05:24:22FromDiscord<Elegantbeef> Wait seems that just kills the matching
05:27:13FromDiscord<Elegantbeef> It shouldnt/doesnt match on an iterator so i dont get why it breaks it
05:28:10FromDiscord<Elegantbeef> Also you're really the worst
05:28:32FromDiscord<Elegantbeef> Nim has a ton of amazing features and you're using rand + 97 like it's C
05:28:38FromDiscord<Elegantbeef> `rand('a'..'z')`
05:30:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40vC
05:35:29FromDiscord<Elegantbeef> Yep this mocker method fucking sucks
05:35:50FromDiscord<Elegantbeef> Use the module method i guess
05:36:49FromDiscord<Elegantbeef> then your `myProc(args)` just works
05:36:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40vD
05:37:18FromDiscord<Elegantbeef> @Prestige\: there's a lot of rambling above for you πŸ˜›
05:37:21FromDiscord<Prestige> In reply to @Elegantbeef "`rand('a'..'z')`": had no idea I could do that lol
05:37:39FromDiscord<Elegantbeef> Works for all ordinals + floats
05:38:01FromDiscord<Elegantbeef> There's also `sample` for set/openarray
05:39:43FromDiscord<Prestige> That change above is working for you?
05:40:07FromDiscord<Elegantbeef> It did work, but it also broke with a minor change
05:40:14FromDiscord<Elegantbeef> Give up on this solution we're not using TRMs for what they're for
05:41:43FromDiscord<Rika> ~~TRMs are too powerful to use in any useful form tho~~
05:42:20FromDiscord<Elegantbeef> I really like what they can in theory enable you to do, they just are a bit broke apparently
05:43:06FromDiscord<Elegantbeef> The parameter matching syntax i do wish will stay for macros/templates
05:44:00FromDiscord<Elegantbeef> I dont think anyone's ever really used TRMs for anything that i know of, but i've used them a bit for toys like this
05:45:36FromDiscord<Prestige> D:
05:46:04FromDiscord<Elegantbeef> The module way is the way to go prestige πŸ˜„
05:46:10FromDiscord<Prestige> What do you mean?
05:46:36FromDiscord<Elegantbeef> The two modules that are imported/exported based off if a flag is passed
05:46:42FromDiscord<Prestige> ah..
05:46:44FromDiscord<Prestige> terrible
05:46:49FromDiscord<Elegantbeef> Eh it's not
05:46:55FromDiscord<Elegantbeef> It's better than this shit
05:47:09FromDiscord<Elegantbeef> It's atleast clear and uses sensible/reasonable mechanisms
05:47:26FromDiscord<Elegantbeef> It's as flexible as this without any overhead on the compiler side or your brain
05:49:03FromDiscord<Elegantbeef> You just have to make pointer procs for all procedures you want to mock, and could make a template handle it for you
05:50:43FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40vE
05:51:12FromDiscord<Elegantbeef> Actually quite a nice API imho, but ymmv
05:52:03FromDiscord<Elegantbeef> mock is a bit of a shortcut cause `var doThing: typeof(doThing)` is a biiiit long
06:02:12FromDiscord<Prestige> lot more boilerplate for the user though, eh?
06:02:25FromDiscord<Elegantbeef> Mostly the same
06:03:24FromDiscord<Elegantbeef> You could make a macro that turned proc defs into pointer procs if `mock` is defined
06:03:55FromDiscord<Elegantbeef> Not as easy as the trm mess but it's more approachable
06:07:51FromDiscord<Prestige> hm well
06:08:02FromDiscord<Prestige> I'll need to think of a solution I guess
06:08:13FromDiscord<Prestige> I'm not sure what you have in mind tbh
06:08:26FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40vK
06:09:18FromDiscord<Prestige> So would this need to be imported in all files and it'd add the mock pragma to everything?
06:09:35FromDiscord<Elegantbeef> what?
06:09:43FromDiscord<Elegantbeef> This works just like your normal proc macros
06:10:00FromDiscord<Elegantbeef> If you want to mock a procedure you add `{.mock.}` to it and it'll let you mock it
06:10:19FromDiscord<Elegantbeef> You could try to use a TRM to enable that mocking but i'll have no fun attempting to fight that macro
06:10:33FromDiscord<Prestige> Yeah so like
06:10:53FromDiscord<Prestige> if I have a proc that i need to mock, I'd need to add that pragma to it right?
06:10:58FromDiscord<Prestige> in the actual code, not the test
06:11:13FromDiscord<Elegantbeef> You can try a TRM to add `{.mock.}` to it
06:11:33FromDiscord<Elegantbeef> It's less aggressive than the other TRM
06:11:41FromDiscord<Prestige> true
06:11:48FromDiscord<Prestige> I suppose that's probably the best route...
06:12:03FromDiscord<Prestige> Is it non-trivial to add a pragma to a proc?
06:12:09FromDiscord<Prestige> with a TRM
06:12:17FromDiscord<Elegantbeef> It's just like adding it using a normal macro
06:12:29FromDiscord<Prestige> oh, alright good
06:12:42FromDiscord<Elegantbeef> Actually this is much simpler than i thought
06:15:50FromDiscord<Elegantbeef> Or... not `nkProcDef` isnt matched πŸ˜„
06:20:11FromDiscord<Prestige> hmm
06:24:51*rockcavera quit (Remote host closed the connection)
06:52:17*PMunch joined #nim
07:01:36*gsalazar joined #nim
07:34:30*mahlon quit (Ping timeout: 240 seconds)
07:42:17*ltriant quit (Ping timeout: 248 seconds)
08:22:52FromDiscord<Phil> sent a code paste, see https://paste.rs/bFN
08:23:23FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=40vW" => "https://play.nim-lang.org/#ix=40vX"
08:25:37FromDiscord<Phil> Using the example with `useSSL`gives the same response, but in that one in the line when calling the `connect` proc
08:26:18FromDiscord<Elegantbeef> You did compile with `-d:ssl` in the `useSsl` version?
08:27:21FromDiscord<Phil> Yeah, I compiled this in my "playground" project where I have -d:ssl just as a default flag
08:28:31FromDiscord<Phil> `nim c -r -d:normDebug --warning=UnusedImport:off -d:ssl ./src/playground.nim` This is the command I compile anything in playground with
08:30:25FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=40vZ
08:30:45FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=40vZ" => "https://play.nim-lang.org/#ix=40w0"
08:31:02FromDiscord<Elegantbeef> Yea i cant say much
08:31:50FromDiscord<Phil> At least I know the error is almost definitely a runtime error caused by the way std/smtp interacts with the smtp server
08:32:14FromDiscord<Phil> Though where I use std/smtp wrong I don't know
08:32:16FromDiscord<Elegantbeef> "almost definitely a runtime error" is a funny read πŸ˜›
08:48:53NimEventerNew question by Philipp Doerner: SMTP - 503 Bad sequence of commands when using nim&#39;s std/smtp, see https://stackoverflow.com/questions/72684418/smtp-503-bad-sequence-of-commands-when-using-nims-std-smtp
08:52:06FromDiscord<Phil> I'll throw this up on the forum as well and answer my own SO question (unless somebody answers it first) once I figured out what's wrong
08:53:36FromDiscord<xflywind> did you enable IMAP/SMTP serice in your email and get auth code?
08:53:49FromDiscord<xflywind> (edit) "did you enable IMAP/SMTP serice in your email ... and" added "settings"
08:53:56FromDiscord<Phil> I enabled SMTP, did not get an auth code though I was not aware there was one
08:54:24FromDiscord<Phil> Since the local mail providers page about that does not mention an auth code
08:54:45FromDiscord<Phil> Let me check if my python implementation needed such a thing
08:56:54FromDiscord<Phil> Hmm within my django app I didn't need to add some specific auth code of sorts (unless you mean login credentials for a user account, those I did have to provide but those I also try to provide in the nim examples, the server just never lets me get that far)
09:01:53PMunchMaybe have a look with Wireshark and see what the Python and Nim versions do differently?
09:03:24NimEventerNew thread by Isofruit: SMTP - 503 Bad sequence of commands with std/smtp, see https://forum.nim-lang.org/t/9251
09:04:17FromDiscord<Phil> Just to be on the safe side since I've got a suspicion, this is a problem with the mail provider, I take it others used this with googles smtp without issue?
09:05:19FromDiscord<xflywind> Yeah, I didn't use startTls though.
09:05:35FromDiscord<Phil> Hmmm I'll make a google dummy then
09:09:33FromDiscord<Phil> Yeeeeeh I'm pretty sure I'm doing something wrong on a more fundamental level, google is giving me the same responses
09:14:28FromDiscord<xflywind> Or `std/smtp` have regressions on stable.
09:14:42FromDiscord<xflywind> ref https://github.com/nim-lang/Nim/pull/15032#issuecomment-715912739
09:14:53FromDiscord<xflywind> > This actually broke SMTP TLS support on nimforum for e.g. GMail SMTP, but no one noticed 😦
09:16:20FromDiscord<enthus1ast> most smtp server these days want to see "ehlo" not "helo"
09:16:34FromDiscord<enthus1ast> you cannot just send helo you must check
09:16:44FromDiscord<enthus1ast> if the server understands esmtp
09:16:54FromDiscord<enthus1ast> then send ehlo
09:17:39FromDiscord<enthus1ast> eg the uni-frankfurt mailserver lets you connect with helo but all commands fail
09:17:47FromDiscord<Phil> Ohh wait, using google I get a different error, nice!
09:18:05FromDiscord<xflywind> What's you Nim version?
09:18:35FromDiscord<xflywind> (edit) "you" => "your"
09:18:48FromDiscord<Phil> > Expected 235 reply, got: 534-5.7.9 Application-specific password required. Learn more at [ReplyError]↡With google, that one breaks on the call `smtpConn.auth`
09:19:10FromDiscord<Phil> sent a long message, see http://ix.io/40w9
09:19:49FromDiscord<xflywind> Could you try devel which contains a fix for smtp tls https://github.com/nim-lang/Nim/pull/19077 ?
09:20:00FromDiscord<enthus1ast> you must create a new password↡(@Phil)
09:20:19FromDiscord<enthus1ast> you cannot use your google account password
09:20:44FromDiscord<enthus1ast> they create like an app token for you to use in your email client
09:21:57*ltriant joined #nim
09:22:11FromDiscord<Phil> sent a code paste, see https://paste.rs/JHK
09:22:25FromDiscord<Phil> (edit) "https://paste.rs/k31" => "https://play.nim-lang.org/#ix=40wb"
09:23:15FromDiscord<Phil> In reply to @enthus1ast "you must create a": I'll take a look at this later, right now I have to leave and on the go coding is a bit hard ^^
09:46:33FromDiscord<d4rckh> how could i only import % from std/json?
09:46:41FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=40wc
09:46:43FromDiscord<d4rckh> this is saying % is not a valid module name
09:57:28FromDiscord<d4rckh> nvm
09:57:43FromDiscord<d4rckh> it took 2 minutes for the nim vs code extension to compile my file
09:58:09FromDiscord<enthus1ast> was is stuck in "checking nim ... "
09:58:09FromDiscord<enthus1ast> ?
09:58:31FromDiscord<enthus1ast> have the same issue idk what it actually does when it "checks" it
10:48:52FromDiscord<d4rckh> idk
10:49:00FromDiscord<d4rckh> yeah
10:49:01FromDiscord<d4rckh> it was
11:21:41*vicecea quit (Remote host closed the connection)
11:21:59*oddish joined #nim
11:22:03*arkanoid joined #nim
11:22:11*vicecea joined #nim
11:23:00arkanoidis std/json compatible with gc:orc? I'm receiving sigsegv in "lib/pure/json.nim(505) len"
11:23:04arkanoidnim 1.6.6
11:23:44*jmdaemon quit (Ping timeout: 255 seconds)
11:25:15arkanoidnevermind, it was my fault
11:42:15FromDiscord<Firefell> Hello, Is it impossible to do this ?
11:42:32FromDiscord<Firefell> (edit) "Hello, Is it impossible to do this ?" => "sent a code paste, see https://paste.rs/cCs"
11:43:40PMunch@Firefell, enums has to be in the correct order
11:43:46PMunchSo you'd have to start with -2 in this case
11:44:29FromDiscord<EchoPouet> In reply to @PMunch "@Firefell, enums has to": Ok thanks
11:55:25*oddish quit (Quit: nyaa~)
12:03:44*oddish joined #nim
12:28:12*crem joined #nim
12:30:38*noeontheend joined #nim
13:08:27*derpydoo joined #nim
13:43:31FromDiscord<tandy> is there any reason why responseContent is private? ↡https://github.com/nim-lang/Nim/blob/1561a83c49b446b0f2ed0eae00c847610f9ee310/lib/pure/httpclient.nim#L1161
13:47:39PMunchI don't think so
13:51:35*arkurious joined #nim
13:56:12FromDiscord<ynfle> What do you need it for?
14:07:53*noeontheend quit (Ping timeout: 248 seconds)
14:13:14FromDiscord<Phil> Erm, has anyone where used hottie so far?
14:14:02FromDiscord<Phil> (Treeforms profiler)
14:15:55*noeontheend joined #nim
14:17:31*PMunch quit (Quit: Leaving)
14:17:35FromDiscord<Phil> Or profiled nim code with the normal profiler
14:20:44FromDiscord<xflywind> In reply to @Isofruit "Or profiled nim code": Use valgrind on linux https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html#profiling-with-valgrind
14:21:06FromDiscord<Phil> Errr alright
14:21:42FromDiscord<Phil> Just as a headsup, both hottie and the normal profiler did not properly record my stacktraces despite me having the correct flags enabled, so I might come back with questions about valgrind due to the same underlying issue in my using it or sth
14:22:52FromDiscord<xflywind> What is the normal profiler? nimprof?
14:23:38FromDiscord<Phil> Yeh
14:24:37FromDiscord<Phil> Added the flags as demanded there ("--profiler:on", "--stacktrace:on",) and my output I got was solely `total executions of each stack trace:`
14:24:40FromDiscord<xflywind> nimprof is hard to use for me.
14:24:43FromDiscord<Phil> (edit) "Added the flags as demanded there ("--profiler:on", "--stacktrace:on",) and my output I got was solely ... `total" added "the line"
14:25:16FromDiscord<xflywind> I used Intel VTune on windows.
14:25:23FromDiscord<arnetheduck> if you're looking for sampling profilers, `vtune` is hard to beat
14:26:07FromDiscord<Phil> Erm... assume I have not ever debugged memory before and am fine with something feature limited if it can be understood by an idiot?
14:26:52FromDiscord<Phil> Like, the extent of my profiling previously consisted of consulting snakeviz for python and look at its cake-diagrams regarding execution time
14:27:50FromDiscord<Phil> Mostly doing this since Rika asked for some profilings of my various pbkdf2 cryptography implementations that imitate the way python's Django does it
14:28:21FromDiscord<Phil> (edit) "Mostly doing this since Rika asked for some profilings of my ... various" added "(well "my" in quotation marks, hotdog wrote one and the first one was built with massive help from here as well)"
14:29:48FromDiscord<Phil> As for valgrind, I'll download that later, train Wifi is too slow to download 100mb
14:30:22FromDiscord<xflywind> I think you need to check the source code of nimcrypto. Profiler may not help too much in this situation.
14:31:01FromDiscord<Phil> I mean, I personally do not care too much, mostly wanted to follow a request to provide some profiling data
14:31:27FromDiscord<Phil> And I wanted to go over the version using nimcrypto, the one using openssl through python and the one using openssl directly
14:32:23*noeontheend quit (Ping timeout: 268 seconds)
14:36:16FromDiscord<Xzayler> sent a code paste, see https://play.nim-lang.org/#ix=40wV
14:36:31reversem3[m]https://play.nim-lang.org/
14:36:59FromDiscord<Xzayler> In reply to @reversem3 "https://play.nim-lang.org/": can I check performance differences on there?
14:37:04reversem3[m]So trying to figure why I am getting dbError even though the type reflects the query ?
14:37:29reversem3[m]what do you mean ?
14:37:31FromDiscord<ynfle> How would I go about transforming a pixie.Image into a arraymancer.Tensor?
14:37:38FromDiscord<Xzayler> In reply to @reversem3 "what do you mean": sorry I thought you were replying to me
14:38:02FromDiscord<ynfle> In reply to @reversem3 "https://play.nim-lang.org/": You didn't "Share to ix"
14:38:03FromDiscord<Rika> Reverse you didn’t send a link with code
14:38:18reversem3[m]shit , sorry
14:38:26FromDiscord<Phil> In reply to @Xzayler "can I check performance": Nah, he was posting his own stuff
14:38:57reversem3[m]https://play.nim-lang.org/#ix=40wW
14:39:04FromDiscord<Phil> In reply to @Xzayler "If I have ": As for performance...err.... write a function, run it 10.000.000 times and echo out the time that passes?
14:39:14reversem3[m]Error: unhandled exception: ERROR: syntax error at or near "."
14:39:14reversem3[m]LINE 1: ..."User".password, "User".id FROM "User" WHERE User.email = ?
14:39:14reversem3[m] ^
14:39:14reversem3[m] [DbError]
14:39:16FromDiscord<Phil> Not even sure if that actually works
14:40:07FromDiscord<ynfle> In reply to @Xzayler "can I check performance": You can use benchy
14:40:16FromDiscord<treeform> In reply to @treeform "I am around to": We have published the 2nd part of the JPEG talk this time the more technical deep dive - again I am around to answer any questions https://www.youtube.com/watch?v=vYwD7OynFcg&t=328s
14:40:27FromDiscord<Phil> In reply to @treeform "We have published the": Nice!
14:40:52FromDiscord<ynfle> In reply to @ynfle "How would I go": @treeform any idea?
14:40:59FromDiscord<ynfle> Has anyone done this before?
14:41:03FromDiscord<Phil> In reply to @ynfle "You can use benchy": This sounds like a much better suggestion than mine, do what this guy suggested Xzayler
14:41:20FromDiscord<Xzayler> In reply to @ynfle "You can use benchy": ok I guess I'll have to do some tests. I just asked in case there was some established "better" way to do it already
14:41:40FromDiscord<treeform> In reply to @ynfle "Has anyone done this": I am sure its not hard, just for x, for y loop the image and insert the colors into tesor?
14:41:43FromDiscord<ynfle> In reply to @Xzayler "ok I guess I'll": What are you trying to acomplish?
14:42:16FromDiscord<ynfle> In reply to @treeform "I am sure its": Ok. I can give a pointer to the array, but it's or structs and I want to decompose the structucts.
14:42:25FromDiscord<treeform> In reply to @ynfle "<@107140179025735680> any idea?": Usually for ML you want to scale the image to some thing smaller first, like 64x64, and probably grayscale?
14:42:36FromDiscord<!Patitotective> In reply to @Xzayler "ok I guess I'll": im pretty sure the difference is subtle and you'll hardly notice
14:42:50FromDiscord<ynfle> It's not ML, it's traditional CV
14:42:51FromDiscord<Xzayler> In reply to @ynfle "What are you trying": nothing really, I just realised I'm using bools as "toggles" and often I have functions toggling the bool to one value when it's already that value and didn't know how wasteful it is compared to running an if check before toggling the value.
14:43:18FromDiscord<Phil> It's going to be comparatively negligible regardless of how you slice it I think
14:43:24reversem3[m]why doesn't the query work ?
14:43:34FromDiscord<ynfle> In reply to @Xzayler "nothing really, I just": Are really high performance?
14:43:36FromDiscord<Josef> How can I read & write into EAX register?
14:43:41FromDiscord<treeform> In reply to @ynfle "It's not ML, it's": Do you want to scale the image or grayscale it first?
14:43:53FromDiscord<ynfle> In reply to @treeform "Do you want to": grayscale, not scale
14:43:59FromDiscord<Xzayler> In reply to @ynfle "Are really high performance?": No, I'm just a beginner and paranoid. And my knowledge on what affects performance is close to 0
14:44:21FromDiscord<ynfle> In reply to @Xzayler "No, I'm just a": So probably don't worry about it
14:45:20FromDiscord<Phil> In reply to @Xzayler "No, I'm just a": You'll be fine, start worrying if you do something in a loop and what happens in that loop executes upwards of 5000 lines of code or works on some sort of string that is several megabytes long and you do that 1000 times or sth
14:46:36FromDiscord<Phil> Copying around large objects a lot or doing a lot of work in a loop/repeating work in a loop is more likely to be an issue than reassigning a boolean
14:46:55FromDiscord<Phil> (edit) "Copying around large objects a lot or doing a lot of work in a ... loop/repeating" added "massive"
14:50:08FromDiscord<Phil> There is such a thing as premature optimization and there's a quote flying around that it is the root of all evil. The essence is focus only on performance when you notice issues
14:51:25FromDiscord<treeform> In reply to @ynfle "grayscale, not scale": How do you create new tensor of width, height?
14:51:33FromDiscord<Phil> That can of course be taken to extremes, but the spirit is too not worry about the small things in terms of performance. Your algorithm in general is much more likely to heavily impact performance
14:52:00FromDiscord<treeform> found it!
14:53:47FromDiscord<treeform> nope, I can't figure our arraymancer docs
14:56:55FromDiscord<treeform> it seems like arraymancer docs don't match its current state
14:58:35FromDiscord<Josef> How do you convert int to str?
14:59:05FromDiscord<Phil> Strutils
14:59:22FromDiscord<Phil> Std/strutils holds your answer
14:59:22FromDiscord<Josef> Is there something like Hoogle for Nim?
14:59:28FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=40x0
15:01:27FromDiscord<Phil> Though $ proc might also work, try $5 and whether that compiled
15:01:34FromDiscord<Phil> (edit) "compiled" => "compiles"
15:08:25FromDiscord<!Patitotective> !eval echo $5
15:08:28NimBot5
15:08:49FromDiscord<Phil> Right that exists, I keep forgetting
15:14:21FromDiscord<Phil> !eval $5=="5"
15:14:24NimBotCompile failed: /usercode/in.nim(1, 3) Error: expression 'true' is of type 'bool' and has to be used (or discarded)
15:17:38FromDiscord<!Patitotective> !eval assert $5 == "5"
15:17:42NimBot<no output>
15:21:52FromDiscord<tandy> i want to do a get call, then get the response content↡(@ynfle)
15:59:52FromDiscord<ynfle> In reply to @tandy "i want to do": So use get content. That's what it's designed for
16:01:09FromDiscord<ynfle> In reply to @treeform "I think this might": What is yuv? Is that how to convert to grayscale?
16:09:08*mahlon joined #nim
16:10:31*arkanoid quit (Ping timeout: 256 seconds)
16:19:07FromDiscord<dom96> In reply to @ynfle "So use get content.": precisely, don't export this
16:29:30om3galooks like executing processes in threads, in parallel is not possible. My test example hangs, but works with Lock. So must the process be executed in subshell to achieve the parallelism?
16:39:40FromDiscord<vindaar> what specifically was hard to understand?↡(@treeform)
16:43:06om3gaplease ignore. execShellCmd not hangs when being used without locks
17:03:00*kayabaNerve joined #nim
17:07:50FromDiscord<xflywind> I like something like https://github.com/nim-lang/Nim/pull/19913 which improves user experience if on the right track.
17:12:08FromDiscord<Zoom> Just look at the amount of open issues with `startProcess` to get your expectations set. I got hangs starting processes from threads, for both arc/orc and refc, some issues with WaitForExit too. And selectors for process state aren't implemented for Windows.↡(<@709044657232936960_om3ga=5b=49=52=43=5d>)
17:12:10FromDiscord<Yardanico> In reply to @flywind "I like something like": yes, but a lot of things are really superfluous
17:14:30om3gaZoom, thanks for the info. good that execShellCmd works for now.
17:15:28FromDiscord<xflywind> In reply to @Yardanico "yes, but a lot": Yeah, so I send link here hoping other can review the PR 😜
17:17:04*rockcavera joined #nim
17:17:04*rockcavera quit (Changing host)
17:17:04*rockcavera joined #nim
17:18:31FromDiscord<xflywind> We probably can create a label "easy to review", so others can participate in the reviewing of PRs.
17:20:49FromDiscord<Phil> Huh.... I'm not sure what's happening with numpy but apparently calling python code through it isn't terribly expensive, at least when you just call a wrapped python library through it
17:20:55FromDiscord<Phil> (edit) "numpy" => "nimpy"
17:21:09FromDiscord<Phil> (edit) "Huh.... I'm not sure what's happening with nimpy but apparently calling python code through it isn't terribly expensive, at least when you just call a wrapped python library through it ... " added "(openssl in my scenario)"
17:23:23FromDiscord<xflywind> In reply to @flywind "We probably can create": The number of commits has been decreasing since early this year.
17:23:26FromDiscord<xflywind> https://media.discordapp.net/attachments/371759389889003532/988494298154668084/unknown.png
17:23:30*rockcavera quit (Ping timeout: 264 seconds)
17:24:41FromDiscord<Zoom> I bet to some degree ist's a function of speed of reviewing/merging.
17:25:32FromDiscord<konsumlamm> In reply to @flywind "The number of commits": hmm, i feel like part of that is that timothee isn't active anymore
17:25:40FromDiscord<konsumlamm> although now you're doing a lot of stuff
17:29:41FromDiscord<xflywind> In reply to @konsumlamm "hmm, i feel like": Yeah, I agree. I miss him very much. I cannot discuss prs with him these days , which makes me less motivated.
17:31:54FromDiscord<vindaar> you don't really expect any performance penalty using `nimpy` really compared to "native python'". It talks to a python interpreter straight via the CPython API↡(@Phil)
17:37:09FromDiscord<jmgomez> hey guys, question, how can I specify the size of an enum to be int32? It does work with byte but not with int32? Is there a way?
17:39:27FromDiscord<jmgomez> nvm uint32 works, which makes sense
17:43:47FromDiscord<jmgomez> hmm turns out you cant set the value if you assign a concrete size?
17:44:20FromDiscord<Phil> In reply to @vindaar "you don't really expect": Was more calling openssl via python vs calling openssl directly, I did expect some performance penalty there but I can barely make one out with benchy, and even that I'm not sure of how much it is just normal fluctuation
17:48:49FromDiscord<geekrelief> In reply to @jmgomez "hey guys, question, how": How are you specifying the size?
17:50:32FromDiscord<U9G> Hey, I'm just trying to cionvert python to nim, and I'm stuck on this:
17:50:41FromDiscord<U9G> sent a code paste, see https://play.nim-lang.org/#ix=40xO
17:50:43FromDiscord<U9G> (edit) "cionvert" => "convert"
17:51:18FromDiscord<U9G> sent a code paste, see https://play.nim-lang.org/#ix=40xQ
17:51:23FromDiscord<Yardanico> you didn't `import std/tables`
17:51:32FromDiscord<U9G> at the top of my file I had `import os, httpclient, strformat, tables, strutils`
17:51:40FromDiscord<Yardanico> ah, right
17:51:42FromDiscord<Yardanico> `let itm`
17:51:48FromDiscord<Yardanico> then `itm` is immutable, but you want to change it
17:51:52FromDiscord<Yardanico> use `var itm` instead
17:52:09FromDiscord<Yardanico> also you don't have to call `initTable`, default initialized tables work just fine
17:52:44FromDiscord<U9G> thanks for the var tip
17:52:59FromDiscord<U9G> In reply to @Yardanico "also you don't have": so is `var itm = Intermediaries()` equivalent ?
17:53:03FromDiscord<Yardanico> yes
17:53:21FromDiscord<Yardanico> initTable docs say "Starting from Nim v0.20, tables are initialized by default and it is not necessary to call this function explicitly."
17:53:34FromDiscord<Yardanico> you only need to call initTable if you want to preallocate some non-default size to the table
17:53:45FromDiscord<Yardanico> to have less reallocations later, but that's just a minor optimization most of the time
17:55:19FromDiscord<U9G> thanks
17:55:26FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=40xS
17:55:42FromDiscord<Yardanico> that's not how you do it
17:56:06FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#set-type-bit-fields
17:56:17FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=40xT
17:56:56FromDiscord<jmgomez> ohh, I saw somewhere else it being done like above. Thanks! Let's see i it allows me to set it now.. BTW why then is valid code what I just posted?
17:57:31FromDiscord<geekrelief> In reply to @jmgomez "ohh, I saw somewhere": Not sure, where did you see code like that?
17:59:25FromDiscord<geekrelief> you could also specify the size by setting a Max value:
17:59:40FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=40xU
17:59:55FromDiscord<geekrelief> (edit) "https://play.nim-lang.org/#ix=40xU" => "https://play.nim-lang.org/#ix=40xV"
18:01:14FromDiscord<jmgomez> Cant recall where I see it. Maybe that was an older way of doing things?
18:02:56FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=40xZ
18:03:08FromDiscord<geekrelief> Seems like you can set the values fine like above.
18:04:50FromDiscord<U9G> how would I skip the first line of an array? `arr[1..]` isnt valid, and neither is `arr[1..^0]`
18:05:20FromDiscord<geekrelief> `arr[1 ..< ^1]`
18:06:40FromDiscord<geekrelief> oops
18:06:45FromDiscord<geekrelief> that excludes the llast one
18:06:57FromDiscord<geekrelief> should be `arr[1 .. ^1]`
18:10:37FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=40y2
18:15:34NimEventerNew thread by Morturo: Question about pointers, see https://forum.nim-lang.org/t/9252
18:15:38FromDiscord<U9G> sent a code paste, see https://paste.rs/dUK
18:15:55FromDiscord<U9G> (edit)
18:18:42FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=40y6
18:18:47FromDiscord<Yardanico> (edit) "https://play.nim-lang.org/#ix=40y6" => "https://play.nim-lang.org/#ix=40y7"
18:19:00FromDiscord<Yardanico> Nim iterators can only be used in loop contexts, and if you need to get all values of an iterator outside of those, use sequtils.toSeq or sugar.collect
18:19:16FromDiscord<U9G> https://i.imgur.com/1CPEytY.png
18:19:19FromDiscord<U9G> thats my code now
18:19:40FromDiscord<Yardanico> just do `mnt in classes`
18:19:48FromDiscord<Yardanico> that'll check if a key is in the table
18:20:02FromDiscord<Yardanico> because Table type has `contains` defined for it that checks if the key is in the table
18:20:09FromDiscord<U9G> ah thanks
18:20:13FromDiscord<Yardanico> https://nim-lang.org/docs/tables.html#contains%2CTable%5BA%2CB%5D%2CA
18:21:20FromDiscord<Yardanico> In Nim you don't have to define an `in` operator for your type, instead you just define a `contains` proc and Nim will automatically use it for the `in` and `notin` operators
18:21:38*kayabaNerve quit (Ping timeout: 240 seconds)
18:25:41*termer_ is now known as termer
18:26:32*firq quit (Remote host closed the connection)
18:30:55FromDiscord<Phil> In reply to @flywind "Could you try devel": Alright, so I just played around with a version of my code that used google: That one worked. Whatever local email provider I'm using appears to be somehow fucked, not sure why it's not working with them
18:36:41FromDiscord<tandy> yes but that I can't get the status code of the request↡(@ynfle)
18:37:08FromDiscord<tandy> I've asked in the PR, I don't understand why this proc must not be exported↡(@dom96)
18:38:01FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=40ya
18:38:08FromDiscord<tandy> I would like to do this
19:25:02*PMunch joined #nim
19:26:46*oddish quit (Quit: oddish)
19:36:06FromDiscord<ynfle> In reply to @tandy "yes but that I": Why don't you use just regular `client.get`
19:36:33FromDiscord<ynfle> Not saing it shouldn't be exported
19:36:35FromDiscord<Yardanico> In reply to @tandy "I've asked in the": but why do you need responseContent specifically
19:36:40FromDiscord<Yardanico> if you can just do `await resp.body`
19:36:43FromDiscord<Yardanico> ?
19:37:01FromDiscord<Yardanico> this is with async ofc, without async it's just resp.body
19:42:08FromDiscord<ynfle> What's the easiest way to draw a 2d matrix in nim? something like displaying an image in matlab. I currently have it in matlab, but don't mind putting it into another format
19:42:25FromDiscord<ynfle> (edit) "matlab," => "an `arraymancer.Tensor`,"
19:44:37*gsalazar_ joined #nim
19:46:38*ltriant_ joined #nim
19:46:53*arkurious quit (Ping timeout: 268 seconds)
19:46:58*ltriant quit (Ping timeout: 240 seconds)
19:47:30*gsalazar quit (Ping timeout: 264 seconds)
19:48:16FromDiscord<U9G> I imported system but I still can't use createThread() from <https://nim-lang.org/docs/threads.html>
19:48:23FromDiscord<U9G> is there something I'm missing?
19:48:48FromDiscord<enthus1ast> do not import system but compile with --threads\:on
19:50:59FromDiscord<tandy> is that the same?↡(@Yardanico)
19:51:08FromDiscord<U9G> In reply to @enthus1ast "do not import system": it runs, but vscode doesnt recognize the createThread function still?
19:52:20FromDiscord<enthus1ast> i'm not 100% sure, but i think it will recognize it when you create a yourApp.nims file with `switch("threads", "on")`
19:52:31FromDiscord<enthus1ast> at least worth a try
19:52:46FromDiscord<U9G> ah I needed a nim.cfg
19:52:47FromDiscord<huantian> or `config.nims`
19:53:04FromDiscord<huantian> then you don't need to add --threads:on in your compile command too
19:53:06FromDiscord<U9G> is there a difference between .nims and nims.cfg?
19:53:26FromDiscord<enthus1ast> .nims is nimscript
19:53:52FromDiscord<huantian> yeah I don't know if you can use nimscript in `nim.cfg`
19:53:57FromDiscord<huantian> but they might just be the same thing
19:55:55FromDiscord<Yardanico> In reply to @tandy "is that the same?": For getting the body yes
19:56:07FromDiscord<Yardanico> the internal behaviour is a bit different, but it'll get the body
19:56:21FromDiscord<Yardanico> And it won't raise since, as Dom mentioned in the issue, it doesn't look like you want that
19:59:51*arkurious joined #nim
20:04:48FromDiscord<tandy> use that code i shared and save it to an image then open it↡(@ynfle)
20:04:56FromDiscord<tandy> hmm okay↡(@Yardanico)
20:09:24*jmdaemon joined #nim
20:11:43FromDiscord<ynfle> In reply to @tandy "use that code i": Where did you share it?
20:11:48FromDiscord<ynfle> Are you treeform?
20:12:05FromDiscord<U9G> is there something like os.name in nim?
20:12:18FromDiscord<U9G> to check windows/linux
20:14:45FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=40yw
20:17:15FromDiscord<U9G> thanks
20:27:43*noeontheend joined #nim
20:34:29FromDiscord<tandy> https://matrix.to/#/!IpFtPSbgfrZrVcVyti:envs.net/$YfUheltgy3K5k3GzgkEdeGZQ8y8QoZWKNUcwnLn6FZw?via=matrix.org&via=t2bot.io&via=envs.net↡(@ynfle)
20:34:31FromDiscord<Torbatti> sent a code paste, see https://play.nim-lang.org/#ix=40yz
20:34:38FromDiscord<tandy> no↡(@ynfle)
20:35:11FromDiscord<ynfle> In reply to @Torbatti "Hi ! how": Excatly that but put `-o` before the file name
20:35:17*PMunch quit (Quit: leaving)
20:35:24FromDiscord<ynfle> The rest are runtime command line args
20:35:48FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=40yA
20:36:11FromDiscord<tandy> @ynfle\: ^
20:36:16FromDiscord<tandy> i realised you arent on matrix
20:38:07FromDiscord<ynfle> Thanks
20:38:21FromDiscord<ynfle> I'm not sure why it doesn't work with the built in write_png
20:39:06FromDiscord<ynfle> This is my code
20:39:07FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=40yC
20:39:23FromDiscord<ynfle> I get `Error: unhandled exception: index out of bounds, the container is empty [IndexDefect]` on the write_png
20:46:13FromDiscord<KatrinaKitten> How would one go about doing conditional compilation in Nim? I've received a request to adjust one of my libraries to use `jsre` instead of `re` when compiling for Javascript, but I'm not sure where to start.
20:46:35FromDiscord<Yardanico> `when`
20:46:39*oddish joined #nim
20:47:46FromDiscord<KatrinaKitten> That makes sense. What would I be looking for in the condition?
20:57:53FromDiscord<Yardanico> In reply to @KatrinaKitten "That makes sense. What": https://github.com/nim-lang/Nim/blob/version-1-6/lib/impure/re.nim#L10
20:58:01*derpydoo quit (Quit: derpydoo)
20:58:22FromDiscord<Yardanico> Just `when defined(js):` is enough
20:59:24FromDiscord<U9G> sent a code paste, see https://play.nim-lang.org/#ix=40yF
21:00:06FromDiscord<Elegantbeef> What are you wanting to do with `txt`
21:00:15FromDiscord<Elegantbeef> the easiest way is `lines("path").toSeq`
21:00:19FromDiscord<ynfle> What are trying accomplish with `stripLineEnd`
21:00:35FromDiscord<ynfle> (edit) "`stripLineEnd`" => "`stripLineEnd`?"
21:00:36FromDiscord<Elegantbeef> `toSeq` is in `std/sequtils`
21:01:11FromDiscord<U9G> In reply to @ynfle "What are trying accomplish": strip empty line so I dont have an empty string at the end of the array of line?
21:01:22FromDiscord<U9G> oh okay I’ll use lines
21:01:56FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/mOf
21:01:58FromDiscord<ynfle> In reply to @U9G "strip empty line so": You could just use strip
21:02:25FromDiscord<Elegantbeef> The above that i showed is how you use procs that expect `var T` with an immutable `T`
21:02:29FromDiscord<Elegantbeef> Not that it's the right solution here
21:03:43FromDiscord<Elegantbeef> Personally i'd ask "what are you doing with txt" anyway
21:12:45FromDiscord<haskellandchill> hm I wanna try dr nim
21:12:50FromDiscord<haskellandchill> is koch the best way?
21:13:07FromDiscord<Elegantbeef> No clue pretty much no one uses the profiler/dr nim
21:13:13FromDiscord<haskellandchill> yea figured
21:13:22FromDiscord<haskellandchill> I don't even have koch cause I used choosenim
21:13:41FromDiscord<Elegantbeef> Yea you need to build from source to get koch
21:13:55FromDiscord<Elegantbeef> And even then you dont really "get" it unless you desire it
21:14:00FromDiscord<haskellandchill> wah ok
21:14:12FromDiscord<haskellandchill> for science
21:14:21FromDiscord<Elegantbeef> Like i've never had koch in my path πŸ˜„
21:15:22FromDiscord<πŸ‘Ύ br4n_d0n> What are the options I can use with ``when``?
21:15:30FromDiscord<Elegantbeef> Any compile time statement
21:15:43FromDiscord<πŸ‘Ύ br4n_d0n> Is there a list somewhere?
21:15:54FromDiscord<Elegantbeef> No cause it's literally any compile time statement
21:15:57FromDiscord<ynfle> What's you question?
21:16:05FromDiscord<enthus1ast> when is the "compile time if"
21:17:16FromDiscord<enthus1ast> `when true:` `when 1 == 1:`
21:18:10FromDiscord<Elegantbeef> If you mean all the compiler defined defines there isnt a comprehensive list but generally it's just OS
21:18:26FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/wiki/Consts-defined-by-the-compiler
21:32:28*greaser|q quit (Changing host)
21:32:28*greaser|q joined #nim
21:32:32*greaser|q is now known as GreaseMonkey
21:35:33FromDiscord<πŸ‘Ύ br4n_d0n> Hmm, can I alias a keyword?
21:35:56FromDiscord<Elegantbeef> Depends on what the keyword is
21:36:07FromDiscord<πŸ‘Ύ br4n_d0n> bitwise or
21:36:13FromDiscord<Elegantbeef> That's not a keyword
21:36:28FromDiscord<Elegantbeef> that's an operator and Nim allows userdefined operators
21:37:14FromDiscord<πŸ‘Ύ br4n_d0n> Sorry, I used the wrong term; I'm not great with them
21:41:45FromDiscord<KatrinaKitten> How do I check for a Javascript `null` from Nim? `== nil` gives me back type errors, `isNil` gives me "is an {.error.}", and I can't figure out what else to try
21:42:28FromDiscord<Elegantbeef> Is it a `ref object`?
21:43:23FromDiscord<KatrinaKitten> I don't think so, that's the issue; it's a `seq[cstring]`, but can be `null`
21:43:41FromDiscord<Elegantbeef> No it cannot be nil in nim land
21:43:54FromDiscord<Elegantbeef> you need to do `toJs(mySeq) != nil` probably
21:44:07FromDiscord<Elegantbeef> `seq[T]` is not nilable in Nim
21:45:31FromDiscord<KatrinaKitten> That worked, thank you!
21:46:31FromDiscord<Elegantbeef> Alternatively you can represent it as a `ref seq[T]` and it might give the semantics you want but i dont use the js backend much
21:47:13FromDiscord<KatrinaKitten> I don't need to use it extensively, just in a "patch" function that wraps `jsre` to be usable like `re` for my use cases, so `toJs` works fine here
21:47:40FromDiscord<Elegantbeef> Is there a reason you dont just use the pure Nim regex?
21:48:17FromDiscord<Elegantbeef> Though i'm sceptical about anyone using regex
21:48:20FromDiscord<KatrinaKitten> Normally I do, but I had a user request `jsre` support so I'm doing conditional compilation and patching in the functionality `jsre` doesn't support
21:48:36FromDiscord<KatrinaKitten> https://media.discordapp.net/attachments/371759389889003532/988561026683383818/unknown.png
21:48:46FromDiscord<Elegantbeef> `re` isnt pure Nim πŸ˜„
21:49:02FromDiscord<KatrinaKitten> Is there a pure Nim one?
21:49:13FromDiscord<ynfle> regex
21:49:14FromDiscord<Elegantbeef> https://github.com/nitely/nim-regex
21:49:14FromDiscord<Elegantbeef> yes
21:49:34FromDiscord<KatrinaKitten> Ah, yeah, I can't use that unfortunately. Part of the selling point of my library is that it has no third-party dependencies, it's stdlib only.
21:49:48FromDiscord<Elegantbeef> Except it has third party deps
21:49:51FromDiscord<ripluke> Can I have a function that returns void, but instead writes to the stdout
21:50:03FromDiscord<ynfle> re uses PCRE dll which is a third party dependency
21:50:10FromDiscord<Elegantbeef> `re` relies on PCRE
21:50:12FromDiscord<ynfle> In reply to @ripluke "Can I have a": Yes of coure
21:50:20FromDiscord<ripluke> Oh ok thx
21:50:34FromDiscord<ynfle> return void means not return any value
21:50:48FromDiscord<KatrinaKitten> In reply to @ynfle "re uses PCRE dll": I handwave that bit, because that's a third party dependency used by the stdlib itself.
21:50:53FromDiscord<Elegantbeef> You also dont need to annotate a procedure returns void
21:51:15FromDiscord<KatrinaKitten> (edit) "itself." => "itself, not one I'm adding on top of it."
21:51:15FromDiscord<ynfle> In reply to @KatrinaKitten "I handwave that bit,": Why no 3rd party deps?
21:51:45FromDiscord<Elegantbeef> Sure but it does have a third party dependancy and with a license attached to it
21:51:46FromDiscord<Elegantbeef> nim-regex is MIT licensed code
21:51:51FromDiscord<Elegantbeef> So you could if you really didnt want a third party dependency pull in nim-regex into your own repo and manage a fork that way
21:52:32FromDiscord<KatrinaKitten> It's admittedly a bit idiosyncratic on my part, but every dependency is a liability, so for a "tiny" library like this it doesn't make sense to depend on stuff the language doesn't already use in its "core" things.
21:52:53FromDiscord<Elegantbeef> I'd of course just say "use nim-regex through nimble" but if you really dislike third party deps the best thing is to have a fork in your project
21:53:10FromDiscord<Elegantbeef> This gives you the same API on every platform without issue
21:53:46FromDiscord<Elegantbeef> That makes no sense
21:54:03FromDiscord<Elegantbeef> Both carry the same risks
21:54:19FromDiscord<Elegantbeef> You're risking that the people ship the library with the code and also that the wrapping of it are proper
21:55:10FromDiscord<KatrinaKitten> In terms of same API, so does writing small extension functions to wrap `jsre` for the few `re` functions I use πŸ€·β€β™€οΈ What really doesn't make sense at the moment, for a library I'm barely maintaining consistently anyway, to rewrite my entire library to not use `re` when I only need to wrap two functions of `jsre` and all my tests pass. If it becomes an issue in the future, I can always make the shift then.
21:55:19FromDiscord<KatrinaKitten> (edit) "In terms of same API, so does writing small extension functions to wrap `jsre` for the few `re` functions I use πŸ€·β€β™€οΈ What really doesn't make sense at the moment, for a library I'm barely maintaining consistently anyway, ... to" added "is"
21:56:44FromDiscord<ripluke> What’s the equivalent to the python continue keyword in nim
21:56:55FromDiscord<huantian> `continue`
21:56:55FromDiscord<Elegantbeef> you arent going to believe this shit
21:56:58FromDiscord<Elegantbeef> It's `continue`
21:57:07FromDiscord<ripluke> Oh
21:57:18FromDiscord<ripluke> Ok that was a dumb question
21:57:27FromDiscord<d4rckh> In reply to @KatrinaKitten "": Wow nice font!
21:57:27FromDiscord<Elegantbeef> Continue
21:57:33FromDiscord<huantian> I can't believe nim would just shamelessly copy python like that tho
21:58:10FromDiscord<KatrinaKitten> In reply to @d4rckh "Wow nice font!": Ty, it's Comic Mono haha https://dtinth.github.io/comic-mono-font/
21:58:14FromDiscord<Elegantbeef> Try why isnt it like "next iteration yous hitty PC"
21:58:15FromDiscord<KatrinaKitten> I use it for readability, mostly
21:58:38FromDiscord<d4rckh> In reply to @KatrinaKitten "Ty, it's Comic Mono": Pretty sick
21:58:42FromDiscord<Elegantbeef> Damn i cannot type that should be "true"
21:58:46FromDiscord<d4rckh> I like Cascadia Code
21:58:52FromDiscord<d4rckh> But I'll give comic mono a try too
21:59:23FromDiscord<Elegantbeef> Here i am bashing rocks together with iosevka
22:03:03FromDiscord<d4rckh> That also looks like a cool font
22:03:55FromDiscord<πŸ‘Ύ br4n_d0n> OK, I feel like this is another dumb question, but I'm struggling with it.↡How do I get echo to display a binary number in the ``0bxxxx`` form?
22:04:05FromDiscord<Elegantbeef> `toBin`
22:04:32FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40yQ
22:05:10FromDiscord<Elegantbeef> Nim's echo doesnt do any formatting it just calls the types `$` operator
22:05:46FromDiscord<huantian> you can also use strformat if you want too I think
22:06:08FromDiscord<Elegantbeef> You can indeed
22:06:21*noeontheend quit (Ping timeout: 276 seconds)
22:06:53FromDiscord<πŸ‘Ύ br4n_d0n> sent a code paste, see https://play.nim-lang.org/#ix=40yT
22:07:11FromDiscord<huantian> what type would it be if not an int?
22:07:19FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40yU
22:07:23FromDiscord<πŸ‘Ύ br4n_d0n> (edit) "https://play.nim-lang.org/#ix=40yT" => "https://paste.rs/eul"
22:07:25FromDiscord<Elegantbeef> Are you trying to do bitflags
22:07:28FromDiscord<Elegantbeef> If so stop what you're doing
22:07:58FromDiscord<πŸ‘Ύ br4n_d0n> I was trying to use flipBits
22:08:09FromDiscord<πŸ‘Ύ br4n_d0n> and wanted to print the outcome
22:08:21FromDiscord<ripluke> So I have this echo statement, and I want it to detect keys such as ctrl + l
22:09:18FromDiscord<ripluke> How can I do that
22:09:57FromDiscord<Elegantbeef> echo then `readCh()`
22:10:05FromDiscord<ripluke> Oh
22:10:09FromDiscord<Elegantbeef> or is it `getCh()` i always forget
22:10:17FromDiscord<Elegantbeef> If you want an interactive terminal program look at illwill
22:10:27FromDiscord<ripluke> Ohk
22:13:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40yV
22:13:15FromDiscord<Elegantbeef> `toBin` takes `int`
22:13:15FromDiscord<ynfle> In reply to @br4n_d0n "and wanted to print": all (non float) number irrespective of how the are defined are integers and are binary in the computer's memory. The compiler does not distinguish. 2342 printed in binary is the same os 0b101101111010101 printed in binary (not the deciman and binary value, of course)
22:13:20FromDiscord<ynfle> (edit) "deciman" => "decimal"
22:13:39FromDiscord<Elegantbeef> there is still the question of what are you using flipbits for
22:13:49FromDiscord<Elegantbeef> Cause if you're using it for flags and lying about it i'll send huan after you
22:13:59FromDiscord<πŸ‘Ύ br4n_d0n> lol
22:14:45*firq joined #nim
22:14:47FromDiscord<πŸ‘Ύ br4n_d0n> I was looking at potentially intefacing with some C code that uses bit flags
22:15:04FromDiscord<huantian> permabanned and deleted from the internet
22:15:07FromDiscord<Elegantbeef> So then why would you use manual bitflags do you dislike yourself?
22:15:52FromDiscord<πŸ‘Ύ br4n_d0n> I clearly don't know what I'm doing
22:15:56FromDiscord<πŸ‘Ύ br4n_d0n> lol
22:16:23FromDiscord<πŸ‘Ύ br4n_d0n> #not-low-level-gang
22:16:46FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40yW
22:16:57FromDiscord<Elegantbeef> No this is highlevel bitflags
22:17:02FromDiscord<Elegantbeef> We dont live like monkeys here
22:18:29FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40yX
22:19:11FromDiscord<Elegantbeef> Yes you can seemlessly interop with a bitset of a given C size using this method without causing headaches
22:19:36FromDiscord<πŸ‘Ύ br4n_d0n> Interesting
22:20:09FromDiscord<πŸ‘Ύ br4n_d0n> What's the reason for using ``'u8`` at the end?
22:20:20FromDiscord<Elegantbeef> To make it a byte?
22:20:23FromDiscord<Elegantbeef> or a uint8 rather
22:20:37FromDiscord<πŸ‘Ύ br4n_d0n> It cannot infer this?
22:20:45FromDiscord<Elegantbeef> Nim doesnt do backwards inference
22:20:57FromDiscord<Elegantbeef> the only inference it has is it's an integer with the first three bits set to x
22:20:59FromDiscord<ynfle> The default int type is int 64 or 32 depending on the machine
22:21:23FromDiscord<Elegantbeef> All unmarked literals are inferred to be the systems `int` type otherwise they're inferred of a callsite parameter
22:22:25FromDiscord<Elegantbeef> So where should it infer it's a uint8?
22:23:14FromDiscord<πŸ‘Ύ br4n_d0n> πŸ€” I feel dumb
22:23:24FromDiscord<Elegantbeef> ok
22:24:02FromDiscord<ripluke> Can I use nim script as a config language for my nim project?
22:24:08FromDiscord<Elegantbeef> You can
22:24:16FromDiscord<Elegantbeef> `config.nims` next to your binary
22:24:28FromDiscord<ripluke> Ohk
22:24:35FromDiscord<Elegantbeef> I mean not binary
22:24:45FromDiscord<Elegantbeef> source file or root directory of your project
22:25:16FromDiscord<ripluke> What if I want the config file in the config dir (~/.config)
22:25:34FromDiscord<Elegantbeef> You'd need to use load the nimscript
22:25:40FromDiscord<Elegantbeef> So this is where i mention nimscripter
22:25:45FromDiscord<ripluke> Ok
22:25:54FromDiscord<Elegantbeef> It's a library that makes nim \<-\> nimscript interop easy at runtime
22:26:09FromDiscord<ripluke> Ok I’ll check it out
22:26:25FromDiscord<Elegantbeef> Just dont make any issues or have troubles as i'm feeling lazy as of late πŸ˜„
22:26:44FromDiscord<ripluke> I’ll try not to lol
22:29:00FromDiscord<πŸ‘Ύ br4n_d0n> @ElegantBeef can Nim do a nibble? 😈
22:29:27FromDiscord<Elegantbeef> Is this a joke or do you have an elaborated question
22:29:46FromDiscord<πŸ‘Ύ br4n_d0n> https://tenor.com/view/monkey-gangster-monkey-monk-monke-shaptic-gif-21239890
22:30:41FromDiscord<πŸ‘Ύ br4n_d0n> (edit) "https://tenor.com/view/monkey-gangster-monkey-monk-monke-shaptic-gif-21239890" => "πŸ’"
22:31:00FromDiscord<Elegantbeef> So is there a serious question?
22:31:42FromDiscord<πŸ‘Ύ br4n_d0n> Half serious half joke; my guess is unsigned inter of 8 bits is as low as the language goes
22:31:42FromDiscord<Elegantbeef> Do you want to know if nim can make a 4bit bitset?
22:32:11FromDiscord<Elegantbeef> I mean `0b010` is an integer literal
22:32:25FromDiscord<Elegantbeef> just cause you dont write all 64bits doesnt mean you dont want it to be 64bits
22:32:33FromDiscord<Elegantbeef> And that's why we have the type declaration
22:33:33FromDiscord<πŸ‘Ύ br4n_d0n> ``0b1001'u4``
22:39:56FromDiscord<Elegantbeef> You cannot do that cause the smallest allocatable memory is 1 byte on modern computers
22:40:15FromDiscord<Elegantbeef> You can do something similar inside type defs
22:41:27FromDiscord<haskellandchill> building from source wish me luck
22:41:43FromDiscord<Elegantbeef> Eh it's quite easy to run `./build_all.sh`
22:41:53FromDiscord<Elegantbeef> See you in 2-10 minutes πŸ˜„
22:41:59*gsalazar_ quit (Ping timeout: 246 seconds)
22:42:20*firq quit (Ping timeout: 246 seconds)
22:42:35FromDiscord<πŸ‘Ύ br4n_d0n> In reply to @Elegantbeef "You cannot do that": What if you were running on some embedded platform that allowed this and you NEEDED to save the space?
22:42:57FromDiscord<Elegantbeef> embedded platforms dont generally allow lower allocations either
22:43:03FromDiscord<Elegantbeef> we're a 8 bit word world
22:43:14FromDiscord<Elegantbeef> Does exist though
22:43:15FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40z0
22:44:12FromDiscord<Elegantbeef> for a u4 you'd do `myField {.bitSize: 4.}: 0u8..15u8`
22:44:37FromDiscord<Elegantbeef> Then you'd only be allowed to use 0..15
22:45:12FromDiscord<πŸ‘Ύ br4n_d0n> Lol, so you're setting a range, but does that actually equate to a smaller size?
22:45:24FromDiscord<Elegantbeef> the `bitsize` is the important part
22:45:29FromDiscord<Elegantbeef> it forces it to be 4 bits
22:46:45FromDiscord<Elegantbeef> But if you only have a single field that's 4 bits the system is still going to allocate 8 cause it cannot allocate fewer
22:46:51FromDiscord<Elegantbeef> Like i said welcome to 8bit words
22:47:13FromDiscord<πŸ‘Ύ br4n_d0n> Yeah, but you can have 2 nibbles then
22:48:05FromDiscord<exelotl> lol I've been packing bits today a lot :p
22:48:14FromDiscord<haskellandchill> lots of warnings but appears to have worked
22:48:28FromDiscord<πŸ‘Ύ br4n_d0n> BTW, what are ``{. word .}`` in Nim so I can look up the documentation?
22:48:45FromDiscord<πŸ‘Ύ br4n_d0n> (edit) "are" => "is the term for"
22:49:13FromDiscord<exelotl> @πŸ‘Ύ br4n_d0n they're pragmas: https://nim-lang.org/docs/manual.html#pragmas
22:49:16FromDiscord<Elegantbeef> pragma
22:49:21FromDiscord<πŸ‘Ύ br4n_d0n> Thanks
22:49:46FromDiscord<haskellandchill> I can run tests with koch, some are failing, maybe I need setup
22:51:22FromDiscord<haskellandchill> I believe related to libgc.dylib
22:53:04FromDiscord<haskellandchill> I have libgc so curious
22:53:17FromDiscord<Elegantbeef> Eh i just pretend like test failures dont exist
22:53:29FromDiscord<Elegantbeef> If you arent contributing there isnt much reason to be concerned
22:57:00FromDiscord<haskellandchill> I'm not concerned and yeah it's beyond me I'm not great at C can't figure out how to link libgc
23:01:14FromDiscord<haskellandchill> more important to me is drnim
23:01:17FromDiscord<haskellandchill> I have z3
23:01:21FromDiscord<haskellandchill> but apparently not libz3
23:02:28FromDiscord<haskellandchill> > clang: error: no such file or directory: 'dist/z3/build/libz3.a'
23:02:40FromDiscord<haskellandchill> I take it I need to build z3 from source and put something where it's looking
23:03:19FromDiscord<Elegantbeef> Depending on your distro you'll have `libz3.a`
23:03:19FromDiscord<haskellandchill> oh what do you know it has z3 in dist already
23:03:49FromDiscord<haskellandchill> hm yeah I think I just have the executable on my path from homebrew which isn't good enough
23:04:04FromDiscord<Elegantbeef> Ah no clue for mac
23:04:16*kayabaNerve joined #nim
23:05:49FromDiscord<haskellandchill> I think I can build z3 from the provided dist/z3
23:06:58FromDiscord<Elegantbeef> you can probably do `libz3-dev` or whatever your package manager calls dev packages to get static libraries but idk
23:07:23FromDiscord<haskellandchill> nah homebrew sucks
23:21:41FromDiscord<haskellandchill> hm it wants a libz3.a but I have a libz3.dylib
23:22:55FromDiscord<Elegantbeef> `.a` is a static library
23:23:10FromDiscord<Elegantbeef> .dylib ia dynamic
23:24:22FromDiscord<haskellandchill> yea last shot is `--staticlib` option
23:26:27FromDiscord<haskellandchill> I wish there was a book called How to Build Anything that teaches you this stuff
23:28:35FromDiscord<haskellandchill> nice I got it
23:29:42FromDiscord<haskellandchill> hot damn I think it works
23:31:01FromDiscord<haskellandchill> sweet
23:31:04FromDiscord<haskellandchill> sent a code paste, see https://play.nim-lang.org/#ix=40z7