| 00:11:59 | FromDiscord | <litlighilit> however python's slice doesn't contains `contains` method either↵(<@709044657232936960_mid-kid=5b=49=52=43=5d>) |
| 00:13:00 | FromDiscord | <litlighilit> however python's slice doesn't own↵contains method either |
| 00:13:08 | FromDiscord | <litlighilit> however python's slice doesn't owncontains method either |
| 00:13:26 | FromDiscord | <litlighilit> however python's slice doesn't own `contains` method either |
| 00:20:36 | FromDiscord | <litlighilit> however python's slice doesn't own `contains` method either,↵but range does.in case you want see it in nim, here is how i implemented\: [https://docs.nimpylib.org/pylib/builtins/pyrange.html#contains%2CPyRange%5BT%5D%2CT](https://docs.nimpylib.org/pylib/builtins/pyrange.html#contains%252CPyRange%255BT%255D%252CT)↵(click `Source` link to for details) |
| 00:21:26 | FromDiscord | <litlighilit> however python's slice doesn't own `contains` method either,↵but range does.in case you want see it in nim, here is how i implemented\: [NimPyLib docs of PyRange.contains](https://docs.nimpylib.org/pylib/builtins/pyrange.html#contains%2CPyRange%5BT%5D%2CT)↵(click `Source` link to for details) |
| 00:22:25 | FromDiscord | <litlighilit> but range does.in case you want see it in nim, here is how i implemented\: [NimPyLib docs of PyRange.contains](https://docs.nimpylib.org/pylib/builtins/pyrange.html#contains%2CPyRange%5BT%5D%2CT)↵(click `Source` link to for details) |
| 00:23:00 | FromDiscord | <litlighilit> but range does.in case you want see it in Nim, here is how it can be implemented in Nim\: [NimPyLib docs of PyRange.contains](https://docs.nimpylib.org/pylib/builtins/pyrange.html#contains%2CPyRange%5BT%5D%2CT)↵(click `Source` link to for details) |
| 00:27:23 | * | ehmry quit (Ping timeout: 260 seconds) |
| 00:28:57 | FromDiscord | <litlighilit> You can see that python is the one special.Almost all other languages result in the same for int division just like nim (e.g. C, Java, Lisp)↵(@nocturn9x) |
| 00:29:59 | FromDiscord | <janakali> In reply to @nocturn9x "any idea why `-18": in Nim `mod` is a remainder, you need `euclMod` from `std/math` for modulo |
| 00:36:08 | FromDiscord | <litlighilit> you can overload your own `//` for integer, as in Nim operator definition is non-invasive, like Rust, like [NimPyLib's definition of `//`](https://docs.nimpylib.org/pylib/ops.html#%2F%2F%2CA%2CB) |
| 00:38:35 | * | beholders_eye quit (Ping timeout: 240 seconds) |
| 00:38:55 | FromDiscord | <systemblue_2010> sent a code paste, see https://play.nim-lang.org/#pasty=vPUOIsZf |
| 00:39:07 | FromDiscord | <systemblue_2010> (edit) "https://play.nim-lang.org/#pasty=GCSeRddO" => "https://play.nim-lang.org/#pasty=VZILVffR" |
| 00:39:20 | FromDiscord | <systemblue_2010> (edit) "https://play.nim-lang.org/#pasty=rTCcQnWP" => "https://play.nim-lang.org/#pasty=reqKlISJ" |
| 00:41:41 | FromDiscord | <litlighilit> (however it's Nim's `floorMod` instead of `euclMod` that is equivalent to python's `%`)↵(@janakali) |
| 00:41:48 | FromDiscord | <litlighilit> how can seq be nil?↵(@systemblue_2010) |
| 00:41:52 | FromDiscord | <litlighilit> seq can never be nil, so such notation is meaningless thus invalid |
| 00:41:58 | FromDiscord | <systemblue_2010> wt? |
| 00:42:01 | FromDiscord | <systemblue_2010> really? |
| 00:42:04 | FromDiscord | <systemblue_2010> seq can't be nil? |
| 00:42:22 | FromDiscord | <litlighilit> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1445575686713774111): (however it's Nim's `floorMod` rather than `euclMod` that is equivalent to python's `%`) |
| 00:42:38 | FromDiscord | <systemblue_2010> sent a code paste, see https://play.nim-lang.org/#pasty=XmCwOKKW |
| 00:42:41 | FromDiscord | <litlighilit> seq may be empty, but never nil |
| 00:42:46 | FromDiscord | <systemblue_2010> if you do this you will get error |
| 00:43:35 | FromDiscord | <litlighilit> shouldn't it?↵(@systemblue_2010) |
| 00:43:46 | FromDiscord | <litlighilit> just like any other langs except for js |
| 00:43:57 | FromDiscord | <Buckwheat> yeah, that sounds like correct behaviour |
| 00:50:19 | FromDiscord | <systemblue_2010> In reply to @litlighilit "Nim has both borrow": does Nim have borrow checker?↵really? |
| 00:51:12 | FromDiscord | <litlighilit> https://nim-lang.org/docs/destructors.html#lent-type |
| 00:52:16 | FromDiscord | <systemblue_2010> hey lent is not borrow checker |
| 00:52:31 | FromDiscord | <systemblue_2010> it's just immutable reference |
| 00:52:33 | FromDiscord | <Buckwheat> that was not what lit was trying to imply |
| 00:52:53 | FromDiscord | <Buckwheat> there is an experimental feature for the Nim compile iirc that includes a borrow checker |
| 00:52:59 | FromDiscord | <Buckwheat> keyword, experimental |
| 00:53:02 | FromDiscord | <systemblue_2010> and even i can't use lent in proc↵only can use in template or func |
| 00:53:20 | FromDiscord | <litlighilit> there're owned[T] type. |
| 00:53:26 | FromDiscord | <litlighilit> and there're owned[T] type. |
| 00:53:44 | FromDiscord | <systemblue_2010> owned[T] and sink[T] move ownership to function↵it's similar with Rust's but |
| 00:53:49 | FromDiscord | <systemblue_2010> it's not borrow |
| 00:54:12 | FromDiscord | <systemblue_2010> borrow means, if function ends, ownership must be returned |
| 00:54:29 | FromDiscord | <systemblue_2010> but owned[T] does not return it ↵it just move it |
| 00:54:39 | FromDiscord | <systemblue_2010> so I think Nim need borrow[T] |
| 00:55:36 | FromDiscord | <systemblue_2010> most times, borrow checker is for concurrency programming and parallel work |
| 00:55:43 | FromDiscord | <systemblue_2010> memory safety is not main |
| 00:55:44 | FromDiscord | <Buckwheat> from what it looks like, it's not meant to be used as a parameter, it's meant to be a return type |
| 00:55:44 | FromDiscord | <Buckwheat> though please correct me if I'm wrong |
| 00:55:45 | FromDiscord | <litlighilit> and also\: sink |
| 00:55:46 | FromDiscord | <litlighilit> nope, it can be said a type of borrow check↵(@systemblue_2010) |
| 00:55:47 | FromDiscord | <litlighilit> see also\: sink |
| 00:55:47 | FromDiscord | <litlighilit> see also\: `sink` |
| 00:55:47 | FromDiscord | <Buckwheat> yeah, looking at that now |
| 00:55:47 | FromDiscord | <Buckwheat> you should probably read that doc lit sent (like I am) before saying so |
| 00:56:37 | FromDiscord | <Buckwheat> ah yeah, this definitely makes sense, I might have to play with this. thanks lit. |
| 00:56:40 | FromDiscord | <systemblue_2010> what is sent? |
| 00:57:16 | FromDiscord | <litlighilit> sent a code paste, see https://play.nim-lang.org/#pasty=hAJkGmIL |
| 00:57:31 | FromDiscord | <litlighilit> sent a code paste, see https://play.nim-lang.org/#pasty=sgcXPzct |
| 00:59:12 | FromDiscord | <litlighilit> lol but whoever uses rust just cannot get rid of borrow check even if not parallel↵(@systemblue_2010) |
| 00:59:42 | FromDiscord | <janakali> sent a code paste, see https://play.nim-lang.org/#pasty=CoBmATJf |
| 01:02:40 | FromDiscord | <litlighilit> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1445579232469057628): see also\: [`sink`](https://nim-lang.org/docs/destructors.html#sink-parameters) |
| 01:15:05 | FromDiscord | <litlighilit> nim has its own methods for race condition (note rust's borrow check itself only enforces there're no race condition)for example, one can\:↵● use pragma\: noSideEffect, guard, locks to make sure compiler check for you\: https://nim-lang.org/docs/manual.html#guards-and-locks↵● Or uses message ([Channel](https://nim-lang.org/docs/system.html#Channel))\: https://nim-lang.org/docs/system.html#example↵(@systemblue_2010) |
| 01:17:01 | FromDiscord | <Buckwheat> don't think I need to say this but as well... don't only trust the compiler, writing reasonable code also helps not have any of these issues |
| 01:17:04 | FromDiscord | <Buckwheat> compilers can only do so much |
| 01:17:39 | FromDiscord | <Buckwheat> help your compiler help you, maybe is the words I ought to use here? |
| 01:18:10 | FromDiscord | <systemblue_2010> but there's no temporary mutable reference that can be returned after function ended |
| 01:19:08 | FromDiscord | <litlighilit> lol but i'm the one who cannot bother writting rust |
| 01:19:27 | FromDiscord | <Buckwheat> me neither... the language is a type soup that gives me C++ war flashbacks |
| 01:19:51 | FromDiscord | <litlighilit> var↵(@systemblue_2010) |
| 01:19:57 | FromDiscord | <systemblue_2010> Vec<T> is similar with owned or sink↵&Vec<T> is similar with lent↵but there's no &mut Vec<T> |
| 01:20:07 | FromDiscord | <systemblue_2010> In reply to @litlighilit "var (<@1436476641726435469>)": var is not safe.. |
| 01:20:08 | FromDiscord | <Buckwheat> lit just said var |
| 01:20:31 | FromDiscord | <litlighilit> sure↵(@systemblue_2010) |
| 01:20:31 | FromDiscord | <Buckwheat> nothing is safe if you write it to be unsafe... |
| 01:20:46 | FromDiscord | <litlighilit> but iirc nim checks safety somehow |
| 01:20:56 | * | rockcavera quit (Ping timeout: 240 seconds) |
| 01:21:05 | FromDiscord | <Buckwheat> probably a compile time flag |
| 01:21:08 | FromDiscord | <Buckwheat> I'd imagine |
| 01:21:32 | FromDiscord | <Buckwheat> idk I just use the GC personally, I don't try to act smarter than the compiler, it knows better than I do |
| 01:21:32 | FromDiscord | <litlighilit> https://nim-lang.org/docs/manual.html#procedures-var-return-type |
| 01:22:03 | FromDiscord | <litlighilit> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1445585291992629260): var return type |
| 01:22:36 | FromDiscord | <litlighilit> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1445585714912952443): https://nim-lang.org/docs/manual.html#procedures-var-return-type says↵> It is a static error if the implicitly introduced pointer could be used to access a location beyond its lifetime\: |
| 01:24:54 | FromDiscord | <litlighilit> oh here you just mean var param↵(@systemblue_2010) |
| 01:26:57 | FromDiscord | <litlighilit> for this nim has [var param](https://nim-lang.org/docs/manual.html#procedures-var-parameters),↵which does nothing with `var is not safe`↵(@systemblue_2010) |
| 01:28:18 | FromDiscord | <litlighilit> btw nim has `out`, too |
| 01:28:28 | FromDiscord | <systemblue_2010> but var is not safe in concurrency and parallel |
| 01:28:43 | FromDiscord | <Buckwheat> yeah I think that'd be similar? I understand that as being like passing a variable reference in C |
| 01:29:49 | FromDiscord | <litlighilit> er, so just no one shall use C# or python-FT(free-threaded) or C++↵(@systemblue_2010) |
| 01:29:57 | FromDiscord | <Buckwheat> or nearly every other language |
| 01:30:14 | FromDiscord | <Buckwheat> Go does similar things in Goroutines, and concurrency is a big part of Go |
| 01:30:28 | FromDiscord | <litlighilit> nim has other models for this, mentioned above↵(@systemblue_2010) |
| 01:30:39 | FromDiscord | <Buckwheat> again, like I said before... these things are unsafe if you write them to be unsafe |
| 01:30:57 | FromDiscord | <Buckwheat> help the compiler help you |
| 01:32:34 | FromDiscord | <litlighilit> and you need only to bother considering these iff you're writting the parallel part |
| 01:34:39 | FromDiscord | <litlighilit> most code is still single-threaded, at least for me |
| 01:35:05 | FromDiscord | <Buckwheat> I definitely do some multi-thread stuff, but I also make sure to use semaphores and mutexes and all that fun stuff |
| 01:35:38 | FromDiscord | <Buckwheat> but I mainly do that in Go where it's heavily baked into the language |
| 01:35:55 | FromDiscord | <systemblue_2010> for multi thread it's good to use spawn/channel and let |
| 01:36:21 | FromDiscord | <Buckwheat> I think you're mostly thinking of this in the context of Pure FP, am I right? |
| 01:36:25 | FromDiscord | <systemblue_2010> I think nim need to add more systems about parallel and concurrent |
| 01:36:29 | FromDiscord | <systemblue_2010> (edit) "concurrent" => "concurrency" |
| 01:36:40 | FromDiscord | <Buckwheat> the worry around var is very much signaling a Pure FP mindset |
| 01:37:25 | FromDiscord | <systemblue_2010> nono I don't like pure FP |
| 01:37:39 | FromDiscord | <litlighilit> for example?↵(@systemblue_2010) |
| 01:38:02 | FromDiscord | <systemblue_2010> I'm saying this because sometime, i need reference type or mutable type in parallel system |
| 01:38:05 | FromDiscord | <Buckwheat> mutability is one of the primary foundations of Pure FP and Pure FP is the most concerned about mutation more than any paradigm from how I learned about FP |
| 01:39:14 | FromDiscord | <litlighilit> just use explicit notation mentioned above↵(@systemblue_2010) |
| 01:39:15 | FromDiscord | <systemblue_2010> In reply to @litlighilit "for example? (<@1436476641726435469>)": borrow[T], system like goroutine and coroutine |
| 01:39:35 | FromDiscord | <Buckwheat> I'm gonna go with lit here, explicit notation |
| 01:39:44 | FromDiscord | <Buckwheat> unless you want to somehow implement something similar to Go's channels |
| 01:40:24 | FromDiscord | <systemblue_2010> In reply to @Buckwheat "mutability is one of": I heard pure FP programming language does not have mutable variables |
| 01:40:45 | FromDiscord | <Buckwheat> correct, because that's considered a side effect, and that's why it sounds like you're thinking in Pure FP to me↵(@systemblue_2010) |
| 01:41:09 | FromDiscord | <Buckwheat> and since you're making the Rust comparisons, that makes sense because that's also how Rust behaves, is in this Pure FP type manner |
| 01:41:55 | FromDiscord | <systemblue_2010> Rust has mutable variable is int? |
| 01:41:58 | FromDiscord | <Buckwheat> problem is, you're trying to apply that logic to a language that's not Pure FP, so... to get similar behaviours, gonna have to find workarounds or build your own solutions |
| 01:42:00 | FromDiscord | <systemblue_2010> (edit) "int?" => "it?" |
| 01:42:16 | FromDiscord | <Buckwheat> only with a certain keyword, beyond that it acts more in an FP sense↵(@systemblue_2010) |
| 01:42:37 | FromDiscord | <Buckwheat> I've written enough Haskell to feel the similarities between the 2 |
| 01:43:03 | FromDiscord | <Buckwheat> but anyways... that's neither here nor there. I think lit has the best solution to your issue and if that's good enough well... tough luck |
| 01:43:31 | FromDiscord | <Buckwheat> but anyways... that's neither here nor there. I think lit has the best solution to your issue and if that's not good enough well... tough luck |
| 03:52:20 | * | SchweinDeBurg quit (Quit: WeeChat 4.8.0-dev) |
| 03:52:52 | * | SchweinDeBurg joined #nim |
| 04:24:59 | * | zero`__ joined #nim |
| 04:24:59 | * | zero`_ quit (Read error: Connection reset by peer) |
| 04:36:16 | * | zero` joined #nim |
| 04:37:19 | * | zero`__ quit (Read error: Connection reset by peer) |
| 04:37:36 | * | zero`_ joined #nim |
| 04:40:31 | * | zero` quit (Ping timeout: 240 seconds) |
| 05:45:03 | * | zero`_ quit (Read error: Connection reset by peer) |
| 06:05:12 | * | zero` joined #nim |
| 06:29:31 | FromDiscord | <nnsee> In reply to @systemblue_2010 "but var is not": neither is `&mut Vec<T>` in rust though |
| 06:29:45 | FromDiscord | <nnsee> which is why it's usually wrapped in a mutex or other sort of lock |
| 06:29:58 | FromDiscord | <nnsee> which is what you would also do in nim |
| 06:42:27 | FromDiscord | <nnsee> and if you want to be explicit that your data needs to be locked, you can wrap it in a struct to indicate it in the procedure signature, something like https://play.nim-lang.org/#pasty=NZLExWfd |
| 06:44:46 | FromDiscord | <nnsee> (or just a Lock in the signature) |
| 11:45:21 | * | beholders_eye joined #nim |
| 12:16:32 | FromDiscord | <devilcrow9857> sent a code paste, see https://play.nim-lang.org/#pasty=lNhTFgMj |
| 12:18:21 | FromDiscord | <nasuray> Can you share the exact command and error message? And if you have any project config files (config.nims/nim.cfg) |
| 12:19:48 | FromDiscord | <devilcrow9857> sent a code paste, see https://play.nim-lang.org/#pasty=kKZGQkLS |
| 12:25:35 | * | beholders_eye quit (Ping timeout: 240 seconds) |
| 12:29:16 | FromDiscord | <punch5799> is there a way to get wrap around behavior on a type? For instance if I have a type defined as a range[0..512] is there a way to perform arithmetic on it such that it just wraps around rather than going out of bounds? |
| 12:36:22 | FromDiscord | <nnsee> sent a code paste, see https://play.nim-lang.org/#pasty=iIToLITw |
| 12:36:29 | FromDiscord | <lainlaylie> you only require websock as a dependency, which doesnt require json_rpc, so it's fair enough that nim can't find it? |
| 12:37:02 | FromDiscord | <devilcrow9857> right, well, in this case i swapped over to json_rpc to see if maybe that would work |
| 12:37:15 | FromDiscord | <nnsee> what was the original error, then? |
| 12:37:21 | FromDiscord | <devilcrow9857> the same, just with websocket |
| 12:37:30 | FromDiscord | <nnsee> can you paste the actual error? |
| 12:37:30 | FromDiscord | <lainlaylie> show nimble file, main file, and error |
| 12:40:09 | FromDiscord | <devilcrow9857> sent a code paste, see https://play.nim-lang.org/#pasty=dMWgWpjL |
| 12:44:25 | FromDiscord | <nnsee> sent a code paste, see https://play.nim-lang.org/#pasty=dynfbNCi |
| 12:44:42 | FromDiscord | <nnsee> to be clear, you should be importing json_rpc/rpcserver, not just json_rpc |
| 12:44:48 | FromDiscord | <nnsee> does the example not compile for you?↵https://github.com/status-im/nim-json-rpc?tab=readme-ov-file#example |
| 12:46:00 | FromDiscord | <devilcrow9857> It does not |
| 12:46:14 | FromDiscord | <devilcrow9857> `Error: cannot open file: json_rpc/rpcserver` |
| 12:47:25 | FromDiscord | <nnsee> that's pretty odd, can you clear the nimble cache dir (`.nimble/pkg`) and redownload the package list using `nimble refresh` and try again? seems to be working fine over here |
| 12:47:46 | FromDiscord | <lainlaylie> before we do that.. are you compiling the example via nimble or using nim directly? |
| 12:47:53 | FromDiscord | <devilcrow9857> nimble |
| 12:47:59 | FromDiscord | <devilcrow9857> `nimble build` |
| 12:48:07 | FromDiscord | <lainlaylie> and youve declared json_rpc as a dependency? |
| 12:48:09 | FromDiscord | <lainlaylie> it works for me |
| 12:48:10 | FromDiscord | <janakali> @devilcrow9857 is there a `nimble.paths` in your project directory? |
| 12:48:22 | FromDiscord | <devilcrow9857> Yes |
| 12:48:35 | FromDiscord | <lainlaylie> nimble setup |
| 12:48:45 | FromDiscord | <janakali> @devilcrow9857 do `nimble setup` and try again |
| 12:49:07 | FromDiscord | <devilcrow9857> still errors the same |
| 12:50:26 | FromDiscord | <nnsee> In reply to @janakali "<@835704949609332746> is there a": wait but why |
| 12:50:38 | FromDiscord | <lainlaylie> i think the vscode extension runs nimble setup automatically |
| 12:50:42 | FromDiscord | <nnsee> oh |
| 12:51:09 | FromDiscord | <lainlaylie> which would be fine if other nimble commands would keep nimble.paths up to date as well.. |
| 12:51:58 | FromDiscord | <devilcrow9857> idk why it would, but lemme reboot pc to see if that fixes it for some reason |
| 12:52:10 | FromDiscord | <lainlaylie> i doubt itll fix it |
| 12:52:28 | FromDiscord | <lainlaylie> you need to debug where nim is getting its --path arguments and why they are wrong |
| 12:53:48 | FromDiscord | <nasuray> In reply to @lainlaylie "i think the vscode": Eww what |
| 12:54:22 | FromDiscord | <lainlaylie> i think the idea is so that nimlangserver/nimsuggest is able to pick up nimble deps without you having to manually run nimble setup beforehand |
| 12:54:36 | FromDiscord | <nasuray> Please post the full output of nimble build --debug |
| 12:54:44 | FromDiscord | <lainlaylie> but it has the side effect that if you change your dependencies without rerunning nimble setup, your --path will be unexpectedly wrong |
| 12:56:03 | FromDiscord | <lainlaylie> but since `nimble build` supplies each --path directly to the nim command, doesnt that override any outdated `nimble.paths`? |
| 12:58:05 | FromDiscord | <devilcrow9857> In reply to @nasuray "Please post the full": https://media.discordapp.net/attachments/371759389889003532/1445761003454201990/message.txt?ex=6931855c&is=693033dc&hm=9b302a135e4a73b567c3fc3feff7fdc3c3a7788f06da6027b45a3a1c6a8e4c1f& |
| 12:58:58 | FromDiscord | <lainlaylie> jsonrpc is missing from the --path |
| 12:59:04 | FromDiscord | <lainlaylie> (edit) "jsonrpc" => "json_rpc" |
| 13:00:09 | FromDiscord | <lainlaylie> it just looks like you havent `requires "json_rpc"`'d |
| 13:00:15 | FromDiscord | <devilcrow9857> but i have |
| 13:00:24 | FromDiscord | <devilcrow9857> https://media.discordapp.net/attachments/371759389889003532/1445761588173733918/image.png?ex=693185e7&is=69303467&hm=734d19b979c3d542ee33fa86ababf7db4da736aaaf2bf55bb97dcc62f11ae520& |
| 13:00:43 | FromDiscord | <lainlaylie> are you running `nimble build` from the same folder as that .nimble file? |
| 13:00:48 | FromDiscord | <devilcrow9857> Yes |
| 13:04:17 | FromDiscord | <devilcrow9857> okaayy↵i don't know exactly what happened here↵↵but i just created a new folder, and setup everything from the start, albeit the exact same, and now it can import it? |
| 13:17:58 | FromDiscord | <lainlaylie> would be nice to get to the bottom of what caused it though |
| 13:18:40 | FromDiscord | <lainlaylie> nimble build should generate the correct --path arguments regardless of any nimble.paths, so it's strange that it doesn't do so even though json_rpc is in your nimble file |
| 13:19:07 | FromDiscord | <nnsee> fwiw, i just did `nimble setup` in my test setup and it still worked fine |
| 13:19:17 | FromDiscord | <nnsee> so it's not like `nimble setup` is generating the wrong paths file |
| 13:19:18 | FromDiscord | <nnsee> hopefully |
| 13:19:33 | FromDiscord | <lainlaylie> it shouldnt be, and even if it did it shouldnt affect `nimble build` |
| 13:22:54 | FromDiscord | <devilcrow9857> i have no clue |
| 13:31:41 | FromDiscord | <janakali> sent a long message, see https://pasty.ee/BDipCncp |
| 13:31:42 | FromDiscord | <janakali> and `nimble.paths` is empty |
| 13:32:11 | FromDiscord | <nnsee> you don't `import json_rpc`, you `import json_rpc/rpcserver` |
| 13:32:14 | FromDiscord | <nnsee> i did say this above |
| 13:32:44 | FromDiscord | <nnsee> i did all of the steps you listed but the correct import and all of my builds worked and nimble.paths was not empty |
| 13:34:45 | FromDiscord | <lainlaylie> sent a long message, see https://pasty.ee/GFCAeVNm |
| 13:36:13 | FromDiscord | <lainlaylie> msgpack4nim is nimrpc's sole dependency, so somewhere there must be a nimble file with `requires "nimrpc"` that nimble is for some reason using instead of the one with `requires "json_rpc"` |
| 14:05:34 | * | hygo quit (Ping timeout: 244 seconds) |
| 14:06:35 | * | hygo joined #nim |
| 15:04:45 | * | amadaluzia joined #nim |
| 15:21:17 | * | beholders_eye joined #nim |
| 15:46:04 | FromDiscord | <litlighilit> overload `+-/` for this type↵(@punch5799) |
| 15:47:40 | FromDiscord | <litlighilit> if for typical int types like \`int8\`, \`int32\`,↵there're \`+%\`, \`\%\`, etc. already defined in system |
| 15:47:52 | FromDiscord | <litlighilit> If for typical int types like \`int8\`, \`int32\`,↵there're \`+%\`, \`\%\`, etc. already defined in system |
| 15:48:13 | FromDiscord | <litlighilit> If for typical int types like `int8`, `int32`,↵there're `+%`, `%`, etc. already defined in system |
| 15:48:23 | FromDiscord | <litlighilit> If for typical int types like `int8`, `int32`,↵there're `+%`, `%`, etc. already defined in system |
| 16:06:16 | * | cornfeedhobo quit (Quit: Goodbye) |
| 16:21:25 | * | cornfeedhobo joined #nim |
| 16:52:53 | * | lumidify quit (Quit: leaving) |
| 16:54:15 | * | lumidify joined #nim |
| 17:20:33 | * | xet7 joined #nim |
| 18:15:34 | FromDiscord | <_.ralf> sent a code paste, see https://play.nim-lang.org/#pasty=HJuXWYtx |
| 18:16:19 | FromDiscord | <_.ralf> (edit) "https://play.nim-lang.org/#pasty=uXHByTAL" => "https://play.nim-lang.org/#pasty=RIHaOvTK" |
| 18:33:19 | FromDiscord | <lainlaylie> did you try doing as the error message suggests |
| 18:42:56 | FromDiscord | <nasuray> > Error: unhandled exception: SSL support is not available. Cannot connect over SSL. Compile with -d:ssl to enable. [HttpRequestError] |
| 19:00:45 | FromDiscord | <lainlaylie> would be funny if someone here tried to debug it by running the program |
| 19:08:15 | FromDiscord | <_.ralf> In reply to @lainlaylie "would be funny if": yea... well i testedt it it runned but wasnt sending anything |
| 19:08:28 | FromDiscord | <_.ralf> but i guess someone deleted the webhook xD |
| 19:39:06 | FromDiscord | <fridge777> hi, any way to hoist procedures in nim? i was surprised that i had to declare it above the code i used it in |
| 19:48:49 | FromDiscord | <Robyn [She/Her]> In reply to @fridge777 "hi, any way to": there is forward declarations, but ideally write your code in a way that avoids them |
| 19:49:33 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=tWnrrUXA |
| 19:49:50 | FromDiscord | <Robyn [She/Her]> you write the signature above the usage site, and then the implementation somewhere below |
| 19:49:52 | FromDiscord | <fridge777> oh like headers... |
| 19:50:03 | FromDiscord | <Robyn [She/Her]> Keep in mind it has to match exactly at all times o7 |
| 19:50:04 | FromDiscord | <fridge777> thank you, whats the reasoning for not hoisting? |
| 19:50:30 | FromDiscord | <Robyn [She/Her]> In reply to @fridge777 "thank you, whats the": For me it's just preference, it feels unhygienic when you do it often |
| 19:52:10 | FromDiscord | <fridge777> alright. well maybe it will make me clutter my code less lol |
| 19:52:50 | FromDiscord | <fridge777> for small script files i always tend to put the main stuff at the top and then all the functions below so i immediately tripped over this |
| 20:17:32 | * | joast quit (Quit: Leaving.) |
| 21:05:43 | * | beholders_eye quit (Ping timeout: 244 seconds) |
| 21:19:01 | * | xet7 quit (Remote host closed the connection) |
| 21:19:56 | FromDiscord | <Elegantbeef> Would require a second pass to reorganize code, but really why are you writing code that's hard to read 😄 |
| 21:19:56 | FromDiscord | <Elegantbeef> @fridge777 Nim is a single pass compiler |
| 21:19:56 | FromDiscord | <Buckwheat> I'll second that |
| 21:20:02 | FromDiscord | <Buckwheat> gotta make your code maintainable and that means making it readable |
| 21:21:49 | FromDiscord | <fridge777> i dont think it makes it hard to read but fair enough |
| 21:22:19 | FromDiscord | <Elegantbeef> Well top to bottom is nice cause you see what's available as you scroll instead of requiring tooling, but it's subjective of course |
| 21:22:20 | FromDiscord | <Buckwheat> it's a lot of unnecessary writing you'd need to do in my opinion |
| 21:22:36 | FromDiscord | <Buckwheat> subjective but it's also the most reasonable stance |
| 21:23:15 | FromDiscord | <Buckwheat> personally I organize in alphabetical order with a `main` function that I use as an entry point that I then call in a `when isMainModule:` statement |
| 21:23:28 | FromDiscord | <fridge777> personally i dont read code top to bottom \:P |
| 21:23:33 | FromDiscord | <Elegantbeef> Alphabetical order is silly |
| 21:23:44 | FromDiscord | <Elegantbeef> Code should be written as it's needed and life is swell |
| 21:24:07 | FromDiscord | <Buckwheat> what if I need it alphabetical order otherwise I get annoyed trying to read it? |
| 21:24:11 | FromDiscord | <Buckwheat> ;D |
| 21:24:11 | FromDiscord | <fridge777> really, having to write code in 2 dimensions is a limitation, code is more like a graph anyway |
| 21:24:28 | FromDiscord | <Buckwheat> if I know the first letter of the function, I know "ah it's probably near this part of the source file" |
| 21:24:41 | FromDiscord | <Elegantbeef> It might be graph shaped, but it's lexical and as such it fits better to match what I'm used to reading |
| 21:25:52 | FromDiscord | <Elegantbeef> Code can be many things but as is its written word, and written word where I'm from is top to bottom! |
| 21:26:18 | FromDiscord | <Elegantbeef> I hate trying to contribute to a project and having to jump around a file to understand what the fuck is going on |
| 21:26:23 | FromDiscord | <Buckwheat> yeah me too |
| 21:26:47 | FromDiscord | <Buckwheat> I always decide on a convention first before I ever write code whenever I work with others |
| 21:26:54 | FromDiscord | <Elegantbeef> It's one of the big benefits to C to me |
| 21:26:55 | FromDiscord | <Buckwheat> I have very hardcore and strict limitations for myself |
| 21:26:59 | FromDiscord | <fridge777> that speaks more to bad overall structure than order of functions imo |
| 21:27:13 | FromDiscord | <Buckwheat> right??? I really like the way C can be written |
| 21:27:17 | FromDiscord | <fridge777> i dont read every single helper function, i start at the start and branch out from there |
| 21:27:43 | FromDiscord | <Buckwheat> are you also one of those types that separates not only the brace from the function but also the return type to make it easier to `grep`??? |
| 21:27:59 | FromDiscord | <fridge777> who greps code? |
| 21:28:05 | FromDiscord | <Elegantbeef> I like to read what a module or file has available and where, it's easier to map a file when you can scroll down and just read it normally |
| 21:28:05 | FromDiscord | <Buckwheat> me |
| 21:28:11 | FromDiscord | <fridge777> just use a good editor |
| 21:28:21 | FromDiscord | <Elegantbeef> @Buckwheat I don't often write C |
| 21:28:26 | FromDiscord | <fridge777> i just ctrl click the function and jump to definition |
| 21:28:38 | FromDiscord | <Buckwheat> I use the best in the game (Emacs)↵(@fridge777) |
| 21:28:40 | FromDiscord | <Buckwheat> and even then |
| 21:28:45 | FromDiscord | <Buckwheat> I'm very comfy in a terminal |
| 21:29:26 | FromDiscord | <Buckwheat> if I'm running it from a terminal (which I am), and the error or compiler tells me the problem, cool, I can `grep` and get the line |
| 21:30:01 | FromDiscord | <threefour> In reply to @fridge777 "who greps code?": I project search via ripgrep frequently |
| 21:30:20 | FromDiscord | <Buckwheat> I forgot about ripgrep eheh |
| 21:30:24 | FromDiscord | <Buckwheat> it's a fantastic tool |
| 21:30:35 | FromDiscord | <Elegantbeef> Tools are for nerds! |
| 21:30:38 | FromDiscord | <fridge777> i guess we just work on different stuff. some languages might not have proper static code analysis |
| 21:31:00 | FromDiscord | <Elegantbeef> I mean I only work in compiled static languages |
| 21:31:13 | FromDiscord | <Buckwheat> yeah I predominantly use compiled things myself |
| 21:31:18 | FromDiscord | <Elegantbeef> It doesn't change my view, things should be declared before use and it makes it easier to on board yourself into understanding code |
| 21:31:27 | FromDiscord | <Buckwheat> yeah, I would agree with that |
| 21:31:36 | FromDiscord | <Elegantbeef> Tooling is great and all, but I want to map code out |
| 21:31:48 | FromDiscord | <threefour> I use both the LSP functionality for jumping around as well as ripgrep. Good for different situations. |
| 21:32:09 | FromDiscord | <fridge777> whats a situation where you would grep over the other thing? |
| 21:32:10 | FromDiscord | <Buckwheat> let me guess, you have Emacs plugins for all that? ;D↵(@threefour) |
| 21:32:12 | * | rockcavera joined #nim |
| 21:32:53 | FromDiscord | <threefour> Eglot which us built in, and projectile which uses ripgrep. |
| 21:32:59 | FromDiscord | <threefour> (edit) "us" => "is" |
| 21:33:06 | FromDiscord | <Buckwheat> right, I'm using eglot for LSP too |
| 21:33:29 | FromDiscord | <Buckwheat> the situation is if you're someone who's faster with a keyboard than with a mouse↵(@fridge777) |
| 21:33:58 | FromDiscord | <fridge777> well, theres still hotkeys for symbol search |
| 21:34:13 | FromDiscord | <Buckwheat> also depends on your editor |
| 21:34:25 | FromDiscord | <Buckwheat> if you're using something like VS Code/VSCodium (ew), then that's probably the route you want |
| 21:34:26 | FromDiscord | <fridge777> if emacs doesnt have that how can it be the best in the game |
| 21:34:31 | FromDiscord | <fridge777> 😌 |
| 21:34:45 | FromDiscord | <Buckwheat> cause it's the most moddable editor, and if you really want that? |
| 21:34:50 | FromDiscord | <Buckwheat> make your own dotfile for it ;D |
| 21:35:17 | FromDiscord | <fridge777> i want sensible defaults |
| 21:35:24 | FromDiscord | <threefour> In reply to @fridge777 "if emacs doesnt have": My mouse never touches Emacs |
| 21:35:31 | FromDiscord | <Buckwheat> yeah same |
| 21:35:34 | FromDiscord | <Buckwheat> all keystrokes for me |
| 21:36:19 | FromDiscord | <Buckwheat> I already use a tiling WM that emphasizes keyboard usage, so I'm already pretty quick with that kinda thing in Emacs |
| 21:36:48 | FromDiscord | <saint._._.> In reply to @fridge777 "if emacs doesnt have": nvim |
| 21:37:14 | FromDiscord | <Buckwheat> Neovim is not mouse-heavy either though |
| 21:37:22 | FromDiscord | <threefour> I wish there was a good keyboard-only solution for the browser. The extensions like Vimium feel hacky, and Nyxt just isn't caught up. It needs to be able to run Dark Reader and uBlock Origin if I'm gonna use it. |
| 21:37:47 | FromDiscord | <fridge777> i didnt mean to start an editor holy war, my bad |
| 21:37:58 | FromDiscord | <saint._._.> emacs used to be better than vim even though i never used emacs and only used vim but nvim has overtaken emacs with the rapid rate of plugin dev etc imo |
| 21:38:20 | FromDiscord | <Buckwheat> mostly because the Emacs nerds like me are happy to implement their own solutions↵(@saint._._.) |
| 21:38:21 | FromDiscord | <threefour> This probably belongs in offtopic |
| 21:38:25 | FromDiscord | <Buckwheat> true |
| 21:38:30 | FromDiscord | <Buckwheat> to offtopic we gooooo |
| 21:38:38 | FromDiscord | <saint._._.> In reply to @threefour "I wish there was": vimium is decent but i don’t really navigate all that much with it. Mouse is just better for web for the most part |
| 21:40:29 | FromDiscord | <threefour> Unfortunately yeah mouse seems unavoidable |
| 21:40:30 | * | FromDiscord quit (Remote host closed the connection) |
| 21:40:43 | * | FromDiscord joined #nim |
| 21:41:04 | FromDiscord | <fridge777> nim question interjection: can a proc have a mutable integer argument |
| 21:41:14 | FromDiscord | <fridge777> or should i shadow it |
| 21:41:20 | FromDiscord | <Elegantbeef> `i: var int` |
| 21:41:33 | FromDiscord | <Buckwheat> I was about to say I think passing the param as var |
| 21:41:34 | FromDiscord | <Elegantbeef> Unless you mean locally mutable then you shadow it |
| 21:41:40 | FromDiscord | <fridge777> when i pass 2 it says expression '2' is immutable, not 'var' |
| 21:41:56 | FromDiscord | <fridge777> with the var int syntax |
| 21:42:00 | FromDiscord | <Elegantbeef> Right you mean locally mutable |
| 21:42:03 | FromDiscord | <Elegantbeef> Then you shadow it |
| 21:42:11 | FromDiscord | <fridge777> okay thank you |
| 21:42:19 | FromDiscord | <Elegantbeef> Technically you can cheat and use `sink int` but that's for ownership and is silly here |
| 21:42:58 | * | joast joined #nim |
| 21:43:09 | FromDiscord | <fridge777> ownership huh? cant wait to dive a bit deeper nim seems very cool so far |
| 21:43:27 | FromDiscord | <fridge777> i was annoyed with the lambda syntax but importing sugar fixed it for me |
| 21:43:37 | FromDiscord | <fridge777> very nifty |
| 21:47:32 | FromDiscord | <fridge777> if anyone did day 3 of aoc in nim id love to see it |
| 21:47:43 | FromDiscord | <fridge777> i just finished but theres probably more idiomatic ways or whatever |
| 21:53:20 | * | beholders_eye joined #nim |
| 22:39:03 | FromDiscord | <anuke> If my aim is to write integers and bytes to a memory buffer, is StringStream from the stdlib the best tool for the job? I vaguely remember hearing about performance issues related to that type, but I don't know if it's relevant these days |
| 22:39:19 | FromDiscord | <anuke> (I am not serializing anything) |
| 22:40:35 | FromDiscord | <ieltan> for loop |
| 22:47:57 | FromDiscord | <Elegantbeef> Stringstream should suffice, but you also can just copymem |
| 22:52:49 | FromDiscord | <anuke> Writing my own memory buffer with copyMem and capacity checks would just be reinventing the wheel, no? |
| 22:55:39 | FromDiscord | <Elegantbeef> `seq[byte]` and copymem is simpler than string stream and would remove some of the performance issues |
| 22:59:20 | FromDiscord | <anuke> I suppose my question is, are these performance issues bad enough for me to write my own implementation, and are there really no other libraries for this? status/faststreams doesn't compile on 2.x |
| 23:02:57 | FromDiscord | <punch5799> good rule of thumb is don't worry about the performance until you need to |
| 23:03:06 | FromDiscord | <punch5799> if you need the speed, then roll your own |
| 23:06:00 | FromDiscord | <punch5799> Question: Does anyone know if nim supports modular types like Ada? I'm doing this day 1 challenge late for aoc, and while I can do my own wrap around logic, this is a perfect instance for defining a modular type, but I'm having a hard time finding anything related to it. I tried using a ranged type with unsigned ints, but it looks like it still performs bounds checks. Any ideas? |
| 23:25:39 | * | beholders_eye quit (Quit: WeeChat 4.7.2) |
| 23:28:43 | * | beholders_eye joined #nim |
| 23:42:49 | FromDiscord | <fridge777> you should be able to turn overflow checks off with compiler options at least |