<< 24-06-2016 >>

00:00:33dom96In case anybody missed it: http://nim-lang.org/news/2016_06_23_launching_the_2016_nim_community_survey.html
00:02:35*saml_ joined #nim
00:03:26vktecdef-: Thanks, but my regex uses a _lot_ of double quotes, so """ is easier. I'll use raw strings for my other regexes though
00:06:07vktecdef-: Also, does the `re"foo""bar"` rather than `re(r"foo""bar")` syntax work with nre?
00:14:24def-vktec: yes
00:14:35edub4rtI know that manually canceling futures is not supported yet, however if I close an async socket, will it cancel all IO futures related to the socket?
00:18:47dom96edub4rt: I don't think so. For example, if you've got a pending recv() you might get an empty string back.
00:22:05edub4rtdom96: I'm dealing with a case where the pending recv() never returns, even after I close the socket
00:22:16vktecdef-: Thanks
00:22:31*zodiak joined #nim
00:23:16edub4rtdom96: for the current implementation is this behavior correct or is something wrong?
00:24:57dom96edub4rt: good question, i'm not sure.
00:27:10dom96I think it's fair to assume that any pending socket operation should finish eventually with either an exception or a result.
00:28:45*GangstaCat quit (Quit: Leaving)
00:34:58edub4rtdom96: I've create a simple async UDP server, call an await recvFrom in an async routine, then closed the socket, the await never finished, waited more than 300 seconds, I'll investigate further
00:37:12*fredrik92 quit (Ping timeout: 276 seconds)
00:51:48*ddl_smurf quit (Quit: ddl_smurf)
01:09:18*ddl_smurf joined #nim
01:12:01*ddl_smurf quit (Remote host closed the connection)
01:15:40*FreezerburnV_ joined #nim
01:18:09*brson quit (Quit: leaving)
01:30:45*yglukhov joined #nim
01:33:35*abruanese quit (Ping timeout: 240 seconds)
01:33:45*FreezerburnV_ quit (Ping timeout: 246 seconds)
01:35:03*yglukhov quit (Ping timeout: 244 seconds)
01:43:09*FreezerburnV_ joined #nim
01:43:39*zds joined #nim
01:43:48*brson joined #nim
01:46:24*chemist69 quit (Ping timeout: 272 seconds)
01:52:41*FreezerburnV_ quit (Remote host closed the connection)
01:59:32*chemist69 joined #nim
02:00:05*fredrik92 joined #nim
02:00:06zdsIs there a way to echo the type of a value?
02:03:18kiertype(x) gives you a typedesc representing the type of the value x
02:03:36kieri think i've seen somewhere you can do type(x).name, can't see it in the docs though
02:06:15*fredrik92 quit (Ping timeout: 276 seconds)
02:10:09zdsI know about the typedescs, but I can't echo the damn things.
02:12:26zdsah - `name` comes from typetraits.
02:12:45zdsthen you can echo it.
02:18:14edub4rtdom96: I could not find the root cause of the problem, I've created issue #4405 regarding that, pending recv/accept futures don't fail after closing a socket
02:28:10*zodiak_ joined #nim
02:32:12*zodiak quit (Ping timeout: 260 seconds)
02:33:04*yglukhov joined #nim
02:33:24*brson quit (Quit: leaving)
02:37:11*yglukhov quit (Ping timeout: 240 seconds)
02:53:02*saml_ quit (Remote host closed the connection)
02:56:42*freezerburnV quit (Ping timeout: 260 seconds)
03:01:05*freezerburnV joined #nim
03:09:35*veganskaway is now known as vegansk
03:38:32*Demon_Fox quit (Ping timeout: 244 seconds)
03:43:11*Demon_Fox joined #nim
03:56:44*fvs quit (Quit: Leaving)
04:07:53*zodiak joined #nim
04:12:21*zodiak_ quit (Ping timeout: 276 seconds)
04:28:36*freezerburnV quit (Ping timeout: 276 seconds)
04:35:27*Demon_Fox quit (Quit: Leaving)
04:43:15*edub4rt quit (Remote host closed the connection)
05:33:30*zds quit (Quit: Connection closed for inactivity)
05:35:13*yglukhov joined #nim
05:38:56*vqrs_ quit (Ping timeout: 244 seconds)
05:39:27*yglukhov quit (Ping timeout: 244 seconds)
05:40:07*vqrs joined #nim
05:40:59*Varriount quit (Disconnected by services)
05:40:59*Varriount_ joined #nim
05:53:22*endragor joined #nim
06:19:00*endragor_ joined #nim
06:22:03*akamaus quit (Ping timeout: 264 seconds)
06:22:33*endragor quit (Ping timeout: 240 seconds)
06:38:45*arnetheduck joined #nim
06:49:57*endragor_ quit (Remote host closed the connection)
06:50:27*endragor joined #nim
06:50:32*endragor quit (Remote host closed the connection)
06:51:01*endragor joined #nim
06:51:04*endragor quit (Remote host closed the connection)
06:51:33*endragor joined #nim
07:01:31*endragor quit (Remote host closed the connection)
07:02:39*endragor joined #nim
07:06:19*zodiak_ joined #nim
07:09:33*zodiak quit (Ping timeout: 258 seconds)
07:12:30*endragor quit (Remote host closed the connection)
07:20:20*endragor joined #nim
07:20:44*arnetheduck quit (Ping timeout: 250 seconds)
07:22:07veganskAraq, hi! Can you look at this PR please: https://github.com/nim-lang/Nim/pull/4398.
07:29:25*yglukhov joined #nim
07:32:01*Trustable joined #nim
07:33:59*yglukhov quit (Ping timeout: 244 seconds)
07:34:15*arnetheduck joined #nim
07:35:29*PMunch joined #nim
07:45:16veganskAraq, thanks. Updated the comments. Also I have a question. Why compareTypes uses sameTypeAux and not typeRel? I think that's why it can't find matching in the issue 88
07:46:05*ldleworker is now known as ldlework
07:48:43*euantor joined #nim
07:48:44*euant joined #nim
07:52:25*brechtm joined #nim
07:58:04AraqtypeRel deals with type variables
07:58:10AraqcompareTypes doesn't.
08:01:04veganskAraq, so can I add custom logic for generics to compareTypes?
08:01:26veganskusing isGenericSubtype
08:01:50Araqwhy is that required? compareTypes should deal with concrete types
08:03:19veganskBecause now test from issue 88 fails with "Error: conversion from ref TGen[system.string] to Ty is invalid"
08:03:56Araqtype conversions already call typeRel
08:06:25*desophos quit (Read error: Connection reset by peer)
08:07:03veganskI can't find it in proc semConv(c: PContext, n: PNode): PNode :-( Ok, need to dig deeper. And what do you think about PR. Can it be merged?
08:11:09*bjz joined #nim
08:17:41AraqsemConv needs to call typeRel then, but don't touch compareTypes
08:19:00veganskOk!
08:21:37*bjz quit (Ping timeout: 260 seconds)
08:27:09*bjz joined #nim
08:38:11*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
08:46:40*bjz joined #nim
08:49:24*yglukhov joined #nim
08:54:41Araqvegansk: I will merge the PR tonight, ok? need to do some tests on my own
08:56:15veganskAraq, Ok! Thanks. Meanwhile I'll try to resolve the rest of issue 88 in another PR because it's another problem
09:02:45Araqnice.
09:05:42*bjz_ joined #nim
09:07:08*bjz quit (Ping timeout: 244 seconds)
09:20:11euantorAraq, I finally got round to making that PR with the modified strutils isNilorEMpty and strutils.isNilOrWhitespace methods. I also edited strutils.isSpace slightly, hopefully that's acceptable. I wasn't 100% sure on how you do tests in the stdlib, so I added a couple of asserts in strutils and some in tstrutil.nim. Hopefully that's correct
09:33:40*endragor quit (Remote host closed the connection)
09:33:52*endragor joined #nim
09:36:47*chemist69 quit (Ping timeout: 250 seconds)
09:37:08*chemist69 joined #nim
09:51:29*filcuc joined #nim
09:51:56*GangstaCat joined #nim
09:52:46chemist69Hi, I am still getting started with Nim (coming mainly from Python) and liking it more and more.
09:52:57chemist69I am using it only on Linux, but want to write some programs that slso my Windows-using colleagues should be able to run. So I used the cross-compilation example from def- in his excellent blog post on Writing a 2D Platform Game in Nim to compile one of my scripts on Linux for Windows and it worked flawlessly. I was even able to cross-compile the controllgallery libui example from Araq. I am duely impressed and
09:52:59chemist69just wanted to share my excitement.
09:53:16dom96chemist69: awesome :D
09:54:22cheatfatedom96, i think https://github.com/nim-lang/Nim/issues/4405 this will be hard bug...
10:00:58chemist69dom96: yes, I am really impressed. It looks like Nim is really one of nicest options for cross-platform devlopment. I love Python, but using it would mean to install the interpreter on every machine where a script should be run, and this is often difficult (for us, it at least requires a call to IT). I even looked into Kotlin, which is a nicer alternative to Java and the JVM is installed on all Windows machines
10:01:00chemist69here, but I really would rather avoid using it (The syntax is quite nice, though and very Swift-like).
10:01:48PMunchchemist69, that's great! Another great thing is that if you even have something you want to package to a source-based distro you can compile to C so your package won't even depend on Nim :)
10:02:19chemist69Yes, that's true!
10:02:51dom96cheatfate: indeed.
10:03:15dom96chemist69: That's precisely why I stopped using Python and started using Nim in the first place :)
10:03:37dom96236 responses for the Nim community survey so far!
10:03:44chemist69dom96: I am starting to understand... :-)
10:03:49PMunchchemist69, I wrote a Gtk program in Python once by accident (didn't really think it through) and when it came to deploy time I ended up creating a portable python install with a portable Gtk install and drop my script in a folder.. The program was a couple kilobytes, the end-product was a couple megabytes because of all the portable dependencies..
10:03:52dom96For anyone that missed it: http://nim-lang.org/news/2016_06_23_launching_the_2016_nim_community_survey.html
10:04:02PMunchdom96, oh nice!
10:04:17PMunchIt seems like Nim has gained some interest lately
10:04:47PMunchMy post on TinyWM got ~1500 page visits after I posted it on r/programming
10:05:53chemist69PMunch: Yeah, this is another thing. For Python cross-platform GUI apps, I have used Tk so far, because it is the easiest option on Windows, but man, it is ugly on Linux (even with the new Ttk).
10:06:41PMunchGtk is actually pretty nice cross platform, but it does require the end user to install Gtj
10:06:44PMunchGtk*
10:07:38PMunchWhich isn't a problem in the Linux world (package managers for the win) but on Windows this means that you need to bundle an installer or write a script that goes and downloads the latest version requiring an internet connection..
10:07:45chemist69Therefore I really see the potential in libui. It looks native on every platform, because it Is native.
10:08:00veganskchemist69. Did you try IUP. It's nice, small, crossplatform and native. See: https://github.com/vegansk/nimtests/blob/master/stdlib/iup/tutorial/ex3_4.nim
10:09:09chemist69vegansk: no, but I definitely will have a look. Thanks.
10:09:18PMunchOh wow, didn't know of libui. It looks great!
10:09:52chemist69PMunch: and Araq already wrote a Nim wrapper!
10:10:06PMunchYeah I saw it listed in the wrapper section :)
10:10:20PMunchvegansk, what's the benefit of iup?
10:11:42veganskPMunch. Native controls, small - 900Kb overhead on windows.
10:12:08veganskWhere is libui wrapper?
10:12:11PMunchGot this on reddit: "As an aside: any idea on how Nim metaprogramming features fare when compared against D lang?" Anyone has anything to pitch in or a good article?
10:12:46chemist69vegansk: https://github.com/nim-lang/ui
10:13:00PMunchhttps://github.com/nim-lang/ui
10:13:30chemist69I was faster, yes! ((fistpump))
10:13:46*arnetheduck quit (Ping timeout: 252 seconds)
10:13:56PMunchDamn it!
10:14:00veganskPMunch. Look at the benefits of Nim metaprogramming for java connection :-) https://github.com/vegansk/jbridge/blob/master/src/javaapi/containers.nim. and https://github.com/vegansk/jbridge/blob/master/tests/test_javaapi_containers.nim#L11-L25
10:14:11veganskThanks
10:14:41*brechtm__ joined #nim
10:15:25PMunchvegansk, what kind of sorcery is that!
10:15:26dom96PMunch: Awesome to see two Nim-related submissions on r/programming at the same time :D
10:16:15PMunchAnd so far up as well :)
10:16:23veganskPMunch, very dark magic :-) I wish i saw something like that in D
10:16:54*brechtm quit (Ping timeout: 260 seconds)
10:17:04PMunchvegansk, but how does it work? Does it run a JVM and interface with it?
10:17:24*arnetheduck joined #nim
10:17:29veganskPMunch, it uses JNI to connect to JVM
10:18:13veganskHere is the low level: https://github.com/vegansk/jbridge/blob/master/tests/test_jni_api.nim
10:19:20veganskBtw, don't use it until Araq merges https://github.com/nim-lang/Nim/pull/4398
10:23:21veganskdom96, how many peoples already participated in survey? :-)
10:23:38dom96242
10:23:45dom96Trying to submit to HN again
10:24:02dom96*hint hint* :P
10:24:44*vegansk is now known as veganskaway
10:29:32*fredrik92 joined #nim
10:32:55*arnetheduck quit (Ping timeout: 244 seconds)
10:39:56*coffeepot joined #nim
10:55:31*euant quit (Ping timeout: 240 seconds)
10:55:31*euantor quit (Ping timeout: 240 seconds)
10:56:40*Senketsu quit (Remote host closed the connection)
11:05:42*euantor joined #nim
11:05:43*euant joined #nim
11:26:33*zama quit (Ping timeout: 276 seconds)
11:27:21*zama joined #nim
11:30:02*yglukhov_ joined #nim
11:31:05*ephja joined #nim
11:32:15*yglukhov quit (Ping timeout: 264 seconds)
11:33:50*yglukhov_ quit (Remote host closed the connection)
11:34:26*yglukhov joined #nim
11:46:18*xet7 quit (Quit: Leaving)
12:01:22*GangstaCat quit (Quit: Leaving)
12:19:49*elrood joined #nim
13:06:58*brechtm__ quit (Read error: Connection reset by peer)
13:07:04*brechtm joined #nim
13:11:21dom96Araq: Ever heard of this? https://docs.google.com/document/d/1gCsFxXamW8RRvOe5hECz98Ftk-tcRRJcDFANj2VwCB0/edit
13:18:52*couven92 joined #nim
13:23:33*fredrik92 quit (Ping timeout: 276 seconds)
13:24:39*PMunch quit (Remote host closed the connection)
13:30:55*nsf quit (Quit: WeeChat 1.5)
13:31:11*nsf joined #nim
13:46:02*BitPuffin joined #nim
13:46:31Sembeidom96: still no solution for this? https://github.com/nim-lang/nimble/issues/203
13:47:32dom96Sembei: sorry, will reopen the issue
13:47:53Sembeiok
13:48:09dom96Sembei: I suggest you try to work around it by not installing Nim via brew
13:48:31Sembeigit cloning and so?
13:48:35dom96yes
13:49:23Sembeior maybe homebrew team can fix it?
13:57:41dom96Sembei: I don't think so
14:00:07*edub4rt joined #nim
14:00:59*PMunch joined #nim
14:01:25edub4rtcheatfate: I commented on issue #4405 an example with recvFromInto
14:02:53edub4rtI am currently stuck with the problem on that issue, I need some kind of workaround, I could not find any yet
14:04:01*Varriount joined #nim
14:04:51euantor@Sembei I somehow managed to get Nim + Nimble installed on my mac using Homebrew. It was a while back though (pre-0.13.0 if I remember correctly)
14:05:51*Varriount_ quit (Ping timeout: 264 seconds)
14:06:31Sembeieuantor: if you remember how or if you can with current version let me know it
14:06:55euantorI'll try installing it on my other mac tonight and write up some details
14:07:05Sembeiok tyvm
14:11:03dom96edub4rt: I gave a possible solution in the comments, don't have time right now to attempt it sorry.
14:16:42edub4rtdom96: okay, thanks I will try to implement it
14:24:17*euant quit (Quit: Leaving)
14:24:17*euantor quit (Quit: Leaving)
14:34:11*nsf quit (Quit: WeeChat 1.5)
14:43:30*couven92 quit (Ping timeout: 276 seconds)
14:46:09*endragor quit (Ping timeout: 246 seconds)
14:47:30*abruanese joined #nim
14:48:49*Olixir joined #nim
14:56:36OlixirHi guys! What does Nim have for parallelism computing?
14:57:47PMunchThreads!
14:58:39*euantor joined #nim
14:59:48PMunchhookrace.net/blog/writing-an-async-logger-in-nim/#adding-a-thread
14:59:54PMunchOlixir ^
15:00:02PMunchThere's some example threading in Nim for you
15:00:51*Olixir left #nim (#nim)
15:10:46cheatfateedub4rt, check github...
15:10:51cheatfatei have found your problem
15:12:25cheatfatebut this is mostly selectors.nim problem not yours
15:12:43*J3RN left #nim ("WeeChat 1.5")
15:14:34PMunchHmm, it says in the docs that channels are slow. How slow are they?
15:22:04*Demon_Fox joined #nim
15:29:27*PMunch quit (Quit: leaving)
15:30:09*i9B joined #nim
15:35:07*GangstaCat joined #nim
15:35:11edub4rtcheatfate: regarding that issue did you get the message "got exception" or "received"?
15:35:46edub4rton windows
15:40:59cheatfateError: unhandled exception: No handles or timers registered in dispatcher. [ValueError]
15:43:29euantorRegarding my earlier comment about Nim/Nimble on Homebrew, it's also now broken for me when installing
15:43:39euantorMy already installed version works, a fresh install does not
15:44:47euantorThough making a symbolic link works
15:49:31euantorsudo ln -s /usr/local/Cellar/nim/0.14.2/nim/lib /usr/local/lib/nim
15:49:46*tautologico joined #nim
15:59:05*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
16:11:22cheatfatedom96, you need to clear "High Priority" for https://github.com/nim-lang/Nim/issues/4405
16:12:10cheatfatebecause with current limits of asyncdispatch.nim for supplied sources, it works as expected...
16:19:08*heretobang joined #nim
16:19:59*yglukhov_ joined #nim
16:20:04*michael_campbell joined #nim
16:23:14*yglukhov quit (Ping timeout: 260 seconds)
16:24:28*yglukhov_ quit (Ping timeout: 264 seconds)
16:24:44*sp33der89 joined #nim
16:28:42*pregressive joined #nim
16:30:43*filcuc quit (Read error: Connection reset by peer)
16:31:58*michael_campbell quit (Quit: michael_campbell)
16:32:15*elrood quit (Quit: Leaving)
16:34:59*brson joined #nim
16:41:09*BitPuffin quit (Ping timeout: 276 seconds)
16:43:04*BitPuffin joined #nim
16:45:37*xet7 joined #nim
17:00:34*brechtm quit (Read error: Connection reset by peer)
17:01:01*brechtm joined #nim
17:03:45*euantor quit (Remote host closed the connection)
17:05:23*yglukhov joined #nim
17:06:34*michael_campbell joined #nim
17:10:14*ephja quit (Quit: WeeChat 1.5)
17:11:09*euantor joined #nim
17:17:44*nsf joined #nim
17:29:57*BitPuffin quit (Ping timeout: 260 seconds)
17:35:17*euantor quit (Remote host closed the connection)
17:40:55*michael_campbell quit (Remote host closed the connection)
17:42:22*michael_campbell joined #nim
17:44:51*BitPuffin joined #nim
17:48:18*EastByte quit (Quit: WeeChat 1.5)
17:50:03*EastByte joined #nim
17:51:25*TheLemonMan joined #nim
17:52:09*mostworst joined #nim
17:53:28*sp33der89 left #nim (#nim)
17:54:55*EastByte_ joined #nim
17:54:55*EastByte quit (Read error: Connection reset by peer)
17:57:04*euantor joined #nim
18:09:31*mostworst quit (Ping timeout: 240 seconds)
18:13:20*brson quit (Quit: leaving)
18:13:33*brson joined #nim
18:19:48Sembeieuantor: that worked for me as well
18:20:59euantorIt's a little bit hacky, but it works
18:22:38*Senketsu joined #nim
18:28:42*mostworst joined #nim
18:30:24*yglukhov quit (Remote host closed the connection)
18:41:55*BitPuffin quit (Remote host closed the connection)
18:57:54*euantor quit ()
19:03:09*mostworst quit (Ping timeout: 250 seconds)
19:09:14*miere joined #nim
19:10:28mieresup, people, quick question: is stuff like this valid in Nim?
19:10:30miereseq[tuple[genre: string, match: range[1..100]]]
19:14:34*michael_campbell quit (Quit: My Mac has gone to sleep. ZZZzzz…)
19:19:00Araqmiere: why wouldn't it?
19:20:05mieregetting weird error when trying to add tuple to sequence
19:21:16miereAraq: about type mismatch
19:21:38Araqpass the seq by 'var'
19:24:00miereAraq: please take a look: https://gist.github.com/miere43/70a785331130224bf57516ff400f3f77
19:25:16mierefor some reason value of '50' is not in range of 1..100
19:25:58*gmpreussner quit (Ping timeout: 252 seconds)
19:26:48*gmpreussner joined #nim
19:28:22miereAraq: works if manually cast to range[1..100] --- result.add((genre: "abcd", match: cast[range[1..100]](50)))
19:28:50Araqoh yeah, the type conversion relation doesn't list to tuples in general
19:29:08Araqbtw use a type conversion, not a cast
19:29:19mierehow? ._.
19:29:33miererange[1..100](50) ?
19:31:46*michael_campbell joined #nim
19:33:09michael_campbellHave you tried it and it failed, or haven't tried it?
19:34:12mieremichael_campbell: failed
19:34:36michael_campbell=\ Seems like it should be valid. I assume the tuple by itself is ok?
19:35:00mieregetting invalid indentation error, lol
19:35:23michael_campbellin that one line?
19:35:32miereoh no, everything works, thats just me being stupid
19:35:41miereforget about some bracket
19:35:44miereforgot*
19:36:10michael_campbellI love, and hate, those types of errors.
19:46:30*yglukhov joined #nim
19:54:28*michael_campbell quit (Quit: My Mac has gone to sleep. ZZZzzz…)
19:58:10*michael_campbell joined #nim
19:59:11*mostworst joined #nim
20:03:22*heretobang quit (Ping timeout: 250 seconds)
20:14:27*gmpreussner quit (Read error: Connection reset by peer)
20:17:20*gmpreussner joined #nim
20:21:06*brson quit (Read error: Connection reset by peer)
20:21:40*brson joined #nim
20:34:52*couven92 joined #nim
20:50:34*PMunch joined #nim
21:03:50*euantor joined #nim
21:04:08*enquora joined #nim
21:08:55*brson quit (Read error: Connection reset by peer)
21:14:24*brson joined #nim
21:16:34*euantor quit (Remote host closed the connection)
21:30:13*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
21:31:39*mostworst quit (Ping timeout: 264 seconds)
21:31:45*disconnected joined #nim
21:31:51disconnectedhello, does nimdoc support html entities somehow?
21:40:38*freevryheid joined #nim
21:41:45freevryheidtgif
21:41:47*saml quit (Quit: Leaving)
21:41:55*freevryheid is now known as fvs
21:45:32cheatfateAraq, hi, how about my brand new ioselectors.nim pr?
21:47:42*couven92 is now known as fredrik92
21:55:57*yglukhov quit (Read error: Connection reset by peer)
21:56:29*yglukhov joined #nim
21:56:33*regtools joined #nim
22:01:16dom96disconnected: possibly, try `.. html::` then put the HTML below indented by two spaces.
22:11:03*miere quit (Read error: Connection reset by peer)
22:17:38*akamaus joined #nim
22:17:53*akaisora joined #nim
22:25:39*benwbooth joined #nim
22:28:51*benwbooth quit (Client Quit)
22:42:11*enquora quit (Quit: enquora)
22:44:54*codye joined #nim
22:52:07*lucus16 joined #nim
22:53:11*lucus16 quit (Client Quit)
22:58:13*namnguyen quit (Remote host closed the connection)
22:59:40*brson quit (Read error: Connection reset by peer)
23:03:45*brson joined #nim
23:06:14PMunchHmm, I've got a *char which I've passed to a c function to get something back. How can I print the contents knowing the length?
23:19:28*Demos joined #nim
23:24:47AraqPMunch: good question, I don't think it gets simpler than:
23:24:56Araqvar x = newString(len)
23:25:15AraqcopyMem(addr(x[0]), thecstring, len)
23:25:18Araqecho x
23:26:39PMunchHmm, that's fair
23:27:31AraqPRs welcome
23:27:53*pregressive quit (Remote host closed the connection)
23:28:47PMunchAraq, by the way. I have other kinds of data as well. Right now an array of clong
23:28:54PMunchI'm passing in a double pointer
23:29:24PMunchWhich points to unknown data. This data is defined by another field passed in as a pointer
23:29:38PMunchAlong with a length that's passed in as a pointer
23:30:11PMunchSo using the length, the type (inferred from the return of the argument), and the pointer to some kind of data. How would you access that?
23:30:40PMuncharrays can't be created on runtime, so they are ruled out
23:31:25PMunchI guess some pointer magic is possible by creating a seq and in a loop over the length do some pointer magic (how?) to access the fields and adding it to the seq
23:36:03PMunchHmm, I tried this:
23:36:15PMunchfor i in 0..<cast[int](len):
23:36:16PMunch echo cast[ptr int](cast[int](list.addr)+i*4)[]
23:36:27PMunchBut it seems to give me bogus data..
23:37:29PMunch(It's an array of c longs by the way, that's why I do i*4)
23:45:40Araqarrays are possible: ptr array[10_000_000, clong]
23:45:44*Trustable quit (Remote host closed the connection)
23:45:57Araqthat's what I use. you can also use .unchecked arrays but meh
23:48:51Demosit seems {.push cdecl.} does not work on procedural types
23:49:04Demosis {.callconv: cdecl.} still a thing?
23:50:00PMunchAraq, allocating room for 10,000,000 clong on the heap isn't a bad idea?
23:50:33Araqit's a pointer to an array
23:50:40Araqit doesn't allocate anything
23:50:53Araqthe array size is a lie to make the bounds checking shut up
23:51:03Araq.unchecked does something similar
23:51:27AraqDemos: that's actually a feature, push only affects routines
23:51:44Araq{.callconv: cdecl.} is indeed what should be used instead
23:52:20Demossqlite3ext.nim(47, 11) Error: invalid pragma: callconv: cdecl
23:57:36PMunchOooh
23:57:41PMunchThat makes sense :P