00:02:10 | * | Gustavo6046 quit (Ping timeout: 260 seconds) |
00:02:11 | FromDiscord | <Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Ktn |
00:03:38 | FromDiscord | <Elegantbeef> you can `export sqlite` if you need |
00:03:38 | FromDiscord | <Elegantbeef> What's the error without the import? |
00:05:19 | FromDiscord | <Isofruit> sent a long message, see http://ix.io/3Kts |
00:05:49 | FromDiscord | <Isofruit> At least I assume it#s trying to use std/sqlite3 |
00:06:12 | FromDiscord | <Isofruit> (edit) "std/sqlite3" => "std/db_sqlite3" |
00:06:26 | FromDiscord | <Isofruit> (edit) "http://ix.io/3Kts" => "https://paste.rs/U5x" |
00:06:33 | FromDiscord | <Isofruit> (edit) "http://ix.io/3Ktv" => "https://paste.rs/clh" |
00:07:45 | FromDiscord | <Elegantbeef> `selectAll` is a generic aswell, so `bind select` |
00:07:46 | FromDiscord | <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:55 | FromDiscord | <Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Kty |
00:10:16 | FromDiscord | <Isofruit> (edit) "https://play.nim-lang.org/#ix=3Kty" => "https://play.nim-lang.org/#ix=3Ktz" |
00:10:37 | FromDiscord | <Elegantbeef> What about with `bind select`? |
00:10:53 | FromDiscord | <Elegantbeef> I'm guessing no change |
00:11:18 | FromDiscord | <Isofruit> sent a long message, see http://ix.io/3KtA |
00:11:58 | FromDiscord | <Elegantbeef> Hmmm |
00:12:25 | FromDiscord | <Elegantbeef> Might be best to just add the `export sqlite` though i dont know |
00:13:17 | FromDiscord | <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:41 | FromDiscord | <Elegantbeef> I just told you to do that |
00:13:59 | FromDiscord | <Elegantbeef> You can export modules from modules |
00:14:02 | FromDiscord | <Isofruit> ... I really do notice it's 1 am once more |
00:14:16 | FromDiscord | <Isofruit> okay, let me read up a bit on export first, then I'll try that one |
00:14:30 | FromDiscord | <Elegantbeef> if you just do `export sqlite` in your one module it'll export all symbols from `sqlite` to other modules |
00:17:00 | FromDiscord | <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:13 | FromDiscord | <Elegantbeef> Correct! |
00:17:29 | FromDiscord | <Isofruit> (edit) "export sqlite" => "`export sqlite`" | "export norm/sqlite" => "`export norm/sqlite`" | "import" => "`import" | "model]" => "model]`" |
00:18:15 | FromDiscord | <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:37 | FromDiscord | <Isofruit> Thank you so much for the advice! |
00:19:04 | FromDiscord | <Elegantbeef> No problem |
00:23:13 | FromDiscord | <Isofruit> I wonder if writing C is like this, but with extra memory chaos on top |
00:23:32 | FromDiscord | <Elegantbeef> Nah C is simpler, no generics, no modules, no overloads |
00:23:40 | FromDiscord | <Elegantbeef> forgot the last no, which is no fun |
00:24:25 | FromDiscord | <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:35 | FromDiscord | <Isofruit> And the "no modules" thing seems like utter murder |
00:24:43 | FromDiscord | <Elegantbeef> you'd manually overload doing `doSomething_MyType` |
00:25:25 | FromDiscord | <Elegantbeef> I mean that's just how C is |
00:25:40 | FromDiscord | <Elegantbeef> Zig adds a few niceties ontop of what C has but is also still pretty primitive |
00:27:34 | FromDiscord | <Elegantbeef> random language facts no one asked for |
00:29:49 | FromDiscord | <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:21 | FromDiscord | <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:23 | FromDiscord | <Isofruit> (edit) "wy" => "way" |
00:47:32 | FromDiscord | <Isofruit> Huh, decorating a piece of code with try catch through a template works pretty easily, nice |
01:01:59 | FromDiscord | <kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3Ku2 |
01:02:46 | FromDiscord | <kaddkaka> `for n in numbers:` yields immuatables |
01:02:54 | FromDiscord | <Elegantbeef> `.mitems` |
01:04:36 | FromDiscord | <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:49 | FromDiscord | <Elegantbeef> `x, y` implicitly calls `pairs` |
01:04:54 | FromDiscord | <Elegantbeef> `x` calls `items` |
01:16:21 | FromDiscord | <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:28 | FromDiscord | <kaddkaka> (edit) "noy" => "not" |
01:16:43 | FromDiscord | <Elegantbeef> `for (x, y) in numbers` if you want to unpack them |
01:16:50 | FromDiscord | <Elegantbeef> otherwise you'll get `index, tuple` |
01:19:32 | FromDiscord | <kaddkaka> oh right, not if I ust `mitems` though, then I can unpack without parentheses |
01:19:37 | FromDiscord | <kaddkaka> (edit) "ust" => "use" |
01:20:21 | FromDiscord | <kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3Kub |
01:20:40 | FromDiscord | <kaddkaka> (edit) "https://play.nim-lang.org/#ix=3Kub" => "https://paste.rs/tCc" |
01:20:56 | FromDiscord | <kaddkaka> which seems surprising to me |
01:21:44 | FromDiscord | <Elegantbeef> The above works or doesnt? |
01:21:49 | FromDiscord | <kaddkaka> it works |
01:22:10 | FromDiscord | <kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3Kud |
01:22:23 | FromDiscord | <Elegantbeef> Didnt expect it |
01:22:24 | FromDiscord | <Elegantbeef> Interesting |
01:25:04 | FromDiscord | <kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3Kuf |
01:25:30 | FromDiscord | <Elegantbeef> Should be a proper error but it's not safe |
01:25:54 | FromDiscord | <kaddkaka> which is also strange, maybe? I'm too new Nimmer to know if I'm doing stupid stuff ^^' |
01:26:19 | FromDiscord | <kaddkaka> whats wrong/incorrect in the above snippet? |
01:27:51 | FromDiscord | <Elegantbeef> `mitems` yields `var (int, int)` |
01:28:30 | FromDiscord | <Elegantbeef> You cannot presently get what you want |
01:29:33 | FromDiscord | <ajusa> how do I parse an ISO8601 date? `"yyyy-MM-dd'T'HH:mm:ss'.'ffffff'Z'"`? |
01:32:25 | FromDiscord | <Elegantbeef> The issue is you'd need something to yield `(int, var int)` |
01:32:38 | FromDiscord | <Elegantbeef> sorry `(int, var (int, int))` |
01:32:57 | FromDiscord | <kaddkaka> In reply to @Elegantbeef "You cannot presently get": Hmm, ok, so no way to chain/combine mitems and pairs? |
01:32:59 | FromDiscord | <Elegantbeef> Which is not possible without `views` |
01:33:30 | FromDiscord | <kaddkaka> ok, I saw that being mentioned here before, is that a new language construct being worked on? |
01:34:03 | FromDiscord | <Elegantbeef> Yes presently it's experimental |
01:34:45 | FromDiscord | <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:05 | FromDiscord | <Elegantbeef> Checkout `std/enumerat` |
01:35:15 | FromDiscord | <Elegantbeef> `std/enumerate` |
01:36:35 | FromDiscord | <kaddkaka> (edit) "does" => "doesn't" |
01:39:37 | FromDiscord | <kaddkaka> Why does enumerate require `std/` ( `import std/enumerate`) while for example `import sequtils` works? |
01:41:09 | FromDiscord | <Elegantbeef> Legacy support, all stdlib should require `std` but for legacy support they dont |
01:42:46 | FromDiscord | <kaddkaka> ok |
01:48:06 | FromDiscord | <ajusa> In reply to @ajusa "how do I parse": oh god chrono doesn't support fractional timestamps in ISO8601, this is painful |
01:48:57 | FromDiscord | <kaddkaka> Looking at `enumerate`: I guess macros don't follow UFCS? |
01:49:32 | FromDiscord | <Elegantbeef> It's a for loop macro so no it does not |
01:52:48 | FromDiscord | <kaddkaka> Does that mean that other kinds of macros can support UFCS? |
01:52:57 | FromDiscord | <Elegantbeef> Yes |
02:03:47 | * | bkay joined #nim |
02:04:39 | FromDiscord | <Alea> do you use .add() for sets? |
02:04:39 | * | beshr quit (Ping timeout: 256 seconds) |
02:04:58 | FromDiscord | <Rosen> .incl() I think |
02:06:47 | * | noeontheend joined #nim |
02:07:05 | FromDiscord | <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:29 | nrds | <Prestige99> Are there ways to have an error throw when some number is divided by zero, instead of returning infinity? |
03:13:10 | FromDiscord | <Rika> Huh I thought Nim did raise on divide by zero |
03:13:48 | nrds | <Prestige99> So did i |
03:14:18 | nrds | <Prestige99> https://play.nim-lang.org/#ix=3KuW |
03:14:49 | FromDiscord | <Rika> Ah that’s a constant probably because of that |
03:14:55 | * | arkanoid quit (Ping timeout: 256 seconds) |
03:15:04 | FromDiscord | <Rika> Even on let though huh |
03:15:21 | FromDiscord | <Rika> Dunno 😃 |
03:15:28 | nrds | <Prestige99> Threw me for a loop |
03:15:45 | FromDiscord | <Rika> Throw you a for loop? Okay |
03:15:52 | FromDiscord | <Rika> (It’s a joke) |
03:28:02 | nrds | <Prestige99> Also was unaware we could not forward declare a template? |
03:29:03 | FromDiscord | <Elegantbeef> There is n oreason to |
03:29:16 | nrds | <Prestige99> good point |
03:58:50 | FromDiscord | <creikey> sent a code paste, see https://play.nim-lang.org/#ix=3Kv7 |
03:58:56 | FromDiscord | <creikey> why does parallel think that `spawn findWinLosses` is discarded? |
04:01:48 | FromDiscord | <Rika> Can you put this in a paste? I can’t read it because of the indent level |
04:03:00 | FromDiscord | <Rika> Ah I don’t see a problem here though I don’t use spawn often |
04:03:32 | FromDiscord | <Elegantbeef> I have a hypothesis so let's see 😀 |
04:04:21 | FromDiscord | <Elegantbeef> It might be the assignment to a variable through `[]=` |
04:04:35 | FromDiscord | <creikey> I see parallel requires that it's an array/sequence indexed by integers |
04:04:35 | FromDiscord | <Rika> Yeah that’s one guess |
04:05:02 | FromDiscord | <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:18 | FromDiscord | <creikey> sent a code paste, see https://play.nim-lang.org/#ix=3Kvt |
04:16:22 | FromDiscord | <creikey> how do I make it execute at the same time |
04:16:31 | FromDiscord | <Elegantbeef> `^` is blocking |
04:16:40 | FromDiscord | <creikey> right but while it's blocking for that shouldn't the other threads be executing? |
04:16:46 | FromDiscord | <creikey> or am I missing somethign |
04:16:48 | FromDiscord | <creikey> (edit) "somethign" => "something" |
04:17:01 | FromDiscord | <Elegantbeef> put a `sync()` after the first for loop |
04:17:51 | FromDiscord | <Elegantbeef> I havent used `spawn` or `parallel` so i'm just going off the examples and what i read |
04:17:53 | FromDiscord | <creikey> In reply to @Elegantbeef "put a `sync()` after": still happening one by one |
04:18:18 | FromDiscord | <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:27 | FromDiscord | <creikey> memory might just be other stuff in the program though |
04:18:37 | FromDiscord | <creikey> well I mean it shouldn't be that much I dunno |
04:18:46 | FromDiscord | <creikey> maybe it's the garbage collector for each thread |
04:18:49 | FromDiscord | <Elegantbeef> References are deeply copied |
04:18:50 | FromDiscord | <creikey> of which 157 were spawned |
04:19:00 | FromDiscord | <creikey> In reply to @Elegantbeef "References are deeply copied": `findWinLosses(champ1: string, champ2: string, games: seq[Game]) |
04:19:01 | FromDiscord | <creikey> (edit) "seq[Game])" => "seq[Game])`" |
04:19:02 | FromDiscord | <creikey> no refs |
04:19:03 | FromDiscord | <Elegantbeef> you can do `--gc:orc` after if that's concerning |
04:19:16 | FromDiscord | <creikey> seq isn't copied right |
04:19:18 | FromDiscord | <creikey> it's only read |
04:19:19 | FromDiscord | <creikey> (edit) "it's only read ... " added "from" |
04:19:31 | FromDiscord | <Elegantbeef> It hopefully isnt but idk |
04:20:50 | FromDiscord | <creikey> I guess I'll try a release build? |
04:20:54 | FromDiscord | <creikey> no idea what's going on |
04:21:02 | FromDiscord | <creikey> release build seems like multiple things are happening at once maybe |
04:21:04 | FromDiscord | <creikey> yeah |
04:21:10 | FromDiscord | <creikey> but it's only like two things |
04:21:27 | FromDiscord | <creikey> have to say not impressed with nim's thread pool so far |
04:21:56 | FromDiscord | <creikey> I'm definitely doing something wrong though |
04:22:06 | FromDiscord | <Yardanico> In reply to @creikey "have to say not": threadpool is kind of abandoned, so yes |
04:22:16 | FromDiscord | <creikey> In reply to @Yardanico "threadpool is kind of": only use `parallel:` or what? |
04:22:26 | FromDiscord | <Yardanico> parallel is a part of threadpool too and it's kind of abandoned as well :) |
04:22:38 | FromDiscord | <creikey> what is the new way of doing parallelism in nim that they've abandoned into |
04:22:51 | FromDiscord | <Yardanico> well you can always use the traditional threads way |
04:23:19 | FromDiscord | <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:22 | FromDiscord | <Yardanico> e.g. https://github.com/nim-lang/threading |
04:23:35 | FromDiscord | <creikey> In reply to @Yardanico "current new things are": arc is that super performant gc right |
04:24:06 | FromDiscord | <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:15 | FromDiscord | <Yardanico> and https://nim-lang.org/docs/destructors.html :) |
04:24:32 | FromDiscord | <creikey> wow a year ago and things still aren't stable? |
04:24:50 | FromDiscord | <Yardanico> well they are not 100% compatible with refc |
04:25:09 | FromDiscord | <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:39 | FromDiscord | <Yardanico> but for most stuff ORC is already perfectly usable |
04:30:09 | FromDiscord | <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:19 | FromDiscord | <Yardanico> taskpools seems like it's pretty early in development though |
04:30:41 | FromDiscord | <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:21 | FromDiscord | <creikey> can nim thread procs take var arguments? |
04:45:50 | FromDiscord | <Elegantbeef> Nope |
04:46:42 | FromDiscord | <Elegantbeef> You'd need to pass a `ptr` |
04:46:46 | FromDiscord | <creikey> In reply to @Elegantbeef "Nope": so how can I get data from a thread |
04:46:50 | FromDiscord | <creikey> In reply to @Elegantbeef "You'd need to pass": I see |
04:47:09 | FromDiscord | <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:17 | FromDiscord | <creikey> https://nim-lang.org/docs/threads.html this says nothinga bout that |
04:47:19 | FromDiscord | <creikey> (edit) "nothinga bout" => "nothing about" |
04:47:50 | FromDiscord | <Elegantbeef> Well `var T` isnt type valid outside of iterators and parameters |
04:47:58 | FromDiscord | <Elegantbeef> So `Thread[var int]` isnt valid |
04:48:15 | FromDiscord | <Elegantbeef> Dont know if it will be eventuall |
04:49:42 | FromDiscord | <Yardanico> In reply to @creikey "so how can I": channels or global variables + locks (with arc/orc) |
04:49:52 | FromDiscord | <creikey> ah yeah forgot about channels |
04:49:53 | FromDiscord | <Yardanico> also ptrs too but you need locks anyway |
04:50:09 | FromDiscord | <creikey> for ptrs you wouldn't need a lock if it's setting separate memory right? |
04:50:30 | FromDiscord | <Yardanico> if each thread gets separate memory location, then sure |
04:55:35 | FromDiscord | <creikey> In reply to @Yardanico "if each thread gets": new fun fact: this does not seem to be true |
04:55:40 | FromDiscord | <Yardanico> ? |
04:55:50 | FromDiscord | <creikey> sent a code paste, see https://play.nim-lang.org/#ix=3Kw2 |
04:55:55 | FromDiscord | <creikey> ah wait |
04:56:00 | FromDiscord | <creikey> same thread object for both threds |
04:56:01 | FromDiscord | <creikey> (edit) "threds" => "threads" |
04:56:47 | FromDiscord | <creikey> no stacktrace or anything though just says execution failed |
04:59:19 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/B9A |
04:59:21 | FromDiscord | <Elegantbeef> With both `arc` and `refc` |
05:02:40 | FromDiscord | <creikey> sent a code paste, see https://paste.rs/Y89 |
05:02:47 | FromDiscord | <creikey> I did |
05:20:32 | * | arkanoid joined #nim |
05:28:30 | FromDiscord | <congusbongus> How can I check if homebrew is installed in nimscript? |
05:29:37 | FromDiscord | <Elegantbeef> `findExe` |
05:32:28 | FromDiscord | <congusbongus> `findExe("brew") != ""` works! |
05:35:43 | * | kayabaNerve quit (Remote host closed the connection) |
05:36:12 | * | kayabaNerve joined #nim |
06:07:38 | FromDiscord | <Casey.McMahon> sent a code paste, see https://play.nim-lang.org/#ix=3Kx1 |
06:08:15 | FromDiscord | <Elegantbeef> Do you need the `<>`? |
06:12:29 | FromDiscord | <Elegantbeef> You are sending a char through the uart right? |
06:13:32 | FromDiscord | <Casey.McMahon> usb serial |
06:13:55 | FromDiscord | <Casey.McMahon> Sorry, my usb got all screwed up, had to reboot my computer |
06:55:45 | FromDiscord | <Esther> Is it normal that windows defender complains about finish.exe in the nim zip from the website? |
06:56:07 | FromDiscord | <Elegantbeef> Ideal not, but it's "normal" |
06:56:24 | FromDiscord | <Esther> it's not a good look, hahah |
06:57:50 | FromDiscord | <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:53 | FromDiscord | <Yardanico> but yes it's just a false positive |
07:03:42 | FromDiscord | <Esther> alrighty, thanks |
07:23:37 | * | thomasross quit (Ping timeout: 240 seconds) |
09:15:37 | * | Vladar joined #nim |
09:39:22 | FromDiscord | <dizzyliam> do either of the stdlib regex libraries compile the queries at compile-time? |
09:47:48 | FromDiscord | <Yardanico> no, they use pcre so the regexes are compiled at runtime |
09:48:06 | FromDiscord | <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:23 | FromDiscord | <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:04 | FromDiscord | <kaddkaka> (edit) "characters:"" => "characters:" |
10:58:28 | FromDiscord | <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:56 | FromDiscord | <kaddkaka> (edit) "https://play.nim-lang.org/#ix=3Kzi" => "https://play.nim-lang.org/#ix=3Kzj" |
11:40:06 | NimEventer | New 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:53 | FromDiscord | <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:55 | FromDiscord | <Yardanico> is there any error? |
12:18:16 | FromDiscord | <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:39 | FromDiscord | <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:49 | FromDiscord | <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:44 | FromDiscord | <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:17 | FromDiscord | <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:36 | FromDiscord | <Isofruit> (edit) "I hash" => "Django hashes" |
15:17:20 | FromDiscord | <Isofruit> sent a long message, see http://ix.io/3KCT |
15:20:12 | FromDiscord | <enthus1ast> salt is usually concatinated to the input, eiter in front or back, for details i would read the django source |
15:20:16 | PMunch | Salt 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:31 | PMunch | So probably just try to add in on either end and run the hashing |
15:22:11 | FromDiscord | <planetis> how do i tell nim to search for dynamic library in the same directory as the executable? |
15:22:18 | FromDiscord | <Yardanico> that's OS-specific |
15:22:24 | FromDiscord | <Yardanico> on linux use LD_LIBRARY_PATH |
15:22:27 | PMunch | LD_LIBRARY_PATH=. |
15:22:35 | FromDiscord | <planetis> thank you |
15:28:24 | FromDiscord | <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:49 | FromDiscord | <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:17 | FromDiscord | <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:50 | FromDiscord | <Isofruit> Ohhh I had been wandering about that |
15:29:55 | FromDiscord | <Yardanico> and they can't really make a new rainbow table since each password has a different salt |
15:29:58 | FromDiscord | <Isofruit> (edit) "wandering" => "wondering" |
15:30:07 | FromDiscord | <Yardanico> so they have to do bruteforce the slower way |
15:30:42 | FromDiscord | <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:19 | PMunch | I thought Prologue had some login middleware already? |
15:33:06 | FromDiscord | <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:15 | PMunch | But I guess it wouldn't be compatible to Djangos system.. |
15:33:55 | FromDiscord | <enthus1ast> build it yourself and make pr to Prologues repo \:) |
15:34:35 | FromDiscord | <Isofruit> I'll build something alright.↵And then try to generalize it out |
15:34:51 | FromDiscord | <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:45 | FromDiscord | <Isofruit> Wait a minute |
15:38:18 | FromDiscord | <Isofruit> If my Django hashes can contain +, / and = signs, that means they are not just hexadecimal |
15:39:10 | FromDiscord | <Isofruit> ... Yeah, I'm seeing the entire alphanumerical space + extra signs in there, wth is that encoded in |
15:44:08 | FromDiscord | <Isofruit> Does anyone have a different library or understands how to parse whatever they're computing into a string? |
15:44:16 | FromDiscord | <Yardanico> In reply to @Isofruit "... Yeah, I'm seeing": base64 |
15:44:23 | FromDiscord | <Yardanico> https://nim-lang.org/docs/base64.html |
15:45:18 | FromDiscord | <Isofruit> Ah, fair, my brain was so settled on hex since the SHA256 lib offers a function for that |
15:46:27 | FromDiscord | <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:03 | FromDiscord | <Yardanico> you're trying to print binary data |
15:47:06 | FromDiscord | <enthus1ast> these are the plain bytes outputted to the terminal |
15:47:18 | FromDiscord | <Yardanico> that's why base64 is used in cases like this |
15:47:25 | FromDiscord | <Yardanico> to encode this binary data in printable ASCII characters |
15:47:55 | FromDiscord | <Isofruit> OH IT OUTPUTS the raw binaries... as string? |
15:48:13 | FromDiscord | <Yardanico> raw bytes, yes |
15:48:19 | FromDiscord | <Yardanico> it's a hash after all |
15:48:32 | FromDiscord | <Yardanico> the typical sha256 representation that you see is actually a hex representation of the bytes |
15:49:30 | FromDiscord | <Isofruit> Hmmmm |
15:50:42 | FromDiscord | <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:15 | PMunch | How do I write a format for times.parse to handle a string like this: 2022-01-03T06:00:00.000+0000 |
15:51:46 | FromDiscord | <enthus1ast> is this iso date? |
15:51:49 | PMunch | I tried yyyy-MM-ddTHH:mm:ss.fff+zzzz but it complains that Error: unhandled exception: 'T' is not a valid pattern [TimeFormatParseError] |
15:52:08 | FromDiscord | <enthus1ast> extra chars must be escaped |
15:52:11 | FromDiscord | <Yardanico> In reply to @PMunch "I tried yyyy-MM-ddTHH:mm:ss.fff+zzzz but": you need to escape T |
15:52:25 | FromDiscord | <Yardanico> > Other strings can be inserted by putting them in '' |
15:52:27 | FromDiscord | <Yardanico> so 'T' |
15:52:34 | PMunch | I tried to escape the T, then it said that ' ' was not a format |
15:53:05 | FromDiscord | <enthus1ast> https://github.com/nim-lang/Nim/blob/afa4bc34b41307c6c63e8c7c973afe295e9fedd8/lib/pure/times.nim#L2168 |
15:53:33 | PMunch | Why the T and not the - and :? |
15:53:54 | FromDiscord | <Yardanico> "The following characters can be inserted without quoting them: : - ( ) / [ ] ," |
15:53:56 | FromDiscord | <Yardanico> :P |
15:55:58 | FromDiscord | <Yardanico> also you should use ZZZ instead of zzzz without inserting + yourself |
15:56:03 | FromDiscord | <Yardanico> let dt = parse("2022-01-03T06:00:00.000+0000", "yyyy-MM-dd'T'HH:mm:ss'.'fffZZZ") |
15:59:21 | FromDiscord | <Isofruit> Hmmm |
15:59:36 | FromDiscord | <Isofruit> well, I'm getting a decent hash as output at least, which is really good! |
16:00:10 | FromDiscord | <Isofruit> I'm just not getting the correct hash =/↵I'll need to take a look at the django source again |
16:00:21 | FromDiscord | <Isofruit> `encode($computeSHA256(plainpw&salt, 180000))`↵That at least get's me where I want to go |
16:00:29 | FromDiscord | <Yardanico> do you require using 100% same hash as django ? |
16:00:30 | FromDiscord | <Yardanico> any reason why? |
16:01:14 | FromDiscord | <Yardanico> also obviously you will never get the same hash if you use random salts |
16:01:16 | FromDiscord | <Isofruit> Well, my current db is hosted via Django |
16:01:32 | FromDiscord | <Yardanico> oh you want to use an existing db |
16:01:35 | FromDiscord | <Isofruit> I effectively have around 20 entries that I need to be able to "recreate" |
16:01:56 | FromDiscord | <Isofruit> My usebase is like 6 people so that works out for me |
16:03:09 | FromDiscord | <Yardanico> also django is sha256 + PBKDF2 |
16:03:11 | FromDiscord | <Yardanico> not just sha256 |
16:04:00 | FromDiscord | <Isofruit> Wait that's a difference? |
16:04:03 | FromDiscord | <Yardanico> yes |
16:04:06 | FromDiscord | <Yardanico> https://github.com/cheatfate/nimcrypto can do both sha256 and pbkdf2 |
16:04:06 | FromDiscord | <Isofruit> Dangit |
16:04:31 | * | kenran joined #nim |
16:05:37 | FromDiscord | <Isofruit> huh |
16:05:38 | FromDiscord | <Isofruit> er |
16:05:58 | FromDiscord | <Isofruit> I guess I'll brute force which combination of sha256, pbkdf2 and 18000 repetitions gives me my hashes ? |
16:06:12 | FromDiscord | <Isofruit> or get the django implementation, anyway |
16:06:23 | FromDiscord | <Isofruit> (edit) "or get ... the" added "a look at" |
16:07:13 | PMunch | Well that's just super confusing :P |
16:09:09 | FromDiscord | <enthus1ast> django can use multiple algos not just pbkdf2 |
16:09:10 | FromDiscord | <enthus1ast> https://github.com/django/django/blob/b0d16d0129b7cc5978a8d55d2331a34cb369e6c7/django/contrib/auth/hashers.py |
16:09:18 | FromDiscord | <enthus1ast> also argon2 |
16:09:23 | FromDiscord | <Yardanico> yes but pbkdf2 is the default |
16:09:45 | FromDiscord | <Isofruit> I Just double checked my settings.py file, I have not changed the default, it's pbkdf2 |
16:09:56 | FromDiscord | <Isofruit> With sha 256 |
16:10:20 | PMunch | Hmm, I wish there was a compare thing in times that could ignore parts of the DateTime.. |
16:10:29 | PMunch | I guess I could just zero out those parts |
16:10:54 | FromDiscord | <Isofruit> Hm? You mean for parsing in? |
16:10:57 | FromDiscord | <Isofruit> Or for what? |
16:15:11 | * | PMunch quit (Quit: leaving) |
16:31:23 | NimEventer | New thread by Freeflow: Links to Std library lead to a 404, see https://forum.nim-lang.org/t/8761 |
16:49:27 | FromDiscord | <Shiba> https://media.discordapp.net/attachments/371759389889003532/927242194396528650/20220102_174846.JPG |
16:49:31 | FromDiscord | <Shiba> How does tht count as an error |
16:49:52 | nrds | <Prestige99> ints can't be nil |
16:50:10 | FromDiscord | <Yardanico> In reply to @Shiba "": Nim value types are not "boxed" |
16:50:16 | FromDiscord | <Yardanico> ints are only numbers, they can't be nil |
16:50:37 | FromDiscord | <Shiba> Theb how i can check if an index in a tuble is nil |
16:50:44 | FromDiscord | <Shiba> (edit) "Theb" => "Then" |
16:50:49 | FromDiscord | <Yardanico> ?? |
16:51:00 | FromDiscord | <Yardanico> can you explain what you want to do in this procedure? |
16:51:03 | FromDiscord | <Yardanico> what is it supposed to do |
16:51:11 | FromDiscord | <Yardanico> and please paste code as text or at least as screenshots (not as photos)\ |
16:51:12 | FromDiscord | <Yardanico> (edit) "photos)\" => "photos)" |
16:52:09 | FromDiscord | <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:22 | FromDiscord | <Shiba> (edit) "wantvto" => "want to" |
16:52:26 | FromDiscord | <Yardanico> that's now how you do that in Nim |
16:52:30 | FromDiscord | <Yardanico> you check the length of the sequence |
16:52:55 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3KEg |
16:52:59 | FromDiscord | <Yardanico> myseq[2] is the third element in the seq |
16:54:06 | FromDiscord | <Shiba> I thought it works the same as lua, 😶 |
16:54:27 | FromDiscord | <Yardanico> nim is not lua |
16:54:28 | FromDiscord | <Solitude> why would it |
16:54:32 | FromDiscord | <Shiba> But it's ok |
16:57:59 | FromDiscord | <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:07 | FromDiscord | <apahl> https://media.discordapp.net/attachments/371759389889003532/927244378576142346/unknown.png |
16:58:11 | FromDiscord | <Yardanico> wow, nice :) |
16:58:44 | FromDiscord | <apahl> Yes, I am quite happy as well. 😆 |
17:22:25 | FromDiscord | <treeform> In reply to @Isofruit "Quick confirmation question regarding": Yes that is correct. |
17:23:04 | FromDiscord | <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:45 | FromDiscord | <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:09 | FromDiscord | <treeform> In reply to @soundmodel "I also don't understand": Yeah that's just how templates work. |
17:26:36 | FromDiscord | <treeform> See here a slide from my upcoming talk: https://media.discordapp.net/attachments/371759389889003532/927251544565485638/unknown.png |
17:27:29 | FromDiscord | <treeform> Let me know if I can explain it better. |
17:27:58 | * | jjido joined #nim |
17:28:16 | FromDiscord | <treeform> In reply to @apahl "": How do you generate the image of the molecule? |
17:32:55 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=3KFe |
17:34:18 | FromDiscord | <apahl> @treeform : RDKit provides a toSVG method that I use. But the toolkit can also generate PNGs via cairo. |
17:34:44 | FromDiscord | <treeform> In reply to @enthus1ast "<@107140179025735680>\: what could it": This was this bug right? https://github.com/treeform/netty/issues/25 |
17:36:07 | FromDiscord | <treeform> In reply to @Isofruit "God I love the": Thanks! I am glad you found jsony useful. |
17:37:11 | FromDiscord | <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:22 | FromDiscord | <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:38 | NimEventer | New 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:18 | FromDiscord | <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:28 | FromDiscord | <kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3KGT |
18:54:59 | FromDiscord | <kaddkaka> What's the canonical way of writing the above fold? |
18:55:49 | FromDiscord | <kaddkaka> (edit) "What's the canonical way" => "Are there other (preferred/reasonable) ways" |
18:58:14 | FromDiscord | <Solitude> In reply to @kaddkaka "Why the asymmetry between": https://nim-lang.org/docs/sequtils.html#allIt.t%2Cuntyped%2Cuntyped |
19:00:26 | FromDiscord | <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:00 | FromDiscord | <Solitude> look at other thingIt templates |
19:01:45 | FromDiscord | <kaddkaka> I understand and guessed that it matches other `It` templates. But why is `foldl ` the odd one out |
19:02:43 | FromDiscord | <Solitude> rewrite foldl with `it` and `that` |
19:02:47 | FromDiscord | <Shiba> sent a code paste, see https://play.nim-lang.org/#ix=3KH6 |
19:02:55 | FromDiscord | <huantian> I like `this` and `that` better :P |
19:03:00 | FromDiscord | <Shiba> (edit) "https://play.nim-lang.org/#ix=3KH6" => "https://play.nim-lang.org/#ix=3KH7" |
19:03:06 | FromDiscord | <Solitude> even better |
19:03:19 | FromDiscord | <kaddkaka> `sum` and `it`? |
19:03:37 | FromDiscord | <kaddkaka> `result` and `it`? |
19:03:38 | FromDiscord | <huantian> `cum` would probably be broader |
19:07:34 | FromDiscord | <kaddkaka> Suggestion `all` and `any ` |
19:07:49 | FromDiscord | <kaddkaka> (edit) "`any `" => "`any` could have identity function as default proc." |
19:08:51 | FromDiscord | <Solitude> cool, why would you call them then |
19:11:36 | FromDiscord | <kaddkaka> @Solitude is the case?re a shorter way in that |
19:11:41 | FromDiscord | <kaddkaka> (edit) "the case?re" => "there" | "that" => "that?" |
19:11:45 | FromDiscord | <kaddkaka> (edit) "that?" => "that case?" |
19:12:35 | FromDiscord | <Solitude> what |
19:13:20 | FromDiscord | <Shiba> sent a code paste, see https://play.nim-lang.org/#ix=3KHf |
19:13:52 | FromDiscord | <Solitude> sorry, telepathy machine broke, wanna show actual error? |
19:14:55 | FromDiscord | <kaddkaka> In reply to @Solitude "what": My idea was to be able to reduce a seq like this:↵`any(@[true, true, false])` |
19:15:05 | FromDiscord | <Rosen> In reply to @Shiba "I don't understand why": what is `points` |
19:15:23 | FromDiscord | <kaddkaka> And skip the identity procedure `(a) => a` |
19:16:15 | FromDiscord | <Solitude> god gave you `allIt(it)` and you are trying to build hack on hacks |
19:16:40 | FromDiscord | <Solitude> you want to have as default argument something that only works on sequences of booleans? |
19:17:32 | FromDiscord | <Shiba> ? |
19:17:35 | FromDiscord | <kaddkaka> In reply to @Solitude "god gave you `allIt(it)`": That was the suggestion, that's how pythons `and` and `all` behave. |
19:17:58 | FromDiscord | <kaddkaka> (although they deal with truthy and falsey values) |
19:18:02 | FromDiscord | <Solitude> yes |
19:18:09 | FromDiscord | <Shiba> It's a 2d array so i need the index of each element to draw each tile |
19:18:24 | FromDiscord | <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:27 | FromDiscord | <Solitude> In reply to @kaddkaka "(although they deal with": thats exactly why it doesnt make sense in nim |
19:18:46 | FromDiscord | <kaddkaka> could be 👍 |
19:18:46 | FromDiscord | <Solitude> In reply to @Shiba "It's a 2d array": can you show error? |
19:19:16 | FromDiscord | <Shiba> ERROR: index -1 not in 0..49 |
19:19:28 | FromDiscord | <Shiba> Index defect |
19:19:51 | FromDiscord | <el__maco> your array is empty? |
19:20:05 | FromDiscord | <kaddkaka> In reply to @Shiba "ERROR: index -1 not": But you are not even indexing anything in the snippet you pasted? |
19:23:29 | FromDiscord | <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:32 | FromDiscord | <Shiba> In reply to @Rosen "To get a decent": Yes? |
19:25:28 | FromDiscord | <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:54 | FromDiscord | <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:28 | FromDiscord | <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:51 | FromDiscord | <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:13 | FromDiscord | <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:48 | FromDiscord | <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:03 | FromDiscord | <Casey.McMahon> sent a code paste, see https://play.nim-lang.org/#ix=3KIZ |
22:49:52 | FromDiscord | <Casey.McMahon> sent a code paste, see https://play.nim-lang.org/#ix=3KJ0 |
23:04:05 | FromDiscord | <hotdog> In reply to @krisppurg "Hiya, Whenever I try": In your json, sticker_items is an array |
23:04:20 | FromDiscord | <hotdog> So presumably the type needs to model it as a sew |
23:04:27 | FromDiscord | <hotdog> Seq |
23:07:39 | FromDiscord | <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:48 | FromDiscord | <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:03 | FromDiscord | <Casey.McMahon> In reply to @hotdog "Haven’t used this command": . |
23:09:56 | FromDiscord | <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:25 | FromDiscord | <Casey.McMahon> I think I'll just use nimibook |
23:23:25 | FromDiscord | <Casey.McMahon> https://github.com/pietroppeter/nimibook |
23:25:44 | FromDiscord | <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:32 | FromDiscord | <geekrelief> I guess I could raise an exception instead. |
23:29:47 | FromDiscord | <geekrelief> Is it possible to catch an exception coming from a macro? |
23:32:39 | FromDiscord | <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:40 | FromDiscord | <Elegantbeef> No there is not |
23:32:44 | FromDiscord | <geekrelief> sent a code paste, see https://paste.rs/iC5 |
23:33:00 | FromDiscord | <geekrelief> In reply to @Elegantbeef "No there is not": darn thx |
23:33:10 | FromDiscord | <Elegantbeef> You should be able to see the defects though with the `expect` |
23:33:17 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/assertions.html#doAssertRaises.t%2Ctypedesc%2Cuntyped |
23:33:28 | FromDiscord | <Elegantbeef> You can test with assertions on |
23:33:43 | FromDiscord | <Elegantbeef> In some dialects defects are not catchable |
23:33:49 | FromDiscord | <geekrelief> ooh thanks for the tip |
23:34:13 | FromDiscord | <Elegantbeef> So you can force defects to be catchable i think |
23:34:24 | FromDiscord | <Elegantbeef> Not that you should ever do that in real code |
23:34:31 | FromDiscord | <Elegantbeef> If you do that in real code i'll find you and break your legs |
23:34:35 | FromDiscord | <geekrelief> Right, I'm only doing this for tests |
23:34:59 | FromDiscord | <Elegantbeef> That's how it starts! |
23:35:19 | FromDiscord | <Elegantbeef> Tests are a gateway drug! |
23:35:23 | FromDiscord | <geekrelief> Well you planted the idea in my head, so you started it. |
23:36:02 | FromDiscord | <geekrelief> It starts with ideas, turned into words, into actions. It's all your fault! |
23:36:32 | FromDiscord | <Elegantbeef> Well it's your knees |
23:40:37 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3KJq |
23:40:54 | FromDiscord | <Elegantbeef> Wait is this at CT or RT? |
23:41:00 | FromDiscord | <geekrelief> at compile time |
23:41:19 | FromDiscord | <geekrelief> I want error reporting for my macro |
23:42:02 | * | sagax quit (Excess Flood) |
23:43:23 | FromDiscord | <Elegantbeef> I think the best thing to do is compile files and check the output |
23:43:33 | FromDiscord | <Elegantbeef> Like how the Nim stdlib checks for errors |
23:43:51 | FromDiscord | <Elegantbeef> `nim check --hints:off yourFile.nim` |
23:44:40 | FromDiscord | <Elegantbeef> On a side note, why are you raising errors in a macro |
23:44:50 | FromDiscord | <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:08 | FromDiscord | <geekrelief> I want to give better error reporting. |
23:45:20 | FromDiscord | <Elegantbeef> So then use `macros.error` |
23:45:33 | FromDiscord | <Elegantbeef> raising errors in macros is terrible |
23:46:01 | FromDiscord | <geekrelief> ah, thanks. 🙂 it did feel wrong |
23:46:22 | FromDiscord | <Elegantbeef> https://github.com/beef331/slicerator/blob/master/src/slicerator.nim#L206-L211 for an example |
23:47:15 | FromDiscord | <geekrelief> gotcha, thx |
23:59:24 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3KJA |