00:02:13 | * | [R] quit (Ping timeout: 240 seconds) |
00:07:34 | * | [R] joined #nim |
00:20:49 | * | PMunch quit (Quit: leaving) |
00:46:51 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3HEs |
00:47:12 | FromDiscord | <Rika> so a LRU cache? |
00:47:13 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=3HEs" => "https://play.nim-lang.org/#ix=3HEt" |
00:47:22 | FromDiscord | <TryAngle> ah yes exactly thaat, forgot tit's name |
00:47:25 | FromDiscord | <TryAngle> (edit) "tit's" => "it's" |
00:47:29 | FromDiscord | <TryAngle> (edit) "thaat," => "that," |
00:47:35 | FromDiscord | <Rika> prolly 3rd party |
00:57:45 | * | noeontheend joined #nim |
00:58:11 | FromDiscord | <valerga> how does nim have so many backends/targets, c, cpp, objc, js, seems like a lot of work? |
01:01:17 | FromDiscord | <Elegantbeef> it has a code gen phase that is somewhat hookable |
01:01:38 | FromDiscord | <Elegantbeef> So you need to take the Nim code then emit semantically correct backend and send it to where it needs to go |
01:06:26 | * | lumo_e quit (Ping timeout: 268 seconds) |
01:18:54 | * | krux02 quit (Remote host closed the connection) |
01:25:35 | FromDiscord | <Sabena Sema> In reply to @valerga "how does nim have": well, C, cpp, and objc are very similar in terms of what the code looks liike |
01:25:38 | FromDiscord | <Sabena Sema> (edit) "liike" => "like" |
01:26:09 | FromDiscord | <Sabena Sema> nim isn't emitting the kind of code that a human would write in those languages |
01:26:10 | FromDiscord | <Rika> They share a lot of their code base yes |
01:26:15 | FromDiscord | <Sabena Sema> (edit) "nim isn't emitting the kind of code that a human would write in those languages ... " added "either" |
01:26:48 | FromDiscord | <Sabena Sema> so it needs to generate just a subset of all the "normal" patterns you'd see in code |
01:27:29 | FromDiscord | <leorize> the C++ backend is really just the C backend but with exceptions \:p |
01:28:43 | FromDiscord | <Sabena Sema> are nim's C exceptions typcially just sjlj style |
01:29:23 | FromDiscord | <leorize> if you use arc then it's kinda like an if statement |
01:29:46 | FromDiscord | <leorize> "goto exceptions", as we call it |
01:29:56 | FromDiscord | <Sabena Sema> (I'm convinced that C++ table based exception handling could be implemented much, much better (in particular in the matching phase of exception catching) if you can exploit {.final.} / final exceptions |
01:30:06 | FromDiscord | <Sabena Sema> (edit) "exceptions" => "exceptions)" |
01:30:20 | FromDiscord | <leorize> sjlj is the default for non-arc gc, though |
01:30:45 | FromDiscord | <Sabena Sema> none of the c++ implementations around can exploit that though, since they can't really break exceptions ABI and their implementations were designed before final was a "thing" |
01:31:24 | FromDiscord | <leorize> c++ people are looking into a redesign of exceptions and it looks pretty good |
01:32:00 | * | noeontheend quit (Quit: noeontheend) |
01:32:43 | FromDiscord | <Sabena Sema> herbceptions is unlikely to happen in the next decade |
01:33:03 | FromDiscord | <Sabena Sema> it's a good idea, but has zero actual traction in wg21 |
01:33:16 | FromDiscord | <Sabena Sema> (edit) "it's a good idea, but has zero actual traction in wg21 ... " added "in terms of people actually doing the work to get it through" |
01:33:31 | FromDiscord | <leorize> thankfully nim is not c++ so we can steal it and beat them to the punch \:p |
01:33:58 | FromDiscord | <leorize> in fact we have a similar proposal made by Araq |
01:34:08 | FromDiscord | <Sabena Sema> like it's a whole new error handling facility, many people are not convinced that adding another separate error handling facility to the core lang is needed (the usual outcome here is that we get some insane library metaprogramming approach) |
01:34:12 | FromDiscord | <leorize> it suffers from the same fate, though |
01:34:21 | FromDiscord | <Sabena Sema> Quirky exceptions? |
01:35:05 | FromDiscord | <leorize> https://github.com/nim-lang/Nim/issues/8363 |
01:35:54 | FromDiscord | <Sabena Sema> hmm, even nim's exception semantics shouldn't require an allocation |
01:35:57 | FromDiscord | <Sabena Sema> I don't think C++'s do |
01:36:02 | FromDiscord | <Sabena Sema> (edit) "I don't think ... C++'s" added "even" |
01:36:20 | FromDiscord | <leorize> c++ do for most practical use of it, unfortunately |
01:36:37 | FromDiscord | <Sabena Sema> only on itanium abi |
01:38:43 | FromDiscord | <Sabena Sema> you can pre-allocate even on itanium-abi, so you can still handle out of memory by exception (although most systems that follow itanium-abi for c++ overcommit anyway, so that point is moot) |
01:38:43 | * | noeontheend joined #nim |
01:39:34 | FromDiscord | <leorize> nim pretty much do the same thing, the allocation is still awful, though |
01:40:04 | FromDiscord | <leorize> maybe it will be dealt with by the time nim 3.0 comes, if ever \:p |
01:41:05 | FromDiscord | <Sabena Sema> personally I would like a way to hook into exceptions and write the implementation in library code |
01:41:21 | FromDiscord | <Sabena Sema> but ... composition is a total nightmare |
01:41:45 | FromDiscord | <leorize> yea, customizability is a double-edged sword |
01:42:16 | FromDiscord | <Sabena Sema> the problem is when exceptiosn can flow through like, random other stack frames |
01:42:41 | FromDiscord | <Sabena Sema> sjlj and c++ style tables allow this by construction |
01:44:24 | FromDiscord | <Sabena Sema> the return value or hidden pointer methods don't necessarily allow this without using like, a tls global, which can have bad consiquences |
01:44:29 | FromDiscord | <Sabena Sema> (edit) "consiquences" => "consequences" |
01:44:37 | FromDiscord | <Sabena Sema> I think Ada takes the more control flow oriented approach |
01:44:49 | FromDiscord | <Sabena Sema> or at least gnat does |
01:46:41 | FromDiscord | <Sabena Sema> glib/gobject is the hidden pointer approach |
01:46:51 | FromDiscord | <Sabena Sema> and seems to work fairly well in practice |
01:48:08 | * | noeontheend quit (Remote host closed the connection) |
01:50:25 | FromDiscord | <Sabena Sema> I like this PR and the discussion so far |
01:50:35 | FromDiscord | <Sabena Sema> well this issue rahter |
01:52:27 | FromDiscord | <leorize> nim has a hidden pointer in tls for this as well |
01:52:39 | FromDiscord | <leorize> it works well enough, i suppose |
01:53:08 | FromDiscord | <Sabena Sema> gobject does the pointer just at the end of the argument list for functions that can raise |
01:53:10 | FromDiscord | <Sabena Sema> no tls |
01:54:15 | FromDiscord | <Sabena Sema> using tls is only really a problem because of limited tls slots and because it can cause optimizers to do bad things, because they see the global write and have to assume they don't have a complete picture of the world |
01:55:53 | FromDiscord | <leorize> the nice thing about nim is that you know for sure most code won't be threaded |
01:56:20 | FromDiscord | <leorize> well, not nice thing, rather |
01:57:50 | FromDiscord | <Sabena Sema> do you though? |
01:58:07 | FromDiscord | <Sabena Sema> and, just not being threaded doesn't eliminate the problems with optimizers |
01:59:16 | FromDiscord | <Sabena Sema> notably errno and Get/SetLastError have like, actual special runtime support from the OS |
01:59:25 | FromDiscord | <leorize> yes you do, because threading is just too hard in nim the moment you need to throw memory around \:p |
01:59:26 | FromDiscord | <Sabena Sema> at least Get/SetLastError is not stored using normal tls |
01:59:56 | FromDiscord | <Sabena Sema> eagh, I've done it before |
01:59:58 | FromDiscord | <Sabena Sema> it's not that bad |
02:00:30 | FromDiscord | <Sabena Sema> I've even done it with two other gcs running in process (both a python interpreter and the C# CLR runtime) |
02:00:43 | FromDiscord | <Sabena Sema> it was a party |
02:00:50 | FromDiscord | <leorize> you give up anything that have the word `ref` in it, though |
02:00:56 | FromDiscord | <Sabena Sema> no |
02:01:03 | FromDiscord | <leorize> isolate was meant to solve this, but it didn't |
02:01:18 | FromDiscord | <Sabena Sema> when you need to share refs you just pin them and take a pointer |
02:02:18 | FromDiscord | <leorize> with a lot of work, you can get threading done, but it's a lot of work |
02:02:37 | FromDiscord | <Sabena Sema> if you are doing multithreaded programming and don't understand your memory ownership model things are bound to fail anyway |
02:03:26 | FromDiscord | <Sabena Sema> and, fwiw, the fact memory management is thread local really does make things faster in general |
02:04:53 | FromDiscord | <leorize> the effect on speed so far has been minimal, unfortunately |
02:05:38 | FromDiscord | <leorize> there are several piece of work being done on moving memory across thread in nim but most of them are not going well |
02:05:40 | FromDiscord | <Sabena Sema> really? I thought nim's alloc and delete beat most malloc implementations by quite a bit |
02:06:50 | FromDiscord | <leorize> tslf is O(1), but it also means that you give up some special work that other allocators can do for small sizes since the time has to be constant |
02:07:13 | FromDiscord | <leorize> and in threading mode Nim's allocator is protected by a single mutex |
02:07:23 | FromDiscord | <Sabena Sema> also: once a ref is pinned on the allocating thread you can inc and dec the refcount without atomic operations (on amd64) |
02:07:50 | FromDiscord | <Sabena Sema> it's very common to have a single allocator lock |
02:08:27 | * | src quit (Quit: Leaving) |
02:10:12 | FromDiscord | <Sabena Sema> it definitely does start to get into "juggling razorblades" territory, but I guess in my case I already had three gcs running (one of which was _moving_ and was sharing memory between all three, so the razorblades were very much already in the air |
02:11:12 | FromDiscord | <Sabena Sema> all different kinds of automatic memory management (refcounting, deffered refcounting, thread local rc, basic mark/sweeb bdwgc style gc, and compacting gc) have uses for different kinds of programs |
02:11:27 | FromDiscord | <Sabena Sema> and ofc the fastest gc of "never free anything" |
02:15:07 | FromDiscord | <leorize> the lock is fine until you have to juggle 10k threads \:p |
02:15:32 | FromDiscord | <Sabena Sema> yesp |
02:15:34 | FromDiscord | <Sabena Sema> (edit) "yesp" => "yep" |
02:15:37 | FromDiscord | <Sabena Sema> depends what they are doing too |
02:15:41 | FromDiscord | <leorize> one of the thing we are researching is moving computation and data between threads, and nim refs are horrible for that at the moment |
02:16:00 | FromDiscord | <Sabena Sema> but if you are like, a usual java program 10k threads with a global lock will end up with everyone piled on that lock quite a bit |
02:16:27 | FromDiscord | <Sabena Sema> that's true |
02:17:29 | FromDiscord | <leorize> not only that isolate doesn't work at runtime, orc cycle collection makes it impossible to move refs safely as it peeks into the refcount for trial deletion |
02:17:39 | FromDiscord | <leorize> which is not atomic... |
02:18:00 | FromDiscord | <Sabena Sema> it just reads though right? |
02:18:55 | FromDiscord | <leorize> yes but if the count is not correctly synchronized, an object might be prematurely freed |
02:19:05 | FromDiscord | <leorize> which it usually is not when you juggle them around threads |
02:19:28 | FromDiscord | <Sabena Sema> how can that happen if the actual writes to the count are correctly synchronized? |
02:20:01 | FromDiscord | <leorize> the writes are not synchronized, they are not atomics |
02:20:08 | FromDiscord | <Sabena Sema> oh |
02:20:09 | FromDiscord | <Sabena Sema> yeah |
02:20:36 | FromDiscord | <Sabena Sema> then your pretty screwed (although things might "just work" on x86 lol) |
02:20:54 | FromDiscord | <leorize> afaik in loony (mpmc ref object queue) they currently use a full fence to "hopefully" force the count to synchronize |
02:21:13 | FromDiscord | <Sabena Sema> two concurrent refs racing and resulting in only one increment then those two unrefs later not racing and resulting in two derefs |
02:25:12 | FromDiscord | <leorize> the folks working on loony do their work with \>10k objects so their "luck" to get desynchronized counts are a bit too high for comfort \:p |
02:25:43 | FromDiscord | <leorize> so right now they are looking at making refcount atomics and try to figure out ways to make atomics not have to happen |
02:25:57 | FromDiscord | <Sabena Sema> just copying the objects into a shared heap using like SmartPtr or whatever seems easier |
02:26:28 | FromDiscord | <Sabena Sema> the idea is that the queue transfers ownership at both ends or no? |
02:33:16 | FromDiscord | <leorize> pretty much, though I could be wrong, the goal is to move continuations between threads |
03:12:29 | * | arkurious quit (Quit: Leaving) |
03:16:26 | * | jmdaemon joined #nim |
03:58:34 | * | noeontheend joined #nim |
04:04:01 | * | jmdaemon quit (Quit: WeeChat 3.3) |
04:04:17 | * | jmd joined #nim |
04:04:48 | * | jmd quit (Client Quit) |
04:05:02 | * | jmdaemon joined #nim |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:28 | * | jmdaemon quit (Client Quit) |
04:06:30 | * | supakeen joined #nim |
04:06:42 | * | jmdaemon joined #nim |
04:08:17 | * | jmdaemon quit (Client Quit) |
04:08:34 | * | jmdaemon joined #nim |
04:22:45 | * | jmdaemon quit (Ping timeout: 252 seconds) |
04:41:56 | * | jmdaemon joined #nim |
05:19:47 | nrds | <Prestige99> Is https://github.com/moigagoo/nimage the current nimage package? I see an older one with less stars that's linked on nimble.directory |
05:20:14 | nrds | <Prestige99> ohoh I looked at the wrong repo |
05:23:10 | nrds | <Prestige99> actually wanted https://github.com/haldean/nimage |
05:40:13 | FromDiscord | <baalajimaestro> Does nim have something like a file that would let people nimble install deps much easily?↵↵Something like python requirements.txt or Rust's Cargo.toml |
05:41:43 | nrds | <Prestige99> Packages would have a .nimble file with dependencies listed, then you can install with `nimble install -d` |
05:41:56 | nrds | <Prestige99> e.g. https://github.com/treeform/pixie/blob/master/pixie.nimble |
05:43:53 | FromDiscord | <baalajimaestro> on the case of pixie, I do a `nimble install -d` from the root of the clone, right? |
05:46:48 | FromDiscord | <Rika> yes |
05:56:53 | nrds | <Prestige99> Is there a simple way to init a 2d seq with zeroed entries? like if I wanted a 3x3 grid of booleans for instance |
05:57:38 | nrds | <Prestige99> or x by y in general, doesn't have to be a square |
06:01:23 | * | noeontheend quit (Ping timeout: 252 seconds) |
06:11:33 | FromDiscord | <Rika> in general a rectangular 2d seq can be distilled into a 1d seq with NxM entries |
06:11:53 | FromDiscord | <Rika> it is also better at performance and holding the rectangular invariant |
06:12:32 | FromDiscord | <Rika> you can make wrapper procs `[](seq, tuple[int, int])` and `[]=` |
06:12:46 | nrds | <Prestige99> good point. I thought there may be a lib for it but I can just write a simple one |
06:19:56 | nrds | <Prestige99> hm I wish I could do proc `[][]`(this: Foo, x, y: int) |
06:20:01 | nrds | <Prestige99> and call it like myArr[0][1] |
06:22:33 | nrds | <Prestige99> https://play.nim-lang.org/#ix=3HFr What's wrong here? Something weird with generics |
06:25:23 | * | jmdaemon quit (Ping timeout: 250 seconds) |
06:25:48 | nrds | <Prestige99> oh, I have to do `get[bool](s, 1, 2) |
06:25:54 | nrds | <Prestige99> that's.. odd? |
06:26:42 | FromDiscord | <Elegantbeef> Why wouldnt you have to |
06:26:58 | nrds | <Prestige99> Couldn't the type be inferred from s? |
06:27:25 | FromDiscord | <Elegantbeef> Ah sorry read the wrong proc |
06:28:05 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=3HFs |
06:28:14 | FromDiscord | <Elegantbeef> Yep |
06:28:16 | nrds | <Prestige99> Yeah fixed that |
06:28:23 | FromDiscord | <Elegantbeef> There's the error 😛 |
06:29:37 | nrds | <Prestige99> oh so this compiles but nimlsp is still showing errors, that's all |
06:31:56 | nrds | <Prestige99> https://play.nim-lang.org/#ix=3HFt Elegantbeef do you know any magic I could pull to use something nicer than get/set function names? |
06:32:09 | nrds | <Prestige99> Like I was speaking about above, s[0][1] = true or whatever |
06:33:03 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3HFu |
06:33:17 | nrds | <Prestige99> oh neat |
06:33:25 | FromDiscord | <Sabena Sema> In reply to @nrds "<Prestige> hm I wish": you can do this with a little temporary object, but just using foo[x,y] is just ... better |
06:34:07 | FromDiscord | <Sabena Sema> a 1D array of NxM is better in every single way then the insane ragged N pointers to N elements thing you see in C |
06:34:26 | nrds | <Prestige99> Yeah for sure |
06:35:00 | FromDiscord | <Sabena Sema> and, unlike in C++ you can actually use the subscript operator for it |
06:35:26 | * | rockcavera joined #nim |
06:35:26 | * | rockcavera quit (Changing host) |
06:35:26 | * | rockcavera joined #nim |
06:39:44 | * | jmdaemon joined #nim |
07:18:31 | nrds | <Prestige99> Does std/monotimes getMonoTime actually use nanoseconds? I'm running a bit of code that seems to take about 14 seconds, but it's reporting back 14452299 nanoseconds (which is about 14 milliseconds) |
07:18:55 | nrds | <Prestige99> Would make sense if it were actually microseconds |
07:23:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/Tz9 |
07:26:20 | nrds | <Prestige99> Weird. If my code is running so fast I wonder why it's taking 14 seconds to echo that it's finished and exit |
07:26:40 | nrds | <Prestige99> https://github.com/avahe-kellenberger/maze_bench_nim for reference |
07:27:15 | nrds | <Prestige99> Compiling for danger and speed |
07:29:14 | FromDiscord | <Elegantbeef> 14 seconds you say? 😀 |
07:29:46 | FromDiscord | <Elegantbeef> It's taking much longer than 14 seconds here |
07:30:06 | nrds | <Prestige99> Yep |
07:30:30 | FromDiscord | <Elegantbeef> I dont kno wwhat to say it seems to work fine |
07:30:53 | nrds | <Prestige99> But the measured time is way off? |
07:31:11 | FromDiscord | <Elegantbeef> Did the above example work? |
07:31:51 | nrds | <Prestige99> Yeah. What times printed for you in this maze benrhmark? |
07:32:07 | FromDiscord | <Elegantbeef> Was taking too long |
07:32:09 | FromDiscord | <Elegantbeef> Stopped it |
07:33:25 | nrds | <Prestige99> Mind running it till it exits? |
07:41:44 | FromDiscord | <Elegantbeef> If it takes hours i hate you |
07:42:57 | nrds | <Prestige99> Lol well it takes me 14 seconds so hopefully not very long for you |
07:43:16 | FromDiscord | <Elegantbeef> Still running |
07:43:33 | nrds | <Prestige99> I wonder if it's just hanging after finishing for some odd reason |
07:43:56 | FromDiscord | <Elegantbeef> 0 seconds |
07:44:17 | FromDiscord | <Elegantbeef> Your warmup takes a bunch of time i reason |
07:44:57 | nrds | <Prestige99> Hmm yeah |
07:54:39 | FromDiscord | <valerga> anything nicer than |
07:54:42 | FromDiscord | <valerga> ? |
07:54:46 | FromDiscord | <valerga> sent a code paste, see https://play.nim-lang.org/#ix=3HFQ |
07:54:58 | FromDiscord | <valerga> if I don't know the number of iterations |
08:09:40 | FromDiscord | <Michal58> Make an infinite natural numbers iterator |
08:12:06 | FromDiscord | <Michal58> sent a code paste, see https://paste.rs/69Q |
08:14:05 | FromDiscord | <valerga> that works, thanks |
09:28:57 | * | jjido joined #nim |
09:36:19 | * | Colt quit (Remote host closed the connection) |
11:40:50 | * | src joined #nim |
11:40:51 | ozzz | Hi! Which editor/ide with nim support is the best functions and performance vise? I mean not the VScode, it eats alot of ram and cpu |
11:43:32 | FromDiscord | <tbrekalo> is there something as .clang-format for nim? |
11:50:13 | FromDiscord | <Rika> No |
11:50:19 | FromDiscord | <Rika> Best is nimpretty |
11:50:25 | FromDiscord | <Rika> Rather closest |
11:53:04 | FromDiscord | <victorNine> Hi! I am trying to run a binary compiled in Nim on OpenWRT witch uses WolfSSL. Is there any way to compile for that? |
11:53:24 | FromDiscord | <victorNine> (Testing out Nim so pretty new to it) |
11:55:12 | FromDiscord | <Rika> I know there is a way but I do not know what it is |
11:59:44 | FromDiscord | <hmmm> In reply to @ozzz "Hi! Which editor/ide with": micro, you "install" it, auto recognizes nim synthax, applies nimsuggest each save. Zero config, no extensions, justworks.jpg |
12:00:50 | FromDiscord | <hmmm> good defaults, and you can use a mouse like sane people do 😋 |
12:01:23 | FromDiscord | <hmmm> you can also F7 to compile and run but you have to set it |
12:01:25 | FromDiscord | <Rika> Honestly the best editors allow for both mouse+kb and kb only usage |
12:02:57 | FromDiscord | <hmmm> honestly we should stop funnelling people into VSCode just because we happen to have a clunky extension that kind of works on it but not really. VSCode is a terrible editor |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:31 | * | supakeen joined #nim |
12:09:22 | FromDiscord | <pmunch> Mouse? What is this heresy you speak of? |
12:13:44 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
12:14:31 | * | terminalpusher joined #nim |
12:17:38 | FromDiscord | <pmunch> I use Vim with NimLSP. Works fairly well, although the LSP implementation could use some love↵(<@709044657232936960_ozzz=5b=49=52=43=5d>) |
12:25:37 | FromDiscord | <pmunch> [victorNine](https://matrix.to/#/@victor9:feneas.org)\: OpenWRT is a kind of Linux system isn't it, just very stripped down? |
12:32:05 | FromDiscord | <Rika> yes |
12:32:35 | FromDiscord | <Rika> In reply to @hmmm "honestly we should stop": i honestly dont see the difference between your beloved editor and vsc |
12:38:22 | * | jmdaemon quit (Quit: WeeChat 3.3) |
12:42:30 | FromDiscord | <victorNine> Yes it is |
12:48:46 | FromDiscord | <Abi> sent a code paste, see https://play.nim-lang.org/#ix=3HH7 |
12:49:11 | FromDiscord | <Abi> (edit) |
12:49:59 | FromDiscord | <Abi> (edit) "https://play.nim-lang.org/#ix=3HH7" => "https://play.nim-lang.org/#ix=3HH8" |
12:50:06 | FromDiscord | <Rika> are you using async or closure iterators |
12:50:28 | FromDiscord | <Abi> No, and what? |
12:50:57 | FromDiscord | <Rika> `iterator ...(...): ... {.closure.} =` i think |
12:51:04 | FromDiscord | <Michal58> In reply to @hmmm "honestly we should stop": Hmm, I was just thinking about trying VScode... I have never used it (for anything) but now I'm not sure it's worth it? |
12:51:21 | FromDiscord | <Rika> or `proc ...(...): iterator(): ... = return ...` |
12:52:38 | FromDiscord | <Abi> sent a code paste, see https://play.nim-lang.org/#ix=3HH9 |
12:53:15 | FromDiscord | <Rika> `adjacent in getAdjacentPoints(point):` do you mean `for ...`? |
12:53:23 | FromDiscord | <Abi> (edit) "https://play.nim-lang.org/#ix=3HH9" => "https://play.nim-lang.org/#ix=3HHa" |
12:53:27 | FromDiscord | <Abi> yeah, i mangled that when editing it in discord |
12:53:30 | FromDiscord | <Rika> okay |
12:53:35 | FromDiscord | <Rika> i see the issue then |
12:53:39 | FromDiscord | <Rika> wait not really |
12:53:42 | FromDiscord | <Abi> (edit) "https://play.nim-lang.org/#ix=3HHa" => "https://play.nim-lang.org/#ix=3HHb" |
12:53:53 | FromDiscord | <Rika> it shouldnt be an issue but since the 2nd proc is a closure proc |
12:53:57 | FromDiscord | <Rika> aka captures cave |
12:54:09 | FromDiscord | <Rika> so capturing cave whilst cave is variable... |
12:54:21 | * | rockcavera quit (Remote host closed the connection) |
12:55:15 | FromDiscord | <Rika> im still thinking why again this is not good, because i have forgotten |
12:55:21 | FromDiscord | <Abi> `iterate` modifies `cave` later on hence the `var` |
12:56:07 | FromDiscord | <Rika> handle nine should probably not be a proc within iterate |
12:56:47 | FromDiscord | <Rika> also, does iterate need to "pass cave out modified without returning it" or just needs it to be mutable? |
12:57:07 | FromDiscord | <Rika> In reply to @Rika "also, does iterate need": if this is true, make the parameter just "Cave" and do the workaround |
12:57:14 | FromDiscord | <Rika> var parameters have a different meaning |
12:57:33 | FromDiscord | <Abi> In reply to @Rika "handle nine should probably": `handleNine` modifies some other variables that are defined in `iterate`, hence that weirdness |
12:58:25 | FromDiscord | <Abi> In reply to @Rika "also, does iterate need": `iterate` needs to modify `cave` and have those changes accessible by the caller |
12:58:38 | FromDiscord | <Abi> if that makes sense, words are failing me atm lol |
12:59:38 | FromDiscord | <Rika> okay, this is the simpler question, are you returning `cave` in that tuple or some other var typed Cave? |
12:59:52 | FromDiscord | <Abi> `cave` |
13:00:15 | FromDiscord | <Rika> then make `cave` a `Cave` instead of var Cave and keep on using that workaround |
13:00:30 | FromDiscord | <Abi> gotcha |
13:00:38 | FromDiscord | <Rika> `var Cave` means that any changes you make to `cave` will "automatically" be done as well to the outer scope and not need to be returned as well |
13:00:58 | FromDiscord | <Abi> oooooooo |
13:01:04 | FromDiscord | <Abi> that's actually what i was aiming for |
13:01:17 | FromDiscord | <Rika> yes but then you cant use the nested proc xd |
13:01:27 | FromDiscord | <Abi> damnit lol |
13:01:40 | FromDiscord | <Rika> i dont exactly know why |
13:01:51 | FromDiscord | <Rika> its really better to explicitly pass everything you need |
13:01:54 | FromDiscord | <Rika> imo |
13:02:25 | FromDiscord | <Abi> probably |
13:02:32 | FromDiscord | <Abi> Either way - thanks for your help! |
13:09:10 | FromDiscord | <victorNine> Seems like SSL is not "pluggable" https://github.com/nim-lang/Nim/issues/14719 |
13:33:56 | FromDiscord | <pmunch> I believe you can use https://nim-lang.org/docs/nimscript.html#patchFile%2Cstring%2Cstring%2Cstring in your config or nimble file in order to swap out the parts of the standard library to use your own SSL implementation |
13:34:13 | FromDiscord | <pmunch> Definitely not perfect, but it should at least be possible |
13:38:07 | FromDiscord | <victorNine> Thanks I'll give it a try |
13:50:42 | * | noeontheend joined #nim |
13:55:17 | * | neurocyte0132889 joined #nim |
13:55:17 | * | neurocyte0132889 quit (Changing host) |
13:55:17 | * | neurocyte0132889 joined #nim |
13:59:40 | * | noeontheend quit (Quit: noeontheend) |
14:00:13 | * | arkurious joined #nim |
14:02:39 | FromDiscord | <Cloudperry> does anyone know how to use nim.nvim with nvim-cmp? |
14:03:27 | FromDiscord | <Cloudperry> or alternatively how to make nimlsp not behave completely wrong with nvim-cmp? |
14:04:31 | FromDiscord | <Cloudperry> I have nimlsp working with nvim-cmp and nim.nvim working with asyncomplete but I don't want to use asyncomplete |
14:05:40 | FromDiscord | <Cloudperry> also nvim-cmp autocomplete pops up after every new line with nimlsp |
14:06:09 | FromDiscord | <Cloudperry> if I could get that fixed nimlsp would be just fine |
14:07:30 | FromDiscord | <Cloudperry> but I don't know how to even begin debugging that |
14:07:37 | FromDiscord | <Cloudperry> because I have 10 other language servers for nvim-cmp and they all work just fine and don't pop up autocomplete after newline |
14:08:00 | * | Colt joined #nim |
14:08:17 | FromDiscord | <Rika> dunno, i personally still use compe |
14:08:27 | FromDiscord | <Rika> i dont know how to call vimscript fns from lua |
14:08:37 | FromDiscord | <Rika> In reply to @Rika "i dont know how": you will prolly need this for cmp |
14:08:56 | FromDiscord | <Cloudperry> yeah if I wanted to use nim.nvim sure |
14:09:08 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3HHB |
14:09:21 | FromDiscord | <Rika> can prolly adapt for lua somehow but i cant help for that |
14:09:29 | FromDiscord | <Rika> In reply to @Cloudperry "or alternatively how to": wrt this whats the issue? |
14:09:55 | FromDiscord | <Rika> actually i dont know how to use nimlsp so maybe pmunch |
14:09:58 | FromDiscord | <Cloudperry> its the one with autocomplete popping up after every enter/newline |
14:10:29 | FromDiscord | <Cloudperry> so its just popping up autocomplete on empty lines constantly 😄 |
14:26:59 | * | Colt quit (Remote host closed the connection) |
14:27:32 | * | Colt joined #nim |
14:30:39 | * | Colt quit (Remote host closed the connection) |
14:31:01 | * | Colt joined #nim |
14:32:32 | * | Colt quit (Remote host closed the connection) |
14:34:12 | * | Colt joined #nim |
14:34:29 | * | Colt quit (Remote host closed the connection) |
14:34:56 | * | Colt joined #nim |
14:35:10 | * | Colt quit (Remote host closed the connection) |
14:39:40 | * | noeontheend joined #nim |
14:42:49 | * | noeontheend_ joined #nim |
15:53:45 | FromDiscord | <pmunch> I dont see how NimLSP could be doing that. LSP is a client/server architecture, so NimLSP is only answering requests sent from your client.. |
15:58:22 | FromDiscord | <Fish-Face> I expect this is an arraymancer or local issue but I'm wondering if anyone can help. Trying to install arraymancer with nimble in docker - it works on my machine but not on someone else's. The relevant bit of build log is here: https://pastebin.com/BSvmfW23 |
15:59:46 | * | PMunch joined #nim |
16:02:33 | * | noeontheend quit (Remote host closed the connection) |
16:02:33 | * | noeontheend_ quit (Remote host closed the connection) |
16:05:22 | PMunch | Don't have a lot of time today, so we'll have to solve today extra fast! Advent of Code day 11 - https://www.twitch.tv/pmunche |
16:06:39 | FromDiscord | <Fish-Face> In reply to @Fish-Face "I expect this is": never mind, a docker prune fixed it |
16:06:53 | * | jmdaemon joined #nim |
16:08:02 | * | CyberTailor left #nim (Konversation terminated!) |
16:10:47 | * | jmdaemon quit (Client Quit) |
16:11:20 | * | jmdaemon joined #nim |
16:11:31 | * | jmdaemon quit (Client Quit) |
16:30:10 | * | terminalpusher quit (Remote host closed the connection) |
16:46:15 | * | PMunch quit (Remote host closed the connection) |
17:01:26 | FromDiscord | <Cloudperry> I guess it could be because nimlsp has " " in its trigger characters |
17:02:08 | FromDiscord | <Cloudperry> In reply to @pmunch "I dont see how": I guess it could be because nimlsp has space as a trigger character |
17:02:48 | FromDiscord | <Cloudperry> but I don't know the details of trigger characters in lsp |
17:04:54 | FromDiscord | <Cloudperry> I get unwanted autocomplete popups only after typing spaces and when entering newline in indented blocks |
17:17:09 | FromDiscord | <Cloudperry> oh wow |
17:17:16 | FromDiscord | <Cloudperry> that was actually the cause |
17:17:52 | FromDiscord | <Cloudperry> just removed space from triggerCharacters and now its not popping up all the time |
17:18:54 | FromDiscord | <Cloudperry> hmm I hope this doesn't break anything |
17:19:26 | * | noeontheend joined #nim |
17:49:12 | * | noeontheend quit (Quit: noeontheend) |
17:53:43 | * | noeontheend joined #nim |
18:01:57 | * | noeontheend_ joined #nim |
18:25:21 | * | vicfred joined #nim |
18:35:46 | * | neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat) |
18:36:24 | FromDiscord | <Hamid_Bluri> Hey, I don;t understand the point of `byCopy` and `byRef` pragmas.↵↵isn't `ref object` or `object` enough ? |
18:36:36 | FromDiscord | <Hamid_Bluri> https://nim-lang.org/docs/manual.html#foreign-function-interface-bycopy-pragma |
18:38:57 | * | neurocyte0132889 joined #nim |
18:38:57 | * | neurocyte0132889 quit (Changing host) |
18:38:57 | * | neurocyte0132889 joined #nim |
18:44:13 | * | jjido joined #nim |
18:52:53 | FromDiscord | <Hamid_Bluri> In reply to @0xAb1 "Either way - thanks": https://nim-lang.org/docs/sugar.html#capture.m,varargs[typed],untyped |
18:53:10 | FromDiscord | <Hamid_Bluri> it might help you |
19:00:10 | * | vicfred quit (Quit: Leaving) |
19:04:43 | FromDiscord | <leorize> it's to control an optimization feature of nim↵(@Hamid_Bluri) |
19:05:09 | FromDiscord | <leorize> in Nim parameter passing is not as rigid as C/C++ |
19:05:51 | FromDiscord | <leorize> we define these by semantics, where C/C++ have a strict definition on how parameters are always copied |
19:06:41 | FromDiscord | <leorize> this allow us to do pass large objects via reference (read\: pointers) if it is faster that way |
19:07:02 | FromDiscord | <leorize> you can imagine, though, that it would make interop with C/C++ harder than it should be |
19:07:45 | FromDiscord | <leorize> so the `{.bycopy.}`, `{.byref.}` specifiers are there to let you force it one way or another (usually you force `{.bycopy.}` because that's how C works) |
19:38:20 | NimEventer | New thread by Jorjun_arch: Happy Christmas, see https://forum.nim-lang.org/t/8700 |
19:49:19 | * | krux02_ joined #nim |
19:53:52 | FromDiscord | <Cloudperry> ok wtf is going on with my advent of code day 5 solution 😄 |
19:54:11 | FromDiscord | <Cloudperry> it takes 1 minute 2 seconds on -d:debug or whatever the default is |
19:54:25 | FromDiscord | <Cloudperry> and 2 damn seconds on -d:release |
19:54:43 | FromDiscord | <Cloudperry> my solution is quite badly optimized I think |
19:55:04 | FromDiscord | <Cloudperry> but I have no idea how is it possible to get this big speedup with -d:release |
19:56:04 | FromDiscord | <Cloudperry> whoops |
19:56:14 | FromDiscord | <Cloudperry> just saw theres an advent of code channel too |
20:11:54 | arkanoid | that is the suggested nim way to handle classical client/server architecture with client->rpc ... slow internet ... prc->server->db and back? I need to move quite large tables between |
20:12:39 | arkanoid | I'm considering using norm for the server -> db but not yet sure, it depends on which solutions I have to move large tables |
20:28:53 | * | xet7 quit (Ping timeout: 250 seconds) |
20:41:51 | * | xet7 joined #nim |
20:43:56 | * | src quit (Quit: Leaving) |
20:44:41 | * | src joined #nim |
21:08:04 | FromDiscord | <geekrelief> Is there a way to parse a string to NimNode? If not is there an easy way to convert PNode to NimNode? |
21:18:27 | FromDiscord | <Solitude> In reply to @geekrelief "Is there a way": https://nim-lang.org/docs/macros.html#parseStmt%2Cstring |
21:18:58 | FromDiscord | <geekrelief> In reply to @Solitude "https://nim-lang.org/docs/macros.html#parseStmt%2Cs": thanks! |
21:22:33 | NimEventer | New thread by Niminem: Help with displaying only used fields in Object for JS backend, see https://forum.nim-lang.org/t/8701 |
21:46:40 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:07:50 | * | jjido joined #nim |
22:45:28 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:47:36 | FromDiscord | <el__maco> sent a code paste, see https://play.nim-lang.org/#ix=3HL4 |
22:48:12 | FromDiscord | <el__maco> I'd like to have something that can be passed to a function and initialized using a constant literal, e.g. ``foo(0xaabbcc.rgba8)`` |
22:54:30 | FromDiscord | <el__maco> I may have asked about anonymous unions before here, and I think the answer was that there are no such things in nim |
23:05:24 | * | lumo_e joined #nim |
23:05:45 | * | lumo_e quit (Client Quit) |
23:06:23 | * | jmdaemon joined #nim |
23:07:42 | FromDiscord | <el__maco> hmm `cast[rgba8](0xaabbcc)` seems to work. Its not pretty but I guess it will have to make do |
23:10:46 | * | jmdaemon quit (Client Quit) |
23:13:59 | * | jmdaemon joined #nim |
23:14:30 | FromDiscord | <Elegantbeef> https://github.com/alaviss/union @elmaco |
23:18:07 | FromDiscord | <evoalg> I'd like my proc to take an openarray (so it can accept both seq's and arrays) but I can't get it to work? : https://play.nim-lang.org/#ix=3HLg |
23:18:51 | FromDiscord | <Yardanico> you can't have openarray of openarrays afaik |
23:18:58 | FromDiscord | <evoalg> ahhh ok thanks |
23:26:31 | FromDiscord | <evoalg> I could use `auto` ... works, but might be bad programming practice |
23:27:20 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3HLl works aswell but introduces you to concepts 😛 |
23:28:08 | FromDiscord | <evoalg> oh! |
23:29:34 | FromDiscord | <Yardanico> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=3HLl works aswell but": you don't really need concepts for this though (except the low == 0) :P |
23:29:45 | FromDiscord | <Elegantbeef> Indeed |
23:30:04 | FromDiscord | <Elegantbeef> The low == 0 is pretty important for preventing issues |
23:30:25 | FromDiscord | <evoalg> `o, O` ... why is both the lower & upper "oh" used? |
23:30:56 | FromDiscord | <Yardanico> o_O |
23:31:06 | FromDiscord | <Yardanico> O_o |
23:31:10 | FromDiscord | <Elegantbeef> I'm an idiot that forgot to do `, type O` |
23:31:29 | FromDiscord | <Elegantbeef> It's the same logic so one could drop the `O` |
23:32:18 | FromDiscord | <Elegantbeef> Before you ask concepts are just check lists of what types need to fulfil to match |
23:33:03 | FromDiscord | <evoalg> thank you! |
23:41:00 | * | jmdaemon quit (Quit: WeeChat 3.3) |
23:41:23 | * | jmdaemon joined #nim |
23:42:20 | * | jmdaemon quit (Client Quit) |
23:42:38 | * | jmdaemon joined #nim |
23:44:53 | * | jmdaemon quit (Client Quit) |
23:45:21 | * | jmdaemon joined #nim |
23:47:03 | * | pch joined #nim |
23:47:54 | * | jmdaemon quit (Client Quit) |
23:48:12 | * | jmdaemon joined #nim |
23:48:51 | * | neurocyte0132889 quit (Ping timeout: 250 seconds) |
23:50:57 | * | jmdaemon quit (Client Quit) |