<< 22-08-2020 >>

00:34:10silvernode[m]is there a proc that lists the contents of a given directory?
00:34:22silvernode[m]I can't seem to find anything in the OS module
00:34:47FromDiscord<Varriount> There's one there
00:35:04disruptekwalkDir
00:35:27silvernode[m]ah, I knew it would be calling something not obvious.
00:35:49disruptekholy shit you guys.
00:35:53silvernode[m]I would looking for listDir or ls()
00:35:54disrupteknimble supports local deps!
00:36:18silvernode[m] * I was looking for listDir or ls()
00:36:24disruptekdon't be rude.
00:36:29disruptekno one calls it that.
00:36:34disruptekit's readDir.
00:39:26silvernode[m]readDir is fine
00:53:32*Zectbumo quit (Remote host closed the connection)
00:54:47*Zectbumo joined #nim
00:56:07silvernode[m]https://play.nim-lang.org/#ix=2uRv
00:56:15silvernode[m]trying to detect if a directory is empty or not
00:56:45silvernode[m]if something is in the directory, it triggers the else part but nothing is echoed if something is in the directory
00:59:00silvernode[m] * if it is empty, nothing gets echoed
01:07:39*vicfred quit (Quit: Leaving)
01:24:26*JustASlacker quit (Ping timeout: 240 seconds)
01:45:49*jxy quit (Ping timeout: 264 seconds)
01:46:42*apahl quit (Ping timeout: 260 seconds)
01:48:40*apahl joined #nim
01:51:05*jxy joined #nim
01:54:25*arecacea1 quit (Remote host closed the connection)
01:54:58*arecacea1 joined #nim
01:57:27disruptekthat's the idea.
01:57:48disruptekit doesn't iterate if there's nothing to iterate upon. silvernode[m] ^
01:59:53*waleee-cl quit (Quit: Connection closed for inactivity)
02:13:46*jxy quit (Ping timeout: 256 seconds)
02:16:37*jxy joined #nim
02:20:03*surma quit (Ping timeout: 246 seconds)
02:24:28*vicfred joined #nim
02:29:19*muffindrake quit (Ping timeout: 272 seconds)
02:31:12*muffindrake joined #nim
02:31:36*r4vi quit (Ping timeout: 246 seconds)
02:36:27*surma joined #nim
02:37:03*r4vi joined #nim
02:43:02*NimBot joined #nim
02:50:33*endragor joined #nim
03:04:18*kwilczynski quit (Ping timeout: 260 seconds)
03:06:03*fowl quit (Ping timeout: 260 seconds)
03:07:20*kwilczynski joined #nim
03:07:22*fowl joined #nim
03:14:27FromDiscord<iWonderAboutTuatara> How can you write to files in Nim?
03:14:56FromDiscord<iWonderAboutTuatara> A better question, how can I qppend something to a file in Nim?
03:15:14FromDiscord<iWonderAboutTuatara> F/e add each element of a newline Nim
03:15:24FromDiscord<iWonderAboutTuatara> (edit) 'a' => 'an seq'
03:34:31FromDiscord<Rika> open using the append file mode
03:34:36FromDiscord<Rika> then write to the file normally
03:39:49*krux02 quit (Remote host closed the connection)
03:45:41FromDiscord<Varriount> Or open normally, and seek to the end of the file.
03:48:29*kinkinkijkin joined #nim
03:55:13*konkrrrrrr joined #nim
03:56:12*kinkinkijkin quit (Ping timeout: 260 seconds)
03:56:18*konkrrrrrr is now known as kinkinkijkin
04:05:50*thomasross quit (Ping timeout: 258 seconds)
04:06:02*supakeen quit (Quit: WeeChat 2.9)
04:06:42*supakeen joined #nim
04:09:52*jwm224 joined #nim
04:13:18FromGitter<Knaque> What would be the easiest way of generating a random letter? It has to be a letter, but the case should also be random.
04:16:34*Jesin quit (Quit: Leaving)
04:20:37*Jesin joined #nim
04:23:29*sirn_ joined #nim
04:23:47*sirn quit (Ping timeout: 240 seconds)
04:23:48*sirn_ is now known as sirn
04:24:30FromDiscord<Elegant Beef> Knaque this is one way https://play.nim-lang.org/#ix=2uRX
04:30:13FromGitter<Knaque> I didn't even know you could use `..` on characters, that's great!
04:43:10*bung joined #nim
05:07:37*Jesin quit (Read error: Connection reset by peer)
05:09:17*Jesin joined #nim
05:11:51*letto quit (Quit: Konversation terminated!)
05:17:14*letto joined #nim
05:24:34FromDiscord<Elegant Beef> Is there a better way to handle this, like by using methods? https://hatebin.com/wwkmewvuou
05:25:26FromDiscord<Elegant Beef> Methods seem weird as far as i can tell i need to convert to the proper type
05:26:16FromDiscord<Elegant Beef> (edit) 'Methods seem weird as far as i can tell i need to convert to the proper type ... ' => 'Methods seem weird as far as i can tell i need to convert to the proper typeoutside the proc call'
05:38:24*solitudesf joined #nim
05:39:37*audiofile quit (Quit: Default Quit Message)
05:40:40*audiofile joined #nim
05:42:14*audiofile quit (Client Quit)
06:17:19*endragor quit (Ping timeout: 258 seconds)
06:24:45*leorize joined #nim
07:05:55ZevvElegant Beef: which part of the snippet is your problem?
07:06:07FromDiscord<Elegant Beef> I mean the mainlogic thing
07:06:56FromDiscord<Elegant Beef> Im wondering if having a base object with mainlogic is an acceptable method for this, or if there is a way for me to do `a.Controller.mainLogic` and ending up with it calling a `FollowController.mainlogic` method
07:07:58FromDiscord<Elegant Beef> Guess i should provide the controller declaration aswell https://hatebin.com/ltvamsklzu
07:09:24FromDiscord<Elegant Beef> If i stored FollowController as a Controller would a method still require converting to a FollowController to invoke that method?
07:09:49FromDiscord<Elegant Beef> I am not using method in place of proc here
07:10:30ZevvI recommend just try and see what it looks like and if you like it, but make sure not to go mixing methods and generics
07:10:36Zevvyou'll hit unpleasant surprises
07:10:44Zevvpersonally, I don't method anymore
07:11:30FromDiscord<Elegant Beef> I mean i was looking at methods as it seen more proper, but it seemed i had to convert the Controller to a FollowerController
07:11:32FromDiscord<Elegant Beef> Which i didnt like
07:11:53Zevvhm I don't think you should need that
07:11:59Zevvthat's where the methods come in
07:12:06ZevvOO is funny in nim :/
07:14:23FromDiscord<Elegant Beef> Hmm you're right
07:14:29FromDiscord<Elegant Beef> No clue why it wasnt working previously
07:15:52Zevvmaybe still had a 'proc' instead of a 'method' somewhere/
07:17:35FromDiscord<Elegant Beef> Do the methods have to be declared in a single file?
07:19:23ZevvI don't think so, but you do have to export* of course
07:19:30FromDiscord<Elegant Beef> yea i know that
07:21:14FromDiscord<Elegant Beef> Yea this is weird
07:21:27FromDiscord<Elegant Beef> I duplicated what im doing on nim playground no errors
07:22:25FromDiscord<Elegant Beef> It's complaining that act.controller is of type controller and not either AiController or PlayerController...
07:28:01FromDiscord<Elegant Beef> Lol, i minified it and put it on nimplayground and it works
07:44:11Zevvbut not locally for you?
07:44:42FromDiscord<Elegant Beef> No it works locally
07:44:50FromDiscord<Elegant Beef> The minified version works, not the large version
07:45:23FromDiscord<Elegant Beef> But the underlying logic is identical afaik minus stretching multiple files
07:47:09FromDiscord<Elegant Beef> Here's the full project if you want to see it↵https://github.com/beef331/shooter
07:47:36FromDiscord<Elegant Beef> main.nim line 19 fails due to Controller not being PlayerController or AiController
07:50:25FromDiscord<vieru> does anybody know do to ship openssl with my nim app ?
07:50:34FromDiscord<vieru> im trying to use httpclient
07:50:54FromDiscord<vieru> and static linking like in the docs doesn't work
07:51:11FromDiscord<vieru> it just gives the same error
07:51:32FromDiscord<vieru> could not load libssl1_1.dll.....
07:51:52FromDiscord<vieru> https://cdn.discordapp.com/attachments/386897099293196288/746374446096449546/unknown.png
07:52:36FromDiscord<Elegant Beef> Did you put it next to your exe?
07:53:00FromDiscord<vieru> i dont want to shit all the dlls with my exe ↵i just want a single exe
07:53:09FromDiscord<Elegant Beef> https://nim-lang.org/docs/openssl.html
07:53:10FromDiscord<vieru> no other files
07:53:46FromDiscord<vieru> `--dynlibOverride:ssl --passl:-lcrypto --passl:-lssl`↵yeah I've tried this
07:53:49FromDiscord<vieru> no luck
07:54:00FromDiscord<vieru> the executable is the same size everytime
07:54:16*awe004 joined #nim
07:54:23FromDiscord<Elegant Beef> Statically linking isnt.... including the .dll afaik
07:54:23FromDiscord<vieru> the libs dont get included
07:54:58FromDiscord<Elegant Beef> I believe you want to make a portable executable
07:55:02FromDiscord<vieru> yep
07:55:35FromDiscord<vieru> i have the static openssl libs downloaded
07:55:39FromDiscord<Elegant Beef> Guess im wrong about the static linking 😄
07:56:01FromDiscord<vieru> libssl.a↵libssl.dll.a↵libcrypto.a↵libxrypto.dll.a
08:05:23FromDiscord<vieru> `nim c -d:ssl -p:. --passL:-L"path_to\openssl\lib" --dynlibOverride:ssl --passL:-l:libcrypto.a --passL:-l:libssl.a -f -d:isProd=true -d:release -d:danger --opt:size --app:gui --passC:-flto -o:./dist/client.exe ./src/client.nim`
08:05:43FromDiscord<vieru> that's how i compile it
08:10:29*hnOsmium0001 quit (Quit: Connection closed for inactivity)
08:11:18*FromDiscord quit (Remote host closed the connection)
08:11:33*FromDiscord joined #nim
08:11:55*apahl quit (Ping timeout: 240 seconds)
08:12:54*apahl joined #nim
08:34:46FromDiscord<hobbledehoy> is there anyway I could use `nim check` on a .nimble file or do I have to use `nimble check`?
08:35:02*jan_ joined #nim
08:45:54*Zectbumo quit (Remote host closed the connection)
08:47:07*jan_ quit (Remote host closed the connection)
08:54:41FromDiscord<dom96> What is your goal?
08:54:53FromDiscord<dom96> To check its syntax?
08:55:45*JustASlacker joined #nim
08:55:46FromDiscord<ivall> sent a code paste, see https://play.nim-lang.org/#ix=2uSA
08:55:49FromDiscord<ivall> (edit) 'https://play.nim-lang.org/#ix=2uSA' => 'https://play.nim-lang.org/#ix=2uSB'
08:56:37FromDiscord<Elegant Beef> the message might not exist
08:56:39FromDiscord<dom96> Maybe the discord doesn’t give you the contents of the message that has been deleted?
08:56:56FromDiscord<Elegant Beef> Well i figure if it doesnt exist the content is nothing
08:56:58FromDiscord<ivall> but why? in discord.py all works fine
08:57:10FromDiscord<ivall> @Elegant Beef yeah its doesnt exist
08:57:11FromDiscord<Elegant Beef> It's not discord.py
08:57:19FromDiscord<Elegant Beef> Well then why do you expect a content?
08:57:49FromDiscord<dom96> Broken Nim discord library then?
08:57:53FromDiscord<dom96> Ask the author
08:58:12FromDiscord<Elegant Beef> "it doesnt exist", seems they use a bool instead of an `Option[Message]`
08:59:05FromDiscord<Elegant Beef> But yea ask the author
09:00:53*vicfred quit (Quit: Leaving)
09:00:53FromDiscord<ivall> > It's not discord.py↵@Elegant Beef
09:00:55FromDiscord<ivall> Same api
09:01:22FromDiscord<ivall> I just getting blank message
09:01:26FromDiscord<ivall> Aftet delete
09:02:28FromDiscord<Elegant Beef> Wait are you using the python library inside nim?
09:02:37FromDiscord<ivall> What
09:02:41FromDiscord<ivall> No
09:02:44FromDiscord<ivall> xD
09:02:59*vicfred joined #nim
09:03:11FromDiscord<Elegant Beef> you said "Same API" so i thought you use one of the cross language barriers and was so confused
09:04:05FromDiscord<ivall> Soo nim don't have actually god library for discord
09:04:29FromDiscord<Elegant Beef> Which one are you using?
09:04:42*guelosk[m] quit (Quit: Idle for 30+ days)
09:04:50FromDiscord<ivall> https://krisppurg.github.io/dimscord/dimscord/objects.html#Message
09:04:54FromDiscord<ivall> dimscord
09:06:06FromDiscord<Elegant Beef> @krisppurg apparently you delete message event doesnt provide a message and it's causing this person issues 😛
09:06:09FromDiscord<Elegant Beef> (edit) 'you' => 'your'
09:06:24FromDiscord<ivall> ¯\_(ツ)_/¯
09:07:13FromDiscord<Elegant Beef> Well there you go, we'll see what happens, i have no clue the intended behaviour, i'd expect it not to have any details as a deleted message is deleted
09:07:37FromDiscord<Elegant Beef> Is shard empty on delete?
09:07:59FromDiscord<ivall> Wait a second, I must see
09:09:59FromDiscord<ivall> id of shard is 0
09:10:07FromDiscord<ivall> (edit) 'id of shard is 0 ... ' => 'id of shard is 0after delete'
09:10:41FromDiscord<ivall> sooo I must stay with discord.py while on delete message don't have msg contnet
09:10:44FromDiscord<ivall> (edit) 'contnet' => 'content'
09:10:46FromDiscord<ivall> :(
09:11:00FromDiscord<ivall> (edit) 'don't' => 'doesn't'
09:13:53FromDiscord<Rika> might really just be a broken library
09:14:28FromDiscord<krisppurg> Huh
09:14:32FromDiscord<ivall> I wanted to write bot in nim bcs its faster than python
09:14:44FromDiscord<ivall> maybe second library for discord works better
09:14:53FromDiscord<krisppurg> discordnim is unmaintained
09:15:29FromDiscord<ivall> oh
09:15:32FromDiscord<ivall> shit
09:15:41FromDiscord<krisppurg> is it message delete bulk?
09:15:45FromDiscord<ivall> no
09:15:59FromDiscord<krisppurg> Is the message uncached?
09:16:18FromDiscord<krisppurg> Do echo exists to check
09:16:26FromDiscord<ivall> idk, I just removed message from discord using browser
09:16:27FromDiscord<ivall> ok
09:16:28FromDiscord<ivall> wait
09:16:38FromDiscord<ivall> @krisppurg I did that
09:16:42FromDiscord<ivall> message doesn't exist
09:16:45FromDiscord<ivall> after delete
09:16:53FromDiscord<ivall> but I still have access to message id
09:16:57FromDiscord<ivall> message channel_id and more
09:16:58FromDiscord<dom96> @ivall you should look into the library code and try to fix it
09:17:06FromDiscord<dom96> This is what open source is all about
09:17:14FromDiscord<krisppurg> ^^
09:17:17FromDiscord<dom96> It’s likely a simple fix
09:17:25FromDiscord<dom96> Since you’re getting the event
09:17:32FromDiscord<ivall> I can try, but I working as python dev and using nim from yesterday ;v
09:17:33FromDiscord<krisppurg> I may have made a tiny mistake
09:17:36FromDiscord<Elegant Beef> *I just pingle krisp as i didnt know what was intended*
09:17:45FromDiscord<Elegant Beef> pinged* 😄
09:18:01FromDiscord<dom96> > I can try, but I working as python dev and using nim from yesterday ;v↵@ivall you can do it. I believe in you.
09:18:02FromDiscord<krisppurg> I wasnt expecting that tbh I was gonna go down for breakfast XD
09:18:05FromDiscord<ivall> :D
09:18:17FromDiscord<ivall> So Im going to work
09:18:27FromDiscord<dom96> Ask here if something in the code confuses you
09:18:35FromDiscord<ivall> ok
09:18:42FromDiscord<Elegant Beef> I am still confused about my methods problem
09:21:01FromDiscord<krisppurg> are you still looking for the file?
09:23:48FromDiscord<krisppurg> Wait actually I think I know what could be the issue, since discord.py might uses the rest api to fetch for the message, dimscord doesn't do that, because you can do it yourself.
09:24:34FromDiscord<krisppurg> try using getting the message from the rest api @ivall
09:25:23FromDiscord<ivall> using message id?
09:25:27FromDiscord<krisppurg> you could also use on_dispatch for raw events, so you could check what event it is and it's raw data
09:25:39FromDiscord<ivall> yeah I see that
09:26:12FromDiscord<krisppurg> > using message id?↵yeah
09:26:37FromDiscord<ivall> I gonna check that, thank you
09:26:40*Trustable joined #nim
09:26:58FromDiscord<krisppurg> your welcome
09:32:32FromDiscord<foxcat> re: I can try, but I working as python dev and using nim from yesterday ;v↵proud of you!! for switching
09:33:20FromDiscord<Elegant Beef> Well im going to bed so if anyone wants to take a look at my issue this line errors complaining that it's a Controller and cant use either method. <https://github.com/beef331/shooter/blob/master/src/main.nim#L19>
09:33:43FromDiscord<Elegant Beef> It's spread over multiple files so it's a pain to look at clearly
09:39:08FromDiscord<Rika> @Elegant Beef what is the generic tail of the `actors` variable? likely it is `Controller`, meaning you have to change the controllers back into the proper Player/Ai types ***I THINK***
09:41:29FromDiscord<ivall> discord cf blocking me xD
09:43:13FromDiscord<krisppurg> how come?
09:45:59FromDiscord<hobbledehoy> @dom96 yeah, trying to add support to .nimble files that my editor uses and I am wondering how to make nim check support .nimble files
09:46:59*def- joined #nim
09:47:00*Trustable quit (Remote host closed the connection)
09:50:13*endragor joined #nim
09:55:26FromDiscord<dom96> @hobbledehoy I see. Yeah, that might be tricky, you'd have to evaluate it in the same way as Nimble does. AFAIK there is no support for `nim check` for nimscript
09:55:59FromDiscord<hobbledehoy> ah ok, thanks for the help
09:59:35*dv^_^ joined #nim
10:00:34*krux02 joined #nim
10:05:05*dddddd quit (Ping timeout: 240 seconds)
10:05:47FromDiscord<Recruit_main707> Does countup involve any runtime overhead?
10:07:18*dddddd joined #nim
10:07:41FromDiscord<Clyybber> no
10:08:30FromDiscord<Recruit_main707> How?
10:08:58FromDiscord<Clyybber> because iterators are inlined
10:09:26FromDiscord<ache of head> this is the implementation of `countup` if you're interested in seeing it https://media.discordapp.net/attachments/371759389889003532/746672369657184306/Zrzut_ekranu_2020-08-22_o_12.09.08.png
10:09:40FromDiscord<Recruit_main707> Yeah, I have already
10:10:44FromDiscord<Clyybber> and where do you spot "overhead"?
10:11:44FromDiscord<Recruit_main707> So... does `for (x = 0; x < 100; x += 5 )` in c perform exactly the same than `for x in countup(0, 100, 5):` in Nim?
10:12:01FromDiscord<Clyybber> yeah
10:22:59*natrys joined #nim
10:27:37*Vladar joined #nim
10:28:45FromDiscord<lqdev> @Recruit_main707 iterators are inlined - when you call an iterator in a for loop, it literally pastes the iterator's body in, also replacing any yield statements with the for loop's body
10:29:20FromDiscord<Ricky Spanish> how do u handle structured output such as html, without a library i mean just so i can understand the best way to achieve this
10:29:38FromDiscord<lqdev> wdym?
10:30:08FromDiscord<lqdev> you either parse and process all the tokens directly or first build a DOM tree
10:30:15FromDiscord<lqdev> and work on that
10:30:21FromDiscord<Ricky Spanish> like say i have a specific file format and i want to output some variables values in a specific position, not neccessarily html, but anything
10:30:39FromDiscord<Varriount> You usually have to parse the format
10:31:35FromDiscord<Varriount> Depending on the format, you might only have to parse some of it, but that's not common.
10:32:04FromDiscord<Varriount> @Ricky Spanish What format are you looking to extract data from?
10:32:34FromDiscord<Ricky Spanish> actually at the moment groovy, its quite simple i suppose but i want to generate a minimal groovy file automatically
10:32:58FromDiscord<Varriount> What do you mean by "minimal"?
10:33:24FromDiscord<Ricky Spanish> meaning i dont desire to support the entire language just enough for the task at hand
10:33:53FromDiscord<Varriount> Do you want to generate groovy, or read it (or both)?
10:34:00FromDiscord<Ricky Spanish> just generate it
10:34:56FromDiscord<Varriount> Then your best best is probably to do what the compiler does, and just write out chunks of groovy code as the program runs
10:35:45FromDiscord<Varriount> You might have a procedure for writing out code to declare a variable, write an assignment, etc
10:36:37FromDiscord<Ricky Spanish> right...but theres some kind of helpers that mean i can avoid stuff like this for example ``` myvariable = "{" + somestuffhere + "}" ``` i guess is part of my question, a way to reasonably define the layout in a reusable way
10:37:31FromDiscord<lqdev> `proc renderBlock(body: string): string = "{\n" & body.indent(2) & "\n}"
10:37:37FromDiscord<lqdev> something like that
10:37:42FromDiscord<Ricky Spanish> yeh thats what im looking for
10:37:51FromDiscord<haxscramper> Or you can use string interpolation from https://nim-lang.org/docs/strtabs.html or strformat
10:37:53FromDiscord<Varriount> Look at strformat
10:38:02FromDiscord<Ricky Spanish> ok great thanks for the tips guys
10:39:23FromDiscord<haxscramper> strtabs if you need to generate both keys and values at runtime, strformat. And there is also https://nim-lang.org/docs/ropes.html#%25%2Cstring%2CopenArray%5BRope%5D which might be useful if you want to generate large files
10:40:00FromDiscord<Varriount> Nah, ropes are better if you need to examine the data and mutate it.
10:40:02FromDiscord<Rika> i dont think ara/q recommends the usage of ropes anymore
10:40:14FromDiscord<Varriount> I would just write directly to a file
10:41:28FromDiscord<haxscramper> It is not recommended to use for interpolation or in general?
10:41:38FromDiscord<Varriount> Ropes are good if you're constantly deleting/inserting sequential data
10:41:49FromDiscord<haxscramper> I'm using it for AST->string conversion in one of my projects - no string interpolation but tons of concatenation and splicing
10:43:08FromDiscord<Varriount> @haxscramper Splicing possibly. I don't think it matters for concatenation
10:46:41FromDiscord<Varriount> @haxscramper the question you have to ask yourself is, "am I constantly modifying a sequence of character data in the same ways and accesses patterns of a human editing a file" ?
10:48:28FromDiscord<haxscramper> No, certainly not. I do recursive DFS over AST and using something like `"{" & mapIt(it.toRope()).concat() & "}"`
10:49:15FromDiscord<Varriount> Then a string or file is probably better.
10:50:18FromDiscord<Varriount> Ropes deal with random deletions and insertions in the middle of their data better than strings and sequences do.
10:51:35FromDiscord<Varriount> If you insert or delete data into the middle of a string, then all the following data must be moved.
10:52:00*ofelas joined #nim
10:52:42FromDiscord<Varriount> I believe ropes use something more like a linked list, so there's less effort involved for those operations.
10:53:13FromDiscord<haxscramper> Ropes use binary tree AFAIK
10:53:38FromDiscord<haxscramper> Well, some sort of tree to get cheap insertion in the middle while maintaining order of elements
10:55:04FromDiscord<Varriount> @haxscramper Sorry to burst your bubble. ☹️
10:55:42FromDiscord<haxscramper> I probably need to do some benchmarking for strings vs ropes for this use case since it is quite common operation - converting tree of AST nodes to string, so it's better to know for sure.
10:57:28FromDiscord<haxscramper> > @haxscramper Sorry to burst your bubble. ☹️↵@Varriount no problem, I just assumed for some.reason it would be better to use ropes because of 'muh log(n) concatenation, must be faster'
10:59:29FromDiscord<Varriount> I guess a rope might have faster concatenation...? It probably depends on the implementation.
10:59:56FromDiscord<Varriount> Though, memory copies are pretty fast
11:19:31FromGitter<alehander92> i am not even sure why ropes are needed
11:19:36FromGitter<alehander92> when people generate code
11:19:57FromGitter<alehander92> i mean, it seems to make great sense
11:19:58FromDiscord<haxscramper> It seems like there is no difference at all for string concatenation vs rope building, but conversion from rope to string adds more overhead
11:20:08FromGitter<alehander92> but most code seems to be generated linearly
11:20:15FromGitter<alehander92> with some exceptions
11:20:24FromDiscord<Clyybber> string concatenation is O(n) and rope concatentation is O(1)
11:20:32*jeko joined #nim
11:20:38FromGitter<alehander92> but
11:20:40FromGitter<alehander92> not really
11:20:45FromDiscord<Clyybber> of course if you add one char at a time and that N times it doesn't matter because armotization
11:20:47FromGitter<alehander92> because if you just generate a new string
11:20:51FromGitter<alehander92> it needs to be generated anyway
11:20:59FromGitter<alehander92> so you directly generate it in its place
11:21:10FromDiscord<haxscramper> I really can't do good benchmarking but for tree of depth 1-6 nodes with each node and five subnodes (5^(1..6)) nodes in total
11:21:18FromDiscord<Clyybber> alehander92: Yeah sure
11:21:21FromDiscord<haxscramper> There is no noticeable difference
11:21:22FromGitter<alehander92> and finally you need to write it all down to a file
11:21:31FromGitter<alehander92> so you need to join them at some point
11:21:44FromGitter<alehander92> so you can have a list of string groups
11:21:46FromDiscord<Clyybber> Yeah, if you take the creation of the string into account its O(2n) vs O(n) so no big diff
11:21:49FromGitter<alehander92> like for locals / functions etc
11:22:00FromDiscord<haxscramper> https://play.nim-lang.org/#ix=2uSW
11:22:16FromDiscord<Clyybber> but take a memmapped for example
11:22:20FromDiscord<Clyybber> file
11:22:29FromGitter<alehander92> at least that's my impressiom from nim backen
11:22:31FromDiscord<Clyybber> you can't elide the cost of the memmapping
11:22:50FromDiscord<Clyybber> so in the end its better to be O(1) on your side rather than copy everything
11:22:59FromDiscord<Clyybber> but in practice ropes probably aren't much of a benefit
11:24:20FromDiscord<haxscramper> And they also have relatively clunky API - lots of procs don't have `.noSideEffect.` annotations and you need to convert all fields you want to serialize to string and then to `rope`
11:27:58*bouzu_ joined #nim
11:43:46FromDiscord<Varriount> alehander92: if you don't mind me asking, where are you from? Your nickname seems to be a derivation of "Alexander" (or the other way around).
11:43:55FromGitter<alehander92> yes
11:43:56*awe004 quit (Ping timeout: 240 seconds)
11:44:06FromGitter<alehander92> i am just using it as an username
11:44:12FromGitter<alehander92> i am alexander ivanov otherwise
11:44:46FromDiscord<Clyybber> x is h in russian or other slav langs
11:45:00FromDiscord<Varriount> My nickname has nothing to do with my real name.
11:45:05FromDiscord<Clyybber> same
11:45:19FromGitter<alehander92> i think alehander sounds spanish mostly
11:45:22FromDiscord<Varriount> "Clay Sweetser"
11:45:23FromGitter<alehander92> but i am from bulgaria
11:45:32FromGitter<alehander92> varriount sounds german to me maybe
11:45:37FromDiscord<Clyybber> just gonna call you sasha from now on
11:45:50FromDiscord<Clyybber> I wouldn't know how to pronounce varriount in german :P
11:46:13FromDiscord<Varriount> I'm not German though
11:46:54FromDiscord<Rika> alejandro would sound spanish
11:47:12FromDiscord<Varriount> I think I made the nickname up, oh, 15 years ago
11:48:38FromGitter<alehander92> oi
11:48:47FromGitter<alehander92> they call me different things
11:48:52FromGitter<alehander92> but sasha sounds ok, russian
11:48:59FromGitter<alehander92> often they call me sashe
11:49:05FromGitter<alehander92> or sasho
11:49:57FromGitter<alehander92> sande
11:50:06FromGitter<alehander92> is another possibility
11:50:56*awe004 joined #nim
11:56:44*lritter joined #nim
12:04:01FromDiscord<Varriount> Why Sasha? I feel like I'm missing some piece of cultural knowledge.
12:04:15Yardanico?
12:04:24Yardanicosasha is a "informal" name for "alehander"
12:04:34*arecacea1 quit (Read error: Connection reset by peer)
12:04:35Yardanicohttps://en.wikipedia.org/wiki/Sasha_(name)
12:04:53FromDiscord<Varriount> Ah, ok.
12:04:58*arecacea1 joined #nim
12:05:56FromDiscord<Varriount> I've never really seen that in the US. I've only ever seen "Sasha" used as a normal name.
12:06:02*supakeen quit (Quit: WeeChat 2.9)
12:06:38*supakeen joined #nim
12:07:25YardanicoUSA is not Eastern Europe :)
12:12:37*kinkinkijkin quit (Ping timeout: 260 seconds)
12:27:43FromDiscord<lakmatiol> had a classmate called alex/sasha in elementary
12:36:25*waleee-cl joined #nim
12:47:12FromDiscord<Recruit_main707> how are iterators inlined?
12:48:03FromDiscord<dk> like templates
12:48:16FromDiscord<Clyybber> wdym *how*?
12:48:36FromDiscord<Recruit_main707> i can see how a proc gets inlined, but i just cant see it with iterators
12:49:13FromDiscord<Rika> its the same idea?
12:49:13FromDiscord<Clyybber> replace every yield with the body of the for loop
12:49:26FromDiscord<Recruit_main707> i see
12:49:30Yardanico@Recruit_main707 "yield" is the assignment for the variable in the loop, nothing complex :)
12:50:56*bouzu_ quit (Ping timeout: 240 seconds)
13:02:35*Cthalupa quit (Ping timeout: 240 seconds)
13:04:04*ja0nz joined #nim
13:06:55*Cthalupa joined #nim
13:16:37*jxy quit (Ping timeout: 265 seconds)
13:27:02Oddmongeri tried to «close» my asynchttpserver, and i get error that i don't understand: https://play.nim-lang.org/#ix=2uTp
13:29:27Oddmongerdefinition is however simple: https://nim-lang.org/docs/asynchttpserver.html
13:29:35YardanicoOddmonger: cb is supposed to be gcsafe, but it accesses a "server" global
13:29:39Yardanicowhich is not gcsafe
13:29:47Oddmongerahhhh
13:29:55Yardanicoon devel you get this error:https://i.imgur.com/FJMcXRi.png
13:31:03FromDiscord<Rika> thats what you get as well on stable dont you
13:31:07Yardanicoidk
13:31:15Yardanicobut yeah, you usually should look at the *whole* error :P
13:31:20Yardaniconot just at first 1-2 lines
13:31:22FromDiscord<Rika> 1.2.6
13:31:52FromDiscord<Rika> maybe the error should be indented
13:33:48Oddmongeryes, i've looked at the whole error, but it was talking about the proc «serve», going back to the definition of the proc… i didn't understand at all
13:34:56Oddmongereven now, i don't find it clear :) (without your explanation, i wouldn't understand anything)
13:36:46*jxy joined #nim
13:52:47*ja0nz quit (Remote host closed the connection)
13:54:02*ja0nz joined #nim
13:56:46*ja0nz quit (Remote host closed the connection)
13:57:54*theelous3 joined #nim
14:04:13bunganyone know how mysql datetime binding packed ? I tried different ways.
14:06:59*xace quit (Ping timeout: 240 seconds)
14:12:15*ja0nz joined #nim
14:12:59*xace joined #nim
14:14:39*ja0nz quit (Remote host closed the connection)
14:14:54FromDiscord<Clyybber> leorize: Is there a reason you didn't use `x in {a,b,c}` syntax for enums with holes?
14:15:12disruptekBeiber4ever
14:15:18disruptekooops
14:15:19*ja0nz joined #nim
14:15:35Zevvfanboi
14:17:06*matlock quit (Quit: Connection closed for inactivity)
14:17:08*ja0nz quit (Remote host closed the connection)
14:17:44*ja0nz joined #nim
14:24:11disruptekZevv: what was that good idea you had recently? did you make an issue for it?
14:24:14*ja0nz quit (Remote host closed the connection)
14:24:45*JustASlacker quit (Ping timeout: 240 seconds)
14:25:22*ja0nz joined #nim
14:33:34leorize@Clyybber the reason is that I completely forgot about it :p
14:33:43FromDiscord<Clyybber> :D
14:34:04leorizeah I remembered why
14:34:40leorizeit has to work for all ordinals, so I can't do that sort of shorthand comparision
14:35:27leorizethe point of the API is to check whether you can safely convert so it wouldn't make sense to do it before the user get to :P
14:37:02FromDiscord<Clyybber> hmm, fair, but you can just convert to int16/uint16
14:37:14leorizerange check will kill me :P
14:37:23FromDiscord<Clyybber> so `x in {a.uint16, b.uint16, c.uint16}`
14:37:43leorizedoes it really work like that?
14:37:59leorize!eval echo high(int32) in {10u16}
14:38:02NimBotCompile failed: /usercode/in.nim(1, 18) Error: type mismatch: got <set[uint16], int32>
14:38:12leorizenope it doesn't
14:38:31*kinkinkijkin joined #nim
14:39:18leorize@dom96 can you please review #14556?
14:39:19disbothttps://github.com/nim-lang/Nim/pull/14556 -- 3net, openssl: support setting the minimum supported SSL/TLS version
14:40:00FromDiscord<Clyybber> leorize: Well, that of course doesn't work
14:42:34FromDiscord<Clyybber> you could do it only for enums that are uint16/int16 or smaller
14:43:26leorizetechnically I can generate two checks: `x in uint16 and x in {enum}`, but is this efficient?
14:44:08FromDiscord<Clyybber> not sure, I would look at the generated C code
14:46:29*ja0nz quit (Remote host closed the connection)
14:46:56*ja0nz joined #nim
14:49:37*audiofile joined #nim
14:53:17disruptekgenerating c code is never a good idea.
14:53:25leorize@Clyybber https://godbolt.org/z/rYxqr4
14:53:37leorizepretty much the same assembly
14:53:59leorizethe bunch of `or` got the advantage of being much easier to generate though :P
14:56:33FromDiscord<Clyybber> yeah :D
14:58:19*ja0nz quit (Remote host closed the connection)
14:59:11*jeko quit (Ping timeout: 272 seconds)
15:15:01*pbb quit (Ping timeout: 272 seconds)
15:27:10*theelous3 quit (Read error: Connection reset by peer)
15:32:50*ja0nz joined #nim
15:32:53*pbb joined #nim
15:37:27*ja0nz quit (Remote host closed the connection)
15:38:07*ja0nz joined #nim
15:46:53*Trustable joined #nim
15:52:34disrupteki really need to do something about this stench.
15:55:07Zevvdang that good idea, i dont know man
15:55:11FromDiscord<ache of head> Is there an "open" kind of type that encompasses all number-like types?
15:55:20Zevvit's all i have lately, good ideas. hard to tell one from the other
15:55:35Zevvwas it inferring cps types because of the cpsCall?
15:57:56Zevvthe rest of my good ideas of this week mostly consist of having yet another nap, yet another coffee or yet another beer.
15:58:44FromDiscord<hugogranstrom> @ache of head there is SomeNumber that encompasses all float and int types
15:58:53FromDiscord<ache of head> Thank you very much!
15:58:58FromDiscord<hugogranstrom> Np :)
16:04:58*jxy quit (Ping timeout: 258 seconds)
16:05:22Zevvdisruptek: so we kind of came to a grinding halt, cpswise, no?
16:06:04FromDiscord<mratsim> You should probably write a report on the RFC repo or the forum
16:06:53FromDiscord<dom96> yeah, curious what the status is
16:07:35*kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in)
16:07:55*kitech1 joined #nim
16:08:21FromDiscord<Clyybber> status of cps?
16:09:59FromDiscord<dom96> yep
16:10:09*jxy joined #nim
16:12:34FromDiscord<Clyybber> blocked by an upstream bug
16:12:43FromDiscord<Clyybber> and I'm working on my fix
16:15:09FromDiscord<dom96> okay, but how far has it come
16:15:18FromDiscord<dom96> what's already possible with it?
16:15:24FromDiscord<dom96> what isn't yet possible?
16:22:49*arecacea1 quit (Remote host closed the connection)
16:23:27*arecacea1 joined #nim
16:23:56*apahl quit (Ping timeout: 240 seconds)
16:25:07*apahl joined #nim
16:31:48FromDiscord<Clyybber> one problem is reallocs afaik
16:31:55FromDiscord<Clyybber> but other than that, its just bugs
16:32:16FromDiscord<Clyybber> Zevv is the guy to ask
16:45:37kinkinkijkinalright, I've gotten fed up with these vulkan bindings and the target platforms for the end product the renderer was to be a part of has changed from rtdesktop x86_64 to rtdesktop x86_[32,64], armv[7,8], and a couple others
16:45:49kinkinkijkinis there an up-to-date nim gles2 binding around?
16:46:19FromDiscord<Clyybber> kingkingijkin: Which wrappers were you using?
16:46:38kinkinkijkinnimgl, which only supports modern desktop gl and vulkan for rendering
16:46:54FromDiscord<Clyybber> Ah, so you want gl and not vulkan?
16:46:59kinkinkijkingles2
16:47:03FromDiscord<Clyybber> I see
16:47:05kinkinkijkinso im switching off nimgl now
16:47:50FromDiscord<Clyybber> theres https://github.com/nimious/gles
16:48:36*hnOsmium0001 joined #nim
16:48:44kinkinkijkinfrom 5 years ago
16:49:03FromDiscord<Clyybber> its not like gles changed much (or anything) in between
16:49:13kinkinkijkinyes, but nim did
16:49:26FromDiscord<Clyybber> you should be able to use c2nim relatively easily
16:49:35FromDiscord<Clyybber> and build a new wrapper with that
16:50:16FromDiscord<Recruit_main707> or manually wrap things as you need to
16:51:46kinkinkijkini think ill adapt those bindings to modern nim maybe
16:53:32Zevvdom96: we have a basic proof of concept that works, but the because of the initial implementation being untyped, its limited in what it can handle. disruptek has been working on moving the transformation to a typed macro, but we run into two or three nim bugs that are blocking.
16:54:06Zevvhere is very basic snippet doing a tcp echo server and a hundred clients, based on cps. it implements three different layers in one file:
16:55:00Zevvbasic epoll based event queue, some glue around posix sockets to allow "blocking" calls like async, and the implementation of the tcp server and client based on the first two
16:55:24Zevvlots of things are still crappyish, but basically it works
16:56:45Zevvthere is also some code that works that implements iterators, coroutines, crude exception handling and gotos
16:57:59*superbia1 joined #nim
17:00:46*superbia quit (Ping timeout: 256 seconds)
17:00:46Zevvdisruptek and me have a bit different view on what all this stuff means and can do. for me its pretty pragmatic: it moves the stack to the heap so you are free to jump wherever you want, as there is no longer "one true path" trhough the code. disruptek is a few steps ahead and has visions about freely compositing data and functions into continuations that work on everything, but thats a few steps too far for me
17:00:52Zevvright now.
17:11:56FromDiscord<haxscramper> Is it possible to capture `var` variable in the callback if I'm willing to risk shooting myself? Some kind of `{.allowClosureToCaptureVar.}` I want to do a recursive visit on the object and possibly mutate it.
17:12:49Zevvyou can take its addr and use the pointer
17:16:36Oddmongerwhy not using a ref ?F
17:16:39Oddmonger-F
17:18:01FromDiscord<haxscramper> Good question actually
17:18:59FromDiscord<haxscramper> What I have is basically more statically typed encoding of nim ast - e.g. separate type for object declaration, for field etc. Mostly intended to be used in macros of course
17:19:25FromDiscord<haxscramper> Will something like this benefit from using `ref`?
17:19:44FromDiscord<haxscramper> Right now this is all just `NObject = object`
17:25:44bungpass it to proc by ref or value, the major differences I think
17:26:11disruptekZevv: yeah, that's it. will you make an issue for the inference bit?
17:26:42disrupteki am deep into rewriting nimph.
17:27:20*ja0nz quit (Remote host closed the connection)
17:28:02bungafter days work I realize I cant correctly pack datetime param without correct mysql document.
17:29:02bungmost drivers using text query that turns datetime to string
17:35:25disruptekhooray for strings!
17:38:39bungoh, I just found a cshap lib that I can inspire
17:38:49disruptekyou
17:38:52disruptekcomplete me.
17:40:37leorize[m]tried my hand on some RST constructs: https://alaviss.github.io/dnsstamps/dnsstamps.html#initDoHStamp%2Cstring%2CopenArray%5Barray%5B%2Cbyte%5D%5D%2Cstring%2Cstring%2CopenArray%5Bstring%5D%2Cset%5BProperties%5D
17:40:53leorize[m]does that look decent enough?
17:41:21disruptekcan they be right-aligned? and, i'd remove the trailing colon.
17:41:42disruptekyou wrote these by hand?
17:41:57leorizenah, it's an RST thing
17:42:04leorizecalled field tables
17:42:23disruptekright, but you wrote the RST by hand.
17:42:30leorizeyea
17:43:48disrupteklooks cool in any event. 👍
17:44:06disrupteksome day i will get around to doing this for openapi.
17:48:15FromDiscord<lqdev> @leorize how'd you do that?
17:48:33disruptekhttps://github.com/alaviss/dnsstamps/blob/master/src/dnsstamps.nim
18:08:25FromDiscord<lqdev> oh cool
18:09:28leorizewhy only now I realize that we have a Group by in the docs
18:09:51disrupteka group by?
18:09:58leorizegrouping by types makes it much easier to navigate
18:10:06disruptekoh, yeah.
18:10:38*kinkinkijkin quit (Disconnected by services)
18:11:32disrupteki noticed that the seqs section doesn't seem to render its links correctly.
18:11:41disruptekhttps://nim-lang.org/docs/system.html#system-module-seqs
18:11:50leorizeit's fixed in devel iir
18:11:51leorizeiirc*
18:11:54disruptekoh, nice.
18:11:55Yardanicothis was fixed, yeah
18:12:22FromGitter<deech> Is there a way to assign the result of `genericParams(...)`? I see it's of type `typedesc[tuple]`.
18:12:45YardanicoIt returns types
18:12:52YardanicoYou can't use types as an assignment target :P
18:13:32FromGitter<deech> Yeah, I just need someplace to store it. Guess I could convert it to a NimNode?
18:15:18YardanicoStore the type?
18:15:20Yardanicohuh
18:15:33YardanicoI don't think you can store typedescs in variables, even const or compile-time
18:15:57Yardanicotypedesc is not a "value"
18:16:43FromGitter<deech> I just got around it with `default(genericParams(...))`, it's a comp time thing so I guess that's ok. Would be nice to have a type level language.
18:19:15FromGitter<deech> Haha, I guess comp time `default` is Nim's type witness.
18:19:27Yardanicodefault just accepts a typedesc
18:21:25FromGitter<deech> I like how Nim sometimes has the Lisp aesthetic where you can cobble together 80% of a some feature ( in this case Haskell's `Proxy`) for 20% effort.
18:26:03leorize[m]disruptek: https://alaviss.github.io/dnsstamps/dnsstamps.html#initDoHStamp%2Cstring%2CopenArray%5Barray%5B%2Cbyte%5D%5D%2Cstring%2Cstring%2CopenArray%5Bstring%5D%2Cset%5BProperties%5D
18:26:05leorize[m]right align achieved :P
18:26:24disrupteknice!
18:26:33Yardanicoto which demon in hell did you make a sacrifice to make that work?
18:26:46leorize[m]I will probably PR the styling change to Nim instead, the way I'm doing it is hackish
18:27:05leorizeI edited the docgen template to include my own css :P
18:27:10disruptekyeah, he cheated.
18:28:36leorizeI made this library with the intention of being a template for my future projects and not for any actual usage :P
18:29:47leorizeany feedback on the repo?
18:29:51leorize!repo alaviss/dnsstamps
18:29:52disbothttps://github.com/alaviss/dnsstamps -- 9dnsstamps: 11Nim implementation of DNS server stamps 15 1⭐ 0🍴
18:31:03disrupteki guess this is what i should model my actions from?
18:31:16*jxy quit (Ping timeout: 265 seconds)
18:31:50leorizemaybe :P it's a bit overkill for simple projects like this, though
18:32:01Yardanicoleorize: I was overjoyed when I saw MPL :P
18:32:13disrupteki cannot be bothered to maintain separate flows for different projects, though.
18:33:10disrupteki have like 40 public nim projects.
18:33:26leorizeyou can use that one
18:33:40leorizeI really hope github actions add a way for me to make templates actions
18:33:51disruptekyeah, i need to be able to rubber-stamp this shit.
18:33:53leorizecurrently they want me to write js
18:45:15leorize[m]oh hey they added tihs sometime ago: https://github.blog/changelog/2020-08-07-github-actions-composite-run-steps/
18:45:35leorize[m]expect to see something from me soon then
18:45:47*apahl quit (Ping timeout: 260 seconds)
18:46:41*apahl joined #nim
18:49:44*superbia1 is now known as superbia
18:51:58*jxy joined #nim
18:53:38*bung quit (Ping timeout: 258 seconds)
19:00:35FromDiscord<Clyybber> leorize: Can you review https://github.com/nim-lang/Nim/pull/15216 ?
19:00:37disbotUnsigned iovlen
19:08:03FromDiscord<djazz> I got webview working on windows :3 https://media.discordapp.net/attachments/371759389889003532/746807908645339297/webview-success.PNG
19:09:15FromDiscord<ache of head> Ayy, sick!
19:09:48shashlicknifty
19:18:13FromDiscord<djazz> WIP https://github.com/daniel-j/nim-webview
19:21:35disruptekso the oskca one no longer works?
19:22:08FromDiscord<djazz> it does, but uses an older version of the webview library (I target the current master, not yet stable)
19:22:49FromDiscord<djazz> older webview uses MSHTML on Windows, while the newer uses EdgeHTML/Chromium (New Edge) to render on Windows
19:23:04disruptekah, i see.
19:23:31FromDiscord<djazz> If anyone wants to use my lib, that's fine. I need it for something else I'm working on 🙂
19:24:22FromDiscord<djazz> there are currently two webview nim bindings; webview and webgpu. webgpu has a lot of linux-only stuff in it
19:26:35FromDiscord<djazz> the new webview is very barebones, you have to manage the window yourself mostly, the api only exposes setting window size, title. So if you want to minimize, make it borderless etc you need to code it yourself. This will probably make its way back into new webview eventually
19:27:14disruptekwhere do i go to read about the webgpu for linux?
19:27:23FromDiscord<djazz> sry
19:27:27FromDiscord<djazz> webgui*
19:27:45FromDiscord<djazz> https://github.com/juancarlospaco/webgui
19:28:46disruptekright, i know that one.
19:29:52FromDiscord<djazz> lots of `when defined(linux)` in that one
19:30:12FromDiscord<djazz> and emit pragma for gtk, ugh
19:31:37FromDiscord<djazz> the webview nim package was last updated in 2019
19:33:26disruptekthanks for getting this working. you should license it; i'd like to play with it.
19:33:30FromDiscord<djazz> Something like this but built on Nim (instead of Rust) would be cool https://tauri.studio
19:33:48Yardanicoinstead I should just finish my sciter wrapper :P
19:33:51FromDiscord<djazz> It uses webview behind the scenes, and they are doing some collab
19:34:08disrupteksciter doesn't interest me.
19:34:13FromDiscord<djazz> me neither
19:34:26Yardanicodisruptek: it's better than using a full web browser engine anyway :)
19:34:35disruptekdepends on your goals.
19:34:58FromDiscord<djazz> I would like a gui framework, maybe libui/wxWidgets, where you can embed a webview, native for each platform
19:35:11FromDiscord<djazz> so you dont have to do everything with html and css
19:35:24FromDiscord<djazz> maybe you want to show some html somewhere
19:35:47FromDiscord<djazz> i think there is a simple webview in wx though
19:35:52FromDiscord<djazz> _very_ simple
19:36:09FromDiscord<haxscramper> Is there any way to uninstall nim channel using `choosenim` or I just can delete `~/.choosenim ...` and install it again
19:36:25FromDiscord<djazz> or maybe they improved it since, idk
19:36:44FromDiscord<djazz> seems like it's better now, huh https://docs.wxwidgets.org/trunk/classwx_web_view.html
19:36:47disruptekthing is, a web-view that can't render like a full browser is rarely compelling -- there are simpler options if you don't care about the web.
19:37:09FromDiscord<djazz> that widget uses edge/chromium, webkitgtk and webkit too
19:37:21FromDiscord<Elegant Beef> @Rika this works so i can only imagine the issue is that `actor` doesnt have the other controller definitions so cant convert to them, but that's weird
19:37:22FromDiscord<Elegant Beef> https://play.nim-lang.org/#ix=2uWt
19:37:27FromDiscord<exelotl> @djazz nice work!!! Definitely gonna try this some time :D
19:37:29FromDiscord<djazz> maybe I should try use that
19:37:35disruptekyeah, that one looks like it has improved a lot in the last decade.
19:37:41FromDiscord<djazz> ~~steal inspiration~~
19:38:05FromDiscord<djazz> with wx you get proper events too
19:38:44FromDiscord<djazz> with webview, you use js to hijack clicks on links, since there is no way to get events by the webview itself
19:38:56Yardanicodisruptek: not really
19:39:15Yardanicofirst of all, with HTML/CSS you don't need to reeducate designers
19:39:34disruptekyou do if they can't reproduce what they see in chrome.
19:39:46Yardanicodisruptek: well, companies use sciter anyway
19:39:50Yardanicoand quite big companies too
19:40:07disrupteki hear there are even companies that use go. bigs ones, even.
19:40:42FromDiscord<djazz> using webview is still nice if all you need is html/css/js and only some native code
19:41:01FromDiscord<djazz> (you can write the js in nim heh)
19:41:29disrupteki just want to be able to render svg and pick up events.
19:41:32FromDiscord<Elegant Beef> I personally dont like webbased applications, so i just cry about it
19:41:59FromDiscord<Elegant Beef> Although i assume webview uses fewer resources than electron
19:42:21FromDiscord<djazz> webview uses an existing browser, without the _chrome_
19:42:36FromDiscord<djazz> electron just bundles it up in a neat package
19:42:53FromDiscord<djazz> you can have small electron apps if you install electron on system level
19:43:10FromDiscord<Elegant Beef> You can have small native apps if you make native apps 😄
19:44:06shashlick@haxscramper: just remove the specific version from ~/.choosenim/toolchains
19:44:39FromDiscord<djazz> I know GTK is basically web tech too, they use CSS and their GJS JavaScript engine
19:46:58FromDiscord<djazz> Looking at the wxnim package by PMunch, a bit out of date... Maybe I'll try tackle that one next
19:47:10*vicfred quit (Quit: Leaving)
19:47:45FromDiscord<djazz> probably using nimterop
19:47:54FromDiscord<djazz> > This wrapper was originally generated by c2nim.
19:48:11FromDiscord<djazz> generated for 5 year old headers
19:52:12FromDiscord<djazz> from*
20:07:54shashlickwxwidgets is c++ no?
20:07:59FromDiscord<djazz> yes
20:08:31shashlicknimterop doesn't wrap c++ yet
20:09:28FromDiscord<djazz> ah, but c2nim can?
20:09:44FromDiscord<djazz> toast has a cpp mode though
20:12:23shashlickyes but it doesn't know how to map c++ entities into Nim wrappers
20:12:32FromDiscord<djazz> ah
20:12:43shashlickC2nim does a subset of C++
20:20:30FromDiscord<Elegant Beef> Ok so this is weird, if i import my controller stuff it fails and cannot implictly convert to call my methods, but if i include the files it works
20:25:41*arecacea1 quit (Remote host closed the connection)
20:26:13FromDiscord<Elegant Beef> Ok im dumb, i needed to import the root object file in my main file
20:29:55*arecacea1 joined #nim
20:32:27*PMunch joined #nim
20:42:11disruptekbad news.
20:42:41disruptekscript kiddies gave up trying to login to my freenode acct.
20:52:21shashlickno one can disrupt you
21:03:21PMunchIs that bad news?
21:13:25FromDiscord<Elegant Beef> Also pmunch going back to my option macro, how would you stop it from being run, a `?procName` ?
21:13:47PMunchWhat do you mean?
21:14:14FromDiscord<Elegant Beef> Well you said just dont run the proc not early exit, so im trying to figure out how you'd do that
21:15:04PMunchOh, I meant the first thing you do in the procedure is check all the Option arguments and then quit if one of them is a none
21:15:11FromDiscord<Elegant Beef> That's what i do
21:15:21FromDiscord<Elegant Beef> if any are non i early return
21:15:39PMunchAaah, then I misunderstood. You seemed to imply that you would run the function until there was an option that was used and wasn't some
21:15:40*natrys quit (Quit: natrys)
21:15:45FromDiscord<Elegant Beef> ah
21:15:50PMunchWhich would've been really weird :P
21:18:03FromDiscord<Elegant Beef> Well before i make a PR these are the macros, feel free to tell me to change anything :P↵https://hatebin.com/foiqceayym
21:19:04FromDiscord<Elegant Beef> I suppose i could make a single proc that the macro calls with the bool `isSome`
21:19:05*audiofile quit (Ping timeout: 240 seconds)
21:22:28FromDiscord<Elegant Beef> oh forgot about the unpacking
21:23:00PMunchAnd will that work with "ident, ident: Option[T]"?
21:23:55FromDiscord<Elegant Beef> yes
21:24:08FromDiscord<Elegant Beef> Well didnt test it with Generic 😛
21:25:14PMunchShouldn't change anything :P
21:25:50FromDiscord<Elegant Beef> there unpacked now https://media.discordapp.net/attachments/371759389889003532/746842592209010718/unknown.png
21:26:06FromDiscord<Elegant Beef> Shit b is wrong
21:26:13FromDiscord<Elegant Beef> I wasnt paying attention just writting 😄
21:34:53FromDiscord<Elegant Beef> There you go pmunch destroy my PR
21:35:25*solitudesf quit (Ping timeout: 265 seconds)
21:39:39PMunchDid you make one?
21:40:34FromDiscord<Elegant Beef> Yea
21:42:19PMunchLink?
21:42:29FromDiscord<Elegant Beef> https://github.com/PMunch/nim-optionsutils/pull/1
21:42:30disbotAdded withSome and withNone
21:43:00FromDiscord<Elegant Beef> Which pmunch is the imposter, you or this github account?
21:44:06PMunchHaha, neither, I just didn't get a notification for it
21:44:23FromDiscord<Elegant Beef> Weird
21:45:10PMunchHmm, what happens with return values?
21:45:52FromDiscord<Elegant Beef> default value is returned, which i assume would be handled anyway
21:46:48disruptekat this rate, no one is going to be able to stop me.
21:48:49FromDiscord<Elegant Beef> Disruptek, im on my way
21:48:54FromDiscord<Elegant Beef> Get ready to get stoppeded
21:51:52*WilhelmVonWeiner left #nim (#nim)
21:54:50*Jesin quit (Quit: Leaving)
21:56:15*bung joined #nim
22:02:41*krux02 quit (Remote host closed the connection)
22:04:41leorize`nim jsondoc --hints:off --warning:off --stdout --project path/to/module.nim`
22:05:18leorizethis is a really interesting use of the compiler
22:05:47*luis_ joined #nim
22:06:08leorizeyou got the full list of exported APIs within the project in json
22:06:11disrupteki'm gonna be switching my repos to use mkdocs using that stuff.
22:06:35leorizewhat I'm seeing a potential for is the ability to do API diffing
22:06:43disruptekhttps://squidfunk.github.io/mkdocs-material/
22:06:59leorizemeaning that you can get precisely what new API and what has been changed since last release
22:06:59disruptekwe could use it to auto-version APIs.
22:07:28disruptekthis is something i've wanted for openapi, too, because currently gensym makes it hard for me to track changes.
22:07:46PrestigePMunch: sorry to bug you about it but I'm eager for the change - did you figure out that nimlsp bug? Was it just detecting the project file?
22:08:09*luis_ quit (Remote host closed the connection)
22:08:10PMunchSorry, I haven't really had a chance to look at it :(
22:08:15PMunchBut I think that's the problem
22:08:32PMunchIt's either that, or a nimsuggest issue
22:08:32*luis_ joined #nim
22:08:42PMunchMaybe dom96 can weigh in on it?
22:08:51leorizewhen in doubt, it's a nimsuggest issue
22:08:55PMunch:)
22:09:07PrestigeNo worries man, just excited about the fix haha
22:09:27Prestigeyou still feeling better?
22:14:19PMunchYeah, but I've been coughing quite a bit today. But I feel totally fine
22:14:34PMunchAnd my test was negative, not sure if I mentioned that here :P
22:14:45*bung quit (Ping timeout: 240 seconds)
22:15:13*Trustable quit (Remote host closed the connection)
22:16:55leorizeluckily it's just a cold then :)
22:16:58*apahl quit (Ping timeout: 260 seconds)
22:18:53Prestigeawesome, congratz
22:18:59*apahl joined #nim
22:19:16FromDiscord<Elegant Beef> Congrats you got sick, but no the sickness of the year 😛
22:19:18FromDiscord<Elegant Beef> not*
22:19:28PMunchHooray, I guess :P
22:25:04leorizeAnyone wanted to weigh in on this? https://github.com/nim-lang/RFCs/issues/168
22:25:05disbotConcepts and type-checking generics ; snippet at 12https://play.nim-lang.org/#ix=23U8
22:25:25leorizeit seems like we haven't reached a consensus yet
22:30:22disruptekso we get rid of , , , syntax following the `concept` keyword.
22:30:40disruptekthis seems like it limits the concept.
22:33:36shashlickelijahr just updated the travis script - we will have arm/ppc CI support soon
22:35:38FromDiscord<Varriount> leorize: I would, but the merits of each approach are way above my head.
22:35:54FromDiscord<Varriount> I just want something akin to Go's interfaces
22:36:02disrupteknot a fan of either/orelse. i would rather find a way to use existing constructs.
22:36:04FromDiscord<Elegant Beef> Yea my dumb dumb brain, just goes "Whatever let's me use concepts at runtime, would make me happy"
22:37:39FromDiscord<Varriount> It seems to me that all the advanced uses of constructs are mostly required for AI/Neural Network/Advanced Math domains, or Libraries/Frameworks
22:37:48FromDiscord<Varriount> *advanced uses of concepts
22:37:57disruptekso, like, code that we actually want as opposed to tests.
22:38:52FromDiscord<Varriount> Yeah.
22:39:15disruptekwell that's the point, right?
22:39:15FromDiscord<Elegant Beef> I dont even get either/orelse isnt that just A or B?
22:39:39disruptekit means that the concept matches for one of the two branches, at least.
22:40:03FromDiscord<Varriount> disruptek: Yeah, I would rather limit the number of new constructs.
22:40:12FromDiscord<Varriount> Or rather, re-use existing ones.
22:41:16FromDiscord<Varriount> Maybe we just need a mechanism to allow compile-time logic to hook into a synthetic "type", and let the compiler call that logic to perform type checking
22:41:31disruptekwe have that now.
22:41:43disruptekyou can use any boolean. just, y'know, not not.
22:42:21disruptekwhich is annoying.
22:42:38*luis_ quit (Quit: luis_)
22:42:59*luis_ joined #nim
22:43:10disruptekthis syntax is more verbose, which i don't like.
22:43:29disrupteki'd rather be able to say foo.bar is T and not care whether bar is a field or a proc yielding T.
22:44:27disrupteki understand that the motivation is to have better structure but it's not clear that the work to do that needs to be performed by the programmer.
22:45:30*awe004 quit (Ping timeout: 265 seconds)
22:46:03FromDiscord<Elegant Beef> I think the current concepts are fine to declare, minus A or B inside a single concept, they are a tad bit confusing at first, but once you realize they're just describing what makes the Concept it's actually quite nice
22:46:52disruptekwhat do you mean by, /minus A or B inside a single concept/ ?
22:48:10FromDiscord<Elegant Beef> If it implements A or if it implements B, them just being any arbitrary concept line
22:48:26FromDiscord<Elegant Beef> I atleast couldnt figure out how to do that in the current concepts and am unsure if it's possible
22:48:50disruptekyou mean like a typeclass?
22:49:06FromDiscord<Elegant Beef> No clue
22:49:51disrupteki've found statics particularly difficult to compose, but other than that i haven't been too stymied.
22:50:09disruptekthough not having not sucks.
22:50:34FromDiscord<Elegant Beef> I dont know how to have concepts with A or B implementations like `&` or `+` for instance
22:51:08Yardanicoyou mean a concept for two types, and it checks if there's a &(A, B) ?
22:51:24FromDiscord<Elegant Beef> No
22:51:31Yardanicothen what?
22:51:48FromDiscord<Elegant Beef> I mean a concept that can abstract `Addables` for instance which checks if the T implements `&` or `+`
22:51:58FromDiscord<Elegant Beef> And if it does it's an addable
22:52:05Yardanicothis is possible?
22:52:13Yardanicoyou can check if a type satisfies a concept
22:52:19FromDiscord<Elegant Beef> > I dont know how to have concepts
22:52:21disruptekjust try it with a typeclass that holds two concepts.
22:52:27*luis_ quit (Ping timeout: 258 seconds)
22:52:36FromDiscord<Elegant Beef> I did say i dont know how, and if it's possible 😄
22:52:46disruptektry it and see.
22:52:50FromDiscord<Elegant Beef> I mean i did
22:52:53FromDiscord<Elegant Beef> I couldnt figure out how
22:53:00disruptektry making two concepts.
22:53:04disruptekone tests for `&`.
22:53:08disruptekone tests for `+`
22:53:17FromDiscord<Elegant Beef> That's why i didint solve it, i figured it should be doable in a single concept
22:53:18disruptekthen Addable = First or Second
22:53:35disruptekAddable is your "concept" (hint: really just a typeclass of two concepts)
22:55:27Yardanico@Elegant like disruptek told you: https://play.nim-lang.org/#ix=2uX6
22:56:33FromDiscord<Elegant Beef> Yea i didnt think to try that as it seems weird
22:56:57Yardanicowhy?
22:57:22Yardanico"Type classes can be combined using the standard boolean operators to form more complex type classes"
22:57:22FromDiscord<Elegant Beef> Well cause you're making concepts you might not need to just construct a another concept you will
22:57:46Yardanicowell I don't see how it would be logical in this case
22:57:57Yardanicoa concept is for a single variable/object to satisfy something usually
22:58:04Yardaniconot for different ones with different operations
22:58:23disrupteki don't agree.
22:58:29Yardanicowith what
22:58:54disrupteki want concepts to be able to assert generic properties that may and may not overlap.
22:59:14Yardanicowouldn't it be the case of some big black box which "does everything"
22:59:20YardanicoI think it's better to have stuff more separate
22:59:42disruptekas an example, i have a concept for a container that holds packages.
23:00:04disruptekwhen that container is a table key'd off a package name, then i want to exploit that for faster lookup.
23:01:37disruptekotherwise, i just iterate over the container.
23:07:42disruptekthis example isn't great.
23:07:56disruptekaddQuoted doesn't seem any better for having been turned into a Quotable.
23:13:16FromDiscord<Varriount> > when that container is a table key'd off a package name, then i want to exploit that for faster lookup.↵Wouldn't it be better for the container type to implement that logic?
23:13:53disruptekand it does.
23:14:04disruptekbut that doesn't make it match the concept any less.
23:15:37FromDiscord<Varriount> Oh, I think I see. You're using concepts to achieve what might be achieved in other languages by using multiple inheritance to inherit methods from a helper class
23:18:18disruptekwe don't really have any way to shade generics otherwise.
23:22:07FromDiscord<Varriount> "shade"?
23:24:25disruptekto disambiguate multiple matching generics.
23:31:03disruptekmaybe inheritance will get fixed some day.
23:31:28disruptekit seems like if it happens, it will happen accidentally.
23:33:07Yardanicowdym "fixed"
23:33:11Yardanicoit's not broken currently :)
23:33:22disrupteklol
23:42:12FromDiscord<exelotl> hey, I'm creating an issue on the Nim repo and I'm wondering if it's important for me to do the "Current Output" and "Expected Output" thing?
23:42:27Yardanicowell not really, but it would be better if you have "Current Output"
23:42:38Yardanicoat least
23:42:48Yardanicoso if it changes in the future, we'll be able to see that
23:43:17Yardanicoalso the code example should be the one crashing/failing assert/etc, pls don't comment the crasinh code :)
23:43:20Yardanicocrashing*
23:46:11FromDiscord<exelotl> do you do any sort of automation to detect if the output changed? I recall reading about that during the stalebot discussions, but I didn't know if it's all just hypothetical
23:46:30disrupteknot yet.
23:46:31FromDiscord<exelotl> I was planning to put a comment in my example snippet like: echo x # <--- outputs y?
23:46:42disruptekcomments are useful.
23:46:53Yardanicohttps://github.com/genotrance/tissue
23:47:08*vicfred joined #nim
23:54:31*Vladar quit (Remote host closed the connection)
23:57:09disruptek!repo nimbug
23:57:11disbothttps://github.com/juancarlospaco/nimbug -- 9nimbug: 11Nim Semi-Auto Bug Report Tool 15 8⭐ 0🍴
23:57:32Yardanicomost of the info here is redundant :P
23:59:22disrupteknot really.
23:59:48disruptekhave you looked at the output?
23:59:59Yardanicoyes