<< 29-12-2018 >>

00:03:36*banc joined #nim
00:05:24*stefanos82 quit (Remote host closed the connection)
00:07:12*craigger quit (Quit: bye)
00:12:55*craigger joined #nim
00:13:07*craigger quit (Remote host closed the connection)
00:21:19*craigger joined #nim
00:41:46*kinkinkijkin quit (Ping timeout: 246 seconds)
00:45:56*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
00:50:08*SenasOzys joined #nim
00:50:51*SenasOzys quit (Remote host closed the connection)
00:51:14*SenasOzys joined #nim
00:52:04*SenasOzys quit (Client Quit)
01:27:58*Cthalupa quit (Ping timeout: 245 seconds)
01:29:45*Cthalupa joined #nim
01:53:40*abm quit (Quit: Leaving)
01:55:28*SenasOzys joined #nim
01:55:36*SenasOzys quit (Client Quit)
01:56:48*SenasOzys joined #nim
01:57:12*SenasOzys quit (Client Quit)
01:59:41*SenasOzys joined #nim
02:00:00*SenasOzys quit (Remote host closed the connection)
02:04:58*SenasOzys joined #nim
02:05:17*SenasOzys quit (Remote host closed the connection)
02:12:11*kapil____ quit (Quit: Connection closed for inactivity)
02:29:29FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c26dc0993cce97d3bb2889a]
02:30:33FromGitter<gogolxdong> How do compare e.data with string value?I tried kstring, cstring, and with/without $.
02:34:19*endragor joined #nim
02:36:50leorizegogolxdong: what type was `e.data`?
02:38:34*endragor quit (Ping timeout: 250 seconds)
02:39:35FromGitter<gogolxdong> jwebsockets.nim of karax ⏎ ⏎ ```type ⏎ MessageEvent* {.importc.} = ref object ⏎ data*: cstring``` [https://gitter.im/nim-lang/Nim?at=5c26de6737975e7ca93d58bb]
02:42:42leorizethen I believe converting the cstring with `$` then compare with `string` should work
02:43:47leorizethere's also [this](http://nim-lang.github.io/Nim/cstrutils.html) module that allows comparing cstrings directly, but I don't think it's of much use in the js backend
02:47:42FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c26e04e92cf4d22420e064e]
02:50:00*endragor joined #nim
02:50:23FromGitter<gogolxdong> well, it's subtle, echo e.data is "1", but it's kind of JsonNode cstring, cannot compare directly with string or cstring, I guess should parse it to JsonNode then getStr and compare, it works.
02:54:41*endragor quit (Ping timeout: 268 seconds)
03:00:11*banc quit (Quit: Bye)
03:05:39*endragor joined #nim
03:09:47*endragor quit (Ping timeout: 240 seconds)
03:15:57*banc joined #nim
03:21:18*endragor joined #nim
03:23:30*Ven`` joined #nim
03:25:48*endragor quit (Ping timeout: 250 seconds)
03:30:29*zachk quit (Quit: Leaving)
03:33:26*kapil____ joined #nim
03:34:28*Ven`` quit (Ping timeout: 250 seconds)
03:36:57*endragor joined #nim
03:41:24*endragor quit (Ping timeout: 250 seconds)
03:46:54*dddddd quit (Remote host closed the connection)
03:50:55*Tyresc quit (Quit: WeeChat 2.4-dev)
03:52:32*endragor joined #nim
03:55:04*quipa joined #nim
03:56:43*endragor quit (Ping timeout: 245 seconds)
04:01:47*quipa quit (Read error: Connection reset by peer)
04:08:12*endragor joined #nim
04:12:36*endragor quit (Ping timeout: 250 seconds)
04:23:19*bevo009 quit (Quit: Page closed)
04:23:50*endragor joined #nim
04:27:58*endragor quit (Ping timeout: 245 seconds)
04:30:18*bevo quit (Quit: Leaving)
04:39:29*endragor joined #nim
04:43:48*endragor quit (Ping timeout: 250 seconds)
04:55:08*endragor joined #nim
05:00:06*endragor quit (Ping timeout: 272 seconds)
05:10:45*endragor joined #nim
05:15:00*endragor quit (Ping timeout: 250 seconds)
05:37:37*narimiran joined #nim
05:42:00*endragor joined #nim
05:46:32*darithorn quit (Quit: Leaving)
05:46:44*endragor quit (Ping timeout: 268 seconds)
05:55:01*nsf joined #nim
05:56:24*Vladar joined #nim
05:57:38*endragor joined #nim
06:01:51*endragor quit (Ping timeout: 250 seconds)
06:13:21*endragor joined #nim
06:18:11*endragor quit (Ping timeout: 268 seconds)
06:35:26*wildlander quit (Quit: Konversation terminated!)
06:44:17*kungtotte quit (Remote host closed the connection)
06:44:36*endragor joined #nim
06:46:14*vlad1777d joined #nim
06:48:47*endragor quit (Ping timeout: 246 seconds)
07:09:10*endragor joined #nim
07:13:27*endragor quit (Ping timeout: 240 seconds)
07:19:15*endragor joined #nim
07:20:00*tefter joined #nim
07:23:27*endragor quit (Ping timeout: 240 seconds)
07:29:18*endragor joined #nim
07:33:35*endragor quit (Ping timeout: 246 seconds)
07:39:19*endragor joined #nim
07:43:41*endragor quit (Ping timeout: 250 seconds)
07:49:25*endragor joined #nim
07:52:16*Cthalupa quit (Ping timeout: 246 seconds)
07:52:57*Cthalupa joined #nim
07:53:17FromGitter<gogolxdong> How to compare the karax JsonNode with "undefined" ? There is a JObject in jsffi, can I cast JsonNode to JObject?
07:53:34FromGitter<gogolxdong> JsObject*
07:53:36*endragor quit (Ping timeout: 250 seconds)
07:54:23leorizegogolxdong: IIRC someone added "undefined" support for `isNil`
07:54:35leorizeso you could just `isNil` a JsObject?
07:58:59FromGitter<gogolxdong> I'm afraid not.
07:59:13FromGitter<gogolxdong> Uncaught TypeError: Cannot read property 'description' of undefined
07:59:29FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c27296009b8066849801c91]
08:01:51FromGitter<gogolxdong> tasks if of type JsonNode.
08:03:57FromGitter<gogolxdong> previous way is tasks[$id].toJson != "undefined"
08:07:34FromGitter<gogolxdong> oh, it doesn't work neither.
08:14:59FromGitter<alehander42> yes, I added isNil for undefined
08:15:02FromGitter<alehander42> but it's still not merged
08:15:08FromGitter<alehander42> I am not sure why
08:15:24FromGitter<alehander42> there was an unrelated(I think) CI error, I'll force push again
08:23:54*d10n-work quit (Quit: Connection closed for inactivity)
08:35:38*hoijui joined #nim
08:46:43*hoijui quit (Ping timeout: 268 seconds)
08:51:16FromGitter<gogolxdong> What's the implementation? I mean I need to check undefined for testing now.
08:52:16FromGitter<alehander42> well you can just define your own isUndefined temporarily
08:52:19FromGitter<alehander42> using importcpp
08:52:42FromGitter<gogolxdong> ok
08:52:44FromGitter<alehander42> a very useful pattern for quick wrapping of functions
08:53:03FromGitter<gogolxdong> copy from jsffi :)
08:53:15FromGitter<alehander42> something like proc isUndefinedT (a: T): bool {.importcpp: "(# === undefined)".}
08:53:58FromGitter<alehander42> (means replace this with (<first arg> === undefined))
08:56:24FromGitter<gogolxdong> yeah, Andreas tought me about importcpp.
09:09:26*shpx joined #nim
09:21:23*shpx quit (Ping timeout: 246 seconds)
09:38:16*hoijui joined #nim
09:38:28*vlad1777d quit (Ping timeout: 250 seconds)
09:39:23Araqnarimiran, can you please backport the lastest commits that are marked as such?
09:39:42narimiranAraq: will do
09:40:33narimiranit was on my todo for this weekend, i'll just move it to the top of the queue
09:47:06*stefanos82 joined #nim
09:54:01narimiranAraq: done
10:14:08Araqyay
10:14:15Araqare the nightlies working again?
10:14:22Araq(except the Windows stuff)
10:25:41*Vladar quit (Remote host closed the connection)
10:27:19*narimiran quit (Ping timeout: 268 seconds)
10:32:25*kapil____ quit (Quit: Connection closed for inactivity)
10:40:45FromGitter<survivorm> Happy new year to everyone! ⏎ As that's my last minutes in office for this year, i'm wishing it to all nimmers now (not sure my lazy ass will be opening this channel from home on holidays :-) )
10:43:04Araqthanks
10:43:21Araqyou should though. Open source thrives on holidays too ;-)
10:50:21*xet7 joined #nim
10:51:27FromDiscord_<exelotl> hey does anyone know how to specify a palette using nimPNG?
10:53:00FromDiscord_<exelotl> I created a 4bpp image from raw pixel data using encodePNG, I'm looking at the available procedures and I can't see a way to set up the palette
11:34:29*dddddd joined #nim
12:07:23*nc-x joined #nim
12:07:33nc-xAraq: You there?
12:09:01Araqnc-x, here
12:11:01nc-xI was having a go at https://github.com/nim-lang/Nim/issues/9331. The reason for that issue is that for vars/lets/consts whole node is not stored in the ast. Why is that so? (For procs the whole node is stored https://github.com/nim-lang/Nim/blob/devel/compiler/semstmts.nim#L1613))
12:12:12Araqbecause I found it more natural to model it this way
12:13:00nc-xSo now the deprecated message is getting lost for vars/lets/consts
12:13:12nc-xSo what would be the best way to solve this
12:14:32*Snircle joined #nim
12:15:34Araqas you suggested, fixing the sym.ast
12:19:45nc-xI mean what ast should I produce? Should I change it to be like procs, where whole node is copied or something else?
12:20:35*hoijui quit (Ping timeout: 250 seconds)
12:22:37Araqsym.ast should contain the nkConstDef etc
12:22:44*dorelix joined #nim
12:27:38sendell[m]Are the "opt[T]" owning pointers already implemented in devel? Can we expect to have them in next release? :)
12:38:03*hoijui joined #nim
12:41:55sendell[m]I'm also wondering if we might build other kinds of smart_ptr using the new destructors, like shared+weak
12:42:53*Vladar joined #nim
12:52:24sendell[m](maybe spt[T], wpt[T]?)
12:54:46*hoijui quit (Ping timeout: 250 seconds)
13:05:32*kapil____ joined #nim
13:10:24FromGitter<arnetheduck> in `nim.cfg`, can I access the project path somehome? imagine I want to add an include directory relative to the `nim` file I'm compiling..
13:13:37*nc-x quit (Quit: Page closed)
13:21:47FromGitter<Clyybber> Araq: Statics or const's dont make much sense in the VM right?
13:25:41Araqno they do
13:25:54Araqbut I don't know if static T is a value or a type in the VM
13:26:19AraqI've complained about this before, remember ;-)
13:26:35FromGitter<Clyybber> Yeah :D
13:27:03Araqsendell[m]: yeah, they are made possible by this feature
13:27:39Araqand opt[T] doesn't have to be builtin anymore, I added it before I figured out how move semantics should be done
13:28:22Araqarnetheduck: iirc that's not possible due to phase ordering problems
13:28:43FromGitter<Clyybber> Araq: Wouldn't it be possible to treat static T in the VM just like (an immutable) T ?
13:30:07Araqwell after my rant I understand it much better now :P, proc foo[T: static int]() = echo T is expected to "work" (as terrible as it is) so you can treat it as a value in the VM. I think.
13:31:23FromGitter<Clyybber> Araq: Have you seen https://github.com/nim-lang/Nim/issues/10085#issuecomment-450489356 ?
13:32:21Araqyes
13:32:31AraqI don't have an opinion though.
13:32:41FromGitter<Clyybber> Understandable
13:33:45Araqarrays are of fixed size though, 'static: var i = 3, a: array[i, int]; inc i' is invalid
13:34:01FromGitter<Clyybber> But in the VM couldn't it be valid?
13:34:08FromGitter<Clyybber> assuming i is immutable
13:34:10FromGitter<Clyybber> so not var?
13:34:29FromGitter<Clyybber> 'static: let i = 3, a: array[i, int]; inc i'
13:34:59AraqI think what we have here is a "staged" notion of compile-time
13:35:16FromGitter<Clyybber> There are multiple layers of compile time there
13:35:22Araqexactly
13:35:29FromGitter<Clyybber> But compile time for a VM doesn't make sense does it?
13:35:46Araqit does, the VM can inline constants, for example
13:35:54FromGitter<Clyybber> Oh ok.
13:35:59Araqbut not vars, whether in a static block or not
13:36:13FromGitter<Clyybber> That makes sense
13:36:17Araqthe VM is much like a real machine in this sense
13:36:31Araqa different 'target' architecture
13:37:12Araqand we must be careful that it stays this way so we have more freedom in the VM implementation.
13:37:48Araqfor example, I'd love to tinker with producing C code fragments and running them, avoiding a VM altogether
13:38:06FromGitter<Clyybber> Yeah that would be awesome
13:38:10FromGitter<Clyybber> Conceptually
13:40:26FromGitter<Clyybber> We could leverage TCC for that, i suppose
13:42:22Araqyeah, for example
13:42:51*whaletechno quit (Quit: ha det bra)
13:47:04FromGitter<Clyybber> Cern's https://root.cern.ch/ uses a C interpreter too
13:49:30*narimiran joined #nim
13:51:14FromDiscord_<Semenikhin_> Sex Dating > http://discord.amazingsexdating.com
13:54:21*Ven`` joined #nim
13:59:14*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
14:07:29FromGitter<zacharycarter> looks like spammers are back?
14:23:23*natrys joined #nim
14:27:29FromGitter<zetashift> from the discord side this time :/
14:30:29FromGitter<zacharycarter> I imagine that's an easier problem to solve :P just disable the bridge
14:30:51*xet7 quit (Ping timeout: 240 seconds)
14:30:55FromGitter<zacharycarter> although it seems like maybe it's just a rogue spammer - and not a fleet of them like freenode was suffering from
14:31:37*Trustable joined #nim
14:41:49*nsf quit (Quit: WeeChat 2.3)
14:43:11sendell[m]Araq: cool, so does that mean that we will have a "smartpointers" lib inside stdlib? :) How far is all this from usable right now? :)
14:45:36AraqI don't know, not very far away, give it another month
14:45:58sendell[m]hehe nice to hear, can't wait to try it
14:47:34*xet7 joined #nim
14:50:08FromGitter<zacharycarter> I started over on the graphics pipeline for my game / engine and I like this approach much better than how I was organizing things before
14:51:03FromGitter<zacharycarter> pipelines will be a composable series of steps and then different constructs will be constructed from the pipeline steps - like different renderers
14:51:31FromGitter<zacharycarter> hopefully I'll have something to play with by the end of the weekend, and by play with, I mean I'll be able to draw something to the screen
15:13:57FromGitter<alehander42> :D
15:14:05FromGitter<alehander42> sounds interesting
15:14:12FromGitter<alehander42> is this still in the zeal engine
15:20:36*kungtotte joined #nim
15:21:20FromGitter<zacharycarter> mmhmm
15:23:27FromGitter<alehander42> btw if I want to make a game with simple 2d graphics (very minimal, not even shades and stuff, almost child-drawing-like ), what would be the best graphic level choice : OpenGL? Vulcan?(too low level?) Something else? (I even wonder about just using webgl libs + canvas)
15:23:54FromGitter<alehander42> I am very green in gamedev, but brainstorming for an eventual gamejam thing
15:26:58Araquse SDL2
15:34:58FromDiscord_<j$> yo is there a way to get the version from your nimble file?
15:36:45Vladaralehander42, I've completed a couple of one-week gamejams with this: https://vladar4.github.io/nimgame2/
15:47:51*wildlander joined #nim
15:53:17*tefter quit (Remote host closed the connection)
15:58:45FromGitter<zetashift> nimgame2 is indeed really nice and well documentated. SDL2 requires a bit more plumbing but PMunch also had some nice stuff for that
15:59:28FromGitter<zacharycarter> @alehander42 - SDL2 has a OpenGL based rendering API that is pretty high level
15:59:44FromGitter<zacharycarter> Nimgame2 is basically a library on top of SDL2
16:00:04FromGitter<zacharycarter> if your game is that simple - I'd probably use Nimgame2
16:00:27FromGitter<zacharycarter> everyone's goals with game dev differ though generally
16:01:36FromGitter<zacharycarter> the SDL2 rendering API does not handle large complex scenes well, with lots of draw calls per-frame
16:01:50FromGitter<zacharycarter> but it doesn't sound like you need to worry about ^
16:06:53FromGitter<alehander42> yeah, it can't batch stuff to send it all to the gpu?
16:14:53FromGitter<zetashift> you have sdl-gpu which can do that(it is included in Vladar's Nim bindings)
16:46:20narimiranVladar: nimgame2 looks quite nice! and big kudos to you for writing the tutorials/documentation!
16:51:40Araq„I Know i <= min(len(s), len(other)) + -4 and wonder about i <= len(s) + -1“
16:51:55*Araq is teaching the Nim compiler more basic algebra
16:52:02Vladarthanks, narimiran =)
16:52:14Araqseems to be true, right
16:54:36Araqif i is smaller than min(a, b)-4 then it is smaller than a-4 which is smaller than a-1
16:55:54narimiranright :)
16:56:20*MightyJoe joined #nim
16:57:47*cyraxjoe quit (Ping timeout: 240 seconds)
17:12:17FromGitter<alehander42> bounds checking?
17:12:35Araqyup
17:14:08*kapil____ quit (Quit: Connection closed for inactivity)
17:16:50FromGitter<alehander42> how is it goin
17:18:19FromDiscord_<j$> does anyone know a way to get clipboard content, seems sdl2 clipboard doesn't work
17:20:13FromDiscord_<j$> nvm
17:20:17*nsf joined #nim
17:21:13*kungtotte quit (Quit: leaving)
17:21:45*kungtotte joined #nim
17:21:45*kungtotte quit (Client Quit)
17:21:47FromDiscord_<j$> forgot to init sdl
17:24:00Araqalehander42: it can prove
17:24:02Araq for i in 0 ..< min(s.len, other.len) - 3:
17:24:02Araq echo s[i], other[i]
17:25:21Araqworks pretty well
17:26:30FromGitter<alehander42> nice, so which operations are magic? min/max/len/`+`/`-` ?
17:34:38*Tyresc joined #nim
17:45:36*awal quit (Quit: ZNC 1.6.4 - http://znc.in)
17:47:11FromDiscord_<exelotl> I think I ran into a bug: https://gist.github.com/geckojsc/579699a42db4ebc590bf09a53d086ff5
17:47:54FromDiscord_<exelotl> that is, type conversion, not casting
17:49:52Araqalehander42: * and div too, that's about it
17:50:51Araqbut I need to extend it to user-defined [] and len operations
17:51:40Araqexelotl: please report it properly
17:55:30FromDiscord_<exelotl> will do, just wanted to check here in case it's already known
18:00:16FromGitter<alehander42> Araq, nice, is it in a branch somewhere
18:00:48*kungtotte joined #nim
18:02:34Araqno, still fixing the regressions
18:05:22*Vladar quit (Remote host closed the connection)
18:06:38*Jesin quit (Quit: Leaving)
18:07:14*smitop joined #nim
18:10:14Araqpretty impressive
18:10:21Araqit knows that
18:10:23Araq if s.len > 0:
18:10:23Araq echo s[0]
18:10:28Araqworks but
18:10:36Araq if s.len > 0 or other.len > 0:
18:10:37Araq echo s[0]
18:10:40Araqdoesn't :-)
18:11:17FromGitter<alehander42> nice
18:11:44FromGitter<alehander42> does it know
18:11:50FromGitter<alehander42> if s.len == 0: ⏎ .. ⏎ else: ⏎ echo s[0] [https://gitter.im/nim-lang/Nim?at=5c27b8e60b7fc97caabae0d4]
18:11:51FromGitter<alehander42> is ok
18:12:13FromGitter<alehander42> this kind of stuff works in my ref nilcheck branch but not sure if i can generalize it easily
18:15:30*OrganicAnywhere joined #nim
18:15:33*vlad1777d joined #nim
18:15:54OrganicAnywhereIs it just me, or does running things through vsc take longer?
18:18:10Araqalehander42: doesn't work. Not hard in theory though
18:18:41Araq if s.len <= 0:
18:18:41Araq echo "zero"
18:18:41Araq else:
18:18:43Araq echo s[0]
18:18:47Araqdoes work though :-)
18:22:37FromGitter<alehander42> huh, strange, but it makes sense :D
18:23:07FromGitter<alehander42> btw can you take a look at the test cases in https://github.com/nim-lang/Nim/pull/10127/files#diff-824cf3fb6b2b0f6d5aec5dd4b416f2b0 later, they're kinda similar so you might be able to think of situations i am forgetting about
18:29:27Araqif a != nil and b != nil:
18:29:35Araq deref(a); deref(b)
18:29:41Araqneeds to be tested
18:30:02Araqand depending on your control flow analysis you need to support
18:30:09Araqif a == nil: return
18:30:11Araqderef(a)
18:30:38Araqanother obvious test:
18:30:41Araqwhile a != nil:
18:30:45Araq deref(a)
18:30:48Araq a = a.next
18:33:50Araqanother devious example is
18:34:00Araqvar x: ref int
18:34:00Araqtry:
18:34:00Araq couldRaise()
18:34:02Araq new(x)
18:34:04Araqfinally:
18:34:06Araq deref(x)
18:36:38FromGitter<arnetheduck> it's funny you mention that kind of analysis.. been thinking about it a it lately - for the ethereum spec we have a bunch of values coming in over the network, and there's a big state object updated every time - now, the interesting part is that the spec is expressed in unbounded signed bigint arithmetic, while the serialization is mostly `uint64`.. basically that means that incoming values are bounded to `uint64` -
18:36:38FromGitter... then along the way, the state transition code enforces certain other limits on the values etc - one thing generally done through formal analysis would be to collect those limiting expressions so you can make claims about the safe value ranges etc - any thoughts on how to approach this?
18:39:08AraqI remember that LLVM analyses the signed/unsigned variants at the same time
18:39:36Araqit tracks the bit patterns and then in the end the signed or unsigned representation is choosen
18:40:05*thumbs_scum joined #nim
18:41:23*OrganicAnywhere quit (Quit: Get schwifty)
18:41:24Araqer s/representation/interpretation
18:42:46FromGitter<arnetheduck> I'm more thinking about analysis like this: `if a * 3 > b * 2` - that means a must be `<high(uint64)` for the expression to be meaningful, placing a practical upper bound on what `a` can be without running into overflows
18:43:01Araqbut in general unsigned wraparound arithmetic is so terrible that I pretend it doesn't exist, i+1 > i does not hold
18:43:41FromGitter<Varriount> I wish saturated arithmetic was the norm
18:44:00Araqlikewise if you knnow that a > b then it is possible that a*3 < b*2
18:44:45FromGitter<arnetheduck> collecting all such expressions should yield function that I can apply during deserialization to check if the value is in bounds and safe for all the operations that follow
18:45:43Araqwhat I would probably do is to inject basic sanity checks like
18:45:58AraqabortIf(x + 1 < x)
18:46:30Araqand then proceed as if the arithmetic rules are not broken beyond repair
18:47:05FromGitter<arnetheduck> yeah, but I'd like to: ⏎ ⏎ 1) have a guarantee that the code will not abort ⏎ 2) avoid checking intermediate values as far as possible [https://gitter.im/nim-lang/Nim?at=5c27c1282863d8612baa74dd]
18:48:25FromGitter<arnetheduck> things like the `k` framework model expressions that way - fuzzers tend to look at them to stress border conditions etc - was just curious if you knew of any good research on the subject (else yeah, the engineering solution is to sprinkle tests everywhere)
18:49:43Araqno, I consider "freedom of overflows" proofs an unsolved problem
18:50:59FromGitter<arnetheduck> and yeah, what you say is sounds about right - `llvm` has analysis like that for optimization, to establish some local information about what value something holds, and yeah, bitfield rings a bell
18:59:48livcddoes anyone know if there are Nim bindings for Sciter ?
19:16:38Araqarnetheduck, another idea that probably doesn't work out: Ensure your inputs are below e.g. 0xFFFF_FFFF and then assume/ensure your loops don't run more than 0xFFFF* iterations and in the loop body only allow x + N for small N, likewise for other arithmetic operations
19:16:54Araqthis becomes overly restrictive very very quickly though
19:17:06*Jesin joined #nim
19:20:49Araqhttps://stackoverflow.com/questions/47227900/spark-integer-overflow-check
19:23:31*nsf quit (Quit: WeeChat 2.3)
19:27:56*Ven`` quit (Ping timeout: 246 seconds)
19:30:00*kapil____ joined #nim
19:51:52*Ven`` joined #nim
19:58:43FromGitter<alehander42> Araq: I think I support all of your examples
20:00:16*endragor joined #nim
20:00:19FromGitter<alehander42> the while thing, maybe only this has to be refined
20:00:24FromGitter<alehander42> I support it for if
20:00:32FromGitter<alehander42> but i have to apply the same logic for after while
20:01:02*SenasOzys joined #nim
20:01:08Araqmy index prover points out tons of questionable Nim code in system.nim
20:01:15Araq:-)
20:01:30*SenasOzys quit (Remote host closed the connection)
20:01:56*SenasOzys joined #nim
20:05:21FromGitter<Clyybber> Araq: Is the reason why ⏎ ⏎ ```if s.len == 0: ⏎ .. ⏎ else: ⏎ echo s[0]``` ⏎ ⏎ that the index prover isn't aware that len must be (0 or )positive? [https://gitter.im/nim-lang/Nim?at=5c27d38192cf4d224213ad37]
20:10:20*zachk joined #nim
20:11:38*zachk quit (Changing host)
20:11:38*zachk joined #nim
20:18:35FromGitter<alehander42> Araq, the thing I see about index is that e.g. for ref-s i can add type information so I can pass `not nilness` through calls because they have `not nil` types: one can't do the same for seq-s, as you can't say, this takes `seq[>=4, int]`
20:25:23Araqalehander42: {.requires: s.len >= 4.}
20:25:40Araqnot implemented, of course
20:26:19AraqClyybber: exactly.
20:29:08FromGitter<Clyybber> Araq: What procs does a VM implementation have to provide? I think I want to try using TCC or a C interpreter for the VM.
20:29:39Araqvmgen.nim covers the required magics
20:30:07FromGitter<Clyybber> Ok, thanks!
20:30:54Araqalso macros.getType() will make your efforts a PITA :P
20:32:22FromGitter<Clyybber> :O
20:33:44Araqwell don't suppport macros.getType() in the first version, rely on --incremental:on for a database of types that the generated program can query
20:43:45FromGitter<Clyybber> I like how https://github.com/nim-lang/Nim/blob/devel/compiler/readme.txt has not changed since 4 years :P
20:56:28shashlick@livcd: I can wrap it for you if it isn't already
20:56:53FromGitter<alehander42> Araq: `{.requires a.len op value.}` sounds interesting
20:56:53*smitop quit (Quit: Connection closed for inactivity)
20:57:10FromGitter<alehander42> btw, do you process e.g. `add` `delete`
20:57:16FromGitter<alehander42> e.g. a loop adding n elements means
20:57:20FromGitter<alehander42> n-1 is fine
20:57:23FromGitter<alehander42> n+1 maybe not
20:57:36shashlickBut looks like one exists already
20:57:37shashlickhttps://github.com/oskca/nsciter
21:11:28*nsf joined #nim
21:12:27*Ven`` quit (Read error: Connection reset by peer)
21:13:45*Ven`` joined #nim
21:22:38*narimiran quit (Ping timeout: 250 seconds)
21:28:18*Calinou quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
21:43:37*Calinou joined #nim
21:52:23*endragor quit (Remote host closed the connection)
21:57:44*MyMind joined #nim
21:57:59*Sembei quit (Ping timeout: 268 seconds)
22:06:32*SenasOzys quit (Quit: Leaving)
22:10:15*dorelix quit (Remote host closed the connection)
22:10:52Araqalehander42: the facts concerned with a.len must not be invalidated by a mutation to 'a'
22:11:16AraqNim's parameter passing semantics help here
22:12:03Araqbut aliasing analysis enters the picture here quickly
22:36:37*stefanos82 quit (Remote host closed the connection)
22:43:27*thomasross joined #nim
22:45:04*thomasross quit (Max SendQ exceeded)
22:45:42*thomasross joined #nim
22:47:31dom96Should nimsuggest really be hogging 100% of my CPU for dozens of minutes at a time?
22:48:00dom96I don't know if this is the VS code plugin's fault but it sure is annoying
22:49:21dom96I start typing... it launches nimsuggest
22:51:37dom96And then it somehow manages to highlight my file even after i've killed nimsuggest
22:58:40*Ven`` quit (Read error: Connection reset by peer)
22:59:25*Ven`` joined #nim
23:04:30*nsf quit (Quit: WeeChat 2.3)
23:04:54*xet7 quit (Quit: Leaving)
23:07:24Araqdom96: we should give nimlsp a try
23:23:43FromGitter<zurs> Hi everyone, quick question. I use threadpool and spawn to launch a lot of workers, but sometimes it just stops spawning new ones while waiting for the ones already spawned(which makes a lot of sense). But I have put sleep() in the worker functions but it doesn't seem to allow for more workers to spawn at the same time
23:25:42FromGitter<zurs> Should sleep() let other workers spawn and do their work or is it someting else I should be using to allow for a large amount of workers to be run at the same time. Btw the sleep() is in the loop which does the work
23:26:51*Trustable quit (Remote host closed the connection)
23:34:24Araquse setMin/MaxThreadPoolSize or whatever it's called
23:34:54Araqdon't use sleep() the threadpool uses CPU activity to determine whether new threads should be created and sleep doesn't increase CPU activity
23:37:40FromGitter<zurs> The setMinPoolSize() was exactly what I needed, thanks!
23:38:32FromGitter<zurs> Yeah, I removed the sleep and now it just flies
23:40:11*NimBot joined #nim
23:41:47*natrys quit (Quit: natrys)
23:43:18FromGitter<deansher> And here's a very different question: I am working on a macro package that will allow a user to declare a "field" in module A and then use it from module B. A field has an identifier, a fully qualified name, and a type. The fully qualified name is constructed from the module name and the identifier. (This is inspired by Clojure's namespaced maps.) I am trying to figure out what underlying Nim thing I can export from
23:43:18FromGitter... module A and reference in module B to represent the field. ⏎ ⏎ That thing's name should be the field's identifier, so that the import works as the programmer would expect. I was hoping it could be a const containing a tuple of the field's fully qualified name and the field's type. But I'll need to use the type in s ... [https://gitter.im/nim-lang/Nim?at=5c2806968dafa715c7121c95]
23:49:46FromGitter<timotheecour> hi @araq ; any other comments on https://github.com/nim-lang/Nim/pull/10071 ?
23:51:36FromGitter<timotheecour> i have a number of green PR’s with no un-addressed comments (or no comments at all) that I’d really like to get merged
23:54:08*kapil____ quit (Quit: Connection closed for inactivity)