00:00:23 | FromDiscord | <odexine> You’d be typing nodes differently in Nim I assume |
00:00:27 | FromDiscord | <Elegantbeef> I mean I don't know the issue |
00:00:38 | * | krux02 quit (Remote host closed the connection) |
00:00:47 | FromDiscord | <my.narco> In reply to @Elegantbeef "I mean I don't": the fact that left recursion is basically impossible because each node is a different ype |
00:00:48 | FromDiscord | <my.narco> type |
00:01:00 | FromDiscord | <my.narco> and i will need to reassign a expr node to a binop node |
00:01:06 | FromDiscord | <odexine> I assume he wouldn’t know why that’s an issue as well |
00:01:29 | FromDiscord | <my.narco> In reply to @odexine "I assume he wouldn’t": well its obviously due to typing because you cant assign an already typed variable to a different type |
00:01:41 | FromDiscord | <my.narco> is there any way i can work arround this in nim? |
00:01:45 | FromDiscord | <Elegantbeef> You just use a tagged union |
00:01:52 | FromDiscord | <Elegantbeef> Or object variant in Nim's case |
00:01:57 | FromDiscord | <odexine> You wouldn’t use types in this case for here in Nim yes |
00:02:15 | FromDiscord | <my.narco> In reply to @odexine "You wouldn’t use types": what would i use? |
00:02:27 | FromDiscord | <odexine> In reply to @Elegantbeef "You just use a": What he just said lol |
00:02:34 | FromDiscord | <my.narco> oh my bad |
00:02:42 | FromDiscord | <Elegantbeef> You don't even need to use Nim here |
00:02:52 | FromDiscord | <Elegantbeef> You can just use Odin's built in union typesx |
00:02:55 | FromDiscord | <Elegantbeef> types\ |
00:03:09 | FromDiscord | <odexine> I can imagine it would need a lot of rework though |
00:03:15 | FromDiscord | <Elegantbeef> You AST in Odin should be pretty much the union of all types |
00:03:18 | FromDiscord | <Elegantbeef> Your\ |
00:03:22 | FromDiscord | <odexine> I didn’t take a peek at your code aside from the image |
00:03:50 | FromDiscord | <my.narco> im so stupid. |
00:04:20 | FromDiscord | <my.narco> i really need a rubber duck |
00:04:25 | FromDiscord | <odexine> Foresight would be a nice superpower to have |
00:04:29 | FromDiscord | <my.narco> yeah. |
00:04:31 | FromDiscord | <Elegantbeef> Eh it happens |
00:04:41 | FromDiscord | <Elegantbeef> Rewrite it in Nim though now that you're here 😛 |
00:04:48 | FromDiscord | <odexine> Lol |
00:04:57 | FromDiscord | <my.narco> ive been tempted to due to how much more mature it is |
00:05:12 | FromDiscord | <Elegantbeef> Like I said it also seems to be faster right now |
00:05:19 | FromDiscord | <Elegantbeef> Atleast in my fractal tree example |
00:05:35 | FromDiscord | <my.narco> yeah, i feel like it would be worth it, but i also wrote a vm for my language in odin, which i would need to rewrite |
00:05:38 | FromDiscord | <my.narco> cant be that hard though i guess |
00:05:54 | FromDiscord | <odexine> Well |
00:06:00 | FromDiscord | <Elegantbeef> Just change the VM to use bytecode if not and use it as a system library until your there |
00:06:02 | FromDiscord | <odexine> At least trial it |
00:06:16 | FromDiscord | <my.narco> In reply to @Elegantbeef "Just change the VM": it is infact a bytecode vm |
00:06:22 | FromDiscord | <Elegantbeef> Well they're using Odin, Nim is Odin but more friendly imo |
00:06:42 | FromDiscord | <my.narco> i would rather rewrite it sooner than later |
00:07:22 | FromDiscord | <my.narco> ill rewrite the vm in nim and see how that goes first |
00:08:37 | FromDiscord | <Elegantbeef> I was in the Odin discord when someone asked about a way to safely convert Union types to other Union types invariantly and gingerbill's response denying it kinda put a lid on any interest I had in Oddin |
00:08:39 | FromDiscord | <Elegantbeef> Odin\ |
00:08:57 | FromDiscord | <my.narco> ah i understand |
00:09:04 | FromDiscord | <my.narco> who is the owner of nim? |
00:09:19 | FromDiscord | <Elegantbeef> Such a simple and nice feature to be able to convert a `{u32, f32}` to `{f32, u32, SomeOtherType}` was denied and there is no way of doing it in the language cause it's purposely simple |
00:09:21 | FromDiscord | <Elegantbeef> Araq |
00:09:47 | FromDiscord | <Elegantbeef> I don't mind the denying in the case it can be done in user space, but it cannot be |
00:09:54 | FromDiscord | <my.narco> ah ok |
00:12:03 | FromDiscord | <Elegantbeef> Though I do think that Odin's simplicity does make it so it's tooling is better |
00:12:30 | FromDiscord | <my.narco> tbh i have never worked with nim before but i think it looks cool for what im trying to do |
00:12:55 | FromDiscord | <Elegantbeef> Well it's also a pascal inspired language indirectly, it just has more bells and whistles |
00:13:06 | FromDiscord | <Elegantbeef> So a lot of what you do in Odin(barring the union type) is just there |
00:13:25 | FromDiscord | <Elegantbeef> Leorize has a nice union library which works like Odin's union type though |
00:13:36 | FromDiscord | <Elegantbeef> https://github.com/alaviss/union |
00:13:44 | FromDiscord | <my.narco> is there a good library for parsing flags? |
00:14:01 | FromDiscord | <Elegantbeef> there is `std/parseopt` which can be used relatively easily |
00:14:07 | FromDiscord | <my.narco> ah ok |
00:14:08 | FromDiscord | <Elegantbeef> There are many non stdlib arg parsing libraries |
00:14:30 | FromDiscord | <my.narco> see with odin im not really used to using third party libs outside of "vendor" |
00:14:46 | FromDiscord | <Elegantbeef> Well Odin doesnt have a package manager so yea |
00:14:49 | FromDiscord | <my.narco> even though it limits what i can use, the bindings in there usually work very well |
00:14:52 | FromDiscord | <my.narco> In reply to @Elegantbeef "Well Odin doesnt have": what is nims? |
00:14:53 | FromDiscord | <Elegantbeef> Gingerbill is against package managers anyway |
00:15:03 | FromDiscord | <Elegantbeef> There is Nimble, it mostly works, but it has issues |
00:15:13 | FromDiscord | <Elegantbeef> Nimph also exists, as does atlas |
00:15:21 | FromDiscord | <Elegantbeef> The latter is not really a package manager but more of a workspace manager |
00:15:39 | FromDiscord | <Elegantbeef> Point is though there is a usable way of consuming other packages aside from using git submodules |
00:15:48 | FromDiscord | <my.narco> wha tis the most widely used and mature one? |
00:16:01 | FromDiscord | <Elegantbeef> Nimble is the official one |
00:16:04 | FromDiscord | <Elegantbeef> Atlas is also official tooling |
00:16:21 | FromDiscord | <Elegantbeef> It's newer and not really a package manager but can be used for reproducible build and a more stable environment |
00:16:40 | FromDiscord | <Elegantbeef> It's more like python's venv from my understanding of python |
00:16:48 | FromDiscord | <my.narco> ah ok |
00:16:59 | FromDiscord | <my.narco> ill just use nimble considering its alreayd packaged with nim from whati can see |
00:17:05 | FromDiscord | <Elegantbeef> Each project(s) can share a workspace of deps and they're tagged so it's got a lockfile fore free |
00:17:13 | FromDiscord | <Elegantbeef> Yea Nimble often is more than enough |
00:18:00 | FromDiscord | <my.narco> alright thanks for the help |
00:18:07 | FromDiscord | <Elegantbeef> As simple as adding a `requires "package >= 1.0.0"` and you're off to the races |
00:19:20 | FromDiscord | <Elegantbeef> and if you want a 1\:1 comparison↵https://play.nim-lang.org/#ix=4HHs↵https://play.nim-lang.org/#ix=4H9b |
00:20:09 | FromDiscord | <Elegantbeef> Both implement the same logic and the Nim version is twice as fast |
00:20:15 | FromDiscord | <Elegantbeef> Atleast on my machine |
00:22:52 | FromDiscord | <my.narco> wow |
00:23:00 | FromDiscord | <my.narco> i kinda realyl like now nim look |
00:23:01 | FromDiscord | <my.narco> looks |
00:46:13 | FromDiscord | <jviega> Or just refactor your grammar to be right recursive instead of left recursive |
00:46:40 | FromDiscord | <jviega> Whoops I'm late to that party. |
00:46:42 | FromDiscord | <jviega> lol |
01:14:54 | termer | NPM got packaging right |
01:15:14 | termer | Nimble feels like Go's package manager |
01:16:17 | FromDiscord | <jviega> Go's package manager on crack cocaine maybe |
01:26:27 | FromDiscord | <Elegantbeef> To be fair doing `import "giturl"` is very cracky |
01:29:43 | FromDiscord | <jviega> I'm not saying that the go package manager never hits the crack pipe! |
01:30:08 | FromDiscord | <jviega> But it's not as crack addled by any means |
01:33:06 | FromDiscord | <Elegantbeef> I mean Nimble is crack adjacent due to implementation |
01:33:12 | FromDiscord | <Elegantbeef> Go is crack usage by design |
01:36:05 | FromDiscord | <my.narco> is there any way i can use C-like enums?" |
01:38:36 | FromDiscord | <my.narco> nice one |
01:38:37 | FromDiscord | <my.narco> sent a code paste, see https://play.nim-lang.org/#ix=4HHz |
01:40:24 | FromDiscord | <my.narco> i fixed |
01:41:13 | FromDiscord | <Elegantbeef> Stop using `include` 😛 |
01:41:21 | FromDiscord | <my.narco> import is better? |
01:41:25 | FromDiscord | <Elegantbeef> Yes |
01:41:29 | FromDiscord | <Elegantbeef> Import properly uses modules |
01:41:33 | FromDiscord | <Elegantbeef> Include is like C include |
01:41:41 | FromDiscord | <Elegantbeef> Inane and in 99% of cases not whwat you want |
01:41:46 | FromDiscord | <my.narco> oh ok |
01:41:53 | FromDiscord | <my.narco> so even for my own modules i should use import" |
01:41:55 | FromDiscord | <my.narco> import? |
01:42:03 | FromDiscord | <Elegantbeef> Yes |
01:42:06 | FromDiscord | <my.narco> ok |
01:42:39 | FromDiscord | <Elegantbeef> The only times you should use `include` is when you want to seperate files but due to Nim's module and cyclical dependencies cannot do it |
01:44:05 | FromDiscord | <my.narco> thank you |
01:47:09 | FromDiscord | <jviega> Not even then |
01:48:19 | FromDiscord | <jviega> I've found the trick for that is to prototype in one file with a `{.importc.}` and then do the right thing on the actual declaration... it gives you the prototype you need w/o having to do unnatural crap |
01:49:55 | FromDiscord | <my.narco> awesome |
02:47:57 | termer | Elegantbeef, "I mean Nimble is crack adjacent due to implementation" |
02:48:03 | termer | I wish we had a quote DB here |
02:55:37 | * | blop_ joined #nim |
02:56:17 | * | blop quit (Remote host closed the connection) |
03:04:15 | FromDiscord | <Elegantbeef> They liked him for he spoke the truth |
03:35:28 | * | rockcavera quit (Remote host closed the connection) |
03:37:02 | * | xet7 quit (Remote host closed the connection) |
03:46:01 | * | blop_ quit (Remote host closed the connection) |
03:51:43 | FromDiscord | <michaelb.eth> In reply to @termer "NPM got packaging right": there's no PTSD like `node_modules` + `package-lock.json` PTSD |
03:53:29 | FromDiscord | <michaelb.eth> mainly from transitive dependency shenanigans |
03:57:39 | termer | not that bad |
04:02:37 | * | hernan quit (Remote host closed the connection) |
04:05:43 | FromDiscord | <michaelb.eth> Maybe it depends on the project, and tooling around JS dep mgmt has probably gotten better, but as recently as 2018 I worked on some Node.js projects involving several hellscapes, one of those owing directly to transitive dependency stuff biting us in the ass over and over again |
04:07:12 | FromDiscord | <michaelb.eth> `yarn` helped some, and when I spent a bit of time tinkering with `pnpm` last year that seemed pretty good but I didn't spend enough time with it to know if it's approach would have really solved our problems back then |
04:07:29 | FromDiscord | <michaelb.eth> (edit) "it's" => "pnpm's" |
04:19:11 | * | xet7 joined #nim |
04:50:14 | termer | Elegantbeef, Gitea uses a 64 char TOTP secret |
04:50:26 | termer | I'm thinking Nim OTP should have 64 as its default, not 32 |
04:51:48 | FromDiscord | <Elegantbeef> PR's welcome |
04:51:57 | termer | All right |
04:51:59 | FromDiscord | <Elegantbeef> Fuck it do 128 by default 😛 |
04:52:11 | termer | Why not |
04:52:15 | termer | memory is cheap |
04:52:29 | FromDiscord | <Elegantbeef> Hey 128 bytes is nothing! |
04:52:59 | FromDiscord | <Elegantbeef> If your in theory short lived data type kills your stack, you have bigger problems |
04:55:53 | FromDiscord | <odexine> “Let’s go overkill and do 2048” |
04:56:28 | FromDiscord | <Elegantbeef> As far as I can think the only time the secret needs to be in memory is when someone is validating or generating |
04:56:47 | FromDiscord | <Elegantbeef> So the sensible 128 bytes seems fine |
04:57:50 | FromDiscord | <Elegantbeef> Then again I'm a stupid person |
05:10:03 | termer | https://github.com/OpenSystemsLab/otp.nim/pull/8 |
05:10:54 | FromDiscord | <Elegantbeef> Lol |
05:11:07 | FromDiscord | <Elegantbeef> Cannot even just say "Some services seem to use larger than 32bytes so 128 bytes seems the most sensible" |
05:11:28 | termer | no time for that |
05:11:40 | FromDiscord | <Elegantbeef> Just throw the guy with cryptography knowledge under the bus! |
05:11:44 | FromDiscord | <Elegantbeef> with 0\ |
05:12:24 | FromDiscord | <Elegantbeef> I couldn't tell you the difference between a nonce or a dunce |
05:14:31 | NimEventer | New Nimble package! unifetch - Multi backend HTTP fetching, see https://github.com/thisago/unifetch |
05:19:04 | * | advesperacit joined #nim |
05:21:14 | FromDiscord | <odexine> In reply to @Elegantbeef "I couldn't tell you": You’re both of them :baqua: |
05:21:35 | FromDiscord | <Elegantbeef> So rude |
05:29:47 | FromDiscord | <odexine> That one way to explain nonce for cryptography though, kinda crazy, “n once” as it’s a single use number. Wonder if it’s also the origin of the term |
05:41:51 | * | azimut quit (Ping timeout: 252 seconds) |
05:57:03 | * | Lord_Nightmare quit (Ping timeout: 240 seconds) |
06:31:49 | * | junaid_ joined #nim |
06:36:20 | * | junaid_ quit (Remote host closed the connection) |
06:42:51 | * | PMunch joined #nim |
06:55:36 | * | PMunch quit (Quit: Leaving) |
06:56:57 | * | PMunch joined #nim |
07:58:29 | * | xet7 quit (Quit: Leaving) |
08:01:02 | FromDiscord | <sOkam! 🫐> @toma400 https://github.com/py2many/py2many might be helpful. it can convert to nim apparently 🤔 |
08:27:50 | FromDiscord | <Chronos [She/Her]> In reply to @heysokam "<@656540400546480128> https://github.com/py2many/py": Why would this be useful? |
08:28:51 | FromDiscord | <Chronos [She/Her]> Since it's a transpiler, isn't it just the syntax quirks? |
08:29:05 | FromDiscord | <odexine> What’s this even in reply to |
08:32:43 | FromDiscord | <toma400> In reply to @heysokam "<@656540400546480128> https://github.com/py2many/py": Oh, that's nice! Not sure where I could use it right now, but it's good to know such tool exist 🥰 |
08:32:53 | FromDiscord | <toma400> (edit) "nice!" => "nice, thank you!" |
08:41:12 | * | Lord_Nightmare joined #nim |
08:41:22 | FromDiscord | <Chronos [She/Her]> I do wonder if the Kotlin output it produces is suitable for MC modding :p |
08:42:07 | * | xet7 joined #nim |
09:07:24 | FromDiscord | <toma400> Yeah, I was wondering just as well, it'd fit for your plans of making Nim compile to JVM 😅 |
09:14:45 | FromDiscord | <Chronos [She/Her]> Not really because, Python and not Nim- |
09:14:48 | FromDiscord | <Chronos [She/Her]> But yeah |
09:54:03 | * | lumo_e joined #nim |
09:57:35 | * | lucerne quit (Ping timeout: 246 seconds) |
10:14:30 | * | lucerne joined #nim |
10:44:28 | * | krux02 joined #nim |
10:47:46 | * | lumo_e quit (Quit: Quit) |
11:56:44 | * | blop_ joined #nim |
12:30:29 | FromDiscord | <sOkam! 🫐> In reply to @odexine "What’s this even in": nothing. i knew the guy used python a lot, and i found it randomly looking for other things, so figured he (or maybe someone else) might find it useful |
12:37:26 | FromDiscord | <odexine> In reply to @heysokam "nothing. i knew the": Ah I see, I thought it was from a distant conversation as I tried scrolling up pretty far to find the related message |
12:44:50 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4HIX |
12:45:40 | FromDiscord | <graveflo> (edit) "https://play.nim-lang.org/#ix=4HIX" => "https://play.nim-lang.org/#ix=4HIY" |
12:53:47 | FromDiscord | <odexine> The parameters on HSlice do not take statics |
12:55:29 | FromDiscord | <graveflo> oh that could be it. There should be a way to unwrap the static types then no? |
12:56:27 | FromDiscord | <odexine> HSlice is not for compile time use only, if you would like anotate it as static Slice instead then use that as a CT parameter |
12:59:06 | FromDiscord | <odexine> sent a code paste, see https://paste.rs/Z75T0 |
12:59:16 | FromDiscord | <odexine> Bear with me, I am on mobile so editing code is slow |
12:59:46 | FromDiscord | <odexine> I don't know if it works, i just made guesses to how the code should look |
13:04:37 | FromDiscord | <graveflo> Thanks. Looks like that `static` was the issue but I haven't made it work the way I want it to yet. I'm going to mess with it a little |
13:05:39 | FromDiscord | <vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4HJ3 |
13:09:41 | FromDiscord | <odexine> s.len is equal to sb-s.a IIRC by the way |
13:10:38 | FromDiscord | <odexine> Would that work for a slice 5..10? The length of the array will be right but not its indices |
13:11:10 | FromDiscord | <odexine> Unless it’s not intended, then that’s fine |
13:11:14 | FromDiscord | <vindaar> I assumed the resulting slice is supposed to start at 0 |
13:12:33 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4HJ5 |
13:13:21 | FromDiscord | <graveflo> is `[]` a deref + access automatically? Thats just weird |
13:13:41 | FromDiscord | <odexine> In reply to @graveflo "alright yea that seems": It does? How do you check? That sounds strange to me |
13:13:56 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4HJ7 |
13:14:30 | FromDiscord | <graveflo> that works but changing the first parameter type to `ptr UncheckedArray[T]` doesn't work. mismatch at position 0. argument 0 type if `UncheckedArray[T]` |
13:17:37 | * | blop_ quit (Ping timeout: 252 seconds) |
13:19:35 | * | blop_ joined #nim |
13:47:04 | * | rockcavera joined #nim |
13:52:46 | FromDiscord | <Chronos [She/Her]> Hi I have a question for people- What's the best way to write a function for a synchronous socket and asynchronous socket? |
13:53:08 | FromDiscord | <Chronos [She/Her]> Not sure if it's better to do some generic nonsense or if I should write them in separate functions despite the logic being the same |
13:57:03 | FromDiscord | <jviega> Generally run things in a select() or epoll/kqueue() loop. You won't block if things are non-blocking, but you can end up with the same logic in any case with the approach |
13:58:45 | FromDiscord | <jviega> In that world, limit yourself to BUFSIZ bytes on a write any time you get a ready status on the FD for write |
13:59:02 | FromDiscord | <jviega> I think Nim does have a wrapper for epoll/kqueue somewhere |
13:59:28 | FromDiscord | <Chronos [She/Her]> I don't need to ensure it's non-blocking aha- Just want to minimise the amount of code I have to write |
14:00:20 | FromDiscord | <jviega> Well, you can still use the same code even if it's blocking. It's good for deadlock avoidance anyway |
14:00:49 | FromDiscord | <Chronos [She/Her]> :p |
14:02:43 | FromDiscord | <jviega> I've seen people, over and over again (me too I'm sure), end up w/ deadlocks where they dump something really large to stdin of a child process that blocks when they don't expect it because the child process isn't going to read more on stdin until you read something it output. |
14:03:02 | FromDiscord | <jviega> In a blocking world, the select loop w/ a bufsz limit is MORE important for that reason |
14:03:45 | FromDiscord | <jviega> Can happen over sockets just as easily |
14:03:45 | FromDiscord | <Chronos [She/Her]> I'm talking about sockets as in over the network, not stdin/stdout? Sorry, I'm confused oof |
14:04:03 | FromDiscord | <jviega> It's all the same thing basically... inter-process comms over a file descriptor |
14:04:12 | FromDiscord | <Chronos [She/Her]> Fair |
14:04:31 | * | PMunch_ joined #nim |
14:04:45 | FromDiscord | <Chronos [She/Her]> Though imo it's not my responsibility to manage any deadlocks- I use async sockets anyway but not everyone does so |
14:06:46 | FromDiscord | <jviega> async doesn't keep you out of deadlocks, but sure |
14:07:18 | FromDiscord | <vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4HJj |
14:07:37 | FromDiscord | <vindaar> (for example if you were to use `{}` it would work) |
14:07:40 | * | PMunch quit (Ping timeout: 255 seconds) |
14:08:38 | FromDiscord | <Chronos [She/Her]> In reply to @jviega "async doesn't keep you": Does it not? Oof |
14:08:44 | FromDiscord | <Chronos [She/Her]> Welp |
14:16:13 | * | PMunch_ quit (Quit: Leaving) |
14:30:48 | FromDiscord | <griffith1deadly> In reply to @chronos.vitaqua "Hi I have a": you can use multisock library, it used by anonimongo for Socket | AsyncSocket. just write code for async socket and mark it multisock pragma |
14:31:41 | FromDiscord | <griffith1deadly> https://github.com/mashingan/multisock |
14:32:33 | FromDiscord | <Chronos [She/Her]> Oh nice! Thanks griff! |
14:46:37 | FromDiscord | <my.narco> is there a proc to resize a sequence? |
14:46:44 | FromDiscord | <my.narco> like ``resize(sequence, 10)`` |
14:46:47 | FromDiscord | <my.narco> or something |
14:47:43 | FromDiscord | <stoneface86> `setLen` |
14:48:48 | FromDiscord | <my.narco> than you! |
14:49:02 | FromDiscord | <stoneface86> np |
14:54:15 | FromDiscord | <graveflo> In reply to @vindaar "you're right. It seems": Why would `[]` be confusing? It's an array |
14:57:35 | FromDiscord | <graveflo> To be clear I don't understand how defrencing an `uncheckedArray` makes any sense in the first place. `ptr uncheckedArray` is it's natural form I believe. |
15:03:01 | FromDiscord | <vindaar> "confusing" may be too strong a word. But if I only see the access in a random piece of code I would probably conclude you're working on a `seq` and not a raw pointer. Hence I'd prefer to have a clearer distinction (or better yet wrap that pointer up in something; depends on what you're actually doing) |
15:03:10 | FromDiscord | <vindaar> just about expectations etc |
15:06:17 | FromDiscord | <graveflo> ok thats makes more sense. I do think that `[]` should not be a seq specific thing, but adding some clarity to code with `uncheckedArray`s makes sense. I guess that's why `system.nim` doesnt define anything too fancy for them |
15:24:34 | FromDiscord | <my.narco> sent a code paste, see https://play.nim-lang.org/#ix=4HJG |
15:28:39 | FromDiscord | <odexine> if all the functions are of the same signature, eys |
15:28:42 | FromDiscord | <odexine> (edit) "eys" => "yhes" |
15:28:42 | FromDiscord | <odexine> (edit) "yhes" => "yes" |
15:28:44 | FromDiscord | <odexine> i can type |
15:32:28 | FromDiscord | <alohaer> Is there a concept of "types" of functions? So that they have the same signature but are different types? |
15:34:03 | FromDiscord | <odexine> yes, there's a common "hidden parameter", let's say, for functions called the calling convention |
15:34:26 | FromDiscord | <odexine> functions declared on the top level are of "nimcall", and anonymous functions that are assigned to variables are of "closure" |
15:35:17 | FromDiscord | <odexine> In reply to @odexine "yes, there's a common": a parameter commonly missed by most Nim beginners and intermediates |
15:40:19 | FromDiscord | <odexine> this "parameter" is set via pragma, forogt to say |
15:40:59 | FromDiscord | <odexine> so something like `proc name(...): ... {.nimcall.} =` or `{.closure.}` will change it ~~i forgot if that's correct syntax~~ |
15:41:59 | FromDiscord | <alohaer> I meant generally in programming. So that you could do `const arithmetic_operators: seq[ArthmeticOpType] = [ add, sub, mul]` but you couldn't stick a `<` funciton in there, even though it could be `(int, int) -> int` |
15:42:51 | FromDiscord | <odexine> well, in that case if you want to do that i'd say to not use an int for denoting "lt, eq, gt" |
15:43:17 | FromDiscord | <odexine> in which case use an enum |
15:47:54 | FromDiscord | <my.narco> what is the problem here? https://media.discordapp.net/attachments/371759389889003532/1157342998191952003/image.png?ex=65184329&is=6516f1a9&hm=ae8a4ba324c76c08da5bf224b28954d74003bc623fa7cdc292e421b5bb08dd9b& |
15:48:15 | FromDiscord | <my.narco> sent a code paste, see https://play.nim-lang.org/#ix=4HJS |
15:49:09 | FromDiscord | <nervecenter> Just a note, it's probably better to use `when debugging:` so your debug messages only appear in debug builds |
15:49:20 | FromDiscord | <nervecenter> unless that's not your intent |
15:49:31 | FromDiscord | <odexine> In reply to @my.narco "what is the problem": can you show the code without the popup? |
15:49:38 | FromDiscord | <odexine> unless theres nothing relevant there |
15:49:46 | FromDiscord | <odexine> hard to say though |
15:50:04 | FromDiscord | <odexine> ah |
15:50:36 | FromDiscord | <odexine> yeah no show the code under the popup |
15:51:24 | FromDiscord | <my.narco> In reply to @nervecenter "Just a note, it's": thats not my intenet |
15:51:52 | FromDiscord | <my.narco> In reply to @odexine "can you show the": its not really relevent, i provided the declaration of ``f`` which is behind the popus |
15:51:53 | FromDiscord | <my.narco> popup |
15:52:10 | FromDiscord | <my.narco> sent a code paste, see https://play.nim-lang.org/#ix=4HJU |
15:53:22 | FromDiscord | <odexine> its probably erroring out inside that const |
15:53:32 | FromDiscord | <odexine> what's the contents of that @[] |
15:53:54 | FromDiscord | <my.narco> nothing |
15:53:55 | FromDiscord | <my.narco> yet |
15:54:22 | FromDiscord | <odexine> oh i thought you omitted it |
15:54:35 | FromDiscord | <my.narco> no nothing is there yet |
15:55:05 | FromDiscord | <my.narco> sent a code paste, see https://paste.rs/PAyxU |
15:55:05 | FromDiscord | <my.narco> but it throws the same error |
15:55:24 | FromDiscord | <odexine> i have no idea, i'm sorry |
15:55:29 | FromDiscord | <my.narco> sent a code paste, see https://play.nim-lang.org/#ix=4HJX |
15:55:41 | FromDiscord | <odexine> ah |
15:55:48 | * | ntat joined #nim |
15:55:50 | FromDiscord | <taperfade> i wish i was as smar as yall |
15:55:59 | FromDiscord | <odexine> fuck |
15:56:01 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#ix=4HJY |
15:56:11 | FromDiscord | <odexine> it's prolly erroring out because it is an empty seq |
15:56:12 | FromDiscord | <odexine> lol |
15:58:00 | FromDiscord | <my.narco> sent a code paste, see https://play.nim-lang.org/#ix=4HJZ |
15:58:04 | FromDiscord | <my.narco> why is it expecting a proc as an argument |
15:58:16 | FromDiscord | <my.narco> am i doing something wrong? |
16:00:09 | FromDiscord | <odexine> honestly i'm just as confused now |
16:00:37 | FromDiscord | <my.narco> 😭 |
16:00:53 | FromDiscord | <odexine> i also have to go to sleep |
16:00:56 | FromDiscord | <odexine> sorry x2 |
16:02:07 | FromDiscord | <vindaar> this compiles just fine https://play.nim-lang.org/#ix=4HK3 so it must be related to what `NoliPU` and `NoliError` actualy are |
16:02:11 | FromDiscord | <vindaar> (edit) "actualy" => "actually" |
16:05:04 | * | Onionhammer quit (Read error: Connection reset by peer) |
16:05:18 | * | Onionhammer joined #nim |
16:06:45 | FromDiscord | <Chronos [She/Her]> Anyone know if chronos (the async library) has an alternative to asyncnet? |
16:07:59 | FromDiscord | <taperfade> what are u guys working on |
16:08:16 | FromDiscord | <taperfade> i had nothing to work on and forgor almost all of what i learned |
16:08:27 | FromDiscord | <taperfade> sob |
16:08:48 | FromDiscord | <my.narco> sent a code paste, see https://play.nim-lang.org/#ix=4HK6 |
16:10:02 | FromDiscord | <my.narco> @vindaar |
16:10:19 | FromDiscord | <taperfade> what does enum do |
16:10:32 | FromDiscord | <vindaar> Can you post a full snippet that doesn't compile? I don't have much time right now, then I take a look when I can |
16:12:51 | FromDiscord | <my.narco> In reply to @vindaar "Can you post a": i cant figure out how to get it to fail on playground for somereason |
16:13:59 | FromDiscord | <my.narco> i got it to compile |
16:14:04 | FromDiscord | <my.narco> multiple definitions |
16:14:05 | FromDiscord | <my.narco> fuck |
16:14:06 | FromDiscord | <my.narco> my bad |
16:17:56 | FromDiscord | <sOkam! 🫐> In reply to @chronos.vitaqua "Anyone know if chronos": with that name, you should already know everything about it! :kappa: |
16:21:34 | FromDiscord | <taperfade> _ _ |
16:30:40 | * | hernan joined #nim |
16:47:24 | FromDiscord | <my.narco> sent a code paste, see https://play.nim-lang.org/#ix=4HKd |
16:53:34 | FromDiscord | <Chronos [She/Her]> In reply to @heysokam "with that name, you": I do not, unfortunately :p |
16:53:54 | FromDiscord | <.aingel.> Is there an mitems iterator equivalent in python? |
16:54:06 | FromDiscord | <.aingel.> Just wondering if that's sort of a nim unique feature, it seems really cool |
16:59:50 | FromDiscord | <Chronos [She/Her]> Objwcts in lists are mutable by default in Python, iirc |
17:01:20 | FromDiscord | <Chronos [She/Her]> Yeah they are |
17:01:22 | FromDiscord | <Chronos [She/Her]> @.aingel. |
17:08:34 | FromDiscord | <my.narco> In reply to @my.narco "is there a cleaner": _ _ |
17:14:31 | * | FlyingSquirrelAr joined #nim |
17:15:03 | FromDiscord | <.aingel.> In reply to @chronos.vitaqua "<@1152336447467163790>": Oh interesting, thanks |
17:15:19 | FromDiscord | <.aingel.> In reply to @chronos.vitaqua "Objwcts in lists are": I mean in for loops though |
17:15:48 | FlyingSquirrelAr | Read about Edna Skilton date raping Richard Simmons! Exerpt: As the game progressed, Edna couldn't help but notice Richard's perfectly toned physique and his Simmonin buns that looked like they were sculpted by the gods themselves. She found herself getting *** and bothered, and her Canadian beaver started to drip profusely as if it were being teased with melted poutine curds filling it until its |
17:15:54 | FlyingSquirrelAr | clitoral tongue tingled with ecstasy. https://pastes.io/3zb8ipyqbv |
17:16:02 | * | FlyingSquirrelAr quit (K-Lined) |
17:16:21 | FromDiscord | <.aingel.> I don't think it works for modifying in a loop |
17:28:38 | FromDiscord | <_gumbercules> In reply to @FlyingSquirrelAr "Read about Edna Skilton": the fuck? |
17:28:44 | FromDiscord | <_gumbercules> @technorazor ^ |
17:28:48 | FromDiscord | <_gumbercules> damnit |
17:28:52 | FromDiscord | <_gumbercules> <@&371760044473319454> |
17:28:58 | FromDiscord | <_gumbercules> @technorazor my bad |
17:30:00 | FromDiscord | <Phil> There we go |
17:31:29 | * | azimut joined #nim |
17:31:46 | FromDiscord | <technorazor> dwai lol |
17:52:31 | FromDiscord | <Chronos [She/Her]> In reply to @.aingel. "I mean in for": It does |
17:52:41 | FromDiscord | <Chronos [She/Her]> If you iterate through a list via a loop and modify the item given |
17:53:38 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4HKm |
18:04:23 | Amun-Ra | do you see klines on discord? |
18:04:38 | Amun-Ra | I mean do the bot forward the info |
18:14:56 | FromDiscord | <my.narco> is this not how to use bitwise operators? https://media.discordapp.net/attachments/371759389889003532/1157380002191528007/image.png?ex=6518659f&is=6517141f&hm=8131612f7c1bc41f4d983b1083727f288a9a993efc0b19f33b10ca96dc620bcf& |
18:15:46 | FromDiscord | <dissolved.girl> Is that comic sans? |
18:16:14 | FromDiscord | <my.narco> In reply to @dissolved.girl "Is that comic sans?": comic mono |
18:16:24 | FromDiscord | <dissolved.girl> Thanks, I hate it |
18:16:39 | FromDiscord | <voidwalker> yeah, unserious funny code |
18:18:03 | FromDiscord | <Langosta> I think its cool |
18:18:06 | FromDiscord | <my.narco> In reply to @my.narco "is this not how": anyways is this not how its used? |
18:18:08 | FromDiscord | <Langosta> just hard to read for me |
18:18:27 | FromDiscord | <Langosta> Are you asking about the error, or are you asking about its usage |
18:18:33 | FromDiscord | <my.narco> both |
18:18:38 | FromDiscord | <my.narco> i swear im using it correctly |
18:19:10 | FromDiscord | <Yardanico> In reply to @my.narco "is this not how": no, that's not how you use them |
18:19:18 | FromDiscord | <Yardanico> you said yourself - "operator", but you're calling it like a function |
18:19:30 | FromDiscord | <Yardanico> `r1 and r2` would be valid syntax |
18:19:45 | FromDiscord | <my.narco> oh |
18:19:53 | FromDiscord | <my.narco> im so retarded sorry 😭 |
18:19:56 | FromDiscord | <my.narco> so tired |
18:19:59 | FromDiscord | <Yardanico> or you can use https://nim-lang.org/docs/bitops.html#bitand.m%2CT%2CT%2Cvarargs%5BT%5D, but there's no reason here really |
18:20:14 | FromDiscord | <dissolved.girl> You could probably implement a proc \`and\` that does that, though |
18:20:18 | Amun-Ra | my.narco: either 1 and 2 or `and`(1, 2) |
18:20:26 | FromDiscord | <my.narco> i figured it out |
18:20:28 | FromDiscord | <my.narco> thanks |
18:20:58 | Amun-Ra | the latter is pretty unorthodox |
18:21:31 | Amun-Ra | there's another way: 1.`and` 2 |
18:21:41 | Amun-Ra | or 1.`and`(2) |
18:22:02 | FromDiscord | <Langosta> In reply to @my.narco "im so retarded sorry": Youre trying to learn. Learning isnt retarded, You’re good. |
18:22:50 | FromDiscord | <my.narco> yeah your right |
18:34:05 | * | rockcavera quit (Remote host closed the connection) |
18:36:27 | FromDiscord | <Phil> In reply to @my.narco "im so retarded sorry": This is the struggle in programming, it's always the dumb mistakes that get you even 5 years later when you've acquired what reasonably could be declared as a pretty decent chunk of experience |
18:37:19 | FromDiscord | <Chronos [She/Her]> Not sure how multisock is supposed to work- If I provide it a sync socket, will it just, work? |
18:37:22 | FromDiscord | <Phil> Prime example:↵Me today, I forgot that there's actually also the need to think about what a UI would need to look like in a chat between 2 users when one of them deleted their account.↵Overall pretty obvious usecase in our org, completely flubbed on remembering it. |
18:37:35 | FromDiscord | <Phil> I see socket talk that isn't websocket, I bail |
18:39:05 | FromDiscord | <Phil> Question to the folks here about documentation |
18:39:17 | FromDiscord | <Phil> More in your role as readers of docs rather than writers of docs |
18:41:16 | FromDiscord | <Phil> sent a long message, see http://ix.io/4HKz |
18:48:03 | * | rockcavera joined #nim |
18:48:44 | FromDiscord | <toma400> Tbh Owlkettle docs are pretty great, so I think it's enough, but additional info is always a plus. Main reason is that names pretty clear and whenever there's some field with ambiguity, there's at least short description making this more precise. |
18:59:02 | FromDiscord | <Phil> The main reason I'm asking is that I'm pretty decent at pointing out and vocalizing all the nuances and things to keep in mind when looking at a widget.↵I'm not particularly great at trimming that to only the information "interesting" to the user |
19:01:24 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4HKF |
19:05:02 | FromDiscord | <Phil> I swear at this point I might be interested in taking a class about writing documentation more effectively because I keep finding myself in positions where I have to write them all over the place |
19:14:51 | FromDiscord | <Chronos [She/Her]> I'm trying to import a module relative to my other module but the compiler doesn't seem to like it? |
19:16:15 | FromDiscord | <Phil> Examples or it didn't happen 😛 |
19:17:25 | * | Mister_Magister quit (Ping timeout: 255 seconds) |
19:18:11 | FromDiscord | <Chronos [She/Her]> It was a mistake on my part :p |
19:27:14 | * | ntat quit (Quit: leaving) |
19:39:36 | * | alphacentauri quit (Quit: WeeChat 4.0.5) |
19:41:18 | * | alphacentauri joined #nim |
19:44:50 | FromDiscord | <.aingel.> Is there a way to suppress Declared But Not Used warnings from nimlsp? |
19:44:54 | FromDiscord | <.aingel.> @pmunch |
19:54:18 | FromDiscord | <my.narco> what did i do https://media.discordapp.net/attachments/371759389889003532/1157405007457554473/image.png?ex=65187ce9&is=65172b69&hm=b4478692350af50703c7bbc1c5a08463d57cad20d4f6cd7616b159bddb718a13& |
19:59:56 | FromDiscord | <nasuray> In reply to @.aingel. "Is there a way": You can suppress the hint either in the file itself with `{.hint[XDeclaredButNotUsed]:off.}` or from a `nim.cfg`/`config.nims` for the project |
20:05:58 | FromDiscord | <demotomohiro> In reply to @my.narco "what did i do": You probably need to read generated C code to check type of T2_ and check_error_() is same.↵And also check your Nim code correctly imports C types and functions. |
20:06:49 | FromDiscord | <my.narco> In reply to @demotomohiro "You probably need to": i import NO ctypes or functions |
20:07:41 | FromDiscord | <my.narco> sent a code paste, see https://play.nim-lang.org/#ix=4HL7 |
20:08:35 | FromDiscord | <my.narco> sent a code paste, see https://play.nim-lang.org/#ix=4HL8 |
20:09:00 | FromDiscord | <my.narco> well |
20:09:02 | FromDiscord | <my.narco> i fixed my problem |
20:09:04 | FromDiscord | <demotomohiro> Why do you need to add nimcall calling convension to each proc?↵Are they declared inside other proc? |
20:09:20 | FromDiscord | <my.narco> In reply to @demotomohiro "Why do you need": because i am using a seq to store them, and call them |
20:09:51 | FromDiscord | <my.narco> sent a code paste, see https://play.nim-lang.org/#ix=4HL9 |
20:09:58 | * | alphacentauri quit (Read error: Connection reset by peer) |
20:10:03 | FromDiscord | <demotomohiro> In reply to @my.narco "i import NO ctypes": Are you sure all module you imports not use any C lib? |
20:10:05 | * | alphacen1 joined #nim |
20:10:44 | FromDiscord | <my.narco> In reply to @demotomohiro "Are you sure all": yeah, i fixed my problem, |
20:10:58 | FromDiscord | <my.narco> fixed it |
20:11:02 | FromDiscord | <my.narco> sent a code paste, see https://play.nim-lang.org/#ix=4HLa |
20:11:07 | FromDiscord | <my.narco> i removed the ``var NoliError`` |
20:11:18 | FromDiscord | <my.narco> and replaced it with just ``NoliError`` |
20:12:08 | FromDiscord | <demotomohiro> I usually get compile error from backend compiler when I import C things incorrectly or Nim compiler bug. |
20:12:28 | FromDiscord | <my.narco> it was a compiler bug not giving me usefull error messages |
20:12:30 | FromDiscord | <my.narco> i fixed it tho8ugh |
20:28:39 | FromDiscord | <bostonboston> Anyone know of libraries for talking to MSSQL dbs |
20:40:06 | FromDiscord | <my.narco> is anyone able to walk me through how to compile for linux from a windows host? |
20:41:28 | FromDiscord | <griffith1deadly> wsl |
20:42:33 | FromDiscord | <my.narco> alright |
20:48:01 | * | Mister_Magister joined #nim |
20:48:07 | FromDiscord | <Elegantbeef> Alternatively you could use zigcc |
20:54:32 | FromDiscord | <my.narco> is there a way i could add tasks to my nimble file? |
20:54:47 | FromDiscord | <my.narco> sent a code paste, see https://play.nim-lang.org/#ix=4HLv |
21:02:05 | FromDiscord | <raynei486> yeah you can define tasks |
21:02:06 | FromDiscord | <.aingel.> Oh cool @nasuray is there a way to do this system wide though? |
21:02:17 | FromDiscord | <raynei486> https://nim-lang.org/docs/nimscript.html#task.t%2Cuntyped%2Cstring%2Cuntyped |
21:02:23 | FromDiscord | <my.narco> oh ok thanks |
21:04:17 | FromDiscord | <nasuray> In reply to @.aingel. "Oh cool <@372579559645773828> is": Absolutely! See [here](https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files) for more info about nim config files |
21:04:46 | FromDiscord | <.aingel.> Thanks! |
21:07:40 | FromDiscord | <.aingel.> hmm @nasuray so I added `{.hint[XDeclaredButNotUsed]:off.}` in my config.nims which I believe is global cause that's where I've added global nimble tasks but I still get those lsp warnings |
21:10:03 | FromDiscord | <.aingel.> I've installed nim via choosenim |
21:10:11 | FromDiscord | <.aingel.> Do you know where the config file would be then? |
21:11:34 | FromDiscord | <nasuray> That's disabling it within that file you can set flags with switch the compiler flag has a different syntax. To add a compiler flag in nim script you can use switch |
21:11:58 | FromDiscord | <.aingel.> Okay i found it |
21:12:12 | FromDiscord | <nasuray> (edit) removed "you can set flags with switch" |
21:12:17 | FromDiscord | <.aingel.> It was `~/.choosenim/toolchains/nim-2.0.0/config/` |
21:12:31 | FromDiscord | <.aingel.> I added it to `configs.nims` and it works now! |
21:16:50 | FromDiscord | <nasuray> In reply to @.aingel. "It was `~/.choosenim/toolchains/nim-2.0.0/config/`": Usually you would edit your personal config not the compilers. So `~/.config/nim/config.nims` |
21:16:59 | FromDiscord | <bostonboston> Do converters not do their implicit thing inside of `[]`s |
21:17:09 | FromDiscord | <bostonboston> (edit) "`[]`s" => "`[]`'s" |
21:23:11 | * | advesperacit quit () |
21:32:33 | NimEventer | New thread by RedDevil: ZIP32, see https://forum.nim-lang.org/t/10521 |
21:37:26 | FromDiscord | <.aingel.> In reply to @nasuray "Usually you would edit": When I edited that, the lsp didn't pick it up |
21:39:14 | FromDiscord | <sOkam! 🫐> In reply to @my.narco "is anyone able to": zigcc |
21:39:16 | FromDiscord | <.aingel.> Ooh wiat |
21:39:35 | FromDiscord | <.aingel.> (edit) "Ooh wiat" => "Oh wait, the lsp isn't picking it up regardless.." |
21:39:42 | FromDiscord | <sOkam! 🫐> (edit) "In reply to @my.narco "is anyone able to": zigcc ... " added "https://github.com/enthus1ast/zigcc" |
21:45:30 | FromDiscord | <my.narco> In reply to @heysokam "zigcc https://github.com/enthus1ast/zigcc": i got wsl to work :D |
21:53:58 | * | krux02 quit (Remote host closed the connection) |
22:08:43 | FromDiscord | <Elegantbeef> They should do implicit conversions everywhere if there is no ambiguous overload↵(@bostonboston) |
22:16:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4HLQ |
22:19:10 | FromDiscord | <nasuray> In reply to @.aingel. "When I edited that,": the syntax for inclusion in a `config.nims` is `switch("hint","[XDeclaredButNotUsed]:off")` |
22:40:50 | FromDiscord | <.aingel.> In reply to @nasuray "the syntax for inclusion": Ahh |
22:41:47 | FromDiscord | <.aingel.> In reply to @nasuray "the syntax for inclusion": Works, thanks!! |
23:24:05 | * | Mister_Magister quit (Ping timeout: 240 seconds) |
23:32:11 | NimEventer | New thread by daylinmorgan: Nimble badge (shields.io) with latest version tag , see https://forum.nim-lang.org/t/10522 |
23:54:20 | FromDiscord | <ravinder387> sent a code paste, see https://play.nim-lang.org/#ix=4HMh |
23:54:40 | FromDiscord | <ravinder387> sent a code paste, see https://play.nim-lang.org/#ix=4HMi |
23:54:58 | FromDiscord | <ravinder387> nim c hello.nim -- gives me error |
23:55:10 | FromDiscord | <ravinder387> how to use .nims file |