<< 03-10-2018 >>

00:17:40FromGitter<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:23FromGitter<gogolxdong> How to convert array[256,char] to string?
02:22:23leorizewrite a custom `$` for it?
02:22:50leorizeor if that array is null terminated, you could cast it to a cstring then `$` it to get a string
02:36:51shashlick```
02:36:51shashlickvar a: array[3, char] = ['a', 'b', '\0']
02:36:54shashlickecho $(cast[cstring](addr a))
02:36:55shashlick```
02:36:57shashlick@gogolxdong
02:40:39*endragor joined #nim
02:43:33*endragor_ joined #nim
02:45:03*endragor quit (Ping timeout: 252 seconds)
02:45:36AlexMaxI could've sworn that something was added to 0.19.0 that wrapped a ptr, length combination in a type
02:45:55AlexMaxsomething like a gsl::span
02:52:22*rockcavera quit (Remote host closed the connection)
02:57:52*rockcavera joined #nim
03:47:10AlexMaxhttps://github.com/nim-lang/Nim/issues/9001
03:47:46*chemist69 quit (Ping timeout: 260 seconds)
03:48:07AlexMaxhope 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:17tankf33dershashlick: 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:21FromGitter<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:17FromGitter<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:06TangerOooh, 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:12FromGitter<alehander42> @kdheepak look at dump from sugar
08:17:58FromGitter<gogolxdong> Does Nim support IPv6 on windows?
08:17:58FromGitter<alehander42> but I think it might work only for one expression (dump)
08:18:28*PyroLagusPO joined #nim
08:20:25FromGitter<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:58FromGitter<kdheepak> I'll take a look @alehander42
08:24:37*PyroLagusPO quit (Remote host closed the connection)
08:27:14Araqgogolxdong, 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:30FromGitter<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:44FromGitter<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:00FromGitter<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:52FromGitter<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:35PMunchI've split my options PRs into four separate ones now: https://github.com/nim-lang/Nim/pull/8358#issuecomment-426577549
10:02:22FromGitter<narimiran> PMunch: securing that hacktoberfest t-shirt, huh? :D :D
10:02:35FromGitter<mratsim> busted
10:06:29PMunchHaha, I actually thought of that after doing the split
10:06:35PMunchBut yeah, I'm just 1 PR away now :P
10:20:32FromGitter<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:19FromGitter<narimiran> this year they explicitly ask you not to do stuff like that
10:31:38*SenasOzys quit (Ping timeout: 268 seconds)
10:40:17FromGitter<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:04FromGitter<gogolxdong> Is there an example of IPv6 listening and access?
11:11:23FromGitter<tim-st> does someone know how to dispatch a command `a` using the name `b` in `cligen`?
11:11:43FromGitter<tim-st> I only saw alias for variables...
11:11:47PMunchBy renaming it to b?
11:11:57FromGitter<tim-st> that's exactly what I dont want
11:12:06PMunchI was just joking
11:12:18PMunchYou could probably wrap it in a template
11:12:40FromGitter<tim-st> `dispatchMulti([startZimHttpServer, cmdName="server"])` seems to get recognized but fails if I actually run it using the alias
11:12:58PMunchHmm, that might be an issue then
11:13:08FromGitter<tim-st> ok, thanks
11:14:12*leorize joined #nim
11:18:34*ocelotsloth joined #nim
11:23:01FromGitter<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:45shashlickdom96: nimble is no longer copying all artifacts on install, has something changed in 0.9.0?
11:33:04shashlickTry the libsvm package for example
11:36:29*tzui joined #nim
11:37:50*ocelotsloth quit (Remote host closed the connection)
11:38:53PMunchshashlick, you mean how it doesn't take readme and license for example?
11:38:56FromGitter<mratsim> yes, that was breaking CI when you needed to pass custom flags
11:39:41FromGitter<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:38shashlickWell it copied libsvm.nim but not libsvm/* which is created by nimgen
11:50:57shashlickUsed to work before
11:51:45shashlicklibsvm.nim simply included files from the subdirectory which also contained the actual C++ source code
11:57:53FromGitter<mratsim> are you using `srcDir = [“libsvm”]` or the skipDir version?
12:02:31shashlickLatter
12:02:34shashlickhttps://github.com/genotrance/libsvm/blob/master/libsvm.nimble
12:06:57*SenasOzys quit (Quit: Leaving)
12:10:41FromGitter<gogolxdong> It works.
12:11:07FromGitter<gogolxdong> on windows IPV6
12:13:01shashlickTry pure 0.19.0 install
12:13:17shashlickFails on appveyor but passes for me as well locally
12:13:34shashlickFails on Linux for sure
12:21:01FromGitter<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:30FromGitter<kdheepak> I'm getting a clang error: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb4b9365331811c2e42ae8f]
12:42:38FromGitter<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:26FromGitter<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:00FromGitter<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:02FromGitter<tim-st> you are slicing on ascii
14:18:24*WanderingGlitchw joined #nim
14:20:20FromGitter<tim-st> `echo "“".len`
14:20:25FromGitter<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:55FromGitter<rokups> every time i come back to nim some basic thing is broken once again..
14:21:07FromGitter<tim-st> and `echo "ą".len`
14:21:48FromGitter<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:31FromGitter<tim-st> your slicing is just wrong:
14:22:33FromGitter<tim-st> var src2 = "ąčęėįšųū„“" ⏎ doAssert src2[2..^4] == expect
14:22:59FromGitter<tim-st> If you dont know the width of each unicode Rune uses `unicode.runes` instead
14:24:04FromGitter<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:20FromGitter<rokups> instead standard slicing operator for `string` is used which is wrong ofc
14:24:38FromGitter<tim-st> ok, so it's not a nim problem?
14:25:07FromGitter<rokups> nim does not call `proc `[]`*(s: ustring, slice: Slice[int]): ustring` operator. it is nim problem
14:25:43elroodthat's just what you have to deal with when using a new language with very little manpower behind it, rokups
14:27:29FromGitter<rokups> and scope too big for available hands yep
14:27:43FromGitter<gogolxdong> How to statically link SDL2.dll ?
14:27:56PMunchrokups, where is that defined? And how should Nim know not to call the string slice procedure in your case
14:28:03Tortice--passL="-static" ?
14:28:19elroodyou cannot statically link a .dll
14:28:45FromGitter<tim-st> PMunch: https://github.com/rokups/nim-ustring/blob/master/ustring.nim
14:29:02FromGitter<rokups> to be specific: https://github.com/rokups/nim-ustring/blob/master/ustring.nim#L550
14:29:32PMunchAah, I thought the code example you posted was complete
14:29:53FromGitter<rokups> nah, sorry, thats a wrong example to begin with :)
14:31:08*krux02 quit (Remote host closed the connection)
14:34:27PMunchIsn't that because the type is actually a HSlice[int, BackwardsIndex] in that case?
14:34:32PMunchAnd not a HSlice[int,int]
14:34:37PMunchie. a Slice[int]
14:35:12FromGitter<tim-st> but the compiler shouldnt fall back to the other `[]` though, because it's defined as `distinct string`
14:35:38FromGitter<rokups> there is an alias: `Slice*[T] = HSlice[T, T]`
14:35:59PMunchYeah but HSlice[int, BackwardsIndex] isn't HSLice[T,T]
14:36:09FromGitter<rokups> oh
14:36:10PMunchtim-st, that's a good point..
14:36:36FromGitter<rokups> guess that was intended breaking change and i need to handle `BackwardsIndex`
14:36:43PMunchYes
14:37:03FromGitter<rokups> *deep breath* ⏎ thanks :)
14:39:24*ocelotsloth quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:39:54FromGitter<dom96> shashlick: hrm. Possibly a bug, please report it.
14:40:41FromGitter<dom96> Note that nimble now tries to guess your package structure so that most packages "just work" instead of getting a warning.
14:42:09shashlickdom96: do you think there's any workaround?
14:43:15PMunchrokups, 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:24FromGitter<rokups> makes sense. adding handing of `BackwardsIndex` also fixes slicing
14:45:51*aalmoO joined #nim
14:45:51PMunchGreat!
14:46:31PMunchThat BackwardsIndex thing tripped me up as well first time I discovered it :P
14:48:13FromGitter<rokups> well good to know im not the only one confused here :)
14:48:16*aalmoO quit (Remote host closed the connection)
14:50:02PMunchI 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:35FromGitter<rokups> yeah well... its been talked over too much already.. but nothing will make me thing nim string slicing is sane :)
14:52:56PMunchHaha, why do you think it's not sane? Seems pretty well behaved IMO
14:54:38FromGitter<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:25PMunchIt drops the last two character, the null character and the one before that
14:59:00FromGitter<gogolxdong> How to run the GUI with sdl2+nuklear as well as listen on socket/.
14:59:06PMunchAnd then it adds on a new null character to have a valid string
14:59:09FromGitter<rokups> meh null character is just a detail. no mainstream language treats null as a part of string content
14:59:21PMunchWell, C is pretty mainstream
14:59:39PMunchBut I agree, I asked the exact same question when I first saw ^n
14:59:56FromGitter<rokups> c does not have string slicing in stdlib that would define this
15:00:06FromGitter<rokups> and again null is just a detail. string content is characters
15:00:38shashlick@gogolxdong - is nimnuklear still broken for you
15:00:42FromGitter<rokups> len("ab") returns 2 but as far as ^ is concerned string is 3 bytes long. confusing.
15:00:58elroodit'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:31PMunchelrood, hmm that's how Araq explained it to me back when I asked..
15:01:56*tankf33der left #nim (#nim)
15:02:10FromGitter<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:33FromGitter<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:12narimiranthink of ^n as -n in python, then it is less confusing or error-prone
15:05:22elroodif 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:34FromGitter<rokups> except its off by one narimiran
15:06:12*abm quit (Ping timeout: 252 seconds)
15:06:20FromGitter<rokups> in python "abc"[1:-1] == "b"
15:06:48elroodstill a bad design decision to not make ..^x be short for ..arr.len-x-1 imho
15:06:58FromGitter<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:39PMunchgogolxdong, a thread probably
15:08:00PMunchOr in an event loop kind of thing if Nuklear has that
15:08:28narimiran@rokups, it is not. because python's : excludes top of the range, and the equivalent in nim is `..<` (not `..`)
15:09:56FromGitter<rokups> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb4dbc43844923661db2bc7]
15:10:18FromGitter<gogolxdong> http://ix.io/1odJ
15:11:19FromGitter<gogolxdong> used a spawn for listen and asyncCheck for GUI render, seems that it trapped in a GUI loop.
15:11:26narimiran@rokups: let a = "abc"; assert a[1 ..< ^1] == "b"
15:11:55FromGitter<rokups> oh that is what you mean
15:12:00FromGitter<rokups> now that makes sense
15:12:23FromGitter<rokups> thanks :)
15:12:30FromGitter<kaushalmodi> @rokups https://scripter.co/notes/string-fns-nim-vs-python/#understanding-the-n-syntax 😁
15:14:12shashlickdom96: 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:21dom96You 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:30dom96gogolxdong: you just need to call asyncdispatch.poll from your GUI's event loop
15:23:34dom96You don't need threads
15:24:00*ocelotsloth joined #nim
15:25:02shashlickdom96: https://github.com/nim-lang/nimble/issues/548
15:25:18shashlickhave used choosenim to install so no debug versions here
15:26:40dom96You might be getting a debug version because IIRC I changed how `build` behaves
15:27:26shashlickand 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:43shashlickif the libsvm subdirectory already exists then nimble installs it just fine
15:27:54shashlickare you scanning package contents before `before install`
15:27:54dom96easy way to check: run `nimble -asadasd`
15:28:03dom96If you get a stack trace then it's in debug mode
15:28:41shashlickyep i do - why is choosenim not compiling this in release mdoe
15:29:01dom96Probably because `nimble build` defaults to debug mode now
15:30:26shashlickchoosenim calls `koch tools`
15:30:33dom96yeah, so koch needs to be fixed
15:30:36shashlickwith -d:release
15:32:13dom96also yeah, Nimble scans the package before installation and changes the package info object
15:32:46shashlickya that breaks anything you want to add in `before install`
15:32:49dom96https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/packageparser.nim#L280
15:33:13*tefter joined #nim
15:33:39FromGitter<gogolxdong> Error: unhandled exception: No handles or timers registered in dispatcher. [ValueError]
15:33:45dom96That gets hairy :(
15:33:55shashlickdom96, araq: looks like nimble in debug mode is intentional - https://github.com/nim-lang/Nim/blame/91c13a0163c692dd709eed1b0cf7eee0c19d0f96/koch.nim#L144
15:34:10Torticehey dom just wanted to say thanks again
15:34:21FromGitter<gogolxdong> don't quite understand how poll works.
15:34:32dom96gogolxdong: try `if asyncdispatch.hasPendingOperations: asyncdispatch.poll()`
15:34:42dom96In fact, Tortice should be able to help you :)
15:34:48dom96Tortice: No worries :)
15:34:52dom96I should head to work now
15:34:55dom96Later!
15:35:19dom96shashlick: 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:51FromGitter<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:51FromGitter... something wrong
16:02:07*floppydh quit (Quit: WeeChat 2.2)
16:02:53FromGitter<mratsim> the first one will be kept as is, and the one after will be converted
16:02:56shashlickdom96: https://github.com/nim-lang/nimble/issues/549
16:03:02FromGitter<mratsim> and it’s undocumented
16:04:11*rokups quit (Quit: Connection closed for inactivity)
16:06:22FromGitter<rokups> @mratsim i expected that as well, however it seems opposite thing happens
16:07:15FromGitter<mratsim> ^ Araq, this is inconsistent ;) with array \[0.float32, 1, 2\]
16:08:38*vivus joined #nim
16:08:54FromGitter<rokups> any idea when `BackwardsIndex` was introduced?
16:09:16narimiransomewhere around 0.18 IIRC
16:09:52FromGitter<rokups> hah i started checking blog posts from 0.17 and down. sigh
16:09:53FromGitter<rokups> thanks
16:12:34vivusdarn, the yaml lib has broken all my code :/
16:13:32FromGitter<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:16vivus@Vindaar this is what I was told is how it should be fixed: https://github.com/flyx/NimYAML/pull/62
16:14:29FromGitter<Vindaar> thanks yeah, that's where I started
16:15:07vivusif you want to discuss in DM, we can maybe fix it together
16:15:14FromGitter<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:48FromGitter<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:43FromGitter<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:27FromGitter<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:37FromGitter<rokups> hmm or maybe compiler version on ideone is older and has no regression
16:20:37FromGitter<kaushalmodi> @Vindaar are you on 64-bit Linux?
16:21:40vivuswhen using choosenim, are the nimble folders separate for each version of nim?
16:21:57FromGitter<rokups> indeed ideone has a working older version and this is a regression
16:24:09FromGitter<Vindaar> @kaushalmodi yep, I am
16:24:58FromGitter<kaushalmodi> can you please try out a static binary built using Nim (this time for a real project!) :)
16:25:06FromGitter<kaushalmodi> it has to do with Org tangling so pinged you
16:25:14FromGitter<Vindaar> sure, if you point me the right way :)
16:25:24FromGitter<kaushalmodi> binary download: https://github.com/OrgTangle/ntangle/releases
16:25:33narimiran@rokups: from ideone site: "language:Nim (nim 0.16.0)" -> well that is quite old
16:25:38*erratic joined #nim
16:25:39vivusdoes the code `rm -rf/` my system?
16:25:49FromGitter<rokups> old and working yep
16:25:49FromGitter<kaushalmodi> @Vindaar sample Org file: https://raw.githubusercontent.com/OrgTangle/ntangle/master/tests/tangle_no_yes.org
16:26:12FromGitter<kaushalmodi> just download, extract and run `ntangle FILE.org`
16:26:21FromGitter<kaushalmodi> (I need to work on `cligen` integration, etc.
16:29:24vivusall it tells me is: "parsing file.org" and then nothing happens after that
16:29:31Araqrokups: the match that implies the least amount of conversions is preferred
16:29:54Araqactually it's different, so let me explain how overloading resolution works (which is documented in the manual)
16:30:29vivus@kaushalmodi ^^^
16:30:33Araqand the regression may be because the compiler follows the spec more or less, so a bug report would be interesting anyway
16:30:50Araqthere are 4 different matching "kinds"
16:31:03Araq1. exact match (wanted int, got int)
16:31:05*darithorn joined #nim
16:31:10Araq2. generic match
16:31:27Araq3. subtype match (not that 'ranges' have a subtype relation)
16:31:32Araq4. conversion match
16:32:19Araqit is counted how many matches of the different kinds exist and the different match kinds have different priorities
16:33:40Araqa 'converter' call is always a conversion match
16:33:47FromGitter<rokups> in my case there are two arguments both of which are conversion match. what then?
16:33:54FromGitter<rokups> which one should be converted of two?
16:34:01Araqthen it's flagged as ambiguous
16:34:09FromGitter<rokups> no it isnt :D
16:34:10FromGitter<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:27vivusI was using 0.18.0 btw
16:34:39FromGitter<kaushalmodi> that shouldn't matter.. you downloaded the binary, right?
16:34:48FromGitter<rokups> i added self-contained testcase to https://github.com/nim-lang/Nim/issues/9165
16:34:53FromGitter<kaushalmodi> download that binary from the Releases link I pasted above
16:35:07FromGitter<Vindaar> @kaushalmodi that's what I also get
16:35:10FromGitter<kaushalmodi> then download the tangle_no_yes.org from the link above
16:35:22FromGitter<kaushalmodi> and do `ntangle tangle_no_yes.org`
16:35:30FromGitter<Vindaar> as in your snippet
16:35:50FromGitter<kaushalmodi> @Vindaar did you first type *yasnippet*?
16:36:11FromGitter<kaushalmodi> at least I thought I read so and I glanced again and it was *snippet* :P
16:36:29FromGitter<Vindaar> nope, I actually meant your snippet of the error message above :D
16:36:34FromGitter<kaushalmodi> :)
16:36:50FromGitter<kaushalmodi> OK, somehow it's not creating the new file.. odd.. investigating
16:37:06FromGitter<Vindaar> at least the binary itself is running, so that's good to know I guess?
16:37:33FromGitter<kaushalmodi> yep :)
16:37:55vivusflyx: 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:23vivusI mean no PR
16:42:40FromGitter<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:03FromGitter<kaushalmodi> not surprisingly, my tests access the Org files from a sub dir
16:43:05FromGitter<kaushalmodi> :P
16:44:39*TheLemonMan joined #nim
16:45:53TheLemonManshashlick, how long does it take you to wrap the zbar library?
16:49:38FromGitter<Vindaar> @kaushalmodi oh, indeed. Then it works
16:50:23FromGitter<Vindaar> that's pretty sweet
16:50:57shashlickTheLemonMan: https://github.com/ZBar/ZBar ??
16:51:10TheLemonManshashlick, yeah
16:51:31FromGitter<kaushalmodi> @Vindaar thanks for testing.. found the bug.. fixing it
16:52:14shashlickhasn't been updated in a long time, so the github should still be up to date
16:53:49TheLemonManyeah, as long as it works heh
16:54:23shashlickI can try real quick and see
16:54:29*malkomalko quit (Ping timeout: 244 seconds)
16:55:41vivushow 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:13shashlickyou can use version or commit hash `nimble install [email protected]"
16:56:51vivusty
16:57:29FromGitter<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:33FromGitter<kdheepak> https://github.com/kdheepak/github-release/releases/tag/releases
16:57:41TheLemonManI'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:01FromGitter<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:05FromGitter<kdheepak> I have to add more features to it but for now it's ready to be used!
17:00:41FromGitter<kdheepak> Latest releases will be on the `releases` tag.
17:01:40Araqrokups: I think what happened is that system.nim has different []= operators now, but I'll investigate
17:02:11FromGitter<kdheepak> Latest releases will be on the `releases` tag, for now.
17:04:46narimiranis 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:54narimirandid anyone else experienced the same?
17:07:19narimiranthis is the command i'm running: `nim doc -o:./docs/index.html ./src/itertools.nim`
17:07:23shashlickTheLemonMan: 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:17planetis[m]btw guys, what do u think of this macro post https://github.com/nim-lang/website/pull/108 ?
17:08:57TheLemonManshashlick, the C api is enough
17:09:36TheLemonManshashlick, see the end of include/zbar.h
17:09:55narimiranit works on the version of 0.18.1 i have from before
17:10:29*tzui quit (Ping timeout: 256 seconds)
17:10:38narimiran("Compiled at 2018-08-09")
17:10:40TheLemonManI 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:05FromGitter<kaushalmodi> @Vindaar , vivus: bug fixed release of https://github.com/OrgTangle/ntangle/releases ready
17:12:08shashlickTheLemonMan: ok cool
17:12:17FromGitter<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:57narimirancan anybody try by themselves running `nim doc` to see if you can reproduce this infinite loop, before i open an issue
17:14:23FromGitter<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:55FromGitter<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:59FromGitter<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:13TheLemonMannarimiran, a bug with nim doc getting into an infinite loop was recently fixed
17:17:34narimiranTheLemonMan: ok, so 0.19.1 is what i need?
17:17:48TheLemonMannarimiran, `devel` or bust
17:18:31narimiranok, 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:01narimiranalso, lines shorter than 80 characters are too long for the default width of nimdoc page :(
17:19:58shashlickTheLemonMan: do you care for this proc - https://github.com/ZBar/ZBar/blob/854a5d97059e395807091ac4d80c53f7968abb8f/include/zbar/Image.h#L73
17:20:01narimiranregarding 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:05TheLemonManline breaking is hard :(
17:20:25shashlickactually this one - https://github.com/ZBar/ZBar/blob/master/include/zbar.h#L1462
17:20:42shashlickit doesn't convert properly, commenting out for now, you might be able to fix it
17:20:49narimiranTheLemonMan: 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:32TheLemonManshashlick, yeah don't worry, it's just a thin wrapper around zbar_scan_y
17:22:18TheLemonMannarimiran, a cloud-hosted blockchain-powered neural network microservice (written in rust) decides where to put the newlines
17:22:25narimiran:D :D
17:22:29TheLemonManand it _does_ know better than you where to put them
17:23:25narimiranok, back to writing code, i can't argue with that :D
17:27:13FromGitter<Vindaar> @kaushalmodi just tested. Works perfectly even outside the directory!
17:28:34shashlickTheLemonMan: https://github.com/genotrance/nimzbar
17:28:41*krux02 joined #nim
17:28:42shashlick`nimble install https://github.com/genotrance/nimzbar`
17:28:50shashlickneed nimgen though and hope you have a working c2nim
17:29:09shashlickstill doesn't compile but I have to run for a bit
17:29:50TheLemonManyeah I'll give it a spin sometimes later, thank you!
17:31:12shashlicki'll bet we have to put something in config.h 😄
17:31:25shashlickget the right #defines to fire
17:32:28flyxvivus: I know that commit, there was a PR but author closed it shortly after https://github.com/flyx/NimYAML/pull/63
17:33:04Araqshashlick: c2nim tests are green and I ensured 0.18 can compile c2nim
17:33:10Araqanything else?
17:33:15flyxalso, 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:13vivus@kaushalmodi same problem still
17:35:11vivus@kaushalmodi what is the expected output?
17:36:18planetis[m]zetashift: It 's not a post about fsm but I can make a PR when its merged :)
17:39:21FromGitter<zetashift> No I know! just a small explanation not indepth ;P
17:39:48shashlickAraq: brilliant! now nimble's broken nimgen so let's see what to do next
17:40:01FromGitter<kaushalmodi> vivus: what is your OS?
17:40:09FromGitter<kaushalmodi> the binary will work only on 64-bit Linux
17:40:10vivusubuntu
17:40:15FromGitter<kaushalmodi> 64-bit?
17:40:18vivusyep
17:41:11FromGitter<kaushalmodi> hmm.. just confirming that you ran this: https://ptpb.pw/dL9A/bash
17:42:17FromGitter<kaushalmodi> vivus.. wait for a min
17:42:29FromGitter<kaushalmodi> after I created that snippet, I re-organized the tests
17:42:52vivusits probably just a weird edge case, as I ran it in a container
17:43:17FromGitter<kaushalmodi> not sure how that matters..
17:43:25FromGitter<kaushalmodi> updated quick test script: https://ptpb.pw/DX39/bash
17:43:37FromGitter<kaushalmodi> save that as a `foo.sh` and run `./foo.sh`
17:45:07FromGitter<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:23FromGitter<kaushalmodi> vivid: maybe creating new files is not allowed in your container?
18:04:37PMunchHmm, var x: range[10..100]; echo x # prints out 0
18:04:39PMunchThis seems like a bug
18:04:51PMunchIt defaults to something that isn't valid for that type
18:04:57FromGitter<kaushalmodi> Though, some error should have been thrown if that were the case.
18:06:14*nsf joined #nim
18:06:52TheLemonManPMunch, that's the zero-init curse, you can't do much about it
18:07:48FromGitter<kaushalmodi> @Vindaar so.. technically, now we can deploy Nim built binaries by just committing Org files :P
18:08:28FromGitter<kaushalmodi> Commit Org -> ntangle + nim musl happens over Travis
18:12:57FromGitter<Vindaar> hehe, now that's handy :D
18:13:29FromGitter<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:34FromGitter<Vindaar> *my
18:13:41*jjido_ joined #nim
18:14:11*manterolat joined #nim
18:14:22PMunchTheLemonMan, 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:58narimiranquick 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:13TheLemonManPMunch, yeah, I hope the RT (and CT?) range checks would catch it
18:15:48PMunchNope, it just tries to use the value..
18:16:13PMunchnarimiran, highly depends on the use-case
18:16:39PMunchBut I think for most practical purposes it should only generate one acbb
18:16:50narimirannim's algorithm.nextPermutation doesn't give you those duplicates, python's itertools.permutations gives you duplicates
18:17:26narimiran...and i'm torn between them :)
18:17:50PMunchWell, I can't think of any case where the Python way would be better
18:18:05PMunchI assume someone would want to try all the permutations, and it would just be double work
18:19:35narimiranwell, 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:03AraqPMunch: it produces a warning though
18:20:28narimirani 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:49PMunchHmm, 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:28PMunchAraq, that's true..
18:21:40PMunchAnd "This will become a compile time error in the future"
18:22:14PMunchProblem arises like this though: https://www.reddit.com/r/nim/comments/9jr50g/question_about_option_and_range/
18:23:01PMunchThe options module raises the error here: https://github.com/nim-lang/Nim/blob/devel/lib/pure/options.nim#L92
18:23:35FromGitter<kaushalmodi> narimaran: may be do some kind of seq -> set -> seq transformation?
18:23:40PMunchIt works fine if that's rewritten to "return Option[T](has: true, val: val)"
18:23:47FromGitter<kaushalmodi> That should get rid of duplicates
18:24:37narimiran@kaushalmodi can't do that because then your permutations of "abbc" would become: abc, acb, cab, ...
18:24:57FromGitter<kaushalmodi> Actually nevermind, sequtils should be having some deduplication proc for sews ⏎ s/sews/seqs
18:25:08narimiranyep, it exists
18:25:09FromGitter<kaushalmodi> I meant
18:26:03FromGitter<kaushalmodi> abcb, acbb, acbb,..-> abcb, acbb, ..
18:28:14*malkomalko joined #nim
18:29:25FromGitter<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:28narimiran@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:00FromGitter<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:23FromGitter<Vindaar> Whether you *want* duplicates or not is a different question for sure
18:32:47narimiran@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:11FromGitter<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:17FromGitter<Vindaar> ok that won't quite work, thinking more about it
18:38:45*malkomalko quit (Ping timeout: 252 seconds)
18:39:17FromGitter<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:07narimiran@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:04FromGitter<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:56kobi7hi guys
19:06:11*Vladar quit (Remote host closed the connection)
19:06:56kobi7when 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:37kobi7I am treating concepts like an interface in my mental model and not sure it's really the same.
19:08:27kobi7because the "matching type" doesn't really implement anything specifically. if it has the structure, then it's a concept match
19:09:21kobi7so, if I have a get; set; pair in a c# interface. can I represent that as a var inside a concept?
19:09:31kobi7I 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:02kobi7Nim in action doesn't have that information either
19:14:46stefanos82what's a concept?
19:15:46*xet7 quit (Quit: Leaving)
19:15:50kobi7https://nim-lang.org/docs/manual.html#generics-concepts
19:16:43*fvs joined #nim
19:17:24*xet7 joined #nim
19:18:39kobi7I 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:10kobi7it's a good thing, but there needs to be a list of what can be done with it and how
19:19:33kobi7(if newcomers are to understand)
19:20:32kobi7for example, look here: https://nim-lang.org/docs/manual.html#generics-generic-concepts-and-type-binding-rules
19:20:44kobi7 M.Rows == R
19:21:54kobi7does 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:54kobi7it's like an interface and a template in one.
19:23:36kobi7sorry for the rant. I like this idea, but it should be solidified better
19:24:22*francisl quit (Quit: francisl)
19:25:22kungtotteWell, the docs literally says this feature is in development.
19:26:10FromDiscord_<demotomohiro> M is a type and R is static int(generic parameter of AnyMatrix)
19:26:51stefanos82kobi7: this must be something really *really* new, because I did not know it until you mentioned it!
19:26:53kobi7Yes. it's like taking specs or contracts to the extreme. it's good for safety and for being explicit in the code.
19:27:14kobi7but coming from other languages, you need to map it to some concept you know in your head
19:27:56stefanos82Araq: is concepts something new that got added lately? I don't remember using it before
19:28:34FromDiscord_<demotomohiro> I think concept in Nim is something similar to concept in C++
19:28:35kobi7stefanos82: I think you can just go deeply in nim, or you can use the basics quite well
19:28:57kobi7oh, demotomohiro, I don't know c++ maybe that's why :/
19:29:11stefanos82kobi7: yes, you can do with macros and templates, but Concepts it's new to me
19:29:26stefanos82C++ is trying to promote it towards C++20; let's see how it will go...
19:30:00kobi7I understood it as something like interface from object oriented languages, but with contracts to specify not just structure but behaviour
19:31:42stefanos82well, a Concept describes the syntax and the semantics of supported operations of a type
19:31:57kobi7anyways, 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:15kobi7I want to make this a constructive report. sorry if it was taken otherwise
19:33:54kobi7thanks 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:08stefanos82it 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:41stefanos82what you said before about C#'s interface, yes it's true that it's that more or less how Concepts behave
19:35:22stefanos82kobi7: the docs are getting there
19:35:22kobi7only the types don't need to specify it by name, they are automatically added to that category based on their structure
19:35:48kobi7hmmm
19:35:49stefanos82you could provide valuable feedback in the form of a ticket
19:36:06stefanos82based on your personal experience around languages that support Concepts already
19:36:10stefanos82such as Java and C#
19:36:42kobi7:-)
19:36:57stefanos82even PHP supports Concepts at a great extend (since they mimic Java most of the times)
19:38:40kobi7ok, I see in the examples there is a way to specify "instance variables":
19:38:41kobi7 f.val is A
19:38:41kobi7 # The Functor should provide a way to obtain
19:38:41kobi7 # a value stored inside it
19:39:33kobi7so I don't need to mimic get and set in a weird way.
19:40:46kobi7I like this "don't repeat yourself" concise syntax. just wished there was easier docs
19:44:17stefanos82now 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:28stefanos82you can read more here if you want to kobi7 https://nim-lang.org/blog/2018/08/07/nim-partners-with-status.html
19:45:29kobi7yea, I've noticed accelerated pace
19:46:02kobi7I find the language very stable btw
19:46:25stefanos82maybe you could familiarize yourself with language's core elements and start contributing to it?
19:46:30kobi7vscode's multiple cursors feature is really cool :-) having some fun
19:46:45kobi7stefanos82: what do you mean?
19:47:07kobi7make a library?
19:47:16stefanos82kobi7: since you are an already experience developer with C#, you could help with Nim's TODO list
19:48:04stefanos82bringing in existing experience could improve many things and even inspire new methodologies
19:52:42kobi7I 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:30kobi7most days it's hard to find the time too. but it is tempting:)
19:54:52stefanos82well, if you can report bugs, that's also considered contribution to language's stability and evolution
19:54:55*francisl joined #nim
19:55:17stefanos82so technically, it can make you an official contributor if you provide a solution to each reported bug
19:56:10kobi7yes, that's a good starting point. explain the docs better from my background.
19:56:33kobi7cool, I might just do something like that
19:57:05FromDiscord_<demotomohiro> I wrote simple example of nim concept
19:57:09FromDiscord_<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:39jxyhi 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:53Araqjxy: type CComplex {.importc: "...", header: "...".} = object
20:24:09stefanos82Araq: you got me lol
20:24:16stefanos82I was about to suggest c2nim as well
20:24:34Araqdidn't mention c2nim
20:25:36stefanos82I meant "as an alternative"
20:27:51jxybut what can I do with these var x:CComplex?
20:28:10jxycast them to Complex?
20:28:46jxywould it be safe to cast stdlib Complex to this CComplex?
20:30:28Araqobviously not :P
20:31:04AraqI 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:37FromGitter<kdheepak> Hi all, thanks for helping me with the parser questions the other day. I really appreciate it.
20:38:03FromGitter<kdheepak> I've made the parser open source, and now can share the code and answer more specific questions.
20:38:31FromGitter<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:43FromGitter<Varriount> @kdheepak Avoid using `cast`, use object conversions instead.
20:41:53FromGitter<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:55FromGitter<kdheepak> How do you do object converstions?
20:43:30FromDiscord_<demotomohiro> @kdheepak is your project is related to OpenGL Mathematics (GLM)?
20:43:31FromDiscord_<demotomohiro> https://glm.g-truc.net/0.9.9/index.html
20:43:38FromGitter<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:34FromGitter<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:43FromGitter<kdheepak> It's a mixture of C and a custom format.
20:45:13FromGitter<kdheepak> This is an example of what I need to parse: https://github.com/NREL/glm/blob/master/tests/data/4node.glm
20:48:48FromDiscord_<demotomohiro> I didn't know about GridLAB-D
20:53:16*a__b__m joined #nim
20:54:34FromDiscord_<demotomohiro> @kdheepak you are using Makefile in your project and it is not used for building C/C++ code.
20:55:33FromDiscord_<demotomohiro> Just type 'make' is much shorter than using nimble command
20:57:11Araqshell aliases, command completion, command history
20:57:21*a_b_m quit (Ping timeout: 260 seconds)
21:00:06FromGitter<kdheepak> @demotomohiro are you saying I shouldn't use Make?
21:01:26*narimiran quit (Ping timeout: 260 seconds)
21:02:12FromDiscord_<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:28FromGitter<dom96> Indeed, you shouldn't use make. Nimble is all you need
21:03:15FromDiscord_<demotomohiro> When I used C++, I wrote Makefile but I thought it is complecated. So I started to use CMake.
21:05:42FromDiscord_<demotomohiro> Writing CMake file was easier than writing Makefile to build C++ but anyway, CMake is also complicated language
21:12:36Araqhttps://youtu.be/PN-I6u-AxMg?t=80 Nim is mentioned by PBS!
21:13:05FromGitter<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:20stefanos82Araq: lol, that's the game, not the language
21:22:39*rlr quit (Ping timeout: 256 seconds)
21:22:43Yardanicostefanos82 but it's nim :P
21:22:46vivus@Vindaar you still around?
21:22:50stefanos82of course :D
21:25:15elroodkdheepak, you could create a separate repository just for your makefiles, and then use symlinks into that repo in your projects
21:26:05FromGitter<kdheepak> @elrood that would do it, wouldn't it.
21:26:25FromGitter<kdheepak> I'd have to globallly gitignore all Makefiles but unignore them in some repos.
21:28:47FromGitter<kdheepak> I obsessively type `make` when I'm working in the terminal. Sometimes from within vim with `:Make`.
21:29:19FromGitter<kdheepak> It's my live reload
21:29:37*stefanos82 quit (Quit: Quitting for now...)
21:30:48FromGitter<kdheepak> I've set up `github-release` to build when I tag the repo.
21:30:53FromGitter<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:56FromGitter<kdheepak> https://github.com/kdheepak/github-release/releases/tag/v0.1.1-alpha
21:34:45FromGitter<kdheepak> Cross compiles for Windows on Travis and everything.
21:37:18FromGitter<kaushalmodi> @kdheepak Awesome! This might be useful to me
21:38:08FromGitter<kaushalmodi> I am curious, what does the github_release utility do?
21:38:25*funnelju joined #nim
21:38:32FromGitter<kaushalmodi> Travis CI already supports deploying to releases
21:40:19*funnelju quit (Remote host closed the connection)
21:40:58FromGitter<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:51AlexMaxYo 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:28AlexMaxMan, 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:49FromGitter<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:02FromGitter<bung87> how to wrap cpp vector const iterator?
23:50:28*rlr joined #nim