00:00:04 | * | antranigv quit (*.net *.split) |
00:00:04 | * | cnx quit (*.net *.split) |
00:00:04 | * | FromDiscord quit (*.net *.split) |
00:00:05 | * | tinytoast quit (*.net *.split) |
00:00:05 | * | madprops quit (*.net *.split) |
00:00:05 | * | lumidify quit (*.net *.split) |
00:00:05 | * | acidsys quit (*.net *.split) |
00:00:05 | * | attah quit (*.net *.split) |
00:00:32 | * | FromDiscord joined #nim |
00:01:21 | * | madprops joined #nim |
00:01:25 | * | acidsys joined #nim |
00:01:48 | * | madprops quit (Changing host) |
00:01:48 | * | madprops joined #nim |
00:02:00 | FromDiscord | <Elegantbeef> You don't get data loss in procs, you just lose access to fields reasonably π |
00:02:15 | * | cnx joined #nim |
00:02:22 | * | antranigv joined #nim |
00:02:25 | * | attah joined #nim |
00:02:38 | * | tinystoat joined #nim |
00:03:50 | FromDiscord | <graveflo> not with refs yea but I'm saying that there is nothing wrong with either of those things happening as long as you understand what is possible. It would only be bad if the compiler believed it could access addresses that were out of segment |
00:03:59 | FromDiscord | <graveflo> ok I read your post but wtf is this: `MyOtherType[T] = distinct int` |
00:04:08 | FromDiscord | <Elegantbeef> What? |
00:04:19 | FromDiscord | <Elegantbeef> It's based off real code |
00:04:44 | FromDiscord | <Elegantbeef> You want to attach type information to a type but it's the same underlying tpye |
00:04:55 | FromDiscord | <Elegantbeef> https://github.com/beef331/truss3d/blob/master/src/truss3D/shaders.nim#L8-L9 |
00:05:23 | * | lumidify joined #nim |
00:05:41 | FromDiscord | <Elegantbeef> This is type safety so I cannot accidently do `seq[int].copyTo Ssbo[seq[float]]` |
00:06:47 | FromDiscord | <arathanis> see, having `Container[Y] is Container[X]` be false even if `Y is X` is true due to inheritance makes perfect sense to me |
00:06:53 | FromDiscord | <arathanis> and was what i expected was happening |
00:07:16 | FromDiscord | <arathanis> it was the fact that `Container[X] is Container[Y]` wound up being true that was confusing... |
00:07:41 | FromDiscord | <Elegantbeef> Sure but that's just cause it didnt error due to not being instantiatable |
00:08:23 | FromDiscord | <Elegantbeef> Actual usage resulted in an error |
00:08:32 | FromDiscord | <arathanis> oh ok, the failed instantiation made it basically be `Bar is Bar`? |
00:08:59 | FromDiscord | <arathanis> but when used outside the type system it breaks cause `ref Child` is not `ref Parent` as far as typedesc are concerned |
00:09:05 | FromDiscord | <Elegantbeef> So it's odd but it never would've impacted real code |
00:09:05 | FromDiscord | <Elegantbeef> No clue what happened |
00:09:06 | FromDiscord | <Elegantbeef> But if you attempted to instantiate that type it errored |
00:09:28 | FromDiscord | <arathanis> inheritance only applies to instances, when referring to typedesc they is distinct |
00:09:32 | FromDiscord | <arathanis> is that true? |
00:09:40 | FromDiscord | <arathanis> (edit) "is" => "are" |
00:09:54 | FromDiscord | <Andreas> @elegantbeef hi again, wrt. Kate - which is sadly not doing stuff for me, but with Katie came along a DBus to my system ? Can one do anything funny or productive with a DBus ? Do you have one, too ? |
00:09:56 | FromDiscord | <Elegantbeef> Perhaps though `[T: Parent]` works in proc |
00:10:37 | FromDiscord | <Elegantbeef> Sadly not on a dev machine presently so cannot say anything there |
00:17:26 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xWU |
00:18:28 | FromDiscord | <Elegantbeef> Right but you need to do a runtime check for every single instance of the table |
00:18:48 | FromDiscord | <graveflo> of course... |
00:18:51 | FromDiscord | <Elegantbeef> It's an `O(n)` check that's hidden in something that appears to be 0 cost |
00:19:17 | FromDiscord | <graveflo> no it doesn't this is just simple mechanics. That is needed because it is forced to be needed by the code |
00:19:20 | FromDiscord | <Elegantbeef> I never implied you'd be able to do it without runtime check |
00:19:39 | FromDiscord | <Elegantbeef> I was just explaining what's required |
00:19:55 | FromDiscord | <Elegantbeef> You need to walk the type tree and all instances that differentiate from `Child` to ensure they match |
00:20:03 | FromDiscord | <Elegantbeef> This requires a complex type walking mechanism |
00:20:47 | FromDiscord | <graveflo> dont you just need to check if its RTTI is `Parent` specifically? |
00:21:03 | FromDiscord | <Elegantbeef> Right, but you have to walk down the fields of `Table` |
00:21:33 | FromDiscord | <graveflo> this is the same issue with creating a `seq[RootOb]` no? |
00:21:41 | FromDiscord | <graveflo> (edit) "`seq[RootOb]`" => "`seq[RootObj]`" |
00:21:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4xWV |
00:22:16 | FromDiscord | <Elegantbeef> No clue I'm only talking that you have to walk down the entire type definition to ensure that it's converitble |
00:22:46 | FromDiscord | <Elegantbeef> Depending on the complexity of the type that's crazy |
00:22:58 | FromDiscord | <graveflo> you mean at compile time? Yea it has to traverse the whole tree |
00:24:11 | FromDiscord | <Elegantbeef> Yea I was just explaining the complexity required |
00:24:12 | FromDiscord | <Elegantbeef> I never one said it shouldnt/cannot be done |
00:24:12 | FromDiscord | <Elegantbeef> They acted like it was simple to implement, plus I just dislike them |
00:25:03 | FromDiscord | <graveflo> xD poor them.. Ok so this is just an issue of nim not evaluating the generic beyond 1 level |
00:25:13 | FromDiscord | <Elegantbeef> This isnt even an issue really |
00:25:24 | FromDiscord | <Elegantbeef> It's an unimplemented feature |
00:25:59 | FromDiscord | <graveflo> At that point its more of a semantic argument on definition bc nim can define what generics and inheritance means |
00:27:01 | FromDiscord | <graveflo> but using the most sensible definitions and expecting the compiler to interpret a situation in the most predicable way possible its incomplete at best |
00:27:32 | FromDiscord | <Elegantbeef> To have `T[Child] -> T[Parent]` you need to ensure the entire type tree does not change based off the two typesTo have `T[Parent] -> T[Child]` you need to do the above and do a conversion check for any instance of `Parent` the type tree has |
00:28:31 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4xWX |
00:28:47 | FromDiscord | <graveflo> the compiler should never let you do Parent -> Child implicitly thats just how inheritance works |
00:28:50 | FromDiscord | <krab4t> i think this bot talk too much on its own. probably chatgpt generator? |
00:29:16 | FromDiscord | <Elegantbeef> You need to check `a` `b.data` and `c.a` `c.b` `c.c` which rotates back and forth |
00:29:23 | FromDiscord | <Elegantbeef> I'm just a fucking NPC really |
00:29:49 | FromDiscord | <Elegantbeef> The compiler doesnt allow down casting implicitly π |
00:30:31 | FromDiscord | <Elegantbeef> The amount of people that come in here not realizing people exist astounds me |
00:31:01 | FromDiscord | <Elegantbeef> Even if it's done explicitly the above needs to happen |
00:31:11 | FromDiscord | <graveflo> ok so that way is not needed for any checks at compile time.. thats a user design problem and its well understood. I get the complexity you are talking about with traversing the definition trees but thats how inheritance is.. its branching complexity. This is what is expected in these situations |
00:31:33 | FromDiscord | <Elegantbeef> Well inheritance is simple generally |
00:31:43 | FromDiscord | <Elegantbeef> In type language |
00:31:56 | FromDiscord | <Elegantbeef> The complexity of inheritance is outside of this conversation |
00:33:09 | FromDiscord | <Elegantbeef> We're simply taking about the complexity of inheritable generic parameter type conversion, and whether Nim should do it |
00:33:17 | FromDiscord | <graveflo> right this is more of an issue with branching complexity from generics. When I was first asking questions here I was worried about the exact same thing. Now that I see that this pattern is avoided it makes sense why I was told that it wasn't an issue. Not that it's anyone's fault but Im js, yea, using inheritance with generics really does create situations where there are MANY variations |
00:35:02 | FromDiscord | <graveflo> but still when thinking about how the compiler could arbitrate these situations we are not talking about a very complex algo.. assuming the data structures are clean. Its just a branch and bound |
00:35:06 | FromDiscord | <graveflo> its not that bad |
00:36:25 | FromDiscord | <graveflo> like code linters do more in OOP langs |
00:37:20 | * | azimut quit (Ping timeout: 240 seconds) |
00:40:14 | FromDiscord | <Andreas> In reply to @graveflo "like code linters do": right, and do these OOP-langs come with Templates and Macro-facilities, too ? |
00:40:29 | FromDiscord | <krab4t> nlvm can't compile telebot.nim sadge |
00:41:40 | FromDiscord | <graveflo> In reply to @Andreas "right, and do these": yea usually, but it's not about lang vs lang or design vs design. I'm just saying that in terms of how "hard" and how efficient algos like this are.. We are not talking about a beast. It's just slightly more complicated then doing 1 check xD |
00:42:54 | FromDiscord | <Elegantbeef> You have to walk down every single type and field that derives from the generic parameter, it's not that bad. Just quite a lot of logic for object variants and friends |
00:43:22 | FromDiscord | <Elegantbeef> Does `std::vector<Child>` convert to `std::vector<Parent>` in C++? |
00:43:47 | FromDiscord | <graveflo> no idea I dont like C++ |
00:43:58 | FromDiscord | <Elegantbeef> Sure but it's a "OOP language" |
00:44:10 | FromDiscord | <Elegantbeef> Does it work in C#/Java? |
00:44:28 | FromDiscord | <graveflo> no its a bastardized OOP patch along with 100 other broken things in a soup of terrible syntax |
00:45:37 | FromDiscord | <graveflo> In reply to @Elegantbeef "Does it work in": idk I'll look into it. The point is that generics have the power to do this and it's a shame that they dont. I would be perfectly fine with nim being more powerful then X# and java |
00:45:52 | FromDiscord | <Andreas> In reply to @graveflo "yea usually, but it's": i guess linter support for OOP is moderate problem vs.linter-support for macros and other nim-goodies - thats hard to get right, and thats why i'd like a switch on nimsuggest to disable macro-support and stop crashing... |
00:45:53 | FromDiscord | <graveflo> (edit) "X#" => "C#" |
00:47:37 | FromDiscord | <graveflo> In reply to @Andreas "i guess linter support": yea it takes work to make a good thing. Nim still needs some work. I'd like to see it be the best it can be |
00:48:11 | FromDiscord | <graveflo> god now I have to remember how java works from my days at college ugh |
00:48:41 | FromDiscord | <krab4t> okay lets discover how to use http client in nim, in go its simply `http.Get(apiUrl)` |
00:48:59 | FromDiscord | <Elegantbeef> So this doesnt compile |
00:49:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/bA3tZ |
00:49:42 | FromDiscord | <Elegantbeef> Suffice to say if a OOP centric language like C# doesnt do this it's not the most important thing to support |
00:49:46 | FromDiscord | <Elegantbeef> It can of course support it, so PRs welcome π |
00:51:04 | FromDiscord | <krab4t> `client.getContent(url)` ? |
00:51:11 | FromDiscord | <Elegantbeef> Luckily a macro could be used for this conversion |
00:52:57 | FromDiscord | <graveflo> k gimme a sec you are really going to make me write java again |
00:53:32 | FromDiscord | <Andreas> In reply to @graveflo "yea it takes work": well, i like combining things, glueing stuff togester and recently i played with QuickJS. It can OOP in any flavour you like and it can use nim-data-types and libs if you need smth. fast... then last week there was this crazy-devil, who started to build a HTML-rendering engine with Nim and QuickJS - i'd rather wait for Servo and than use some nim-glue, but we'll see.. |
00:54:15 | FromDiscord | <Andreas> (edit) "togester" => "together" |
01:03:59 | FromDiscord | <krab4t> what equivalent for `sprintf` in nim? like `fmt.Sprintf` in go? |
01:05:29 | FromDiscord | <Andreas> In reply to @krab4t "what equivalent for `sprintf`": maybe this https://nim-lang.org/docs/strformat.html#%26.m |
01:07:19 | FromDiscord | <krab4t> it takes parameters for replacing %s, %i like sprintf? |
01:15:24 | FromDiscord | <Elegantbeef> No |
01:16:19 | FromDiscord | <Elegantbeef> you just do `echo fmt"{myVal}, {myOtherVal}"` |
01:16:37 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xX4 |
01:17:08 | FromDiscord | <krab4t> https://nim-lang.org/docs/strutils.html#%25%2Cstring%2CopenArray%5Bstring%5D |
01:18:48 | FromDiscord | <Elegantbeef> Yes `%` exists |
01:19:06 | FromDiscord | <Elegantbeef> But so does `fmt` |
01:22:39 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xX5 |
01:23:57 | FromDiscord | <graveflo> but we arent even talking about generics anymore. When generics are used in the wild they have a concrete type. We are only discussing the resolution in our convo. If you give a constraint of type `X` that means `X` or its sub classes for an inheritance model (`RootObj`) |
01:24:36 | FromDiscord | <Elegantbeef> So java supports it through the abhorrent `? extends Parent` |
01:25:31 | FromDiscord | <Elegantbeef> Well there are two conversations we had, firstly the one arath brought up secondly the implicit conversion of a generic type with a child type to the parent |
01:25:39 | FromDiscord | <Elegantbeef> My C# code was in reference to the latter |
01:25:50 | FromDiscord | <graveflo> I'm pretty sure you are convoluting "it" here. Even if you just kept is as a collection of `Parent` we are doing the same thing. All places where `Parent` is acceptable in a OO system `Child` is also acceptable |
01:26:29 | FromDiscord | <graveflo> implicit conversion in constraint resolution is not the same as a casting syntax |
01:26:45 | FromDiscord | <graveflo> Im sure c# has a way to do it to but that is only because it is a logically compatible form |
01:26:51 | FromDiscord | <Elegantbeef> Again two different conversation |
01:27:11 | FromDiscord | <Elegantbeef> C# doesnt implicitly or explicitly convert a `List<Child>` to `List<Parent>` |
01:27:41 | FromDiscord | <graveflo> oh well idk what I'm proving then anymore but yea. You can treat `Child` as `Parent` where ever `Parent` is acceptable as long as `Child` inherits `Parent` |
01:28:04 | FromDiscord | <Elegantbeef> `List<Parent> list2 = list` nor `List<Parent> list2 = (List<Parent>)(list)` works |
01:28:33 | FromDiscord | <Elegantbeef> I do not know if I agree that all `T[Child]` should be convertible to `T[Parent]` |
01:29:02 | FromDiscord | <Elegantbeef> You lose type safety if implicit conversions work |
01:29:13 | FromDiscord | <graveflo> why it must have all the faculties of `Parent` or there is something else wrong |
01:29:21 | FromDiscord | <graveflo> thats the whole point of inheritance |
01:29:38 | FromDiscord | <Elegantbeef> Having a generic parameter means you want to constrain things to that parameter |
01:29:48 | FromDiscord | <Elegantbeef> When you upcast a generic parameter you're losing static information |
01:30:04 | FromDiscord | <graveflo> no it means that the static information is deferred until it can be resolved |
01:30:10 | FromDiscord | <Elegantbeef> `seq[Child]` to `seq[Parent]` we've now lost informatio |
01:30:12 | FromDiscord | <graveflo> thats why nim errs when it cannot be resolved |
01:30:44 | FromDiscord | <krab4t> `identifier expected, but found 'httpWorker.asyncProc'` what this about? |
01:30:57 | FromDiscord | <Elegantbeef> "deferred until it can be resolved"? |
01:31:01 | FromDiscord | <graveflo> In reply to @Elegantbeef "`seq[Child]` to `seq[Parent]` we've": beef come on now. Not if its a ref RoobObj and even if it did work like that, as I said, this is a known thing. Ofc `Parent` == `Child` |
01:31:34 | FromDiscord | <graveflo> In reply to @Elegantbeef ""deferred until it can": yes all generics must resolve to a concrete type unless they are transient |
01:31:52 | FromDiscord | <Elegantbeef> I treat all inheritance as `ref` πβ΅(@graveflo) |
01:31:59 | FromDiscord | <Elegantbeef> The thing is you do lose static type information |
01:32:14 | FromDiscord | <graveflo> well I have to be specific bc Im not sure why it would be confusing otherwise |
01:32:48 | FromDiscord | <Elegantbeef> It's not confusing it's losing type information |
01:32:49 | FromDiscord | <graveflo> if you have code that is coupled to `Parent` not `Child` ofc you are operating in a context that is a subset of `Child` at most thats the whole point |
01:33:36 | FromDiscord | <graveflo> In reply to @Elegantbeef "It's not confusing it's": type information must be reclaimed at run time from RTTI if they have been manually made ambiguous this is obvious |
01:34:07 | FromDiscord | <Elegantbeef> Sure but we're not talking about RTTI |
01:34:24 | FromDiscord | <Elegantbeef> We're purely talking about at a type language level |
01:34:36 | FromDiscord | <Elegantbeef> `seq[Child]` -\> `seq[Parent]` is a loss of type information |
01:35:08 | FromDiscord | <graveflo> then there is no issue because `Parent` can only operate with other paths that are contained to `Parent` again this is the whole point of OOP you arent supposed to go back the other way statically its nonsense |
01:35:23 | FromDiscord | <graveflo> (edit) "contained" => "constrained" |
01:36:13 | FromDiscord | <Elegantbeef> consider `proc doThing[T](val: T, s: seq[T])` |
01:36:59 | FromDiscord | <graveflo> is that all? |
01:36:59 | FromDiscord | <Elegantbeef> if you do `Parent().doThing(seq[Child])` you type information and it doesnt error |
01:37:28 | FromDiscord | <Elegantbeef> I'm simply just saying I do not know if that's ideal |
01:37:55 | FromDiscord | <Elegantbeef> I still think just cause a generic parameter is inheritable does not mean that the data type should abide by inheritance |
01:38:20 | FromDiscord | <graveflo> it already works that way just on one level |
01:38:34 | FromDiscord | <Elegantbeef> "Just on one level"? |
01:38:37 | FromDiscord | <graveflo> In reply to @Elegantbeef "I'm simply just saying": What is ideal then? I don't understand why this is wrong |
01:38:54 | FromDiscord | <graveflo> In reply to @Elegantbeef ""Just on one level"?": yes I can constrain a generic to a type and its subclasses |
01:39:17 | FromDiscord | <Elegantbeef> How? |
01:39:24 | FromDiscord | <graveflo> but if a type inherits from that type it doesn't inherit the constraint? that makes no sense |
01:39:58 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xX7 |
01:40:10 | FromDiscord | <Elegantbeef> I just think that generic parameters are explicit type annotations and implicitly removing them is bad for the type system. Is that wrong? Who knows. Is it right? Who knows? |
01:41:10 | FromDiscord | <graveflo> well yea I think they shouldn't be removed too. Thats why the constraints should keep. Thats what I'm saying |
01:41:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4xX8 |
01:42:09 | FromDiscord | <Elegantbeef> the constraints should keep? |
01:42:15 | * | oldpcuser quit (Quit: restarting the X session) |
01:43:55 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xX9 |
01:44:05 | FromDiscord | <krab4t> okay i forgot to make proc public ... it happens all the time because in Go you just start with uppercase letter |
01:45:06 | FromDiscord | <Elegantbeef> grave given `var a: MyType[Child]` errors one of these have to be a bug π |
01:45:15 | FromDiscord | <Elegantbeef> Right Go makes the wrong choice |
01:45:32 | FromDiscord | <graveflo> In reply to @Elegantbeef "grave given `var a:": I've made a very strong argument that one is logical and the other is missing some functionality |
01:45:59 | FromDiscord | <krab4t> i prefer write `public` |
01:46:01 | FromDiscord | <Elegantbeef> I don't know if it's a strong argument |
01:46:26 | FromDiscord | <Elegantbeef> It's an argument, it's consistent atleast with other usages |
01:46:33 | FromDiscord | <Elegantbeef> But this is still unrelated to the conversion conversation |
01:46:42 | FromDiscord | <Elegantbeef> Two conversations twice the confusion |
01:47:18 | FromDiscord | <Elegantbeef> `typeof(a)` is not `MyType[Parent]` btw it's `MyType[Child]` |
01:47:50 | FromDiscord | <graveflo> well its all related. We are just going over the basics of what inheritance and in what situations things are compatible. The way I have explained it you can use compatibility when it makes sense and not when it doesn't |
01:48:09 | FromDiscord | <graveflo> In reply to @Elegantbeef "`typeof(a)` is not `MyType[Parent]`": yes it should be |
01:48:28 | FromDiscord | <graveflo> because it was made concrete |
01:48:40 | FromDiscord | <Elegantbeef> Except `var a: MyType[Child]` errors |
01:48:41 | FromDiscord | <Elegantbeef> So it's a wonderful hack |
01:48:42 | FromDiscord | <Elegantbeef> One of these two shouldnt work |
01:48:45 | FromDiscord | <Elegantbeef> I do not know which |
01:48:53 | FromDiscord | <graveflo> I do |
01:48:56 | FromDiscord | <graveflo> π |
01:49:04 | FromDiscord | <Elegantbeef> I am leaning to agree `MyType[Child]` is valid as it's consistent |
01:49:22 | FromDiscord | <Elegantbeef> but it still has 0 relation towards the conversion conversation |
01:49:31 | FromDiscord | <Elegantbeef> Since even if it works it does not mean anything about conversion |
01:49:37 | FromDiscord | <graveflo> ok perhaps |
01:50:04 | FromDiscord | <graveflo> yea I'm talking about nim doing something different or I would have nothing to say from the get go |
01:50:22 | FromDiscord | <graveflo> using the system in question isn't quite the best way to do this |
01:50:32 | FromDiscord | <Elegantbeef> Eitherway add this to yet another bug to your list of "things to learn to fix" π |
01:50:56 | FromDiscord | <Elegantbeef> Eh given Nim doesnt have a well defined spec using the system in question is the only way to approximate what should happen |
01:51:39 | FromDiscord | <Elegantbeef> If two things that should behave similar are behaving disimilar attempt to fix it in the way that is the most rational |
01:51:49 | FromDiscord | <Elegantbeef> Either Araq will say no and dismiss the PR or it'll be accepted π |
01:51:52 | FromDiscord | <graveflo> well I'm just saying we can use logic to ascertain what can happen and what the best way to express is |
01:52:37 | FromDiscord | <Elegantbeef> Well it's an inheretly flawed system and I'm an idiot so I just reason based off what works, and what I feel should work |
01:52:56 | FromDiscord | <graveflo> well same |
01:53:51 | FromDiscord | <Elegantbeef> Nim really needs the entire type system and generic ripped out and given to a typing expert to reimplement |
01:54:01 | FromDiscord | <Elegantbeef> So much could would stop working, but so much code would also start |
01:54:31 | FromDiscord | <graveflo> I'm tellin ya. The way nim does generics on procs is correct generally. It must be or itll segfault. The way it does inheritance + generics is wrong... bc I think core devs dont care about it... it can be fixed |
01:54:53 | FromDiscord | <Elegantbeef> Eh the entire generic/type system is in an awful state |
01:55:08 | FromDiscord | <Elegantbeef> Hacks ontop of hacks to get something resembling a functioning type system |
01:55:11 | FromDiscord | <graveflo> I believe you |
01:55:12 | FromDiscord | <krab4t> https://i.imgur.com/sISaWhj.png ??? |
01:55:25 | FromDiscord | <Elegantbeef> did you install jsony |
01:55:35 | FromDiscord | <Elegantbeef> Did you restart your language server after installing it |
01:55:46 | FromDiscord | <krab4t> yes and added it into nimble file |
01:56:23 | FromDiscord | <krab4t> what language server |
01:57:00 | FromDiscord | <Elegantbeef> You editor's tooling likely needs restarted when a package is added |
01:57:00 | FromDiscord | <Elegantbeef> your\ |
01:57:33 | FromDiscord | <krab4t> nimble said `Warning: Using project local deps mod` `Success: jsony installed successfully.` |
01:57:54 | FromDiscord | <Elegantbeef> Welcome to Nim, the tooling sucks |
01:58:03 | * | oldpcuser joined #nim |
01:58:31 | * | oldpcuser quit (Remote host closed the connection) |
01:59:01 | * | oldpcuser joined #nim |
01:59:48 | FromDiscord | <Elegantbeef> But sadly there is no other language that's as good as it π |
01:59:54 | FromDiscord | <krab4t> in go its isnt better, cgo can cache multiple GB outdated binaries, its just GoLand makes user experience better |
02:01:25 | FromDiscord | <krab4t> now its working https://i.imgur.com/LwJSwWQ.png jsony just dislikes be last |
02:07:47 | FromDiscord | <krab4t> https://transform.tools/json-to-go |
02:09:26 | FromDiscord | <krab4t> someone should make same webtool for nim |
02:18:01 | * | azimut joined #nim |
02:23:17 | FromDiscord | <krab4t> this how its should be done? https://pastebin.com/KecKYmEa no nested objects in nim? |
02:41:15 | FromDiscord | <krab4t> how to return Future[string]? just await str? |
02:47:46 | FromDiscord | <odexine> In reply to @krab4t "this how its should": Nim doesnβt have anonymous objects |
02:47:54 | FromDiscord | <odexine> Either make an object or use a tuple |
02:48:17 | FromDiscord | <krab4t> nvm i just forgot {.async.} |
02:51:02 | * | disso-peach quit (Quit: Leaving) |
02:51:26 | FromDiscord | <krab4t> hmm use what? |
02:55:23 | * | systemdsucks quit (*.net *.split) |
02:55:23 | * | NimEventer quit (*.net *.split) |
02:55:32 | * | systemdsucks joined #nim |
02:55:35 | * | NimEventer joined #nim |
03:08:18 | FromDiscord | <krab4t> veryPog if object has wrong type jsony just fails, i mean std/json raises error |
03:09:02 | FromDiscord | <bostonboston> sent a code paste, see https://play.nim-lang.org/#ix=4xXi |
03:09:25 | FromDiscord | <bostonboston> (edit) "https://play.nim-lang.org/#ix=4xXi" => "https://play.nim-lang.org/#ix=4xXj" |
03:09:32 | FromDiscord | <bostonboston> (edit) "https://play.nim-lang.org/#ix=4xXj" => "https://play.nim-lang.org/#ix=4xXk" |
03:53:11 | FromDiscord | <demotomohiro> What error message did you get? |
04:27:44 | * | azimut quit (Ping timeout: 240 seconds) |
05:35:54 | FromDiscord | <bostonboston> In reply to @demotomohiro "What error message did": "could not load lib "[name of dll]"" or similar (not at PC rn) as opposed to the bad format/differing architecture error |
07:37:42 | FromDiscord | <Marcus> Is there a way to resend the email confirmation on the nim forum? Apparently my link expired |
07:40:08 | * | ntat joined #nim |
07:45:16 | FromDiscord | <Marcus> I guess I have to change my email |
07:46:12 | FromDiscord | <Elegantbeef> A moderator can validate your account |
07:46:42 | FromDiscord | <Marcus> changing the email worked fine to get a new mail π |
07:47:04 | FromDiscord | <Marcus> (checked the sourcecode of the forum first) |
08:33:04 | termer | everyone has issues with the forum |
08:33:25 | termer | it's a meta joke to talk about things the forum is missing or has broken |
08:44:23 | * | pbsds quit (Quit: The Lounge - https://thelounge.chat) |
08:46:29 | * | pbsds joined #nim |
08:57:33 | Amun-Ra | changing email shouldn't be possible without clicking a link/etc. sent to the old one |
09:41:59 | * | disso-peach joined #nim |
10:20:55 | * | azimut joined #nim |
11:13:04 | * | junaid_ joined #nim |
12:05:27 | * | lucasta joined #nim |
12:05:36 | FromDiscord | <heysokam> sent a long message, see http://ix.io/4xYJ |
12:07:30 | FromDiscord | <tecknicalwarrior> sent a code paste, see https://paste.rs/54nw5 |
12:07:58 | FromDiscord | <tecknicalwarrior> The weird part is I only added a SPACE at the end of a string, that's it, before that the entire program compiled right |
12:08:35 | FromDiscord | <kots> ld.exe: cannot open output file C:\Users\jokej\OneDrive\Documents\Code\nim\main.exe: Permission denied |
12:08:39 | FromDiscord | <kots> make sure nothing is running or using main.exe |
12:08:41 | FromDiscord | <heysokam> ^ |
12:20:49 | FromDiscord | <TheFunkyWood> hi |
12:20:55 | FromDiscord | <TheFunkyWood> im quite new to the nim language |
12:21:08 | FromDiscord | <TheFunkyWood> how |
12:21:17 | FromDiscord | <TheFunkyWood> does anyone know any resorces to learn nim? |
12:22:54 | FromDiscord | <heysokam> @TheFunkyWood i learned with https://narimiran.github.io/nim-basics/ pretty decent to start |
12:23:23 | FromDiscord | <TheFunkyWood> interesting |
12:23:38 | FromDiscord | <TheFunkyWood> my end goal is to learn how to build a parser and lexer in nim |
12:23:41 | FromDiscord | <heysokam> the official docs also have 3 tuts, but imo that link is better for starting out https://nim-lang.org/docs/tut1.html |
12:24:08 | FromDiscord | <TheFunkyWood> yeah |
12:24:13 | FromDiscord | <TheFunkyWood> i looked at the official docs |
12:25:31 | FromDiscord | <heysokam> In reply to @TheFunkyWood "my end goal is": https://nim-lang.org/docs/parseutils.html you probably want this. or even use `lexerbase` for the advanced versionβ΅https://nim-lang.org/docs/lexbase.html |
12:26:20 | FromDiscord | <heysokam> imo, finish those two tutorials and then go back to the lexer goal. you will learn most of the requirements in the tutorial anyway |
12:26:23 | FromDiscord | <TheFunkyWood> In reply to @heysokam "https://nim-lang.org/docs/parseutils.html you proba": my main problem is that it really doesnt show me much about how its used |
12:26:45 | FromDiscord | <TheFunkyWood> In reply to @heysokam "imo, finish those two": id say im about equivalent to halfway through the tutorial skill wise |
12:26:51 | FromDiscord | <heysokam> yeah, because its raw docs. they are only useful when you already know what to do (aka the tut) |
12:27:13 | FromDiscord | <heysokam> specially the lexer/parser modules, they are super advanced and with little example docs |
12:27:33 | FromDiscord | <TheFunkyWood> im just slightly confused about when you would use macros and templates |
12:27:46 | FromDiscord | <heysokam> they are easy to use when you got the knowledge, but for starting out they are difficult to grasp. been there |
12:28:14 | FromDiscord | <TheFunkyWood> its not entirely about how to use them, mainly when to use them |
12:28:14 | FromDiscord | <heysokam> In reply to @TheFunkyWood "im just slightly confused": macros are for code generation. so programmatically writing what you write yourself |
12:29:26 | FromDiscord | <heysokam> templates are more about automatic code replacement. like placing some bit of code in other code, more than for metaprogramming (aka creating the code with a macro)β΅templates are basically a highly improved version of C preprocessor macros |
12:29:46 | FromDiscord | <TheFunkyWood> In reply to @heysokam "templates are more about": i dont know c... |
12:30:30 | FromDiscord | <heysokam> in general, you probably will not need a template unless you know what you are doing. they are only helpful for advanced code. using a proc will inline automatically when it can, so you cannot really outsmart the compiler when starting out in learning |
12:30:50 | FromDiscord | <heysokam> when you know how to use them, you will a lot. but dont worry about them yet |
12:31:08 | FromDiscord | <TheFunkyWood> ok |
12:31:39 | FromDiscord | <heysokam> In reply to @TheFunkyWood "i dont know c...": ah i see. C macros are just code expansion. what you write gets expanded into wherever you placed your macro. so the macro doesn't really exist when the compiler processes the file, it only places that bit of code in there |
12:31:52 | FromDiscord | <heysokam> templates are similar, but better functionality |
12:32:36 | FromDiscord | <TheFunkyWood> i think my problem is that ive learned the syntax of nim (python really helped me out there) but im not writing code in the most efficient way |
12:32:50 | FromDiscord | <TheFunkyWood> im basically writing my code like python but with different keywords |
12:33:12 | FromDiscord | <heysokam> regular nim is almost always efficient. its designed such that easy to read and idiomatic is the most efficient code to compile |
12:33:35 | FromDiscord | <TheFunkyWood> i mean writing |
12:33:36 | FromDiscord | <TheFunkyWood> it |
12:33:40 | FromDiscord | <TheFunkyWood> not running it |
12:33:49 | FromDiscord | <TheFunkyWood> im not taking advantage of nims unique features |
12:33:51 | FromDiscord | <heysokam> In reply to @TheFunkyWood "im basically writing my": that's how it should be. except for getting rid of the "everything is a string" mentality from python |
12:34:41 | FromDiscord | <heysokam> in advanced pything, everything is either a class or a dictionary of [string, string]β΅in nim, there are much better ways to deal with those things (modules, overloads and enums) |
12:34:49 | FromDiscord | <heysokam> (edit) "pything," => "python," |
12:35:04 | FromDiscord | <TheFunkyWood> yeah, too many classes in python |
12:35:24 | FromDiscord | <TheFunkyWood> and enums are awesome |
12:35:36 | FromDiscord | <heysokam> in nim you would replace those with `object`s, and implement functions that work on that custom type |
12:35:55 | FromDiscord | <heysokam> nim enums and overloads are literal gamechangers |
12:37:37 | FromDiscord | <TheFunkyWood> i was trying to find a chatgpt conversation |
12:37:47 | FromDiscord | <TheFunkyWood> where i asked it how to have classes in nim |
12:38:04 | FromDiscord | <heysokam> oof, chatgpt fails catastrophically with nim code |
12:38:08 | FromDiscord | <heysokam> also, oop is not needed in nim like at all |
12:38:15 | FromDiscord | <TheFunkyWood> In reply to @heysokam "also, oop is not": that was my mistake |
12:38:21 | FromDiscord | <heysokam> module imports + the type system is way better than classes |
12:38:56 | FromDiscord | <heysokam> overloads take care of name clashes, and you can encapsulate with module visibility and imports |
12:39:09 | FromDiscord | <TheFunkyWood> what are overloads? |
12:39:23 | FromDiscord | <heysokam> so the structure of the project becomes much more straight forward than class-for-everything stuffs |
12:41:47 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4xYN |
12:42:17 | FromDiscord | <heysokam> overloads are for having the same symbol name for two different things, and meaning two different things with them |
12:42:38 | FromDiscord | <TheFunkyWood> like, variable one and type one in that example? |
12:42:51 | FromDiscord | <heysokam> in python or cpp you would need a class, and call `myclass.someFunction()`β΅but here you can do that with the type system, no need for class abstractions |
12:42:58 | FromDiscord | <TheFunkyWood> oh |
12:43:01 | FromDiscord | <TheFunkyWood> the something |
12:43:05 | FromDiscord | <TheFunkyWood> that makes sense |
12:43:12 | FromDiscord | <TheFunkyWood> that is awesome |
12:43:21 | FromDiscord | <heysokam> literal gamechanger, im telling you |
12:43:47 | FromDiscord | <demotomohiro> C++ also have overloading |
12:44:07 | FromDiscord | <TheFunkyWood> In reply to @heysokam "literal gamechanger, im telling": why did you define a variable? |
12:44:13 | FromDiscord | <heysokam> yeah, i was just trying to represent the `.` syntax |
12:44:13 | FromDiscord | <TheFunkyWood> oh |
12:44:18 | FromDiscord | <TheFunkyWood> nvm im stupid |
12:44:29 | FromDiscord | <demotomohiro> overload allows same name procs with different type parameters. |
12:44:30 | FromDiscord | <TheFunkyWood> dont mind me |
12:44:31 | FromDiscord | <heysokam> In reply to @TheFunkyWood "why did you define": to be able to operate on the variable with the function, so it knows what to do |
12:44:36 | FromDiscord | <TheFunkyWood> In reply to @heysokam "to be able to": yeah |
12:44:39 | FromDiscord | <TheFunkyWood> i realised |
12:44:42 | FromDiscord | <TheFunkyWood> i was an idiot |
12:44:48 | FromDiscord | <TheFunkyWood> i forgot that one was a type |
12:45:15 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4xYP |
12:45:41 | FromDiscord | <TheFunkyWood> yeah |
12:45:45 | FromDiscord | <TheFunkyWood> im just an idiot |
12:46:05 | FromDiscord | <heysokam> no worries, just trying to give examples of the basics. no probl |
12:46:20 | FromDiscord | <TheFunkyWood> nim is amazing |
12:46:35 | FromDiscord | <TheFunkyWood> why is not even popular enough to be on the stackoverflow survey? |
12:46:49 | FromDiscord | <heysokam> its ergonomic as f. won't find another lang like that |
12:50:13 | FromDiscord | <heysokam> sent a long message, see http://ix.io/4xYR |
12:50:35 | FromDiscord | <heysokam> (edit) "http://ix.io/4xYR" => "http://ix.io/4xYS" |
12:51:02 | FromDiscord | <demotomohiro> In reply to @TheFunkyWood "nim is amazing": I think it is because most of people ask Nim questions here or on Nim forum and dont use stackoverflow much. |
12:51:21 | FromDiscord | <TheFunkyWood> In reply to @heysokam "my current understanding is": but honestly, if i was a python developer (the second most popular language) and i saw it had a similar syntax and was faster, that would be enough for me to give it a shot |
12:51:37 | FromDiscord | <heysokam> yeah, thats how i landed here myself too |
12:52:01 | * | junaid_ quit (Quit: leaving) |
12:52:18 | FromDiscord | <TheFunkyWood> i see it as similar to crystal |
12:52:36 | FromDiscord | <TheFunkyWood> no backing company |
12:52:38 | FromDiscord | <TheFunkyWood> obscure |
12:52:44 | FromDiscord | <TheFunkyWood> yet crystal's popular enough to be on the survey |
13:01:25 | * | junaid_ joined #nim |
13:04:40 | FromDiscord | <Benjamin> What language would you choose to implement an interpreter that needs to be compiled to Wasm? Real life use case. The person in charge is considering Zig. |
13:13:20 | FromDiscord | <heysokam> In reply to @Benjamin "What language would you": @elegantbeef was working on that for nim. don't know the state/progress on it |
13:13:54 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4xYX |
13:14:03 | FromDiscord | <heysokam> yep! i love that personally |
13:14:12 | FromDiscord | <odexine> In reply to @Benjamin "What language would you": That works too though |
13:15:07 | FromDiscord | <heysokam> In reply to @Benjamin "What language would you": https://github.com/beef331/wasm3 |
13:23:46 | * | junaid_ quit (Remote host closed the connection) |
14:09:48 | * | PMunch joined #nim |
14:45:37 | * | derpydoo quit (Read error: Connection reset by peer) |
14:55:19 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4xZs |
15:22:56 | * | azimut quit (Ping timeout: 240 seconds) |
15:26:00 | * | oldpcuser_ joined #nim |
15:28:32 | * | oldpcuser quit (Ping timeout: 248 seconds) |
15:30:31 | * | oldpcuser_ quit (Remote host closed the connection) |
15:31:12 | * | oldpcuser_ joined #nim |
15:36:46 | PMunch | Fun, reading an IEEE standard and it said it had a "computer program" in Annex A to perform some calculations for me. But it appears like it is written in BASIC or something like that.. |
15:36:48 | FromDiscord | <shalokshalom> How does Nim exhausivenes checks on unions these days? |
15:37:00 | FromDiscord | <shalokshalom> Did you settle on a pattern matching library, finally? |
15:37:06 | PMunch | What do you mean @shalokshalom? |
15:37:25 | FromDiscord | <shalokshalom> Guess you would say checks on object variants? |
15:37:46 | FromDiscord | <shalokshalom> In reply to @PMunch "What do you mean": Nim had no official pattern matching library, last time that I looked |
15:41:56 | PMunch | Still doesn't, but I'm not sure anyone has tried to push for any of the existing ones to become official |
15:42:38 | PMunch | And I'm still not sure what kind of checks you mean |
15:43:16 | PMunch | @heysokam, how do you try to run that code? |
15:44:09 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4xZX |
15:48:14 | PMunch | @michaelb.eth, generally I'd say a typedesc in an object is not a great idea, actually a bit surprised to see it work |
15:48:52 | PMunch | Nim doesn't have type information at runtime, which is why Spec is only valid in a const (as that is compile-time, you could also put it in a var marked with `{.compileTime.}`) |
15:49:22 | FromDiscord | <shalokshalom> In reply to @PMunch "And I'm still not": exhausivenes |
15:49:29 | FromDiscord | <shalokshalom> if all cases are fulfilled |
15:50:29 | PMunch | But in which scenario? |
15:51:21 | FromDiscord | <shalokshalom> what do you mean, in which scenario |
15:51:25 | FromDiscord | <shalokshalom> in pattern matching |
15:51:34 | PMunch | @michaelb.eth, you could probably do something like this: https://play.nim-lang.org/#ix=4y00 |
15:51:58 | PMunch | @shalokshalom, but as you said Nim doesn't have pattern matching.. The exhaustiveness check would be up to the pattern-matching library you use |
15:52:12 | FromDiscord | <shalokshalom> yepππ |
15:52:52 | FromDiscord | <michaelb.eth> In reply to @PMunch "@michaelb.eth, you could probably": thanks, will try to adapt that approach |
15:53:05 | PMunch | So what exactly is your question then @shalokshalom? :P I'm confused |
15:53:45 | FromDiscord | <shalokshalom> It seems still to be in fusion |
15:53:46 | FromDiscord | <shalokshalom> https://github.com/nim-lang/fusion/tree/master/src/fusion |
15:54:08 | FromDiscord | <shalokshalom> I was simply asking, if you have a default pattern matching library with exhausivenes |
15:54:10 | FromDiscord | <shalokshalom> that's all |
16:06:47 | FromDiscord | <jmgomez> @shalokshalom take a look at @JJ proposal https://github.com/nim-lang/RFCs/issues/525 β΅Anyways fusion is good enough in the meantime although it has that one issue where it cant be used inside a generic proc though π¦ |
16:07:09 | PMunch | @shalokshalom, aaah, that's what you where asking |
16:08:59 | PMunch | Trying to copy this basic code out so I can try and run it, of course the PDF has also introduced line breaks (yay..) |
16:11:48 | FromDiscord | <shalokshalom> thanks |
16:13:05 | FromDiscord | <shalokshalom> that PR looks very promising |
16:13:36 | FromDiscord | <shalokshalom> please dont kill it, offend the author or throw it out of the window, because you have a bad day π |
16:13:50 | FromDiscord | <shalokshalom> Andreas is meant. |
16:13:52 | FromDiscord | <shalokshalom> π |
16:17:46 | NimEventer | New thread by froeling: A question about the development and compatibility of Nim 2.0 and Nim 1.0, see https://forum.nim-lang.org/t/10265 |
16:18:14 | PMunch | @shalokshalom, have you seen Fungus by the way? |
16:18:41 | PMunch | The author of that PR has this to say at the end "Many thanks to fungus: which implements a near-identical union and quite similar match already as macros." |
16:19:15 | FromDiscord | <shalokshalom> oh, nice |
16:22:57 | FromDiscord | <jmgomez> In reply to @shalokshalom "Andreas is meant.": I think if James handles to make such a big PR it will be accepted. What I dont think that will hapen (and hope it doesnt TBH) is for Araq to implement it as even though it is great, there are more important things to tackle IMHO |
16:24:34 | FromDiscord | <fabricio> sent a code paste, see https://play.nim-lang.org/#ix=4y09 |
16:24:36 | FromDiscord | <michaelb.eth> @PMunch thanks a ton, the approach you suggested works great: no more compiler crashes with non-const instances of `Spec`, and it works with all versions of Nim back to 1.2β΅https://gist.github.com/michaelsbradleyjr/91c9283cc7bcfee8736c7e94f88a1c97 |
16:25:52 | FromDiscord | <voidwalker> sent a long message, see http://ix.io/4y0a |
16:26:17 | PMunch | @fabricio, not sure, might be a strange $ implementation somewhere |
16:26:47 | FromDiscord | <odexine> In reply to @fabricio "why does that code": typeof(<a typedesc>) == <that same typedesc> iirc |
16:26:58 | FromDiscord | <odexine> x.model is already a typedesc so |
16:27:20 | FromDiscord | <shalokshalom> In reply to @jmgomez "I think if James": Nim not having pattern matching is so often the reason why people stop considering the language in an instance |
16:27:32 | FromDiscord | <odexine> In reply to @shalokshalom "Nim not having pattern": well not really i would say |
16:27:44 | PMunch | Hard to tell for us isn't it |
16:27:47 | FromDiscord | <shalokshalom> not only because it's so fundamental, mostly because they go like "if it hasn't that, what else is missing" |
16:27:49 | FromDiscord | <jmgomez> Nah, plus it has |
16:27:50 | PMunch | Kind of a reverse selection bias |
16:27:59 | FromDiscord | <shalokshalom> Absolutely |
16:28:09 | FromDiscord | <shalokshalom> Great, that you are aware about that |
16:28:19 | FromDiscord | <jmgomez> There is another reason everyone knows, even you π |
16:28:23 | FromDiscord | <shalokshalom> This is hyper rare among programmers π |
16:28:25 | PMunch | Although I don't think I've ever heard anyone call it fundamental apart from in more math-based languages |
16:28:52 | FromDiscord | <shalokshalom> Well, when you come from imperative languages, sure |
16:29:04 | PMunch | @shalokshalom, haha it's easy to get siloed into your own paradigms |
16:29:15 | FromDiscord | <shalokshalom> But I live in the world of "math based languages" and so are all my colleagues |
16:29:26 | FromDiscord | <shalokshalom> and also my own arguments around a language |
16:29:36 | PMunch | What would you call those languages by the way? I guess functional wouldn't really apply to all of them |
16:29:38 | FromDiscord | <shalokshalom> filter bubble |
16:29:51 | FromDiscord | <shalokshalom> I would call them sane |
16:29:55 | FromDiscord | <shalokshalom> π
|
16:29:55 | FromDiscord | <jmgomez> Then again, Nim has pattern matching |
16:29:57 | FromDiscord | <!&luke> How can I draw a rotated square with pixie |
16:30:06 | FromDiscord | <shalokshalom> declarative is the word I like most |
16:30:11 | FromDiscord | <shalokshalom> expressive second |
16:30:22 | FromDiscord | <shalokshalom> functional third π |
16:30:43 | FromDiscord | <shalokshalom> In reply to @jmgomez "Then again, Nim has": well, in a library |
16:30:49 | FromDiscord | <shalokshalom> that is hardly maintained |
16:31:02 | FromDiscord | <shalokshalom> there is a reason, why stdlibs are a thing |
16:31:20 | FromDiscord | <jmgomez> "be the change you want to be in world" |
16:31:28 | FromDiscord | <shalokshalom> That PR seems rather well prepared |
16:31:31 | FromDiscord | <jmgomez> promote it to the std, oopen a RFC |
16:31:43 | FromDiscord | <shalokshalom> And Araq seems to just sit on their face and fart |
16:32:10 | FromDiscord | <shalokshalom> In reply to @jmgomez ""be the change you": Yes, Ghandi π |
16:32:25 | PMunch | He's busy with other stuff |
16:32:27 | FromDiscord | <shalokshalom> Do you know that Ghandi was a racist? π
|
16:32:37 | PMunch | I don't think algebraic data types are on top of his list |
16:32:43 | FromDiscord | <shalokshalom> In reply to @PMunch "He's busy with other": I guess. That's no reason to be aggressive |
16:32:46 | FromDiscord | <shalokshalom> say nothing |
16:32:47 | FromDiscord | <jmgomez> I dunno, but the fact that it can be kinda build (although not perfect) in user space, it's kinda amazing. Also, it has PM which was what you were complaining about in the first place |
16:32:48 | * | derpydoo joined #nim |
16:32:52 | FromDiscord | <shalokshalom> instead of something destructive |
16:33:13 | PMunch | Oh I didn't read the comments on that PR |
16:33:21 | FromDiscord | <shalokshalom> In reply to @jmgomez "I dunno, but the": I was complaining about the lack of standardized solution |
16:33:35 | FromDiscord | <shalokshalom> that is clearly used and endorsed by the community as a whole |
16:33:45 | FromDiscord | <shalokshalom> In reply to @PMunch "Oh I didn't read": Ah yeah π
|
16:33:54 | FromDiscord | <shalokshalom> Otherwise, no problem |
16:34:09 | FromDiscord | <shalokshalom> I think language maintainers do too much very often anyway |
16:34:21 | FromDiscord | <jmgomez> what about opening a RFC and asking to move fusion/case into the std now that's in being extracted from there core? |
16:34:37 | FromDiscord | <shalokshalom> One of the benefits of Nim is that it is a rather big and active community |
16:34:51 | FromDiscord | <shalokshalom> Compared to other languages, who have more public expose |
16:34:51 | * | oldpcuser_ is now known as oldpcuser |
16:34:54 | FromDiscord | <jmgomez> Im telling you this because it isnt the first time that I see you ask and wait for some else to take action |
16:35:09 | FromDiscord | <shalokshalom> I dont plan on using Nim |
16:35:24 | FromDiscord | <jmgomez> but yet you come here to complain on the missing features that you want to see π |
16:35:35 | FromDiscord | <shalokshalom> I iust point to it from time to time, since people ask me for a language and I think Nim could fit the bill |
16:35:48 | FromDiscord | <shalokshalom> And it's quite often "where is pm" oO |
16:35:57 | FromDiscord | <shalokshalom> that comes as an answer |
16:36:13 | FromDiscord | <shalokshalom> I also consider Araq and others to be quite toxic to communicate |
16:36:28 | FromDiscord | <shalokshalom> No fun bringing myself in such a situation |
16:36:33 | FromDiscord | <jmgomez> for the last time, it doesnt require much more energy to formally ask to include it in the std |
16:36:58 | FromDiscord | <shalokshalom> I dont think, fusion would be nessecarily what I want but it could be |
16:37:16 | FromDiscord | <shalokshalom> As you said, it would need to be maintained |
16:37:30 | FromDiscord | <shalokshalom> Who would maintain fusion? |
16:37:46 | FromDiscord | <jmgomez> if it made it into the std, the core devs |
16:37:48 | FromDiscord | <shalokshalom> Wasn't it the brainchild of Haxscramper? |
16:38:13 | PMunch | I would love for the ability to extend the syntax of a couple of things to macros. Like the `object`, `enum`, keywords. Why couldn't a `union` macro be implemented and then executed if it turns up there. Make it take a special argument like the ForLoop thing |
16:38:46 | PMunch | Same for `proc`, `func`, `template`, `macro`, I want to create my own ones :( |
16:40:10 | PMunch | Fun.. This old basic code has a missing label.. Some `GOTO` statements fail to compile because the label is missing.. |
16:46:09 | FromDiscord | <jmgomez> is that even possible with the current design of the compiler? |
16:47:19 | PMunch | No idea |
16:49:44 | FromDiscord | <demotomohiro> In reply to @ripluke "How can I draw": Probably this proc rotate what pixie draws: https://treeform.github.io/pixie/pixie/contexts.html#rotate%2CContext%2Cfloat32 |
17:04:10 | * | lucasta quit (Ping timeout: 260 seconds) |
17:05:03 | FromDiscord | <JJ> In reply to @jmgomez "<@208199869301522432> take a look": yes, it has feature-parity with fusion/matching @shalokshalom |
17:05:14 | FromDiscord | <haxscramper> In reply to @PMunch "I don't think algebraic": nobody is asking him to implement them, just give a clear signal of whether you want them or not for fuck's sake it has been half a decade already |
17:05:38 | FromDiscord | <haxscramper> if "no" then say "no", but at least give a reason |
17:05:44 | FromDiscord | <JJ> the main differences being the addition of a special union/wrapper type and the removal of a bunch of syntax |
17:06:01 | FromDiscord | <haxscramper> "what is the core devs opinion on pattern matching" -- nobody knows, each discussion is an endless drag |
17:06:08 | PMunch | @haxscramper, again I didn't read the actual comments |
17:06:47 | FromDiscord | <haxscramper> well I have time so I can actually quote some things that are not bad per se, but drag the thing into a whole different dimension entirely |
17:06:49 | FromDiscord | <JJ> given how i've seen araq reject rfcs in the past i got the impression he's mostly fine with it :-P |
17:07:06 | PMunch | I don't have time though, so I won't have time to read them here either |
17:07:16 | FromDiscord | <JJ> well, neutral or doesn't really care might be a better term |
17:07:33 | FromDiscord | <jmgomez> In reply to @apropos "given how i've seen": that's my impression too but I havent been around for too long |
17:07:56 | FromDiscord | <JJ> anyway i do want to look into the implementation but it's unfortunately at the bottom of my priority list right now |
17:07:57 | PMunch | Everything that goes into the standard library and compiler ends up with him eventually though. Got to make sure he doesn't break the feature, make sure that the syntax still works, etc. etc. |
17:08:08 | FromDiscord | <haxscramper> On Juan's listing of language compares -- "That doesn't mean much beyond the fact that people avoid dependencies for various reasons." -- yes, so what? What is the goal? Get the feature in the language or not? |
17:08:21 | FromDiscord | <haxscramper> Just stating the obvious, but now we are also discussing dependencies here |
17:08:36 | FromDiscord | <haxscramper> Next comment "You don't need to teach me about ML and Rust and Racket and Foozbaz, I know. You need to tell me why you found the existing solutions based on macros lacking." -- |
17:08:46 | FromDiscord | <haxscramper> what you found lacking -- well, yo just said it |
17:08:49 | FromDiscord | <haxscramper> people avoid dependencies |
17:08:49 | PMunch | You could ask him directly if he would accept a PR if someone implemented that RFC |
17:08:58 | FromDiscord | <JJ> union types are the Different part, i imagine the pattern matching part will be harder but i was also going to work from your prior art haxscramper |
17:09:24 | FromDiscord | <jmgomez> In reply to @PMunch "You could ask him": I do much more smaller things, but with stuff like lazy modules, virtual, constructors.. I just ask is this wanted and is this approach is correct? OC I dont expect anyone to implement anything... I tried to do it myself |
17:09:39 | FromDiscord | <haxscramper> Also this revulsing `case` statement cancer I just can't bear it but whatever |
17:09:48 | FromDiscord | <haxscramper> well ok I will ping on RFC |
17:10:05 | FromDiscord | <heysokam> In reply to @PMunch "<@186489007247589376>, how do you": `nim myfile.nims` afaik |
17:10:09 | FromDiscord | <JJ> yeah i'd prefer match/case but it's from haskell or whatever |
17:10:33 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
17:10:43 | FromDiscord | <JJ> the syntax aside from that is how i like it at least |
17:10:56 | FromDiscord | <shalokshalom> In reply to @apropos "yes, it has feature-parity": thats awesome ππ» |
17:11:11 | FromDiscord | <shalokshalom> love your library π |
17:13:32 | PMunch | @heysokam, I tried with `nim e myfile.nims` and it worked just fine |
17:13:46 | FromDiscord | <JJ> ha i wish it was a library! it's entirely unimplemented, just a proposal |
17:13:52 | FromDiscord | <shalokshalom> ah |
17:14:06 | FromDiscord | <shalokshalom> still, I like the library you are about to create π |
17:14:20 | * | Lord_Nightmare joined #nim |
17:14:48 | FromDiscord | <haxscramper> https://github.com/nim-lang/RFCs/issues/525#issuecomment-1586252053 well done |
17:14:53 | FromDiscord | <haxscramper> (edit) "well" => "well," |
17:15:04 | FromDiscord | <haxscramper> so basically two qs: yes/no in stdlib, yes/no in core lang |
17:15:19 | FromDiscord | <heysokam> In reply to @PMunch "<@186489007247589376>, I tried with": yeah i know. it works for me too in a separate file. but its something with the setup of this project |
17:15:35 | FromDiscord | <heysokam> thats why i was asking for how to debug nimscript |
17:15:36 | FromDiscord | <haxscramper> this is certainly under-clarified but IMO there needs to be more clarity in the decision-making process on this one, so here it is |
17:16:07 | FromDiscord | <shalokshalom> @haxscramper thing think |
17:16:12 | FromDiscord | <shalokshalom> typo in the first line |
17:16:26 | FromDiscord | <jmgomez> In reply to @shalokshalom "still, I like the": it isnt a library. It's integrated into the compiler |
17:16:34 | FromDiscord | <Phil> After getting marginally more of a grasp on the meaning of MVC beyond just web development, I feel like you really need to squint to see e.g. server-side-rendered webdev as MVC.β΅Though maybe I'm misinterpreting that. |
17:16:47 | FromDiscord | <Phil> (edit) "misinterpreting that." => "having the wrong understanding of MVC there." |
17:17:12 | NimEventer | New post on r/nim by h234sd: File Explorer in 20 lines of Nim | Mono UI, see https://reddit.com/r/nim/comments/146zh10/file_explorer_in_20_lines_of_nim_mono_ui/ |
17:22:15 | FromDiscord | <shalokshalom> In reply to @haxscramper "Also this revulsing `case`": I like the way Kotlin does it:β΅https://kotlinlang.org/docs/control-flow.html#when-expression |
17:22:26 | FromDiscord | <shalokshalom> its declarative and concise |
17:22:41 | FromDiscord | <shalokshalom> In reply to @jmgomez "it isnt a library.": well, not yet? |
17:22:47 | FromDiscord | <shalokshalom> fusion is |
17:23:14 | FromDiscord | <jmgomez> the proposal is about integrating union and PM into the compiler |
17:23:20 | FromDiscord | <shalokshalom> yep |
17:23:38 | FromDiscord | <shalokshalom> I assumed it already exists as a library |
17:26:47 | FromDiscord | <JJ> fusion and fungus exist as libraries, mine does not (and cannot afaik) |
17:26:55 | FromDiscord | <shalokshalom> ah |
17:32:37 | * | krux02 joined #nim |
17:33:07 | FromDiscord | <haxscramper> In reply to @shalokshalom "fusion is": no |
17:33:08 | FromDiscord | <haxscramper> unless they changed it fusion is just another library that is no different from everything else |
17:47:56 | FromDiscord | <michaelb.eth> I think I read one time about a thing you can do if you're exporting a macro and within that macro it makes reference to a symbol (maybe coming from a lib like std/typetraits) that you don't want to export |
17:48:09 | FromDiscord | <michaelb.eth> but now I can't find it |
17:48:37 | FromDiscord | <michaelb.eth> (edit) removed "now" | "find" => "remember where I read" | "I can'tremember where I readit ... " added "or what to search for" |
17:52:33 | madprops | https://i.imgur.com/InIet9o.jpg |
17:52:34 | madprops | hmm |
17:52:41 | madprops | using nim's argparser |
17:53:24 | madprops | parseopt |
17:53:46 | FromDiscord | <demotomohiro> In reply to @michaelb.eth "I think I read": It sounds like `bindSym`: https://nim-lang.org/docs/manual.html#macros-bindsym |
17:58:59 | FromDiscord | <michaelb.eth> In reply to @demotomohiro "It sounds like `bindSym`:": thank you, that's it! |
18:17:24 | * | azimut joined #nim |
18:24:24 | FromDiscord | <Spatchler> what does this error mean, and how might i fix it?β΅`SIGSEGV: Illegal storage access. (Attempt to read from nil?)` |
18:26:52 | FromDiscord | <graveflo> It means you are trying a null pointer access... in most cases |
18:36:50 | FromDiscord | <michaelb.eth> In reply to @Spatchler "what does this error": try a non-release build (which is the default, i.e. you don't specify `-d:release`) with `--linetrace:on --stacktrace:on`, then re-run the program |
18:37:25 | FromDiscord | <michaelb.eth> you may be able to get a better idea of where in you code the bad access is happening |
18:41:27 | PMunch | Hmm, we said that we would go dark on the subreddit on the 12th. But never specified a timezone.. |
18:42:57 | FromDiscord | <michaelb.eth> zulu time is a pretty good default |
18:43:35 | FromDiscord | <graveflo> or just be inclusive and do it for all timezones |
18:43:53 | PMunch | It's going dark for at least 48 hours |
18:43:56 | FromDiscord | <graveflo> I'm sure no one will be pissed if its a little off for them anyway |
18:44:42 | FromDiscord | <voidwalker> If I were reddit, I would piss on all this democracy and force open all reddits : D |
18:44:47 | FromDiscord | <voidwalker> (edit) "reddits" => "subreddits" |
18:45:30 | PMunch | They might still.. |
18:45:32 | FromDiscord | <graveflo> is this the rising of reddits new "great leader" |
18:47:07 | FromDiscord | <voidwalker> hey does anyone feel like guiding me with my sqlite/BLOB problem ? I am getting `Exception message: unrecognized token` with allographer, and it seems like the same bug manifests itself with db_sqlite from std, open for 6 years now. |
18:47:15 | FromDiscord | <voidwalker> (edit) "hey does anyone feel like guiding me with my sqlite/BLOB ... problem" added "inserting" |
19:18:23 | FromDiscord | <michaelb.eth> In reply to @voidwalker "hey does anyone feel": you might look into using https://github.com/arnetheduck/nim-sqlite3-abiβ΅you should be able to use it to insert blobs, but it's a wrapper for the raw C API, so you'll need to look at the docs for sqlite3 |
19:23:07 | * | disso-peach quit (Quit: Leaving) |
19:29:29 | * | Guest55 joined #nim |
19:29:56 | * | Guest55 quit (Client Quit) |
20:28:15 | * | PMunch quit (Quit: leaving) |
20:32:12 | * | derpydoo quit (Quit: derpydoo) |
20:59:27 | * | ntat quit (Quit: Leaving) |
21:09:27 | * | oldpcuser_ joined #nim |
21:12:01 | * | oldpcuser quit (Ping timeout: 255 seconds) |
21:15:51 | * | oldpcuser_ is now known as oldpcuser |
21:37:36 | * | derpydoo joined #nim |
21:48:34 | * | mal`` quit (Quit: Leaving) |
21:54:57 | * | mal`` joined #nim |
22:29:29 | * | oldpcuser_ joined #nim |
22:30:40 | * | oldpcuser quit (Killed (NickServ (GHOST command used by oldpcuser_))) |
22:30:42 | * | oldpcuser_ is now known as oldpcuser |
23:02:09 | * | oprypin quit (Quit: Bye) |
23:02:28 | * | oprypin joined #nim |
23:29:46 | FromDiscord | <graveflo> In reply to @heysokam "I've been working on": Looks cool, thanks for sharing your work |
23:44:30 | * | oldpcuser_ joined #nim |
23:46:40 | * | oldpcuser quit (Ping timeout: 260 seconds) |
23:47:33 | * | oldpcuser_ quit (Remote host closed the connection) |
23:48:00 | * | oldpcuser_ joined #nim |
23:58:33 | * | oldpcuser__ joined #nim |
23:59:48 | * | oldpcuser__ is now known as oldpcuser |