<< 10-08-2020 >>

00:02:35*Lord_Nightmare quit (Ping timeout: 240 seconds)
00:04:30*dulsi_ joined #nim
00:07:24*dulsi quit (Ping timeout: 256 seconds)
00:08:21*hnOsmium0001 joined #nim
00:19:17FromDiscord<exelotl> Bleh I have this annoying problem in my project where the nim compiler crashes when I pass a varargs[untyped] to another template that also takes a varargs[untyped]
00:19:25*oddp quit (Ping timeout: 240 seconds)
00:19:53FromDiscord<exelotl> I tried making a minimal example but I can't reproduce it :(
00:22:22*opal joined #nim
00:26:52*abm quit (Read error: Connection reset by peer)
01:26:08*unihernandez22 joined #nim
01:26:49*unihernandez22 quit (Client Quit)
02:00:03*apahl quit (Ping timeout: 260 seconds)
02:01:56*apahl joined #nim
02:03:53*theelous3 quit (Read error: Connection reset by peer)
02:49:05*rockcavera joined #nim
02:51:23*muffindrake quit (Ping timeout: 260 seconds)
02:53:32*muffindrake joined #nim
03:05:58*waleee-cl quit (Quit: Connection closed for inactivity)
03:13:23*leorize quit (Ping timeout: 240 seconds)
03:15:45*leorize joined #nim
03:24:14*Cthalupa quit (Ping timeout: 264 seconds)
03:24:29Zevvyeah but be honest. who would ever think of doing such a thing
03:25:06Zevvvarargs[untyped]
03:25:09disruptekthe manual says you're doing it wrong.
03:32:35*Jjp137 quit (Ping timeout: 240 seconds)
03:33:21*Jjp137 joined #nim
03:33:38FromDiscord<downpour> i haven't really touched code in half a decade the crux of my experience was a 4 in ap computer science, and I wanted to try my hand at nim, being stuck in quarantine in all. i definitely have looked through the site and there's a very comprehensive beginner guide (https://narimiran.github.io/nim-basics/) but i tend to be a visual/auditory learner and i was wondering if anyone could recommend a video series with the same jist as this gui
03:34:14disruptekkilonie has a series on youtube.
03:34:30FromDiscord<downpour> alright, i will check it out! thank you ๐Ÿ™‚
03:41:32disruptekZevv: am i crazy to introduce an optional flag to emit unicode so that, eg. Foo:Object turns into Foo๊ž‰Object instead of Foocolon_Object?
03:45:06Zevvyeah, that stuff is ungreppable
03:45:22Zevvwhy not Foo__Object or similar?
03:45:44Zevvwell its not ungreppab
03:45:56Zevvbu itll confuse people
03:46:15disruptekbecause if you're looking for the $ for something, you don't wanna search for __.
03:46:18Zevvutf8 is everywere, except for where it isnt
03:46:33Zevvalso not for your magic unicode identifiers
03:46:42Zevvalso, im not even sure if that is valid C
03:47:06disruptekit's valid if it's \u1234, which is fine with us -- we're generating it, after all.
03:47:53disruptekprobably right to just suck it up, though.
03:48:05Zevvok, im on mobile, i assume this is about the funny : right?
03:48:28disruptekyes?
03:48:44Zevvmaybe foo_colon_object
03:48:54Zevvbut really, stick to ascii is my gut feeling
03:48:57disruptekthat's what it is now, chucklhead.
03:49:09disruptekyeah, was just looking for you to say that. ๐Ÿ˜‰
03:49:22Zevvnoo now its FooColon_object
03:49:29disrupteki'm out. another wasted day on mangling. cya in a few.
03:49:33disruptekwell, true.
03:49:52Zevvdont let the bad bugs bite
03:50:11Zevvlike, you know, ticks and the like
03:50:45disruptekah, bloodsuckers.
03:51:10disruptekit's worms i have a problem with.
03:51:39disruptekprobably shouldn't have skipped shower day. ๐Ÿคท
04:06:01*supakeen quit (Quit: WeeChat 2.8)
04:06:37*supakeen joined #nim
04:10:03*Lord_Nightmare joined #nim
04:19:17*Cthalupa joined #nim
04:51:38voltistAny lawyers on? :)
04:53:03*rockcavera quit (Remote host closed the connection)
04:57:53*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
04:57:55FromDiscord<Doof Doof> Is it possible to define an alternative entry point for compilation output? So instead of main it would be a user defined function name?
04:58:04Yardanico--noMain
04:58:11Yardanicoand define your own main or DllMain or whatever
04:58:14Yardanicodon't forget to exportc
04:58:40FromDiscord<Doof Doof> That's what I'm doing but I was asking about what I said
04:59:05Yardanicolibc expects the default "main" function to be present
04:59:12Yardanicoor the compiler, I'm not exactly sure
04:59:26*Lord_Nightmare joined #nim
04:59:36Yardanicobut why do you need that?
05:02:27*vicfred quit (Quit: Leaving)
05:04:24FromDiscord<Doof Doof> Well I just realized it probably wouldn't make a difference in my case since I don't actually need a new name every compilation - but it would be nice to not need to wrap my entry point in a c function that's only purpose is to invoke ninstart and my custom main. I'm not in control of that scenario without changing a framework I'm using.
05:38:34FromDiscord<Skaruts> I'm using the official lua bindings to make a dll I can load up in lua, and I have a bit of a problem here
05:38:38FromDiscord<Skaruts> How do I register a lua table to create a namespace in lua?
05:38:42FromDiscord<Skaruts> (So I don't have my entire lib in lua globals)
05:38:44FromDiscord<Skaruts> I'd like to do the equivalent of the C code I included here: https://play.nim-lang.org/#ix=2tKW
05:40:54*maier joined #nim
06:09:59*PMunch joined #nim
06:17:22*solitudesf joined #nim
06:24:46*bung_ joined #nim
06:27:49*bung quit (Ping timeout: 264 seconds)
07:18:25PMunchZevv, are you around? I'm apparently too dumb to figure out how npeg works..
07:25:46*kwilczynski quit (Ping timeout: 256 seconds)
07:26:17FromDiscord<Varriount> PMunch: I can help, though I'll be going to bed soon
07:26:25*kwilczynski joined #nim
07:29:37PMunchOh great :)
07:29:47PMunchRight now I'm just trying to match a string
07:30:04PMunchAKA starts with ", followed by any character but ", and ends with "
07:30:44PMunchI've got '"' * +1 * '"' but it doesn't match anything..
07:31:44PMunchhttps://play.nim-lang.org/#ix=2tLj
07:32:02PMunch(npeg works in the playground, so you can run that right on the playground)
07:32:18PMunch@Varriount ^
07:34:25FromDiscord<Varriount> Hm
07:35:28FromDiscord<Varriount> @PMunch: NPeg doesn't backtrack repetitions
07:36:07FromDiscord<Varriount> The 1 needs to explicitly be any character plus 1
07:36:25FromDiscord<Varriount> Er, any character but "
07:36:34PMunchWait. I thought 1 was any character..
07:37:32PMunchThis doesn't work either though: https://play.nim-lang.org/#ix=2tLm
07:37:58FromDiscord<Rika> you're not capturing it
07:38:07FromDiscord<Rika> lol
07:38:20FromDiscord<Rika> >+ instead of just + ๐Ÿ˜›
07:38:33PMunchAaaah
07:38:35PMunchDurr
07:38:43FromDiscord<Varriount> Yeah, https://play.nim-lang.org/#ix=2tLn
07:39:12FromDiscord<Varriount> Though, I always use >() for stylistic reasons
07:39:57FromDiscord<Varriount> PMunch: This may help you: https://github.com/Varriount/commandant/blob/master/commandant/lexer.nim#L150
07:40:47FromDiscord<Varriount> Or it might confuse you.
07:44:21*opi joined #nim
07:44:54FromDiscord<Varriount> PMunch: What are you writing?
07:44:57PMunchGot strings working, but struggling a bit with escapes.. https://play.nim-lang.org/#ix=2tLp
07:45:11PMunchI'm writing stacklang v2
07:45:20PMunchAnd I wanted to add a string data type
07:45:49PMunchSo now I need something slightly more complex than splitWhitespace to parse the input :P
07:48:13PMunchAh, another backtracking issue
07:48:47PMunchSwitching the order of 1-'"' and ('\\' * '"') helped
07:49:51*moerm joined #nim
07:50:12moermHello everyone ;)
07:50:20FromDiscord<Rika> hello
07:53:55*NimBot joined #nim
07:55:20FromDiscord<Varriount> PMunch: The 1 is going to match a backwards slash too. Reverse the order
07:56:05PMunchYeah I realised
07:57:05FromDiscord<Varriount> PMunch: You might want to use multiple rules.
07:57:21PMunchHaha, I've already split it :)
07:57:51PMunchhttps://play.nim-lang.org/#ix=2tLs
08:05:51*oddp joined #nim
08:17:33FromDiscord<Varriount> PMunch: I'm going to head off to bed. Any other questions?
08:38:36*Vladar joined #nim
08:46:02*abm joined #nim
08:50:06FromDiscord<lqdev> PMunch: the way zevv does it in his json example is instead of matching 1 he matches for a rule stringChar or sth like that and that matches any character except \, if it's a \ then it matches an escape sequence
09:01:42*Senketsu joined #nim
09:05:01*krux02 joined #nim
09:12:54moermHave a nice day everyone
09:13:00*moerm quit (Quit: Leaving)
09:13:45*Senketsu quit (Ping timeout: 240 seconds)
09:14:27*endragor_ joined #nim
09:14:27*endragor quit (Read error: Connection reset by peer)
09:16:43alehander92you too
09:16:44alehander92:)
09:16:52alehander92morning/lunch
09:17:41*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:21:03*Perkol joined #nim
09:21:52PMunchSorry I got yanked off to a meeting. @lqdev, that is actually not a bad way of doing it
09:45:33FromDiscord<Byte> Hey :D
09:45:38FromDiscord<Clyybber> hey
09:47:07FromDiscord<Byte> Sup
09:57:00FromDiscord<Byte> Aight nice to hear
10:19:00*fililip joined #nim
10:19:32*fililip left #nim (#nim)
10:26:44*Senketsu joined #nim
10:31:16*Perkol quit (Remote host closed the connection)
11:18:54*PMunch quit (Quit: Leaving)
11:20:03*PMunch joined #nim
11:32:30FromDiscord<vieru> hi
11:32:35FromDiscord<vieru> winim users online ?
11:32:55*Cthalupa quit (Ping timeout: 246 seconds)
11:38:42*Cthalupa joined #nim
11:40:04*opi quit (Remote host closed the connection)
11:58:41PMunch@vieru, doesn't seem like it. What's your issue?
11:59:22FromDiscord<vieru> sry for bothering I fixed it, that's why i deleted my messages lol
11:59:52FromDiscord<vieru> on irc i think they still show up
12:00:04PMunchAh yes, IRC doesn't have a concept of deleting messages
12:01:27*Cthalupa quit (Ping timeout: 260 seconds)
12:03:02ZevvPMunch: zup
12:03:58*Cthalupa joined #nim
12:03:58PMunchHi :)
12:04:14PMunchI just needed some help with npeg earlier, but I've figured it out now
12:04:23Zevvwasn't that hard, was it :)
12:06:01*supakeen quit (Quit: WeeChat 2.8)
12:06:34*supakeen joined #nim
12:06:45PMunchNope, as soon as I got used to the whole no-backreference thing
12:07:00Zevvno-backreference thing?
12:07:16PMunchWell I was trying to parse strings
12:08:00Zevvhttps://github.com/zevv/npeg/blob/master/tests/performance.nim#L74
12:08:27PMunchAnd for detecting escapes for example I had *(1-'"') | *('\\' * '"')
12:08:50PMunchWhich didn't work because it had already consumed the \ by the time it failed :P
12:08:57Zevvbut you got it now, I assume?
12:09:19PMunchYeah
12:09:24Zevvsweet
12:09:28PMunchNot as fancy as that escaping though
12:09:33Zevvso was it as good for you as it was for me, your first time
12:09:35Zevvdoing Npeg
12:09:42PMunchJust \" supported
12:09:55PMunchHaha, yeah I really like npegging now
12:09:59Zevv\o/
12:10:16PMunchThe * to concatenate got me in the beginning though ngl
12:10:39Zevvthat is exactly the reason I removed this one sentences from the Nim manual the other day
12:10:55Zevv"you can't change syntax wiht macros, but that's ok becaue Nims syntax is flexible enouygh anyway"
12:11:12PMunchHehe, what is it usually in PEG?
12:11:14Zevvit's still on the website I see: "Macros cannot change Nim's syntax because there is no need for it โ€” the syntax is flexible enough."
12:11:18Zevvit's implicit
12:11:20Zevvthere is no operator
12:11:30PMunchAah
12:12:26FromDiscord<Clyybber> we could actually support postfix operators, at least in some cases
12:12:40Zevvyeah I know, but they were too limited
12:12:50FromDiscord<Clyybber> oh, no I mean we *could* as in we don't
12:13:11FromDiscord<Clyybber> but now I'm curious
12:13:14FromDiscord<Clyybber> what did you mean
12:13:23ZevvI think there are a few 'postfixy' things already
12:15:17Zevv"There is no way to declare postfix operators: all postfix operators are built-in and handled by the grammar explicitly."
12:16:15FromDiscord<Clyybber> yeah
12:16:26FromDiscord<Clyybber> but I mean in theory you could allow it without being ambiguous
12:17:15Zevvhow come you're so sure of that. You know https://nim-lang.github.io/Nim/manual.html#syntax-grammar by heart? :)
12:17:26FromDiscord<Clyybber> it recently occured to me
12:17:36FromDiscord<Clyybber> its simple
12:17:52FromDiscord<Clyybber> when an operator is immediately following some expression without a space in between
12:17:58Zevvdon't go there
12:18:07FromDiscord<Clyybber> *and* if the next line has <= indentation
12:18:09Zevv"without a space in between"
12:18:12FromDiscord<Clyybber> then its a postifx operator
12:18:22FromDiscord<Clyybber> Zevv: Do you know how the prefix operators work :p
12:18:26*arecacea1 quit (Remote host closed the connection)
12:18:26FromDiscord<Clyybber> they work exactly like that
12:18:34Zevvyeah it's bad enough already :)
12:18:34FromDiscord<Clyybber> put a space in between and its an infix :)
12:18:38FromDiscord<Clyybber> no thats elegant
12:18:47Zevvwell wait that's not true
12:19:11*arecacea1 joined #nim
12:19:28FromDiscord<Clyybber> !eval echo $ 1
12:19:29NimBotCompile failed: /usercode/in.nim(1, 6) Error: type mismatch: got <proc (x: varargs[typed]){.gcsafe, locks: 0.}, int literal(1)>
12:19:46FromDiscord<Clyybber> see :)
12:20:00FromDiscord<Clyybber> of course there are some cases where its unambiguous
12:20:00Zevvhold it
12:20:22*opi joined #nim
12:22:21Zevvhttps://play.nim-lang.org/#ix=2tNb
12:23:06FromDiscord<Clyybber> yeah because its unambiguous there
12:24:01FromDiscord<Clyybber> same as it would be in some cases with postfix
12:24:26FromDiscord<Clyybber> you could allow postfix with spaces in between most of the time
12:24:34Zevvwell, go for it!
12:24:38FromDiscord<Clyybber> as long as the next line is indented less or equal
12:24:39Zevvnpeg 2.0 is on the way
12:24:49FromDiscord<Clyybber> whats new?
12:28:06Zevvnothing at all, we're totally blocked by all these nim bugs :P)
12:34:03Oddmongermod(10,5) is not correct ?
12:34:17Oddmongerseen here, not invented: https://nim-lang.org/docs/system.html#mod,int,int
12:35:36PMunch!eval `mod`(10, 5) # this works
12:35:37NimBotCompile failed: /usercode/in.nim(1, 6) Error: expression '0' is of type 'int literal(0)' and has to be discarded
12:35:45PMunch!eval echo `mod`(10, 5) # this works
12:35:47NimBot0
12:35:49Oddmongerhan
12:35:53Oddmonger`` needed
12:35:56PMunchYup
12:36:04PMunchmod is an operator like + and -
12:36:16Oddmongerthought it was `` as in markdown syntax, for the doc
12:36:22PMunch!eval echo `+`(10, 5) # works the same way here
12:36:24NimBot15
12:36:30Oddmongerso i could do: 10 mod 5 then
12:36:36PMunchMhm
12:36:43PMunchThat's how you'd normally use it
12:36:46Oddmongeryes
12:36:53FromDiscord<AvW> Hi all. I am trying to use package niup (gui). I did a nimble install niup. Compiling the simplest gui program, says: could not load niup.dll. Then I went to iup site here: https://sourceforge.net/projects/iup/files/3.30/Windows%20Libraries/Dynamic/ but I do'nt know which to choose here. Any ideas?
12:37:19FromDiscord<AvW> Ans iup 3.30 is the latest ...
12:37:29Oddmongerok thank you PMunch , i had forgotten the ยซ == 0 ยป in my test
12:37:39Oddmongerthat is : if x mod y == 0:
12:37:58Oddmongerwithout == 0 , no bools
12:38:09PMunchAh, yes. Same issue as you had the other day :)
12:38:17PMunchNim doesn't auto-convert integers to bools
12:38:21Oddmongeryou have good memory :)
12:38:39PMunch(unless of course you add a "converter intToBool(x: int): bool = x == 0
12:38:44PMunch")
12:39:14PMunchI have good memory for completely random stuff like this :P Terrible for stuff like names and birthdays..
12:41:13PMunch@AvW, you should pick the one that fits your platform..
12:41:21PMunchSee under the Available Platforms in the documentation
12:47:37FromDiscord<AvW> @PMunch[IRC] Thx. I'll try the most promising one.
12:48:48FromDiscord<AvW> And it works. Thx again.
12:49:08*OMGOMG joined #nim
12:49:25*opi quit (Remote host closed the connection)
13:02:31*rockcavera joined #nim
13:05:11*dulsi_ is now known as dulsi
13:06:58FromDiscord<Zachary Carter> Just FYI you can't `@` someone who is on IRC through discord
13:07:37FromDiscord<Zachary Carter> you can ping them using their IRC nick the way you'd normally ping someone on IRC
13:09:45*apahl quit (Ping timeout: 272 seconds)
13:10:09*apahl joined #nim
13:12:57*waleee-cl joined #nim
13:17:47Zevvso wow, I think Im done with npeg now. Even pmunch is using it, what else could I ask for
13:17:59Zevvtime for something new then
13:21:23*opal quit (Ping timeout: 240 seconds)
13:24:41*Cthalupa quit (Ping timeout: 244 seconds)
13:26:11*opi joined #nim
13:28:01*Cthalupa joined #nim
13:36:17*opal joined #nim
13:38:54PMunchZevv, I've just been waiting for a usecase :)
13:39:36PMunchIf you're bored though I have a little project you could attempt
13:40:32PMunchMake a macro that generates a huffman tree and decoder for a string of characters. So essentially compressing some arbitrary binary and making an efficient decompressor on compile-time
13:40:44PMunchI think it could be cool to have for Arduino stuff
13:43:26FromDiscord<Kiloneie> Objects are constructable via a type section right ?
13:43:37FromDiscord<Kiloneie> only *
13:43:38FromDiscord<Clyybber> whatever that means :p
13:43:57FromDiscord<Clyybber> oh, yeah you can only define object types in a type section
13:44:05FromDiscord<Kiloneie> thanks
13:48:09*Kaivo joined #nim
13:49:51disruptek๐Ÿ€โšฝ
14:00:46*PMunch quit (Quit: Leaving)
14:03:36*arecacea1 quit (Remote host closed the connection)
14:04:23*arecacea1 joined #nim
14:31:38*Guest73425 quit (Read error: Connection reset by peer)
14:36:13*dadada joined #nim
14:36:36*dadada is now known as Guest67791
14:44:22Zevvpmunch: yo
14:44:41Zevvu mee compress at compil time, decompress *run* time I assume?
15:02:05*Senketsu quit (Ping timeout: 240 seconds)
15:18:20Zevvchocolate salty
15:35:07FromDiscord<Rebel> Is there a way to have a nim's output PE contain a .reloc (base relocation table) section? Such as passing special flags to the compiler to be consumed by gcc or mingw?
15:38:16shashlickthere's passC and passL CLI flags and pragmas
15:39:42FromDiscord<kodkuce> @dom96 i think i saw some post that wasm is getting real threads so meybe now webasambly>js for browser
15:40:02FromDiscord<kodkuce> i know i saw your post long about how you thested both and found js to be better
15:40:03dom96JS supports threads too, no?
15:40:34dom96Yep https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers
15:41:36dom96I am going to add a todo to write about what I found, either I'll learn something new or others will. Webasm seems overhyped to me
15:51:43FromDiscord<kodkuce> sorry afk , head to go to kitchen fast it smelled wronk ๐Ÿ™‚
15:52:08FromDiscord<kodkuce> hmm i think i saw they say WA got real threads not like JS one
15:52:13FromDiscord<kodkuce> can google try find link
15:52:47disrupteki have that all the time. damn kitchen is adjacent to the can.
15:55:34FromDiscord<kodkuce> https://developers.google.com/web/updates/2018/10/wasm-threads or meybe i saw this old post somehow, or somone linked it, i know i saw that difrence betwin js threads and wasm you can share memeory state so its possible is this one just duno how i saw it like last weak
15:56:01FromDiscord<kodkuce> i like 90% search with last month enable
15:59:00FromDiscord<kodkuce> so possible sorry ๐Ÿ™‚ tough duno what i saw i was it in 01:00 was treveling hacker news or reddit tech/programming or something before sleap
16:05:00FromDiscord<vieru> hi can anyone help me translate this c code into nim ?
16:05:09FromDiscord<vieru> sent a code paste, see https://play.nim-lang.org/#ix=2tOa
16:05:26FromDiscord<vieru> im interested in the `static_cast` part
16:05:51FromDiscord<vieru> is it just like a nim cast ?
16:18:05*Cthalupa quit (Ping timeout: 246 seconds)
16:18:41dom96nope, `static_cast` is the safest cast in C++ as far as I can see
16:19:03dom96`cast` in Nim is basically unsafe, you're telling the compiler "I know what I'm doing, don't complain"
16:19:40FromDiscord<vieru> you have any idea how to convert the code ?
16:20:06FromDiscord<vieru> or at least point me in the right direction
16:21:08dom96Search around, I found one example of a library that already does this for you
16:21:18dom96and if you look at its source code you can see how it's done https://github.com/Guevara-chan/Cliptomania/blob/master/src/cliptomania.nim
16:21:36dom96that code is pretty ugly though lol
16:21:45FromDiscord<vieru> i was looking at the same lib lol
16:21:59*Cthalupa joined #nim
16:22:18dom96You can pretty much write the same code as the C++ in Nim
16:22:29dom96You just need to wrap the `GetClipboardData` call
16:22:32dom96and the others used there
16:22:37dom96you can see how that's done in cliptomania
16:23:02dom96you might want to find an example in C
16:23:06dom96could be easier to translate
16:24:05FromDiscord<vieru> thanks, ill read that lib's source for now, and see if i understand it
16:26:05shashlickyou want to work with the clipboard?
16:26:26FromDiscord<vieru> yep
16:26:52shashlickthere's also https://github.com/genotrance/nimclipboard
16:26:58shashlicklibclipboard wrapper
16:27:59*apahl quit (Ping timeout: 272 seconds)
16:28:03FromDiscord<vieru> thanks but i want to stick to the windows apiโ†ตim not making this cross platform lol
16:28:22*apahl joined #nim
16:29:50shashlickcool
16:51:13*maier quit (Ping timeout: 264 seconds)
16:54:41*letto quit (Quit: Konversation terminated!)
16:56:55*superbia1 joined #nim
16:59:28*superbia quit (Ping timeout: 246 seconds)
17:11:46*letto joined #nim
17:23:45Zevvwell well well
17:24:16disruptekwell don't threaten me with a good time.
17:25:19Zevvsay, what was the reason for frosty
17:25:36disrupteki forget.
17:25:52disrupteki don't even think i'm using it anywhere.
17:26:05disruptekzedeus uses it over sockets.
17:26:07Zevvfair enough
17:26:15disruptekhe says it works.
17:26:24Zevvthat's cool
17:26:42disrupteki need to take another look at variant objects.
17:27:11disruptekthat, and taking out the recursion. then it will be okay.
17:27:29Zevvhow would you go without the recursion then
17:27:43disruptekoh, and it might be interesting to see what we can do with isolates, too.
17:29:48ZevvI'd like to see if we could do go-like stuff
17:29:58Zevvbecause I did enjoy my escapade
17:30:15shashlickautodup is fun - processed 50gb of video files for dups in 1.4 seconds
17:30:16Zevvit would be a nice match with CPS to have go-like channels
17:30:31Zevvshashlick: 0 dups found, yah
17:30:46Zevvor your hash is so broken *everything* is a dup. And your disk is now empty
17:30:46*kungtotte quit (Read error: Connection reset by peer)
17:30:48Zevvone lonely file left
17:30:50shashlickonly had to hash 4 of 316 files
17:31:06shashlickonly need to hash if there's a file size match
17:31:08*kungtotte joined #nim
17:31:09Zevvsure
17:31:43disruptekzevv: the other one to look at for inspiration is clojure's.
17:31:56ZevvI never clojured
17:32:07ZevvI would love to elixir one day
17:32:18disruptekhttps://www.youtube.com/watch?v=drmNlZVkUeE
17:32:26shashlickdisruptek - will push my meow changes to the repo
17:32:32disrupteknice.
17:32:45Zevvlet me watch that for 44:24
17:32:57disruptekyeah, i will definitively use that shashlick. thank you.
17:33:28disruptekZevv: i didn't know what hickey sounded like for a year or so because i never watch him below 1.5x speed.
17:33:59Zevvi thought he had a skin condition, but it's freak lighting through his freak glasses
17:34:08disrupteklol
17:34:49*oddp quit (Ping timeout: 256 seconds)
17:35:35alehander92i have a skin condition
17:35:39alehander92but it's very small
17:35:54Zevvdisruptek: he has a good story in that talk
17:35:58Zevvnim needs a good story like that
17:36:09Zevvyes alehander92, we're listening
17:36:12disrupteki know. i've been saying this for a year now.
17:36:32Zevvyea i know same here
17:37:08Zevvthat guy seems smart. can we hire him
17:37:24disruptekclojure is pretty cool.
17:37:29alehander92i still dont get the love for dynamic typing
17:37:39Zevvno, you were talking about your skin condition, remember
17:37:42Zevvlet's get it over with
17:37:47alehander92well it's vitiligo
17:38:27ZevvA freind of my has that in his hair
17:38:33alehander92is he a dog
17:38:39alehander92dogs have multi-colored hair
17:38:43disrupteksome bitches would say yes.
17:38:44Zevvhe as well
17:38:47Zevvit's pretty cool
17:38:56alehander92i do have white hairs
17:39:02alehander92in my hair
17:39:07alehander92is it like color patches?
17:39:11Zevvyeah
17:39:12disruptekbig deal, i have white hair.
17:39:14disruptekpffbt.
17:39:20*vicfred joined #nim
17:39:59alehander92disruptek you're like 18
17:40:11Zevvyeah, more compliments, that's what he needs right
17:41:25alehander92zevv when is your talk show coming on air
17:41:37Zevvwhat should I talk about then
17:41:42alehander92did you send araq in a retirement lambda
17:41:52disruptekoh, thanks for reminding me.
17:41:54alehander92he is just offline somehwere
17:41:58Zevvsometimes
17:42:05ZevvI still bashes my PR for spelling mistakes
17:42:10Zevv /he/
17:42:39alehander92zevv well you can just ask insightful questions
17:42:44alehander92to people on the street
17:42:54alehander92if there are any pedestrians left
17:42:57alehander92in netherlands
17:42:59Zevvstill got a black i from the last time i did that
17:43:13alehander92we can put you behind a glass
17:43:16Zevvoh pedestrians galore.
17:43:23alehander92it's very anti-covid
17:43:32Zevvthat's really a non-issue here
17:43:37alehander92you can just cold call famous people
17:43:47alehander92e.g. the swift compiler guys
17:43:49disrupteki mean, we can build "core.async" for nim.
17:43:51ZevvI think I have seen masks on the street 3 or 4 times since februari
17:43:59alehander92"can you add disruptors to your constructors"
17:44:14alehander92and then you just provide a living Human abstraction
17:44:26*FromDiscord quit (Remote host closed the connection)
17:44:27alehander92huh, good for you
17:44:33alehander92oh bye discord
17:44:41*FromDiscord joined #nim
17:44:45alehander92we are losing whole social networks
17:44:52Zevvgood riddance
17:45:05Zevvirc - one protocol to rule them all
17:45:27disruptekit does what it says on the tin and it does it well.
17:45:46alehander92it really chats
17:45:56Zevvman does it chat
17:47:15alehander92what happened to yardanico
17:47:17*oddp joined #nim
17:47:37alehander92i remember the time when many brave people spammed from all of the hemisphere
17:48:03alehander92good thing pmunch came back from the war
17:48:13*opi quit (Ping timeout: 264 seconds)
17:48:53alehander92the compression idea seems kinda cool
17:49:27Zevvbwah. I already embed pngs in my nim
17:49:29Zevvwhat's new
17:53:48*krux02 quit (Remote host closed the connection)
17:54:50*krux02 joined #nim
18:04:29disruptekdid you finish that talk?
18:06:59Zevvsure
18:07:42disruptekis copying good design, good design?
18:08:53Zevvtechnically, yes
18:09:36disruptekwell, wanna build it?
18:09:51Zevvbut maan it seems like soooo much woooork
18:10:11disruptekhow do you figure?
18:10:31Zevvall this thinking all the time
18:10:44disruptekrelax, you're good at it.
18:12:50Zevvcan't relax... must think... all the time...
18:18:14FromGitter<pebauer68> How would you read a single char non-blocking from stdin in Nim ?
18:28:33shashlickdisruptek: https://github.com/disruptek/meow
18:28:56disruptekawesome.
18:29:46disruptekthe docs link doesn't work.
18:29:58shashlicki just pushed it
18:30:01disruptekah
18:30:04shashlickmight take a bit for it to show
18:30:11alehander92disruptek what about transducers
18:30:22disruptekwhat's that?
18:30:57shashlickthe gh-pages branch is there but for some reason the link isn't working
18:31:10alehander92i think it was a famous clojure concept
18:33:09disruptekhad to configure it on github.
18:33:22shashlicknift - it works
18:33:45shashlickthere's also a meow binary to create hashes on the command line
18:33:48shashlickor compare two files
18:33:55disrupteklol sweet.
18:34:01disruptekthis will be really fun to benchmark.
18:34:48shashlickhttps://github.com/nim-lang/packages/pull/1591
18:34:49disbotโžฅ Add package meow
18:40:50puluxhi, do you know a module to read/write python's numpy npz-files (zip with binary numpy-array, npy)?
18:47:59*maier joined #nim
18:52:57*vicfred quit (Quit: Leaving)
18:53:01*maier quit (Ping timeout: 264 seconds)
18:53:48*hnOsmium0001 joined #nim
19:14:13*clemens3 quit (Ping timeout: 246 seconds)
19:15:29*Vladar quit (Quit: Leaving)
19:25:33*lritter joined #nim
19:27:50*clemens3 joined #nim
19:32:24*kenran joined #nim
20:04:32disruptekshashlick: just noticed that nimph doesn't work with jbb for me anymore.
20:04:44disruptek0.8.10 is fine and 1.0.0 doesn't clone due to a cert error.
20:05:09*kenran quit (Quit: leaving)
20:06:05*Guest67791 quit (Ping timeout: 240 seconds)
20:08:15*dadada joined #nim
20:08:25shashlickoh
20:08:28shashlicklet me check
20:08:40*dadada is now known as Guest85438
20:10:22shashlickunrelated, looks like cligen now depends on pcre
20:17:24disruptekeh?
20:17:33disruptekit's a bad error message?
20:21:25*abm quit (Ping timeout: 240 seconds)
20:22:09disrupteknimph uses cligen-v0.9.45. seems pretty easy to repro.
20:26:34shashlickno not related to your issue
20:48:54*maier joined #nim
20:53:23*maier quit (Ping timeout: 240 seconds)
20:55:23shashlickdisruptek: was a toml issue - have fixed it - please try again
20:58:01FromGitter<benash> Does nim support any way to destructure an object, like this: โŽ โŽ ```let { id, name } = myObject``` [https://gitter.im/nim-lang/Nim?at=5f31b4d99231d665df6be97f]
20:59:02disruptekshashlick: what did you do?
20:59:37disrupteki can clone git:// urls but not https.
21:03:07*mbuchel joined #nim
21:03:28shashlickThey are hosted on bintray
21:03:38Yardanico@benash no, but there's destructuring for tuples
21:03:38*FromDiscord quit (Remote host closed the connection)
21:03:44disrupteki just found a new bug in nimph.
21:03:55*FromDiscord joined #nim
21:04:07Yardanico@benash you shouldn't use objects if you want destructuring
21:04:21shashlickSo 1.0.0 worked?
21:04:26disruptekno.
21:04:32shashlickThere's also 1.0.1 since you wanted that
21:04:38mbuchelhow do you use addTimer in asyncdispatch?
21:05:39Yardanicoyou give it a callback to be called
21:06:12disruptek`doctor` doesn't work because it follows a package-based codepath that discovers https:// urls for packages. whereas, the github search supplies git with git:// urls and those work fine.
21:06:36mbucheli did that but i get this: No handles or timers registered in dispatcher. [ValueError]
21:06:43Yardanicombuchel: what's your code?
21:06:46disruptekbut also, it looks like "segmentation >= 0.8" is getting parsed as "0.8.*" for some dumb reason.
21:07:05disruptekmbuchel: did you discard the future?
21:07:13mbuchelthere is no future
21:07:31Yardanicolol
21:07:33mbucheli want to run a function every 30 seconds
21:08:00Yardanicombuchel: I don't understand your problem - https://play.nim-lang.org/#ix=2tPY
21:08:08Yardanicobut if you use addTimer other parts of your program should be async as well
21:08:12Yardanicoif they're not, use threads
21:09:16mbucheli have virtually the same code you wrote
21:09:22mbuchelin the playground
21:09:27Yardanicobut something is different, right?
21:09:52mbucheli am calling a few functions which are not actually async
21:10:01mbuchelto determine WiFis in the area
21:10:04Yardanicothe exception you posted usually comes when you're using something like poll()
21:10:09Yardanicobut there are no futures to run
21:10:14Yardanicono callbacks, nothing
21:10:34Yardanicoyou should use poll together with hasPendingOperations
21:13:25*lritter quit (Ping timeout: 264 seconds)
21:14:17FromDiscord<Rika> @๐Ÿ˜ฌ๐Ÿคฃ why would you need a sync http server tho?
21:14:36mbucheli am calling execCmdEx in a function with this async could this change things?
21:15:07disruptekwhat color is your function?
21:15:07mbuchelthe code is virtually the same as what you wrote in the play.nim i am looking for the minimal way to reproduce the error
21:15:10FromDiscord<Rika> also can't you just do `waitFor server.serve(...)` anyway?
21:16:29FromDiscord<๐Ÿ˜ฌ๐Ÿคฃ> I was sure there was one before
21:16:47Yardanicoyes, but it was removed
21:16:50Yardanicobecause no one used it
21:16:52Yardanicowhy do you want it?
21:16:57*dulsi quit (Ping timeout: 256 seconds)
21:17:21disruptekthe sync http server was removed?
21:17:21FromDiscord<๐Ÿ˜ฌ๐Ÿคฃ> just to make code simpler, no biggie
21:17:40mbuchelOH ok i found the issue
21:17:45Yardanicodisruptek: did you sleep for an eternity?
21:17:47mbucheli was returning true in the callback
21:17:50Yardanicoit was removed in 0.20.0
21:17:53mbuchelfor the mycb
21:18:01disruptekthat's ridiculous.
21:18:03Yardanicothat's good
21:18:06disruptekno.
21:18:08Yardanicoyes
21:18:12FromDiscord<Rika> @๐Ÿ˜ฌ๐Ÿคฃ it wont be that much simpler
21:18:50disruptekso i /have/ to use async to have a web-server in current nim?
21:18:57Yardanicowith stdlib - yes
21:19:03Yardanicoyou can always make your own or use that old httpserver code
21:19:11mbuchelhttps://play.nim-lang.org/#ix=2tQ1
21:19:15disruptekguess i don't have a fuckin' choice, now do i?
21:19:17mbuchelthis is the code that fails
21:19:17Yardanicombuchel: yeah don't do that
21:19:25Yardanicoif you return true it stops the callback
21:19:30mbuchelwhat does the result from the callback do?
21:19:37mbuchelAH ok thank you
21:21:19FromGitter<benash> @Yardanico Interesting, haven't heard that advice before. I'm reading some command-line arguments (using the simple_parseopt library). Do you see a better way than this: โŽ โŽ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5f31ba4fe20413052e7be8ca]
21:21:23FromDiscord<dom96> disruptek: it was removed because it was broken. It didn't function properly at all.
21:21:23*dulsi joined #nim
21:21:39disruptekbut now what?
21:21:49Yardanico@benash not sure what simple_parseopt is
21:21:49FromDiscord<dom96> It made some pretty embarrassingly bad assumptions.
21:21:54Yardanicohave you tried normal parseopt or cligen or docopt? :)
21:22:04disrupteki know. but i still have a ton of lambda based on it.
21:22:32FromDiscord<dom96> huh
21:23:52disrupteki got milk and i got cream, i'm good.
21:25:52FromGitter<benash> @Yardanico It seems like I'd need quite a bit more code with `parseopt`, having to iterate and check each arg. I haven't seen docopt; I'll take a look at that now.
21:25:59Yardanicowhat about cligen/docopt?
21:26:33Yardanicosorry, just cligen I mean :P
21:30:03*NimBot joined #nim
21:46:30*solitudesf quit (Ping timeout: 260 seconds)
22:02:53FromGitter<benash> @Yardanico OK, cligen seems to be a cool way of doing it. So you don't find a need for object destructuring in general? You're saying it might be a code smell of sorts if you want to use such a thing?
22:03:23YardanicoI just don't understand why would you need object destructuring
22:03:27Yardanicoobjects aren't supposed to be destructured
22:03:30Yardanicothey're supposed to be objects
22:03:34Yardanicothere are tuples if you want destructuring
22:04:19YardanicoI don't even know any popular languages which have destructuring of structs/classes/objects
22:04:29FromDiscord<Rika> javascript?
22:04:45Yardanicoobjects?
22:04:54Yardanicooh I see
22:04:57Yardanicobut JS is JS :)
22:05:01FromDiscord<Rika> lol
22:05:20FromDiscord<Rika> they dont have tuples so they have to go with objects
22:05:28FromDiscord<Rika> (do they?)
22:05:41Yardanicothey don't
22:05:47Yardanicotypescript does, but not JS
22:08:41FromDiscord<Rika> anyway yeah i only know js has object destructuring
22:10:10FromGitter<benash> Yeah, it seems to happen all the time in JS codebases that I look at, say to extract fields out of a JSON structure into a differently shaped structure
22:11:15FromDiscord<Rika> i think object destructuring doesnt really work in the land of static typing
22:11:37Yardanicoi mean in nim you can always make a macro
22:11:40Yardanicolike unpack macro but for objects
22:11:41Yardanicobut why
22:14:00FromDiscord<Rika> i mean yes but that would make an """anonymous""" object definition either way
22:14:14FromDiscord<Rika> and you wouldnt be able to do much with that new object
22:23:04FromGitter<benash> Well if I have a complex nested object structure that I just read JSON into, and I'd like to use a handful of those fields, destructuring might reduce some boilerplate. It seems like the types should still be inferred OK. โŽ โŽ ```let { id, name } = myObj โŽ # vs โŽ let โŽ id = myObj.id โŽ name = myObj.name``` [https://gitter.im/nim-lang/Nim?at=5f31c8c8a4768b6856861c1b]
22:24:52Yardanicolet (id, name) = (myObj.id, myObj.name) if you REALLY want that syntax
22:25:06FromGitter<benash> Although that syntax that I used doesn't seem very "nim-like", maybe something indentation-based would fit better
22:28:13FromDiscord<dom96> you should be able to write a macro for this fairly easily
22:28:22FromDiscord<dom96> maybe we can add it to nim's `sugar` module
22:28:54FromDiscord<Elegant Beef> i dont get the benefit of unpacking an object, you still have to do the exact same amount of typing but do it weirdly
22:29:01*oddp quit (Ping timeout: 264 seconds)
22:30:19*azed joined #nim
22:30:37*azed quit (Max SendQ exceeded)
22:30:50FromGitter<benash> Elegant Beef not in the code example I just pasted. You only have to write the name of the object once, as opposed to once per field you're extracting.
22:31:36FromDiscord<Elegant Beef> Eh, you now have to have the exact ident spelling, seems very prone to issue imo
22:32:24FromDiscord<Elegant Beef> But i digress, make the macro and be merry ๐Ÿ˜„
22:34:55FromGitter<benash> Scala too has something similar with destructuring (or extracting) case class fields through pattern matching
22:35:07Yardanicowell as we said, you can do it with a macro :)
22:35:32FromGitter<benash> Although Scala's might just be positional, more like tuples
22:35:56FromDiscord<XxDiCaprioxX> If I want to hash type1 with string and type2 with string do I need two different hash procs?
22:36:06FromGitter<benash> Macros, got it!
22:36:07Yardanicoyes, thery're different types
22:36:16FromDiscord<XxDiCaprioxX> Because the hash proc takes a parameter
22:36:24Yardanicoeven if types have the same exact fields, they're still different
22:36:29FromDiscord<XxDiCaprioxX> But how do I name them?
22:36:33Yardaniconame what?
22:36:38FromDiscord<XxDiCaprioxX> Because I can't name both procs hash
22:36:40Yardanicoyou can
22:36:43Yardanicosince the types are different
22:36:49FromDiscord<XxDiCaprioxX> Oh I did not know that
22:36:51Yardaniconim has overloading
22:36:54FromDiscord<XxDiCaprioxX> amazing, thank you
22:37:05FromDiscord<XxDiCaprioxX> makes it 10x easier
22:38:27FromDiscord<XxDiCaprioxX> Do I put Hash or Table as a parameter in a type?
22:38:53Yardanicowdym?
22:39:23FromDiscord<XxDiCaprioxX> sent a code paste, see https://play.nim-lang.org/#ix=2tQ9
22:39:35FromDiscord<XxDiCaprioxX> Does it have to be Hash or Table
22:39:35Yardanicohash just like that
22:39:40FromDiscord<XxDiCaprioxX> Okay nice
22:39:43Yardanicohttps://nim-lang.org/docs/hashes.html
22:39:44Yardanicowait
22:39:48Yardanicoyou want a table or a hash?
22:39:59YardanicoHash is not a "hashmap" if that's what you wanted
22:40:22FromDiscord<XxDiCaprioxX> I thought you had to use hashes because table won't take complex types as keys
22:40:33Yardanicoyes, but you don't have to store them in the type
22:40:41Yardanicoyou need to have a hash proc defined for your type
22:40:47FromDiscord<Elegant Beef> You use a hash proc.... ^
22:40:51Yardanicohttps://nim-lang.org/docs/hashes.html see docs here
22:41:01FromDiscord<XxDiCaprioxX> I want the type to contain a hashmap-similar thing
22:41:08FromDiscord<Elegant Beef> When you put a type in the key of a table it calls the T.hash proc to hash it
22:41:35FromDiscord<XxDiCaprioxX> Okay I'll put my code completely
22:41:54FromDiscord<XxDiCaprioxX> sent a code paste, see https://play.nim-lang.org/#ix=2tQa
22:42:11FromDiscord<XxDiCaprioxX> The hash procs are not important and one is unfini9shed
22:42:12Yardanicowhat is "variations" field in Opening for?
22:42:32FromDiscord<XxDiCaprioxX> That is exactly what I am asking about
22:42:35Yardanico???????
22:42:39FromDiscord<XxDiCaprioxX> It is about chess
22:42:39Yardanicowhat do you want it to be?
22:42:42FromDiscord<Elegant Beef> What is it supposed to be
22:42:48FromDiscord<XxDiCaprioxX> A hashmap
22:42:59FromDiscord<XxDiCaprioxX> Of Variations
22:43:10YardanicoTable
22:43:12FromDiscord<Elegant Beef> Then you want it as a `Table[key,Variations]`
22:43:15Yardanicohttps://nim-lang.org/docs/tables.html
22:43:22FromDiscord<XxDiCaprioxX> Okay and I can use string as a key?
22:43:25Yardanicoyes
22:43:30FromDiscord<XxDiCaprioxX> So I can remove all the hash stuff?
22:43:32Yardanicono
22:43:36FromDiscord<XxDiCaprioxX> crap
22:43:37FromDiscord<Elegant Beef> No you'll need it for variations
22:43:42Yardanicoyou need to have hash for your Variation type
22:43:46Yardanicoactually no wait
22:43:52Yardanicoif it's a value, you don't need to
22:43:56Yardanicoyou can remove both
22:43:58FromDiscord<XxDiCaprioxX> ??????????
22:44:00FromDiscord<Elegant Beef> Yea was going to say we both got it wrong
22:44:12FromDiscord<Elegant Beef> Hash is only needed for the key since you need a way to hash keys
22:44:13Yardanico@XxDiCaprioxX please read docs in tables module :)
22:44:18Yardanicohash is for the key only, yes
22:44:22Yardanicoand strings already have a hash proc defined
22:44:27FromDiscord<XxDiCaprioxX> So I put Table[string, Variation] instead of Hash in Opening and remove the hash procs?
22:44:30Yardanicoyes
22:44:34FromDiscord<XxDiCaprioxX> Okay perfect
22:44:37FromDiscord<XxDiCaprioxX> Thanks a lot
22:47:16FromDiscord<XxDiCaprioxX> I don't understand the sql documentation and examples
22:47:25Yardanicowhy?
22:47:29Yardanicoyou mean db_sqlite ?
22:47:32Yardanicoor db_mysql ?
22:47:37FromDiscord<XxDiCaprioxX> the second one
22:47:51Yardanicowell it's just a wrapper of mysql
22:47:52FromDiscord<XxDiCaprioxX> I want to have a bot with a database editable from discord
22:47:55Yardanicoand mariadb
22:48:02Yardanicoare you sure you want mysql specifically though?
22:48:07Yardanicowhat about something like sqlite
22:48:33Yardanicohttps://nim-lang.org/docs/db_mysql.html#examples-larger-example
22:48:35Yardanicopretty big example
22:48:36FromDiscord<XxDiCaprioxX> I need a databse of Opening objects
22:48:54Yardanicoyou might also want to use an ORM
22:48:56Yardanicolike https://github.com/moigagoo/norm
22:49:00FromDiscord<XxDiCaprioxX> I read the example but I am not able to understand it
22:49:07Yardanicowdym?
22:49:15Yardanicowell, to understrand db_mysql you need to know SQL :)
22:49:29*maier joined #nim
22:49:39Yardanicoyou open the database, delete the table if it exists, create a new table, do a transaction where you insert 1000 values
22:49:53Yardanicocommit that transaction, then print all of the values from the database by selecting
22:49:55FromDiscord<XxDiCaprioxX> Okay
22:50:00Yardanicothen add another item and find it
22:50:03FromDiscord<XxDiCaprioxX> So basically I have to learn sql first
22:50:07FromDiscord<XxDiCaprioxX> Is it hard?
22:50:11Yardaniconot really
22:50:14Yardanicoor use something like https://github.com/moigagoo/norm
22:50:21Yardanicoit supports SQLite and PostgreSQL
22:50:47FromDiscord<XxDiCaprioxX> Okay, I'll keep the tabs open but v0.0.1 will be without anyways
22:50:48Yardaniconot sure why would you want mysql specifically :)
22:51:02Yardaniconowadays it's sqlite for smaller DBs or postgresql
22:51:07Yardanicofor everything else
22:51:08FromDiscord<XxDiCaprioxX> Doesn't have to be mysql
22:51:16Yardanicowell, except the key: value DBs of course, i mean relational DBs
22:51:22Yardanicodo you even need a relational DB?
22:51:42FromDiscord<XxDiCaprioxX> I need a database that can be edited with discord commands
22:51:51Yardanicothat doesn't explain anything
22:51:56Yardanicoyou can make any database editable with discord commands
22:52:03FromDiscord<XxDiCaprioxX> I was told using a json is not an option because of performance and security
22:52:55FromDiscord<Elegant Beef> What is your end goal?
22:53:20FromDiscord<XxDiCaprioxX> The size will be at max 60 instances of Opening each with at max 10 instances of Variation
22:53:46FromDiscord<XxDiCaprioxX> However you should be able to add these while the bot is active
22:54:22*maier quit (Ping timeout: 246 seconds)
22:54:25FromDiscord<XxDiCaprioxX> So basically can I just keep the database as a simple variable in my bot file? Or do I need something like sqlite?
22:54:47Yardanicowell you can always use simple files to store data, but it wouldn't be the best
22:54:48FromDiscord<Elegant Beef> I think it's a case of what are you doing, and do you need to run a DB for it
22:55:13FromDiscord<XxDiCaprioxX> It is about performance in that aspect
22:55:18Yardanicosqlite will do just fine
22:55:31Yardaniconot sure what "performance" you're aiming at
22:55:37Yardanico1k commands per second?
22:55:38Yardanico10k?
22:55:47FromDiscord<XxDiCaprioxX> Not at all that much
22:56:06FromDiscord<XxDiCaprioxX> At least not in the beginning
22:56:08Yardanicothen you wouldn't really need to care about performance that much
22:56:15Yardanicobut just use Norm if you need relational
22:56:16FromDiscord<XxDiCaprioxX> Okay
22:56:21Yardanicoor some key:value DB if you don't need relations
22:56:48FromDiscord<XxDiCaprioxX> So if I keep it in the main.nim file it is okay if it only runs on a single server?
22:57:01YardanicoI don't understand how file is related to a server
22:57:14FromDiscord<Elegant Beef> I dont understand anything ๐Ÿ˜›
22:57:23*azed joined #nim
22:57:33FromDiscord<XxDiCaprioxX> If I put the table inside the bots source code file
22:57:55Yardanicowell, if your app restarts, you'll lose all data
22:58:18FromDiscord<XxDiCaprioxX> okay, that's good to know
22:59:01FromDiscord<XxDiCaprioxX> And if I use sqlite where does it get saved?
23:00:58Yardanicoin a file
23:01:06Yardanicoyou can always just backup it
23:01:16FromDiscord<XxDiCaprioxX> Okay but I can do the same with a json, right?
23:01:28Yardanicoyes, but it'll be slower to serialize/deserialize :)
23:01:30Yardanicoprobably
23:01:33Yardanicoand more size
23:01:39FromDiscord<Elegant Beef> You can do the same with any file format, i think the biggest question is still what are you doing imo
23:02:27FromDiscord<XxDiCaprioxX> I want a bot to print out Information about chess openings for my chess server
23:02:38Yardanicoyes, so what's the problem? it doesn't sound too hard
23:02:59FromDiscord<XxDiCaprioxX> 1. I'm new to nim 2. I never made a bot before
23:03:03FromDiscord<Elegant Beef> Ok so then just store all chess openings in a compiletime table and there you go
23:03:07Yardanicohaha
23:03:12Yardanicowell he needs to add them via commands
23:03:13Yardanicoso no
23:03:26FromDiscord<XxDiCaprioxX> But while I'm thinking about it
23:03:29Yardanico@XxDiCaprioxX just use simple json or sqlite (maybe with Norm if you're new to SQL)
23:03:48FromDiscord<Elegant Beef> I mean name is the command and the data gets sent in response
23:03:54FromDiscord<Elegant Beef> ๐Ÿ˜›
23:04:07FromDiscord<XxDiCaprioxX> Mean xD
23:04:28FromDiscord<XxDiCaprioxX> Yardanico I'll just go for json and change it later
23:04:48FromDiscord<XxDiCaprioxX> The performance should be good enough and changing it should not be too much wrk
23:05:58FromDiscord<XxDiCaprioxX> So thanks for your time
23:06:14*Jjp137 quit (Read error: Connection reset by peer)
23:08:09*Jjp137 joined #nim
23:15:35*Jjp137 quit (Read error: Connection reset by peer)
23:15:50*Jjp137 joined #nim
23:16:02FromDiscord<XxDiCaprioxX> So this may sound dumb but how do I instantiate my types? ``` var najdorf = Variation(parameters) ``` gives me `invalid type: 'untyped' for var`
23:28:01YardanicoVariation(field1: value1, field2: value2)
23:28:24Yardanicoor write a constructor (just a normal proc which makes a new type)
23:28:29Yardanicoa new object of that type*
23:33:33FromDiscord<XxDiCaprioxX> I did it actually
23:33:46FromDiscord<XxDiCaprioxX> I forgot my messages don't get deleted on your platform, sorry for that
23:44:47FromDiscord<XxDiCaprioxX> How can I access a member of a table?
23:47:01FromDiscord<Rika> with[]
23:47:06FromDiscord<Rika> table[key]
23:47:21FromDiscord<XxDiCaprioxX> does not work for me
23:47:23FromDiscord<XxDiCaprioxX> how weird
23:47:26FromDiscord<Rika> what is the error
23:47:46FromDiscord<XxDiCaprioxX> Nevermind
23:47:56FromDiscord<XxDiCaprioxX> I wrote string instead of the variable on accident
23:48:00*krux02_ joined #nim
23:49:33FromDiscord<XxDiCaprioxX> sent a code paste, see https://play.nim-lang.org/#ix=2tQm
23:50:10Yardanicouhh
23:50:13Yardanicowhat do you want to add?
23:50:18FromDiscord<Elegant Beef> do you know how tables work?
23:50:24Yardanicoyou said you want a mapping from string to Variation
23:50:26Yardanicoso
23:50:28FromDiscord<Elegant Beef> `dataBase.add(name,variation)`
23:50:31Yardanicono
23:50:36FromDiscord<XxDiCaprioxX> no
23:50:37Yardanicodatabase[name] = variation
23:50:38FromDiscord<Elegant Beef> no
23:50:42*krux02 quit (Ping timeout: 244 seconds)
23:50:46FromDiscord<XxDiCaprioxX> not what I want
23:50:50Yardanicobut what do you want?
23:50:56FromDiscord<XxDiCaprioxX> database hold openings, openings hold variations
23:51:01Yardanicoyou said you want a table of mappings string to Variation
23:51:31FromDiscord<XxDiCaprioxX> give me a minute
23:51:35Yardanicotable is a mapping from one type to another
23:51:40FromDiscord<XxDiCaprioxX> yes
23:51:43Yardanicowhere one type acts as a key, and another as a value
23:51:51FromDiscord<XxDiCaprioxX> and I have a table of openings called database
23:52:03FromDiscord<XxDiCaprioxX> Wait I'll do full code
23:52:11Yardanicojust tell what you actually want to do
23:52:19FromDiscord<XxDiCaprioxX> sent a code paste, see https://paste.rs/aa0
23:52:31FromDiscord<XxDiCaprioxX> I want to add a variations to an opening inside database
23:52:38Yardanicowell okay
23:52:46Yardanicobut then
23:52:57Yardanicoyou need to have an add proc for your opening
23:53:17FromDiscord<XxDiCaprioxX> ``` proc newOpening(name: string, position: string, variations: Table[string, Variation]) =โ†ต let opening = Opening(name: name, position: position, variations: variations) ```
23:53:38FromDiscord<XxDiCaprioxX> This one does not have the add thing yet but whatever
23:53:43Yardanicobut you need to
23:53:47Yardanico"database[opening].add(name, variation)"
23:53:53Yardanicoyou get an opening from the table
23:53:57Yardanicoand call .add proc on that opening
23:54:03Yardanicowhich doesn't exist
23:54:06Yardanicoso the compiler complains
23:54:16FromDiscord<XxDiCaprioxX> (edit) 'variations)' => 'variations)โ†ต database.add(name, opening)'
23:54:32FromDiscord<XxDiCaprioxX> Oh okay makes sense
23:54:41FromDiscord<XxDiCaprioxX> But opening is a table too
23:55:00FromDiscord<XxDiCaprioxX> Oh no it does not
23:55:13FromDiscord<XxDiCaprioxX> I found the mistake
23:55:27FromDiscord<XxDiCaprioxX> I was taking Opening as the table while in fact opening only holds a table
23:55:45FromDiscord<XxDiCaprioxX> Figured it out
23:55:48FromDiscord<XxDiCaprioxX> Thank you
23:56:37*krux02_ quit (Remote host closed the connection)
23:56:56*vicfred joined #nim