<< 26-05-2021 >>

00:02:32*noeontheend quit (Remote host closed the connection)
00:04:32*frd joined #nim
00:05:04*theelous3 quit (Read error: Connection reset by peer)
00:06:11*Q-Master quit (Ping timeout: 240 seconds)
00:06:19*Q-Master joined #nim
00:09:45FromDiscord<zetashift> @demotomohiro you here by any chance? I saw that you did some experiments with msgpack4nim and neovim, how did that turn out?
00:24:24FromGitter<kaushalmodi> ElegantBeef: Yeah, I didn't realize the other one was a generic proc. Thanks for clarifying.
00:25:28*motersen quit (*.net *.split)
00:25:28*fantis quit (*.net *.split)
00:25:45*brainproxy joined #nim
00:27:07*brainproxy quit (Client Quit)
00:35:20FromGitter<kaushalmodi> Went to fix my post; realized that ~strikethrough~ syntax didn't work on Nim Forum. *Need to add that support ..*
00:42:08FromDiscord<exelotl> In reply to @ElegantBeef "Before Nim i didnt": it's strange that Lua has it only for tables and strings
00:42:43FromDiscord<exelotl> so you can do `print "hello"` but not `print 123` or `print myVar`
00:42:59FromDiscord<exelotl> (edit) "tables" => "table" | "strings" => "string literals"
00:43:25FromDiscord<ElegantBeef> Odd
00:44:09FromDiscord<exelotl> guess they just did what was easy to parse or something
00:53:50*arkurious quit (Quit: Leaving)
00:54:23FromDiscord<ajusa> Anyone know why I have a whole bunch of "hcode" in my JSON when using https://github.com/status-im/nim-chronicles↵Does it have to do with the way they serialize tables?
00:56:21*nphg joined #nim
00:56:54*Tlanger quit (Ping timeout: 260 seconds)
00:58:34*nphg1 quit (Ping timeout: 272 seconds)
00:59:17*Gustavo6046 quit (Remote host closed the connection)
00:59:50*Gustavo6046 joined #nim
01:01:33FromDiscord<timotheecour> try jsonutils
01:02:00FromDiscord<timotheecour> (edit) "jsonutils" => "std/jsonutils, it has custom serializer for Table"
01:03:45*motersen joined #nim
01:05:51FromDiscord<ajusa> Hm, not sure how to do that with chronicles though, as I assume that the JSON serialization stuff is handled somewhere in their library code. I ended up switch to a sequence itself, that I can parse into a table later
01:07:12*fantis joined #nim
01:11:02*a_chou joined #nim
01:11:20*a_chou quit (Client Quit)
01:12:22FromDiscord<timotheecour> the hcode will depend on insertion order though
01:13:05FromDiscord<timotheecour> (edit) "though" => "though, which `myTable.toJson` avoids"
01:14:14FromDiscord<treeform> My library also serializes Json and handles Tables correctly and it can be very fast: https://github.com/treeform/jsony
01:15:02FromDiscord<treeform> If there is some type it does not handle right you can write a `dumpHook()` for your type to serialize just how want it.
01:40:38PrestigeIs there a high precision sleep function (for nanoseconds)?
01:45:00*Tlangir joined #nim
01:51:13FromDiscord<timotheecour> posix.nanosleep but ideally should be exposed in os.nim via `sleep(t: Duration)` as overload of `sleep(milsecs: int)`
01:54:24FromDiscord<ajusa> In reply to @treeform "My library also serializes": Yep, I just switched to using that for JSON parsing, saw a 4x speedup over jsonutils. Unfortunately I wrote my code with nim chronicles for logging, which means that I can't control the JSON output from there. I'll probably write my own logging implementation at some point in the future with the few things that I need, but `jsony` is fantastic!
02:14:21PrestigeWeird, is there no way to convert a Time object like you can with Duration?
02:15:33FromDiscord<treeform> Prestige, I don't think there is a way to tell the OS to sleep exact amount of time.
02:15:49PrestigeI'm past that
02:16:11FromDiscord<treeform> A trick I used in the past is to sleep until about 100ms then I while loop and keep the CPU busy till I get exact timing.
02:16:40FromDiscord<treeform> Then I can get very accurate sleep times at cost of spinning the CPU for no reason.
02:18:47Prestigeatm I'm trying to getTime() and have the value be in nanoseconds
02:19:10PrestigeI seem to not be able to get the number of seconds from the Time object to convert it
02:22:18FromDiscord<treeform> I recommending using `std/monotimes`
02:22:43FromDiscord<treeform> `getMonoTime().ticks`
02:23:09FromDiscord<treeform> that gives you nanoseconds.
02:23:14FromDiscord<treeform> https://nim-lang.org/docs/monotimes.html#getMonoTime
02:24:00FromDiscord<ElegantBeef> Well you can do `getTime().nanosecond` if you just want the ns, but if you want to convert it to ns good luck 😄
02:24:37PrestigeYeah that's just the nanoseconds past the current second, I think I need what treeform just linked
02:33:28FromDiscord<rvbg> Hi, I want to get the current URL from httpclient newHttpClient. Any ideas?
02:34:06FromDiscord<ElegantBeef> What do you mean the current url?
02:34:41FromDiscord<ElegantBeef> Ah nvm i see 😄
02:36:48FromDiscord<ElegantBeef> It's not actually exposed that i can see
02:37:53FromDiscord<treeform> don't you pass it the url?
02:38:16FromDiscord<ElegantBeef> Yea it's a bit odd considering that, but it does store the url internally
02:39:20FromDiscord<rvbg> The http request is redirected and I want to get the new URL
02:39:45FromDiscord<rvbg> (edit) "The http request is ... redirected" added "getting"
02:50:03FromDiscord<rvbg> If there is no way to get the new url in that way, I guess getting the 301 location first and then the content of the grabbed location would be the best solution.
02:50:24FromGitter<BracketMaster> does nim have a sliding window iterator? I have an array [1,2,3,4] and would like to do something like ``for i in slide([1,2,3,4], 2)`` where i yields [1,2], [2,3], [3,4], [4,1]
02:51:01FromGitter<BracketMaster> if not, wouldn't take long for me to implement something I suppose
02:52:04FromDiscord<ElegantBeef> I dont believe it does
02:52:26FromDiscord<Rika> 3rd party library
02:52:34FromDiscord<Rika> Think it's in itertools
03:10:09FromDiscord<codic> is there a library to read BMPs, or PPMs, or literally any other simple bitmap format?
03:14:18*rockcavera quit (Remote host closed the connection)
03:23:36FromDiscord<ElegantBeef> You could use pixie for loading images
03:24:01*spiderstew_ joined #nim
03:24:59*spiderstew quit (Ping timeout: 245 seconds)
03:33:47FromDiscord<codic> looks like a full 2d graphics thing
03:33:57FromDiscord<codic> rosetta code looks like it has one implementation
03:34:26FromDiscord<ElegantBeef> Sure it's a full 2D graphics thing but it has loading bitmaps as data, and we have dead code elimination
03:35:01Lord_NightmareThe new owner of freenode made a sudden rules change today making redirects/closing of projects channels against network rules
03:35:10Lord_Nightmareand minutes ago, siezed several hundred channels
03:35:17FromGitter<BracketMaster> can up put type restrictions on a template?
03:35:35Lord_NightmareF*** this s***, I'm out. What network is the IRC bridge moving to, if I might ask?
03:35:52Lord_Nightmaresince this network is about to implode in the next 24 hours, if not less.
03:36:06FromDiscord<ElegantBeef> You should be able to bracket
03:36:29FromDiscord<ElegantBeef> I believe it was decided on superbia or similarly named, plus there is matrix + shittydiscord 😄
03:41:10FromGitter<BracketMaster> Where might i find info in HSlice? I want to access its upper and lower bounds
03:41:24FromGitter<BracketMaster> oh
03:41:25FromGitter<BracketMaster> a and b
03:41:27FromGitter<BracketMaster> nvm
03:44:05FromDiscord<ElegantBeef> Yea it's kinda unexpected, until you realize low/high wouldnt work cause it's just a general `a` to `b` type
03:44:27FromDiscord<ElegantBeef> I know i was a bit annoyed for a few seconds trying to find the value's names 😄
03:45:36FromDiscord<ElegantBeef> And if using homogeneous a/b `Slice[T]` is an alias to `Hslice[T, T]`
03:52:39ForumUpdaterBotNew thread by Alexeypetrushin: Native integration of Nim and JavaScript/TypeScript, see https://forum.nim-lang.org/t/8038
03:52:59FromGitter<kaushalmodi> Funny, I also discovered the a and b for Slice, maybe a week back
03:53:33FromGitter<kaushalmodi> .. or rather re-discovered
03:53:53FromGitter<BracketMaster> You know what would be niced - replace JS with Nim completely
03:54:12FromGitter<BracketMaster> like HTML + Nim instead of HTML + JS
03:54:25FromGitter<BracketMaster> or even HTML + Python
03:54:29FromGitter<BracketMaster> JS is yuck
03:55:15FromGitter<BracketMaster> in response to native integration of Nim and JS/TS ^^
03:57:28FromDiscord<ElegantBeef> Well we have a js backend as you probably know, so be the change you want in the world 😄
04:01:36FromGitter<BracketMaster> Sure, I'm just not sure how a pull request for "replace V8 with Nim" would be recieved on Chromium...
04:01:39FromGitter<BracketMaster> Well, I am sure
04:01:41FromGitter<BracketMaster> It wouldn't
04:17:34FromDiscord<ElegantBeef> Sure, but we can atleast use Nim as a JS writer so we dont suffer as much
04:46:55*Tlangir quit (Remote host closed the connection)
04:50:05*Tlangir joined #nim
04:54:25*narimiran joined #nim
05:04:23*Tlangir quit (Remote host closed the connection)
05:07:58FromDiscord<lamersc> Is the book or the official ,docs more in depth for learning nim?
05:08:33FromDiscord<lamersc> If it makes any difference, I'm experienced with a few languages like C, C#, JS
05:09:17PrestigeI'd start with the official docs (tutorials and manual)
05:10:15*al1ranger joined #nim
05:11:01FromDiscord<lamersc> That's what I was thinking, I'll check em out
05:11:26FromDiscord<lamersc> Perhaps I'll get the book later on just to freshen up or for quick reference
05:12:41PrestigeThere are a few youtube channels as well if you like that medium, such as https://www.youtube.com/channel/UC7jrCF4RVWeXwg6noJKMztw
05:13:58*al1ranger quit (Client Quit)
05:14:15*al1ranger joined #nim
05:15:32*al1ranger quit (Remote host closed the connection)
05:18:57FromDiscord<ElegantBeef> Here's also a pretty good place to learn when you get lost, but not for basic questions of "how do i declare a variable" 😄
05:19:47*al1ranger joined #nim
05:28:44FromDiscord<Rika> In reply to @ElegantBeef "Here's also a pretty": Can you teach me how to write a reactive framework
05:28:58FromDiscord<ElegantBeef> Totally, you just go use reactjs and there you go
05:29:51FromDiscord<Rika> Wrong reactive lol
05:35:45*Tlangir joined #nim
05:46:26*al1ranger left #nim ("Leaving")
05:58:50FromGitter<kaushalmodi> I have proc of this signature: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ What's the correct way of declaring that `constr1` proc? [https://gitter.im/nim-lang/Nim?at=60ade39a3d43a15a65c82afe]
06:09:23FromGitter<kaushalmodi> ok.. changing the arg type of `constr1` to `auto` worked.
06:10:19FromDiscord<Rika> constr1(a: array[3, int]) should be constr1(a: openArray[int]) ?
06:22:07*Lord_Nightmare left #nim ("I'm getting out while I can. This IRC network has descended into complete chaos, and the new owner is a goddamn idiot. I'll be on discord.")
06:27:53*PMunch joined #nim
06:28:04*sknebel left #nim (#nim)
06:32:45FromGitter<kaushalmodi> yes, that would also work. I was specifying the array dimensions as I knew how many indices I needed in that proc. But yeah, setting that to openarray would work.
07:17:07Oddmongertest
07:17:40FromDiscord<ElegantBeef> Pong
07:18:11Oddmongerthanks (i've been -v on some freenode chans, time to move to l…a )
07:41:00*whaletechno joined #nim
08:11:24FromDiscord<quarternion> Hi, I have some experience with multi-thread programming in C++. I have trouble understanding the behavior of `Thread` object in nim. 1) What is the effect of copying thread object (in C++ thread is move only)? 2) Is it undefined behavior to can `joinThread` on same thread multiple times? 3) What is the corresponding `detach` method in nim? Thanks ahead.
08:14:11FromDiscord<quarternion> I read the 'threads` section and the module documentation, but couldn't find a answer to it.
08:17:43FromGitter<bung87> what does it do in c++ `detach`
08:21:44FromGitter<bung87> I googled it , it looks like `createThread` does
08:23:16FromDiscord<quarternion> But in c++, if you can `detach` on a thread, you cannot join the thread. In nim, you can join that thread after calling `createThread`
08:23:28FromDiscord<quarternion> (edit) "can" => "call"
08:23:34FromDiscord<quarternion> `s/can/call`
08:24:50FromGitter<bung87> your problem is prevent mis-used?
08:24:53FromDiscord<quarternion> I just found you can edit your message by calling regular expressions. `s/can/call` actually works. That's powerful
08:24:58FromDiscord<quarternion> yes
08:27:01FromGitter<bung87> have no idea now, if code all write by yours self , you just need dont call joinThread by your self. and I dont see the use case you provide thread object as api to other developer.
08:31:46*PMunch quit (Ping timeout: 240 seconds)
08:34:41FromGitter<bung87> how to handle cocurrent request in my async mysql conector, I found a read pendding error during benchmark test.
08:37:24FromGitter<bung87> I have async pool module , but the module export type name same as module name I can't use it right now, I thought make a minor change to single connection module.
08:38:05FromGitter<bung87> maybe a busy flag?
08:44:12*PMunch joined #nim
08:47:19*rusua joined #nim
08:53:02*PMunch quit (Ping timeout: 252 seconds)
09:01:52*Vladar joined #nim
09:02:51*Tlangir quit (Quit: Leaving)
09:03:24*NimBot joined #nim
09:04:40FromDiscord<jseb> sent a code paste, see https://play.nim-lang.org/#ix=3nUe
09:07:13*PMunch joined #nim
09:15:44FromDiscord<jseb> huho when acceding directly it's ok, but not in the loop
09:16:16FromDiscord<jseb> sent a code paste, see https://play.nim-lang.org/#ix=3nUf
09:22:59FromDiscord<ElegantBeef> Yea it's odd, but the data is proper https://play.nim-lang.org/#ix=3nUi
09:25:40nphgIsn't buffer already a pointer? I.e. shouldn't the code use `buffer` instead of `buffer.addr`?
09:26:36nphgA pointer the `alloc`ed memory, I mean
09:27:52FromDiscord<jseb> well i was thinking this too, but copyMem seems to need pointer on pointer
09:28:16FromDiscord<ElegantBeef> No they're right, https://play.nim-lang.org/#ix=3nUl
09:29:18FromDiscord<jseb> ah ok i understand
09:29:33FromDiscord<jseb> buffer.addr was doubled and pointed to unallocated memory
09:29:55*teasea quit (Quit: teasea)
09:30:01FromDiscord<jseb> so one part of the pointed zone was thrashed
09:30:16FromDiscord<jseb> thank you
09:36:06*teasea joined #nim
09:49:15FromDiscord<Zachary Carter> buffer.addr is going to result in a pointer to a pointer
09:49:26FromDiscord<Zachary Carter> buffer is already a pointer
09:49:27*l1x joined #nim
09:49:43FromDiscord<Zachary Carter> that's your problem - not that anything was "thrashed"
09:52:18FromDiscord<jseb> yes, that's what i was saying
09:52:33FromDiscord<jseb> as it points to unallocated memory, anything can happen
10:15:59*lritter joined #nim
10:23:29PMunch@jseb, I showed you that in my example yesterday :P But I guess it was easy to miss
10:30:42*aeverr joined #nim
10:37:51FromGitter<BracketMaster> I created a sliding window iterator in nim, the first group of statements at the bottom work, the second don't: https://play.nim-lang.org/#ix=3nUC
10:38:04FromGitter<BracketMaster> The second fails with: ``type mismatch: got <seq[int]> but expected 'array[0..2, int]'``
10:41:18PMunchYes because T is set by your `items` argument to be an array of three integers, but your yields use slices which are sequences
10:43:01PMunchYou might be able to make it return an array if you make `interval` a `static[int]` type, since arrays need to have static sizes. Otherwise you could just say that the return type is always a sequence
10:43:58PMunchLike this for example: https://play.nim-lang.org/#ix=3nUH (just changed the signature of the iterator and uncommented the previously not working bit)
10:44:04PMunch^ BracketMaster
10:50:12FromGitter<kaushalmodi> @BracketMaster The itertools package has a `windowed`, which is a sliding window iterator.
10:52:00PMunchHere is a slightly more style correct Nim version by the way: https://play.nim-lang.org/#ix=3nUK
11:02:43*Torro joined #nim
11:08:28*madnight left #nim ("WeeChat 3.1")
11:31:03*aeverr quit (Remote host closed the connection)
11:31:35*aeverr joined #nim
11:45:16*sagax quit (Ping timeout: 268 seconds)
11:49:40FromDiscord<jseb> PMunch : i'm sorry to have missed that ^^'
11:52:00*sacredfrog quit (Quit: ZNC 1.8.2 - https://znc.in)
11:52:17*sacredfrog joined #nim
11:52:22PMunchNo worries, I think I forgot to mention it :P
11:52:32PMunchI just changed the code to do it properly
11:54:00FromDiscord<mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3nV6
11:55:11FromDiscord<Rika> looks nice imo
11:55:16FromDiscord<mlokis> It can serialize and deserialize even recursive datastructures
11:56:23FromDiscord<mlokis> of course if you serialize to one and deserialize to another you program will highly likely die
11:56:47FromDiscord<Rika> now its time for you to add checking for that 😛
11:57:06FromDiscord<mlokis> i have no idea how to do that
12:05:22FromDiscord<mlokis> it still amazes me that something so complex can be written in 250 lines of code
12:05:34FromDiscord<mlokis> (edit) "250" => "~250"
12:13:22ebbhi folks, i've been lurking for a while here via irc. is there an authoritative decision yet on whether #nim will stay on freenode?
12:13:49ebb(phrased with the assumption that a decision is going to be made, because it seems like it's almost a requirement if you run a channel on here nowadays :) )
12:16:16def-ebb: i guess it makes sense to move it. I'm only reading, but this is the only remaining channel I have on freenode
12:17:53FromDiscord<Rika> dom's waiting on you-know-what-server to accept the project registration
12:19:17ebbah, awesome
12:20:02ebb(it's okay, you can say 'snoonet')
12:20:41FromDiscord<Rika> nah ill keep on using you-know-what-server
12:21:56FromDiscord<mlokis> i em getting this error when installing choosenim `LibArchive v3.4.3 not found`
12:22:19FromDiscord<mlokis> did anyone encounter it and have fast solution?
12:25:02FromDiscord<mlokis> its fine am just stupid
12:30:47*def- quit (Quit: -)
12:35:22*arkurious joined #nim
12:36:05*vsantana joined #nim
12:38:13FromDiscord<mlokis> In reply to @Rika "now its time for": Do you think that making a slow debug solution that can be disabled is good solution? Because storing type information alongside with data can double the resources needed.
12:38:55FromDiscord<Rika> maybe? but then you'd need to be mindful of loading a debug-stream on a release-reader
12:43:43FromDiscord<mlokis> In reply to @Rika "maybe? but then you'd": One boolean on the start of the buffer should be enough
12:44:12FromDiscord<Rika> or maybe you can somehow skip the type information
12:44:26*Village12 joined #nim
12:44:26Village12/!\ THIS CHANNEL HAS MOVED TO IRC.LIBERA.CHAT #HAMRADIO /!\
12:44:27Village12/!\ THE JEWS HAVE TAKEN OVER FREENODE, CHATS HAVE MOVED TO IRC.LIBERA.CHAT /!\
12:44:28Village12/!\ JOIN #HAMRADIO TODAY. THIS CHANNEL HAS MOVED TO IRC.LIBERA.CHAT #HAMRADIO /!\
12:44:29*Village12 quit (Remote host closed the connection)
12:44:40FromDiscord<Rika> oh man xd
12:44:47ebbthat's a throwback
12:45:10FromDiscord<Rika> @dom96 early warning that some people might start spamming the irc channel
12:45:49ebbdid you suffer any spam last week?
12:46:05FromDiscord<Rika> not that i know of
12:49:18Oddmongerspam on l…a side to, i had to voice my own chan to registred nicks only
12:50:26*rockcavera joined #nim
12:52:53Oddmongeris it realistic to pass var-sized arrays as function parameters, or should i use seqs instead ?
12:53:42Oddmongeri've tried to pass them as UncheckedArray, it works, but what a mess
12:53:59Oddmongerhttps://play.nim-lang.org/#ix=3nVl
12:54:07FromDiscord<Rika> please use seqs instead for that
12:54:13FromDiscord<Rika> i dont see why you wouldnt in that case
12:54:34Oddmongerit was curiosity
12:58:57*l1x quit (Quit: Connection closed for inactivity)
13:02:29leorize[m]there's openarray which is basically that but safe
13:02:52Oddmongeri look
13:03:40FromDiscord<Rika> oh i didnt check the code, thats a good point
13:04:31Oddmongeryes perfect
13:08:20FromDiscord<mlokis> Seriously why is nimlsp constantly crashing?
13:11:25*sagax joined #nim
13:17:51PMunch@mlokis, could be a nimsuggest issue. But try to make a debug build so we get a nice log from it
13:17:59PMunchThat might be able to tell us what's wrong
13:18:38FromDiscord<mlokis> well currently it is spamming my console with long errors
13:18:56FromDiscord<mlokis> should i send one of them?
13:19:02PMunchSure
13:19:10FromGitter<kaushalmodi> I need help fixing this compilation error: https://play.nim-lang.org/#ix=3nVx ⏎ ⏎ I need to pass an array of procs to the `randomize` proc in there.
13:19:50FromDiscord<mlokis> this is just fraction of it https://media.discordapp.net/attachments/371759389889003532/847101728351453204/message.txt
13:21:49FromGitter<kaushalmodi> I am working on a POC for a constrained random solver.. I got this working ( https://play.nim-lang.org/#ix=3nVy ) but it will never converge as the constraint space grows even slightly. So I am modifying this to accept an array of procs and seeing if that helps.
13:34:12nphgkaushalmodi: the procs must be closures, if you use `[proc(a: array[1, int]):auto{.closure.} = a[0] == 2]` it works
13:35:23FromGitter<kaushalmodi> npgh: Trying that now.. Curious: Why isn't that pragma needed here: https://play.nim-lang.org/#ix=3nVy
13:37:12FromDiscord<zetashift> In reply to @mlokis "this is just fraction": If you're using VSCode try out https://github.com/saem/vscode-nim because it generally is a better plugin
13:38:01*alri[m] left #nim ("User left")
13:38:11nphgkaushalmodi: no idea
13:39:06FromGitter<kaushalmodi> nphg: Thanks, though. Your suggestion unblocks me for now to continue developing that POC. To make it usable, I'll need to be able to use the `=>` so that it doesn't become overly verbose
13:41:29nphgthat would mean no needing the pragma or extending `=>` to support pragmas
13:43:06FromGitter<kaushalmodi> I am trying to mimic this constraint block in SystemVerilog where those a, b, c, d are rand variables: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I can see that each semi-colon separate constraint would be kind of a boolean returning proc in Nim.. now just to figure out how to make that as concise as above [https://gitter.im/nim-lang/Nim?at=60ae5069850bfa2d3be4e7d8]
13:47:50Oddmongeris it possible to put an array in a function call ?
13:47:59Oddmongerfoo([1,2])
13:49:11ForumUpdaterBotNew thread by HJarausch: Nim Devel - how to (re-) build it?, see https://forum.nim-lang.org/t/8039
13:51:11ForumUpdaterBotNew thread by Xioren: Catching shell resizes (asynchronously?), see https://forum.nim-lang.org/t/8040
13:56:30FromDiscord<Rika> In reply to @Oddmonger "is it possible to": yeah, are you getting an error or something?
13:57:21*vsantana quit (Quit: leaving)
13:57:27FromGitter<BracketMaster> PMunch: thx for your example^^, also, what is ``runnableExamples`` in your code? : https://play.nim-lang.org/#ix=3nUK
13:57:46FromGitter<BracketMaster> thx
13:59:01Oddmonger@Rika : hum in a simple test case, it works, so it must be something else, i continue to search
13:59:22PMunchAh, runnableExamples is code that will be put into the documentation (## is how you make a documentation comment in Nim). But unlike an example that is just written out in the comment it will actually be compiled and run when you generate the documentation. So if you write your examples with an `assert` in them they will fail if you change something and the example is no longer correct :)
13:59:51FromDiscord<Encrypted Backpack> Isn't talking through webhooks against the Discord API ToS?
14:00:44PMunchTry to run `nim doc` on my example, it will create documentation for that module where you can see the example and the output of `nim doc` will show you that the example was run
14:00:56FromGitter<BracketMaster> rust has something like runnable examples
14:00:57FromGitter<BracketMaster> very nice
14:01:06FromGitter<BracketMaster> are there other languages with things like this?
14:01:14FromGitter<BracketMaster> besides rust
14:01:39*oz left #nim ("WeeChat 3.1")
14:01:47FromDiscord<Rika> In reply to @Encrypted Backpack "Isn't talking through webhooks": it is? can you link us
14:09:40FromGitter<kaushalmodi> Still working on my POC: Updated code: https://play.nim-lang.org/#ix=3nVP ⏎ ⏎ How to solve: ⏎ ⏎ > Error: '.closure' calling convention for top level routines is invalid ... [https://gitter.im/nim-lang/Nim?at=60ae56a443fc4a24c5c88021]
14:11:10FromDiscord<ajusa> Anyone know how to get the output of a command with any color output? If I just use `execCmdEx` and echo the returned output, all color formatting seems to be stripped.
14:14:58FromDiscord<Rika> im pretty sure most commands disable color when it detects its not running on a terminal
14:15:24FromDiscord<Rika> so your first hurdle is to trick commands into thinking theyre running on a terminal
14:16:02FromDiscord<ajusa> ah, even when I pass in an explicit `--color` flag? This is for the `diff` command btw
14:16:33FromDiscord<ajusa> or is it possible for me to have them directly print to the command line itself?
14:17:14ForumUpdaterBotNew thread by Leeooox: How to test exceptions with unittest?, see https://forum.nim-lang.org/t/8041
14:17:53FromDiscord<Rika> diff will give color when `diff ... --color=always`
14:18:05FromDiscord<Rika> are you not getting color given that?
14:18:47FromDiscord<ajusa> ... that worked, thanks! I thought it was just the `--color` flag that was needed, I guess `always` skips the terminal support color check
14:19:00FromDiscord<Rika> yes
14:19:10FromDiscord<Rika> --color by itself is invalid
14:19:19FromDiscord<Rika> and the default value is `auto`
14:26:08*superbia joined #nim
14:27:44*xet7 quit (Remote host closed the connection)
14:28:58*xet7 joined #nim
14:46:27*a_chou joined #nim
14:51:16*aenesidemus joined #nim
14:53:18ForumUpdaterBotNew thread by 2f1cafc: Documentation for the `do` keyword?, see https://forum.nim-lang.org/t/8042
14:55:18ForumUpdaterBotNew thread by Mantielero: Macros - iterate on sequence, see https://forum.nim-lang.org/t/8043
15:04:36*a_chou quit (Quit: a_chou)
15:06:17*superbia left #nim ("WeeChat 3.1")
15:12:36FromDiscord<jseb> i think the problem is with the cast in the copyMem:↵https://play.nim-lang.org/#ix=3nW8
15:17:20FromDiscord<jseb> hmm even with a `cast[pointer](vertices)` (this violence!) it doesn't change anything. The kind of stuff that must be debugged with assembly dump, i guess
15:17:33FromDiscord<jseb> /away
15:23:48FromDiscord<mlokis> In reply to @zetashift "If you're using VSCode": and how do i get nimsuggest running?
15:26:22FromDiscord<Rika> `copyMem(v, cast[ptr cfloat](vertices[0].unsafeaddr), vertices.lensizeof(cfloat))` is the proper use @jseb
15:26:31*kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in)
15:26:47*kitech1 joined #nim
15:26:53FromDiscord<Rika> vertices.len == 3, copyMem needs byte amount
15:41:15FromDiscord<jseb> Aaah ok. Thank you Rika
15:42:18FromDiscord<jseb> I was not copying the whole buffer
15:44:26FromDiscord<Kaffee> How do you compile to an assembly file? I found out about the --asm flag but it still compiles to a binary?
15:45:28FromDiscord<Zachary Carter> Nim doesn't compile to assembly, it compiles to C/C++/Objective-C/JS
15:45:39FromGitter<gogolxdong> .fatal.nim(53) sysFatal ⏎ Error: unhandled exception: over- or underflow [OverflowDefect]
15:45:59FromGitter<gogolxdong> There is no stacktrace.
15:46:10FromDiscord<Kaffee> what does the --asm flag do then?
15:47:15FromDiscord<Rika> In reply to @gogolxdong ".fatal.nim(53) ": compile on debug or --stacktrace:on
15:47:27FromDiscord<Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=3nWh
15:47:42FromDiscord<Rika> oh, also --linedir:on i think
15:47:42FromDiscord<James> In reply to @Encrypted Backpack "Isn't talking through webhooks": Self-bots are against Discord guidelines, but bridging chat networks should be okay.↵https://discord.com/guidelines
15:48:42FromDiscord<Zachary Carter> @Kaffee try compiling with that flag and looking at the generated code
15:49:20*NimBot joined #nim
15:49:28FromDiscord<Zachary Carter> Nim compiles to C and then invokes the native C compiler on your system to produce an executable
15:49:38FromDiscord<Zachary Carter> You need to find the code that nim generated - what operating system are you on?
15:49:41FromDiscord<Encrypted Backpack> In reply to @James "Self-bots are against Discord": So the webhooks talking earlier we're just sent by bots that picked up user messages in a different channel/guild?
15:49:54FromDiscord<Kaffee> windows10
15:50:33FromDiscord<Zachary Carter> Okay, look in `C:\Users\{YOUR_USERNAME_HERE}\nimcache` and find the source for your project
15:51:15FromDiscord<Zachary Carter> `_d` = debug `_r` = release
15:52:39FromDiscord<Kaffee> found it
15:52:39FromDiscord<Kaffee> thx
15:52:58FromDiscord<Zachary Carter> Yeah, no problem
15:54:55*NimBot joined #nim
15:57:55FromDiscord<Hi02Hi> curious, is there another one for -d:danger?
15:58:38FromDiscord<Zachary Carter> I imagine it would just go into release? Also I don't know if `_d` is debug or develop 😛 I'm just guessing
16:00:02FromDiscord<James> In reply to @Encrypted Backpack "So the webhooks talking": Yeah, they’re bridging IRC and Gitter with Discord. What the community guidelines are trying to prevent is people using the bot api to create a 3rd party Discord client.
16:05:42FromDiscord<Encrypted Backpack> Oh okie I was just skeptical because I thought people we're abusing the API.
16:05:44FromDiscord<Encrypted Backpack> Sorry.
16:07:10FromDiscord<Shravan> how to measure execution time of a nim program?
16:12:33FromDiscord<Hi02Hi> sent a code paste, see https://play.nim-lang.org/#ix=3nWp
16:14:38FromDiscord<Shravan> thanks
16:15:30FromDiscord<Hi02Hi> you're welcome
16:22:03*ghosthell left #nim ("Leaving")
16:26:01FromDiscord<haxscramper> In reply to @Shravan "how to measure execution": https://github.com/treeform/benchy
16:26:33FromDiscord<haxscramper> Automatically computes average and re-runs as code several times
16:28:08FromGitter<BracketMaster> Pmunch: also - why did you use openarray?
16:32:41robertmetaAre the discord and gitter bots open source?
16:36:58FromDiscord<mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3nWu
16:48:06FromDiscord<pietroppeter> hi all, thinking of buying a mic to get a decent nimconf recording. I know basically nothing about it. not even defined a budget (well let's say < 200€) Suggestions?
16:52:51FromGitter<BracketMaster> I do a bit of filming on the side and use this guy: https://www.amazon.com/gp/product/B0002TTN3Y/ref=ppx_yo_dt_b_asin_title_o06_s00?ie=UTF8&psc=1
16:52:58FromGitter<BracketMaster> Can't go wrong with Audio Technica
16:56:46FromGitter<BracketMaster> you'll also need a USB ADC as well a phantom power brick
17:06:22FromGitter<kaushalmodi> I had ordered this set to record my presentation for a work conference and it worked wonderful: https://www.amazon.com/FIFINE-Microphone-Adjustable-Instruments-Streaming-T669/dp/B07Y1C6GDS ⏎ ⏎ I'd say that it would be pretty lowend for folks into recording and such, but I think it did the job really well.
17:12:05*avass quit (Quit: leaving)
17:16:44FromDiscord<treeform> In reply to @codic "is there a library": You can also take pixe's image reader and just rip the code out if you want to learn how it works.
17:17:09FromDiscord<treeform> https://github.com/treeform/pixie/blob/master/src/pixie/fileformats/bmp.nim
17:18:34FromDiscord<treeform> In reply to @haxscramper "https://github.com/treeform/benchy": My new Nim 2021 Conf talk will feature using benchy to optimize pixie. I hope it will be informative.
17:21:25FromDiscord<codic> i see, cool
17:22:55*voltist9 joined #nim
17:23:30FromDiscord<pietroppeter> Thanks for the suggestions on mics from gitter. Unfortunately they are not available in Amazon Italy...
17:24:33*hoek_ joined #nim
17:25:13*voltist quit (Quit: Ping timeout (120 seconds))
17:25:13*hoek quit (Ping timeout: 260 seconds)
17:25:14*voltist9 is now known as voltist
17:25:15*hoek_ is now known as hoek
17:25:45*Guest78830 quit (Ping timeout: 260 seconds)
17:25:46*joast quit (Ping timeout: 260 seconds)
17:26:30*WilhelmVonWeiner joined #nim
17:26:54*WilhelmVonWeiner is now known as Guest21384
17:28:26*letto quit (Quit: Konversation terminated!)
17:30:25*letto joined #nim
17:35:18*fredrikhr joined #nim
17:39:21*joast joined #nim
17:42:07*tane joined #nim
17:44:49FromDiscord<Varriount> Hm.. has #nim (freenode) been impacted by the recent idiocy by the Freenode owner?
18:03:08*Torro quit (Quit: bye)
18:07:25ebbNo, it's still here
18:08:25*FromDiscord quit (Remote host closed the connection)
18:08:41*FromDiscord joined #nim
18:12:17FromDiscord<exelotl> his behaviour is appalling
18:13:37FromDiscord<exelotl> dude's literally searching for channel topics saying "moved to liberachat" and seizing the channels
18:14:53*aenesidemus quit (Quit: Leaving)
18:25:40robertmetaYeah, we closed up #vim (1000+ users) due to it -- gross behavior and zero transparency or communication with the communities on here. Welcome to the 90s all over again.
18:26:09*superbia joined #nim
18:28:38*blackpawn_ quit (Quit: ZNC 1.7.2+deb3 - https://znc.in)
18:28:56*blackpawn joined #nim
19:02:11*mfx joined #nim
19:03:02*mfx quit (Client Quit)
19:10:25FromDiscord<kunitoki> Hey, is there a way to step debug macros in vscode ?
19:11:35FromDiscord<kunitoki> i've only been able to get debugging of executables working in vscode, with using --debugger:native and attaching lldb to the generated binary
19:13:32FromDiscord<kunitoki> it would be nice to be able to attach to the nim compiler and step debug the macro bodies 😄
19:39:54*FromDiscord quit (Remote host closed the connection)
19:40:11*FromDiscord joined #nim
19:45:22*vicfred joined #nim
19:47:48*narimiran quit (Ping timeout: 272 seconds)
19:49:24*vicfred quit (Client Quit)
19:50:11FromDiscord<SivadNai> noob question, how do I go about building this https://github.com/ftsf/nimsynth/ using its makefile
19:50:11*FromDiscord quit (Remote host closed the connection)
19:50:25*FromDiscord joined #nim
19:50:50*FromDiscord quit (Remote host closed the connection)
19:51:05*FromDiscord joined #nim
19:51:05*vicfred joined #nim
19:51:50*FromDiscord quit (Remote host closed the connection)
19:52:06*FromDiscord joined #nim
19:53:00*FromDiscord quit (Remote host closed the connection)
19:53:16*FromDiscord joined #nim
19:53:39*vicfred quit (Client Quit)
19:54:12*fredrikhr quit (Quit: Client Disconnecting)
20:04:54*FromDiscord quit (Remote host closed the connection)
20:05:20*FromDiscord joined #nim
20:21:03*lf joined #nim
20:21:27*lf is now known as Guest66296
20:25:00ForumUpdaterBotNew thread by Gcao: How to debug: SIGBUS: Illegal storage access. (Attempt to read from nil?), see https://forum.nim-lang.org/t/8044
20:25:01*FromDiscord quit (Remote host closed the connection)
20:30:26*lritter quit (Ping timeout: 252 seconds)
20:45:10*Guest66296 quit (Quit: Guest66296)
20:53:21*conkker7 joined #nim
20:54:50*lain quit (Ping timeout: 260 seconds)
20:55:18*superbia quit (Ping timeout: 260 seconds)
20:55:18*letto quit (Ping timeout: 260 seconds)
20:55:18*conkker quit (Ping timeout: 260 seconds)
20:55:19*conkker7 is now known as conkker
20:55:24*lain joined #nim
20:55:26*letto joined #nim
21:01:39*test_usr joined #nim
21:04:40*NimBot joined #nim
21:04:54*frd quit (Ping timeout: 252 seconds)
21:13:56*rockcavera quit (Read error: Connection reset by peer)
21:14:25*rockcavera joined #nim
21:31:53Zoom[m]<FromDiscord "<pietroppeter> hi all, thinking "> Hey, @pietroppeter, have you seen my guide on voice recording?
21:32:29Zoom[m]There's not much on mic models, but there's a bunch of other useful info.
21:33:42*Vladar quit (Quit: Leaving)
21:34:29Zoom[m]https://indiscipline.github.io/post/voice-sound-reference/
21:38:11Zoom[m]Will Andreas give a talk, BTW?
21:39:38Zoom[m]I hope he got himself a mic. He's the main face of the language, I think it's important to present his ideas in the best possible quality.
21:45:51*Guest66296 joined #nim
21:52:52*tane quit (Quit: Leaving)
22:08:42*arkurious quit (Quit: Leaving)
22:13:20*theelous3 joined #nim
22:14:23*fifth quit (Ping timeout: 265 seconds)
22:39:17ForumUpdaterBotNew thread by Lscrd: Date issue. What happened in 1940?, see https://forum.nim-lang.org/t/8045
22:45:39*Guest66296 quit (Quit: Guest66296)
22:46:01*Guest66296 joined #nim
23:45:47*Guest66296 quit (Quit: Guest66296)
23:46:11*Guest66296 joined #nim