<< 03-07-2015 >>

00:01:22Xewhat is nim's equivalent to a union?
00:02:21Xeah, union pragma
00:03:30fowlUse variant obj when you can
00:05:02Xeahhh
00:05:04XeI see
00:05:27fowlYou can with c apis where the enum key is an int amd the structure isnt packed
00:06:29fowlWell that may actually work now with {.packed.}
00:21:22*vendethiel quit (Ping timeout: 256 seconds)
00:22:51*yglukhov_ joined #nim
00:26:47*vendethiel joined #nim
00:27:21*yglukhov_ quit (Ping timeout: 250 seconds)
00:42:20*OnO- quit (Ping timeout: 256 seconds)
00:42:27*OnO joined #nim
00:48:36*vendethiel quit (Ping timeout: 252 seconds)
00:56:50*^aurora^ quit (Quit: My Mac has gone to sleep. ZZZzzz…)
01:27:48*rainbowism joined #nim
01:28:09*pregressive quit (Remote host closed the connection)
01:37:23*jaco60 quit (Ping timeout: 246 seconds)
01:39:11*Guest34738 quit (Quit: Leaving)
01:41:25*Demos joined #nim
01:43:14*elbow_jason quit (Quit: Leaving)
01:44:45*askatasuna joined #nim
01:45:50*Demos quit (Ping timeout: 244 seconds)
02:04:09*bcinman joined #nim
02:07:11*gyeates quit (Ping timeout: 246 seconds)
02:08:12*ozra quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
02:17:30*vasher_ joined #nim
02:26:59*rgv151 quit (Remote host closed the connection)
02:28:35dtscodeHow come when I am in the root folder of nim-lang/irc and I run nimble build it does nothing?
02:28:37*vendethiel joined #nim
02:36:03*ggggggg quit (Quit: Page closed)
02:37:23reactormonkAraq, I like the nim secret >:)
02:38:02*FedeOmoto quit (Quit: Leaving)
02:42:54*Demos joined #nim
02:47:28*Demos quit (Ping timeout: 265 seconds)
02:49:11fowldtscode there is no binary set for it, its a library
02:49:28dtscodeoh duh
02:52:20*darkf joined #nim
03:19:29*vendethiel quit (Ping timeout: 252 seconds)
03:24:55*gyeates joined #nim
03:28:46*vendethiel joined #nim
03:50:02*vendethiel quit (Ping timeout: 246 seconds)
03:52:42*elbow joined #nim
03:56:09*vendethiel joined #nim
03:58:29*gyeates quit (Ping timeout: 246 seconds)
04:41:43*vendethiel quit (Ping timeout: 250 seconds)
04:48:16*askatasuna quit (Ping timeout: 276 seconds)
04:48:48*vasher_ quit (Quit: Connection closed for inactivity)
04:59:47*filcuc joined #nim
05:07:18*gyeates joined #nim
05:08:15*strcmp1 quit (Ping timeout: 256 seconds)
05:26:10*OnO quit (Ping timeout: 252 seconds)
05:26:52*OnO joined #nim
05:30:23*filcuc quit (Ping timeout: 252 seconds)
05:32:20*^aurora^ joined #nim
05:33:16*vendethiel joined #nim
05:35:11*gyeates quit (Ping timeout: 248 seconds)
05:47:38*dalarmmst joined #nim
05:50:38*gyeates joined #nim
05:56:25*dalarmmst quit (Ping timeout: 244 seconds)
06:13:50*gyeates quit (Ping timeout: 256 seconds)
07:10:38*onionhammer1 joined #nim
07:10:39*reactormonk_ joined #nim
07:11:06*n1ftyn8 quit (Ping timeout: 250 seconds)
07:11:06*gsingh93 quit (Ping timeout: 250 seconds)
07:11:06*onionhammer quit (Ping timeout: 250 seconds)
07:11:07*reactormonk quit (Ping timeout: 250 seconds)
07:11:10*n1ftyn8_ joined #nim
07:11:22*gsingh93 joined #nim
07:11:23*n1ftyn8_ quit (Changing host)
07:11:23*n1ftyn8_ joined #nim
07:11:44*yglukhov_ joined #nim
07:17:14*rainbowism quit ()
07:30:45*dalarmmst joined #nim
07:31:54*gsingh93_ joined #nim
07:33:30*gsingh93 quit (Ping timeout: 250 seconds)
07:33:31*gsingh93_ is now known as gsingh93
07:53:07*wan quit (Ping timeout: 264 seconds)
08:04:36*jubalh joined #nim
08:06:13*coffeepot joined #nim
08:06:19*Guest32960 is now known as wuehlmaus
08:06:29*^aurora^ quit (Quit: My Mac has gone to sleep. ZZZzzz…)
08:08:08*wan joined #nim
08:27:56*Angelion joined #nim
08:34:57*Angelion quit (Quit: AndroIRC - Android IRC Client ( http://www.androirc.com ))
08:44:03*jszymanski joined #nim
08:46:26*milosn quit (Quit: leaving)
09:01:37r-kuAraq: can nim gc get confused by my coroutines that use setjmp/longjmp? each coroutine also uses its own stack.
09:02:04Araqyes, the GC hates you for this and will crash eventually
09:05:34r-kuAraq: anything i could do to make gc happy? i really need those coroutines. was using iterators before to simulate coroutines but they have one very big shortcoming - cant yield from any call, just from main iterator body.
09:06:16AraqI can tell you how to update the GC to support it
09:07:10r-kuworth a try i guess
09:07:51Araqwhich GC do you want to use M&S or Refc?
09:08:29*jszymanski1 joined #nim
09:10:23*jszymanski quit (Ping timeout: 252 seconds)
09:10:40r-kutbh im not aware of differences and i dont think its imporant in my case anyway. i just use default one
09:11:37Araqwell M&S GC is simpler but where is the fun in that?
09:12:35r-kualso take into account if ill actually be able to understand/handle task lol
09:13:41Araqhow do you allocate these new stacks?
09:13:54Araqcan you ensure they are all in the same address range?
09:14:30Araqhow many coroutines do you use?
09:15:01r-kumalloc + char sp_shift[(size_t)&stack - (size_t)stack - stacksize]; trick to set rsp to the end of allocated memory
09:15:14r-kuand atm its just two
09:15:36r-kui dont plan on hundreds but at least 20-30 would be useful
09:16:05Araqwe might as well do it properly and plan on thousands :P
09:16:34r-kui see no problem in that ;)
09:17:49Araqok let's start simple:
09:18:08Araqopen gc_ms.nim
09:19:17r-kuis that default gc? cause stack trace i got points to gc.nim
09:19:33Araqno, I said "let's start simple"
09:20:09Araqline 509
09:20:21Araqthat one needs to learn about your stacks
09:21:40Araqand in your 'yield' implementation you need to tell the GC the actual stack pointer that you are about to swap so that the GC can the yielded stacks properly and not use the stack's upper bound
09:24:04OnOAraq: I've rebased and fixed `verbosity-map` PR also made it use back `const`
09:24:49AraqOnO: I like the features it brings but I think it's too convoluted. cannot point my finger to anything concrete though
09:25:13*jubalh quit (Quit: Leaving)
09:26:11r-kui feel like a janitor fixing car engine :|
09:26:50*jubalh joined #nim
09:27:29OnOI think current behavior is far more convoluted, when some diagnostics are hardcoded, then having --hintName:on to have absolutely no effect
09:27:45OnOAraq: moreover this PR does not change current defaults at all
09:27:58Araqr-ku: it's actually only a simple loop: treat the stack as an array of words, for every word do: gcMark(gch, word)
09:28:19OnOnext I want consider to droping verbosity (as you have suggested), but we need to settle which hints are default
09:28:27Araqyou need to nest this loop in a "for every stack" loop
09:28:54AraqOnO: the behaviour is more convoluted but the code is simpler :P
09:29:18Araqin fact, I'm not so sure it doesn't change behaviour
09:29:44OnOAraq: you mean mine or current? :) it does change behavior since now --hintName:on|off is not related to verbosity
09:29:52r-kuah alright, i suspected that but since i have only vague idea how GCs work i expect to sooner break things than fix lol ^_^ but yeah that makes sense. var sp = cast[ByteAddress](addr(registers)) ends up being current stack address?
09:30:08OnOcurrent code is more convoluted because it checks both verbosity and if hint is enabled in many places
09:30:19Araqr-ku: exactly
09:31:00r-kuAraq: i also cant quite tell, var sp points to the end of stack memory (beginning)?
09:31:15*gokr joined #nim
09:32:05r-kuhmm or maybe not
09:35:33Araqr-ku: 'sp' is the run variable, often called 'i'
09:36:54Araqlook at the version in 'elif stackIncreases'
09:37:06*jaco60 joined #nim
09:37:18Araqthat's the easier version of the code, but on x86 the stack decreases
09:41:35r-kuits address of registers, so some spot on the stack most likely in the middle, and then gcMark() works with it. confusing part is that sp points to the middle of current stack. i have no idea whats the right middle for other custom stacks
09:44:08Araq var stackTop {.volatile.}: pointer
09:44:10Araq stackTop = addr(stackTop)
09:44:24Araqthat's how you get the current top of the stack
09:44:43Araqyou need to do this in your 'yield' implementation when still on the old stack
09:46:49r-kunow to me it seems markStackAndRegisters() should work on old stack top when yielding, but this idea lost that loop of all coroutine stacks
09:48:58Araqyou need to scan the registers only for the active task
09:49:42Araqthe other yielded tasks don't use registers or even if they do, the will be scanned within the scanning of the active task
09:50:01Araq*these will be
09:55:42Araqr-ku: conceptually you have an array of tuple (stackStart, stackEnd, currentStackPos) where stackEnd is not really used for scanning
09:56:42Araqthe GC can get the currentStackPos of the currently running coroutine but not of the yielded coroutine
09:58:04Araqalso the GC needs to know which coroutine is running
09:58:56Araqand that's because the GC needs to do:
09:59:19*vasher_ joined #nim
09:59:28Araqstacks[currentCoroutine].currentStackPos = stackTop
10:00:28Araqyou cannot do that in the 'yield' because the yield only knows the stack pointer won't change for the suspended coroutine but the stack pointer for the running coroutine is constantly changing
10:01:59*jubalh quit (Quit: Leaving)
10:02:30r-kui lost you again. so in yield which stack gets GC'ed? stack of coro that is about to be suspended or stack of coro that is about to run? because at that point when its yielding world stops really, nothing changes on stacks until new coro does not run
10:03:08Araqno no no. argh. :-)
10:03:25r-kualso how do i even make app use gc_ms? --gc option does not like "ms" param
10:03:36Araq--gc:markAndSweep
10:04:05r-kuand that was not contained in error message, thanks
10:04:42Araqok, you MUST NOT GC in the yield!
10:04:53Araqyou only need to update the stack pointer so later the GCs knows about it
10:04:57r-kuokay, understood
10:05:10r-kubtw gc_ms does not crash ;)
10:05:19r-kumy code just works
10:06:21Araqno, it doesn't.
10:06:22Araqit will crash eventually
10:06:22r-kucan you suggest stress test?
10:06:24Araqkeep a single ref to something in a coroutine
10:06:42Araqflip between coroutines
10:07:02Araqaccess the ref -- kaboom, got collected even though it was still alive
10:07:31*JStoker quit (Ping timeout: 264 seconds)
10:08:01*reactormonk_ quit (Ping timeout: 256 seconds)
10:08:22*JStoker joined #nim
10:08:22*JStoker quit (Changing host)
10:08:22*JStoker joined #nim
10:08:27*reactormonk_ joined #nim
10:09:26Araqbecause the GC doesn't know about your stacks
10:11:36r-kuAraq: https://paste2box.com/5Ae-VQ/TNHQyRVA4ZQ#/4kyaJuEoYUoFm-pCgInVjPVj9EBQwaJaXdI1_l2MLK4/nfQyra0I.py should crash?
10:12:07r-ku(it does not)
10:12:52Araqyou only need a loop around coro_start(a); ...
10:14:08Araqand even if it doesn't crash for this example, what does that prove? do you think I don't know how the GC works?
10:14:43r-kui think i dont know how gc works :D
10:15:11r-kuwhat it means is fixing something that does not misbehave for someone like me is hard. i want to make it misbehave
10:16:05Araqaye, a very good point, sorry
10:20:51r-kuAraq: how should i store coroutine info in GcHeap? i see it has no imports so not sure, maybe non even allowed. besides im not sure which container is best suited for thousands of entries
10:21:55*bjz joined #nim
10:23:25Araqr-ku: just use an array[1000, ...] for now
10:23:37*eldamar quit (Ping timeout: 250 seconds)
10:23:44*eldamar joined #nim
10:23:54Araqand yeah you need to expose an API for adding and removing stack bounds
10:24:34r-kuyes that i already understood
10:25:18*Trustable joined #nim
10:25:27Araqactually you can do it much better when you let the GC return the stack space in the first place instead of malloc'ing it
10:27:34Araqbut that's more complex so let's do it later
10:29:38r-kunot sure what that even means. i didnt write that coroutines lib either, picked it up on internets. initially it had all coroutine stacks on main application stack but it is rather limiting. thats why i changed it to malloc
10:30:46*jszymanski1 quit (Quit: computer sleeps...)
10:34:25Araqwhich coroutine lib did you wrap?
10:35:30r-kuhttp://dotat.at/cgi/git?p=picoro.git;a=tree
10:38:16*ozra joined #nim
10:40:19*pwzoii_ quit (Ping timeout: 256 seconds)
10:40:48*ozra quit (Changing host)
10:40:48*ozra joined #nim
10:40:48Araqr-ku: well if it's kept on the main application stack it might work without GC changes ... but hrm
10:40:48*pwzoii joined #nim
10:40:48r-kubut then all coroutine stacks have to not exceed application stack
10:42:30Araqstatic struct coro {
10:42:32Araq struct coro *next;
10:42:33Araq jmp_buf state;
10:42:35Araq } first, *running = &first, *idle;
10:42:51AraqC's declaration syntax is so nice ...
10:42:59Araqhad to read it 3 times
10:45:21r-kuyou are too used to nim :p
11:05:56*xcombelle joined #nim
11:28:21*boopsiesisaway is now known as boopsies
11:37:15*jaco60 quit (Quit: Leaving)
11:38:35*jaco joined #nim
11:38:58*jaco is now known as Guest62640
11:39:14*Guest62640 is now known as jaco60
11:58:00*beatmox_ joined #nim
11:59:32*renesac quit (*.net *.split)
11:59:32*beatmox quit (*.net *.split)
12:01:40*renesac joined #nim
12:32:18*apense_ quit (Ping timeout: 265 seconds)
12:51:06*jszymanski joined #nim
13:00:16*strcmp1 joined #nim
13:08:27*raza joined #nim
13:11:46*jszymanski1 joined #nim
13:14:14*jszymanski quit (Ping timeout: 246 seconds)
13:18:37*NhanH quit ()
13:18:47*NhanH joined #nim
13:29:34r-kuAraq: that looks about right? https://paste2box.com/BMGfIQ#/VEvK8N1aPtP0ACd8JjmdiK3Vm-HP25VFS7IBBzhCIHs/FGczSPFu.diff
13:29:57r-kui figured out how to make testcase that crashes without this patch and works with the patch
13:30:08r-kuit still lacks handling of dead coroutines though
13:30:16r-kujust wanted to make sure im on the right track
13:30:58r-kuin yield() i do char volatile sp; GC_setCurrentStack(&sp); and after stack malloc() i do GC_addStack(stack, stack + stacksize);
13:32:20*xcombelle quit (Remote host closed the connection)
13:35:44*milosn joined #nim
13:45:33*FedeOmoto joined #nim
14:17:27*askatasuna joined #nim
14:25:30*xcombelle joined #nim
14:26:44*^aurora^ joined #nim
14:34:59*Arrrr joined #nim
14:35:13*gyeates joined #nim
14:42:34*perturbation joined #nim
14:43:39*perturbation quit (Remote host closed the connection)
14:43:55*perturbation joined #nim
14:48:00*jszymanski1 quit (Quit: computer sleeps...)
14:48:49*vasher_ quit (Quit: Connection closed for inactivity)
14:51:56*pmbauer quit ()
14:52:05*pmbauer joined #nim
14:56:27*darkf quit (Quit: Leaving)
14:57:36*perturbation quit (Remote host closed the connection)
15:03:19*vendethiel quit (Ping timeout: 264 seconds)
15:09:48*vendethiel joined #nim
15:11:15*perturbation joined #nim
15:16:24coffeepotto someone used to GPL... if I go on a website and adapt some simple code to my needs, and the website states the code is GPL, doesn't that mean that anything that touches this adapted code is now GPL?
15:16:51coffeepoti mean, I don't really understand the ins and outs of it, but that doesn't make any sense to me
15:17:29coffeepotI mean, I could write a blog and say "a += 1 # Licensed under GPL" and then what?
15:18:40coffeepotsorry in particular LGPL 3
15:20:51coffeepotthis isn't as offtopic as it sounds btw, looking at some code for calculating times/leap years etc. Super simple code yet LGPL seems to make it unusable for libraries? I probably misunderstand the implications of LGPL, surely.
15:28:41*yglukhov_ quit (Ping timeout: 246 seconds)
15:30:25*rgv151 joined #nim
15:31:11*perturbation quit (Remote host closed the connection)
15:31:31*vendethiel quit (Ping timeout: 264 seconds)
15:34:02*vendethiel joined #nim
15:34:08*vasher_ joined #nim
15:35:54*n1ftyn8_ quit ()
15:36:09*n1ftyn8_ joined #nim
15:43:01*perturbation joined #nim
15:43:11*dalarmmst quit (Ping timeout: 248 seconds)
15:46:33*perturbation quit (Remote host closed the connection)
15:49:09r-kucoffeepot: depends really.. if you take some bits and result is totally different from what you copied then just ignore GPL
15:50:40*endou___________ quit ()
15:50:54*endou___________ joined #nim
15:51:12coffeepotI've just been reading about it and it seems like the LGPL is more permissive anyway
15:52:20coffeepot"using the Lesser GPL permits use of the library in proprietary programs; using the ordinary GPL for a library makes it available only for free programs."
15:53:58coffeepotit's worth noting though, that translating code from one language to another still carries the license with it
15:56:16ArrrrIt is like a curse
15:56:40coffeepotArrrr it kind of feels like that, I know it's been referred to as a "viral" licence
15:57:19ArrrrWhat do you want to translate to nim?
15:57:48*MatrixBridge quit (Remote host closed the connection)
15:58:39*MatrixBridge joined #nim
15:58:50coffeepotdoesn't help that RMS declares in the licence FAQ that "releasing non-free software is ethically tainted". I'm all for free software (I mean, Nim is free!) but sometimes you gotta make ends meet, ya know?
15:59:03*M-max joined #nim
15:59:13coffeepotArrrr just some code on breaking down datetimes with leap years etc, really tiny code
15:59:58ArrrrYou could port javajoda to nim http://www.joda.org/joda-time/
16:00:05coffeepotI wouldn't want to put this in a library, for example, and then everyone who wanted to use it having to distribute the source
16:00:13coffeepotyes I've been looking at that
16:00:30coffeepotbut that's a lot of work considering I never expected to be doing time related stuff
16:01:13Arrrryes
16:01:15*M-max quit (Client Quit)
16:01:20coffeepotI am basically writing a times.nim extension module for now. Perhaps I'll make it a PR later
16:01:58coffeepotthere's no way to convert Time (an int of seconds since epoc) to it's broken down representation so I'm doing that.
16:02:24coffeepotie; allow Time <-> TimeInfo
16:03:22coffeepotanyway it looks like LGPL is fine for libraries and doesn't carry over, so it should be ok to nick this tiny wee bit of code
16:03:29federico3coffeepot: the idea of virality is usually misunderstood.
16:03:53coffeepotfederico3 yeah tbh I thought that'd be the case, but it's really hard to get plain english on it
16:04:13coffeepotRMS seems really anti proprietary code
16:04:30federico3regarding how much code you have to take - the stuff called "license" is just an application of copyright law, and the definition
16:04:41*Matthias247 joined #nim
16:04:55federico3of what constitutes a copyrightable work is necessarily fuzzy.
16:05:06*brson joined #nim
16:05:43coffeepotyeah I can imagine, like the example I mentioned earlier "a += 1 # under GPL"
16:06:03coffeepoti am not a lawyer unfortunately
16:06:18federico3If you are using some code as an example and 1) not copying it verbatim 2) not extracting a new algorithm from it most likely you are ok
16:06:47coffeepotand yet converting languages, says RMS, still carries the copyright under 'modified works' :/
16:07:09coffeepotI mean, can you really copyright this?
16:07:10coffeepotproc isLeapYear*(year: int): bool =
16:07:10coffeepot (year mod 4 == 0) and ((year mod 100 != 0) or (year mod 400 == 0))
16:07:16federico3(it's not a specific problem around GPL, you have the same problems with any form of copyright)
16:08:30federico3that's absolutely ok :D
16:09:37coffeepotyeah surely it's just basic math. And yet "This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)"
16:10:24*MatrixBridge quit (Remote host closed the connection)
16:12:03federico3Every time you read code examples and documentation on a random blog that has no mention of licensing, everything you see is under exclusive copyright of the author
16:12:58*MatrixBridge joined #nim
16:13:14federico3so it's way more restrictive than any open source license. Yet, it is understood that learn from it and use that knowledge.
16:14:20coffeepotok that's a good point
16:14:32coffeepotright catch you all later, hometime!
16:14:46federico3understood that [is ok to] learn
16:15:47*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
16:16:51*^aurora^ quit (Quit: Textual IRC Client: www.textualapp.com)
16:25:09*rainbowism joined #nim
16:29:26*yglukhov_ joined #nim
16:39:20*tmku quit (Ping timeout: 246 seconds)
16:39:44*MatrixBridge quit (Remote host closed the connection)
16:40:31*MatrixBridge joined #nim
16:41:04*M-max joined #nim
16:41:42*vendethiel quit (Ping timeout: 265 seconds)
16:43:41*tmku joined #nim
16:47:11*perturbation joined #nim
16:51:51*perturbation quit (Ping timeout: 265 seconds)
16:53:02*vendethiel joined #nim
16:57:55*Arrrr quit (Quit: WeeChat 1.2)
16:58:01*CARAM__ quit ()
16:58:15*CARAM__ joined #nim
17:06:41*reactormonk_ is now known as reactormonk
17:09:08*yglukhov_ quit (Quit: Be back later ...)
17:12:38*Jesin quit (Quit: Leaving)
17:27:47*Matthias247 quit (Read error: Connection reset by peer)
17:37:46*dalarmmst joined #nim
17:40:47*brson quit (Quit: leaving)
17:54:14*M-max quit (Quit: Client limit exceeded: 240)
18:03:55*MatrixBridge quit (Ping timeout: 264 seconds)
18:06:58*gyeates quit (Remote host closed the connection)
18:10:33*MatrixBridge joined #nim
18:15:51*jszymanski joined #nim
18:19:22*perturbation joined #nim
18:22:04*bjz_ joined #nim
18:23:42*bjz quit (Ping timeout: 256 seconds)
18:23:49Araqr-ku: you're on the right track but I see no loop over all the registered stacks in the mark phase
18:31:12*yglukhov_ joined #nim
18:47:04*jszymanski1 joined #nim
18:48:53*rgv151 quit (Ping timeout: 250 seconds)
18:49:22*jszymanski quit (Ping timeout: 276 seconds)
18:49:58*flaviu joined #nim
18:58:43*EXetoC joined #nim
19:10:46*dtscode is now known as dtscode|hulk
19:13:11*dtscode|hulk is now known as dtscode
19:33:09*tegovich joined #nim
19:33:14*tegovich left #nim ("Leaving")
19:38:49*vasher_ quit (Quit: Connection closed for inactivity)
19:42:29*jszymanski1 is now known as jszymanski
19:51:39perturbationwhat would be a good issue to learn more about Nim internals? I think I may need to take a compilers class before I can really contribute...
19:51:50perturbationhttps://github.com/nim-lang/Nim/issues/2785 (re: GC internals) looks promising
19:51:56reactormonkperturbation, I have no idea about compilers ^^
19:52:25reactormonkperturbation, still... https://github.com/nim-lang/Nim/pulls?q=is%3Apr+author%3Areactormonk+is%3Aclosed mostly not in the compiler though
19:52:41reactormonkThe "hard compiler work" is done by the gcc anyway
19:53:06perturbationreactormonk: but I bet you come from a CS background? I have a nat. sciences background and any lexing/parsing/data structures and algorithms knowledge is hard-won
19:53:14perturbationfrom scraps, and I am no Tony Stark ;)
19:53:26reactormonkperturbation, natural language processing here, with an interest in CS
19:55:01Araqperturbation: but the GC is not part of the compiler :P
19:55:26reactormonkoh, GC, right - I haven't messed with that. O.o
19:55:57perturbationthen I need a compilers class... *and* a, uhm... GC class? Not actually sure what area of study that falls under...
19:55:59reactormonkperturbation, but that stuff isn't too hard, it's just refactoring - find common code. No need to understand it fully.
19:56:11*filcuc joined #nim
19:56:11Araqthe answer to your question is of course: https://gist.github.com/Araq/7f1eaacb68a5c49f73bc
19:57:25Araqnah, just kidding. you need to have a PhD in CS for that one
19:57:30perturbationI mean... my main objectives in contributing would be 1) To contribute and 2) To learn
19:57:38Araqor better 2
19:57:42perturbationso if I'm not getting of comfort zone then I'm not really doing anything
19:57:52*raza quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
19:57:59Araqlet's see
19:58:15perturbationAraq: I'd have to be the hollywood version of the "programmer" character
19:58:28perturbation"Yes, I'm 17 with 2 Phds from Berkeley and MIT. I commuted"
19:59:07reactormonkAraq, can you convert a procvar to a closure? Just asking because you wanna dissable top level closure procs
20:01:25reactormonkperturbation, or you could take https://github.com/nim-lang/Nim/issues/2573 - grab the commit from https://github.com/HaCk3Dq/Nim/commit/5c7c5f82a4af189a703bc86c84d44c17f3715d93 and see if everything works
20:02:27Araqreactormonk: yeah that's a valid conversion
20:03:11EXetoCcolored output. hi tech
20:03:26perturbationreactormonk: hmmmm - will do. Do you usually clone the repo and build a whole separate Nim installation, or just overwrite your existing?
20:03:56reactormonkperturbation, got a git devel clone already?
20:04:15perturbationreactormonk: yeah, but it's old. May need to clone and fast-forward
20:04:23reactormonkperturbation, nah, git git pull
20:04:41reactormonkperturbation, actually, if it's old, rm -rf
20:04:51reactormonkwe did a history cleanup a while back
20:05:18reactormonkthere's instructions on the readme.md how to clone and build nim
20:05:23reactormonkI'd also add bin/ to your PATH
20:05:58perturbationI have a working installation already; the times in past I've tried to hack on the compiler I usually end up borking it though ;)
20:06:37perturbationsorry, misread your question - my clone is current, but I have a fork of the compiler which is old (but should be ff-able)
20:06:41reactormonkfor grabbing his commit, I check https://github.com/HaCk3Dq/Nim/branches first. Apparently it's https://github.com/HaCk3Dq/Nim/tree/fix-2573 so you go git remote add HaCk3Dq [email protected]:HaCk3Dq/Nim.git
20:06:58reactormonkthen git fetch HaCk3Dq fix-2573
20:07:20Araqperturbation: https://github.com/nim-lang/Nim/issues/2573 not a compiler bug but "easy" and important
20:07:28reactormonkthen git merge FETCH_HEAD or git cherry-pick 5c7c5f82a4af189a (commit ID of https://github.com/HaCk3Dq/Nim/commit/5c7c5f82a4af189a703bc86c84d44c17f3715d93 )
20:07:32Araqso please start with that
20:07:46perturbationthanks reactormonk, Araq - I'll take a look at #2573
20:07:54reactormonkperturbation, that's the one I just tossed at you ;-)
20:08:31Araqhttps://github.com/nim-lang/Nim/issues/3052
20:08:42Araqthis one should be easy and is a compiler bug
20:09:11reactormonkperturbation, your choice - the one I tossed you is #2573 - #3052 is a compiler bug.
20:09:44perturbationhmmm - I'll look at 2573 first
20:09:57perturbationI have today off, so I may have time for both :)
20:12:24OnOperturbation: hi, great to see someone new, just curious... what OS you're using?
20:13:21perturbationI've been using Nim for a while (but outside the random library or stray project just haven't, uhm, contributed that much)
20:13:29perturbationMy main OS these days is Mac OS X
20:13:43perturbationbut I also have a desktop running a Debian variant
20:13:52perturbationand a chromebook which I somehow manage to use for the odd project as well
20:13:55OnOcool! you see Araq, we are growing stronger ;)
20:15:50OnOAraq: anyways, changing subject, what should I bother about semfold, ccgexprs & jsgen for mSameNodeType magic, if mEqNimrodNode is not covered there?
20:16:08Araqdunno just read the code
20:16:30Araqthat mEqNimrodNODE IS missng too is no argument
20:17:07Araqwhy do computers still have a capslock key? who uses that?
20:17:35reactormonkAraq, just remap it to esc or ctrl
20:18:16EXetoCare there no conveniences for binary serialization?
20:18:54*Trustable quit (Remote host closed the connection)
20:19:02*vasher_ joined #nim
20:21:55Araqmeh I'd rather map it to something useful. falling power symbol, for instance
20:23:13OnOAraq: hmmm... NimNode comparsion in constant folding, as long mNGetType neither mNBindSym is not constant folded, I don't really see the application there
20:23:22EXetoCI use esc a lot so it's very convenient
20:23:55OnOAraq: sometimes you are very mysterious with your suggestions, like an ancient oracle ;)
20:28:03*xcombelle quit (Remote host closed the connection)
20:30:50AraqOnO: else: internalError(a.info, "evalOp(" & $m & ')') # we like to avoid this
20:32:23OnOokay but arguments to mEqNimrodNode are NimNode's, which I believe cannot be contants
20:32:30OnOso we shouldn't see that
20:32:45Araqfair enough I hope
20:35:53*filcuc quit (Remote host closed the connection)
20:36:55*filcuc joined #nim
20:55:57*jszymanski quit (Quit: computer sleeps...)
21:00:53*askatasuna quit (Quit: WeeChat 1.2)
21:10:27*johnsoft quit (Ping timeout: 256 seconds)
21:16:01*filcuc quit (Quit: Konversation terminated!)
21:22:41*filcuc joined #nim
21:30:16*perturbation quit ()
21:35:42*yglukhov_ quit (Quit: Be back later ...)
21:38:32*filcuc quit (Quit: Konversation terminated!)
21:42:16FedeOmotois this expected to work?:
21:42:16FedeOmotoproc b(t: int | string)
21:42:19FedeOmotoproc a(t: int) = b(t)
21:42:19FedeOmotoproc b(t: int | string) = echo "b()"
21:42:19FedeOmotoa(1)
21:42:40FedeOmotoI get this error: "Error: implementation of 'b.b(t: int)' expected"
21:43:37*cornus_ammonis joined #nim
21:44:49*dalarmmst quit (Ping timeout: 250 seconds)
21:46:32Araqwell
21:46:47Araqwe know it doesnt work yet
21:47:30*renesac quit (Ping timeout: 252 seconds)
21:47:39FedeOmoto:P
21:47:52FedeOmotobut, the question is, should it?
21:48:13Araqyes
21:48:33FedeOmotoAraq: thx
21:51:31federico3a proc with Table as a return type triggers "Error: cannot instantiate: 'Table'" when called
21:53:19Araqfederico3: that on the other hand is not a bug
21:54:30federico3I'm not saying it is :)
21:54:49FedeOmotoAraq: how is the "|" called in that context? (in asking you so I can file a bug)
21:55:36dtscodeor
21:55:49Araqthe bug report is just "forwarding does not work for generics", | produces an implicit generic
21:56:03FedeOmotoAraq: thx a lot!
21:56:19Araqits name is "or type constructor"
21:56:26*renesac joined #nim
21:58:30*thaless joined #nim
22:00:02FedeOmotohttps://github.com/nim-lang/Nim/issues/3055
22:00:50*perturbation joined #nim
22:01:45FedeOmotoit's been a log day...
22:01:58FedeOmotogoing home, have a nice weekend!
22:02:15*FedeOmoto quit (Quit: Leaving)
22:02:37*Varriount_ joined #nim
22:02:38*Varriount_ quit (Client Quit)
22:03:08*Varriount|Mobile joined #nim
22:03:49*Kingsquee joined #nim
22:07:45federico3 is this autogenerated from packages.json http://nim-lang.org/docs/lib.html ?
22:08:41Araqfederico3: partly yes
22:11:09perturbationAraq: I think I did the fix for #2573 incorrectly - is there a problem with the newException template that needs to be fixed?
22:12:00perturbation(there's also the special case in sockets/rawsockets having some POSIX error code and getting the message from hstrerror or gai_strerror, that can't AFAICT be retrieved downstream)
22:12:31Araqjust ensure that every OSError exception that is raised gets the error code set too.
22:14:52*Varriount|Mobile quit (Ping timeout: 246 seconds)
22:17:42perturbationI could set the error message from gai_strerror() and set the code from osLastError() I guess
22:18:38perturbationI just don't want there to be a collision between OS error codes and (say) EAI_OVERFLOW from gai_strerror's netdb.h
22:19:53AraqI just want to close this bug. any solution is fine
22:31:16*ozra quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
22:39:14*Varriount|Mobile joined #nim
22:43:32*vendethiel quit (Ping timeout: 264 seconds)
22:48:58*vendethiel joined #nim
22:56:24Varriount|MobileAraq: Do we have an alloca equivalent in the standard library?
22:58:40Araqno.
22:59:48Varriount|MobileAraq: So, it turns out my implementation of readlink fails for broken links. I looked at the Python version, to see what it does.
23:01:23Varriount|MobileAraq: For OS calls that require buffers of indeterminate size, do we favor using sequences, or arrays with a known upper bound?
23:02:18Varriount|MobileAraq: Essentially, I want to know if I should emulate the buffer allocation strategy used here: https://github.com/python/cpython/blob/829b49cbd2e4b1d573470da79ca844b730120f3d/Modules/posixmodule.c#L1100
23:02:37Araqno, just use newString or newWideCString
23:03:08Varriount|MobileAh, ok.
23:13:33*FedeOmoto joined #nim
23:15:46*Varriount|Mobile quit (Ping timeout: 246 seconds)
23:20:25*Matthias247 joined #nim
23:28:49*perturbation quit ()
23:30:02*MatrixBridge quit (Ping timeout: 252 seconds)
23:32:04*5EXABLYGN joined #nim
23:32:04*1JTAAGLFW joined #nim
23:41:48*Matthias247 quit (Read error: Connection reset by peer)
23:45:07*5EXABLYGN quit (Remote host closed the connection)
23:45:07*1JTAAGLFW quit (Remote host closed the connection)
23:45:30*MatrixBridge joined #nim
23:47:41*saml_ joined #nim
23:48:49*vasher_ quit (Quit: Connection closed for inactivity)
23:50:50*boopsies is now known as boopsiesisaway
23:56:34fowlIs there an unsafeAddr() or something similar
23:59:47Araqno but we need it