00:00:05 | * | lf-araujo_ joined #nim |
00:01:32 | * | lf-araujo quit (Ping timeout: 272 seconds) |
00:01:33 | * | lf-araujo_ is now known as lf-araujo |
00:05:30 | * | krux02_ quit (Remote host closed the connection) |
00:23:28 | * | dddddd quit (Ping timeout: 268 seconds) |
00:27:28 | * | kuon quit (Remote host closed the connection) |
00:27:51 | * | kuon joined #nim |
00:32:13 | * | stefanos82 quit (Quit: Quitting for now...) |
00:36:52 | * | dddddd joined #nim |
00:42:44 | * | kuon__ joined #nim |
00:43:47 | * | kuon quit (Ping timeout: 245 seconds) |
00:49:15 | * | theelous3 quit (Ping timeout: 244 seconds) |
00:57:38 | * | lf-araujo quit (Quit: lf-araujo) |
00:57:46 | * | lf-araujo joined #nim |
01:05:12 | * | squattingmonk joined #nim |
01:17:11 | squattingmonk | Howdy, all. Is there a simple way to get the differences between two Times in seconds? |
01:43:37 | * | lf-araujo quit (Ping timeout: 250 seconds) |
02:00:37 | * | theelous3 joined #nim |
02:04:23 | FromGitter | <zetashift> subtract using https://nim-lang.org/docs/times.html#-%2CTime%2CDuration and then pass the resulting Duration to `inSeconds` https://nim-lang.org/docs/times.html#inSeconds%2CDuration ? |
02:05:28 | * | theelous3 quit (Ping timeout: 245 seconds) |
02:14:12 | * | dwdv quit (Ping timeout: 245 seconds) |
02:15:01 | * | vlad1777d quit (Ping timeout: 244 seconds) |
02:18:25 | * | jest joined #nim |
02:35:07 | * | actuallybatman joined #nim |
02:37:44 | * | actuallybatman is now known as MikeSS |
02:38:50 | * | MikeSS is now known as actuallybatman |
02:46:04 | * | laaron- joined #nim |
02:47:03 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
02:50:42 | squattingmonk | I wanted to do comething like that, but you can't use - with two Times, only a Time and a Duration. |
02:50:42 | * | chun joined #nim |
02:50:57 | squattingmonk | I unded up sing toUnix() on both, then subtracting. |
02:51:02 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
02:51:07 | squattingmonk | *ended up using |
02:53:32 | squattingmonk | Wait, yes you can. |
02:56:47 | FromGitter | <ratiotile> c2nim currently translates `const` to `var`. Would it be better to make it `let`? |
02:58:21 | squattingmonk | Thanks, zeta. I missed that. |
03:05:25 | * | chun_ joined #nim |
03:06:31 | * | chun__ joined #nim |
03:06:45 | * | chun__ quit (Client Quit) |
03:09:15 | * | chun quit (Remote host closed the connection) |
03:10:28 | * | chun_ quit (Ping timeout: 245 seconds) |
03:24:01 | * | lritter quit (Ping timeout: 246 seconds) |
03:25:03 | * | lritter joined #nim |
03:44:17 | * | fjellfras joined #nim |
03:45:38 | * | lritter quit (Ping timeout: 258 seconds) |
03:50:55 | * | nimNoob joined #nim |
04:14:05 | FromGitter | <zacharycarter> all of a sudden, on 0.2.0, I'm getting this error every time I start up my application- ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d26b78d0c8c4114d90c0657] |
04:14:08 | FromGitter | <zacharycarter> and I have no idea why |
04:17:42 | FromGitter | <zacharycarter> debugging provides me with nothing - because the program crashes before the entry point is reached |
04:18:52 | nimNoob | hola is there a channel specifically for beginners? |
04:19:54 | FromGitter | <zacharycarter> this one :) |
04:19:57 | FromGitter | <zacharycarter> fire away |
04:21:47 | nimNoob | I am new to programming and I bought Nim in Action. In " Chapter 7. Building a Twitter clone" nimble asks me what package type I should choose. Should I choose bin ? would it break if I chose anything else ? |
04:22:45 | FromGitter | <zacharycarter> bin = binary, like creating an executable that you can run, so like on windows - app.exe or on linux macos an (well they don't have extensions for apps do they?) |
04:23:10 | FromGitter | <zacharycarter> lib = a Nim library that you can then use in other Nim projects, or potentially a static / dynamically linked library if you want to go down that route |
04:23:43 | FromGitter | <zacharycarter> let me take a look at the twitter clone code and I can let you know what you should pick - I'm not sure how it's supposed to be built |
04:24:37 | FromGitter | <zacharycarter> you want to choose bin |
04:24:43 | nimNoob | ah ty |
04:24:46 | FromGitter | <zacharycarter> no problem |
04:24:58 | * | nimNoob quit (Remote host closed the connection) |
04:25:14 | * | fjellfras quit (Remote host closed the connection) |
04:25:34 | * | fjellfras joined #nim |
04:29:37 | * | squattingmonk quit (Quit: WeeChat 2.5) |
04:30:52 | * | nimNoob joined #nim |
04:35:37 | * | nimNoob quit (Remote host closed the connection) |
04:37:03 | * | nsf joined #nim |
04:37:19 | FromGitter | <zacharycarter> I was being stupid and closing a stream |
04:42:29 | FromGitter | <zacharycarter> okay - I seem to get that error when I read from the stream, assign a value to a sequence that is read from the stream, close the stream, and try to echo the sequence |
04:42:33 | FromGitter | <zacharycarter> why though... |
04:45:10 | * | nimNoob joined #nim |
04:45:40 | nimNoob | ty dom I got the answer from chat. your book is amazing! |
05:04:47 | FromGitter | <zacharycarter> Well the stream seems like a red herring. I have absolutely no idea what is causing this error. I'm starting to lean towards thinking it has something to do with my usage of options... |
05:07:34 | * | dddddd quit (Remote host closed the connection) |
05:09:51 | * | laaron- quit (Remote host closed the connection) |
05:10:16 | * | laaron joined #nim |
05:15:58 | * | narimiran joined #nim |
05:24:17 | Zevv | Araq: got some context about that npeg thing?? |
05:26:20 | * | nimNoob quit (Remote host closed the connection) |
05:31:25 | * | jest quit (Ping timeout: 246 seconds) |
05:39:37 | * | lf-araujo joined #nim |
05:43:38 | * | lf-araujo quit (Remote host closed the connection) |
05:51:20 | * | absolutejam joined #nim |
06:15:53 | * | solitudesf joined #nim |
06:27:12 | * | PMunch joined #nim |
06:39:33 | * | absolutejam quit (Ping timeout: 244 seconds) |
06:47:07 | * | eterps joined #nim |
06:53:30 | * | Vladar joined #nim |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:01:04 | * | krux02 joined #nim |
07:04:32 | * | gmpreussner joined #nim |
07:33:12 | PMunch | Hmm, trying to run parseSql on compile-time yields an intVal is not accessible error |
07:33:27 | PMunch | Or more specifically http://ix.io/1N8C |
07:35:10 | * | absolutejam joined #nim |
07:38:04 | PMunch | Tried with 0.19.6, which gave me a different error: ../../home/peter/.choosenim/toolchains/nim-0.19.6/lib/pure/lexbase.nim(156, 13) Error: VM is only allowed to 'cast' between integers of same size |
07:38:10 | * | stefanos82 joined #nim |
07:39:38 | PMunch | Hmm, is there a way to check if you are in the VM? |
07:45:11 | * | krux02 quit (Remote host closed the connection) |
07:45:23 | * | krux02 joined #nim |
07:47:08 | PMunch | Okay, I found `nimvm` |
07:47:15 | PMunch | But it's the most finnicky thing I've seen |
07:54:34 | Araq | lol |
07:56:17 | PMunch | Ended up doing this just to be able to use it: http://ix.io/1N8H/nim |
08:00:27 | PMunch | Uhm, this assertion fails http://ix.io/1N8J/nim |
08:01:13 | PMunch | http://ix.io/1N8K/Nim |
08:01:27 | PMunch | Trying to modify lexbase to also run on compile-time |
08:03:49 | Araq | huh, it was patched to work at compile-time, krux02 ? |
08:04:19 | PMunch | Hmm, then it might be something else that trips up |
08:04:37 | PMunch | I went back to 0.19.6 since I got the intVal is not accesible error |
08:05:05 | PMunch | Yeah, I can see that lexbase in 0.20.0 is patched |
08:05:24 | * | solitudesf quit (Ping timeout: 272 seconds) |
08:07:05 | krux02 | PMunch: I don't understand the problem |
08:07:15 | krux02 | what do you try to do with `nimvm`? |
08:07:49 | krux02 | nimvm is a Schrödinger's constant that is both true and false at the same time. |
08:08:15 | PMunch | I was just trying to patch lexbase |
08:08:20 | PMunch | But I see that is already done |
08:08:23 | PMunch | http://ix.io/1N8L/nim |
08:08:28 | PMunch | That is my actual issue |
08:08:45 | PMunch | When I try to compile it I get the error: http://ix.io/1N8C |
08:09:46 | krux02 | interesting: http://ix.io/1N8M |
08:10:19 | krux02 | Araq: I have a path from your computer in there on my computer ^ |
08:10:43 | Araq | you should be thankful for that |
08:10:46 | PMunch | Yeah, I think that's a known issue that has been fixed in devel already |
08:10:53 | Araq | ^ yup |
08:11:48 | PMunch | http://ix.io/1N8N |
08:11:53 | PMunch | Full error with a debug compiler |
08:13:58 | * | arecaceae quit (Remote host closed the connection) |
08:14:17 | * | arecaceae joined #nim |
08:20:11 | krux02 | I can reproduce the problem now |
08:20:25 | krux02 | I went in it with a debugger, but I don't understand it |
08:20:46 | krux02 | The important part of the stacktrace is missing/incorrect |
08:22:35 | Zevv | Araq: can you elaborate on your npeg const problem? I'd like to fix but I don't know what your problem is |
08:24:25 | PMunch | Yeah the line numbers in that stack trace doesn't make much sense.. |
08:25:40 | * | actuallybatman quit (Ping timeout: 272 seconds) |
08:26:31 | FromGitter | <zacharycarter> how can I trouble shoot an issue that happens before any of my code executes? This error seems to be thrown as soon as my executable starts - ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d26f2b7f867ec1687eaee93] |
08:33:26 | PMunch | Hmm, on devel I get another error krux02 |
08:33:36 | PMunch | Error: index 140609990366264 not in 0 .. 8191 |
08:33:58 | krux02 | I could reproduce that problem as well |
08:34:09 | PMunch | That seems related to the strange L.bufLen = bufLen; assert(L.bufLen == bufLen) error |
08:34:16 | PMunch | That assert fails.. |
08:35:04 | * | floppydh joined #nim |
08:35:24 | PMunch | Ah wait, but that isn't there in the refactor |
08:36:20 | PMunch | But L.bufpos = 0; assert(L.bufpos == 0) now fails.. |
08:36:51 | PMunch | If you insert the assert at line 139 of lexbase |
08:52:16 | * | eterps quit (Ping timeout: 252 seconds) |
08:54:03 | FromGitter | <kayabaNerve> Anyone here have a bit to help me debug a mystery? |
08:55:55 | Zevv | just ask |
08:56:36 | FromGitter | <kayabaNerve> Alrighty then |
08:57:19 | FromGitter | <kayabaNerve> I have two macros in place here. One is a custom case statement macro to handle sub-types and one is one for the errors systems. |
08:58:43 | FromGitter | <kayabaNerve> The error system macro (well, effect system, but that's not directly accessible...) creates a copy of the function, embeds it, and guarantees the function only raises what it explicitly raises. |
08:59:29 | FromGitter | <kayabaNerve> The case statement works with my object hierarchy which goes A -> B -> SB, yet A also goes to C which goes to CB, and so on. |
08:59:59 | FromGitter | <kayabaNerve> ```case a: ⏎ of B as b: ⏎ #B is usable.``` [https://gitter.im/nim-lang/Nim?at=5d26fa8f270d2b1bfa789405] |
09:01:05 | FromGitter | <kayabaNerve> The following function compiles with both macros. |
09:01:08 | FromGitter | <kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d26fad472d4092b1ac21702] |
09:01:44 | FromGitter | <kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d26faf70c8daa1686c46894] |
09:01:59 | FromGitter | <kayabaNerve> That second function, from the same file which has had pieces cut out for consistency, doesn't work. |
09:02:55 | FromGitter | <kayabaNerve> *SB, not CB |
09:03:07 | FromGitter | <kayabaNerve> My theory was because the case statement macro takes A, like the first function, yet the second function takes a typeclass of SA, SB, SC, SD... it failed. |
09:03:35 | FromGitter | <kayabaNerve> However editing the case statement macro to take a type class of Element or SignedElement, or casting the SignedElement to an Element, does not fix this code. |
09:03:52 | FromGitter | <kayabaNerve> The code does however compile with the discard statement I left in when I submitted this. |
09:04:32 | FromGitter | <kayabaNerve> ... yet the case statement above the discard was testing code which also doesn't work. Direct copy of the code from function 1. Ignore that please. |
09:05:04 | FromGitter | <kayabaNerve> So I believe it's a bug with Nim, but I don't know how to wrap it up, and more urgently, find a workaround. |
09:05:18 | FromGitter | <kayabaNerve> Zevv: I feel like this should've been done in PM :P |
09:05:40 | Zevv | well, usually just asking stuff gets people to respond, but in your case it might be a bit overwhelming |
09:05:43 | Zevv | :) |
09:06:07 | Zevv | The usual answer in this case would be: "can you isolate to a minimal example so I can reproduce" |
09:06:14 | Zevv | but I guess that's not trivial here? |
09:06:59 | FromGitter | <kayabaNerve> Thankfully, the workaround is easy. Just manually expand to if element of Verification: var verif: Verification = castVerification (element); ...` |
09:07:16 | FromGitter | <kayabaNerve> Let me say If I can isolate it to just the typedefs/macros/and macro uses |
09:07:19 | FromGitter | <kayabaNerve> 'just' |
09:16:39 | * | ng0 joined #nim |
09:25:50 | FromGitter | <kayabaNerve> Zevv: I think I did it |
09:25:53 | FromGitter | <kayabaNerve> Have a minute? |
09:30:09 | * | lf-araujo joined #nim |
09:30:38 | * | actuallybatman joined #nim |
09:31:43 | FromGitter | <kayabaNerve> The following was compiled on the latest devel with `im c --experimental:caseStmtMacros -r file.nim`: https://gist.github.com/kayabaNerve/169d7d5d5fa3f9d745f31632b0b68946. The first case compiles, yet the second does not. If you edit the match macro to use a typeclass of `A or S`, even though S should match for A, it still doesn't work. If you explicitly cast `s` to `A`, it still doesn't work. |
09:32:09 | FromGitter | <kayabaNerve> This looks to be a Nim bug where the only workaround is manual expansion of the macro :thinking: I'd like to know if I'm wrong though before I make an issue :P |
09:32:45 | * | fjellfras quit (Quit: Leaving) |
09:33:48 | Zevv | does the macro expand to what you think it does? |
09:37:01 | Zevv | your snippet does not compile for me: /tmp/t.nim(68, 10) Error: selector must be of an ordinal type, float or string |
09:37:24 | Zevv | nim 0.20.99, just pulled |
09:37:46 | FromGitter | <kayabaNerve> It's only run once. |
09:37:52 | FromGitter | <kayabaNerve> `-experimental:caseStmtMacros` |
09:37:57 | FromGitter | <kayabaNerve> *double dash |
09:38:50 | Zevv | ah right |
09:38:52 | FromGitter | <kayabaNerve> So it does expand properly the one time it's run. With a type class, or with the cast, or even with both, it's still only run once. |
09:40:51 | FromGitter | <kayabaNerve> It looks like B and SB work fine. Match just can't handle typeclasses. |
09:41:13 | FromGitter | <kayabaNerve> Even when there's a type class accepting that type class or the type class is casted to the baser type. |
09:41:27 | FromGitter | <kayabaNerve> I'll create the issue... |
09:42:40 | Zevv | yeah, it's kind of over my head I must admit |
09:42:47 | Zevv | and no one else stepped in here :) |
09:43:16 | Araq | I skimmed it, but I don't understand it |
09:43:23 | FromGitter | <kayabaNerve> Mr. "just ask" :P |
09:43:53 | Zevv | well, I ment 'just ask, an someone might respond' :) |
09:43:59 | FromGitter | <kayabaNerve> If you have a type class of inherited objects, a case statement macro for the parent object fails. |
09:44:04 | FromGitter | <kayabaNerve> *fails to match |
09:44:34 | FromGitter | <kayabaNerve> Changing the macro's arguments to `Parent or Type class` (type class of a type class) also fails. |
09:44:45 | FromGitter | <kayabaNerve> Casting from the type class to the parent type also fails. |
09:51:16 | FromGitter | <kayabaNerve> Issue created. |
09:52:07 | * | shomodj joined #nim |
09:56:13 | * | eterps joined #nim |
09:59:36 | PMunch | Hmm, there is something seriously wrong with the VM I think.. echo L.bufpos; L.bufpos = 0; echo L.bufpos |
09:59:43 | PMunch | They both echo the same thing.. |
10:02:51 | PMunch | var p: SqlParser; echo p.bufpos |
10:02:54 | PMunch | That doesn't echo 0.. |
10:04:18 | Zevv | !eval import parsesql; var p: SqlParser; echo p.bufpos |
10:04:22 | NimBot | 0 |
10:05:14 | PMunch | !eval import parsesql; static(var p: SqlParser; echo p.bufpos) |
10:05:16 | NimBot | Compile failed: /usercode/in.nim(1, 25) Error: expected: ':', but got: '(' |
10:05:40 | Zevv | almost |
10:05:55 | Zevv | I don't know how to do a static in a one liner |
10:06:00 | narimiran | !eval import parsesql; static: (var p: SqlParser; echo p.bufpos) |
10:06:02 | NimBot | Compile failed: Error: unhandled exception: intVal is not accessible [FieldError] |
10:06:18 | Zevv | right |
10:06:21 | PMunch | Yeah, there is another weird bug in 0.20.0 |
10:06:27 | PMunch | But that's apparently fixed in devel |
10:07:22 | Zevv | running devel, same error |
10:08:00 | PMunch | Hmm, maybe it was just my specific version of devel |
10:08:03 | * | dwdv joined #nim |
10:08:05 | PMunch | Which probably is a bit dated |
10:09:57 | PMunch | Yeah, updated my devel version and now I get the intVal error as well |
10:10:32 | PMunch | But the stack trace is just completely bonkers (from the devel compiler without -d:release) |
10:11:07 | Zevv | The IntVal is cuased because the src.knd == rkNode, not rkInt |
10:12:16 | Zevv | which part is bonkers? It makes sense here? |
10:12:39 | Zevv | http://paste.ubuntu.com/p/YWWjCgvhJD/ |
10:13:31 | PMunch | Hmm, what code were you using? |
10:13:43 | Zevv | nim devel of just now |
10:13:56 | Zevv | and http://paste.ubuntu.com/p/pGWdYxnXn8/ |
10:14:14 | PMunch | This is what I'm doing |
10:14:17 | PMunch | http://ix.io/1N9r |
10:15:15 | Zevv | completely bonkers! |
10:15:16 | PMunch | Ah, you were doing the field test |
10:15:50 | PMunch | I mean the line numbers don't match up.. |
10:16:59 | Zevv | ehm, I don't follow - it matches up fine here |
10:17:32 | PMunch | vm.nim:219 is the "case x.kind" statement in writeField |
10:17:59 | PMunch | But the error seems to occur on line 221 which is "of rxInt: n.intVal = x.intVal" |
10:18:02 | Zevv | ah you'd expect it to say line 221 where it actaully access the intVal |
10:19:04 | * | miona joined #nim |
10:19:35 | Zevv | right, I didn't even notice - I guess it kind of makes sense to point there as the various 'of' branches simply do not exist for the wrong kind |
10:19:57 | PMunch | Eh, I guess it might.. |
10:21:07 | PMunch | No idea what the actual cause of the bug is though.. |
10:21:37 | PMunch | Somehow it tries to get an int field for something that doesn't have an int field.. |
10:22:10 | PMunch | But it's weird that it only happens here |
10:25:32 | Zevv | is an object variand and the kind is wrong |
10:26:16 | PMunch | Yeah I know what fails, but not why |
10:27:01 | * | clyybber joined #nim |
10:30:45 | * | absolutejam1 joined #nim |
10:32:41 | Araq | the bugs is in 0.19 too, but 0.20 changed the rules for -d:release |
10:32:52 | Araq | so more bugs are detected |
10:34:04 | Zevv | ah right |
10:34:26 | FromGitter | <arnetheduck> yay for behavior-changing compiler flags, software is not complicated enough without them :) |
10:35:12 | * | Kaivo quit (Ping timeout: 268 seconds) |
10:36:14 | Araq | huh? -d:release now does *not* change behavior anymore |
10:37:18 | * | Kaivo joined #nim |
10:38:06 | * | vlad1777d joined #nim |
10:40:48 | PMunch | Aha, turning on -d:danger for the compiler indeed gives the same behaviour where the number simply isn't set |
10:45:13 | * | miona left #nim (#nim) |
10:49:44 | FromGitter | <arnetheduck> oh, I think it's excellent that it was changed :) could simplify things further and remove -d:danger too.. |
10:50:16 | PMunch | Well it's nice to have the option to turn it on |
10:50:21 | FromGitter | <arnetheduck> I'm curious though, it looks like the overflow checks are part in std lib code and part in compiler, as if they'd been implemented in either place at some point in time.. any preference? |
10:50:32 | PMunch | If you really need to squeeze performance, or want to fit things on a microcontroller |
10:52:30 | * | eterps quit (Ping timeout: 252 seconds) |
10:53:59 | PMunch | Hmm, and I who thought I would just throw together a small little ORM for fun.. |
10:54:13 | PMunch | Now I've spent all day looking at strange VM bugs.. |
10:54:21 | FromGitter | <arnetheduck> well, they significantly alter the control flow of your application.. `catch` takes on a completely different meaning, so you need to do more than just flip a switch - your code-base must be prepared for the change.. meaning that most libraries are off limits because they're not prepped for it etc etc |
10:54:53 | PMunch | True, which is why it's good that -d:release was split |
10:55:10 | PMunch | But -d:danger is still nice to have if you need it for something |
10:59:46 | FromGitter | <alehander42> PMunch where is this orm |
11:00:02 | FromGitter | <alehander42> i am making a small web framework these days |
11:00:16 | FromGitter | <alehander42> and i wondered what should my default orm: for now i use norm |
11:00:59 | * | actuallybatman quit (Ping timeout: 244 seconds) |
11:02:03 | PMunch | alehander42, I haven't gotten around to creating my ORM since parsesql doesn't run on compile-time.. |
11:02:19 | FromGitter | <alehander42> i even managed to make scaffolding => different model files work, but not sure this makes sense with most nim orm-s as often they need a central schema |
11:02:40 | FromGitter | <alehander42> hmm i like that norm is the opposite: based on types/pragmas |
11:02:50 | FromGitter | <alehander42> i prefer using that as a single source of truth |
11:02:55 | FromGitter | <alehander42> have you looked at ormin btw |
11:03:45 | PMunch | Yes I was looking at ormin |
11:03:59 | PMunch | I like it |
11:14:02 | PMunch | But it doesn't have a MySQL backend yet.. |
11:14:24 | PMunch | I think that should be an easy fix though |
11:16:49 | FromGitter | <alehander42> does parsesql fail because of streams |
11:17:45 | FromGitter | <alehander42> ok Araq, actually a better argument for the python imports people: right now it might be easy for me to find out with goto def what is defined where |
11:18:11 | FromGitter | <alehander42> but how can i see quickly how many things in e.g. "lexbase" come from "streams." |
11:18:31 | PMunch | alehander42, parsesql fails because of some VM bug I think |
11:18:34 | FromGitter | <alehander42> i guess one can say that this still doesnt help with >1 level of dependencies |
11:19:15 | PMunch | http://ix.io/1N9x |
11:19:27 | Araq | alehander42: remove the 'import streams' from lexbase and run 'nim check' |
11:19:30 | FromGitter | <alehander42> hm its interesting that lexbase. actually is used a lot in parsesql |
11:19:46 | PMunch | As you can see it tries to access a field that doesn't exist.. |
11:20:11 | Araq | and while that might not be ideal it's still so much better than having to do the same in Python. Ridiculous. |
11:21:09 | Araq | again, if you want to make this argument, argue in #python that module level def is to be preferred over def in classes. |
11:21:43 | Araq | "Python without OO is more maintainable", go ahead and make that claim. |
11:22:09 | Araq | don't waffle around it, say it. |
11:22:41 | FromGitter | <alehander42> Araq: i am just noticing a possible tradeoff |
11:22:48 | FromGitter | <alehander42> otherwise dont care a lot |
11:23:14 | FromGitter | <alehander42> i dont like(understand) oop too much anyway, so i wont involve myself in that :D |
11:23:47 | FromGitter | <alehander42> btw PMunch what is the blocker |
11:23:55 | FromGitter | <alehander42> for directly hotcodereloading your web app |
11:24:05 | FromGitter | <alehander42> is it nimrtl support for the async stdlib modules |
11:24:16 | FromGitter | <alehander42> or for something else in jester |
11:25:43 | PMunch | I dunno, I tried to turn it on, and jester started complaining |
11:26:01 | PMunch | Like the most trivial jester example fails if you turn it on |
11:27:05 | * | eterps joined #nim |
11:27:18 | FromGitter | <alehander42> woah hm it actually compiled to C |
11:27:37 | PMunch | Yeah, on devel |
11:27:49 | FromGitter | <alehander42> but had a c codegen bug in asyncdispatch |
11:27:58 | Araq | we fixed nimrtl bugs fwiw |
11:28:26 | FromGitter | <alehander42> my error is /dev/shm/codetracer/stdlib_asyncdispatch.nim.c:739:88: error: conflicting types for ‘getGlobalDispatcher_Qj2WZ6U46mm9bNMz9b8QTS9cA_actual’ |
11:28:36 | PMunch | http://ix.io/1N9y |
11:29:00 | FromGitter | <alehander42> yeah the same |
11:29:45 | PMunch | This happens a lot when you enable HCR/nimrtl /home/peter/.choosenim/toolchains/nim-0.20.0/lib/pure/htmlgen.nim(72, 28) Error: VM not allowed to do FFI, see `compiletimeFFI` |
11:30:11 | * | lf-araujo quit (Quit: lf-araujo) |
11:30:26 | * | lf-araujo joined #nim |
11:33:02 | FromGitter | <alehander42> its interesting that clang fails with different conflicting case |
11:33:16 | FromGitter | <alehander42> but probably a different order of analyzing them |
11:33:23 | clyybber | Araq: I think we need to introduce temporarys when an nkObjDown/nkObjUpConv is passed to a sink param |
11:34:54 | Araq | that would be wrong |
11:35:12 | Araq | when you moved a subtype/supertype the underlying object must be nil'ed out |
11:35:28 | clyybber | Ah, right. |
11:35:46 | clyybber | But how to do it then? |
11:36:17 | * | vlad1777d quit (Ping timeout: 245 seconds) |
11:36:51 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:37:13 | * | Snircle joined #nim |
11:37:14 | clyybber | I think one solution would be to generate more eqmoves, so that every subtype is covered by one. |
11:38:32 | clyybber | So that when we have `type Root = ref object of RootObj` `type Sub1 = ref object of Root` `type Sub2 = ref object of Root` |
11:39:14 | clyybber | instead of generating eqmove(Root, Root); eqmove(Sub1, Sub1); eqmove(Sub2, Sub2) |
11:39:44 | clyybber | we additionally generate eqmove(Root, Sub1); eqmove(Root, Sub2) |
11:48:33 | FromGitter | <zacharycarter> krux02: do you think you could merge - https://github.com/nim-lang/sdl2/pull/117 ? |
11:49:05 | FromGitter | <zacharycarter> just so it doesn't hang around forever |
11:59:02 | * | dddddd joined #nim |
12:04:33 | krux02 | zacharycarter: just merged it |
12:05:45 | FromGitter | <zacharycarter> thanks! |
12:06:14 | Zevv | c |
12:07:06 | clyybber | Araq: WDYT about the above approach? |
12:12:37 | Araq | clyybber, what's the problem? |
12:13:46 | Araq | the problem appears to be: nkAddr(nkConv(x)) must be turned into nkConv(nkAddr(x)) |
12:19:10 | * | eterps quit (Read error: Connection reset by peer) |
12:28:44 | PMunch | Hmm, Araq is there a good reason why ormin doesn't name it's tuple values? |
12:29:17 | * | krux02 quit (Remote host closed the connection) |
12:30:12 | * | lf-araujo quit (Quit: lf-araujo) |
12:30:32 | * | lf-araujo joined #nim |
12:35:35 | clyybber | Araq: Ah, yeah that should work |
12:50:04 | * | miona joined #nim |
12:53:51 | clyybber | Araq: As a side effect, the Cgen will then also be able to compile stuff like this: 'proc t(v: var RootObject) = ... ; var a = ObjectThatInheritsFromRootObj(); t(a)' |
12:55:47 | clyybber | or to make it even through to the backend: 't(RootObject(a))' |
12:55:56 | clyybber | which would currently generate invalid code |
12:56:03 | * | shomodj joined #nim |
12:57:19 | * | nsf quit (Quit: WeeChat 2.4) |
13:08:09 | Araq | PMunch, because Ormin also supports real object types |
13:15:53 | PMunch | Wait, it does? |
13:19:58 | PMunch | How? |
13:23:09 | * | theelous3 joined #nim |
13:25:22 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:26:57 | Araq | check the examples, I forgot |
13:30:17 | * | lf-araujo quit (Quit: lf-araujo) |
13:34:21 | Araq | "And don’t forget the fact, that UNIX system failed to keep T-Rex into park. It was even on TV, I think it was a documentary, but go look it up yourself." |
13:34:55 | * | krux02 joined #nim |
13:35:08 | * | krux02 quit (Read error: Connection reset by peer) |
13:35:19 | * | krux02 joined #nim |
13:35:43 | * | shomodj joined #nim |
13:36:10 | PMunch | Hmm, I can't really see either of the examples using anything but tuples.. |
13:39:14 | * | synshroud quit (Quit: ZNC 1.7.4 - https://znc.in) |
13:40:00 | * | clyybber quit (Quit: WeeChat 2.5) |
13:40:07 | * | miona quit (Remote host closed the connection) |
13:44:32 | FromGitter | <mratsim> Thoughts on deprecating `[]` as a deref operator and replacing it by `deref` function? https://github.com/nim-lang/Nim/issues/11705 |
13:48:20 | FromGitter | <alehander42> there is a problem with lineinfo for functions |
13:48:25 | FromGitter | <alehander42> linedir * |
13:49:11 | PMunch | mratsim, I'm all for it |
13:49:28 | PMunch | I haven't had any issues with `[]`, but it's a bit strange and cryptic |
13:49:31 | FromGitter | <alehander42> i tried to add genLineDir(p, prc.ast) |
13:49:38 | FromGitter | <alehander42> in the beginning of genProcAux |
13:49:41 | PMunch | Nim is already verbose about .addr, so why not .deref |
13:50:06 | FromGitter | <alehander42> to make line directives appear again for N_LIB_PRIVATE N_NIMCALL(.. etc lines |
13:50:36 | FromGitter | <alehander42> but its producing it in the body |
13:50:38 | PMunch | Hmm, Araq the Ormin chat example gives me an error when I try to go to localhost:8080 "WebSocket negotiation failed: the only supported sec-websocket-version is 13" |
13:51:18 | PMunch | But I might not have built it correctly |
13:51:26 | PMunch | But that is hard since it doesn't have any documentation.. |
13:51:41 | Araq | it's been a long time since I got ws to work with it |
13:51:57 | PMunch | I did "nim c server" and "nim js frontend" |
13:52:03 | PMunch | Is there anything else I need to do? |
13:52:03 | Araq | IME sockets/websockets don't work. |
13:52:16 | Araq | use a more recent ws implementation |
13:53:01 | PMunch | I just want to run the Ormin examples, do they rely on websockets? |
13:53:35 | PMunch | Rather I'd want to run some tests, to see if my implementation of named tuples work |
13:53:44 | PMunch | But Ormin doesn't have any tests.. |
13:54:13 | Araq | the examples are the tests |
13:54:27 | PMunch | But how do I run them? |
13:55:34 | Araq | your commands seem correct |
13:55:37 | * | lf-araujo joined #nim |
13:55:44 | PMunch | And to launch the test? |
13:55:49 | PMunch | Err, example |
13:55:57 | Araq | read the .travis.yml file please |
13:58:14 | PMunch | That only builds it.. |
13:58:24 | PMunch | It doesn't actually run it, which is what I have issues with |
13:58:35 | PMunch | It doesn't even build the front-end as far as I can tell.. |
14:00:17 | PMunch | Oh well, I have to go now.. |
14:00:22 | * | PMunch quit (Remote host closed the connection) |
14:07:42 | * | floppydh quit (Quit: WeeChat 2.5) |
14:10:50 | * | natrys joined #nim |
14:11:21 | * | jmiven quit (Quit: reboot) |
14:12:07 | * | jmiven joined #nim |
14:13:25 | * | fredrik92 joined #nim |
14:13:54 | * | fredrik92 quit (Client Quit) |
14:15:33 | * | Senketsu quit (Quit: WeeChat 2.5) |
14:15:47 | FromGitter | <alehander42> it would be nice to get ormin in shape |
14:16:00 | FromGitter | <alehander42> i wonder whats the best way to make migrations |
14:16:43 | FromGitter | <alehander42> i have a lib where one defines them declaratively with some nim calls |
14:17:30 | FromGitter | <alehander42> but i dont like that : i think often one should be able to automate it, change your schema/models, change your init code and make the tool generate the migration |
14:20:06 | * | jest joined #nim |
14:23:13 | * | jest quit (Remote host closed the connection) |
14:24:12 | * | abm joined #nim |
14:32:15 | * | solitudesf joined #nim |
14:54:22 | * | solitudesf quit (Remote host closed the connection) |
14:54:49 | * | solitudesf joined #nim |
14:58:46 | * | lf-araujo quit (Ping timeout: 246 seconds) |
15:03:49 | * | lritter joined #nim |
15:18:41 | Araq | alehander42: agreed |
15:21:12 | * | synshroud joined #nim |
15:23:11 | shashlick | joinThread() is hanging on linux, but works fine on Windows - what's the deal? |
15:33:25 | FromGitter | <mratsim> @Araq, is it feasible to get minimal stacktraces in release mode when we have a SIGSEGV? |
15:35:21 | FromGitter | <arnetheduck> it's feasible to get full stacktraces by compiling with --debuginfo and running through gdb :) |
15:35:57 | FromGitter | <mratsim> Sounds like a chore :P |
15:36:28 | FromGitter | <mratsim> and I think it's --debugger:native |
15:36:45 | FromGitter | <arnetheduck> this will always be "lighter" than whatever nim can achieve due to how it's table-driven with dwarf debug info.. `nlvm` can get it for free too but from `c` it's trickier to gen the right tables |
15:36:47 | FromGitter | <mratsim> you even get the function input values |
15:37:16 | FromGitter | <mratsim> So can nlvm compile nimbus? |
15:37:34 | FromGitter | <mratsim> ah there is secp256k1 dependency |
15:37:35 | FromGitter | <arnetheduck> no, nlvm is 0.20 which is broken |
15:37:47 | FromGitter | <arnetheduck> secp is fine, nlvm can use c libraries |
15:38:05 | FromGitter | <arnetheduck> (how would it link to glibc otherwise?) |
15:39:05 | * | couven92 quit (Read error: Connection reset by peer) |
15:39:06 | FromGitter | <mratsim> Ithought it still had importc issues |
15:39:25 | FromGitter | <arnetheduck> `--debuginfo` works for me.. everything is nicer with it enabled, I kind of wonder why it's not the default actually |
15:39:55 | FromGitter | <arnetheduck> ie call stacks, parameters etc etc.. profiling with `perf` - all the c tooling that exists already |
15:40:02 | * | rockcavera quit (Remote host closed the connection) |
15:41:14 | FromGitter | <arnetheduck> nlvm has never had importc issues. it has issues when in nim the ABI is not matched (ie if you specify a struct/object with the fields in different order) because nim-c will use the c header file order and nlvm will use the nim order.. |
15:41:18 | * | absolutejam quit (Ping timeout: 245 seconds) |
15:42:34 | FromGitter | <arnetheduck> ah there's one more importc issue: when nim imports a macro/constant as a var - arguably this is dubious in nim because a const shouldn't be a var. |
15:48:48 | * | federico3 quit (Ping timeout: 245 seconds) |
15:49:00 | * | federico3 joined #nim |
15:54:21 | Araq | well yes, you're both right |
15:55:03 | Araq | the default stack traces are nicer to read but their overhead is big and I don't like to spend more effort on a "minimal" version for the release mode |
15:55:34 | Araq | for the release mode we have --debuginfo. there is also "nativeStackTraces" |
15:58:54 | * | vlad1777d joined #nim |
16:09:49 | * | shomodj quit (Quit: Textual IRC Client: www.textualapp.com) |
16:10:02 | * | shomodj joined #nim |
16:29:38 | * | nsf joined #nim |
16:52:29 | FromDiscord_ | <Skaruts> hey guy, is there a way to ask the compiler to tell me where a function call came from? |
16:53:33 | FromDiscord_ | <Skaruts> cos I have a mysterious call, if I comment out the function there's no errors, if I don't, it gets called somehow (I have an `echo` in it getting printed out) |
16:57:00 | lqdev[m] | writeStackTrace()? |
16:57:16 | lqdev[m] | add that to the problematic function |
16:58:05 | FromDiscord_ | <Skaruts> I just noticed its from a `case of` |
16:58:43 | FromDiscord_ | <Skaruts> but I don't think I'm using the branch that calls the function though... |
17:00:01 | FromDiscord_ | <Skaruts> well I probably forgot something somewhere... |
17:01:49 | * | rockcavera joined #nim |
17:03:18 | lqdev[m] | perhaps some stack trace related call gets optimized away |
17:03:30 | lqdev[m] | gdb may help you in that scenario |
17:03:46 | lqdev[m] | or, echo the value that you pass to the case of |
17:03:56 | FromDiscord_ | <Skaruts> nevermind I'm just burned out and not thinking straight |
17:04:17 | lqdev[m] | I feel you |
17:04:26 | FromDiscord_ | <Skaruts> I was commenting out the case of branch, so of course there's no errors when I comment out the function |
17:04:30 | FromDiscord_ | <Skaruts> lol |
17:05:32 | lqdev[m] | dumb errors happen to us all the time, don't worry :) |
17:05:39 | FromDiscord_ | <Skaruts> thanks for that tip though |
17:05:59 | lqdev[m] | np |
17:07:46 | * | Jesin quit (Quit: Leaving) |
17:10:55 | * | Jesin joined #nim |
17:13:39 | * | krux02 quit (Remote host closed the connection) |
17:22:22 | FromGitter | <zacharycarter> question - if I'm using HCR - can I use streams in the code that isn't hot reloaded? |
17:23:56 | * | xet7 quit (Quit: Leaving) |
17:25:09 | FromGitter | <zacharycarter> I guess not :/ because when I try to with `--hotCodeReloading:on` I get the error: `Error: unhandled exception: key not found: failedAssertImpl_W9cjVocn1tjhW7p7xohJj6A [KeyError]` |
17:25:22 | FromGitter | <zacharycarter> that's disappointing - I guess I won't be using HCR :/ |
17:25:55 | FromGitter | <zacharycarter> I guess it's still not very useful |
17:26:29 | * | Senketsu joined #nim |
17:27:22 | * | actuallybatman joined #nim |
17:30:42 | FromGitter | <zacharycarter> and that I guess means coming up with scripting system becomes a pointless endeavor as well |
17:31:18 | shashlick | @zacharycarter - i know i already mentioned it but check out feud's plugin system |
17:31:33 | FromGitter | <zacharycarter> I took a look - but you're using boehm correct? |
17:31:38 | shashlick | i haven't used hcr but it works just fine |
17:31:56 | FromGitter | <zacharycarter> I'm using Nim's default GC |
17:31:57 | shashlick | yes, but i'm working on https://github.com/genotrance/shared which will remove dependency on boehm, at least for me |
17:32:19 | shashlick | really makes no diff which GC, between default and boehm for most projects |
17:32:31 | shashlick | although boehm is more unstable on devel/0.20.0 |
17:32:40 | shashlick | which pushed me to making shared again |
17:33:48 | FromGitter | <zacharycarter> from my understanding, with shared libraries and nim's default GC, there will be multiple instances of the GC that are not aware of one another |
17:34:13 | FromGitter | <zacharycarter> so you could potentially have one GC collect memory another is still referencing |
17:36:32 | shashlick | do you have multiple threads loading the same dll? |
17:38:01 | FromGitter | <zacharycarter> well ideally no - but I think in every plugin system I've looked at with Nim there is another thread responsible for watching changes to files and loading / unloading the dll |
17:38:01 | * | xet7 joined #nim |
17:43:01 | shashlick | that's what i do too |
17:43:40 | FromGitter | <zacharycarter> yeah - so my main thread would potentially grab references to memory from the thread that loads the shared lib |
17:43:46 | FromGitter | <zacharycarter> and both threads would have independent GCs |
17:44:20 | FromGitter | <zacharycarter> maybe I'll just use luajit or something |
17:45:16 | FromGitter | <zacharycarter> although I'm not sure that would just automatically guarantee any type of hot swapping either |
17:45:48 | Araq | if you tell me that you don't need freaking async I can give you threads and channels for --newruntime |
17:46:15 | FromGitter | <zacharycarter> I don't need async. Yet... haha |
17:48:53 | FromGitter | <zacharycarter> hot loading would drastically speed up iteration time though - if I can figure out some way of achieving it and still use the default gc |
17:50:12 | * | leorize quit (Ping timeout: 260 seconds) |
17:53:09 | shashlick | that's exactly why i built the plugin system first, since i didn't want to build everything into one binary - would make dev slow |
17:54:08 | FromGitter | <zacharycarter> yeah - I've been down that road before though and it's a lot of work for unreliable results (if you're not able to use boehm or another GC) |
17:54:26 | Araq | well HCR worked for me with the default GC |
17:54:26 | * | leorize joined #nim |
17:54:39 | FromGitter | <zacharycarter> it works for me - but not if I use streams in my main program |
17:54:49 | FromGitter | <zacharycarter> that results in an instant crash |
17:54:55 | Araq | streams? |
17:55:00 | FromGitter | <zacharycarter> FileStream |
17:55:06 | Araq | strange |
17:57:03 | FromGitter | <zacharycarter> I'll post a gist |
17:57:38 | FromGitter | <zacharycarter> maybe I'm doing something else wrong and blaming it on HCR |
17:59:38 | FromGitter | <zacharycarter> https://gist.github.com/zacharycarter/2555ccf9e7afcb6f5a27cd0934942f38 |
18:00:13 | FromGitter | <zacharycarter> first file is the file I'm parsing - second file is the Nim source |
18:01:11 | * | absolutejam joined #nim |
18:02:10 | * | Trustable joined #nim |
18:07:03 | shashlick | what's the crash output |
18:07:14 | FromGitter | <zacharycarter> it's at the top of the second file in the gist |
18:07:38 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d277aea4d750532412aa43f] |
18:08:01 | shashlick | no stack trace? |
18:08:06 | FromGitter | <zacharycarter> nope |
18:08:42 | * | leorize_ joined #nim |
18:09:19 | shashlick | ok, going back to the previous topic, I load the dlls in my main thread and call procs in the same thread, so everything is in one GC |
18:10:02 | shashlick | if you want every thread to do that, perhaps each thread loads its own copy of the dll? Araq might know better |
18:10:16 | * | leorize quit (Ping timeout: 260 seconds) |
18:10:28 | shashlick | as for sharing memory, you can only share what's allocShared() |
18:10:50 | shashlick | so i don't understand why loading dlls is being mixed with threads |
18:12:16 | FromGitter | <zacharycarter> hmm - I might have to give it a try then if you're only loading and calling procs from one thread - that might work |
18:12:21 | FromGitter | <zacharycarter> are you using channels or something to achieve that? |
18:12:28 | shashlick | what do you want to do across threads? |
18:12:33 | FromGitter | <zacharycarter> nothing |
18:12:34 | shashlick | i'm loading and calling in the same thread |
18:12:46 | FromGitter | <zacharycarter> oh okay |
18:12:52 | FromGitter | <zacharycarter> but not in the main thread |
18:12:54 | shashlick | my monitor is a separate thread but it tells my main thread when something has changed |
18:12:58 | FromGitter | <zacharycarter> ah okay |
18:13:08 | FromGitter | <zacharycarter> I see - I'll give it a looksee and maybe I can get it to work |
18:13:34 | shashlick | i am using boehm cause i was sharing between monitor thread and main thread |
18:14:02 | shashlick | but that is a mess, Araq saw the bug in 2 minutes when i was crashing nonstop with the default GC |
18:14:18 | shashlick | so boehm helped with 0.19.x but 0.20.0 even that is crashing |
18:14:27 | shashlick | so in order for me to update, i have to share with allocShared |
18:14:33 | * | nsf quit (Quit: WeeChat 2.4) |
18:14:36 | shashlick | hence the shared module i'm working on |
18:15:03 | FromGitter | <zacharycarter> gotcha |
18:15:18 | shashlick | does anyone know if you can check if you already have a lock? |
18:15:35 | shashlick | using withLock() recursively works fine on windows, but pthreads gets pissed off |
18:17:34 | FromGitter | <zacharycarter> maybe something is up other than using HCR with streams - because I can put together a four line example that works fine |
18:17:50 | FromGitter | <zacharycarter> this error is just not very easy to debug because I don't get any stack trace... |
18:24:17 | * | leorize_ is now known as leorize |
18:27:05 | FromGitter | <zacharycarter> Araq: should I file an issue for this? |
18:30:20 | * | leorize quit (Ping timeout: 260 seconds) |
18:37:43 | * | leorize joined #nim |
18:38:20 | * | Trustable quit (Remote host closed the connection) |
18:40:23 | * | kuon__ quit (Remote host closed the connection) |
18:40:50 | * | kuon__ joined #nim |
18:44:27 | FromGitter | <zacharycarter> well - it works with sdl rwops so I think I can get by with that |
18:57:45 | FromGitter | <zacharycarter> I don't think this has to do with streams after all - I think it's because I'm echoing something that isn't echoable with useNimRtl |
18:58:21 | FromGitter | <zacharycarter> or something along those lines |
19:03:25 | rayman22201 | trippy that there is no stack trace |
19:03:35 | rayman22201 | are you using devel or 0.20? |
19:05:18 | FromGitter | <zacharycarter> 1) 20 |
19:05:49 | FromGitter | <zacharycarter> it seems to happen as soon as the executable is launched - if I compile with debug symbols and run it through gdb my entrypoint doesn't even get hit |
19:06:57 | rayman22201 | try devel? |
19:09:08 | rayman22201 | also, where do you end up when you run it inside gdb? just curious |
19:09:09 | * | lmariscal quit (Quit: I'm out!) |
19:09:40 | * | lmariscal joined #nim |
19:09:55 | * | lmariscal quit (Client Quit) |
19:10:12 | * | lmariscal joined #nim |
19:20:01 | FromGitter | <Obround> Is there some way you can override built-ins in nim? |
19:23:48 | FromGitter | <zacharycarter> I basically see the same output in gdb |
19:24:12 | FromGitter | <zacharycarter> I can try devel - but I have managed to get around the error by just not echoing the sequence I had created |
19:24:58 | rayman22201 | @Obround, what are you trying to override exactly? |
19:24:59 | rayman22201 | @zacharycarter, you end up inside Tables.nim line 263? Does gdb show the stack trace of how it got there? |
19:25:09 | FromGitter | <zacharycarter> nope |
19:25:49 | FromGitter | <zacharycarter> let me double check but I'm pretty sure it doe snot |
19:25:50 | rayman22201 | hrmmm. When gdb can't show the stack trace it usually means a memory corruption... weird... |
19:27:22 | FromGitter | <zacharycarter> well - I can't get gdb to stop anywhere |
19:27:29 | FromGitter | <zacharycarter> I even am running it with flags to stop on exceptions |
19:27:31 | FromGitter | <zacharycarter> and it's not stopping |
19:28:03 | FromGitter | <zacharycarter> as long as I don't echo this seq though - everything seems fine - and I was only doing that for debugging purposes |
19:28:25 | FromGitter | <zacharycarter> I can still echo the strings it contains |
19:30:23 | rayman22201 | well, when it crashes, gdb should stop |
19:30:43 | rayman22201 | then you can do "bt" to get the stack trace from that point |
19:30:50 | FromGitter | <zacharycarter> yeah - but that doesn't happen at all |
19:30:59 | FromGitter | <zacharycarter> at least I don't think it does |
19:35:27 | FromGitter | <zacharycarter> gdb just exits |
19:35:46 | rayman22201 | yeah, Nim catches the exception and "gracefully exits" |
19:36:32 | FromGitter | <zacharycarter> :) |
19:36:58 | Araq | -d:noSignalHandler |
19:37:07 | Araq | to prevent that from happening |
19:37:30 | rayman22201 | I was going to tell him to try and put a breakpoint in the signal handler, but that works too |
19:38:41 | Zevv | zacharycarter: you are still hunting the crash from your gist snippet? |
19:38:56 | rayman22201 | I'm pushing him to look deeper into it :-P |
19:38:58 | FromGitter | <zacharycarter> nah - I'm just not doing what I think was causing the crash anymore |
19:39:40 | rayman22201 | because I have a hunch there is something interesting going on here |
19:40:05 | FromGitter | <zacharycarter> even `-d:noSignalHandler` produces the same reuslt |
19:40:50 | Zevv | valgrind knows what is happening |
19:40:55 | FromGitter | <zacharycarter> I'd blame all the bindings and shared libs I'm loading and chalk it up to memory corruption - but given that the gist which isn't using anything but the Nim stdlib crashes too |
19:41:04 | Zevv | http://ix.io/1Obp |
19:41:06 | FromGitter | <zacharycarter> no valgrind for me :( on windows |
19:41:47 | FromGitter | <zacharycarter> nice! |
19:41:51 | FromGitter | <zacharycarter> I wonder why that's happening |
19:42:13 | FromGitter | <zacharycarter> and also why I get that funky ass error |
19:42:39 | rayman22201 | Valgrind is cool... I always forget lol |
19:43:56 | FromGitter | <zacharycarter> also - why does removing the echo from the program fix it? |
19:44:35 | rayman22201 | I'm guessing the invalid read brought some garbage into memory, that the echo is later trying to read. If you don't echo, it doesn't read the bad memory. |
19:45:23 | FromGitter | <zacharycarter> makes sense - so basically I have a time bomb in my app atm |
19:45:37 | rayman22201 | I have a feeling the bad memory is still there though, waiting to cause havoc for you later. yup... a memory land mine :-P |
19:45:47 | Zevv | I'm digging, looks like readDataImpl is messed up |
19:47:30 | FromGitter | <zacharycarter> I feel like I'm war torn Bosnia |
19:48:05 | Zevv | newFileStream is borked |
19:48:30 | Zevv | if you call it with file name it creates a proper file stream if the file can be opened |
19:48:44 | Zevv | if not, it silently returns and the stream has uninitialized function pointers |
19:49:13 | FromGitter | <zacharycarter> yeah - I think I switched to using openFileStream |
19:49:49 | rayman22201 | ohhh, nice find |
19:50:11 | FromGitter | <zacharycarter> but the whole invalid read size is still a mystery |
19:50:19 | Zevv | so, what should it do if open fails? |
19:50:21 | Zevv | throw? |
19:50:40 | FromGitter | <zacharycarter> supposedly |
19:50:43 | FromGitter | <zacharycarter> according to the docs |
19:51:23 | Zevv | "This function returns nil in case of failure" |
19:51:24 | rayman22201 | nope: "This function returns nil in case of failure" |
19:51:33 | rayman22201 | I'm too slow lol |
19:52:45 | rayman22201 | I'm guessing two implementations b/c some people don't want exceptions? |
19:53:09 | Zevv | well there you have it. The thing is friggin nil |
19:53:16 | Zevv | this is why I left Lua |
19:53:24 | FromGitter | <zacharycarter> oh sorry - when you said `open` I thought you meant - `openFileStream` |
19:53:31 | FromGitter | <zacharycarter> `newFileStream` will return nil |
19:53:38 | FromGitter | <zacharycarter> `openFileStream` with raise an exception |
19:53:53 | Zevv | yeah. It's try-ed in your code, but not checked for nilism |
19:54:49 | FromGitter | <zacharycarter> well - in my actual program I'm using `openFileStream` now and it's still crashing |
19:55:05 | Zevv | gist it |
19:55:15 | FromGitter | <zacharycarter> let me modify the example - it's a lot of code |
19:56:57 | FromGitter | <zacharycarter> if you just change line 130 from `stream = newFileStream(basePath)` to `stream = openFileStream(basePath)` - that's what I just did and it still crashes |
19:57:16 | FromGitter | <zacharycarter> also - the file exists so it's not because of that I don't think |
19:57:39 | rayman22201 | it exists, but does your program have the right permissions to read it? |
19:58:09 | rayman22201 | I know you are windows, but that kind of thing can still happen |
19:58:12 | Zevv | it works just fine |
19:58:25 | Zevv | as long as the zmap is in the proper subdir |
19:58:38 | Zevv | I had to make assets/maps and move it in there |
19:59:21 | Zevv | @["grass.png", "cliffs.png", "cobblestone.jpg", "grass2.jpg", "dirty_grass.jpg", "cracked_dirt.jpg", "dirt_road.jpg", "metal_platform.jpg", "snowy_grass.jpg", "lava_ground.jpg", "sand.jpg"] |
20:00:11 | FromGitter | <zacharycarter> okay let me try putting it in the same directory and modifying the code slightly |
20:00:40 | FromGitter | <zacharycarter> I still get that error - let me check file permissions |
20:00:49 | Zevv | strace() |
20:00:54 | Zevv | oooooh, wait. you're not on linux :) |
20:01:17 | FromGitter | <zacharycarter> nope - windows :) |
20:01:30 | Zevv | glad I can be of help. I tried to help some other guy this morning, but I was completely flabbergasted |
20:01:35 | Zevv | caseStatementMacros |
20:01:39 | Zevv | Never heard of that stuff |
20:01:44 | rayman22201 | there is a reason it's experimental lol |
20:02:12 | FromGitter | <zacharycarter> permissions seem fine |
20:02:13 | Zevv | yeah, why is it not in the experimental manual? |
20:02:22 | rayman22201 | I thought it was? |
20:02:37 | Zevv | it's in the devel manual, but not in the experimental manual |
20:03:36 | rayman22201 | hrmmmm.... maybe an oversight? or maybe the core team thinks it won't be experimental by the next release? lol |
20:03:37 | FromGitter | <zacharycarter> here's what Dr. Memory spits out - https://gist.github.com/zacharycarter/85b15100361498a54077edd45f4a15b2 |
20:04:55 | FromGitter | <zacharycarter> definitely looks to me like it has something to do with hcr / nimRtl |
20:05:16 | Zevv | Just sent a PR to move it to experimental manual |
20:05:56 | Zevv | that's a pretty useless dump of numbers if you ask me |
20:06:38 | Zevv | so you are doing more then just the snippet I assume |
20:06:49 | FromGitter | <zacharycarter> no - that's from compiling and running the snippet |
20:07:01 | FromGitter | <zacharycarter> `nim c -r --hotCodeReloading:on -d:useNimRtl -d:noSignalHandler .\foo.nim` |
20:10:29 | Zevv | oh need to bake some libnimhcr stuff ifrst |
20:11:10 | FromGitter | <zacharycarter> it's probably reproducable with just -d:useNimRtl |
20:11:25 | FromGitter | <zacharycarter> nevermind |
20:13:53 | * | narimiran quit (Ping timeout: 258 seconds) |
20:14:29 | Zevv | I have hcr issues. |
20:14:42 | Zevv | "key not found: failedAssertImpl_W9cjVocn1tjhW7p7xohJj6A" at compile time |
20:14:50 | FromGitter | <zacharycarter> yarrr |
20:14:53 | FromGitter | <zacharycarter> that's the error I get! |
20:15:05 | Zevv | oh raight :) |
20:16:39 | * | jjido joined #nim |
20:17:04 | FromGitter | <zacharycarter> I guess it might be time to checkout shashlick's plugin system :P |
20:17:17 | FromGitter | <zacharycarter> because I have no idea how to figure this one out |
20:17:19 | Zevv | I have no clue about the hcr status |
20:17:34 | Zevv | I got it to run once, but I feel there is some tricky stuff involved there and a very small user base to find bugs |
20:18:35 | rayman22201 | apparently pei386_runtime_relocator is a mingw thing that runs on dll startup. Maybe a mingw bug? https://mingw.fedoraproject.narkive.com/lxzD0FxL/pei386-runtime-relocator |
20:19:06 | FromGitter | <zacharycarter> well if Zevv is getting it on linux too |
20:19:34 | rayman22201 | hrmmm, true |
20:21:11 | Zevv | failedAssertImpl_W9cjVocn1tjhW7p7xohJj6A gets declared static in the C code |
20:21:23 | Zevv | I know nil about codegen |
20:23:23 | FromGitter | <zacharycarter> I don't even know where nimcache resides anymore lol |
20:23:32 | FromGitter | <zacharycarter> oh found it |
20:24:07 | rayman22201 | what happens if you add `--passC: --enable-runtime-pseudo-reloc-v1` ? |
20:24:54 | FromGitter | <zacharycarter> not sure what the equivalent of that is for `cc` |
20:25:13 | FromGitter | <zacharycarter> okay well `failedAssertImpl_W9cjVocn1tjhW7p7xohJj6A` must come from the asserts next to the readlines |
20:25:19 | FromGitter | <zacharycarter> so let me get rid of those |
20:25:51 | rayman22201 | are you not using mingw on windows? |
20:25:57 | rayman22201 | what are you using? |
20:27:51 | FromGitter | <zacharycarter> yeah I think I am - but that flag did not work for me |
20:28:02 | rayman22201 | actually it's `PassL` sorry. It's a linker flag |
20:28:06 | FromGitter | <zacharycarter> ah np |
20:28:19 | FromGitter | <zacharycarter> same error :/ |
20:28:32 | rayman22201 | well damn. It was worth a shot |
20:29:10 | * | Vladar quit (Read error: Connection reset by peer) |
20:29:26 | * | Trustable joined #nim |
20:31:20 | FromGitter | <zacharycarter> I agree - I should probably go to sleep because I don't think this one is going to get solved any time soon |
20:31:48 | Zevv | likely an HCR issue |
20:32:08 | FromGitter | <zacharycarter> I agree - and I don't know if anyone is working on HCR |
20:32:41 | rayman22201 | I agree. It |
20:32:46 | rayman22201 | it's an hcr issue |
20:32:58 | rayman22201 | would be nice to get a bug report, but oh well |
20:33:00 | rayman22201 | gn |
20:33:22 | FromGitter | <zacharycarter> I can file one - but I'm not sure if my example is minimal enough |
20:33:30 | Zevv | I'm diging through the C gen code to see where this static is coming from |
20:33:33 | FromGitter | <zacharycarter> I tried coming up with smaller ones but to no avail |
20:33:35 | rayman22201 | That's what I mean. a minimal repro |
20:33:39 | FromGitter | <zacharycarter> yeah |
20:33:39 | Zevv | and everywhere I go I see `if hcrOn:` |
20:36:54 | Zevv | well, you could file an issue with your gist, it's small enough to reproduce |
20:36:56 | rayman22201 | @zacharycarter, are you using mingw 64bit or 32bit? |
20:37:05 | Zevv | I guess in the hands of someone who knows whats going on it should be clear |
20:37:22 | rayman22201 | based on the Dr. Memory thingy you sent, this is the function that is exploding: https://github.com/Alexpux/mingw-w64/blob/d0d7f784833bbb0b2d279310ddc6afb52fe47a46/mingw-w64-crt/crt/pseudo-reloc.c#L464 |
20:37:43 | rayman22201 | And that has some ifdef stuff for 64bit, so I wonder if that is related |
20:38:20 | rayman22201 | maybe some similar issue with linux gcc and 64bit shared libs? |
20:39:13 | rayman22201 | @Zevv, good poitn |
20:39:15 | FromGitter | <Obround> @FromIRC -- I am trying to override something like the out keyword |
20:39:15 | rayman22201 | point* |
20:39:34 | Zevv | nah, it's not even getting to the shared lib parts. It's the Nim compiler itself not finding a symbol somewhere |
20:39:38 | Zevv | There is nothing getting linked yet |
20:39:40 | FromGitter | <Obround> Oh |
20:41:28 | rayman22201 | lol. @Obround. IRC is bridged, that's not my username. You cannot override reserved words. |
20:42:23 | FromGitter | <zacharycarter> 64 bit mingw |
20:42:39 | rayman22201 | I wonder if using 32bit will make a difference |
20:44:03 | FromGitter | <zacharycarter> if I turn up the verbosity to 3 on the nim compile command I get some more output |
20:44:05 | rayman22201 | @Obround, you can do this: http://ix.io/1ObS/nim |
20:44:34 | FromGitter | <zacharycarter> but that seems like it's because the compilation is failing |
20:44:47 | Zevv | also wrong with 32 bit |
20:44:58 | Zevv | and I was wrong, it *is* a runtime error, not nim compile time |
20:45:03 | rayman22201 | what does verbosity 3 show? |
20:45:28 | Zevv | nim and c compilation are just fine, linking as well |
20:45:35 | Zevv | run time problem with symbol resolving. |
20:46:19 | Zevv | and now: nightynight |
20:46:30 | rayman22201 | ah, so that _pei386_runtime_relocator function failing makes more sense |
20:46:42 | rayman22201 | gn! |
20:48:03 | FromGitter | <zacharycarter> night! thanks for helping look into it Zevv! |
20:48:10 | FromGitter | <zacharycarter> and you too rayman :) |
20:48:23 | rayman22201 | np. sorry we couldn't help more |
20:48:48 | Zevv | its worth an issue I guess |
20:51:25 | FromGitter | <zacharycarter> no worries - I'll file an issue tomorrow and give shashlick's plugin system a go |
20:59:46 | shashlick | @zacharycarter - i'm still fighting with 0.20.0 so will recommend sticking with 0.19.6 for now |
20:59:58 | shashlick | close to finishing shared - just ran into =destroy issue |
21:00:18 | shashlick | `Error: type bound operation `=destroy` can be defined only in the same module with its type (SharedSeq)` |
21:00:20 | shashlick | why! |
21:06:40 | leorize[m] | due to complications in letting them to be defined in other modules |
21:08:12 | leorize[m] | causing those to be bound too late |
21:08:23 | shashlick | it worked in 0.19.6 😞 |
21:08:51 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:09:33 | leorize[m] | and there were bugs related to it |
21:09:52 | leorize[m] | iirc one of the reason for this change was that if you define a type like this: |
21:09:54 | leorize[m] | type |
21:10:01 | leorize[m] | A: object |
21:10:20 | leorize[m] | B = object |
21:10:23 | leorize[m] | a: A |
21:10:40 | leorize[m] | and you define destructors for A afterwards |
21:11:00 | leorize[m] | that destructor won't be bound to B |
21:12:09 | shashlick | okay |
21:16:45 | * | stefanos82 quit (Quit: Quitting for now...) |
21:17:59 | * | shomodj_ joined #nim |
21:18:20 | * | __Myst__ quit (Ping timeout: 272 seconds) |
21:21:05 | * | shomodj quit (Ping timeout: 248 seconds) |
21:22:42 | shashlick | how do you do parent/child classes such that if i pass a child obj to a proc with parent param, it will work |
21:26:27 | rayman22201 | you can make a `FlowVar[string]` but you can't make a `FlowVar[tuple[a: string]]` ??? |
21:27:13 | * | jjido joined #nim |
21:27:45 | leorize[m] | shashlick: what do you mean? |
21:28:29 | * | seni joined #nim |
21:28:30 | leorize[m] | a child type can always be converted to the parent type |
21:31:16 | shashlick | generic methods are deprecated? |
21:31:52 | * | jjido quit (Client Quit) |
21:32:00 | FromGitter | <alehander42> i think this is old |
21:32:19 | FromGitter | <alehander42> a long time ago it was talked that generics + methods have problems |
21:37:02 | shashlick | gosh i'm totally stuck |
21:38:09 | * | absolutejam quit (Ping timeout: 248 seconds) |
21:39:56 | rayman22201 | I would expect this to work: http://ix.io/1Oc9 |
21:40:01 | rayman22201 | but I get `/home/ray/test.nim(6, 15) Error: cannot create a flowVar of type: tuple[a: string]` |
21:40:26 | rayman22201 | any thoughts? |
21:41:22 | rayman22201 | latest devel btw |
21:42:59 | dom96 | shashlick, https://github.com/dom96/choosenim/issues/124 |
21:43:15 | dom96 | Can't remember if you changed this or not |
21:43:30 | dom96 | I guess so since we built from tar.gz's on windows before :/ |
21:45:00 | shashlick | yep, it's that damn powershell 2.0 |
21:45:35 | dom96 | if unzipping isn't reliable on Windows we should revert back to what we had |
21:45:41 | dom96 | at least it was reliable AFAIK |
21:46:10 | * | jjido joined #nim |
21:46:24 | shashlick | we should fallback to legacy if powershell is old |
21:46:37 | shashlick | i am close to getting nimarchive working, then we can just extract ourselves |
21:47:22 | * | a_b_m joined #nim |
21:47:55 | shashlick | I'm getting unresolved generic parameter here - https://github.com/genotrance/shared/blob/master/shared/seq.nim#L131 - worked on 0.19.6 - any suggestions? |
21:48:09 | FromGitter | <alehander42> dom96 please look or merge that category pr for nimforum |
21:48:23 | FromGitter | <alehander42> active contributors should remain motivated :( |
21:48:34 | FromGitter | <alehander42> and it seems this one waited so much |
21:49:21 | dom96 | Please help with reviews like this |
21:49:35 | dom96 | I am only one person, I cannot be the sole reviewer for so many things |
21:49:54 | dom96 | I know you don't have as much knowledge about this, but at least you can pick out the low hanging things that obviously need fixing |
21:50:25 | * | abm quit (Ping timeout: 248 seconds) |
21:50:29 | dom96 | also, with this one this is more about testing rather than reviewing tbh |
21:51:00 | FromGitter | <alehander42> yeah this one just looked like a bigger change which probably requires some kind of decision by the software creator |
21:51:06 | FromGitter | <alehander42> as its a big new feature |
21:51:12 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:51:15 | FromGitter | <alehander42> otherwise you're right |
21:51:54 | dom96 | A decision of whether this should be implemented is already: yes. In fact, I asked for this to be implemented IIRC |
21:52:23 | * | absolutejam joined #nim |
21:55:59 | FromGitter | <alehander42> ahh |
21:56:00 | * | solitudesf quit (Ping timeout: 268 seconds) |
22:00:03 | dom96 | So many changes, yeah, I can't review this tonight |
22:00:55 | FromGitter | <alehander42> yeah, i feel you |
22:02:54 | FromGitter | <Kvothe87> hello all |
22:03:18 | FromGitter | <Kvothe87> any experience with nigui? |
22:04:01 | * | absolutejam1 quit (Ping timeout: 246 seconds) |
22:04:24 | FromGitter | <Kvothe87> i just took one of the examples and tried to compile and get the following error "Error: 2147483648 can't be converted to int" |
22:05:53 | FromGitter | <Kvothe87> i don't have any int so i guess is something in the library |
22:06:11 | FromGitter | <Kvothe87> was there any change in 0.20 that may have an effect? |
22:07:34 | rayman22201 | lots of changes in 0.20, hard to tell. I don't have experience with nigui. You might be better off posting on the forum along with which specific example is failing. |
22:08:22 | FromGitter | <Kvothe87> thanks |
22:08:55 | FromGitter | <ratiotile> @Kvothe87 I ran into a similar problem before and the solution was to use a static int for generics |
22:09:37 | FromGitter | <ratiotile> but that's something in the library itself that needs to change |
22:09:48 | rayman22201 | iirc the NiGui guy is on the forum more than he is on irc. |
22:15:41 | * | __Myst__ joined #nim |
22:16:40 | * | absolutejam1 joined #nim |
22:20:46 | * | a_b_m quit (Ping timeout: 258 seconds) |
22:23:50 | * | absolutejam quit (Ping timeout: 258 seconds) |
22:34:42 | shashlick | @Araq - any chance you are around? |
22:35:56 | * | Trustable quit (Remote host closed the connection) |
22:40:50 | * | shomodj_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:44:10 | * | vlad1777d quit (Ping timeout: 244 seconds) |
22:55:18 | shashlick | if I make a generic object but don't use T, Nim complains "unresolved generic parameter". this doesn't happen with 0.19.6. my workaround - https://github.com/genotrance/shared/blob/master/shared/seq.nim#L9 |
22:56:21 | * | disruptek quit (Read error: Connection reset by peer) |
22:57:32 | * | disruptek joined #nim |
23:00:08 | * | dwdv quit (Ping timeout: 268 seconds) |
23:02:38 | lmariscal | shashlick but why do you need the generic type? |
23:03:23 | lmariscal | since you are not using it in the SharedObj |
23:07:21 | shashlick | I am using it |
23:07:29 | shashlick | it is a shared seq |
23:07:33 | shashlick | so has to be generic |
23:07:44 | shashlick | i'm just not using the info in the object but within SharedObj |
23:08:19 | shashlick | https://github.com/genotrance/shared/blob/master/shared/seq.nim#L40 |
23:13:36 | * | disruptek quit (Ping timeout: 272 seconds) |
23:16:30 | * | disruptek joined #nim |
23:24:12 | * | traviss joined #nim |
23:24:26 | * | traviss quit (Client Quit) |
23:26:59 | FromDiscord_ | <Travis> araq: what is the `gg` file search tool you use on stream? I want to try it out. |
23:27:23 | * | natrys quit (Quit: natrys) |
23:27:29 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
23:29:21 | FromGitter | <Obround> Is there a way you can disable a proc (for example `echo`) |
23:30:24 | FromGitter | <ratiotile> you can use a template that checks cond and then calls echo |
23:31:19 | FromGitter | <Obround> could you give an example(i'm noob at nim) |
23:32:24 | FromGitter | <Obround> @ratiotile -- Could you give an example(I'm noob at Nim) |
23:32:40 | FromDiscord_ | <Travis> does this throw an error for you? |
23:32:40 | FromDiscord_ | <Travis> ```nim |
23:32:40 | FromDiscord_ | <Travis> template echo(ss: varargs[string]) = discard |
23:32:40 | FromDiscord_ | <Travis> ``` |
23:32:55 | shashlick | just don't import it |
23:33:41 | FromGitter | <Obround> <Travis> What do you mean by don;t import it? |
23:34:05 | FromGitter | <ratiotile> @Obround try starting with a proc and turn it into a template once you get it |
23:34:16 | FromGitter | <Obround> Ok. |
23:36:36 | rayman22201 | @Obround, `import system except echo` |
23:36:43 | rayman22201 | that is @shashlicks solution |
23:37:25 | rayman22201 | That will just skip the echo function from being imported into your program |
23:38:37 | rayman22201 | If you wanted something *fancier*, you could do: |
23:38:38 | rayman22201 | `template echo(args: untyped) = raise newException(AssertionError, "sorry echo not allowed")` |
23:39:27 | rayman22201 | the import except way is better though imo |
23:41:46 | FromDiscord_ | <Travis> and if you want to ignore echo: |
23:41:46 | FromGitter | <ratiotile> huh, I assumed he wanted a way to globally turn off all echos in the code. Is Obround making some sort of sandbox? |
23:41:46 | FromDiscord_ | <Travis> ```nim |
23:41:46 | FromDiscord_ | <Travis> import system except echo |
23:41:46 | FromDiscord_ | <Travis> template echo(args: untyped) = discard |
23:41:46 | FromDiscord_ | <Travis> ``` |
23:43:39 | rayman22201 | lol. Yes, that will turn `echo` into a noop. |
23:48:32 | rayman22201 | @ratiotile, good question. There is no way to disable a proc "globally". If a library that you import calls `echo` there isn't anything you can do about it. |
23:49:23 | FromDiscord_ | <Travis> haha, i think that would be a pretty big security problem |
23:52:31 | * | dddddd quit (Ping timeout: 246 seconds) |
23:57:27 | rayman22201 | what are you actually trying to do @Obround? |