00:00:01 | * | junland quit (Quit: %ZNC Disconnected%) |
00:00:41 | * | junland joined #nim |
00:00:42 | Yardanico | @Synth can you show a code sample? |
00:01:05 | FromDiscord | <Synth> sent a code paste, see http://ix.io/2naO |
00:01:26 | FromDiscord | <Synth> sent a code paste, see http://ix.io/2naP |
00:02:41 | Yardanico | what's the error? |
00:02:50 | Yardanico | and what type is "pass_length" ? |
00:05:15 | FromDiscord | <Synth> ```nim↵let pass_length = sizeof(password)↵``` |
00:05:27 | FromDiscord | <Synth> Error is: `Error: unhandled exception: index 4 not in 0 .. 3 [IndexError]` |
00:05:43 | Yardanico | what is sizeof password |
00:05:47 | Yardanico | that's now the way to get the length of the string |
00:05:48 | FromDiscord | <Synth> So the index is out of range due to this: https://discordapp.com/channels/371759389889003530/371759389889003532/713904445787996271not resetting `pass_index` back to 0 |
00:05:57 | FromDiscord | <Synth> (edit) 'https://discordapp.com/channels/371759389889003530/371759389889003532/713904445787996271not' => 'https://discordapp.com/channels/371759389889003530/371759389889003532/713904445787996271 not' |
00:06:03 | Yardanico | length of the string is len(password) |
00:06:25 | FromDiscord | <Synth> Oh thank you |
00:06:28 | Yardanico | and to be able to index it you need something like |
00:06:32 | FromDiscord | <Synth> Wow, that fixed it |
00:06:35 | Yardanico | "let maxIdx = len(password) - 1" |
00:06:37 | Yardanico | yeah |
00:06:43 | FromDiscord | <Synth> I'm sorry, I'm used to C haha |
00:06:45 | Yardanico | sizeof gives you the size of the structure in bytes |
00:06:51 | FromDiscord | <Synth> I see |
00:16:25 | * | Guest8810 quit (Ping timeout: 264 seconds) |
00:18:52 | shashlick | Do many of you use Conan? https://conan.io/ |
00:22:32 | * | dadada joined #nim |
00:22:55 | * | dadada is now known as Guest64291 |
00:32:44 | FromGitter | <bung87> seem large code base nimlsp will not work |
00:33:33 | FromGitter | <bung87> also in some case nimsuggest code will throw error |
00:45:52 | * | Guest64291 quit (Ping timeout: 246 seconds) |
00:51:03 | * | konvertex quit (Quit: quit) |
00:52:33 | * | dadada__ joined #nim |
01:00:14 | * | lritter quit (Ping timeout: 240 seconds) |
01:01:08 | * | lritter joined #nim |
01:14:08 | * | krux02_ quit (Remote host closed the connection) |
01:16:25 | * | dadada__ quit (Ping timeout: 265 seconds) |
01:22:36 | * | dadada joined #nim |
01:23:00 | * | dadada is now known as Guest83630 |
01:25:22 | * | chemist69 quit (Ping timeout: 260 seconds) |
01:27:01 | * | chemist69 joined #nim |
01:30:34 | * | zacharycarter quit (Ping timeout: 256 seconds) |
01:39:02 | leorize[m] | bung87 it depends |
01:39:31 | leorize[m] | though if you work with the stdlib I can assure that it will crash 40% of the time |
01:42:47 | * | zacharycarter joined #nim |
01:43:03 | * | nphg joined #nim |
01:45:22 | * | nphg1 quit (Ping timeout: 256 seconds) |
01:46:25 | * | Guest83630 quit (Ping timeout: 264 seconds) |
01:48:40 | FromGitter | <bung87> yeah , I debug on nimslp, which contains submodule whole nim source. |
01:48:48 | * | lritter quit (Ping timeout: 265 seconds) |
01:49:43 | FromGitter | <bung87> I even create a new thread in nimlsp for stdin, thought may not helpful. |
01:52:19 | FromGitter | <bung87> other small project just works fine |
01:52:37 | * | dadada__ joined #nim |
02:01:28 | * | zacharycarter quit (Ping timeout: 246 seconds) |
02:15:40 | * | gxt__ quit (Remote host closed the connection) |
02:16:25 | * | dadada__ quit (Ping timeout: 264 seconds) |
02:22:29 | * | gxt__ joined #nim |
02:22:35 | * | dadada joined #nim |
02:23:00 | * | dadada is now known as Guest88049 |
02:29:50 | * | zacharycarter joined #nim |
02:33:22 | * | muffindrake quit (Ping timeout: 260 seconds) |
02:35:31 | * | muffindrake joined #nim |
02:37:39 | * | zacharycarter quit (Ping timeout: 256 seconds) |
02:46:25 | * | Guest88049 quit (Ping timeout: 264 seconds) |
02:52:39 | * | dadada__ joined #nim |
03:16:22 | * | dadada__ quit (Ping timeout: 258 seconds) |
03:17:44 | * | fredrikhr quit (Ping timeout: 256 seconds) |
03:22:36 | * | dadada joined #nim |
03:23:00 | * | dadada is now known as Guest41507 |
03:25:52 | * | chemist69 quit (Ping timeout: 260 seconds) |
03:26:25 | * | thomasross quit (Remote host closed the connection) |
03:26:37 | * | chemist69 joined #nim |
03:26:47 | * | thomasross joined #nim |
03:27:57 | * | Senketsu quit (Ping timeout: 272 seconds) |
03:40:02 | FromDiscord | <Technisha Circuit> Would it be a good idea to implement a transpiler instead of an ast? |
03:40:14 | FromDiscord | <Technisha Circuit> Because I'm replicating Python |
03:40:24 | FromDiscord | <Technisha Circuit> And I can't use `__` in names |
03:40:30 | FromDiscord | <Technisha Circuit> Which is required for the builtins |
03:40:36 | Yardanico | use backticks |
03:40:53 | FromDiscord | <Technisha Circuit> I thought i tried that, but lemme try again |
03:40:57 | Yardanico | ah nvm yeah |
03:41:04 | Yardanico | but it's better if you do something like py2nim, yeah |
03:46:32 | * | Guest41507 quit (Ping timeout: 260 seconds) |
03:52:38 | * | dadada__ joined #nim |
04:04:17 | * | silvernode joined #nim |
04:05:29 | silvernode | Good morning |
04:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:43 | * | supakeen joined #nim |
04:16:13 | * | dadada__ quit (Ping timeout: 265 seconds) |
04:17:50 | * | thomasross quit (Remote host closed the connection) |
04:18:14 | * | thomasross joined #nim |
04:19:17 | silvernode | So in python, it is encouraged to put a header at the top of a function definition that describes what the function purpose is. Is there a a way to do this with procs in Nim? |
04:19:44 | leorize | yes |
04:22:36 | * | dadada joined #nim |
04:22:43 | silvernode | leorize, I have not noticed any examples in Nim documentation so I am wondering if I overlooked it. |
04:23:00 | * | dadada is now known as Guest2584 |
04:23:26 | silvernode | My guess is that it is the same in Nim as in python |
04:23:48 | leorize | see documentation comments in the manual |
04:24:33 | leorize | oh wait we have literally zero example on the manual for this |
04:25:04 | leorize | https://github.com/nim-lang/Nim/blob/devel/lib/pure/collections/sequtils.nim |
04:25:06 | silvernode | interesting |
04:25:23 | leorize | see that module, it's one of the heavily documented one |
04:26:08 | silvernode | it looks like all I have to do is: ## my proc description here |
04:28:47 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
04:39:25 | * | thomasross quit (Remote host closed the connection) |
04:39:47 | * | thomasross joined #nim |
04:46:42 | * | Guest2584 quit (Ping timeout: 256 seconds) |
04:51:55 | * | silvernode quit (Ping timeout: 246 seconds) |
04:52:40 | * | dadada__ joined #nim |
04:53:48 | * | dddddd quit (Ping timeout: 272 seconds) |
05:16:19 | * | dadada__ quit (Ping timeout: 256 seconds) |
05:22:38 | * | dadada joined #nim |
05:23:02 | * | dadada is now known as Guest62569 |
05:46:02 | FromDiscord | <Rika> yes |
05:46:14 | * | Guest62569 quit (Ping timeout: 240 seconds) |
05:46:27 | FromDiscord | <Rika> theyre also technically better since theyre not just "strings put at the start of a function" |
05:46:36 | * | thomasross quit (Ping timeout: 265 seconds) |
05:52:36 | * | dadada__ joined #nim |
05:54:55 | * | audiofile quit (Quit: Going offline, see ya! (www.adiirc.com)) |
05:54:58 | Araq | https://github.com/nim-lang/RFCs/issues/230 |
05:57:54 | Araq | don't downvote if you don't understand it, it's a detail |
06:02:31 | * | solitudesf joined #nim |
06:16:16 | * | dadada__ quit (Ping timeout: 246 seconds) |
06:18:22 | * | solitudesf quit (Quit: Leaving) |
06:22:37 | * | dadada joined #nim |
06:23:00 | * | dadada is now known as Guest92797 |
06:41:36 | * | xet7 joined #nim |
06:46:25 | * | solitudesf joined #nim |
06:47:10 | * | Guest92797 quit (Ping timeout: 272 seconds) |
06:52:40 | * | dadada__ joined #nim |
07:05:35 | FromDiscord | <Yardanico> Oh wow I'm actually impressed https://play.nim-lang.org/#ix=2nc2 works, that might help me in doing a proper tdlib wrapper in nim |
07:07:32 | * | opal quit (Remote host closed the connection) |
07:07:48 | * | opal joined #nim |
07:16:43 | FromDiscord | <Yardanico> Ah nvm, not really because case object branches can't share same names so I'll have to rename them and then do some json parsing without .to |
07:16:52 | * | dadada__ quit (Ping timeout: 256 seconds) |
07:16:55 | FromDiscord | <Yardanico> *.to |
07:22:36 | * | dadada joined #nim |
07:22:59 | * | dadada is now known as Guest46640 |
07:30:39 | * | letto quit (Read error: Connection reset by peer) |
07:32:32 | * | letto joined #nim |
07:33:18 | Prestige | What's the typical way to treat something as a particular type of it is type checked? just wrap with CheckedType(myObj).doSomething()? |
07:33:37 | Prestige | type if it* |
07:37:03 | * | konvertex joined #nim |
07:40:17 | Araq | yes |
07:43:38 | * | neceve joined #nim |
07:43:51 | * | tdc joined #nim |
07:44:57 | Prestige | Thanks |
07:46:42 | * | Guest46640 quit (Ping timeout: 272 seconds) |
07:52:34 | * | dadada__ joined #nim |
07:56:56 | Prestige | How can I check if an object is a "subclass" of another? Where I have type B = ref object of A, I was trying to see if foo: A is really of type B |
07:57:13 | Prestige | Looks like foo.type comes back as A even though it was initialized as B |
08:02:43 | Prestige | Short example: https://play.nim-lang.org/#ix=2nce |
08:06:20 | FromDiscord | <Elegant Beef> https://play.nim-lang.org/#ix=2ncf |
08:06:36 | FromDiscord | <Elegant Beef> https://nim-lang.org/docs/tut2.html#object-oriented-programming |
08:07:16 | Prestige | Ah Beef I love you, thanks |
08:07:23 | FromDiscord | <Elegant Beef> Lol no problem |
08:07:56 | disruptek | see the `is` keyword |
08:08:26 | FromDiscord | <Elegant Beef> is returns false in that case |
08:08:45 | FromDiscord | <Elegant Beef> Since it's stored as the root type |
08:08:47 | Prestige | Yeah, I tried is but didn't think about of |
08:11:20 | disruptek | use `typeof` versus `type`. |
08:16:19 | * | dadada__ quit (Ping timeout: 246 seconds) |
08:22:36 | * | dadada joined #nim |
08:23:00 | * | dadada is now known as Guest81669 |
08:46:53 | * | Guest81669 quit (Ping timeout: 265 seconds) |
08:52:41 | * | dadada__ joined #nim |
09:10:11 | Zevv | moin folks |
09:13:13 | FromDiscord | <Rika> moin moin |
09:14:49 | Prestige | o/ |
09:16:14 | * | dadada__ quit (Ping timeout: 240 seconds) |
09:17:04 | Zevv | Araq: I do understand the RFC but I feel the warning might raise a lot of questions for the average user. "to avoid what?" |
09:18:10 | Zevv | Its pretty cryptic as it is now. |
09:19:48 | FromDiscord | <dom96> Anyone interested in testing my new Nim game: https://discord.gg/vBhuZj 🙂 |
09:20:29 | Zevv | like, what is an *observable*? its not someting that is defined in the manual |
09:22:38 | * | dadada__ joined #nim |
09:46:24 | * | dadada__ quit (Ping timeout: 256 seconds) |
09:52:38 | * | dadada joined #nim |
09:53:01 | * | dadada is now known as Guest13333 |
10:23:57 | FromGitter | <matrixbot> `Asbjørn Olling` Hi friends - newbie question: ⏎ if I want to implement the `in` operator for my custom type, how should I do that? ⏎ Basically I want to be able to do ⏎ ⏎ ```let b: bool = node in graph``` [https://gitter.im/nim-lang/Nim?at=5eca4b3db101510b201362aa] |
10:24:30 | FromGitter | <matrixbot> `Asbjørn Olling` my google-ing comes up short, I guess "in" is a pretty seo-unfriendly word ;) |
10:27:12 | alehander92 | iirc contains |
10:27:25 | alehander92 | is equivalent to it: i might be wrong |
10:27:56 | * | dddddd joined #nim |
10:30:55 | * | Guest13333 is now known as dadada |
10:56:05 | FromGitter | <bung87> I found on windows bin dir contains shell scripts not exe.. |
10:57:46 | FromGitter | <matrixbot> `Asbjørn Olling` > <@gitter_fromirc:matrix.org> *<alehander92>* iirc contains ⏎ ⏎ thanks! |
10:58:13 | * | liblq-dev joined #nim |
11:12:48 | FromDiscord | <Synth> Hello, I'm trying to convert a `seq[char]` into a string... is anyone able to help me? |
11:13:03 | FromDiscord | <Synth> I know it's a noobish question and I apologize |
11:14:58 | FromDiscord | <Rika> there's always the `import sequtils; let theString = theSeq.foldl(a & b, "")` or something |
11:15:44 | FromGitter | <matrixbot> `Asbjørn Olling` you can use `join` from strutils |
11:15:46 | FromDiscord | <Synth> Hmm alright, thank you! |
11:16:14 | FromGitter | <matrixbot> `Asbjørn Olling` `let mystr = mycharseq.join("")` |
11:17:02 | FromDiscord | <Synth> > `Asbjørn Olling` `let mystr = mycharseq.join("")`↵@matrixbot[Gitter]#0000 This worked, thank you! |
11:17:02 | FromGitter | <matrixbot> `Asbjørn Olling` actually it works even without the empty string to join on- then it just defaults to empty string |
11:17:05 | FromGitter | <matrixbot> `Asbjørn Olling` so `mycharseq.join()` should be enough |
11:17:11 | FromDiscord | <Synth> Thanks! |
11:17:37 | FromGitter | <matrixbot> `Asbjørn Olling` nw :3 |
11:20:06 | FromDiscord | <Rika> oh that makes sense, i forgot join existed |
11:21:56 | * | Hideki joined #nim |
11:22:19 | * | Hideki is now known as Guest28271 |
11:39:36 | FromDiscord | <Synth> I'm sorry for asking again, but how can I convert a string into an int? |
11:40:11 | FromDiscord | <Synth> for example:↵```nim↵const variable: int = toInt("1")↵``` |
11:40:21 | FromDiscord | <Synth> I know the above code is wrong, but something as such |
11:40:29 | FromDiscord | <Recruit_main707> parseInt iirc |
11:40:36 | FromDiscord | <Synth> Ohh right |
11:40:36 | FromDiscord | <Recruit_main707> its from the strutils module |
11:40:37 | FromDiscord | <Synth> Thank you! |
11:54:06 | FromDiscord | <Synth> I'm sorry, but one more question ;-; |
11:54:20 | FromDiscord | <Synth> Is there a way I can measure the time it took to execute part of a code? |
11:54:35 | FromDiscord | <Synth> For example, I want to measure how long it took for this for loop to end |
11:54:39 | FromDiscord | <Recruit_main707> std/monotimes |
11:54:58 | FromDiscord | <Recruit_main707> https://nim-lang.github.io/Nim/monotimes.html |
11:55:06 | FromDiscord | <Rika> let start = getMonoTime(); do stuff; echo getMonoTime() - start |
11:55:37 | FromDiscord | <Synth> Ohh thank you |
12:00:53 | FromDiscord | <Zed> what's the matrix bot connected to? |
12:01:06 | FromDiscord | <Rika> uh |
12:01:06 | * | hsh quit (Quit: Connection closed for inactivity) |
12:01:07 | FromDiscord | <Rika> matrix |
12:01:21 | FromDiscord | <Zed> ? |
12:01:45 | FromDiscord | <Recruit_main707> irc i think |
12:02:03 | FromDiscord | <Recruit_main707> wasnt matrix irc in fact? |
12:02:56 | FromDiscord | <Rika> matrix bot is bridging irc and matrix is it not |
12:03:05 | FromDiscord | <Rika> ah no |
12:03:08 | FromDiscord | <Rika> matrix and gitter |
12:03:17 | FromDiscord | <Zed> what is matrix? |
12:03:31 | FromDiscord | <Rika> another protocol |
12:04:33 | FromDiscord | <Zed> Well TIL |
12:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:44 | * | supakeen joined #nim |
12:17:28 | * | fredrikhr joined #nim |
12:18:06 | * | krux02 joined #nim |
12:18:53 | FromGitter | <gogolxdong> Anyone got interested in working with QUIC/AI/Web frontend in Nim? We are employing, based in Shenzhen China. I know it's limited because of covd19, anyone who can help all over the world is appreciated and rewarded. |
12:49:25 | * | dadada quit (Ping timeout: 264 seconds) |
12:50:21 | FromGitter | <gogolxdong> I'm helping a company which got its big datacenter infrastructure venture capital ,because it's one of the new infrastructure seven domain presents in nation whitepaper to boost economy in the next decade, to get back on the top list of FileCoin mining first, then to develop its own distributed storage, any practical help will be appreciated and rewarded. You name it and price it. |
12:50:49 | * | dadada joined #nim |
12:51:12 | * | dadada is now known as Guest51080 |
13:08:47 | FromDiscord | <gour> hello, if i'd do a gui desktop project in nim (using wxnim/nigui/nimx...) and have to include 3rd party C lib, generating nim bindings with c2nim, have doc-toolchain (building epub/html/pdf manuals) using rst/asciidoc markup...can Nim's build packager handle all these or it's recommended to use some specialized build system (which one?) ? |
13:09:11 | * | Guest28271 quit () |
13:16:35 | * | hvn joined #nim |
13:16:44 | shashlick | @gour checkout nimterop |
13:16:49 | * | hvn left #nim (#nim) |
13:19:07 | * | nuxdie quit (Ping timeout: 260 seconds) |
13:21:05 | * | msmorgan quit (Ping timeout: 246 seconds) |
13:24:53 | * | nuxdie joined #nim |
13:25:47 | * | nuxdie quit (Max SendQ exceeded) |
13:26:41 | FromDiscord | <Recruit_main707> whats the difference between pointer and void? |
13:27:10 | FromDiscord | <Rika> ??? |
13:27:34 | FromDiscord | <Rika> arent the differences pretty obvious or something or am i an idiot |
13:28:07 | FromDiscord | <Recruit_main707> ive heard pointer was just like c's void, but we also have void |
13:28:16 | liblq-dev | no |
13:28:17 | FromDiscord | <gour> shashlick: thanks |
13:28:30 | liblq-dev | @Recruit_main707 Nim `pointer` == C `void *` |
13:28:35 | liblq-dev | not C `void` |
13:28:40 | FromDiscord | <Recruit_main707> ok |
13:28:44 | FromDiscord | <Recruit_main707> thanks |
13:30:49 | * | msmorgan joined #nim |
13:31:04 | * | nuxdie joined #nim |
13:31:57 | FromGitter | <matrixbot> `Asbjørn Olling` Question regarding the `tables` module: ⏎ does anyone know how to best merge two tables? it looks like `CountTable` has a `merge` function, but I don't see one for regular tables. ⏎ Seems a bit silly to do manually |
13:33:43 | FromDiscord | <Rika> it kinda makes sense for count tables |
13:33:59 | FromDiscord | <Rika> for regular tables, what would happen if a duplicate key exists? |
13:35:46 | Zevv | nim tabls allow duplicate keys |
13:35:52 | FromGitter | <matrixbot> `Asbjørn Olling` I guess regular tables support multiple entries with the same key, so the logical result would be just having both? |
13:35:57 | Zevv | but its confusing if you dont expect that |
13:37:24 | FromGitter | <matrixbot> `Asbjørn Olling` so it's not that I'm missing anything obvious here - there just isn't a function for merging regular tables? |
13:37:36 | FromGitter | <matrixbot> `Asbjørn Olling` maybe I can do it with `collect` from the `sugar` module |
13:38:34 | FromGitter | <matrixbot> `Asbjørn Olling` (imo I think the `&` concatentation operator should be implemented for tables) |
13:41:03 | FromDiscord | <Rika> afaik it's an RFC to make duplicate keys not allowable or something not sure anymore |
13:43:55 | * | hvn joined #nim |
13:51:31 | hvn | hi all, I just discovered Nim yesterday, come from Python, I tried to replace our current python script with nim, the result is surprising that my naive nim version is slower, the script does scan about more than 20.000 text files under a directory using walkDirRec, on Python version, I was able to skip multiples dirs base on their name (e.g: .terraform in root), is it possile to do that with Nim or walkDirRec |
13:51:37 | hvn | iterate over all the files? Thanks |
13:52:19 | FromDiscord | <Recruit_main707> have you compiled the code with -d:danger? |
13:54:10 | FromDiscord | <Rika> use -d:release, not danger |
13:55:51 | FromDiscord | <Recruit_main707> danger is faster, if you are still testing things release might be better |
13:56:29 | FromDiscord | <Rika> well its called danger for a reason |
13:56:46 | FromDiscord | <Rika> debug and release have much more of a difference than release and danger |
13:57:19 | FromDiscord | <Rika> anyone know if there's a compile-time `existsFile`? |
13:57:27 | FromDiscord | <Rika> `existsFile` by itself doesnt work on CT |
14:00:26 | FromDiscord | <Rika> nvm, changed my structure and i dont need `existsFile` anymore |
14:01:28 | FromDiscord | <Recruit_main707> https://media.discordapp.net/attachments/371759389889003532/714115852282101861/fetchimage.png |
14:01:54 | * | sz0 joined #nim |
14:02:31 | * | hvn left #nim (#nim) |
14:02:47 | FromDiscord | <Rika> lmao |
14:03:08 | FromDiscord | <Rika> hmm, interesting that you cannot nest "shortcut imports", the one with the ident/[ident, ident] |
14:03:22 | FromDiscord | <Rika> this isnt possible: ident/[ident, ident/[ident, ident]] |
14:03:25 | FromDiscord | <Rika> interesting |
14:05:47 | liblq-dev | there was a discussion on the forum about that, iirc |
14:06:05 | liblq-dev | I wonder why this was never implemented |
14:06:24 | FromDiscord | <Rika> it's a syntax that's perfectly capable of being implemented isnt it |
14:07:56 | liblq-dev | pretty much https://play.nim-lang.org/#ix=2ndV |
14:13:27 | * | waleee-cl joined #nim |
14:25:35 | * | silvernode joined #nim |
14:26:33 | * | abm joined #nim |
14:34:19 | * | zacharycarter joined #nim |
14:34:38 | * | Guest51080 is now known as dadada |
14:35:15 | dadada | as I don't want to repeat work of others, I've to ask this, do we have any shorthand notation for result = someProc(); if someProc() != nil: return ??? |
14:35:36 | dadada | sorry, I forgot something important |
14:35:55 | dadada | result = someProc(); if someProc() != nil; return result |
14:36:02 | dadada | s/;/: |
14:36:43 | dadada | returnValueOfExpressionDependingOnValueOfExpression |
14:37:36 | dadada | I couldn't come up with any really good name for a macro/template that does this, it's easy to confuse with this: |
14:38:13 | dadada | if someOtherThingIsTrue(): return someProc() |
14:38:48 | * | zacharycarter quit (Ping timeout: 256 seconds) |
14:43:38 | FromDiscord | <exelotl> dadada: surely you don't want to execute someProc() twice? |
14:44:02 | * | filcuc joined #nim |
14:44:07 | dadada | exelotl: of course, not, this was pseudo code, and in my actual code there's result trice |
14:44:18 | * | silvernode quit (Quit: Leaving) |
14:45:49 | dadada | testedReturn is what I've come up with |
14:46:27 | FromDiscord | <exelotl> returnIfNotNil |
14:46:34 | FromDiscord | <exelotl> or something like that? |
14:46:36 | dadada | exelotl: that was my first idea too |
14:47:06 | dadada | exelotl: but then I would have to write returnIfNil and returnIfWhatever ... So I wanted a variant that works for all cases |
14:48:32 | FromDiscord | <exelotl> I don't think you really need a template/macro for this |
14:48:40 | FromDiscord | <exelotl> var x = foo() |
14:48:42 | FromDiscord | <exelotl> if x != nil: return |
14:48:59 | FromDiscord | <exelotl> it's pretty short and clear already |
14:49:19 | dadada | return x , I almost agree with you |
14:49:26 | FromDiscord | <exelotl> (oops yeah that should be return x) |
14:49:52 | dadada | but imagine you have a proc with 4 if-returns like this closely together |
14:50:10 | dadada | wouldn't that look repetitive to you to see x there 3x4 = 12 times |
14:50:14 | * | filcuc quit (Ping timeout: 240 seconds) |
14:50:30 | * | filcuc joined #nim |
14:50:37 | dadada | it's not a real issue, it's debatable if such syntax sugar creates more confusion than it helps |
14:58:16 | disruptek | why do you resist block/break? it's great. |
14:59:08 | dadada | well, I don't, who do you mean |
14:59:21 | FromDiscord | <exelotl> dadada: something like this? https://play.nim-lang.org/#ix=2ne9 |
14:59:26 | disruptek | anyone that uses return. |
15:00:38 | FromGitter | <bung87> hi there |
15:01:53 | dadada | exelotl: yes, only that the != nil check there is not dynamic |
15:01:57 | FromGitter | <bung87> https://github.com/PMunch/nimlsp/pull/49 when this merged, my vscode nim extension will work, I'v tested on my Mac And PC |
15:01:59 | disbot | ➥ fix debug echo hover suggestions index out of bound, initSuggest need unencoded path not encoded. |
15:04:32 | FromGitter | <bung87> @Generic pls wait and check |
15:07:54 | Zevv | do it in color, people love color |
15:12:00 | * | endragor joined #nim |
15:14:00 | * | filcuc quit (Quit: Konversation terminated!) |
15:15:02 | FromGitter | <gour> niminst's manual (https://nim-lang.org/docs/niminst.html) says: "Later versions will support Linux' package management systems." does it mean creating rpm/deb/etc. packages? just wonder about binaries for Mac OS since "niminst is a tool to generate an installer for a Nim program...it can create an installer for Windows via Inno Setup " ? |
15:16:09 | * | theelous3 joined #nim |
15:17:37 | FromGitter | <gour> what would be required to have `nimlsp` working with SublimeText (https://github.com/sublimelsp/LSP) ? |
15:19:54 | FromGitter | <bung87> the extension using LSP protocol ,so it needs nimlsp as LSP server |
15:20:09 | * | solitudesf- joined #nim |
15:20:13 | * | solitudesf quit (Remote host closed the connection) |
15:20:34 | * | dddddd quit (Ping timeout: 240 seconds) |
15:22:29 | FromGitter | <gour> hmm...not 100% clear (yet)...Sublime's implementation of LSP does support several languages already, does it one another one is required to be written for Nim? |
15:23:53 | FromGitter | <bung87> usually LSP server write in their native language |
15:24:56 | FromGitter | <bung87> if someone implemented a vm in other language should work too |
15:26:27 | FromGitter | <bung87> basically LSP just a protocol. MS provide a node server and node client. |
15:44:48 | * | Trustable joined #nim |
15:46:47 | * | NimBot joined #nim |
15:49:16 | FromDiscord | <Generic> @bung87 thanks for the fix, I couldn't wait so I build it myself and it mostly works now |
15:49:49 | FromGitter | <bung87> yeah , that's the quick way, sounds good! |
15:49:57 | * | dadada quit (Ping timeout: 272 seconds) |
15:49:58 | FromDiscord | <Generic> except for goto definition which seems to suffer from a similar problem |
15:50:04 | FromDiscord | <Generic> with path encoding |
15:50:29 | FromGitter | <bung87> oh that could be, I just fix one case. |
15:52:46 | * | dadada joined #nim |
15:53:09 | * | dadada is now known as Guest92779 |
15:53:35 | Zevv | hey disruptek |
15:53:44 | disruptek | sup dawg |
15:53:51 | Zevv | i fixed the nim parser: http://ix.io/2n99 |
15:54:02 | Zevv | should I put up a PR for that? |
15:54:24 | disruptek | you're a bad person. |
15:54:36 | FromGitter | <deech> i like it |
15:54:46 | Zevv | me gusta |
15:54:58 | disruptek | do you have an npeg for it? |
15:55:01 | Zevv | it still parses old 2020 nim |
15:55:12 | Zevv | no it's just the nim parser, but no longer broken |
15:55:38 | disruptek | we had a curly skin in the past. |
15:56:00 | disruptek | what have you been up to, zevv? |
15:56:23 | Zevv | not much, nim-wise |
15:56:57 | Zevv | my day job kind of pulled me in over the last months, and I'm totally passive and bored when not working |
15:57:00 | Zevv | It'll pass, I'm sure |
15:57:17 | FromGitter | <deech> hard same |
15:57:49 | Zevv | I totally dropped #nim for some weeks as well, but trying to keep up a bit now |
15:57:57 | disruptek | i got a weird bug that only exists in !-d:danger. |
15:58:14 | disruptek | also, my arc code is ~5x faster than the same code in refc. |
15:58:31 | Zevv | it must be bad code, then |
15:59:23 | Zevv | (https://github.com/zevv/Nim/commit/a957a882ed055eb7b7ecb2a4f5d643b9a7271cab) |
15:59:39 | Zevv | where's your bug at |
16:00:13 | disruptek | ~stream |
16:00:14 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
16:00:29 | Zevv | later maybe, time to put the soup on the table first |
16:00:39 | disruptek | what kinda soup? |
16:00:57 | Zevv | tomato mostly, and whatever-was-left-at-the-bottom-of-the-fridge |
16:01:02 | Zevv | cleanupsoup |
16:01:42 | Zevv | some weird shaped foreign potatoes and other nameless tubers |
16:02:20 | disruptek | actually, it's about 6x faster in arc. and about 6x less variance in latency, too. |
16:02:23 | Zevv | a chilli I took for a small pepper, with regrettable colateral damage to the eyes and genitals |
16:02:37 | disruptek | you go for the balls first and then the eyes? |
16:02:45 | disruptek | just like a woman. |
16:02:48 | Zevv | hurting balls make me cry |
16:03:05 | disruptek | what do you do with those peppers you pervert? |
16:03:07 | Zevv | anyway, diner time - <cursive>I'll be back</cursive> |
16:03:44 | disruptek | namless tubers had some good albums, but their first is still their best work, imo. |
16:09:36 | * | shadwick joined #nim |
16:18:27 | * | Tlanger quit (Ping timeout: 260 seconds) |
16:19:17 | * | thomasross joined #nim |
16:31:07 | liblq-dev | does `nim doc` include types/procs generated by macros? |
16:31:36 | Yardanico | i think it does, although their field names might not be so pretty |
16:31:40 | Yardanico | I mean argument names |
16:31:53 | liblq-dev | well maybe it depends on whether you use genSym or not? |
16:31:57 | liblq-dev | idk, I haven't tried |
16:32:20 | liblq-dev | the fields I'm generating are normally usable from other parts of my code |
16:35:29 | * | endragor quit (Remote host closed the connection) |
16:37:03 | * | konvertex quit (Quit: quit) |
16:41:45 | * | konvertex joined #nim |
16:50:11 | * | bung joined #nim |
16:51:23 | * | natrys joined #nim |
16:51:31 | bung | hi |
16:54:27 | Yardanico | hello bung |
16:54:31 | Yardanico | are you bung87 |
16:54:56 | bung | hi,am bung87, I just installed irssi |
16:55:14 | Yardanico | nice |
16:56:51 | bung | I finally know why people choose using irc ,feels fine. |
16:57:14 | * | abm quit (Remote host closed the connection) |
16:57:42 | * | abm joined #nim |
17:07:18 | * | shadwick quit (Remote host closed the connection) |
17:21:25 | * | abm quit (Remote host closed the connection) |
17:21:51 | * | abm joined #nim |
17:22:50 | krux02 | bung: I still use hexchat. It works. Don't necessarily like it though. |
17:23:05 | * | lritter joined #nim |
17:30:48 | * | audiofile joined #nim |
17:32:31 | * | audiofile quit (Remote host closed the connection) |
17:32:48 | bung | first time heard hexchat,I tried colloguy today which also has gui, never make it work, so I found irssi on apple developer forum. |
17:37:43 | * | gangstacat quit (Quit: Ĝis!) |
17:37:58 | exelotl | I used hexchat for years, but IRC is not very nice on the days when you have bad internet |
17:39:32 | exelotl | eventually I just stopped opening it because I could find all the interesting discussions I needed on discord. and not have to worry about missing parts of the conversaion, or having to be near a PC, etc. |
17:40:13 | exelotl | only recently started running a Quassel instance on my VPS and now IRC is actually a decent experience |
17:43:56 | bung | oh ,I miss the mobile part, I'll try when I outside, theses days I always at my home. |
17:51:04 | * | gangstacat joined #nim |
17:53:03 | * | bung quit (Quit: Lost terminal) |
18:03:16 | FromGitter | <bung87> @Yardanico I guess when nimlsp fix the path encode decode things it should be more stable |
18:04:34 | liblq-dev | why is :: a reserved token? |
18:06:55 | FromGitter | <bung87> guess for namespace ,module name |
18:12:58 | * | zacharycarter joined #nim |
18:17:33 | * | zacharycarter quit (Ping timeout: 256 seconds) |
18:28:14 | * | Vladar joined #nim |
18:34:59 | Yardanico | Does anyone know if there's a way to get custom pragma annotations if I get passed a "typed" argument (a variable) in a macro? for example how to get check if there's a pragma for "arr" field here - https://play.nim-lang.org/#ix=2nf6 |
18:35:16 | Yardanico | I tried with hasCustomPragma, but it's always false and I don't see pragma nodes in treeRepr |
18:38:23 | planetis[m] | yeah I know and its very cumbersome, you need to call hasCustomPragma macro from your macro |
18:38:28 | Yardanico | well I tried |
18:38:31 | Yardanico | it always returns false |
18:38:42 | Yardanico | and with treeRepr I don't see jsonName pragma on arr field anyway |
18:38:58 | Yardanico | when I do treeRepr x.getTypeImpl() |
18:39:19 | planetis[m] | when https://github.com/nim-lang/Nim/pull/11526 is merge it will be better |
18:39:20 | disbot | ➥ getCustomPragma is split up in more usable chunks |
18:39:27 | Yardanico | how do I do it now though? :P |
18:41:11 | Yardanico | hmm I'll try looking at the src of that pr |
18:44:38 | planetis[m] | i got you: https://play.nim-lang.org/#ix=2nfe |
18:46:05 | planetis[m] | the last one, all the others output false for some reason... |
18:46:06 | * | Guest92779 quit (Ping timeout: 256 seconds) |
18:47:11 | Yardanico | planetis[m]: lol, thank you :P |
18:48:11 | * | Firegem joined #nim |
18:52:38 | * | dadada joined #nim |
18:53:01 | * | dadada is now known as Guest52665 |
19:01:02 | * | abm quit (Remote host closed the connection) |
19:01:07 | Yardanico | planetis[m]: in the end I copied findPragmaExprForFieldSym from that PR |
19:01:14 | Yardanico | and then just let pragma = findPragmaExprForFieldSym(fieldSym.owner.getImpl()[2][2], fieldSym) |
19:01:22 | Yardanico | and check if it's nnkPragma or not, etc |
19:01:29 | * | abm joined #nim |
19:03:50 | * | brainbomb joined #nim |
19:08:35 | planetis[m] | sounds better than this |
19:09:03 | Yardanico | planetis[m]: yeah, I needed it to add custom field support for json.to (I need it to have json.to do all deserialization work with tdlib json objects for me) |
19:09:08 | * | brainbomb quit (Quit: Leaving.) |
19:09:15 | Yardanico | so I can use case objects with different field names in nim side |
19:09:20 | Yardanico | but they have same field name in json side |
19:10:15 | Yardanico | once that PR gets merged it'll be a relatively small change to json.to to make it understand custom pragma like {.jsonName: "nameOnJsonSide".} |
19:10:31 | planetis[m] | that could be very useful |
19:10:51 | Yardanico | there is https://github.com/LemonBoy/jstin but it doesn't work for object variants since it's done with generics and fieldPairs and not a macro |
19:34:10 | * | dddddd joined #nim |
19:46:22 | * | Tlongir joined #nim |
19:55:46 | * | Guest52665 is now known as dadada |
19:55:55 | dadada | hi people |
19:56:17 | Yardanico | hi |
19:56:28 | dadada | is there a generalized term for proc/macro/template/func and anything like it, maybe even iterators |
19:56:35 | Yardanico | routine? |
19:56:44 | Yardanico | https://nim-lang.org/docs/macros.html#RoutineNodes |
19:57:23 | dadada | oh kay |
20:01:37 | * | Firegem quit (Ping timeout: 260 seconds) |
20:02:11 | * | leorize is now known as leorize_m |
20:02:18 | * | leorize_m is now known as leorize |
20:02:31 | * | leorize is now known as leorize`mtx |
20:02:36 | * | leorize`mtx is now known as leorize |
20:09:25 | * | konvertex quit (Quit: quit) |
20:11:57 | federico3 | are there examples of reading/writing nested, packed data structures using mmap? |
20:23:41 | * | Vladar quit (Quit: Leaving) |
20:26:05 | * | natrys quit (Quit: natrys) |
20:34:03 | * | tdc quit (Ping timeout: 258 seconds) |
20:45:25 | * | abm quit (Quit: Leaving) |
20:51:56 | * | Trustable quit (Remote host closed the connection) |
21:11:39 | shashlick | dom96: got time for a short review? |
21:14:59 | Yardanico | shashlick: use @ to ping on discord, dom is usually in there nowadays :) |
21:15:00 | Yardanico | @dom96 |
21:16:14 | leorize | Yardanico: try parsing the irc-style pings too? :) |
21:16:22 | Yardanico | leorize: that's too ambiguous :) |
21:16:29 | leorize | our gitter bridge currently do this |
21:16:32 | Yardanico | or if you mean only on the start, then ok |
21:16:45 | Yardanico | like if a message starts like "nick:msg" |
21:16:53 | leorize | yea, seems fair |
21:17:14 | Yardanico | ok ill try |
21:17:19 | leorize | and when can I expect colors for the (edited) messages? :p |
21:17:58 | shashlick | https://binarybuilder.org/ and http://conan.io/ |
21:18:07 | Yardanico | it's not that useful since this channel has colors disabled anyway leorize |
21:18:26 | leorize | really? disbot still show me colors |
21:18:38 | Yardanico | ah, colors maybe work |
21:18:40 | Yardanico | not italics/bold |
21:18:40 | leorize | except on offtopic |
21:18:48 | leorize | !repo ircord |
21:18:50 | disbot | https://github.com/Yardanico/ircord -- 9ircord: 11Discord <-> IRC bridge in Nim 15 6⭐ 0🍴 |
21:18:50 | disruptek | offtopic has no color but irc does. |
21:18:52 | leorize | ^ bold too |
21:18:54 | disruptek | er, #nim |
21:18:59 | FromDiscord | <dom96> shashlick: just send me PR links |
21:19:07 | Yardanico | leorize: ah right I confused this channel with offtopic |
21:20:48 | shashlick | @dom96 - https://github.com/dom96/choosenim/pull/201 |
21:20:50 | disbot | ➥ Fix #199 - missing dlls |
21:23:29 | * | solitudesf- quit (Ping timeout: 256 seconds) |
21:24:54 | FromDiscord | <dom96> Commented |
21:26:22 | shashlick | @dom96 - I replied to that comment in the original issu |
21:26:29 | shashlick | which is why I implemented it this way |
21:26:31 | shashlick | it is much simpler |
21:27:37 | FromDiscord | <dom96> meh, I need to think about it |
21:27:43 | shashlick | https://github.com/dom96/choosenim/issues/199#issuecomment-632762684 |
21:27:45 | disbot | ➥ Nimarchive cannot overwrite existing extraction? ; snippet at 12https://play.nim-lang.org/#ix=2mZw |
21:49:24 | * | bung joined #nim |
21:57:38 | FromDiscord | <Technisha Circuit> How do i make an sequence with multiple data types? |
21:57:45 | FromDiscord | <Technisha Circuit> Is it `T`? |
21:58:19 | Yardanico | you can't |
21:58:29 | Yardanico | sequence is a sequence of one data type |
22:02:23 | * | Yardanico quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
22:03:21 | * | Yardanico joined #nim |
22:05:38 | FromDiscord | <Technisha Circuit> Oh okay |
22:10:39 | FromDiscord | <exelotl> @Technisha Circuit what are you trying to do? |
22:11:35 | FromDiscord | <Technisha Circuit> I am just testing some random stuff |
22:13:29 | FromDiscord | <Elegant Beef> You can use object variance to get close to that |
22:13:49 | FromDiscord | <Elegant Beef> But you're stuck with 1 type per sequence |
22:23:54 | * | liblq-dev quit (Quit: WeeChat 2.8) |
22:43:59 | FromDiscord | <Varriount> @Technisha Circuit You can do what the JSON module does |
22:47:33 | bung | @Yardanico provide hover range fixed, I make it as middleware modified the word range |
22:47:43 | Yardanico | ah okay nice |
22:47:49 | Yardanico | did you see the bug I showed? |
22:48:06 | bung | which one? |
22:48:39 | bung | yesterday talked ? |
22:49:28 | Yardanico | bung: nah, today, lemme show |
22:49:59 | Yardanico | bung: https://play.nim-lang.org/#ix=2nfS |
22:50:12 | Yardanico | in your extension all code after line 3 in this example will be highlighted as a string |
22:51:48 | bung | lemme try |
22:57:32 | bung | here's what I see https://transfer.sh/tX3pK/Screenshot-2020-05-25-at-6.55.59-AM.png |
22:57:47 | Yardanico | well, it's still wrong :P |
22:58:24 | Yardanico | bung: here's what I see - https://transfer.sh/135op6/2020-05-25-01-58-04_grim.png |
22:58:32 | Yardanico | see how it becomes yellow after that line |
22:58:34 | Yardanico | all identifiers and stuff |
22:58:37 | bung | yeah, that's complicated. I developed a rails extension |
22:58:56 | bung | also has syntax issue, hard to fix |
23:00:02 | bung | hhh, your version more funny. |
23:02:25 | bung | how you check the file in irc? open in browser? |
23:03:51 | Yardanico | bung: yes? of course |
23:04:14 | bung | okay, thought there's more geek way :p |
23:20:20 | * | oprypin quit (Remote host closed the connection) |
23:23:14 | * | oprypin joined #nim |
23:25:15 | * | FromGitter quit (Remote host closed the connection) |
23:26:30 | * | oprypin quit (Client Quit) |
23:32:15 | * | krux02 quit (Remote host closed the connection) |
23:38:31 | * | FromGitter joined #nim |
23:40:14 | * | oprypin joined #nim |
23:51:34 | * | fredrikhr quit (Ping timeout: 240 seconds) |
23:57:26 | * | ftsf joined #nim |