<< 10-11-2018 >>

00:07:44*d10n_ left #nim (#nim)
00:17:21*citycide quit (Ping timeout: 252 seconds)
00:17:30*citycide joined #nim
00:21:27*citycide quit (Ping timeout: 240 seconds)
00:22:59*citycide joined #nim
00:32:43*jjido joined #nim
00:41:23FromGitter<ratiotile> How can I get nim to use the vs2017 compiler?
01:02:38FromGitter<ratiotile> looks like vccenv.nim doesn't check for VS150COMNTOOLS, and the --vsvarsall option is gone
01:14:48*martin1_1 quit (Ping timeout: 252 seconds)
01:22:24*zachk quit (Read error: Connection reset by peer)
01:22:58*zachk joined #nim
01:23:35*zachk quit (Changing host)
01:23:35*zachk joined #nim
01:40:53*jjido quit (Remote host closed the connection)
01:49:24*martin1_1 joined #nim
01:52:27*zachk quit (Quit: Leaving)
02:02:58*theelous3_ quit (Ping timeout: 246 seconds)
02:24:09FromGitter<ratiotile> made a fix: https://github.com/nim-lang/Nim/pull/9672
02:27:25*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:35:26*martin1_1 quit (Ping timeout: 244 seconds)
03:04:22*citycide quit (Ping timeout: 244 seconds)
03:05:25*banc quit (Quit: ZNC - http://znc.in)
03:06:29*krux02 quit (Remote host closed the connection)
03:21:39*banc joined #nim
03:26:26FromGitter<Aaron-JM> Hey
03:26:42FromGitter<ratiotile> hey
03:26:45FromGitter<Aaron-JM> Anyone know how to zip and password protect files in nim?
03:47:48FromDiscord_<PusiteGA> https://github.com/kuba--/zip
03:48:02FromDiscord_<PusiteGA> and wrap it with nim i guess
03:49:01*vlad1777d quit (Ping timeout: 246 seconds)
04:03:43shashlicknim7z, nimarchive
04:03:47shashlickSnappyc
04:05:36*wildlander quit (Quit: Konversation terminated!)
04:05:46FromGitter<Aaron-JM> Thanks but do any of these support password compression
04:08:51FromGitter<Aaron-JM> Yeah idk if they actually support password zipping
04:17:49*kapil____ joined #nim
04:24:26*onionhammer joined #nim
04:25:55*martin1_1 joined #nim
04:26:07*onionhammer1 quit (Ping timeout: 240 seconds)
04:37:26*smt quit (Read error: Connection reset by peer)
04:39:58*onionhammer1 joined #nim
04:41:08*onionhammer quit (Ping timeout: 268 seconds)
04:44:06*onionhammer joined #nim
04:44:07*martin1_1 quit (Ping timeout: 240 seconds)
04:45:38*onionhammer1 quit (Read error: Connection reset by peer)
04:51:36*onionhammer1 joined #nim
04:52:51*onionhammer quit (Ping timeout: 268 seconds)
05:03:01*onionhammer joined #nim
05:05:11*onionhammer1 quit (Ping timeout: 268 seconds)
05:08:21*onionhammer1 joined #nim
05:10:07*onionhammer quit (Ping timeout: 240 seconds)
05:25:46*darithorn quit ()
05:52:47*awal joined #nim
05:53:10*awal is now known as Guest80198
05:56:11*narimiran joined #nim
06:00:36*Guest80198 is now known as awal
06:25:00*cyraxjoe quit (Ping timeout: 252 seconds)
06:38:25*cyraxjoe joined #nim
06:53:48*dddddd quit (Remote host closed the connection)
06:59:36*mech422__ joined #nim
07:02:58*mech422_ quit (Ping timeout: 268 seconds)
07:08:52*cyraxjoe quit (Ping timeout: 246 seconds)
07:18:06*cyraxjoe joined #nim
07:32:55*jjido joined #nim
07:36:53*kapil____ quit (Quit: Connection closed for inactivity)
07:54:32*Vladar joined #nim
08:08:47*Trustable joined #nim
08:23:18*Trustable quit (Remote host closed the connection)
08:23:28*hoijui joined #nim
08:37:44*jjido quit (Read error: Connection reset by peer)
08:48:21*leorize quit (Ping timeout: 260 seconds)
08:48:49*kapil____ joined #nim
08:50:39*rokups joined #nim
09:02:11*nsf joined #nim
09:08:24*stefanos82 joined #nim
09:10:40*jjido joined #nim
09:18:10*Sembei joined #nim
09:19:39*Pisuke quit (Ping timeout: 252 seconds)
09:21:14*druonysus quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
09:21:46FromGitter<alehander42> what is the difference between
09:21:50FromGitter<alehander42> newTable and toTable
09:22:35FromGitter<mratsim> toTable create a “stack” Table
09:22:41FromGitter<mratsim> creates*
09:22:42FromGitter<alehander42> ahh yeah
09:23:02FromGitter<mratsim> also it works on sequence of {key: value} pairs
09:23:08FromGitter<alehander42> we have a PR changing toTable to newTable in py2nim
09:23:15FromGitter<alehander42> and I wonder if it's closer to the python usage
09:23:41FromGitter<mratsim> to table works on {x: “x”, y: “y”, z:”z”} which is easier
09:23:50FromGitter<alehander42> newTable does too
09:23:53FromGitter<mratsim> oh
09:23:56FromGitter<alehander42> I was surprised too
09:24:05FromGitter<mratsim> then newTable is closer to Python due to ref semantics i think
09:25:25FromGitter<alehander42> yep
09:30:35*leorize joined #nim
09:30:57narimiran@alehander42 pattern matching lib in python: https://github.com/santinic/pampy
09:31:16narimiranmaybe it will be interesting to you
09:33:21FromGitter<alehander42> oh nice
09:34:21FromGitter<alehander42> hm it doesn't have capturing?
09:34:31FromGitter<alehander42> ah it has with lambdas
09:35:23FromGitter<alehander42> looks pretty nice
09:36:40FromGitter<alehander42> but it's just harder to do something like that in Python, you have to use a `lambda` which is just more typing and introduces a new call
09:37:33FromGitter<alehander42> maybe with a decorator you can kinda rewrite the function, but it gets very hard
09:37:55FromGitter<alehander42> because I think you have access to the bytecode only programaticaly
09:38:13FromGitter<alehander42> and I am not even sure it isn't cpython-specific
09:38:24FromGitter<mratsim> there is an ast module in Python but i think it’s a bit like nim secret in Nim :P
09:38:38FromGitter<alehander42> no, it's very popular I think
09:38:56FromGitter<alehander42> it basically created my interest in language dev single handedly
09:39:04FromGitter<mratsim> oh, ok
09:39:11FromGitter<alehander42> we used it in py2nim too
09:39:28FromGitter<alehander42> but the problem is that I am not sure you can just use it in a decorator
09:39:41FromGitter<alehander42> as I don't know if you have access to the source code of the function
09:39:53FromGitter<alehander42> without hacks like reading the function from the file location
09:39:56FromGitter<mratsim> we? did you clone yourself? :D
09:40:43FromGitter<alehander42> well me and zah worked on py2nim
09:40:55FromGitter<alehander42> i don't implement Cloneable
09:42:30FromGitter<alehander42> how are things going with the nimbus vm
09:43:10FromGitter<mratsim> Right now we switched focus is on Eth2.0 following the grant, so updates on Eth1.0 will be slower
09:44:00FromGitter<mratsim> basically we can sync the blockchain for the for tens of thousands of block or so on the networking side, and for the VM only precompiles and CALL instructions are left
09:44:23FromGitter<mratsim> we also ripped out lots of the object oriented part inherited from Python ;)
09:46:15FromGitter<alehander42> yeah sorry for that
09:46:21FromGitter<alehander42> oh eth 2.0 sounds exciting
09:46:54FromGitter<alehander42> is the spec for it final? are there "revolutionary" changes there
09:47:07FromGitter<mratsim> we are actually contributing to the specs
09:47:14FromGitter<mratsim> and it changes everyday
09:47:25FromGitter<mratsim> so it’s a completely different development model
09:47:34FromGitter<mratsim> and yeah, it’s completely revamped
09:48:58FromGitter<mratsim> what was the Eth1.0 will be become a shard chain conceptually, shard chain will be in charge of executing blocks/transactions. but on top there will be a beacon chain that will be in charge of proof-of-stake, randomness generation and cross-shard communication: https://github.com/ethereum/eth2.0-specs/blob/master/specs/beacon-chain.md
09:49:54FromGitter<mratsim> and shard chains only need to hold their own state, so it’s more scalable than Eth1.0 where everyone needs to hold the state of everything.
10:00:17FromGitter<alehander42> great, you're basically on a commitee now :D
10:00:36FromGitter<alehander42> sounds nice, I hope it will work well
10:00:53FromGitter<alehander42> a magnitudes more scalable eth would be a game change
10:01:00FromGitter<alehander42> I guess
10:06:03FromGitter<mratsim> theoretically, sharding brings 1000x scalability at the protocol level, and then on top you can implement “layer 2” solution, like "state channels" (equivalent to direct messaging) or “plasma” (equivalent to a private server) if you only need relaxed security. The state in those can be checkpointed much less often to avoid polluting the main shard chain with spurious updates.
10:11:19*vlad1777d joined #nim
10:12:07*Perkol joined #nim
10:13:47FromGitter<alehander42> cool, iirc the problem was having speed & decentralization & security in the same time, so here you have some exceptions like plasma right
10:14:04FromGitter<alehander42> what is the roadmap, when is it supposed to be ready, e.g. 2020
10:24:48*Vladar quit (Remote host closed the connection)
10:43:09*Yardanico joined #nim
10:43:18FromGitter<mratsim> “when it’s ready” :P
10:44:32FromGitter<mratsim> multiclient beacon chain test net in 6 months, shard chain is still in limbo, probably will use an EVM 2.0, latest idea would be for it to be eWASM based (ethereum WASM).
10:45:50FromGitter<alehander42> I see, so you're still working on the spec
10:46:16FromGitter<alehander42> does this mean nimbus would need to implement ewasm support
10:46:33FromGitter<alehander42> or you'll use existing wasm runtimes
10:48:54*jjido quit (Read error: No route to host)
10:53:00*Vladar joined #nim
11:11:35*Yardanico quit (Remote host closed the connection)
11:35:46*Perkol quit (Quit: Leaving)
11:36:33*Perkol joined #nim
11:41:58*narimiran quit (Ping timeout: 272 seconds)
11:46:17*voiceftp quit (Read error: Connection reset by peer)
11:46:31*voiceftp joined #nim
11:59:40*Perkol quit (Remote host closed the connection)
12:02:28FromGitter<mratsim> probably we will use eWASM C++ for proof-of-concept
12:02:58FromGitter<mratsim> once we show that it works, it makes sense to implement it in Nim
12:16:08*PMunch joined #nim
12:35:59*Snircle joined #nim
12:43:43*stefanos82 quit (Quit: Quitting for now...)
12:52:31*nsf quit (Quit: WeeChat 2.3)
12:56:11*NimBot joined #nim
13:11:14PMunch@tim-st, you couldn't get nimlsp to work on Windows
13:11:16PMunch?
13:11:55*PMunch quit (Remote host closed the connection)
13:17:51*kapil____ quit (Quit: Connection closed for inactivity)
13:22:41*smt joined #nim
13:49:25FromGitter<arnetheduck> that's 5 months, @mratsim .. get cracking
13:50:43*dddddd joined #nim
13:55:06FromGitter<tim-st> PMunch: yes, I get it compiled and it runs, but it seems first request makes it crash, it doesn't work with `intellij-lsp` too :\
14:04:18FromGitter<tim-st> PMunch: not sure if it helps: https://gist.github.com/tim-st/714f9caf1d50473c5500e0e407fab461
14:07:38*Sembei quit (Quit: WeeChat 2.3-dev)
14:21:03*Yardanico joined #nim
14:27:10FromGitter<alehander42> is lsp already ready for use :O
14:29:44FromGitter<tim-st> that's what I wanted to find out :)
14:46:09*Zevv joined #nim
14:48:44ZevvHi #nim. I'm playing around with handling audio in SDL2 for nim. Recorded audio frames are delivered to the application by a cdecl call from an interal SDL thread of which Nim is not aware.
14:49:10ZevvI don't see any precautions in the example code from sdl2_nim at https://github.com/nim-lang/sdl2/blob/master/examples/sdl_audio_callback.nim
14:49:42Zevvbut my own app crashes in various interesting ways, which seems reasonable if I do any Nim from the callback.
14:50:39ZevvIs there a proper way to handle these situations, or should they just be avoided?
14:55:52shashlickZevv: this perhaps? https://forum.nim-lang.org/t/3965
14:56:53*lukd quit (Quit: WeeChat 2.2)
15:01:29Zevvshashlick: Thanks, that seems like a trivial fix
15:02:01Zevvunfortunately, Nim does not like this. If I add setupForeignThreadGc() in my callback compilation fails: c.nim(71, 15) Error: usage of 'on_audio' is a user-defined error
15:02:33Zevvbut thanks for the hint, I'll do some reading first!
15:03:33Zevv--threads:on :)
15:03:55Zevvworks like a charm now, thank you
15:06:49leorizeZevv: well that doesn't sounds like a good error message...
15:08:24leorizeIIRC there were commits that make compiling without `--threads:on` output a message telling you to add it
15:13:44*seni joined #nim
15:13:44*lukd joined #nim
15:20:23*rokups quit (Quit: Connection closed for inactivity)
15:22:51*martin1_1 joined #nim
15:28:07*narimiran joined #nim
15:30:57*martin1_1 quit (Ping timeout: 244 seconds)
15:41:33xacein my own module/lib, i'd like to introduce a procedure to return the relevant output to a string, what's the norm in nim for this, should i only define the `$` proc or should i also add a .toString() ?
15:50:21narimiranxace: just `$`
15:53:04xaceOki, thank you
16:03:09benjikun#join #perl6-dev
16:03:15benjikunwhoops, ignore that
16:04:36Zevvleorize: Funny thing is that in gc_common there is indeed a proper error message defined for this case: setupForeignThreadGc is available only when ``--threads:on`` and ``--tlsEmulation:off`` are used
16:04:40Zevvbut for some reason it's not hit
16:07:29FromGitter<kayabaNerve> I do $ for printing and toString for binary data.
16:07:36*martin1_1 joined #nim
16:07:51FromGitter<kayabaNerve> Commenting in case xace is still here.
16:13:00leorizeZevv: weird. If you could make a small snippet to reproduce the problem, maybe it'd worth filing an issue.
16:22:27*vlad1777d quit (Ping timeout: 240 seconds)
16:22:53*vlad1777d joined #nim
16:39:03*darithorn joined #nim
16:39:22*wildlander joined #nim
16:46:40*nsf joined #nim
16:52:49xacekayabNerve: yeah, in my case it's string data, but I'll keep that in mind
17:01:14*wildlander quit (Quit: Konversation terminated!)
17:01:27*wildlander joined #nim
17:17:10*martin1_1 quit (Ping timeout: 268 seconds)
17:24:48*stefanos82 joined #nim
17:25:17*martin1_1 joined #nim
17:32:58FromGitter<kayabaNerve> Sounded like it :p just thought it might help.
17:42:14*darithorn quit ()
17:50:25*dddddd quit (Remote host closed the connection)
17:52:04Zevvleorize: https://github.com/nim-lang/Nim/issues/9677
18:08:16xaceresult = align($TimeInterval.hours,2,'0') # where should i place that $ to convert the int(hours) into a string? the way i put it now doesnt work
18:09:06narimiranxace: have you tried putting parantheses around `TimeInterval.hours`?
18:09:32xacenarimiran: i tried this: align($(TimeInterval.hours),2,'0')
18:09:58narimiranand?
18:10:04xaceit complained: type mismatch: got <type int>
18:10:37xacethen it goes ahead and lists various `$` procedures including: proc `$`(x: int): string
18:10:55*zachk joined #nim
18:11:30*zachk quit (Changing host)
18:11:30*zachk joined #nim
18:13:58*theelous3_ joined #nim
18:14:14narimiranxace: can you give us a small, self-contained, example? (post it on some pasting service)
18:14:26xaceyeah 1 min let me construct it
18:18:54xacenarimiran: my bad, the problem became abundantly clear when i remade a small example, i was using TimeInterval.hours where TimeInterval was the variable type, rather than the variable name
18:19:10narimiran:)
18:19:25narimiran...and that's why you don't use PascalCase for variable names
18:28:11xacenarimiran: Yeah, i didn't, the variable name was just `t` in this case. atm I'm coding in vim, i feel like I should set up a better vim environment to handle nim better, but i'd bet someone already has spent time doing this
18:28:57benjikunCan I not forward a procedure from another module to whatever is including this module while keeping the same name
18:29:15benjikunI know I could just make a template and call it something else
18:29:17narimiranxace: https://github.com/nim-lang/Nim/wiki/Editor-Support#vim
18:29:46benjikunlike a global mixin or something idk
18:30:06narimiranbenjikun: i'm not sure i understand what you're trying to do and/or where it fails to do what you want
18:30:15FromGitter<alehander42> vim has good support i think it has plugins
18:35:35benjikunI figured it out narimiran, thanks for the quick response though
18:37:03xacenarimiran: yeah, i'm using that, but I still find myself relying on my webbrowser to look things up
18:37:21narimiranwe all do, we all do.... :)
18:39:24xacehehe, yeah, I just find it to be a obstacle in my workflow, but with time and experience i'll get better and might have time to spare to make something to alleviate the workflow issues for me
18:43:05xaceif I intend to distribute a module, should i avoid using strformat ? I Figured since I'm only doing some simple concatenations at specific spots I might aswell drop another dependency
18:44:23FromGitter<alehander42> well it's in the stdlib
18:44:55FromGitter<alehander42> i wouldn't call it a dep
18:45:12FromGitter<alehander42> concatecations is what strformat is for after all
18:45:55xaceHmm, is it normal for it to be used, eventough I'll only use it once in the entire module?
18:46:23benjikunYou can just include that from the module
18:47:12benjikun`from strformat import yadayada`
18:47:31narimiranit doesn't really matter how do you import
18:48:33FromGitter<alehander42> well why not, if you use split only once you wouldn't write it manually
18:48:41FromGitter<alehander42> but yeah `a & b` is also
18:48:42FromGitter<alehander42> fine
18:48:54FromGitter<alehander42> but there is no cost at importing it or something
19:11:52*martin1_1 quit (Ping timeout: 268 seconds)
19:28:39*martin1_1 joined #nim
19:30:52FromGitter<tim-st> I think cost is binary size
19:31:39xaceyeah I think so too
19:31:55FromGitter<tim-st> maybe this is not true for strformat, I can imagine it is macros?
19:32:16xacetim-st: it seems to be a mix between macros and procedures
19:32:55FromGitter<tim-st> hm, you would have to compare the binaries then
19:34:15xaceI'll avoid it, since i'd rather have the module itself be minimal than shoving in extrasa for a simple problem
19:34:36*Trustable joined #nim
19:34:57FromGitter<tim-st> at least I can tell that also import are compiled if they are not used and also if you just import one proc from the package, everything in the package gets compiled
19:36:05FromGitter<tim-st> I now use more files and define types in single files, especially when one module has c files it can create import problems if imported twice
19:39:31*nsf quit (Quit: WeeChat 2.3)
20:14:37*starfish19 joined #nim
20:17:20xacefor line in lines: # is it possible to peekforward and see If the current iteration is the last one?
20:22:16benjikunother than keeping a running total and knowing the amount of lines, I'm not sure
20:23:33xacebenjikun: yeah, but I feel like I've previously encountered code that did something without keeping track of the iterations by itself
20:27:06benjikunhmm
20:27:49xacebenjikun: but I might be totally wrong, might've been some tuple kind of structure that was returned
20:32:57*starfish19 quit (Ping timeout: 256 seconds)
20:38:39*shpx joined #nim
20:44:09*Trustable quit (Remote host closed the connection)
20:58:00*PMunch joined #nim
21:00:20FromGitter<tim-st> maybe with streams, readLine and atEnd ?
21:02:52*narimiran quit (Remote host closed the connection)
21:11:31*Yardanico quit (Remote host closed the connection)
21:12:25*darithorn joined #nim
21:13:27*Vladar quit (Remote host closed the connection)
21:20:57PMunch@tim-st, looking at your gist
21:21:03PMunchIt appears like nimlsp just crashed
21:21:31PMunchOh wait, I think I have hard-coded in the log- and dirtyfile path as /tmp/nimlsp
21:22:02PMunchThat might be causing some issues
21:28:59*stefanos82 quit (Quit: Quitting for now...)
21:31:45FromGitter<tim-st> PMunch: I think you only hardcoded it once, and I changed that to `nimlsp` and seems to work, for me the latest version doesnt compile anymore
21:32:14PMunchAh okay
21:32:24PMunchTo get the latest version to compile you need to update jsonschema
21:32:32FromGitter<tim-st> ok
21:32:37PMunchI forgot to bump the version number so it isn't automatic
21:33:00FromGitter<tim-st> I'm not sure if calling nimsuggest works, although I have everything in path
21:35:18PMunchThere, updated the versions
21:35:30PMunchHmm, strange that calling nimsuggest doesn't work
21:35:55PMunchIt does do a simple slice to get the path from the URI, is it possible that Windows doesn't like the forward slashes?
21:36:16PMunchI don't think it escapes anything in them either, so the "-" you have in your path might mess things up
21:37:03FromGitter<tim-st> I'm not sure if it doesnt work because I have no hepful errors from sublime, I just looked at process manager and didnt saw it once, maybe it crashes there
21:37:22PMunchI'm currently working on creating a nimsuggest library from the source code of nimsuggest. With this there should no longer be a need for calling nimsuggest
21:37:48FromGitter<tim-st> ok, that sounds good, does it create a nimsuggest for each nim file?
21:37:52PMunchYeah if you look in the gist you sent me Sublime says it can't read or write, meaning the process died
21:38:09PMunchCurrently it creates a nimsuggest process for each project file
21:38:22FromGitter<tim-st> ok
21:38:23PMunchSo if you open two files with the same project file they will share a process
21:43:33*shpx quit (Read error: Connection reset by peer)
21:50:45FromGitter<tim-st> nimlsp directly crashes after I hover the first time over a name, I dont know how can I get better info, it seems the exception is not logged :\
21:54:01*nsf joined #nim
22:10:52*martin1 joined #nim
22:14:02*martin1_1 quit (Ping timeout: 272 seconds)
22:15:57*martin1 quit (Ping timeout: 252 seconds)
22:22:07*banc quit (Ping timeout: 240 seconds)
22:23:48*hoijui quit (Ping timeout: 245 seconds)
22:27:01*banc joined #nim
22:34:06PMunchYeah, since the LSP protocol is over the stdin/stdout interface it's hard to get better logs..
22:34:18PMunchEven though Sublime is logging stderr
22:34:24PMunchIt's really annoying
22:34:46PMunchHopefully stability will get better when I have the nimsuggest library
22:54:47*PMunch quit (Remote host closed the connection)