<< 02-01-2022 >>

00:02:10*Gustavo6046 quit (Ping timeout: 260 seconds)
00:02:11FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Ktn
00:03:38FromDiscord<Elegantbeef> you can `export sqlite` if you need
00:03:38FromDiscord<Elegantbeef> What's the error without the import?
00:05:19FromDiscord<Isofruit> sent a long message, see http://ix.io/3Kts
00:05:49FromDiscord<Isofruit> At least I assume it#s trying to use std/sqlite3
00:06:12FromDiscord<Isofruit> (edit) "std/sqlite3" => "std/db_sqlite3"
00:06:26FromDiscord<Isofruit> (edit) "http://ix.io/3Kts" => "https://paste.rs/U5x"
00:06:33FromDiscord<Isofruit> (edit) "http://ix.io/3Ktv" => "https://paste.rs/clh"
00:07:45FromDiscord<Elegantbeef> `selectAll` is a generic aswell, so `bind select`
00:07:46FromDiscord<Isofruit> Actually, that first definition of select might be from norm/sqlite.... but then it should also recognize that dbConn is of type `DbConn` since norm/sqlite has a `using` statement inside of itself
00:09:55FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Kty
00:10:16FromDiscord<Isofruit> (edit) "https://play.nim-lang.org/#ix=3Kty" => "https://play.nim-lang.org/#ix=3Ktz"
00:10:37FromDiscord<Elegantbeef> What about with `bind select`?
00:10:53FromDiscord<Elegantbeef> I'm guessing no change
00:11:18FromDiscord<Isofruit> sent a long message, see http://ix.io/3KtA
00:11:58FromDiscord<Elegantbeef> Hmmm
00:12:25FromDiscord<Elegantbeef> Might be best to just add the `export sqlite` though i dont know
00:13:17FromDiscord<Isofruit> I'd love for `genericArticleRepository.nim` to provide the functions from norm/sqlite so that in all the other `.nim` files that will import that module, I'll no longe rhave to manually import `norm/sqlite`
00:13:41FromDiscord<Elegantbeef> I just told you to do that
00:13:59FromDiscord<Elegantbeef> You can export modules from modules
00:14:02FromDiscord<Isofruit> ... I really do notice it's 1 am once more
00:14:16FromDiscord<Isofruit> okay, let me read up a bit on export first, then I'll try that one
00:14:30FromDiscord<Elegantbeef> if you just do `export sqlite` in your one module it'll export all symbols from `sqlite` to other modules
00:17:00FromDiscord<Isofruit> Alright, and I can do export sqlite instead of export norm/sqlite because my import norm/[sqlite, model] statement has already brought "sqlite" into my scope, so I already have the module flying around and can thus just grab it by the name and export it
00:17:13FromDiscord<Elegantbeef> Correct!
00:17:29FromDiscord<Isofruit> (edit) "export sqlite" => "`export sqlite`" | "export norm/sqlite" => "`export norm/sqlite`" | "import" => "`import" | "model]" => "model]`"
00:18:15FromDiscord<Isofruit> Man, this feels like learning async coding again / learning how to use rxjs, head swirls a bit but slowly the individual bobs make sense
00:18:37FromDiscord<Isofruit> Thank you so much for the advice!
00:19:04FromDiscord<Elegantbeef> No problem
00:23:13FromDiscord<Isofruit> I wonder if writing C is like this, but with extra memory chaos on top
00:23:32FromDiscord<Elegantbeef> Nah C is simpler, no generics, no modules, no overloads
00:23:40FromDiscord<Elegantbeef> forgot the last no, which is no fun
00:24:25FromDiscord<Isofruit> .... overloads is the one thing that allows me to make the entire fetching of DB stuff through norm generic, I shudder to think if that weren't a thing
00:24:35FromDiscord<Isofruit> And the "no modules" thing seems like utter murder
00:24:43FromDiscord<Elegantbeef> you'd manually overload doing `doSomething_MyType`
00:25:25FromDiscord<Elegantbeef> I mean that's just how C is
00:25:40FromDiscord<Elegantbeef> Zig adds a few niceties ontop of what C has but is also still pretty primitive
00:27:34FromDiscord<Elegantbeef> random language facts no one asked for
00:29:49FromDiscord<Isofruit> It's nice to see, I've really not spent much time in languages that go this deep, I've made a living off of python, JS/TS, Groovy and Java so far, so getting to know more in that space is really interesting
00:30:21FromDiscord<Isofruit> I've, e.g. heard D so far only by name, really no idea what's behind it other than that it's also low level. I likely could look at it to get a deeper idea, but I've got my hands full with nim atm either wy
00:30:23FromDiscord<Isofruit> (edit) "wy" => "way"
00:47:32FromDiscord<Isofruit> Huh, decorating a piece of code with try catch through a template works pretty easily, nice
01:01:59FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3Ku2
01:02:46FromDiscord<kaddkaka> `for n in numbers:` yields immuatables
01:02:54FromDiscord<Elegantbeef> `.mitems`
01:04:36FromDiscord<kaddkaka> right, also, why does `pairs` seem to be optional? Is there a difference between `for i, n in pairs numbers:` and `for i, n in numbers:`?
01:04:49FromDiscord<Elegantbeef> `x, y` implicitly calls `pairs`
01:04:54FromDiscord<Elegantbeef> `x` calls `items`
01:16:21FromDiscord<kaddkaka> how does nim select between tuple unpacking and implicitly calling pairs? Is it noy possible to get implicit `pairs` for a sequence like `var numbers = @[(1, 2), (5, 7), (15, 18)]`?
01:16:28FromDiscord<kaddkaka> (edit) "noy" => "not"
01:16:43FromDiscord<Elegantbeef> `for (x, y) in numbers` if you want to unpack them
01:16:50FromDiscord<Elegantbeef> otherwise you'll get `index, tuple`
01:19:32FromDiscord<kaddkaka> oh right, not if I ust `mitems` though, then I can unpack without parentheses
01:19:37FromDiscord<kaddkaka> (edit) "ust" => "use"
01:20:21FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3Kub
01:20:40FromDiscord<kaddkaka> (edit) "https://play.nim-lang.org/#ix=3Kub" => "https://paste.rs/tCc"
01:20:56FromDiscord<kaddkaka> which seems surprising to me
01:21:44FromDiscord<Elegantbeef> The above works or doesnt?
01:21:49FromDiscord<kaddkaka> it works
01:22:10FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3Kud
01:22:23FromDiscord<Elegantbeef> Didnt expect it
01:22:24FromDiscord<Elegantbeef> Interesting
01:25:04FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3Kuf
01:25:30FromDiscord<Elegantbeef> Should be a proper error but it's not safe
01:25:54FromDiscord<kaddkaka> which is also strange, maybe? I'm too new Nimmer to know if I'm doing stupid stuff ^^'
01:26:19FromDiscord<kaddkaka> whats wrong/incorrect in the above snippet?
01:27:51FromDiscord<Elegantbeef> `mitems` yields `var (int, int)`
01:28:30FromDiscord<Elegantbeef> You cannot presently get what you want
01:29:33FromDiscord<ajusa> how do I parse an ISO8601 date? `"yyyy-MM-dd'T'HH:mm:ss'.'ffffff'Z'"`?
01:32:25FromDiscord<Elegantbeef> The issue is you'd need something to yield `(int, var int)`
01:32:38FromDiscord<Elegantbeef> sorry `(int, var (int, int))`
01:32:57FromDiscord<kaddkaka> In reply to @Elegantbeef "You cannot presently get": Hmm, ok, so no way to chain/combine mitems and pairs?
01:32:59FromDiscord<Elegantbeef> Which is not possible without `views`
01:33:30FromDiscord<kaddkaka> ok, I saw that being mentioned here before, is that a new language construct being worked on?
01:34:03FromDiscord<Elegantbeef> Yes presently it's experimental
01:34:45FromDiscord<kaddkaka> I would have expected `numbers.mitems.pairs` to maybe work, but pairs does accept an iterable I think (`expression 'mitems(numbers)' is of type: iterable[var (int, int)]`)
01:35:05FromDiscord<Elegantbeef> Checkout `std/enumerat`
01:35:15FromDiscord<Elegantbeef> `std/enumerate`
01:36:35FromDiscord<kaddkaka> (edit) "does" => "doesn't"
01:39:37FromDiscord<kaddkaka> Why does enumerate require `std/` ( `import std/enumerate`) while for example `import sequtils` works?
01:41:09FromDiscord<Elegantbeef> Legacy support, all stdlib should require `std` but for legacy support they dont
01:42:46FromDiscord<kaddkaka> ok
01:48:06FromDiscord<ajusa> In reply to @ajusa "how do I parse": oh god chrono doesn't support fractional timestamps in ISO8601, this is painful
01:48:57FromDiscord<kaddkaka> Looking at `enumerate`: I guess macros don't follow UFCS?
01:49:32FromDiscord<Elegantbeef> It's a for loop macro so no it does not
01:52:48FromDiscord<kaddkaka> Does that mean that other kinds of macros can support UFCS?
01:52:57FromDiscord<Elegantbeef> Yes
02:03:47*bkay joined #nim
02:04:39FromDiscord<Alea> do you use .add() for sets?
02:04:39*beshr quit (Ping timeout: 256 seconds)
02:04:58FromDiscord<Rosen> .incl() I think
02:06:47*noeontheend joined #nim
02:07:05FromDiscord<kaddkaka> In reply to @Elegantbeef "Yes": Thanks for all the help, time to sleep 😴
02:36:37*noeontheend quit (Ping timeout: 240 seconds)
03:12:29nrds<Prestige99> Are there ways to have an error throw when some number is divided by zero, instead of returning infinity?
03:13:10FromDiscord<Rika> Huh I thought Nim did raise on divide by zero
03:13:48nrds<Prestige99> So did i
03:14:18nrds<Prestige99> https://play.nim-lang.org/#ix=3KuW
03:14:49FromDiscord<Rika> Ah that’s a constant probably because of that
03:14:55*arkanoid quit (Ping timeout: 256 seconds)
03:15:04FromDiscord<Rika> Even on let though huh
03:15:21FromDiscord<Rika> Dunno 😃
03:15:28nrds<Prestige99> Threw me for a loop
03:15:45FromDiscord<Rika> Throw you a for loop? Okay
03:15:52FromDiscord<Rika> (It’s a joke)
03:28:02nrds<Prestige99> Also was unaware we could not forward declare a template?
03:29:03FromDiscord<Elegantbeef> There is n oreason to
03:29:16nrds<Prestige99> good point
03:58:50FromDiscord<creikey> sent a code paste, see https://play.nim-lang.org/#ix=3Kv7
03:58:56FromDiscord<creikey> why does parallel think that `spawn findWinLosses` is discarded?
04:01:48FromDiscord<Rika> Can you put this in a paste? I can’t read it because of the indent level
04:03:00FromDiscord<Rika> Ah I don’t see a problem here though I don’t use spawn often
04:03:32FromDiscord<Elegantbeef> I have a hypothesis so let's see 😀
04:04:21FromDiscord<Elegantbeef> It might be the assignment to a variable through `[]=`
04:04:35FromDiscord<creikey> I see parallel requires that it's an array/sequence indexed by integers
04:04:35FromDiscord<Rika> Yeah that’s one guess
04:05:02FromDiscord<creikey> I refactored it to be like that but parallel froze (some kind of race condition?) so I'm changing it to be spawn since parallel is experimental
04:16:18FromDiscord<creikey> sent a code paste, see https://play.nim-lang.org/#ix=3Kvt
04:16:22FromDiscord<creikey> how do I make it execute at the same time
04:16:31FromDiscord<Elegantbeef> `^` is blocking
04:16:40FromDiscord<creikey> right but while it's blocking for that shouldn't the other threads be executing?
04:16:46FromDiscord<creikey> or am I missing somethign
04:16:48FromDiscord<creikey> (edit) "somethign" => "something"
04:17:01FromDiscord<Elegantbeef> put a `sync()` after the first for loop
04:17:51FromDiscord<Elegantbeef> I havent used `spawn` or `parallel` so i'm just going off the examples and what i read
04:17:53FromDiscord<creikey> In reply to @Elegantbeef "put a `sync()` after": still happening one by one
04:18:18FromDiscord<creikey> the process is consuming 43% of 4 core 8 thread cpu and a lot of memory https://media.discordapp.net/attachments/371759389889003532/927053161317928980/unknown.png
04:18:27FromDiscord<creikey> memory might just be other stuff in the program though
04:18:37FromDiscord<creikey> well I mean it shouldn't be that much I dunno
04:18:46FromDiscord<creikey> maybe it's the garbage collector for each thread
04:18:49FromDiscord<Elegantbeef> References are deeply copied
04:18:50FromDiscord<creikey> of which 157 were spawned
04:19:00FromDiscord<creikey> In reply to @Elegantbeef "References are deeply copied": `findWinLosses(champ1: string, champ2: string, games: seq[Game])
04:19:01FromDiscord<creikey> (edit) "seq[Game])" => "seq[Game])`"
04:19:02FromDiscord<creikey> no refs
04:19:03FromDiscord<Elegantbeef> you can do `--gc:orc` after if that's concerning
04:19:16FromDiscord<creikey> seq isn't copied right
04:19:18FromDiscord<creikey> it's only read
04:19:19FromDiscord<creikey> (edit) "it's only read ... " added "from"
04:19:31FromDiscord<Elegantbeef> It hopefully isnt but idk
04:20:50FromDiscord<creikey> I guess I'll try a release build?
04:20:54FromDiscord<creikey> no idea what's going on
04:21:02FromDiscord<creikey> release build seems like multiple things are happening at once maybe
04:21:04FromDiscord<creikey> yeah
04:21:10FromDiscord<creikey> but it's only like two things
04:21:27FromDiscord<creikey> have to say not impressed with nim's thread pool so far
04:21:56FromDiscord<creikey> I'm definitely doing something wrong though
04:22:06FromDiscord<Yardanico> In reply to @creikey "have to say not": threadpool is kind of abandoned, so yes
04:22:16FromDiscord<creikey> In reply to @Yardanico "threadpool is kind of": only use `parallel:` or what?
04:22:26FromDiscord<Yardanico> parallel is a part of threadpool too and it's kind of abandoned as well :)
04:22:38FromDiscord<creikey> what is the new way of doing parallelism in nim that they've abandoned into
04:22:51FromDiscord<Yardanico> well you can always use the traditional threads way
04:23:19FromDiscord<Yardanico> current new things are arc/orc and they have shared heap, destructors, move semantics and other things, so threading is kind of reworked for them
04:23:22FromDiscord<Yardanico> e.g. https://github.com/nim-lang/threading
04:23:35FromDiscord<creikey> In reply to @Yardanico "current new things are": arc is that super performant gc right
04:24:06FromDiscord<Yardanico> https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html and https://nim-lang.org/blog/2020/12/08/introducing-orc.html
04:24:15FromDiscord<Yardanico> and https://nim-lang.org/docs/destructors.html :)
04:24:32FromDiscord<creikey> wow a year ago and things still aren't stable?
04:24:50FromDiscord<Yardanico> well they are not 100% compatible with refc
04:25:09FromDiscord<Yardanico> orc is supposed to become default in 2.0 which will probably be the next release after 1.6, but I don't know for sure
04:26:39FromDiscord<Yardanico> but for most stuff ORC is already perfectly usable
04:30:09FromDiscord<Yardanico> also there's weave https://github.com/mratsim/weave, but seems like Status is making another lib which has some code from it (and mratsim seems like the one developing it mainly) - https://github.com/status-im/nim-taskpools
04:30:19FromDiscord<Yardanico> taskpools seems like it's pretty early in development though
04:30:41FromDiscord<creikey> weave is a work of art but idk if I want to add a nimble dependency
04:33:52*arkurious quit (Quit: Leaving)
04:45:21FromDiscord<creikey> can nim thread procs take var arguments?
04:45:50FromDiscord<Elegantbeef> Nope
04:46:42FromDiscord<Elegantbeef> You'd need to pass a `ptr`
04:46:46FromDiscord<creikey> In reply to @Elegantbeef "Nope": so how can I get data from a thread
04:46:50FromDiscord<creikey> In reply to @Elegantbeef "You'd need to pass": I see
04:47:09FromDiscord<creikey> In reply to @Elegantbeef "You'd need to pass": I remember reading this somewhere on the threadpool docs but thought it was just for those not all threads
04:47:17FromDiscord<creikey> https://nim-lang.org/docs/threads.html this says nothinga bout that
04:47:19FromDiscord<creikey> (edit) "nothinga bout" => "nothing about"
04:47:50FromDiscord<Elegantbeef> Well `var T` isnt type valid outside of iterators and parameters
04:47:58FromDiscord<Elegantbeef> So `Thread[var int]` isnt valid
04:48:15FromDiscord<Elegantbeef> Dont know if it will be eventuall
04:49:42FromDiscord<Yardanico> In reply to @creikey "so how can I": channels or global variables + locks (with arc/orc)
04:49:52FromDiscord<creikey> ah yeah forgot about channels
04:49:53FromDiscord<Yardanico> also ptrs too but you need locks anyway
04:50:09FromDiscord<creikey> for ptrs you wouldn't need a lock if it's setting separate memory right?
04:50:30FromDiscord<Yardanico> if each thread gets separate memory location, then sure
04:55:35FromDiscord<creikey> In reply to @Yardanico "if each thread gets": new fun fact: this does not seem to be true
04:55:40FromDiscord<Yardanico> ?
04:55:50FromDiscord<creikey> sent a code paste, see https://play.nim-lang.org/#ix=3Kw2
04:55:55FromDiscord<creikey> ah wait
04:56:00FromDiscord<creikey> same thread object for both threds
04:56:01FromDiscord<creikey> (edit) "threds" => "threads"
04:56:47FromDiscord<creikey> no stacktrace or anything though just says execution failed
04:59:19FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/B9A
04:59:21FromDiscord<Elegantbeef> With both `arc` and `refc`
05:02:40FromDiscord<creikey> sent a code paste, see https://paste.rs/Y89
05:02:47FromDiscord<creikey> I did
05:20:32*arkanoid joined #nim
05:28:30FromDiscord<congusbongus> How can I check if homebrew is installed in nimscript?
05:29:37FromDiscord<Elegantbeef> `findExe`
05:32:28FromDiscord<congusbongus> `findExe("brew") != ""` works!
05:35:43*kayabaNerve quit (Remote host closed the connection)
05:36:12*kayabaNerve joined #nim
06:07:38FromDiscord<Casey.McMahon> sent a code paste, see https://play.nim-lang.org/#ix=3Kx1
06:08:15FromDiscord<Elegantbeef> Do you need the `<>`?
06:12:29FromDiscord<Elegantbeef> You are sending a char through the uart right?
06:13:32FromDiscord<Casey.McMahon> usb serial
06:13:55FromDiscord<Casey.McMahon> Sorry, my usb got all screwed up, had to reboot my computer
06:55:45FromDiscord<Esther> Is it normal that windows defender complains about finish.exe in the nim zip from the website?
06:56:07FromDiscord<Elegantbeef> Ideal not, but it's "normal"
06:56:24FromDiscord<Esther> it's not a good look, hahah
06:57:50FromDiscord<Yardanico> if you are really really scared of windows defender doing false positives you might try https://github.com/nim-lang/nightlies/releases/tag/2021-12-14-version-1-6-48c62ca48bc1f0a0ff4bc891e720297b3e8e5c15
06:57:53FromDiscord<Yardanico> but yes it's just a false positive
07:03:42FromDiscord<Esther> alrighty, thanks
07:23:37*thomasross quit (Ping timeout: 240 seconds)
09:15:37*Vladar joined #nim
09:39:22FromDiscord<dizzyliam> do either of the stdlib regex libraries compile the queries at compile-time?
09:47:48FromDiscord<Yardanico> no, they use pcre so the regexes are compiled at runtime
09:48:06FromDiscord<Yardanico> https://github.com/nitely/nim-regex is pure Nim and can compile regexes at compile time
10:15:21*jjido joined #nim
10:57:23FromDiscord<kaddkaka> In reply to @glyh (Lyhokia) "I'm trying to create": How is it going with the treesitter grammar? According to [the manual](https://nim-lang.org/docs/manual.html#lexical-analysis-operators) `abc=>` is not an oeprator:↵"An operator is any combination of the following characters:"
10:58:04FromDiscord<kaddkaka> (edit) "characters:"" => "characters:"
10:58:28FromDiscord<kaddkaka> (edit) "In reply to @glyh (Lyhokia) "I'm trying to create": How is it going with the treesitter grammar? According to [the manual](https://nim-lang.org/docs/manual.html#lexical-analysis-operators) `abc=>` is not an oeprator:↵"An operator is any combination of the following characters:" => "sent a code paste, see https://play.nim-lang.org/#ix=3Kzi"
10:58:56FromDiscord<kaddkaka> (edit) "https://play.nim-lang.org/#ix=3Kzi" => "https://play.nim-lang.org/#ix=3Kzj"
11:40:06NimEventerNew question by How2: nimble : Warning: Using project local deps mode, see https://stackoverflow.com/questions/70555624/nimble-warning-using-project-local-deps-mode
11:57:11*noeontheend joined #nim
12:05:25*noeontheend quit (Ping timeout: 240 seconds)
12:12:50*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
12:14:53FromDiscord<HJarausch (HJarausch)> Nim development on Android. Since a few weeks, if I build Nim development on Termux(Android), the build process succeeds but when I invoke Nim, it fails with loading.
12:16:55FromDiscord<Yardanico> is there any error?
12:18:16FromDiscord<HJarausch (HJarausch)> It can't load... /usr/lib/system.nim, since system.nim has been installed under ... /usr/lib/Nim as are all other files of Nim. How can I fix that the Nim compiler searches system.nim in the wrong place. Many thanks for a hint, Helmut
12:29:50*Vladar quit (Remote host closed the connection)
12:33:25*Vladar joined #nim
12:57:57*jjido joined #nim
13:35:01*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
13:44:26*jjido joined #nim
14:08:24*Vladar quit (Quit: Leaving)
14:12:39FromDiscord<demotomohiro> Did you build Nim from source on termux?
14:16:06*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
14:21:49FromDiscord<demotomohiro> Making symbolic link in the same way as Nim package in termux might fix your problem.↵~ $ ls -l /data/data/com.termux/files/usr/bin/nim↵/data/data/com.termux/files/usr/bin/nim -> ../lib/nim/bin/nim
14:24:16*neurocyte0132889 joined #nim
14:24:16*neurocyte0132889 quit (Changing host)
14:24:16*neurocyte0132889 joined #nim
14:24:44FromDiscord<demotomohiro> usr/lib/nim/bin/nim search for system.nim in usr/lib/nim/lib
14:38:24*PMunch joined #nim
14:38:37*arkurious joined #nim
15:08:56*neurocyte0132889 is now known as neurocyte
15:10:17FromDiscord<Isofruit> ... erm, question.↵So... I have a database containing hashed passwords among other things and I'm in the process of re-building my backend from using python (Django) to using nim (Prologue).↵Now what that also means is that I need to re-build for login purposes how I hash incoming passwords into hashes and compare them with what I have in my database
15:10:36FromDiscord<Isofruit> (edit) "I hash" => "Django hashes"
15:17:20FromDiscord<Isofruit> sent a long message, see http://ix.io/3KCT
15:20:12FromDiscord<enthus1ast> salt is usually concatinated to the input, eiter in front or back, for details i would read the django source
15:20:16PMunchSalt is basically just a little piece of random data appended or prepended to you password to make sure that the same password won't be hashed to the same thing
15:20:31PMunchSo probably just try to add in on either end and run the hashing
15:22:11FromDiscord<planetis> how do i tell nim to search for dynamic library in the same directory as the executable?
15:22:18FromDiscord<Yardanico> that's OS-specific
15:22:24FromDiscord<Yardanico> on linux use LD_LIBRARY_PATH
15:22:27PMunchLD_LIBRARY_PATH=.
15:22:35FromDiscord<planetis> thank you
15:28:24FromDiscord<Isofruit> Thanks (to you as well PMunch)! Yeh I only knew that I needed a salt, not how exactly that was calculated in there. Thanks! I'll check out the source code
15:28:49FromDiscord<Isofruit> (edit) "Thanks (to you as well PMunch)!" => "Thanks!"
15:29:01*neurocyte quit (Ping timeout: 240 seconds)
15:29:03*neurocyte4 joined #nim
15:29:17FromDiscord<Yardanico> In reply to @Isofruit "Thanks! Yeh I only": the main point of using the salt is that even if someone gets access to the hashes, they can't use existing rainbow tables to bruteforce them
15:29:50FromDiscord<Isofruit> Ohhh I had been wandering about that
15:29:55FromDiscord<Yardanico> and they can't really make a new rainbow table since each password has a different salt
15:29:58FromDiscord<Isofruit> (edit) "wandering" => "wondering"
15:30:07FromDiscord<Yardanico> so they have to do bruteforce the slower way
15:30:42FromDiscord<Isofruit> On the one hand, having to re-implement a lot of the stuff Django used to do for me is annoying.↵On the other, it's also pretty educational
15:32:19PMunchI thought Prologue had some login middleware already?
15:33:06FromDiscord<Isofruit> It has a basic auth middleware, I use JWTs↵So I glanced over that middleware and didn't really see anything in there that jumped out to my not-all-that-hashing-wise-trained eye
15:33:15PMunchBut I guess it wouldn't be compatible to Djangos system..
15:33:55FromDiscord<enthus1ast> build it yourself and make pr to Prologues repo \:)
15:34:35FromDiscord<Isofruit> I'll build something alright.↵And then try to generalize it out
15:34:51FromDiscord<Isofruit> Damn, I do not consider myself competent enough to do this, but you gotta be the change you want to see in the world.
15:37:45FromDiscord<Isofruit> Wait a minute
15:38:18FromDiscord<Isofruit> If my Django hashes can contain +, / and = signs, that means they are not just hexadecimal
15:39:10FromDiscord<Isofruit> ... Yeah, I'm seeing the entire alphanumerical space + extra signs in there, wth is that encoded in
15:44:08FromDiscord<Isofruit> Does anyone have a different library or understands how to parse whatever they're computing into a string?
15:44:16FromDiscord<Yardanico> In reply to @Isofruit "... Yeah, I'm seeing": base64
15:44:23FromDiscord<Yardanico> https://nim-lang.org/docs/base64.html
15:45:18FromDiscord<Isofruit> Ah, fair, my brain was so settled on hex since the SHA256 lib offers a function for that
15:46:27FromDiscord<Isofruit> But yeah, this is what that library outputs, not sure what's going wrong there other than that the letter encoding doesn't seem to be working well https://media.discordapp.net/attachments/371759389889003532/927226340409749534/Screenshot_from_2022-01-02_16-45-20.png
15:47:03FromDiscord<Yardanico> you're trying to print binary data
15:47:06FromDiscord<enthus1ast> these are the plain bytes outputted to the terminal
15:47:18FromDiscord<Yardanico> that's why base64 is used in cases like this
15:47:25FromDiscord<Yardanico> to encode this binary data in printable ASCII characters
15:47:55FromDiscord<Isofruit> OH IT OUTPUTS the raw binaries... as string?
15:48:13FromDiscord<Yardanico> raw bytes, yes
15:48:19FromDiscord<Yardanico> it's a hash after all
15:48:32FromDiscord<Yardanico> the typical sha256 representation that you see is actually a hex representation of the bytes
15:49:30FromDiscord<Isofruit> Hmmmm
15:50:42FromDiscord<enthus1ast> and you should also do the repetitions on the binary data, then when you're done output as base64 and store in database
15:51:15PMunchHow do I write a format for times.parse to handle a string like this: 2022-01-03T06:00:00.000+0000
15:51:46FromDiscord<enthus1ast> is this iso date?
15:51:49PMunchI tried yyyy-MM-ddTHH:mm:ss.fff+zzzz but it complains that Error: unhandled exception: 'T' is not a valid pattern [TimeFormatParseError]
15:52:08FromDiscord<enthus1ast> extra chars must be escaped
15:52:11FromDiscord<Yardanico> In reply to @PMunch "I tried yyyy-MM-ddTHH:mm:ss.fff+zzzz but": you need to escape T
15:52:25FromDiscord<Yardanico> > Other strings can be inserted by putting them in ''
15:52:27FromDiscord<Yardanico> so 'T'
15:52:34PMunchI tried to escape the T, then it said that ' ' was not a format
15:53:05FromDiscord<enthus1ast> https://github.com/nim-lang/Nim/blob/afa4bc34b41307c6c63e8c7c973afe295e9fedd8/lib/pure/times.nim#L2168
15:53:33PMunchWhy the T and not the - and :?
15:53:54FromDiscord<Yardanico> "The following characters can be inserted without quoting them: : - ( ) / [ ] ,"
15:53:56FromDiscord<Yardanico> :P
15:55:58FromDiscord<Yardanico> also you should use ZZZ instead of zzzz without inserting + yourself
15:56:03FromDiscord<Yardanico> let dt = parse("2022-01-03T06:00:00.000+0000", "yyyy-MM-dd'T'HH:mm:ss'.'fffZZZ")
15:59:21FromDiscord<Isofruit> Hmmm
15:59:36FromDiscord<Isofruit> well, I'm getting a decent hash as output at least, which is really good!
16:00:10FromDiscord<Isofruit> I'm just not getting the correct hash =/↵I'll need to take a look at the django source again
16:00:21FromDiscord<Isofruit> `encode($computeSHA256(plainpw&salt, 180000))`↵That at least get's me where I want to go
16:00:29FromDiscord<Yardanico> do you require using 100% same hash as django ?
16:00:30FromDiscord<Yardanico> any reason why?
16:01:14FromDiscord<Yardanico> also obviously you will never get the same hash if you use random salts
16:01:16FromDiscord<Isofruit> Well, my current db is hosted via Django
16:01:32FromDiscord<Yardanico> oh you want to use an existing db
16:01:35FromDiscord<Isofruit> I effectively have around 20 entries that I need to be able to "recreate"
16:01:56FromDiscord<Isofruit> My usebase is like 6 people so that works out for me
16:03:09FromDiscord<Yardanico> also django is sha256 + PBKDF2
16:03:11FromDiscord<Yardanico> not just sha256
16:04:00FromDiscord<Isofruit> Wait that's a difference?
16:04:03FromDiscord<Yardanico> yes
16:04:06FromDiscord<Yardanico> https://github.com/cheatfate/nimcrypto can do both sha256 and pbkdf2
16:04:06FromDiscord<Isofruit> Dangit
16:04:31*kenran joined #nim
16:05:37FromDiscord<Isofruit> huh
16:05:38FromDiscord<Isofruit> er
16:05:58FromDiscord<Isofruit> I guess I'll brute force which combination of sha256, pbkdf2 and 18000 repetitions gives me my hashes ?
16:06:12FromDiscord<Isofruit> or get the django implementation, anyway
16:06:23FromDiscord<Isofruit> (edit) "or get ... the" added "a look at"
16:07:13PMunchWell that's just super confusing :P
16:09:09FromDiscord<enthus1ast> django can use multiple algos not just pbkdf2
16:09:10FromDiscord<enthus1ast> https://github.com/django/django/blob/b0d16d0129b7cc5978a8d55d2331a34cb369e6c7/django/contrib/auth/hashers.py
16:09:18FromDiscord<enthus1ast> also argon2
16:09:23FromDiscord<Yardanico> yes but pbkdf2 is the default
16:09:45FromDiscord<Isofruit> I Just double checked my settings.py file, I have not changed the default, it's pbkdf2
16:09:56FromDiscord<Isofruit> With sha 256
16:10:20PMunchHmm, I wish there was a compare thing in times that could ignore parts of the DateTime..
16:10:29PMunchI guess I could just zero out those parts
16:10:54FromDiscord<Isofruit> Hm? You mean for parsing in?
16:10:57FromDiscord<Isofruit> Or for what?
16:15:11*PMunch quit (Quit: leaving)
16:31:23NimEventerNew thread by Freeflow: Links to Std library lead to a 404, see https://forum.nim-lang.org/t/8761
16:49:27FromDiscord<Shiba> https://media.discordapp.net/attachments/371759389889003532/927242194396528650/20220102_174846.JPG
16:49:31FromDiscord<Shiba> How does tht count as an error
16:49:52nrds<Prestige99> ints can't be nil
16:50:10FromDiscord<Yardanico> In reply to @Shiba "": Nim value types are not "boxed"
16:50:16FromDiscord<Yardanico> ints are only numbers, they can't be nil
16:50:37FromDiscord<Shiba> Theb how i can check if an index in a tuble is nil
16:50:44FromDiscord<Shiba> (edit) "Theb" => "Then"
16:50:49FromDiscord<Yardanico> ??
16:51:00FromDiscord<Yardanico> can you explain what you want to do in this procedure?
16:51:03FromDiscord<Yardanico> what is it supposed to do
16:51:11FromDiscord<Yardanico> and please paste code as text or at least as screenshots (not as photos)\
16:51:12FromDiscord<Yardanico> (edit) "photos)\" => "photos)"
16:52:09FromDiscord<Shiba> Wait so myabe if i have a seq with @[2,5] and i wantvto check if index 3 of thta seq is nil or declared
16:52:22FromDiscord<Shiba> (edit) "wantvto" => "want to"
16:52:26FromDiscord<Yardanico> that's now how you do that in Nim
16:52:30FromDiscord<Yardanico> you check the length of the sequence
16:52:55FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3KEg
16:52:59FromDiscord<Yardanico> myseq[2] is the third element in the seq
16:54:06FromDiscord<Shiba> I thought it works the same as lua, 😶
16:54:27FromDiscord<Yardanico> nim is not lua
16:54:28FromDiscord<Solitude> why would it
16:54:32FromDiscord<Shiba> But it's ok
16:57:59FromDiscord<apahl> @Yardanico: re your help yesterday with the LD_LIBRARY_PATH issue - I got it working.↵Had to play around a bit with the link paths for the compiler, but now I have a nice application using only Nim, marcomq's Webview and my bindings to the RDKit C++ toolkit:
16:58:07FromDiscord<apahl> https://media.discordapp.net/attachments/371759389889003532/927244378576142346/unknown.png
16:58:11FromDiscord<Yardanico> wow, nice :)
16:58:44FromDiscord<apahl> Yes, I am quite happy as well. 😆
17:22:25FromDiscord<treeform> In reply to @Isofruit "Quick confirmation question regarding": Yes that is correct.
17:23:04FromDiscord<treeform> In reply to @Isofruit "Wait a minute, treeform": Yeah I am here most days. My work is 100% Nim and I am in this channel a lot.
17:23:45FromDiscord<treeform> In reply to @soundmodel "so I wonder if": Nimble can be very strange, I recommend to uninstall and reinstall what you need if stuff does not work or does not update.
17:25:09FromDiscord<treeform> In reply to @soundmodel "I also don't understand": Yeah that's just how templates work.
17:26:36FromDiscord<treeform> See here a slide from my upcoming talk: https://media.discordapp.net/attachments/371759389889003532/927251544565485638/unknown.png
17:27:29FromDiscord<treeform> Let me know if I can explain it better.
17:27:58*jjido joined #nim
17:28:16FromDiscord<treeform> In reply to @apahl "": How do you generate the image of the molecule?
17:32:55FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=3KFe
17:34:18FromDiscord<apahl> @treeform : RDKit provides a toSVG method that I use. But the toolkit can also generate PNGs via cairo.
17:34:44FromDiscord<treeform> In reply to @enthus1ast "<@107140179025735680>\: what could it": This was this bug right? https://github.com/treeform/netty/issues/25
17:36:07FromDiscord<treeform> In reply to @Isofruit "God I love the": Thanks! I am glad you found jsony useful.
17:37:11FromDiscord<treeform> In reply to @apahl "<@!107140179025735680> : RDKit provides": Neat! RDKit looks like a huge project.
17:38:26*Kit joined #nim
17:38:57*Kit left #nim (WeeChat 3.0.1)
17:40:22FromDiscord<apahl> It definitely is. I use it a lot, mostly via the Python bindings, but I always wanted to try out some bindings to other compiled languages as well. And from everything I have tried so far, generating bindings from Nim works best.
17:58:00*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
18:09:38NimEventerNew thread by Keks84: Help with metaprogramming, see https://forum.nim-lang.org/t/8762
18:12:51*systemdsucks quit (Remote host closed the connection)
18:14:42*jjido joined #nim
18:24:18FromDiscord<Isofruit> What'll be funny is implementing some sort of system equivalent to Django's signal system
18:37:14*Gustavo6046 joined #nim
18:38:49*thomasross joined #nim
18:38:53*thomasross quit (Remote host closed the connection)
18:54:28FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3KGT
18:54:59FromDiscord<kaddkaka> What's the canonical way of writing the above fold?
18:55:49FromDiscord<kaddkaka> (edit) "What's the canonical way" => "Are there other (preferred/reasonable) ways"
18:58:14FromDiscord<Solitude> In reply to @kaddkaka "Why the asymmetry between": https://nim-lang.org/docs/sequtils.html#allIt.t%2Cuntyped%2Cuntyped
19:00:26FromDiscord<kaddkaka> In reply to @Solitude "https://nim-lang.org/docs/sequtils.html#allIt.t%2Cu": ah so there was an option! Perhaps surprising that it uses `it` and not `a`.
19:01:00FromDiscord<Solitude> look at other thingIt templates
19:01:45FromDiscord<kaddkaka> I understand and guessed that it matches other `It` templates. But why is `foldl ` the odd one out
19:02:43FromDiscord<Solitude> rewrite foldl with `it` and `that`
19:02:47FromDiscord<Shiba> sent a code paste, see https://play.nim-lang.org/#ix=3KH6
19:02:55FromDiscord<huantian> I like `this` and `that` better :P
19:03:00FromDiscord<Shiba> (edit) "https://play.nim-lang.org/#ix=3KH6" => "https://play.nim-lang.org/#ix=3KH7"
19:03:06FromDiscord<Solitude> even better
19:03:19FromDiscord<kaddkaka> `sum` and `it`?
19:03:37FromDiscord<kaddkaka> `result` and `it`?
19:03:38FromDiscord<huantian> `cum` would probably be broader
19:07:34FromDiscord<kaddkaka> Suggestion `all` and `any `
19:07:49FromDiscord<kaddkaka> (edit) "`any `" => "`any` could have identity function as default proc."
19:08:51FromDiscord<Solitude> cool, why would you call them then
19:11:36FromDiscord<kaddkaka> @Solitude is the case?re a shorter way in that
19:11:41FromDiscord<kaddkaka> (edit) "the case?re" => "there" | "that" => "that?"
19:11:45FromDiscord<kaddkaka> (edit) "that?" => "that case?"
19:12:35FromDiscord<Solitude> what
19:13:20FromDiscord<Shiba> sent a code paste, see https://play.nim-lang.org/#ix=3KHf
19:13:52FromDiscord<Solitude> sorry, telepathy machine broke, wanna show actual error?
19:14:55FromDiscord<kaddkaka> In reply to @Solitude "what": My idea was to be able to reduce a seq like this:↵`any(@[true, true, false])`
19:15:05FromDiscord<Rosen> In reply to @Shiba "I don't understand why": what is `points`
19:15:23FromDiscord<kaddkaka> And skip the identity procedure `(a) => a`
19:16:15FromDiscord<Solitude> god gave you `allIt(it)` and you are trying to build hack on hacks
19:16:40FromDiscord<Solitude> you want to have as default argument something that only works on sequences of booleans?
19:17:32FromDiscord<Shiba> ?
19:17:35FromDiscord<kaddkaka> In reply to @Solitude "god gave you `allIt(it)`": That was the suggestion, that's how pythons `and` and `all` behave.
19:17:58FromDiscord<kaddkaka> (although they deal with truthy and falsey values)
19:18:02FromDiscord<Solitude> yes
19:18:09FromDiscord<Shiba> It's a 2d array so i need the index of each element to draw each tile
19:18:24FromDiscord<Shiba> (edit) "It's a 2d array so i need the index of each element to draw each tile ... " added "in it's position"
19:18:27FromDiscord<Solitude> In reply to @kaddkaka "(although they deal with": thats exactly why it doesnt make sense in nim
19:18:46FromDiscord<kaddkaka> could be 👍
19:18:46FromDiscord<Solitude> In reply to @Shiba "It's a 2d array": can you show error?
19:19:16FromDiscord<Shiba> ERROR: index -1 not in 0..49
19:19:28FromDiscord<Shiba> Index defect
19:19:51FromDiscord<el__maco> your array is empty?
19:20:05FromDiscord<kaddkaka> In reply to @Shiba "ERROR: index -1 not": But you are not even indexing anything in the snippet you pasted?
19:23:29FromDiscord<Rosen> To get a decent answer you need to provide enough context for people to understand what's wrong lmao. I'm assuming the dimensions of the array are 50x50? How are you accessing the array inside the loop? Is the type of `points` `array[50, array[50, int]]` or something else?
19:24:32FromDiscord<Shiba> In reply to @Rosen "To get a decent": Yes?
19:25:28FromDiscord<Rosen> the snippet you sent works fine, and that error has to do with accessing the array, so you didn't provide the context needed to understand the problem
19:30:54FromDiscord<Shiba> Ok fixed i was a little dump
19:31:57*noeontheend joined #nim
20:00:13*noeontheend quit (Ping timeout: 240 seconds)
20:14:56*NimBot joined #nim
20:19:27*Goodbye_Vincent joined #nim
20:19:27*kayabaNerve_ joined #nim
20:19:27*kenran joined #nim
20:19:27*mahlon_ joined #nim
20:19:27*nac joined #nim
20:19:27*arkanoid joined #nim
20:19:27*Onionhammer joined #nim
20:19:27*rb joined #nim
20:19:27*neurocyte joined #nim
20:19:27*perro_ joined #nim
20:19:27*jkl1337 joined #nim
20:19:27*dtomato joined #nim
20:19:27*greyrat_ joined #nim
20:19:27*Gustavo6046 joined #nim
20:19:27*jjido joined #nim
20:19:27*arkurious joined #nim
20:19:27*bkay joined #nim
20:19:27*vicecea joined #nim
20:19:27*joast joined #nim
20:19:27*rp3 joined #nim
20:19:27*GnuYawk joined #nim
20:19:27*oprypin joined #nim
20:19:27*cornfeedhobo joined #nim
20:19:27*ldlework joined #nim
20:19:27*redj joined #nim
20:19:27*ehmry joined #nim
20:19:27*oisota joined #nim
20:19:27*nrds joined #nim
20:19:27*Lord_Nightmare joined #nim
20:19:27*def- joined #nim
20:19:27*anadahz joined #nim
20:19:27*sagax joined #nim
20:19:27*tk joined #nim
20:19:27*ozzz joined #nim
20:19:27*xiamx joined #nim
20:19:27*flynn joined #nim
20:19:27*xiamx[m] joined #nim
20:19:27*joshbaptiste joined #nim
20:19:27*averell joined #nim
20:19:27*pippin joined #nim
20:19:27*zacts joined #nim
20:19:27*toothlessgear joined #nim
20:19:27*Jjp137 joined #nim
20:19:27*gshumway joined #nim
20:19:27*dv2 joined #nim
20:19:27*nixfreaknim[m] joined #nim
20:19:27*GreaseMonkey joined #nim
20:19:27*notchris joined #nim
20:19:27*Schnouki joined #nim
20:19:27*blackbeard420 joined #nim
20:19:27*ecs joined #nim
20:19:27*crem joined #nim
20:19:27*tinytoast joined #nim
20:19:27*[R] joined #nim
20:19:27*happycorsair[m] joined #nim
20:19:27*cheer[m] joined #nim
20:19:27*meowray joined #nim
20:19:27*LyndsySimon joined #nim
20:19:27*mikko joined #nim
20:19:27*Ekho joined #nim
20:19:27*euantorano joined #nim
20:19:27*oz joined #nim
20:19:27*Amun-Ra joined #nim
20:19:27*Zevv joined #nim
20:19:27*dv^_^ joined #nim
20:19:27*mjsir911 joined #nim
20:19:27*dom96 joined #nim
20:19:27*adium joined #nim
20:19:27*ormiret joined #nim
20:19:27*madprops joined #nim
20:19:27*lain joined #nim
20:19:27*qwr joined #nim
20:19:27*robertmeta joined #nim
20:19:27*Yardanico joined #nim
20:19:27*koltrast joined #nim
20:19:27*djanatyn joined #nim
20:19:27*NimEventer joined #nim
20:20:15*happycorsair[m] quit (Ping timeout: 268 seconds)
20:20:41*anddam joined #nim
20:21:29*xet7 joined #nim
20:21:35*greyrat_ quit (Ping timeout: 256 seconds)
20:22:01*xiamx[m] quit (Ping timeout: 245 seconds)
20:22:26*cheer[m] quit (Ping timeout: 245 seconds)
20:22:31*nixfreaknim[m] quit (Ping timeout: 250 seconds)
20:22:44*greyrat joined #nim
20:23:23*xiamx quit (Ping timeout: 250 seconds)
20:24:00*nisstyre joined #nim
20:24:45*kenran quit (Quit: WeeChat info:version)
20:25:46*mal`` joined #nim
20:27:17*FromDiscord joined #nim
20:41:00*happycorsair[m] joined #nim
20:53:41*cheer[m] joined #nim
21:01:28FromDiscord<Isofruit> In reply to @Yardanico "https://github.com/cheatfate/nimcrypto can do both": I'm trying to comprehend how hashing in nimcrypto works but I can't really say I'm succeeding.↵So I set up a context object (with a count (?) a state (?) and a buffer (?)), sth sth. digest (?), more unknown steps, out comes the string?↵I don't think I comprehend the documentation or the given examples in there
21:01:51FromDiscord<Isofruit> (edit) "string?↵I" => "string in bytes that I can base64-encode myself?↵I"
21:06:23*vicecea quit (Remote host closed the connection)
21:06:57*vicecea joined #nim
21:18:13FromDiscord<kaddkaka> If anyone would like it give some feedback on my newbie Nim code I would be very thankful: https://github.com/kaddkaka/adventofcode2021/blob/main/day04.nim↵(It's a solution for https://adventofcode.com/2021/day/4)
21:18:32*Gustavo6046_ joined #nim
21:18:58*Gustavo6046 quit (Ping timeout: 260 seconds)
21:28:57*Gustavo6046_ quit (Quit: Leaving)
21:29:09*Gustavo6046 joined #nim
21:35:09*xiamx[m] joined #nim
21:36:36*Gustavo6046 quit (Ping timeout: 245 seconds)
21:41:25*nixfreaknim[m] joined #nim
21:48:54*xiamx[m] quit (Remote host closed the connection)
21:48:54*nixfreaknim[m] quit (Remote host closed the connection)
21:48:54*happycorsair[m] quit (Remote host closed the connection)
21:48:54*cheer[m] quit (Write error: Connection reset by peer)
21:51:50*cheer[m] joined #nim
21:53:52*drewr joined #nim
22:16:50*cheer[m] quit (Quit: Client limit exceeded: 20000)
22:17:13*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
22:17:19*happycorsair[m] joined #nim
22:17:19*xiamx[m] joined #nim
22:17:19*xiamx joined #nim
22:17:19*nixfreaknim[m] joined #nim
22:17:30*xiamx quit (Quit: Client limit exceeded: 20000)
22:18:18*xiamx[m] quit (Quit: Client limit exceeded: 20000)
22:19:46*jjido joined #nim
22:19:48FromDiscord<krisppurg> sent a code paste, see https://play.nim-lang.org/#ix=3KIU
22:20:02*cheer[m] joined #nim
22:20:21*xiamx[m] joined #nim
22:20:22*xiamx joined #nim
22:49:03FromDiscord<Casey.McMahon> sent a code paste, see https://play.nim-lang.org/#ix=3KIZ
22:49:52FromDiscord<Casey.McMahon> sent a code paste, see https://play.nim-lang.org/#ix=3KJ0
23:04:05FromDiscord<hotdog> In reply to @krisppurg "Hiya, Whenever I try": In your json, sticker_items is an array
23:04:20FromDiscord<hotdog> So presumably the type needs to model it as a sew
23:04:27FromDiscord<hotdog> Seq
23:07:39FromDiscord<hotdog> In reply to @Casey.McMahon "is there a way": Haven’t used this command before but you can probably splice the html together if there’s no inbuilt way
23:08:48FromDiscord<Casey.McMahon> I was just going through how the nim compiler builds it's manual and tutorial files, which originates as an `.rst` file
23:09:03FromDiscord<Casey.McMahon> In reply to @hotdog "Haven’t used this command": .
23:09:56FromDiscord<Casey.McMahon> a little confusing, obviously, as it does a whole bunch of other stuff, and isn't documented well
23:10:55*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
23:23:25FromDiscord<Casey.McMahon> I think I'll just use nimibook
23:23:25FromDiscord<Casey.McMahon> https://github.com/pietroppeter/nimibook
23:25:44FromDiscord<geekrelief> I'm using `std/unittest`, and I have a test that wants to check if some code raises an `AssertionDefect` via `raiseAssert`. I realize defects can't be caught, so is there another way to test for failure scenarios?
23:26:32FromDiscord<geekrelief> I guess I could raise an exception instead.
23:29:47FromDiscord<geekrelief> Is it possible to catch an exception coming from a macro?
23:32:39FromDiscord<Isofruit> A macro is merely rendered into your source code at compile time, methinks.↵I'd assume so, since your tests are running after compile time (I think? I'd assume that at least).↵Shouldn't it be possible to just jot down what the fully rendered source code will be and write tests that cover that?
23:32:40FromDiscord<Elegantbeef> No there is not
23:32:44FromDiscord<geekrelief> sent a code paste, see https://paste.rs/iC5
23:33:00FromDiscord<geekrelief> In reply to @Elegantbeef "No there is not": darn thx
23:33:10FromDiscord<Elegantbeef> You should be able to see the defects though with the `expect`
23:33:17FromDiscord<Elegantbeef> https://nim-lang.org/docs/assertions.html#doAssertRaises.t%2Ctypedesc%2Cuntyped
23:33:28FromDiscord<Elegantbeef> You can test with assertions on
23:33:43FromDiscord<Elegantbeef> In some dialects defects are not catchable
23:33:49FromDiscord<geekrelief> ooh thanks for the tip
23:34:13FromDiscord<Elegantbeef> So you can force defects to be catchable i think
23:34:24FromDiscord<Elegantbeef> Not that you should ever do that in real code
23:34:31FromDiscord<Elegantbeef> If you do that in real code i'll find you and break your legs
23:34:35FromDiscord<geekrelief> Right, I'm only doing this for tests
23:34:59FromDiscord<Elegantbeef> That's how it starts!
23:35:19FromDiscord<Elegantbeef> Tests are a gateway drug!
23:35:23FromDiscord<geekrelief> Well you planted the idea in my head, so you started it.
23:36:02FromDiscord<geekrelief> It starts with ideas, turned into words, into actions. It's all your fault!
23:36:32FromDiscord<Elegantbeef> Well it's your knees
23:40:37FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3KJq
23:40:54FromDiscord<Elegantbeef> Wait is this at CT or RT?
23:41:00FromDiscord<geekrelief> at compile time
23:41:19FromDiscord<geekrelief> I want error reporting for my macro
23:42:02*sagax quit (Excess Flood)
23:43:23FromDiscord<Elegantbeef> I think the best thing to do is compile files and check the output
23:43:33FromDiscord<Elegantbeef> Like how the Nim stdlib checks for errors
23:43:51FromDiscord<Elegantbeef> `nim check --hints:off yourFile.nim`
23:44:40FromDiscord<Elegantbeef> On a side note, why are you raising errors in a macro
23:44:50FromDiscord<geekrelief> huh ok, not the end of the world, but I'll keep that in mind. Would be nice to have a test tool that handles that.
23:45:08FromDiscord<geekrelief> I want to give better error reporting.
23:45:20FromDiscord<Elegantbeef> So then use `macros.error`
23:45:33FromDiscord<Elegantbeef> raising errors in macros is terrible
23:46:01FromDiscord<geekrelief> ah, thanks. 🙂 it did feel wrong
23:46:22FromDiscord<Elegantbeef> https://github.com/beef331/slicerator/blob/master/src/slicerator.nim#L206-L211 for an example
23:47:15FromDiscord<geekrelief> gotcha, thx
23:59:24FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3KJA