00:02:12 | shashlick | Doubt it @zacharycarter - they might be using vms |
00:03:02 | * | chemist69 joined #nim |
00:03:27 | FromGitter | <zacharycarter> true |
00:08:11 | shashlick | Well I can check on my Windows vm once you get it working there |
00:10:53 | FromGitter | <arnetheduck> @timotheecour fact remains that a `Nim` array is a value type - can't think of it in `C`terms, comes out wrong |
00:11:53 | FromGitter | <arnetheduck> besides, you're showing the impl of a `seq` which is a different beast entirely |
00:14:35 | FromGitter | <zacharycarter> shashlick: I think I'm probably going to abandon using this lib for now so I can make progress on my game jam entry |
00:14:49 | FromGitter | <zacharycarter> but once I'm done with that I will eventually want to get it usable |
00:14:59 | FromGitter | <zacharycarter> or just port it entirely to Nim if possible |
00:19:30 | * | xet7 quit (Read error: Connection reset by peer) |
00:39:10 | * | d10n-work quit (Quit: Connection closed for inactivity) |
00:42:57 | * | citycide quit (Ping timeout: 252 seconds) |
00:43:24 | * | zachk quit (Quit: Leaving) |
00:45:19 | * | citycide joined #nim |
01:00:31 | shashlick | What isn't working for you right now |
01:08:07 | * | kapil____ quit (Quit: Connection closed for inactivity) |
01:27:02 | * | elrood quit (Remote host closed the connection) |
01:38:18 | * | tobbez quit (Ping timeout: 264 seconds) |
01:40:42 | * | theelous3_ quit (Ping timeout: 268 seconds) |
01:44:30 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
01:55:41 | * | tobbez joined #nim |
02:06:03 | FromGitter | <zacharycarter> shashlick: it's putting together a CI pipeline that will accommodate all the platforms I'm going to need to build this game for |
02:06:05 | FromGitter | <zacharycarter> for that library |
02:08:41 | FromGitter | <zacharycarter> I'll need to build for windows and probably linuux |
02:09:26 | FromGitter | <zacharycarter> I'm on osx - all those advanced instruction sets and varying compiler support make the prospect of building something in time, a scary onee |
02:28:47 | * | jjido quit (Ping timeout: 240 seconds) |
02:44:11 | * | Aareon_ quit (Ping timeout: 260 seconds) |
02:45:46 | * | Aareon_ joined #nim |
03:05:21 | * | banc quit (Quit: ZNC - http://znc.in) |
03:05:36 | shashlick | well i can help build when you need - i have both |
03:20:48 | * | banc joined #nim |
03:25:03 | FromGitter | <zacharycarter> thanks - I appreciate it. hopefully Ill end up having time to optimize |
03:31:46 | * | endragor joined #nim |
04:41:26 | * | chemist69 quit (Ping timeout: 260 seconds) |
04:42:15 | * | chemist69 joined #nim |
04:47:46 | * | Pisuke joined #nim |
04:48:36 | * | MyMind quit (Ping timeout: 252 seconds) |
05:02:21 | * | chemist69 quit (Ping timeout: 252 seconds) |
05:04:28 | * | chemist69 joined #nim |
05:17:03 | * | dddddd quit (Remote host closed the connection) |
05:28:24 | * | nsf joined #nim |
05:35:00 | * | kapil____ joined #nim |
06:12:41 | * | itschin joined #nim |
06:38:29 | * | darithorn quit () |
07:06:17 | * | krux02 joined #nim |
07:19:19 | * | Yardanico quit (Quit: Quitting) |
07:31:49 | FromGitter | <alehander42> Araq, what do you think about swift's ownership plans https://forums.swift.org/t/sil-ownership-model-proposal-refreshed/16872 (not sure if this is the most relevant link, but I just found they have such plans) |
07:35:05 | FromGitter | <narimiran> wow, my (six months old) article about python vs numpy vs nim has just been published in pycoder's weekly newsletter! |
07:35:42 | Araq | narimiran: nice :-) |
07:37:16 | FromGitter | <narimiran> i have no idea how and why did somebody notice it just now.... but i don't mind :) |
07:40:48 | * | NimBot joined #nim |
07:41:20 | Araq | alehander42: I don't understand it well enough to have an opinion about it |
07:42:29 | FromGitter | <gogolxdong> Anyone work on QUIC ? |
07:53:31 | * | PMunch joined #nim |
08:06:09 | FromGitter | <alehander42> Araq, me too, haha |
08:07:22 | FromGitter | <alehander42> btw what do you think about generational gc-s ? I was reading about the "young objects are collected much often than older ones" theory and I wondered if there is such an assumption in some of the nim gc |
08:07:55 | FromGitter | <xmonader> @kdheepak still suffering with openssl 1.1 on mac https://pastebin.com/raw/aft2paAw |
08:10:18 | Araq | generational GCs are nice but the occasional "full collection" means they have no benefit for realtime guarantees |
08:11:25 | * | vlad1777d quit (Ping timeout: 244 seconds) |
08:17:23 | * | floppydh joined #nim |
08:18:32 | * | xet7 joined #nim |
08:20:28 | * | chemist69 quit (Ping timeout: 250 seconds) |
08:21:01 | * | xet7 quit (Client Quit) |
08:21:24 | * | xet7 joined #nim |
08:21:36 | itschin | is it that the GC stops for a full collection or the time it takes? |
08:21:42 | * | chemist69 joined #nim |
08:27:20 | livcd | oh the pics from this article are gone : http://bootstrap.me.uk/programming-languages/2017/07/09/nim-for-the-discerning-rubyist.html. Anyone has them ? |
08:33:15 | PMunch | The wayback machine has a couple of them: https://web.archive.org/web/20180905055951/http://bootstrap.me.uk/programming-languages/2017/07/09/nim-for-the-discerning-rubyist.html |
08:36:36 | PMunch | And some of the scripts he for some reason decided to make images out of can probably be found on his GitLab page here: https://gitlab.com/users/RedFred7/snippets |
08:38:22 | Araq | itschin: depends on the implementation. for a good implementation it's mostly "CPU cycles spent"/power consumption |
08:39:08 | * | vlad1777d joined #nim |
08:39:44 | * | citycide quit (Remote host closed the connection) |
08:39:58 | * | citycide joined #nim |
08:40:52 | itschin | Araq: https://wiki.openjdk.java.net/display/zgc/Main |
08:40:57 | itschin | can you scale things like this down? |
08:43:11 | itschin | speaking generally, wondering if good things need economy of scale |
08:44:29 | Araq | "scale things down" -- to what. it will never run with e.g. 4MB of RAM |
08:46:45 | Araq | that doesn't make it a bad piece of technology, ofc |
08:50:08 | * | vlad1777d_ joined #nim |
08:54:13 | * | vlad1777d quit (Ping timeout: 268 seconds) |
09:21:26 | FromGitter | <narimiran> Araq: i see that the test for version-0-19 branch are now passing. do we backport some more (e.g. your yesterday's nimscript fix), or is 0.19.2 release nearby? |
09:29:32 | Araq | well we can release 0.19.2 anytime, but automated builds would be nice |
10:00:16 | FromGitter | <xmonader> ok i opened an issue no idea how to proceed https://github.com/nim-lang/Nim/issues/9641 |
10:05:02 | * | craigger_ joined #nim |
10:06:38 | * | craigger quit (Ping timeout: 244 seconds) |
10:11:48 | * | voiceftp quit (Ping timeout: 244 seconds) |
10:12:55 | * | voiceftp joined #nim |
10:18:47 | * | dom96_w joined #nim |
10:43:29 | FromGitter | <xmonader> @Araq are you using openssl 1.1.1 ? |
10:44:43 | Araq | dunno, how to find out? |
10:46:15 | FromGitter | <xmonader> openssl version |
10:56:06 | livcd | PMunch: thanks. Did not think about archive |
10:56:37 | FromGitter | <xmonader> how do i know the exact libraries version linked against in mac ? in case my passL is just wrong or ignored ? |
10:57:14 | FromGitter | <mratsim> ldd |
10:57:53 | FromGitter | <mratsim> ah no, otool -L |
10:58:13 | FromGitter | <mratsim> but Nim doesn’t link, it dlopens |
10:58:56 | FromGitter | <xmonader> @mratsim i see it only shows ``` otool -L zos ⏎ zos: ⏎ /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1) ⏎ MacBookPro:zos codescalers$ otool --help ⏎ ... [https://gitter.im/nim-lang/Nim?at=5be2c56fbb06d73a9937b039] |
10:59:09 | FromGitter | <xmonader> is there away to see the exact version opened in dlopens in nim? |
11:00:38 | * | jjido joined #nim |
11:02:06 | FromGitter | <mratsim> no idea :/ |
11:10:40 | Araq | strace it if osx has one |
11:13:12 | jjido | dtrace |
11:14:54 | FromGitter | <xmonader> yeah i'm searching how to use it .. only used ltrace and strace |
11:16:25 | leorize | you could just use `--dynlibOverrideAll` and use normal linking... |
11:20:52 | FromGitter | <xmonader> @leorize i get that https://pastebin.com/u6W1uRhh do i need to add the explicit paths again? |
11:22:09 | FromGitter | <xmonader> also with explicit paths ⏎ https://pastebin.com/PDV4Szwr |
11:30:10 | * | Vladar joined #nim |
11:43:56 | * | theelous3 joined #nim |
11:54:18 | FromGitter | <xmonader> @Araq I added dtruss logs too ⏎ https://github.com/nim-lang/Nim/issues/9641 |
12:11:27 | PMunch | Hmm, is there a way to pass a name, list of arguments, and body to a template? |
12:12:31 | PMunch | Basically what I want to do is this: http://ix.io/1rdW/Nim |
12:16:19 | * | jjido quit (Ping timeout: 244 seconds) |
12:44:49 | * | Snircle joined #nim |
12:53:46 | * | nsf quit (Quit: WeeChat 2.3) |
12:57:28 | leorize | xmonader: `--dynlibOverrideAll` just disable them |
12:57:35 | leorize | it doesn't pass any link flags |
12:57:40 | leorize | so you'd have to do so yourself |
12:58:09 | FromGitter | <xmonader> @leorize yeah i figured i passed the flags too https://pastebin.com/PDV4Szwr |
12:59:56 | leorize | I mean you'd have to pass the respective `-l` |
13:00:16 | leorize | in this case `-lssl -lcrypto -lpcre` |
13:06:41 | FromGitter | <kaushalmodi> Araq: May be I didn't understand the nightly build requirements entirely |
13:06:57 | FromGitter | <kaushalmodi> We now already have the nightly releases |
13:07:12 | FromGitter | <kaushalmodi> User just needs to download those and build locally |
13:07:53 | FromGitter | <kaushalmodi> What is missing (apart from creating the archive on Windows and getting koch testinstall to pass) |
13:08:17 | FromGitter | <kaushalmodi> A windows user can extract the Linux or os built release and build Nim locally right now. |
13:09:28 | FromGitter | <kaushalmodi> Also, I wouldn't be able to be much active here for the coming month; work load + long vacation |
13:11:13 | FromGitter | <kaushalmodi> livcd: interestingly I ended up on that missing pics blog earlier today, and emailed the author about that issue. So hopefully he fixes them soon. |
13:13:42 | Araq | kaushalmodi: I broke nightlies |
13:17:48 | * | platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:21:01 | FromGitter | <kaushalmodi> Hmm, let me see if I find time today. Travis debugs are huge time sinks. |
13:21:42 | livcd | kaushalmodi: doh i really dislike that irssi wont highlight me if you msg me via this gitter bridge :/ |
13:48:35 | * | platoff joined #nim |
13:56:38 | FromGitter | <xmonader> @leorize you're the man thanks |
14:00:38 | shashlick | @kaushalmodi that's what I'm doing on Travis but it will be nice to have binaries rather than source |
14:01:32 | * | itschin left #nim ("Leaving") |
14:01:56 | leorize | livcd: use weechat :) |
14:05:37 | FromGitter | <kaushalmodi> shashlick: I won't have time to go down the binary generation route any time soon. |
14:06:22 | * | endragor quit (Remote host closed the connection) |
14:06:48 | * | endragor joined #nim |
14:11:44 | * | endragor quit (Ping timeout: 276 seconds) |
14:12:41 | * | dddddd joined #nim |
14:20:16 | * | endragor joined #nim |
14:24:49 | * | couven92 quit (Read error: Connection reset by peer) |
14:25:00 | * | endragor quit (Ping timeout: 252 seconds) |
14:27:10 | * | dddddd quit (Remote host closed the connection) |
14:45:26 | * | platoff quit (Read error: Connection reset by peer) |
14:49:04 | * | platoff joined #nim |
14:49:57 | * | Aareon_ quit (Ping timeout: 252 seconds) |
14:50:55 | PMunch | Anyone knows how I can pass an argument list to a template? |
14:53:44 | * | Aareon_ joined #nim |
14:55:54 | FromGitter | <alehander42> what do u mean by arg list |
14:56:22 | PMunch | Basically I want to do this: http://ix.io/1rdW/Nim |
14:56:47 | FromGitter | <alehander42> ahhh |
14:56:55 | FromGitter | <alehander42> I am not sure if this is easily possible |
14:56:56 | PMunch | Have a template that creates a proc which has some common functionality, but which takes different arguments, and has a different main body |
14:58:38 | FromGitter | <alehander42> it doesn't work with "`arguments`" ? |
14:58:45 | FromGitter | <alehander42> ugh `` |
15:01:06 | PMunch | But how would I call it` |
15:01:08 | PMunch | ? |
15:04:37 | FromGitter | <alehander42> I just wonder if quoting arguments would somehow make it valid |
15:05:38 | Araq | use a macro |
15:21:43 | FromGitter | <kdheepak> @xmonader you may have already done this, but I'm curious if you get the same error if you try it without `--dynlibOverride:ssl`? |
15:24:01 | * | kapil____ quit (Quit: Connection closed for inactivity) |
15:50:44 | * | citycide quit (Ping timeout: 244 seconds) |
15:51:18 | * | citycide joined #nim |
16:02:17 | * | narimiran joined #nim |
16:05:12 | * | floppydh quit (Quit: WeeChat 2.3) |
16:16:31 | * | darithorn joined #nim |
16:46:01 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:47:20 | * | dom96_w joined #nim |
17:01:39 | * | dom96_w quit (Read error: Connection reset by peer) |
17:12:04 | * | platoff quit (Read error: Connection reset by peer) |
17:30:18 | xace | https://pastebin.com/EAxpUyZf can someone explain how i can get line 15 to accept the arrays by reference? |
17:32:20 | Araq | leave out the ': var' part |
17:32:30 | xace | Araq: will it implicitly conver it to a ref type? |
17:32:48 | Araq | no, Nim doesn't copy parameters unless that is faster |
17:33:01 | Araq | conceptually everything is passed as 'const &' in C++ terms |
17:33:13 | Araq | (unless it would be faster by copy) |
17:33:33 | * | vlad1777d_ quit (Ping timeout: 244 seconds) |
17:36:08 | * | endragor joined #nim |
17:36:26 | xace | Araq: Alright I'll interpret it as: when I send immutable objects to procedures, it may be sent as a `const &` if its faster than copy. |
17:37:38 | xace | Second question: In my example, does this also mean I have to change the arrays into seq[] ? as it is now it wont accept a array[2,string] vs array[3,string] |
17:38:28 | narimiran | xace: `openArray` to the rescue |
17:43:53 | xace | narimiran: found openArray in the manual but cant figure out how to initialize it, and the link to the Source doesnt point to the type definition afaik |
17:44:35 | xace | const example: openArray[string] = {"a","b","c"} #doesn't compile |
17:44:55 | narimiran | xace: you use openarray only as a parameter in your function. it is basically shorthand for "i don't care if you give me seq, array or even string" |
17:45:28 | narimiran | so your `const example` remains defined as array |
17:46:01 | narimiran | but your proc is now: `proc extIsMedia(extension: string,filter: openArray[string]): bool` |
17:46:08 | xace | narimiran: wow, i would've never figured that one out |
17:46:20 | narimiran | xace: that's why we're here ;) |
17:46:35 | xace | so openArray[] is meant for procedure parameters? |
17:46:47 | narimiran | yes |
17:46:50 | xace | as a common way to wrap generics arrays/sequence? |
17:48:21 | * | endragor quit (Remote host closed the connection) |
17:50:17 | xace | yeah, seems like it after re-reading the manual |
17:50:51 | * | endragor joined #nim |
17:51:54 | * | endragor quit (Remote host closed the connection) |
17:55:07 | * | wildlander joined #nim |
18:00:32 | * | jjido joined #nim |
18:04:24 | * | Vladar quit (Remote host closed the connection) |
18:05:44 | * | Vladar joined #nim |
18:07:02 | * | theelous3 quit (Ping timeout: 276 seconds) |
18:10:00 | * | nsf joined #nim |
18:14:36 | * | jjido quit (Ping timeout: 260 seconds) |
18:18:25 | * | zachk joined #nim |
18:19:25 | * | zachk quit (Read error: Connection reset by peer) |
18:19:47 | * | zachk joined #nim |
18:23:15 | * | zachk quit (Changing host) |
18:23:15 | * | zachk joined #nim |
18:25:21 | * | rnrwashere joined #nim |
18:26:25 | * | theelous3_ joined #nim |
18:27:33 | * | rnrwashere quit (Client Quit) |
18:34:51 | * | jjido joined #nim |
18:42:01 | * | rlr quit (Quit: quitting) |
18:51:50 | * | Vladar quit (Remote host closed the connection) |
18:53:47 | * | rlr joined #nim |
18:53:48 | * | jlhouchin joined #nim |
19:05:43 | * | Aareon_ quit (Quit: Quit) |
19:06:49 | martin1_ | PMunch: I was trying nimlsp out and I can't get past the time outs.. running it debug mode shows results for completions (for example) and they are found quite fast, but still the client isn't able to show them and times out.. any ideas? maybe it's some parsing issue or something? |
19:08:18 | PMunch | Hmm, that sounds strange |
19:08:22 | PMunch | What client are you using? |
19:08:53 | martin1_ | I'm on neovim, so I'm using LanguageClient-neovim |
19:09:54 | * | jjido quit (Read error: Connection reset by peer) |
19:09:58 | FromGitter | <xmonader> @kdheepak I believe it failed because it'll also need to override libcrypto |
19:10:11 | PMunch | Hmm, so far I've only tried it with Sublime |
19:10:18 | PMunch | Just to not bork up Vim :P |
19:12:20 | PMunch | Maybe it's missing a newline or something.. |
19:12:36 | PMunch | Which Sublime just ignores |
19:12:39 | PMunch | I'll look into it |
19:20:07 | * | PMunch quit (Quit: Leaving) |
19:32:10 | martin1_ | it definitely is an issue with the deserializing, the error seems to be coming from serde_json, which is used by LanguageClient-neovim, it isn't really a useful error, but what I get is "expected ident a line 1 column 2", I'll try to dig deeper and see if I find something |
19:50:22 | * | smt joined #nim |
19:51:29 | * | dddddd joined #nim |
19:57:55 | FromGitter | <Varriount> xace: openarray is also used to pass slices of strings/sequences/arrays via toOpenAray |
19:58:55 | FromGitter | <kayabaNerve> If my program is completely async, and I want to run every 10 seconds, I should call X (without using await) and have that proc call asyncSleep(10000), right? |
19:59:20 | FromGitter | <kayabaNerve> (while true: asyncSleep 10 secs; do stuff) |
20:01:30 | Araq | sounds about right |
20:04:34 | FromGitter | <kayabaNerve> Yep. Thanks. |
20:07:42 | FromGitter | <arnetheduck> @krux02 https://github.com/nim-lang/Nim/pull/9635 passes now, in case you feel like doing a quick merge |
20:08:25 | krux02 | done |
20:08:29 | FromGitter | <arnetheduck> gracias |
20:09:16 | krux02 | thank you! I like when cruft is removed. |
20:10:26 | FromGitter | <arnetheduck> there's one refactoring idea from `nlvm` I've been thinking about porting over to `nim` as well - for every node type, there's basically a `proc` handling it.. in `nlvm` I've consistently named them after the node they handle which makes for some nice grepping (ie `nkSym` is processed by `genNodeSym`) - likewise for magics.. this would be really nice to see in the c/js backends as well |
20:12:47 | FromGitter | <arnetheduck> that - and join ccgexprs/ccgstmts.nim - they're used as includes anyway, and since the expr/stmt difference was mostly refactored away at some point, it would make finding stuff slightly easier, I believe |
20:20:17 | Araq | if we do that we can also replace the 'case' statement with a macro :P |
20:21:44 | * | avsej quit (Quit: Quit) |
20:21:56 | * | avsej joined #nim |
20:21:56 | * | avsej quit (Changing host) |
20:21:56 | * | avsej joined #nim |
20:24:04 | FromGitter | <arnetheduck> can and should are different beasts :) |
20:27:33 | Araq | it's called "DRY" and "automation" |
20:29:28 | FromGitter | <arnetheduck> "rube goldberg" comes to mind - there's also the downside of not being able to grep for where stuff is being called from which leaves a bad taste |
20:29:46 | FromGitter | <arnetheduck> (once you start getting too clever) |
20:31:57 | FromGitter | <arnetheduck> btw, I was under the impression that `func` and `proc nosideeffects` should be equivalent - not so it seems - wrote a little`sed` script that does the transformation, but it results in weird overload resolution issues.. ideas? |
20:32:45 | FromGitter | <arnetheduck> ie running it on `system.nim` breaks a fair bit of stuff, even if it shouldn't |
20:34:48 | FromGitter | <arnetheduck> .. which would be a way to move forwards with https://github.com/nim-lang/Nim/pull/9029 - seems kind of weird to introduce a feature that saves typing and makes the language safer and easier to reason about, and then *not* use it in the std lib |
20:35:09 | Araq | "how to grep for it" is my approach how to do language design |
20:35:13 | Araq | *is not |
20:36:38 | FromGitter | <arnetheduck> nonetheless, text is king, as they say, and the fewer custom tools needed, the easier it is to jump into getting stuff done |
20:37:36 | Araq | as for your question, I don't know, maybe 'sed' is as terrible as I always thought it to be |
20:38:39 | FromGitter | <arnetheduck> in this case it's pretty accurate actually, which is why I was surprised |
20:39:24 | Araq | "and then *not* use it in the std lib" well the existing codebase doesn't use it and some scream "consistency" all day long |
20:39:51 | krux02 | Araq: sed is the tool to go if you want to change the licese information in all source files of a project. I've done it. But sure it's not really for data that isn't text. |
20:40:36 | Araq | really? can sed do --confirm? no? they I stick with nimgrep, thank you very much |
20:41:25 | Araq | *then |
20:43:36 | FromGitter | <arnetheduck> sed or not aside, the errors I get are all around overload resolution and the like, it seems.. ie if forward declaration and implementation don't match, or if there are several overloads where some are proc and some are func, it all breaks down |
20:44:12 | Araq | well if they don't match, you have 2 procs instead of one |
20:45:21 | FromGitter | <arnetheduck> well.. not really: |
20:46:08 | FromGitter | <arnetheduck> ```code paste, see link``` ⏎ ⏎ if the first equalmem is turned into a `func`, this breaks [https://gitter.im/nim-lang/Nim?at=5be34f10bb06d73a993b6409] |
20:46:23 | Araq | procfind.nim, line 70 |
20:47:02 | Araq | the algorithm isn't aware of skFunc == skProc for forwarding detection |
20:47:07 | Araq | so you need to be consistent |
20:47:39 | FromGitter | <arnetheduck> yeah, but the same happens for overload resolution.. ie `$` or `==` break as well |
20:47:43 | * | surma__ quit (Ping timeout: 252 seconds) |
20:47:43 | * | euantor quit (Ping timeout: 252 seconds) |
20:47:58 | * | zielmicha__ quit (Read error: Connection reset by peer) |
20:48:16 | * | sz0 quit (Ping timeout: 252 seconds) |
20:48:16 | * | r4vi quit (Ping timeout: 252 seconds) |
20:48:16 | * | fowl quit (Ping timeout: 252 seconds) |
20:48:25 | * | mids joined #nim |
20:48:40 | * | federico3 quit (Remote host closed the connection) |
20:48:58 | * | zielmicha__ joined #nim |
20:49:11 | * | euantor joined #nim |
20:49:15 | * | surma__ joined #nim |
20:49:15 | * | r4vi joined #nim |
20:49:17 | * | fowl joined #nim |
20:49:31 | FromGitter | <arnetheduck> so basically what you're saying is that they're not equivalent |
20:49:49 | * | federico3 joined #nim |
20:49:51 | * | sz0 joined #nim |
20:50:06 | * | nsf quit (Quit: WeeChat 2.3) |
20:50:27 | * | couven92 joined #nim |
20:50:54 | martin1_ | PMunch: found the issue! really simple solution, submitted a PR! |
20:52:12 | FromGitter | <arnetheduck> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5be3507cf1b87534048e6d40] |
20:53:02 | FromGitter | <arnetheduck> this should print `f ` twice (because `proc x` has side effects, potentially) |
20:53:42 | FromGitter | <arnetheduck> or it should give an error, depending on when overload resolution happens |
20:56:01 | Araq | that's not what the spec says |
20:56:59 | Araq | debugecho is not a side-effect and for procs the .noSideEffect is inferred, hence your example compiles |
20:58:12 | FromGitter | <arnetheduck> oh, it's inferred? that's.. unexpected. |
21:11:53 | FromGitter | <arnetheduck> it also seems.. inconsistent.. ie after fixing a few of those proc/func definition / declarations so they all become func, I now get ``` |
21:12:16 | FromGitter | <arnetheduck> ```lib/pure/strutils.nim(798, 6) Error: 'split' can have side effects``` |
21:13:07 | * | narimiran quit (Remote host closed the connection) |
21:13:21 | benjikun | Does anyone here have any suggestions about what I should add to https://github.com/ijneb/nimetry |
21:14:37 | * | martin1__ joined #nim |
21:17:08 | * | martin1__ quit (Client Quit) |
21:19:34 | FromGitter | <arnetheduck> the inferring is weird.. it basically means that in a `func` I can call bunch of procs that someone explicitly declared as having side effects (by choosing to use the `proc` keyword over `func`), then have my code break when they change the implementation (!) |
21:20:27 | Araq | yes (!), that is true for all inferred effects. |
21:26:07 | Araq | 'func' is what the community wanted :-) |
21:26:31 | krux02 | I like func |
21:26:43 | krux02 | but I don't use it |
21:26:48 | krux02 | I like to know that it exists |
21:27:27 | Araq | I would throw away Nim's effect system, but I have said it before and not many agree with me |
21:28:01 | benjikun | What do you guys mean when you say `effects` |
21:28:10 | krux02 | side effect checking |
21:28:50 | FromGitter | <arnetheduck> hm. that significantly decreases the "power" of func however. sad. |
21:29:31 | * | kapil____ joined #nim |
21:32:04 | FromGitter | <arnetheduck> `func`, `let`, `discard` etc - all these are features that promote good defaults and limit the surface area of things that can go wrong.. I like that nim has escape hatches that allow each of these to be avoided, but they're also tools that tremendously help when optimizing for maintainability and refactoring, which is why I'm sad |
21:32:33 | benjikun | So using func is just generally more performant? |
21:32:37 | Araq | well write an RFC, we can turn .noSideEffect into "Not inferred" or something |
21:33:12 | Araq | but not inferring things comes with its own problems, like the well-known ripple effects |
21:33:21 | krux02 | benjikun, no it's not |
21:33:54 | krux02 | func is just activating nim to check that you don't get side effects. Side effect free code is generally more maintainable. |
21:34:00 | krux02 | but not faster |
21:34:08 | benjikun | oh, I see |
21:34:12 | benjikun | ty |
21:34:48 | FromGitter | <arnetheduck> benjikun, depends how you look at it.. it's a semantic difference - that said, the compiler can sometimes use that knowledge in optimizations |
21:35:14 | benjikun | interesting |
21:35:26 | Demos[m] | well if the compiler can use it in optimization it could before adding the func / {.noSideEffects.} annotation, since it's checked anyways |
21:36:28 | Araq | that's true but IMO if you wanna optimize, give the compiler an optimizer, don't introduce cargo-cultish programming language features |
21:37:38 | FromGitter | <arnetheduck> krux02, well, there are several optimizations that are safe only in a side-effect-free world.. ie loop hoisting etc, and `func` could potentially convey that meaning in places where it cannot be inferred (shared libs? importc?) |
21:38:19 | benjikun | Araq: So you're against the func keyword? |
21:38:38 | FromGitter | <arnetheduck> so I see pragmas mostly as a feature for the latter case - ie when the compiler cannot possibly know and you want to pass it a hint.. whereas func vs proc is about telling your fellow programmer a story |
21:39:11 | Araq | benjikun: yeah but I'm in a minority |
21:39:45 | benjikun | hm |
21:40:03 | Araq | and it is sexy, so ... we have no choice but to make it work well |
21:40:33 | Araq | well we'll see. |
21:41:31 | Araq | one easy solution: func can only call 'func', proc with inferred .noSideEffect doesn't count |
21:41:54 | Araq | but then you have to patch the whole stdlib as arnetheduck is trying to do |
21:47:01 | FromGitter | <arnetheduck> araq, that's how I thought it worked ;) well, func can call func or explicitly annotated proc |
21:55:14 | * | martin1__ joined #nim |
21:58:37 | * | martin1_1 joined #nim |
22:01:07 | * | martin1__ quit (Ping timeout: 240 seconds) |
22:06:15 | FromGitter | <rayman22201> @araq what is wrong with the effect system? |
22:07:24 | Araq | given its complexity, it doesn't catch enough bugs |
22:07:41 | Araq | it's a programming placebo. |
22:09:05 | Araq | some effects are essential for Nim to work at all though, like .gcsafe |
22:10:32 | Araq | and the locking levels for compile-time deadlock prevention is an under-used/developed feature too |
22:13:45 | FromGitter | <rayman22201> I think the locking levels feature is under-used because Nim is under used for systems programming lol :-P |
22:14:37 | FromGitter | <arnetheduck> https://github.com/nim-lang/Nim/pull/9646 - not sure this is a brilliant idea right now though, will probably wreak havoc with open pull requests |
22:27:31 | * | vlad1777d_ joined #nim |
22:55:57 | * | jlhouchin quit (Quit: Leaving) |
23:01:13 | FromGitter | <tim-st> PMunch: maybe you need this for your lsp server: https://gist.github.com/tim-st/df0ce1c4b712abe7d4e2a90f0b8c78a2 |
23:04:53 | * | mids quit (Quit: Connection closed for inactivity) |
23:24:28 | * | zachk quit (Remote host closed the connection) |
23:24:55 | * | zachk joined #nim |
23:30:28 | * | zachk quit (Read error: Connection reset by peer) |
23:30:59 | * | zachk joined #nim |
23:43:05 | Araq | oh lol my 'not' fix doesn't work with 'not nil' |
23:51:07 | FromGitter | <kaushalmodi> May be wrapping that not nil in parens would work? |
23:57:36 | * | smt quit (Ping timeout: 260 seconds) |