00:34:10 | silvernode[m] | is there a proc that lists the contents of a given directory? |
00:34:22 | silvernode[m] | I can't seem to find anything in the OS module |
00:34:47 | FromDiscord | <Varriount> There's one there |
00:35:04 | disruptek | walkDir |
00:35:27 | silvernode[m] | ah, I knew it would be calling something not obvious. |
00:35:49 | disruptek | holy shit you guys. |
00:35:53 | silvernode[m] | I would looking for listDir or ls() |
00:35:54 | disruptek | nimble supports local deps! |
00:36:18 | silvernode[m] | * I was looking for listDir or ls() |
00:36:24 | disruptek | don't be rude. |
00:36:29 | disruptek | no one calls it that. |
00:36:34 | disruptek | it's readDir. |
00:39:26 | silvernode[m] | readDir is fine |
00:53:32 | * | Zectbumo quit (Remote host closed the connection) |
00:54:47 | * | Zectbumo joined #nim |
00:56:07 | silvernode[m] | https://play.nim-lang.org/#ix=2uRv |
00:56:15 | silvernode[m] | trying to detect if a directory is empty or not |
00:56:45 | silvernode[m] | if something is in the directory, it triggers the else part but nothing is echoed if something is in the directory |
00:59:00 | silvernode[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:27 | disruptek | that's the idea. |
01:57:48 | disruptek | it 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:27 | FromDiscord | <iWonderAboutTuatara> How can you write to files in Nim? |
03:14:56 | FromDiscord | <iWonderAboutTuatara> A better question, how can I qppend something to a file in Nim? |
03:15:14 | FromDiscord | <iWonderAboutTuatara> F/e add each element of a newline Nim |
03:15:24 | FromDiscord | <iWonderAboutTuatara> (edit) 'a' => 'an seq' |
03:34:31 | FromDiscord | <Rika> open using the append file mode |
03:34:36 | FromDiscord | <Rika> then write to the file normally |
03:39:49 | * | krux02 quit (Remote host closed the connection) |
03:45:41 | FromDiscord | <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:18 | FromGitter | <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:30 | FromDiscord | <Elegant Beef> Knaque this is one way https://play.nim-lang.org/#ix=2uRX |
04:30:13 | FromGitter | <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:34 | FromDiscord | <Elegant Beef> Is there a better way to handle this, like by using methods? https://hatebin.com/wwkmewvuou |
05:25:26 | FromDiscord | <Elegant Beef> Methods seem weird as far as i can tell i need to convert to the proper type |
05:26:16 | FromDiscord | <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:55 | Zevv | Elegant Beef: which part of the snippet is your problem? |
07:06:07 | FromDiscord | <Elegant Beef> I mean the mainlogic thing |
07:06:56 | FromDiscord | <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:58 | FromDiscord | <Elegant Beef> Guess i should provide the controller declaration aswell https://hatebin.com/ltvamsklzu |
07:09:24 | FromDiscord | <Elegant Beef> If i stored FollowController as a Controller would a method still require converting to a FollowController to invoke that method? |
07:09:49 | FromDiscord | <Elegant Beef> I am not using method in place of proc here |
07:10:30 | Zevv | I 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:36 | Zevv | you'll hit unpleasant surprises |
07:10:44 | Zevv | personally, I don't method anymore |
07:11:30 | FromDiscord | <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:32 | FromDiscord | <Elegant Beef> Which i didnt like |
07:11:53 | Zevv | hm I don't think you should need that |
07:11:59 | Zevv | that's where the methods come in |
07:12:06 | Zevv | OO is funny in nim :/ |
07:14:23 | FromDiscord | <Elegant Beef> Hmm you're right |
07:14:29 | FromDiscord | <Elegant Beef> No clue why it wasnt working previously |
07:15:52 | Zevv | maybe still had a 'proc' instead of a 'method' somewhere/ |
07:17:35 | FromDiscord | <Elegant Beef> Do the methods have to be declared in a single file? |
07:19:23 | Zevv | I don't think so, but you do have to export* of course |
07:19:30 | FromDiscord | <Elegant Beef> yea i know that |
07:21:14 | FromDiscord | <Elegant Beef> Yea this is weird |
07:21:27 | FromDiscord | <Elegant Beef> I duplicated what im doing on nim playground no errors |
07:22:25 | FromDiscord | <Elegant Beef> It's complaining that act.controller is of type controller and not either AiController or PlayerController... |
07:28:01 | FromDiscord | <Elegant Beef> Lol, i minified it and put it on nimplayground and it works |
07:44:11 | Zevv | but not locally for you? |
07:44:42 | FromDiscord | <Elegant Beef> No it works locally |
07:44:50 | FromDiscord | <Elegant Beef> The minified version works, not the large version |
07:45:23 | FromDiscord | <Elegant Beef> But the underlying logic is identical afaik minus stretching multiple files |
07:47:09 | FromDiscord | <Elegant Beef> Here's the full project if you want to see it↵https://github.com/beef331/shooter |
07:47:36 | FromDiscord | <Elegant Beef> main.nim line 19 fails due to Controller not being PlayerController or AiController |
07:50:25 | FromDiscord | <vieru> does anybody know do to ship openssl with my nim app ? |
07:50:34 | FromDiscord | <vieru> im trying to use httpclient |
07:50:54 | FromDiscord | <vieru> and static linking like in the docs doesn't work |
07:51:11 | FromDiscord | <vieru> it just gives the same error |
07:51:32 | FromDiscord | <vieru> could not load libssl1_1.dll..... |
07:51:52 | FromDiscord | <vieru> https://cdn.discordapp.com/attachments/386897099293196288/746374446096449546/unknown.png |
07:52:36 | FromDiscord | <Elegant Beef> Did you put it next to your exe? |
07:53:00 | FromDiscord | <vieru> i dont want to shit all the dlls with my exe ↵i just want a single exe |
07:53:09 | FromDiscord | <Elegant Beef> https://nim-lang.org/docs/openssl.html |
07:53:10 | FromDiscord | <vieru> no other files |
07:53:46 | FromDiscord | <vieru> `--dynlibOverride:ssl --passl:-lcrypto --passl:-lssl`↵yeah I've tried this |
07:53:49 | FromDiscord | <vieru> no luck |
07:54:00 | FromDiscord | <vieru> the executable is the same size everytime |
07:54:16 | * | awe004 joined #nim |
07:54:23 | FromDiscord | <Elegant Beef> Statically linking isnt.... including the .dll afaik |
07:54:23 | FromDiscord | <vieru> the libs dont get included |
07:54:58 | FromDiscord | <Elegant Beef> I believe you want to make a portable executable |
07:55:02 | FromDiscord | <vieru> yep |
07:55:35 | FromDiscord | <vieru> i have the static openssl libs downloaded |
07:55:39 | FromDiscord | <Elegant Beef> Guess im wrong about the static linking 😄 |
07:56:01 | FromDiscord | <vieru> libssl.a↵libssl.dll.a↵libcrypto.a↵libxrypto.dll.a |
08:05:23 | FromDiscord | <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:43 | FromDiscord | <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:46 | FromDiscord | <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:41 | FromDiscord | <dom96> What is your goal? |
08:54:53 | FromDiscord | <dom96> To check its syntax? |
08:55:45 | * | JustASlacker joined #nim |
08:55:46 | FromDiscord | <ivall> sent a code paste, see https://play.nim-lang.org/#ix=2uSA |
08:55:49 | FromDiscord | <ivall> (edit) 'https://play.nim-lang.org/#ix=2uSA' => 'https://play.nim-lang.org/#ix=2uSB' |
08:56:37 | FromDiscord | <Elegant Beef> the message might not exist |
08:56:39 | FromDiscord | <dom96> Maybe the discord doesn’t give you the contents of the message that has been deleted? |
08:56:56 | FromDiscord | <Elegant Beef> Well i figure if it doesnt exist the content is nothing |
08:56:58 | FromDiscord | <ivall> but why? in discord.py all works fine |
08:57:10 | FromDiscord | <ivall> @Elegant Beef yeah its doesnt exist |
08:57:11 | FromDiscord | <Elegant Beef> It's not discord.py |
08:57:19 | FromDiscord | <Elegant Beef> Well then why do you expect a content? |
08:57:49 | FromDiscord | <dom96> Broken Nim discord library then? |
08:57:53 | FromDiscord | <dom96> Ask the author |
08:58:12 | FromDiscord | <Elegant Beef> "it doesnt exist", seems they use a bool instead of an `Option[Message]` |
08:59:05 | FromDiscord | <Elegant Beef> But yea ask the author |
09:00:53 | * | vicfred quit (Quit: Leaving) |
09:00:53 | FromDiscord | <ivall> > It's not discord.py↵@Elegant Beef |
09:00:55 | FromDiscord | <ivall> Same api |
09:01:22 | FromDiscord | <ivall> I just getting blank message |
09:01:26 | FromDiscord | <ivall> Aftet delete |
09:02:28 | FromDiscord | <Elegant Beef> Wait are you using the python library inside nim? |
09:02:37 | FromDiscord | <ivall> What |
09:02:41 | FromDiscord | <ivall> No |
09:02:44 | FromDiscord | <ivall> xD |
09:02:59 | * | vicfred joined #nim |
09:03:11 | FromDiscord | <Elegant Beef> you said "Same API" so i thought you use one of the cross language barriers and was so confused |
09:04:05 | FromDiscord | <ivall> Soo nim don't have actually god library for discord |
09:04:29 | FromDiscord | <Elegant Beef> Which one are you using? |
09:04:42 | * | guelosk[m] quit (Quit: Idle for 30+ days) |
09:04:50 | FromDiscord | <ivall> https://krisppurg.github.io/dimscord/dimscord/objects.html#Message |
09:04:54 | FromDiscord | <ivall> dimscord |
09:06:06 | FromDiscord | <Elegant Beef> @krisppurg apparently you delete message event doesnt provide a message and it's causing this person issues 😛 |
09:06:09 | FromDiscord | <Elegant Beef> (edit) 'you' => 'your' |
09:06:24 | FromDiscord | <ivall> ¯\_(ツ)_/¯ |
09:07:13 | FromDiscord | <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:37 | FromDiscord | <Elegant Beef> Is shard empty on delete? |
09:07:59 | FromDiscord | <ivall> Wait a second, I must see |
09:09:59 | FromDiscord | <ivall> id of shard is 0 |
09:10:07 | FromDiscord | <ivall> (edit) 'id of shard is 0 ... ' => 'id of shard is 0after delete' |
09:10:41 | FromDiscord | <ivall> sooo I must stay with discord.py while on delete message don't have msg contnet |
09:10:44 | FromDiscord | <ivall> (edit) 'contnet' => 'content' |
09:10:46 | FromDiscord | <ivall> :( |
09:11:00 | FromDiscord | <ivall> (edit) 'don't' => 'doesn't' |
09:13:53 | FromDiscord | <Rika> might really just be a broken library |
09:14:28 | FromDiscord | <krisppurg> Huh |
09:14:32 | FromDiscord | <ivall> I wanted to write bot in nim bcs its faster than python |
09:14:44 | FromDiscord | <ivall> maybe second library for discord works better |
09:14:53 | FromDiscord | <krisppurg> discordnim is unmaintained |
09:15:29 | FromDiscord | <ivall> oh |
09:15:32 | FromDiscord | <ivall> shit |
09:15:41 | FromDiscord | <krisppurg> is it message delete bulk? |
09:15:45 | FromDiscord | <ivall> no |
09:15:59 | FromDiscord | <krisppurg> Is the message uncached? |
09:16:18 | FromDiscord | <krisppurg> Do echo exists to check |
09:16:26 | FromDiscord | <ivall> idk, I just removed message from discord using browser |
09:16:27 | FromDiscord | <ivall> ok |
09:16:28 | FromDiscord | <ivall> wait |
09:16:38 | FromDiscord | <ivall> @krisppurg I did that |
09:16:42 | FromDiscord | <ivall> message doesn't exist |
09:16:45 | FromDiscord | <ivall> after delete |
09:16:53 | FromDiscord | <ivall> but I still have access to message id |
09:16:57 | FromDiscord | <ivall> message channel_id and more |
09:16:58 | FromDiscord | <dom96> @ivall you should look into the library code and try to fix it |
09:17:06 | FromDiscord | <dom96> This is what open source is all about |
09:17:14 | FromDiscord | <krisppurg> ^^ |
09:17:17 | FromDiscord | <dom96> It’s likely a simple fix |
09:17:25 | FromDiscord | <dom96> Since you’re getting the event |
09:17:32 | FromDiscord | <ivall> I can try, but I working as python dev and using nim from yesterday ;v |
09:17:33 | FromDiscord | <krisppurg> I may have made a tiny mistake |
09:17:36 | FromDiscord | <Elegant Beef> *I just pingle krisp as i didnt know what was intended* |
09:17:45 | FromDiscord | <Elegant Beef> pinged* 😄 |
09:18:01 | FromDiscord | <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:02 | FromDiscord | <krisppurg> I wasnt expecting that tbh I was gonna go down for breakfast XD |
09:18:05 | FromDiscord | <ivall> :D |
09:18:17 | FromDiscord | <ivall> So Im going to work |
09:18:27 | FromDiscord | <dom96> Ask here if something in the code confuses you |
09:18:35 | FromDiscord | <ivall> ok |
09:18:42 | FromDiscord | <Elegant Beef> I am still confused about my methods problem |
09:21:01 | FromDiscord | <krisppurg> are you still looking for the file? |
09:23:48 | FromDiscord | <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:34 | FromDiscord | <krisppurg> try using getting the message from the rest api @ivall |
09:25:23 | FromDiscord | <ivall> using message id? |
09:25:27 | FromDiscord | <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:39 | FromDiscord | <ivall> yeah I see that |
09:26:12 | FromDiscord | <krisppurg> > using message id?↵yeah |
09:26:37 | FromDiscord | <ivall> I gonna check that, thank you |
09:26:40 | * | Trustable joined #nim |
09:26:58 | FromDiscord | <krisppurg> your welcome |
09:32:32 | FromDiscord | <foxcat> re: I can try, but I working as python dev and using nim from yesterday ;v↵proud of you!! for switching |
09:33:20 | FromDiscord | <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:43 | FromDiscord | <Elegant Beef> It's spread over multiple files so it's a pain to look at clearly |
09:39:08 | FromDiscord | <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:29 | FromDiscord | <ivall> discord cf blocking me xD |
09:43:13 | FromDiscord | <krisppurg> how come? |
09:45:59 | FromDiscord | <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:26 | FromDiscord | <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:59 | FromDiscord | <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:47 | FromDiscord | <Recruit_main707> Does countup involve any runtime overhead? |
10:07:18 | * | dddddd joined #nim |
10:07:41 | FromDiscord | <Clyybber> no |
10:08:30 | FromDiscord | <Recruit_main707> How? |
10:08:58 | FromDiscord | <Clyybber> because iterators are inlined |
10:09:26 | FromDiscord | <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:40 | FromDiscord | <Recruit_main707> Yeah, I have already |
10:10:44 | FromDiscord | <Clyybber> and where do you spot "overhead"? |
10:11:44 | FromDiscord | <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:01 | FromDiscord | <Clyybber> yeah |
10:22:59 | * | natrys joined #nim |
10:27:37 | * | Vladar joined #nim |
10:28:45 | FromDiscord | <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:20 | FromDiscord | <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:38 | FromDiscord | <lqdev> wdym? |
10:30:08 | FromDiscord | <lqdev> you either parse and process all the tokens directly or first build a DOM tree |
10:30:15 | FromDiscord | <lqdev> and work on that |
10:30:21 | FromDiscord | <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:39 | FromDiscord | <Varriount> You usually have to parse the format |
10:31:35 | FromDiscord | <Varriount> Depending on the format, you might only have to parse some of it, but that's not common. |
10:32:04 | FromDiscord | <Varriount> @Ricky Spanish What format are you looking to extract data from? |
10:32:34 | FromDiscord | <Ricky Spanish> actually at the moment groovy, its quite simple i suppose but i want to generate a minimal groovy file automatically |
10:32:58 | FromDiscord | <Varriount> What do you mean by "minimal"? |
10:33:24 | FromDiscord | <Ricky Spanish> meaning i dont desire to support the entire language just enough for the task at hand |
10:33:53 | FromDiscord | <Varriount> Do you want to generate groovy, or read it (or both)? |
10:34:00 | FromDiscord | <Ricky Spanish> just generate it |
10:34:56 | FromDiscord | <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:45 | FromDiscord | <Varriount> You might have a procedure for writing out code to declare a variable, write an assignment, etc |
10:36:37 | FromDiscord | <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:31 | FromDiscord | <lqdev> `proc renderBlock(body: string): string = "{\n" & body.indent(2) & "\n}" |
10:37:37 | FromDiscord | <lqdev> something like that |
10:37:42 | FromDiscord | <Ricky Spanish> yeh thats what im looking for |
10:37:51 | FromDiscord | <haxscramper> Or you can use string interpolation from https://nim-lang.org/docs/strtabs.html or strformat |
10:37:53 | FromDiscord | <Varriount> Look at strformat |
10:38:02 | FromDiscord | <Ricky Spanish> ok great thanks for the tips guys |
10:39:23 | FromDiscord | <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:00 | FromDiscord | <Varriount> Nah, ropes are better if you need to examine the data and mutate it. |
10:40:02 | FromDiscord | <Rika> i dont think ara/q recommends the usage of ropes anymore |
10:40:14 | FromDiscord | <Varriount> I would just write directly to a file |
10:41:28 | FromDiscord | <haxscramper> It is not recommended to use for interpolation or in general? |
10:41:38 | FromDiscord | <Varriount> Ropes are good if you're constantly deleting/inserting sequential data |
10:41:49 | FromDiscord | <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:08 | FromDiscord | <Varriount> @haxscramper Splicing possibly. I don't think it matters for concatenation |
10:46:41 | FromDiscord | <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:28 | FromDiscord | <haxscramper> No, certainly not. I do recursive DFS over AST and using something like `"{" & mapIt(it.toRope()).concat() & "}"` |
10:49:15 | FromDiscord | <Varriount> Then a string or file is probably better. |
10:50:18 | FromDiscord | <Varriount> Ropes deal with random deletions and insertions in the middle of their data better than strings and sequences do. |
10:51:35 | FromDiscord | <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:42 | FromDiscord | <Varriount> I believe ropes use something more like a linked list, so there's less effort involved for those operations. |
10:53:13 | FromDiscord | <haxscramper> Ropes use binary tree AFAIK |
10:53:38 | FromDiscord | <haxscramper> Well, some sort of tree to get cheap insertion in the middle while maintaining order of elements |
10:55:04 | FromDiscord | <Varriount> @haxscramper Sorry to burst your bubble. ☹️ |
10:55:42 | FromDiscord | <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:28 | FromDiscord | <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:29 | FromDiscord | <Varriount> I guess a rope might have faster concatenation...? It probably depends on the implementation. |
10:59:56 | FromDiscord | <Varriount> Though, memory copies are pretty fast |
11:19:31 | FromGitter | <alehander92> i am not even sure why ropes are needed |
11:19:36 | FromGitter | <alehander92> when people generate code |
11:19:57 | FromGitter | <alehander92> i mean, it seems to make great sense |
11:19:58 | FromDiscord | <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:08 | FromGitter | <alehander92> but most code seems to be generated linearly |
11:20:15 | FromGitter | <alehander92> with some exceptions |
11:20:24 | FromDiscord | <Clyybber> string concatenation is O(n) and rope concatentation is O(1) |
11:20:32 | * | jeko joined #nim |
11:20:38 | FromGitter | <alehander92> but |
11:20:40 | FromGitter | <alehander92> not really |
11:20:45 | FromDiscord | <Clyybber> of course if you add one char at a time and that N times it doesn't matter because armotization |
11:20:47 | FromGitter | <alehander92> because if you just generate a new string |
11:20:51 | FromGitter | <alehander92> it needs to be generated anyway |
11:20:59 | FromGitter | <alehander92> so you directly generate it in its place |
11:21:10 | FromDiscord | <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:18 | FromDiscord | <Clyybber> alehander92: Yeah sure |
11:21:21 | FromDiscord | <haxscramper> There is no noticeable difference |
11:21:22 | FromGitter | <alehander92> and finally you need to write it all down to a file |
11:21:31 | FromGitter | <alehander92> so you need to join them at some point |
11:21:44 | FromGitter | <alehander92> so you can have a list of string groups |
11:21:46 | FromDiscord | <Clyybber> Yeah, if you take the creation of the string into account its O(2n) vs O(n) so no big diff |
11:21:49 | FromGitter | <alehander92> like for locals / functions etc |
11:22:00 | FromDiscord | <haxscramper> https://play.nim-lang.org/#ix=2uSW |
11:22:16 | FromDiscord | <Clyybber> but take a memmapped for example |
11:22:20 | FromDiscord | <Clyybber> file |
11:22:29 | FromGitter | <alehander92> at least that's my impressiom from nim backen |
11:22:31 | FromDiscord | <Clyybber> you can't elide the cost of the memmapping |
11:22:50 | FromDiscord | <Clyybber> so in the end its better to be O(1) on your side rather than copy everything |
11:22:59 | FromDiscord | <Clyybber> but in practice ropes probably aren't much of a benefit |
11:24:20 | FromDiscord | <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:46 | FromDiscord | <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:55 | FromGitter | <alehander92> yes |
11:43:56 | * | awe004 quit (Ping timeout: 240 seconds) |
11:44:06 | FromGitter | <alehander92> i am just using it as an username |
11:44:12 | FromGitter | <alehander92> i am alexander ivanov otherwise |
11:44:46 | FromDiscord | <Clyybber> x is h in russian or other slav langs |
11:45:00 | FromDiscord | <Varriount> My nickname has nothing to do with my real name. |
11:45:05 | FromDiscord | <Clyybber> same |
11:45:19 | FromGitter | <alehander92> i think alehander sounds spanish mostly |
11:45:22 | FromDiscord | <Varriount> "Clay Sweetser" |
11:45:23 | FromGitter | <alehander92> but i am from bulgaria |
11:45:32 | FromGitter | <alehander92> varriount sounds german to me maybe |
11:45:37 | FromDiscord | <Clyybber> just gonna call you sasha from now on |
11:45:50 | FromDiscord | <Clyybber> I wouldn't know how to pronounce varriount in german :P |
11:46:13 | FromDiscord | <Varriount> I'm not German though |
11:46:54 | FromDiscord | <Rika> alejandro would sound spanish |
11:47:12 | FromDiscord | <Varriount> I think I made the nickname up, oh, 15 years ago |
11:48:38 | FromGitter | <alehander92> oi |
11:48:47 | FromGitter | <alehander92> they call me different things |
11:48:52 | FromGitter | <alehander92> but sasha sounds ok, russian |
11:48:59 | FromGitter | <alehander92> often they call me sashe |
11:49:05 | FromGitter | <alehander92> or sasho |
11:49:57 | FromGitter | <alehander92> sande |
11:50:06 | FromGitter | <alehander92> is another possibility |
11:50:56 | * | awe004 joined #nim |
11:56:44 | * | lritter joined #nim |
12:04:01 | FromDiscord | <Varriount> Why Sasha? I feel like I'm missing some piece of cultural knowledge. |
12:04:15 | Yardanico | ? |
12:04:24 | Yardanico | sasha is a "informal" name for "alehander" |
12:04:34 | * | arecacea1 quit (Read error: Connection reset by peer) |
12:04:35 | Yardanico | https://en.wikipedia.org/wiki/Sasha_(name) |
12:04:53 | FromDiscord | <Varriount> Ah, ok. |
12:04:58 | * | arecacea1 joined #nim |
12:05:56 | FromDiscord | <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:25 | Yardanico | USA is not Eastern Europe :) |
12:12:37 | * | kinkinkijkin quit (Ping timeout: 260 seconds) |
12:27:43 | FromDiscord | <lakmatiol> had a classmate called alex/sasha in elementary |
12:36:25 | * | waleee-cl joined #nim |
12:47:12 | FromDiscord | <Recruit_main707> how are iterators inlined? |
12:48:03 | FromDiscord | <dk> like templates |
12:48:16 | FromDiscord | <Clyybber> wdym *how*? |
12:48:36 | FromDiscord | <Recruit_main707> i can see how a proc gets inlined, but i just cant see it with iterators |
12:49:13 | FromDiscord | <Rika> its the same idea? |
12:49:13 | FromDiscord | <Clyybber> replace every yield with the body of the for loop |
12:49:26 | FromDiscord | <Recruit_main707> i see |
12:49:30 | Yardanico | @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:02 | Oddmonger | i tried to «close» my asynchttpserver, and i get error that i don't understand: https://play.nim-lang.org/#ix=2uTp |
13:29:27 | Oddmonger | definition is however simple: https://nim-lang.org/docs/asynchttpserver.html |
13:29:35 | Yardanico | Oddmonger: cb is supposed to be gcsafe, but it accesses a "server" global |
13:29:39 | Yardanico | which is not gcsafe |
13:29:47 | Oddmonger | ahhhh |
13:29:55 | Yardanico | on devel you get this error:https://i.imgur.com/FJMcXRi.png |
13:31:03 | FromDiscord | <Rika> thats what you get as well on stable dont you |
13:31:07 | Yardanico | idk |
13:31:15 | Yardanico | but yeah, you usually should look at the *whole* error :P |
13:31:20 | Yardanico | not just at first 1-2 lines |
13:31:22 | FromDiscord | <Rika> 1.2.6 |
13:31:52 | FromDiscord | <Rika> maybe the error should be indented |
13:33:48 | Oddmonger | yes, 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:56 | Oddmonger | even 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:13 | bung | anyone 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:54 | FromDiscord | <Clyybber> leorize: Is there a reason you didn't use `x in {a,b,c}` syntax for enums with holes? |
14:15:12 | disruptek | Beiber4ever |
14:15:18 | disruptek | ooops |
14:15:19 | * | ja0nz joined #nim |
14:15:35 | Zevv | fanboi |
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:11 | disruptek | Zevv: 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:34 | leorize | @Clyybber the reason is that I completely forgot about it :p |
14:33:43 | FromDiscord | <Clyybber> :D |
14:34:04 | leorize | ah I remembered why |
14:34:40 | leorize | it has to work for all ordinals, so I can't do that sort of shorthand comparision |
14:35:27 | leorize | the 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:02 | FromDiscord | <Clyybber> hmm, fair, but you can just convert to int16/uint16 |
14:37:14 | leorize | range check will kill me :P |
14:37:23 | FromDiscord | <Clyybber> so `x in {a.uint16, b.uint16, c.uint16}` |
14:37:43 | leorize | does it really work like that? |
14:37:59 | leorize | !eval echo high(int32) in {10u16} |
14:38:02 | NimBot | Compile failed: /usercode/in.nim(1, 18) Error: type mismatch: got <set[uint16], int32> |
14:38:12 | leorize | nope it doesn't |
14:38:31 | * | kinkinkijkin joined #nim |
14:39:18 | leorize | @dom96 can you please review #14556? |
14:39:19 | disbot | https://github.com/nim-lang/Nim/pull/14556 -- 3net, openssl: support setting the minimum supported SSL/TLS version |
14:40:00 | FromDiscord | <Clyybber> leorize: Well, that of course doesn't work |
14:42:34 | FromDiscord | <Clyybber> you could do it only for enums that are uint16/int16 or smaller |
14:43:26 | leorize | technically I can generate two checks: `x in uint16 and x in {enum}`, but is this efficient? |
14:44:08 | FromDiscord | <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:17 | disruptek | generating c code is never a good idea. |
14:53:25 | leorize | @Clyybber https://godbolt.org/z/rYxqr4 |
14:53:37 | leorize | pretty much the same assembly |
14:53:59 | leorize | the bunch of `or` got the advantage of being much easier to generate though :P |
14:56:33 | FromDiscord | <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:34 | disruptek | i really need to do something about this stench. |
15:55:07 | Zevv | dang that good idea, i dont know man |
15:55:11 | FromDiscord | <ache of head> Is there an "open" kind of type that encompasses all number-like types? |
15:55:20 | Zevv | it's all i have lately, good ideas. hard to tell one from the other |
15:55:35 | Zevv | was it inferring cps types because of the cpsCall? |
15:57:56 | Zevv | the rest of my good ideas of this week mostly consist of having yet another nap, yet another coffee or yet another beer. |
15:58:44 | FromDiscord | <hugogranstrom> @ache of head there is SomeNumber that encompasses all float and int types |
15:58:53 | FromDiscord | <ache of head> Thank you very much! |
15:58:58 | FromDiscord | <hugogranstrom> Np :) |
16:04:58 | * | jxy quit (Ping timeout: 258 seconds) |
16:05:22 | Zevv | disruptek: so we kind of came to a grinding halt, cpswise, no? |
16:06:04 | FromDiscord | <mratsim> You should probably write a report on the RFC repo or the forum |
16:06:53 | FromDiscord | <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:21 | FromDiscord | <Clyybber> status of cps? |
16:09:59 | FromDiscord | <dom96> yep |
16:10:09 | * | jxy joined #nim |
16:12:34 | FromDiscord | <Clyybber> blocked by an upstream bug |
16:12:43 | FromDiscord | <Clyybber> and I'm working on my fix |
16:15:09 | FromDiscord | <dom96> okay, but how far has it come |
16:15:18 | FromDiscord | <dom96> what's already possible with it? |
16:15:24 | FromDiscord | <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:48 | FromDiscord | <Clyybber> one problem is reallocs afaik |
16:31:55 | FromDiscord | <Clyybber> but other than that, its just bugs |
16:32:16 | FromDiscord | <Clyybber> Zevv is the guy to ask |
16:45:37 | kinkinkijkin | alright, 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:49 | kinkinkijkin | is there an up-to-date nim gles2 binding around? |
16:46:19 | FromDiscord | <Clyybber> kingkingijkin: Which wrappers were you using? |
16:46:38 | kinkinkijkin | nimgl, which only supports modern desktop gl and vulkan for rendering |
16:46:54 | FromDiscord | <Clyybber> Ah, so you want gl and not vulkan? |
16:46:59 | kinkinkijkin | gles2 |
16:47:03 | FromDiscord | <Clyybber> I see |
16:47:05 | kinkinkijkin | so im switching off nimgl now |
16:47:50 | FromDiscord | <Clyybber> theres https://github.com/nimious/gles |
16:48:36 | * | hnOsmium0001 joined #nim |
16:48:44 | kinkinkijkin | from 5 years ago |
16:49:03 | FromDiscord | <Clyybber> its not like gles changed much (or anything) in between |
16:49:13 | kinkinkijkin | yes, but nim did |
16:49:26 | FromDiscord | <Clyybber> you should be able to use c2nim relatively easily |
16:49:35 | FromDiscord | <Clyybber> and build a new wrapper with that |
16:50:16 | FromDiscord | <Recruit_main707> or manually wrap things as you need to |
16:51:46 | kinkinkijkin | i think ill adapt those bindings to modern nim maybe |
16:53:32 | Zevv | dom96: 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:06 | Zevv | here 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:00 | Zevv | basic 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:24 | Zevv | lots of things are still crappyish, but basically it works |
16:56:45 | Zevv | there 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:46 | Zevv | disruptek 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:52 | Zevv | right now. |
17:11:56 | FromDiscord | <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:49 | Zevv | you can take its addr and use the pointer |
17:16:36 | Oddmonger | why not using a ref ?F |
17:16:39 | Oddmonger | -F |
17:18:01 | FromDiscord | <haxscramper> Good question actually |
17:18:59 | FromDiscord | <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:25 | FromDiscord | <haxscramper> Will something like this benefit from using `ref`? |
17:19:44 | FromDiscord | <haxscramper> Right now this is all just `NObject = object` |
17:25:44 | bung | pass it to proc by ref or value, the major differences I think |
17:26:11 | disruptek | Zevv: yeah, that's it. will you make an issue for the inference bit? |
17:26:42 | disruptek | i am deep into rewriting nimph. |
17:27:20 | * | ja0nz quit (Remote host closed the connection) |
17:28:02 | bung | after days work I realize I cant correctly pack datetime param without correct mysql document. |
17:29:02 | bung | most drivers using text query that turns datetime to string |
17:35:25 | disruptek | hooray for strings! |
17:38:39 | bung | oh, I just found a cshap lib that I can inspire |
17:38:49 | disruptek | you |
17:38:52 | disruptek | complete me. |
17:40:37 | leorize[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:53 | leorize[m] | does that look decent enough? |
17:41:21 | disruptek | can they be right-aligned? and, i'd remove the trailing colon. |
17:41:42 | disruptek | you wrote these by hand? |
17:41:57 | leorize | nah, it's an RST thing |
17:42:04 | leorize | called field tables |
17:42:23 | disruptek | right, but you wrote the RST by hand. |
17:42:30 | leorize | yea |
17:43:48 | disruptek | looks cool in any event. 👍 |
17:44:06 | disruptek | some day i will get around to doing this for openapi. |
17:48:15 | FromDiscord | <lqdev> @leorize how'd you do that? |
17:48:33 | disruptek | https://github.com/alaviss/dnsstamps/blob/master/src/dnsstamps.nim |
18:08:25 | FromDiscord | <lqdev> oh cool |
18:09:28 | leorize | why only now I realize that we have a Group by in the docs |
18:09:51 | disruptek | a group by? |
18:09:58 | leorize | grouping by types makes it much easier to navigate |
18:10:06 | disruptek | oh, yeah. |
18:10:38 | * | kinkinkijkin quit (Disconnected by services) |
18:11:32 | disruptek | i noticed that the seqs section doesn't seem to render its links correctly. |
18:11:41 | disruptek | https://nim-lang.org/docs/system.html#system-module-seqs |
18:11:50 | leorize | it's fixed in devel iir |
18:11:51 | leorize | iirc* |
18:11:54 | disruptek | oh, nice. |
18:11:55 | Yardanico | this was fixed, yeah |
18:12:22 | FromGitter | <deech> Is there a way to assign the result of `genericParams(...)`? I see it's of type `typedesc[tuple]`. |
18:12:45 | Yardanico | It returns types |
18:12:52 | Yardanico | You can't use types as an assignment target :P |
18:13:32 | FromGitter | <deech> Yeah, I just need someplace to store it. Guess I could convert it to a NimNode? |
18:15:18 | Yardanico | Store the type? |
18:15:20 | Yardanico | huh |
18:15:33 | Yardanico | I don't think you can store typedescs in variables, even const or compile-time |
18:15:57 | Yardanico | typedesc is not a "value" |
18:16:43 | FromGitter | <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:15 | FromGitter | <deech> Haha, I guess comp time `default` is Nim's type witness. |
18:19:27 | Yardanico | default just accepts a typedesc |
18:21:25 | FromGitter | <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:03 | leorize[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:05 | leorize[m] | right align achieved :P |
18:26:24 | disruptek | nice! |
18:26:33 | Yardanico | to which demon in hell did you make a sacrifice to make that work? |
18:26:46 | leorize[m] | I will probably PR the styling change to Nim instead, the way I'm doing it is hackish |
18:27:05 | leorize | I edited the docgen template to include my own css :P |
18:27:10 | disruptek | yeah, he cheated. |
18:28:36 | leorize | I made this library with the intention of being a template for my future projects and not for any actual usage :P |
18:29:47 | leorize | any feedback on the repo? |
18:29:51 | leorize | !repo alaviss/dnsstamps |
18:29:52 | disbot | https://github.com/alaviss/dnsstamps -- 9dnsstamps: 11Nim implementation of DNS server stamps 15 1⭐ 0🍴 |
18:31:03 | disruptek | i guess this is what i should model my actions from? |
18:31:16 | * | jxy quit (Ping timeout: 265 seconds) |
18:31:50 | leorize | maybe :P it's a bit overkill for simple projects like this, though |
18:32:01 | Yardanico | leorize: I was overjoyed when I saw MPL :P |
18:32:13 | disruptek | i cannot be bothered to maintain separate flows for different projects, though. |
18:33:10 | disruptek | i have like 40 public nim projects. |
18:33:26 | leorize | you can use that one |
18:33:40 | leorize | I really hope github actions add a way for me to make templates actions |
18:33:51 | disruptek | yeah, i need to be able to rubber-stamp this shit. |
18:33:53 | leorize | currently they want me to write js |
18:45:15 | leorize[m] | oh hey they added tihs sometime ago: https://github.blog/changelog/2020-08-07-github-actions-composite-run-steps/ |
18:45:35 | leorize[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:35 | FromDiscord | <Clyybber> leorize: Can you review https://github.com/nim-lang/Nim/pull/15216 ? |
19:00:37 | disbot | ➥ Unsigned iovlen |
19:08:03 | FromDiscord | <djazz> I got webview working on windows :3 https://media.discordapp.net/attachments/371759389889003532/746807908645339297/webview-success.PNG |
19:09:15 | FromDiscord | <ache of head> Ayy, sick! |
19:09:48 | shashlick | nifty |
19:18:13 | FromDiscord | <djazz> WIP https://github.com/daniel-j/nim-webview |
19:21:35 | disruptek | so the oskca one no longer works? |
19:22:08 | FromDiscord | <djazz> it does, but uses an older version of the webview library (I target the current master, not yet stable) |
19:22:49 | FromDiscord | <djazz> older webview uses MSHTML on Windows, while the newer uses EdgeHTML/Chromium (New Edge) to render on Windows |
19:23:04 | disruptek | ah, i see. |
19:23:31 | FromDiscord | <djazz> If anyone wants to use my lib, that's fine. I need it for something else I'm working on 🙂 |
19:24:22 | FromDiscord | <djazz> there are currently two webview nim bindings; webview and webgpu. webgpu has a lot of linux-only stuff in it |
19:26:35 | FromDiscord | <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:14 | disruptek | where do i go to read about the webgpu for linux? |
19:27:23 | FromDiscord | <djazz> sry |
19:27:27 | FromDiscord | <djazz> webgui* |
19:27:45 | FromDiscord | <djazz> https://github.com/juancarlospaco/webgui |
19:28:46 | disruptek | right, i know that one. |
19:29:52 | FromDiscord | <djazz> lots of `when defined(linux)` in that one |
19:30:12 | FromDiscord | <djazz> and emit pragma for gtk, ugh |
19:31:37 | FromDiscord | <djazz> the webview nim package was last updated in 2019 |
19:33:26 | disruptek | thanks for getting this working. you should license it; i'd like to play with it. |
19:33:30 | FromDiscord | <djazz> Something like this but built on Nim (instead of Rust) would be cool https://tauri.studio |
19:33:48 | Yardanico | instead I should just finish my sciter wrapper :P |
19:33:51 | FromDiscord | <djazz> It uses webview behind the scenes, and they are doing some collab |
19:34:08 | disruptek | sciter doesn't interest me. |
19:34:13 | FromDiscord | <djazz> me neither |
19:34:26 | Yardanico | disruptek: it's better than using a full web browser engine anyway :) |
19:34:35 | disruptek | depends on your goals. |
19:34:58 | FromDiscord | <djazz> I would like a gui framework, maybe libui/wxWidgets, where you can embed a webview, native for each platform |
19:35:11 | FromDiscord | <djazz> so you dont have to do everything with html and css |
19:35:24 | FromDiscord | <djazz> maybe you want to show some html somewhere |
19:35:47 | FromDiscord | <djazz> i think there is a simple webview in wx though |
19:35:52 | FromDiscord | <djazz> _very_ simple |
19:36:09 | FromDiscord | <haxscramper> Is there any way to uninstall nim channel using `choosenim` or I just can delete `~/.choosenim ...` and install it again |
19:36:25 | FromDiscord | <djazz> or maybe they improved it since, idk |
19:36:44 | FromDiscord | <djazz> seems like it's better now, huh https://docs.wxwidgets.org/trunk/classwx_web_view.html |
19:36:47 | disruptek | thing 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:09 | FromDiscord | <djazz> that widget uses edge/chromium, webkitgtk and webkit too |
19:37:21 | FromDiscord | <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:22 | FromDiscord | <Elegant Beef> https://play.nim-lang.org/#ix=2uWt |
19:37:27 | FromDiscord | <exelotl> @djazz nice work!!! Definitely gonna try this some time :D |
19:37:29 | FromDiscord | <djazz> maybe I should try use that |
19:37:35 | disruptek | yeah, that one looks like it has improved a lot in the last decade. |
19:37:41 | FromDiscord | <djazz> ~~steal inspiration~~ |
19:38:05 | FromDiscord | <djazz> with wx you get proper events too |
19:38:44 | FromDiscord | <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:56 | Yardanico | disruptek: not really |
19:39:15 | Yardanico | first of all, with HTML/CSS you don't need to reeducate designers |
19:39:34 | disruptek | you do if they can't reproduce what they see in chrome. |
19:39:46 | Yardanico | disruptek: well, companies use sciter anyway |
19:39:50 | Yardanico | and quite big companies too |
19:40:07 | disruptek | i hear there are even companies that use go. bigs ones, even. |
19:40:42 | FromDiscord | <djazz> using webview is still nice if all you need is html/css/js and only some native code |
19:41:01 | FromDiscord | <djazz> (you can write the js in nim heh) |
19:41:29 | disruptek | i just want to be able to render svg and pick up events. |
19:41:32 | FromDiscord | <Elegant Beef> I personally dont like webbased applications, so i just cry about it |
19:41:59 | FromDiscord | <Elegant Beef> Although i assume webview uses fewer resources than electron |
19:42:21 | FromDiscord | <djazz> webview uses an existing browser, without the _chrome_ |
19:42:36 | FromDiscord | <djazz> electron just bundles it up in a neat package |
19:42:53 | FromDiscord | <djazz> you can have small electron apps if you install electron on system level |
19:43:10 | FromDiscord | <Elegant Beef> You can have small native apps if you make native apps 😄 |
19:44:06 | shashlick | @haxscramper: just remove the specific version from ~/.choosenim/toolchains |
19:44:39 | FromDiscord | <djazz> I know GTK is basically web tech too, they use CSS and their GJS JavaScript engine |
19:46:58 | FromDiscord | <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:45 | FromDiscord | <djazz> probably using nimterop |
19:47:54 | FromDiscord | <djazz> > This wrapper was originally generated by c2nim. |
19:48:11 | FromDiscord | <djazz> generated for 5 year old headers |
19:52:12 | FromDiscord | <djazz> from* |
20:07:54 | shashlick | wxwidgets is c++ no? |
20:07:59 | FromDiscord | <djazz> yes |
20:08:31 | shashlick | nimterop doesn't wrap c++ yet |
20:09:28 | FromDiscord | <djazz> ah, but c2nim can? |
20:09:44 | FromDiscord | <djazz> toast has a cpp mode though |
20:12:23 | shashlick | yes but it doesn't know how to map c++ entities into Nim wrappers |
20:12:32 | FromDiscord | <djazz> ah |
20:12:43 | shashlick | C2nim does a subset of C++ |
20:20:30 | FromDiscord | <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:13 | FromDiscord | <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:11 | disruptek | bad news. |
20:42:41 | disruptek | script kiddies gave up trying to login to my freenode acct. |
20:52:21 | shashlick | no one can disrupt you |
21:03:21 | PMunch | Is that bad news? |
21:13:25 | FromDiscord | <Elegant Beef> Also pmunch going back to my option macro, how would you stop it from being run, a `?procName` ? |
21:13:47 | PMunch | What do you mean? |
21:14:14 | FromDiscord | <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:04 | PMunch | Oh, 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:11 | FromDiscord | <Elegant Beef> That's what i do |
21:15:21 | FromDiscord | <Elegant Beef> if any are non i early return |
21:15:39 | PMunch | Aaah, 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:45 | FromDiscord | <Elegant Beef> ah |
21:15:50 | PMunch | Which would've been really weird :P |
21:18:03 | FromDiscord | <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:04 | FromDiscord | <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:28 | FromDiscord | <Elegant Beef> oh forgot about the unpacking |
21:23:00 | PMunch | And will that work with "ident, ident: Option[T]"? |
21:23:55 | FromDiscord | <Elegant Beef> yes |
21:24:08 | FromDiscord | <Elegant Beef> Well didnt test it with Generic 😛 |
21:25:14 | PMunch | Shouldn't change anything :P |
21:25:50 | FromDiscord | <Elegant Beef> there unpacked now https://media.discordapp.net/attachments/371759389889003532/746842592209010718/unknown.png |
21:26:06 | FromDiscord | <Elegant Beef> Shit b is wrong |
21:26:13 | FromDiscord | <Elegant Beef> I wasnt paying attention just writting 😄 |
21:34:53 | FromDiscord | <Elegant Beef> There you go pmunch destroy my PR |
21:35:25 | * | solitudesf quit (Ping timeout: 265 seconds) |
21:39:39 | PMunch | Did you make one? |
21:40:34 | FromDiscord | <Elegant Beef> Yea |
21:42:19 | PMunch | Link? |
21:42:29 | FromDiscord | <Elegant Beef> https://github.com/PMunch/nim-optionsutils/pull/1 |
21:42:30 | disbot | ➥ Added withSome and withNone |
21:43:00 | FromDiscord | <Elegant Beef> Which pmunch is the imposter, you or this github account? |
21:44:06 | PMunch | Haha, neither, I just didn't get a notification for it |
21:44:23 | FromDiscord | <Elegant Beef> Weird |
21:45:10 | PMunch | Hmm, what happens with return values? |
21:45:52 | FromDiscord | <Elegant Beef> default value is returned, which i assume would be handled anyway |
21:46:48 | disruptek | at this rate, no one is going to be able to stop me. |
21:48:49 | FromDiscord | <Elegant Beef> Disruptek, im on my way |
21:48:54 | FromDiscord | <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:41 | leorize | `nim jsondoc --hints:off --warning:off --stdout --project path/to/module.nim` |
22:05:18 | leorize | this is a really interesting use of the compiler |
22:05:47 | * | luis_ joined #nim |
22:06:08 | leorize | you got the full list of exported APIs within the project in json |
22:06:11 | disruptek | i'm gonna be switching my repos to use mkdocs using that stuff. |
22:06:35 | leorize | what I'm seeing a potential for is the ability to do API diffing |
22:06:43 | disruptek | https://squidfunk.github.io/mkdocs-material/ |
22:06:59 | leorize | meaning that you can get precisely what new API and what has been changed since last release |
22:06:59 | disruptek | we could use it to auto-version APIs. |
22:07:28 | disruptek | this is something i've wanted for openapi, too, because currently gensym makes it hard for me to track changes. |
22:07:46 | Prestige | PMunch: 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:10 | PMunch | Sorry, I haven't really had a chance to look at it :( |
22:08:15 | PMunch | But I think that's the problem |
22:08:32 | PMunch | It's either that, or a nimsuggest issue |
22:08:32 | * | luis_ joined #nim |
22:08:42 | PMunch | Maybe dom96 can weigh in on it? |
22:08:51 | leorize | when in doubt, it's a nimsuggest issue |
22:08:55 | PMunch | :) |
22:09:07 | Prestige | No worries man, just excited about the fix haha |
22:09:27 | Prestige | you still feeling better? |
22:14:19 | PMunch | Yeah, but I've been coughing quite a bit today. But I feel totally fine |
22:14:34 | PMunch | And 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:55 | leorize | luckily it's just a cold then :) |
22:16:58 | * | apahl quit (Ping timeout: 260 seconds) |
22:18:53 | Prestige | awesome, congratz |
22:18:59 | * | apahl joined #nim |
22:19:16 | FromDiscord | <Elegant Beef> Congrats you got sick, but no the sickness of the year 😛 |
22:19:18 | FromDiscord | <Elegant Beef> not* |
22:19:28 | PMunch | Hooray, I guess :P |
22:25:04 | leorize | Anyone wanted to weigh in on this? https://github.com/nim-lang/RFCs/issues/168 |
22:25:05 | disbot | ➥ Concepts and type-checking generics ; snippet at 12https://play.nim-lang.org/#ix=23U8 |
22:25:25 | leorize | it seems like we haven't reached a consensus yet |
22:30:22 | disruptek | so we get rid of , , , syntax following the `concept` keyword. |
22:30:40 | disruptek | this seems like it limits the concept. |
22:33:36 | shashlick | elijahr just updated the travis script - we will have arm/ppc CI support soon |
22:35:38 | FromDiscord | <Varriount> leorize: I would, but the merits of each approach are way above my head. |
22:35:54 | FromDiscord | <Varriount> I just want something akin to Go's interfaces |
22:36:02 | disruptek | not a fan of either/orelse. i would rather find a way to use existing constructs. |
22:36:04 | FromDiscord | <Elegant Beef> Yea my dumb dumb brain, just goes "Whatever let's me use concepts at runtime, would make me happy" |
22:37:39 | FromDiscord | <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:48 | FromDiscord | <Varriount> *advanced uses of concepts |
22:37:57 | disruptek | so, like, code that we actually want as opposed to tests. |
22:38:52 | FromDiscord | <Varriount> Yeah. |
22:39:15 | disruptek | well that's the point, right? |
22:39:15 | FromDiscord | <Elegant Beef> I dont even get either/orelse isnt that just A or B? |
22:39:39 | disruptek | it means that the concept matches for one of the two branches, at least. |
22:40:03 | FromDiscord | <Varriount> disruptek: Yeah, I would rather limit the number of new constructs. |
22:40:12 | FromDiscord | <Varriount> Or rather, re-use existing ones. |
22:41:16 | FromDiscord | <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:31 | disruptek | we have that now. |
22:41:43 | disruptek | you can use any boolean. just, y'know, not not. |
22:42:21 | disruptek | which is annoying. |
22:42:38 | * | luis_ quit (Quit: luis_) |
22:42:59 | * | luis_ joined #nim |
22:43:10 | disruptek | this syntax is more verbose, which i don't like. |
22:43:29 | disruptek | i'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:27 | disruptek | i 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:03 | FromDiscord | <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:52 | disruptek | what do you mean by, /minus A or B inside a single concept/ ? |
22:48:10 | FromDiscord | <Elegant Beef> If it implements A or if it implements B, them just being any arbitrary concept line |
22:48:26 | FromDiscord | <Elegant Beef> I atleast couldnt figure out how to do that in the current concepts and am unsure if it's possible |
22:48:50 | disruptek | you mean like a typeclass? |
22:49:06 | FromDiscord | <Elegant Beef> No clue |
22:49:51 | disruptek | i've found statics particularly difficult to compose, but other than that i haven't been too stymied. |
22:50:09 | disruptek | though not having not sucks. |
22:50:34 | FromDiscord | <Elegant Beef> I dont know how to have concepts with A or B implementations like `&` or `+` for instance |
22:51:08 | Yardanico | you mean a concept for two types, and it checks if there's a &(A, B) ? |
22:51:24 | FromDiscord | <Elegant Beef> No |
22:51:31 | Yardanico | then what? |
22:51:48 | FromDiscord | <Elegant Beef> I mean a concept that can abstract `Addables` for instance which checks if the T implements `&` or `+` |
22:51:58 | FromDiscord | <Elegant Beef> And if it does it's an addable |
22:52:05 | Yardanico | this is possible? |
22:52:13 | Yardanico | you can check if a type satisfies a concept |
22:52:19 | FromDiscord | <Elegant Beef> > I dont know how to have concepts |
22:52:21 | disruptek | just try it with a typeclass that holds two concepts. |
22:52:27 | * | luis_ quit (Ping timeout: 258 seconds) |
22:52:36 | FromDiscord | <Elegant Beef> I did say i dont know how, and if it's possible 😄 |
22:52:46 | disruptek | try it and see. |
22:52:50 | FromDiscord | <Elegant Beef> I mean i did |
22:52:53 | FromDiscord | <Elegant Beef> I couldnt figure out how |
22:53:00 | disruptek | try making two concepts. |
22:53:04 | disruptek | one tests for `&`. |
22:53:08 | disruptek | one tests for `+` |
22:53:17 | FromDiscord | <Elegant Beef> That's why i didint solve it, i figured it should be doable in a single concept |
22:53:18 | disruptek | then Addable = First or Second |
22:53:35 | disruptek | Addable is your "concept" (hint: really just a typeclass of two concepts) |
22:55:27 | Yardanico | @Elegant like disruptek told you: https://play.nim-lang.org/#ix=2uX6 |
22:56:33 | FromDiscord | <Elegant Beef> Yea i didnt think to try that as it seems weird |
22:56:57 | Yardanico | why? |
22:57:22 | Yardanico | "Type classes can be combined using the standard boolean operators to form more complex type classes" |
22:57:22 | FromDiscord | <Elegant Beef> Well cause you're making concepts you might not need to just construct a another concept you will |
22:57:46 | Yardanico | well I don't see how it would be logical in this case |
22:57:57 | Yardanico | a concept is for a single variable/object to satisfy something usually |
22:58:04 | Yardanico | not for different ones with different operations |
22:58:23 | disruptek | i don't agree. |
22:58:29 | Yardanico | with what |
22:58:54 | disruptek | i want concepts to be able to assert generic properties that may and may not overlap. |
22:59:14 | Yardanico | wouldn't it be the case of some big black box which "does everything" |
22:59:20 | Yardanico | I think it's better to have stuff more separate |
22:59:42 | disruptek | as an example, i have a concept for a container that holds packages. |
23:00:04 | disruptek | when that container is a table key'd off a package name, then i want to exploit that for faster lookup. |
23:01:37 | disruptek | otherwise, i just iterate over the container. |
23:07:42 | disruptek | this example isn't great. |
23:07:56 | disruptek | addQuoted doesn't seem any better for having been turned into a Quotable. |
23:13:16 | FromDiscord | <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:53 | disruptek | and it does. |
23:14:04 | disruptek | but that doesn't make it match the concept any less. |
23:15:37 | FromDiscord | <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:18 | disruptek | we don't really have any way to shade generics otherwise. |
23:22:07 | FromDiscord | <Varriount> "shade"? |
23:24:25 | disruptek | to disambiguate multiple matching generics. |
23:31:03 | disruptek | maybe inheritance will get fixed some day. |
23:31:28 | disruptek | it seems like if it happens, it will happen accidentally. |
23:33:07 | Yardanico | wdym "fixed" |
23:33:11 | Yardanico | it's not broken currently :) |
23:33:22 | disruptek | lol |
23:42:12 | FromDiscord | <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:27 | Yardanico | well not really, but it would be better if you have "Current Output" |
23:42:38 | Yardanico | at least |
23:42:48 | Yardanico | so if it changes in the future, we'll be able to see that |
23:43:17 | Yardanico | also the code example should be the one crashing/failing assert/etc, pls don't comment the crasinh code :) |
23:43:20 | Yardanico | crashing* |
23:46:11 | FromDiscord | <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:30 | disruptek | not yet. |
23:46:31 | FromDiscord | <exelotl> I was planning to put a comment in my example snippet like: echo x # <--- outputs y? |
23:46:42 | disruptek | comments are useful. |
23:46:53 | Yardanico | https://github.com/genotrance/tissue |
23:47:08 | * | vicfred joined #nim |
23:54:31 | * | Vladar quit (Remote host closed the connection) |
23:57:09 | disruptek | !repo nimbug |
23:57:11 | disbot | https://github.com/juancarlospaco/nimbug -- 9nimbug: 11Nim Semi-Auto Bug Report Tool 15 8⭐ 0🍴 |
23:57:32 | Yardanico | most of the info here is redundant :P |
23:59:22 | disruptek | not really. |
23:59:48 | disruptek | have you looked at the output? |
23:59:59 | Yardanico | yes |