<< 02-10-2018 >>

00:00:41Torticehey, I finally have working gui, this is great
00:01:02Torticesorry for all the general dumbness, but I greatly appreciate all of the help
00:01:57FromDiscord_<Shield> can't get ui to compile on windows :/
00:02:23Torticeoh man, really?
00:03:10FromDiscord_<Shield> are you using dynamic or static linking?
00:03:37AlexMaxah dangit
00:03:50AlexMaxDoes anybody else have any success getting nimPNG working?
00:03:51AlexMaxhttps://github.com/jangko/nimPNG/issues
00:04:02AlexMaxI tried installing it from nimble and got an error when importing it
00:04:06AlexMaxhttps://github.com/jangko/nimPNG/issues/24
00:05:38TorticeI haven't tested a build on windows yet
00:08:19FromGitter<dom96> Tortice: Don't worry about it, it takes a while to get that async instinct but once you do it'll be smooth sailing :)
00:08:30FromDiscord_<Shield> whenever a library needs to do compiling and static linking it just doesn't work for me..
00:10:55*malkomalko joined #nim
00:11:34*Yardanico quit (Ping timeout: 240 seconds)
00:13:28*malkomalko quit (Quit: leaving)
00:13:28*Tortice quit (Read error: Connection reset by peer)
00:14:47*Tortice joined #nim
00:17:29*malkomalko_ joined #nim
00:19:01*Yardanico joined #nim
00:21:19*malkomalko_ is now known as malkomalko
00:21:54*malkomalko quit (Client Quit)
00:23:53*malkomalko joined #nim
00:24:17malkomalkoHey everybody! Just wanted to introduce myself as I'm a new Nim user who is really excited to dig in.
00:26:18AlexMaxWelcome to Zombo.com
00:26:22AlexMax...I mean, to Nim
00:26:26malkomalkolol
00:26:35AlexMaxHow far have you gotten?
00:28:10stefanos82welcome aboard malkomalko
00:28:37FromGitter<kayabaNerve> AlexMax: "Compiler update which changes how the language works breaks un-updated packages."
00:29:39FromGitter<kayabaNerve> @dom96 Nim 0.19.0 had an interesting side effect for me, but only on Windows; not on Linux. If you call `await socket.recv()` on a dc'd client, it instantly returns "", and never lets other async code runs.
00:29:50FromGitter<kayabaNerve> Side effect/change in how async works.
00:32:12FromGitter<kayabaNerve> Anyways. Just had to check if the client was dc'd.
00:34:50*ewookgo joined #nim
00:35:58*ocelotsloth joined #nim
00:36:42*ewookgo quit (K-Lined)
00:41:44*neonfuzqY joined #nim
00:45:29*neonfuzqY quit (Remote host closed the connection)
00:47:22Torticeany idea what this is caused by? mingw is in %PATH% http://0x0.st/sYfI.png
00:49:22*rnrwashere joined #nim
01:00:56*roundtrip joined #nim
01:02:00*roundtrip quit (Remote host closed the connection)
01:04:18*rnrwashere quit (Remote host closed the connection)
01:07:03*luk3yxOP joined #nim
01:10:12*luk3yxOP quit (Remote host closed the connection)
01:12:16*M144Cb joined #nim
01:15:28*M144Cb quit (Remote host closed the connection)
01:17:31*druonysus quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:17:55*druonysus joined #nim
01:17:55*druonysus quit (Changing host)
01:17:55*druonysus joined #nim
01:19:19*druonysus quit (Client Quit)
01:19:44*druonysus joined #nim
01:19:44*druonysus quit (Changing host)
01:19:44*druonysus joined #nim
01:23:46*rnrwashere joined #nim
01:24:30*ocelotsloth quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:24:34*smt quit (Read error: Connection reset by peer)
01:26:15*rnrwashere quit (Remote host closed the connection)
01:33:02FromGitter<citycide> Tortice: hey I'm the author of `glob` and I see you ran into an error earlier, did you figure it out or report it anywhere?
01:34:34TorticeI did not, I switched away from glob to walkDir and walkDirRec
01:35:12FromGitter<citycide> that's sad to hear. if you have a chance I'd appreciate more info or a bug report either in `glob` or Nim (wherever it's most relevant)
01:35:17Torticehttps://ptpb.pw/lMf0/nim is the relevant code that produces the bug
01:35:31FromGitter<citycide> I'll look at it quick
01:36:48FromGitter<citycide> Tortice: any specific line or proc? that's a pretty good chunk of code
01:37:51FromGitter<citycide> nvm assuming it's one of the walkGlob usages but just by looking at it I couldn't say which one
01:39:10*voiceftp quit (Read error: Connection reset by peer)
01:39:36*stefanos82 quit (Quit: Quitting for now...)
01:39:54Tortice77 or 82? Error: internal error: environment misses: dir
01:42:17*ocelotsloth joined #nim
01:43:08*malkomalko quit (Quit: leaving)
01:43:16FromGitter<citycide> I think it's an issue with `toSeq`, probably in combination with the `%` string formatter
01:43:41FromGitter<citycide> sounds like it isn't able to lookup the `dir` identifier through the template
01:44:09FromGitter<citycide> TLDR I doubt this is a glob issue and should likely be a Nim issue
01:44:11Torticearaq wanted a bug report if you're able to get a small test case
01:45:54FromGitter<citycide> I wonder if it'd be different if you use `stformat` instead of `%`
01:46:08FromGitter<citycide> `strformat` *
01:47:53*malkomalko joined #nim
01:48:44*bill-augerBB joined #nim
01:50:42*bill-augerBB quit (Remote host closed the connection)
01:51:02FromGitter<citycide> Tortice: actually have you tried escaping "type" in `for type in types`? `type` is a reserved word, and I wonder if that's affecting it
01:51:20FromGitter<citycide> try renaming it or wrapping it with backticks
01:51:26TorticeI did not try that
01:51:38TorticeI'll give it a shot
01:52:35Torticejust for `type` in types, right?
01:52:49FromGitter<citycide> wherever you use the name "type" as an identifier
01:53:02FromGitter<citycide> either rename the identifier everywhere or put backticks around it every time you use it
01:54:22TorticeI changed the identifier type to a_type, and that did not solve it, neither did backticks
01:54:47FromGitter<citycide> hmm alright
01:59:29*ocelotsloth quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:03:14FromGitter<kdheepak> Hi all. I've cross compiled a binary from Nim on a Travis build for Windows.
02:03:33FromGitter<kdheepak> However, I'm unable to run it on Windows. It is not even an executable.
02:03:42FromGitter<kdheepak> Any suggestions on what might be going on?
02:05:26FromGitter<zacharycarter> hrm
02:05:37*ocelotsloth joined #nim
02:05:58FromGitter<zacharycarter> I have this - https://github.com/fragworks/frag-samples/blob/master/desktop/space-shooter/dist/win64/Dockerfile
02:06:04FromGitter<zacharycarter> but I doubt it's going to be of muc use
02:06:07FromGitter<zacharycarter> much* use
02:06:16FromGitter<zacharycarter> but that's the last time I tried to cross-compile for windows
02:06:46FromGitter<zacharycarter> maybe it will lead to some clues - but probably not - and definitely no promises
02:07:26FromGitter<zacharycarter> also - OSX is the operating system all these dockerfiles were run from
02:17:54*ocelotsloth quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:20:56FromGitter<gogolxdong> Hi, @zacharycarter How are you doing? nuklear snippet is like now ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb2d607ef4afc4f2805c235]
02:21:24*ocelotsloth joined #nim
02:27:54FromGitter<kdheepak> Thanks @zacharycarter will take a look!
02:28:50*roidelapluieux joined #nim
02:29:17*dddddd quit (Remote host closed the connection)
02:33:56*roidelapluieux quit (Ping timeout: 272 seconds)
02:37:32*hodappZy joined #nim
02:38:47*hodappZy quit (Remote host closed the connection)
02:45:50TorticeShield, were you able to get anything using "ui" to build on windows? I can't even build the controllgallery example
02:46:48*malkomalko quit (Ping timeout: 252 seconds)
02:47:45*rnrwashere joined #nim
02:53:06*malkomalko joined #nim
03:00:11FromGitter<citycide> has anyone successfully used `nim doc` with 0.19.0? it SIGSEGVs for me
03:04:41*rnrwashere quit (Remote host closed the connection)
03:15:06FromGitter<gogolxdong> After half a day of reading the calculator.nim example code , kind of understand how the edit_string works with cstring, and worked my use case out as follows: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb2e2bae65a6343366d8354]
03:16:54*rnrwashere joined #nim
03:19:46*francisl joined #nim
03:23:31FromGitter<gogolxdong> backspace doesn't work correctly.
03:24:46*francisl quit (Quit: francisl)
03:46:38*ocelotsloth quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
03:48:19*chemist69 quit (Ping timeout: 252 seconds)
03:50:13*chemist69 joined #nim
03:53:54dom96https://nim-lang.org/blog/2018/10/01/hacktoberfest-with-nim.html
03:53:58dom96miran ^
03:55:02*rnrwashere quit (Remote host closed the connection)
03:55:53dom96yay, thanks for picking it up :)
03:57:40*rnrwashere joined #nim
04:04:39FromGitter<citycide> would anyone with nim `0.19.0` handy be willing to clone down `citycide/glob` and try to `nim doc -o:docs src/glob.nim` ? I've tried it on 2 machines and it fails with SIGSEGV and want to confirm it's not just me before I open an issue
04:05:28FromGitter<citycide> though I should try linux, have only tried windows so far
04:07:18*ocelotsloth joined #nim
04:07:33FromGitter<kaushalmodi> @citycide I'm on RHEL 6.8. It did not crash, but I got this error:
04:07:35FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb2ef076e5a401c2d0295fc]
04:08:21FromGitter<kaushalmodi> and here's that Nim example: https://ptpb.pw/IqFT/nim
04:08:23*rnrwashere quit (Remote host closed the connection)
04:08:57FromGitter<citycide> oh right there's a few errors in the runnables... one of them is user (me) and the others I think are because docgen changes the way code is formatted and it comes out indented incorrectly
04:09:00FromGitter<citycide> that's a separate issue
04:09:03FromGitter<citycide> forgot about those
04:09:39FromGitter<citycide> I'll fix that example real fast
04:11:22*rnrwashere joined #nim
04:12:28*darithorn quit (Quit: Konversation terminated!)
04:12:55FromGitter<citycide> @kaushalmodi I pushed fixes for those so if you could, pull down master and please try again
04:25:40*NimBot joined #nim
04:25:45FromGitter<kaushalmodi> tried `-o:docs/.`
04:25:45FromGitter<citycide> must be a windows issue then? I'll see if I can try on linux...
04:26:12FromGitter<kaushalmodi> without `-o:docs`, the html is created in `src/glob.html`
04:29:07*malkomalko quit (Ping timeout: 268 seconds)
04:35:33*kapil____ joined #nim
04:35:36*ocelotsloth quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
04:38:24FromGitter<citycide> @kaushalmodi thanks
04:38:42FromGitter<citycide> tried `nim doc -o:docs/index.html src/glob.nim` on linux and it also SIGSEGVs
04:39:09FromGitter<kaushalmodi> hmm.. I am on 64-bit, if that matters
04:40:48FromGitter<citycide> so am I, Ubuntu 14.04.5 LTS (old but it's through c9.io)
04:41:24FromGitter<kaushalmodi> it couldn't be older than RHEL 6.8 :P
04:42:02FromGitter<citycide> I'm not familiar 😄 I'm primarily a windows user but I use linux a decent bit for dev
04:44:30FromGitter<citycide> if I `choosenim 0.18.0` that same command works, so something is definitely wrong in v0.19.0
04:45:08FromGitter<citycide> or breaks something in my code I suppose
04:48:44*miran joined #nim
04:57:51*rnrwashere quit (Remote host closed the connection)
05:02:48*malkomalko joined #nim
05:07:36*malkomalko quit (Ping timeout: 252 seconds)
05:12:40*sling00vJ joined #nim
05:17:35*sling00vJ quit (Remote host closed the connection)
05:25:20*nsf joined #nim
05:56:48*arecaceae quit (Remote host closed the connection)
05:57:07*arecaceae joined #nim
06:09:06*krux02 joined #nim
06:14:34*miran quit (Ping timeout: 268 seconds)
06:15:43*initself_oQ joined #nim
06:17:44*initself_oQ quit (Remote host closed the connection)
06:32:18*rokups joined #nim
06:38:37*kzemekxE joined #nim
06:45:49*kzemekxE quit (Remote host closed the connection)
06:47:04*malkomalko joined #nim
06:51:51*malkomalko quit (Ping timeout: 260 seconds)
06:51:54*xet7 quit (Remote host closed the connection)
06:54:12*chemist69 quit (Ping timeout: 252 seconds)
06:54:39*chemist69 joined #nim
06:54:42*xet7 joined #nim
07:04:34*erratic quit (Ping timeout: 240 seconds)
07:08:15tdcvi ~/.tmux.conf
07:10:46*bogus-Ch joined #nim
07:13:10*bogus-Ch quit (Remote host closed the connection)
07:34:00*Arrrr joined #nim
07:34:23*pwntus quit (Remote host closed the connection)
07:38:49*pwntus joined #nim
07:38:53*PMunch joined #nim
07:47:48*erratic joined #nim
07:48:06*shanafC joined #nim
07:49:26FromGitter<Bennyelg> any equivalent to the python slice arr[1:] ?
07:49:48*voiceftp joined #nim
07:50:00FromGitter<Bennyelg> only arr[1:arr.len - 1] ?
07:50:42Arrrrarr[1 .. ^1] ?
07:52:36*shanafC quit (Remote host closed the connection)
07:53:20FromGitter<Bennyelg> thanks
07:57:42*tankf33der joined #nim
07:58:03tankf33dermorning
07:58:23PMunchHi tankf33der
07:58:29tankf33derwhere can i post nimble request ? forum ?
07:58:51PMunchWhat do you mean a Nimble request?
07:59:17PMunchA request for a new package, a request to have one of your own packages added to Nimble, or a feature request to Nimble itsef
07:59:27*natrys joined #nim
07:59:37*floppydh quit (Quit: WeeChat 2.2)
07:59:57Arrrrmaybe a github issue
08:00:01tankf33deri need a nimble for monocypher
08:01:19PMunchWell you could make an issue here: https://github.com/nim-lang/needed-libraries/issues
08:01:23PMunchOr on the forums
08:01:35*floppydh joined #nim
08:02:33Tangertankf33der: You could also try wrapping the libraries yourself. https://monocypher.org/ states that the .c and .h files have no dependencies and compile to C99 or C++
08:02:57Tangerhttps://gist.github.com/zacharycarter/846869eb3423e20af04dea226b65c18f - For getting started
08:03:20*gmpreussner_ quit (Ping timeout: 252 seconds)
08:03:48*gmpreussner joined #nim
08:03:51tankf33derTanger: thanks.
08:03:57*l1xoX joined #nim
08:04:22TangerMight be faster than waiting for someone else to do it. And maybe, it might just work out of the box with c2nim
08:04:51*chedrje joined #nim
08:04:55tankf33deri will play with c2nim
08:05:08ZevvAPI seems pretty straightforward. No data structures, no states
08:05:26Zevvoh some states, crypto_blake2b_ctx and such
08:05:57*chedrje quit (Remote host closed the connection)
08:06:00tankf33dermaybe i can spy on libsodium wrapper
08:06:09tankf33derand see how they did it.
08:08:01*l1xoX quit (Remote host closed the connection)
08:09:00TangerZevv: What's c2nim's issue with states?
08:10:51Tangertankf33der: This guide is pretty outdated, but it might give you some extra perspective on the subject: http://goran.krampe.se/2014/10/16/nim-wrapping-c/
08:12:23tankf33derTanger: thanks.
08:12:35tankf33derso my destination is c2nim
08:12:35tankf33derok
08:13:03TangerI think the general idea is to let c2nim have a crack at it, then fix any parts up manually
08:15:14*smt joined #nim
08:26:40PMunchProblem is that c2nim isn't too happy about pre-processor things
08:30:34*rnrwashere joined #nim
08:31:33FromGitter<mratsim> @tankf33der this is probably the best example of a wrapper for crypto lib: https://github.com/status-im/nim-secp256k1
08:32:56FromGitter<mratsim> and if you only need blake2b, it’s supported in Nimcrypto: https://github.com/cheatfate/nimcrypto/blob/master/nimcrypto/blake2.nim
08:34:40*rnrwashere quit (Ping timeout: 250 seconds)
08:34:43*creeschHs joined #nim
08:35:36FromGitter<mratsim> Example usage in streaming hash: https://github.com/status-im/nim-beacon-chain/blob/edac536f10533107c87a691a3fdbf97cee688f53/beacon_chain/state_transition.nim#L70, and in simple non-streaming mode: https://github.com/status-im/nim-ethash/blob/master/src/proof_of_work.nim#L206
08:39:55*rnrwashere joined #nim
08:41:46*creeschHs quit (Remote host closed the connection)
08:42:57*couven92 joined #nim
08:44:12*rnrwashere quit (Ping timeout: 250 seconds)
08:47:53*malkomalko joined #nim
08:48:52FromGitter<Bennyelg> @Aarq, @dom96 @mratsim @Miran
08:49:22FromGitter<Bennyelg> why we always need to pass this annying cmp parameter , why it can't be something like ⏎ https://gist.github.com/Bennyelg/a40da9b7acdbf660f87d8eb9de878d13
08:51:10*milp joined #nim
08:52:33*malkomalko quit (Ping timeout: 252 seconds)
08:55:04FromGitter<narimiran> @Bennyelg because we need to tell nim how to compare the elements. for built-in types there is `cmp`, for your custom types, you need to define your own function for comparing
08:55:49FromGitter<narimiran> another question is "why `cmp` is not passed to `sort` as a default argument", and recently somebody answered that, i think on github
08:56:36FromGitter<Bennyelg> Ic thanks, cmp as a default of any built-in type should be sufficient
08:57:52FromGitter<mratsim> wasn’t there a PR that made it default?
08:58:26*milp quit (Remote host closed the connection)
09:01:10FromGitter<narimiran> https://github.com/nim-lang/Nim/issues/8684
09:01:33Arrrrhttps://github.com/nim-lang/Nim/pull/8778
09:15:53*aykutCR joined #nim
09:17:08*aykutCR quit (K-Lined)
09:19:51*Dollar_ joined #nim
09:22:27*Dollar_ quit (Remote host closed the connection)
09:23:06*DouglasKBR joined #nim
09:23:13*DouglasKBR quit (Remote host closed the connection)
09:38:34*hardc0der joined #nim
09:42:07*hardc0der quit (Remote host closed the connection)
09:47:07*pikluDr joined #nim
09:47:37*pikluDr quit (Remote host closed the connection)
09:51:34FromGitter<Bennyelg> Still didnt get the cmp thing. ⏎ If you have custom type and you want to order it you need to implement the `<` `>` ... and just send it to the sort regullarly
09:53:06ArrrrPropose it
09:53:17FromGitter<tim-st> If you have a custom type, you define your own `proc cmpMyCustomType(a, b: MyCustomType): int` and just pass this to sort
09:53:50FromGitter<Bennyelg> not trivial at all (in my humble opinion)
09:53:53ArrrrThe advantage of the current approach is that you may define more than one cmp for different purposes
09:54:42FromGitter<Bennyelg> but you make you code less readable ? if you compare 2 things it must have only 1 approach
09:54:46FromGitter<tim-st> @Bennyelg it is the only way to make it correct, otherwise it's completely unknown how to sort an custom object that has x fields
09:55:46FromGitter<Bennyelg> ```proc `<`(c, otherC: myCustomHugeObject): bool = ⏎ # write your logic``` [https://gitter.im/nim-lang/Nim?at=5bb340a2ae7be94016ec69ba]
09:56:12*NobodyCamHy joined #nim
09:56:33FromGitter<Bennyelg> my point is cmp most of the time hide the logic
09:56:38FromGitter<tim-st> you dont have to implement `<`, only `cmp` is needed
10:02:23*NobodyCamHy quit (Remote host closed the connection)
10:14:27*endragor joined #nim
10:33:37FromGitter<mratsim> cmp is to make comparison generic
10:33:57FromGitter<mratsim> the sort proc only has to deal with -1, 0 and 1
10:36:23*elrood joined #nim
10:36:47FromGitter<mratsim> though I’d like if Nim inlined the cmp proc, currently it has to go through a pointer indirection. ⏎ ⏎ in C++ you could use `struct myCmp{__forceinline__ void operator()(int a, int b){…}}`
10:37:42FromGitter<mratsim> you can use templates but that means using it\[0\] and it\[1\] or a and b injection magic
10:38:02TorticeWas anybody able to compile the ui examples on windows?
10:39:16FromGitter<mratsim> btw, hyping my experiment at data visualization in Nim
10:39:24FromGitter<mratsim> (https://files.gitter.im/nim-lang/Nim/AkMO/2018-10-01_23-55-58.png)
10:40:27FromGitter<mratsim> @narimiran ^ @Vindaar
10:40:28FromGitter<narimiran> @mratsim a new plotting library? looking nice! is source available?
10:40:54FromGitter<mratsim> Well yeah but I only spent ike 30min on it: https://github.com/numforge/monocle
10:41:45FromGitter<mratsim> just clone, and `nim c -r` this file https://github.com/numforge/monocle/blob/master/src/monocle/viz.nim
10:41:52FromGitter<narimiran> well, your 30min is something like 6 hours for me ;)
10:42:46FromGitter<narimiran> btw, i've just read the issues you marked as easy in arraymancer (i'm trying to see what i can do for hacktoberfest) and — those might be easy for you, but definitely not for me :D
10:42:53FromGitter<mratsim> lol
10:43:05FromGitter<mratsim> which one?
10:44:41FromGitter<narimiran> well, i just spend 5min (that's something like 2 seconds in your world), but everything looks cryptic to me :D
10:45:13FromGitter<narimiran> the problem is that i didn't use arraymancer that much so i'm not very familiar with it
10:45:23FromGitter<mratsim> well, I was super active this weekend and opened lots of issues so I could get those out of my mind
10:46:00FromGitter<mratsim> I finally have recurrent neural net working, with an example: https://github.com/mratsim/Arraymancer/blob/master/examples/ex05_sequence_classification_GRU.nim
10:46:20FromGitter<narimiran> i think i might switch my attention to `neo`, as i have used it a lot more and i'm more familiar with its source code and "how it works"
10:46:54FromGitter<narimiran> for `arraymancer` i might be able just to fix the documentation, or something like that :)
10:48:07FromGitter<mratsim> no problem. Unfortunately, when you keep adding stuff it becomes quite handle everything.
10:48:46*malkomalko joined #nim
10:48:57FromGitter<narimiran> back to plotting lib: i haven't used any of the current nim offerings (i still use matplotlib), but i feel we still lack "one big/capable plotting lib" (correct me if i'm wrong)
10:49:07*btbytes joined #nim
10:49:10FromGitter<mratsim> I’m not that happy about how iterations works. It’s effective but I keep wondering if the iteration scheme I use in the Julia challenge would be faster: https://github.com/mratsim/nim-julia-challenge/blob/master/src/tensor.nim
10:50:17FromGitter<mratsim> we do, I didn’t try Plotly either though vindaar used it to create this very nice viz: https://github.com/Vindaar/NeuralNetworkLiveDemo
10:50:27FromGitter<mratsim> we do lack one*
10:51:10FromGitter<narimiran> i guess i should give https://github.com/brentp/nim-plotly a try
10:51:22*natrys quit (Quit: natrys)
10:51:49FromGitter<mratsim> My goal with monocle is that you can just do something like a.plot({“x”: {“time”, months}, “y”: {“volume”, unit}}) and be done
10:51:54FromGitter<narimiran> i see that @Vindaar is very active in that repo
10:52:58*malkomalko quit (Ping timeout: 245 seconds)
10:53:34FromGitter<mratsim> i.e. a declarative visualisation, I will use vega-lite that you can check there: https://github.com/vega/vega-lite
10:53:59FromGitter<mratsim> see for example: https://vega.github.io/editor/#/examples/vega-lite/stacked_bar_h
10:55:34FromGitter<alehander42> btw just a quick quasi-poll: would people prefer `match .. of pattern: branch.. of pattern: .. else .. ` syntax or `match .. pattern: branch pattern: .. _ ..` (similar to patty) syntax
10:55:45FromGitter<mratsim> math pattern
10:55:48FromGitter<mratsim> match*
10:56:32FromGitter<mratsim> Something like this: https://wiki.haskell.org/The_Fibonacci_sequence#Naive_definition
10:56:46FromGitter<narimiran> i've seen python plotting lib altair (https://altair-viz.github.io/) using vega and vega-light, and the results (here i mean: how you write your code for viz creation) look quite nice
10:57:13FromGitter<Vindaar> @mratsim nice, will take a look later today! ⏎ @narimiran yeah, I use it pretty heavily! The nice thing about plotly.js is that it basically provides every functionality you might need for plotting. And since it's controlled via JSON anything that isn't yet implemented in nim-plotly can quite easily be added :)
10:57:16FromGitter<mratsim> I’m really bad at matplotlib :P I don’t want to deal with all those stuff
10:57:34FromGitter<Vindaar> I think the idea of Vega is awesome, but it really needs a nice interface
10:57:51FromGitter<Vindaar> (I don't want to write JSON like code in order to create a plot...)
10:58:05FromGitter<mratsim> @Vindaar see this: https://youtu.be/9uaHRWj04D4?t=1478
10:58:30FromGitter<mratsim> And beyond Voyager (for data exmplo) they have Lyra which is Tableau-like
10:58:38FromGitter<mratsim> data explo*
10:58:54FromGitter<Vindaar> will grab lunch now, but I'll check it out afterwards!
11:00:41FromGitter<alehander42> @mratsim well now it's more like ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I can also do match-based overloading of procs like in https://github.com/alehander42/poly , but I haven't thought about it a lot yet [https://gitter.im/nim-lang/Nim?at=5bb34fd91e23486b937784cb]
11:02:06FromGitter<narimiran> i'll repeat my thoughts here publicly: the first one (without `of`, with `_` for 'everything else', and indented) looks much cleaner to me
11:05:01*PMunch quit (Ping timeout: 268 seconds)
11:05:18*ocelotsloth joined #nim
11:08:01leorize!eval echo NimVersion
11:08:03NimBot0.18.0
11:08:36FromGitter<alehander42> the biggest pro of the second option is that it makes it easy to refactor existing `case` to matches, but I'd argue against the other "pro": that it is more familiar
11:09:18FromGitter<alehander42> to a nim user, as this is actually a trap: if an user haven't used a matching lib before, it's better to make him check its docs instead of making wrong assumptions about the dsl syntax
11:14:24*kapil____ quit (Quit: Connection closed for inactivity)
11:16:08FromGitter<tim-st> Tortice: did you try compiling it with `cpp` backend?
11:17:34TorticeNo, I was using c, my bad
11:18:31FromGitter<tim-st> Not sure if it works though, but I remember this was said some time ago
11:21:51FromGitter<tim-st> https://github.com/nim-lang/ui/issues/16#issuecomment-392397326
11:33:35*user0x1 joined #nim
11:34:11Torticethanks, the cpp backend works
11:34:41Torticealthough it doesn't exactly have the native feel
11:34:44Torticeclose enough though
11:36:48*muJj joined #nim
11:37:37FromGitter<kaushalmodi> Talking about plots, I have been looking for a way to create Venn diagrams for a while now.
11:38:20FromGitter<kaushalmodi> Takes data from JSON or some representation of sets, and generates Venn diagram using a CLI
11:38:54FromGitter<kaushalmodi> *preferably an SVG*
11:42:28*stefanos82 joined #nim
11:42:55FromGitter<mratsim> D3 :? :P
11:44:38*muJj quit (Ping timeout: 245 seconds)
11:54:45TorticeCan I represent a MultipartData as a string? $ doesn't seem to work, but I'd like to see what I'm actually sending to the server
11:54:56*PMunch joined #nim
11:58:17FromGitter<kaushalmodi> @mratsim I don't know JS, and for that reason, I'm keeping my site mostly JS-free. I'd prefer a way to just generate an svg using CLI. I'll keep looking :)
11:59:17FromGitter<kaushalmodi> Tortice: you might need to simply write a `` `$` `` proc for that custom type.
12:06:01*untitakerLl joined #nim
12:09:28*untitakerLl quit (Remote host closed the connection)
12:11:01TorticeI'll go the simpler route and use mitmproxy
12:11:26*tankf33der left #nim (#nim)
12:17:33*kapil__ joined #nim
12:19:00*Sembei joined #nim
12:19:21*Pisuke quit (Ping timeout: 252 seconds)
12:22:01FromGitter<mratsim> you can use readData and dump it as hex or whatever format you choose
12:22:58FromGitter<mratsim> sorry readBytes
12:27:02*rockcavera quit (Ping timeout: 268 seconds)
12:31:10*kapil__ quit ()
12:31:34Torticeanything wrong with this line? json.parseJson(await client.getContent("$#//$#/$#/1.json" % [protocol, site, board]))["maxFileCount"].getInt()
12:32:02*kapil____ joined #nim
12:33:00*ocelotsloth quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:34:52*ocelotsloth joined #nim
12:40:50FromGitter<qqtop> @mratsim nimble install arraymancer fails to due issue with nimcl
12:41:26FromGitter<mratsim> give me 2 min, I’m on something else
12:42:15*malkomalko joined #nim
12:43:50*abm joined #nim
12:45:17*dddddd joined #nim
12:54:26FromGitter<mratsim> @qqtop both nimble install arraymancer and `nimble install https://github.com/mratsim/Arraymancer@#master` works for me, even after removing nimcl
13:03:10*Yonk__HE joined #nim
13:06:12*Yonk__HE quit (Remote host closed the connection)
13:08:12FromGitter<Quelklef> Any way to return values from threads?
13:08:40FromGitter<Quelklef> Of course I could have a 'return value' channel, but that feels really ugly to mr
13:08:41*endragor quit (Remote host closed the connection)
13:12:15FromGitter<qqtop> @mratsim confirm all ok now , issue was due to old nimcl-0.1.2 , thank you.
13:14:25FromGitter<mratsim> cool :), I added GRU support by the way so now you can do sequence predictions. There is an example here: https://github.com/mratsim/Arraymancer/blob/master/examples/ex05_sequence_classification_GRU.nim#L65-L87
13:15:01FromGitter<Bennyelg> what do you say about something like Go mapping json into types instead of using indexes ? `json:"myVal"`
13:15:11FromGitter<Bennyelg> can be useful right ?
13:15:42*rockcavera joined #nim
13:15:52FromGitter<mratsim> what does that generates?
13:15:53FromGitter<Bennyelg> ```type ⏎ dataObject = object ⏎ name: string `json:"name"` ⏎ ``` [https://gitter.im/nim-lang/Nim?at=5bb36f896e5a401c2d05d6fc]
13:16:19FromGitter<Bennyelg> instead of iterate over the results and infering name: to pos[0]
13:16:35FromGitter<mratsim> ```type ⏎ dataObject = object ⏎ name {.jsonmap:”name”.}: string ``` [https://gitter.im/nim-lang/Nim?at=5bb36fb3ef4afc4f280961d7]
13:16:44FromGitter<Bennyelg> we have this ?
13:16:58FromGitter<mratsim> I think you can write a pragma like this and then your serializer can check it out
13:17:08FromGitter<Bennyelg> exactly this is what I want to do
13:17:57FromGitter<mratsim> might be useful as well: https://xomachine.gitlab.io/NESM/ check the “size” and endian part
13:18:54FromGitter<mratsim> there is a new “hasCustomPragma” macro
13:21:01FromGitter<Bennyelg> thanks
13:21:21*PhilSliderScy joined #nim
13:22:28*PhilSliderScy quit (Remote host closed the connection)
13:28:34*endragor joined #nim
13:31:35*endragor quit (Remote host closed the connection)
13:32:30*endragor joined #nim
13:32:44TorticeI get Exception message: input(1, 24004) Error: } expected - but my JSON is validly formed
13:38:35*ocelotsloth quit (Quit: Textual IRC Client: www.textualapp.com)
13:39:22*endragor quit (Remote host closed the connection)
13:47:30Torticeis https://github.com/nim-lang/Nim/issues/8994 the cause?
13:47:36*rnrwashere joined #nim
13:50:04mastermis there a way to specify the underlying type for an enum? I need to make sure my enum is uint8 for the sake of C compatibility
13:52:26*rnrwashere quit (Ping timeout: 260 seconds)
13:56:26Torticewith stable/devel I think I run into this issue https://github.com/nim-lang/Nim/issues/8994, but with 0.18.0 I get http://0x0.st/sY4f.png http://0x0.st/sY4O.png
13:56:27*malkomalko quit (Ping timeout: 268 seconds)
14:01:34*chemist69 quit (Ping timeout: 240 seconds)
14:02:49*chemist69 joined #nim
14:12:45*Tortice quit (Remote host closed the connection)
14:15:19*tankf33der joined #nim
14:17:15*Tortice joined #nim
14:19:15*endragor joined #nim
14:19:55*endragor quit (Remote host closed the connection)
14:20:57tankf33dermy attempt to compile c2nim thing.
14:20:58tankf33derhttps://pastebin.com/vVbZhytc
14:21:09tankf33derany comments ? :/
14:21:36*defect_ur joined #nim
14:24:32*TheLemonMan joined #nim
14:25:24shashlickcan you share the generated nim file
14:25:36*defect_ur quit (Remote host closed the connection)
14:25:46tankf33derin repo
14:25:52tankf33deror maybe pastebin ?
14:27:08shashlickeither is fine
14:27:12FromGitter<adam-r-kowalski> @mratsim, If I wanted to build a data pipeline similar to tf.data in nim, would it be faster to use iterators and then build up a set of combinators such as map/filter/flatMap/batch/shuffle that take and return iterators, so we can work easily with large amounts of data that may or may not fit in RAM. Or should I use channels and threads where each combinator consumes values off a channel, applies the
14:27:12FromGitter... transformation as needed and then places values onto the next channel?
14:27:43shashlicktankf33der: c2nim generated code needn't compile right away, it might have dependencies, etc.
14:28:10tankf33dershashlick: https://bitbucket.org/mihailp/nim-monocypher/raw/b590ddf283fcd616619dd099a0c0a4c64a1eda88/monocypher.nim
14:28:35tankf33dermonocypher doesnt have deps.
14:29:40TheLemonMancrypto_unlock_ctx has been translated as a const
14:29:56tankf33deryea.
14:30:22TheLemonMandelete the const declaration and c&p the type definition you see above
14:30:50TheLemonManthe header probably had something like `#define crypto_unlock_ctx crypto_lock_ctx`
14:31:00shashlickya it is not a const but a type
14:31:10shashlickTheLemonMan: too fast 😄
14:31:22tankf33deri see. lets try.
14:37:40*PrimHelios joined #nim
14:38:37tankf33derhttps://pastebin.com/W5waKyYn
14:38:44tankf33dernow this.
14:39:40tankf33dermy goal is compile in monocypher in binary, not shared lib.
14:39:45shashlick{.compile: "monocypher.c".}
14:39:51shashlicklooks like you want a nimgen'd lib 😄
14:40:03tankf33deryea, i think so.
14:40:50tankf33deri found their lobby.
14:40:56tankf33deron gitter.
14:41:37shashlickif you wait 30 minutes, I can create a nim lib for this really quick
14:42:28tankf33deri will wait, i just want a demo example or maybe nimble ? :)
14:42:29TheLemonManthere's a single shashlick behind nimgen
14:43:19TheLemonManand I'm now hungry
14:43:43*skelett joined #nim
14:45:25shashlick👍
14:45:32shashlickokay let's see how fast we can do this
14:45:42shashlickhttps://github.com/LoupVaillant/Monocypher <= right?
14:46:15tankf33deryea
14:47:23TheLemonManwhy do you need monocrypt and not libsodium?
14:47:48tankf33dermuch better.
14:52:38*rnrwashere joined #nim
14:54:17*PMunch quit (Quit: Leaving)
14:55:37*rnrwashere quit (Remote host closed the connection)
14:56:34federico3how?
14:59:29TheLemonMana low-sodium diet is good for your health
14:59:35*miran joined #nim
15:00:13FromGitter<kdheepak> Hi all, I'm getting this really weird issue. I'm able to cross compile for Windows on gitlab-ci (and run it on windows! yay!) but I'm not able run the binary that I cross compile for Windows on Travis.
15:00:30Yardanicowhat's the error?
15:00:31Yardanicoand does your program use openssl?
15:00:48FromGitter<kdheepak> main.exe: cannot execute binary file: Exec format error.
15:00:51FromGitter<kdheepak> No it does not.
15:00:59Yardanicoehm, why are you trying to run EXE on linux?
15:01:03FromGitter<kdheepak> My program is just a `echo "hello world"`
15:01:12FromGitter<kdheepak> I'm running it in git bash on Windows.
15:01:26Yardanicotry to run it in a normal cmd
15:01:40FromGitter<kdheepak> It's not executable, I think.
15:01:49tankf33derfederico3: https://www.reddit.com/r/crypto/comments/9bnkhf/introducing_the_tink_cryptographic_software/e5hga0g/?context=3
15:02:16tankf33derread this comment
15:02:23tankf33dersecond top
15:02:24tankf33derloup-vaillant 2 points 28 days ago
15:02:40tankf33dertext from author of monocypher.
15:02:57FromGitter<mratsim> @adam-r-kowalski check NimData, it has been benched vs Pandas and PySpark and seems much faster. If data diesn’t fit in RAM you can still use memmapping in Nim. The issues with channels is that by default it does deep copies so you will have to play with pointers, memmapping is probably easier.
15:03:40FromGitter<kdheepak> (https://files.gitter.im/nim-lang/Nim/chRj/Screen-Shot-2018-10-02-at-9.03.07-AM.png)
15:04:28FromGitter<kdheepak> Not sure how this works in IRC but here's the screenshot I took just now and attached to gitter: https://files.gitter.im/nim-lang/Nim/chRj/Screen-Shot-2018-10-02-at-9.03.07-AM.png
15:04:42shashlicktankf33der: what OS?
15:04:48tankf33derlinux
15:04:58TorticeJust asking, is partial casing here to stay? It and UFCS are definitely my favorite features.
15:05:35Yardanico@kdheepak hmm, I don't really know, maybe cross-compilation was configured in a wrong way?
15:06:06*PrimHelios quit (Remote host closed the connection)
15:06:25skelettHi all, I got this strange error. Has anybody an idea where I can start debugging what went wrong?: http://ix.io/1o6X
15:06:29*PrimHelios joined #nim
15:08:19TheLemonManskelett, try replacing the => with a normal `proc`
15:11:16shashlicktankf33der: https://github.com/genotrance/nimmonocypher
15:11:23skelettIt works then, I also have this same `=>` syntax in another file, the calling function and function call are exatly the same, with the same arguments. It works there
15:11:35shashlickneed to get a proper test
15:11:41Yardanicoshashlick how are you so fast 0_0
15:11:43shashlickand run through linux to verify
15:11:48tankf33dershashlick: ok, i will play
15:11:51FromGitter<mratsim> @Tortice, Araq thinks it might be a mistake (or he said that in August, maybe he changed his mind once again) but the ship has probably sailed anyway
15:11:56shashlickyardanico: copy / paste mostly 😄
15:12:08tankf33dershashlick: yea.
15:12:08shashlickand no guarantee it actually works so still needs that effort
15:12:42FromGitter<mratsim> @shashlick, you should put the doc link in the first or second line of the readme
15:12:53shashlickdon't have a linux right now to check
15:12:58FromGitter<mratsim> because no interface in the repo (yeah I’m always saying this)
15:13:04shashlickya, haven't generated docs yet, will add that once i get that
15:13:20shashlick🙂 I haven't forgotten, will do promise
15:13:34skelettTheLemonMan: thanks though!
15:13:42TorticeI mean, it's not 1.0 yet so it could change, but I'd definitely love to keep it
15:13:48TorticeI'm a dirty snake_case lover
15:14:35*Arrrr quit (Quit: Arrrr)
15:14:51TheLemonManskelett, when in doubt always blame `=>` (and sequtils)
15:15:01skelett:D
15:17:11shashlickmratsim: here's what it looks like right now - https://pastebin.com/cWH5AsVC
15:18:10FromGitter<kdheepak> (https://files.gitter.im/nim-lang/Nim/nnfg/Screen-Shot-2018-10-02-at-9.17.41-AM.png)
15:18:10FromGitter<kdheepak> Got it working!
15:22:09*SenasOzys__ quit (Ping timeout: 252 seconds)
15:23:07*miran quit (Quit: Konversation terminated!)
15:23:32*narimiran joined #nim
15:25:48*PrimHelios quit (Ping timeout: 252 seconds)
15:28:16*SenasOzys__ joined #nim
15:30:05*pgowda joined #nim
15:31:17*pgowda quit (Client Quit)
15:32:16narimirantest 1 2
15:33:00narimiranok, now i'm narimiran on IRC too, to reduce the confusion and mentions i don't see :)
15:33:19*Vladar joined #nim
15:33:39FromDiscord_<treeform> hi
15:33:49TheLemonManwe're all delighted that miran is now dead
15:34:59narimiranhahaha TheLemonMan
15:35:45narimiranor should i say LemonBoy?
15:35:57narimiranthose people with several nicknames.... cccccc
15:36:37FromGitter<mratsim> @shashlick, are you sure about stdcall? isn’t it a C lib
15:44:13shashlicknimgen defaults to stdcall, though I'm not an expert, I've found it to be most reliable
15:44:56TorticeI get Program received signal SIGSEGV for some reason
15:45:39*endragor joined #nim
15:46:05*endragor quit (Remote host closed the connection)
15:46:30*endragor joined #nim
15:49:39*tootheni joined #nim
15:52:00*malkomalko joined #nim
15:52:43*tootheni quit (Killed (Sigyn (Spam is off topic on freenode.)))
15:53:39*rnrwashere joined #nim
15:53:41*rnrwashere quit (Remote host closed the connection)
15:55:11*nsf quit (Quit: WeeChat 2.2)
15:55:47shashlicktankf33der: any luck
15:56:42*malkomalko quit (Ping timeout: 268 seconds)
15:58:15*endragor quit (Remote host closed the connection)
16:01:37tankf33dershashlick: trying up all this to write demo code, thanks a lot
16:02:56*darithorn joined #nim
16:12:24FromGitter<mratsim> @shashlick probably because you wrap too much C++ ;)
16:13:33Torticewhich line is this exception from? I don't think I have anything that accesses indexes in my code https://ptpb.pw/Rhfj/
16:14:25*kapil____ quit (Quit: Connection closed for inactivity)
16:18:06Torticewhat's the workaround for https://github.com/nim-lang/Nim/issues/8994? just await sleepAsync(a_big_value)
16:24:32*ocelotsloth joined #nim
16:24:57FromGitter<mratsim> You can always try ad2: https://github.com/status-im/nim-asyncdispatch2
16:30:09*nmknq joined #nim
16:30:34*nmknq quit (K-Lined)
16:34:27*PrimHelios joined #nim
16:34:56TorticeDo I have to use something other than await? Error: type mismatch: got <Future[system.string]> but expected 'FutureBase = ref FutureBase:ObjectType'
16:35:32TorticeI checked the wiki but I didn't get the API
16:39:13FromGitter<dom96> Tortice: hard to say what the problem is without seeing your code
16:39:28FromGitter<dom96> line 129 in hello3.nim might be the cause
16:40:03narimiranhey @dom96, what happened to the nim survey?
16:40:21FromGitter<dom96> Nothing happened. I didn't get a chance to analyse it yet
16:40:47FromGitter<dom96> @mratsim ad2 makes me sad :(
16:40:48FromGitter<abijahm> hey people how can you generate json string using strformat
16:41:24FromGitter<dom96> @abijahm That's not how you should generate JSON: $(%{"foo": %42})
16:41:32FromGitter<dom96> That way is how.
16:41:46FromGitter<dom96> (You'll need to `import json`).
16:42:02FromGitter<abijahm> thanks dom
16:43:09FromGitter<kdheepak> Is there a way to run nimble to build both binary and libraries.
16:43:12FromGitter<kdheepak> ?
16:43:31FromGitter<dom96> Nimble doesn't build libraries
16:43:38FromGitter<kdheepak> I see.
16:43:44FromGitter<dom96> There is nothing to build
16:44:04Tortice129 is if asyncdispatch2.check_pending(): asyncdispatch2.poll(timeout)), 10)
16:44:14FromGitter<kdheepak> So the only way to build libraries then is to run ⏎ ⏎ ```nim c --app:lib filename.nim``` [https://gitter.im/nim-lang/Nim?at=5bb3a05eef4afc4f280aae44]
16:44:19FromGitter<kdheepak> Is that correct?
16:44:27FromGitter<dom96> Tortice: so you're using asyncdispatch2 already?
16:44:59Torticeline 129 was if asyncdispatch.has_pending_operations(): asyncdispatch2.poll(timeout)), 10), changing it to if asyncdispatch2.check_pending(): asyncdispatch2.poll(timeout)), 10) had no effect
16:45:31FromGitter<dom96> pastebin your code
16:46:00Torticehttps://ptpb.pw/FBaz/nim
16:47:46FromGitter<dom96> I hope this is just stale code: if asyncdispatch.has_pending_operations(): asyncdispatch2.poll(timeout)), 10)
16:47:58FromGitter<dom96> Mixing asyncdispatch1 and 2 won't work
16:48:25FromGitter<dom96> Please pastebin your code as it is for asyncdispatch
16:48:30FromGitter<dom96> together with the stack trace for that code
16:48:32Torticethat's why it's commented out
16:48:34FromGitter<dom96> so that line numbers line up
16:49:03FromGitter<tim-st> should `func` be used as default over `proc` if possible?
16:49:40narimiran@tim-st i use `func` wherever i can, and where i can't i drop to `proc`
16:50:15Torticehttps://ptpb.pw/FBaz - https://ptpb.pw/Yv7J
16:50:21FromGitter<kaushalmodi> @kdheepak You can create your own `task` in .nimble or .nims to generate those libs
16:51:08FromGitter<dom96> Tortice: That's asyncdispatch2
16:51:13FromGitter<kdheepak> Okay, great. I can add a task. How does a .nims file get executed?
16:51:26FromGitter<dom96> Once again, show me the code where you're using asyncdispatch and the exception stack trace that you're getting
16:51:29FromGitter<kaushalmodi> if the .nims file has `foo` task, you run `nim foo`
16:51:30FromGitter<tim-st> since which version is `func`supported?
16:51:44narimiran@tim-st since 0.18.1
16:51:57FromGitter<kaushalmodi> (sorry everyone for spamming this link again) https://github.com/kaushalmodi/hello_musl/blob/master/config.nims
16:51:59Torticeoh, sorry, sorry
16:52:11FromGitter<kdheepak> @kaushalmodi I have the following in a file that seems to get executed when I run `nimble build -d:crosswin`. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb3a23bc08b8b3067c0cab4]
16:52:31FromGitter<kaushalmodi> @kdheepak with that musl task defined in my example, you run `nim musl src/hello_musl.nim`
16:52:36FromGitter<kaushalmodi> you cannot use both nimble and nim
16:53:02FromGitter<dom96> You should probably be using Nimble tasks not Nim tasks
16:53:09FromGitter<tim-st> narimiran: ok, thanks, just wondered because here is required version 0.18.0 : https://github.com/LemonBoy/dtoa.nim/blob/master/dtoa.nimble
16:53:26*SenasOzys__ quit (Remote host closed the connection)
16:53:34Torticedidn't realize you meant the trace in https://ptpb.pw/Rhfj/ - but I don't have that copy any more
16:53:43*SenasOzys joined #nim
16:53:43TorticeI'll let you know if I manage to reproduce it again
16:53:57FromGitter<kdheepak> @dom96 and @kaushalmodi I didn't know there were nimble AND nim tasks.
16:54:08FromGitter<kaushalmodi> both use NimScript syntax
16:54:15FromGitter<kaushalmodi> I think it comes to preference..
16:54:26narimiran@tim-st func doesn't work in 0.18.0? i thought it existed even then, just later it was defined it means proc with no side effects
16:54:28FromGitter<kaushalmodi> I like config.nims as that's not tied to nimble
16:54:41FromGitter<kaushalmodi> if I want, I can call `nim musl ..` from a nimble task :P
16:54:46FromGitter<dom96> Is there really much point in supporting both?
16:54:53FromGitter<dom96> Nimble needs it but Nim really doesn't
16:55:20FromGitter<tim-st> narimiran: I don't know, that was the question :)
16:55:32*ocelotsloth quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:56:09FromGitter<kaushalmodi> @dom96 I ended with config.nims route when I couldn't do `findExe` in .nimble
16:56:23FromGitter<kaushalmodi> as of now, .nims seems to be doing more than .nimble
16:56:33FromGitter<kdheepak> This is what I have in my current directory. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb3a341ae7be94016ef1652]
16:57:02*user0x1 quit (Quit: El Psy Congroo.)
16:57:03FromGitter<kaushalmodi> @kdheepak I would `mv src/cli.nims config.nims`
16:57:38FromGitter<kaushalmodi> You can read more here: https://nim-lang.org/docs/nims.html
16:57:46*vivus joined #nim
16:57:56TheLemonMantim-st, who cares about 0.18.0, we're now living in the wonderful age of 0.19.0
16:59:03FromGitter<kaushalmodi> @dom96 another advantage of config.nims is that I can just cp to all my projects and have the musl build support easily
16:59:23FromGitter<kaushalmodi> blindly copying .nimble wouldn't work as each .nimble would be specific to that project
16:59:37FromGitter<tim-st> TheLemonMan: Sure, just wanted to know the version, since I thought about adding a package and maybe changing to `func` too
17:00:03FromGitter<kaushalmodi> I see config.nims as a way to contain generic tasks that I wish were default `nim` subcommands, and .nimble only to contain the nimble package management specific stuff
17:00:58narimiran@tim-st put 0.19.0 as a minimum, and use func :)
17:01:10FromGitter<tim-st> ok
17:02:17FromGitter<dom96> Nim's nimscript and Nimble's should be the same
17:02:25FromGitter<dom96> so you should be able to do findExe in Nimble too
17:02:33FromGitter<kaushalmodi> +1
17:02:45FromGitter<kaushalmodi> I'd even go further and suggest setting a convention of config.nims
17:02:47narimiranbtw TheLemonMan, what is stoping us to use your dtoa in stdlib?
17:02:58FromGitter<kaushalmodi> tasks shouldn't be defined in .nimble
17:03:13FromGitter<kaushalmodi> if config.nims exists, nimble should respect tasks defined in that
17:03:25vivusdoes anybody know how to handle this error for folder names with a "." : Warning: using '.' instead of '/' in import paths is deprecated [Deprecated] ?
17:03:56FromGitter<tim-st> replace '.' by '/' ?
17:03:58TheLemonMannarimiran, I wrote a couple of lines about that on the forum post, long-story short this algorithm is _fast_
17:03:59*PrimHelios quit (Remote host closed the connection)
17:04:24*PrimHelios joined #nim
17:04:24FromGitter<tim-st> vivus: oh, just read it again^^
17:04:39TheLemonManbut you probably want something like Errol3/4 for your stdlib, and that's slower than grisu2 and is quite difficult to implement
17:04:42narimiranvivus: so you have something like `import foo/.bar`? it throws this error if it finds a dot, even if it is not used as `foo.bar`?
17:04:45Torticeare there any examples for asyncdispatch2?
17:05:13vivusso this: `var cmd_file = newFileStream("~/.appfolder/file.txt", fmRead)` is my code.
17:05:55vivusI want to store the user-data in the Linux-root under .appfolder/
17:06:07FromGitter<dom96> Do I need to create asyncdispatch3? :P
17:06:07vivus`/.appfolder/`
17:06:16FromGitter<dom96> just because there is a `2` doesn't mean it's the future
17:06:19FromGitter<dom96> (Sorry)
17:06:38vivusnarimiran: ^^^
17:06:52shashlickI'm putting a good amount of effort to ensure nimgen libs work as far as 0.17.x
17:07:05shashlicki think backwards compatibility should be attempted to give people time to migrate
17:07:21narimiranTheLemonMan: what is the problem with those 0.05% numbers? is it like those examples i have shown or is it something more serious?
17:07:24FromGitter<tim-st> yes, but for new packages it shouldnt matter
17:07:25TorticeI'm perfectly fine using asyncdispatch - except for https://github.com/nim-lang/Nim/issues/8994
17:07:56TheLemonMannarimiran, it's about compactness, the results are guaranteed to round-trip
17:07:57shashlick@tim-st: I'm saying it should - even new packages should work with older versions so that people aren't forced to upgrade all the time
17:08:07Torticeand await sleepAsync(long_duration) seems like it kinda defeats the point
17:08:18TheLemonManit'd be a pretty useless algorithm if that didn't work heh
17:08:34FromGitter<tim-st> shashlick: ok, is there an easy way to check what is the min version that works with my code?
17:08:38vivusill bbl. if anybody has any suggestions, just tag me
17:08:42narimiranTortice: well, that will be resolved in 0.19.2 (and before that in the devel 0.19.1), so you can just wait if you're not in a hurry :)
17:09:00shashlickthis is one of the reasons why people are waiting for 1.0, cause they are looking for some stability
17:09:22shashlick@tim-st: no easy way, i have to check with every version of nim I want to support and write cross-platform code
17:09:35FromGitter<tim-st> that's bad :\
17:09:58shashlickwell as library writers that's the price you pay for being useful
17:10:11TorticeI guess I'll wait for 0.19.1
17:10:25FromGitter<tim-st> has someone found out how to easy cross compile on windows (not to windows)
17:11:00shashlickyou can check nim version and have different code and perhaps add new features for newer nim versions but if you use newer constructs that older compilers don't understand, it might still fail
17:11:04FromGitter<kdheepak> @kaushalmodi if I move `src/cli.nims` to `config.nims` then `nimble build` to build the cli is not going to pick up the changes in config.nims, right?
17:11:11shashlicknot sure if older compiler will be forgiving with unknown syntax
17:11:16shashlickif in a when() block
17:11:31FromGitter<dom96> Tortice: You can grab 0.18.0 and avoid this regression
17:11:57FromGitter<dom96> No idea what you mean regarding `await sleepAsync`
17:12:00FromGitter<dom96> Can you elaborate?
17:12:04FromGitter<kaushalmodi> @kdheepak I think it should work the same way
17:12:09FromGitter<kaushalmodi> just try it
17:12:27FromGitter<kdheepak> I want to 1) build both a binary and a library. 2) using nimble to do both (i.e. nimble build, nimble custom_task_library_build), 3) (ideally) not repeat code
17:12:28Torticehttps://github.com/nim-lang/Nim/issues/8994
17:12:37FromGitter<kdheepak> Okay will try.
17:12:40Torticesorry, meant to link to comment
17:12:41Torticehttps://github.com/nim-lang/Nim/issues/8994#issuecomment-425397702
17:12:59FromGitter<kdheepak> My cli.nims has windows specific stuff, so I'll need to build and test on a different machine.
17:13:08Torticeskilchen suggests adding await sleepAsync(1) to /lib/pure/httpclient.nim as a workaround
17:13:36FromGitter<kaushalmodi> you would put windows stuff in `when defined(windows):`
17:13:49Torticewith 0.18.0 I get http://0x0.st/sY4f.png http://0x0.st/sY4O.png
17:14:08*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
17:15:07FromGitter<dom96> Yes, that workaround is a hack. It's not how to fix this properly.
17:15:31FromGitter<dom96> Strange that you're getting segfaults on 0.18.0
17:16:51FromGitter<tim-st> TheLemonMan: the tfib.nim runs fine on windows amd64 in case you hadnt an answer
17:18:44Torticeso, any tips on avoiding segfaults? :P
17:19:35shashlicktankf33der: so nimmonocypher is confirmed to work on Windows and Linux and has a real test case
17:20:12tankf33dershashlick: oops doing pull again then
17:20:27shashlicknothing really changed, just added test case
17:20:49FromGitter<kdheepak> I think it worked. So my takeaway from this conversation is that to do what I want to do (use nimble for all packaging related tasks), I need to use nimble for tasks and use config.nims for configuration of the compiler etc.
17:20:55FromGitter<Bennyelg> Q: Converter runs at compilaion time ?
17:21:26FromGitter<dom96> Tortice: What's Nim's stack trace for that segfault?
17:22:26tankf33dershashlick: super
17:22:57*PrimHelios quit (Ping timeout: 252 seconds)
17:23:18Torticesource: https://ptpb.pw/Hn2P/nim nim bt: https://ptpb.pw/FfiK
17:24:28FromGitter<dm1try> so a "proper" workaround will be `callSoon(proc() = stream.complete)` instead of `sleepAsync(1)`
17:24:49*abm quit (Quit: Leaving)
17:25:41FromGitter<dm1try> the result will be the same, but the former chunk identifies that the completion of the stream should be scheduled
17:25:59FromGitter<dm1try> because of the internal implementation of the FutureStream
17:26:05*abm joined #nim
17:26:10*abm quit (Read error: Connection reset by peer)
17:26:35*abm joined #nim
17:26:37Araqtoday I learned LLVM works really well on Windows
17:26:54Araqbootstrapping is 0.2s faster with clang compared to an older gcc (6.3)
17:30:45FromGitter<dom96> @kdheepak yeah, that sounds about right
17:32:23shashlickhas anyone tried to get appveyor to include nim releases
17:33:26vivusI tried making the filepath a string, but the error still remains. Any suggestions?
17:34:36FromGitter<Vindaar> @mratsim just watched that video on data voyager. That's looks pretty awesome. Now I want something like that for my data :) Need to watch it from the start though, because I don't quite understand how data voyager is fed its data
17:34:44*Trustable joined #nim
17:34:58*abm quit (Quit: Leaving)
17:35:10vivus@dom96 do you know how to open folders that have .foldernames ?
17:35:21*abm joined #nim
17:36:02*abm quit (Read error: Connection reset by peer)
17:36:44Torticeimport ospaths, echo joinPath(ospaths.getHomeDir(), ".appfolder")
17:36:46*abm joined #nim
17:37:15Torticesomething like that?
17:37:18shashlickaraq: why does c2nim now require compiler >= 0.18.1?
17:37:34vivusLet me try that
17:37:51shashlickaraq: rather nim >= 0.18.1
17:38:24shashlickmakes it hard to have nimgen wrappers to support older versions of the compiler
17:40:04*PrimHelios joined #nim
17:42:06shashlickcc dom96 ^^ since c2nim deps bumped up to 0.18.0 in June
17:42:42*PrimHelios quit (Client Quit)
17:43:33Araqshashlick, because I didn't think it would cause problems, c2nim is tied to the compiler's Nim code renderer
17:44:41shashlickya I am wondering if its even possible to have c2nim use the latest compiler renderer but an older nim binary
17:45:03Araqwe can tie c2nim to a specific commit of the compiler API
17:45:25FromGitter<kdheepak> How to pass variables to nimble tasks?
17:45:28Araqwe used to do that but the renderer also receives bugfixes and improvements
17:45:45FromGitter<kdheepak> ` -d:variable` doesn't seem to work?
17:45:56FromGitter<kdheepak> It is not defined in the .nimble file.
17:46:08Araqkdheepak: I think that's supported but I could be wrong
17:46:17*abm quit (Quit: Leaving)
17:46:18shashlickAraq: will this even work - `requires "nim >= 0.16.0", "compiler >= 0.18.1"`
17:46:47*abm joined #nim
17:46:47FromGitter<dom96> We used to do that?
17:47:45Torticeany idea on the SIGSEGV?
17:47:46FromGitter<dom96> @kdheepak you can't right now
17:47:47FromGitter<kdheepak> @Araq @dom96 it doesn't seem to propogate.
17:48:03FromGitter<dom96> Tortice: I asked for a Nim stack trace
17:48:05shashlickcompiler.nimble says it wants `nim >= 0.14.0` - https://github.com/nim-lang/Nim/blob/devel/compiler.nimble
17:48:24FromGitter<kdheepak> Got it.
17:48:25*Vladar quit (Remote host closed the connection)
17:48:34Araqdom96, maybe I misremember
17:48:54Torticeis https://ptpb.pw/FfiK not what you wanted?
17:49:02shashlickAraq: in essence, can you compile the latest c2nim and compiler code with an older version of nim.exe
17:49:09FromGitter<dom96> It is. Maybe I missed it
17:49:27FromGitter<dom96> Line 71? What's there?
17:49:30Araqideally I would copy the code from the compiler that c2nim uses into c2nim and drop the dependency on the compiler API
17:49:34shashlickthen we can down-rev the nim dependency
17:49:50Araqbut as I said, the compiler is also constantly improved and c2nim benefits from that
17:49:56Torticehttps://ptpb.pw/Hn2P/nim L71: files.add("$#/$#$#" % [dir, file, ext])
17:49:56FromGitter<dom96> Seqs/strings are nil by default on 0.18.0
17:50:02FromGitter<dom96> That's probably your problem
17:50:11shashlicki'm on board with using the latest compiler code, just hoping we can use the older nim to compile it all
17:52:10Torticeso declaring the type isn't enough, it actually needs initialized?
17:52:24narimiranTortice: in 0.18.0 yes
17:52:53Torticealright, thanks
17:53:10narimiranTortice: `var a: seq[int] = @[]` or `var a = newSeq[int]()`
17:53:37narimiranin 0.19 you can do just `var a: seq[int]`. the same goes for strings
17:54:00Torticemuchas gracias
17:54:47FromGitter<dom96> Araq: Slack?
17:55:48Torticeawesome, works great
17:55:49FromGitter<dom96> Ugh. How many times are tests for c2nim going to be broken?
17:56:22vivuscan anyone tell me if this is an error in the package: ../.nimble/pkgs/yaml-0.10.3/yaml/stream.nim(140, 31) Error: invalid type ?
17:58:00Torticeokay, so it mostly works great https://ptpb.pw/ieC9
17:58:04Araqdom96: until this hashing scheme is fixed, I'm working on it
17:58:19flyxvivus: yes, nimyaml has not yet been updated with new `not nil` stuff.
17:58:23FromGitter<dom96> Araq: You complained about me not using a different branch
17:58:26FromGitter<dom96> Follow your own advice :)
17:58:42FromGitter<dom96> And don't depend on 0.18.1
17:58:44Araqc2nim is not as important as Nimble, but ok, you're right
17:58:45FromGitter<dom96> It's a moving target
17:58:45TorticeException message: invalid http version, 0x7f4a6e385a80"<input type=\"checkbox\" name=\"deleteMedia\" /> Wipe files</label></p>"
17:58:58FromGitter<dom96> Everyone will get a different compiler version
17:59:12FromGitter<dom96> This is all about reproducible builds
17:59:14vivusflyx: are you in charge of nimyaml?
17:59:20FromGitter<dom96> And you've just made them non-reproducible
17:59:34FromGitter<dom96> And this is now the 3rd time, at least
18:00:25shashlickAraq, dom96: so 0.17.x cannot compile the compiler `.nimble\pkgs\compiler-#head\compiler\ast.nim(1023, 33) Error: undeclared identifier: 'BackwardsIndex'`
18:00:31flyxvivus: well it's my project. there was a PR fixing it but it got some stuff wrong. I know about the problem, but fixing it has no high priority for me since I don't currently use NimYAML (or Nim)
18:01:18shashlick0.18.0: cannot either since `cparse.nim(739, 29) Error: undeclared identifier: 'gConfig'`
18:01:39FromGitter<dom96> Yeah, `nimble install c2nim` will be broken for many
18:01:48vivusflyx: it would be highly appreciated if you could fix it, as my project depends on yours.
18:02:09*edcragg quit (Quit: ZNC - http://znc.in)
18:02:19shashlickheh - 0.19.0 also doesn't work `.nimble\pkgs\compiler-#head\compiler\packagehandling.nim(43, 13) Error: usage of 'isNil' is a user-defined error`
18:03:04*edcragg joined #nim
18:03:14flyxvivus: frankly, I got of tired of Nim breaking NimYAML every second release and have little motivation maintaining it. however, the fix is not hard and if you need it, you could probably do it yourself
18:04:04vivusflyx: will I need to recompile nimyaml ?
18:04:20Araqflyx, sorry, we promise not to break NimYAML again now *cough*
18:04:37*stefanos82 quit (Quit: Quitting for now...)
18:05:22flyxAraq: that was not really criticism, it just happened.
18:06:11flyxvivus: if you want to fix the problem, look at https://github.com/flyx/NimYAML/pull/62 which fixes the compiler errors. my comment there lists things to be done before it can be merged
18:07:23shashlickAraq, dom96: okay, I'm not sure what to do now with nimgen wrappers - do I have nimgen depend on the older version of c2nim? but does that then mean the wrappers won't support 0.19.0+?
18:08:20FromGitter<dom96> c2nim really needs a release
18:08:27FromGitter<dom96> That way you can depend on the latest release instead of HEAD
18:08:50shashlickwell even a release is tied to a specific version of nim and compiler
18:08:56TorticeHow should I deal with Exception message: invalid http version, 0x7fb14d22d988"heckbox\" />"?
18:09:23shashlickno way to get it installed across multiple past versions of nim which are out there
18:10:06FromGitter<dom96> Tortice: that seems like another HTTP client bug or you're doing something wrong.
18:11:07*krux02 quit (Remote host closed the connection)
18:11:07Araqshashlick, c2nim produces Nim code that works with 0.18
18:11:16AraqI'm not sure I understand your question
18:11:40Torticesource: https://ptpb.pw/ZXNt
18:11:45Torticejust a client.postContent
18:11:46*rokups quit (Quit: Connection closed for inactivity)
18:12:25vivushmmm ill just downgrade to 0.18 for now. flyx will you not be supporting further development of nimyaml in the future?
18:12:58shashlickAraq: I'm asking about building c2nim, not the code it generates
18:13:15shashlickall nimgen wrappers run c2nim on nimble install so c2nim is a dependency on install
18:13:19*francisl joined #nim
18:13:35flyxvivus: I definitely do not plan to add any features. I might someday fix those compiler errors, but don't count on it.
18:13:47vivusoh no :(
18:14:24*rnrwashere joined #nim
18:16:57shashlickAraq: right now c2nim#head doesn't even build with 0.19.0
18:18:00shashlickdom96: so c2nim#head wants compiler >= 0.18.1, and nimble has installed compiler@#head which cannot be uinstalled since nimble depends on it
18:18:03Torticeso any workaround?
18:19:24Torticehttps://github.com/nim-lang/Nim/issues/7413#issuecomment-376694927 - i leave it as an exercise to interested people to find out, why this fails with: Error: unhandled exception: invalid http version, 0x7f80ff2bb630"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">" [ProtocolError]
18:19:55flyxvivus: sorry, I simply do not have enough time for maintaining all my projects.
18:20:28vivusflyx: no need to be sorry man :) we must be grateful that such a project actually exists in the first place.
18:20:36FromGitter<dom96> Tortice: Create a new AsyncHttpClient for each request.
18:20:40shashlickdom96: I had to `nimble install compiler@#head` again and overwrite the existing install, now c2nim builds for me
18:20:58shashlickjust note that any existing installs of nim won't be able to build the latest c2nim
18:21:05FromGitter<dom96> shashlick: Yes, this is why depending on `compiler >= 0.18.1` sucks
18:21:21FromGitter<dom96> It needs to be pinned to a commit
18:21:48shashlickok, so rock and hard place really - I cannot support both pre 0.19.0 and post, only one or the other
18:22:26Araqshashlick, just give me an hour please
18:22:27FromGitter<dom96> You can
18:22:43FromGitter<dom96> You just need to find a compiler commit that both 0.18.0 and 0.19.0 support
18:22:49FromGitter<dom96> Pretty sure that exists
18:22:54shashlickAraq: ok sure, let me know if you want me to run any tests
18:23:06FromGitter<dom96> or you can even add `when`s into c2nim to support both in the worst case scenario
18:23:24FromGitter<dom96> The travis file tests whether c2nim compiles with a specific Nim commit hash
18:23:26shashlickwell but I cannot dictate what compiler commit c2nim should depend on
18:23:36FromGitter<dom96> You can make it test the commit hash for 0.18.0 and 0.19.0 and whatever else
18:23:48FromGitter<dom96> You can
18:24:02FromGitter<dom96> In the c2nim repo, but you can
18:24:38shashlickok i'll let Araq work his magic
18:26:08shashlickbut I'd really like to support at least from 0.17.0 - that way we have 1.5 years of support and it will test all these dependencies
18:26:42shashlickI'd like to test automatically on appveyor but it will take more than an hour across multiple nim versions
18:27:00shashlickalready takes 6+ minutes x 2 (win + lin) with just 0.18.0
18:27:04FromGitter<dom96> I think that's too far
18:27:13FromGitter<dom96> 1) 18.0 is good enough
18:28:00Torticethanks again dom
18:28:05shashlickso devel, n, n-1 which gives us ~6 months of support
18:29:28FromGitter<dom96> Nim isn't at 1.0 yet and most of us are quick to take up new versions so it's just a waste of effort to support anymore.
18:29:30shashlickor rather 1 year since we will support 0.18.0 until 0.20.0 comes out 6 months from now
18:29:46FromGitter<dom96> heh, our releases aren't that regular
18:29:56shashlickwell, I'd argue Nim is stable enough to be treated as a 1.x
18:29:57FromGitter<dom96> 1) 20.0 could very well be here in 2 month
18:30:07FromGitter<Bennyelg> I did it. we will have first service using Nim here at Gett )
18:30:09shashlickif we can provide this stability for 2 years
18:30:24FromGitter<dom96> @Bennyelg yay!
18:30:28shashlickthen the versioning doesn't matter
18:30:37FromGitter<Bennyelg> Yea so excited
18:30:42shashlickall said and done, once 1.x comes out, we will be expected to provide this kind of support
18:31:06shashlickso why not start now is my point
18:31:20shashlickall libraries should be written backwards compatible
18:32:26Araqdom96, iirc our release are quite regular, 6-7 months for a release
18:33:12*nsf joined #nim
18:39:10FromGitter<dom96> I'd say it's more like 4 months, they are fairly regular
18:39:15Araqshashlick, do you checkin the produced Nim code?
18:39:15FromGitter<dom96> But .2 releases are usually quick
18:39:16FromGitter<dom96> https://github.com/nim-lang/Nim/releases
18:39:27*rnrwashere quit ()
18:39:33FromGitter<dom96> (which we need to release for 0.19.0 ASAP to fix these HTTP issues)
18:39:34shashlickAraq: I do not since it is platform dependent
18:39:47shashlickand perhaps compiler dependent once nimgen goes beyond gcc
18:39:55Araqwhat? gah, that's bad, sorry
18:40:10Araqwrappers should be platform independent via 'whens'
18:40:32Araqby its nature c2nim + tooling on top of it is a fragile undertaking
18:40:38shashlickwell, it is dynamically generated, that's the whole point of nimgen
18:40:54Araqalways keep a working copy around
18:40:58shashlickand the C code can have #defines that need to be preprocessed before c2nim even looks at it
18:41:16vivusoh no. my 0.18.0 code is broken now also: SIGSEGV: Illegal storage access. (Attempt to read from nil?)
18:42:43shashlicki wonder why c2nim isn't part of the nim repo and shipped with every release
18:43:00shashlickif it is so tightly dependent on the compiler
18:43:41Araqshashlick, mostly because it should get its own issue tracker
18:43:57shashlickanyway, doesn't make life any easier since I'll have to test wrappers with each newer version of c2nim but that seems more feasible than getting c2nim to build in the first place
18:43:57Araqbut yeah, in retrospect it probably was a mistake
18:44:17Araqc2nim can handle #defines
18:44:27Araqand most defines are not platform specific either
18:44:32shashlickdom96: is it possible for nimble to have different dependencies based on the version of nim
18:45:04AraqI like the idea of making c2nim more robust via nimgen but the idea of dynamically producing these wrappers seems unwise
18:45:16shashlickwell, I don't want to get into the intricacies of #defines that different C/C++ libs have
18:45:34AraqI remember trying to build some C code that "only just" required flex and bison too
18:45:41shashlicki just let the preprocessor handle it and occasionally pass in a -D where it is explicitly required
18:45:50Araqand getting flex/bison to work on Windows can be a challenge
18:46:50*ZeDestructorqu joined #nim
18:47:06Araqmaybe keep generated/{osx, linux, windows} as a compromise?
18:47:46*ZeDestructorqu quit (Remote host closed the connection)
18:47:53Araqin the build process you can warn if nimgen failed and then fallback to the pre-generated wrapper?
18:48:25shashlickwell I'd have to depend on nimble for that - right now nimgen is a dependency for these wrappers, and c2nim is a dep for nimgen
18:48:38shashlickif anything fails along that chain, wrapper install will fail
18:49:07Araqwhat do you think are the odds this will happen to somebody? :D
18:49:47shashlickwell anyone using 0.18.0 today won't be able to build from scratch anymore
18:50:08shashlickso they will be forced to update their code base to use 0.19.0 simply because a library they use demands it
18:50:11FromGitter<dom96> We can't have every tool that depends on the Nim compiler in the Nim repo
18:50:20Araqok, ok, I fucked up, I got it, I'm sorry. but apart from that
18:50:38FromGitter<dom96> So we should put up with the pains that this causes to allow other projects which want to the use the compiler sources
18:50:47Araqthis will cause problems again because dynamic wrapper generation is fragile
18:51:13Araqand it's fragile by its nature
18:51:25FromGitter<dom96> FWIW I think we should be moving towards a macro that can import C/CPP headers and generate a Nim ast which wraps it
18:51:34Araqyou need to pin the versions/commit of:
18:51:37FromGitter<dom96> That's what I would be working on now if I had the time
18:51:44Araq- the C source code
18:51:46Araq- c2nim
18:51:48Araq- nimgen
18:52:27shashlickdom96: I like that idea - no tool dependencies at all will be ideal
18:54:26shashlickdynamic wrapper generation is working fine for almost 20 wrappers I've done so far
18:54:57Araqit is working fine *now*
18:55:01*SenasOzys quit (Remote host closed the connection)
18:55:07Araqit's not future-proof
18:55:11shashlickthe only way I can manage to continue to expand that is if it takes care of itself
18:55:20shashlickas much as possible
18:55:39Araqcan I build this in 5 years? I can update 5 year old generated Nim code
18:55:58AraqI don't think I'll be able to dig through a failing nimgen build
18:56:19Araqand so having what was produced back then around, is a precious thing
18:57:49shashlickwell I'm fine maintaining this as fragile as it seems because I see value in expanding the available libraries as well as backward support
18:58:48Araqif I ever get around it, I shall create a nimgen github cache
18:59:05shashlicki am okay supporting all these older versions of nim - testing and making sure it all works but its just c2nim which stands independent and forces you to use the latest release
18:59:39AraqI'm not critcising your work and it's not about c2nim's failures
19:00:14AraqI'm not trying to convince you to cache stuff because I want the freedom to break c2nim yet again
19:00:45AraqI'm trying to convince you because it's a good idea regardless of your skill or nimgen's qualities
19:01:45shashlicki understand your point, but you are asking to cache a limited subset of nim code that is generated from C code that is designed to run on who knows how many different variants of OS
19:02:04shashlickit isn't impossible and I'm sure @mratsim will love it too
19:02:51shashlicktomorrow some new variant comes up, adding support will mean checking in generated code for that for every single nimgen wrapper
19:03:03shashlickit just isn't scalable
19:03:07shashlickit is fragile no doubt
19:04:08Araqonly cache the 3 important oses then, osx, linux, win
19:04:30Araqand if you automate it, it scales all the way you want
19:05:21Araqand Nim practices what I preach, nim.tar.xz comes with the produced C source code, you can build every Nim release without any installed Nim version whatsoever
19:06:34*euidzeroHU joined #nim
19:06:52Araqand the C source code is built for X OSes and Y CPUs
19:11:02*euidzeroHU quit (Remote host closed the connection)
19:13:17*Tortice quit (Remote host closed the connection)
19:15:03shashlickall makes sense, but even if I sign up for all this, I will now have to cache upstream as well since the cached nim will have been generated from upstream C/C++ code that continues to evolve
19:17:25*stevenfx joined #nim
19:17:28shashlickbut all seems inevitable in the quest for reproducible builds and reliability
19:18:09shashlickseems easier to bump up to 0.19.0 and call it a day
19:18:19*stevenfx quit (Client Quit)
19:19:21*SenasOzys joined #nim
19:22:41*francisl quit (Quit: francisl)
19:24:16*thomasross__ quit (Remote host closed the connection)
19:27:06*thomasross joined #nim
19:43:45Araqshashlick, I am not following you. you build the wrappers you might as well keep them in a generated/$os dir that you add to git
19:44:24Araqif you re-generate the 'git diff' might be interesting or not but you can always overwrite, it's versionized after all
19:45:45FromDiscord_<exelotl> hey so, I really need {.this:self.} because it makes the DSL i'm working on twice as pleasant to use. What are my options if it's going to be removed in the future?
19:52:22*malkomalko joined #nim
19:52:25shashlickAraq: no, I mean even the C files will need to get versioned since the nim was generated from them, so need to store the git hash of upstream as well
19:52:37shashlickmost nimgen wrappers compile in the C/C++ code rather than depending on a dll
19:54:45*francisl joined #nim
19:56:24*malkomalko quit (Ping timeout: 244 seconds)
20:30:03FromGitter<codenoid> morning all
20:31:57*francisl quit (Quit: francisl)
20:44:36*ahmed____ joined #nim
20:46:57*bobey6rP joined #nim
20:49:24*bobey6rP quit (Remote host closed the connection)
20:50:51*narimiran quit (Ping timeout: 252 seconds)
20:51:47*smibayi joined #nim
20:54:01*tre99 joined #nim
20:57:29*Trustable quit (Remote host closed the connection)
20:58:23Araqexelotl, in the long run the macro system can replicate this feature, in the near run it's only deprecated and won't be removed
20:58:24*tre99 quit (Remote host closed the connection)
20:58:31Araqso I wouldn't worry about it
20:58:35*smibayi quit (Remote host closed the connection)
20:59:03Araqyou are not the only one who complained about its deprecation
20:59:27Araqshashlick, ideally yes, but any form of caching helps
21:04:42FromDiscord_<exelotl> ah okay, thanks :)
21:09:30*Tortice joined #nim
21:22:29*vivus quit (Ping timeout: 252 seconds)
21:22:49*vivus joined #nim
21:29:19*nsf quit (Quit: WeeChat 2.2)
21:34:24*elrood quit (Quit: Leaving)
21:40:57AlexMaxOkay I have found a misleading error message that I might have brought up before, but I wanted to quick check to see if this was a known issue before filing a bug
21:42:15AlexMaxIf I have an object declaration in one .nim file and proc declaration in a second .nim file that have the sane name, and then I import both, if I try to call the proc, I get an error message like this:
21:42:19AlexMaxc.nim(4, 2) Error: type mismatch: got <testing> but expected 'foo = object'
21:42:34AlexMaxthis is sounding awfully familiar, I might've reported it before...
21:44:38Araqthe style guide says the type should be UpperCased anyway
21:44:55Araqwhich is probably why it comes up very rarely :P
21:46:16FromGitter<alehander42> i still think ruby was right on that one, just make all types UpperCased and be done with it :D
21:49:06AraqRuby has types?
21:49:21*disruptek joined #nim
21:49:29FromGitter<alehander42> typenames*
21:49:57FromGitter<alehander42> classnames if you wish
21:50:43AlexMaxAraq: I agree, from a stylistic point of view. However, it comes up regardless
21:51:34AlexMaxI wouldn't have noticed it if I hadn't seen nimnukler's nimgenned 'keys' object conflict with sdl2's "keys" conversion proc
21:51:55AlexMaxactually IDK what it is exactly, probably an actual proc
21:52:13AlexMaxbut yeah, it was weird, it was one of those heisenbugs
21:52:23AlexMaxvar sym = evt[].key.keysym.sym
21:52:27Araqwrappers should use --nep1 from c2nim
21:52:35AlexMaxthis line worked....until it didn't
21:52:48AlexMaxit got hung up on 'key' due to the ambiguity
21:53:15AlexMaxooo, fancy
21:56:23FromDiscord_<treeform> Getting this problem again where string that was pointing to string "day" flips to pointing to random strings, after a ton of string allocations and decollations. But I don't know how to write a simple repor for it... or even believe it. Is it GC? Is it me? World is not consistent...
21:57:22FromDiscord_<treeform> I had this before at: https://github.com/flyx/NimYAML/issues/50
21:57:48planetis[m]heads up, new macro post: https://github.com/nim-lang/website/pull/108
22:02:35*ghost64 joined #nim
22:09:41AlexMaxthere we go
22:09:43AlexMaxhttps://github.com/nim-lang/Nim/issues/9156
22:13:32AlexMaxnow I won't forget the issue
22:19:52FromGitter<iffy> Any stdlib way to do products and combinations? (e.g. python's itertools)
22:21:53FromGitter<iffy> aha, `algorithm`: https://nim-lang.org/docs/algorithm.html
22:21:57Araqitertools nimble package
22:23:18AlexMaxhrm, c2nim doesn't have a --noconv?
22:29:57FromGitter<timotheecour> @araq how would I pass a string to js? in foo.js I have: `function getTypeFromName(name){ return eval(name));}` what would be the corresponding proc in bar.nim in karax? I tried: ⏎ `proc getTypeFromName(name: Node) : Element {.importc: "$1”.}` but leads to errors
22:32:44Araqwhat errors?
22:33:58*PrimHelios joined #nim
22:37:32FromGitter<timotheecour> well basically I’m not sure how to convert a string or kstring to a Node (or should it be Element?); I tried: ⏎ ⏎ ```var e: Node ⏎ new(e) ⏎ e.appendData “baz" ⏎ let ret = getTypeFromName(e)``` ⏎ ⏎ but that was a shot in the dark and gave: TypeError: e_238216.appendData is not a function [https://gitter.im/nim-lang/Nim?at=5bb3f32cae7be94016f112fb]
22:38:01FromGitter<timotheecour> probably missing an obvious way to do that...
22:38:03Araqvia 'text'?
22:39:01Araqbtw if you want your features merged, please give us a 'since' pragma
22:39:06Araqthen we can do
22:39:26Araqproc maAwesomeFoo() {.since: "0.20".}
22:39:44Araqit should also show up in the docs
22:39:53FromGitter<timotheecour> let App2 = getTypeFromName("App2".text) ⏎ Error: type mismatch: got <VNode> ⏎ but expected one of: ⏎ proc getTypeFromName(name: Node): Element [https://gitter.im/nim-lang/Nim?at=5bb3f3b9ae7be94016f11603]
22:40:35FromGitter<timotheecour> > btw if you want your features merged, please give us a 'since’ pragma ⏎ ⏎ was that comment for my PRs or for someone else?
22:40:43Araqfor you
22:41:09AlexMaxoof
22:41:12AlexMax char* = int8T
22:41:23AlexMax-nep1 leaves me with...this
22:41:43Araq#mangle char char
22:42:36FromGitter<timotheecour> `{.since: "0.20”.}` ok ; is there a post on that? (ideally something on GitHub or on issue tracker ) ; for new procs it’s ok; for overloads it may be tricky sometimes
22:44:21Araqhttps://github.com/nim-lang/Nim/issues/7527 there is this
22:44:36Araqwhere "trunk based development" won with 1 vote
22:45:09Araqthe idea is that if the compiler is set to --version=0.19 every symbol like
22:45:18Araqproc foo {.since: "0.20".}
22:45:28Araqis silently ignored
22:45:43Araqoverloads are irrelevant afaict
22:46:17FromGitter<timotheecour> Meaning , no need to add `since` for new overloads ? (i see no mention in that issue of overloads)
22:46:41Araqthe since pragma is per symbol, it doesn't matter if the symbol is overloaded
22:46:56Araqit only applies to the symbol the pragma annotation belongs to
22:47:51FromGitter<timotheecour> there r other cases, eg a proc for which an extra param is added in v20
22:47:56Araqbut we also need to have since: ("0.20"..<"0.30") so after 0.30 it stopped being part of Nim
22:48:24Araqso now you're talking about parameter additions, that requires a 'when' statement then
22:49:49FromGitter<timotheecour> ok I remember I had voted for branch based… alas… anyway that’s a separate discussion.
22:51:54Araqmost commits would have to be backported, I don't see branch based development working. In Python land every branch has a separate maintainer that can cherrypick bugfixes
22:51:59FromGitter<timotheecour> so I’m trying to integrate karax app with existing react apps (eg youtube etc); I somehow made it work, but it’s pretty hacky and am wondering what’s the best way to do that. I’m currently calling js’ ReactDOM.render for existing components (eg youtube) inside nim’s postRender, but not sure if that’s the best.
22:52:39AraqI don't know either, never tried it
22:53:39*ahmed____ quit (Quit: Connection closed for inactivity)
22:54:06FromGitter<timotheecour> Ok; what about the creation of a js node that contains a string from nim ? (your suggested `text` didn’t work as shown above)
22:54:30*malkomalko joined #nim
22:54:37AraqI have no idea what a "node that contains a string" means
22:55:33Araqresult = buildHtml(tdiv):
22:55:38Araq text "string"
22:55:38FromGitter<timotheecour> ```code paste, see link``` ⏎ ⏎ I wanna call `getTypeFromName1(‘App2’)` ; calling `getTypeFromName2()` works fine. [https://gitter.im/nim-lang/Nim?at=5bb3f76ac7bf7c3662a83d72]
22:56:26FromGitter<timotheecour> it’s not an DOM element, it’s a JS string
22:56:54FromGitter<Araq> proc getTypeFromName1(name: cstring) {.importc: "$1".}
22:59:13FromGitter<timotheecour> Duh… I could swear I had tried this before… works; thank!
23:01:30FromGitter<timotheecour> random other things: I had a local fix to make all types print their raw, un-aliased values in mismatch errors; and another one to have type.name print raw, un-alias values; would that have a chance of getting accepted?
23:01:54*fyber joined #nim
23:05:33AraqI merged a PR that did the same or something similar
23:06:35FromGitter<timotheecour> Unless it’s within past 2 days problem is still largely there, eg https://github.com/nim-lang/Nim/pull/8634#issuecomment-413109363
23:06:55FromGitter<timotheecour> as well as for type.name which uses aliases instead of raw names
23:08:33Araqyour comment is outdated there is no 'aka' in sight
23:11:32FromGitter<timotheecour> will have to dig my pending PR; will get back to u later on that
23:12:21*fester joined #nim
23:13:10FromGitter<timotheecour> one more thing: I have a local fix that allows iterating over a module’s declarations; that’s useful for a number of uses cases involving reflection; same question: would that get accepted?
23:17:00*thomasross quit (Quit: Leaving)
23:17:18*thomasross joined #nim
23:17:42*thomasross is now known as Guest51249
23:17:54*fester quit (Ping timeout: 244 seconds)
23:18:28*Guest51249 quit (Remote host closed the connection)
23:18:50*Guest51249 joined #nim
23:19:52*vivus quit (Remote host closed the connection)
23:19:53*Guest51249 quit (Remote host closed the connection)
23:20:10*thomasross_ joined #nim
23:20:54*thomasross_ is now known as thomasross
23:23:38*andymccrNn joined #nim
23:24:45Araqunlikely. requires at least an RFC
23:25:11*andymccrNn quit (Killed (Sigyn (Spam is off topic on freenode.)))
23:25:15Araqand some of us enjoy the fact that it's always clear what code is safe from "reflection" and can be edited
23:36:35*francisl joined #nim