00:01:22 | Xe | what is nim's equivalent to a union? |
00:02:21 | Xe | ah, union pragma |
00:03:30 | fowl | Use variant obj when you can |
00:05:02 | Xe | ahhh |
00:05:04 | Xe | I see |
00:05:27 | fowl | You can with c apis where the enum key is an int amd the structure isnt packed |
00:06:29 | fowl | Well 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:35 | dtscode | How 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:23 | reactormonk | Araq, 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:11 | fowl | dtscode there is no binary set for it, its a library |
02:49:28 | dtscode | oh 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:37 | r-ku | Araq: can nim gc get confused by my coroutines that use setjmp/longjmp? each coroutine also uses its own stack. |
09:02:04 | Araq | yes, the GC hates you for this and will crash eventually |
09:05:34 | r-ku | Araq: 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:16 | Araq | I can tell you how to update the GC to support it |
09:07:10 | r-ku | worth a try i guess |
09:07:51 | Araq | which 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:40 | r-ku | tbh im not aware of differences and i dont think its imporant in my case anyway. i just use default one |
09:11:37 | Araq | well M&S GC is simpler but where is the fun in that? |
09:12:35 | r-ku | also take into account if ill actually be able to understand/handle task lol |
09:13:41 | Araq | how do you allocate these new stacks? |
09:13:54 | Araq | can you ensure they are all in the same address range? |
09:14:30 | Araq | how many coroutines do you use? |
09:15:01 | r-ku | malloc + char sp_shift[(size_t)&stack - (size_t)stack - stacksize]; trick to set rsp to the end of allocated memory |
09:15:14 | r-ku | and atm its just two |
09:15:36 | r-ku | i dont plan on hundreds but at least 20-30 would be useful |
09:16:05 | Araq | we might as well do it properly and plan on thousands :P |
09:16:34 | r-ku | i see no problem in that ;) |
09:17:49 | Araq | ok let's start simple: |
09:18:08 | Araq | open gc_ms.nim |
09:19:17 | r-ku | is that default gc? cause stack trace i got points to gc.nim |
09:19:33 | Araq | no, I said "let's start simple" |
09:20:09 | Araq | line 509 |
09:20:21 | Araq | that one needs to learn about your stacks |
09:21:40 | Araq | and 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:04 | OnO | Araq: I've rebased and fixed `verbosity-map` PR also made it use back `const` |
09:24:49 | Araq | OnO: 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:11 | r-ku | i feel like a janitor fixing car engine :| |
09:26:50 | * | jubalh joined #nim |
09:27:29 | OnO | I think current behavior is far more convoluted, when some diagnostics are hardcoded, then having --hintName:on to have absolutely no effect |
09:27:45 | OnO | Araq: moreover this PR does not change current defaults at all |
09:27:58 | Araq | r-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:19 | OnO | next I want consider to droping verbosity (as you have suggested), but we need to settle which hints are default |
09:28:27 | Araq | you need to nest this loop in a "for every stack" loop |
09:28:54 | Araq | OnO: the behaviour is more convoluted but the code is simpler :P |
09:29:18 | Araq | in fact, I'm not so sure it doesn't change behaviour |
09:29:44 | OnO | Araq: you mean mine or current? :) it does change behavior since now --hintName:on|off is not related to verbosity |
09:29:52 | r-ku | ah 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:08 | OnO | current code is more convoluted because it checks both verbosity and if hint is enabled in many places |
09:30:19 | Araq | r-ku: exactly |
09:31:00 | r-ku | Araq: i also cant quite tell, var sp points to the end of stack memory (beginning)? |
09:31:15 | * | gokr joined #nim |
09:32:05 | r-ku | hmm or maybe not |
09:35:33 | Araq | r-ku: 'sp' is the run variable, often called 'i' |
09:36:54 | Araq | look at the version in 'elif stackIncreases' |
09:37:06 | * | jaco60 joined #nim |
09:37:18 | Araq | that's the easier version of the code, but on x86 the stack decreases |
09:41:35 | r-ku | its 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:08 | Araq | var stackTop {.volatile.}: pointer |
09:44:10 | Araq | stackTop = addr(stackTop) |
09:44:24 | Araq | that's how you get the current top of the stack |
09:44:43 | Araq | you need to do this in your 'yield' implementation when still on the old stack |
09:46:49 | r-ku | now 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:58 | Araq | you need to scan the registers only for the active task |
09:49:42 | Araq | the 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:01 | Araq | *these will be |
09:55:42 | Araq | r-ku: conceptually you have an array of tuple (stackStart, stackEnd, currentStackPos) where stackEnd is not really used for scanning |
09:56:42 | Araq | the GC can get the currentStackPos of the currently running coroutine but not of the yielded coroutine |
09:58:04 | Araq | also the GC needs to know which coroutine is running |
09:58:56 | Araq | and that's because the GC needs to do: |
09:59:19 | * | vasher_ joined #nim |
09:59:28 | Araq | stacks[currentCoroutine].currentStackPos = stackTop |
10:00:28 | Araq | you 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:30 | r-ku | i 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:08 | Araq | no no no. argh. :-) |
10:03:25 | r-ku | also how do i even make app use gc_ms? --gc option does not like "ms" param |
10:03:36 | Araq | --gc:markAndSweep |
10:04:05 | r-ku | and that was not contained in error message, thanks |
10:04:42 | Araq | ok, you MUST NOT GC in the yield! |
10:04:53 | Araq | you only need to update the stack pointer so later the GCs knows about it |
10:04:57 | r-ku | okay, understood |
10:05:10 | r-ku | btw gc_ms does not crash ;) |
10:05:19 | r-ku | my code just works |
10:06:21 | Araq | no, it doesn't. |
10:06:22 | Araq | it will crash eventually |
10:06:22 | r-ku | can you suggest stress test? |
10:06:24 | Araq | keep a single ref to something in a coroutine |
10:06:42 | Araq | flip between coroutines |
10:07:02 | Araq | access 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:26 | Araq | because the GC doesn't know about your stacks |
10:11:36 | r-ku | Araq: https://paste2box.com/5Ae-VQ/TNHQyRVA4ZQ#/4kyaJuEoYUoFm-pCgInVjPVj9EBQwaJaXdI1_l2MLK4/nfQyra0I.py should crash? |
10:12:07 | r-ku | (it does not) |
10:12:52 | Araq | you only need a loop around coro_start(a); ... |
10:14:08 | Araq | and 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:43 | r-ku | i think i dont know how gc works :D |
10:15:11 | r-ku | what it means is fixing something that does not misbehave for someone like me is hard. i want to make it misbehave |
10:16:05 | Araq | aye, a very good point, sorry |
10:20:51 | r-ku | Araq: 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:25 | Araq | r-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:54 | Araq | and yeah you need to expose an API for adding and removing stack bounds |
10:24:34 | r-ku | yes that i already understood |
10:25:18 | * | Trustable joined #nim |
10:25:27 | Araq | actually 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:34 | Araq | but that's more complex so let's do it later |
10:29:38 | r-ku | not 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:25 | Araq | which coroutine lib did you wrap? |
10:35:30 | r-ku | http://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:48 | Araq | r-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:48 | r-ku | but then all coroutine stacks have to not exceed application stack |
10:42:30 | Araq | static struct coro { |
10:42:32 | Araq | struct coro *next; |
10:42:33 | Araq | jmp_buf state; |
10:42:35 | Araq | } first, *running = &first, *idle; |
10:42:51 | Araq | C's declaration syntax is so nice ... |
10:42:59 | Araq | had to read it 3 times |
10:45:21 | r-ku | you 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:34 | r-ku | Araq: that looks about right? https://paste2box.com/BMGfIQ#/VEvK8N1aPtP0ACd8JjmdiK3Vm-HP25VFS7IBBzhCIHs/FGczSPFu.diff |
13:29:57 | r-ku | i figured out how to make testcase that crashes without this patch and works with the patch |
13:30:08 | r-ku | it still lacks handling of dead coroutines though |
13:30:16 | r-ku | just wanted to make sure im on the right track |
13:30:58 | r-ku | in 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:24 | coffeepot | to 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:51 | coffeepot | i mean, I don't really understand the ins and outs of it, but that doesn't make any sense to me |
15:17:29 | coffeepot | I mean, I could write a blog and say "a += 1 # Licensed under GPL" and then what? |
15:18:40 | coffeepot | sorry in particular LGPL 3 |
15:20:51 | coffeepot | this 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:09 | r-ku | coffeepot: 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:12 | coffeepot | I've just been reading about it and it seems like the LGPL is more permissive anyway |
15:52:20 | coffeepot | "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:58 | coffeepot | it's worth noting though, that translating code from one language to another still carries the license with it |
15:56:16 | Arrrr | It is like a curse |
15:56:40 | coffeepot | Arrrr it kind of feels like that, I know it's been referred to as a "viral" licence |
15:57:19 | Arrrr | What 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:50 | coffeepot | doesn'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:13 | coffeepot | Arrrr just some code on breaking down datetimes with leap years etc, really tiny code |
15:59:58 | Arrrr | You could port javajoda to nim http://www.joda.org/joda-time/ |
16:00:05 | coffeepot | I 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:13 | coffeepot | yes I've been looking at that |
16:00:30 | coffeepot | but that's a lot of work considering I never expected to be doing time related stuff |
16:01:13 | Arrrr | yes |
16:01:15 | * | M-max quit (Client Quit) |
16:01:20 | coffeepot | I am basically writing a times.nim extension module for now. Perhaps I'll make it a PR later |
16:01:58 | coffeepot | there'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:24 | coffeepot | ie; allow Time <-> TimeInfo |
16:03:22 | coffeepot | anyway 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:29 | federico3 | coffeepot: the idea of virality is usually misunderstood. |
16:03:53 | coffeepot | federico3 yeah tbh I thought that'd be the case, but it's really hard to get plain english on it |
16:04:13 | coffeepot | RMS seems really anti proprietary code |
16:04:30 | federico3 | regarding 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:55 | federico3 | of what constitutes a copyrightable work is necessarily fuzzy. |
16:05:06 | * | brson joined #nim |
16:05:43 | coffeepot | yeah I can imagine, like the example I mentioned earlier "a += 1 # under GPL" |
16:06:03 | coffeepot | i am not a lawyer unfortunately |
16:06:18 | federico3 | If 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:47 | coffeepot | and yet converting languages, says RMS, still carries the copyright under 'modified works' :/ |
16:07:09 | coffeepot | I mean, can you really copyright this? |
16:07:10 | coffeepot | proc isLeapYear*(year: int): bool = |
16:07:10 | coffeepot | (year mod 4 == 0) and ((year mod 100 != 0) or (year mod 400 == 0)) |
16:07:16 | federico3 | (it's not a specific problem around GPL, you have the same problems with any form of copyright) |
16:08:30 | federico3 | that's absolutely ok :D |
16:09:37 | coffeepot | yeah 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:03 | federico3 | Every 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:14 | federico3 | so it's way more restrictive than any open source license. Yet, it is understood that learn from it and use that knowledge. |
16:14:20 | coffeepot | ok that's a good point |
16:14:32 | coffeepot | right catch you all later, hometime! |
16:14:46 | federico3 | understood 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:49 | Araq | r-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:39 | perturbation | what 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:50 | perturbation | https://github.com/nim-lang/Nim/issues/2785 (re: GC internals) looks promising |
19:51:56 | reactormonk | perturbation, I have no idea about compilers ^^ |
19:52:25 | reactormonk | perturbation, still... https://github.com/nim-lang/Nim/pulls?q=is%3Apr+author%3Areactormonk+is%3Aclosed mostly not in the compiler though |
19:52:41 | reactormonk | The "hard compiler work" is done by the gcc anyway |
19:53:06 | perturbation | reactormonk: 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:14 | perturbation | from scraps, and I am no Tony Stark ;) |
19:53:26 | reactormonk | perturbation, natural language processing here, with an interest in CS |
19:55:01 | Araq | perturbation: but the GC is not part of the compiler :P |
19:55:26 | reactormonk | oh, GC, right - I haven't messed with that. O.o |
19:55:57 | perturbation | then I need a compilers class... *and* a, uhm... GC class? Not actually sure what area of study that falls under... |
19:55:59 | reactormonk | perturbation, 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:11 | Araq | the answer to your question is of course: https://gist.github.com/Araq/7f1eaacb68a5c49f73bc |
19:57:25 | Araq | nah, just kidding. you need to have a PhD in CS for that one |
19:57:30 | perturbation | I mean... my main objectives in contributing would be 1) To contribute and 2) To learn |
19:57:38 | Araq | or better 2 |
19:57:42 | perturbation | so 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:59 | Araq | let's see |
19:58:15 | perturbation | Araq: I'd have to be the hollywood version of the "programmer" character |
19:58:28 | perturbation | "Yes, I'm 17 with 2 Phds from Berkeley and MIT. I commuted" |
19:59:07 | reactormonk | Araq, can you convert a procvar to a closure? Just asking because you wanna dissable top level closure procs |
20:01:25 | reactormonk | perturbation, 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:27 | Araq | reactormonk: yeah that's a valid conversion |
20:03:11 | EXetoC | colored output. hi tech |
20:03:26 | perturbation | reactormonk: hmmmm - will do. Do you usually clone the repo and build a whole separate Nim installation, or just overwrite your existing? |
20:03:56 | reactormonk | perturbation, got a git devel clone already? |
20:04:15 | perturbation | reactormonk: yeah, but it's old. May need to clone and fast-forward |
20:04:23 | reactormonk | perturbation, nah, git git pull |
20:04:41 | reactormonk | perturbation, actually, if it's old, rm -rf |
20:04:51 | reactormonk | we did a history cleanup a while back |
20:05:18 | reactormonk | there's instructions on the readme.md how to clone and build nim |
20:05:23 | reactormonk | I'd also add bin/ to your PATH |
20:05:58 | perturbation | I 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:37 | perturbation | sorry, 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:41 | reactormonk | for 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:58 | reactormonk | then git fetch HaCk3Dq fix-2573 |
20:07:20 | Araq | perturbation: https://github.com/nim-lang/Nim/issues/2573 not a compiler bug but "easy" and important |
20:07:28 | reactormonk | then git merge FETCH_HEAD or git cherry-pick 5c7c5f82a4af189a (commit ID of https://github.com/HaCk3Dq/Nim/commit/5c7c5f82a4af189a703bc86c84d44c17f3715d93 ) |
20:07:32 | Araq | so please start with that |
20:07:46 | perturbation | thanks reactormonk, Araq - I'll take a look at #2573 |
20:07:54 | reactormonk | perturbation, that's the one I just tossed at you ;-) |
20:08:31 | Araq | https://github.com/nim-lang/Nim/issues/3052 |
20:08:42 | Araq | this one should be easy and is a compiler bug |
20:09:11 | reactormonk | perturbation, your choice - the one I tossed you is #2573 - #3052 is a compiler bug. |
20:09:44 | perturbation | hmmm - I'll look at 2573 first |
20:09:57 | perturbation | I have today off, so I may have time for both :) |
20:12:24 | OnO | perturbation: hi, great to see someone new, just curious... what OS you're using? |
20:13:21 | perturbation | I've been using Nim for a while (but outside the random library or stray project just haven't, uhm, contributed that much) |
20:13:29 | perturbation | My main OS these days is Mac OS X |
20:13:43 | perturbation | but I also have a desktop running a Debian variant |
20:13:52 | perturbation | and a chromebook which I somehow manage to use for the odd project as well |
20:13:55 | OnO | cool! you see Araq, we are growing stronger ;) |
20:15:50 | OnO | Araq: anyways, changing subject, what should I bother about semfold, ccgexprs & jsgen for mSameNodeType magic, if mEqNimrodNode is not covered there? |
20:16:08 | Araq | dunno just read the code |
20:16:30 | Araq | that mEqNimrodNODE IS missng too is no argument |
20:17:07 | Araq | why do computers still have a capslock key? who uses that? |
20:17:35 | reactormonk | Araq, just remap it to esc or ctrl |
20:18:16 | EXetoC | are there no conveniences for binary serialization? |
20:18:54 | * | Trustable quit (Remote host closed the connection) |
20:19:02 | * | vasher_ joined #nim |
20:21:55 | Araq | meh I'd rather map it to something useful. falling power symbol, for instance |
20:23:13 | OnO | Araq: 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:22 | EXetoC | I use esc a lot so it's very convenient |
20:23:55 | OnO | Araq: sometimes you are very mysterious with your suggestions, like an ancient oracle ;) |
20:28:03 | * | xcombelle quit (Remote host closed the connection) |
20:30:50 | Araq | OnO: else: internalError(a.info, "evalOp(" & $m & ')') # we like to avoid this |
20:32:23 | OnO | okay but arguments to mEqNimrodNode are NimNode's, which I believe cannot be contants |
20:32:30 | OnO | so we shouldn't see that |
20:32:45 | Araq | fair 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:16 | FedeOmoto | is this expected to work?: |
21:42:16 | FedeOmoto | proc b(t: int | string) |
21:42:19 | FedeOmoto | proc a(t: int) = b(t) |
21:42:19 | FedeOmoto | proc b(t: int | string) = echo "b()" |
21:42:19 | FedeOmoto | a(1) |
21:42:40 | FedeOmoto | I 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:32 | Araq | well |
21:46:47 | Araq | we know it doesnt work yet |
21:47:30 | * | renesac quit (Ping timeout: 252 seconds) |
21:47:39 | FedeOmoto | :P |
21:47:52 | FedeOmoto | but, the question is, should it? |
21:48:13 | Araq | yes |
21:48:33 | FedeOmoto | Araq: thx |
21:51:31 | federico3 | a proc with Table as a return type triggers "Error: cannot instantiate: 'Table'" when called |
21:53:19 | Araq | federico3: that on the other hand is not a bug |
21:54:30 | federico3 | I'm not saying it is :) |
21:54:49 | FedeOmoto | Araq: how is the "|" called in that context? (in asking you so I can file a bug) |
21:55:36 | dtscode | or |
21:55:49 | Araq | the bug report is just "forwarding does not work for generics", | produces an implicit generic |
21:56:03 | FedeOmoto | Araq: thx a lot! |
21:56:19 | Araq | its name is "or type constructor" |
21:56:26 | * | renesac joined #nim |
21:58:30 | * | thaless joined #nim |
22:00:02 | FedeOmoto | https://github.com/nim-lang/Nim/issues/3055 |
22:00:50 | * | perturbation joined #nim |
22:01:45 | FedeOmoto | it's been a log day... |
22:01:58 | FedeOmoto | going 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:45 | federico3 | is this autogenerated from packages.json http://nim-lang.org/docs/lib.html ? |
22:08:41 | Araq | federico3: partly yes |
22:11:09 | perturbation | Araq: I think I did the fix for #2573 incorrectly - is there a problem with the newException template that needs to be fixed? |
22:12:00 | perturbation | (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:31 | Araq | just 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:42 | perturbation | I could set the error message from gai_strerror() and set the code from osLastError() I guess |
22:18:38 | perturbation | I 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:53 | Araq | I 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:24 | Varriount|Mobile | Araq: Do we have an alloca equivalent in the standard library? |
22:58:40 | Araq | no. |
22:59:48 | Varriount|Mobile | Araq: 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:23 | Varriount|Mobile | Araq: For OS calls that require buffers of indeterminate size, do we favor using sequences, or arrays with a known upper bound? |
23:02:18 | Varriount|Mobile | Araq: 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:37 | Araq | no, just use newString or newWideCString |
23:03:08 | Varriount|Mobile | Ah, 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:34 | fowl | Is there an unsafeAddr() or something similar |
23:59:47 | Araq | no but we need it |