00:17:40 | FromGitter | <gogolxdong> @AlexMax, how to fix this line var sym = evt[].key.keysym.sym? It compiles on windows, but doesn't on linux. |
00:19:28 | * | vegiiCv joined #nim |
00:24:30 | * | xet7 quit (Quit: Leaving) |
00:26:43 | * | vegiiCv quit (Remote host closed the connection) |
00:40:43 | * | pihlstroVs joined #nim |
00:45:37 | * | endragor joined #nim |
00:46:41 | * | pihlstroVs quit (Killed (Sigyn (Spam is off topic on freenode.))) |
00:48:51 | * | endragor quit (Remote host closed the connection) |
00:49:24 | * | endragor joined #nim |
00:53:57 | * | endragor quit (Ping timeout: 252 seconds) |
01:06:52 | * | survietaminegG joined #nim |
01:07:26 | * | survietaminegG quit (Remote host closed the connection) |
01:12:06 | * | abm quit (Read error: Connection reset by peer) |
01:15:16 | * | adhawkinslG joined #nim |
01:16:53 | * | adhawkinslG quit (K-Lined) |
01:17:15 | * | floppydh quit (Ping timeout: 268 seconds) |
01:19:11 | * | floppydh joined #nim |
01:24:02 | * | disruptek quit (Quit: Page closed) |
01:42:50 | * | kolorafa joined #nim |
01:48:05 | * | kolorafa quit (Remote host closed the connection) |
01:58:46 | * | kapil____ joined #nim |
01:59:23 | FromGitter | <gogolxdong> How to convert array[256,char] to string? |
02:22:23 | leorize | write a custom `$` for it? |
02:22:50 | leorize | or if that array is null terminated, you could cast it to a cstring then `$` it to get a string |
02:36:51 | shashlick | ``` |
02:36:51 | shashlick | var a: array[3, char] = ['a', 'b', '\0'] |
02:36:54 | shashlick | echo $(cast[cstring](addr a)) |
02:36:55 | shashlick | ``` |
02:36:57 | shashlick | @gogolxdong |
02:40:39 | * | endragor joined #nim |
02:43:33 | * | endragor_ joined #nim |
02:45:03 | * | endragor quit (Ping timeout: 252 seconds) |
02:45:36 | AlexMax | I could've sworn that something was added to 0.19.0 that wrapped a ptr, length combination in a type |
02:45:55 | AlexMax | something like a gsl::span |
02:52:22 | * | rockcavera quit (Remote host closed the connection) |
02:57:52 | * | rockcavera joined #nim |
03:47:10 | AlexMax | https://github.com/nim-lang/Nim/issues/9001 |
03:47:46 | * | chemist69 quit (Ping timeout: 260 seconds) |
03:48:07 | AlexMax | hope something like this gets added |
03:49:31 | * | chemist69 joined #nim |
03:54:26 | * | smt quit (Read error: Connection reset by peer) |
04:15:03 | * | btbytes quit (Ping timeout: 245 seconds) |
04:30:33 | * | gangstacat quit (Ping timeout: 252 seconds) |
04:45:20 | * | francisl quit (Quit: francisl) |
04:51:19 | * | shpx joined #nim |
04:51:29 | * | shpx quit (Client Quit) |
04:57:28 | * | btbytes joined #nim |
05:03:35 | * | darithorn quit (Quit: Konversation terminated!) |
05:08:14 | * | narimiran joined #nim |
05:21:27 | * | leorize quit (Ping timeout: 252 seconds) |
05:33:44 | * | dddddd quit (Remote host closed the connection) |
05:40:39 | * | nsf joined #nim |
05:44:35 | * | leorize joined #nim |
06:00:40 | * | jjido joined #nim |
06:06:41 | * | Trustable joined #nim |
06:07:54 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
06:15:54 | * | narimiran quit (Ping timeout: 252 seconds) |
06:34:23 | * | Trustable quit (Remote host closed the connection) |
06:51:17 | tankf33der | shashlick: thanks for monocypher, works. |
07:08:00 | * | Tanger quit (Quit: Leaving) |
07:14:29 | * | cstaeth_ joined #nim |
07:18:58 | * | mr_yogurt_ joined #nim |
07:19:30 | * | Yardanico quit (*.net *.split) |
07:19:30 | * | mr_yogurt quit (*.net *.split) |
07:19:30 | * | JStoker quit (*.net *.split) |
07:19:30 | * | def- quit (*.net *.split) |
07:19:30 | * | cstaeth quit (*.net *.split) |
07:19:31 | * | dada78641 quit (*.net *.split) |
07:31:15 | * | Tanger joined #nim |
07:32:46 | * | Yardanico joined #nim |
07:32:46 | * | JStoker joined #nim |
07:32:46 | * | def- joined #nim |
07:32:46 | * | dada78641 joined #nim |
07:39:21 | FromGitter | <kdheepak> Is there a built in macro that does essentially this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb472295331811c2e40e376] |
07:40:17 | FromGitter | <kdheepak> I find that I use this extensively, and if it doesn't exist I think it might make a valuable addition to the language. |
07:50:06 | Tanger | Oooh, that is a handy macro kdheepak |
07:51:48 | * | zahary_ joined #nim |
07:53:08 | * | Tanger quit (Quit: Leaving) |
07:55:42 | * | PMunch joined #nim |
08:03:42 | * | gmpreussner_ joined #nim |
08:03:46 | * | floppydh quit (Quit: WeeChat 2.2) |
08:03:47 | * | gmpreussner quit (Ping timeout: 252 seconds) |
08:03:57 | * | floppydh joined #nim |
08:09:47 | * | Vladar joined #nim |
08:13:56 | * | Yardanico quit (*.net *.split) |
08:13:56 | * | JStoker quit (*.net *.split) |
08:13:56 | * | def- quit (*.net *.split) |
08:13:56 | * | dada78641 quit (*.net *.split) |
08:17:12 | FromGitter | <alehander42> @kdheepak look at dump from sugar |
08:17:58 | FromGitter | <gogolxdong> Does Nim support IPv6 on windows? |
08:17:58 | FromGitter | <alehander42> but I think it might work only for one expression (dump) |
08:18:28 | * | PyroLagusPO joined #nim |
08:20:25 | FromGitter | <kdheepak> Thanks @Tanger. I think it can be cleaned up more. For e.g., if we have the following: ⏎ ⏎ ```x: hello world``` [https://gitter.im/nim-lang/Nim?at=5bb47b85c08b8b3067c5e002] |
08:20:58 | FromGitter | <kdheepak> I'll take a look @alehander42 |
08:24:37 | * | PyroLagusPO quit (Remote host closed the connection) |
08:27:14 | Araq | gogolxdong, I am quite sure it does |
08:27:17 | * | Yardanico joined #nim |
08:27:18 | * | JStoker joined #nim |
08:27:18 | * | def- joined #nim |
08:27:18 | * | dada78641 joined #nim |
08:27:39 | * | xet7 joined #nim |
08:35:30 | FromGitter | <gogolxdong> yes, is there anything to take care to set up an pair of IPv6 client and server? client is as follows: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ there is an example server of asyncnet module listening on this IP of another computer. [https://gitter.im/nim-lang/Nim?at=5bb47f525af48530685341f6] |
08:36:44 | FromGitter | <gogolxdong> got messy code ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb47f9c5331811c2e413b62] |
08:51:30 | * | Yardanico quit (*.net *.split) |
08:51:30 | * | JStoker quit (*.net *.split) |
08:51:30 | * | def- quit (*.net *.split) |
08:51:30 | * | dada78641 quit (*.net *.split) |
08:56:18 | * | leorize quit (Ping timeout: 252 seconds) |
08:58:01 | * | hringriinxr joined #nim |
08:58:46 | * | McSoFake joined #nim |
09:01:00 | FromGitter | <gogolxdong> in a LAN |
09:01:05 | * | hringriinxr quit (Remote host closed the connection) |
09:05:08 | * | Yardanico joined #nim |
09:05:08 | * | JStoker joined #nim |
09:05:08 | * | def- joined #nim |
09:05:08 | * | dada78641 joined #nim |
09:13:41 | * | thecliguyHJ joined #nim |
09:13:55 | * | thecliguyHJ quit (Read error: Connection reset by peer) |
09:25:52 | FromGitter | <mratsim> @dom96, re: ad2, the fact that people can reimplement async without needing to dive into the compiler is good, and yeah I know you put a lot of time in it but hopefully both can cross-pollinate some ideas. |
09:29:37 | * | viatsko__ joined #nim |
09:30:01 | * | viatsko__ quit (Remote host closed the connection) |
09:37:49 | * | kapil____ quit (Quit: Connection closed for inactivity) |
09:49:23 | * | bdtmR joined #nim |
09:54:57 | * | bdtmR quit (Remote host closed the connection) |
09:56:35 | PMunch | I've split my options PRs into four separate ones now: https://github.com/nim-lang/Nim/pull/8358#issuecomment-426577549 |
10:02:22 | FromGitter | <narimiran> PMunch: securing that hacktoberfest t-shirt, huh? :D :D |
10:02:35 | FromGitter | <mratsim> busted |
10:06:29 | PMunch | Haha, I actually thought of that after doing the split |
10:06:35 | PMunch | But yeah, I'm just 1 PR away now :P |
10:20:32 | FromGitter | <mratsim> just PR in your own repo, or do silly stuff like this smart guy did: https://github.com/Microsoft/LightGBM/pull/1720 |
10:21:24 | * | craigger quit (Quit: bye) |
10:21:43 | * | craigger joined #nim |
10:24:19 | FromGitter | <narimiran> this year they explicitly ask you not to do stuff like that |
10:31:38 | * | SenasOzys quit (Ping timeout: 268 seconds) |
10:40:17 | FromGitter | <alehander42> on the other hand, what kind of hackX would it be without people trying to game the system |
10:51:23 | * | taleonsl joined #nim |
10:52:49 | * | taleonsl quit (Remote host closed the connection) |
10:56:25 | * | elrood joined #nim |
11:10:04 | FromGitter | <gogolxdong> Is there an example of IPv6 listening and access? |
11:11:23 | FromGitter | <tim-st> does someone know how to dispatch a command `a` using the name `b` in `cligen`? |
11:11:43 | FromGitter | <tim-st> I only saw alias for variables... |
11:11:47 | PMunch | By renaming it to b? |
11:11:57 | FromGitter | <tim-st> that's exactly what I dont want |
11:12:06 | PMunch | I was just joking |
11:12:18 | PMunch | You could probably wrap it in a template |
11:12:40 | FromGitter | <tim-st> `dispatchMulti([startZimHttpServer, cmdName="server"])` seems to get recognized but fails if I actually run it using the alias |
11:12:58 | PMunch | Hmm, that might be an issue then |
11:13:08 | FromGitter | <tim-st> ok, thanks |
11:14:12 | * | leorize joined #nim |
11:18:34 | * | ocelotsloth joined #nim |
11:23:01 | FromGitter | <gogolxdong> the messy code is ⏎ Error: unhandled exception: Resource temporarily unavailable [OSError] ⏎ Error: execution of an external program failed: '/mnt/d/nimnuklear/demo/sdl_opengl3/client ' ⏎ on linux [https://gitter.im/nim-lang/Nim?at=5bb4a694ae7be94016f5133a] |
11:32:45 | shashlick | dom96: nimble is no longer copying all artifacts on install, has something changed in 0.9.0? |
11:33:04 | shashlick | Try the libsvm package for example |
11:36:29 | * | tzui joined #nim |
11:37:50 | * | ocelotsloth quit (Remote host closed the connection) |
11:38:53 | PMunch | shashlick, you mean how it doesn't take readme and license for example? |
11:38:56 | FromGitter | <mratsim> yes, that was breaking CI when you needed to pass custom flags |
11:39:41 | FromGitter | <mratsim> ah no copying, what changed is that it doesn’t try to compile when doing nimble install, not sure about copying but we had some issues with git submodules and nimble |
11:44:05 | * | tzui quit (Ping timeout: 256 seconds) |
11:46:18 | * | SenasOzys joined #nim |
11:50:38 | shashlick | Well it copied libsvm.nim but not libsvm/* which is created by nimgen |
11:50:57 | shashlick | Used to work before |
11:51:45 | shashlick | libsvm.nim simply included files from the subdirectory which also contained the actual C++ source code |
11:57:53 | FromGitter | <mratsim> are you using `srcDir = [“libsvm”]` or the skipDir version? |
12:02:31 | shashlick | Latter |
12:02:34 | shashlick | https://github.com/genotrance/libsvm/blob/master/libsvm.nimble |
12:06:57 | * | SenasOzys quit (Quit: Leaving) |
12:10:41 | FromGitter | <gogolxdong> It works. |
12:11:07 | FromGitter | <gogolxdong> on windows IPV6 |
12:13:01 | shashlick | Try pure 0.19.0 install |
12:13:17 | shashlick | Fails on appveyor but passes for me as well locally |
12:13:34 | shashlick | Fails on Linux for sure |
12:21:01 | FromGitter | <gogolxdong> @AlexMax How do you fix evt[].key.keysym.sym , it worked until it didn't. |
12:21:43 | * | xet7 quit (Quit: Leaving) |
12:25:46 | * | tzui joined #nim |
12:29:59 | * | tzui quit (Ping timeout: 256 seconds) |
12:33:29 | * | krux02 joined #nim |
12:34:43 | * | abm joined #nim |
12:40:02 | * | krux02 quit (Remote host closed the connection) |
12:41:17 | * | xet7 joined #nim |
12:41:46 | * | ocelotsloth joined #nim |
12:42:30 | FromGitter | <kdheepak> I'm getting a clang error: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb4b9365331811c2e42ae8f] |
12:42:38 | FromGitter | <stvnfx> hey guys |
12:43:44 | * | dddddd joined #nim |
12:52:49 | * | MegafIp joined #nim |
12:56:25 | * | MegafIp quit (Remote host closed the connection) |
12:56:42 | * | McSoFake quit (Ping timeout: 252 seconds) |
13:05:51 | * | endragor_ quit (Remote host closed the connection) |
13:07:27 | * | krux02 joined #nim |
13:14:48 | * | noonien joined #nim |
13:21:04 | * | SimAV_tesla joined #nim |
13:22:05 | * | francisl joined #nim |
13:22:44 | * | stefanos82 joined #nim |
13:25:53 | * | erratic quit (Ping timeout: 276 seconds) |
13:27:22 | * | SimAV_tesla quit (Remote host closed the connection) |
13:31:29 | * | endragor joined #nim |
13:35:42 | * | endragor quit (Ping timeout: 252 seconds) |
13:36:31 | * | tefter joined #nim |
13:47:19 | * | ocelotsloth quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:54:13 | * | ocelotsloth joined #nim |
13:55:41 | * | rokups joined #nim |
13:57:04 | * | nsf quit (Quit: WeeChat 2.2) |
13:57:26 | FromGitter | <rokups> what on earth is going on here? string slicing seems to corrupt strings. https://ideone.com/kMEYjX |
13:57:39 | * | ocelotsloth quit (Client Quit) |
13:58:00 | FromGitter | <rokups> bleh nvm that |
13:58:24 | * | ocelotsloth joined #nim |
14:02:27 | * | Taylor__ joined #nim |
14:03:22 | * | voice_ftp joined #nim |
14:03:40 | * | PrimHelios quit (Read error: Connection reset by peer) |
14:03:40 | * | voiceftp quit (Remote host closed the connection) |
14:04:21 | * | gsingh93 quit (Ping timeout: 260 seconds) |
14:07:46 | * | gsingh93 joined #nim |
14:08:17 | * | auvigaQM joined #nim |
14:12:41 | * | auvigaQM quit (Remote host closed the connection) |
14:18:02 | FromGitter | <tim-st> you are slicing on ascii |
14:18:24 | * | WanderingGlitchw joined #nim |
14:20:20 | FromGitter | <tim-st> `echo "“".len` |
14:20:25 | FromGitter | <rokups> yeah.. i realized that. although problem originated from my `ustring`. something broke and now invoking slicing operator on `ustring` for some reason ignores operator defined for that type and calls operator defined for `string` which again slices ascii |
14:20:47 | * | WanderingGlitchw quit (Remote host closed the connection) |
14:20:55 | FromGitter | <rokups> every time i come back to nim some basic thing is broken once again.. |
14:21:07 | FromGitter | <tim-st> and `echo "ą".len` |
14:21:48 | FromGitter | <rokups> and if that wasnt enough - minimal testcase that is supposed to reproduce issue is working fine. so i guess ill just not deal with this issue and call it a day.. |
14:22:31 | FromGitter | <tim-st> your slicing is just wrong: |
14:22:33 | FromGitter | <tim-st> var src2 = "ąčęėįšųū„“" ⏎ doAssert src2[2..^4] == expect |
14:22:59 | FromGitter | <tim-st> If you dont know the width of each unicode Rune uses `unicode.runes` instead |
14:24:04 | FromGitter | <rokups> yeah that sample is wrong. but from my `ustring` lib is actually `doAssert u"ąčęėįšųū„“"[1..^2] == "čęėįšųū„"`. note `u` prefix which convers string to `ustring` type, and that type has utf8-aware slicing operator which does not get called |
14:24:20 | FromGitter | <rokups> instead standard slicing operator for `string` is used which is wrong ofc |
14:24:38 | FromGitter | <tim-st> ok, so it's not a nim problem? |
14:25:07 | FromGitter | <rokups> nim does not call `proc `[]`*(s: ustring, slice: Slice[int]): ustring` operator. it is nim problem |
14:25:43 | elrood | that's just what you have to deal with when using a new language with very little manpower behind it, rokups |
14:27:29 | FromGitter | <rokups> and scope too big for available hands yep |
14:27:43 | FromGitter | <gogolxdong> How to statically link SDL2.dll ? |
14:27:56 | PMunch | rokups, where is that defined? And how should Nim know not to call the string slice procedure in your case |
14:28:03 | Tortice | --passL="-static" ? |
14:28:19 | elrood | you cannot statically link a .dll |
14:28:45 | FromGitter | <tim-st> PMunch: https://github.com/rokups/nim-ustring/blob/master/ustring.nim |
14:29:02 | FromGitter | <rokups> to be specific: https://github.com/rokups/nim-ustring/blob/master/ustring.nim#L550 |
14:29:32 | PMunch | Aah, I thought the code example you posted was complete |
14:29:53 | FromGitter | <rokups> nah, sorry, thats a wrong example to begin with :) |
14:31:08 | * | krux02 quit (Remote host closed the connection) |
14:34:27 | PMunch | Isn't that because the type is actually a HSlice[int, BackwardsIndex] in that case? |
14:34:32 | PMunch | And not a HSlice[int,int] |
14:34:37 | PMunch | ie. a Slice[int] |
14:35:12 | FromGitter | <tim-st> but the compiler shouldnt fall back to the other `[]` though, because it's defined as `distinct string` |
14:35:38 | FromGitter | <rokups> there is an alias: `Slice*[T] = HSlice[T, T]` |
14:35:59 | PMunch | Yeah but HSlice[int, BackwardsIndex] isn't HSLice[T,T] |
14:36:09 | FromGitter | <rokups> oh |
14:36:10 | PMunch | tim-st, that's a good point.. |
14:36:36 | FromGitter | <rokups> guess that was intended breaking change and i need to handle `BackwardsIndex` |
14:36:43 | PMunch | Yes |
14:37:03 | FromGitter | <rokups> *deep breath* ⏎ thanks :) |
14:39:24 | * | ocelotsloth quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:39:54 | FromGitter | <dom96> shashlick: hrm. Possibly a bug, please report it. |
14:40:41 | FromGitter | <dom96> Note that nimble now tries to guess your package structure so that most packages "just work" instead of getting a warning. |
14:42:09 | shashlick | dom96: do you think there's any workaround? |
14:43:15 | PMunch | rokups, just tested and it seems to be the case. The reason it falls back to the string slicing operation is the converter on line 407 which auto-converts a ustring to string. So it can't find a matching [] slicing operation for ustring, so it tries to convert to a string and calls the string [] slicing instead. |
14:44:11 | * | ocelotsloth joined #nim |
14:44:24 | FromGitter | <rokups> makes sense. adding handing of `BackwardsIndex` also fixes slicing |
14:45:51 | * | aalmoO joined #nim |
14:45:51 | PMunch | Great! |
14:46:31 | PMunch | That BackwardsIndex thing tripped me up as well first time I discovered it :P |
14:48:13 | FromGitter | <rokups> well good to know im not the only one confused here :) |
14:48:16 | * | aalmoO quit (Remote host closed the connection) |
14:50:02 | PMunch | I guess it's less confusing than the old behavior though. str[1 .. ^1] used to rewrite to str[1 .. str.len - 1] which worked fine, until you tried to do getString()[1 .. ^1] and it rewrote that to getString()[1 .. getString().len - 1]. If getString returned two different strings you would get very confusing errors. |
14:51:35 | FromGitter | <rokups> yeah well... its been talked over too much already.. but nothing will make me thing nim string slicing is sane :) |
14:52:56 | PMunch | Haha, why do you think it's not sane? Seems pretty well behaved IMO |
14:54:38 | FromGitter | <rokups> 1) .^2 dropping last character is confusing. there is a number 2 and only one character is dropped. my brain shorts out on this one |
14:58:25 | PMunch | It drops the last two character, the null character and the one before that |
14:59:00 | FromGitter | <gogolxdong> How to run the GUI with sdl2+nuklear as well as listen on socket/. |
14:59:06 | PMunch | And then it adds on a new null character to have a valid string |
14:59:09 | FromGitter | <rokups> meh null character is just a detail. no mainstream language treats null as a part of string content |
14:59:21 | PMunch | Well, C is pretty mainstream |
14:59:39 | PMunch | But I agree, I asked the exact same question when I first saw ^n |
14:59:56 | FromGitter | <rokups> c does not have string slicing in stdlib that would define this |
15:00:06 | FromGitter | <rokups> and again null is just a detail. string content is characters |
15:00:38 | shashlick | @gogolxdong - is nimnuklear still broken for you |
15:00:42 | FromGitter | <rokups> len("ab") returns 2 but as far as ^ is concerned string is 3 bytes long. confusing. |
15:00:58 | elrood | it's not limited to strings but that way for any slice, tho, PMunch. explaining it with null-terminated strings isn't really helping get the bigger picture |
15:01:18 | * | narimiran joined #nim |
15:01:31 | PMunch | elrood, hmm that's how Araq explained it to me back when I asked.. |
15:01:56 | * | tankf33der left #nim (#nim) |
15:02:10 | FromGitter | <rokups> yeah i know, i read all those Araq's rants few years ago why its a good idea. it still throws me off when ^2 does not match number of chars im dealing with |
15:02:33 | FromGitter | <rokups> off-by-one errors are hard as they are. no need nim helping me to make more :) |
15:02:43 | * | a_b_m joined #nim |
15:02:43 | * | tefter quit (Remote host closed the connection) |
15:03:44 | * | PrimHelios joined #nim |
15:05:00 | * | edcragg quit (Excess Flood) |
15:05:07 | * | voice_ftp_ joined #nim |
15:05:08 | * | edcragg joined #nim |
15:05:12 | narimiran | think of ^n as -n in python, then it is less confusing or error-prone |
15:05:22 | elrood | if you think about about it this way it almost makes sense: indices in nim are 0-based, so accessing arr[arr.len] is already one element beyond its bounds. arr[arr.len-1] would be the last element. ..^x is a shortcut for ..arr.len-x |
15:05:34 | FromGitter | <rokups> except its off by one narimiran |
15:06:12 | * | abm quit (Ping timeout: 252 seconds) |
15:06:20 | FromGitter | <rokups> in python "abc"[1:-1] == "b" |
15:06:48 | elrood | still a bad design decision to not make ..^x be short for ..arr.len-x-1 imho |
15:06:58 | FromGitter | <gogolxdong> don't know how it is on linux, but I got it work on windows, how do I run GUI and listen on socket at the same time. |
15:07:17 | * | voice_ftp quit (Ping timeout: 252 seconds) |
15:07:39 | PMunch | gogolxdong, a thread probably |
15:08:00 | PMunch | Or in an event loop kind of thing if Nuklear has that |
15:08:28 | narimiran | @rokups, it is not. because python's : excludes top of the range, and the equivalent in nim is `..<` (not `..`) |
15:09:56 | FromGitter | <rokups> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb4dbc43844923661db2bc7] |
15:10:18 | FromGitter | <gogolxdong> http://ix.io/1odJ |
15:11:19 | FromGitter | <gogolxdong> used a spawn for listen and asyncCheck for GUI render, seems that it trapped in a GUI loop. |
15:11:26 | narimiran | @rokups: let a = "abc"; assert a[1 ..< ^1] == "b" |
15:11:55 | FromGitter | <rokups> oh that is what you mean |
15:12:00 | FromGitter | <rokups> now that makes sense |
15:12:23 | FromGitter | <rokups> thanks :) |
15:12:30 | FromGitter | <kaushalmodi> @rokups https://scripter.co/notes/string-fns-nim-vs-python/#understanding-the-n-syntax 😁 |
15:14:12 | shashlick | dom96: I'd also like to say that nimble v0.9.0 is *much* slower than the previous release |
15:18:04 | * | PrimHelios quit (Quit: Leaving) |
15:22:21 | dom96 | You sure you just didn't end up with a debug version? |
15:23:23 | * | ocelotsloth quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:23:30 | dom96 | gogolxdong: you just need to call asyncdispatch.poll from your GUI's event loop |
15:23:34 | dom96 | You don't need threads |
15:24:00 | * | ocelotsloth joined #nim |
15:25:02 | shashlick | dom96: https://github.com/nim-lang/nimble/issues/548 |
15:25:18 | shashlick | have used choosenim to install so no debug versions here |
15:26:40 | dom96 | You might be getting a debug version because IIRC I changed how `build` behaves |
15:27:26 | shashlick | and also regarding libsvm not installing correctly on v0.9.0, the libsvm subdirectory doesn't exist until `before install` is done. so nimble doesn't see the directory in the beginning so omits it during install |
15:27:43 | shashlick | if the libsvm subdirectory already exists then nimble installs it just fine |
15:27:54 | shashlick | are you scanning package contents before `before install` |
15:27:54 | dom96 | easy way to check: run `nimble -asadasd` |
15:28:03 | dom96 | If you get a stack trace then it's in debug mode |
15:28:41 | shashlick | yep i do - why is choosenim not compiling this in release mdoe |
15:29:01 | dom96 | Probably because `nimble build` defaults to debug mode now |
15:30:26 | shashlick | choosenim calls `koch tools` |
15:30:33 | dom96 | yeah, so koch needs to be fixed |
15:30:36 | shashlick | with -d:release |
15:32:13 | dom96 | also yeah, Nimble scans the package before installation and changes the package info object |
15:32:46 | shashlick | ya that breaks anything you want to add in `before install` |
15:32:49 | dom96 | https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/packageparser.nim#L280 |
15:33:13 | * | tefter joined #nim |
15:33:39 | FromGitter | <gogolxdong> Error: unhandled exception: No handles or timers registered in dispatcher. [ValueError] |
15:33:45 | dom96 | That gets hairy :( |
15:33:55 | shashlick | dom96, araq: looks like nimble in debug mode is intentional - https://github.com/nim-lang/Nim/blame/91c13a0163c692dd709eed1b0cf7eee0c19d0f96/koch.nim#L144 |
15:34:10 | Tortice | hey dom just wanted to say thanks again |
15:34:21 | FromGitter | <gogolxdong> don't quite understand how poll works. |
15:34:32 | dom96 | gogolxdong: try `if asyncdispatch.hasPendingOperations: asyncdispatch.poll()` |
15:34:42 | dom96 | In fact, Tortice should be able to help you :) |
15:34:48 | dom96 | Tortice: No worries :) |
15:34:52 | dom96 | I should head to work now |
15:34:55 | dom96 | Later! |
15:35:19 | dom96 | shashlick: No idea why Araq did that :/ |
15:36:45 | * | devopsdeluxe joined #nim |
15:45:01 | * | devopsdeluxe quit (Quit: ZNC 1.7.1 - https://znc.in) |
15:53:13 | * | usviBK joined #nim |
15:54:16 | * | PMunch quit (Quit: Leaving) |
15:54:28 | * | devopsdeluxe joined #nim |
16:00:34 | * | usviBK quit (Remote host closed the connection) |
16:00:51 | FromGitter | <rokups> consider operator `proc []=*(s: var ustring, slice: Slice[int], replacement: ustring)`. it gets called like `s[1..2] = "a"` where `s` is `ustring`. converters exist for both `string->ustring` and `ustring->string`. is it documented which parameter would get converted? i get `s` converted to `string` while i expected string litteral `"a"` to be turned to `ustring`. no idea if i expect wrong thing or compiler is doing |
16:00:51 | FromGitter | ... something wrong |
16:02:07 | * | floppydh quit (Quit: WeeChat 2.2) |
16:02:53 | FromGitter | <mratsim> the first one will be kept as is, and the one after will be converted |
16:02:56 | shashlick | dom96: https://github.com/nim-lang/nimble/issues/549 |
16:03:02 | FromGitter | <mratsim> and it’s undocumented |
16:04:11 | * | rokups quit (Quit: Connection closed for inactivity) |
16:06:22 | FromGitter | <rokups> @mratsim i expected that as well, however it seems opposite thing happens |
16:07:15 | FromGitter | <mratsim> ^ Araq, this is inconsistent ;) with array \[0.float32, 1, 2\] |
16:08:38 | * | vivus joined #nim |
16:08:54 | FromGitter | <rokups> any idea when `BackwardsIndex` was introduced? |
16:09:16 | narimiran | somewhere around 0.18 IIRC |
16:09:52 | FromGitter | <rokups> hah i started checking blog posts from 0.17 and down. sigh |
16:09:53 | FromGitter | <rokups> thanks |
16:12:34 | vivus | darn, the yaml lib has broken all my code :/ |
16:13:32 | FromGitter | <Vindaar> @vivus I'm trying to fix the yaml lib right now. but don't get your hopes up right now, because it's more complicated than I thought (or my approach just sucks) |
16:14:16 | vivus | @Vindaar this is what I was told is how it should be fixed: https://github.com/flyx/NimYAML/pull/62 |
16:14:29 | FromGitter | <Vindaar> thanks yeah, that's where I started |
16:15:07 | vivus | if you want to discuss in DM, we can maybe fix it together |
16:15:14 | FromGitter | <Vindaar> I'm going by the test cases in the lib. But I don't know if they all worked before or not (one certainly didn't, because of the changes in the times module) |
16:15:48 | FromGitter | <Vindaar> yeah, we could do that. could you hop on gitter? I don't have an IRC client on the pc I'm on right now :) |
16:17:43 | FromGitter | <rokups> which operator do you think gets called here when `u"!!!"` is changed to `"!!!"`? https://github.com/rokups/nim-ustring/blob/master/ustring.nim#L830 ⏎ that change causes error: ustring.nim(830, 9) Error: for a 'var' type a variable needs to be passed; but 'toString(x)' is immutable |
16:18:27 | FromGitter | <rokups> i tried to create isolated testcase but ofc once again it works fine converting `"!!!"` to ustring while in my code it works differently |
16:18:37 | FromGitter | <rokups> hmm or maybe compiler version on ideone is older and has no regression |
16:20:37 | FromGitter | <kaushalmodi> @Vindaar are you on 64-bit Linux? |
16:21:40 | vivus | when using choosenim, are the nimble folders separate for each version of nim? |
16:21:57 | FromGitter | <rokups> indeed ideone has a working older version and this is a regression |
16:24:09 | FromGitter | <Vindaar> @kaushalmodi yep, I am |
16:24:58 | FromGitter | <kaushalmodi> can you please try out a static binary built using Nim (this time for a real project!) :) |
16:25:06 | FromGitter | <kaushalmodi> it has to do with Org tangling so pinged you |
16:25:14 | FromGitter | <Vindaar> sure, if you point me the right way :) |
16:25:24 | FromGitter | <kaushalmodi> binary download: https://github.com/OrgTangle/ntangle/releases |
16:25:33 | narimiran | @rokups: from ideone site: "language:Nim (nim 0.16.0)" -> well that is quite old |
16:25:38 | * | erratic joined #nim |
16:25:39 | vivus | does the code `rm -rf/` my system? |
16:25:49 | FromGitter | <rokups> old and working yep |
16:25:49 | FromGitter | <kaushalmodi> @Vindaar sample Org file: https://raw.githubusercontent.com/OrgTangle/ntangle/master/tests/tangle_no_yes.org |
16:26:12 | FromGitter | <kaushalmodi> just download, extract and run `ntangle FILE.org` |
16:26:21 | FromGitter | <kaushalmodi> (I need to work on `cligen` integration, etc. |
16:29:24 | vivus | all it tells me is: "parsing file.org" and then nothing happens after that |
16:29:31 | Araq | rokups: the match that implies the least amount of conversions is preferred |
16:29:54 | Araq | actually it's different, so let me explain how overloading resolution works (which is documented in the manual) |
16:30:29 | vivus | @kaushalmodi ^^^ |
16:30:33 | Araq | and the regression may be because the compiler follows the spec more or less, so a bug report would be interesting anyway |
16:30:50 | Araq | there are 4 different matching "kinds" |
16:31:03 | Araq | 1. exact match (wanted int, got int) |
16:31:05 | * | darithorn joined #nim |
16:31:10 | Araq | 2. generic match |
16:31:27 | Araq | 3. subtype match (not that 'ranges' have a subtype relation) |
16:31:32 | Araq | 4. conversion match |
16:32:19 | Araq | it is counted how many matches of the different kinds exist and the different match kinds have different priorities |
16:33:40 | Araq | a 'converter' call is always a conversion match |
16:33:47 | FromGitter | <rokups> in my case there are two arguments both of which are conversion match. what then? |
16:33:54 | FromGitter | <rokups> which one should be converted of two? |
16:34:01 | Araq | then it's flagged as ambiguous |
16:34:09 | FromGitter | <rokups> no it isnt :D |
16:34:10 | FromGitter | <kaushalmodi> vivus: Thanks for testing.. looks I am missing something.. I get: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb4ef825af485306856333a] |
16:34:27 | vivus | I was using 0.18.0 btw |
16:34:39 | FromGitter | <kaushalmodi> that shouldn't matter.. you downloaded the binary, right? |
16:34:48 | FromGitter | <rokups> i added self-contained testcase to https://github.com/nim-lang/Nim/issues/9165 |
16:34:53 | FromGitter | <kaushalmodi> download that binary from the Releases link I pasted above |
16:35:07 | FromGitter | <Vindaar> @kaushalmodi that's what I also get |
16:35:10 | FromGitter | <kaushalmodi> then download the tangle_no_yes.org from the link above |
16:35:22 | FromGitter | <kaushalmodi> and do `ntangle tangle_no_yes.org` |
16:35:30 | FromGitter | <Vindaar> as in your snippet |
16:35:50 | FromGitter | <kaushalmodi> @Vindaar did you first type *yasnippet*? |
16:36:11 | FromGitter | <kaushalmodi> at least I thought I read so and I glanced again and it was *snippet* :P |
16:36:29 | FromGitter | <Vindaar> nope, I actually meant your snippet of the error message above :D |
16:36:34 | FromGitter | <kaushalmodi> :) |
16:36:50 | FromGitter | <kaushalmodi> OK, somehow it's not creating the new file.. odd.. investigating |
16:37:06 | FromGitter | <Vindaar> at least the binary itself is running, so that's good to know I guess? |
16:37:33 | FromGitter | <kaushalmodi> yep :) |
16:37:55 | vivus | flyx: does this fix the issue with 0.19.0 : https://github.com/6in/NimYAML/commit/07a1b8ceb500be288c85e237bcb6646b8c483812 ? somebody else forked it and made updates, but no commit |
16:38:23 | vivus | I mean no PR |
16:42:40 | FromGitter | <kaushalmodi> @Vindaar looks like a funny bug.. if you move that tangle_no_yes.org to a foo dir and do `ntangle foo/tangle_no_yes.org`, it should work.. same binary |
16:43:03 | FromGitter | <kaushalmodi> not surprisingly, my tests access the Org files from a sub dir |
16:43:05 | FromGitter | <kaushalmodi> :P |
16:44:39 | * | TheLemonMan joined #nim |
16:45:53 | TheLemonMan | shashlick, how long does it take you to wrap the zbar library? |
16:49:38 | FromGitter | <Vindaar> @kaushalmodi oh, indeed. Then it works |
16:50:23 | FromGitter | <Vindaar> that's pretty sweet |
16:50:57 | shashlick | TheLemonMan: https://github.com/ZBar/ZBar ?? |
16:51:10 | TheLemonMan | shashlick, yeah |
16:51:31 | FromGitter | <kaushalmodi> @Vindaar thanks for testing.. found the bug.. fixing it |
16:52:14 | shashlick | hasn't been updated in a long time, so the github should still be up to date |
16:53:49 | TheLemonMan | yeah, as long as it works heh |
16:54:23 | shashlick | I can try real quick and see |
16:54:29 | * | malkomalko quit (Ping timeout: 244 seconds) |
16:55:41 | vivus | how do I install an older version of a package with nimble? |
16:56:02 | * | ocelotsloth quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:56:13 | shashlick | you can use version or commit hash `nimble install [email protected]" |
16:56:51 | vivus | ty |
16:57:29 | FromGitter | <kdheepak> Hi @all I've built a github-release command line utility in Nim, so that one can upload their binaries to github more easily. |
16:57:33 | FromGitter | <kdheepak> https://github.com/kdheepak/github-release/releases/tag/releases |
16:57:41 | TheLemonMan | I've added another 'Hacktoberfest' task so if you like compiler hacking & t-shirts this is your chance to shine |
16:58:17 | * | tzui joined #nim |
16:59:01 | FromGitter | <kdheepak> Naturally, the releases of `github-releases` uploaded to github were done through `github-releases` ⏎ ⏎ https://github.com/kdheepak/github-release/blob/c58281b/.travis.yml#L69 |
17:00:05 | FromGitter | <kdheepak> I have to add more features to it but for now it's ready to be used! |
17:00:41 | FromGitter | <kdheepak> Latest releases will be on the `releases` tag. |
17:01:40 | Araq | rokups: I think what happened is that system.nim has different []= operators now, but I'll investigate |
17:02:11 | FromGitter | <kdheepak> Latest releases will be on the `releases` tag, for now. |
17:04:46 | narimiran | is there a bug in `nim doc` or am i doing something wrong? (but i'm running the same command as before) it seems it is in some kind of infinite loop!?! |
17:05:03 | * | jjido joined #nim |
17:06:54 | narimiran | did anyone else experienced the same? |
17:07:19 | narimiran | this is the command i'm running: `nim doc -o:./docs/index.html ./src/itertools.nim` |
17:07:23 | shashlick | TheLemonMan: c2nim doesn't like this line - https://github.com/ZBar/ZBar/blob/854a5d97059e395807091ac4d80c53f7968abb8f/include/zbar/Image.h#L73 |
17:07:27 | * | rockcavera quit (Ping timeout: 252 seconds) |
17:08:17 | planetis[m] | btw guys, what do u think of this macro post https://github.com/nim-lang/website/pull/108 ? |
17:08:57 | TheLemonMan | shashlick, the C api is enough |
17:09:36 | TheLemonMan | shashlick, see the end of include/zbar.h |
17:09:55 | narimiran | it works on the version of 0.18.1 i have from before |
17:10:29 | * | tzui quit (Ping timeout: 256 seconds) |
17:10:38 | narimiran | ("Compiled at 2018-08-09") |
17:10:40 | TheLemonMan | I once wrote a similar tool (for CHICKEN scheme) to create bindings from header files, but I used libclang because life is too short to parse shit by hand |
17:12:05 | FromGitter | <kaushalmodi> @Vindaar , vivus: bug fixed release of https://github.com/OrgTangle/ntangle/releases ready |
17:12:08 | shashlick | TheLemonMan: ok cool |
17:12:17 | FromGitter | <kaushalmodi> vivus: I am curious why it didn't work for you earlier |
17:13:04 | * | francisl quit (Quit: francisl) |
17:13:38 | * | arecaceae quit (Remote host closed the connection) |
17:13:56 | * | arecaceae joined #nim |
17:13:57 | narimiran | can anybody try by themselves running `nim doc` to see if you can reproduce this infinite loop, before i open an issue |
17:14:23 | FromGitter | <kaushalmodi> vivus: I have tested this to work (needs 64-bit Linux): ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb4f8eeae7be94016f75672] |
17:14:55 | FromGitter | <zetashift> @planetis[m] nice read I don't know much about macros though, so can't comment much. However I'd add a short explanation of what a state machine is and how did you achieve 'Then we will expand on ⏎ this to generate states machines that also run faster.' this? By modifying it to produce nested case clauses? |
17:14:59 | FromGitter | <kaushalmodi> should create 2 .nim files and print this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb4f913c7bf7c3662ae79f1] |
17:16:29 | * | gangstacat joined #nim |
17:17:13 | TheLemonMan | narimiran, a bug with nim doc getting into an infinite loop was recently fixed |
17:17:34 | narimiran | TheLemonMan: ok, so 0.19.1 is what i need? |
17:17:48 | TheLemonMan | narimiran, `devel` or bust |
17:18:31 | narimiran | ok, then i can now complain about the looks of the created document and nim's free will to (not)break lines where it should(n't) |
17:19:01 | narimiran | also, lines shorter than 80 characters are too long for the default width of nimdoc page :( |
17:19:58 | shashlick | TheLemonMan: do you care for this proc - https://github.com/ZBar/ZBar/blob/854a5d97059e395807091ac4d80c53f7968abb8f/include/zbar/Image.h#L73 |
17:20:01 | narimiran | regarding devel — i'd like to keep 0.18.1 for now. i don't know if choosenim allows to have two devel versions? |
17:20:05 | TheLemonMan | line breaking is hard :( |
17:20:25 | shashlick | actually this one - https://github.com/ZBar/ZBar/blob/master/include/zbar.h#L1462 |
17:20:42 | shashlick | it doesn't convert properly, commenting out for now, you might be able to fix it |
17:20:49 | narimiran | TheLemonMan: well, if i have two lines in my code — why does nim concatenate them into one line? let me worry about those hard line breaks ;) |
17:20:52 | * | francisl joined #nim |
17:21:32 | TheLemonMan | shashlick, yeah don't worry, it's just a thin wrapper around zbar_scan_y |
17:22:18 | TheLemonMan | narimiran, a cloud-hosted blockchain-powered neural network microservice (written in rust) decides where to put the newlines |
17:22:25 | narimiran | :D :D |
17:22:29 | TheLemonMan | and it _does_ know better than you where to put them |
17:23:25 | narimiran | ok, back to writing code, i can't argue with that :D |
17:27:13 | FromGitter | <Vindaar> @kaushalmodi just tested. Works perfectly even outside the directory! |
17:28:34 | shashlick | TheLemonMan: https://github.com/genotrance/nimzbar |
17:28:41 | * | krux02 joined #nim |
17:28:42 | shashlick | `nimble install https://github.com/genotrance/nimzbar` |
17:28:50 | shashlick | need nimgen though and hope you have a working c2nim |
17:29:09 | shashlick | still doesn't compile but I have to run for a bit |
17:29:50 | TheLemonMan | yeah I'll give it a spin sometimes later, thank you! |
17:31:12 | shashlick | i'll bet we have to put something in config.h 😄 |
17:31:25 | shashlick | get the right #defines to fire |
17:32:28 | flyx | vivus: I know that commit, there was a PR but author closed it shortly after https://github.com/flyx/NimYAML/pull/63 |
17:33:04 | Araq | shashlick: c2nim tests are green and I ensured 0.18 can compile c2nim |
17:33:10 | Araq | anything else? |
17:33:15 | flyx | also, it basically has the same problems as the other PR and moreover it does some unrelated stuff like changing the Table to an OrderedTable |
17:34:13 | vivus | @kaushalmodi same problem still |
17:35:11 | vivus | @kaushalmodi what is the expected output? |
17:36:18 | planetis[m] | zetashift: It 's not a post about fsm but I can make a PR when its merged :) |
17:39:21 | FromGitter | <zetashift> No I know! just a small explanation not indepth ;P |
17:39:48 | shashlick | Araq: brilliant! now nimble's broken nimgen so let's see what to do next |
17:40:01 | FromGitter | <kaushalmodi> vivus: what is your OS? |
17:40:09 | FromGitter | <kaushalmodi> the binary will work only on 64-bit Linux |
17:40:10 | vivus | ubuntu |
17:40:15 | FromGitter | <kaushalmodi> 64-bit? |
17:40:18 | vivus | yep |
17:41:11 | FromGitter | <kaushalmodi> hmm.. just confirming that you ran this: https://ptpb.pw/dL9A/bash |
17:42:17 | FromGitter | <kaushalmodi> vivus.. wait for a min |
17:42:29 | FromGitter | <kaushalmodi> after I created that snippet, I re-organized the tests |
17:42:52 | vivus | its probably just a weird edge case, as I ran it in a container |
17:43:17 | FromGitter | <kaushalmodi> not sure how that matters.. |
17:43:25 | FromGitter | <kaushalmodi> updated quick test script: https://ptpb.pw/DX39/bash |
17:43:37 | FromGitter | <kaushalmodi> save that as a `foo.sh` and run `./foo.sh` |
17:45:07 | FromGitter | <kaushalmodi> after you run that in an empty dir, you should end up with: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb50023a9be136b94ee7b57] |
17:45:57 | * | Viper-7Qn joined #nim |
17:46:48 | * | Viper-7Qn quit (Remote host closed the connection) |
17:49:28 | * | vivus quit (Ping timeout: 268 seconds) |
17:51:23 | * | tzui joined #nim |
17:56:23 | * | tzui quit (Ping timeout: 256 seconds) |
18:03:37 | * | PMunch joined #nim |
18:04:23 | FromGitter | <kaushalmodi> vivid: maybe creating new files is not allowed in your container? |
18:04:37 | PMunch | Hmm, var x: range[10..100]; echo x # prints out 0 |
18:04:39 | PMunch | This seems like a bug |
18:04:51 | PMunch | It defaults to something that isn't valid for that type |
18:04:57 | FromGitter | <kaushalmodi> Though, some error should have been thrown if that were the case. |
18:06:14 | * | nsf joined #nim |
18:06:52 | TheLemonMan | PMunch, that's the zero-init curse, you can't do much about it |
18:07:48 | FromGitter | <kaushalmodi> @Vindaar so.. technically, now we can deploy Nim built binaries by just committing Org files :P |
18:08:28 | FromGitter | <kaushalmodi> Commit Org -> ntangle + nim musl happens over Travis |
18:12:57 | FromGitter | <Vindaar> hehe, now that's handy :D |
18:13:29 | FromGitter | <Vindaar> @flyx: well, here's WIP attempt to get all tests in the suite running on the current version: https://github.com/flyx/NimYAML/pull/64 |
18:13:34 | FromGitter | <Vindaar> *my |
18:13:41 | * | jjido_ joined #nim |
18:14:11 | * | manterolat joined #nim |
18:14:22 | PMunch | TheLemonMan, it's a huge problem for something like this though "proc test(y: range[10 .. 100])" which now suddenly can get a 0 |
18:14:58 | narimiran | quick question: if you have "abbc", and you want to have permutations of it, would you consider these two 'b' as different? e.g. would you want to have repeating permutations: abbc, abcb, acbb, acbb, ... |
18:15:13 | TheLemonMan | PMunch, yeah, I hope the RT (and CT?) range checks would catch it |
18:15:48 | PMunch | Nope, it just tries to use the value.. |
18:16:13 | PMunch | narimiran, highly depends on the use-case |
18:16:39 | PMunch | But I think for most practical purposes it should only generate one acbb |
18:16:50 | narimiran | nim's algorithm.nextPermutation doesn't give you those duplicates, python's itertools.permutations gives you duplicates |
18:17:26 | narimiran | ...and i'm torn between them :) |
18:17:50 | PMunch | Well, I can't think of any case where the Python way would be better |
18:18:05 | PMunch | I assume someone would want to try all the permutations, and it would just be double work |
18:19:35 | narimiran | well, in python way you always know total number of permutations, in nim way it depends on what you give it as an argument |
18:20:03 | Araq | PMunch: it produces a warning though |
18:20:28 | narimiran | i also lean to the nim-way, but on the other hand: i want to mimic python's itertools and don't surprise users (too much) |
18:20:49 | PMunch | Hmm, I guess. And with the Python way you have a way to get the Nim version, just filter out the dupes before-hand. But with the Nim version there's no way to get the Python version without going through all the permutations |
18:21:28 | PMunch | Araq, that's true.. |
18:21:40 | PMunch | And "This will become a compile time error in the future" |
18:22:14 | PMunch | Problem arises like this though: https://www.reddit.com/r/nim/comments/9jr50g/question_about_option_and_range/ |
18:23:01 | PMunch | The options module raises the error here: https://github.com/nim-lang/Nim/blob/devel/lib/pure/options.nim#L92 |
18:23:35 | FromGitter | <kaushalmodi> narimaran: may be do some kind of seq -> set -> seq transformation? |
18:23:40 | PMunch | It works fine if that's rewritten to "return Option[T](has: true, val: val)" |
18:23:47 | FromGitter | <kaushalmodi> That should get rid of duplicates |
18:24:37 | narimiran | @kaushalmodi can't do that because then your permutations of "abbc" would become: abc, acb, cab, ... |
18:24:57 | FromGitter | <kaushalmodi> Actually nevermind, sequtils should be having some deduplication proc for sews ⏎ s/sews/seqs |
18:25:08 | narimiran | yep, it exists |
18:25:09 | FromGitter | <kaushalmodi> I meant |
18:26:03 | FromGitter | <kaushalmodi> abcb, acbb, acbb,..-> abcb, acbb, .. |
18:28:14 | * | malkomalko joined #nim |
18:29:25 | FromGitter | <Vindaar> @narimiran well my group theory is a little rusty, but if you want the total number of permutations of N elements, treating each element as distinct, it's just N! |
18:30:28 | narimiran | @vindaar but do you want to see all N! permutation listed if there are duplicates? consider "aaa", how many permutations of it you want to see? 1 or 6? |
18:31:00 | FromGitter | <Vindaar> I'm just saying it, because above you said in python you knew the total number of them. And that you know in Nim too :) |
18:31:23 | FromGitter | <Vindaar> Whether you *want* duplicates or not is a different question for sure |
18:32:47 | narimiran | @Vindaar what i meant is: in nim, if you want to list all permutations using `while algorithm.nextPermutation(x): echo x`, you would get different number of lines printed depending on contents of `x` (for the same `x.len`) |
18:34:11 | FromGitter | <Vindaar> yep, different numbers, but not unknown. But you still know how many lines you'll get by `toSet(x).card.factorial` or something like that |
18:35:17 | FromGitter | <Vindaar> ok that won't quite work, thinking more about it |
18:38:45 | * | malkomalko quit (Ping timeout: 252 seconds) |
18:39:17 | FromGitter | <citycide> to use `nimdoc.cfg` must you replace the entire file or can you extend it by only configuring certain values? |
18:39:26 | * | devopsdeluxe left #nim ("WeeChat 2.2") |
18:45:54 | * | jjido quit (Ping timeout: 252 seconds) |
18:46:11 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
18:53:07 | narimiran | @Vindaar, PMunch: here are my thoughts about permutations: https://github.com/narimiran/itertools/issues/3#issuecomment-426754188 feel free to add yours |
18:54:03 | * | kungtotte joined #nim |
18:58:04 | FromGitter | <Vindaar> will do so later! :) |
18:58:39 | * | rockcavera joined #nim |
18:59:24 | * | jjido_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:03:37 | * | sqozzmK joined #nim |
19:05:54 | * | kobi7 joined #nim |
19:05:56 | kobi7 | hi guys |
19:06:11 | * | Vladar quit (Remote host closed the connection) |
19:06:56 | kobi7 | when I have a var x inside a concept, does that mean the matching type must have such a variable too? |
19:07:18 | * | tefter quit (Remote host closed the connection) |
19:07:37 | kobi7 | I am treating concepts like an interface in my mental model and not sure it's really the same. |
19:08:27 | kobi7 | because the "matching type" doesn't really implement anything specifically. if it has the structure, then it's a concept match |
19:09:21 | kobi7 | so, if I have a get; set; pair in a c# interface. can I represent that as a var inside a concept? |
19:09:31 | kobi7 | I think I am missing information about its usage. |
19:10:03 | * | sqozzmK quit (Remote host closed the connection) |
19:10:37 | * | manterolat quit (Ping timeout: 256 seconds) |
19:12:02 | kobi7 | Nim in action doesn't have that information either |
19:14:46 | stefanos82 | what's a concept? |
19:15:46 | * | xet7 quit (Quit: Leaving) |
19:15:50 | kobi7 | https://nim-lang.org/docs/manual.html#generics-concepts |
19:16:43 | * | fvs joined #nim |
19:17:24 | * | xet7 joined #nim |
19:18:39 | kobi7 | I feel it's too abstract (and the syntax is kind of different from the usual language), or perhaps it's just the documentation which is lacking |
19:19:10 | kobi7 | it's a good thing, but there needs to be a list of what can be done with it and how |
19:19:33 | kobi7 | (if newcomers are to understand) |
19:20:32 | kobi7 | for example, look here: https://nim-lang.org/docs/manual.html#generics-generic-concepts-and-type-binding-rules |
19:20:44 | kobi7 | M.Rows == R |
19:21:54 | kobi7 | does that mean the instance variable is named Rows, and has the value R, specified as static int? (we know what a matrix is, so...) |
19:22:54 | kobi7 | it's like an interface and a template in one. |
19:23:36 | kobi7 | sorry for the rant. I like this idea, but it should be solidified better |
19:24:22 | * | francisl quit (Quit: francisl) |
19:25:22 | kungtotte | Well, the docs literally says this feature is in development. |
19:26:10 | FromDiscord_ | <demotomohiro> M is a type and R is static int(generic parameter of AnyMatrix) |
19:26:51 | stefanos82 | kobi7: this must be something really *really* new, because I did not know it until you mentioned it! |
19:26:53 | kobi7 | Yes. it's like taking specs or contracts to the extreme. it's good for safety and for being explicit in the code. |
19:27:14 | kobi7 | but coming from other languages, you need to map it to some concept you know in your head |
19:27:56 | stefanos82 | Araq: is concepts something new that got added lately? I don't remember using it before |
19:28:34 | FromDiscord_ | <demotomohiro> I think concept in Nim is something similar to concept in C++ |
19:28:35 | kobi7 | stefanos82: I think you can just go deeply in nim, or you can use the basics quite well |
19:28:57 | kobi7 | oh, demotomohiro, I don't know c++ maybe that's why :/ |
19:29:11 | stefanos82 | kobi7: yes, you can do with macros and templates, but Concepts it's new to me |
19:29:26 | stefanos82 | C++ is trying to promote it towards C++20; let's see how it will go... |
19:30:00 | kobi7 | I understood it as something like interface from object oriented languages, but with contracts to specify not just structure but behaviour |
19:31:42 | stefanos82 | well, a Concept describes the syntax and the semantics of supported operations of a type |
19:31:57 | kobi7 | anyways, I didn't mean to be so critical. I have a tendency to reach the outer limits and find issues/bugs that most don't encounter. |
19:32:15 | kobi7 | I want to make this a constructive report. sorry if it was taken otherwise |
19:33:54 | kobi7 | thanks stefanos82. I was hoping for a simple howto: how to use it, and what for. I think the docs would improve a lot keeping this in mind |
19:34:08 | stefanos82 | it doesn't matter kobi7; as long as you hit a bug that's a + for you and your credibility as an experienced programmer |
19:34:41 | stefanos82 | what you said before about C#'s interface, yes it's true that it's that more or less how Concepts behave |
19:35:22 | stefanos82 | kobi7: the docs are getting there |
19:35:22 | kobi7 | only the types don't need to specify it by name, they are automatically added to that category based on their structure |
19:35:48 | kobi7 | hmmm |
19:35:49 | stefanos82 | you could provide valuable feedback in the form of a ticket |
19:36:06 | stefanos82 | based on your personal experience around languages that support Concepts already |
19:36:10 | stefanos82 | such as Java and C# |
19:36:42 | kobi7 | :-) |
19:36:57 | stefanos82 | even PHP supports Concepts at a great extend (since they mimic Java most of the times) |
19:38:40 | kobi7 | ok, I see in the examples there is a way to specify "instance variables": |
19:38:41 | kobi7 | f.val is A |
19:38:41 | kobi7 | # The Functor should provide a way to obtain |
19:38:41 | kobi7 | # a value stored inside it |
19:39:33 | kobi7 | so I don't need to mimic get and set in a weird way. |
19:40:46 | kobi7 | I like this "don't repeat yourself" concise syntax. just wished there was easier docs |
19:44:17 | stefanos82 | now that Nim has financial support by Status.io, don't worry about it; the core team will work hard to fix both bugs and improve docs and code base |
19:44:28 | stefanos82 | you can read more here if you want to kobi7 https://nim-lang.org/blog/2018/08/07/nim-partners-with-status.html |
19:45:29 | kobi7 | yea, I've noticed accelerated pace |
19:46:02 | kobi7 | I find the language very stable btw |
19:46:25 | stefanos82 | maybe you could familiarize yourself with language's core elements and start contributing to it? |
19:46:30 | kobi7 | vscode's multiple cursors feature is really cool :-) having some fun |
19:46:45 | kobi7 | stefanos82: what do you mean? |
19:47:07 | kobi7 | make a library? |
19:47:16 | stefanos82 | kobi7: since you are an already experience developer with C#, you could help with Nim's TODO list |
19:48:04 | stefanos82 | bringing in existing experience could improve many things and even inspire new methodologies |
19:52:42 | kobi7 | I want to do good with it, and report issues if needed. but don't think I can work for the sake of the language's improvement itself. not sure it's something i should do |
19:53:30 | kobi7 | most days it's hard to find the time too. but it is tempting:) |
19:54:52 | stefanos82 | well, if you can report bugs, that's also considered contribution to language's stability and evolution |
19:54:55 | * | francisl joined #nim |
19:55:17 | stefanos82 | so technically, it can make you an official contributor if you provide a solution to each reported bug |
19:56:10 | kobi7 | yes, that's a good starting point. explain the docs better from my background. |
19:56:33 | kobi7 | cool, I might just do something like that |
19:57:05 | FromDiscord_ | <demotomohiro> I wrote simple example of nim concept |
19:57:09 | FromDiscord_ | <demotomohiro> https://wandbox.org/permlink/DPl0yaFHgWuYuHBn |
19:58:09 | * | tiorock joined #nim |
19:58:09 | * | rockcavera is now known as Guest60642 |
19:58:09 | * | tiorock quit (Changing host) |
19:58:09 | * | tiorock joined #nim |
19:58:10 | * | Guest60642 quit (Killed (karatkievich.freenode.net (Nickname regained by services))) |
19:58:10 | * | tiorock is now known as rockcavera |
20:02:45 | * | kobi7 quit (Quit: Leaving) |
20:08:39 | jxy | hi all, what is the recommended way to do C FFI with C99 complex number types? |
20:12:37 | * | Eagle_ErwinCK joined #nim |
20:15:20 | * | jjido joined #nim |
20:18:40 | * | Eagle_ErwinCK quit (Remote host closed the connection) |
20:23:53 | Araq | jxy: type CComplex {.importc: "...", header: "...".} = object |
20:24:09 | stefanos82 | Araq: you got me lol |
20:24:16 | stefanos82 | I was about to suggest c2nim as well |
20:24:34 | Araq | didn't mention c2nim |
20:25:36 | stefanos82 | I meant "as an alternative" |
20:27:51 | jxy | but what can I do with these var x:CComplex? |
20:28:10 | jxy | cast them to Complex? |
20:28:46 | jxy | would it be safe to cast stdlib Complex to this CComplex? |
20:30:28 | Araq | obviously not :P |
20:31:04 | Araq | I don't know why C added a complex that is not just a struct, terrible language design |
20:31:17 | * | francisl quit (Quit: francisl) |
20:34:16 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:35:11 | * | malkomalko joined #nim |
20:37:37 | FromGitter | <kdheepak> Hi all, thanks for helping me with the parser questions the other day. I really appreciate it. |
20:38:03 | FromGitter | <kdheepak> I've made the parser open source, and now can share the code and answer more specific questions. |
20:38:31 | FromGitter | <kdheepak> I would really REALLLYYY appreciate it if someone took the time to review this code and provide comments and feedback: https://github.com/NREL/glm |
20:39:51 | * | malkomalko quit (Ping timeout: 260 seconds) |
20:41:43 | FromGitter | <Varriount> @kdheepak Avoid using `cast`, use object conversions instead. |
20:41:53 | FromGitter | <kdheepak> There's some somewhat high level software engineering questions as well that I have, that I'd like to ask. Not sure if this is the best place for it though (e.g. of such a question, should I use a JSON object to store attributes in a Parser to form a AST representation?). |
20:42:55 | FromGitter | <kdheepak> How do you do object converstions? |
20:43:30 | FromDiscord_ | <demotomohiro> @kdheepak is your project is related to OpenGL Mathematics (GLM)? |
20:43:31 | FromDiscord_ | <demotomohiro> https://glm.g-truc.net/0.9.9/index.html |
20:43:38 | FromGitter | <kdheepak> Thanks @Varriount for looking at it (these are lines being referenced: https://github.com/NREL/glm/blob/34be5d3/src/ast.nim#L45) |
20:44:34 | FromGitter | <kdheepak> @demotomohiro no it's not, I did see that there was something else with the same name. This is a power systems distribution system simulator called GridLAB-D that has data files in .glm format. |
20:44:43 | FromGitter | <kdheepak> It's a mixture of C and a custom format. |
20:45:13 | FromGitter | <kdheepak> This is an example of what I need to parse: https://github.com/NREL/glm/blob/master/tests/data/4node.glm |
20:48:48 | FromDiscord_ | <demotomohiro> I didn't know about GridLAB-D |
20:53:16 | * | a__b__m joined #nim |
20:54:34 | FromDiscord_ | <demotomohiro> @kdheepak you are using Makefile in your project and it is not used for building C/C++ code. |
20:55:33 | FromDiscord_ | <demotomohiro> Just type 'make' is much shorter than using nimble command |
20:57:11 | Araq | shell aliases, command completion, command history |
20:57:21 | * | a_b_m quit (Ping timeout: 260 seconds) |
21:00:06 | FromGitter | <kdheepak> @demotomohiro are you saying I shouldn't use Make? |
21:01:26 | * | narimiran quit (Ping timeout: 260 seconds) |
21:02:12 | FromDiscord_ | <demotomohiro> No, I just thought it is interesting to use Makefile in Nim project |
21:02:18 | * | nsf quit (Quit: WeeChat 2.2) |
21:02:28 | FromGitter | <dom96> Indeed, you shouldn't use make. Nimble is all you need |
21:03:15 | FromDiscord_ | <demotomohiro> When I used C++, I wrote Makefile but I thought it is complecated. So I started to use CMake. |
21:05:42 | FromDiscord_ | <demotomohiro> Writing CMake file was easier than writing Makefile to build C++ but anyway, CMake is also complicated language |
21:12:36 | Araq | https://youtu.be/PN-I6u-AxMg?t=80 Nim is mentioned by PBS! |
21:13:05 | FromGitter | <kdheepak> I work on a number of programming languages, and it's so much easier to type stuff out in a Makefile that I know I'll be running regularly. If there was a way to version control my Makefiles separately from the version control for the project I'd totally do that though. I don't necessary want it to be part of the repo. |
21:13:40 | * | rlr joined #nim |
21:15:45 | * | vivus joined #nim |
21:22:20 | stefanos82 | Araq: lol, that's the game, not the language |
21:22:39 | * | rlr quit (Ping timeout: 256 seconds) |
21:22:43 | Yardanico | stefanos82 but it's nim :P |
21:22:46 | vivus | @Vindaar you still around? |
21:22:50 | stefanos82 | of course :D |
21:25:15 | elrood | kdheepak, you could create a separate repository just for your makefiles, and then use symlinks into that repo in your projects |
21:26:05 | FromGitter | <kdheepak> @elrood that would do it, wouldn't it. |
21:26:25 | FromGitter | <kdheepak> I'd have to globallly gitignore all Makefiles but unignore them in some repos. |
21:28:47 | FromGitter | <kdheepak> I obsessively type `make` when I'm working in the terminal. Sometimes from within vim with `:Make`. |
21:29:19 | FromGitter | <kdheepak> It's my live reload |
21:29:37 | * | stefanos82 quit (Quit: Quitting for now...) |
21:30:48 | FromGitter | <kdheepak> I've set up `github-release` to build when I tag the repo. |
21:30:53 | FromGitter | <timotheecour> @araq I remember you recently discussed u had a feature to support arbitrary `importc` at CT and then dropped the feature; can’t find the thread on forum ; do you remember where it was? I’d really like to revive this |
21:30:56 | FromGitter | <kdheepak> https://github.com/kdheepak/github-release/releases/tag/v0.1.1-alpha |
21:34:45 | FromGitter | <kdheepak> Cross compiles for Windows on Travis and everything. |
21:37:18 | FromGitter | <kaushalmodi> @kdheepak Awesome! This might be useful to me |
21:38:08 | FromGitter | <kaushalmodi> I am curious, what does the github_release utility do? |
21:38:25 | * | funnelju joined #nim |
21:38:32 | FromGitter | <kaushalmodi> Travis CI already supports deploying to releases |
21:40:19 | * | funnelju quit (Remote host closed the connection) |
21:40:58 | FromGitter | <kaushalmodi> nvm.. so that utility is if you want to create github releases without using Travis, right? |
21:43:15 | * | PMunch quit (Remote host closed the connection) |
21:43:51 | AlexMax | Yo before most of you guys peace out for the night can I voice my support for https://github.com/nim-lang/Nim/issues/9001#issuecomment-426072675 ? |
21:44:28 | AlexMax | Man, I'd like it if openArray had a settable 'length' field attached to it |
21:59:09 | * | rockcavera quit (Ping timeout: 252 seconds) |
22:00:08 | * | elrood quit (Quit: Leaving) |
22:07:33 | * | malkomalko joined #nim |
22:08:49 | FromGitter | <kdheepak> @kaushalmodi that's right. Even if you wanted to do it on Travis, one might consider using the tool in a script. That way you can use the same script on gitlab-ci or appveyor etc. |
22:10:37 | * | PrimHelios joined #nim |
22:53:03 | * | PrimHelios quit (Ping timeout: 252 seconds) |
22:59:00 | * | krux02 quit (Remote host closed the connection) |
23:00:42 | * | noonien quit (Quit: Connection closed for inactivity) |
23:02:27 | * | arecaceae quit (Remote host closed the connection) |
23:02:46 | * | arecaceae joined #nim |
23:08:49 | * | vivus quit (Remote host closed the connection) |
23:37:01 | * | a__b__m quit (Quit: Leaving) |
23:43:02 | FromGitter | <bung87> how to wrap cpp vector const iterator? |
23:50:28 | * | rlr joined #nim |