<< 01-03-2017 >>

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:00zachcarteralright 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:38zachcarternow 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:06krux02zachcarter: that sounds pretty neat
01:17:09*yglukhov quit (Ping timeout: 240 seconds)
01:17:13krux02and like an API I would like to use
01:17:38zachcarterhere’s a sample :
01:17:45zachcarterhttps://gist.github.com/zacharycarter/0fd027b20efe2ffd23354fb89e5b0b79#file-nimian-nim-L4
01:18:10zachcarterit’s just me applying your suggestions to making the bindings more nimian
01:18:35zachcarterbut I could write some sensiible defaults for intialization etc
01:23:47zachcarterI wish I knew what half of these parameters represented, I could actually name them accordingly
01:23:52zachcartertoo bad nuklear has ZERO documentation
01:24:09zachcarterminus what’s inside the header which is already minimal
01:38:00krux02zachcarter: how is the buffer type defined
01:38:49zachcarterhttps://gist.github.com/zacharycarter/74ee314e588404a0215b677ce442cc4f
01:39:05krux02ok I found the definition
01:39:22zachcarterI’ll commit my latest changes to the branch
01:39:40krux02I can at least tell you what a memory pool is
01:40:00krux02and I guess the type is related to the memory pool
01:40:16zachcarteryeah
01:40:45zachcarterthat’s a bad example actually
01:40:49zachcarterit’s when you get into function prototypes like -
01:40:50krux02ok there are only two allocation types fixed and dynamic and that says basically nothing
01:41:29krux02no to be honest I don't know what the buffer is for
01:41:46zachcarterhttps://github.com/zacharycarter/nuklear-nim/blob/RemoveNKPrefixes/nuklear.nim#L1107
01:42:00krux02it looks like well written code, but the documentaion is poor, only understandable by the author
01:42:14zachcarteragreed
01:43:03krux02to be honest it looks better written than a lot of the stuff I have seen in the Nim compiler
01:43:58zachcarterwell I can always go back and reference Nuklear.h
01:44:12zachcartersome of the horribleness in the naming of the proc parameters may be due to c2nim
01:46:33krux02I am not sure if you should export everything form the header
01:46:53krux02currently the buffer looks to internal to be
01:47:45zachcarterthat may very well be the case
01:47:59zachcarteralthough I think the buffer has to be exported as the drawing backend it
01:48:48krux02it there an example on the buffer usage
01:48:52krux02or use case?
01:49:28zachcarteryup
01:49:29zachcarterone sec
01:49:53zachcarterhttps://github.com/vurtun/nuklear/blob/master/demo/sdl_opengl3/nuklear_sdl_gl3.h#L103
01:49:54krux02aah I found documentation about the buffer
01:50:41*BitPuffin|osx quit (Ping timeout: 260 seconds)
01:52:06krux02https://github.com/vurtun/nuklear/blob/master/nuklear.h#L1463
01:53:23zachcarternice okay I should definitely include this docu in the binidngs
01:53:33zachcarteror link to it at least
01:53:40zachcarterI 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:27zachcarterI have two different types defined -
02:59:44zachcarterplugin_filter = proc (a2: ptr text_edit; unicode: uint32): int32 {.cdecl.}
02:59:45zachcarter inputFilter* = proc(te: var text_edit, unicode: uint32): int32
03:00:18zachcarteris there a way to cast one into the other? or create a plugin_filter given an instance of an inputFilter?
03:02:08krux02well you can not cast a function pointer into a closure and vice versa
03:02:25krux02there are ways to work around this
03:02:55krux02but it depends on what you want to do
03:03:03zachcarterI want to call this method
03:03:08krux02or how it is used
03:03:13zachcarterproc edit_string(a2: ptr context; a3: uint32; buffer: cstring; len: ptr int32;
03:03:14zachcarter max: int32; a7: plugin_filter): uint32 {.importc: "nk_edit_string".}
03:03:17*ofelas quit (Remote host closed the connection)
03:03:33zachcarterit’s the last parameter of that function
03:03:36zachcarterplugin_filter
03:03:39*ofelas joined #nim
03:03:54zachcarterso I’m defining anoter proc
03:04:08krux02is the callback stored, or is it used only during the call edit_string?
03:04:09zachcarterproc editString*(ctx: var context, u: uint32, buffer: string, len: var int32, max: int32, f: inputFilter) =
03:04:33krux02that is important, because when it is used only during edit_string, you are luckey
03:04:36krux02lucky
03:05:26zachcarterlet me see how I’m using it currently
03:05:40zachcarterdiscard edit_string(fileBrowser.ctx, EDIT_FIELD.ord, addr fileBrowser.newFolderName[0], addr fileBrowser.newFolderNameLen, 64, nuklear.filter)
03:05:42zachcarter:)
03:05:46krux02then you can create a plugin_filter function that calls a nim closure
03:06:16zachcarterso they’ll call one of several defined plugin filters
03:06:21zachcarteror inputFilters now
03:06:35zachcartererr they’ll provide
03:06:37zachcarterto the proc
03:06:48zachcarterexposed by the API
03:07:14zachcarterproc filter_default(a2: ptr text_edit; unicode: uint32): int32 {.importc: "nk_filter_default", cdecl.}
03:07:14zachcarterproc filter*(te: var text_edit, unicode: uint32): int32 {.cdecl.} =
03:07:15zachcarter filter_default(addr te, unicode)
03:09:03zachcarterI guess I can remove that cdecl from filter
03:09:29krux02http://ix.io/nQW
03:09:58zachcarterthanks
03:10:31krux02that only works when there is only one active callback at a time
03:10:54zachcartergotcha - I think that should be the case
03:11:00krux02when there is something like addHook(callback) then it doesn't work that way
03:11:32zachcartergotcha
03:11:43krux02but that also allows you to enable real closures for the nim callback
03:12:14krux02so you make the interface instantly more usable
03:12:27zachcarteryeah this is sweet
03:14:32krux02Why did the partially bind man fell into the well?
03:14:42*yglukhov joined #nim
03:14:48krux02because he couldn't see that well
03:15:06zachcarterlol
03:17:07krux02ok, 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:05zachcarterstill not getting how to do what I need to do
03:56:23zachcarterahhh 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:38j75I am having trouble installing nimble from koch. I keep seeing Killed FAILURE at the end
06:25:50j75had 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:22FromGitter<Varriount> zachcarter: So what are today's challenges?
06:53:00FromGitter<Varriount> j25: If you're seeing "Killed", then it might be that the system is killing the compiler process.
07:00:29j75only 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:02FromGitter<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:32Araqno, by design the VM doesn't perform symbol lookups
09:33:47Araqthere are all sorts of workarounds though
09:36:41FromGitter<vegansk> @Araq, I have some identifier from AST and need to find the symbol for it. How can I do it?
09:39:33FromGitter<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:07Araqif 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:48FromGitter<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:31Araqwell 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:21FromGitter<vegansk> Thanks
09:46:33Araqif you produce nnkIdent instead of nnkSym then the compiler's lookup rules will be used
09:46:56Araqthat's what you should be doing, I think.
09:49:44*PMunch joined #nim
09:50:49FromGitter<vegansk> Ok
10:08:22*PMunch quit (Quit: leaving)
10:11:56*PMunch joined #nim
10:14:14FromGitter<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:06rokupsAraq: symlink sin compiler repo - allowed or not?
10:21:09*chemist69_ is now known as chemist69
10:21:42Araqnot allowed.
10:21:53Araqno symlinks, I hate them.
10:22:24chemist69Hi, I am parsing a C++ header file with c2nim, just to see if I can get anywhere with this.
10:22:27chemist69The 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:48Araqdoes it really choke on that?
10:23:59Araqis that everything what the file contains?
10:24:07Araqdo you use c2nim --cpp ?
10:24:35chemist69yes I use --cpp and the error occurs on line 420 of the file
10:24:58Araqisolate it, my guess is it's something else
10:25:02*tankfeeder joined #nim
10:25:46chemist69when I comment out that line it parses another code line and then stops at this line: `std::string getSupplementalSmilesLabel(const Atom *atom);`
10:26:14chemist69ok, will try to narrow it down, thanks.
10:26:31couven92Araq, PMunch tells me you hate symlinks? why do you hate symlinks?
10:27:12Araqthey transform a nice tree structure into a graph
10:27:16FromGitter<vegansk> What's the difference between ``typed`` and ``untyped`` result of macro?
10:27:38Araqevery tool needs to be patched to do "the right thing" with symlinks
10:28:10Araqdoes copyDir copy the symlinks or the files they point to?
10:30:25Araqvegansk: there is no difference in theory, in practice the compiler might do something weird with 'typed'
10:31:17couven92Araq, 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:42Araqthere is none afaik
10:32:12couven92what about including the koch.nim.cfg? does that also happen anyways?
10:32:23Araqwhat?
10:32:40Araqyeah, it should.
10:32:45couven92ok
10:33:27PMunchAraq, 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:18cheatfaterokups, what do you think about custom memory manager for coroutines? with bitmap array as backend, to reuse obj+stack chunks?
10:52:07rokupssounds like possible performance gains
10:52:56cheatfateon initialize developer can specify count of coroutines and manager allocates such amount of memory
10:53:38*chemist69 joined #nim
10:53:46cheatfateif more memory needed one more big chunk will be created with new bitmap array
10:54:26cheatfatethis can cause zero-cost coroutine creation
10:56:36rokupssounds like a good idea indeed
11:00:20rokupscheatfate: fix for you https://github.com/nim-lang/Nim/pull/5463
11:01:11rokupsyou may try implementing these coroutine changes yourself. im not sure i want to tackle it right now
11:06:31cheatfaterokups, so you give me permission to `rape` your coroutines?
11:06:35couven92Araq, on the topic of symlinks... How do you feel about NTFS Junction links? :P
11:06:36cheatfate:)
11:07:13rokupsits not my baby, have a free reign just as MIT license says ;)
11:08:59rokupsanother 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:00cheatfaterokups, there will be some changes which will add `COROUTINE_BLOCK` state
11:22:15cheatfatein such way i want to mark coroutines which wait for IO
11:22:56cheatfateand scheduler will perform ioselectors.select() to resolve blocked coroutines
11:23:37cheatfatei'm still can't figure out how i can achieve this but i really need to call ioselectors.select() in some place
11:27:41cheatfateand 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:55PMunchHmm, anyone here using NimLime for Sublime?
12:22:00PMunchI'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:47rokupscheatfate: 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:08PMunchHmm, 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:09PMunchI'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:14PMunchThis just gives me random data
13:53:57FromGitter<Varriount> PMunch: Are you sure that the path environment variable loaded by sublime is the same?
13:55:33FromGitter<Varriount> Also, you can specify an exact path to your Nim executable in the settings file.
13:55:40PMunchIt appeared that it wasn't, for some strange reason.
13:55:45PMunchYeah, that's what I ended up doing
13:56:56FromGitter<Varriount> Ok, good. *goes back to sleep*
13:58:17PMunchHmm, 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:47FromGitter<andreaferretti> I remember not long ago an option was introduced to dump/inspect the content of memory
14:22:59FromGitter<andreaferretti> but I cannot find any reference anymore
14:23:04FromGitter<andreaferretti> does anyone know?
14:23:47*smt quit (Ping timeout: 255 seconds)
14:30:24*hjsagg joined #nim
14:33:15FromGitter<andreaferretti> I have found something in the latest commits regarding nimtracker
14:33:23FromGitter<andreaferretti> but I am not quite sure how to use it
14:34:35Araqit needs to be documented and cleaned up a bit
14:35:12FromGitter<andreaferretti> what would be a basic usage?
14:35:46Araqyou add watchpoints via the API and during the program run you get reports when this memory is written to
14:36:01Araqhelps to find memory corruptions
14:36:44Araqlldb/gdb watchpoints are restricted to 8 byte sized locations and so are often useless
14:36:58FromGitter<andreaferretti> ok, maybe this is not what I was thinking about
14:37:09FromGitter<andreaferretti> probably I had misunderstood the announcement
14:37:21Araqwell its purpose changed
14:37:34FromGitter<andreaferretti> is there anything to just dump a graph annotated with sizes or something like that?
14:37:41Araqoriginally it would track every memory write so that you could "go back in time"
14:37:51FromGitter<andreaferretti> I see
14:38:03Araqbut that's just too slow for anything
14:38:23FromGitter<andreaferretti> I would have guessed! :-D
14:38:38FromGitter<andreaferretti> yes, it is more interesting to restrict its usage
14:38:40AraqI thought sqlite can handle it :P
14:38:46FromGitter<andreaferretti> :-)
14:38:57Araqfor medium sized programs
14:39:05Araqbut nope, it's unusable
14:39:39demi-there is a mac app that can do that for you
14:40:04Araqyou can compile -d:nimTypeNames and then call dumpNumberOfInstances()
14:40:12demi-https://github.com/zorgiepoo/bit-slicer/ one of the features is memory watchpoints
14:40:28Araqnot a graph, but a useful list
14:40:36FromGitter<andreaferretti> ah great, so there was in fact somthing like that!
14:40:44FromGitter<andreaferretti> thank you! :-)
14:41:24yglukhovAraq: 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:12Araqyglukhov: -d:nimTypeNames and dumpNumberOfInstances() ?
14:43:21*rauss joined #nim
14:43:58Araqyou're the guy with the customized solution to detect leaks
14:44:08Araqso why do you ask me? ;-)
14:44:36yglukhovAraq: dumpNumberOfInstances not helping. the values before the leak and after the leak look pretty similar.
14:45:48yglukhovalso there are some bugs in dumpNumberOfInstances.
14:46:15yglukhovand even after my fixes i don't understand/trust it.
14:47:21yglukhovmy 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:54PMunchAraq, 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:47yglukhovAraq: 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:23Araqyglukhov: strange, I thought I patched growObj, are you sure it's wrong?
15:39:57AraqPMunch: wxString could be destructed already, I doubt c_str() keeps it alive
15:43:14yglukhovAraq: yep.
15:44:24PMunchHmm, how do I get the string then?
15:47:22*Sembei joined #nim
15:49:20yglukhovAraq: 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:46AraqPMunch: store it in a temp
15:57:01Araqyglukhov: yeah that code doesn't read like the latest version of my code
15:57:11Araqmaybe I lost it in a branch
15:57:39yglukhovAraq: 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:12yglukhovAraq: oh, please try to find it. hopefully it will help
15:58:40Araqyglukhov: what OS?
15:58:53Araqalso the difference can be explained by manual alloc0() calls
16:01:55*elrood joined #nim
16:03:22PMunchStore it in a temp?
16:08:16PMunchAaah "var str = e1.getValue(); str.c_str().asCString()" works
16:09:11yglukhovAraq: macos
16:13:07elroodguys, 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:57Araqelrood: Error: invalid pragma: used means you don't use 'nim devel' for the docgen
16:19:25elroodAraq, Version 0.16.1 (2017-03-01), git hash: 28a7c874b7cdba34544abb7691515d36fe8411c8
16:20:13elroodfreshly pulled and built, although i ran into that failure a few days ago already
16:20:32elroodwhat should i do differently, and why?
16:21:01PMunchOkay Araq, when doing changes to wxWidgets
16:21:15PMunchThe wrapper is auto-generated right
16:21:35PMunchBut it contains some bugs (for example the fonts stuff in my PR)
16:21:58PMunchSo how do you want changes to that?
16:25:33elroodAraq, oh, right, koch's been hooking up to an outdated binary with its automagic smartness
16:26:48PMunchOh Araq, by the way. What does {.experimental.} do?
16:29:13euantorHas anybody by any chance encountered any oddities with asyncnet's acceptAddr and IPv6 sockets?
16:29:33euantorI'm looking at NimForum, and as soon as I hit the registration page, it all falls over
16:30:03euantorThe `db_sqlite` module creates an invalid query: `delete from antibot where ip = '::1`
16:30:29yglukhovAraq: and linux as well.
16:30:32euantorAnd the length of the IP (which is `::1`) is apparently 46
16:31:25euantor(eg: len(s) returns 46 at this line: https://github.com/nim-lang/Nim/blob/master/lib/impure/db_sqlite.nim#L109)
16:33:13euantorIt 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:28yglukhoveuantor: Just today reverted asynchttpserver to not support ipv6 because it causes problems on windows. does it sound relevant?
16:36:33euantorI'm running this on Arch Linux, forgot to mention!
16:37:07elroodAraq, 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:24yglukhoveuantor: are you using asynchttpserver?
16:42:14euantorAlso, 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:28euantoryglukhov: Yes, NimForum runs on jester, which uses asynchttpserver
16:43:05yglukhoveuantor: try updating nim
16:43:32euantorI'll try that, though it's a fresh install from yesterday built from source
16:48:56yglukhoveuantor: exactly. a couple of days ago i made ipv6, today i reverted it
16:49:06euantorok, 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:37euantorOk, that didn't help unfortunately
16:54:51euantorStill getting the same error, but obviously my debug code in `db_sqlite` is gone
16:56:17euantorYep, 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:37dom96Strange. It does seem to definitely be related to yglukhov's patch.
17:00:03dom96or 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:36euantorIPv6 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:25PMunchIs there a template for safe file handling in Nim?
17:44:36PMunchBasically this: https://nim-lang.org/docs/tut2.html#exceptions-try-statement
17:57:49*hjsagg joined #nim
17:59:35dom96PMunch: what should this template do? Ignore the errors?
18:00:05PMunchHmm, you're right, that would be bad :P
18:00:51*Vladar quit (Remote host closed the connection)
18:02:43euantorNimForum works fine on my mac, so it looks like something related to Arch or the current version of Nim
18:02:54euantorI'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:21FromGitter<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:10stisaphilip-wernersbach : just made this https://github.com/stisa/websockets , it's basic but works
18:16:28*yglukhov joined #nim
18:33:44raussphilip-wernersbach: I tried to embed v8, ChakraCore, and SpiderMonkey. Had the most success with SpiderMonkey, as the others are convoluted C++ APIs
18:34:14raussBut I didn't really ever finish figuring it out. I tabled it for now
18:34:49raussErr, 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:26zachcarterhow can I cast a sequence to a cstringArray?
19:41:36zachcartercan I simply call cast[cstringArray](seq) ?
19:43:29Araqno, use allocCstringArray or something
19:43:52zachcarteralright 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:38FromGitter<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:44FromGitter<philip-wernersbach> @rauss How did that work out? I'm trying to compile Nim to JS though, but that's still interesting
20:44:51raussphilip-wernersbach: Oh haha yeah that's the opposite, so nvm
20:47:55stisaphilip-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:39stisaFor 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:17PMunchHmm, 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:00PMunchNever 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:35FromGitter<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!