<< 18-03-2018 >>

00:01:59*BitPuffin quit (Remote host closed the connection)
00:04:00*endragor joined #nim
00:05:13*endragor quit (Remote host closed the connection)
00:05:36*endragor joined #nim
00:07:06*endragor quit (Remote host closed the connection)
00:09:36FromGitter<mratsim> @miran try this, it should be much faster: https://github.com/mratsim/Arraymancer/blob/master/benchmarks/euler_tensor_optim.nim. ⏎ I think the main bottlenecks were the 3 ~ 4 temporary tensors created in each functions. That is quite costly. So solution: I have to work on my loop fusion macro
00:20:31*endragor joined #nim
00:24:09*RushPL joined #nim
00:24:57*endragor quit (Ping timeout: 240 seconds)
00:35:53*PMunch quit (Quit: leaving)
00:42:03FromGitter<polypus74> anyone know any good libs for binary protocol packing/unpacking?
00:42:25FromGitter<mratsim> Maybe NESM? https://github.com/xomachine/NESM
00:43:12FromGitter<polypus74> v/ cool thanks. looks like it might be of use
00:43:43FromGitter<mratsim> doc is extensive: https://xomachine.github.io/NESM/
00:58:30leorizeDoes anyone know any alternative methods to implement this? https://play.nim-lang.org/?gist=36940b8cfd10a29659ae87d5e05f8879
01:00:32leorizeWhile it appears to be a nice way to reduce duplication, the compiler crashes with it (issue filed), so I would like to know if there's any alternative instead of copying code all over.
01:06:40dom96Link to issue?
01:06:50dom96Your code is missing the definition for 'Context'
01:13:16GitDisc<2vg> hi, Michael-Scott queue implemented in Nim but this is very unsafe so... Can anyone securely implement using ref object ? I want to leave memory management to GC ;)
01:13:17GitDisc<2vg>
01:13:17GitDisc<2vg> https://github.com/2vg/MSQueue
01:16:47dom96Nimgen sure is cool
01:17:20dom96Wish Nimble could support installation of packages that depend on it when nimgen hasn't already been installed
01:18:26federico3dom96: isn't the dependency system doing that?
01:18:51leorizedom96: https://github.com/nim-lang/Nim/issues/7355
01:18:52dom96not when you use a 'before install' hook which all of these packages are using
01:19:54leorizethe gist was only an demonstration of what I would like to achieve, so I didn't copy all the contents over.
01:21:25*arcmass joined #nim
01:22:42dom96arcmass: Sorry about this but webchat is currently muted here so I'm the only one who can see your messages.
01:23:31dom96Gitter is another alternative which is relayed to IRC
01:24:28dom96As for your question, I guess you want: https://nim-lang.org/docs/terminal.html#getch,
01:27:50dom96leorize: I replied to your issue
01:28:01dom96arcmass: Here is a handy link: https://gitter.im/nim-lang/Nim :)
01:30:14*dom96 really needs to unmute webchat or get NimBot to notify people that they are muted
01:30:31dom96In any case. Time for sleep, good night!
01:31:20FromGitter<2vg> good night, dom96 ;)
01:39:11FromGitter<polypus74> concepts: how ready are they?
01:45:57*arnetheduck quit (Ping timeout: 264 seconds)
02:05:34*xet7 quit (Quit: Leaving)
02:45:48FromGitter<AjBreidenbach> conceptually?
02:54:11*S1tiSchu joined #nim
02:57:57*S1t1Schu quit (Ping timeout: 264 seconds)
03:13:14*dddddd quit (Remote host closed the connection)
03:26:52*vlad1777d_ quit (Ping timeout: 246 seconds)
03:58:09*yglukhov joined #nim
04:02:31*yglukhov quit (Ping timeout: 256 seconds)
04:22:43*NimBot joined #nim
04:26:17*SenasOzys quit (Remote host closed the connection)
05:10:43*NimBot joined #nim
05:44:34*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
05:48:59*arcmass quit (Ping timeout: 260 seconds)
06:16:01*nsf joined #nim
06:42:40*miran joined #nim
06:48:41*arthurz quit (Read error: Connection reset by peer)
07:16:17*byte512 quit (Ping timeout: 240 seconds)
07:16:28*littleli quit (Quit: Ping timeout (120 seconds))
07:16:55*r4vi_ joined #nim
07:16:56*littleli joined #nim
07:18:29*thor77_ joined #nim
07:18:46*r4vi quit (Read error: Connection reset by peer)
07:18:47*Araq quit (Ping timeout: 240 seconds)
07:18:48*thor77 quit (Ping timeout: 240 seconds)
07:18:48*Cthalupa quit (Ping timeout: 240 seconds)
07:18:49*r4vi_ is now known as r4vi
07:18:56*byte512 joined #nim
07:18:56*Araq joined #nim
07:19:07*Cthalupa joined #nim
07:37:11*yglukhov joined #nim
07:39:42*yglukhov quit (Remote host closed the connection)
08:20:30*yglukhov joined #nim
08:20:38*yglukhov quit (Remote host closed the connection)
08:35:12*miran quit (Quit: Konversation terminated!)
08:43:37*yglukhov joined #nim
08:48:22*rokups joined #nim
08:52:14*jaco60 joined #nim
09:01:33*rauss quit (Read error: Connection reset by peer)
09:03:06*rauss joined #nim
09:15:18FromGitter<mratsim> Did someone already implement a varargs zip? I suppose that would be quite useful in sequtils.
09:15:50*yglukhov quit (Remote host closed the connection)
09:17:55FromGitter<mratsim> but the varargs need to be known at compile-time so only arrays and “tuple-like" zip(seq1, seq2, seq3), mmmh.
09:20:40Araqfor+if vs zip, filter, foldl, foldr, map. Still don't see the elegance in FP. ;-)
09:21:27Araqit's like Kepler vs epicycles.
09:22:36FromGitter<mratsim> This is part of a larger problem, I want to implement loop-fusion in Arraymancer: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aae2fdc26a769820b2ad626]
09:23:25FromGitter<mratsim> basically I want to be able to have a variadic number of t[_, 0..^3], t[_, 1..^2], t[_, 2..^1] ...
09:24:15FromGitter<mratsim> this is implemented with `for x{.inject.}, y{.inject.}, z{.inject} in zip(t1, t2, t3)` currently
09:24:20Araqwhere is the problem? loopFusion has enough context to do that
09:25:29FromGitter<mratsim> there is no problem, it’s just to check if there was a varargs zip I could use as reference
09:29:01FromGitter<mratsim> The only foggy thing is how to ensure that if I do `macro zip(v: varargs[Tensor]): untyped` how to ensure that the arity of v is known at compile-time.
09:29:39FromGitter<mratsim> `macro zip(v: varargs[Tensor] not seq)` ?
09:37:34FromGitter<mratsim> Actually my need seems similar to the “curry” needs: https://github.com/nim-lang/Nim/issues/402
10:03:16Araqoh please leave 'void' out of this. 'void' is horrible.
10:06:04FromGitter<data-man> @mratsim: zero-functional library supports zip with 4 parameters. Can be increased. :)
10:06:39FromGitter<mratsim> I really need varargs!
10:07:04FromGitter<mratsim> But it’s fine, I’m building the macro right now
10:07:21Araqthe macro can produce code that doesn't depend on a zip, no?
10:15:26FromGitter<mratsim> Probably, basically the `loop-fusion` should generalize the following: https://github.com/mratsim/Arraymancer/blob/e801b78169b59f1213a2e046997cfecf99ed4feb/src/tensor/higher_order_applymap.nim#L24-L114
10:16:28FromGitter<mratsim> This template `omp_parallel_blocks(block_offset, block_size, t.size)`splits the work for OpenMP parallelization.
10:16:36*xkapastel quit (Quit: Connection closed for inactivity)
10:17:27*tefter joined #nim
10:17:45leorizehi, does the compiler automatically inline procs across modules? I don't really want to add {.inline.} to everything
10:18:20FromGitter<mratsim> in that case you need to compile with `-lto`
10:18:36Araqleorize, it doesn't :-) but -lto helps
10:18:45FromGitter<mratsim> it’s not done in C so it’s not done in Nim ;)
10:19:04Araqwell actually .inline is replicated to make it easier for C
10:20:35Araqbut we don't infer .inline automatically
10:24:13FromGitter<data-man> @Araq: How about new compiler parameter? --inline or --opt:inline
10:24:34Araqbased on what principle?
10:24:57FromGitter<data-man> Alaways proc inline
10:25:09Araqfor every proc or what?
10:25:21FromGitter<data-man> Yes, for every proc
10:25:41Araqthat's crazy talk
10:25:59FromGitter<data-man> or smart inline, for short procs
10:28:15leorizeAraq: is core/seqs.nim currently used by anything?
10:28:40Araqleorize, sadly, no.
10:28:44FromGitter<mratsim> Don’t inline every proc, that’s a recipe for code size explosion
10:29:13leorizeI found that it solves a few issues I have with seq for --newruntime. Is there any plans to move it to system.nim?
10:29:29Araqdata-man, meh just use link time optimization instead.
10:29:31FromGitter<mratsim> the compiler detects and inline short proc already within the same module.
10:29:59FromGitter<mratsim> I actually have to put {.noinline.} sometimes for benchmarking ;)
10:29:59Araqleorize, yup. it's the next generation of Nim's seq :-)
10:32:08*yglukhov joined #nim
10:36:06FromGitter<data-man> @Araq: In some libs I saw unroll pragma. But docs says that "Note: Currently the compiler recognizes but ignores this pragma." Who is wrong? :)
10:36:29Araqthe libs :-)
10:37:19FromGitter<data-man> I thought so. :-)
10:39:50leorizeAraq: do we have anything capable of being the Allocator in stdlib? alloc() exists but doesn't have the alignment param
10:40:08*dddddd joined #nim
10:41:16Araqleorize, PRs are welcome, we need to add alignment to alloc() I think
10:44:30leorizeI think I could create the missing procs for seqs, but I know nothing about memory allocation
10:45:39FromGitter<mratsim> Oh please that would be awesome =), @data-man yeah I use the unroll pragma as a reminder ;) but usually it’s not performance critical, if it is I write my own unroll macro like so: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/fallback/blas_l3_gemm_micro_kernel.nim#L18 or for an unknown at compile time this can be made into a macro: https://gist.github.com/mratsim
10:45:39FromGitter... /cc49df81f5050550b83c73b616c142a1#file-strided-nim-L9-L29
10:53:34FromGitter<data-man> @mratsim: Can you adapt this for seqs?
10:54:19FromGitter<data-man> BTW Today I downloaded all the IRC logs. A lot of interesting. :) ⏎ A bit of statistics: ⏎ 2063 files ⏎ largest log on 21-01-2015 ⏎ smallest log on 30-03-2013 ... [https://gitter.im/nim-lang/Nim?at=5aae455b35dd17022e716a92]
10:58:26Araqis an error message
10:58:27Araq"Nim is not Pascal; the syntax is 'parameter: var T', not 'var parameter: T'"
10:58:30Araqacceptable?
10:59:29FromGitter<data-man> @Araq: No, I love Pascal! :)
10:59:42*Vladar joined #nim
11:00:23*SenasOzys joined #nim
11:00:51Araqok, then without the remark
11:00:53*SenasOzys quit (Remote host closed the connection)
11:01:00Araq"the syntax is 'parameter: var T', not 'var parameter: T'"
11:01:22*SenasOzys joined #nim
11:01:37FromGitter<dom96> @data-man in case you want to run more analysis, you can grab a JSON of the logs of most days. Just change the extension to .json
11:02:52*Snircle joined #nim
11:03:33Araqmaybe produce a graph "number of days Araq is a dick" vs "number of days Araq was helpful" :P
11:05:21FromGitter<data-man> @dom96: Thanks! Just for offline reading. boilerplate.css is missing?
11:06:30FromGitter<mratsim> @data-man, I could but I’m lacking the time.
11:07:41*yglukhov quit (Remote host closed the connection)
11:08:39FromGitter<data-man> @mratsim: Ok. ⏎ @Araq: And for those who do not know Pascal such a message is unclear.
11:08:47leorizeAraq: What makes something qualify as an openArray? I'm fiddling with core/seqs but it seems that the new seq is not qualified as an openArray
11:09:24Araqdata-man: those who do not know Pascal do not make this syntax error
11:10:36*yglukhov joined #nim
11:11:17Araqspeaking about 'void'. it is too late to remove 'void' from Nim?
11:11:26FromGitter<alehander42> what's bad about it?
11:12:05Araqit's a PITA to support properly in the compiler
11:12:26FromGitter<alehander42> well how would one signify the return type of a void procedure :D
11:12:46Araqfor return type it's ok.
11:12:54Araqbut for everything else it's messy
11:13:03FromGitter<alehander42> what else can it be used for :O
11:13:24AraqTable[string, void] # a set of strings
11:14:01FromGitter<alehander42> ahh, I've used Table[string, bool] for that
11:14:29FromGitter<alehander42> I didn't realize void can be used like this, can one do seq[void] ?
11:14:36AraqcreateThread[void](thing)
11:19:29yglukhovFuture[void]?
11:20:02*vlad1777d joined #nim
11:22:08FromGitter<alehander42> @PMunch I will start a simple lang parser dsl for one side project, I will probably ask you stuff as the parser lib guru around :D
11:22:27FromGitter<alehander42> yeah, Future[void] is ok, as a return type too I guess
11:23:55FromGitter<mratsim> I think this needs an example: https://nim-lang.org/docs/macros.html#params=,NimNode,NimNode `proc params=(someProc: NimNode; params: NimNode)` I can’t pass an `nnkFormalParams.newTree(…)` or a seq\[NimNode\] to it. (assertion error)
11:29:40*yglukhov quit (Remote host closed the connection)
11:29:47FromGitter<alehander42> wow I'll manage to use `*rule` in the dsl
11:29:56FromGitter<alehander42> I wonder if that would be too confusing instead of `rule*`
11:45:22*Trustable joined #nim
12:14:27*yglukhov joined #nim
12:16:35Araqalenader42: thats what I use too
12:21:25Araqyglukhov, well Future[void] is fine too. what is hard is that 'void' parameters can be "empty"
12:21:31Araqproc foo(a, b: void)
12:21:35Araqfoo() # valid
12:21:57Araqthat's what makes things hard. If we map 'void' to the empty tuple this would become
12:22:03Araqfoo((), ())
12:22:43Araqand lots of bugs would disappear :-)
12:23:22AraqScala uses 'Unit' instead of void for these reasons
12:23:55yglukhovhm, i did not know nim supports void arguments =). so i will not miss this functionality probably...
12:41:49yglukhovmapping void to () is even better i think
12:47:32dom96it seems to me that 'void' arguments can be replaced by simply overloading
12:47:33dom96No?
12:51:03Araqyeah, they can.
12:55:05*yglukhov quit (Remote host closed the connection)
13:04:13*r3d9u11 joined #nim
13:14:18dom96yay, journalctl has all the timestamped logs for my Snake game
13:14:52dom96So I should be able to get a nice graph showing a spike during my talk
13:18:32*hyp3rbor3a joined #nim
13:19:44dom96Araq: Still not sure how to fix this Aporia problem
13:20:04dom96Smells like a regression
13:20:13dom96I get the same error even if I don't use the template
13:21:58AraqI wanted to improve the error messgae for "illegal capture"
13:50:58FromGitter<mratsim> I’m stuck at this point for my variadic zip: `Error: invalid type: 'typed' in this context: 'iterator (s0: seq[typed], s1: seq[typed], s2: seq[typed], s3: seq[typed]): tuple of (typed, typed, typed, typed){.inline.}' for proc` It doesn’t seem like getType, getTypeinst or getTypeImpl would work instead: https://gist.github.com/mratsim/b153b7df89db3730a97143c39b19cf41#file-varargs_zip-nim-L117
14:05:37FromGitter<mratsim> made progress, seems like I can’t use `args: varargs[seq[typed]]` but I must use `args: varargs[typed]`
14:16:01*leorize quit (Ping timeout: 245 seconds)
14:20:04FromGitter<mratsim> bummer, I can’t generate my own iterator inside a for loop and then call it, so I must create my own “forN” / “forN” macro that wraps everything.
14:27:08dom96why not?
14:29:53Trustabledom96: Please have a look at https://github.com/nim-lang/Nim/pull/7326 . It should be a no-brainer to merge.
14:36:13FromGitter<zacharycarter> yeah I don't see why that shouldn't be possible @mratsim - can you share some code?
14:40:14dom96Trustable: thanks
14:43:09Trustabledom96: thank you :)
14:48:18*nsf quit (Quit: WeeChat 2.0.1)
15:06:05*Sentreen quit (Quit: WeeChat 1.6)
15:08:08*miran joined #nim
15:08:56*Sentreen joined #nim
15:09:55*yglukhov joined #nim
15:13:06*s7rfq joined #nim
15:13:07*s7rfq quit (Client Quit)
15:14:13*yglukhov quit (Ping timeout: 240 seconds)
15:20:33*SenasOzys quit (Ping timeout: 240 seconds)
15:25:31*PMunch joined #nim
15:26:03*SenasOzys joined #nim
15:31:45FromGitter<alehander42> I think I just had special cases for 2, 3 and 4 zip cases
15:31:51FromGitter<alehander42> we had* in zero_functional
15:32:07FromGitter<alehander42> do you want a more general zip?
15:35:14PMunchdom96, does Jester/AsyncHttpServer start new threads at any point? Or is it all just in a separate thread from the main thread?
15:35:38*_alexr_ joined #nim
15:36:01dom96PMunch: Neither
15:36:05PMunchNeither?
15:36:11dom96It's single threaded
15:36:39*_alexr_ quit (Remote host closed the connection)
15:36:40PMunchBut Nim was complaining when I tried to use a global variable
15:37:00FromGitter<mratsim> @zacharycarter @alehander42: https://gist.github.com/mratsim/b153b7df89db3730a97143c39b19cf41
15:37:02PMunchHad to mark it as {.threadvar.} to be able to use it in a route
15:37:29AraqPMunch, the compiler enforces 'gcsafe' independently of whether you use threading or not
15:38:17dom96federico3: Can confirm, peak number of users on Snake was 28
15:38:33dom96The IPs are different too
15:38:48federico3world domination [✔]
15:39:07dom96I'm surprised so many people joined
15:39:10PMunchAraq, ah so because the matcher is marked as gcsafe it checks it. Is that to make it possible to run Jester in a thread if you want to, or is there some other reason for it?
15:39:18PMunchdom96, you had a snake-off?
15:39:30federico3indeed - but aren't the client NATted?
15:39:38dom96PMunch: I embedded my Multiplayer Snake game in my presentation
15:39:45dom96PMunch: And asked people to join
15:40:01*edcragg quit (Quit: ZNC - http://znc.in)
15:40:06PMunchPresentation?
15:40:11FromGitter<alehander42> @mratsim I don't know how hard would that be with typed args, I usually used untyped ones and try to delay the type checking after expansion
15:40:14*edcragg joined #nim
15:40:38dom96federico3: No idea. My knowledge of NAT is embarresingly bad :)
15:40:49dom96PMunch: Local event at my Uni
15:41:15dom96PMunch: Also, regarding your Jester question: yes
15:41:23PMunchAh right, maybe that would be a good idea for the Nim talk me and couven are giving at our university :)
15:41:27federico3dom96: don't tell insomniac!
15:42:04FromGitter<mratsim> @alehander42 Actually it works here, my macro with 4 args would produce something similar to this: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ But in a `for`context I cannot define a new iterator and then call it. [https://gitter.im/nim-lang/Nim?at=5aae88cc2dfcfffd2b2b925e]
15:42:25mirandom96: don't forget to post the slides online :)
15:42:28federico3dom96: do you see multiple connections from the same IPaddrs?
15:42:28dom96federico3: I was expecting lots of similar IPs, most people were surely connected to the Uni wifi
15:42:38dom96federico3: or maybe most people just used their mobile internet
15:42:51Araqmratsim: what's the connection of loop fusion and 'zip'?
15:42:55*yglukhov joined #nim
15:43:14federico3virtually all phone provider NAT very heavily
15:43:47dom96federico3: Does that mean that people connected to the same mobile tower will get the same IP?
15:43:48PMunchdom96, so I only need to mark it as a threadvar in case I want to run the matching in a thread. Wish there was some way around that, makes it look a bit messy..
15:44:04federico3no way :)
15:44:08*leorize joined #nim
15:44:10dom96federico3: Interestingly, there is one Irish and one US IP
15:44:13AraqPMunch, workaround is easy:
15:44:20Araq{.gcsafe.}:
15:44:26Araq code that accesses the global here
15:44:59FromGitter<mratsim> @Araq, if I get a generalized zip on seq, I can port it to Tensors, if I have a zip on Tensors, I can create use it as a base for loop fusion
15:45:28dom96Araq: But that's just a hack, no?
15:45:33dom96it'll fail as soon as you use threads
15:45:50dom96federico3: TL;DR about NAT? :)
15:46:04federico3incoming
15:46:09Araqdom96, yup, it's a hack
15:47:13*yglukhov quit (Ping timeout: 240 seconds)
15:47:40FromGitter<mratsim> The main issue on tensors is that one could be in row Major order, the second in column major, and the third is in something random, so iteration is not trivial.
15:47:46*nsf joined #nim
15:48:54FromGitter<mratsim> So I have helper template `initStridediterations`and `advanceStridedIterations` that take that into account properly.
15:49:24FromGitter<mratsim> My current zip proc are built on top of that (to zip, 2 or 3 tensors)
15:49:43PMunchWell, tagging one variable with threadvar vs. tagging all the routes with gcsafe it would look worse than what I'm doing now :P
15:50:14FromGitter<mratsim> and on top of that I have map2, map3 templates, that supports OpenMP. (the zip supports splitting work)
15:51:07FromGitter<mratsim> loopfusion means generalizing map2/map3, so ideally I generalize the zip iterators*
15:51:31*PMunch quit (Quit: leaving)
15:53:11*rauss quit (Quit: WeeChat 2.0.1)
15:57:17*S1tiSchu is now known as SitiSchu
15:58:19dom96omg, why is it so difficult for Excel to pick up my date strings
16:01:53dom96of course, it can't handle ISO dates
16:05:55*hyp3rbor3a quit (Quit: Leaving)
16:10:02shashlickAraq: if you remove void, what can we map to for C functions or data types that use void or void*
16:11:40Araqshashlick, my bad, I'm not removing 'void', but I remove some weird behaviour of it
16:12:01shashlickOk cool
16:12:25Araqbtw 'void*' is just 'pointer'
16:25:31*xkapastel joined #nim
16:41:53FromGitter<mratsim> Is it possible to not get `undeclared identifier` in this situation? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aae96d1012ff2bf681da12e]
16:46:03*dddddd quit (Remote host closed the connection)
16:46:23planetis[m]can I add get{Int, Str, Bool} procs with a field parameter i.e: `data["sets"].getInt("size", 2)` or that will complicate the json module Api?
16:46:52planetis[m]in order to be used without the weird `{}` thing
16:52:39federico3si
16:58:26Araqplease don't. the json module is aready getting bloated
16:59:19planetis[m]thought so
17:42:20*PMunch joined #nim
17:43:03*smt quit (Ping timeout: 256 seconds)
17:43:42FromGitter<mratsim> Success: I have a variadic forEach that you can use like so `ForEach [i,j,k], [a,b,c]: (i + j) * k`: https://gist.github.com/mratsim/e71b16354f146f3253a76cb0eff8a908
17:43:59*nsf quit (Quit: WeeChat 2.0.1)
17:44:03*enthus1ast joined #nim
17:44:40FromGitter<mratsim> Now I only need to have an unique identifier for the autogenerated `zip` proc
17:45:57*enthus1a1t quit (Ping timeout: 240 seconds)
17:49:52shashlickWhat's a good module to get working in the VM? One that doesn't use importc of course 🙂
17:50:22shashlickAnd is there any plan to get importc working in the vm or no plans, too much work?
17:51:23*MJCaley joined #nim
18:05:51dom96https://twitter.com/d0m96/status/975433038590078976
18:06:18*SitiSchu quit (Read error: Connection reset by peer)
18:18:55FromGitter<AjBreidenbach> that game is surprisingly cpu intensive
18:19:54dom96really? What browser?
18:20:54FromGitter<AjBreidenbach> chrome
18:21:28FromGitter<AjBreidenbach> the GPU process task went up to 35%
18:22:18dom96Interesting
18:22:54*cspar_ quit (Ping timeout: 268 seconds)
18:24:03*cspar joined #nim
18:26:21dom96Perhaps I am doing something wrong
18:26:30dom96I did try to follow the modern best practices for JS games though
18:26:40FromGitter<AjBreidenbach> could be a chrome bug
18:30:55FromGitter<AjBreidenbach> I tried it without hardware acceleration and I think it was a little better
18:32:39*cspar_ joined #nim
18:33:38*yglukhov joined #nim
18:33:51FromGitter<AjBreidenbach> any idea why this would cause the compiler to crash? ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5aaeb10ef3f6d24c688bb560]
18:34:04FromGitter<AjBreidenbach> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aaeb11c5f188ccc15cd25e3]
18:34:41FromGitter<AjBreidenbach> I'm need to compile with `--noMain` and I want to add an init hook
18:34:57*cspar quit (Ping timeout: 240 seconds)
18:35:14*cspar joined #nim
18:35:49FromGitter<AjBreidenbach> I get `Error: internal error: expr: param not init exports_124450`
18:37:27*cspar_ quit (Ping timeout: 240 seconds)
18:38:57PMunchHmm, I'm playing around a bit more with gcsafe and with a more trivial example it only throws a warning. Does Jester push some options that turns this into an error?
18:40:46*yglukhov quit (Remote host closed the connection)
18:41:14FromGitter<AjBreidenbach> you get a warning for that?
18:41:45FromGitter<AjBreidenbach> it doesn't do anything if the hook doesn't call `register` on `exports`
18:44:11AraqAjBreidenbach: rename one of your 'exports' parameters
18:45:59FromGitter<AjBreidenbach> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aaeb3e7a60157d62fffcd42]
18:46:18FromGitter<AjBreidenbach> like this?
18:47:36Araqyes
18:48:06FromGitter<AjBreidenbach> it still doesn't like it
18:49:29FromGitter<AjBreidenbach> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aaeb4b9f3f6d24c688bc8ac]
18:49:38FromGitter<AjBreidenbach> I think this is where it's happening
18:51:02Araqmake your template .dirty
18:52:44FromGitter<AjBreidenbach> that didn't work
18:54:33Araqwhat imports are required?
18:57:36Araqwell give me something I theoretically should be able to compile please
18:58:00Araqand probably you want to return exportsObj, not exports
18:58:21FromGitter<AjBreidenbach> exports is a pointer that I need to return
18:58:39FromGitter<AjBreidenbach> the file should compile standalone, I'll try to link it
18:58:55AraqError: undeclared identifier: 'JsObject'
18:59:30FromGitter<AjBreidenbach> test.nim (https://files.gitter.im/nim-lang/Nim/uL3K/test.nim)
18:59:47FromGitter<AjBreidenbach> I defined it
19:01:23FromGitter<AjBreidenbach> I need to compile it with `--noMain` if that makes a difference
19:05:24FromGitter<Araq> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aaeb87427c509a7747892eb]
19:05:30FromGitter<Araq> workaround
19:05:42FromGitter<AjBreidenbach> works for me! thanks
19:06:47Araqbut please create an issue for this
19:06:56Araqit's a new bug :-)
19:07:07FromGitter<AjBreidenbach> Idk even know what to label it
19:07:38Araq"Codegen does not like shadowed parameter"
19:08:31FromGitter<AjBreidenbach> got it ;)
19:08:51PMunchHmm, can you detect if threads are on or off?
19:10:06Araqwhen compileOption("threads") I think
19:11:06PMunchThanks :)
19:13:40PMunchdom96, would something like this be an option for Jester http://ix.io/Z9N/Nim
19:14:24dom96That hacks around the language, so no
19:14:41dom96If you want to disable these checks just compile with --threadAnalysis:off
19:16:26*nsf joined #nim
19:19:03GitDisc<AnimalSpirits> Can someone help me with my helloworld compiler error?
19:19:47PMunchdom96, well the reason why they are marked as gcsafe is to be used with threads. Without threads it doesn't really make sense. It's just making up for strange behaviour..
19:20:10*noonien joined #nim
19:23:53FromGitter<zetashift> @AnimalSpirits post the code1
19:23:55miranAnimalSpirits: show us the code :)
19:23:57*r3d9u11 quit (Remote host closed the connection)
19:25:03GitDisc<AnimalSpirits> https://pastebin.com/cxrmV2rw
19:25:37*yglukhov joined #nim
19:25:47GitDisc<AnimalSpirits> I know for a fact the file is actually there in Projects and is named "greetings.nim"
19:26:17miranhave you just installed nim?
19:26:50*SenasOzys quit (Remote host closed the connection)
19:26:55GitDisc<AnimalSpirits> Yes
19:27:14mirantry restarting your machine and try it again :)
19:27:34Araqrun finish.exe from the zip
19:27:46miranwindows need restarting to refresh what is it in the PATH
19:30:08Araqthat's not true
19:30:33Araqyou might need to restart the terminal/shell/cmd.exe though
19:30:33miranhappened to me several times
19:30:56Araqthen stop using Windows 95 :P
19:31:18Araqit's not true, it's an entry in the registry
19:31:29Araqyou don't need to restart windows when the registry changed
19:32:08miranlet's just wait and see if that will solve AnimalSpirit's problem ;)
19:36:36GitDisc<AnimalSpirits> What do you mean run finish.exe from zip? I tried restarting and nothing changed sadly.
19:37:06GitDisc<AnimalSpirits> Reinstall Nim but unzipped?
19:37:42*hyp3rbor3a joined #nim
19:37:44GitDisc<AnimalSpirits> Or reinstall Nim but still zipped?
19:38:44*hyp3rbor3a quit (Client Quit)
19:38:58*dddddd joined #nim
19:40:45Araqhttps://nim-lang.org/install_windows.html
19:41:40GitDisc<AnimalSpirits> Is there something there I need to read
19:41:50GitDisc<AnimalSpirits> I downloaded the x64 one from here
19:42:51*yglukhov quit (Remote host closed the connection)
19:50:25FromGitter<zetashift> Yeah it can't find your C compiler, you could also download the mingw x64 from that link and it's bin directory to the path
19:50:45FromGitter<zetashift> Also as windows user I can tell you no windows restart required, but a cmd restart could be needed
19:52:05FromGitter<zetashift> @AnimalSpirits, choosenim automates this for you(except you need to add one directory to the path manually) https://github.com/dom96/choosenim/releases
19:53:16Araqunzip the x64 from there into your HOME_DIR and run finish.exe
19:53:44GitDisc<AnimalSpirits> I don't know why clicking finish worked... I feel like I did that multiple times before coming on here and it never worked but it just did now... Thanks I guess
19:53:51GitDisc<AnimalSpirits> What's choosenim?
19:55:07Araqthe alternative installer
19:56:33GitDisc<AnimalSpirits> Does it do anything special
19:59:34Araqit lets you pick the Nim version but it doesn't work well on Windows yet IMO
20:02:46*arecaceae quit (Remote host closed the connection)
20:03:08*arecaceae joined #nim
20:11:23FromGitter<mratsim> The loopfusion package is out: https://github.com/numforge/loopfusion (without loopfusion but it will be syntactic sugar over the `forEach` macro)
20:21:53PMunchHuh, didn't know Ormin could create it's own server
20:23:18PMunchOooh, cool stuff mratsim
20:24:54PMunchBut what is the loopfusion macro going to do?
20:26:36FromGitter<mratsim> `loopfusion: a + b * c` a,b,c being sequences (i.e. you don’t need to fiddle with the indices)
20:27:03FromGitter<mratsim> `loopfusion: echo a + b * c` sorry
20:27:14PMunchAah, that's pretty neat
20:32:15Araqmratsim: sounds really cool. but wouldn't 'lift' be a more appropriate name?
20:32:33Araqor maybe 'loopover'
20:32:53Araqthe 'fusion' is more an implementation detail, no?
20:33:19Araqloopfusion would 'fuse' the loops but they are not any
20:33:34Araqthe macro creates the loops
20:33:50FromGitter<mratsim> It’s similar to this https://julialang.org/blog/2017/01/moredots
20:34:23FromGitter<mratsim> loopover, no. lift mmh, for me you lift a proc to apply to a container
20:34:42FromGitter<mratsim> but it seems like the opposite is going here.
20:34:46FromGitter<zetashift> Offtopic but Julia seems really nice and maybe even a contender for Nim
20:37:17FromGitter<mratsim> Actually I have an issue, it seems like when you use `containers: array[N, typed]` all the typed must be the same
20:38:30*zama quit (Read error: Connection reset by peer)
20:41:14Araqonly 'varargs' is special for 'typed', yes
20:42:02*SenasOzys joined #nim
20:44:12*thor77_ is now known as thor77
20:46:45*zama joined #nim
20:49:18*MJCaley quit (Quit: MJCaley)
20:57:03*Trustable quit (Remote host closed the connection)
20:58:55*rokups quit (Quit: Connection closed for inactivity)
21:06:47*athenot joined #nim
21:14:56*athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:15:44*smt joined #nim
21:17:11shashlickI'm pretty happy with choosenim on Windows 10, what issues have you seen araq
21:25:17Araqshashlick, they are all issues on github
21:28:39dom96Main problem is that choosenim only support 32bit
21:28:41dom96*supports
21:29:06dom96There is a "Araq's wishlist" milestone that contains all the issues that Araq wants fixed on GitHub :)
21:31:26PMunchHmm, doesn't Ormin work properly with Jester?
21:32:22PMunchA query that works outside of a route works fine, but not one within a route
21:36:10PMunchOh wait
21:36:25PMunchIt was just me doing something wrong :P
21:37:51dom96PMunch: What were you doing wrong? We might learn from your mistakes :)
21:38:01*Vladar quit (Quit: Leaving)
21:38:16PMunchI was just trying to access the id from Jester by doing @id and not @"id"
21:38:22PMunchSilly mistake
21:38:59PMunchIt would be nice if Jester could check those at compile-time by the way
21:39:28dom96well... what if `id` is a string variable? :)
21:40:00*riidom joined #nim
21:40:13*riidom quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
21:40:36*riidom joined #nim
21:41:55PMunchWhat do you mean?
21:42:38dom96var x = "id"; @x is valid
21:43:27PMunchOooh
21:43:33PMunchThat's, interesting..
21:52:05*miran quit (Quit: Konversation terminated!)
21:56:29*SitiSchu joined #nim
21:57:35PMunchUhm, really strange thing
21:57:54PMunchI tried to wrap both an integer conversion and the query in a try catch block
21:58:25PMunchIf I have a single except it works fine, but if I have two I get an error saying: Error: type mismatch: got <bool> but expected 'FutureBase = ref FutureBase:ObjectType'
21:58:31PMunchThis is within a Jester route
21:59:35PMunchOutside the route it works fine
21:59:44dom96probably the async try transformation is failing
22:00:39PMunchShould I create a GitHub issue for it?
22:01:43dom96sure
22:02:00PMunchHmm, wrapping the whole thing in a template outside the route works fine
22:02:13dom96you can do 'if fut.failed:' and check 'fut.error' as a workaround
22:02:42PMunchEh, this is example code. I want it to be as little hacky as possible
22:03:35PMunchGitHub issue for Jester or Nim?
22:07:48*nsf quit (Quit: WeeChat 2.0.1)
22:09:35dom96Nim
22:09:47dom96That's not hacky, it's the recommended way
22:10:26dom96I will likely change the 'async' macro to tell you to do this if it cannot transform your try statement
22:10:53dom96please show your code in your issue btw
22:15:45PMunchYeah I'll add it
22:39:38*SenasOzys quit (Remote host closed the connection)
22:40:04PMunchHmm
22:40:10PMunchThis is even stranger
22:40:17PMunchI can't seem to trigger it without ormin
22:40:56*SenasOzys joined #nim
22:41:40*SenasOzys quit (Remote host closed the connection)
22:42:06*SenasOzys joined #nim
22:44:34PMunchUpdated the issue with a code snippet
22:56:35*arthurz joined #nim
22:58:47*leorize quit (Ping timeout: 265 seconds)
23:06:46*PMunch quit (Quit: leaving)
23:14:23*jaco60 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:31:13FromGitter<mratsim> @PMunch: loopfusion added: https://github.com/numforge/loopfusion
23:43:27FromGitter<data-man> @mratsim: macro loopfusion -> loopFusion?
23:49:11FromGitter<mratsim> You can iterate over a variadic number of containers at the same time and so do elementwise operation without temporary allocation
23:52:51FromGitter<data-man> I about renaming :)
23:58:17FromGitter<mratsim> oh, yeah why not, in anycase with Nim special casing you can choose the one you want