<< 03-09-2021 >>

00:11:21*arkurious quit (Quit: Leaving)
00:34:50FromDiscord<auxym> any ideas to check if an `int` is a valid value for a given enum type?
00:35:11*Pyautogui joined #nim
00:35:43FromDiscord<Elegantbeef> is it a holey enum?
00:36:09FromDiscord<impbox [ftsf]> test for RangeDefect
00:36:10FromDiscord<Elegantbeef> If it's contigious you can do `if i in YourEnum.low.ord .. YouEnum.high.ord`
00:36:22FromDiscord<Elegantbeef> Impbox you can leave right this instant
00:36:34FromDiscord<Elegantbeef> You do not catch `defects` πŸ˜€
00:36:43FromDiscord<impbox [ftsf]> you except them =)
00:36:49FromDiscord<Elegantbeef> No you do not
00:36:54FromDiscord<impbox [ftsf]> you can!
00:36:57FromDiscord<impbox [ftsf]> i just tried it
00:37:05FromDiscord<Elegantbeef> now try with `-d:danger`
00:37:10FromDiscord<impbox [ftsf]> sounds dangerous =p
00:37:23FromDiscord<impbox [ftsf]> but fair
00:37:47FromDiscord<Elegantbeef> I'm going to spam this forever now someone shouldnt let me write forum posts https://forum.nim-lang.org/t/8342#53776
00:38:14FromDiscord<impbox [ftsf]> aye, though the compiler should probably throw an error/warning if you try
00:38:42FromDiscord<Elegantbeef> defects just shouldnt be catchable imo
00:38:48FromDiscord<impbox [ftsf]> I agree
00:39:10FromDiscord<impbox [ftsf]> or at least throw a warning
00:39:24FromDiscord<auxym> yeah, wanted to avoid having to catch anything, thanks @ElegantBeef. I'll be avoiding holes due to https://github.com/nim-lang/Nim/issues/13980
00:39:27FromDiscord<impbox [ftsf]> but I do think out of Range should be catchable
00:40:10FromDiscord<Elegantbeef> Eh using exception handling for something rather simple seems odd, but what do i know
00:40:31FromDiscord<impbox [ftsf]> shrugs
00:40:50FromDiscord<impbox [ftsf]> but yeah, `if val in EnumType:` might be nicer
00:40:56FromDiscord<Elegantbeef> the what do i know wasnt meant to be condescending, just an actuality
00:41:38FromDiscord<auxym> @impbox [ftsf] yeah. probably implementable as a template? My template-fu isn't extremely strong
00:41:42FromDiscord<Elegantbeef> Consider a PR to http://nim-lang.github.io/Nim/enumutils.html
00:42:00FromDiscord<Elegantbeef> It's implementable as a procedure, generic that takes a `typedesc[enum]`
00:42:23FromDiscord<Elegantbeef> Assuming it's not holey
00:42:40FromDiscord<Elegantbeef> https://forum.nim-lang.org/t/8188 for a bunch of solutions
00:43:10FromDiscord<auxym> cheers. good reading.
00:45:41FromDiscord<impbox [ftsf]> actually, excepting defects may make sense when running nimscript for example
00:45:52FromDiscord<impbox [ftsf]> and reporting errors
00:46:01FromDiscord<Elegantbeef> Perhaps
00:46:10FromDiscord<impbox [ftsf]> you can't fix the problem, but you can report about it
00:47:39FromDiscord<Elegantbeef> Catching defects in nim code though is just asking for trouble since you can easily stop that from happening which will cause hidden bugs
00:47:43*Gustavo6046 is now known as Gustava6046
00:55:17*Gustava6046 is now known as Gustavo6046
00:58:13*byanka joined #nim
01:04:29cornfeedhoboanyone have opinions one which vscode extension to use?
01:04:41FromDiscord<Elegantbeef> nimsaem's
01:04:52cornfeedhobothanks
01:04:59FromDiscord<impbox [ftsf]> VSCodeVim
01:05:18cornfeedhobolol. i meant nim specific :p
01:05:20FromDiscord<Elegantbeef> You mean onivim? πŸ˜›
01:05:29cornfeedhobolook what you started
01:05:33FromDiscord<impbox [ftsf]> sorry
01:05:44cornfeedhobohehe
01:05:56FromDiscord<Elegantbeef> Impbox might actually like onivim2 though πŸ˜€
01:13:44*flynn quit (Read error: Connection reset by peer)
01:14:50*flynn joined #nim
01:15:32*neurocyte2 joined #nim
01:15:32*neurocyte2 quit (Changing host)
01:15:32*neurocyte2 joined #nim
01:17:23FromDiscord<impbox [ftsf]> can a macro determine the type of a thing?
01:17:31*neurocyte quit (Ping timeout: 252 seconds)
01:17:31*neurocyte2 is now known as neurocyte
01:17:38FromDiscord<Elegantbeef> If the macro arg is `typed`
01:17:50FromDiscord<Elegantbeef> it cannot get a type inside the macro though
01:17:56FromDiscord<impbox [ftsf]> sent a code paste, see https://paste.rs/PFV
01:18:41FromDiscord<Elegantbeef> you could do `root[^2] = newCall(ident"typeof", root[^])`
01:21:19FromDiscord<impbox [ftsf]> woo! magic!
01:21:21FromDiscord<impbox [ftsf]> thanks
01:21:32FromDiscord<Elegantbeef> No problem
01:21:51FromDiscord<Elegantbeef> Whatcha working on?
01:21:59FromDiscord<impbox [ftsf]> >_>
01:22:37FromDiscord<Elegantbeef> I mean i can only think of one use case for the above, and that's with modifying type defs \:P
01:23:08FromDiscord<impbox [ftsf]> https://github.com/Glasses-Neo/OOlib saw this and thought it's cool, but it _couldn't_ infer types from defaults...
01:23:39FromDiscord<Elegantbeef> Hey i was right! πŸ˜€
01:23:51FromDiscord<Elegantbeef> https://github.com/beef331/constructor#defaults thought it was something like this
01:24:09FromDiscord<impbox [ftsf]> indeed
01:26:22FromDiscord<impbox [ftsf]> for people like me who sometimes like basic oopy stuff
01:26:40FromDiscord<impbox [ftsf]> i do miss class data
01:27:52cornfeedhobowhat defines a package name? where is the line between repo name and package name?
01:28:00FromDiscord<Elegantbeef> If you're doing anything with inheritance may want to use https://nimdocs.com/beef331/oopsie/oopsie.html
01:28:15FromDiscord<Elegantbeef> Repo name should be the package name to make everyone happier
01:29:06cornfeedhobosuuuuure, but consider when you implement the same thing in multiple languages. it's common to prefix $lang-$library
01:29:34cornfeedhobobut within the language, you just want to use $library
01:33:44cornfeedhobooh, is package name the name of the .nimble file?
01:33:56FromDiscord<Elegantbeef> I believe so
01:34:18FromDiscord<Elegantbeef> It only really matters for the nimble directory since if you use git urls it's the repo
01:34:40*Pyautogui quit (Ping timeout: 240 seconds)
01:37:11*Freneticks quit (Ping timeout: 250 seconds)
01:39:00FromDiscord<Cark> sent a code paste, see https://play.nim-lang.org/#ix=3xNq
01:39:19FromDiscord<Elegantbeef> `for x in myseq.mitems: dostuff(x)`
01:39:33FromDiscord<Cark> oh i need to try this, thanks
01:39:51FromDiscord<Elegantbeef> `mitems` is the `mutable` items iterator that is conventionally named as such
01:40:12FromDiscord<Elegantbeef> Each element is yielded as a mutable reference to `x`
01:41:00FromDiscord<Cark> indeed that works, thanks !
01:46:55*Freneticks joined #nim
01:48:54*flynn quit (Ping timeout: 256 seconds)
01:55:57*stkrdknmibalz quit (Remote host closed the connection)
01:57:14*flynn joined #nim
01:59:09*stkrdknmibalz joined #nim
02:41:10*auxym_ quit (Ping timeout: 240 seconds)
03:00:34*Pyautogui joined #nim
03:01:56*neurocyte quit (Quit: Ping timeout (120 seconds))
03:02:08*neurocyte joined #nim
03:02:08*neurocyte quit (Changing host)
03:02:08*neurocyte joined #nim
03:03:59*Pyautogui quit (Client Quit)
03:05:19*flynn quit (Read error: Connection reset by peer)
03:06:33*flynn joined #nim
03:16:56madpropshow should I do this with karax ...
03:16:56madpropstdiv(id = "options-switch", onclick = () => (kdom.getElementById("options-switch").style.display = "block"))
03:17:58madpropsoh wait nvm
03:18:42madpropsI was getting the wrong element
03:19:36*rockcavera quit (Remote host closed the connection)
04:06:02*supakeen quit (Quit: WeeChat 3.2)
04:06:31*supakeen joined #nim
04:15:43madpropshey, something weird happened
04:16:17madpropssome choosenim process got cpu heavy https://i.imgur.com/zNKySQV.jpg
04:16:24madpropsi don't know why it was running
04:17:13madpropsi was compiling some karax code into js
04:17:20madpropsmaybe it got stuck on some failed compilation or something
04:27:18FromDiscord<Rika> nimsuggest can bug out like that
04:27:25*flynn quit (Read error: Connection reset by peer)
04:28:31*flynn joined #nim
04:55:52FromDiscord<garett> sent a code paste, see https://play.nim-lang.org/#ix=3xNF
04:56:37FromDiscord<garett> I've definitely seen `nimsuggest` bug out and go nuts on CPU
04:56:42FromDiscord<xflywind> `include a`
04:57:01FromDiscord<garett> @xflywind thank you
04:57:38FromDiscord<xflywind> np
04:58:43FromDiscord<garett> moved all the `{.pragma:...}` to `pragmas.nim`
04:58:50FromDiscord<garett> worked like a charm
04:59:10FromDiscord<garett> seems like an inconsistency
04:59:37FromDiscord<xflywind> that's what stdlib does
04:59:44FromDiscord<xflywind> like `include "system/inclrtl"`
05:00:28FromDiscord<xflywind> > # Pragmas for RTL generation. Has to be an include, because user-defined↡> # pragmas cannot be exported.
05:03:24FromDiscord<impbox [ftsf]> is there any way in a macro to determine if a method should use {.base.}, ie, check if the method is defined in its parent and add {.base.} if not?
05:08:01FromDiscord<πτ (pi man)> so I managed to get debugging working through VSC, but the variable names are all T<number>_, any way to get the actual variable names?
05:09:07FromDiscord<πτ (pi man)> https://media.discordapp.net/attachments/371759389889003532/883217018835333160/unknown.png
05:09:37FromDiscord<πτ (pi man)> `nimble --lineDir:on --debuginfo --debugger:native -d:useRealtimeGC -d:nimTypeNames build`↡this is my build command
05:09:58FromDiscord<Elegantbeef> put those commands after build
05:10:02FromDiscord<Elegantbeef> i believe atleast
05:10:34FromDiscord<πτ (pi man)> it works either way
05:10:39FromDiscord<xflywind> use `nim-gdb.py` to get better messages
05:12:26FromDiscord<Elegantbeef> Yea follow https://github.com/saem/vscode-nim#debugging if you havent
05:12:55FromDiscord<Elegantbeef> @impbox [ftsf]\: so yes macros can figure out if it should be base, but no i dont think they can figure out soon enough to remove the warning πŸ˜€
05:14:21FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3xNJ annoyingly
05:16:44FromDiscord<impbox [ftsf]> dang
05:16:55FromDiscord<impbox [ftsf]> _needs to get better at this macro stuff_
05:17:14FromDiscord<Elegantbeef> Hmm wonder if we can push a `when compiles`
05:17:40FromDiscord<πτ (pi man)> In reply to @Elegantbeef "Yea follow https://github.com/saem/vscode-nim#debug": oh, this on is lldb not gdb
05:17:43FromDiscord<Elegantbeef> Mix a when compiles with a warning as error to get this behaviour
05:24:37FromDiscord<Elegantbeef> @impbox [ftsf]\: so yea this works but not that is smart or clean πŸ˜€ https://play.nim-lang.org/#ix=3xNM
05:24:58FromDiscord<πτ (pi man)> sent a code paste, see https://play.nim-lang.org/#ix=3xNN
05:25:06FromDiscord<impbox [ftsf]> @ElegantBeef evil! I like it
05:25:50FromDiscord<Elegantbeef> Eh i want to make this a bit smarter
05:25:56FromDiscord<Elegantbeef> Atleast to reduce the amount of time spent on semming
05:27:00FromDiscord<impbox [ftsf]> i'm trying to add class constants to oolib, i figure they need to be methods for dynamic dispatch
05:28:08FromDiscord<Elegantbeef> Well this is a bit more sane since it's just the header now instead of the entire body https://play.nim-lang.org/#ix=3xNP
05:28:47FromDiscord<impbox [ftsf]> pretty cool!
05:28:50FromDiscord<Elegantbeef> Wait are you executing `nim-gdb.py` yourself?
05:29:37FromDiscord<πτ (pi man)> am I not supposed to?
05:29:45FromDiscord<Elegantbeef> Nope
05:30:40FromDiscord<Elegantbeef> Did you read the setup guide i linked?
05:31:42FromDiscord<Elegantbeef> I atleast dont think you're supposed to run the python file yourself
05:32:59FromDiscord<Elegantbeef> dont know what a class constant is so no clue what you mean πŸ˜€β†΅(@impbox [ftsf])
05:33:30FromDiscord<impbox [ftsf]> i guess a constant that is specific to that class, rather than linked to an instance of that class
05:33:58FromDiscord<πτ (pi man)> In reply to @Elegantbeef "Yea follow https://github.com/saem/vscode-nim#debug": reading this again, looks like I need a second nim extension?
05:34:14FromDiscord<impbox [ftsf]> (edit) "class," => "class (and its children unless overriden),"
05:34:24FromDiscord<Elegantbeef> I just use that extension so idk πŸ˜€
05:34:25FromDiscord<πτ (pi man)> also I can't find it through VSC
05:35:24FromDiscord<Elegantbeef> Well isnt a method going to give you a constant linked to the class?
05:35:38FromDiscord<impbox [ftsf]> that's the idea of using a method
05:36:05FromDiscord<Elegantbeef> I mean linked to an instance
05:36:24FromDiscord<impbox [ftsf]> hmm i see what you mean
05:36:36FromDiscord<impbox [ftsf]> yes, it is just a method
05:36:37FromDiscord<Elegantbeef> Like you cannot do `Banana.size` it's `Banana().size`
05:36:52FromDiscord<impbox [ftsf]> i just want to generate those methods
05:37:52FromDiscord<Elegantbeef> Ah ok so if there is no `myObject.size` you do `myObject.super.size` which does the same internally
05:38:01FromDiscord<Elegantbeef> So its a bunch of super calls all the way up πŸ˜€
05:38:39FromDiscord<impbox [ftsf]> https://play.nim-lang.org/#ix=3xNR
05:38:44FromDiscord<impbox [ftsf]> something like this is what i'm going for
05:39:22FromDiscord<impbox [ftsf]> which works, just whinges about {.base.}
05:41:00FromDiscord<Elegantbeef> Yea so guess you get to use my silly work around untill someone suggests something better
05:41:26FromDiscord<impbox [ftsf]> aye =)
05:42:28NimEventerNew Nimble package! htmlAntiCopy - Block copy of any text in HTML, see https://github.com/thisago/htmlAntiCopy
05:42:47FromDiscord<impbox [ftsf]> that looks like a terrible package D:
05:42:58FromDiscord<impbox [ftsf]> i want to copy text
05:43:59FromDiscord<Elegantbeef> Yea it's quite odd
05:46:39FromDiscord<Rika> its really easy to bypass anyway i assu,
05:46:41FromDiscord<Rika> assume
05:47:10FromDiscord<Rika> ah its server side
05:47:11FromDiscord<Rika> lmao
05:47:34FromDiscord<Rika> whats the point tho if you can just like
05:47:45FromDiscord<Rika> screenshot the text and then maybe if you really want OCR
05:48:35FromDiscord<Elegantbeef> Clearly it's for preventing people from cheating on exams πŸ˜›
05:49:07FromDiscord<Rika> to prevent them from what, copying the text? what are they stupid to not know how to google or type?
05:49:37FromDiscord<Elegantbeef> Indeed!
05:50:32FromDiscord<Rika> damn
06:02:10FromDiscord<πτ (pi man)> hmm, ok, switched to lldb and it's better but not great
06:03:14FromDiscord<Elegantbeef> I havent used a debugger much so i sadly cannot help
06:05:18FromDiscord<πτ (pi man)> the local variables are still all T<umber>_↡but now there are static and globals (looks like the same list though) that are the global variables with the correct names but with extra stuff added to the name
06:06:19FromDiscord<πτ (pi man)> (edit) "T<umber>_↡but" => "T<number>_↡but"
06:08:54FromDiscord<Elegantbeef> Well due to how nim emits C code the symbols will not be 1\:1
06:09:14FromDiscord<Elegantbeef> Cause remember you can have infinite global scoped `thisT`
06:10:33FromDiscord<Rika> and C does not have overloading
06:11:31madpropsI'm glad nim uses github for distribution, one account less to manage
06:12:09FromDiscord<Elegantbeef> Microsoft screams "huzzah" from the rooftops
06:28:15*userj joined #nim
06:28:44*ad-absurdum joined #nim
06:50:02*PMunch joined #nim
07:10:25*max22- joined #nim
07:13:35*PersonMcGuy joined #nim
07:14:35PersonMcGuyHello everyone. I checked and didn't see anything, but I wanted to be sure: is there any proc like zeroMem that will fill with some arbitrary int instead of 0?
07:15:55FromDiscord<Elegantbeef> For what?
07:16:02FromDiscord<Elegantbeef> An array, a seq...?
07:18:00PersonMcGuyI guess just a pointer? I'm going off zeroMem's documentation: copyMem(dest, source: pointer; size: Natural)
07:18:18PersonMcGuySorry, wrong one: zeroMem(p: pointer; size: Natural)
07:20:06FromDiscord<Elegantbeef> Appears there is not
07:20:48PersonMcGuyAlright, just wanted to be sure
07:20:51PersonMcGuyThanks
07:22:10FromDiscord<impbox [ftsf]> PersonMcGuy it'd be tricky because it doesn't know the size of each element
07:22:30FromDiscord<impbox [ftsf]> if you want to do it you'd probably better do a loop and set it
07:23:07PersonMcGuyI was thinking about copying a definition under system/memory.nim for nimSetMem and working with that
07:24:29PersonMcGuyI just thought it was odd that there wasn't an exported proc for it like there is for nimZeroMem -> zeroMem, but I barely know what I'm doing so I don't know lol
07:24:53FromDiscord<Elegantbeef> Well here's what i'd do https://play.nim-lang.org/#ix=3xO2
07:25:11FromDiscord<impbox [ftsf]> aye, that's what i was thinking but nicer
07:25:13FromDiscord<Elegantbeef> Is there a reason you're doing low level stuff? πŸ˜€
07:25:36FromDiscord<Elegantbeef> Oh you had a nicer impl? \:P
07:25:45FromDiscord<impbox [ftsf]> no yours is nicer
07:26:28PersonMcGuy@Elegantbeef I'm probably out of my depth, but I'm trying to convert a C header to nim for the solana sdk
07:26:50PersonMcGuyI tried searching to see if anyone else had done it or something similar, but I didn't find anything
07:27:19FromDiscord<Elegantbeef> Well the best way of learning to swim is to submerge your feet in concrete blocks and jump in a lake
07:27:31PersonMcGuyI like your implementation by the way. Is it okay if I use it?
07:27:32FromDiscord<Elegantbeef> Though now that i say that i think i've mistaken the best way to hide a body
07:27:52PersonMcGuylol right? I just like to go straight at the code and see what happens
07:28:06FromDiscord<Elegantbeef> Absolutely not i shared it so we could admire my big brain πŸ˜›
07:28:16FromDiscord<Elegantbeef> Yes you can of course use it
07:28:28FromDiscord<Elegantbeef> Where is my disclaimer of "If i share code anyone can use it"
07:28:59FromDiscord<Elegantbeef> Do you have a link to the header file?
07:29:14FromDiscord<impbox [ftsf]> https://play.nim-lang.org/#ix=3xO5 i was thinking more something like this where the cast is inside
07:29:27FromDiscord<impbox [ftsf]> mostly because i hate having to think about casting
07:30:28FromDiscord<Elegantbeef> I avoid raw pointers as much as possible since i view `ptr T` different to a ptr array
07:30:59FromDiscord<Elegantbeef> `createU` and it's friend `create` are quite nice though
07:31:13FromDiscord<Elegantbeef> a typed pointer is noice
07:33:00FromDiscord<impbox [ftsf]> PersonMcGuy, what's is the c code you're trying to imitate doing? maybe there's a nicer way in nim
07:33:31PersonMcGuyI'm trying to find a link on their github but it's not the same as the one from the release itself
07:33:35FromDiscord<Elegantbeef> a `template createPtrArray(T: typedesc, count: int): ptr UncheckedArray[T] = cast[ptr UncheckedArray[T]](create(T, count))` would be a nice little addition in some stdlib
07:34:11FromDiscord<Elegantbeef> Though i figure it's not overly needed so probably not \:D
07:36:59PersonMcGuyWhile I'm looking, the code that I was trying to port:
07:37:02PersonMcGuy * Fill a byte string with a byte value
07:37:02PersonMcGuy */
07:37:03PersonMcGuystatic void *sol_memset(void *b, int c, size_t len) {
07:37:03PersonMcGuy uint8_t *a = (uint8_t *) b;
07:37:04PersonMcGuy while (len > 0) {
07:37:04PersonMcGuy *a = c;
07:37:05PersonMcGuy a++;
07:37:05PersonMcGuy len--;
07:37:06PersonMcGuy }
07:37:06PersonMcGuy}
07:37:24PersonMcGuylol *) is * )
07:37:32FromDiscord<Elegantbeef> Ok so that's identical to what we have
07:37:38FromDiscord<Elegantbeef> Plus you can use paste sites πŸ˜€
07:39:23PersonMcGuyAhhhh duh, I should have thought about that. Sorry.
07:39:24PersonMcGuyhttps://pastebin.com/LQ06i7EB
07:44:53FromDiscord<Elegantbeef> You're replicating this API in nim eh?
07:45:17FromDiscord<Elegantbeef> Cause if that's the case you dont need to use `ptr uint8` you can just use a `seq[uint8`
07:46:06PersonMcGuyTrying to at least. I wanted to see if it would work because I would love to write stuff with the sdk with nim instead of C if possible.
07:46:24PersonMcGuyThough I'm worried about memory safety the more I think about it
07:46:54FromDiscord<Elegantbeef> Well that's why you use Nim's more safe tools where you can
07:47:40FromDiscord<impbox [ftsf]> if you're worried about memory safety, i wouldn't start by copying C =)
07:48:05PersonMcGuySorry, I think I meant more like GC stuff. I'm not really sure what's going to happen
07:48:28FromDiscord<Elegantbeef> In what way?
07:49:26FromDiscord<Elegantbeef> Reading this over `SolBytes` -\> `string` or \`seq[bytes]
07:49:45FromDiscord<Elegantbeef> A lot of the pointers can be `seq[uint8]` really
07:49:47FromDiscord<impbox [ftsf]> if you use `--gc:arc` you can work without a GC
07:50:09FromDiscord<Elegantbeef> And it's deterministic, you can expand the code to see the memory frees
07:51:02FromDiscord<Elegantbeef> One thing i dont get is how this API even works
07:51:14PersonMcGuy@impbox [ftsf] Yeah I was actually going to try that, but I was worried I might just be trying to stick a bandaid on the whole problem without fully understanding potential issues with GC stuff
07:51:19FromDiscord<impbox [ftsf]> blockchain magic?
07:51:34PersonMcGuyI'm not super experienced with low level programming in general
07:52:30PersonMcGuylol pretty much, I barely understand what I'm looking at. I more so wanted to see if it was even possible before I just resigned to my fate with C.
07:52:50FromDiscord<impbox [ftsf]> well if you can do it in C, you can probably do it nicer in Nim =)
07:53:40FromDiscord<Elegantbeef> Well even if you are scared of the gc(you shouldnt be) you can reimplement the code 1\:1
07:53:52FromDiscord<Elegantbeef> So then it's just all pointers and smoke and mirrors or something like that πŸ˜›
07:54:48FromDiscord<Elegantbeef> I dont imagine arc is cryptographically insecure, but i'm also not knowledgable in cryptography
07:55:21PersonMcGuyThat's good to know. Here's hoping everything goes well. If so, I'll put this out on github so that someone can hopefully use this as a starting point
07:56:36PersonMcGuyThough I did have one more question. In the start of the header, they typedef'd a lot of things that have a nim equvialent, like "typedef signed char int8_t;"
07:57:32PersonMcGuyI'm assuming I would be okay to just use int8 for all those "int8_t"s right? I'm trying to copy things as closely as possible, but I figure there's not much point to having an intermediate type like that
07:57:42FromDiscord<Elegantbeef> Yea `int8` is 1 byte
07:57:59FromDiscord<Elegantbeef> If you notice they put asserts after, which is the important part
07:58:12FromDiscord<Elegantbeef> Since they're the same size they're golden
07:58:39PersonMcGuyPerfect! Thanks again to you both for all the help, I really appreciate it
07:59:35FromDiscord<Elegantbeef> This is going to be a rather cutdown clone if my brief glancing at it is any indication
08:00:45PersonMcGuyYeah, there's a ton of stuff that I don't think I need with nim
08:04:26FromDiscord<Elegantbeef> Oh wait this depends on something, that's what i was missing
08:04:48FromDiscord<Elegantbeef> So the afforementioned string/seq[uint8] probably isnt true then
08:12:57*GreaseMonkey quit (Read error: Connection reset by peer)
08:13:55*greaser|q joined #nim
08:29:22*Vladar joined #nim
08:35:53PMunchTwo new articles out: Multitasking in Nim: https://peterme.net/multitasking-in-nim.html and Asynchronous programming in Nim: https://peterme.net/asynchronous-programming-in-nim.html
08:39:00FromDiscord<haxscramper> What tool did you use to create timing diagrams?
08:39:54PMunchVim
08:39:59PMunchI just typed them out :P
08:43:19Zevvno cps. missed chance pmunch! :)
08:44:19PMunchI said that there's room for more ;)
08:44:48PMunchAre there any good CPS libraries in Nim yet? Or is that still being worked on?
08:44:56Zevvno one is using that shit
08:45:44Zevvjoking aside: leorize is in the progress of making a cps-oriented stdlib for IO and event queus and all that
08:45:48Zevvbut it's not in a working state
08:46:06ZevvI have this little test project where I just push and poke at CPS to see where it can bring me and where it breaks: https://github.com/zevv/cpstest
08:46:24Zevvit has a basic async ipv4/ipv6 socket layer and HTTP/HTTPS server and client and some other stuff
08:46:27Zevvbut it's the bare minimum
08:47:49supakeenclearly it should *all* be based on io_uring+bpf
08:48:08Zevvyeah until someone comes around complaining it doesn't run on windows, right
08:48:14supakeen:>
08:48:27Zevvlets be honest: overoptimization on these kind of things makes no sense for 99% of the cases
08:48:43Zevvhow many apps did you ever deploy doing gigabytes of I/O on 100k clients
08:49:16supakeenyou can make the same case for any asynchronous paradigm :)
08:49:20ZevvThis thing is a complete epoll based async event queue mechanism for CPS. No dependencies execpt for posix. https://github.com/zevv/cpstest/blob/master/evq.nim
08:49:33ZevvI prefer simplicity and correctness over performance, at this time in the project
08:49:34supakeenyea, i've put it in my reading list for the weekend!
08:51:04PMunchI still struggle a bit to see how this differs from what I was doing with closure iterators.. But maybe I'm just being a dumbo, guess I should do some reading as well..
08:52:02ZevvPMunch: I struggle as well. I tried to get there with iterators a few times and always got stuck somewhere. I'd *love* to see someone make something similar to this based on iterators.
08:53:00ZevvThe nice thing of CPS is that it actually mostly works these days. Once you're in 'cps land' you type your code just synchronously. No 'async', 'away', 'future[]', etc. You just do `let s = s.recvLine()` and the stuff does what's needed to get you a line
08:54:30supakeeni'm still confused by the abbreviation
08:55:17PMunchHmm, is it just me or is `callback=` from asyncstreams completely broken?
08:55:20FromDiscord<Elegantbeef> Continuation Passing Style if my memory is right πŸ˜€
08:55:45Zevvsupakeen: https://raw.githubusercontent.com/disruptek/cps/master/docs/cps.svg
08:56:00supakeenyes, but generally CPS means passing callbacks explicitly
08:56:11Zevvwe do that for you
08:56:14FromDiscord<Elegantbeef> I'm not allowed to talk about CPS directly after the incident
08:56:18supakeenexactly, this is implicit CPS
08:56:23supakeenwhich: cool
08:57:20Zevvthe nice thing is: you still /can/ do that. You can just juggle with continuations and and use them as you see fit
08:57:34Zevvthat's the added flexibility. It's a first class citizen, not something hidden in the compiler impl
08:57:37PMunchHmm, I think I see how this differs quite a bit
08:58:01supakeendoesn't it make it hard to reason about where a race could happen
08:58:15supakeenif you don't explicitly show where it could happen (with await or a callback)
08:58:26supakeenactually i shouldn't ask all this before i actually read
08:58:28supakeendisregard
08:58:33Zevvwill do
09:00:45*flynn quit (Read error: Connection reset by peer)
09:01:21Zevvnote that this is concurrency, not paralellism
09:01:31Zevvwhen you go parallel, you need to sit on your hands before you type
09:01:53*flynn joined #nim
09:02:20Zevvideally we'd like to get to some kind of share-nothing, golang channels like
09:02:20supakeenyes
09:02:43supakeenbut even with concurrency you generally still share things such as database connections
09:02:45Zevvarc has the nice promise of allowing moves over threads, but in practice I didn't get this to work without tripping asan
09:03:14supakeen(sadly)
09:03:16Zevvsupakeen: sure, but these can be abstracted away.
09:03:30ZevvYou can send a query, stash the continuation and revive it when the response comes in
09:03:41supakeenyes but then you get into the bits i generally don't like which is that any concurrency runtime needs its own libraries
09:03:59Zevvyou can't have your cake and eat it
09:04:05supakeenyea but it fragments :)
09:04:12PMunchOkay, so the callback of a FutureStream takes the stream itself, but I can't seem to create a valid signature for it. If I make the callback async it adds the Future[void] return type, but I need to be able to call read to get any data from it
09:04:25PMunchI guess waitfor would be safe in that context since I know it has data..
09:04:57*userj quit (Remote host closed the connection)
09:37:23FromDiscord<dom96> there are definitely many improvements to be made for FutureStream
09:38:00FromDiscord<dom96> (and possibly a redesign of its API, but it should sort of work at least :))
09:50:11*flynn quit (Read error: Connection reset by peer)
09:51:19*flynn joined #nim
10:03:37*flynn quit (Read error: Connection reset by peer)
10:04:51*flynn joined #nim
10:05:47*xet7 quit (Remote host closed the connection)
10:06:53*xet7 joined #nim
10:14:07*flynn quit (Read error: Connection reset by peer)
10:15:13*flynn joined #nim
10:18:13FromDiscord<hyu1996> why foo is not TestFoo https://media.discordapp.net/attachments/371759389889003532/883294801603203113/unknown.png
10:19:51FromDiscord<Rika> void is not a "type" per se
10:19:59FromDiscord<Rika> so it wont match that
10:20:14FromDiscord<Rika> : T usually means "actually returns something" so it cant be void
10:22:15FromDiscord<hyu1996> In reply to @Rika ": T usually means": soga, thx bro
10:24:40*flynn quit (Ping timeout: 240 seconds)
10:29:20*flynn joined #nim
10:38:00*flynn quit (Read error: Connection reset by peer)
10:39:07*flynn joined #nim
10:48:02*flynn quit (Read error: Connection reset by peer)
10:49:08*flynn joined #nim
11:00:29FromDiscord<hyu1996> https://nim-lang.github.io/Nim/manual_experimental.html#void-type
11:00:30FromDiscord<hyu1996> The document says "aΒ voidΒ type cannot be inferred in generic code"
11:04:45FromDiscord<Rika> yes
11:09:49*Vladar quit (Remote host closed the connection)
11:18:21*PersonMcGuy quit (Ping timeout: 256 seconds)
11:23:26PMunch@dom96, I was trying to respond to this and got stuck writing a proper callback: https://forum.nim-lang.org/t/8392
11:23:31PMunchNot sure if I like my solution either..
11:24:30PMunchDamn, 191 page hits for my async article already :P
11:24:44*flynn quit (Read error: Connection reset by peer)
11:25:51*flynn joined #nim
11:26:22NimEventerNew post on r/nim by PMunch: Article series on multitasking in Nim, first installment: async, see https://reddit.com/r/nim/comments/ph39h4/article_series_on_multitasking_in_nim_first/
11:36:02FromDiscord<dom96> hmmm, there is a better way
11:41:36FromDiscord<dom96> The `callback=` is really just confusing it seems
11:42:03FromDiscord<dom96> PMunch: I replied to the thread
11:54:17PMunchAh, yeah I would also do it like that. But I assumed they had wanted to use the callback for a specific reason
11:58:08FromDiscord<dom96> You should assume they don't have a good reason to do so πŸ™‚
11:59:32FromDiscord<enthus1ast> never used callback= before, and i've written a lot of async code
11:59:53FromDiscord<dom96> That goes for most things. It's why I always ask people to describe their high level goal when they are asking a specific question of how to do x. Often they are following the wrong path.
12:02:14*stkrdknmibalz quit (Quit: WeeChat 3.0.1)
12:02:38*arkurious joined #nim
12:02:44*max22- quit (Ping timeout: 252 seconds)
12:06:01*supakeen quit (Quit: WeeChat 3.2)
12:06:30*supakeen joined #nim
12:13:03FromDiscord<Cark> @enthus1ast i've been giving a go at your service example, because my implementation silently fails, but it looks like oldwinapi doesn't compile anymore ? or maybe something wrong with my setup ?
12:14:52FromDiscord<Cark> trying to compile with oldwinapi, i get a crazy error stating that 2147746288 cannot be converted to a DWORD, which i beleive fits in a DWORD ><
12:15:59FromDiscord<Cark> then again DWORD is defined as int32 in oldwinapi, so obviously not
12:23:40FromDiscord<Cark> ah but it works with winim and some slight adjustments
12:35:47*flynn quit (Read error: Connection reset by peer)
12:36:53*flynn joined #nim
13:35:58*PMunch quit (Quit: Leaving)
13:37:45*PMunch joined #nim
13:37:53*rockcavera joined #nim
13:37:53*rockcavera quit (Changing host)
13:37:53*rockcavera joined #nim
13:44:32*Gustavo6046 quit (Ping timeout: 244 seconds)
13:44:55*Gustavo6046 joined #nim
13:46:12*nrds joined #nim
13:56:49FromDiscord<Cark> my issue is that adding --threads:on while compiling makes it crash ... no idea how to fix this
14:00:53FromDiscord<Cark> would it be possible to sidestep the nim threading facilities and use platform threads directly ? would this expose me to subtle bugs ?
14:01:24FromDiscord<Cark> (by not using --threads:on)
14:08:46FromDiscord<treeform> I tried that, I got mystery bugs, decided to do other stuff.
14:10:17FromDiscord<Cark> mhh damn that's a show stopper... at some point i'll need to serve some gui via http for that windows service, and i guess there is no doing this without threads
14:10:40FromDiscord<Cark> outside writing my own http server, which i don't want to do =)
14:18:19*max22- joined #nim
14:23:02FromDiscord<enthus1ast> @Cark\: try to use winim
14:23:17FromDiscord<enthus1ast> Could just work
14:23:33FromDiscord<Cark> @enthus1ast I did, there is a PR on your project about it
14:23:40*Gustavo6046 quit (Ping timeout: 240 seconds)
14:23:46*Gustavo6046_ joined #nim
14:23:53FromDiscord<enthus1ast> Yeah platform threads could work
14:24:08FromDiscord<enthus1ast> Ah nice
14:24:16FromDiscord<Cark> i'll give it a try, thanks =)
14:24:43*Vladar joined #nim
14:25:27FromDiscord<enthus1ast> Will merge it later when not on mobile
14:25:27FromDiscord<dom96> @Cark what are you working on?
14:26:04FromDiscord<enthus1ast> BUT also consider NSSM as your service, works quite nicely
14:26:19*Gustavo6046_ is now known as Gustavo6046
14:26:53FromDiscord<enthus1ast> Then you don't have the hassle working with the service stuff on windows and just write normal binaries
14:26:55FromDiscord<Cark> @dom96 pretty simple spying program to instill fear in my daughter, I did catch her talking to strangers on discord, she's too young for that.... but the real goal is to evaluate nim, so I go as deep as possible into system programming, threading and stuff
14:27:44FromDiscord<enthus1ast> Better talk than hack imho πŸ˜‰
14:27:59FromDiscord<Cark> @enthus1ast i'm trying to learn how to effectively use nim
14:28:08FromDiscord<Cark> so i'll go the hard way
14:28:39FromDiscord<dom96> Wait, are you serious or joking. Spying on your daughter is a really bad idea
14:29:10FromDiscord<Cark> there is no secret about it...and she's 8
14:29:24FromDiscord<Cark> there will be a toast notification too
14:30:34FromDiscord<Cark> i don't even intend to acdtually spy, just show that i can =)
14:30:37FromDiscord<dom96> I see, that's better, but then your daughter will just find a different way to use Discord
14:30:50FromDiscord<dom96> and trust you less (which is why this is a bad idea)
14:31:08*PMunch quit (Quit: Leaving)
14:31:09FromDiscord<Cark> she would trust less if i was doing it secretly
14:31:36*vicfred joined #nim
14:31:40FromDiscord<Cark> we had a big talk about discord, she knows she messed up, and she's ok with it
14:34:36FromDiscord<Cark> real end goal is to build callshop point of sales software, have the telephony routing and messaging going through a windows service
14:35:16FromDiscord<Cark> that's a little too big to just go at it with nim without prior experience
14:35:40*Pyautogui joined #nim
14:36:44*sdmcallister joined #nim
14:38:52*sdmcallister quit (Client Quit)
14:40:51*Pyautogui quit (Ping timeout: 244 seconds)
15:00:10*flynn quit (Read error: Connection reset by peer)
15:01:17*flynn joined #nim
15:05:19FromDiscord<garuse> Hi! I mostly work from terminal (tmux) and it would be nice if i could access nim documentation from there. Is there a nim tool/pkg that can search and print documentation to stdout?
15:08:55FromDiscord<enthus1ast> @garuse\: maybe use links or w3m
15:37:42*Vladar quit (Quit: Leaving)
15:58:50FromDiscord<moein> is there any tutorial on how to compile and use a nim app in android? I wrote a simple text search functioanlity and i'd like to use it an android project
15:59:00FromDiscord<moein> (edit) "functioanlity" => "functionality"
15:59:55FromDiscord<Rika> i was doing this right now
15:59:59FromDiscord<Rika> doing that
16:00:11FromDiscord<Rika> reading https://github.com/yglukhov/jnim and https://github.com/GordonBGood/NimHelloJNI/
16:00:13nrds<R2D299> itHub: 7"Nim - Java bridge"
16:08:47FromDiscord<Ayy Lmao> Does anyone with discord developer with experience know if it is possible to send audio from your computer to a discord bot? I've been looking into https://github.com/krisppurg/dimscord but it looks like the audio stuff isn't complete yet.
16:08:50nrds<R2D299> itHub: 7"A Discord Bot & REST Library for Nim."
16:09:44FromDiscord<moein> In reply to @Rika "reading https://github.com/yglukhov/jnim and https:": I guess i did not explain good enough, by nim app i mean exposing a nim proc to android and using it in a android project that's written with kotlin.
16:09:47nrds<R2D299> itHub: 7"Nim - Java bridge"
16:10:01FromDiscord<Rika> In reply to @moein "I guess i did": yes that is still relevant
16:10:05FromDiscord<Rika> that is what i am doing as well
16:10:22FromDiscord<Rika> `Nim Hello JNI is an Android sample that uses JNI to call C code from a Android Java Activity, with the C code generated from the Nim computer language instead of directly from C source files.`
16:16:04*flynn quit (Read error: Connection reset by peer)
16:17:10*flynn joined #nim
16:20:15FromDiscord<Ayy Lmao> sent a code paste, see https://paste.rs/N53
16:20:25FromDiscord<Ayy Lmao> Is there some downside to this that I'm not thinking of?
16:24:44FromDiscord<Yardanico> > converter
16:24:47FromDiscord<Yardanico> that's why :)
16:25:15FromDiscord<Yardanico> converters can result in some really weird interactions in the code, and make your compilation errors really confusing sometimes
16:25:50FromDiscord<Rika> ~~i mean look at js~~
16:26:37FromDiscord<Rika> get will raise when none, so you might turn something that doesnt raise into something that does
16:26:54FromDiscord<Ayy Lmao> Converters probably aren't the best way of dealing with it, but I was just using it as an example to show how it would work. I've just seen a few languages that have optional values as more of a builtin type and streamline dealing with them
16:27:06FromDiscord<Yardanico> nim might get a built-in Opt type
16:27:17FromDiscord<Yardanico> also, converters are only used thrice in the whole nim stdlib
16:27:25FromDiscord<Rika> ooh where
16:27:43FromDiscord<Ayy Lmao> In reply to @Yardanico "nim might get a": That would be really cool
16:27:47FromDiscord<Yardanico> https://github.com/nim-lang/Nim/blob/devel/lib/js/dom.nim#L1678 https://github.com/nim-lang/Nim/blob/devel/lib/pure/httpcore.nim#L172 https://github.com/nim-lang/Nim/blob/devel/lib/system/widestrs.nim#L53
16:27:55FromDiscord<Yardanico> maybe more, but github only showed these
16:31:46FromDiscord<Ayy Lmao> I'm also not a huge fan of having to specify the type when using `none`
16:32:31FromDiscord<Ayy Lmao> I suppose it's necessary if you want to use type inference, but other than that it seems clunky
16:34:40*vicfred quit (Quit: Leaving)
16:35:10*flynn quit (Read error: Connection reset by peer)
16:36:16*flynn joined #nim
16:42:00FromDiscord<Rika> i keep on saying its a side effect of the lack of "backward inference" but im not sure if thats the only reason
16:44:24FromDiscord<Yardanico> In reply to @Rika "i keep on saying": Even with return type interference it will only be possible if you assign to already existing variables, otherwise you'll have to specify the type anyway
16:44:52FromDiscord<Rika> or arguments
16:45:04FromDiscord<Rika> theyre possible with arguments i would assume
16:45:10FromDiscord<Yardanico> and for existing variables it's really easy to just make a none template overload
16:45:12FromDiscord<Rika> unless there are many matching arguments ofc
16:57:56FromDiscord<Ayy Lmao> In reply to @Yardanico "Even with return type": I think that is the case where it would be nice to have it. Specifically for dealing with existing variables and early `return none` in functions that return optional values.
16:58:10FromDiscord<Yardanico> you can just use "return" in this case fyi
16:58:19FromDiscord<Yardanico> default Option value is none
16:58:27FromDiscord<Ayy Lmao> Interesting, I didn't realize that
16:58:36FromDiscord<Ayy Lmao> That makes things a bit easier
16:58:57FromDiscord<Ayy Lmao> I've been doing return none(whatever) this whole time haha
17:21:18*ad-absurdum quit (Quit: Leaving)
17:21:25*flynn quit (Read error: Connection reset by peer)
17:22:32*flynn joined #nim
17:42:34*flynn quit (Ping timeout: 252 seconds)
17:47:09*flynn joined #nim
17:57:12*flynn quit (Read error: Connection reset by peer)
17:58:18*flynn joined #nim
18:19:32FromDiscord<Neko~Neko~ni> sent a code paste, see https://play.nim-lang.org/#ix=3xR3
18:21:29FromDiscord<Yardanico> what version is your gcc?
18:21:31FromDiscord<Yardanico> g++ -v
18:21:40FromDiscord<Neko~Neko~ni> lemme check\
18:21:54FromDiscord<Neko~Neko~ni> 4.4.1
18:21:58FromDiscord<Yardanico> yeah, that's very old
18:22:02FromDiscord<Yardanico> gnu++14 requires gcc 6.1 at least
18:22:17FromDiscord<Yardanico> i assume you're using mingw?
18:22:23FromDiscord<Neko~Neko~ni> Yeas
18:22:28FromDiscord<Neko~Neko~ni> (edit) "Yeas" => "Yes"
18:22:48FromDiscord<Yardanico> then you can install https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/mingw-w64-v9.0.0.zip/download and add it to PATH
18:22:50FromDiscord<Neko~Neko~ni> so i should update
18:22:52FromDiscord<Yardanico> and remove the other mingw installation from path
18:23:44FromDiscord<Neko~Neko~ni> i don't think i installed g++ myself,or so i think.desn't nim install that stuff with its installation
18:23:46FromDiscord<Neko~Neko~ni> ?
18:23:58FromDiscord<Neko~Neko~ni> (edit) "think.desn't" => "think.doesn't"
18:24:25FromDiscord<Yardanico> how did you install nim?
18:24:42FromDiscord<Neko~Neko~ni> from zip file i think
18:24:53FromDiscord<Neko~Neko~ni> the official installation process
18:24:55FromDiscord<Yardanico> hm, weird, the shipped compiler should've been updated there
18:25:24FromDiscord<Yardanico> lemme check
18:26:21FromDiscord<Yardanico> no, the mingw shipped with the nim is the last one, what nim version did you install?
18:26:31FromDiscord<Yardanico> or maybe you have an older mingw install from some time before?
18:26:31FromDiscord<Neko~Neko~ni> nvm i think this was problem on my end.i had Falcon C++ installed which also installed gcc and g++.
18:26:34FromDiscord<Yardanico> yeah
18:26:38*max22- quit (Ping timeout: 252 seconds)
18:26:43FromDiscord<Neko~Neko~ni> Thanks anyway
18:26:55FromDiscord<Yardanico> nim windows installer downloads mingw with gcc 11.1
18:28:12FromDiscord<Neko~Neko~ni> removing the g++,gcc from PATH should do trick(i mean the gcc,g++ that was bundles with falcon)
18:28:26FromDiscord<Neko~Neko~ni> (edit) "bundles" => "bundled"
18:28:27FromDiscord<Yardanico> yes
18:28:54FromDiscord<Yardanico> it's just 1 folder though, since in gcc/mingw all binaries are kept in the single "bin" folder, so just check all directories you have in your path and remove that one
18:29:43FromDiscord<Neko~Neko~ni> And wow my PATH variable is a mess.lol.Thanks for the help
18:40:46*flynn quit (Read error: Connection reset by peer)
18:41:53*flynn joined #nim
18:56:08*max22- joined #nim
19:07:28*NimEventer quit (Remote host closed the connection)
19:07:35*NimEventer joined #nim
19:35:11FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=3xRs
19:45:00FromDiscord<treeform> some_other_macro does
19:48:02*rockcavera quit (Ping timeout: 245 seconds)
19:51:29*flynn quit (Read error: Connection reset by peer)
19:52:36*flynn joined #nim
20:06:40*Gustavo6046 quit (Ping timeout: 240 seconds)
20:11:36*Gustavo6046 joined #nim
20:17:34*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
20:17:53*Gustavo6046 joined #nim
20:30:49*flynn quit (Read error: Connection reset by peer)
20:31:56*flynn joined #nim
20:32:45FromDiscord<haxscramper> In reply to @dain "what is the order": https://forum.nim-lang.org/t/8357#53872 for more detailed explanation
20:38:29FromDiscord<dain> thank
20:49:33*Gustavo6046 quit (Remote host closed the connection)
20:51:24*Gustavo6046 joined #nim
21:03:43FromDiscord<krisppurg> In reply to @Ayy Lmao "Does anyone with discord": Yeah, I was implementing voice about last year, but no luck for some reason :(. I've tried to look for solutions to, and asked help, still nothing. I am not giving up on voice, but rather I feel unmotivated to work on so.↡↡You could try modifying my code and implement opus and the whole libsodium stuff and see if it works or not (maybe there could be a problem with udp connection o
21:13:24FromDiscord<Varriount> Hm, is Zevv around?
21:13:49*auxym_ joined #nim
21:18:54FromDiscord<dom96> @Varriount might be best to just ask as if Zevv is here
21:20:23*flynn quit (Read error: Connection reset by peer)
21:21:31*flynn joined #nim
21:23:53ZevvVarriount: zup
21:29:24*flynn quit (Read error: Connection reset by peer)
21:30:31*flynn joined #nim
21:34:42*auxym_ quit (Ping timeout: 244 seconds)
21:55:47*auxym_ joined #nim
22:09:28FromDiscord<Ayy Lmao> In reply to @krisppurg "Yeah, I was implementing": It's currently over my head I think, but I might try at some point if I can get more familiar with the discord API.
22:14:36*auxym_ quit (Ping timeout: 256 seconds)
22:21:12*max22- quit (Quit: Leaving)
22:39:48FromDiscord<Goat> How do I find the literal `/` character using the re modules?
22:42:52*auxym_ joined #nim
22:46:09FromDiscord<Elegantbeef> isnt it `\/`
22:52:34FromDiscord<Goat> No
22:52:37FromDiscord<Goat> I tried that
22:57:14FromDiscord<Elegantbeef> What are you trying to find/capture?
22:57:19Zevvworks for me
22:57:40Zevv!eval import re; echo find("fl/p", re"/")
22:57:50Zevvoh no more bot here
22:58:27FromDiscord<Elegantbeef> !eval import re; echo find("fl/p", re"/")
22:58:36FromDiscord<Elegantbeef> Cmon bot
22:58:40NimBotCompile failed: <no output>
22:58:42Zevvwhat bot would that be
22:58:42nrds<R2D299> <no output>
22:58:47FromDiscord<Elegantbeef> I think it's just dead zevv you killed nimbot
22:58:52Zevvagain
22:59:00FromDiscord<dom96> Don't blame NimBot for playground's woes
22:59:28NimBotCompile failed: <no output>
22:59:28FromDiscord<Elegantbeef> I'll blame who i want just cause your name rhymes with mom doesnt mean you're mine
23:00:00FromDiscord<Varriount> In reply to @Zevv "<@169336940846514176>: zup": I'm trying to use a NPeg grammar spread across 3 files, however they don't seem to be picking each other up.
23:00:56Zevvyou use `grammar:` blocks
23:01:03Zevv?
23:02:27FromDiscord<dom96> also is R2D2 just a copy of NimBot?
23:02:30FromDiscord<dom96> !ping
23:02:30NimBotpong
23:02:30FromDiscord<StardustAnnouncer> Pong!
23:05:16ZevvVarriount: ping me tomorrow, I'm off for a nap
23:05:38FromDiscord<Varriount> Darn
23:05:54FromDiscord<Varriount> Ah well, at least I'm making progress
23:06:31FromDiscord<Varriount> dom96: Is there a reason Nimble (and Nim in general) doesn't use Window's root certificate store with OpenSSL?
23:06:39FromDiscord<Varriount> (edit)
23:06:50FromDiscord<Varriount> (edit) removed "@dom96"
23:06:55FromDiscord<Varriount> @dom96 ^
23:07:39FromDiscord<dom96> I don't know/recall the details but I think it just wasn't trivial to implement
23:10:22FromDiscord<Varriount> In reply to @dom96 "I don't know/recall the": I mean, I'm implementing it now, based off of https://github.com/douderg/net/blob/0f132b3f2a4808438e2638d429a72179259b8e82/src/cert_utils.cpp#L13
23:10:47FromDiscord<Varriount> Maybe it's just because Windows developers are in the minority.
23:11:37FromDiscord<dom96> possibly, I am on Windows but using WSL
23:11:49FromDiscord<dom96> and probably running an old version of Nimble anyway
23:19:09*PersonMcGuy joined #nim
23:20:40PersonMcGuyHello all, just curious, does anyone know of any libraries to make dealing with UncheckedArrays easier? I know it's pretty low level, so the actions needed generally aren't too involved, but I guess I'm looking for some standardized implementations of basic functionality
23:22:47FromDiscord<Elegantbeef> Easier like with the fill logic from yesterday?
23:24:03FromDiscord<Varriount> In reply to @PersonMcGuy "Hello all, just curious,": What do you mean by "easier"?
23:25:26PersonMcGuyYeah, pretty much. I went through a first sweep of the header file and got everything, but it handles more like C with nim syntax (still dealing with pointers and array lengths). So I'm trying to do a second pass and trying to make it a simple as possible (i.e. turning all those unchecked arrays into seqs when possible)
23:26:15FromDiscord<Elegantbeef> Well the biggest QOL you can do is `type ByteArray = ptr UncheckedArray[uint8]`
23:26:30FromDiscord<Elegantbeef> But aside from that, there isnt much "easier" to be had
23:26:51PersonMcGuyThat is a good one, I should definitely do that
23:28:47PersonMcGuyLet me write up some code about what I was thinking about
23:29:20PersonMcGuyOh is the playground down?
23:29:34FromDiscord<Elegantbeef> seems like it
23:29:48FromDiscord<Elegantbeef> https://doongjohn.github.io/nim-playground/ exists aswell
23:30:53PersonMcGuy@Elegantbeef How do you send a link with the code like you did last night?
23:31:12FromDiscord<Elegantbeef> Well i used the playground πŸ˜€
23:31:18FromDiscord<Elegantbeef> But it's not playing nice
23:31:24PersonMcGuyAw man
23:31:57PersonMcGuyOkay, I'll just use pastebin again
23:37:24FromDiscord<Elegantbeef> Well here are some niceties you might like https://hastebin.com/axucarasud.md
23:39:05*stkrdknmibalz joined #nim
23:50:03*flynn quit (Remote host closed the connection)
23:51:11*flynn joined #nim
23:51:23FromDiscord<Yardanico> @ElegantBeef off by 1 :)
23:51:29FromDiscord<Yardanico> 0..size will emit from 0 to 10, so 11 items in total
23:51:41FromDiscord<Elegantbeef> ah yes forgot to handle that
23:51:58FromDiscord<Elegantbeef> replace all `0..size` with `0..<size`
23:52:26FromDiscord<Elegantbeef> Cmon yard you can say off by one you dont have to belittle me with an explanation of inclusive ranges
23:52:47FromDiscord<Yardanico> i'm doing it lovingly!
23:53:26FromDiscord<Elegantbeef> Yea i'm sure you lovingly like being on a pedestal
23:54:57FromDiscord<Yardanico> ok, so another explanation - I explained the ranges because other people read this chat too
23:55:12FromDiscord<Elegantbeef> Lol i'm just joking of course
23:55:16FromDiscord<Yardanico> i know
23:55:29FromDiscord<Yardanico> :tf: