00:00:29 | * | gxt quit (Remote host closed the connection) |
00:02:08 | * | gxt joined #nim |
00:05:27 | skrylar[m] | that's probably fine. vsts don't do that |
00:06:00 | skrylar[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:55 | Yardanico | ok, 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:58 | Yardanico | good night everyone |
00:11:52 | FromGitter | <gogolxdong> What's type of proc in object , closure or pointer, value type or ref type? |
00:13:25 | skrylar[m] | procs are value types |
00:13:35 | skrylar[m] | if its a closure there is a hidden ref for the environment |
00:15:35 | FromGitter | <gogolxdong> will ``` ⏎ type Person = object of RootObj ⏎ ⏎ `````` ⏎ be copied at assignment? [https://gitter.im/nim-lang/Nim?at=5ec5c8276e837c7743c33a39] |
00:16:06 | FromGitter | <gogolxdong> ```type Person = object of RootObj ⏎ speak*: proc(Person)``` [https://gitter.im/nim-lang/Nim?at=5ec5c846e06728175b7fad78] |
00:16:13 | PMunch | Hmm, sleep, that might be a good idea.. |
00:17:09 | * | PMunch quit (Quit: leaving) |
00:20:09 | FromGitter | <gogolxdong> means proc in object is value type as well? |
00:29:01 | * | Jesin quit (Quit: Leaving) |
00:37:22 | zacharycarter | i |
00:37:24 | zacharycarter | whoops |
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:09 | nimskull | is 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:07 | leorize[m] | do we even have `...`? |
01:33:44 | FromDiscord | <zetashift> We don't |
01:34:46 | nimskull | well now I can't find the code I saw with ... :( |
01:36:58 | nimskull | what is `..<` ? is 0..<n the terse version of 0..n-1? |
01:37:40 | FromDiscord | <zetashift> Yes it is |
01:38:08 | * | dadada joined #nim |
01:38:31 | * | dadada is now known as Guest93405 |
01:38:34 | FromDiscord | <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:33 | nimskull | in 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:58 | nimskull | I've been looking at how linspace is defined in arraymancer source and it just seems to come out of nowhere |
02:18:44 | nimskull | well 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:39 | nimskull | does 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:25 | leorize[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:24 | skrylar[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:21 | Prestige | I'm attempting to run a command with startProcess that takes an environment variable. Is this possible? It seems to not evaluate $MYARG |
04:32:48 | Prestige | I 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:34 | FromDiscord | <Elegant Beef> Prestiege are you using putEnv? |
04:45:43 | FromDiscord | <Elegant Beef> (edit) 'Prestiege' => 'Prestige' |
04:47:00 | * | narimiran joined #nim |
04:48:35 | * | nsf joined #nim |
04:51:22 | Prestige | Nah 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:27 | silvernode | So 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:02 | Prestige | silvernode: if it's already added to the index you need to remove it |
06:18:21 | silvernode | Prestige, Now that you mention it, I think I added the binary to the index by mistake before I created the ignore file |
06:19:28 | Prestige | I've made the mistake before :) |
06:19:45 | silvernode | I 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:27 | silvernode | Do you know how from memory? |
06:21:37 | Prestige | I think git rm myfile |
06:21:44 | silvernode | git rm --cached |
06:23:41 | silvernode | fatal: pathspec 'tuxn' did not match any files |
06:23:45 | silvernode | wtf |
06:26:40 | * | rockcavera quit (Remote host closed the connection) |
06:26:41 | nimskull | I'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:37 | silvernode | So 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:32 | silvernode | I 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:08 | Araq | up/downvotes please https://github.com/nim-lang/RFCs/issues/224 |
07:23:12 | disbot | ➥ Deprecate `==` for refs and procs ; snippet at 12https://play.nim-lang.org/#ix=2mSu |
07:23:45 | Prestige | fancy |
07:23:58 | Prestige | the bot I mean :P |
07:26:57 | Araq | and downvoting it is perfectly fine |
07:27:24 | Araq | I don't offer you the choice for things we'll do either way :P |
07:42:25 | * | Vladar joined #nim |
07:49:51 | skrylar[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:57 | alehander92 | Araq |
08:07:59 | FromGitter | <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:05 | alehander92 | i kinda agree that |
08:08:23 | alehander92 | two operators would be good : one for "content" equality and one for identity |
08:08:49 | alehander92 | but in this case `==` still makes sense for refs , right? |
08:09:06 | FromGitter | <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:19 | alehander92 | that's true for trees |
08:09:31 | alehander92 | so yeah i get it |
08:09:46 | alehander92 | to prevent bugs, no `==` so people need to read on `eq<kind>` |
08:10:02 | FromGitter | <Clyybber> I'd like == to stay for refs |
08:10:11 | FromGitter | <Clyybber> and simply mean they point to the same memory |
08:10:15 | alehander92 | but this leaves room for bugs indeed |
08:10:20 | FromGitter | <Clyybber> How so? |
08:10:34 | FromGitter | <Clyybber> People should maybe think when coding :p |
08:10:44 | alehander92 | because then people can mistakenly write code thinking its content equali |
08:10:56 | alehander92 | well ok then |
08:11:12 | alehander92 | identity is supposed to be `is` , right |
08:11:20 | alehander92 | so equal addresses should be `is` |
08:11:30 | FromGitter | <Clyybber> I don't think so |
08:11:34 | FromGitter | <Clyybber> is on types is not identity |
08:11:45 | supakeen | `is` is also a terrible operator name :( |
08:11:51 | alehander92 | it is not |
08:11:59 | FromGitter | <Clyybber> IMO the == simply refers to the refs. |
08:12:00 | alehander92 | i am not sure |
08:12:09 | alehander92 | ok but guys |
08:12:16 | alehander92 | this again mixes it all |
08:12:39 | alehander92 | for one type its "those are identical", for other its "those might not be the same object but they are content-equal" |
08:12:46 | dadada__ | I've mixed feelings about this, preventing programmers from making errors is a good goal |
08:13:09 | dadada__ | but when programmers don't use their head while coding, is it really the fault of the language? |
08:13:16 | FromGitter | <Clyybber> alehander92: No, its always about equal, its just that pointers transform equal to identical |
08:13:28 | alehander92 | but equality |
08:13:29 | alehander92 | wait! |
08:14:17 | alehander92 | sorry, there was a good blog on that by a scala guy |
08:14:23 | alehander92 | i would search it |
08:14:56 | skrylar[m] | huh. i did a nimble search for earcut and also tesselator |
08:15:05 | dadada__ | 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:11 | skrylar[m] | i guess this time something i wrotei s actually new for us :f |
08:15:27 | FromGitter | <Clyybber> that doesn't look bad |
08:15:35 | FromGitter | <Clyybber> but keep in mind that this is still not deep equality |
08:16:01 | FromGitter | <Clyybber> unless you use [==] in [==] too |
08:16:06 | skrylar[m] | i suggested `==` and `===` because the js folk already have === for extra equality |
08:16:16 | Prestige | what type of equality is this for if not deep equality? |
08:16:31 | dadada__ | skrylar[m]: I don't think taking JS for inspiration is wise |
08:16:34 | FromGitter | <Clyybber> Prestige: Could be for deep equality, but only 1 layer |
08:16:54 | FromGitter | <Clyybber> Prestige: So comparing the contents of the ref object with == basically |
08:17:08 | FromGitter | <Clyybber> Deep equality would be comparing everything with [==] I guess |
08:17:33 | alehander92 | sorry not important ! |
08:17:38 | Prestige | I feel like there should be procs with different levels of equality checking for procs |
08:17:39 | alehander92 | the blog link |
08:17:40 | FromGitter | <Clyybber> But that could mean that a [==] could hang |
08:17:44 | Prestige | if there are multiple levels people would use |
08:17:51 | * | zacharycarter joined #nim |
08:17:58 | FromGitter | <Clyybber> IMO that means that people should implement it themselves |
08:18:03 | alehander92 | so anyway it might be a good thing to not mix equality and identity |
08:18:06 | FromGitter | <Clyybber> because it makes them think about what they want |
08:18:08 | Prestige | what about an ast comparison |
08:18:11 | alehander92 | because they are really different concepts |
08:18:14 | dadada__ | 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:23 | FromGitter | <Clyybber> Prestige: Ast of a variable? |
08:18:40 | Prestige | of the contents of the proc |
08:18:48 | Prestige | or can u not get that at runtime |
08:18:53 | FromGitter | <Clyybber> dadada: Its easily possible, but I wouldn't put it in the stdlib |
08:18:55 | alehander92 | and about multiple equality, usually one can have just flags |
08:18:59 | FromGitter | <Clyybber> Because it might infinite recurse |
08:19:15 | skrylar[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:18 | skrylar[m] | lisp also has these operators (semantic vs bitwise) |
08:19:19 | alehander92 | something like `eq(depth=..)` |
08:19:21 | dadada__ | Clyybber: ref[] == ref2[] # shallow equality ref [==] ref2 deep equality ref == ref2 # equality based on direct type |
08:19:36 | FromGitter | <Clyybber> alehander92: Problem is, you might want to deep compare one ref field, but not another |
08:19:45 | FromGitter | <Clyybber> So even depth is not enough in the general case |
08:19:54 | FromGitter | <Clyybber> So its better to let people just define it themselves |
08:20:16 | Prestige | what is == doing for refs and procs currently? for refs it just checks the dereffed value right? |
08:20:35 | FromGitter | <Clyybber> dadada: Yeah, ok. I have no strong objections about putting [==] in sugar.nim |
08:20:46 | FromGitter | <Clyybber> But it can hang, which is unfortunate |
08:21:18 | FromGitter | <Clyybber> Also [==] is not a possible operator afaikt |
08:22:44 | alehander92 | clyybber yeah |
08:23:05 | alehander92 | so that's why it's ok to have e.g. `===` or `id` or something for identity |
08:23:08 | alehander92 | and no `==` |
08:23:14 | alehander92 | so people are forced to read the docs |
08:23:23 | alehander92 | and to find out which custom `eq` is best for their case |
08:23:49 | alehander92 | also its important to keep generics in mind |
08:23:55 | Prestige | I like the idea of adding more operators rather than just modifying == |
08:24:07 | alehander92 | many generic algo-s need to be able to call `equality` in some way |
08:24:29 | alehander92 | so maybe a way for a user to define which eq operator to be used e.g. for searching |
08:24:36 | alehander92 | is very important |
08:24:48 | FromGitter | <Clyybber> alehander92: I don't have strong objections against === but it would simply break a ton of code |
08:24:56 | FromGitter | <Clyybber> And actually would suck for generics |
08:25:01 | alehander92 | but everything would |
08:25:13 | FromGitter | <Clyybber> No, leaving it as is wouldn't :p |
08:25:17 | alehander92 | because as you said we already need custom `eq` for trees |
08:25:27 | alehander92 | so now we just close our eyes for the problem |
08:25:27 | FromGitter | <Clyybber> I said we don't need it |
08:25:32 | alehander92 | but we do |
08:25:35 | FromGitter | <Clyybber> No? |
08:25:36 | alehander92 | i probably have like 2-3 custom eq-s |
08:25:40 | alehander92 | for some of my trees |
08:25:43 | FromGitter | <Clyybber> Because they should define it themselves |
08:25:46 | alehander92 | and if i used generic code |
08:25:49 | FromGitter | <Clyybber> alehander92: Yeah thats how it should be |
08:25:53 | alehander92 | i have no idea how to pass it |
08:25:58 | FromGitter | <Clyybber> Alias it |
08:26:09 | alehander92 | but i can use two ops |
08:26:13 | alehander92 | in two different cases |
08:26:21 | alehander92 | that's the whole point |
08:26:26 | alehander92 | of having different equality options |
08:26:58 | alehander92 | maybe some template-based apis can work e.g. `a.search(b, op=eq)` |
08:27:25 | FromGitter | <Clyybber> alehander92: IMO this could be solved by having an {.override.} pragma |
08:27:29 | alehander92 | or even `a.index(b, op=eq(level=4))` |
08:27:54 | alehander92 | Clyybber which locally overrides an op for an expression? |
08:27:57 | FromGitter | <Clyybber> alehander92: So that one can defined `==` on his scope and override the default `==` |
08:28:02 | FromGitter | <Clyybber> alehander92: Yeah |
08:28:03 | alehander92 | ughhh |
08:28:10 | alehander92 | it seems cute but very hacky |
08:28:22 | dadada__ | Clyybber: it would Nim code inconsistent across different projects |
08:28:42 | FromGitter | <Clyybber> What would? |
08:28:52 | alehander92 | `{.override: ==, eq}: a.index(b)` |
08:29:08 | alehander92 | but i kinda see your point |
08:29:16 | alehander92 | one can even do it with just block syntax |
08:29:23 | FromDiscord | <Clyybber> Yeah |
08:29:24 | alehander92 | withEq(eq): a.index(b) |
08:29:33 | alehander92 | which is more easy to nest / write etc |
08:29:46 | alehander92 | or override(`==`, eq): |
08:30:00 | alehander92 | which can be then used for custom allocation :P |
08:30:17 | alehander92 | with(`allocator`, `myallocator`): expr |
08:30:44 | alehander92 | but 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:33 | dadada__ | is there hope for NimScript supporting casts from pointers to refs, cause this would make my code a lot less complicated |
08:57:17 | dadada__ | 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:15 | alehander92 | why dont you just |
08:59:19 | alehander92 | use runtime code all the time |
08:59:25 | alehander92 | and staticExec some of it |
08:59:38 | alehander92 | it seems simpler to just add some deserialization only there maybe |
09:09:17 | FromDiscord | <mratsim> For ref you can just use myRef1[] == myRef2[] |
09:11:43 | FromGitter | <jorjun_twitter> Let me have thoughts on why typescript type ‘number’ is not a genius initiative. |
09:14:38 | dadada__ | jorjun_twitter: what's your thought on it? |
09:17:28 | FromDiscord | <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:31 | disbot | ➥ fix #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:13 | FromDiscord | <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:02 | FromDiscord | <mratsim> I think there should be a code example in the article |
09:45:08 | FromDiscord | <mratsim> it's too dry at the moment. |
09:46:06 | FromDiscord | <mratsim> for example computing Pi via monte carlo method: https://github.com/nim-lang/Nim/blob/devel/tests/parallel/tpi.nim |
09:46:30 | FromDiscord | <jasonfi> I wanted to link to code examples only, thanks I'll take a look at that link |
09:48:47 | FromDiscord | <jasonfi> is the threads module still in use? or is threadpool to be used instead? |
09:49:03 | dadada__ | 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:33 | dadada__ | request to generate code for .compileTime proc: initTable |
09:57:25 | nikita` | 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:37 | nikita` | just via ffi? |
09:58:50 | * | JustASlacker quit (Ping timeout: 256 seconds) |
09:59:22 | * | theelous3 joined #nim |
10:01:36 | FromDiscord | <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:01 | FromDiscord | <mratsim> var MyCONST {.importc.} = ctype |
10:02:23 | nikita` | oh |
10:02:26 | FromDiscord | <mratsim> or if the Nim name and C name are different ↵↵var MyCONST {.importc: "CNAME".} = ctype |
10:02:42 | nikita` | ok, thanks. |
10:02:55 | FromDiscord | <mratsim> examples: https://github.com/numforge/laser/blob/master/laser/photon_jit/photon_osalloc.nim#L64-L66 |
10:12:08 | FromDiscord | <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:47 | FromDiscord | <InventorMatt> are there any pure nim solutions for interfacing with a computer's webcam? |
11:29:36 | * | theelous3_ joined #nim |
11:30:09 | FromDiscord | <Recruit_main707> i doubt it |
11:31:19 | FromDiscord | <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:13 | FromGitter | <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:59 | Yardanico | @bung87 I think that's an overkill :) |
11:55:01 | Yardanico | you can write nim wrapper for v4l2 |
11:55:08 | Yardanico | or maybe nimterop will help |
11:55:11 | * | Guest49660 is now known as dadada |
11:58:24 | dadada | InventorMatt: 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:25 | FromDiscord | <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:09 | FromGitter | <bung87> Yardanico :P |
12:14:00 | FromGitter | <bung87> considering opencv? |
12:15:48 | FromDiscord | <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:58 | FromGitter | <bung87> simple solution using c2nim |
12:20:09 | Yardanico | or nimterop as I said |
12:20:43 | * | gxt_ quit (Ping timeout: 240 seconds) |
12:22:11 | FromDiscord | <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:21 | FromGitter | <bung87> what's my next project, I have no idea. |
12:30:10 | Yardanico | nim compiler |
12:30:40 | FromGitter | <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:40 | dom96 | InventorMatt: you're likely better off fixing my wrapper, we can help if you show us the problems you're running into :) |
12:45:35 | FromDiscord | <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:28 | FromDiscord | <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:47 | Yardanico | well that means you don't have the required opencv lib |
12:52:19 | FromDiscord | <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:13 | FromDiscord | <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:27 | Yardanico | that 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:49 | FromDiscord | <InventorMatt> is there any resource that describes how to do that. the nimble page only has a small paragraph on nimble tasks |
12:57:30 | Yardanico | well .nimble files are nimscript files |
12:57:36 | Yardanico | you can write a large subset of nim in them |
12:57:52 | Yardanico | https://github.com/kaushalmodi/hello_musl for example |
12:57:57 | Yardanico | https://github.com/kaushalmodi/hello_musl/blob/master/config.nims |
12:59:03 | FromGitter | <bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ec67b16ff7a920a72021f2e] |
12:59:35 | FromGitter | <bung87> https://github.com/nim-lang/zip/blob/master/zip.nimble |
13:00:11 | FromDiscord | <InventorMatt> thanks, I'll llook through those |
13:00:15 | Guest49151 | is there a reverse {.compileTime.} to prevent something getting interpreted as a compileTime proc? |
13:00:19 | * | Guest49151 is now known as dadadad |
13:00:37 | Yardanico | dadadad: don't use const? |
13:00:50 | dadadad | dadadad: I don't use const AFAIK |
13:01:12 | dadadad | or is there something that doesn't explicit call itself const that is also const? |
13:01:52 | Yardanico | dadadad: try https://nim-lang.org/docs/manual.html#statements-and-expressions-when-nimvm-statement ? |
13:02:09 | Yardanico | you can do {.error: "Can't execute at compile-time.} in the "when nimvm" branch |
13:03:02 | Yardanico | oh, that might not work |
13:03:05 | * | JustASlacker quit (Ping timeout: 258 seconds) |
13:06:13 | FromGitter | <Clyybber> @timotheecour ping |
13:06:18 | Yardanico | but really why would you need that? dadadad |
13:06:22 | Yardanico | just curious :) |
13:07:29 | dadadad | Yardanico: 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:05 | Yardanico | so why are you worried now? |
13:08:24 | dadadad | worried? I just don't understand what nim wants from me |
13:08:45 | Yardanico | ??? |
13:10:09 | dadadad | look, I've two procs, one that is supposed to work at compile time and one that isn't |
13:10:29 | dadadad | and I thought I could separate them with when nimvm |
13:11:28 | FromGitter | <Clyybber> Yeah, why wouldn't you be able to? |
13:12:27 | alehander92 | but isn't top level .. |
13:12:30 | alehander92 | like valid in both |
13:12:51 | dadadad | request to generate code for .compileTime proc |
13:13:00 | alehander92 | exactly |
13:13:07 | alehander92 | from when nimvm: else: .. other code |
13:13:17 | alehander92 | i'd expect nim to try to generate other code for runtime |
13:13:41 | dadadad | all it tells me is the line, but I've no clue what I should do :-( nim makes me feel really dumb today |
13:14:06 | dadadad | also yesterday, last week was better |
13:15:24 | FromGitter | <bung87> https://github.com/github/codeql anyone working on this ? |
13:16:06 | FromGitter | <bung87> add nim support on lgtm.com |
13:16:39 | * | zacharycarter joined #nim |
13:16:59 | alehander92 | dadadad `when nimvm .. proc a` would just generate a top level proc always |
13:17:25 | alehander92 | and else as well |
13:17:34 | alehander92 | so i think when not nimvm cant ensure anything in that case |
13:18:37 | alehander92 | btw i just get illegal context for 'nimvm' magic |
13:22:10 | * | endragor_ quit (Remote host closed the connection) |
13:23:40 | FromDiscord | <mratsim> @InventorMatt OpenCV should already be available through your mac or Linux package manager |
13:23:53 | FromDiscord | <mratsim> if you use windows there are package manager options there |
13:24:11 | FromDiscord | <mratsim> the C / C++ package situation is sad and we can't solve that |
13:24:11 | FromDiscord | <Clyybber> You have to put the when nimvm inside the proc |
13:24:19 | FromDiscord | <Clyybber> Its not valid at toplevel |
13:25:56 | alehander92 | oi dadadad |
13:25:59 | alehander92 | yardanico was right |
13:26:06 | alehander92 | your case can be solved more simply |
13:26:10 | * | Vladar joined #nim |
13:26:12 | FromDiscord | <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:26 | dadadad | alehander92: maybe, but you both don't know the whole situation here... |
13:27:40 | dadadad | I would show you code, but currently it is an ugly mess |
13:27:42 | alehander92 | hm http://ix.io/2mTL |
13:27:48 | alehander92 | this should work for most code |
13:28:03 | alehander92 | such a function should fail on compile time but be callable on runtime |
13:28:12 | alehander92 | you can make a macro which can be used as a pragma and inserts that |
13:28:18 | alehander92 | `{.noCompileTime.}` |
13:28:40 | alehander92 | as Yardanico said, mostly using `error` when on ct |
13:28:54 | alehander92 | you need import macros for error |
13:37:12 | * | audiofile joined #nim |
13:39:45 | * | liblq-dev quit (Ping timeout: 265 seconds) |
13:42:00 | dadadad | alehander92: what are the limitations around generics for nimvm |
13:42:36 | dadadad | I 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:12 | alehander92 | well it seems it works |
13:43:15 | alehander92 | ah ok |
13:43:18 | alehander92 | then you can do the same |
13:43:22 | * | s4mu3lbk quit (Remote host closed the connection) |
13:43:36 | dadadad | I'm using exprs like getFoo[Yo[My]](nizzle) |
13:43:44 | dadadad | are those too demanding for nimvm? |
13:43:47 | alehander92 | but .. i mean, then you can just do the normal thing not sure what the problem is |
13:44:37 | alehander92 | i dont think so i can do `echo getA[seq[int]](@[2])` |
13:44:52 | alehander92 | what exactly is failing |
13:45:55 | dadadad | if I knew that, I could fix it |
13:55:38 | * | tefter quit (Quit: WeeChat 2.8) |
14:07:57 | * | clemens3 joined #nim |
14:08:33 | FromDiscord | <willyboar> ~stream |
14:08:34 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) |
14:13:06 | disruptek | hey mr. boar. |
14:13:29 | alehander92 | heyy |
14:14:09 | FromDiscord | <willyboar> I am the first |
14:14:13 | FromDiscord | <willyboar> 🙂 |
14:14:27 | alehander92 | :D :D is this a queue |
14:15:01 | FromDiscord | <willyboar> I am going to make a coffee |
14:15:14 | alehander92 | cool |
14:19:20 | * | Satomi-Kowa quit (Ping timeout: 256 seconds) |
14:21:37 | FromDiscord | <willyboar> ready |
14:21:56 | disruptek | SWING FOR THE FENCES, BABY! |
14:23:03 | * | gxt quit (Ping timeout: 240 seconds) |
14:23:05 | * | natrys joined #nim |
14:23:10 | alehander92 | i thought it sounds very american and that its a boxing phrase |
14:23:20 | alehander92 | i found out its about baseball, now somehow it sounds even more american |
14:23:25 | disruptek | baseball. |
14:23:46 | livcd | baseball is also big in Korea and Japan :> |
14:23:55 | alehander92 | THEY ARE AMERICAN |
14:23:58 | alehander92 | only half kidding |
14:24:18 | alehander92 | if only you guys could play footy |
14:26:42 | * | gxt joined #nim |
14:27:29 | livcd | Is it time for watermelon? Yes it is! |
14:28:58 | livcd | Oh sh...Yeah this is what I hate about this marriage. My watermelon smells like kimchi. |
14:33:15 | disruptek | i should a tool that sits on a url and produces depedency graphs in svg for the given package set. |
14:33:22 | disruptek | s/should/should write/ |
14:33:40 | disruptek | then 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:43 | dadadad | soo, here's what has happened |
14:39:34 | dadadad | I 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:35 | FromGitter | <kaushalmodi> disruptek: awesome |
14:40:11 | dadadad | in 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:23 | dadadad | s/onf of those/one of those kind kinds |
14:41:44 | dadadad | IMO NimNode should work at runtime to, and Nim should include a Nimparser that works in runtime, and returns NimNodes |
14:42:15 | dadadad | it could be useful for parsing config files and stuff like it |
14:42:42 | dadadad | s/to/too s/in/at |
14:44:13 | FromGitter | <Clyybber> You can use the compiler api |
14:44:18 | FromGitter | <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:57 | disruptek | leorize: good job on the gentoo package. we need a stable version, no? |
15:03:32 | FromDiscord | <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:26 | Prestige | does intellij support lsp? |
15:14:56 | FromDiscord | <Recruit_main707> yes |
15:17:50 | * | liblq-dev joined #nim |
15:19:25 | disruptek | leorize: why don't we install nimble with nimble and put the nimble that ships with nim into libexec/bootstrap-nimble? |
15:26:21 | FromDiscord | <Recruit_main707> but it says something about nimlsp.exe keeps crashing due to java IOException |
15:28:55 | FromDiscord | <Recruit_main707> i think it has to do with hovering over the functions |
15:32:29 | FromDiscord | <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:12 | leorize[m] | disruptek: becsuse nim don't ship with nimble source the last time I checked |
15:54:32 | disruptek | relaly? |
15:54:41 | disruptek | how do we build it? |
15:54:47 | leorize[m] | well certainly not the git version |
15:55:00 | leorize[m] | stable version probably have it |
15:55:19 | disruptek | well, we need a stable gentoo ebuild, right? |
15:55:39 | leorize[m] | gentoo already got one :p |
15:55:46 | disruptek | oh, nice. |
15:56:01 | disruptek | where is it? |
15:56:06 | disruptek | i only have yours. |
15:56:30 | leorize[m] | should be dev-lang/nim too, I doubt they removed it |
15:57:37 | shashlick | Koch clones a specific tag of nimble and builds it |
15:57:59 | * | silvernode joined #nim |
15:58:37 | * | xet7 quit (Quit: Leaving) |
16:01:32 | FromDiscord | <Yardanico> A specific commit, yeah |
16:02:10 | leorize[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:56 | dadadad | has anyone done a conversion proc from a genAstRepr string to NimNodes? |
16:08:29 | dadadad | as 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:25 | disruptek | how do i cast a set of enums into an int? |
17:09:06 | disruptek | no way to do this in the vm agaict. |
17:10:36 | FromDiscord | <mratsim> int(myEnum) |
17:10:43 | FromDiscord | <mratsim> ah a set |
17:10:49 | FromDiscord | <mratsim> nope |
17:12:45 | federico3 | how can I create a variable in a template and make it available in a "body" of code inside? |
17:15:07 | federico3 | {.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:52 | FromGitter | <kaushalmodi> Would anyone on Linux 64-bit would like to give this a try: https://github.com/kaushalmodi/version/releases ? |
17:27:58 | FromGitter | <kaushalmodi> Open for feedback on code, etc |
17:28:05 | FromGitter | <kaushalmodi> !repo version |
17:28:09 | disbot | https://github.com/moigagoo/nimage -- 9nimage: 11Dockerfiles for various Nim versions published on Docker Hub 15 36⭐ 6🍴 7& 29 more... |
17:28:15 | FromGitter | <kaushalmodi> oh well |
17:28:45 | FromGitter | <kaushalmodi> https://kaushalmodi.github.io/version/ |
17:32:11 | * | brainbomb joined #nim |
17:42:16 | leorize | !repo kaushalmodi/version |
17:42:19 | disbot | https://github.com/kaushalmodi/version -- 9version: 11Fetch and parse the version number of most CLI apps 15 2⭐ 0🍴 |
17:48:50 | disruptek | !pull count |
17:48:55 | disbot | https://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:08 | FromGitter | <danielecook> Hey folks I'm trying to parallelize this function: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ec6ca90225dc25f54998778] |
18:38:16 | FromGitter | <danielecook> but it's coming back as not GC safe |
18:38:22 | FromGitter | <danielecook> ` Error: 'spawn' takes a GC safe call expression` |
18:39:00 | FromGitter | <danielecook> Anything obvious in there? I've tried quite a few things but no luck |
18:39:11 | * | PMunch joined #nim |
18:41:13 | dadadad | is it idiomatic nim to use include to split up big modules? |
18:41:46 | Zevv | nope. But nim does it itself, though |
18:42:35 | dadadad | makes 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:46 | dadadad | I'd like some opinions, what do you mean by name |
18:43:49 | dadadad | name=nope |
18:44:03 | dadadad | yes, it means no, but why is it not idiomatic |
18:44:24 | PMunch | I'd say splitting a large module up into "include"-ed files is pretty idiomatic |
18:44:32 | Zevv | might me just my personal experience, I don't make the idioms |
18:44:41 | Zevv | well, there you have it :) |
18:45:07 | PMunch | Or import/export of course |
18:45:16 | PMunch | Depends a bit on what you're doing |
18:45:40 | dadadad | okay, 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:05 | PMunch | PRs welcome |
18:47:30 | dadadad | javascript :-( |
18:47:39 | PMunch | Oh, haha :P |
18:47:42 | leorize | rewrite it in Nim :P |
18:47:52 | PMunch | Switch to NimLSP, it's written in Nim :) |
18:47:52 | leorize | or switch to neovim and use the superior nim.nvim :P |
18:48:52 | leorize | @danielecook: use initRand to create a random generator |
18:49:05 | leorize | the `rand` function uses the global generator by default |
18:52:25 | FromGitter | <danielecook> ok i'll give that a try |
18:52:47 | Prestige | or use nimlsp with nvim :P |
18:54:22 | FromDiscord | <Generic> there are certainly some problems with the nim vscode plugin |
18:54:39 | FromDiscord | <Generic> but at some point it's also nimsuggest |
18:55:03 | PMunch | Basically, everyone should switch to NimLSP so that all our efforts are concentrated |
18:56:04 | leorize | you get highlighting implemented in nimlsp, and I will switch nim.nvim to it :P |
18:56:19 | leorize | though you should also make nimlsp a part of nim too |
18:56:24 | * | liblq-dev joined #nim |
18:56:40 | PMunch | I started working on getting highlighting in it |
18:56:54 | FromGitter | <danielecook> @leorize no luck unfortunately. If I add the gcsafe pragma I get this |
18:57:29 | FromGitter | <danielecook> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ec6cf18b101510b200bd3b0] |
18:58:07 | leorize | you don't create a Rand object then discard it right after like that... |
18:58:08 | FromGitter | <danielecook> Failure always happens around ~567 |
18:58:31 | leorize | read the docs |
18:59:30 | FromGitter | <danielecook> ok sorry i've been hammering away for a few hours I'll slow down here a bit |
19:00:18 | leorize | golden rule in Nim: if you use discard you probably are ignoring something important :P |
19:01:39 | PMunch | That's why its there :) So that you know that you're doing something silly |
19:03:18 | dadadad | I 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:35 | disruptek | how about smack? |
19:03:40 | disruptek | if you use discard you get a smack. |
19:03:51 | PMunch | Haha |
19:04:08 | PMunch | dadadad, you can rename it to whatever you like with a template :) |
19:04:13 | dadadad | we could use fuck, if it wasn't against the rules of a polite society |
19:04:24 | dadadad | PMunch: and I probably will |
19:04:37 | PMunch | You could also write a template that turns non-null return codes to an exception for example |
19:04:52 | PMunch | Which is more in-line with what Nim typically expects to happen when stuff goes wrong |
19:05:13 | PMunch | dadadad, that reminds me of a shell program I had that was called fuck |
19:05:24 | PMunch | It would look at your last command and guess how it was mis-spelt |
19:05:40 | krux02 | PMunch: Ignoring the "polite" attribute, I think the word "fuck" has a secondary meaning that could be misleading. |
19:05:52 | dadadad | PMunch: you could integrate it into the shell, it possible to hook into it |
19:05:55 | dadadad | its |
19:05:56 | PMunch | So if you mis-spelled anything you could just hit "fuck" in the terminal and it would try to fix you error |
19:06:29 | PMunch | krux02, which is the secondary meaning? |
19:06:42 | krux02 | to have reproductive activity |
19:06:52 | PMunch | I mean it would look bad if you did "fuck node.sons" |
19:07:04 | krux02 | yea pretty much |
19:07:12 | dadadad | if funny is bad to you, then yes |
19:07:22 | PMunch | Haha :P |
19:07:32 | * | dadadad is now known as dadada |
19:07:43 | krux02 | well, discard node.sons is also weird. |
19:07:48 | PMunch | There was a FOSDEM talk about a guy who wrote a small programming language that basically allowed you to write code as prose |
19:08:01 | PMunch | krux02, yeah it's a pretty nonsensical thing to do |
19:08:16 | PMunch | Unless `node.sons` refreshed a cache or something |
19:08:23 | krux02 | yea those esoteric programming languages again. |
19:08:24 | dadada | miss node.sons <- makes sense, admit it! |
19:08:48 | krux02 | I hear so often about them. But I also think they are neither funny nor interesting in any particular way. |
19:10:00 | krux02 | I 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:47 | krux02 | also 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:47 | zacharycarter | https://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:07 | zacharycarter | or do I just need to keep track of the offset and use it with the subscript operator? |
19:11:22 | krux02 | pleas cast to `uint` not ByteAddress |
19:11:36 | zacharycarter | uint8? |
19:11:42 | krux02 | I think ByteAddress should be deprecated, as it has the wrong signedness. |
19:11:44 | krux02 | uint |
19:12:32 | dadada | do the devs of vscode intentionally produce bugs to make me mad? |
19:12:40 | dadada | does someone know? |
19:12:44 | FromDiscord | <Generic> what is it now? |
19:12:59 | krux02 | zacharycarter, what do you exactly mean with `f`s |
19:13:01 | krux02 | ? |
19:13:12 | krux02 | I see neither o nor f in your example code |
19:13:25 | dadada | Generic: 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:39 | zacharycarter | look at the string krux02 |
19:13:51 | zacharycarter | its value is `foo` |
19:14:02 | FromDiscord | <Generic> dadada: it works for me |
19:14:04 | dadada | s/have/have to take |
19:14:23 | dadada | Generic: it worked for me, until it randomly didn't, then it worked, again, until it randomly didn't |
19:14:23 | krux02 | addr foo[1] |
19:14:36 | zacharycarter | but I added an offset to the pointer right? |
19:15:14 | FromDiscord | <Generic> dadada: not 100% related, but do you have the mini map enabled? It makes scrolling with the mouse a lot nicer |
19:15:45 | krux02 | zacharycarter, your += doesn't modify the pointer |
19:16:01 | krux02 | wait |
19:16:40 | dadada | Generic: you're right, yet I disabled it to save horizontal space, have a split window most of the time |
19:17:01 | zacharycarter | ah okay I think I get why |
19:18:10 | * | s4mu3lbk joined #nim |
19:18:13 | leorize | you don't really have to do all this math, just cast it to openarray then get the address back :P |
19:20:10 | krux02 | sizeof(UncheckArray) is always 0 |
19:21:18 | krux02 | zacharycarter: http://ix.io/2mVy |
19:21:39 | zacharycarter | thanks |
19:22:25 | krux02 | the 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:44 | zacharycarter | well unchecked array - but I guess I'll just use a nim string and keep an offset |
19:22:48 | zacharycarter | that's probably the simplest thing to do |
19:23:23 | FromDiscord | <Generic> you might as well use cast[ptr UncheckedArray[yourtype]](addr uncheckedarray[offset]) |
19:25:33 | leorize | if you only wanted zero-copy slicing then toOpenArray provides thta |
19:25:35 | leorize | that* |
19:26:05 | FromDiscord | <Generic> though openarrays can't be put into variables, only arguments |
19:26:13 | FromDiscord | <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:39 | FromDiscord | <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:54 | FromDiscord | <Recruit_main707> i just dont understand how it works |
20:10:24 | * | fredg joined #nim |
20:12:23 | FromDiscord | <Recruit_main707> im surprised c2nim actually parsed it |
20:14:28 | FromDiscord | <Recruit_main707> but it doesnt really work :P |
20:17:59 | FromDiscord | <Elegant Beef> @Generic what's unfortunate about that? |
20:18:34 | FromDiscord | <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:47 | FromDiscord | <Elegant Beef> That can have a dynamic size |
20:18:53 | FromDiscord | <Elegant Beef> (edit) 'That can have a dynamic ... size' => 'That can have a dynamicruntime' |
20:25:41 | FromDiscord | <Generic> @Elegant Beef it could be used for something like this https://github.com/nim-lang/Nim/pull/13508 but without ptr |
20:25:45 | disbot | ➥ new syntax for lvalue references: `var b {.byaddr.} = expr` ; snippet at 12https://play.nim-lang.org/#ix=2mVU |
20:26:15 | FromDiscord | <Generic> of course what would be better would be if openarrays could even be put into objects |
20:27:05 | FromDiscord | <Elegant Beef> Well atleast an array type that has an runtime intialized size value that cannot be changed without remaking the array |
20:28:00 | FromDiscord | <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:35 | FromDiscord | <Elegant Beef> Although im a numpty so... |
20:33:39 | * | tane joined #nim |
20:43:42 | FromDiscord | <exelotl> hmm byaddr seems interesting |
20:52:21 | FromDiscord | <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:36 | FromDiscord | <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:12 | FromDiscord | <Recruit_main707> @Gary M this is still broken |
20:58:14 | FromDiscord | <Recruit_main707> https://media.discordapp.net/attachments/371759389889003532/713133571413377064/unknown.png |
21:00:45 | FromDiscord | <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:22 | FromDiscord | <dom96> my god, GitHub's stupid "Author" auto complete on PRs really irritates me |
21:07:30 | FromDiscord | <dom96> Why can't it ever find poor rayman22201? |
21:07:47 | supakeen | Because of the other 22200 rayman's coming first? |
21:09:37 | FromDiscord | <Recruit_main707> in a 1/10 scale, how big is this sin? https://media.discordapp.net/attachments/371759389889003532/713136434105810944/unknown.png |
21:10:16 | FromDiscord | <Recruit_main707> its for interoping with python, and i need to use this fake c arrays |
21:11:51 | FromDiscord | <Generic> quite high, because if I'm not wrong you could use ptr UncheckedArray[cint] instead |
21:12:21 | FromDiscord | <Recruit_main707> i thought about it |
21:12:36 | FromDiscord | <Recruit_main707> can someone else with a higher iq confirm this? |
21:13:45 | FromDiscord | <Recruit_main707> yessssssssss |
21:13:47 | FromDiscord | <Recruit_main707> it works |
21:13:51 | FromDiscord | <Recruit_main707> thank god |
21:14:33 | dadada | who else likes Stevie Wonder? :P https://www.youtube.com/watch?v=FBtUiN_OA9I |
21:17:29 | FromDiscord | <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:48 | FromGitter | <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:20 | leorize | `nim secret` |
21:53:12 | FromGitter | <deech> I though that was a joke but apparently not. Any pointers on how to use it? |
21:55:37 | FromGitter | <deech> Oh I see, it's a REPL. Neat. |
21:56:35 | FromGitter | <deech> Does it (will it) support all of Nim or just the VM subset? |
21:58:36 | FromGitter | <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:56 | FromDiscord | <Yardanico> @deech VM only for now |
22:01:10 | FromGitter | <deech> Cool. A full fledged REPL would be amazing. |
22:02:32 | FromDiscord | <Technisha Circuit> If I'm using the js backend, how do i import JS stuff? |
22:04:44 | FromDiscord | <Generic> there's a problem with REPLs for static programming languages |
22:05:06 | FromDiscord | <Generic> in dynamic programming languages everything is an object in a hash table which can be replaced |
22:05:19 | FromDiscord | <Generic> but that's not the case for Nim |
22:06:14 | FromGitter | <bung87> Technisha Circuit see document modules for js backend. |
22:08:03 | leorize | bung87: try brForceOpen or omit that parameter |
22:08:42 | * | sschwarzer joined #nim |
22:08:54 | * | fredg quit (Quit: Lost terminal) |
22:09:36 | leorize | I wrote brOpen to allow for symbol mixin (ie. capturing the symbol from the another module) |
22:10:06 | leorize | since it would facilitate user-extensible bindParam() |
22:11:24 | FromGitter | <bung87> let me try, I actually not understand what you mean |
22:12:43 | * | solitudesf quit (Ping timeout: 260 seconds) |
22:14:22 | FromGitter | <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:22 | FromGitter | <bung87> none of them work |
22:15:24 | leorize | the latter |
22:15:44 | leorize | bung87: hmm, what did you put in `since`? |
22:16:21 | FromGitter | <dawkot> Doesn't `&` have some magic compiler optimization? |
22:16:24 | FromGitter | <bung87> `{.since: (1, 4).}` |
22:16:30 | FromGitter | <dawkot> I recall Araq saying this |
22:17:24 | leorize | bung87: use (1, 3) |
22:17:26 | FromGitter | <bung87> I even try auto bind experiment |
22:17:49 | sschwarzer | leorize: 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:50 | leorize | dawkot: you can benchmark it |
22:18:11 | leorize | it really depends on how you do it |
22:19:06 | FromDiscord | <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:09 | FromGitter | <bung87> hmm that's wired , in another PR I using 1.4 |
22:22:28 | Yardanico | you should use 1.3 though |
22:22:30 | FromGitter | <bung87> I was told current version is 1.3 so I should use 1.4 |
22:22:33 | Yardanico | no |
22:22:37 | Yardanico | you should care about devel too :) |
22:22:38 | * | neceve quit (Ping timeout: 272 seconds) |
22:23:06 | Yardanico | if 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:56 | Yardanico | guess what |
22:24:05 | Yardanico | I actually love the new dots for Processing hint :P |
22:24:24 | leorize | it's gonna be like "..." then a bunch of CC? |
22:24:37 | Yardanico | ye |
22:24:45 | FromGitter | <bung87> why that PR pass, it use 1.4, |
22:24:58 | Yardanico | which PR? |
22:25:00 | leorize | someone didn't notice |
22:25:03 | FromGitter | <bung87> this PR even not pass compile |
22:25:19 | Yardanico | well it will compile |
22:25:24 | Yardanico | you just won't be able to use the code in 1.3.5 |
22:25:29 | Yardanico | leorize: https://i.imgur.com/1OaxlRw.png |
22:25:41 | FromGitter | <bung87> https://github.com/nim-lang/Nim/pull/14416 |
22:25:48 | leorize | Yardanico: ah, nice |
22:25:49 | Yardanico | need a newline before CC though |
22:25:54 | leorize | true |
22:25:55 | Yardanico | for some reason it's not inserted here |
22:26:31 | * | sschwarzer quit (Quit: leaving) |
22:26:33 | leorize | bung87: you're not testing the new functions, that's why |
22:26:35 | Yardanico | @bung87 there are no tests for your new stuff |
22:26:39 | Yardanico | that's why it will pass just fine |
22:26:45 | Yardanico | and it will compile fine as well |
22:26:56 | Yardanico | since pragma is really simple |
22:27:36 | inv2004 | Hello, 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:36 | inv2004 | header of a proc; redefinition of '$' |
22:27:51 | Yardanico | inv2004: did you do a forward declaration of that $ ? |
22:28:02 | Yardanico | forward declaration and the actual implementation must match all pragmas and annotations |
22:28:31 | inv2004 | Is it about ownership? Probably not, just proc `$`*(x: K): string {.gcsafe.} |
22:28:46 | leorize | gcsafe is about not accessing globals |
22:29:01 | leorize | globals that contains gc memory to be precise |
22:29:07 | FromGitter | <bung87> @Yardanico ok, thanks I get it |
22:29:10 | Yardanico | @bung87 thathttps://github.com/nim-lang/Nim/blob/devel/lib/std/private/since.nim |
22:29:12 | Yardanico | since is really simple |
22:29:16 | * | brainbomb joined #nim |
22:29:22 | Yardanico | literally two 2-line templates :) |
22:30:12 | Yardanico | inv2004: can you show a bit more code and the whole error? |
22:30:13 | inv2004 | @leorize, ok, found forward declaration - did not get why I need it here. |
22:30:20 | FromGitter | <bung87> ok so always since current version |
22:30:27 | Yardanico | yes, current devel version |
22:30:34 | Yardanico | you can check which one it is in lib/system.nim |
22:30:55 | Yardanico | or here http://nim-lang.github.io/Nim/system.html#NimVersion |
22:31:01 | Yardanico | (nightly docs) |
22:31:12 | inv2004 | @Yardanico, here it is https://github.com/inv2004/kdb_nim/blob/d9ac5b1fc2e0c14ae868eb0b7525b28a431bcf51/src/kdb/format.nim#L84 |
22:31:28 | Yardanico | yeah as I said you need to match pragmas for the forward decl and proc itself |
22:33:20 | inv2004 | Isn't forward declaration is just declaration, for example, at start of the module - to make it available for funtions before implementation? |
22:33:31 | Yardanico | well it still needs to match the actual procedure |
22:33:33 | FromGitter | <bung87> oh , that's the devel version list there, someday I was scan source by eye check where is the version number... |
22:33:34 | Yardanico | because pragmas can affect a lot of stuff |
22:33:39 | Yardanico | they can change the whole proc |
22:34:22 | inv2004 | @Yardanico, does it mean - I cannot set gcsafe on $ ? |
22:34:26 | Yardanico | you can? |
22:34:30 | Yardanico | just set it in the forward declaration as well |
22:34:52 | Yardanico | proc `$`(x: K): string {.gcsafe.} for the forward decl |
22:34:54 | inv2004 | Ah, I have forward declaration!!! :) I did not see it, thx :) |
22:34:56 | Yardanico | proc `$`(x: K): string {.gcsafe.} = stuff for the actual proc |
22:35:18 | inv2004 | I did not see it at the beginning of my file. Thx :) |
22:40:14 | FromDiscord | <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:02 | Yardanico | 915 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:17 | inv2004 | Probably 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:37 | Yardanico | might be because it accesses unicodeStyle ? |
22:42:44 | inv2004 | I am trying to pass the "style" to function - but it does not matter |
22:42:46 | Yardanico | hm |
22:42:51 | Yardanico | what does it show exactly? |
22:43:09 | Yardanico | you can try annotating newUnicodeTable proc itself with gcsafe to better understand why it's happening |
22:43:16 | inv2004 | @Yardanico, exactly, that if why I am trying to pass it like parameter, I supposed that only default arg is global |
22:43:42 | Yardanico | well newUnicodeTable calls newTerminalTable which accesses another global :) |
22:43:48 | Yardanico | call newTerminalTable instead? |
22:44:06 | Yardanico | ah well it shouldn't error, hmm |
22:44:24 | inv2004 | but arg should pass to terminaltable too |
22:44:35 | * | tane quit (Quit: Leaving) |
22:44:44 | Yardanico | yeah, you can try to add gcsafe pragma to the proc itself to better understand what's the error |
22:45:08 | Yardanico | hmm I can also try myself, let's see |
22:46:19 | Yardanico | "Warning: 'newUnicodeTable' is not GC-safe as it accesses 'unicodeStyle' which is a global using GC'ed memory" |
22:46:26 | inv2004 | yep |
22:46:39 | inv2004 | but I do: let uS = Style(rowSeparator:"─", colSeparator:"│", cellEdgeLeft:"├", cellEdgeRight:"┤", topLeft:"┌", topRight:"┐", bottomLeft:"└", bottomRight:"┘", topRowSeparator:"┬", bottomRowSeparator:"┴", dashLineLeft:"├", dashLineRight:"┤", dashLineColSeparatorLastRow:"┴", dashLineColSeparatorTopRow:"┬", dashLineColSeparator:"┼") |
22:46:39 | inv2004 | let t = newUnicodeTable(uS) |
22:46:40 | Yardanico | ah right |
22:46:42 | Yardanico | it's the bug |
22:46:45 | Yardanico | in the library itself LOL |
22:46:52 | Yardanico | inv2004: https://github.com/xmonader/nim-terminaltables/blob/master/src/terminaltables.nim#L74 |
22:46:53 | Yardanico | check argument name |
22:46:59 | Yardanico | and what is being passed to newTerminalTable |
22:47:00 | Yardanico | :DDDD |
22:47:13 | Yardanico | "style" vs "unicodeStyle" |
22:47:23 | inv2004 | ah! |
22:47:27 | inv2004 | yep, see it :) |
22:47:35 | Yardanico | works if you fix it |
22:47:38 | Yardanico | you can make a PR |
22:47:42 | dadada | don'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:53 | inv2004 | I am going to use newAsciiTable :) |
22:47:59 | Yardanico | inv2004: no PR? :P |
22:48:03 | Yardanico | I can make it myself then |
22:48:38 | leorize | dadada: poor developers can't afford more than one screen :P |
22:48:47 | inv2004 | I am mix of WSL and win-10, but I can if you want :) |
22:48:59 | FromGitter | <timotheecour> is there `newAsciiTable` somewhere? |
22:49:01 | dadada | leorize: they aint all poor :P I think its a plot to make me mad |
22:49:19 | dadada | s/its/it's |
22:49:30 | Yardanico | inv2004: it's okay, I already opened it :) |
22:49:47 | Yardanico | dadada: well I have two displays |
22:49:51 | Yardanico | 1920x1080 and 1280x1024 |
22:49:55 | Yardanico | and guess what I use the second display for? |
22:50:04 | dadada | Yardanico: mine are both 1920x1080 |
22:50:08 | Yardanico | two workspaces, first one is Quassel | Telegram split 50/50 horizontally |
22:50:13 | dadada | Yardanico: the funny thing to say would be porn |
22:50:18 | Yardanico | second workspace on second display is VLC and mumble |
22:50:24 | inv2004 | Pfff, I use two 960x1080 |
22:50:41 | Yardanico | on 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:03 | FromGitter | <timotheecour> besides `compiler/asciitables.nim` which I added a while back (and which shd probably be moved to fusion/asciitables (@inv2004) |
22:51:14 | inv2004 | Probably another question, why does not it help? let uS = unicodeStyle.deepCopy() |
22:51:14 | inv2004 | let t = newTerminalTable(uS) |
22:51:31 | inv2004 | If I define let uS = Style(...) - it is ok |
22:54:03 | FromGitter | <bung87> `Error: invalid pragma: since: (1, 3)` CI report this |
22:54:23 | FromGitter | <bung87> I've `include "system/inclrtl"` |
22:54:30 | Yardanico | that's the wrong place though |
22:54:45 | Yardanico | it's std/private/since now |
22:54:51 | Yardanico | "import std/private/since" |
22:55:34 | leorize | in the future we might want to make it a macro :P |
22:55:44 | Yardanico | to report the error instead or something? |
22:55:45 | leorize | which can add a footnote to the docs |
22:55:50 | Yardanico | oh |
22:55:52 | Yardanico | yeah right |
22:56:14 | FromGitter | <bung87> `Error: cannot open file: std/private/since` |
22:56:21 | Yardanico | what's your nim version? |
22:56:25 | FromGitter | <bung87> nim -v ⏎ Nim Compiler Version 1.3.1 [MacOSX: amd64] |
22:56:28 | Yardanico | that's pretty old |
22:56:41 | Yardanico | https://github.com/nim-lang/Nim/commit/fbc97e712a67f30076f7633880383c8c4ae7866f |
22:56:43 | Yardanico | 19 days ago :) |
22:56:52 | Yardanico | so you have to update your compiler XD |
22:56:56 | inv2004 | Why deepcopy does not clone? :( |
22:57:00 | FromGitter | <timotheecour> @bung87 always check on devel before :) |
22:57:23 | FromGitter | <bung87> ok , `choosenim update devel` now |
22:57:59 | FromGitter | <bung87> everyday everything is new |
22:58:59 | Yardanico | yeah |
23:00:14 | Yardanico | inv2004: https://github.com/xmonader/nim-terminaltables/pull/6 merged :D |
23:00:30 | FromGitter | <deech> What's the difference between `choosenim update devel` and `choosenim "#head"`? |
23:00:45 | inv2004 | @Yardanico, thx! Could you help with deepCopy? |
23:00:53 | Yardanico | well I don't exactly understand the issyue |
23:01:11 | Yardanico | as far as I know deepCopy just does a deep copy of all data, creating a full clone :) |
23:02:04 | FromGitter | <bung87> devel branch, master#head comment |
23:02:09 | FromGitter | <bung87> commit |
23:02:18 | inv2004 | @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:34 | Yardanico | but unicodeStyle is a global variable isn't it? |
23:02:48 | FromGitter | <deech> Oh really it defaults to master#head and not devel#head? That's interesting. I thought devel was the default branch. |
23:02:57 | inv2004 | yes, But ins't deepCopy do a local copy? |
23:02:59 | Yardanico | @deech it is |
23:03:21 | Yardanico | inv2004: but you still access unicodeStyle first |
23:03:24 | Yardanico | which is global :D |
23:03:40 | inv2004 | ah, blin. |
23:03:40 | FromGitter | <bung87> hmm, may check choosenim source |
23:03:46 | inv2004 | @Yardanico, how to fix it? |
23:04:40 | Yardanico | uhh 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:59 | inv2004 | copy of declaration is bad :( |
23:07:29 | inv2004 | Will adding threadvar to the unicodeStyle help? |
23:07:38 | Yardanico | hmm it might help |
23:07:42 | Yardanico | it'll create a new unicodeStyle for each thread |
23:08:10 | inv2004 | But is it problem? Because we have to copy anyway |
23:10:31 | leorize | the fix is to use --gc:arc :P |
23:10:46 | Yardanico | yep |
23:10:58 | Yardanico | leorize: https://github.com/nim-lang/Nim/issues/14410#issuecomment-632353904 |
23:11:00 | Yardanico | :D |
23:11:38 | Yardanico | the future is now |
23:11:45 | Yardanico | stuff doesn't work with default GC but works with arc |
23:12:01 | * | leorize quit (Quit: WeeChat 2.7.1) |
23:12:20 | FromGitter | <deech> Same thing happened to me with my libclang bindings. |
23:12:34 | Yardanico | well yeah you should generally try arc :P |
23:12:40 | Yardanico | and report bugs |
23:12:50 | Yardanico | although for that it's much better to use devel which has a lot of arc bugfixes |
23:13:09 | * | leorize joined #nim |
23:13:19 | Yardanico | (and no they won't be in 1.2.2) |
23:13:22 | FromGitter | <deech> Yep, I'm on `HEAD` for everything. |
23:13:42 | FromGitter | <xmonader> @Yardanico thanks, and sorry @inv2004 for the inconvenience |
23:13:49 | Yardanico | @xmonader it's ok :) |
23:14:09 | Yardanico | ah actually |
23:14:13 | Yardanico | 1.2.2 will have most arc fixes |
23:14:32 | * | Trustable quit (Remote host closed the connection) |
23:15:03 | inv2004 | @leorize, I am too young for the gc:arc :) |
23:15:42 | FromDiscord | <Clyybber> it can only be that gc:arc is too young for you |
23:15:46 | FromDiscord | <Clyybber> not the other way around :p |
23:15:55 | inv2004 | xmonader, sorry, did not get should I create PR for threadvar or not :) |
23:16:12 | Yardanico | inv2004: well I mean if a lib wants to claim it's threadsafe it might do that |
23:16:25 | Yardanico | but if some program has 1000 threads it might not want that :P |
23:17:51 | inv2004 | too much philosophy :) |
23:20:28 | FromGitter | <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:41 | Yardanico | @xmonader well he's talking about the old threads :) |
23:20:50 | Yardanico | unicodeStyle is global so it can't be accessed in another thread |
23:20:53 | Yardanico | since it's a "let" |
23:21:01 | Yardanico | one solution would be to make it "const" I think |
23:21:09 | Yardanico | since it wouldn't need to change anyway |
23:21:22 | * | Jesin quit (Quit: Leaving) |
23:21:24 | inv2004 | @Yardanico, old? I updated to nim 1.2 just two weeks ago :) |
23:21:33 | Yardanico | inv2004: i'm in the future on 1.3.5 |
23:21:39 | FromGitter | <xmonader> aha, also he can define another const style and use it no? |
23:21:46 | inv2004 | @Yardanico, do not go too far! |
23:21:49 | FromGitter | <xmonader> wow 1.3.5 :O I'm that late behind. |
23:21:52 | Yardanico | @xmonader well but for less code repetition |
23:22:01 | Yardanico | to use the default style from the lib |
23:22:11 | Yardanico | and anyway having it as "const" wouldn't do any bad for the lib anyway |
23:22:14 | FromGitter | <xmonader> if const fixes it i'm ok with merging that indeed |
23:22:52 | inv2004 | How @Yardanico merges PR's so fast? Into someones repo |
23:23:05 | Yardanico | that one was created in github's web UI :P |
23:23:09 | Yardanico | it's literally a 1-line fix |
23:24:24 | inv2004 | I expected will will share secret how to do it so fast, but it was just cheat :) |
23:24:46 | inv2004 | s/will/you/ |
23:24:58 | FromGitter | <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:19 | FromGitter | <xmonader> been doing to much crystal that I'm saturated ... |
23:26:21 | inv2004 | xmonader, thank you! |
23:26:41 | * | Jesin joined #nim |
23:26:43 | FromGitter | <xmonader> most welcome :) |
23:27:08 | inv2004 | 3rd 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:12 | inv2004 | Why ? |
23:27:24 | inv2004 | because d[1] is not var ? |
23:27:42 | inv2004 | but d is var |
23:32:47 | Yardanico | @xmonader any reason for Cell and TerminalTable being "object" but you use "ref Object" everywhere? |
23:35:21 | * | thomasross joined #nim |
23:37:18 | FromGitter | <xmonader> no not really |
23:38:03 | * | thomasross quit (Max SendQ exceeded) |
23:38:11 | FromGitter | <xmonader> i usually make everything of objet and if mutable i pass ref to the methods |
23:38:22 | Yardanico | why though? |
23:38:29 | Yardanico | you can just make it as "ref object" if you use it as "ref Obj" everywhere |
23:38:32 | * | thomasross joined #nim |
23:38:43 | FromGitter | <xmonader> go habit i think :) |
23:40:02 | Yardanico | also since you target nim >= 0.19.4 you don't need to initalize seqs and strings |
23:40:17 | Yardanico | since 0.19.0 made them empty (but initialized) by default |
23:42:07 | Yardanico | also setRows and addRows are the same :D |
23:42:25 | Yardanico | I'll create a PR with my (opinionated but mostly NEP-1 style fixes) and a few other small code changes |
23:42:29 | Yardanico | really small |
23:42:59 | * | inv2004 quit (Read error: Connection reset by peer) |
23:43:31 | FromGitter | <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:41 | FromGitter | <xmonader> sure much appreciated indeed ^_^ |
23:47:50 | * | sagax joined #nim |
23:54:09 | * | krux02_ joined #nim |
23:55:26 | Yardanico | I made the PR, although I'm not proud of one thing I did |
23:55:29 | Yardanico | "this[] = newTerminalTable()[]" :D |
23:55:34 | Yardanico | to have less code repetitions |
23:57:22 | Yardanico | also one thing I might add (but it's just nitpicking and generally might confuse some people) is the using statement |
23:57:31 | Yardanico | so instead of writing (this: TerminalTable) in a lot of procs you can just write |
23:57:36 | Yardanico | using this: TerminalTable |
23:57:36 | Yardanico | once |
23:57:47 | Yardanico | and then use it as "proc setRows*(this; rows: seq[seq[string]])" |
23:57:49 | * | krux02 quit (Ping timeout: 258 seconds) |
23:57:52 | Yardanico | notice the semicolon instead of a comma |
23:58:06 | Yardanico | https://nim-lang.org/docs/manual.html#statements-and-expressions-using-statement |
23:58:11 | FromGitter | <xmonader> yup much better indeed imo (y) |
23:58:28 | FromGitter | <xmonader> I merged thank you |
23:59:10 | FromGitter | <zetashift> Not sure how I feel about that, saves up some typing but I always infer so much from proc signatures |
23:59:17 | Yardanico | well yeah might be true |
23:59:24 | Yardanico | but what if you literally have 20-30 procs for same type |
23:59:38 | FromGitter | <zetashift> yeah, then I'd use it too but I feel like I just might abuse it ;p |
23:59:51 | Yardanico | xd |