00:02:16 | * | gmaggior quit (Quit: Leaving) |
00:07:28 | FromDiscord | <exelotl> @InventorMatt https://play.nim-lang.org/#ix=2yYx |
00:08:36 | FromDiscord | <exelotl> if you change `a` the program will fail to compile, but if you change `b` it will still compile, but raise an exception at runtime |
00:09:59 | FromDiscord | <exelotl> due to the static parameter, the overload resolution picks the first template if the value is known at compile time, or the second template otherwise. |
00:10:16 | FromDiscord | <InventorMatt> thanks, that helps a lot |
00:10:55 | FromDiscord | <exelotl> (these could totally be procs instead of templates, idk why I picked template) |
00:43:16 | bung | is there workaround fix this? https://play.nim-lang.org/#ix=2yVe |
00:58:36 | leorize[m] | no, varargs is essentially openarray which has to borrow the memory from the caller |
00:59:28 | leorize[m] | since async transform the code into a closure iterator which doesn't rely on the stack, the borrowing can't be done safely (yet) |
01:00:01 | leorize[m] | your best bet is to use a seq |
01:05:36 | * | thomasross quit (Read error: Connection reset by peer) |
01:20:40 | * | noonien quit (Quit: Connection closed for inactivity) |
01:24:27 | * | apahl quit (Ping timeout: 260 seconds) |
01:25:57 | * | apahl joined #nim |
01:28:40 | * | krux02 quit (Remote host closed the connection) |
01:45:24 | bung | leorize, ty! I manually change it to sync and callback version, result same. |
01:56:20 | * | lritter joined #nim |
01:56:49 | bung | I move proc body to async proc accept seq and wrap a sync proc accept varargs |
03:00:07 | * | muffindrake quit (Ping timeout: 240 seconds) |
03:02:34 | * | muffindrake joined #nim |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:34 | * | supakeen joined #nim |
04:07:38 | silvernode[m] | Is there a way to do mixed type seqs? |
04:07:58 | FromDiscord | <UNIcodeX> json? |
04:11:18 | FromDiscord | <Elegant Beef> Well similar to how json does it, you box the data into object variants |
04:13:55 | FromDiscord | <Elegant Beef> silvernode here is an example of how https://play.nim-lang.org/#ix=2yZ9 |
04:14:36 | FromDiscord | <Elegant Beef> It works like inheritance so you cannot access strval on a object with the kind of bkString |
04:14:46 | FromDiscord | <Elegant Beef> (edit) 'bkString' => 'bkInt' |
04:16:00 | silvernode[m] | wow that is fairly easy but I figured it would be a bit easier than that. |
04:26:01 | FromDiscord | <Elegant Beef> Well nim is statically typed, so the data needs to be the same type |
04:27:11 | FromDiscord | <shad0w> gratz on the 10k stars @github team. 👑 |
04:44:55 | * | solitudesf- joined #nim |
04:49:56 | FromDiscord | <Bub_Lite_63_Jr (JosephTLyons)> Is there a command to update nim to the newest version? |
04:50:05 | FromDiscord | <Bub_Lite_63_Jr (JosephTLyons)> (edit) 'Is there a command to update nim to the newest ... version?' => 'Is there a command to update nim to the neweststable' |
04:50:10 | FromDiscord | <Elegant Beef> If you have choosenim installed it's `choosenim stable` |
04:50:41 | FromDiscord | <Bub_Lite_63_Jr (JosephTLyons)> Great, its reporting 1.2.0 on my system and that that is the newest stable version |
04:51:56 | ForumUpdaterBot | New thread by Jiyinyiyong: Is there a concept like "equality of refs" in Nim?, see https://forum.nim-lang.org/t/6865 |
04:52:39 | FromDiscord | <Elegant Beef> alternatively `choosenim update stable` |
04:53:31 | FromDiscord | <Bub_Lite_63_Jr (JosephTLyons)> Ahh, that actually did the updating |
04:53:35 | FromDiscord | <Bub_Lite_63_Jr (JosephTLyons)> 1.2.6 now |
04:53:40 | FromDiscord | <Bub_Lite_63_Jr (JosephTLyons)> Thanks @Elegant Beef |
04:53:48 | FromDiscord | <Elegant Beef> No problem |
04:59:34 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
05:00:51 | * | justsomeguy joined #nim |
05:38:42 | * | narimiran joined #nim |
05:51:30 | * | justsomeguy left #nim (#nim) |
05:52:33 | * | bunbunbunbunny joined #nim |
05:54:33 | * | kenran joined #nim |
06:39:23 | * | narimiran quit (Ping timeout: 256 seconds) |
06:42:10 | * | narimiran joined #nim |
06:48:56 | * | Vladar joined #nim |
06:51:21 | * | PMunch joined #nim |
06:54:33 | * | bunbunbunbunny quit (Quit: Lost terminal) |
08:03:47 | * | kinkinkijkin quit (Ping timeout: 240 seconds) |
08:14:48 | Araq | ping alehander92 |
08:30:14 | FromGitter | <alehander92> yes sorry |
08:30:15 | FromGitter | <alehander92> morning |
08:37:59 | Araq | too late, missed the meeting |
08:38:39 | * | kinkinkijkin joined #nim |
08:44:08 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
08:47:42 | * | Kai0Shin joined #nim |
08:47:48 | Kai0Shin | Hi |
08:48:00 | Kai0Shin | template n_vec2* (x,y:float64):vec2= vec2(x:x,y:y) |
08:48:10 | Kai0Shin | Why does this throw an error |
08:48:45 | FromDiscord | <lqdev> what error? |
08:48:48 | Kai0Shin | It says Undeclared field <Error> |
08:48:52 | Araq | because templates don't understand (x: x) |
08:49:01 | Kai0Shin | /root/nim-lang/sdl2/src/inc/vec/vec2.nim(14, 13) Error: identifier expected, but found '10' |
08:49:04 | Araq | they replace the 'x' in both places! |
08:49:04 | Kai0Shin | make: *** [Makefile:45: bin/debug/base] Error 1 |
08:49:15 | Araq | use an inline proc instead |
08:49:30 | Kai0Shin | what is an inline proc |
08:49:40 | Araq | it's a common gotcha but it cannot be fixed because it's also a feature of templates and used |
08:50:02 | Kai0Shin | so i just replace names of variables |
08:50:13 | Araq | proc n_vec2*(x,y: float64): vec2 {.inline.} = vec2(x: x, y: y) |
08:50:26 | Araq | you can pick different parameter names in your template, yes |
08:50:44 | Araq | but generally we advise you to use inline procs over templates |
08:50:50 | Kai0Shin | okay so it just replaces the code there rather than calling the proc |
08:50:57 | Kai0Shin | thanks |
08:52:14 | PMunch | Kai0Shin, yeah that's what templates do |
08:52:33 | Kai0Shin | I meant for the {.inline.} method |
08:52:41 | PMunch | They just replace the call with whatever is in the template body |
08:53:18 | PMunch | Ah {.inline.} tells the C compiler to try harder to inline the call. And inline means to replace the call with the body |
08:53:45 | PMunch | And I say "harder" because he C compiler already tries to inline things when it thinks it's a good idea to do so |
08:54:45 | Kai0Shin | The same would go for cpp |
08:58:31 | * | superbia2 joined #nim |
08:58:47 | * | abm joined #nim |
09:00:47 | * | superbia1 quit (Ping timeout: 240 seconds) |
09:02:21 | PMunch | Yeah |
09:05:13 | * | superbia2 quit (Quit: WeeChat 2.9) |
09:13:54 | Araq | er |
09:14:08 | Araq | pragmas for parameters are ignored? |
09:14:14 | Araq | proc p(x {.noalias.}: openArray[char]) = |
09:14:14 | Araq | discard |
09:14:21 | Araq | compiles for me! :-( |
09:14:45 | Araq | !proc p(x {.noalias.}: string) = discard |
09:14:55 | Kai0Shin | what is !proc |
09:15:07 | Araq | what's Nimbot's syntax again? |
09:15:57 | FromDiscord | <Rika> !eval |
09:15:58 | FromDiscord | <Rika> i think |
09:16:36 | Araq | !eval echo "hi" |
09:16:38 | NimBot | hi |
09:16:42 | Araq | ah, thanks |
09:17:02 | Araq | !eval proc p(x {.noalias.}: openArray[char]) = discard |
09:17:03 | NimBot | Compile failed: /usercode/in.nim(1, 10) Error: identifier expected, but found 'x {.noalias.}' |
09:17:17 | narimiran | !eval echo NimVersion |
09:17:19 | NimBot | 1.2.6 |
09:17:33 | Araq | thank god. :-) |
09:17:53 | Kai0Shin | !eval echo hostOS |
09:17:56 | NimBot | linux |
09:18:18 | Kai0Shin | !eval echo hostCPU |
09:18:21 | NimBot | amd64 |
09:18:47 | PMunch | !eval echo staticExec("uname -a") |
09:18:49 | NimBot | Compile failed: /usercode/in.nim(1, 16) Error: 'staticExec' can only be used in compile-time context |
09:18:58 | PMunch | !eval echo static: staticExec("uname -a") |
09:19:00 | NimBot | Compile failed: /usercode/in.nim(1, 24) Error: 'staticExec' can only be used in compile-time context |
09:19:03 | * | kenran quit (Quit: leaving) |
09:19:08 | FromGitter | <alehander92> Araq yes: forgive me, i woke up later: elif/[] remaining |
09:19:10 | PMunch | !eval echo(static: staticExec("uname -a")) |
09:19:12 | NimBot | Compile failed: /usercode/in.nim(1, 1) Error: type expected |
09:19:15 | FromGitter | <alehander92> i'll stream a bit |
09:19:19 | PMunch | Meh |
09:19:21 | FromGitter | <alehander92> to focus |
09:19:24 | narimiran | PMunch: static: echo maybe |
09:19:24 | Araq | ok |
09:19:47 | PMunch | @narimiran, don't think that would work as the bot doesn't show compile-time output |
09:19:54 | narimiran | PMunch: ah, ok |
09:20:40 | FromDiscord | <haxscramper> !eval import osproc; echo execCmdEx("uname -a").output |
09:20:44 | NimBot | Linux 328f2f99e925 4.15.0-118-generic #119-Ubuntu SMP Tue Sep 8 12:30:01 UTC 2020 x86_64 Linux↵ |
09:21:50 | PMunch | Hmm "static:" behaves really weird |
09:22:11 | FromDiscord | <Yardanico> Did anyone try out https://plugins.jetbrains.com/plugin/15128-nim yet? |
09:22:14 | FromDiscord | <Yardanico> I'll do it later |
09:22:29 | FromDiscord | <Yardanico> Seems like they support Nim partial case insensitivity |
09:22:40 | PMunch | @flywind mentioned it over in offtopic earlier today, not sure if they tried it though.. |
09:23:50 | Kai0Shin | Is there a discord server I can join |
09:24:23 | FromDiscord | <Yardanico> Yes |
09:24:28 | FromDiscord | <flywind> I have tried it, still immature, but seems an official jetbrains plugin I think. |
09:24:32 | FromDiscord | <Yardanico> discord.gg/nim |
09:30:31 | FromDiscord | <iWonderAboutTuatara> We're on the discord right now actually |
09:30:41 | FromDiscord | <Yardanico> He knows :) |
09:30:41 | FromDiscord | <haxscramper> There is no way to limit number of type mismatch errors, right? I can only use `--showAllMismatches:on|off` to show absolutely everything |
09:30:46 | FromDiscord | <iWonderAboutTuatara> Oh lol |
09:31:00 | FromDiscord | <Yardanico> Bridge name in IRC is "FromDiscord" |
09:31:18 | FromDiscord | <haxscramper> But if I want to filter out things I just have to do some text filtering manually? |
09:31:20 | * | Trustable joined #nim |
09:31:36 | FromDiscord | <brainbomb> > Did anyone try out https://plugins.jetbrains.com/plugin/15128-nim yet?↵@Yardanico Does it work with the community versions of the IDEs too? |
09:31:52 | FromDiscord | <Yardanico> I don't know, you can try :) |
09:34:23 | * | Kai0Shin quit (Quit: leaving) |
09:34:50 | FromDiscord | <brainbomb> "Compatible with IntelliJ IDEA, Android Studio, AppCode, CLion, DataGrip, GoLand, PhpStorm, PyCharm, Rider, RubyMine, WebStorm" |
09:40:36 | FromDiscord | <Rika> !eval const test = staticExec("uname -a"); echo test |
09:40:39 | NimBot | Linux db9e6db77742 4.15.0-118-generic #119-Ubuntu SMP Tue Sep 8 12:30:01 UTC 2020 x86_64 Linux |
09:41:10 | FromDiscord | <Yardanico> we already figured this out :P |
09:41:31 | FromDiscord | <brainbomb> !eval const test = staticExec("id"); echo test |
09:41:34 | NimBot | uid=65534(nobody) gid=65534(nobody) |
09:41:42 | FromDiscord | <Rika> does it look like i did it for you |
09:48:39 | FromGitter | <alehander92> :) |
09:51:31 | FromDiscord | <alehander42> ok, streaming in discord #general a bit |
09:52:09 | FromDiscord | <Yardanico> if you stream on twitch people from irc will be able to see too :) |
09:52:29 | FromDiscord | <alehander42> yeah but for some reason |
09:52:46 | FromDiscord | <alehander42> i have problems with my obs hardware encoding |
09:52:57 | FromDiscord | <alehander42> so it's slow and |
09:53:17 | FromDiscord | <alehander42> for some reason sharing my screen/mic on discord seems to be more lightweight |
09:53:20 | * | crem joined #nim |
09:53:34 | FromDiscord | <Yardanico> because the quality is worse? |
09:54:13 | FromDiscord | <alehander42> maybe not great |
09:54:19 | FromDiscord | <alehander42> but it seems i can see the code well |
09:54:21 | FromDiscord | <alehander42> even on discord |
09:55:04 | FromDiscord | <alehander42> i have to debug my system & the open broadcast thing |
09:55:14 | FromDiscord | <alehander42> probably some kind of codec issue |
09:55:44 | FromDiscord | <alehander42> another + for discord is that |
09:55:52 | FromDiscord | <alehander42> if someone wants to say something, he can just join |
09:55:59 | FromDiscord | <alehander42> in twitch i need a .. mumble or stuff |
09:57:06 | * | Trustable quit (Read error: Connection timed out) |
09:57:29 | * | Trustable joined #nim |
09:58:42 | * | dv-^_^6 quit (Quit: The Lounge - https://thelounge.chat) |
10:01:50 | PMunch | Hmm, is there a way to turn a file descriptor into a Nim file? |
10:03:47 | * | apahl quit (Ping timeout: 240 seconds) |
10:06:11 | * | apahl joined #nim |
10:27:55 | FromDiscord | <Yardanico> Yes |
10:28:17 | FromDiscord | <Yardanico> File is just importc of C's FILE |
10:28:47 | FromDiscord | <Yardanico> Well, ptr of it |
10:28:48 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/blob/devel/lib/system/io.nim#L21 |
10:29:18 | FromDiscord | <Yardanico> And there's c_fdopen |
10:30:50 | FromDiscord | <Yardanico> Ah wait |
10:31:27 | FromDiscord | <Yardanico> @PMunch https://nim-lang.org/docs/io.html#open%2CFile%2CFileHandle%2CFileMode |
10:31:53 | PMunch | Hmm, okay |
10:32:42 | Araq | please don't rely on it, we're looking forward to a new io module that doesn't use C's legacy |
10:33:44 | PMunch | Don't worry, this is only for a small test script I'm writing |
10:33:52 | PMunch | But I need to read from a UDP socket as a stream |
10:34:03 | PMunch | Ah, it didn't like peek.. |
10:36:02 | Araq | btw today I solved borrow checking for Nim. Now only the documentation and implementation is lacking... |
10:41:11 | FromDiscord | <Yardanico> borrow checking for openarrays or it can be used for other stuff too? |
10:43:14 | Araq | for "view types" |
10:43:26 | Araq | lent/var/openArray |
10:44:32 | FromDiscord | <exelotl> Aw heck yeah |
10:45:45 | FromDiscord | <Clyybber> Araq: Nice, what was the problem ? |
10:48:49 | * | waleee-cl joined #nim |
10:49:19 | Araq | Nim's semantics were off |
10:49:36 | Araq | but we can recover from it easily |
10:50:56 | Araq | we need to allow proc `[]`(x: Container): var T |
10:51:05 | Araq | note the absense of 'var Container' |
10:51:13 | FromDiscord | <Clyybber> Huh |
10:51:24 | Araq | then we also need two overloads to do the same |
10:51:29 | Araq | er |
10:51:38 | Araq | then we also do not need two overloads to do the same anymore |
10:52:02 | FromDiscord | <Clyybber> But that allows me to get var T from a immutable seq[T]? |
10:52:18 | FromDiscord | <Clyybber> Don't we need proc [](x: Container): lent T instead? |
10:52:23 | Araq | yeah, borrow checking then enforces you don't mutate the seq |
10:52:51 | FromDiscord | <Clyybber> hmm, but why can't we use lent T instead? |
10:52:51 | Araq | but the type signature finally stops lying (it doesn't mutate the seq, it allows for a seq mutation!) |
10:53:07 | Araq | because it's not the same thing, 'lent' doesn't allow for mutations |
10:53:24 | FromDiscord | <Clyybber> yeah, but why should we allow for mutations if we want to enforce they dont happen |
10:53:42 | FromDiscord | <Clyybber> if possible I think preventing mistakes with the type system is preferred over borrow checking |
10:54:13 | Araq | I'm quite certain I got it right :P |
10:54:24 | FromDiscord | <Clyybber> it sounds quite broken to me :D |
10:54:44 | Araq | look at a[i] = x |
10:54:51 | Araq | where a is a good old array |
10:55:42 | Araq | we know that it mutates an element but a[i] itself is no mutation |
10:56:04 | Araq | we currently model this with two overloaded [] accessors |
10:56:36 | Araq | but that's not correct. there is one accessor and it allows for mutations, done by the '=' |
10:56:53 | * | neceve joined #nim |
10:57:42 | Araq | our way of modelling says "if the var overload is picked assume a mutation" |
10:57:54 | Araq | but that's not good enough for strict funcs, see |
10:57:57 | FromDiscord | <Clyybber> But we don't have to assume that |
10:58:09 | FromDiscord | <Clyybber> We can have the compiler check for actual modifications |
10:58:23 | FromDiscord | <Clyybber> but I agree that we might be conflating two things here |
10:58:40 | FromDiscord | <Clyybber> passing on something mutable might be worth it to seperate from actual modification |
10:59:01 | Araq | https://github.com/nim-lang/Nim/blob/devel/lib/impure/nre.nim#L377 |
10:59:42 | FromDiscord | <Clyybber> is that needed because the var overload was chosen? |
11:00:16 | Araq | yes |
11:00:31 | FromDiscord | <Clyybber> but why does that count as a sideffect |
11:00:33 | FromDiscord | <Clyybber> pattern is local |
11:00:40 | FromDiscord | <Clyybber> and name isn't passed as a var param? |
11:03:43 | FromDiscord | <Clyybber> and result isn't modified afterwards |
11:03:53 | FromDiscord | <Clyybber> Araq: ping |
11:12:11 | Araq | pattern is connected to the parameter 'pattern' |
11:12:29 | Araq | it's confusing code, I know |
11:12:50 | Araq | but the compiler's analysis is correct (except for the language design problem) |
11:13:34 | Araq | the parameter is not a 'var' |
11:13:55 | Araq | and so for all the compiler can tell this could mutate an object reachable from the pattern parameter |
11:14:16 | FromDiscord | <KaiOShin> I am getting some error in an almost perfect program |
11:14:17 | FromDiscord | <KaiOShin> https://pastebin.com/bvY9qep6 |
11:14:42 | FromDiscord | <Yardanico> Makefile? |
11:14:56 | Araq | add a loadExtensions() call as the first statemnt of your main .nim file |
11:15:47 | FromDiscord | <KaiOShin> Makefile output : |
11:15:48 | FromDiscord | <KaiOShin> Compiling: src/inc/vec/vec2.nim -> bin/debug/base↵nim -o:bin/debug/base cpp --opt:size src/main.nim |
11:16:03 | * | konkrrrrrr joined #nim |
11:16:41 | * | kinkinkijkin quit (Ping timeout: 244 seconds) |
11:18:00 | FromDiscord | <KaiOShin> still shows the error @Araq[IRC] |
11:18:41 | FromDiscord | <KaiOShin> Araq where do you mean |
11:19:09 | FromDiscord | <Clyybber> Araq: How could it? The local pattern variable is immutable? |
11:20:08 | FromDiscord | <Clyybber> ah, Refex is a ref object :/ |
11:20:37 | FromDiscord | <KaiOShin> It does not show the error after removing loadExtensions() |
11:26:48 | FromDiscord | <KaiOShin> It works after I used some functions from opengl |
11:34:25 | Oddmonger | let's say i have: var foo:tuple[ idx:int, bag:array[10, ptr string] ] |
11:34:59 | Oddmonger | is it possible to initialize it, starting idx at 9 for example ? |
11:35:24 | FromDiscord | <Rika> instead of putting 10, put 9..<19 |
11:35:26 | Oddmonger | like var foo… = (9, [0..9,0] ) ? |
11:35:37 | FromDiscord | <Clyybber> Araq: Hold on, is the var overload chosen? |
11:35:53 | PMunch | Is there a way to see the raises of a procedure? |
11:36:15 | PMunch | I get this error, which isn't very useful.. http://ix.io/2z0u |
11:37:02 | FromDiscord | <Clyybber> Disregard that |
11:37:19 | Oddmonger | ah i see what you mean Rika, but my example was not well chosen |
11:37:35 | Oddmonger | let's say i want to initialize the tuple with an arbitrary value for idx |
11:38:09 | FromDiscord | <Rika> wdym? |
11:38:30 | FromDiscord | <Rika> array indices are decided at compile time i think? |
11:39:21 | Oddmonger | i mean something like this: var ufos:tuple[ list:array[50,ptr orxOBJECT], index:int, index_max:int] = (array[50,orxOBJECT],0,50) |
11:39:39 | Oddmonger | it's for initializing index_max at creation |
11:40:16 | * | lritter quit (Ping timeout: 246 seconds) |
11:40:32 | Oddmonger | the «array» part in the init is wrong, i don't know how to init this part at blank values (or just skip it) |
11:40:37 | FromDiscord | <Rika> array[N, T] is an alias for array[0..<N, T] afaik so max int is always gonna be array.high |
11:41:03 | Oddmonger | ah fine |
11:41:18 | PMunch | Hmm, I also have an issue with tags.. |
11:41:24 | Oddmonger | thank you Rika |
11:41:51 | PMunch | I'm trying to implement streams for a socket |
11:42:48 | PMunch | But the socket procedures have various effect tags that aren't listed by the streams "interface" |
11:43:03 | FromDiscord | <Clyybber> Araq: I think i have a solution for the problem |
11:43:09 | FromDiscord | <Clyybber> Since with strictFuncts non-var params are deeply-immutable |
11:43:12 | FromDiscord | <Clyybber> The local pattern variable is deeply-immutable too |
11:43:16 | FromDiscord | <Yardanico> You'll have to cast @PMunch |
11:43:16 | FromDiscord | <Clyybber> If the analysis is aware of that we have solved the problem |
11:43:29 | FromDiscord | <Yardanico> Not sure how safe it is, but you can strip these tags with casts |
11:44:13 | PMunch | Aha |
11:47:30 | * | d10n_ is now known as d10n |
11:47:30 | * | d10n quit (Changing host) |
11:47:30 | * | d10n joined #nim |
11:49:36 | PMunch | Ugh, I'm using a backwards setPosition.. This means I have to implement a socket stream properly.. |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:39 | * | supakeen joined #nim |
12:10:44 | * | xace quit (Ping timeout: 256 seconds) |
12:11:55 | * | NimBot joined #nim |
12:41:36 | FromDiscord | <dom96> I wonder if you can `{.tags: [].}:` |
12:41:46 | FromDiscord | <dom96> in the same way you can use `gcsafe` |
12:41:55 | FromDiscord | <dom96> if not it would be a great feature (CC Araq) |
12:43:49 | * | xace joined #nim |
12:44:41 | * | arecacea1 quit (Remote host closed the connection) |
12:45:04 | * | arecacea1 joined #nim |
12:52:35 | * | xace quit (Ping timeout: 240 seconds) |
12:55:22 | * | konkrrrrrr quit (Ping timeout: 244 seconds) |
12:55:29 | * | kinkinkijkin joined #nim |
12:55:47 | FromDiscord | <mratsim> lying about gcsafe is OK, but lying about exceptions? |
12:57:21 | FromDiscord | <fwsgonzo> does anyone have a bog-standard CMake script for building with Nim using either C or C++ backend? |
12:57:48 | FromDiscord | <fwsgonzo> if not, will there be an argument you could pass to nim that would output in a way that simplifies CMake builds? |
12:58:21 | FromDiscord | <fwsgonzo> (edit) 'does anyone have a bog-standard CMake script for building with Nim using either C or C++ backend? ... ' => 'does anyone have a bog-standard CMake script for building with Nim using either C or C++ backend?GLOB disqualified' |
12:58:37 | * | kinkinkijkin quit (Remote host closed the connection) |
12:59:04 | * | kinkinkijkin joined #nim |
13:00:59 | FromDiscord | <mratsim> Building Nim the compiler or building a Nim program/application? |
13:05:13 | * | Trustable quit (Remote host closed the connection) |
13:28:02 | disruptek | zevv: npeg 0.23.0 doesn't work on 1.0.6 |
13:28:35 | Zevv | so how did 1.0.6 get through CI |
13:29:19 | Zevv | it's the new move in system.add[T](seq T, openArray T) |
13:29:25 | Zevv | or is it |
13:31:53 | * | gmaggior joined #nim |
13:38:44 | * | xace joined #nim |
13:44:05 | * | xace quit (Ping timeout: 240 seconds) |
13:49:27 | * | xace joined #nim |
13:56:45 | PMunch | Ugh, implementing a stream for sockets is such a pain.. |
14:01:27 | * | FromDiscord quit (Remote host closed the connection) |
14:01:43 | * | FromDiscord joined #nim |
14:05:25 | disruptek | no, expectIdent doesn't exist. |
14:10:59 | FromDiscord | <dom96> mratsim: tags != raises |
14:11:29 | FromDiscord | <dom96> also, you can say the same about `cast` |
14:15:34 | FromDiscord | <Vindaar> To me the difference would be that I'm aware that a `{.gcsafe.}` block is screaming "unsafe" and so does `cast`. The same (to my intuition) wouldn't apply to a `{.tags: [].}` |
14:17:31 | FromDiscord | <Rika> why would it not |
14:17:47 | FromDiscord | <Rika> its the same notation as gcsafe |
14:18:55 | FromDiscord | <Vindaar> because I'm not educated about it I guess?↵Oh, is that supposed to be a block as well? In my head I attached it to a proc, same as `raises` |
14:19:24 | FromDiscord | <Vindaar> if it's a block, ok. At least that would make me stop and look up what it's supposed to do |
14:19:27 | FromDiscord | <Rika> thats what it said in the message |
14:19:37 | PMunch | What's weird about `gcsafe` is that it does different things in different contexts |
14:19:49 | FromDiscord | <Vindaar> oh I agree with that PMunch |
14:19:59 | FromDiscord | <Vindaar> @Rika in what message? |
14:20:22 | FromDiscord | <Vindaar> oh, you mean that was what dom meant by adding the colon at the end? yes, possibl |
14:20:32 | PMunch | Place it as a pragma on a procedure and that procedure will be checked and guaranteed to be GC-safe. However put it as a block statement and it now does the opposite, allows you to do GC-unsafe things without a check |
14:21:18 | disruptek | silly. |
14:21:21 | Araq | yeah, that has been said elsewhere too and we can change it to |
14:21:31 | Araq | .assumeGcSafe |
14:21:41 | FromDiscord | <Vindaar> I'd +1 that |
14:21:44 | FromDiscord | <alehander42> disruptek |
14:21:45 | PMunch | Same |
14:21:48 | Araq | or maybe something else that screams "I know what I'm doing" |
14:21:57 | Araq | suggestions are welcome |
14:22:29 | disruptek | just make it a warning that we can push off. |
14:22:43 | disruptek | that's a senantic everyone knows how to use. |
14:22:55 | FromDiscord | <lqdev> {.pleaseNimCompilerISwearIKnowWhatIAmDoing.} |
14:23:26 | FromDiscord | <Vindaar> {.pleaseNimCompilerISwearIKnowWhatIAmDoingExceptIReallyDontAndPrayMyCodeStillRuns.} you mean? |
14:23:27 | disruptek | as the compiler gets smarter, it will warn less. |
14:23:33 | FromDiscord | <lqdev> or perhaps {.dontBullyMe.} |
14:23:42 | Araq | .stopPokingMe |
14:23:51 | FromDiscord | <Rika> gcunsafe |
14:23:53 | FromDiscord | <Rika> lol |
14:23:54 | Prestige | +1 for dontBullyMe |
14:24:37 | Araq | .enforceGcSafe |
14:24:40 | Araq | ? |
14:24:49 | Araq | keep in mind we have the same now for .noSideEffect |
14:25:07 | Araq | .enforceNoSideEffect is quite a pragma name :-/ |
14:25:33 | FromDiscord | <Rika> what about force instead of enforce |
14:25:42 | Araq | maybe if we remove the vowels, nfrcnsdffct |
14:25:49 | Prestige | lol |
14:25:58 | Araq | now that's something for unix |
14:26:12 | Prestige | only keep the vowels Araq |
14:28:28 | FromDiscord | <lqdev> eoeoiee |
14:31:54 | Araq | forceGcSafe ? |
14:33:47 | FromDiscord | <dom96> Huh? You want to make it unenforced by default? |
14:33:50 | * | evanj joined #nim |
14:34:03 | Araq | no, I'm talking about giving the override *blocks* better names |
14:34:09 | FromDiscord | <dom96> oh lol |
14:34:35 | FromDiscord | <dom96> I guess that can work |
14:34:37 | Araq | maybe we should make it a general mechanism |
14:34:50 | Araq | {.enforce: gcsafe, noSideEffect.}: ... |
14:34:50 | FromDiscord | <dom96> yeah |
14:35:03 | FromDiscord | <dom96> {.forcePush.}? |
14:35:14 | FromDiscord | <dom96> or just `force` really |
14:35:38 | FromDiscord | <dom96> good word, it implies lack of safety |
14:35:43 | Araq | but 'enforce' cannot be mistaken for a noun |
14:35:44 | FromDiscord | <dom96> or maybe `ignore`? |
14:35:55 | FromDiscord | <dom96> {.ignore: gcsafe.} |
14:35:58 | Araq | (I'm also not talking about 'push') |
14:36:05 | FromDiscord | <Rika> ignore is good |
14:36:15 | Prestige | that looks good actually |
14:36:27 | Araq | dom96: add the colon so that I know we're talking about the same thing |
14:36:45 | Araq | once again, I'm talking about {.gcsafe.}: |
14:36:58 | FromDiscord | <dom96> yes, the colon is implicit in all my messages |
14:36:59 | Araq | about {.gcsafe.}: <block here> |
14:37:02 | Araq | ok |
14:37:13 | FromDiscord | <dom96> {.ignore: gcsafe.}: myGlobalVar = 23 |
14:37:21 | Araq | yeah |
14:37:35 | Araq | I like 'enforce' better than 'ignore' though |
14:37:46 | Araq | or maybe 'override' |
14:37:52 | Araq | {.override: gcsafe.}: ... |
14:38:19 | Prestige | does that just mean gcsafe doesn't apply? |
14:38:33 | Araq | it means "shut up, compiler" |
14:38:50 | Prestige | I think ignore is more concise |
14:39:09 | * | skyler joined #nim |
14:40:50 | Araq | well 'force' is even shorter but they are all acceptably short IMO |
14:41:26 | Araq | maybe we should re-use 'cast' for grepping conveniences |
14:41:40 | Araq | {.cast: gcsafe}: global = 12 |
14:43:05 | FromDiscord | <dom96> hmmm, not a bad idea |
14:43:15 | FromDiscord | <dom96> a keyword in a pragma may be weird though |
14:45:07 | * | krux02 joined #nim |
14:46:10 | FromDiscord | <dom96> I like the consistency though 🙂 |
14:46:27 | disruptek | kinda makes sense. |
14:46:39 | Araq | wow, people agree |
14:46:52 | Araq | doesn't happen that often for trivia |
14:47:21 | disruptek | give it time; we'll find something wrong with it. |
14:47:28 | * | hnOsmium0001 joined #nim |
14:47:39 | FromDiscord | <Yardanico> Well, it makes sense - you're kind of casting a code block to enforce a pragma |
14:47:54 | FromDiscord | <Yardanico> The same as you add gcsafe to procs via casts |
14:48:31 | Araq | before we had these blocks, casting to a different proc type was common |
14:48:39 | Araq | so yeah, it makes lots of sense |
14:48:42 | disruptek | it puts the on/off spec into the pragma name, though. |
14:49:07 | disruptek | like, it doesn't solve the problem here. |
14:50:45 | Araq | *shrug* we can always come up with 'ungcsafe', but I have no idea what 'cast: ungcsafe' means |
14:51:03 | * | xace quit (Quit: leaving) |
14:51:24 | FromDiscord | <dom96> Shouldn't it be: {.cast: [].} then? i.e casting to no pragmas |
14:51:46 | disruptek | well, time for a new pragma then. |
14:51:55 | FromDiscord | <Rika> what if you only wanted to remove gcsafe but not tags |
14:52:03 | FromDiscord | <dom96> I suppose it will get annoying to always list the pragmas that you want a proc to have, when you may just want it to be gcsafe |
14:52:07 | disruptek | or, .uncast |
14:52:16 | Prestige | that's what I liked about ignore @Rika |
14:53:00 | Araq | {.cast: tags: [].} :P |
14:53:14 | FromDiscord | <dom96> It looks like making the cast block consistent with the cast expression will turn it into something that is a little annoying to use |
14:53:27 | Araq | {.cast: tags: [], raises: [ValueError], gcsafe.} |
14:53:40 | Araq | or maybe |
14:53:48 | Araq | {.cast: (tags: [], raises: [ValueError], gcsafe).} |
14:54:17 | FromDiscord | <dom96> or `{.cast: {.tags: [], raises: [ValueError], gcsafe.}.}` 😛 |
14:54:27 | Araq | or |
14:54:43 | Araq | {.cast: tags: [], cast: raises: [ValueError], cast: gcsafe.} |
14:55:40 | FromDiscord | <dom96> btw while we're doing this, can we also make it possible to have a way to exclude specific tags/exceptions rather than just giving an absolute list? |
14:56:25 | Araq | like? |
14:56:33 | FromDiscord | <dom96> {.tags: [not IORead].} # statically ensures that IORead is not present in the tags for this proc (but any other tag is fine) |
14:56:45 | Prestige | ignore/exclude pragma? |
14:57:03 | Prestige | or that, seems decent |
14:58:38 | FromDiscord | <Recruit_main707> can you pass an overriden method as a function pointer? the base method is always being called, (because it properly fits the argument `ref Root` rather than `ref Child` i guess) |
14:59:00 | FromDiscord | <dom96> I guess for exceptions it's tricky, since the compiler cannot guarantee that an `Exception` is not actually a more concrete `IOError` which I have excluded via `{.raises: [not IOError].}` |
15:00:27 | Araq | yep |
15:00:38 | FromDiscord | <dom96> you could be conservative here though |
15:00:58 | FromDiscord | <dom96> I would say that most use cases would involve that proc including a try catch that explicitly handles `IOError` |
15:01:01 | Araq | in my personal universe there is only .raises and .noraises and the exact exception types are not tracked |
15:01:10 | Araq | like Swift does it |
15:01:32 | Araq | but whenever I bring it up the world is gonna end with coarse grained exception tracking |
15:01:33 | * | mmohammadi98129 joined #nim |
15:05:18 | FromDiscord | <alehander42> cant we do that |
15:05:19 | disruptek | maybe this should be tied to a specific scope. |
15:05:21 | FromDiscord | <alehander42> and see how well it works |
15:05:47 | FromDiscord | <alehander42> a bit more experimental lang-design in branches with +/- analysis |
15:23:41 | * | njoseph quit (Ping timeout: 272 seconds) |
15:24:03 | * | njoseph joined #nim |
15:26:30 | * | abm quit (Read error: Connection reset by peer) |
15:35:09 | * | abm joined #nim |
15:41:23 | FromDiscord | <alehander42> ok Araq |
15:41:34 | FromDiscord | <alehander42> if/elif/else should be more stable now |
15:42:42 | FromDiscord | <alehander42> i have cleanup to do, but basically whenever you have time take a look at the `nkIfStmt, nkIfExpr` case in `check`: if it's understandable , most of the stuff should be ok |
15:42:43 | FromDiscord | <alehander42> imo |
15:44:26 | * | qwertfisch quit (Quit: ZNC - http://znc.in) |
15:45:09 | * | qwertfisch joined #nim |
15:49:44 | * | Trustable joined #nim |
15:49:49 | * | skyler quit (Quit: WeeChat 2.9) |
15:52:19 | * | mmohammadi98129 quit (Quit: I quit (╯°□°)╯︵ ┻━┻) |
15:53:24 | * | mmohammadi9812 joined #nim |
16:05:25 | FromDiscord | <alehander42> ok `checkIf` * |
16:05:52 | FromDiscord | <alehander42> about the speed: i know, i'll optimized it tomorrow, trying to finish the feature fixes today |
16:15:47 | * | zedeus quit (Ping timeout: 240 seconds) |
16:17:44 | * | zedeus joined #nim |
16:24:51 | * | arecacea1 quit (Remote host closed the connection) |
16:25:21 | * | arecacea1 joined #nim |
16:37:49 | FromDiscord | <haxscramper> How hard it would be to write own static analyser for nim which would do some simple checks like detecting `a == a` (equal expressions on each side). Nothing really serious. And if it can be done which compiler modules I should look into for something like that? Aside from `parser` of course |
16:38:19 | * | PMunch quit (Quit: leaving) |
16:40:22 | leorize | asts |
16:40:59 | leorize | mainly passes |
16:41:09 | leorize | for static analysis you might want to compile the module |
16:41:27 | leorize | so register a pass that runs after sem to get access to the typed ast |
16:41:37 | leorize | then, uh, you got the ast now so do whatever :p |
16:42:21 | leorize | you should probably ask Araq though, I only have limited experience with this (from reading nimsuggest) |
16:44:31 | FromDiscord | <haxscramper> I will start with this one + I remembered that there is a `dust` - https://github.com/disruptek/dust/blob/master/dust.nim which should ba good starting example (probably, not sure about that though) |
16:50:33 | * | Jesin quit (Quit: Leaving) |
16:50:50 | * | buyfn joined #nim |
16:58:23 | disruptek | haxscramper: the earlier dust commits are more "lean" while the later ones pull in more and more of the compiler. |
16:59:40 | disruptek | the early ones seem more like what you want to look at. |
17:00:02 | disruptek | ie. a custom pass. |
17:01:03 | * | a_chou joined #nim |
17:10:01 | * | nature joined #nim |
17:18:12 | Zevv | disruptek: did you mean 1.0.6 or 1.2.6? |
17:22:12 | * | m4r35n357 joined #nim |
17:23:02 | * | m4r35n357 quit (Read error: Connection reset by peer) |
17:23:25 | * | m4r35n357 joined #nim |
17:28:46 | * | vicfred quit (Quit: Leaving) |
17:31:35 | * | def- quit (Quit: -) |
17:33:12 | * | buyfn quit (Quit: buyfn) |
17:34:09 | * | buyfn joined #nim |
17:35:04 | * | def- joined #nim |
17:36:22 | * | buyfn quit (Client Quit) |
17:37:16 | * | Jesin joined #nim |
17:49:10 | * | a_chou quit (Ping timeout: 246 seconds) |
17:52:05 | * | Northstrider[m] quit (Quit: killed) |
17:57:48 | * | a_chou joined #nim |
18:00:43 | * | tane joined #nim |
18:00:44 | * | Northstrider[m] joined #nim |
18:06:37 | * | apahl quit (Ping timeout: 260 seconds) |
18:07:19 | * | apahl joined #nim |
18:08:25 | * | neceve quit (Ping timeout: 246 seconds) |
18:16:08 | FromDiscord | <alehander42> a linter? 😮 |
18:16:22 | FromDiscord | <alehander42> that would be interesting |
18:33:22 | * | vicfred joined #nim |
18:34:00 | * | xace joined #nim |
18:41:46 | Araq | interesting, https://github.com/nim-lang/Nim/pull/15423/files |
18:41:47 | disbot | ➥ Clean out WIP |
18:41:53 | Araq | do we have an RFC that covers it? |
18:55:35 | FromDiscord | <XeroOl> is there a way to run a nimscript file with just a shebang, and not a file extension? |
18:55:40 | * | mmohammadi9812 quit (Ping timeout: 246 seconds) |
18:55:58 | * | a_chou quit (Remote host closed the connection) |
18:56:56 | FromDiscord | <haxscramper> You mean treating `.nim` file as nimscript? |
18:57:06 | FromDiscord | <XeroOl> I mean treating a file with no extension as nimscript |
18:57:32 | FromDiscord | <XeroOl> ie, on the command line, I want to type just the filename |
18:57:43 | FromDiscord | <haxscramper> Maybe `#!/usr/bin/env -S nim e` |
18:58:44 | FromDiscord | <haxscramper> Oh, no `Error: not a NimScript file: /tmp/test`. Adding `nims` fixes it |
19:00:12 | FromDiscord | <XeroOl> I was hoping I could use nim as a replacement to shell scripting |
19:01:41 | FromDiscord | <haxscramper> And `.nims` extension stops you from doing so? |
19:01:57 | FromDiscord | <XeroOl> well, I'm trying to write a script to put in my path |
19:02:35 | FromDiscord | <XeroOl> I guess I could just write it in nim, and then compile it into an executable lol |
19:02:37 | FromDiscord | <XeroOl> instead of nimscript |
19:03:27 | FromDiscord | <haxscramper> You can write `script.nims` and then just `ln -sf script.nims as-command`. And use `#!/usr/bin/env -S nim e` as shebang in script itself |
19:04:15 | FromDiscord | <haxscramper> And then use `as-command` in shell. This approach also allows you to switch nimscript for compiled version if you want |
19:05:02 | FromDiscord | <XeroOl> yeah, that's actaully a good way to do it |
19:05:09 | FromDiscord | <XeroOl> thank you very much |
19:18:41 | nature | Anybody has experience using nim on nixos ? |
19:19:58 | FromDiscord | <dayl1ght> sent a code paste, see https://play.nim-lang.org/#ix=2z4s |
19:20:53 | FromDiscord | <dayl1ght> the process gets stuck in the last line (`process.outputStream.readLine()`), and it also gets stuck if I call `process.hasData()` |
19:21:17 | FromDiscord | <dayl1ght> what is wrong with this snippet of code? |
19:22:09 | FromDiscord | <XeroOl> you should be reading from the inputstream and writing to the outputstream |
19:22:35 | FromDiscord | <XeroOl> wait, I'm being stupid, nevermind |
19:23:28 | FromDiscord | <dayl1ght> oh maybe I'm missing a \n |
19:23:46 | FromDiscord | <dayl1ght> ok that wasn't the problem |
19:25:07 | FromDiscord | <haxscramper> I had similar problem with `inputStream()` where I had to call `.close()` manually, otherwise it would get stuck |
19:25:29 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2z4u |
19:27:12 | FromDiscord | <dayl1ght> `pid` is a `Process` instance in your snippet, correct? |
19:27:21 | FromDiscord | <haxscramper> Yes |
19:27:53 | FromDiscord | <dayl1ght> I tried that and it's not stuck anymore, but I get a `unhandled exception: cannot read from stream [IOError]` when trying to read from outputStream after closing inputStream |
19:28:20 | FromDiscord | <haxscramper> https://play.nim-lang.org/#ix=2z4w |
19:30:01 | FromDiscord | <haxscramper> Although I'm not sure about `{poEvalCommand, poUsePath, poEchoCmd}` part - I use just `{poEvalCommand}` |
19:30:29 | FromDiscord | <dayl1ght> Thanks for that, I'll try it out |
19:30:53 | FromDiscord | <dayl1ght> I might have to change it a bit because I want to send to stdin and read from stdout in sequence multiple times (while keeping the process open) |
19:52:08 | FromDiscord | <haxscramper> I had some progress with passes, but now I'm completely stuck on how to supply path to nim stdlib. The code - https://gist.github.com/haxscramper/8821819221b1d73866e4aed306147f0c , using `compiler/1.2.6` and it fails with `Error: cannot open '/mnt/workspace/github/hax-nim/hack-test/system.nim'` - tries to search for `system.nim` in the same directory as project. |
19:53:19 | FromDiscord | <Elegant Beef> Nature i know ldlework has but no clue if they're going to get this message 😄 |
19:59:44 | FromDiscord | <shashlick> @haxscramper how do you tell it where the compiler is |
20:00:49 | FromDiscord | <haxscramper> I should? Probably with `findExe "nim"` |
20:02:05 | FromDiscord | <haxscramper> And I also found `ConfigREf.libpath` which is used in `modules.compileSystemModule` |
20:04:25 | * | narimiran quit (Ping timeout: 240 seconds) |
20:06:14 | FromDiscord | <haxscramper> Yes, now It fails with `.choosenim/toolchains/nim-1.2.6/lib/system.nim(275, 25) Error: invalid pragma: unchecked` |
20:21:50 | * | dv-^_^6 joined #nim |
20:29:50 | FromDiscord | <alehander42> all |
20:29:53 | * | Vladar quit (Quit: Leaving) |
20:29:55 | FromDiscord | <alehander42> static values are calculated |
20:30:00 | FromDiscord | <alehander42> before end of sempass2 right? |
20:36:31 | Araq | right |
20:36:49 | FromDiscord | <alehander42> awesome |
20:37:45 | FromDiscord | <alehander42> so my last plan for now is to just support collection[<static value>] for now: one can always add additional logic later |
20:43:43 | FromDiscord | <alehander42> cool, this sem .. to work |
20:45:13 | * | solitudesf- quit (Ping timeout: 264 seconds) |
20:45:26 | * | solitudesf joined #nim |
20:53:08 | FromDiscord | <shashlick> @haxscramper use `--path:$nim`? |
20:55:14 | FromDiscord | <haxscramper> @shashlick Yes, I already figured it out with `.libpath` - not I'm trying to figure out why it cannot open ` Error: cannot open file: system/fatal`. I updated the gist |
20:56:08 | FromDiscord | <haxscramper> now* |
20:56:09 | FromDiscord | <shashlick> Your command line seems more relevant |
20:56:53 | FromDiscord | <haxscramper> I don't pass cmdline arguments right now |
20:57:14 | FromDiscord | <shashlick> Like you are using the wrong lib dir with the wrong compiler version |
20:57:21 | FromDiscord | <shashlick> Your cfg file then |
20:59:18 | Araq | haxscramper: simply use a github clone and use it for everything |
20:59:35 | Araq | it's what I do, no need for choosenim, no multiple outdated stdlib dirs |
20:59:39 | Araq | works |
21:00:17 | FromDiscord | <alehander42> Araq should i add |
21:00:23 | FromDiscord | <alehander42> tests for known false positives |
21:00:34 | Araq | like? |
21:01:07 | FromDiscord | <alehander42> e.g. `a[b].field # warning here` even if its possible to improve the analysis one day |
21:01:17 | FromDiscord | <alehander42> so `a[b].field # no warning` one day |
21:06:36 | Araq | yeah, add these |
21:06:41 | FromDiscord | <haxscramper> Araq: the same error - cloned Nim & compiled with devel version |
21:07:15 | Araq | how can it still fail with |
21:07:16 | Araq | `.choosenim/toolchains/nim-1.2.6/lib/system.nim(275, 25) |
21:07:25 | Araq | when you don't have choosenim anymore? :P |
21:08:11 | FromDiscord | <haxscramper> Well, yes `/mnt/workspace/github/hax-nim/hack-test/pass/here/lib/system/assertions.nim(2, 11) Error: cannot open file: system/fatal` - it pointed it to cloned nim. The only thing different is the path for `assertions.nim` |
21:11:30 | Araq | well maybe you need a system/fatal.nim file |
21:18:20 | FromDiscord | <alehander42> ok, night night |
21:18:33 | FromDiscord | <alehander42> tomorrow i should wake up at ~6:45 |
21:19:16 | FromDiscord | <alehander42> Araq ok, i've added the tests and impl |
21:19:18 | FromDiscord | <alehander42> for brackets |
21:19:19 | FromDiscord | <alehander42> for now |
21:19:47 | FromDiscord | <dayl1ght> `process.outputStream.hasData` gets stuck (i.e. never returns) when there's no data to read from the stdout of a process started with `startProcess` |
21:19:53 | FromDiscord | <dayl1ght> isn't it supposed to return false? |
21:24:29 | FromDiscord | <dayl1ght> oops I meant process.hasData |
21:26:53 | FromDiscord | <dayl1ght> https://play.nim-lang.org/#ix=2z5f this reproduces the issue |
21:39:14 | Araq | meh, iirc, interprocess communication is inherently prone to deadlocks |
21:39:19 | FromDiscord | <dayl1ght> ok so I think this is the problem |
21:39:20 | FromDiscord | <dayl1ght> https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/osproc.nim#L1376 |
21:39:27 | FromDiscord | <dayl1ght> shouldn't the last argument to select be a timeout of zero? |
21:39:45 | FromDiscord | <dayl1ght> from the manpage of select(2): |
21:39:51 | FromDiscord | <dayl1ght> sent a code paste, see https://play.nim-lang.org/#ix=2z5j |
21:40:06 | Araq | create a PR |
21:40:15 | FromDiscord | <dayl1ght> cool, I can do that |
21:40:19 | FromDiscord | <dayl1ght> do you think this should be configurable? |
21:40:27 | FromDiscord | <dayl1ght> i.e. add a new optional timeout parameter to hasData |
21:40:55 | * | solitudesf quit (Remote host closed the connection) |
21:41:00 | Araq | I don't know but also see the git history, we didn't always use 'select' for this |
21:41:44 | * | Trustable quit (Remote host closed the connection) |
21:41:56 | * | tane quit (Quit: Leaving) |
21:42:47 | * | solitudesf joined #nim |
21:43:19 | FromDiscord | <dayl1ght> ok! I'll work on the PR later today |
21:43:41 | Araq | ty |
21:43:53 | FromDiscord | <dayl1ght> ideally I can also add a test to prevent this from coming up again, but I'm not sure on the best way to do that (i.e. assert that hasData returns in less than n seconds) |
21:44:53 | FromDiscord | <dayl1ght> sent a code paste, see https://play.nim-lang.org/#ix=2z5m |
22:12:35 | * | nature quit (Ping timeout: 240 seconds) |
22:32:38 | * | solitudesf quit (Ping timeout: 260 seconds) |
22:47:36 | FromGitter | <ynfle> Any ideas for simple plotting libraries? |
22:54:01 | * | vqrs quit (Ping timeout: 246 seconds) |
23:08:06 | FromDiscord | <Vindaar> what do you mean? existing plotting libs in Nim? |
23:08:22 | FromGitter | <ynfle> yup |
23:08:46 | FromGitter | <ynfle> Found ggplot. The syntax seems easier than plotly for what I need |
23:09:02 | FromDiscord | <Vindaar> sent a long message, see http://ix.io/2z5J |
23:09:06 | FromGitter | <ynfle> (I think you made it so 👍 ) |
23:09:28 | FromGitter | <ynfle> Yup |
23:09:39 | FromDiscord | <Vindaar> Aside from those 3 there's a wrapper for gnuplot somewhere and it's easy to interface with matplotlib using nimpy |
23:10:49 | FromGitter | <ynfle> Thanks sounds good I'll check them out tomorrow |
23:10:55 | FromDiscord | <Vindaar> in any case. Those 3 should cover most of your needs. If something is lacking, get in touch. plotly can be extended easily to support anything that plotly natively can do. Everything that isn't there, simply is missing because no one needed it so far |
23:11:28 | FromDiscord | <Vindaar> and extending ggplotnim is a bit of work of course, but I'll prioritize stuff people want |
23:19:44 | * | lritter joined #nim |
23:20:20 | * | vqrs joined #nim |
23:21:07 | * | sagax quit (Read error: Connection reset by peer) |
23:23:09 | * | arecacea1 quit (Remote host closed the connection) |
23:23:33 | * | arecacea1 joined #nim |
23:36:00 | * | gmaggior quit (Quit: Leaving) |
23:45:34 | evanj | /join #hare |
23:45:39 | evanj | fuck |
23:45:56 | FromDiscord | <Clyybber> :) |
23:49:05 | * | lbart quit (Ping timeout: 272 seconds) |
23:53:06 | * | lbart joined #nim |
23:53:06 | * | lbart quit (Changing host) |
23:53:06 | * | lbart joined #nim |