00:02:25 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
00:02:30 | * | PMunch quit (Quit: leaving) |
00:02:42 | * | Kingsquee joined #nim |
00:11:34 | * | yglukhov quit (Remote host closed the connection) |
00:13:36 | * | Matthias247 quit (Read error: Connection reset by peer) |
00:17:06 | * | couven92 quit (Quit: Client Disconnecting) |
00:22:28 | * | zachcarter joined #nim |
00:26:00 | zachcarter | alright I got rid of all the nk_ prefixes in the nuklear bindings and replaced all the cint / culong / cfloat etc with their nim equivalents |
00:27:38 | zachcarter | now I’m working on a thin layer to make the bindings more nimian, and this will be the API that will be exposed |
00:35:36 | * | shashlick quit (Ping timeout: 260 seconds) |
00:39:31 | * | shashlick joined #nim |
01:02:48 | * | dddddd quit (Quit: Hasta otra..) |
01:12:05 | * | yglukhov joined #nim |
01:17:06 | krux02 | zachcarter: that sounds pretty neat |
01:17:09 | * | yglukhov quit (Ping timeout: 240 seconds) |
01:17:13 | krux02 | and like an API I would like to use |
01:17:38 | zachcarter | here’s a sample : |
01:17:45 | zachcarter | https://gist.github.com/zacharycarter/0fd027b20efe2ffd23354fb89e5b0b79#file-nimian-nim-L4 |
01:18:10 | zachcarter | it’s just me applying your suggestions to making the bindings more nimian |
01:18:35 | zachcarter | but I could write some sensiible defaults for intialization etc |
01:23:47 | zachcarter | I wish I knew what half of these parameters represented, I could actually name them accordingly |
01:23:52 | zachcarter | too bad nuklear has ZERO documentation |
01:24:09 | zachcarter | minus what’s inside the header which is already minimal |
01:38:00 | krux02 | zachcarter: how is the buffer type defined |
01:38:49 | zachcarter | https://gist.github.com/zacharycarter/74ee314e588404a0215b677ce442cc4f |
01:39:05 | krux02 | ok I found the definition |
01:39:22 | zachcarter | I’ll commit my latest changes to the branch |
01:39:40 | krux02 | I can at least tell you what a memory pool is |
01:40:00 | krux02 | and I guess the type is related to the memory pool |
01:40:16 | zachcarter | yeah |
01:40:45 | zachcarter | that’s a bad example actually |
01:40:49 | zachcarter | it’s when you get into function prototypes like - |
01:40:50 | krux02 | ok there are only two allocation types fixed and dynamic and that says basically nothing |
01:41:29 | krux02 | no to be honest I don't know what the buffer is for |
01:41:46 | zachcarter | https://github.com/zacharycarter/nuklear-nim/blob/RemoveNKPrefixes/nuklear.nim#L1107 |
01:42:00 | krux02 | it looks like well written code, but the documentaion is poor, only understandable by the author |
01:42:14 | zachcarter | agreed |
01:43:03 | krux02 | to be honest it looks better written than a lot of the stuff I have seen in the Nim compiler |
01:43:58 | zachcarter | well I can always go back and reference Nuklear.h |
01:44:12 | zachcarter | some of the horribleness in the naming of the proc parameters may be due to c2nim |
01:46:33 | krux02 | I am not sure if you should export everything form the header |
01:46:53 | krux02 | currently the buffer looks to internal to be |
01:47:45 | zachcarter | that may very well be the case |
01:47:59 | zachcarter | although I think the buffer has to be exported as the drawing backend it |
01:48:48 | krux02 | it there an example on the buffer usage |
01:48:52 | krux02 | or use case? |
01:49:28 | zachcarter | yup |
01:49:29 | zachcarter | one sec |
01:49:53 | zachcarter | https://github.com/vurtun/nuklear/blob/master/demo/sdl_opengl3/nuklear_sdl_gl3.h#L103 |
01:49:54 | krux02 | aah I found documentation about the buffer |
01:50:41 | * | BitPuffin|osx quit (Ping timeout: 260 seconds) |
01:52:06 | krux02 | https://github.com/vurtun/nuklear/blob/master/nuklear.h#L1463 |
01:53:23 | zachcarter | nice okay I should definitely include this docu in the binidngs |
01:53:33 | zachcarter | or link to it at least |
01:53:40 | zachcarter | I don’t want to have to maintain it |
01:56:20 | * | def-pri-pub joined #nim |
01:56:20 | * | def-pri-pub quit (Changing host) |
01:56:20 | * | def-pri-pub joined #nim |
02:04:47 | * | ofelas quit (Remote host closed the connection) |
02:05:05 | * | ofelas joined #nim |
02:15:52 | * | hjsagg joined #nim |
02:22:25 | * | hjsagg quit (Ping timeout: 260 seconds) |
02:26:38 | * | chemist69 quit (Disconnected by services) |
02:26:43 | * | chemist69_ joined #nim |
02:35:08 | * | rauss joined #nim |
02:36:17 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
02:36:28 | * | Kingsquee joined #nim |
02:59:27 | zachcarter | I have two different types defined - |
02:59:44 | zachcarter | plugin_filter = proc (a2: ptr text_edit; unicode: uint32): int32 {.cdecl.} |
02:59:45 | zachcarter | inputFilter* = proc(te: var text_edit, unicode: uint32): int32 |
03:00:18 | zachcarter | is there a way to cast one into the other? or create a plugin_filter given an instance of an inputFilter? |
03:02:08 | krux02 | well you can not cast a function pointer into a closure and vice versa |
03:02:25 | krux02 | there are ways to work around this |
03:02:55 | krux02 | but it depends on what you want to do |
03:03:03 | zachcarter | I want to call this method |
03:03:08 | krux02 | or how it is used |
03:03:13 | zachcarter | proc edit_string(a2: ptr context; a3: uint32; buffer: cstring; len: ptr int32; |
03:03:14 | zachcarter | max: int32; a7: plugin_filter): uint32 {.importc: "nk_edit_string".} |
03:03:17 | * | ofelas quit (Remote host closed the connection) |
03:03:33 | zachcarter | it’s the last parameter of that function |
03:03:36 | zachcarter | plugin_filter |
03:03:39 | * | ofelas joined #nim |
03:03:54 | zachcarter | so I’m defining anoter proc |
03:04:08 | krux02 | is the callback stored, or is it used only during the call edit_string? |
03:04:09 | zachcarter | proc editString*(ctx: var context, u: uint32, buffer: string, len: var int32, max: int32, f: inputFilter) = |
03:04:33 | krux02 | that is important, because when it is used only during edit_string, you are luckey |
03:04:36 | krux02 | lucky |
03:05:26 | zachcarter | let me see how I’m using it currently |
03:05:40 | zachcarter | discard edit_string(fileBrowser.ctx, EDIT_FIELD.ord, addr fileBrowser.newFolderName[0], addr fileBrowser.newFolderNameLen, 64, nuklear.filter) |
03:05:42 | zachcarter | :) |
03:05:46 | krux02 | then you can create a plugin_filter function that calls a nim closure |
03:06:16 | zachcarter | so they’ll call one of several defined plugin filters |
03:06:21 | zachcarter | or inputFilters now |
03:06:35 | zachcarter | err they’ll provide |
03:06:37 | zachcarter | to the proc |
03:06:48 | zachcarter | exposed by the API |
03:07:14 | zachcarter | proc filter_default(a2: ptr text_edit; unicode: uint32): int32 {.importc: "nk_filter_default", cdecl.} |
03:07:14 | zachcarter | proc filter*(te: var text_edit, unicode: uint32): int32 {.cdecl.} = |
03:07:15 | zachcarter | filter_default(addr te, unicode) |
03:09:03 | zachcarter | I guess I can remove that cdecl from filter |
03:09:29 | krux02 | http://ix.io/nQW |
03:09:58 | zachcarter | thanks |
03:10:31 | krux02 | that only works when there is only one active callback at a time |
03:10:54 | zachcarter | gotcha - I think that should be the case |
03:11:00 | krux02 | when there is something like addHook(callback) then it doesn't work that way |
03:11:32 | zachcarter | gotcha |
03:11:43 | krux02 | but that also allows you to enable real closures for the nim callback |
03:12:14 | krux02 | so you make the interface instantly more usable |
03:12:27 | zachcarter | yeah this is sweet |
03:14:32 | krux02 | Why did the partially bind man fell into the well? |
03:14:42 | * | yglukhov joined #nim |
03:14:48 | krux02 | because he couldn't see that well |
03:15:06 | zachcarter | lol |
03:17:07 | krux02 | ok, good night |
03:18:25 | * | krux02 quit (Quit: Leaving) |
03:19:31 | * | yglukhov quit (Ping timeout: 260 seconds) |
03:33:17 | * | ofelas quit (Remote host closed the connection) |
03:33:38 | * | ofelas joined #nim |
03:34:40 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:39:21 | * | ofelas quit (Remote host closed the connection) |
03:39:35 | * | ofelas joined #nim |
03:43:05 | zachcarter | still not getting how to do what I need to do |
03:56:23 | zachcarter | ahhh if I do {.closure, cdecl.} I can cast it |
03:57:10 | * | brson quit (Quit: leaving) |
05:04:20 | * | ftsf_ quit (Ping timeout: 246 seconds) |
05:07:17 | * | ofelas quit (Remote host closed the connection) |
05:07:39 | * | ofelas joined #nim |
05:13:08 | * | butchster_ joined #nim |
05:13:28 | * | butchster quit (Ping timeout: 240 seconds) |
05:16:20 | * | ftsf_ joined #nim |
05:16:49 | * | butchster_ left #nim (#nim) |
05:17:25 | * | butchster joined #nim |
05:41:14 | * | def-pri-pub quit (Quit: leaving) |
05:48:22 | * | rauss quit (Quit: WeeChat 1.7) |
06:00:56 | * | libman quit (Quit: Connection closed for inactivity) |
06:05:49 | * | Sembei joined #nim |
06:08:06 | * | Pisuke quit (Ping timeout: 260 seconds) |
06:12:47 | * | ofelas quit (Remote host closed the connection) |
06:13:04 | * | ofelas joined #nim |
06:14:04 | * | zachcarter quit (Quit: zachcarter) |
06:21:51 | * | j75 joined #nim |
06:25:38 | j75 | I am having trouble installing nimble from koch. I keep seeing Killed FAILURE at the end |
06:25:50 | j75 | had no issues on my other computer |
06:29:45 | * | sz0 joined #nim |
06:32:19 | * | MyMind joined #nim |
06:34:26 | * | nsf joined #nim |
06:35:40 | * | Sembei quit (Ping timeout: 268 seconds) |
06:41:11 | * | ofelas quit (Ping timeout: 264 seconds) |
06:43:49 | * | ofelas joined #nim |
06:51:22 | FromGitter | <Varriount> zachcarter: So what are today's challenges? |
06:53:00 | FromGitter | <Varriount> j25: If you're seeing "Killed", then it might be that the system is killing the compiler process. |
07:00:29 | j75 | only when trying to install nimble |
07:03:14 | * | ftsf_ quit (Remote host closed the connection) |
07:57:56 | * | rokups joined #nim |
08:26:02 | * | libman joined #nim |
08:27:42 | * | yglukhov joined #nim |
08:34:04 | * | yglukhov quit (Ping timeout: 268 seconds) |
08:36:43 | * | bjz joined #nim |
08:38:08 | * | djellemah quit (Ping timeout: 240 seconds) |
08:38:29 | * | djellemah joined #nim |
08:46:23 | * | yglukhov joined #nim |
08:51:49 | * | Vladar joined #nim |
08:55:05 | * | Pisuke joined #nim |
08:55:38 | * | MyMind quit (Ping timeout: 240 seconds) |
09:09:31 | * | rauce quit (Ping timeout: 260 seconds) |
09:26:27 | * | rauce joined #nim |
09:29:18 | * | Matthias247 joined #nim |
09:32:31 | * | djellemah_ joined #nim |
09:32:38 | * | djellemah quit (Ping timeout: 240 seconds) |
09:33:02 | FromGitter | <vegansk> Is there any way to implement ⏎ ⏎ ```proc test(name: string): NimNode {.compileTime.} = ⏎ result = bindSym(name)``` ⏎ ⏎ ? [https://gitter.im/nim-lang/Nim?at=58b6954d21d548df2c7471a1] |
09:33:32 | Araq | no, by design the VM doesn't perform symbol lookups |
09:33:47 | Araq | there are all sorts of workarounds though |
09:36:41 | FromGitter | <vegansk> @Araq, I have some identifier from AST and need to find the symbol for it. How can I do it? |
09:39:33 | FromGitter | <vegansk> Example: in this line (https://github.com/vegansk/nimboost/blob/6332bbd9156c64fb61909e45ce9714216859f570/tests/boost/test_objutils.nim#L123) macro creates object DataA, and here (https://github.com/vegansk/nimboost/blob/6332bbd9156c64fb61909e45ce9714216859f570/tests/boost/test_objutils.nim#L137) I need to get symbol ``DataA`` |
09:40:46 | * | Matthias247 quit (Read error: Connection reset by peer) |
09:41:49 | * | Andris_zbx joined #nim |
09:42:07 | Araq | if you create it, register it some .global compiletime var to be able to look it up later |
09:43:10 | * | couven92 joined #nim |
09:44:48 | FromGitter | <vegansk> @Araq, but I can create object DataA in global scope, then in local. The compiler knows the scope. How can I get the scope of instantiation in macro? |
09:45:31 | Araq | well you cannot have it both ways. either the compiler should lookup, then the macro parameter is 'typed' or you do the lookup in your macro |
09:46:21 | FromGitter | <vegansk> Thanks |
09:46:33 | Araq | if you produce nnkIdent instead of nnkSym then the compiler's lookup rules will be used |
09:46:56 | Araq | that's what you should be doing, I think. |
09:49:44 | * | PMunch joined #nim |
09:50:49 | FromGitter | <vegansk> Ok |
10:08:22 | * | PMunch quit (Quit: leaving) |
10:11:56 | * | PMunch joined #nim |
10:14:14 | FromGitter | <vegansk> @Araq, one more question please. Why I can't get type of generated type in data macro?: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=58b69ef500c00c3d4fa3656d] |
10:17:06 | rokups | Araq: symlink sin compiler repo - allowed or not? |
10:21:09 | * | chemist69_ is now known as chemist69 |
10:21:42 | Araq | not allowed. |
10:21:53 | Araq | no symlinks, I hate them. |
10:22:24 | chemist69 | Hi, I am parsing a C++ header file with c2nim, just to see if I can get anywhere with this. |
10:22:27 | chemist69 | The parser chokes on lines like this: `std::string getAtomValue(const Atom *atom);`with the error: `Error: ';' expected` at pos. 25 (before the parentheses). Does someone have an idea how to fix this? |
10:23:48 | Araq | does it really choke on that? |
10:23:59 | Araq | is that everything what the file contains? |
10:24:07 | Araq | do you use c2nim --cpp ? |
10:24:35 | chemist69 | yes I use --cpp and the error occurs on line 420 of the file |
10:24:58 | Araq | isolate it, my guess is it's something else |
10:25:02 | * | tankfeeder joined #nim |
10:25:46 | chemist69 | when I comment out that line it parses another code line and then stops at this line: `std::string getSupplementalSmilesLabel(const Atom *atom);` |
10:26:14 | chemist69 | ok, will try to narrow it down, thanks. |
10:26:31 | couven92 | Araq, PMunch tells me you hate symlinks? why do you hate symlinks? |
10:27:12 | Araq | they transform a nice tree structure into a graph |
10:27:16 | FromGitter | <vegansk> What's the difference between ``typed`` and ``untyped`` result of macro? |
10:27:38 | Araq | every tool needs to be patched to do "the right thing" with symlinks |
10:28:10 | Araq | does copyDir copy the symlinks or the files they point to? |
10:30:25 | Araq | vegansk: there is no difference in theory, in practice the compiler might do something weird with 'typed' |
10:31:17 | couven92 | Araq, PMunch and I are having a discussion about nim compile and file extensions in the command-line argument. Difference between `nim c koch` and `nim c koch.nim`? |
10:31:42 | Araq | there is none afaik |
10:32:12 | couven92 | what about including the koch.nim.cfg? does that also happen anyways? |
10:32:23 | Araq | what? |
10:32:40 | Araq | yeah, it should. |
10:32:45 | couven92 | ok |
10:33:27 | PMunch | Araq, did you see the wxnim pull request by the way? |
10:33:30 | * | BitPuffin|osx joined #nim |
10:33:35 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
10:38:25 | * | Arrrr joined #nim |
10:38:35 | * | djellemah_ quit (Ping timeout: 246 seconds) |
10:38:54 | * | djellemah_ joined #nim |
10:40:55 | * | libman quit (Quit: Connection closed for inactivity) |
10:42:56 | * | bjz_ joined #nim |
10:43:37 | * | bjz quit (Ping timeout: 260 seconds) |
10:47:49 | * | chemist69 quit (Ping timeout: 260 seconds) |
10:48:49 | * | tankfeeder quit (Quit: Leaving) |
10:51:18 | cheatfate | rokups, what do you think about custom memory manager for coroutines? with bitmap array as backend, to reuse obj+stack chunks? |
10:52:07 | rokups | sounds like possible performance gains |
10:52:56 | cheatfate | on initialize developer can specify count of coroutines and manager allocates such amount of memory |
10:53:38 | * | chemist69 joined #nim |
10:53:46 | cheatfate | if more memory needed one more big chunk will be created with new bitmap array |
10:54:26 | cheatfate | this can cause zero-cost coroutine creation |
10:56:36 | rokups | sounds like a good idea indeed |
11:00:20 | rokups | cheatfate: fix for you https://github.com/nim-lang/Nim/pull/5463 |
11:01:11 | rokups | you may try implementing these coroutine changes yourself. im not sure i want to tackle it right now |
11:06:31 | cheatfate | rokups, so you give me permission to `rape` your coroutines? |
11:06:35 | couven92 | Araq, on the topic of symlinks... How do you feel about NTFS Junction links? :P |
11:06:36 | cheatfate | :) |
11:07:13 | rokups | its not my baby, have a free reign just as MIT license says ;) |
11:08:59 | rokups | another optimization i had in mind for later was main loop sorting coroutine list by sleep time and `switchTo()` switching to next coroutine directly while switching back to main loop only when there is some sleeping to do or we scheduled a round of coroutines |
11:22:00 | cheatfate | rokups, there will be some changes which will add `COROUTINE_BLOCK` state |
11:22:15 | cheatfate | in such way i want to mark coroutines which wait for IO |
11:22:56 | cheatfate | and scheduler will perform ioselectors.select() to resolve blocked coroutines |
11:23:37 | cheatfate | i'm still can't figure out how i can achieve this but i really need to call ioselectors.select() in some place |
11:27:41 | cheatfate | and i think this place will be scheduler |
11:31:28 | * | djellemah_ quit (Ping timeout: 240 seconds) |
11:32:19 | * | djellemah_ joined #nim |
11:32:37 | * | yglukhov quit (Read error: Connection reset by peer) |
11:33:13 | * | yglukhov joined #nim |
11:40:05 | * | bjz joined #nim |
11:41:35 | * | bjz_ quit (Ping timeout: 246 seconds) |
12:02:26 | * | Snircle joined #nim |
12:07:55 | PMunch | Hmm, anyone here using NimLime for Sublime? |
12:22:00 | PMunch | I'm getting an error that it can't find the Nim executable (which is in my PATH) |
12:25:19 | * | synshroud quit (Quit: ZNC 1.6.4 - http://znc.in) |
12:28:47 | rokups | cheatfate: yes, that place should be around switchTo() call in run(). i like where this is going ^_^ |
12:50:16 | * | xet7 quit (Quit: Leaving) |
12:50:47 | * | ofelas quit (Remote host closed the connection) |
12:51:34 | * | ofelas joined #nim |
13:00:50 | * | zachcarter joined #nim |
13:23:08 | PMunch | Hmm, it seems that wxString -> nim string doesn't work |
13:29:55 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
13:47:09 | PMunch | I'm currently trying to do "echo e1.getValue().c_str().asCString()" where e1 is a TextCtrl, getValue return a wxString, c_str returns a wxCStrData, and .asCString() returns a cstring. |
13:47:14 | PMunch | This just gives me random data |
13:53:57 | FromGitter | <Varriount> PMunch: Are you sure that the path environment variable loaded by sublime is the same? |
13:55:33 | FromGitter | <Varriount> Also, you can specify an exact path to your Nim executable in the settings file. |
13:55:40 | PMunch | It appeared that it wasn't, for some strange reason. |
13:55:45 | PMunch | Yeah, that's what I ended up doing |
13:56:56 | FromGitter | <Varriount> Ok, good. *goes back to sleep* |
13:58:17 | PMunch | Hmm, getValue().len works fine and reports the length correctly. So WxWidgets have indeed got the string |
14:15:25 | * | couven92 quit (Quit: Client disconnecting) |
14:20:23 | * | smt_ joined #nim |
14:22:47 | * | couven92 joined #nim |
14:22:47 | FromGitter | <andreaferretti> I remember not long ago an option was introduced to dump/inspect the content of memory |
14:22:59 | FromGitter | <andreaferretti> but I cannot find any reference anymore |
14:23:04 | FromGitter | <andreaferretti> does anyone know? |
14:23:47 | * | smt quit (Ping timeout: 255 seconds) |
14:30:24 | * | hjsagg joined #nim |
14:33:15 | FromGitter | <andreaferretti> I have found something in the latest commits regarding nimtracker |
14:33:23 | FromGitter | <andreaferretti> but I am not quite sure how to use it |
14:34:35 | Araq | it needs to be documented and cleaned up a bit |
14:35:12 | FromGitter | <andreaferretti> what would be a basic usage? |
14:35:46 | Araq | you add watchpoints via the API and during the program run you get reports when this memory is written to |
14:36:01 | Araq | helps to find memory corruptions |
14:36:44 | Araq | lldb/gdb watchpoints are restricted to 8 byte sized locations and so are often useless |
14:36:58 | FromGitter | <andreaferretti> ok, maybe this is not what I was thinking about |
14:37:09 | FromGitter | <andreaferretti> probably I had misunderstood the announcement |
14:37:21 | Araq | well its purpose changed |
14:37:34 | FromGitter | <andreaferretti> is there anything to just dump a graph annotated with sizes or something like that? |
14:37:41 | Araq | originally it would track every memory write so that you could "go back in time" |
14:37:51 | FromGitter | <andreaferretti> I see |
14:38:03 | Araq | but that's just too slow for anything |
14:38:23 | FromGitter | <andreaferretti> I would have guessed! :-D |
14:38:38 | FromGitter | <andreaferretti> yes, it is more interesting to restrict its usage |
14:38:40 | Araq | I thought sqlite can handle it :P |
14:38:46 | FromGitter | <andreaferretti> :-) |
14:38:57 | Araq | for medium sized programs |
14:39:05 | Araq | but nope, it's unusable |
14:39:39 | demi- | there is a mac app that can do that for you |
14:40:04 | Araq | you can compile -d:nimTypeNames and then call dumpNumberOfInstances() |
14:40:12 | demi- | https://github.com/zorgiepoo/bit-slicer/ one of the features is memory watchpoints |
14:40:28 | Araq | not a graph, but a useful list |
14:40:36 | FromGitter | <andreaferretti> ah great, so there was in fact somthing like that! |
14:40:44 | FromGitter | <andreaferretti> thank you! :-) |
14:41:24 | yglukhov | Araq: hi. I’ve got an issue that i can’t create a small reproducible example of. The issue is a memory leak in the server code, only on 64bits, when using nimongo. Nimongo code is rather straightforward, uses async sockets, doesn’t use custom memory management etc. Any hints? |
14:43:12 | Araq | yglukhov: -d:nimTypeNames and dumpNumberOfInstances() ? |
14:43:21 | * | rauss joined #nim |
14:43:58 | Araq | you're the guy with the customized solution to detect leaks |
14:44:08 | Araq | so why do you ask me? ;-) |
14:44:36 | yglukhov | Araq: dumpNumberOfInstances not helping. the values before the leak and after the leak look pretty similar. |
14:45:48 | yglukhov | also there are some bugs in dumpNumberOfInstances. |
14:46:15 | yglukhov | and even after my fixes i don't understand/trust it. |
14:47:21 | yglukhov | my custom solution works when i know the specific instance that should be disposed but doesnt get disposed. this case is different |
14:50:26 | * | zachcarter quit (Quit: zachcarter) |
14:51:22 | * | krux02 joined #nim |
14:54:54 | PMunch | Araq, any idea why "echo e1.getValue().c_str().asCString()" doesn't work? getValue returns a wxString |
14:57:12 | * | nsf quit (Quit: WeeChat 1.7) |
14:58:47 | yglukhov | Araq: one of the dumpNumberOfInstances bugs: https://github.com/nim-lang/Nim/pull/5465 |
15:05:14 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
15:23:38 | * | shashlick quit (Ping timeout: 240 seconds) |
15:24:37 | * | shashlick joined #nim |
15:26:07 | * | zachcarter joined #nim |
15:33:53 | * | hjsagg quit (Ping timeout: 260 seconds) |
15:39:23 | Araq | yglukhov: strange, I thought I patched growObj, are you sure it's wrong? |
15:39:57 | Araq | PMunch: wxString could be destructed already, I doubt c_str() keeps it alive |
15:43:14 | yglukhov | Araq: yep. |
15:44:24 | PMunch | Hmm, how do I get the string then? |
15:47:22 | * | Sembei joined #nim |
15:49:20 | yglukhov | Araq: there's more to it. decTypeSize calculates wrong sizes for ref objects. probably should use type.base.size instead of type.size |
15:51:02 | * | libman joined #nim |
15:52:46 | Araq | PMunch: store it in a temp |
15:57:01 | Araq | yglukhov: yeah that code doesn't read like the latest version of my code |
15:57:11 | Araq | maybe I lost it in a branch |
15:57:39 | yglukhov | Araq: after these changes gc stats and dumpNumberOfInstances.totalSize differ. e.g gcstats.occupiedMemory = 330mb. dumpNumberOfInstances.totalSize = 44mb. in 32bit mode, when leaks are not reproduced, the consumed memory is around 10mb |
15:58:12 | yglukhov | Araq: oh, please try to find it. hopefully it will help |
15:58:40 | Araq | yglukhov: what OS? |
15:58:53 | Araq | also the difference can be explained by manual alloc0() calls |
16:01:55 | * | elrood joined #nim |
16:03:22 | PMunch | Store it in a temp? |
16:08:16 | PMunch | Aaah "var str = e1.getValue(); str.c_str().asCString()" works |
16:09:11 | yglukhov | Araq: macos |
16:13:07 | elrood | guys, nim's documentation generation seems increasingly broken these days. koch web or nimweb --onlyDocs with appropriate flags fail: https://gist.github.com/anonymous/89fd9fe0bd65870053a572ca2807e52e |
16:17:57 | Araq | elrood: Error: invalid pragma: used means you don't use 'nim devel' for the docgen |
16:19:25 | elrood | Araq, Version 0.16.1 (2017-03-01), git hash: 28a7c874b7cdba34544abb7691515d36fe8411c8 |
16:20:13 | elrood | freshly pulled and built, although i ran into that failure a few days ago already |
16:20:32 | elrood | what should i do differently, and why? |
16:21:01 | PMunch | Okay Araq, when doing changes to wxWidgets |
16:21:15 | PMunch | The wrapper is auto-generated right |
16:21:35 | PMunch | But it contains some bugs (for example the fonts stuff in my PR) |
16:21:58 | PMunch | So how do you want changes to that? |
16:25:33 | elrood | Araq, oh, right, koch's been hooking up to an outdated binary with its automagic smartness |
16:26:48 | PMunch | Oh Araq, by the way. What does {.experimental.} do? |
16:29:13 | euantor | Has anybody by any chance encountered any oddities with asyncnet's acceptAddr and IPv6 sockets? |
16:29:33 | euantor | I'm looking at NimForum, and as soon as I hit the registration page, it all falls over |
16:30:03 | euantor | The `db_sqlite` module creates an invalid query: `delete from antibot where ip = '::1` |
16:30:29 | yglukhov | Araq: and linux as well. |
16:30:32 | euantor | And the length of the IP (which is `::1`) is apparently 46 |
16:31:25 | euantor | (eg: len(s) returns 46 at this line: https://github.com/nim-lang/Nim/blob/master/lib/impure/db_sqlite.nim#L109) |
16:33:13 | euantor | It seems like perhaps the net module or wherever it is that actual accept happens allocates a string of length 46 for IPv6 addresses. Why the db_sqlite module then falls over, I'm not so sure about |
16:34:20 | * | sz0 quit (Quit: Connection closed for inactivity) |
16:35:28 | yglukhov | euantor: Just today reverted asynchttpserver to not support ipv6 because it causes problems on windows. does it sound relevant? |
16:36:33 | euantor | I'm running this on Arch Linux, forgot to mention! |
16:37:07 | elrood | Araq, alright, no more failures, thanks for the hint. the issues with incompletely generated docs and thus broken links persist, and nimweb doesn't seem to heed its --output flag, but hey, at least a step in the right direction |
16:41:24 | yglukhov | euantor: are you using asynchttpserver? |
16:42:14 | euantor | Also, whilst I'm looking at the sqlite module, is there a reason it does its own parameter substitution? It already uses prepare_v2, so why not use the various bind_x() functions on that prepared statement? |
16:42:28 | euantor | yglukhov: Yes, NimForum runs on jester, which uses asynchttpserver |
16:43:05 | yglukhov | euantor: try updating nim |
16:43:32 | euantor | I'll try that, though it's a fresh install from yesterday built from source |
16:48:56 | yglukhov | euantor: exactly. a couple of days ago i made ipv6, today i reverted it |
16:49:06 | euantor | ok, I'm rebuilding now |
16:51:38 | * | Andris_zbx quit (Remote host closed the connection) |
16:53:24 | * | yglukhov quit (Remote host closed the connection) |
16:54:37 | euantor | Ok, that didn't help unfortunately |
16:54:51 | euantor | Still getting the same error, but obviously my debug code in `db_sqlite` is gone |
16:56:17 | euantor | Yep, the IP address still has length 46, rather than the expected 3. That shouldn't break db_sqlite, but it seems to |
16:56:26 | * | Trustable joined #nim |
16:57:24 | * | Trustable quit (Remote host closed the connection) |
16:58:20 | * | Trustable joined #nim |
16:59:37 | dom96 | Strange. It does seem to definitely be related to yglukhov's patch. |
17:00:03 | dom96 | or maybe it's the fact that your Arch install has IPv6 enabled? |
17:03:07 | * | brson joined #nim |
17:04:12 | * | zachcarter_ joined #nim |
17:04:40 | * | zachcarter quit (Ping timeout: 268 seconds) |
17:04:40 | * | zachcarter_ is now known as zachcarter |
17:06:56 | * | tautologico joined #nim |
17:10:56 | * | Matthias247 joined #nim |
17:20:36 | euantor | IPv6 seems to be the problem, just got to work out the cause. I'll test a minimal test case this evening on my Mac and see if I can reproduce it. If I can, I'll create an issue |
17:42:51 | * | nsf joined #nim |
17:44:25 | PMunch | Is there a template for safe file handling in Nim? |
17:44:36 | PMunch | Basically this: https://nim-lang.org/docs/tut2.html#exceptions-try-statement |
17:57:49 | * | hjsagg joined #nim |
17:59:35 | dom96 | PMunch: what should this template do? Ignore the errors? |
18:00:05 | PMunch | Hmm, you're right, that would be bad :P |
18:00:51 | * | Vladar quit (Remote host closed the connection) |
18:02:43 | euantor | NimForum works fine on my mac, so it looks like something related to Arch or the current version of Nim |
18:02:54 | euantor | I'll set up another VM and test there |
18:04:51 | * | zachcarter quit (Quit: zachcarter) |
18:06:06 | * | zachcarter joined #nim |
18:08:28 | * | Trustable quit (Remote host closed the connection) |
18:09:21 | FromGitter | <philip-wernersbach> Does anyone have an example of working JS FFI? I can't instantiate any Javascript objects, I keep getting weird type errors |
18:14:21 | * | Sembei quit (Ping timeout: 260 seconds) |
18:15:10 | stisa | philip-wernersbach : just made this https://github.com/stisa/websockets , it's basic but works |
18:16:28 | * | yglukhov joined #nim |
18:33:44 | rauss | philip-wernersbach: I tried to embed v8, ChakraCore, and SpiderMonkey. Had the most success with SpiderMonkey, as the others are convoluted C++ APIs |
18:34:14 | rauss | But I didn't really ever finish figuring it out. I tabled it for now |
18:34:49 | rauss | Err, no, had most success with Chakra. |
18:34:59 | * | tankfeeder joined #nim |
18:35:09 | * | hjsagg quit (Ping timeout: 240 seconds) |
18:38:11 | * | djellemah_ quit (Ping timeout: 264 seconds) |
18:39:51 | * | djellemah_ joined #nim |
18:46:51 | * | PMunch quit (Remote host closed the connection) |
18:47:36 | * | BitPuffin|osx quit (Ping timeout: 260 seconds) |
19:00:54 | * | couven92 quit (Quit: Client disconnecting) |
19:12:12 | * | rokups quit (Quit: Connection closed for inactivity) |
19:12:33 | * | djellemah_ quit (Quit: Leaving) |
19:16:37 | * | tankfeeder quit (Remote host closed the connection) |
19:16:54 | * | tankfeeder joined #nim |
19:19:02 | * | djellemah joined #nim |
19:37:47 | * | PMunch joined #nim |
19:37:52 | * | couven92 joined #nim |
19:38:31 | * | Ven joined #nim |
19:41:26 | zachcarter | how can I cast a sequence to a cstringArray? |
19:41:36 | zachcarter | can I simply call cast[cstringArray](seq) ? |
19:43:29 | Araq | no, use allocCstringArray or something |
19:43:52 | zachcarter | alright thanks Araq |
19:47:11 | * | bjz joined #nim |
19:52:28 | * | yglukhov quit (Remote host closed the connection) |
20:01:19 | * | yglukhov joined #nim |
20:06:18 | * | hjsagg joined #nim |
20:19:25 | * | smt_ quit (Read error: Connection reset by peer) |
20:20:00 | * | Jesin quit (Quit: Leaving) |
20:25:08 | * | Jesin joined #nim |
20:35:49 | * | Sembei joined #nim |
20:39:51 | * | Vladar joined #nim |
20:41:07 | * | Arrrr quit (Quit: Leaving.) |
20:42:38 | FromGitter | <philip-wernersbach> @stisa That helps a lot, thanks! But when do you use ref object vs object, and importc vs importcpp for FFI? |
20:43:44 | FromGitter | <philip-wernersbach> @rauss How did that work out? I'm trying to compile Nim to JS though, but that's still interesting |
20:44:51 | rauss | philip-wernersbach: Oh haha yeah that's the opposite, so nvm |
20:47:55 | stisa | philip-wernersbach: I use importcpp when the proc is a method of a js object, otherwise nim rewrites the proc to ``function(obj, arg)`` |
20:49:26 | * | smt joined #nim |
20:51:19 | * | kier_ joined #nim |
20:51:48 | * | michael_campbel- joined #nim |
20:52:39 | stisa | For obj vs ref obj, I usually have a ref obj marked with importc and a obj of refobj that is used in the wrapper |
20:53:06 | * | kier quit (*.net *.split) |
20:53:07 | * | michael_campbell quit (*.net *.split) |
21:00:48 | * | elrood quit (Quit: Leaving) |
21:01:27 | * | BitPuffin|osx joined #nim |
21:10:43 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:15:53 | * | yglukhov quit (Remote host closed the connection) |
21:19:09 | * | yglukhov joined #nim |
21:26:46 | * | ftsf quit (Remote host closed the connection) |
21:29:27 | * | vlad1777d joined #nim |
21:37:01 | * | tankfeeder quit (Quit: Leaving) |
21:43:09 | * | brson quit (Ping timeout: 240 seconds) |
21:49:17 | PMunch | Hmm, I've got a macro that creates a user interface. And now I want to create one that adds more elements to that interface. How do I declare a macro that takes an identifier and an AST so that I can call it like "widget.addElements:<The following lines is my macro>" |
21:56:37 | * | yglukhov quit (Remote host closed the connection) |
21:56:54 | * | zachcarter quit (Quit: zachcarter) |
21:59:00 | PMunch | Never mind, think I figured it out |
22:01:07 | * | yglukhov joined #nim |
22:02:23 | * | yglukhov quit (Remote host closed the connection) |
22:02:52 | * | yglukhov joined #nim |
22:03:12 | * | brson joined #nim |
22:09:03 | * | Snircle joined #nim |
22:17:38 | * | Sembei quit (Ping timeout: 240 seconds) |
22:32:23 | * | Vladar quit (Remote host closed the connection) |
22:34:55 | * | rauss quit (Quit: WeeChat 1.7) |
22:55:50 | * | zachcarter joined #nim |
23:13:14 | * | nsf quit (Quit: WeeChat 1.7) |
23:14:54 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:48:14 | * | PMunch quit (Quit: leaving) |
23:48:35 | FromGitter | <piotrklibert> Hi guys, I wrote a little TCL interpreter in Nim and submitted it to HN: https://news.ycombinator.com/item?id=13769334 (GitHub: https://github.com/piotrklibert/nimiTCL). I'd appreciate both any tips on making the code better and upvotes (but please be moderate in giving the latter as not to trigger HN's voting ring detection ;)). Thanks! |