00:04:00 | * | jmdaemon joined #nim |
00:05:37 | NimEventer | New thread by Womble: Flutter and Nim, see https://forum.nim-lang.org/t/8865 |
00:14:18 | nrds | <gurul/freenode99> <rasengan> Consequences are real. Treat things you care about with respect. Appreciate it. Help it. Cultivate it. And don't try to destroy it - because if you wish for its destruction, you're going to get it. |
00:14:22 | nrds | <gurul/freenode99> <rasengan> Classic Freenode had a special part in my heart and everyone else's. It's the saddest and hardest thing I've done, in a long time - but I |
00:14:25 | nrds | <gurul/freenode99> <rasengan> am giving the directive to shut it down. |
00:14:27 | nrds | <gurul/freenode99> <rasengan> Goodbye freenode classic. |
00:14:30 | nrds | <gurul/freenode99> <rasengan> This is your queue to go to libera and oftc if you dont like waht we're doing. |
00:14:33 | nrds | <gurul/freenode99> <rasengan> Do it. If you don't like what we're doing - go do it better. |
00:14:35 | nrds | <gurul/freenode99> <rasengan> They need help. |
00:33:02 | rockcavera | Elegantbeef, mkDir it's nimscript |
00:34:08 | FromDiscord | <Elegantbeef> Guess there is no wrapping for the interpreter for `mkDir` |
00:34:08 | FromDiscord | <Elegantbeef> Or `createDir` |
00:35:43 | * | noeontheend joined #nim |
00:36:42 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
00:38:00 | * | jmdaemon joined #nim |
01:01:37 | * | noeontheend quit (Ping timeout: 240 seconds) |
01:16:21 | * | noeontheend joined #nim |
01:16:24 | * | vicfred quit (Quit: Leaving) |
01:22:41 | FromDiscord | <Ayy Lmao> How do you get a function to be called when a ref is destroyed? `=destroy` seems to only be for objects. |
01:26:25 | * | jmdaemon quit (Ping timeout: 256 seconds) |
01:31:37 | * | noeontheend quit (Ping timeout: 240 seconds) |
01:33:32 | * | audiophile_ joined #nim |
01:36:57 | * | jmdaemon joined #nim |
01:37:01 | FromDiscord | <geekrelief> In reply to @ajusa "yup, I *think* genit": @Phil genit will almost do what you want, but there's an issue with how types are ↵ transformed. |
01:39:46 | FromDiscord | <geekrelief> In reply to @Ayy Lmao "How do you get": try this? https://discord.com/channels/371759389889003530/371759389889003532/937079923691122749 |
01:43:46 | FromDiscord | <Ayy Lmao> In reply to @geekrelief "try this? https://discord.com/channels/371759389889": Cool, thanks! |
01:50:36 | FromDiscord | <ajusa> In reply to @geekrelief "<@!394315290592411648> genit will almost": cool, thanks for clarifying. Is there any reason genit is devel only? can it be made to work on 1.6, or is that buggy? |
01:51:14 | FromDiscord | <geekrelief> In reply to @ajusa "cool, thanks for clarifying.": genit probably works on 1.6. I'm just working off devel, so when I created the nimble package I didn't bother changing it. 🙂 |
01:52:21 | FromDiscord | <geekrelief> You can try it with 1.6, and I'll change the requirement if it works. |
01:52:40 | FromDiscord | <geekrelief> I'm working on Phil's test case with iterating on types. |
01:54:07 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3OA9 |
01:54:30 | FromDiscord | <geekrelief> (edit) "https://play.nim-lang.org/#ix=3OA9" => "https://play.nim-lang.org/#ix=3OAa" |
01:55:03 | FromDiscord | <geekrelief> I have two issues to fix before that works. |
02:13:02 | * | TakinOver joined #nim |
02:16:21 | * | krux02 quit (Remote host closed the connection) |
02:16:37 | FromDiscord | <ajusa> In reply to @geekrelief "You can try it": I can confirm that the tests work on 1.6.2! |
02:18:01 | FromDiscord | <geekrelief> cool thx! Next time I push I'll have it updated. |
02:30:55 | * | jmdaemon quit (Ping timeout: 256 seconds) |
02:48:18 | * | arkurious quit (Quit: Leaving) |
02:56:14 | * | Gustavo6046 quit (Quit: Leaving) |
03:02:50 | FromDiscord | <creikey> what's the difference between a tuple and an object? |
03:03:48 | FromDiscord | <creikey> it seems like objects are only needed for inheritane |
03:03:51 | FromDiscord | <creikey> (edit) "inheritane" => "inheritance" |
03:04:59 | FromDiscord | <Rika> tuples dont have access control for fields |
03:05:13 | FromDiscord | <Rika> not sure about this but afaik they also dont have case fields |
03:05:15 | FromDiscord | <creikey> In reply to @Rika "tuples dont have access": so on a tuple type will expose all its fields? |
03:05:18 | FromDiscord | <Rika> yes |
03:05:21 | FromDiscord | <creikey> interesting |
03:05:26 | FromDiscord | <Rika> and you cannot do anything about it |
03:05:27 | FromDiscord | <Rika> also |
03:05:37 | FromDiscord | <Rika> if the tuple definitions of two types are the same |
03:05:42 | FromDiscord | <Rika> they are treated as not distinct |
03:05:43 | FromDiscord | <Rika> afaik |
03:05:54 | FromDiscord | <Rika> and distinct tuples afaik dont work well |
03:06:05 | FromDiscord | <creikey> sent a code paste, see https://play.nim-lang.org/#ix=3OAp |
03:06:10 | FromDiscord | <creikey> how can you get something of MyObject and interact with it if the type ins't exposed |
03:06:13 | FromDiscord | <creikey> (edit) "ins't" => "isn't" |
03:06:21 | FromDiscord | <Rika> exported proc returning |
03:06:26 | FromDiscord | <Rika> exported global |
03:06:31 | FromDiscord | <creikey> makes sense makes sense |
03:06:33 | FromDiscord | <creikey> you just can't make new of it |
03:06:41 | FromDiscord | <Rika> technically you can as well |
03:07:04 | FromDiscord | <Rika> let a = exportedProc()↵let b = (typeof a)() |
03:07:07 | FromDiscord | <Rika> probably would work |
03:07:35 | FromDiscord | <creikey> I can't imagine how complicated this compiler is that looks so messy to parse |
03:07:38 | FromDiscord | <creikey> (edit) "I can't imagine how complicated this compiler is that looks so messy to parse ... " added "and reason about" |
03:07:43 | FromDiscord | <Rika> its not messy |
03:07:46 | FromDiscord | <Rika> its just confusing |
03:15:38 | * | noeontheend joined #nim |
03:18:43 | FromDiscord | <Elegantbeef> To add tuple type definitions are just aliases |
03:20:54 | FromDiscord | <Elegantbeef> Which part looks messy to parse?↵(@creikey) |
03:28:10 | FromDiscord | <noow> In reply to @creikey "it seems like objects": afaik most people prefer objects in most cases |
03:28:29 | FromDiscord | <noow> don't really know why |
03:28:36 | FromDiscord | <Elegantbeef> Indeed most cases objects are better |
03:28:42 | FromDiscord | <Elegantbeef> Well cause they're distinct |
03:29:03 | FromDiscord | <Elegantbeef> Tuples are just type aliases so you do not get type safety |
03:29:56 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3OAu |
03:32:34 | FromDiscord | <Elegantbeef> When you have types that come from anywhere you dont have any assurances |
03:33:31 | FromDiscord | <huantian> So what you’re saying is we should have distinct tuples :P |
03:35:47 | FromDiscord | <huantian> I usually mostly just used tuples when returning multiple values from a func |
03:36:25 | * | noeontheend quit (Ping timeout: 256 seconds) |
03:41:10 | * | jmdaemon joined #nim |
03:44:35 | FromDiscord | <Elegantbeef> If only there was a easy thing that replicates distinct tuples.... hmmm↵(@huantian) |
03:44:47 | FromDiscord | <Elegantbeef> Too bad no one made it, we could call it like a `record` or `struct` |
03:45:48 | FromDiscord | <huantian> That would be interesting |
03:46:56 | FromDiscord | <Elegantbeef> Maybe we call them `awbject` |
03:47:57 | FromDiscord | <Elegantbeef> If it's unclear to anyone reading, objects people objects! |
03:49:08 | FromDiscord | <Elegantbeef> Yea this is where it's fine, i often see people using tuples like objects↵(@huantian) |
03:49:37 | FromDiscord | <Elegantbeef> You can always mke unpack procedures that convert the object to tuple |
03:54:24 | FromDiscord | <Rika> i also mentioned that there are issues with distinct tuples |
03:54:33 | FromDiscord | <Rika> like... not being able to access fields by field name |
03:54:33 | FromDiscord | <Elegantbeef> I mean they dont make sense |
03:54:47 | FromDiscord | <Rika> so you have to borrow `.` |
03:55:01 | FromDiscord | <Rika> and at that fuckin point just use an object damn it |
03:55:03 | FromDiscord | <Elegantbeef> Not really an issue it's by design of how it works |
03:55:26 | FromDiscord | <Rika> i mean sure it is but its "not an issue" when you distinct an object |
03:55:32 | FromDiscord | <Rika> you can still access its fields |
03:55:38 | FromDiscord | <Elegantbeef> No you cannot |
03:56:18 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3OAx |
03:56:41 | FromDiscord | <Elegantbeef> Oh wait even borrowing dot fails 😀 |
03:57:10 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3OAy |
04:01:13 | FromDiscord | <huantian> The distinct is too powerful for your puny period |
04:01:29 | FromDiscord | <Elegantbeef> I mean you just need to borrow the dot exprs |
04:19:30 | * | audiophile_ quit (Quit: Default Quit Message) |
04:20:23 | FromDiscord | <Rika> maybe i forgot then |
04:40:39 | FromDiscord | <creikey> In reply to @Elegantbeef "Which part looks messy": getting typeof of an external compilation unit when you try to multithread the compilation seems nontrivial |
04:40:46 | FromDiscord | <creikey> but I don't have much practical experience writing compilers so that's probably wrong |
04:41:25 | FromDiscord | <Elegantbeef> Well it's not multithreaded |
04:42:01 | FromDiscord | <Elegantbeef> `typeof` is a relatively simple operation which reasons the body and returns the type it is |
04:42:38 | FromDiscord | <Elegantbeef> It's mostly a type operation that doesnt require anything overly fancy |
04:44:37 | FromDiscord | <Elegantbeef> You can easily analyse an expression for it's type when you have a type system, since that most of what it's doing anyway 😛 |
04:44:42 | * | rockcavera quit (Remote host closed the connection) |
04:50:46 | FromDiscord | <creikey> cool |
04:51:25 | FromDiscord | <creikey> In reply to @Elegantbeef "Well it's not multithreaded": I looked at the nimsuggest docs yesterday to see if this is true but they seem a little under filled out, is it possible to get some kind of parse tree of the nim program for some advanced editor manipulation stuff? |
04:51:50 | FromDiscord | <creikey> stuff like keyboard shortcuts to copy and paste the currently selected scope |
04:51:54 | FromDiscord | <Elegantbeef> I dont speak french |
04:52:05 | FromDiscord | <creikey> I think vim has that stuff but just looks for the {} |
04:53:04 | FromDiscord | <Elegantbeef> I dont know if it's possible |
04:55:10 | FromDiscord | <Elegantbeef> It might be possible to capture the scope of where your cursor is and get the AST but i dont know about the before the AST |
04:56:46 | FromDiscord | <Elegantbeef> Might be helpful to ask this in the internals chat, would probably get a more insightful answer↵(@creikey) |
05:46:46 | FromDiscord | <evoalg> I think you're telling me to use objects because they are safer than tuples, because objects are distinct and therefore they lead to less errors ... I'm just struggling to drive this home. For a tuple I can do `doThing (10, 20)` or even `doThing (a:10, b:20)` ... for an object I figured out I can do `doThing(MyObject(a: 1, b: 2))` ... but it's not clear to me where the safety is? |
05:47:50 | FromDiscord | <Elegantbeef> The safety is that you cannot have a `(int, int)` from module A be used in module B |
05:48:51 | FromDiscord | <Elegantbeef> Not all objects that have only two int fields are considered the same type, all tuples with only two ints are |
05:50:34 | FromDiscord | <evoalg> ok so I think you're saying it's all about the beauty of distinct |
05:52:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3OB4 |
05:52:34 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3OB5 |
05:53:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/f7u |
05:55:03 | FromDiscord | <Elegantbeef> With the latter example the way to send data to `doThing` you cannot provide bad values |
05:55:19 | FromDiscord | <Elegantbeef> This is a constructed example but eitherway, shows the point |
05:56:10 | FromDiscord | <evoalg> thank you ... lemme digest all this |
05:57:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3OB7 |
05:58:45 | FromDiscord | <Elegantbeef> Unrelated but it's just in north america where "Consider the following" evokes memories of Bill Nye right? 😀 |
06:04:28 | FromDiscord | <evoalg> hehe it didn't evoke that in me, but only a kiwi |
06:08:52 | FromDiscord | <evoalg> we didn't have Bill Nye, but we did have Cosmos (the original one with Sagan) |
06:09:21 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3OBa |
06:10:37 | FromDiscord | <geekrelief> (edit) "https://play.nim-lang.org/#ix=3OBa" => "https://play.nim-lang.org/#ix=3OBb" |
06:14:56 | FromDiscord | <Elegantbeef> [evoalg](https://matrix.to/#/@evoalg:matrix.org)\: i will say that it's atleast my view in a statically typed language to use types as much as possible to ensure program safety, some people vastly disagree |
06:15:55 | FromDiscord | <evoalg> gotcha ... I guess I'm still so used to python that anything else seems restrictive |
06:16:31 | FromDiscord | <evoalg> but I can see how I can (and do) get myself into trouble with python when it's over X number of lines |
06:16:53 | FromDiscord | <Elegantbeef> That's kinda the benefit of static though, you make the code as safe as possible 😀 |
06:18:36 | FromDiscord | <Elegantbeef> Subrange types are one of my favourite things to talk about in this regard, in most languages if you want to say "X cannot be outside of this range" you document it and manually check it. In Nim you just do `var a: 0..10` |
06:19:18 | FromDiscord | <evoalg> and that doesn't even change the type right? |
06:19:27 | FromDiscord | <Elegantbeef> Well it's a checked range but it's an int |
06:19:46 | FromDiscord | <evoalg> yea that's what I meant \:) ... very nice and easy |
06:21:01 | FromDiscord | <Elegantbeef> I should shush before i start a rant about tuples 😀 |
06:21:37 | FromDiscord | <evoalg> you already talked about tuples though? |
06:21:57 | FromDiscord | <Elegantbeef> Sure but i was starting to write a message ranting about them |
06:22:16 | FromDiscord | <evoalg> please rant away |
06:24:12 | FromDiscord | <Elegantbeef> I generally only see tuples useful as anonymous return groups, for quick grouped types for collections, and unpacking. As soon as you start adding field names i feel like you should just use an object. Then use a macro or user written procedures to unpack |
06:25:47 | FromDiscord | <evoalg> I've heard rantier rants ;-) |
06:27:05 | FromDiscord | <Elegantbeef> Oh yay it's succinct rant or a succy rant |
06:27:18 | FromDiscord | <evoalg> I can't find the right nim offtopic channel in matrix ... what do I do to find it? |
06:27:29 | FromDiscord | <Elegantbeef> #offtopic |
06:28:43 | FromDiscord | <evoalg> Sorry, when I go to Rooms \> Explore public rooms, it says nothing is found |
06:28:59 | FromDiscord | <Elegantbeef> Are you on matrix? |
06:29:03 | FromDiscord | <Elegantbeef> I mean element |
06:29:06 | FromDiscord | <Elegantbeef> Gosh i'm daft |
06:29:08 | FromDiscord | <evoalg> yes |
06:29:27 | FromDiscord | <Elegantbeef> Did you join the nim space? |
06:30:38 | FromDiscord | <evoalg> I didn't join the nim space ... found offtopic but just searching for #nim-offtopic\:envs.net and when it said nothing was found I clicked join and it worked |
06:42:14 | FromDiscord | <Rika> As soon as you use the tuple for more than, like, one proc then maybe change it for a type |
06:43:03 | FromDiscord | <Elegantbeef> Exactly |
06:43:27 | FromDiscord | <Elegantbeef> I feel a lot of people use tuples as objects and that's just not their point |
06:44:12 | FromDiscord | <Elegantbeef> Though could be the use of `object` making people think it's an OOP thing |
06:53:43 | FromDiscord | <speq> What's the point of tuples then? Not objecting, just trying to understand the perspective here |
06:54:19 | FromDiscord | <Elegantbeef> Easy pairs/unpacking |
06:54:55 | FromDiscord | <Elegantbeef> `proc doThing(args): (T1, T2)` is a common usage of them |
06:55:21 | FromDiscord | <Elegantbeef> I say pairs but i mean any grouping of types |
06:55:47 | FromDiscord | <speq> OK, but how is this different from an object with no `proc`s defined specifically for it? |
06:56:02 | FromDiscord | <Elegantbeef> What do you mean? |
06:56:32 | FromDiscord | <Elegantbeef> An object with no procs is still a unique type |
06:56:35 | FromDiscord | <Elegantbeef> A tuple with no procs is not |
06:56:42 | FromDiscord | <speq> I mean, why/when would I switch to an object that encapsulates T1 and T2 |
06:56:57 | FromDiscord | <speq> If I don't need a specific name for it |
06:57:22 | FromDiscord | <Elegantbeef> Imo if you're doing named fields like `tuple[field1: int, field2: float]`, just use an object |
06:58:05 | FromDiscord | <Elegantbeef> If someone gets your returned tuple and then uses it later they have 0 type safety assurances it can go anywhere that matches the tuple signature |
06:58:27 | FromDiscord | <Elegantbeef> I dont mind using anonymous tuples is mostly what i'm saying |
06:58:34 | FromDiscord | <evoalg> so tuples are great if you want anonymous fields? |
06:58:48 | FromDiscord | <Elegantbeef> When you're attempting to give names to tuple fields i really feel like you're using the wrong thing |
06:59:06 | FromDiscord | <speq> OK, so you are arguing for objects for their type safety, gotcha |
06:59:28 | FromDiscord | <speq> That's clear |
07:37:14 | * | jjido joined #nim |
07:39:51 | * | PMunch joined #nim |
07:53:55 | FromDiscord | <axtens> if I declare a proc as `proc foo(bar: string | seq[string]) : int =` how do I tell in the body of the proc whether I've got a string or a sequence of string? |
07:54:06 | * | Guest16 joined #nim |
07:54:24 | FromDiscord | <enthus1ast> when bar is string\: |
07:54:57 | FromDiscord | <enthus1ast> when bar is seq[string]\: |
07:55:27 | * | Guest16 quit (Client Quit) |
07:56:20 | FromDiscord | <Elegantbeef> depending what you're doing you could also just use `varargs[string]` |
07:58:27 | FromDiscord | <axtens> wow. ok |
07:59:27 | FromDiscord | <enthus1ast> https://play.nim-lang.org/#ix=3OBv |
08:00:22 | FromDiscord | <enthus1ast> also\: when / elif / else |
08:00:30 | FromDiscord | <enthus1ast> the second when could be elif |
08:04:33 | FromDiscord | <axtens> that is a thorough answer |
08:05:34 | Amun-Ra | and, depending on what's in the function body, the 3rd option would be foo(s: string)… foo(s: seq[string])… |
08:08:38 | FromDiscord | <Elegantbeef> Us Nim users for some reason give very detailed explanations with examples 😛 |
08:09:03 | FromDiscord | <enthus1ast> guess we procrastinate work |
08:09:07 | FromDiscord | <enthus1ast> i do \:/ |
08:10:28 | FromDiscord | <Elegantbeef> Ha me work! |
08:10:35 | FromDiscord | <enthus1ast> must do php if i don't ;\_; |
08:10:46 | Amun-Ra | ouch |
08:16:02 | FromDiscord | <--HA--> In that `proc foo(bar: string | seq[string]) : int =` example and then writing code to handle different types with `when` is there a way to make sure all cases are covered?↵So that I can later add another type in the function signature and my "when block" does not compile, something like that. |
08:17:12 | FromDiscord | <Elegantbeef> There is not without macros |
08:17:13 | FromDiscord | <enthus1ast> then i would use the overloading option |
08:17:22 | FromDiscord | <Elegantbeef> Overloading makes more sense indeed |
08:19:49 | FromDiscord | <--HA--> Overloading means I'd have `proc foo(bar: string): int` and `proc foo(bar: float): int` and so on? And maybe they call a private proc to share some code? |
08:20:03 | FromDiscord | <Elegantbeef> Yea |
08:20:18 | FromDiscord | <enthus1ast> yes, see my link to the tutorial above |
08:20:20 | FromDiscord | <Elegantbeef> Generalizing what's generalizable |
08:20:24 | FromDiscord | <Phil> In reply to @geekrelief "<@!102899813149855744> genit v0.13.0 supports": Thanks! I'll keep it in mind for the future!↵For now, I managed to get rid of the need for both the enum and the variant so I'll keep an eye out for other scenarios where this might be useful for generating a lot of similar stuff on the fly |
08:22:50 | Amun-Ra | how about proc foo(bar: varargs[typed, `$`]) |
08:23:28 | FromDiscord | <--HA--> In reply to @enthus1ast "yes, see my link": Sorry I'm not finding the link |
08:23:46 | FromDiscord | <enthus1ast> this |
08:23:50 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3OBv |
08:23:53 | FromDiscord | <Elegantbeef> Oh whoops |
08:23:54 | FromDiscord | <Elegantbeef> 😀 |
08:24:11 | FromDiscord | <Phil> In reply to @enthus1ast "must do php if": My condolences, may you rest in piece |
08:24:23 | FromDiscord | <Rika> In reply to @enthus1ast "this": Reply with unknown content |
08:24:51 | FromDiscord | <enthus1ast> https://nim-lang.github.io/Nim/tut1.html#procedures-overloaded-procedures |
08:25:13 | FromDiscord | <Elegantbeef> Oh didnt get through from matrix |
08:25:30 | FromDiscord | <Phil> And yeah if you want a proc to accept multiple types as arguments, unless the proc can't do the exact same code on each type, use overloading |
08:25:52 | FromDiscord | <enthus1ast> mh yeah, maybe i should switch to discord for nim, but then i get this "whatsapp, meta" feeling |
08:26:16 | FromDiscord | <Elegantbeef> Lol i swapped to matrix for it cause i'd rather use matrix than discord |
08:26:18 | FromDiscord | <Phil> What I like to do, though I'm not sure if that's sensible, is have a core proc with the functionality but maybe not a proc signature that is as simple as it could be, and have a lot of helper procs around it and then only export the helper procs. |
08:26:43 | FromDiscord | <Phil> (edit) "What I like to do, though I'm not sure if that's sensible, is have a core proc with the functionality but maybe not a proc signature that is as simple as it could be, and have a lot of helper procs ... around" added "as ovreloads" |
08:27:44 | FromDiscord | <enthus1ast> yeah the matrix idea is much better (and its foss) but the ux of discord is much better (insert 3 pages long matrix rant here) |
08:28:14 | FromDiscord | <enthus1ast> especially when you connect via federation, like i doo |
08:28:25 | FromDiscord | <Phil> federation? |
08:28:44 | FromDiscord | <enthus1ast> i have my own matrix server and it connects to other matrix servers |
08:29:06 | FromDiscord | <Elegantbeef> Matrix is a decentralised federated protocol, which means matrix servers communicate between eachother |
08:29:27 | FromDiscord | <Elegantbeef> So you can have your own server like enthus does but connect to other servers that allow you to join |
08:31:43 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/939075738085232680/image.png |
08:31:46 | FromDiscord | <Elegantbeef> Diagram of the layout |
08:32:00 | FromDiscord | <Rika> Why do people say Enthus but not ast smh |
08:32:05 | FromDiscord | <Rika> I’m joking |
08:32:18 | FromDiscord | <Elegantbeef> Cause no one likes AST |
08:33:35 | FromDiscord | <enthus1ast> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: eeehm you mean this one right?\: |
08:33:47 | FromDiscord | <enthus1ast> xkcd1810-matrixified-v2-1024x842.png https://media.discordapp.net/attachments/371759389889003532/939076260116697098/xkcd1810-matrixified-v2-1024x842.png |
08:34:06 | FromDiscord | <Elegantbeef> Sure |
08:37:53 | FromDiscord | <Phil> No bridge to Wall(Unix)?! Heresy! |
08:38:16 | FromDiscord | <Elegantbeef> Literally unusable |
08:38:41 | Amun-Ra | apache request log users, unite! |
08:38:48 | FromDiscord | <Phil> I'm legit fascinated there's an ICQ bridge |
08:38:51 | FromDiscord | <Phil> There's two of us ! |
08:38:56 | FromDiscord | <Phil> (edit) "There's two of us ! ... " added "Amun-Ra!" |
08:38:59 | Amun-Ra | :> |
08:39:20 | FromDiscord | <xx_ns> In reply to @Amun-Ra "apache request log users,": nginx access log is the superior communication method |
08:39:29 | Amun-Ra | Phil: sorry to tell you but I'm more of nginx request log user nowadays… :/ |
08:39:40 | Amun-Ra | xx_ns: ^ ;) |
08:39:52 | FromDiscord | <eyecon> How tf do people communicate via web server logs 😄 |
08:40:19 | FromDiscord | <Elegantbeef> Very carefully |
08:40:35 | FromDiscord | <enthus1ast> i've done a small tool a few years ago, that could print ascii art into the server logs \: ) |
08:40:41 | FromDiscord | <eyecon> Do I make a request HOWDY with the header `X-Intended-Recipient: Sandy` |
08:40:46 | FromDiscord | <enthus1ast> never got an answer though \:( |
08:41:00 | FromDiscord | <Phil> In reply to @Amun-Ra "<@180601887916163073>: sorry to tell": darth vader nooooooooo |
08:42:11 | FromDiscord | <Phil> About the IRC gateway accounts, why does Prestige's one do the <> thing and Amun-Ra's doesn't? |
08:42:56 | FromDiscord | <Phil> I think Prestige used "nrds[IRC]" |
08:43:07 | FromDiscord | <Elegantbeef> One connects from freenode the other libera |
08:43:24 | FromDiscord | <Elegantbeef> Prestige likes being wrong |
08:43:28 | FromDiscord | <xx_ns> hmmmm https://media.discordapp.net/attachments/371759389889003532/939078693463130152/IMG_1189.png |
08:43:31 | FromDiscord | <enthus1ast> oh its bridged to both? |
08:43:53 | nrds | <Prestige99> This bridge is from irc-nerds |
08:44:37 | FromDiscord | <Elegantbeef> The other is libera right? |
08:45:16 | nrds | <Prestige99> Yeah |
08:55:29 | PMunch | @eyecon, you normally don't log the request content. So I guess you'd set the referrer to your message :P |
09:03:18 | * | cyraxjoe quit (Quit: No Ping reply in 180 seconds.) |
09:04:33 | * | cyraxjoe joined #nim |
09:05:14 | FromDiscord | <eyecon> In reply to @PMunch "<@191304757195833344>, you normally don't": Right, makes sense |
09:26:27 | FromDiscord | <xx_ns> yep, either referer or user agent |
09:26:42 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
09:27:00 | FromDiscord | <xx_ns> or literally just the path |
09:57:56 | FromDiscord | <Rika> Prestige genuine question why do you still use Freenode |
09:59:49 | nrds | <Prestige99> I don't |
10:00:38 | FromDiscord | <Rika> I'm confused then |
10:00:46 | FromDiscord | <Rika> Which is freenode which is libera |
10:01:00 | PMunch | I'm on Libera |
10:01:02 | nrds | <Prestige99> I'm on the irc nerds network, and I have it bridged to libera |
10:01:05 | PMunch | He's onIRC-nERDS |
10:01:09 | FromDiscord | <Rika> I see |
10:01:15 | FromDiscord | <Rika> What's the difference |
10:02:53 | nrds | <Prestige99> Just different networks, different goals and different management |
10:03:50 | FromDiscord | <Rika> Okay |
10:08:26 | FromDiscord | <xx_ns> i thought freenode died? |
10:08:45 | nrds | <Prestige99> Nope it's still up and running |
10:11:25 | FromDiscord | <xx_ns> _a_ server on that address is up and running |
10:11:33 | FromDiscord | <xx_ns> but it's not freenode is it |
10:11:37 | FromDiscord | <Elegantbeef> They had a odd message today |
10:11:45 | nrds | <Prestige99> Yes it's still freenode |
10:11:48 | FromDiscord | <Elegantbeef> Or atleast some message was sent here that was odd |
10:12:09 | nrds | <Prestige99> Yeah there are people still mad that freenode is alive, so they go around spamming crap |
10:12:58 | FromDiscord | <xx_ns> In reply to @nrds "<Prestige> Yes it's still": it doesn't have any of the old chan/nickserv registration, any of the staff, uses an entirely different server software / implementation, and most importantly none of the users (who have pretty much all moved to libera) |
10:13:00 | FromDiscord | <xx_ns> i'd say it's pretty dead |
10:13:40 | FromDiscord | <Rika> What, are we gonna start talking abiut Theseus' ship now |
10:13:45 | nrds | <Prestige99> That's not what dead means, and not all the staff left |
10:13:52 | nrds | <Prestige99> 🤷 |
10:14:10 | nrds | <Prestige99> I don't really care, don't know why people still mad about freenode being around |
10:14:13 | FromDiscord | <Elegantbeef> Whose ship? It's mine now |
10:14:31 | FromDiscord | <Phil> Why does anyone care whether freenode is up or not? It's a mystery |
10:14:47 | FromDiscord | <Phil> Trolls be trolls I guess |
10:15:06 | FromDiscord | <xx_ns> i really don't think anyone's mad at freenode "still" being around, more the fact that it was a hostile takeover of an entire community |
10:15:10 | FromDiscord | <Phil> In reply to @Elegantbeef "Whose ship? It's mine": Write a macro to gain ownership of it |
10:15:13 | FromDiscord | <xx_ns> the community has spoken and has left |
10:15:27 | FromDiscord | <Rika> I don't care either |
10:15:35 | FromDiscord | <Elegantbeef> Nah in Nim to get ownership we just `sink` it↵(@Phil) |
10:15:42 | nrds | <Prestige99> It wasn't and they haven't.. but I'm done talking about this lol you're the only one that cares xx |
10:15:56 | FromDiscord | <xx_ns> okay? |
10:16:01 | FromDiscord | <Rika> If no one I care about uses it why should I care if it's still up or not; if it's not doing anything to me directly or indirectly what's there to give a fuck about |
10:16:03 | FromDiscord | <Rika> Anyway |
10:16:04 | FromDiscord | <Phil> In reply to @Elegantbeef "Nah in Nim to": And that's how you make sure there's no ship for anyone to have anymore |
10:16:09 | FromDiscord | <xx_ns> not sure why you're getting so defensive over this i was just trying to have a conversation about freenode |
10:16:24 | FromDiscord | <Rika> In reply to @Isofruit "And that's how you": LMFAO |
10:16:28 | FromDiscord | <Elegantbeef> I'm not getting defensive the wall is! |
10:16:36 | FromDiscord | <Rika> Fucker sunk the ship I can't believe it |
10:16:51 | FromDiscord | <Elegantbeef> But we do have the nameplate that says "thesus'" |
10:17:00 | FromDiscord | <Rika> The sus |
10:17:00 | FromDiscord | <Elegantbeef> So how about thesus' train? |
10:17:05 | FromDiscord | <Rika> :AMOGUS: |
10:17:18 | FromDiscord | <Elegantbeef> !ban @Rika |
10:17:30 | FromDiscord | <Phil> In reply to @Elegantbeef "So how about thesus'": Why would theseus want to put on even more muscles? |
10:19:43 | * | Zevv quit (Ping timeout: 250 seconds) |
10:20:04 | FromDiscord | <Phil> In reply to @Rika "<:AMOGUS:811451017521790978>": Ya know, germany has a pretty proud tradition of finding humour in the nonsensical. But even I never managed to really find the entire Among Us meme stuff funny |
10:20:19 | FromDiscord | <Rika> In reply to @Isofruit "Ya know, germany has": Thats because it isn't |
10:20:24 | FromDiscord | <Elegantbeef> You know what they say german humour is no laughing matter |
10:20:46 | FromDiscord | <Phil> God damn I hate how I have heard that joke dozens of times yet it still makes me snort a bit |
10:20:51 | FromDiscord | <Rika> How |
10:21:13 | FromDiscord | <Elegantbeef> It's a well written joke it cannot die |
10:32:50 | FromDiscord | <Rika> It’s barely a joke |
10:33:04 | FromDiscord | <Elegantbeef> The german humour joke? |
10:36:57 | * | jjido joined #nim |
10:37:17 | FromDiscord | <Phil> In reply to @Rika "How": I don't have an incredibly high bar for finding even dumb jokes funny. That's why it is somewhat impressive that the amongus stuff fits below even that |
10:50:37 | FromDiscord | <exelotl> What are you talking about, amogus is hilarious |
11:16:28 | FromDiscord | <Goel> `proc map[T, S](s: openArray[T]; op: proc (x: T): S {.closure.}): seq[S]`↵> Instead of using map and filter, consider using the collect macro from the sugar module↵Why this, for performance or just because its more handy? |
11:19:37 | * | jmdaemon quit (Ping timeout: 256 seconds) |
11:23:28 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
11:27:02 | FromDiscord | <Phil> macro smells like offloading computation to compile time |
11:27:15 | FromDiscord | <Phil> Though I don't get what you would offload to compile time there |
11:31:58 | FromDiscord | <Rika> It’s “nicer and more explicit to look at” |
11:32:07 | FromDiscord | <Rika> For non functional programmers |
11:32:08 | FromDiscord | <konsumlamm> `collect` is more general (it allows more than just map and filter) and it's more efficient (because it doesn't allocate intermediate `seq`s) when you do multiple operations |
11:43:43 | FromDiscord | <Goel> sent a long message, see http://ix.io/3OCl |
11:46:51 | * | jjido joined #nim |
11:50:58 | FromDiscord | <Rika> Template it and call it “asSlice” or toSlice |
11:51:14 | FromDiscord | <exelotl> you could do `myArr[0..^1]` |
11:55:40 | FromDiscord | <Phil> Is there a way, in logging, to include somehow from which file the logging call is coming from? |
11:56:02 | FromDiscord | <Phil> I'm starting at the format string options and I'm sort of missing anything related to "log the origin of the log call" |
11:56:15 | FromDiscord | <Phil> (edit) "starting" => "staring" |
11:56:31 | FromDiscord | <Phil> I'm using std/logging |
11:56:50 | FromDiscord | <Flo> I'm currently building a parser, and I having difficulty deciding how to handle the original input / buffer.↵When "taking" characters, do I modify the input buffer by always taking away the currently parsed items, or would It be ok to move just the index like a cursor, and always doing substring on the original? |
11:57:57 | FromDiscord | <Flo> So the main question would be, what is more performant, cutting a large string into parts until there's nothing left anymore.↵Or always doing lookups in the original string |
11:58:02 | FromDiscord | <Rika> In reply to @Isofruit "Is there a way,": Yes but I don’t remember the template name |
11:58:18 | FromDiscord | <dom96> In reply to @Flo "So the main question": the latter |
11:58:43 | FromDiscord | <Phil> In reply to @Rika "Yes but I don’t": So it's not achieved by manipulating the formatstring but by calling aspecific template? |
11:58:50 | FromDiscord | <Phil> (edit) "In reply to @Rika "Yes but I don’t": So it's not achieved by manipulating the formatstring ... but" added "of a given logger" |
11:59:01 | FromDiscord | <Rika> https://nim-lang.org/docs/system.html#currentSourcePath.t |
11:59:03 | FromDiscord | <dom96> @Flo example of how to do parsing from my book https://github.com/dom96/nim-in-action-code/blob/master/Chapter6/WikipediaStats/naive.nim |
11:59:49 | FromDiscord | <Phil> In reply to @Rika "https://nim-lang.org/docs/system.html#currentSource": Ohhh I can include that in the formatstr? Actually.. why wouldn't it... thanks for the find ! |
12:05:49 | FromDiscord | <Flo> In reply to @dom96 "<@!274627218368626699> example of how": Cool, that helps me, thanks! |
12:28:42 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
12:46:20 | * | jjido joined #nim |
12:58:43 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
13:05:21 | FromDiscord | <Zajt> sent a code paste, see https://paste.rs/uI1 |
13:05:41 | PMunch | `choosenim update stable` |
13:05:56 | PMunch | @Zajt ^ |
13:08:52 | FromDiscord | <Zajt> thanks |
13:12:19 | FromDiscord | <Phil> In reply to @Rika "https://nim-lang.org/docs/system.html#currentSource": Hmmm I might not be doing this correctly. I can get a source path, but I can't add it to the default format of the logger. I'd have to add this manually to every time I call log. Hmmm |
13:12:39 | FromDiscord | <Phil> (edit) "Hmmm" => "Hmmm↵`addHandler(newConsoleLogger(fmtstr = fmt "$levelname : currentSourcePath(): "))`" |
13:12:48 | FromDiscord | <Phil> (edit) "currentSourcePath():" => "{currentSourcePath()}:" |
13:21:57 | FromDiscord | <JohnDoe> sip nimrods |
13:22:04 | FromDiscord | <JohnDoe> (edit) "sip" => "sup" |
13:23:25 | FromDiscord | <Rika> In reply to @Isofruit "Hmmm I might not": well thats because the template call has to be in the source file you want the name of |
13:26:40 | FromDiscord | <Phil> Dang. the fmtstr has these nice placeholders with $ that it replaces, just wish it also had one for filename |
13:29:47 | FromDiscord | <Rika> well you cant really get filename since the .log .info etc are procs |
13:30:18 | FromDiscord | <Goel> > This module implements a simple logger.↵> It has been designed to be as simple as possible to avoid bloat. If this library does not fulfill your needs, write your own.↵Well thanks i suppose! Not need to be so grumpy... |
13:42:42 | PMunch | @Goel, haha is that the official logger module? |
13:43:22 | FromDiscord | <Goel> Yes |
13:43:23 | PMunch | https://nim-lang.org/blog/2022/02/04/nim-devroom-fosdem-2022.html |
13:44:56 | FromDiscord | <Phil> In reply to @Goel "> This module implements": I think that's alright. Logging can range from mildly difficult to insanely complicated and I can't imagine it's the most exciting thing to implement, no matter how much anyone asks for it. I guess the entire lib has been implemented against Araqs will or sth. in order to provide something at least |
13:45:58 | NimEventer | New thread by PMunch: Nim devroom at FOSDEM this weekend, see https://forum.nim-lang.org/t/8866 |
13:47:05 | PMunch | @Phil, I don't think it's implemented against his will. But as you say logging can get quite complex so I guess the decision was made to not go down that rabbit hole in the official module |
13:47:40 | PMunch | If you need more than the official logger module though I can recommend Chronicles by Status, that is some black-magic level stuff |
13:48:06 | FromDiscord | <Phil> In reply to @PMunch "<@180601887916163073>, I don't think": Fair, I think the wording might've been bad. More like "implemented to have something, not because one is excited about it" |
13:48:54 | FromDiscord | <Phil> (edit) "the" => "my" |
13:58:36 | * | rockcavera joined #nim |
13:58:36 | * | rockcavera quit (Changing host) |
13:58:36 | * | rockcavera joined #nim |
14:11:17 | * | TakinOver quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
14:12:09 | * | jjido joined #nim |
14:22:28 | * | audiophile_ joined #nim |
14:27:48 | * | arkurious joined #nim |
14:32:50 | * | xaltsc joined #nim |
14:33:46 | xaltsc | Hey, is there a cookbook for Nim somewhere ? I'm a few hours old newb and kind of lost with nim's idiosyncrasies and package/module system |
14:34:57 | FromDiscord | <Phil> The stuff under documentation on the official webpage isn't helping you any? |
14:38:41 | xaltsc | Phil: I went through it enough to grasp the essential stuff, but I'm stuck with concrete problems. For instance, I want to filter a TypeRef, but filterIt raises a type error since the arguments are untyped. |
14:38:55 | xaltsc | TableRef* |
14:39:23 | FromDiscord | <enthus1ast> can you show code? |
14:40:59 | FromDiscord | <enthus1ast> you can put it here if you like\: https://play.nim-lang.org/ |
14:41:48 | xaltsc | https://paste.debian.net/1229583/ |
14:43:26 | xaltsc | Also, I couldn't find the complexity of access for the different list/map-like types |
14:45:58 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
14:53:09 | FromDiscord | <enthus1ast> like this? https://play.nim-lang.org/#ix=3ODm |
14:55:40 | xaltsc | enthus1ast: It's a bit... verbose :D I wanted to precisely use filterIt and learn how to solve this kind of type issue, especially since the procedure doesn't seem to be generic and is not actually a procedure |
15:02:00 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/sequtils.html#filterIt.t,untyped,untyped |
15:02:32 | FromDiscord | <demotomohiro> Document says "Returns a new sequence" but your code expecting it returns TableRef type. |
15:03:29 | FromDiscord | <enthus1ast> ok then this?\: https://play.nim-lang.org/#ix=3ODJ |
15:03:45 | FromDiscord | <enthus1ast> to make this a little bit more ergonomic you could define some helpers |
15:05:23 | FromDiscord | <enthus1ast> i think i've never used a ref tuple before \:) |
15:06:12 | NimEventer | New thread by Nycto: Exclude from generated docs, see https://forum.nim-lang.org/t/8867 |
15:08:42 | * | PMunch quit (Quit: Leaving) |
15:14:01 | xaltsc | enthus1ast: Yeah, I did the same thing in the end (except it's more convenient to get a seq in fact). I would have though filterIt would preserve the container type. |
15:15:22 | xaltsc | Regarding my use of ref tuple, I'm not quite sure I master the difference between tuples and objects, but tuple seem more well behaved mathematically, and since I expect them to be large, I'd rather use pointers than hard copies. |
15:17:40 | FromDiscord | <enthus1ast> ok maybe something like this\: https://play.nim-lang.org/#ix=3ODN |
15:17:45 | FromDiscord | <enthus1ast> could be improved i guess |
15:18:02 | FromDiscord | <enthus1ast> this is filter it from sequtils, patched for tables |
15:20:58 | xaltsc | But this copies the elements of the table, doesn't it ? (But probably, so does the library's filterIt) |
15:21:47 | FromDiscord | <enthus1ast> yes it creates a new table |
15:22:31 | FromDiscord | <enthus1ast> https://github.com/nim-lang/Nim/blob/35c812fda1ae7f1d183d3021793438fb2099c329/lib/pure/collections/sequtils.nim#L615 |
15:34:43 | * | audiophile_ quit (Ping timeout: 256 seconds) |
15:41:00 | * | jjido joined #nim |
15:47:20 | xaltsc | In the end, this is what I ended up with: https://play.nim-lang.org/#ix=3ODW However, I can't find how to create a new reference |
15:50:29 | xaltsc | My problem lies likely with the combined use of a let and a ref, as I can manage to do it with a var + new |
15:52:58 | xaltsc | Managed to do it https://play.nim-lang.org/#ix=3ODY. However, in this particular case, does it matter that AdjacencyMatrix is a ref ? Given that the possibly heavy field matrix is already a ref ? |
16:47:19 | * | noeontheend joined #nim |
16:49:17 | FromDiscord | <Ayy Lmao> Does anyone know what to do when getting `error:1408F10B:SSL routines:ssl3_get_record:wrong version number [SslError]` while using `httpclient`? I'm on Windows and installed the latest version of openssl and added it to my path but still get the error message. |
16:51:47 | * | noeontheend quit (Ping timeout: 256 seconds) |
17:12:57 | FromDiscord | <lantos> is there an easy way to do math ops (+, -, /, %, ) on big numbers stored in arrays of bytes? not bigint lib |
17:20:37 | FromDiscord | <Waldecir Santos> Is it possible to get all keys in a Table ? |
17:20:54 | FromDiscord | <Waldecir Santos> like a seq[string] of keys |
17:24:13 | FromDiscord | <Waldecir Santos> Hmm there is the keys proc it wasn't showing before /shrug. |
17:26:27 | FromDiscord | <Waldecir Santos> But I'm getting this error `Error: undeclared field: 'keys' for type tables.Table [type declared in /opt/homebrew/Cellar/nim/1.6.2/nim/lib/pure/collections/tables.nim(206, 3)]` |
17:26:50 | FromDiscord | <lantos> @Waldecir Santos ↵https://play.nim-lang.org/#ix=3OEG |
17:27:47 | FromDiscord | <Waldecir Santos> @lantos why it fails if I try `echo a.keys()` ? |
17:27:47 | FromDiscord | <lantos> https://nim-lang.org/docs/tables.html |
17:27:57 | FromDiscord | <Waldecir Santos> https://play.nim-lang.org/#ix=3OEI |
17:29:06 | FromDiscord | <auxym> In reply to @lantos "is there an easy": Sounds like a bigint lib? Why not use a bigint lib? |
17:29:07 | FromDiscord | <lantos> because the keys() returns a iterator which needs to be enumerated over. Using the toSeq() from the sequtils library turns it into a sequence kind of like rusts .collect() |
17:29:17 | FromDiscord | <lantos> In reply to @Waldecir Santos "https://play.nim-lang.org/#ix=3OEI": because the keys() returns a iterator which needs to be enumerated over. Using the toSeq() from the sequtils library turns it into a sequence kind of like rusts .collect() |
17:29:49 | FromDiscord | <Waldecir Santos> But why undeclared erro ? because there isn't a proc that returns string ? |
17:31:27 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
17:31:34 | FromDiscord | <Waldecir Santos> Dismiss this 👆 |
17:31:41 | FromDiscord | <Waldecir Santos> You guys are right. |
17:32:52 | FromDiscord | <demotomohiro> You cannot use method call syntax if 1st parameter is untyped |
17:34:16 | FromDiscord | <lantos> In reply to @auxym "Sounds like a bigint": want to use arrays instead of seq's because I want to avoid the copys (unless its a non issue) |
17:34:23 | FromDiscord | <lantos> (edit) removed "because I want" |
17:35:36 | FromDiscord | <Waldecir Santos> Another think that I always miss is that I need to import `std/sequtils` if I want to use `.toSeq` but I get used to it 😄 |
17:36:09 | FromDiscord | <Waldecir Santos> (edit) "I" => "I'll" | "😄" => "😄e" |
17:36:18 | FromDiscord | <konsumlamm> In reply to @lantos "want to use arrays": avoid the copies? if anything, arrays do more copies |
17:36:58 | FromDiscord | <Waldecir Santos> I mean if I set the variable in 1 file/module and want to use that in another module and check keys/seq I need to import tables/sequtils |
17:37:05 | FromDiscord | <auxym> In reply to @lantos "want to use arrays": https://github.com/status-im/nim-stint "No heap/dynamic allocation" |
17:38:38 | FromDiscord | <auxym> megalo and bigint are seq-based, you could benchmark either and see which is faster between stack-based or seq-based |
17:43:39 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=3OEP |
17:43:52 | FromDiscord | <lantos> In reply to @auxym "https://github.com/status-im/nim-stint "No heap/dyn": yeah this looks more like it will try this |
17:46:03 | FromDiscord | <auxym> do you really have to use ptrs? Nim tries to be smart when passing non-var arguments by using either a copy of ref, depending on which is faster. (refs avoid a copy but add an indirection step) |
17:48:21 | FromDiscord | <auxym> and var arguments are always passed by reference, if you want to modify in place. |
18:02:48 | FromDiscord | <Rainbow Asteroids> Does this code compile for anyone else? I'm getting a weird compiler error on stable and devel. It seems like GCC is reporting type errors. https://pastebin.com/FmwrEbv3 |
18:04:38 | FromDiscord | <lantos> In reply to @auxym "and var arguments are": hmm, having some difficulty could you please show a small example? |
18:07:39 | FromDiscord | <Phil> This is likely a really dumb nimble gotcha |
18:08:08 | FromDiscord | <auxym> In reply to @Rainbow Asteroids "Does this code compile": it's failing in playground too. I have a vague recall of a compiler bug involving options and ref types. Did you try the 1.6.4 RC maybe? |
18:09:14 | FromDiscord | <auxym> maybe this? https://github.com/nim-lang/Nim/issues/16754 |
18:10:02 | FromDiscord | <Phil> I, out of sheer frustration, changed permission of all files in a project to 777. Recursively! So every file in that dir↵So everyone and their mother should have access to read anything↵Yet when I run `nimble test` in that project, I get:↵> /home/isofruit/dev/norm/src/norm/postgres.nim(3, 11) Error: cannot open file: ndb/postgres |
18:10:16 | FromDiscord | <Phil> (edit) "dir↵So" => "dir has read write execute permission for everyone↵So" |
18:11:25 | NimEventer | New post on r/nim by pietroppeter: Nim devroom at Fosdem tomorrow (Feb 24) 12:30-17:40, see https://reddit.com/r/nim/comments/skk2nc/nim_devroom_at_fosdem_tomorrow_feb_24_12301740/ |
18:12:28 | * | PMunch joined #nim |
18:12:46 | FromDiscord | <Phil> sent a long message, see http://ix.io/3OF5 |
18:20:36 | * | jjido joined #nim |
18:21:52 | FromDiscord | <tandy> my nimble looks like this |
18:21:57 | FromDiscord | <tandy> `requires "https://gitlab.com/tandy1000/listenbrainz-nim#head"` |
18:21:58 | FromDiscord | <tandy> sent a code paste, see https://paste.rs/yQ8 |
18:22:26 | FromDiscord | <demotomohiro> Do you have the file your Nim says cannot open? |
18:28:23 | FromDiscord | <tandy> no |
18:28:32 | FromDiscord | <tandy> i just deleted nimble folder |
18:31:28 | FromDiscord | <tandy> i dont understnad why its requesting specific versions.. `Error: unhandled exception: cannot open: /home/tandy/.nimble/pkgs/prologue-0.5.0/prologue.nim [IOError]` |
18:31:49 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
18:32:26 | FromDiscord | <lantos> ls -lah /home/tandy/.nimble/pkgs/prologue-0.5.0/ |
18:32:57 | FromDiscord | <lantos> (edit) "ls -lah /home/tandy/.nimble/pkgs/prologue-0.5.0/" => "sent a code paste, see https://play.nim-lang.org/#ix=3OFe" |
18:35:11 | FromDiscord | <tandy> no file |
18:37:14 | FromDiscord | <tandy> ive got this in nimble anyway `requires "prologue"`↵(@lantos) |
18:41:27 | FromDiscord | <auxym> In reply to @lantos "hmm, having some difficulty": https://play.nim-lang.org/#ix=3OFi |
18:41:51 | FromDiscord | <auxym> you could check the generated C and see that it uses pointers under the hood |
18:42:09 | FromDiscord | <tandy> just needed to update nimble lol |
18:44:30 | FromDiscord | <Phil> Sidenote, does anyone know off the cuff to check if a type has a given field? |
18:44:42 | FromDiscord | <Phil> In a way that returns a boolean |
18:44:50 | * | jjido joined #nim |
18:47:22 | FromDiscord | <auxym> only possible at compile time with a macro |
18:48:17 | FromDiscord | <Phil> hmmm not a compile time proc? |
18:49:52 | FromDiscord | <auxym> possibly. not super familiar with that stuff but maybe have a look at the implementation for this: https://github.com/beef331/constructor |
18:51:29 | FromDiscord | <lantos> In reply to @auxym "https://play.nim-lang.org/#ix=3OFi": oh haha, I actually way trying to use openArray[byte] before but I was getting an error like var openArray can not be known at compile time (iirc) |
18:51:54 | FromDiscord | <lantos> (edit) "(iirc)" => "(iirc),↵don't know what I did it must of been something weird but thanks" |
18:51:58 | FromDiscord | <lantos> (edit) "weird but" => "weird," |
18:56:57 | * | szahid quit (Read error: Connection reset by peer) |
18:59:14 | FromDiscord | <Phil> ... did I just crash play nim lang? |
18:59:35 | PMunch | @Phil, no, I took it down for maintenance |
18:59:43 | FromDiscord | <Phil> Phewwwwww |
18:59:46 | PMunch | Sorry about that |
19:00:09 | FromDiscord | <Phil> No worries, I was just playing around with some compile time stuff and suddenly nothing |
19:00:19 | FromDiscord | <Phil> Thought I found something crashable |
19:00:32 | FromDiscord | <Phil> Instapanic that I ruined it for everybody else xD |
19:02:12 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3OFz |
19:02:19 | FromDiscord | <Phil> Outputs:↵> true↵> false |
19:02:58 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=3OFz" => "https://play.nim-lang.org/#ix=3OFA" |
19:03:18 | FromDiscord | <tandy> nvm, still happening |
19:05:21 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
19:12:16 | FromDiscord | <ajusa> In reply to @tandy "nvm, still happening": you probably need to clear nim cache |
19:14:20 | FromDiscord | <tandy> nmm |
19:14:24 | FromDiscord | <tandy> how |
19:30:16 | * | vicfred joined #nim |
19:31:14 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix= |
19:41:16 | FromDiscord | <tandy> it keeps asking for this |
19:41:16 | FromDiscord | <tandy> \:( |
19:48:14 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3OFM |
19:48:34 | FromDiscord | <ajusa> (edit) "https://play.nim-lang.org/#ix=3OFM" => "https://play.nim-lang.org/#ix=3OFN" |
19:48:39 | FromDiscord | <lantos> 😮 is that a bad thing though? all /pkgs should be dl'd? |
19:49:04 | FromDiscord | <ajusa> Yeah it should be fine but it won't fix the issue, and it may be annoying to reinstall all the nimble packages |
19:50:35 | FromDiscord | <ajusa> Like if you've installed pixie, chronicles, and fidget you've probably got 100 packages installed. Reinstalling all of those (and the correct versions for your code if you don't have a .nimble) could take hours |
19:56:46 | NimEventer | New question by nonimportant: Out of Memory Error When Calling DLL function, see https://stackoverflow.com/questions/70992147/out-of-memory-error-when-calling-dll-function |
19:59:15 | FromDiscord | <Zajt> I don't quite understand the `-d` param to the nim compiler after checking the manpage, anyone wanna try to explian how you should use this one? |
19:59:19 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3OFP |
19:59:24 | FromDiscord | <Waldecir Santos> I'd like to create an "portuguese" channel in the language-specific group, who owns it ? |
19:59:37 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=3OFP" => "https://play.nim-lang.org/#ix=3OFR" |
20:00:56 | * | neurocyte0917090 joined #nim |
20:09:35 | FromDiscord | <tandy> well that helped↵(@ajusa) |
20:12:39 | FromDiscord | <ajusa> In reply to @tandy "well that helped (<@102899813149855744>)": Awesome! I've had to do that a couple times, not sure if there is a better way |
20:29:08 | FromDiscord | <Zajt> Is there a list of builtin compile-time symbols somewhere? |
20:30:02 | * | pro joined #nim |
20:32:45 | FromDiscord | <Phil> You can make any proc compile time with the compile time pragma, similarly for any variable with that pragma.↵Any variable assignment with a `const` also automatically happens at compile time |
20:33:28 | FromDiscord | <Phil> (edit) "pragma," => "pragma `{.compileTime.}`," |
20:33:56 | FromDiscord | <Phil> Or did you mean something else? |
20:35:38 | FromDiscord | <Phil> On an unrelated note, if anyone wants to take a look at this monster of a compile time proc, I'm very open to refactor suggestions.↵I just found that the proc in there works, I can't get any other version to work somehow: https://codereview.stackexchange.com/questions/273747/compile-time-check-for-validity-of-given-field-name |
20:36:32 | FromDiscord | <Phil> (edit) "somehow:" => "somehow. It's the proc from above, I just now posted it also to codereview SO because that is a large enough topic that I want to document whatever I learn from it" |
21:04:54 | * | krux02 joined #nim |
21:27:55 | * | jmdaemon joined #nim |
21:38:26 | * | vicecea quit (Remote host closed the connection) |
21:38:56 | * | vicecea joined #nim |
21:59:09 | * | jmdaemon quit (Ping timeout: 256 seconds) |
22:20:01 | * | jjido joined #nim |
22:20:41 | * | pro quit (Ping timeout: 256 seconds) |
22:49:08 | FromDiscord | <evoalg> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: I am reading in a file from https://github.com/fchollet/ARC/blob/master/data/training/a61f2674.json and doing https://play.nim-lang.org/#ix=3OGt like you taught me and it seems to work ... since it's a more complex json I dunno if using types is better or cleaner? ... but I'm happy it works as is 😀 |
22:52:35 | FromDiscord | <Elegantbeef> Types would probably be cleaner |
22:52:35 | FromDiscord | <evoalg> ok thank you! |
22:55:13 | PMunch | Hmm... /home/peter/.choosenim/toolchains/nim-1.6.2/lib/pure/times.nim(289, 29) Error: type mismatch: got 'int32' for '0 .. 999999999' but expected 'int' |
22:55:42 | PMunch | This is an annoying thing compiling for AVR.. |
22:57:52 | * | jmdaemon joined #nim |
23:01:05 | FromDiscord | <Elegantbeef> [evoalg](https://matrix.to/#/@evoalg:matrix.org)\: here's the type version |
23:01:05 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3OGy |
23:02:24 | FromDiscord | <evoalg> You're the best beefy! ❤️ |
23:33:32 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
23:35:57 | * | jmdaemon quit (Ping timeout: 240 seconds) |
23:37:36 | * | jmdaemon joined #nim |