<< 21-05-2020 >>

00:00:29*gxt quit (Remote host closed the connection)
00:02:08*gxt joined #nim
00:05:27skrylar[m]that's probably fine. vsts don't do that
00:06:00skrylar[m]you mostly get called via cdecl to fill a buffer with noise, and occasionally get told to turn some knobs, but plugins don't pass things to one another really
00:10:55Yardanicook, minimized https://github.com/nim-lang/Nim/issues/14410 to the full extent and found the first bad commit with bisect, time to go to sleep
00:10:58Yardanicogood night everyone
00:11:52FromGitter<gogolxdong> What's type of proc in object , closure or pointer, value type or ref type?
00:13:25skrylar[m]procs are value types
00:13:35skrylar[m]if its a closure there is a hidden ref for the environment
00:15:35FromGitter<gogolxdong> will ``` ⏎ type Person = object of RootObj ⏎ ⏎ `````` ⏎ be copied at assignment? [https://gitter.im/nim-lang/Nim?at=5ec5c8276e837c7743c33a39]
00:16:06FromGitter<gogolxdong> ```type Person = object of RootObj ⏎ speak*: proc(Person)``` [https://gitter.im/nim-lang/Nim?at=5ec5c846e06728175b7fad78]
00:16:13PMunchHmm, sleep, that might be a good idea..
00:17:09*PMunch quit (Quit: leaving)
00:20:09FromGitter<gogolxdong> means proc in object is value type as well?
00:29:01*Jesin quit (Quit: Leaving)
00:37:22zacharycarteri
00:37:24zacharycarterwhoops
00:42:40*dddddd quit (Ping timeout: 246 seconds)
00:45:39*Jesin joined #nim
00:46:52*gxt_ joined #nim
00:48:43*gxt quit (Ping timeout: 240 seconds)
01:01:13*dadada quit (Ping timeout: 246 seconds)
01:08:06*dadada joined #nim
01:08:30*dadada is now known as Guest52529
01:15:03*gxt_ quit (Ping timeout: 240 seconds)
01:28:17*chemist69_ quit (Ping timeout: 272 seconds)
01:29:09nimskullis there a difference between .. and ... for sequences?
01:29:46*chemist69 joined #nim
01:31:51*Guest52529 quit (Ping timeout: 265 seconds)
01:32:47*theelous3 quit (Ping timeout: 260 seconds)
01:33:07leorize[m]do we even have `...`?
01:33:44FromDiscord<zetashift> We don't
01:34:46nimskullwell now I can't find the code I saw with ... :(
01:36:58nimskullwhat is `..<` ? is 0..<n the terse version of 0..n-1?
01:37:40FromDiscord<zetashift> Yes it is
01:38:08*dadada joined #nim
01:38:31*dadada is now known as Guest93405
01:38:34FromDiscord<zetashift> `1..10` includes 10 and `1..< 10` does not
01:40:45*tefter joined #nim
01:45:16*nimskull quit (Remote host closed the connection)
01:53:29*nimskull joined #nim
02:02:16*Guest93405 quit (Ping timeout: 256 seconds)
02:03:03*s4mu3lbk quit (Remote host closed the connection)
02:08:11*dadada__ joined #nim
02:16:33nimskullin arraymancer, when I declare a proc with return type say Tensor[float]... how do I say how big (shape or total size in floats) result is?
02:16:58nimskullI've been looking at how linspace is defined in arraymancer source and it just seems to come out of nowhere
02:18:44nimskullwell looking again he declares `result = newTensorUninit[float](num)` in what I thought was boring setup (I guess it is setup!)
02:19:16*zacharycarter quit (Ping timeout: 256 seconds)
02:19:39nimskulldoes this mean that a proc of return type Tensor[float] really just returns a pointer to some arbitrarily sized tensor somewhere? can that tensor's size be changed (not just shape?)
02:25:55*audiofile quit (Quit: Going offline, see ya! (www.adiirc.com))
02:26:57*zacharycarter joined #nim
02:31:10*zacharycarter quit (Ping timeout: 246 seconds)
02:31:47*dadada__ quit (Ping timeout: 265 seconds)
02:34:32*nimskull quit (Remote host closed the connection)
02:36:48*muffindrake quit (Ping timeout: 265 seconds)
02:38:05*dadada joined #nim
02:38:30*dadada is now known as Guest41970
02:38:45*muffindrake joined #nim
03:02:01*Guest41970 quit (Ping timeout: 264 seconds)
03:05:14*Tongir joined #nim
03:05:16*zacharycarter joined #nim
03:07:59*Tlanger quit (Ping timeout: 260 seconds)
03:08:06*dadada__ joined #nim
03:09:40*zacharycarter quit (Ping timeout: 246 seconds)
03:13:25leorize[m]@mratsim ^
03:31:55*dadada__ quit (Ping timeout: 258 seconds)
03:38:11*dadada joined #nim
03:38:34*dadada is now known as Guest80839
03:43:05*zacharycarter joined #nim
03:44:24skrylar[m]huh. defold is open source now
03:47:58*zacharycarter quit (Ping timeout: 260 seconds)
03:48:03*waleee-cl quit (Quit: Connection closed for inactivity)
04:01:58*Guest80839 quit (Ping timeout: 260 seconds)
04:06:01*supakeen quit (Quit: WeeChat 1.9.1)
04:06:44*supakeen joined #nim
04:08:05*dadada__ joined #nim
04:17:52*Senketsu joined #nim
04:32:18*dadada__ quit (Ping timeout: 272 seconds)
04:32:21PrestigeI'm attempting to run a command with startProcess that takes an environment variable. Is this possible? It seems to not evaluate $MYARG
04:32:48PrestigeI suppose I could use poEvalCommand since it's the user's own config file
04:38:16*dadada joined #nim
04:38:40*dadada is now known as Guest55587
04:45:34FromDiscord<Elegant Beef> Prestiege are you using putEnv?
04:45:43FromDiscord<Elegant Beef> (edit) 'Prestiege' => 'Prestige'
04:47:00*narimiran joined #nim
04:48:35*nsf joined #nim
04:51:22PrestigeNah I just ended up going with poEvalCommand
04:56:18*thomasross quit (Ping timeout: 265 seconds)
04:58:37*Nilium joined #nim
05:02:18*Guest55587 quit (Ping timeout: 256 seconds)
05:08:05*dadada__ joined #nim
05:31:25*dadada__ quit (Ping timeout: 246 seconds)
05:38:09*dadada joined #nim
05:38:32*dadada is now known as Guest10686
05:47:26*gangstacat quit (Quit: Ĝis!)
05:59:34*gangstacat joined #nim
06:01:54*Guest10686 quit (Ping timeout: 260 seconds)
06:06:15*Tlanger joined #nim
06:06:47*nimskull joined #nim
06:08:07*dadada__ joined #nim
06:08:37*solitudesf joined #nim
06:08:48*Tongir quit (Ping timeout: 265 seconds)
06:14:56*silvernode joined #nim
06:16:27silvernodeSo I can't seem to make .gitignore, ignore my compiled project binary. I have never had a problem like this since usually just putting the name of the binary in the ignore file works.
06:17:02Prestigesilvernode: if it's already added to the index you need to remove it
06:18:21silvernodePrestige, Now that you mention it, I think I added the binary to the index by mistake before I created the ignore file
06:19:28PrestigeI've made the mistake before :)
06:19:45silvernodeI have never forgotten to create the ignore file first until now. So I am not sure how to remove stuff from the index
06:20:27silvernodeDo you know how from memory?
06:21:37PrestigeI think git rm myfile
06:21:44silvernodegit rm --cached
06:23:41silvernodefatal: pathspec 'tuxn' did not match any files
06:23:45silvernodewtf
06:26:40*rockcavera quit (Remote host closed the connection)
06:26:41nimskullI'm fumbling with arraymancer. I have a 2D (m, n) array result, and a 1D array (n) p. result[0, _] = p.reshape(1, n) _works_ but seems clunky. Is there an idiomatic or more efficient way to set a lower dimension slice of a Tensor?
06:27:59*nisstyre quit (Ping timeout: 244 seconds)
06:31:58*dadada__ quit (Ping timeout: 246 seconds)
06:34:06*zacharycarter joined #nim
06:38:07*dadada joined #nim
06:38:30*dadada is now known as Guest16955
06:38:34*zacharycarter quit (Ping timeout: 256 seconds)
06:43:37silvernodeSo I couldn't figure out how to use parseopts to take command line args so I hacked together something crude using various examples I found online. Here is what I have https://play.nim-lang.org/#ix=2mSf
06:44:32silvernodeI am not wantng to use this method in my final design but so far it is the only thing I have gotten to work.
06:53:07*Trustable joined #nim
06:53:19*silvernode quit (Ping timeout: 246 seconds)
06:54:53*nisstyre joined #nim
07:02:26*Guest16955 quit (Ping timeout: 256 seconds)
07:08:14*dadada__ joined #nim
07:23:08Araqup/downvotes please https://github.com/nim-lang/RFCs/issues/224
07:23:12disbotDeprecate `==` for refs and procs ; snippet at 12https://play.nim-lang.org/#ix=2mSu
07:23:45Prestigefancy
07:23:58Prestigethe bot I mean :P
07:26:57Araqand downvoting it is perfectly fine
07:27:24AraqI don't offer you the choice for things we'll do either way :P
07:42:25*Vladar joined #nim
07:49:51skrylar[m]i kind of don't like it but simultaneously this is why you end up with so many versions of ==/eq/equals in lisp and js
07:59:15*endragor joined #nim
08:07:57alehander92Araq
08:07:59FromGitter<Clyybber> @timotheecour Your foldr fix is a good one, but do you know what caused the crash? Seems weird to me that the behaviour differs between normal function call syntax and method call syntax
08:08:05alehander92i kinda agree that
08:08:23alehander92two operators would be good : one for "content" equality and one for identity
08:08:49alehander92but in this case `==` still makes sense for refs , right?
08:09:06FromGitter<Clyybber> alehander92: The problem is, the content equality one has many possiblities, do you also want to content compare nested refs, and how deep?
08:09:19alehander92that's true for trees
08:09:31alehander92so yeah i get it
08:09:46alehander92to prevent bugs, no `==` so people need to read on `eq<kind>`
08:10:02FromGitter<Clyybber> I'd like == to stay for refs
08:10:11FromGitter<Clyybber> and simply mean they point to the same memory
08:10:15alehander92but this leaves room for bugs indeed
08:10:20FromGitter<Clyybber> How so?
08:10:34FromGitter<Clyybber> People should maybe think when coding :p
08:10:44alehander92because then people can mistakenly write code thinking its content equali
08:10:56alehander92well ok then
08:11:12alehander92identity is supposed to be `is` , right
08:11:20alehander92so equal addresses should be `is`
08:11:30FromGitter<Clyybber> I don't think so
08:11:34FromGitter<Clyybber> is on types is not identity
08:11:45supakeen`is` is also a terrible operator name :(
08:11:51alehander92it is not
08:11:59FromGitter<Clyybber> IMO the == simply refers to the refs.
08:12:00alehander92i am not sure
08:12:09alehander92ok but guys
08:12:16alehander92this again mixes it all
08:12:39alehander92for one type its "those are identical", for other its "those might not be the same object but they are content-equal"
08:12:46dadada__I've mixed feelings about this, preventing programmers from making errors is a good goal
08:13:09dadada__but when programmers don't use their head while coding, is it really the fault of the language?
08:13:16FromGitter<Clyybber> alehander92: No, its always about equal, its just that pointers transform equal to identical
08:13:28alehander92but equality
08:13:29alehander92wait!
08:14:17alehander92sorry, there was a good blog on that by a scala guy
08:14:23alehander92i would search it
08:14:56skrylar[m]huh. i did a nimble search for earcut and also tesselator
08:15:05dadada__introducing new operators should be done in the context of existing operators, so when [] dereferences a reference, maybe something like ref1 [==] ref2 should exist for comparing refs by content
08:15:11skrylar[m]i guess this time something i wrotei s actually new for us :f
08:15:27FromGitter<Clyybber> that doesn't look bad
08:15:35FromGitter<Clyybber> but keep in mind that this is still not deep equality
08:16:01FromGitter<Clyybber> unless you use [==] in [==] too
08:16:06skrylar[m]i suggested `==` and `===` because the js folk already have === for extra equality
08:16:16Prestigewhat type of equality is this for if not deep equality?
08:16:31dadada__skrylar[m]: I don't think taking JS for inspiration is wise
08:16:34FromGitter<Clyybber> Prestige: Could be for deep equality, but only 1 layer
08:16:54FromGitter<Clyybber> Prestige: So comparing the contents of the ref object with == basically
08:17:08FromGitter<Clyybber> Deep equality would be comparing everything with [==] I guess
08:17:33alehander92sorry not important !
08:17:38PrestigeI feel like there should be procs with different levels of equality checking for procs
08:17:39alehander92the blog link
08:17:40FromGitter<Clyybber> But that could mean that a [==] could hang
08:17:44Prestigeif there are multiple levels people would use
08:17:51*zacharycarter joined #nim
08:17:58FromGitter<Clyybber> IMO that means that people should implement it themselves
08:18:03alehander92so anyway it might be a good thing to not mix equality and identity
08:18:06FromGitter<Clyybber> because it makes them think about what they want
08:18:08Prestigewhat about an ast comparison
08:18:11alehander92because they are really different concepts
08:18:14dadada__Clyybber: we could define [==] to be for deep content equality, but I think this is hard to solve for all types, or someone would already have done it, right?
08:18:23FromGitter<Clyybber> Prestige: Ast of a variable?
08:18:40Prestigeof the contents of the proc
08:18:48Prestigeor can u not get that at runtime
08:18:53FromGitter<Clyybber> dadada: Its easily possible, but I wouldn't put it in the stdlib
08:18:55alehander92and about multiple equality, usually one can have just flags
08:18:59FromGitter<Clyybber> Because it might infinite recurse
08:19:15skrylar[m]afaik you typically get either semantic equal or bit equal, and if you need any weird recursion thats the job of whatever semantic equal you coded
08:19:18skrylar[m]lisp also has these operators (semantic vs bitwise)
08:19:19alehander92something like `eq(depth=..)`
08:19:21dadada__Clyybber: ref[] == ref2[] # shallow equality ref [==] ref2 deep equality ref == ref2 # equality based on direct type
08:19:36FromGitter<Clyybber> alehander92: Problem is, you might want to deep compare one ref field, but not another
08:19:45FromGitter<Clyybber> So even depth is not enough in the general case
08:19:54FromGitter<Clyybber> So its better to let people just define it themselves
08:20:16Prestigewhat is == doing for refs and procs currently? for refs it just checks the dereffed value right?
08:20:35FromGitter<Clyybber> dadada: Yeah, ok. I have no strong objections about putting [==] in sugar.nim
08:20:46FromGitter<Clyybber> But it can hang, which is unfortunate
08:21:18FromGitter<Clyybber> Also [==] is not a possible operator afaikt
08:22:44alehander92clyybber yeah
08:23:05alehander92so that's why it's ok to have e.g. `===` or `id` or something for identity
08:23:08alehander92and no `==`
08:23:14alehander92so people are forced to read the docs
08:23:23alehander92and to find out which custom `eq` is best for their case
08:23:49alehander92also its important to keep generics in mind
08:23:55PrestigeI like the idea of adding more operators rather than just modifying ==
08:24:07alehander92many generic algo-s need to be able to call `equality` in some way
08:24:29alehander92so maybe a way for a user to define which eq operator to be used e.g. for searching
08:24:36alehander92is very important
08:24:48FromGitter<Clyybber> alehander92: I don't have strong objections against === but it would simply break a ton of code
08:24:56FromGitter<Clyybber> And actually would suck for generics
08:25:01alehander92but everything would
08:25:13FromGitter<Clyybber> No, leaving it as is wouldn't :p
08:25:17alehander92because as you said we already need custom `eq` for trees
08:25:27alehander92so now we just close our eyes for the problem
08:25:27FromGitter<Clyybber> I said we don't need it
08:25:32alehander92but we do
08:25:35FromGitter<Clyybber> No?
08:25:36alehander92i probably have like 2-3 custom eq-s
08:25:40alehander92for some of my trees
08:25:43FromGitter<Clyybber> Because they should define it themselves
08:25:46alehander92and if i used generic code
08:25:49FromGitter<Clyybber> alehander92: Yeah thats how it should be
08:25:53alehander92i have no idea how to pass it
08:25:58FromGitter<Clyybber> Alias it
08:26:09alehander92but i can use two ops
08:26:13alehander92in two different cases
08:26:21alehander92that's the whole point
08:26:26alehander92of having different equality options
08:26:58alehander92maybe some template-based apis can work e.g. `a.search(b, op=eq)`
08:27:25FromGitter<Clyybber> alehander92: IMO this could be solved by having an {.override.} pragma
08:27:29alehander92or even `a.index(b, op=eq(level=4))`
08:27:54alehander92Clyybber which locally overrides an op for an expression?
08:27:57FromGitter<Clyybber> alehander92: So that one can defined `==` on his scope and override the default `==`
08:28:02FromGitter<Clyybber> alehander92: Yeah
08:28:03alehander92ughhh
08:28:10alehander92it seems cute but very hacky
08:28:22dadada__Clyybber: it would Nim code inconsistent across different projects
08:28:42FromGitter<Clyybber> What would?
08:28:52alehander92`{.override: ==, eq}: a.index(b)`
08:29:08alehander92but i kinda see your point
08:29:16alehander92one can even do it with just block syntax
08:29:23FromDiscord<Clyybber> Yeah
08:29:24alehander92withEq(eq): a.index(b)
08:29:33alehander92which is more easy to nest / write etc
08:29:46alehander92or override(`==`, eq):
08:30:00alehander92which can be then used for custom allocation :P
08:30:17alehander92with(`allocator`, `myallocator`): expr
08:30:44alehander92but yeah, not the same, in the second case one just needs to replace some kind of variable/field
08:33:48*endragor_ joined #nim
08:36:18*liblq-dev joined #nim
08:36:49*endragor quit (Ping timeout: 264 seconds)
08:40:09*letto quit (Quit: Konversation terminated!)
08:42:02*neceve joined #nim
08:42:06*letto joined #nim
08:44:22*zacharycarter quit (Ping timeout: 272 seconds)
08:45:58*waleee-cl joined #nim
08:56:33dadada__is there hope for NimScript supporting casts from pointers to refs, cause this would make my code a lot less complicated
08:57:17dadada__the solution I have now seems to work fine at runtime, but just for compiletime, I'd need to write a lot of additional hacky code
08:57:22*Vladar quit (Quit: Leaving)
08:59:15alehander92why dont you just
08:59:19alehander92use runtime code all the time
08:59:25alehander92and staticExec some of it
08:59:38alehander92it seems simpler to just add some deserialization only there maybe
09:09:17FromDiscord<mratsim> For ref you can just use myRef1[] == myRef2[]
09:11:43FromGitter<jorjun_twitter> Let me have thoughts on why typescript type ‘number’ is not a genius initiative.
09:14:38dadada__jorjun_twitter: what's your thought on it?
09:17:28FromDiscord<mratsim> @Araq, @krux02, is this fix going into 1.2.2? https://github.com/nim-lang/Nim/pull/13742 we have arrays and sequences of 256-bit hashes that are quite large and iterating on them should not copy
09:17:31disbotfix #13739
09:27:05*leorize joined #nim
09:27:47*JustASlacker joined #nim
09:36:22*nimskull quit (Ping timeout: 260 seconds)
09:40:03*s4mu3lbk joined #nim
09:40:13FromDiscord<jasonfi> I've just written a new article on concurrency in Nim: https://onlinetechinfo.com/concurrency-and-parallelism-in-nim/
09:41:10*s4mu3lbk quit (Client Quit)
09:41:31*s4mu3lbk joined #nim
09:43:33*Senketsu quit (Ping timeout: 272 seconds)
09:45:02FromDiscord<mratsim> I think there should be a code example in the article
09:45:08FromDiscord<mratsim> it's too dry at the moment.
09:46:06FromDiscord<mratsim> for example computing Pi via monte carlo method: https://github.com/nim-lang/Nim/blob/devel/tests/parallel/tpi.nim
09:46:30FromDiscord<jasonfi> I wanted to link to code examples only, thanks I'll take a look at that link
09:48:47FromDiscord<jasonfi> is the threads module still in use? or is threadpool to be used instead?
09:49:03dadada__discriminator types don't work in compileTime tables, too? man, can't cast pointer to ref, and can't use kind either, ... what now
09:49:33dadada__ request to generate code for .compileTime proc: initTable
09:57:25nikita`is there a way to call constants defined in a C header? This is code I wrote https://git.gnunet.org/gnunet.git/tree/contrib/scripts/gnunet-bugreport#n449 it's not pretty but essentially I'm looking to replicate or improve on that in nim.
09:57:37nikita`just via ffi?
09:58:50*JustASlacker quit (Ping timeout: 256 seconds)
09:59:22*theelous3 joined #nim
10:01:36FromDiscord<mratsim> @jasonfi, it depends, if you need long-running threads you use createThread, if you need just tasks that are fire and forget you use threadpool
10:02:01FromDiscord<mratsim> var MyCONST {.importc.} = ctype
10:02:23nikita`oh
10:02:26FromDiscord<mratsim> or if the Nim name and C name are different ↵↵var MyCONST {.importc: "CNAME".} = ctype
10:02:42nikita`ok, thanks.
10:02:55FromDiscord<mratsim> examples: https://github.com/numforge/laser/blob/master/laser/photon_jit/photon_osalloc.nim#L64-L66
10:12:08FromDiscord<jasonfi> thanks
10:18:29*gxt_ joined #nim
10:24:30*JustASlacker joined #nim
10:27:13*nimskull joined #nim
10:27:16*nimskull quit (Client Quit)
10:37:38*abm joined #nim
10:38:22*dadada__ quit (Ping timeout: 272 seconds)
10:41:25*fredrikhr joined #nim
10:43:06*s4mu3lbk quit (Read error: Connection reset by peer)
10:46:42*s4mu3lbk joined #nim
11:00:46*tefter quit (Ping timeout: 246 seconds)
11:02:05*dadada joined #nim
11:02:28*dadada is now known as Guest49660
11:13:06*dddddd joined #nim
11:25:16*Satomi-Kowa joined #nim
11:25:27*marquisdefalbala joined #nim
11:28:38*tefter joined #nim
11:28:47FromDiscord<InventorMatt> are there any pure nim solutions for interfacing with a computer's webcam?
11:29:36*theelous3_ joined #nim
11:30:09FromDiscord<Recruit_main707> i doubt it
11:31:19FromDiscord<InventorMatt> that's what I figured as well. are there at least any good libraries that can readily do it?
11:35:46*waleee-cl quit (Quit: Connection closed for inactivity)
11:40:13FromGitter<bung87> you can try webgui using browser 's api
11:42:09*a_b_m joined #nim
11:45:13*abm quit (Ping timeout: 246 seconds)
11:53:59Yardanico@bung87 I think that's an overkill :)
11:55:01Yardanicoyou can write nim wrapper for v4l2
11:55:08Yardanicoor maybe nimterop will help
11:55:11*Guest49660 is now known as dadada
11:58:24dadadaInventorMatt: I believe ffmpeg is able to read from a webcam and convert to whatever you want,.. then you can read ie. an avi/mpeg/webm and work with that, if it's not ffmpeg then it's another tool, but there must be some, I know this works on Linux, but I suppose there are solutions on Windows too. If using an external program is acceptable for you.
12:02:15*waleee-cl joined #nim
12:04:49*JustASlacker quit (Ping timeout: 258 seconds)
12:06:02*supakeen quit (Quit: WeeChat 1.9.1)
12:06:25FromDiscord<InventorMatt> I was hoping I could do live editing to the video stream and I don't think ffmpeg can do live video streams
12:06:42*supakeen joined #nim
12:07:40*Trustable quit (Remote host closed the connection)
12:13:09FromGitter<bung87> Yardanico :P
12:14:00FromGitter<bung87> considering opencv?
12:15:48FromDiscord<InventorMatt> I tried wrapper by dom96 for it but I ran into dependency error for it and it the last update was 6 years ago so I don't know how up to date it is with the current state of nim
12:18:58FromGitter<bung87> simple solution using c2nim
12:20:09Yardanicoor nimterop as I said
12:20:43*gxt_ quit (Ping timeout: 240 seconds)
12:22:11FromDiscord<InventorMatt> I'll try and look into doing the conversion. My only concern is the scale of the opencv library making it difficult to fix if any errors occur
12:29:21FromGitter<bung87> what's my next project, I have no idea.
12:30:10Yardaniconim compiler
12:30:40FromGitter<bung87> oh no, I learnning nothing about compiler.
12:34:01*chemist69 quit (Quit: WeeChat 2.7)
12:34:21*chemist69 joined #nim
12:35:28*rockcavera joined #nim
12:39:40dom96InventorMatt: you're likely better off fixing my wrapper, we can help if you show us the problems you're running into :)
12:45:35FromDiscord<mratsim> @InventorMatt is there something already existing that does live editing? You can use Vapoursynth as a frame server but you won't be able to edit manually, only via script
12:48:21*JustASlacker joined #nim
12:50:28FromDiscord<InventorMatt> dom96: the error I'm getting running one of the examples is "could not load: (lib|)opencv_highgui(249|231|)(d|).dll" if you know what that is
12:50:47Yardanicowell that means you don't have the required opencv lib
12:52:19FromDiscord<InventorMatt> yeah, I figured as much. I just didn't want to go through the whole cmake process because I tend to have bad luck with that.
12:52:23*dadada quit (Ping timeout: 265 seconds)
12:53:13FromDiscord<InventorMatt> for a future nimble functionality would it be possible to also download external library dependencies and compile those so that users don't have to it themselves?
12:53:27Yardanicothat is already possible with custom nimble tasks
12:54:10*dadada joined #nim
12:54:33*dadada is now known as Guest49151
12:55:42*gxt joined #nim
12:56:49FromDiscord<InventorMatt> is there any resource that describes how to do that. the nimble page only has a small paragraph on nimble tasks
12:57:30Yardanicowell .nimble files are nimscript files
12:57:36Yardanicoyou can write a large subset of nim in them
12:57:52Yardanicohttps://github.com/kaushalmodi/hello_musl for example
12:57:57Yardanicohttps://github.com/kaushalmodi/hello_musl/blob/master/config.nims
12:59:03FromGitter<bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ec67b16ff7a920a72021f2e]
12:59:35FromGitter<bung87> https://github.com/nim-lang/zip/blob/master/zip.nimble
13:00:11FromDiscord<InventorMatt> thanks, I'll llook through those
13:00:15Guest49151is there a reverse {.compileTime.} to prevent something getting interpreted as a compileTime proc?
13:00:19*Guest49151 is now known as dadadad
13:00:37Yardanicodadadad: don't use const?
13:00:50dadadaddadadad: I don't use const AFAIK
13:01:12dadadador is there something that doesn't explicit call itself const that is also const?
13:01:52Yardanicodadadad: try https://nim-lang.org/docs/manual.html#statements-and-expressions-when-nimvm-statement ?
13:02:09Yardanicoyou can do {.error: "Can't execute at compile-time.} in the "when nimvm" branch
13:03:02Yardanicooh, that might not work
13:03:05*JustASlacker quit (Ping timeout: 258 seconds)
13:06:13FromGitter<Clyybber> @timotheecour ping
13:06:18Yardanicobut really why would you need that? dadadad
13:06:22Yardanicojust curious :)
13:07:29dadadadYardanico: the proc isn't supposed to be running in compile time, I've even ensured it can't by putting a when not nimvm around it
13:08:05Yardanicoso why are you worried now?
13:08:24dadadadworried? I just don't understand what nim wants from me
13:08:45Yardanico???
13:10:09dadadadlook, I've two procs, one that is supposed to work at compile time and one that isn't
13:10:29dadadadand I thought I could separate them with when nimvm
13:11:28FromGitter<Clyybber> Yeah, why wouldn't you be able to?
13:12:27alehander92but isn't top level ..
13:12:30alehander92like valid in both
13:12:51dadadad request to generate code for .compileTime proc
13:13:00alehander92exactly
13:13:07alehander92from when nimvm: else: .. other code
13:13:17alehander92i'd expect nim to try to generate other code for runtime
13:13:41dadadadall it tells me is the line, but I've no clue what I should do :-( nim makes me feel really dumb today
13:14:06dadadadalso yesterday, last week was better
13:15:24FromGitter<bung87> https://github.com/github/codeql anyone working on this ?
13:16:06FromGitter<bung87> add nim support on lgtm.com
13:16:39*zacharycarter joined #nim
13:16:59alehander92dadadad `when nimvm .. proc a` would just generate a top level proc always
13:17:25alehander92and else as well
13:17:34alehander92so i think when not nimvm cant ensure anything in that case
13:18:37alehander92btw i just get illegal context for 'nimvm' magic
13:22:10*endragor_ quit (Remote host closed the connection)
13:23:40FromDiscord<mratsim> @InventorMatt OpenCV should already be available through your mac or Linux package manager
13:23:53FromDiscord<mratsim> if you use windows there are package manager options there
13:24:11FromDiscord<mratsim> the C / C++ package situation is sad and we can't solve that
13:24:11FromDiscord<Clyybber> You have to put the when nimvm inside the proc
13:24:19FromDiscord<Clyybber> Its not valid at toplevel
13:25:56alehander92oi dadadad
13:25:59alehander92yardanico was right
13:26:06alehander92your case can be solved more simply
13:26:10*Vladar joined #nim
13:26:12FromDiscord<InventorMatt> @mratsim yeah, I forgot I had choco downloaded for my package manager so I am downloading opencv now. thanks for the help
13:27:26dadadadalehander92: maybe, but you both don't know the whole situation here...
13:27:40dadadadI would show you code, but currently it is an ugly mess
13:27:42alehander92hm http://ix.io/2mTL
13:27:48alehander92this should work for most code
13:28:03alehander92such a function should fail on compile time but be callable on runtime
13:28:12alehander92you can make a macro which can be used as a pragma and inserts that
13:28:18alehander92`{.noCompileTime.}`
13:28:40alehander92as Yardanico said, mostly using `error` when on ct
13:28:54alehander92you need import macros for error
13:37:12*audiofile joined #nim
13:39:45*liblq-dev quit (Ping timeout: 265 seconds)
13:42:00dadadadalehander92: what are the limitations around generics for nimvm
13:42:36dadadadI really want those procs to work in both compileTime and runTime but I tried to separate the code, because I didn't know why it failed, so I could dissect it
13:43:12alehander92well it seems it works
13:43:15alehander92ah ok
13:43:18alehander92then you can do the same
13:43:22*s4mu3lbk quit (Remote host closed the connection)
13:43:36dadadadI'm using exprs like getFoo[Yo[My]](nizzle)
13:43:44dadadadare those too demanding for nimvm?
13:43:47alehander92but .. i mean, then you can just do the normal thing not sure what the problem is
13:44:37alehander92i dont think so i can do `echo getA[seq[int]](@[2])`
13:44:52alehander92what exactly is failing
13:45:55dadadadif I knew that, I could fix it
13:55:38*tefter quit (Quit: WeeChat 2.8)
14:07:57*clemens3 joined #nim
14:08:33FromDiscord<willyboar> ~stream
14:08:34disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat)
14:13:06disruptekhey mr. boar.
14:13:29alehander92heyy
14:14:09FromDiscord<willyboar> I am the first
14:14:13FromDiscord<willyboar> 🙂
14:14:27alehander92:D :D is this a queue
14:15:01FromDiscord<willyboar> I am going to make a coffee
14:15:14alehander92cool
14:19:20*Satomi-Kowa quit (Ping timeout: 256 seconds)
14:21:37FromDiscord<willyboar> ready
14:21:56disruptekSWING FOR THE FENCES, BABY!
14:23:03*gxt quit (Ping timeout: 240 seconds)
14:23:05*natrys joined #nim
14:23:10alehander92i thought it sounds very american and that its a boxing phrase
14:23:20alehander92i found out its about baseball, now somehow it sounds even more american
14:23:25disruptekbaseball.
14:23:46livcdbaseball is also big in Korea and Japan :>
14:23:55alehander92THEY ARE AMERICAN
14:23:58alehander92only half kidding
14:24:18alehander92if only you guys could play footy
14:26:42*gxt joined #nim
14:27:29livcdIs it time for watermelon? Yes it is!
14:28:58livcdOh sh...Yeah this is what I hate about this marriage. My watermelon smells like kimchi.
14:33:15disrupteki should a tool that sits on a url and produces depedency graphs in svg for the given package set.
14:33:22disrupteks/should/should write/
14:33:40disruptekthen we can put it under a link on the directory and in README.md.
14:37:58*narimiran quit (Ping timeout: 256 seconds)
14:38:43dadadadsoo, here's what has happened
14:39:34dadadadI had a discriminator kind, one of those created an object field, which itself contained a NimNode field, but AFAIK, this object was never created, I instantiated it nowhere, this is why I believed it couldn't cause something like that
14:39:35FromGitter<kaushalmodi> disruptek: awesome
14:40:11dadadadin retrospect it should've occurred to me earlier that this was the cause, because I had similar issues with NimNode (which of course only works at compile time) before
14:40:23dadadads/onf of those/one of those kind kinds
14:41:44dadadadIMO NimNode should work at runtime to, and Nim should include a Nimparser that works in runtime, and returns NimNodes
14:42:15dadadadit could be useful for parsing config files and stuff like it
14:42:42dadadads/to/too s/in/at
14:44:13FromGitter<Clyybber> You can use the compiler api
14:44:18FromGitter<Clyybber> For stuff like that
14:44:25*inv2004 joined #nim
14:46:09*NimBot joined #nim
14:55:33*brainbomb joined #nim
15:00:57disruptekleorize: good job on the gentoo package. we need a stable version, no?
15:03:32FromDiscord<Recruit_main707> has someone ever been able to run a nim lsp in intellij?
15:09:49*dadadad quit (Ping timeout: 264 seconds)
15:13:21*nsf quit (Quit: WeeChat 2.8)
15:13:26Prestigedoes intellij support lsp?
15:14:56FromDiscord<Recruit_main707> yes
15:17:50*liblq-dev joined #nim
15:19:25disruptekleorize: why don't we install nimble with nimble and put the nimble that ships with nim into libexec/bootstrap-nimble?
15:26:21FromDiscord<Recruit_main707> but it says something about nimlsp.exe keeps crashing due to java IOException
15:28:55FromDiscord<Recruit_main707> i think it has to do with hovering over the functions
15:32:29FromDiscord<Recruit_main707> for now adding a really big timeout seems to be the only option to avoid the crash
15:36:10*dadadad joined #nim
15:43:30*inv2004 quit (Read error: Connection reset by peer)
15:51:52*konvertex joined #nim
15:51:56*nphg joined #nim
15:54:12leorize[m]disruptek: becsuse nim don't ship with nimble source the last time I checked
15:54:32disruptekrelaly?
15:54:41disruptekhow do we build it?
15:54:47leorize[m]well certainly not the git version
15:55:00leorize[m]stable version probably have it
15:55:19disruptekwell, we need a stable gentoo ebuild, right?
15:55:39leorize[m]gentoo already got one :p
15:55:46disruptekoh, nice.
15:56:01disruptekwhere is it?
15:56:06disrupteki only have yours.
15:56:30leorize[m]should be dev-lang/nim too, I doubt they removed it
15:57:37shashlickKoch clones a specific tag of nimble and builds it
15:57:59*silvernode joined #nim
15:58:37*xet7 quit (Quit: Leaving)
16:01:32FromDiscord<Yardanico> A specific commit, yeah
16:02:10leorize[m]well I'm also skeptical of packaging any nimble packages, as nimble don't support system-provided packages
16:04:25*Perkol joined #nim
16:07:56dadadadhas anyone done a conversion proc from a genAstRepr string to NimNodes?
16:08:29dadadadas repr is supposedely not reliable the serialization from NimNode -> genAstRepr -> NimNode would be preferable
16:39:52*Vladar quit (Quit: Leaving)
16:40:15*brainbomb quit (Quit: Leaving.)
16:41:14*ftsf quit (Ping timeout: 240 seconds)
16:51:21*liblq-dev quit (Ping timeout: 256 seconds)
16:59:48*krux02 joined #nim
17:03:11*narimiran joined #nim
17:03:25disruptekhow do i cast a set of enums into an int?
17:09:06disruptekno way to do this in the vm agaict.
17:10:36FromDiscord<mratsim> int(myEnum)
17:10:43FromDiscord<mratsim> ah a set
17:10:49FromDiscord<mratsim> nope
17:12:45federico3how can I create a variable in a template and make it available in a "body" of code inside?
17:15:07federico3 {.inject.}
17:16:00*Brandon__ joined #nim
17:17:23*gxt quit (Ping timeout: 240 seconds)
17:18:23*gxt_ joined #nim
17:19:25*bebarker quit (Ping timeout: 264 seconds)
17:27:52FromGitter<kaushalmodi> Would anyone on Linux 64-bit would like to give this a try: https://github.com/kaushalmodi/version/releases ?
17:27:58FromGitter<kaushalmodi> Open for feedback on code, etc
17:28:05FromGitter<kaushalmodi> !repo version
17:28:09disbothttps://github.com/moigagoo/nimage -- 9nimage: 11Dockerfiles for various Nim versions published on Docker Hub 15 36⭐ 6🍴 7& 29 more...
17:28:15FromGitter<kaushalmodi> oh well
17:28:45FromGitter<kaushalmodi> https://kaushalmodi.github.io/version/
17:32:11*brainbomb joined #nim
17:42:16leorize!repo kaushalmodi/version
17:42:19disbothttps://github.com/kaushalmodi/version -- 9version: 11Fetch and parse the version number of most CLI apps 15 2⭐ 0🍴
17:48:50disruptek!pull count
17:48:55disbothttps://github.com/nim-lang/Nim/pull/13837 -- 6feature/count 7& 29 more...
17:49:14*dadadad quit (Ping timeout: 240 seconds)
17:51:22*dadadad joined #nim
17:54:39*Trustable joined #nim
18:09:39*Vladar joined #nim
18:21:32*xet7 joined #nim
18:31:21*lritter joined #nim
18:31:46*brainbomb quit (Quit: Leaving.)
18:38:08FromGitter<danielecook> Hey folks I'm trying to parallelize this function: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ec6ca90225dc25f54998778]
18:38:16FromGitter<danielecook> but it's coming back as not GC safe
18:38:22FromGitter<danielecook> ` Error: 'spawn' takes a GC safe call expression`
18:39:00FromGitter<danielecook> Anything obvious in there? I've tried quite a few things but no luck
18:39:11*PMunch joined #nim
18:41:13dadadadis it idiomatic nim to use include to split up big modules?
18:41:46Zevvnope. But nim does it itself, though
18:42:35dadadadmakes the work on modules in vscode a lot more cumbersome, hitting F6 for running the module code won't work then... you always have to go to the module file ... also the autocompletion won't work well... this is not nim's fault of course
18:43:46dadadadI'd like some opinions, what do you mean by name
18:43:49dadadadname=nope
18:44:03dadadadyes, it means no, but why is it not idiomatic
18:44:24PMunchI'd say splitting a large module up into "include"-ed files is pretty idiomatic
18:44:32Zevvmight me just my personal experience, I don't make the idioms
18:44:41Zevvwell, there you have it :)
18:45:07PMunchOr import/export of course
18:45:16PMunchDepends a bit on what you're doing
18:45:40dadadadokay, btw. for the fact that vscode is recommended as IDE for Nim I think the extension is still pretty basic, everything that's slightly of the norm won't work
18:47:05PMunchPRs welcome
18:47:30dadadadjavascript :-(
18:47:39PMunchOh, haha :P
18:47:42leorizerewrite it in Nim :P
18:47:52PMunchSwitch to NimLSP, it's written in Nim :)
18:47:52leorizeor switch to neovim and use the superior nim.nvim :P
18:48:52leorize@danielecook: use initRand to create a random generator
18:49:05leorizethe `rand` function uses the global generator by default
18:52:25FromGitter<danielecook> ok i'll give that a try
18:52:47Prestigeor use nimlsp with nvim :P
18:54:22FromDiscord<Generic> there are certainly some problems with the nim vscode plugin
18:54:39FromDiscord<Generic> but at some point it's also nimsuggest
18:55:03PMunchBasically, everyone should switch to NimLSP so that all our efforts are concentrated
18:56:04leorizeyou get highlighting implemented in nimlsp, and I will switch nim.nvim to it :P
18:56:19leorizethough you should also make nimlsp a part of nim too
18:56:24*liblq-dev joined #nim
18:56:40PMunchI started working on getting highlighting in it
18:56:54FromGitter<danielecook> @leorize no luck unfortunately. If I add the gcsafe pragma I get this
18:57:29FromGitter<danielecook> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ec6cf18b101510b200bd3b0]
18:58:07leorizeyou don't create a Rand object then discard it right after like that...
18:58:08FromGitter<danielecook> Failure always happens around ~567
18:58:31leorizeread the docs
18:59:30FromGitter<danielecook> ok sorry i've been hammering away for a few hours I'll slow down here a bit
19:00:18leorizegolden rule in Nim: if you use discard you probably are ignoring something important :P
19:01:39PMunchThat's why its there :) So that you know that you're doing something silly
19:03:18dadadadI think it makes sense, yet I wish for a nicer word, and I thought about one: miss <- if you use miss, something is probably missed
19:03:35disruptekhow about smack?
19:03:40disruptekif you use discard you get a smack.
19:03:51PMunchHaha
19:04:08PMunchdadadad, you can rename it to whatever you like with a template :)
19:04:13dadadadwe could use fuck, if it wasn't against the rules of a polite society
19:04:24dadadadPMunch: and I probably will
19:04:37PMunchYou could also write a template that turns non-null return codes to an exception for example
19:04:52PMunchWhich is more in-line with what Nim typically expects to happen when stuff goes wrong
19:05:13PMunchdadadad, that reminds me of a shell program I had that was called fuck
19:05:24PMunchIt would look at your last command and guess how it was mis-spelt
19:05:40krux02PMunch: Ignoring the "polite" attribute, I think the word "fuck" has a secondary meaning that could be misleading.
19:05:52dadadadPMunch: you could integrate it into the shell, it possible to hook into it
19:05:55dadadadits
19:05:56PMunchSo if you mis-spelled anything you could just hit "fuck" in the terminal and it would try to fix you error
19:06:29PMunchkrux02, which is the secondary meaning?
19:06:42krux02to have reproductive activity
19:06:52PMunchI mean it would look bad if you did "fuck node.sons"
19:07:04krux02yea pretty much
19:07:12dadadadif funny is bad to you, then yes
19:07:22PMunchHaha :P
19:07:32*dadadad is now known as dadada
19:07:43krux02well, discard node.sons is also weird.
19:07:48PMunchThere was a FOSDEM talk about a guy who wrote a small programming language that basically allowed you to write code as prose
19:08:01PMunchkrux02, yeah it's a pretty nonsensical thing to do
19:08:16PMunchUnless `node.sons` refreshed a cache or something
19:08:23krux02yea those esoteric programming languages again.
19:08:24dadadamiss node.sons <- makes sense, admit it!
19:08:48krux02 I hear so often about them. But I also think they are neither funny nor interesting in any particular way.
19:10:00krux02I like Brainfuck, because it maps so nice to a turing machine. But I think all those derivatives that have a 1:1 mapping to brainfuck just not worth mentioning. And that includes the language Whitespace.
19:10:47krux02also this prose language is just a language that has many room to put comments and after all, the comments make the code look like prose.
19:10:47zacharycarterhttps://play.nim-lang.org/#ix=2mVv - how can I add an offset to the pointer so it points at `o` instead of `f`?
19:11:07zacharycarteror do I just need to keep track of the offset and use it with the subscript operator?
19:11:22krux02pleas cast to `uint` not ByteAddress
19:11:36zacharycarteruint8?
19:11:42krux02I think ByteAddress should be deprecated, as it has the wrong signedness.
19:11:44krux02uint
19:12:32dadadado the devs of vscode intentionally produce bugs to make me mad?
19:12:40dadadadoes someone know?
19:12:44FromDiscord<Generic> what is it now?
19:12:59krux02zacharycarter, what do you exactly mean with `f`s
19:13:01krux02?
19:13:12krux02I see neither o nor f in your example code
19:13:25dadadaGeneric: 1) you have some of my comments with a grain of salt, I'm not actually mad 2) the scroll bar can not be moved with the mouse anymore :D
19:13:39zacharycarterlook at the string krux02
19:13:51zacharycarterits value is `foo`
19:14:02FromDiscord<Generic> dadada: it works for me
19:14:04dadadas/have/have to take
19:14:23dadadaGeneric: it worked for me, until it randomly didn't, then it worked, again, until it randomly didn't
19:14:23krux02addr foo[1]
19:14:36zacharycarterbut I added an offset to the pointer right?
19:15:14FromDiscord<Generic> dadada: not 100% related, but do you have the mini map enabled? It makes scrolling with the mouse a lot nicer
19:15:45krux02zacharycarter, your += doesn't modify the pointer
19:16:01krux02wait
19:16:40dadadaGeneric: you're right, yet I disabled it to save horizontal space, have a split window most of the time
19:17:01zacharycarterah okay I think I get why
19:18:10*s4mu3lbk joined #nim
19:18:13leorizeyou don't really have to do all this math, just cast it to openarray then get the address back :P
19:20:10krux02sizeof(UncheckArray) is always 0
19:21:18krux02zacharycarter: http://ix.io/2mVy
19:21:39zacharycarterthanks
19:22:25krux02the question though is, do you want to operate on unchecked array so you can use the subscript operator, or do you want to work on `ptr` with pointer arithmetics?
19:22:44zacharycarterwell unchecked array - but I guess I'll just use a nim string and keep an offset
19:22:48zacharycarterthat's probably the simplest thing to do
19:23:23FromDiscord<Generic> you might as well use cast[ptr UncheckedArray[yourtype]](addr uncheckedarray[offset])
19:25:33leorizeif you only wanted zero-copy slicing then toOpenArray provides thta
19:25:35leorizethat*
19:26:05FromDiscord<Generic> though openarrays can't be put into variables, only arguments
19:26:13FromDiscord<Generic> (unfortunately)
19:26:38*fredrikhr quit (Disconnected by services)
19:26:47*couven92 is now known as fredrikhr
19:27:05*couven92 joined #nim
19:29:12*Vladar quit (Quit: Leaving)
19:37:19*Perkol quit (Remote host closed the connection)
19:41:12*couven92 quit (Ping timeout: 256 seconds)
19:43:07*NimBot joined #nim
19:46:18*sbeam joined #nim
19:51:31*silvernode quit (Quit: Leaving)
19:56:39*PMunch quit (Quit: leaving)
19:58:39FromDiscord<Recruit_main707> what would be the nim version of this? https://stackoverflow.com/a/54166481/10817928
20:06:13*sbeam quit (Quit: WeeChat 2.6)
20:08:54FromDiscord<Recruit_main707> i just dont understand how it works
20:10:24*fredg joined #nim
20:12:23FromDiscord<Recruit_main707> im surprised c2nim actually parsed it
20:14:28FromDiscord<Recruit_main707> but it doesnt really work :P
20:17:59FromDiscord<Elegant Beef> @Generic what's unfortunate about that?
20:18:34FromDiscord<Elegant Beef> With relatively little code you can abstract away the seq.add proc and make a fixed length array. https://play.nim-lang.org/#ix=2mVT
20:18:47FromDiscord<Elegant Beef> That can have a dynamic size
20:18:53FromDiscord<Elegant Beef> (edit) 'That can have a dynamic ... size' => 'That can have a dynamicruntime'
20:25:41FromDiscord<Generic> @Elegant Beef it could be used for something like this https://github.com/nim-lang/Nim/pull/13508 but without ptr
20:25:45disbotnew syntax for lvalue references: `var b {.byaddr.} = expr` ; snippet at 12https://play.nim-lang.org/#ix=2mVU
20:26:15FromDiscord<Generic> of course what would be better would be if openarrays could even be put into objects
20:27:05FromDiscord<Elegant Beef> Well atleast an array type that has an runtime intialized size value that cannot be changed without remaking the array
20:28:00FromDiscord<Elegant Beef> Cause if you want what you're asking a seq already does that
20:28:10*narimiran quit (Ping timeout: 265 seconds)
20:28:35FromDiscord<Elegant Beef> Although im a numpty so...
20:33:39*tane joined #nim
20:43:42FromDiscord<exelotl> hmm byaddr seems interesting
20:52:21FromDiscord<exelotl> I'm sure there's cases where I've wanted this in gba dev, though it doesn't work in the most common case because all the IO registers need to be marked as volatile
20:54:36FromDiscord<exelotl> you can explicitly use `volatileLoad` and `volatileStore` in Nim, but that's a lot of hassle... way easier to just import all the register definitions from C
20:57:45*natrys quit (Quit: natrys)
20:58:12FromDiscord<Recruit_main707> @Gary M this is still broken
20:58:14FromDiscord<Recruit_main707> https://media.discordapp.net/attachments/371759389889003532/713133571413377064/unknown.png
21:00:45FromDiscord<Recruit_main707> and emit should not be all blue https://media.discordapp.net/attachments/371759389889003532/713134206208704552/unknown.png
21:03:38*a_b_m quit (Quit: Leaving)
21:07:22FromDiscord<dom96> my god, GitHub's stupid "Author" auto complete on PRs really irritates me
21:07:30FromDiscord<dom96> Why can't it ever find poor rayman22201?
21:07:47supakeenBecause of the other 22200 rayman's coming first?
21:09:37FromDiscord<Recruit_main707> in a 1/10 scale, how big is this sin? https://media.discordapp.net/attachments/371759389889003532/713136434105810944/unknown.png
21:10:16FromDiscord<Recruit_main707> its for interoping with python, and i need to use this fake c arrays
21:11:51FromDiscord<Generic> quite high, because if I'm not wrong you could use ptr UncheckedArray[cint] instead
21:12:21FromDiscord<Recruit_main707> i thought about it
21:12:36FromDiscord<Recruit_main707> can someone else with a higher iq confirm this?
21:13:45FromDiscord<Recruit_main707> yessssssssss
21:13:47FromDiscord<Recruit_main707> it works
21:13:51FromDiscord<Recruit_main707> thank god
21:14:33dadadawho else likes Stevie Wonder? :P https://www.youtube.com/watch?v=FBtUiN_OA9I
21:17:29FromDiscord<Recruit_main707> even ptr array[3, cfloat] works, nice
21:28:06*sagax quit (Remote host closed the connection)
21:41:21*zacharycarter quit (Ping timeout: 256 seconds)
21:42:22*samuelb_ joined #nim
21:44:02*s4mu3lbk quit (Ping timeout: 258 seconds)
21:50:48FromGitter<deech> Is there a `nim e ..` like command but allows interpreting directly from the shell? Like `nim interpret 'let x = 1; echo x + 1'`
21:51:20leorize`nim secret`
21:53:12FromGitter<deech> I though that was a joke but apparently not. Any pointers on how to use it?
21:55:37FromGitter<deech> Oh I see, it's a REPL. Neat.
21:56:35FromGitter<deech> Does it (will it) support all of Nim or just the VM subset?
21:58:36FromGitter<bung87> `bindSym("bindParam", brOpen)` I add since annotation to bindParam then it report `undeclared identifier: 'bindParam' ⏎ `
21:59:20*marquisdefalbala quit (Quit: Konversation terminated!)
21:59:56FromDiscord<Yardanico> @deech VM only for now
22:01:10FromGitter<deech> Cool. A full fledged REPL would be amazing.
22:02:32FromDiscord<Technisha Circuit> If I'm using the js backend, how do i import JS stuff?
22:04:44FromDiscord<Generic> there's a problem with REPLs for static programming languages
22:05:06FromDiscord<Generic> in dynamic programming languages everything is an object in a hash table which can be replaced
22:05:19FromDiscord<Generic> but that's not the case for Nim
22:06:14FromGitter<bung87> Technisha Circuit see document modules for js backend.
22:08:03leorizebung87: try brForceOpen or omit that parameter
22:08:42*sschwarzer joined #nim
22:08:54*fredg quit (Quit: Lost terminal)
22:09:36leorizeI wrote brOpen to allow for symbol mixin (ie. capturing the symbol from the another module)
22:10:06leorizesince it would facilitate user-extensible bindParam()
22:11:24FromGitter<bung87> let me try, I actually not understand what you mean
22:12:43*solitudesf quit (Ping timeout: 260 seconds)
22:14:22FromGitter<dawkot> How much more optimal is concatenating string like `a & b & c` in comparison to `result.add a; result.add b; result.add c`?
22:15:22FromGitter<bung87> none of them work
22:15:24leorizethe latter
22:15:44leorizebung87: hmm, what did you put in `since`?
22:16:21FromGitter<dawkot> Doesn't `&` have some magic compiler optimization?
22:16:24FromGitter<bung87> `{.since: (1, 4).}`
22:16:30FromGitter<dawkot> I recall Araq saying this
22:17:24leorizebung87: use (1, 3)
22:17:26FromGitter<bung87> I even try auto bind experiment
22:17:49sschwarzerleorize: Would also be interesting by _how much_ the speeds differ. (I don't expect precise numbers, but a rough value would be helpful.)
22:17:50leorizedawkot: you can benchmark it
22:18:11leorizeit really depends on how you do it
22:19:06FromDiscord<Yardanico> In some simple cases IIRC .add and & will perform the same
22:20:48*couven92 joined #nim
22:20:58*liblq-dev quit (Quit: WeeChat 2.8)
22:21:29*fredrikhr quit (Disconnected by services)
22:21:36*couven92 is now known as fredrikhr
22:22:09FromGitter<bung87> hmm that's wired , in another PR I using 1.4
22:22:28Yardanicoyou should use 1.3 though
22:22:30FromGitter<bung87> I was told current version is 1.3 so I should use 1.4
22:22:33Yardanicono
22:22:37Yardanicoyou should care about devel too :)
22:22:38*neceve quit (Ping timeout: 272 seconds)
22:23:06Yardanicoif you have since: (1, 4) and someone tries to use it on latest devel (which is 1.3.5 as of now) they won't be able to
22:23:17*couven92 joined #nim
22:23:53*inv2004 joined #nim
22:23:56Yardanicoguess what
22:24:05YardanicoI actually love the new dots for Processing hint :P
22:24:24leorizeit's gonna be like "..." then a bunch of CC?
22:24:37Yardanicoye
22:24:45FromGitter<bung87> why that PR pass, it use 1.4,
22:24:58Yardanicowhich PR?
22:25:00leorizesomeone didn't notice
22:25:03FromGitter<bung87> this PR even not pass compile
22:25:19Yardanicowell it will compile
22:25:24Yardanicoyou just won't be able to use the code in 1.3.5
22:25:29Yardanicoleorize: https://i.imgur.com/1OaxlRw.png
22:25:41FromGitter<bung87> https://github.com/nim-lang/Nim/pull/14416
22:25:48leorizeYardanico: ah, nice
22:25:49Yardaniconeed a newline before CC though
22:25:54leorizetrue
22:25:55Yardanicofor some reason it's not inserted here
22:26:31*sschwarzer quit (Quit: leaving)
22:26:33leorizebung87: you're not testing the new functions, that's why
22:26:35Yardanico@bung87 there are no tests for your new stuff
22:26:39Yardanicothat's why it will pass just fine
22:26:45Yardanicoand it will compile fine as well
22:26:56Yardanicosince pragma is really simple
22:27:36inv2004Hello, I have a question: I want to call echo on my structure in thread, but it says: `$` is not GC-Safe. ok, trying to put {.gcsafe.} on my `$` and I have: pragmas are only allowed in the
22:27:36inv2004header of a proc; redefinition of '$'
22:27:51Yardanicoinv2004: did you do a forward declaration of that $ ?
22:28:02Yardanicoforward declaration and the actual implementation must match all pragmas and annotations
22:28:31inv2004Is it about ownership? Probably not, just proc `$`*(x: K): string {.gcsafe.}
22:28:46leorizegcsafe is about not accessing globals
22:29:01leorizeglobals that contains gc memory to be precise
22:29:07FromGitter<bung87> @Yardanico ok, thanks I get it
22:29:10Yardanico@bung87 thathttps://github.com/nim-lang/Nim/blob/devel/lib/std/private/since.nim
22:29:12Yardanicosince is really simple
22:29:16*brainbomb joined #nim
22:29:22Yardanicoliterally two 2-line templates :)
22:30:12Yardanicoinv2004: can you show a bit more code and the whole error?
22:30:13inv2004@leorize, ok, found forward declaration - did not get why I need it here.
22:30:20FromGitter<bung87> ok so always since current version
22:30:27Yardanicoyes, current devel version
22:30:34Yardanicoyou can check which one it is in lib/system.nim
22:30:55Yardanicoor here http://nim-lang.github.io/Nim/system.html#NimVersion
22:31:01Yardanico(nightly docs)
22:31:12inv2004@Yardanico, here it is https://github.com/inv2004/kdb_nim/blob/d9ac5b1fc2e0c14ae868eb0b7525b28a431bcf51/src/kdb/format.nim#L84
22:31:28Yardanicoyeah as I said you need to match pragmas for the forward decl and proc itself
22:33:20inv2004Isn't forward declaration is just declaration, for example, at start of the module - to make it available for funtions before implementation?
22:33:31Yardanicowell it still needs to match the actual procedure
22:33:33FromGitter<bung87> oh , that's the devel version list there, someday I was scan source by eye check where is the version number...
22:33:34Yardanicobecause pragmas can affect a lot of stuff
22:33:39Yardanicothey can change the whole proc
22:34:22inv2004@Yardanico, does it mean - I cannot set gcsafe on $ ?
22:34:26Yardanicoyou can?
22:34:30Yardanicojust set it in the forward declaration as well
22:34:52Yardanicoproc `$`(x: K): string {.gcsafe.} for the forward decl
22:34:54inv2004Ah, I have forward declaration!!! :) I did not see it, thx :)
22:34:56Yardanicoproc `$`(x: K): string {.gcsafe.} = stuff for the actual proc
22:35:18inv2004I did not see it at the beginning of my file. Thx :)
22:40:14FromDiscord<mratsim> Why make a blog post when you can make a repo: https://github.com/mratsim/trace-of-radiance↵↵@disruptek if you wanted to play with raytracers, it's not parallelized though but I have some extension plans.↵@narimiran / @Araq, I was thinking of using that text as a blog post on Nim website, thoughts?
22:42:02Yardanico915 members in the Discord server, nearing that 1k mark :D (albeit most of them are not active, just like in the Telegram group which has 480 members but activity comes from mostly the same people)
22:42:17inv2004Probably another question: I use terminaltables, and it shows that it is not gcsafe here: https://github.com/xmonader/nim-terminaltables/blob/master/src/terminaltables.nim#L73
22:42:37Yardanicomight be because it accesses unicodeStyle ?
22:42:44inv2004I am trying to pass the "style" to function - but it does not matter
22:42:46Yardanicohm
22:42:51Yardanicowhat does it show exactly?
22:43:09Yardanicoyou can try annotating newUnicodeTable proc itself with gcsafe to better understand why it's happening
22:43:16inv2004@Yardanico, exactly, that if why I am trying to pass it like parameter, I supposed that only default arg is global
22:43:42Yardanicowell newUnicodeTable calls newTerminalTable which accesses another global :)
22:43:48Yardanicocall newTerminalTable instead?
22:44:06Yardanicoah well it shouldn't error, hmm
22:44:24inv2004but arg should pass to terminaltable too
22:44:35*tane quit (Quit: Leaving)
22:44:44Yardanicoyeah, you can try to add gcsafe pragma to the proc itself to better understand what's the error
22:45:08Yardanicohmm I can also try myself, let's see
22:46:19Yardanico"Warning: 'newUnicodeTable' is not GC-safe as it accesses 'unicodeStyle' which is a global using GC'ed memory"
22:46:26inv2004yep
22:46:39inv2004but I do: let uS = Style(rowSeparator:"─", colSeparator:"│", cellEdgeLeft:"├", cellEdgeRight:"┤", topLeft:"┌", topRight:"┐", bottomLeft:"└", bottomRight:"┘", topRowSeparator:"┬", bottomRowSeparator:"┴", dashLineLeft:"├", dashLineRight:"┤", dashLineColSeparatorLastRow:"┴", dashLineColSeparatorTopRow:"┬", dashLineColSeparator:"┼")
22:46:39inv2004 let t = newUnicodeTable(uS)
22:46:40Yardanicoah right
22:46:42Yardanicoit's the bug
22:46:45Yardanicoin the library itself LOL
22:46:52Yardanicoinv2004: https://github.com/xmonader/nim-terminaltables/blob/master/src/terminaltables.nim#L74
22:46:53Yardanicocheck argument name
22:46:59Yardanicoand what is being passed to newTerminalTable
22:47:00Yardanico:DDDD
22:47:13Yardanico"style" vs "unicodeStyle"
22:47:23inv2004ah!
22:47:27inv2004yep, see it :)
22:47:35Yardanicoworks if you fix it
22:47:38Yardanicoyou can make a PR
22:47:42dadadadon't understand why multimonitor multiwindow coding seems to be so low on the list of IDE developers, it wasn't working easily or propely in emacs, I don't think vim is better, vscode also is not great at this, I can't remember a single IDE that was really good, maybe qtcreator but I don't remember
22:47:53inv2004I am going to use newAsciiTable :)
22:47:59Yardanicoinv2004: no PR? :P
22:48:03YardanicoI can make it myself then
22:48:38leorizedadada: poor developers can't afford more than one screen :P
22:48:47inv2004I am mix of WSL and win-10, but I can if you want :)
22:48:59FromGitter<timotheecour> is there `newAsciiTable` somewhere?
22:49:01dadadaleorize: they aint all poor :P I think its a plot to make me mad
22:49:19dadadas/its/it's
22:49:30Yardanicoinv2004: it's okay, I already opened it :)
22:49:47Yardanicodadada: well I have two displays
22:49:51Yardanico1920x1080 and 1280x1024
22:49:55Yardanicoand guess what I use the second display for?
22:50:04dadadaYardanico: mine are both 1920x1080
22:50:08Yardanicotwo workspaces, first one is Quassel | Telegram split 50/50 horizontally
22:50:13dadadaYardanico: the funny thing to say would be porn
22:50:18Yardanicosecond workspace on second display is VLC and mumble
22:50:24inv2004Pfff, I use two 960x1080
22:50:41Yardanicoon my main display I have browser on workspace 3, editor on workspace 2, and 1 and 4 are usually for some temp stuff
22:51:03FromGitter<timotheecour> besides `compiler/asciitables.nim` which I added a while back (and which shd probably be moved to fusion/asciitables (@inv2004)
22:51:14inv2004Probably another question, why does not it help? let uS = unicodeStyle.deepCopy()
22:51:14inv2004 let t = newTerminalTable(uS)
22:51:31inv2004If I define let uS = Style(...) - it is ok
22:54:03FromGitter<bung87> `Error: invalid pragma: since: (1, 3)` CI report this
22:54:23FromGitter<bung87> I've `include "system/inclrtl"`
22:54:30Yardanicothat's the wrong place though
22:54:45Yardanicoit's std/private/since now
22:54:51Yardanico"import std/private/since"
22:55:34leorizein the future we might want to make it a macro :P
22:55:44Yardanicoto report the error instead or something?
22:55:45leorizewhich can add a footnote to the docs
22:55:50Yardanicooh
22:55:52Yardanicoyeah right
22:56:14FromGitter<bung87> `Error: cannot open file: std/private/since`
22:56:21Yardanicowhat's your nim version?
22:56:25FromGitter<bung87> nim -v ⏎ Nim Compiler Version 1.3.1 [MacOSX: amd64]
22:56:28Yardanicothat's pretty old
22:56:41Yardanicohttps://github.com/nim-lang/Nim/commit/fbc97e712a67f30076f7633880383c8c4ae7866f
22:56:43Yardanico19 days ago :)
22:56:52Yardanicoso you have to update your compiler XD
22:56:56inv2004Why deepcopy does not clone? :(
22:57:00FromGitter<timotheecour> @bung87 always check on devel before :)
22:57:23FromGitter<bung87> ok , `choosenim update devel` now
22:57:59FromGitter<bung87> everyday everything is new
22:58:59Yardanicoyeah
23:00:14Yardanicoinv2004: https://github.com/xmonader/nim-terminaltables/pull/6 merged :D
23:00:30FromGitter<deech> What's the difference between `choosenim update devel` and `choosenim "#head"`?
23:00:45inv2004@Yardanico, thx! Could you help with deepCopy?
23:00:53Yardanicowell I don't exactly understand the issyue
23:01:11Yardanicoas far as I know deepCopy just does a deep copy of all data, creating a full clone :)
23:02:04FromGitter<bung87> devel branch, master#head comment
23:02:09FromGitter<bung87> commit
23:02:18inv2004@Yardanico, that is why I expected I can do: let uS = deepCopy(unicodeStyle) and pass it newTerminalTable(uS) # and it does not work
23:02:34Yardanicobut unicodeStyle is a global variable isn't it?
23:02:48FromGitter<deech> Oh really it defaults to master#head and not devel#head? That's interesting. I thought devel was the default branch.
23:02:57inv2004yes, But ins't deepCopy do a local copy?
23:02:59Yardanico@deech it is
23:03:21Yardanicoinv2004: but you still access unicodeStyle first
23:03:24Yardanicowhich is global :D
23:03:40inv2004ah, blin.
23:03:40FromGitter<bung87> hmm, may check choosenim source
23:03:46inv2004@Yardanico, how to fix it?
23:04:40Yardanicouhh I honestly don't know, either get the address of that variable and pass it to the thread or just copy the declaration :D
23:04:59inv2004copy of declaration is bad :(
23:07:29inv2004Will adding threadvar to the unicodeStyle help?
23:07:38Yardanicohmm it might help
23:07:42Yardanicoit'll create a new unicodeStyle for each thread
23:08:10inv2004But is it problem? Because we have to copy anyway
23:10:31leorizethe fix is to use --gc:arc :P
23:10:46Yardanicoyep
23:10:58Yardanicoleorize: https://github.com/nim-lang/Nim/issues/14410#issuecomment-632353904
23:11:00Yardanico:D
23:11:38Yardanicothe future is now
23:11:45Yardanicostuff doesn't work with default GC but works with arc
23:12:01*leorize quit (Quit: WeeChat 2.7.1)
23:12:20FromGitter<deech> Same thing happened to me with my libclang bindings.
23:12:34Yardanicowell yeah you should generally try arc :P
23:12:40Yardanicoand report bugs
23:12:50Yardanicoalthough for that it's much better to use devel which has a lot of arc bugfixes
23:13:09*leorize joined #nim
23:13:19Yardanico(and no they won't be in 1.2.2)
23:13:22FromGitter<deech> Yep, I'm on `HEAD` for everything.
23:13:42FromGitter<xmonader> @Yardanico thanks, and sorry @inv2004 for the inconvenience
23:13:49Yardanico@xmonader it's ok :)
23:14:09Yardanicoah actually
23:14:13Yardanico1.2.2 will have most arc fixes
23:14:32*Trustable quit (Remote host closed the connection)
23:15:03inv2004@leorize, I am too young for the gc:arc :)
23:15:42FromDiscord<Clyybber> it can only be that gc:arc is too young for you
23:15:46FromDiscord<Clyybber> not the other way around :p
23:15:55inv2004xmonader, sorry, did not get should I create PR for threadvar or not :)
23:16:12Yardanicoinv2004: well I mean if a lib wants to claim it's threadsafe it might do that
23:16:25Yardanico but if some program has 1000 threads it might not want that :P
23:17:51inv2004too much philosophy :)
23:20:28FromGitter<xmonader> @inv2004 I'm not sure what is your current problem, also I'm not up to date with Nim currently, with the changes in the runtimes and the rethinking of concurrency/parallelism
23:20:41Yardanico@xmonader well he's talking about the old threads :)
23:20:50YardanicounicodeStyle is global so it can't be accessed in another thread
23:20:53Yardanicosince it's a "let"
23:21:01Yardanicoone solution would be to make it "const" I think
23:21:09Yardanicosince it wouldn't need to change anyway
23:21:22*Jesin quit (Quit: Leaving)
23:21:24inv2004@Yardanico, old? I updated to nim 1.2 just two weeks ago :)
23:21:33Yardanicoinv2004: i'm in the future on 1.3.5
23:21:39FromGitter<xmonader> aha, also he can define another const style and use it no?
23:21:46inv2004@Yardanico, do not go too far!
23:21:49FromGitter<xmonader> wow 1.3.5 :O I'm that late behind.
23:21:52Yardanico@xmonader well but for less code repetition
23:22:01Yardanicoto use the default style from the lib
23:22:11Yardanicoand anyway having it as "const" wouldn't do any bad for the lib anyway
23:22:14FromGitter<xmonader> if const fixes it i'm ok with merging that indeed
23:22:52inv2004How @Yardanico merges PR's so fast? Into someones repo
23:23:05Yardanicothat one was created in github's web UI :P
23:23:09Yardanicoit's literally a 1-line fix
23:24:24inv2004I expected will will share secret how to do it so fast, but it was just cheat :)
23:24:46inv2004s/will/you/
23:24:58FromGitter<xmonader> I got 4 days of vacation, I'll try to update all code and do proper tagging, I know people complain of using #head
23:25:19FromGitter<xmonader> been doing to much crystal that I'm saturated ...
23:26:21inv2004xmonader, thank you!
23:26:41*Jesin joined #nim
23:26:43FromGitter<xmonader> most welcome :)
23:27:08inv20043rd question for the night: expression 'mitems[int64](d[1])' cannot be called . But it is just for x in d[1].mitems[:int64]: ...
23:27:12inv2004Why ?
23:27:24inv2004because d[1] is not var ?
23:27:42inv2004but d is var
23:32:47Yardanico@xmonader any reason for Cell and TerminalTable being "object" but you use "ref Object" everywhere?
23:35:21*thomasross joined #nim
23:37:18FromGitter<xmonader> no not really
23:38:03*thomasross quit (Max SendQ exceeded)
23:38:11FromGitter<xmonader> i usually make everything of objet and if mutable i pass ref to the methods
23:38:22Yardanicowhy though?
23:38:29Yardanicoyou can just make it as "ref object" if you use it as "ref Obj" everywhere
23:38:32*thomasross joined #nim
23:38:43FromGitter<xmonader> go habit i think :)
23:40:02Yardanicoalso since you target nim >= 0.19.4 you don't need to initalize seqs and strings
23:40:17Yardanicosince 0.19.0 made them empty (but initialized) by default
23:42:07Yardanicoalso setRows and addRows are the same :D
23:42:25YardanicoI'll create a PR with my (opinionated but mostly NEP-1 style fixes) and a few other small code changes
23:42:29Yardanicoreally small
23:42:59*inv2004 quit (Read error: Connection reset by peer)
23:43:31FromGitter<xmonader> ah I know the reason for setRows and addRows i think i wasn't able to do alias with let to the function
23:43:41FromGitter<xmonader> sure much appreciated indeed ^_^
23:47:50*sagax joined #nim
23:54:09*krux02_ joined #nim
23:55:26YardanicoI made the PR, although I'm not proud of one thing I did
23:55:29Yardanico"this[] = newTerminalTable()[]" :D
23:55:34Yardanicoto have less code repetitions
23:57:22Yardanicoalso one thing I might add (but it's just nitpicking and generally might confuse some people) is the using statement
23:57:31Yardanicoso instead of writing (this: TerminalTable) in a lot of procs you can just write
23:57:36Yardanicousing this: TerminalTable
23:57:36Yardanicoonce
23:57:47Yardanicoand then use it as "proc setRows*(this; rows: seq[seq[string]])"
23:57:49*krux02 quit (Ping timeout: 258 seconds)
23:57:52Yardaniconotice the semicolon instead of a comma
23:58:06Yardanicohttps://nim-lang.org/docs/manual.html#statements-and-expressions-using-statement
23:58:11FromGitter<xmonader> yup much better indeed imo (y)
23:58:28FromGitter<xmonader> I merged thank you
23:59:10FromGitter<zetashift> Not sure how I feel about that, saves up some typing but I always infer so much from proc signatures
23:59:17Yardanicowell yeah might be true
23:59:24Yardanicobut what if you literally have 20-30 procs for same type
23:59:38FromGitter<zetashift> yeah, then I'd use it too but I feel like I just might abuse it ;p
23:59:51Yardanicoxd