<< 28-03-2017 >>

00:02:19*rauss joined #nim
00:04:30*ftsf joined #nim
00:24:24*Nobabs27 quit (Quit: Leaving)
00:27:08*girvo joined #nim
00:27:10girvoHey all
00:27:24ftsfo/
00:36:40girvoI've got kind of a silly question: I've got a cstring (from a C callback) that for certain calls has a real string in it, but for other calls suddenly has a len of 1 and no longer acts as a string
00:36:50*brson joined #nim
00:37:01girvoI know exactly how many bytes I need to read: how do I read them out into another buffer?
00:37:31girvohttps://hastebin.com/asulojobiy.nim
00:37:37girvoThis is what I've been trying so far
00:37:58girvoI'm sort of trying to port this; https://hastebin.com/ebenomareb.c
00:57:58*shashlick quit (Ping timeout: 240 seconds)
00:58:33*shashlick joined #nim
01:14:15*yglukhov joined #nim
01:17:21girvoAh I see what I'm having issues with; null terminated strings from the C lib are causing me dramas on the Nim side
01:18:09ftsfchecking for nil?
01:18:18ftsfon the return value
01:18:29*yglukhov quit (Ping timeout: 240 seconds)
01:18:31girvoAh I see what I'm having issues with; null terminated strings from the C lib are causing me dramas on the Nim side
01:18:45girvoSo I -was- getting the data, "echo" was failing instead
01:18:49girvohttps://github.com/nim-lang/Nim/issues/1137
01:19:49ftsfahh
01:20:50*sz0 joined #nim
01:21:24girvoI wonder if I can just grab the cstring buf directly now...
01:21:55girvohttps://hastebin.com/wijotapumu.nim
01:21:59girvoThat's what I've ended up with
01:23:48girvoIs there a way I can make that a bit safer? Seems a bit... ick, heh.
01:24:33*Serenit0r joined #nim
01:25:29*huonw quit (Ping timeout: 240 seconds)
01:25:49*sz0 quit (Ping timeout: 240 seconds)
01:26:28*sz0 joined #nim
01:26:29*StarBrilliant quit (Ping timeout: 240 seconds)
01:26:37girvoHere's the whole context; Talking to the Docker daemon, via a Unix socket (that speaks HTTP) using the latest version of libcurl - https://hastebin.com/ufafomohoc.nim
01:26:49*Serenitor quit (Ping timeout: 240 seconds)
01:28:26*huonw joined #nim
01:32:18*StarBrilliant joined #nim
01:33:52*brson quit (Quit: leaving)
01:35:48*chemist69 quit (Disconnected by services)
01:35:53*chemist69_ joined #nim
01:54:30girvoWhat's the best way of gating features in a wrapper for a C library based on the version _for_ said C lib?
02:04:12FromGitter<Varriount> girvo: I don't follow
02:05:11FromGitter<Varriount> girvo: Also, if you're wrapping C structures, you're always going to get 'ick'
02:10:29def-pri-pubjust got done porting my Linux Game Jam entry from desktop to browser: https://16bpp.net/games/pucker-up-lgj-2017
02:13:59def-pri-pub(It's still made with Nim)
02:16:34FromGitter<Varriount> def-pri-pub: Neat!
02:17:05FromGitter<Varriount> My only gripe is the control scheme. I kept expecting 'qw' to control one ring, and 'op' to control the other
02:17:30def-pri-pubIt did orignally
02:17:40def-pri-pubIf it's frustrating people enough, I might change it back
02:18:10def-pri-pubyou're mind might eventually ease into it
02:18:46def-pri-pub(I've still got to make a bug fix or tw)
02:18:47*Serenit0r quit (Quit: Leaving)
02:18:48def-pri-pubtwo*
02:22:10girvoVarriount: Yeah I guess you're right, heh. I'm still trying to find nicer ways of presenting safer interfaces to unsafe C libs. Most wrappers seem to stop at the unsafe side
02:28:11FromGitter<Varriount> girvo: Well, that's generally because we don't have any tools for generating safe wrappers.
02:32:52girvoVarriount, of course! I more wonder what a safe (or safer) wrapper would even look like? The nim-csfml wrapper attempted to use ptr objects with destructors to automate some of it; I wonder if RAII-styled semantics would even make sense... /me continues musing
02:33:53FromGitter<Varriount> Generally, if you want to automatically generate safer behavior, you need to know more about how input/output is used, and/or sacrifice efficiency
02:40:56*BitPuffin|osx quit (Ping timeout: 246 seconds)
02:43:46*vendethiel joined #nim
02:47:41*vendethiel- quit (Ping timeout: 258 seconds)
03:02:53*girvo quit (Ping timeout: 260 seconds)
03:24:26*sz0 quit (Quit: Connection closed for inactivity)
03:47:32ldleworkftsf: when building nimsynth I get: pico.nim(215, 10) Error: type mismatch: got (cint) but expected 'uint8'
03:47:59ftsfhmm, i suspect that's in an SDL wrapper thing?
03:48:16ftsfi have some changes i need to PR for the SDL wrapper
03:49:00ldleworkno idea what pico.nim is
03:50:21ftsfit's a nim approximation of the pico8 api which backs on to SDL
03:50:51ldleworkftsf: do you just use "make" to build
03:50:51ftsfwhich is what i use for the UI and input
03:51:04ftsfyep
03:51:08ldlework:(
03:51:32ldleworkftsf: do you know how to use Docker?
03:51:42ftsfi've played with it a little at work
03:59:20*girvo joined #nim
04:03:29*girvo quit (Ping timeout: 240 seconds)
04:10:35*vendethiel- joined #nim
04:11:58*vendethiel quit (Ping timeout: 240 seconds)
04:16:29*def-pri-pub quit (Quit: leaving)
04:24:32ldleworkftsf: do you know what I need to compile it correctly?
04:42:26*vendethiel- quit (Remote host closed the connection)
04:42:36*vendethiel joined #nim
04:55:22ftsfhttps://gist.github.com/ftsf/a56d2f61daba02bf934e5ce445b8ebdc patch for SDL2 wrapper
05:00:29*girvo joined #nim
05:04:34*vendethiel- joined #nim
05:04:37*vendethiel quit (Ping timeout: 268 seconds)
05:05:09*girvo quit (Ping timeout: 260 seconds)
05:15:27zachcarterhrm, having some c - nim interop issues
05:15:40zachcarterfor some reason my UncheckedArrays are only being filled with the first element
05:33:38*girvo joined #nim
05:49:35*xet7 quit (Quit: Leaving)
05:50:15*girvo quit (Ping timeout: 268 seconds)
05:57:56*rokups joined #nim
06:00:13*gokr joined #nim
06:19:12*rauss quit (Quit: WeeChat 1.7)
06:32:23*chemist69_ quit (Quit: WeeChat 1.7)
06:33:11*chemist69 joined #nim
06:48:00*Sentreen quit (Read error: Connection reset by peer)
06:48:38*Sentreen joined #nim
06:50:31*nsf joined #nim
07:02:56*Vladar joined #nim
07:09:40*Tiberium joined #nim
07:12:49Tiberiumsorry, but my question again - how can I parse only one "div" with class "text" from the page (there's like 40 of them, but I need just one of them, random)
07:14:05ldleworkGet all of them and then randomly choose one
07:15:49Tiberiumldlework, yeah, I just thought there might me another way :)
07:15:50Tiberiumalso
07:16:29FromGitter<TiberiumPY> inside this "div" with class "text" I have html like ⏎ "text" ⏎ <br> ⏎ "more text" ⏎ <br> [https://gitter.im/nim-lang/Nim?at=58da0dcc8e4b63533d6ef907]
07:16:39FromGitter<TiberiumPY> how to convert all <br> to \n ?
07:16:44FromGitter<TiberiumPY> how to read them?
07:17:08*vendethiel- quit (Remote host closed the connection)
07:17:19*vendethiel joined #nim
07:17:31Araqyesterday I showed stdlib HTML modules
07:17:56Araqhave you seen it?
07:18:10FromGitter<TiberiumPY> what do you mean?
07:18:14FromGitter<TiberiumPY> I know there's htmlparser
07:18:16FromGitter<TiberiumPY> I use it
07:18:25Araqgood.
07:22:05FromGitter<TiberiumPY> ah, maybe I need iterate over div's children ?
07:22:06FromGitter<TiberiumPY> iterator items(n: XmlNode): XmlNode {..}
07:26:28zachcarterAraq: can you help me with a binding question?
07:26:46zachcarterc interop really
07:32:33zachcarternot sure how to handle pointers of pointers
07:32:36zachcarteror pointers to pointers I guess
07:33:30Araqptr ptr T
07:33:38zachcarterright
07:33:48zachcarterbut let’s say I have C code I’m binding to that has a struct with a member like
07:33:53zachcarter**foo
07:34:15zachcarterhere one sec I’ll throw up a gist to show what I”m struggling with
07:36:59zachcarterhttps://gist.github.com/zacharycarter/8626400320c87e91e64ff44babbdc58b
07:37:09zachcarternot a great example but it shows the C data type and the Nim equivalent
07:37:23zachcarterand my Q is at the buttom of the .nim file
07:37:58zachcarterthe pointer to pointer I guess is really pointing to an array of structs in memory
07:38:09zachcarternot quite sure how to get at them
07:38:51Araqptr array[10_000, ptr spPathConstraintData]
07:39:15zachcarterthank you
07:39:20Araqthe 10_000 is arbitrary, you can also use an unchecked array
07:39:24zachcartergotcha
07:39:36Araqbut I wouldn't use unchecked arrays.
07:39:43zachcarterokay
07:40:13FromGitter<brechtm> I run into segmentation faults now and then when I access a nil-object. Is there by any chance a compiler flag that points me to the source code line where this happens?
07:41:10Araqdon't you get a stack trace?
07:41:35FromGitter<brechtm> Don't think so. Let me double-check.
07:42:15FromGitter<brechtm> Nope
07:42:27FromGitter<vegansk> @Araq, if the owner thread of the ForeignCell is died, will ``dispose`` lead to crash?
07:42:52FromGitter<brechtm> Araq: only this: "SIGSEGV: Illegal storage access. (Attempt to read from nil?)" and "Error: execution of an external program failed: ..."
07:43:06FromGitter<brechtm> @Araq: unless VSCode is not displaying stderr or so
07:43:21FromGitter<brechtm> Nope, same when running from the terminal.
07:43:52Araqyou should get a stack trace. don't use -d:release.
07:44:16Araqvegansk: yup.
07:45:13Araqand now moreso than ever because we changed thread memory management
07:46:36FromGitter<vegansk> @Araq, that's why I can't implement the scalaz version of Actors in Nim in efficient manner :-( What do you think about the transferring of the ownership to another thread? Is it possible?
07:46:40FromGitter<brechtm> Aha. The nakefile I'm using has "--stackTrace:off" ...
07:47:53AraqI'm not sure I understand why 'nake' is as popular as it is :-)
07:48:38AraqI always thought nimscript will make it obsolete. I guess nim's VM just doesn't support enough features yet
07:49:46Tiberiumhow to convert all values in sequence to int?
07:50:50Araqsequtils.mapIt
07:52:34Tiberiumthis doesn't work https://gist.github.com/TiberiumN/ed7ec1337df1c769e79a375ba2b06ed2
07:52:47Tiberiumit says :type mismatch: got (string) but expected 'int'"
07:53:38*yglukhov joined #nim
07:53:49Tiberiumah
07:53:50Tiberiumnvm
07:53:53TiberiumAGAIN MY BAD
07:54:01Tiberiumoh my god, I forgot that I need to use parseInt
07:54:03Tiberiumjesus
07:54:47Araqno worries
07:56:20*bjz joined #nim
07:56:39*bjz quit (Client Quit)
07:58:09Tiberiumhow can I get random number if I have start and end of the range?
08:03:21ldleworkyou can probably figure this one out
08:04:05cheatfaterandomnumber = (`start` + someRandomNumberGeneratorFunctionWhichReturnsIntegerValue() mod (`end` - `start`))
08:04:18Tiberiumcheatfate, many thanks
08:05:33FromGitter<andreaferretti> @cheatfate not quite
08:05:46FromGitter<andreaferretti> depending on the modulus you may obtain a non uniform distribution
08:06:08*couven92 joined #nim
08:06:34FromGitter<andreaferretti> more like `start + random(max=end - start - 1)`
08:07:04FromGitter<andreaferretti> assuming `random` returns values uniformly between 0 and max includded
08:07:28Araqstdlib's random module supports range out of box for this reason
08:07:34Araqand gets the distribution right.
08:08:46cheatfateandreaferretti: hardware/os RNGs returns sequence of bytes... not integers and don't care about distribution... so everything with `max` is handled via `and` or `mod` operation
08:10:22FromGitter<andreaferretti> I know
08:10:41FromGitter<andreaferretti> still, one does not just blidly do `randomValue mod x`
08:10:52FromGitter<andreaferretti> it will not be uniform in general
08:11:20FromGitter<andreaferretti> say you function returns a random `int` distributed uniformly
08:11:29FromGitter<andreaferretti> and `end-start = 7`
08:11:41cheatfateandrea please stop
08:11:46FromGitter<andreaferretti> since the number of ints is not divisible by 7, you will introduce a bias
08:11:54FromGitter<andreaferretti> uh, why?
08:12:07FromGitter<andreaferretti> did I say something offensive?
08:12:20cheatfatelets start from the beginning, for example you got sequence of bytes [n1, n2, n3, n4, n5, n6, n7, n8]
08:12:30FromGitter<andreaferretti> yup
08:12:56FromGitter<andreaferretti> just use one byte and cast it to an int in the range [0,255]
08:13:00cheatfatehow you make function random(max)
08:13:20FromGitter<andreaferretti> you do rejection sampling for instance
08:13:44cheatfatefor example i need max = 16
08:13:45FromGitter<andreaferretti> let me make a simple example where you have only on byte, which you convert to `uint8`
08:13:57FromGitter<andreaferretti> with max=16, everything you said works right
08:14:05FromGitter<andreaferretti> with max=13 it will not
08:14:43FromGitter<andreaferretti> there are more integers = 0 mod 13 in the range [0..255] then = 12 mod 13
08:14:59cheatfatehow so? because some bits of randomness will be lost?
08:14:59*bjz joined #nim
08:15:17FromGitter<andreaferretti> no, it's much simpler than that
08:15:21FromGitter<andreaferretti> forget randomness
08:15:33FromGitter<andreaferretti> say you have a random number between 0 and 7 inclusive
08:15:39FromGitter<andreaferretti> and you do it mod 3
08:15:55FromGitter<andreaferretti> you have three cases (0, 3, 6) where you get 0
08:15:59Araqhttp://stackoverflow.com/questions/10984974/why-do-people-say-there-is-modulo-bias-when-using-a-random-number-generator
08:16:06FromGitter<andreaferretti> three cases (1, 4, 7) where you get 1
08:16:16FromGitter<andreaferretti> and only two cases (2, 5) where you get 2
08:16:29FromGitter<andreaferretti> because 8 is not divisible by 3
08:17:28FromGitter<andreaferretti> in this case, you would have to reject the values 6 and 7 to restore uniformity
08:19:14cheatfateok thanks for explanation
08:19:47*zachcarter_ joined #nim
08:22:28*zachcarter quit (Ping timeout: 240 seconds)
08:22:28*zachcarter_ is now known as zachcarter
08:29:19Tiberiumhmm, how to get element by key from openarray[tuple[key: string, value: string]] ?
08:29:35Tiberiumloop?
08:29:40def-Tiberium: yeah
08:30:10cheatfateTiberium, are you trolling us?
08:30:14Tiberiumcheatfate, no?
08:30:22def-Tiberium: if you want to efficiently get value by key you should use a Table[key, value]
08:30:44Tiberiumdef-, I know, but with table I need to put .toTable() everywhere in my code
08:31:12cheatfateTiberium, i'm sorry, but you are asking question on every simple step in your code
08:31:26Tiberiumcheatfate, not every :)
08:36:51ldleworkhi def-
08:41:30def-hi ldlework
08:41:43ldleworkdef-: how are you?
08:42:47FromGitter<konqoro> Hey what is more efficient: discard list.pop() or list.delete(^1) ?
08:45:47def-ldlework: fine, you?
08:46:28def-konqoro: I'd assume pop to be faster, but probably very similar
08:46:38def-reading the implementations might help
08:46:53ldleworkdef-: I'm OK. Have you seen NimSynth?
08:47:01ldleworkKinda obsessed with it right now
08:47:09def-nope
08:47:46ldleworkdef-: https://www.youtube.com/watch?v=sDop4JELAhc
08:52:21Tiberiumldlework, wow
08:54:22ldleworkTiberium: that was my reaction :)
09:01:40*vivus joined #nim
09:05:53*Matthias247 joined #nim
09:29:07*Tiberium quit (Read error: Connection reset by peer)
09:29:22*Tiberium joined #nim
09:30:09*vlad1777d joined #nim
09:36:30*Arrrr joined #nim
09:36:30*Arrrr quit (Changing host)
09:36:30*Arrrr joined #nim
09:38:55*Andris_zbx joined #nim
09:40:13Tiberiumcan I implement something like 3 requests/sec limit for httpclient via queues module?
09:41:24ldleworkI dunno, can you?
09:41:44Tiberiumldlework, I mean is this module suitable for my task?
09:41:52Tiberiummaybe there's another choice
09:45:05zachcarterI kind of have spine integration working with frag : http://imgur.com/a/2cjOM
09:48:06Tiberiumwhy this doesnt work? https://gist.github.com/TiberiumN/28f0183257825e97222cd1dccf4fc9fb someone said I can reference types from each other in types section
09:48:10FromGitter<brechtm> @zachcarter You seem to be into CG. What would be the CG term for the projectiles in this video: https://youtu.be/2v2Jm9NQ_Yc?t=22? How are they rendered, you think?
09:48:26Tiberiumah
09:48:27Tiberiumnvm
09:48:32TiberiumI don't need VkApi in ApiRequest
09:49:03zachcarteryou could do it a number of ways brechtm
09:49:24FromGitter<brechtm> I was thinking of particles, but I don't think that's correct...
09:49:43zachcartershaders
09:50:13zachcarteralthough you can get pretty far just rendering textures with multiple passes and blurring
09:50:20FromGitter<vegansk> @Tiberium, if you use async, you can try something like ``(req1 and req2 and req3) or sleepAsync(1000)``
09:50:35Tiberiumok, time to make my app async :)
09:50:42Tiberiumif it would be easier to limit requests then
09:51:07TiberiumI use one thread and httpclient, so i think it would be *easy* to make my app async
09:51:52FromGitter<brechtm> @zachcarter ok, thanks
09:51:58zachcarternp
09:52:05zachcarterif your’e looking for ideas
09:52:25zachcarterI’d just google 2d laser beam effect shaders textures blur and glow
09:52:30zachcarterall good keywords to search for that kind of effect
09:52:45zachcarterbloom too
09:53:02FromGitter<vegansk> But if you use sync API, what's the problem? Measure the time between requests, then pause the thread if needed
09:54:33TiberiumI wanted to use async in future anyway
09:54:42Tiberiumbecause I have a command bot for social network
09:54:51Tiberiumso with one thread and sync plugins can block whole bot
09:58:35Tiberiumoh wait
09:58:59TiberiumI can't use async with procs like "proc startBot(bot: var VkBot) {.async.}" ?
10:00:59Tiberiumit says "illegal capture bot"
10:02:43Tiberiumif I try to modify/read bot values
10:04:12euantorYou can't use var parameters with async
10:04:16euantorUse a ref object instead
10:04:34euantorso make `type VkBot = ref object`
10:04:47*dyce[m] quit (Remote host closed the connection)
10:04:47*MrAxilus[m] quit (Read error: Connection reset by peer)
10:04:48*jivank[m] quit (Read error: Connection reset by peer)
10:04:49*hohlerde quit (Read error: Connection reset by peer)
10:04:49*ehmry[m] quit (Remote host closed the connection)
10:04:49*M-Quora quit (Read error: Connection reset by peer)
10:04:49*stisa quit (Read error: Connection reset by peer)
10:04:49*Guest73656[m] quit (Read error: Connection reset by peer)
10:04:50*Jipok[m] quit (Remote host closed the connection)
10:04:50*TheManiac quit (Remote host closed the connection)
10:04:51Tiberiumwpw
10:04:56Tiberiumwtf
10:05:04Tiberiumeuantor, thanks
10:09:36*dyce[m] joined #nim
10:09:42zachcarterhttp://imgur.com/a/Gt9Ee
10:09:46zachcarternot sure why the drawing is screwed up
10:09:50zachcarterbut at least animation is working well
10:16:11FromGitter<vegansk> Created first version of scalaz like actors in Nim: https://github.com/vegansk/nimfp/blob/master/tests/fp/test_concurrent.nim
10:17:27Tiberiumeuantor, what about KeyVal* = ref openarray[tuple[key: string, val: string]] ? I want to use it as parameter in async proc (and I want this parameter to have default value)
10:17:48Tiberiumsomething like "proc callMethod*(api: VkApi, methodName: string, params: KeyVal = [], token: string = "", flood: bool = false): Future[JsonNode] {.async.}" doesn't work
10:18:00FromGitter<vegansk> The main feature of this actors library is that messages can be handled synchronously, asynchronously via asyncdispatch, or in another threads using spawn. But if you want, you can create your own strategy :smile:
10:18:12euantorProbably better as a seq than an openarray
10:18:22Tiberiumah
10:18:23Tiberiumok
10:20:35Tiberiumeuantor, I used openarray because I can create something like "let data = {"message": body, "peer_id": $msg.peerId}" and then pass this to callmethod
10:21:08euantorYou can do something simialr with seq:
10:21:40euantor`let data = @[("message", body"), ("peer_id", $msg.peerid)]`
10:22:03euantor`proc callMethod*(api: VkApi, methodName: string, params: KeyVal = @[], token: string = "", flood: bool = false): Future[JsonNode] {.async.}`
10:22:11Tiberiumeuantor, yeah, I figured this out myself :)
10:22:12Tiberiumthanks!
10:22:13euantorSomething like that should work IIRC
10:22:34Tiberiumit works
10:22:40euantorBut if it's a key/value pair, it's probably best to look at using a string table: https://nim-lang.org/docs/strtabs.html
10:23:17euantorThough the documentation could do with some examples there...
10:24:04Tiberiumeuantor, I see :)
10:24:44Tiberiumah
10:24:51Tiberiumnim tests helps
10:29:43ArrrrSeems like cyclic detection is stricter now
10:30:11Tiberiumeuantor, what I need to do if I need to parse html in async proc?
10:30:17Tiberiumvia htmlparser
10:31:55Tiberiumfor now it fails "Error: 'cb' is not GC-safe as it accesses 'nameIterVar' which is a global using GC'ed memory"
10:32:20*arnetheduck joined #nim
10:33:12*MrAxilus[m] joined #nim
10:33:15*M-Quora joined #nim
10:33:15*ehmry[m] joined #nim
10:33:17*jivank[m] joined #nim
10:33:19*stisa joined #nim
10:33:19*hohlerde joined #nim
10:33:19*TheManiac joined #nim
10:33:21*Guest73656[m] joined #nim
10:33:23*Jipok[m] joined #nim
10:35:42ArrrrMmm no, it was my mistake
10:36:43euantorTiberium: That's a bug/issue in htmlparser then unfortunately. dom96 might have an idea of how to get around/fix it
10:38:17Tiberiumeuantor, another error: "lib/pure/includes/asyncfutures.nim(106, 16) Error: attempting to call undeclared routine: 'value='"
10:38:29Tiberiumah
10:38:31Tiberiumnevermind
10:38:52TiberiumI've put "return await method()" but method() doesn't return anything
10:39:25*user0___ joined #nim
10:40:28Tiberiumso i fixed it
10:40:48Tiberiumeuantor, can I use parseJson with async?
10:41:17euantorI think so, but can't remember off the top of my head
10:42:38*bjz quit (Remote host closed the connection)
10:44:00Tiberiumeuantor, "Error: 'cb' is not GC-safe as it accesses 'nameIterVar' which is a global using GC'ed memory" finding this errors in code is fun :D
10:46:23Tiberiumeuantor, can "Warning: cannot prove that field 'data["key"].str' is accessible [ProveField]" be the reason of unsafe gc procs?
10:46:38Tiberiumdata is proc parameter (data is JsonNode)
10:46:53TiberiumI don't know what exactly in my proc is gc unsafe
10:47:52*bjz joined #nim
10:48:42euantorCan you provide the content of your proc on pastebin or something?
10:49:16Tiberiumeuantor, yeah, but I have two files with like ~250 lines of code and one file with types
10:49:25Tiberiumadd comments are in russian sadly :(
10:49:39Tiberiumeuantor, yeah, sure, will do it right now
10:50:01euantorAh, it might not even be in your code unfortunately - it could be a library you're using
10:50:28Tiberiumeuantor, I'm using "strfmt" and unpack macro from stackoverflow
10:51:55euantorI've not tried either of those, so I don't know if either might cause issues
10:52:07*vendethiel quit (Ping timeout: 240 seconds)
10:53:10*vendethiel joined #nim
10:54:56AraqTiberium: add explicit .gcsafe annotations to see where the compiler thinks you got it wrong
10:55:42TiberiumAraq, like var test {.gcsafe.} = test() ?
10:55:53Araqno, like
10:56:02Araqproc test() {.gcsafe.} = ...
10:56:31zachcartergetting closer…
10:56:32zachcarterhttp://imgur.com/a/3Tgou
10:57:44Tiberiumwwait
10:57:56euantorMight be being dumb, but is "Frame: 16.xxx[ms]" the length of time a single frame stays on screen for? Saw that on an earlier gif you provided and wondered if that was it
10:57:58Tiberiumit compiled xD
10:58:09zachcartereuantor: yup that’s the time per frame
10:58:12zachcarterin ms
10:58:25zachcarter16ms = roughly 60fps
10:58:41TiberiumI don't know how
10:59:06zachcarterof course the gif recording software messes a bit with my fps it’s usually steadier
10:59:12euantorAh, nice. Getting pretty close to 60fps, out of interest what's that running on?
10:59:29zachcartermy macbook pro
10:59:35euantorIs it fairly easy to build? I might give it a go on my machine at home with a 1080
10:59:36zachcarterI’m actually capping the FPS at 60
10:59:43zachcarterFRAG?
10:59:44euantorah, fair enough
10:59:58TiberiumIT WORKS
11:00:00zachcarterit’s going to be a bit of a struggle probablby until I get docu going
11:00:09zachcarterbut I could help you along if you’d like to try
11:00:15Tiberiumlol, I didn't thought it can be so easy to convert sync to async in a compiled language
11:00:20zachcarterwhat OS are you running?
11:00:28euantorYeah, that example. If it would be useful to you to try, but don't want to waste your time and I'm at work right now anyway
11:00:33euantorWIndows 10 x64
11:00:38Tiberiumzachcarter, I can test on Linux
11:00:44Tiberiummanjaro (based on arch)
11:00:48Tiberiumx64 too
11:01:06zachcarterah this example isn’t committed or anything
11:01:16zachcarterI’m probably not going to pusht he spine stuff up until I fix the holes in the mesh bug
11:01:24zachcarterTiberium: awesome
11:01:36zachcarterI plan to ask as many folks to help test frag as possible once we get the website and documentation going
11:03:00euantorAh right, no problem. I'd be interested in giving it a go so I'll watch out for a thread on the forum :)
11:03:21zachcarterokay cool :) as soon as the spine integration is added I’ll update the frag post
11:03:33zachcarterby that time hopefully we’ll have some docu
11:06:48Tiberiumvegansk: so how I use this sleepAsync() to limit it for 3 req/s if I have a proc which I call for every API method?
11:06:58Tiberiumadd sleepAsync(350) inside this proc?
11:07:29Tiberiumah
11:07:40Tiberiummy compilation fails in VSCode because it compiles with --threads:on
11:09:26*yglukhov quit (Remote host closed the connection)
11:10:22*yglukhov joined #nim
11:10:36*yglukhov quit (Remote host closed the connection)
11:12:40*Vladar quit (Excess Flood)
11:13:07*Vladar joined #nim
11:13:48chemist69Tiberium: yeah, had that recently, too. Add --threads:on into a <yourfile>.nim.cfg
11:19:57*BitPuffin|osx joined #nim
11:20:27FromGitter<vegansk> @Tiberium. asyncdispatch.all(req1, req2, req3, sleepAsync(1000)) will complete after all 4 futures will complete
11:21:29*gokr quit (Ping timeout: 240 seconds)
11:21:48Tiberiumvegansk: but I call api requests in different places
11:22:12zachcarterI’m trying to pack RGBA values in the range of 0-255 into a single uint32 witht he format abgr
11:22:28zachcarterso for example : 0xFFFFFFFF.uint32
11:22:44zachcarterI don’t think my attempt at a funciton to do this is right though:
11:22:52zachcarterabgr = (`shl`(a, 24) or `shl`(b, 16) or `shl`(g, 8) or r).uint32
11:23:01zachcarterabgr = (`shl`(a, 24) or `shl`(b, 16) or `shl`(g, 8 ) or r).uint32
11:24:12zachcarterI’m getting results like 254 with that
11:24:19zachcarterif I echo repr 0xFFFFFFFF.uint32
11:24:20zachcarterI get
11:24:40zachcarter4294967295
11:27:13FromGitter<vegansk> @Tiberium. Then you can store the times of the last three calls and check, if you need to call sleepAsync() before issuing new request
11:27:36*Tiberium quit (Remote host closed the connection)
11:28:37*yglukhov joined #nim
11:44:34*zachcarter_ joined #nim
11:47:25*zachcarter quit (Ping timeout: 260 seconds)
11:47:26*zachcarter_ is now known as zachcarter
11:48:24*yglukhov quit (Remote host closed the connection)
11:52:06FromGitter<TiberiumPY> Will try it, thanks Anatoly :)
11:53:11*djellemah_ quit (Ping timeout: 264 seconds)
11:55:31*yglukhov joined #nim
11:55:49*yglukhov quit (Remote host closed the connection)
11:56:42*gokr joined #nim
11:58:23*yglukhov joined #nim
11:59:57Arrrrare a, r, g, b defined as uint8 ?
12:01:56*ftsf quit (Quit: :q!)
12:02:19*yglukhov quit (Remote host closed the connection)
12:05:24*djellemah_ joined #nim
12:05:37*gokr left #nim (#nim)
12:05:56*yglukhov joined #nim
12:07:08*yglukhov quit (Read error: Connection reset by peer)
12:07:14*yglukhov_ joined #nim
12:09:31ArrrrI didn't have any issue with your snippet zachcarter https://glot.io/snippets/eoergtv3wi, unless i'm missing out anything
12:11:41*yglukhov_ quit (Ping timeout: 260 seconds)
12:11:47zachcarterthank you Arrrr
12:14:27*zachcarter quit (Quit: zachcarter)
12:14:45*yglukhov joined #nim
12:19:22*yglukhov quit (Ping timeout: 268 seconds)
12:25:19*Tiberium joined #nim
12:29:49*djellemah_ quit (Ping timeout: 240 seconds)
12:32:38*djellemah_ joined #nim
12:35:37FromGitter<evacchi> @vegansk re: actors; hey, that's pretty cool! I've been playing around with the same idea a bit, but for now it's just a playground https://github.com/evacchi/nimoy/
12:36:17FromGitter<evacchi> (tbf I did stumble upon your lib before, while looking for a conslist impl without having to roll out my own)
12:39:55FromGitter<evacchi> (i'll have to admit I'm doing this to learn Nim, so bear with me ;-) )
12:41:05*djellemah_ quit (Ping timeout: 258 seconds)
12:41:11*djellemah_ joined #nim
12:49:26*ftsf joined #nim
12:53:13FromGitter<vegansk> @evacchi , I see that you prefer Akka actors :-)
12:53:32Tiberiumbtw
12:53:42Tiberiumeuantor, I know why parseHtml failed xD
12:53:50Tiberiumbecause I compiled with --threads:on by default in VScode
12:55:01euantorYes, that would cause it :)
12:55:20euantorThough that should be fixed in the parsehtml library
12:55:34Tiberiumeuantor, it's htmlparser library :)
12:55:45Tiberiumeuantor, and that happens with parseJson() too
12:55:50Tiberiumso it's like a compiler bug maybe?
12:57:39euantorstdlib bug rather than compiler, but yeah
12:58:41*yglukhov joined #nim
13:00:29Tiberiumhmm, seems there's also good Nim plugin for Atom
13:00:31Tiberiumlet me try it
13:02:58*yglukhov quit (Ping timeout: 240 seconds)
13:03:18*vendethiel- joined #nim
13:03:46*vendethiel quit (Ping timeout: 268 seconds)
13:05:39*Vladar quit (Remote host closed the connection)
13:06:08*zachcarter joined #nim
13:08:46*Vladar joined #nim
13:16:29*tankfeeder joined #nim
13:26:03*demian joined #nim
13:26:12*demian is now known as dmi0
13:31:27*Tiberium quit (Remote host closed the connection)
13:31:43*Tiberium joined #nim
13:42:13FromGitter<evacchi> @vegansk that's just because I've been using akka a lot lately :^)
13:42:36FromGitter<brechtm> Does Nim have Python-style proc argument packing/unpacking (*args and **kwargs)?
13:44:22*tankfeeder quit (Quit: Leaving)
13:45:16*zahary quit (Quit: Connection closed for inactivity)
13:46:24Tiberiumbrechtm as I know you can use varargs
13:46:28Tiberiumat least for *args
13:51:11FromGitter<brechtm> @Tiberium that requires changes to the proc, right?
13:51:22Tiberiumbrechtm yes I think
13:51:34Tiberiumbrenchtm https://nim-by-example.github.io/varargs/
13:52:17Tiberiumbrechtm also https://forum.nim-lang.org/t/1324
14:05:39*rauss joined #nim
14:19:51*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
14:25:57zachcarteranyone know how to convert an unchecked array into a safe array?
14:26:10zachcarteror easily collect all the members of an unsafe array?
14:26:55*zahary joined #nim
14:31:59*dmi0 quit (Remote host closed the connection)
14:38:34Tiberiumhow to turn all debug settings on maximum?
14:38:45Tiberiumor they're turned on maximum by default?
14:48:59*couven92 quit (Quit: Client disconnecting)
14:57:05ArrrrI think they are set by default. Unless you won't to upgrade warnings to compiler errors
14:58:55Arrrr*want
15:01:38*yglukhov joined #nim
15:07:46*gangstaguy joined #nim
15:17:03FromGitter<andreaferretti> @zachcarter I think you can just cast it if you know the dimension statically
15:17:23zachcarterah okay I’ll try that thank you andrea
15:17:53FromGitter<andreaferretti> otherwise you're out of luck, the dimension is part of the type, you cannot define a concrete array type of unknown dimension
15:18:02FromGitter<andreaferretti> at most, you can copy the items into a seq
15:18:25FromGitter<andreaferretti> but in that case, I think you'd best just use a seq from the start
15:18:32*yglukhov quit (Remote host closed the connection)
15:18:53zachcarteragreed
15:21:26FromGitter<Varriount> There's openarray
15:21:31*yglukhov joined #nim
15:21:44TiberiumVarriount it's usecases are limited
15:24:46*yglukhov quit (Remote host closed the connection)
15:25:21*vendethiel- quit (Ping timeout: 260 seconds)
15:26:07*yglukhov joined #nim
15:30:37*onionhammer quit (Read error: Connection reset by peer)
15:31:00*onionhammer joined #nim
15:32:30*Trustable joined #nim
15:38:24*yglukhov quit (Remote host closed the connection)
15:38:46Tiberiumyay, my first public project made with Nim - https://github.com/TiberiumN/NickelVK (comments and readme are in russian)
15:42:38*yglukhov joined #nim
15:45:29*shashlick quit (Ping timeout: 240 seconds)
15:46:15*shashlick joined #nim
15:46:52*yglukhov quit (Remote host closed the connection)
15:48:09Tiberiumhow to find out what system libraries Nim would try to load after start?
15:48:16Tiberium"ldd" doesn't show OpenSSL for example
15:49:41Vladardynamic libraries are not traceable this way. You should either know it beforehand or use some kind of in-progress monitoring tool
15:50:23FromGitter<barcharcraz> if you look in the C file it will have a list of them
15:50:28*nsf quit (Quit: WeeChat 1.7)
15:50:37FromGitter<barcharcraz> nim does dlopen/dlsym in it's init process
15:50:39*Matthias247 quit (Read error: Connection reset by peer)
15:50:52FromGitter<barcharcraz> because it's way more consistent than using the platform (we don't need things like import libs on windows)
15:53:39Tiberiumbarcharcraz: what C file?
15:53:44Tiberiumthere are many of them xD
15:54:17*yglukhov joined #nim
15:55:11Tiberiumah, nvm
15:55:12dom96Tiberium: Nice! Your code looks very clean and very well commented :)
15:55:18Tiberiumdom96, really?
15:55:46Tiberiumok, there are dlopen's in stdlib_dynlib.c and stdlib_system.c
15:56:25dom96Yeah! Well, I can't read Russian so perhaps I can't judge the comments too accurately. But the code is looking good :)
15:56:33*yglukhov quit (Remote host closed the connection)
15:58:08*yglukhov joined #nim
15:58:55FromGitter<barcharcraz> *grumble* boost *grumble*
16:08:22*nhywyll joined #nim
16:09:09SusWombatAnyone knows what nim module i could use to "concatenate images" or "make images ot of other images"?
16:09:28*zachcarter quit (Ping timeout: 240 seconds)
16:10:56*yglukhov quit (Remote host closed the connection)
16:11:42*yglukhov joined #nim
16:12:28*yglukhov quit (Remote host closed the connection)
16:12:59*arnetheduck quit (Ping timeout: 256 seconds)
16:14:48FromGitter<BontaVlad> devil?
16:15:05FromGitter<BontaVlad> http://openil.sourceforge.net/
16:15:54FromGitter<BontaVlad> and nim bindings: https://github.com/Varriount/DevIL
16:19:51SusWombatThanks ill look into it
16:27:31Tiberiumwell, so Nim seems like a very good language :) speed of C and very user-friendly
16:27:54*gokr joined #nim
16:29:21*gokr quit (Client Quit)
16:38:02*yglukhov joined #nim
16:40:18*yglukhov quit (Remote host closed the connection)
16:44:05*Andris_zbx quit (Remote host closed the connection)
16:46:32*zachcarter joined #nim
16:54:51SentreenIs there any way to give `mgetOrPut` of the tables module lazy semantics?
16:55:22*yglukhov joined #nim
16:55:26SentreenAs in: `table.mgetOrPut(myKey, expensiveOpHere)` should only execute expensiveOpHere if the key is not present
16:59:06*yglukhov quit (Remote host closed the connection)
16:59:40*yglukhov joined #nim
16:59:57*yglukhov quit (Remote host closed the connection)
17:00:10*yglukhov joined #nim
17:02:37*yglukhov quit (Remote host closed the connection)
17:09:18def-Sentreen: if it was a template that would be easy
17:10:04Tiberiumhow can I use "^" and "%" bitwise operations in Nim?
17:10:20Tiberiumsomething like chr(ord(letter) ^ ord(key[ind % keyLen]))
17:10:24*brson joined #nim
17:10:58*brson quit (Client Quit)
17:11:19*brson joined #nim
17:11:33def-Tiberium: xor and mod?
17:12:03*brson_ joined #nim
17:14:34*yglukhov joined #nim
17:14:38cheatfateTiberium, bitwise operations is: and, or, xor, not. Different languages has different symbols for different bitwise operations
17:15:27cheatfateso what you mean under "^", "%" operations?
17:15:49*brson quit (Ping timeout: 240 seconds)
17:16:25Tiberiumcheatfate, I want to implement XOR decryption and encryption with key
17:16:39cheatfatethen you need `xor`
17:16:55Sentreendef-: do you mean if mgetorput was a template? Or if my expensive op was? Because it seems like messing with the table implementation is pretty tricky
17:17:06def-Sentreen: mgetorput
17:17:17cheatfateand `%` is mod (but it not bitwise operation)
17:17:30def-Sentreen: well, for functions the argument is evaluated before calling the function, for templates it's not
17:17:48Tiberiumcheatfate, this is https://gist.github.com/TiberiumN/94e508a3aa3761ffd9e9f4774f64e2c8 xor encryption with python
17:18:11TiberiumI'm translating it to nim :)
17:18:30*yglukhov quit (Remote host closed the connection)
17:19:13*gangstaguy quit (Quit: Connection closed for inactivity)
17:19:37SentreenOkay right, just wanted to be sure. I don't think I can do this without rolling out my own table implementation which is something I hope to avoid. But wanted to ask to be sure :)
17:20:18Tiberiumcheatfate, what's wrong with this code? https://gist.github.com/TiberiumN/33b1dde7ac6524730588295c0d04ff8e
17:20:34FromGitter<barcharcraz> doesn't xor encryption only work if len(key) >= len(message)
17:20:44Tiberiumyeah
17:20:51Tiberiumbut i'm doing simple xor
17:20:53Tiberiumand key is long
17:21:03FromGitter<barcharcraz> also you can only use each key once
17:21:13Tiberiumbarcharcraz why?
17:21:17Tiberiummy code doesn't work even with short messages btw
17:21:34Tiberiumbarcharcraz: it's not for my app, it's for talking with unofficial web api xD
17:22:14cheatfateTiberium, compiler in silence?
17:22:25Tiberiumcheatfate, compiler - yes, throws error at runtime
17:22:30TiberiumSIGSEGV: Illegal storage access. (Attempt to read from nil?)
17:22:36Tiberiumat line with "result"
17:22:43cheatfateresult = newString()
17:22:52cheatfatemust be first line
17:22:55cheatfatein the procedure
17:22:59Tiberiumwhy?
17:23:14Tiberiumlol
17:23:16Tiberiumworks now
17:24:01FromGitter<barcharcraz> because if you reuse keys then someone who intercepts multiple messages can xor them together to recover the key
17:24:22TiberiumI don't care
17:24:28TiberiumIt's just for talking with web api
17:24:29FromGitter<barcharcraz> what API is this
17:24:34FromGitter<barcharcraz> someone should hit them with a fish
17:24:38TiberiumI mean
17:24:42Tiberiumthey've done it
17:24:52Tiberiumjust to make sure script kiddies can't use this web api
17:24:58FromGitter<barcharcraz> oh
17:24:59*yglukhov joined #nim
17:25:03FromGitter<barcharcraz> that's just annoying
17:25:05def-Tiberium: result is initialized to binary 0 by default, so it's a null pointer. then you call the `&=` proc on a null pointer, trying to dereference it. so you have to initialize result first
17:28:30Tiberiumdef-, ok, thanks
17:31:33*yglukhov quit (Remote host closed the connection)
17:39:34*yglukhov joined #nim
17:42:00*yglukhov quit (Remote host closed the connection)
17:47:54*yglukhov joined #nim
17:48:43SentreenOkay this is very weird...
17:49:29SentreenIf I compile my main module which imports my tests, `time` tells me the execution takes slightly less than 3 seconds
17:49:54SentreenNow if I directly compile the test file and execute it, it happens in 0.25 seconds
17:50:18SentreenThis even happens when my main module consists of only that import statement
17:50:38Arrrrremove nimcache
17:52:11SentreenSame thing still happens
17:53:13ArrrrMmm
17:53:17*nhywyll quit (Quit: nhywyll)
17:54:15*Trustable quit (Remote host closed the connection)
17:55:22*yglukhov quit (Remote host closed the connection)
17:56:07*zachcarter quit (Quit: zachcarter)
17:56:27SentreenIt seems like it's some nimscript error: I have a task that calls `--define:release`, which generates the slow binary
17:56:59Sentreenmanually entering `--define:release` when building seems to produce the fast binary too
17:59:24*zachcarter joined #nim
17:59:32SentreenThat is still a pretty big difference between a release and debug build, a racket implementation of the same algorithm does it in less than a second.
18:00:58ArrrrWhich algorithm? maybe you are creating new strings/seqs, which is the common fault in performance with nim
18:02:36SentreenAlgorithm is probably a misnomer, it's a data-driven interpreter.
18:03:49SentreenAnd I'm creating at least one sequence for every primitive that I execute, but there is no real way around that I'm afraid :/
18:04:25Arrrrwhy not
18:07:18SentreenEach operation is triggered when the data it depends on becomes available. The data can be added in pretty much any order. And, since it is an interpreter, you cannot know how much inputs an operation takes in advance. So, at the very least, I need to create a seq for every primitive invocation
18:09:49ArrrrCan't you have a seq of seqs?
18:10:41SentreenDo you mean to have a predefined seq for each operation?
18:10:51ldleworkTRIGGERED
18:10:54ldleworksorry.
18:13:35SentreenIf that's what you mean, it is not possible, since an undetermined amount of instances of the same primitives can be active at the same time. So I can't statically determine how seqs I'd need.
18:14:20Araqputting -d:release in a nimscript file doesn't work.
18:14:37Araqit cannot, but I can make it an error I guess.
18:14:57Araqit's immediately obvious why it can't work. -d:release is implemented completely in nim.cfg
18:15:20Araqso if you set it in your nimscript file, it's already too late and doesn't affect the processing of nim.cfg at all
18:16:32SentreenProducing an error would probably be a good idea, you don't want to know how much time this cost me :p
18:17:44ArrrrDoes pragma checks actually do anything? I think it is not working
18:18:15Araq.push checks:off surely works for me
18:18:31Araqnot sure if it works without the .push
18:19:20*yglukhov joined #nim
18:21:12ArrrrIt doesn't work for me, outside and inside procs
18:21:19Arrrrwith push
18:22:00ArrrrAnd without them
18:22:16ArrrrAnd i notice the difference if i define release
18:23:26*gokr joined #nim
18:24:18Tiberiumhow much memory does Nim compiler need for it compilation?
18:24:34FromGitter<Varriount> Tiberium: Depends on the input files.
18:24:46*yglukhov quit (Remote host closed the connection)
18:24:46TiberiumI mean for it to compile itself :)
18:24:59Tiberiumkoch boot -d:release
18:25:06ArrrrI don't think it needs to much
18:25:10Arrrr*too
18:26:55FromGitter<Varriount> Sentreen: Why are you trying to define 'release' in your nimscript? Isn't that a switch reserved for the user?
18:28:24SentreenI'm using nimscript as a build tool, so the idea is to just say something like `nim buildRelease myproject` instead of `nim build -d:release myproject`
18:28:46TiberiumArrrr, I'm trying to compile it at my friend's RPi, firstly I was connected via teamviewer and my friend via vnc, so there was like 400 free memory, and it failed
18:29:49FromGitter<Varriount> Tiberium: Nim has successfully bootstrapped itself on a Rasberry Pi before.
18:29:52SentreenSpeaking of which, is it possible to see if -d:release or similar flags have been passed to nim from within nimscript?
18:31:01Arrrrmaybe with `if defined(release):` ?
18:31:32FromGitter<Varriount> if defined() will work, although the if will be done at runtime.
18:31:51FromGitter<Varriount> `if defined(release)` == `if true:`
18:32:00FromGitter<Varriount> or `if false`
18:32:21Arrrrin nimscript?
18:32:28SentreenThat works in the code that's gonna be compiled, but not in nimscript
18:32:37FromGitter<Varriount> :/
18:33:07dom96Tiberium: Add sawp
18:33:09dom96*swap
18:33:24dom96It will take a while though
18:33:37dom96Took at least 30 minutes when I did it last
18:33:43dom96But that was on an RPi 1
18:33:48dom96Might be faster on the newest one
18:34:16AraqSentreen: the compiler says release or debug build at the end of the compile
18:35:31FromGitter<Varriount> Araq: Sentreen wants a way to detect the 'release' define in Nimscript.
18:36:16ArrrrNow that i think about it, i think you can check the args passed from nimscript
18:36:16SentreenVarriount: I think Araq was referring to whether or not an error would be wanted/needed if you try to define release from within nimscript
18:37:12SentreenArrrr, you can with `paramStr` indeed. It's what I am looking into now :)
18:38:37*nsf joined #nim
18:39:27*Vladar quit (Quit: Leaving)
18:44:52Araqwhen defined(release):
18:45:18Araq^ should work. pretty sure I've used that before in nimscript
18:48:51SentreenIt does
18:50:09*brson_ quit (Quit: leaving)
18:51:53*vendethiel joined #nim
18:56:30*dmi0 joined #nim
18:59:24*zachcarter quit (Quit: zachcarter)
19:03:55Sentreen@Araq: I still think an error/warning could be useful, since it's pretty easy to miss the message after all the hints.
19:05:18SentreenI completely agree that it is a really stupid mistake to make, but it's pretty easy to make that assumption and to miss it when fixing your code a few months after.
19:05:38Araqno, I wasn't serious
19:05:56Araqthe compiler should error out for --define:release in nimscript/config system
19:06:05Araqyou're not the first one who made this mistake.
19:06:16AraqI think even the great araq himself did it wrong one day.
19:06:32AraqI mean, obviously he was completely drunk back then, but still.
19:09:23SentreenHaha, I was feeling pretty stupid when I finally found out, so I'm glad that I'm not the only one :p
19:11:20Tiberiumhmm, on friend's RPi I have some strange crash
19:11:55Tiberiumhttps://gist.github.com/TiberiumN/038a4cbb226712351568cb77754e37f0
19:12:04Tiberiumsrc on https://github.com/TiberiumN/NickelVK
19:12:33Tiberiumon vkapi.nim(62) there's code that returns section from json
19:12:36Tiberiumby key
19:17:55Tiberiumah
19:17:56Tiberiumnvm
19:18:05Tiberiumit disappeared
19:30:30dom96seems like a possible bug in strfmt?
19:32:29*yglukhov joined #nim
19:35:57*dmi0 quit (Quit: Using Circe, the loveliest of all IRC clients)
19:36:29*dmi0 joined #nim
19:37:02*Tiberium quit (Remote host closed the connection)
19:38:23*yglukhov quit (Remote host closed the connection)
19:42:16*rokups quit (Quit: Connection closed for inactivity)
19:42:17FromGitter<TiberiumPY> Maj ⏎ It was because I used int in LongPollData.ts
19:42:29FromGitter<TiberiumPY> Needed int64 on some machines
19:42:45FromGitter<TiberiumPY> It fixed the problem on RPI
19:45:55*bjz joined #nim
19:47:37*Arrrr quit (Quit: Leaving.)
19:51:54*hcorion joined #nim
19:52:36*PMunch joined #nim
19:56:17*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
20:00:18*nsf quit (Quit: WeeChat 1.7)
20:01:05*nsf joined #nim
20:02:52dom96Our Travis jobs are being terminated because they are taking too long
20:02:54dom96This is pretty bad
20:03:33hcorionIs it just the free version of Travis?
20:05:24FromGitter<Varriount> dom96: What's the timeout for travis? The full bootstrap process usually takes only a couple of minutes at most.
20:11:12*Serenitor joined #nim
20:15:46FromGitter<stisa> dom96: maybe you could split the test suite in different jobs ( eg a job per category ) ?
20:17:21FromGitter<Varriount> dom96: Has anyone e-mailed Travis support? Perhaps they would be willing to increase the time limit.
20:17:45FromGitter<Varriount> If not, I think I could spare the 70$ needed for a monthly account
20:18:02FromGitter<Varriount> (Though, I would rather not pay any money)
20:18:48hcorionWe could also cache the csources build, that takes up quite a bit of time
20:20:16*Matthias247 joined #nim
20:22:05hcorionIt doesn't seem to be timing out for most builds though
20:23:23*libman joined #nim
20:24:47*Matthias247 quit (Read error: Connection reset by peer)
20:26:09*Matthias247 joined #nim
20:26:12hcorionI dunno, I think we're pretty OK.
20:27:09hcorionIt seems only to be my PR, which ran for roughly 50 minutes. The previous commit that passed ran for only 30 minutes. I think something odd just happened with travis
20:28:06dom96varriount: You already give us a lot through donations :)
20:30:58cheatfatehcorion, maybe your changes made some incredible waiting or endless cycle?
20:32:07hcorion@cheatfate, I only changed http -> https in the doc cfg tho
20:32:56cheatfatehcorion, travis and appveyor has limits to 60 minutes per one job
20:33:33hcorionThe build timed out at 49 min 59 sec
20:34:20cheatfatelooks like travis has 50 minutes limit
20:34:22hcorionAnd said: The job exceeded the maximum time limit for jobs, and has been terminated.
20:34:24hcorionYet, all the tests had passed, the niminst tool had done it's thing.
20:34:43FromGitter<stisa> travis is 50 minutes on free and 120 on pro ( https://docs.travis-ci.com/user/customizing-the-build#Build-Timeouts )
20:34:47hcorionMaybe travis just has a grudge against me. Wants all my builds to fail
20:34:54dom96Could be a weird travis bug
20:39:56*user0___ quit (Quit: user0___)
20:40:15hcorionThat's what I think. Appveyor is unchanged, actually ran a few minutes faster than the previous build
20:52:12Araqugh, reviewing git diffs is just barbaric
20:53:14Araqgit doesn't understand syntax trees, so if I wrap X in an 'if cond:\n X' it's a "big change"
20:53:20*sz0 joined #nim
20:53:25Araqpathetic bullshit. plain text simply doesn't work. never has, never will.
20:53:59hcorionHuh. Build failed.
21:07:04*zachcarter joined #nim
21:07:43FromGitter<Varriount> Araq: Try disabling whitespace diffs?
21:07:44*couven92 joined #nim
21:10:39hcorionMaybe we do need to work on travis. I think the issue is that the servers are under load and this Nim is given less processing power.
21:11:27Araqvarriount: that's not a solution.
21:15:46Araqyay, only 20 commits left to review...
21:29:41FromGitter<Varriount> Araq: :<
21:31:12*rauss quit (Quit: WeeChat 1.7)
21:40:10*Jesin quit (Quit: Leaving)
21:45:13FromGitter<TiberiumPY> dom96: what would you recommend for request per second limiting for async httpclient? I call method, which is doing requests for a web API, from different places, files, but with one instance
21:45:39FromGitter<TiberiumPY> I need to limit it to 3 req/s
21:46:48dom96Create a type to hold a `lastRequest` field which contains the time when the last request was made
21:47:00dom96create your own request procedure that checks this field
21:47:20dom96use epochTime for the time
21:48:58FromGitter<TiberiumPY> Ah, thanks :)
21:50:13FromGitter<TiberiumPY> And for additional learning of Nim I wish to do macro like this
21:50:18FromGitter<TiberiumPY> Oh sorry
21:51:24FromGitter<TiberiumPY> Can't delete messages from mobile app, need to do in browser :)
21:53:54FromGitter<TiberiumPY> So web API allows you to send up to 25 requests in one, so you can process them at web API side via restricted subset of JS (very restricted)
21:54:06FromGitter<TiberiumPY> And I want to do macro like this:
21:54:26FromGitter<TiberiumPY> ``````
21:54:29FromGitter<TiberiumPY> Oh wait
21:54:43FromGitter<TiberiumPY> 77
21:54:52FromGitter<TiberiumPY> I can't put messines newlines
22:00:58*nsf quit (Quit: WeeChat 1.7)
22:02:50FromGitter<TiberiumPY> So I want to create macro like that: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=58dadd8908c00c092a26370f]
22:03:06FromGitter<TiberiumPY> I think it's possible
22:03:30FromGitter<TiberiumPY> Oh, I meant to put this code block inside "execute" macro block
22:05:45*tyler569 joined #nim
22:20:09*gangstacat quit (Ping timeout: 240 seconds)
22:27:02*zachcarter quit (Quit: zachcarter)
22:28:21*Jesin joined #nim
22:29:11*dmi0 quit (Ping timeout: 264 seconds)
22:37:03*PMunch quit (Quit: leaving)
22:40:45*couven92 quit (Quit: Client Disconnecting)
22:41:51SusWombatcan i open somehow stdin with openAsync?
22:43:55dom96SusWombat: nope
22:44:06dom96do what I do here instead https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L39
22:44:09dom96'night
22:48:37cheatfateSusWombat, it doesn't help you a lot, because stdin available to read/write only when Enter button pressed
22:50:05*krux02 joined #nim
22:53:13SusWombatok ty
22:54:26*sz0 quit (Quit: Connection closed for inactivity)
23:00:33*vlad1777d quit (Quit: Leaving)
23:02:26*zachcarter joined #nim
23:09:36*zachcarter quit (Ping timeout: 240 seconds)
23:12:06*zachcarter joined #nim
23:12:51*niv quit (Remote host closed the connection)
23:12:59krux02Araq, do you know if C structs introduce any alignment patterns by default except those to align primitive types?
23:13:45demi-krux02: that is compiler and platform specific
23:14:12*butchster_ joined #nim
23:14:27*niv joined #nim
23:14:45krux02demi-, I highly doubt that different C compilers layout C structs differently
23:15:03Araqstructs are always aligned
23:15:14krux02that would mean that I could not use link together programs that are compiled by different compilers
23:15:28krux02aligned to what?
23:15:32Araqthe alignment is determined by the fields in them
23:15:54Araqthe max alignment of the fields determines the struct alignment
23:15:55krux02I intuition tells me that every type has an "alignment" attributes
23:16:06Araqexactly.
23:16:10krux02and the alignment attribute from structs the the maximum of all it's members
23:16:14krux02(by default)
23:16:16Araqyes
23:16:29krux02it can be overridden though
23:16:37Araqyes
23:16:59demi-krux02: they can, because it is entirely dependent on platform architectures
23:17:00Araqand for unions nested in structs nested in structs it can become very surprising
23:17:03*Matthias247 quit (Read error: Connection reset by peer)
23:17:05*krux02 left #nim ("Leaving")
23:17:13*krux02 joined #nim
23:17:59*butchster quit (Ping timeout: 256 seconds)
23:18:06Araqdemi-: it's pretty standardized, I don't know of many cpu specific rules
23:18:15krux02Araq, well I don't care for unions so far, but I wouldn't do it differently than with structs
23:18:29*butchster_ quit (Ping timeout: 240 seconds)
23:18:41Araqsdl's event type comes to mind
23:19:04demi-Araq: not that i can name off the top of my head, but i am making the point that you cannot depend on alignment without packing
23:19:06krux02It must be standardized otherwise C would not count as the lingua franca for programming languages
23:19:07Araqhas strange alignment for reasons that escaped me
23:19:46demi-lol
23:19:49Araqhahaha, it doesn't take facts to create a myth
23:20:00Araq("lingua franca" my ass)
23:20:04demi-yeah really
23:21:00Araqit's part of the ABI though and C compilers usually adhere to the ABI
23:21:07krux02well I exaggerated a bit, but most programming languages do have a C interface
23:21:33krux02and that would not work if different compilers would align struct members differently from header files
23:21:46Araqgood C code lacks #align annotations for this reason
23:22:01Araqit's standardized, don't mess with it
23:22:11Araqdon't outsmart the compiler.
23:22:24Araqdon't create a struct that's less compatible with the others.
23:22:28*xet7 joined #nim
23:22:48krux02I don't want to outsmart the compiler, all I would like to do is to write an offsetof macro that can be evaluated at compile time
23:22:58krux02therefore I need to know the alignment rules
23:23:01demi-krux02: it would work fine in most cases, because you compile the library you are going to use with your compiler and it interfaces with the C struct through a layer of abstraction
23:23:35demi-and unless you are mapping from data in files or something the alignment of the struct isn't a huge deal
23:23:46demi-since you aren't accessing based on offset, but via member name instead
23:23:58Araqdemi-: that's not how C interop usually works for a compiled language. usually you're ABI compliant.
23:24:07krux02demi-, well I don't think that struct definitions in the header file count as layers of abstraction
23:24:42demi-krux02: no, but ruby and python, for example, don't interface directly with the struct members, there is a layer in-between for doing that
23:24:51Araqkrux02: yeah and it's a nice goal.
23:25:04Araqcheck out sdl's event type
23:25:13Araqto learn how it really works :-)
23:25:37*smt quit (Ping timeout: 240 seconds)
23:25:38demi-Araq: true, for an evaluated language that is the case; for compiled you would have the ABI compliance
23:26:46Araqyes, but even for Python's FFI via ctypes offsets matter. Ruby has a comparable module.
23:27:52krux02I just searched a bit for ABI, and I found out, that different architectures may in fact have different ABI's
23:28:06demi-yup
23:28:33krux02but that doesn't matter because normally you don't interface in binary with different Processor architectures
23:28:46*smt joined #nim
23:30:13krux02but for my implementation it does matter though if I want it to be used on different platforms, too
23:32:01*user0___ joined #nim
23:35:32*ftsf_ joined #nim
23:39:49tyler569even the same architecture can have different ABIs, Microsoft and *nix use different ones
23:40:14*ftsf_ quit (Ping timeout: 246 seconds)
23:40:55krux02tyler569, well I did find differences in calling conventions, but nothing else
23:41:16krux02even for different architectures I could only find that C struct members do self alignment
23:43:53SusWombatcan it be that loadLib behaves differently when used for dlls instead of a .so?
23:45:18AraqSusWombat: sure. it's OS specific.
23:46:09SusWombati have a "spawned" readLine which works under linux with a .so but not with dlls
23:53:09*ftsf_ joined #nim
23:54:51*Jesin quit (Quit: Leaving)
23:57:24AraqI doubt threadpool works in a DLL
23:58:42*roygbiv joined #nim
23:58:55SusWombatHow can i kill a "spawned readline"?