00:03:12 | * | vicfred joined #nim |
00:19:06 | FromDiscord | <retkid> Is there anyway I can program on my phone |
00:19:07 | FromDiscord | <retkid> Ugh |
00:19:10 | FromDiscord | <retkid> I just miss it |
00:19:15 | FromDiscord | <retkid> I need to practice |
00:20:35 | FromDiscord | <theangryepicbanana> In reply to @retkid "Is there anyway I": replit.com supports a (somewhat) recent version of nim |
00:21:07 | FromDiscord | <theangryepicbanana> the mobile code editor is really good |
00:21:26 | FromDiscord | <konsumlamm> ime, repl.it on mobile is horrible |
00:21:34 | FromDiscord | <theangryepicbanana> how long ago did you try it? |
00:21:40 | FromDiscord | <retkid> I can try it |
00:21:43 | FromDiscord | <konsumlamm> few months maybe |
00:21:50 | FromDiscord | <retkid> I’ll probably airplay it to my monitor |
00:22:06 | FromDiscord | <konsumlamm> entering a comma would repeat the input or some shit |
00:22:13 | FromDiscord | <theangryepicbanana> In reply to @konsumlamm "few months maybe": it's been getting worked on over the last several months (ik the person who's working on it) |
00:22:24 | FromDiscord | <theangryepicbanana> (edit) "worked on" => "improved" |
00:23:13 | FromDiscord | <theangryepicbanana> I use it on my phone sometimes and I haven't had any major issues |
00:23:17 | FromDiscord | <theangryepicbanana> (edit) "I use it on my phone sometimes and I haven't had any major issues ... " added "recently" |
00:25:33 | FromDiscord | <retkid> In reply to @theangryepicbanana "it's been getting improved": Why don’t you become a person working on it |
00:26:13 | FromDiscord | <theangryepicbanana> In reply to @retkid "Why don’t you become": I have been, just not specifically on the mobile controls (although that'll be fixed eventually anyways) |
00:26:47 | FromDiscord | <theangryepicbanana> (edit) "anyways)" => "anyways for reasons)" |
00:27:19 | FromDiscord | <theangryepicbanana> I can send a screen recording of me using nim on my phone if you want |
00:27:45 | FromDiscord | <retkid> I wanna learn how Nim compiled w JS n see if I can get some stuff working |
00:27:53 | FromDiscord | <retkid> Also Nim to Java compilation |
00:28:07 | FromDiscord | <theangryepicbanana> nim doesn't compile to java but sure lol |
00:28:25 | FromDiscord | <retkid> Compiles to C |
00:28:31 | FromDiscord | <retkid> Which can |
00:29:04 | FromDiscord | <theangryepicbanana> java doesn't compile to c |
00:29:39 | FromDiscord | <retkid> No you can compile to Java using weird tools |
00:29:41 | FromDiscord | <theangryepicbanana> But anyways here's the thing https://media.discordapp.net/attachments/371759389889003532/864302525863297034/video0.mov |
00:30:13 | FromDiscord | <theangryepicbanana> cut off a bit early at the end but eh |
00:30:19 | FromDiscord | <ElegantBeef> You could also use termux |
00:30:26 | FromDiscord | <theangryepicbanana> this works on ios too tho |
00:30:27 | FromDiscord | <ElegantBeef> But phone programming is scary |
00:30:39 | FromDiscord | <theangryepicbanana> nah |
00:30:47 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/864302801080680458/image0.png |
00:30:50 | FromDiscord | <retkid> Or I can try this |
00:30:55 | FromDiscord | <theangryepicbanana> I mean |
00:31:02 | FromDiscord | <theangryepicbanana> if you really want to go the hard way then sure |
00:31:23 | FromDiscord | <theangryepicbanana> oh did you meant testing java > nim separately from your phone thingy |
00:31:29 | FromDiscord | <theangryepicbanana> (edit) ">" => "->" |
00:31:50 | FromDiscord | <retkid> Kinda but this Linux stuff can’t really run in my phone or cloud |
00:32:07 | FromDiscord | <theangryepicbanana> no it'll work anyways |
00:32:15 | FromDiscord | <theangryepicbanana> replit doesn't run the code directly on your device |
00:32:31 | FromDiscord | <retkid> Ooo |
00:32:44 | fn | <ForumUpdaterBot99> New post on r/nim by shujidev: Create an object in a macro, see https://reddit.com/r/nim/comments/oj4bnz/create_an_object_in_a_macro/ |
00:32:48 | FromDiscord | <theangryepicbanana> it's run elsewhere (on a "cloud vm") and then it communicates with your phone like ssh or something |
00:32:49 | FromDiscord | <retkid> I wonder if I can get a Minecraft plugin to work |
00:32:56 | FromDiscord | <theangryepicbanana> yeah you can |
00:33:11 | FromDiscord | <theangryepicbanana> it's basically a virtual computer, even supports graphics and stuff |
00:33:25 | FromDiscord | <theangryepicbanana> that's why I can run nim on my iphone lol |
00:33:34 | FromDiscord | <retkid> I mean for jnim |
00:33:38 | FromDiscord | <theangryepicbanana> ah |
00:33:43 | FromDiscord | <theangryepicbanana> ig |
00:33:49 | FromDiscord | <retkid> Testing it on Minecraft won’t work haha |
00:34:17 | FromDiscord | <theangryepicbanana> you could technically run nim/java in minecraft lol |
00:34:21 | FromDiscord | <retkid> I also wanna see if I can get the Minecraft rending engine to render in an ascii pipe then play on terminal |
00:34:36 | FromDiscord | <retkid> In reply to @theangryepicbanana "you could technically run": Not for plugins tho I think those have to be Java |
00:34:49 | FromDiscord | <retkid> Think for mods you can use C binaries |
00:34:59 | FromDiscord | <theangryepicbanana> In reply to @retkid "Not for plugins tho": nah have you seen langcraft (or whatever it's called?) |
00:35:29 | FromDiscord | <theangryepicbanana> it's basically a version of llvm that compiles to minecraft datapacka |
00:35:30 | FromDiscord | <theangryepicbanana> (edit) "datapacka" => "datapacks" |
00:36:02 | FromDiscord | <theangryepicbanana> there's a video of someone running rust in minecraft, so I'm sure java/nim are possible ;) |
00:36:31 | FromDiscord | <retkid> I’m happy and sad to be alive in 2021 |
00:36:38 | FromDiscord | <theangryepicbanana> this came out last year |
00:36:42 | FromDiscord | <theangryepicbanana> maybe 2019 idk |
00:36:45 | FromDiscord | <theangryepicbanana> very pog tho |
00:36:54 | FromDiscord | <retkid> All the good ideas are taken but also I have to do no work |
00:37:13 | FromDiscord | <theangryepicbanana> lol |
00:44:23 | * | Figworm joined #nim |
01:05:39 | FromDiscord | <Rika> a person here tried running nim for minecraft before |
01:05:49 | FromDiscord | <Rika> i dont know if they still use the same name as before |
01:47:59 | FromDiscord | <theangryepicbanana> I think I asked about this yesterday, but has there been any work done to (at least partially) implement vtable types or converter typeclasses? |
01:48:24 | FromDiscord | <theangryepicbanana> (would this be a better question for #internals?) |
01:57:49 | FromDiscord | <Bung> Error: cannot 'importc' variable at compile time; pipe, why I cant call io related proc like execCmdEx in macro ? since the macro only returns ast |
02:00:17 | FromDiscord | <Elegantbeef> Do you mean call it from the emitted code or from the code ran inside? |
02:01:14 | FromDiscord | <Elegantbeef> The nim vm cannot call C code so use `gorge` or `staticExec` in place of `execCmdEx` |
02:10:46 | FromDiscord | <Bung> I mean inside macro body |
02:15:44 | FromDiscord | <Bung> nvm, give up |
03:07:48 | * | arkurious quit (Quit: Leaving) |
03:44:55 | FromDiscord | <theangryepicbanana> found this black magic. dunno if it still works https://forum.nim-lang.org/t/3642#22706 |
03:46:40 | * | rockcavera joined #nim |
03:46:40 | * | rockcavera quit (Changing host) |
03:46:40 | * | rockcavera joined #nim |
03:50:21 | FromDiscord | <Rika> Not recommended |
03:53:34 | FromDiscord | <theangryepicbanana> In reply to @Rika "Not recommended": why not? |
03:53:41 | FromDiscord | <theangryepicbanana> I don't care about overhead |
03:54:16 | FromDiscord | <Rika> Unsafe |
03:54:21 | FromDiscord | <Rika> Casting pointers to integers |
03:54:29 | FromDiscord | <theangryepicbanana> lol even better |
03:54:52 | FromDiscord | <theangryepicbanana> as long as it works without leaking too much memory, I don't mind |
03:55:05 | FromDiscord | <Rika> If you’re making a library, I advise against it |
03:55:09 | FromDiscord | <Rika> Otherwise whatever |
03:55:10 | FromDiscord | <theangryepicbanana> I'm not |
03:55:35 | FromDiscord | <Rika> Maybe look at the last link at the bottom of the page |
03:55:46 | FromDiscord | <theangryepicbanana> ok |
03:55:59 | FromDiscord | <theangryepicbanana> In reply to @Rika "Otherwise whatever": I'm, uh, compiling my language to nim in order to bootstrap it lol |
03:56:35 | FromDiscord | <theangryepicbanana> nim has pretty much everything I need except vtable types/interfaces |
03:58:09 | FromDiscord | <theangryepicbanana> my other solution was going to be abusing genericHead and concepts, but I like this more |
03:59:04 | FromDiscord | <theangryepicbanana> In reply to @Rika "Maybe look at the": bookmarked, will use as a backup |
04:02:52 | FromDiscord | <theangryepicbanana> oh imma assume neither of these will like generic virtual methods huh |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:38 | * | supakeen joined #nim |
05:00:55 | * | rockcavera quit (Remote host closed the connection) |
05:44:53 | fn | <ForumUpdaterBot99> New thread by Xioren: Don't understand macros compile error, see https://forum.nim-lang.org/t/8229 |
06:05:40 | * | stkrdknmibalz quit (Remote host closed the connection) |
06:22:37 | * | Vladar joined #nim |
07:07:53 | FromDiscord | <Bung> @ElegantBeef any news of nimscripter ? |
07:09:20 | * | neceve joined #nim |
07:10:23 | FromDiscord | <ElegantBeef> Nope |
07:13:23 | FromDiscord | <Bung> gotcha |
07:14:52 | FromDiscord | <haxscramper> Have you looked at compiler API? You can basically write a frontend for your language and reuse all the other compilation parts (like C/Js/C++ backend) while not having to go through intermediate files↵(@theangryepicbanana) |
07:15:04 | FromDiscord | <haxscramper> That you call compiler on later |
07:17:36 | FromDiscord | <haxscramper> And I think that "nim has pretty much everything I need except vtable types/interfaces ... so I'm going to generate nim code" sounds a lot like macros. I'm pretty sure someone mentioned this already but still |
07:22:57 | * | vicfred quit (Quit: Leaving) |
07:25:26 | fn | <ForumUpdaterBot99> New post on r/nim by dild0ge: Any tutorials for absolute beginners?, see https://reddit.com/r/nim/comments/ojak73/any_tutorials_for_absolute_beginners/ |
08:00:44 | * | max22- joined #nim |
08:14:20 | * | mahlon quit (Ping timeout: 256 seconds) |
08:15:46 | * | Vladar quit (Quit: Leaving) |
08:24:07 | * | mahlon joined #nim |
09:01:30 | * | pro joined #nim |
09:13:31 | * | xet7 quit (Remote host closed the connection) |
09:22:41 | FromDiscord | <bolino> Hi! Sorry for the stupid question. I couldn't find in the doc a good example of a function with an optional argument. |
09:22:57 | FromDiscord | <bolino> Hi! Sorry for the stupid question. I couldn't find in the doc a good example of a function with an optional argument. |
09:25:57 | FromDiscord | <bolino> sent a long message, see http://ix.io/3sPC |
09:26:19 | FromDiscord | <ElegantBeef> Well nim strings are not nilable |
09:26:42 | FromDiscord | <ElegantBeef> so it's just `size = ""` or `size: string = ""` |
09:27:17 | FromDiscord | <ElegantBeef> Do you want an `Option` or an optional argument? |
09:27:24 | FromDiscord | <ElegantBeef> They're two different things |
09:28:05 | FromDiscord | <bolino> Thanks. I guess I'm a bit confused between the two |
09:28:08 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/8Jk |
09:28:10 | FromDiscord | <haxscramper> If you want to use an option |
09:28:44 | FromDiscord | <ElegantBeef> Options are for having values that may or may not be present, a common case is having exceptionless error handling |
09:28:51 | FromDiscord | <ElegantBeef> They can be unpacked to get their internal value |
09:29:30 | FromDiscord | <ElegantBeef> Optional arguments are so you can just not include that parameter when calling so `proc a(huh = 30) echo huh` can be called `a(300)` or `a()` |
09:31:45 | * | max22- quit (Ping timeout: 276 seconds) |
09:31:48 | FromDiscord | <ElegantBeef> In the case that the return type is an `Option` you are supposed to do what hax shared where you check if it's some before doing `size.get` to retrieve that value |
09:36:23 | * | sidro_ joined #nim |
09:36:32 | * | sidro_ left #nim (Konversation terminated!) |
09:40:24 | FromDiscord | <bolino> Thanks! |
09:40:26 | FromDiscord | <bolino> Will try |
09:41:11 | * | xet7 joined #nim |
09:51:36 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @System64 "why do I have": Do you know why I have theses errors please? fg is already declared and used |
09:56:20 | FromDiscord | <Rika> probably the indentation level |
10:08:18 | * | pro quit (Quit: WeeChat 3.2) |
10:10:19 | * | pro joined #nim |
10:19:28 | FromDiscord | <bolino> If we want a function to return a string in some case, and nothing in other case, should the return type be `Option[string]`? |
10:19:58 | FromDiscord | <Rika> yes |
10:20:21 | FromDiscord | <bolino> ...and in that case, to return nothing, it should be `return some(nil)`? |
10:21:21 | FromDiscord | <bolino> (I thought it should be either `nil` or `some(string)`) |
10:21:26 | FromDiscord | <Rann> hey can ask here faster-than-requests install ? |
10:21:27 | FromDiscord | <Rika> none(string) |
10:21:54 | * | Vladar joined #nim |
10:22:03 | FromDiscord | <bolino> Haaaa `some(string)`. Gotcha. Thanks!!! |
10:22:36 | FromDiscord | <Rika> remove the thought of "nil" when you're working with options |
10:40:07 | FromDiscord | <Rann> Hey i try install the pack "faster-than-requests" but get ERROR: Could not find a version that satisfies the requirement faster-than-requests↵ERROR: No matching distribution found for faster-than-requests |
10:44:21 | FromDiscord | <System64 ~ Flandre Scarlet> I still have one error with fg https://media.discordapp.net/attachments/371759389889003532/864457215993839616/unknown.png |
10:46:18 | FromDiscord | <haxscramper> can you show definition of the `onInject` |
10:48:03 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/864458140178055168/unknown.png |
10:48:07 | FromDiscord | <System64 ~ Flandre Scarlet> it's a template |
10:49:20 | FromDiscord | <haxscramper> ffs, I'm sorry for salt overload, but can you just read the error then? It says "type mismatch for `instantiationInfo`" - so we can safely assume that you have it called somewhere. If we look at the line 27 we can clearly see that you are passing something to `onInject` that gets expanded to `instantiationInfo` |
10:49:24 | FromDiscord | <haxscramper> And it you pass something to instantnation info |
10:49:49 | FromDiscord | <haxscramper> Or more specifically you pass thing to `onInject` and it directly expands to `instantiationInfo` |
10:50:28 | FromDiscord | <haxscramper> And it gives you error for type mismatch, I think we can conclude that whatever you passed to instantiation info was not what it expected |
10:50:53 | FromDiscord | <haxscramper> Specifically, it wants `int` for a first argument (which it does say in the error message) |
10:51:00 | FromDiscord | <haxscramper> But you've passed `TLN_Tilemap` |
10:51:26 | FromDiscord | <haxscramper> Which it also says in the same error message, also showsing you that `fg` that you passed is of type `TLN_Tilemap` |
10:51:42 | FromDiscord | <haxscramper> And all of that happened on line 27, which is also provided by the error message |
10:51:56 | FromDiscord | <System64 ~ Flandre Scarlet> I thought it was for seeing the content of an object or something like that |
10:52:06 | FromDiscord | <haxscramper> Not the most readable form of the message, I can agree to that |
10:52:08 | FromDiscord | <haxscramper> But still |
10:52:54 | FromDiscord | <haxscramper> So I think you just need to remove `fg` argument from `onInject` |
10:54:00 | FromDiscord | <haxscramper> or at least don't pass it to the instantiation info |
10:54:14 | FromDiscord | <System64 ~ Flandre Scarlet> and I need to remove the "a" thing to the template? |
10:54:49 | FromDiscord | <haxscramper> yes |
10:55:05 | FromDiscord | <bolino> I guess I have another question! |
10:56:45 | FromDiscord | <bolino> I guess I have another question!↵If we want to pass an optional array arg2 to a function (meaning the function can work with or without the arg2 array), can we do `proc myFuntion(arg1: string, arg2: Option[array], arg3: string ="")` ? |
10:57:25 | FromDiscord | <haxscramper> yes, you can also do arg2\: array = \<some meaningful default value\>\` |
10:57:49 | FromDiscord | <haxscramper> most of the time you would want to just use some meaninful defaults instead of just `Option` |
10:58:06 | FromDiscord | <haxscramper> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/864460504814845953): yes, you can also do `arg2: array = <some meaningful default value>` |
10:58:10 | FromDiscord | <bolino> OK. Or an empty array like `arg2: array = array[]`? Then I'm not sure I know how to test if it's empty inside the function. |
10:58:47 | FromDiscord | <System64 ~ Flandre Scarlet> Interesting, I had an exception somewhere https://media.discordapp.net/attachments/371759389889003532/864460847546892308/unknown.png |
10:58:50 | FromDiscord | <haxscramper> 1. You can accept `seq[T]` and test it using `.len == 0`↵2. You can write a default value and avoid checking for thigns |
10:59:06 | * | max22- joined #nim |
10:59:34 | FromDiscord | <haxscramper> Can also inject printf call that uses `LINE` from C↵(@System64 ~ Flandre Scarlet) |
10:59:43 | FromDiscord | <haxscramper> `instantiationInfo` seems to be working in somewhat unexpected manner |
11:00:55 | FromDiscord | <System64 ~ Flandre Scarlet> why printing something with C? |
11:01:59 | FromDiscord | <System64 ~ Flandre Scarlet> ah still have random crashes so my try-excepts doesn't protect from them |
11:05:41 | FromDiscord | <haxscramper> `proc onInject() {.nodecl, importc: """printf("%d\n", LINE);//""".}` |
11:05:58 | FromDiscord | <haxscramper> Also can you just test code incrementally |
11:06:43 | FromDiscord | <System64 ~ Flandre Scarlet> it only occurs if I have the Raster Callback AND the Audio Callback enabled |
11:13:10 | FromDiscord | <System64 ~ Flandre Scarlet> aaah I understand, it prints the line number |
11:19:23 | FromDiscord | <Rann> In reply to @Rann "Hey i try install": someone ? its full track https://dpaste.org/CQnc#L |
11:19:55 | FromDiscord | <haxscramper> `> pip install ` |
11:19:56 | FromDiscord | <bolino> > 1. You can accept seq[T] and test it using .len == 0↵> 2. You can write a default value and avoid checking for thigns↵Yes, but the idea is to be able to pass the second argument, or not. Like `myFunc(arg1, arg2)` or `myFunc(arg1)` |
11:20:05 | FromDiscord | <haxscramper> Sorry but this is a nim server, not python |
11:20:23 | FromDiscord | <haxscramper> Which both solutions allow↵(@bolino) |
11:20:35 | FromDiscord | <haxscramper> `defaulted: seq[int] = @[]` |
11:20:50 | FromDiscord | <haxscramper> `if defaulted.len == 0: # we know it was defaulted` |
11:20:59 | FromDiscord | <haxscramper> `defaulted: array[3, int] = [1,2,3]`\` |
11:21:15 | FromDiscord | <haxscramper> WE DON'T CARE IF IT WAS DEFAULTED SINCE VALUE IS MEANINGFUL ANYWA |
11:22:08 | FromDiscord | <haxscramper> and I personally prefer to use latter one (especially over `Option[]`), since users don't have to slap `some` all over the place |
11:22:11 | FromDiscord | <bolino> Gotcha! |
11:22:48 | FromDiscord | <bolino> Better to use `Option` only for function returns then? |
11:22:48 | FromDiscord | <haxscramper> so sensible defaults is the best solutiopn |
11:23:11 | FromDiscord | <haxscramper> It depends on use case, but in short - yes, `Optino` is good for return |
11:23:21 | FromDiscord | <bolino> Okaye |
11:23:38 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/ikD |
11:23:56 | FromDiscord | <haxscramper> Since default value of the `AbsFile` is `""` which is an invalid state |
11:24:09 | FromDiscord | <haxscramper> Therefore I must explicitly say `Optional Absolute File` |
11:24:29 | FromDiscord | <haxscramper> But `forceBuild = false` is a perfectly fine default value, and `false` is a valid state for bool |
11:24:51 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3sQt |
11:25:39 | FromDiscord | <haxscramper> `CliCheck` is `ref` itself, and this is a user-facing function, so I decided to just default to `nil` instead of an `Option` |
11:26:06 | FromDiscord | <haxscramper> So users can write `opt(check = cliCheckFor(int))` where `cliCheckFor` just returns `CliCheck` - not option |
11:28:37 | FromDiscord | <haxscramper> sent a long message, see http://ix.io/3sQv |
11:29:47 | FromDiscord | <haxscramper> 2.1.1\: "argument type does not have valid default state" or default state make things ambiguous. Things like `""` that might be valid by themselves, but don't convey "default value" in the given procedure |
11:30:46 | FromDiscord | <haxscramper> 3. You can use other arguments in expressions for default values `proc(input: AbsFile, output: AbsFile = input.withExt("out"))` |
11:31:30 | FromDiscord | <konsumlamm> In reply to @theangryepicbanana "nim has pretty much": i mean, if you're just compiling to Nim, you don't need those as Nim language features, assembly doesn't have vtables/interfaces either and C++ compiles to it just fine↵you can look how other languages implement them (for example, interfaces (or more generally, multiple inheritance) can be dine by using composition) |
11:31:33 | FromDiscord | <haxscramper> That is - if you want to have a cheat-sheet for this, but again - it all comes down to concrete use case |
11:32:04 | FromDiscord | <haxscramper> Does that make any sense? @bolino |
11:33:17 | FromDiscord | <bolino> Yes |
11:33:25 | FromDiscord | <bolino> Totally |
11:34:43 | FromDiscord | <Rika> In reply to @konsumlamm "i mean, if you're": I think they just want an easy solution |
11:35:06 | FromDiscord | <haxscramper> Though this does not always work, sometimes you can get "environment lacks \<other argument name\>" and I'm not sure how to fix this |
11:35:45 | FromDiscord | <haxscramper> And don't forget function can be called with named arguments, but I'm sure you are aware of that. Like `someProc("positional", defaultedArg = "hello")` |
11:58:42 | * | max22- quit (Ping timeout: 272 seconds) |
11:59:52 | * | pro quit (Ping timeout: 256 seconds) |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:37 | * | supakeen joined #nim |
12:14:30 | FromDiscord | <theangryepicbanana> In reply to @konsumlamm "i mean, if you're": I specifically chose nim because of its type system, since it's the only language with a type system comparable to my own (which makes it easier to bootstrap my language since I can skip some typechecking) |
12:20:35 | FromDiscord | <theangryepicbanana> In reply to @haxscramper "Have you looked at": haxscramper: (idk if this will mention you on irc but eh) I kinda need Nim'a frontend though I think. Unless it has typechecking options/functionality, I'll need to keep targeting Nim itself because that's mainly why I'm doing so |
12:21:22 | * | xet7 quit (Remote host closed the connection) |
12:21:27 | * | Vladar quit (Quit: Leaving) |
12:22:18 | * | xet7 joined #nim |
12:25:34 | * | arkurious joined #nim |
12:27:20 | FromDiscord | <System64 ~ Flandre Scarlet> I noticed something weird↵If the audio callback produce an effect (printing something in the console, generating sound, ...) while the Raster callback is active, crash |
12:27:59 | FromDiscord | <System64 ~ Flandre Scarlet> and seems it's only when the audio callback produces an effect↵I tried with a variable assignement only, no crash |
12:28:20 | * | mal`` quit (Quit: Leaving) |
12:29:27 | FromDiscord | <konsumlamm> In reply to @theangryepicbanana "I specifically chose nim": what about Swift, C# or D? |
12:32:30 | * | Vladar joined #nim |
12:32:57 | * | mal`` joined #nim |
12:35:02 | * | mal`` quit (Excess Flood) |
12:36:12 | FromDiscord | <System64 ~ Flandre Scarlet> And I tried Nordaudio but the problem is, I have this error message https://media.discordapp.net/attachments/371759389889003532/864485360096903188/unknown.png |
12:39:34 | arkanoid | is it possible to define a polymorphic function type in nim? |
12:40:03 | FromDiscord | <System64 ~ Flandre Scarlet> a template I guess |
12:40:04 | arkanoid | I mean, how to "type" the function "func id[T](x: T): T = x" ? |
12:40:28 | * | mal`` joined #nim |
12:42:07 | arkanoid | I can write "type Fid = proc(x: int): int", but I need the generic type. Not sure if it is possible |
12:42:45 | * | xet7 quit (Remote host closed the connection) |
12:43:55 | * | xet7 joined #nim |
12:44:18 | arkanoid | nevermind, it was just "type Fid[T] = proc(x: T): T{.noSideEffect.}" |
12:46:15 | FromDiscord | <Bung> there's rfc about using func keyword like this |
12:47:17 | arkanoid | Bung, was that a quesion? |
12:47:35 | * | xet7 quit (Remote host closed the connection) |
12:47:54 | arkanoid | the compiler forces you to explicitly use proc+{.noSideEffect.} instead of func for function types |
12:48:12 | FromDiscord | <haxscramper> It can't find portaudio library↵(@System64 ~ Flandre Scarlet) |
12:48:17 | FromDiscord | <Bung> yeah, it's current behavior |
12:48:34 | FromDiscord | <Bung> might be change in future. |
13:00:17 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @haxscramper "It can't find portaudio": The dll is in the same folder than my code |
13:04:48 | FromDiscord | <konsumlamm> In reply to @theangryepicbanana "I specifically chose nim": what about Swift, C# or D? |
13:12:32 | FromDiscord | <theangryepicbanana> In reply to @konsumlamm "what about Swift, C#": swift doesn't have HKTs (higher-kinded types), and ref counting is also a bit of an issue. C# doesn't have complex generic constraints or HKTs, and D unfortunately doesn't support multiple inheritance |
13:13:05 | FromDiscord | <theangryepicbanana> like I could make D work, but it's probably more trouble than it's eorth |
13:13:08 | FromDiscord | <konsumlamm> Nim doesn't have HKTs either, does it? |
13:13:11 | FromDiscord | <theangryepicbanana> (edit) "eorth" => "worth" |
13:13:15 | FromDiscord | <theangryepicbanana> genericHead |
13:13:27 | FromDiscord | <theangryepicbanana> (& friends) |
13:13:41 | FromDiscord | <Rika> nim doesnt have multi inheritance either though? |
13:14:15 | FromDiscord | <theangryepicbanana> In reply to @Rika "nim doesnt have multi": as long as methods are a thing, I just need some form of interfaces |
13:14:33 | FromDiscord | <konsumlamm> uhh, that sounds like a horrible abuse of `genericHead` |
13:14:46 | FromDiscord | <theangryepicbanana> well that was gonna happen anyways lol |
13:15:21 | FromDiscord | <konsumlamm> In reply to @theangryepicbanana "as long as methods": D has interfaces and UFCS, so... |
13:15:53 | FromDiscord | <theangryepicbanana> In reply to @konsumlamm "D has interfaces and": yeah but interfaces can't have method bodies |
13:16:03 | FromDiscord | <theangryepicbanana> I also don't think D supports generic methods |
13:16:08 | FromDiscord | <konsumlamm> you mean default implementations? |
13:16:14 | FromDiscord | <theangryepicbanana> yeah basically |
13:16:16 | FromDiscord | <konsumlamm> why wouldn't it support generic methods? |
13:16:32 | FromDiscord | <theangryepicbanana> well, generic virtual methods |
13:16:43 | FromDiscord | <theangryepicbanana> same deal as c++ |
13:17:08 | FromDiscord | <Rika> nim doesnt exactly have hkts either though?? |
13:17:19 | FromDiscord | <theangryepicbanana> In reply to @theangryepicbanana "well, generic virtual methods": in nim they kinda work, which is better than not at all |
13:17:20 | FromDiscord | <Rika> as in you cant use a generic param as a type's head i believe |
13:17:46 | FromDiscord | <theangryepicbanana> In reply to @Rika "as in you cant": well also whichever other method lets you unpack a generic type |
13:18:02 | FromDiscord | <theangryepicbanana> either way, I can use more macros if necessary |
13:18:16 | FromDiscord | <Rika> i guess so |
13:18:46 | FromDiscord | <konsumlamm> In reply to @theangryepicbanana "genericHead": so how exactly does this work? instead of a HKT, you pass the type applied with some dummy type (e.g. `F[()]` instead of `F`) and then use `genericHead` on that? |
13:19:07 | * | rockcavera joined #nim |
13:19:07 | * | rockcavera quit (Changing host) |
13:19:07 | * | rockcavera joined #nim |
13:19:29 | FromDiscord | <theangryepicbanana> In reply to @konsumlamm "so how exactly does": something like that yeah |
13:19:53 | arkanoid | I'm doing some basic execises while reading a book about category theory. I need to type a function composition. How to fix the commented line? https://play.nim-lang.org/#ix=3sQU |
13:20:04 | FromDiscord | <theangryepicbanana> genericHead and stripGenericParams are basically what I need |
13:20:59 | FromDiscord | <konsumlamm> interesting, thanks for your explanations |
13:21:18 | FromDiscord | <theangryepicbanana> np |
13:21:50 | FromDiscord | <theangryepicbanana> here's a link to the lang if you're curious https://github.com/ALANVF/star |
13:22:30 | FromDiscord | <konsumlamm> thx |
13:22:36 | FromDiscord | <theangryepicbanana> you can think of the type system as a mix of c++20, scala 3, and nim (which is why it's difficult to typecheck lol) |
13:23:15 | FromDiscord | <theangryepicbanana> scala 3 would've worked if scala didn't have type erasure |
13:23:37 | FromDiscord | <konsumlamm> In reply to @arkanoid "I'm doing some basic": you want function composition... at the type level? do you know how this would work in something like Haskell (because i have no idea what you're trying to achieve here) |
13:25:12 | FromDiscord | <haxscramper> `> mix of c++20, scala 3, and nim (which is why it's difficult to typecheck`Considering your plans I think you need to have a standalone implementation |
13:25:21 | FromDiscord | <haxscramper> Instead of trying to mix things on top of nim system |
13:25:58 | FromDiscord | <haxscramper> I have a feeling it just be a constant bug hunt due to nim type system not being exactly how you would like it to be |
13:26:34 | arkanoid | konsumlamm, the thing I'm trying to achieve is very easy in haskell (I don't know haskell, but book examples are in haskell). I'm just at page 3 :D. In haskell is the dot operator, it works like the pipe in bash: you have two functions, you pipe them together so the final function takes the input of the first one and returns the output of the second one https://wiki.haskell.org/Function_composition |
13:26:50 | FromDiscord | <haxscramper> And nim type system is not really that sophisticated I think - no HKT, single inheritance, no structural/SFINAE typing like in C++ templates |
13:27:06 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=3sQX arkanoid |
13:27:08 | FromDiscord | <haxscramper> So it is not trivial as well, but |
13:27:54 | FromDiscord | <Rika> arkanoid please note that haskell's type system is much different from nim's... |
13:28:27 | FromDiscord | <konsumlamm> In reply to @Rika "arkanoid please note that": i just asked for the Haskell version because i'm familiar with it |
13:28:43 | arkanoid | Rika, thanks a lot. I do know that the type system is different, but I don't want to bend nim into haskell, just want to know how to improve my nim programming by using nim type system |
13:28:44 | FromDiscord | <konsumlamm> In reply to @haxscramper "And nim type system": Nim has no SFINAE? since when? |
13:28:50 | FromDiscord | <Rika> ok |
13:29:22 | FromDiscord | <haxscramper> Since when did it have SFINAE?↵(@konsumlamm) |
13:29:48 | FromDiscord | <haxscramper> `[T: not int]` is a generic narrowing IIRC, SFINAE refers to different way of picing overload candidates |
13:29:50 | FromDiscord | <konsumlamm> In reply to @arkanoid "<@312654963694108674>, the thing I'm": there's a difference between what you're doing and the thing you linked: you're just creating a type and no implementation for it |
13:30:21 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @System64 "The dll is in": I dunno if I missnamed it or if I should but the dll in another place or if it needs something else |
13:30:39 | FromDiscord | <konsumlamm> In reply to @haxscramper "Since when did it": you can substitute arbitrary types for (unconstrained) type parameters and only upon instantiation it is checked if the thing compiles, isn't that what SFINAE is? |
13:30:44 | FromDiscord | <haxscramper> SFINAE implies more parts of structural typing for templates, to allow for things like \`std\:\:enable\_if\<std\:\:is\_integral\_type\`\`\` |
13:30:53 | FromDiscord | <theangryepicbanana> In reply to @haxscramper "I have a feeling": probably, but even then I prefer nim because its macros are much more powerful than anything I could do in haxe (the lang I'm writing in) because it's a bit of a pain to do anything in haxe. also still has generic virtual methods, which is very rare lol |
13:31:05 | FromDiscord | <theangryepicbanana> In reply to @haxscramper "SFINAE implies more parts": that's what concepts are for |
13:31:20 | arkanoid | konsumlamm, sure, my exercise is about category theory so is all about thinking types first. The implementation comes later and may vary |
13:31:40 | FromDiscord | <konsumlamm> oh, so you're just trying to write down the type of the composition operator? |
13:32:51 | FromDiscord | <Rika> In reply to @theangryepicbanana "that's what concepts are": i dont think you can do what C++ can do just with concepts though? |
13:33:48 | arkanoid | konsumlamm, the type of the composition operator first, and then a generic composition operator later. But yeah, that's the point |
13:33:50 | FromDiscord | <konsumlamm> well, typeclasses can do this specific case, but in general Nim's (new-style) concepts are less powerful than C++ concepts i think |
13:34:10 | FromDiscord | <theangryepicbanana> In reply to @Rika "i dont think you": I think nim's concepts are actually more powerful than those in c++ |
13:34:18 | FromDiscord | <theangryepicbanana> wrong reply but eh |
13:34:20 | arkanoid | konsumlamm, consider that I am noob at functional programming, so is all about bending the way think about nim types |
13:34:49 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3sQY |
13:34:50 | FromDiscord | <Rika> idt this is possible |
13:34:59 | FromDiscord | <theangryepicbanana> it should be |
13:35:04 | FromDiscord | <Rika> well it isnt |
13:35:09 | FromDiscord | <Rika> (probably?) |
13:35:10 | FromDiscord | <Rika> therefore |
13:35:13 | FromDiscord | <Rika> no sfinae |
13:35:25 | FromDiscord | <theangryepicbanana> macro + typed + when should work then |
13:35:26 | FromDiscord | <Rika> (probably because ive never actually tested) |
13:35:32 | FromDiscord | <Rika> well that's not sfinae then |
13:35:44 | FromDiscord | <Rika> that's "manually doing sfinae" |
13:35:51 | FromDiscord | <theangryepicbanana> but I still think it's possible the other way |
13:36:14 | FromDiscord | <haxscramper> "Substitution Failure Is Not An Error"@konsumlamm) |
13:36:14 | FromDiscord | <haxscramper> So |
13:36:30 | FromDiscord | <haxscramper> So in short - I'm not sure if what nim does qualifies as SFINAE |
13:36:41 | FromDiscord | <haxscramper> concepts do something similar |
13:36:51 | FromDiscord | <haxscramper> Old concepts especally, with fields support and all that kind of stuff |
13:37:15 | FromDiscord | <haxscramper> But right now you can't put random constexpr in generic arguments |
13:37:18 | FromDiscord | <Rika> didnt araq say that new concepts can still express field existence? |
13:37:22 | FromDiscord | <haxscramper> To make it check for field existence say |
13:37:28 | * | tiorock joined #nim |
13:37:28 | * | tiorock quit (Changing host) |
13:37:28 | * | tiorock joined #nim |
13:37:28 | * | rockcavera is now known as Guest3116 |
13:37:28 | * | tiorock is now known as rockcavera |
13:37:37 | FromDiscord | <haxscramper> I think it was "we will implement this"↵(@Rika) |
13:37:46 | FromDiscord | <Rika> so it can, just unimpl |
13:37:46 | FromDiscord | <Rika> okay |
13:37:58 | FromDiscord | <haxscramper> ye, of course everyone would ask for that |
13:38:03 | FromDiscord | <konsumlamm> arkanoid: i think you just want `Composition[A, B] = Function[A, B] -> Fid[A] -> Function[A, B]` (curried) or `Composition[A, B] = (Function[A, B], Fid[A]) -> Function[A, B]` (uncurried) |
13:38:05 | FromDiscord | <haxscramper> Maybe it even works RN |
13:38:30 | * | Guest3116 quit (Remote host closed the connection) |
13:38:43 | * | rockcavera quit (Remote host closed the connection) |
13:38:45 | FromDiscord | <Rika> In reply to @konsumlamm "arkanoid: i think you": that doesnt look right to me, there should be three types shouldnt there? |
13:39:04 | FromDiscord | <Rika> three generic params i mean |
13:39:06 | * | tiorock joined #nim |
13:39:13 | FromDiscord | <haxscramper> Also an interesting one https://github.com/nim-lang/Nim/blob/devel/compiler/sigmatch.nim#L1980 |
13:39:29 | * | tiorock is now known as rockcavera |
13:39:30 | * | rockcavera quit (Changing host) |
13:39:30 | * | rockcavera joined #nim |
13:39:49 | FromDiscord | <konsumlamm> In reply to @Rika "that doesnt look right": if it's the type of the composition function, why would there be 3 parameters? |
13:40:14 | FromDiscord | <Rika> im trying to understand |
13:40:43 | FromDiscord | <Rika> it should take one `func[a,b] -> func[b,c] -> func[a,c]` no? |
13:40:51 | FromDiscord | <Rika> or am i mistaking something again |
13:41:38 | arkanoid | Rika, don't think so as the two types are function types |
13:41:49 | FromDiscord | <theangryepicbanana> In reply to @haxscramper "Also an interesting one": interesting |
13:41:56 | FromDiscord | <Rika> ah thats what you mean |
13:41:57 | FromDiscord | <Rika> okay |
13:42:09 | arkanoid | btw there's still something wrong then I try to implement a simple composition. Just try to run this: https://play.nim-lang.org/#ix=3sR0 |
13:42:10 | FromDiscord | <Rika> i still dont get it but ok |
13:43:55 | FromDiscord | <konsumlamm> In reply to @Rika "it should take one": oh right, this makes more sense, i thought the second argument was supposed to be `Fid[A]` |
13:44:26 | FromDiscord | <Rika> im still confused |
13:44:40 | FromDiscord | <Rika> ok wait no yeah i think what i said is correct |
13:50:43 | FromDiscord | <System64 ~ Flandre Scarlet> @haxscramper Do you know how can I solve this issue please? |
13:52:14 | FromDiscord | <haxscramper> no |
13:52:24 | FromDiscord | <haxscramper> install missing libraries somehow |
13:54:37 | * | max22- joined #nim |
13:55:59 | FromDiscord | <System64 ~ Flandre Scarlet> I dunno how I can install them |
13:58:59 | FromDiscord | <System64 ~ Flandre Scarlet> And there is nothing else than PortAudio and SDL2 for low level audio |
13:59:33 | * | max22- quit (Ping timeout: 276 seconds) |
14:05:37 | FromDiscord | <konsumlamm> In reply to @theangryepicbanana "I also don't think": i wanted to try it out (<https://run.dlang.io/is/IKEqUt>) and got a linker error lol |
14:13:19 | FromDiscord | <theangryepicbanana> In reply to @konsumlamm "i wanted to try": yeah I figured lmao |
14:18:29 | FromDiscord | <aleclarson> why can't subranges be backwards? https://play.nim-lang.org/#ix=3sRp |
14:18:52 | arkanoid | konsumlamm, I'm trying to follow your curried/uncurried compisition example, but I fear I'm not understanding it. Why Fid[A] comes into play? |
14:19:03 | FromDiscord | <Bung> can I get qualified name from typed arg in template ? |
14:19:17 | FromDiscord | <aleclarson> (edit) "https://play.nim-lang.org/#ix=3sRp" => "https://play.nim-lang.org/#ix=3sRp↵i can use `countdown` but the range syntax feels better \:P" |
14:21:12 | FromDiscord | <haxscramper> because it is not clear what correct semantics is↵(@aleclarson) |
14:21:35 | FromDiscord | <haxscramper> For example `for 0 .. someSeq.len - 1` currently iterates zero times |
14:22:13 | FromDiscord | <haxscramper> But with countdown it would iterate one time, giving `-1` value |
14:22:13 | FromDiscord | <haxscramper> You can overload `...` to make custom iterator for downcount |
14:22:17 | FromDiscord | <haxscramper> `getType`?↵(@Bung) |
14:22:46 | FromDiscord | <haxscramper> I'm not sure what do you mean by "qualified" thoug |
14:22:46 | FromDiscord | <haxscramper> `module.TypeName`? |
14:25:34 | FromDiscord | <Bung> eg. you get proc name want also get the module proc belongs |
14:26:34 | FromDiscord | <haxscramper> `.owner` is not explicitly exposed in the `std/macros` |
14:26:35 | FromDiscord | <konsumlamm> In reply to @arkanoid "<@312654963694108674>, I'm trying to": i misread the task, it should be `Function[B, C] -> Function[A, B] -> Function[A, C]` (curried) |
14:26:56 | * | xet7 joined #nim |
14:27:18 | FromDiscord | <haxscramper> You can try to `$` the type name and this might give you a module name |
14:27:45 | FromDiscord | <haxscramper> But in general macros can't go "up" in the semantic/syntactic tree |
14:28:08 | * | happycorsair[m] quit (*.net *.split) |
14:28:08 | * | fputs quit (*.net *.split) |
14:28:14 | FromDiscord | <haxscramper> You can't get field's owner, encolosing scope, procedure module and so on |
14:28:17 | FromDiscord | <haxscramper> And I think that's a good thing |
14:31:48 | FromDiscord | <Bung> ah, very clear. |
14:32:00 | * | xet7 quit (Remote host closed the connection) |
14:32:48 | FromDiscord | <Rika> In reply to @konsumlamm "i misread the task,": wait why is it backwards now |
14:32:50 | FromDiscord | <Bung> found another load routes. |
14:32:57 | FromDiscord | <Bung> another way |
14:35:34 | arkanoid | konsumlamm, I think I've succeeded in implementing a trivial example https://play.nim-lang.org/#ix=3sRz |
14:35:56 | * | fputs joined #nim |
14:37:58 | arkanoid | is it possible to declare generic lambda? |
14:38:09 | arkanoid | or generic anonymous function |
14:39:16 | FromDiscord | <konsumlamm> In reply to @Rika "wait why is it": because composition is backwards in math |
14:39:55 | FromDiscord | <konsumlamm> In reply to @arkanoid "is it possible to": not with the lambda (`=>`) syntax sugar |
14:40:17 | FromDiscord | <konsumlamm> you can try to do `proc[T](...)` |
14:49:48 | arkanoid | konsumlamm, seems not possible with anonymous functions: https://play.nim-lang.org/#ix=3sRC |
14:51:07 | FromDiscord | <konsumlamm> hmm, too bad |
14:52:02 | FromDiscord | <konsumlamm> ig variables can't be generic |
14:52:23 | FromDiscord | <konsumlamm> maybe it works when you're directly passing it |
14:52:43 | FromDiscord | <konsumlamm> but then you'd probably need to define it as a local proc, using normal syntax |
14:58:04 | arkanoid | konsumlamm, no problem, it's just ok to know that |
15:13:24 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3sS3 |
15:13:25 | FromDiscord | <aleclarson> is there a shorthand for max possible `int`? |
15:13:41 | FromDiscord | <haxscramper> `high(int)` |
15:13:58 | FromDiscord | <aleclarson> thanks |
15:17:40 | FromDiscord | <haxscramper> Running the same compiled binary under gdb does not raise any exceptions |
15:18:21 | FromDiscord | <haxscramper> Certainly not from `nimBoolToStr` |
15:18:21 | FromDiscord | <haxscramper> I forgot to include last part of the message - `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` (after `rawAlloc`) |
15:19:09 | FromDiscord | <haxscramper> Switching to `orc` does solve the issue, but I need to use `refc` because I haven't ported other parts to new runtime yet |
15:30:01 | FromDiscord | <Ayy Lmao> Does anyone know how to compile a .rc file with Nim? passC doesn't seem to work |
15:34:27 | arkanoid | konsumlamm, I've successful implemented the generic version of the function compose operator, problem is that the type generated by the generic function mismatch the type that should be https://play.nim-lang.org/#ix=3sSe |
15:36:06 | arkanoid | I'm also interested in hiding the "B" type value in the `|` compose operator |
15:39:08 | * | max22- joined #nim |
15:41:03 | FromDiscord | <konsumlamm> hmm, maybe a bug, maybe it's intended, idk |
15:41:20 | FromDiscord | <konsumlamm> Nim's type system isn't particularly good for that kinda stuff |
15:42:00 | FromDiscord | <konsumlamm> In reply to @arkanoid "I'm also interested in": i don't think that's possible or that it makes any sense |
15:44:23 | FromDiscord | <haxscramper> What is an rc file, and have you tried .compile.?↵(@Ayy Lmao) |
15:45:29 | arkanoid | konsumlamm, it's very possible, I feel like pushing nim type system beyond the nim requirements |
15:47:10 | FromDiscord | <konsumlamm> you probably are |
15:48:02 | FromDiscord | <Ayy Lmao> @haxscramper It is the way to describe window layouts and such in the windows API apparently. It's looking like I have to compile it with a special compiler and link compiled file |
15:51:18 | * | xet7 joined #nim |
16:04:02 | FromDiscord | <Ayy Lmao> After many many hours of fiddling around I finally got a popup window to open in a Reaper extension. The windows API is a pain |
16:05:38 | FromDiscord | <Ayy Lmao> Pretty cool though that it can be done with Nim, considering Reaper expects it to be done in C++. I don't know if any other languages are capable of this kind of feat |
16:07:57 | * | stkrdknmibalz joined #nim |
16:11:44 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
16:11:55 | FromDiscord | <Rika> only C++? no possibility to do so in C? |
16:12:40 | arkanoid | here's a minimal example of what is puzzling me: https://play.nim-lang.org/#ix=3sSJ |
16:13:45 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3sSL |
16:15:17 | FromDiscord | <Rika> seems so indeed |
16:19:51 | * | stkrdknmibalz joined #nim |
16:20:18 | FromDiscord | <Rika> arkanoid need to specify calling convention in pragmas `type Fid[A] = proc(x: A): A {.noSideEffect, nimcall.}` |
16:20:48 | FromDiscord | <Rika> (default is closure for proc types i believe?) |
16:20:49 | fn | <ForumUpdaterBot99> New thread by Giaco: Function type check of generic function, see https://forum.nim-lang.org/t/8230 |
16:21:50 | FromDiscord | <Bung> default closure |
16:21:51 | arkanoid | Rika, sorry I've pasted on the forum before reading your question. Let me check |
16:21:52 | FromDiscord | <Rika> arkanoid, are you giaco? |
16:21:56 | FromDiscord | <Rika> okay |
16:22:03 | arkanoid | it has been a matter of seconds |
16:22:13 | FromDiscord | <Rika> bung confirmed that default is closure for proc types |
16:22:24 | FromDiscord | <Rika> so yeah thats the cause |
16:22:43 | FromDiscord | <Rika> (top level procs are always nimcall unless otherwise specified) |
16:22:57 | FromDiscord | <Rika> but they cannot be closure ever i believe |
16:23:08 | FromDiscord | <TurtleP> sent a code paste, see https://play.nim-lang.org/#ix=3sSQ |
16:23:09 | arkanoid | yeah it works by specifying closure. I have to read what is this call convention thing |
16:24:32 | FromDiscord | <Bung> use `;` seperate your args |
16:25:53 | FromDiscord | <Rika> bung it should still work even with , |
16:25:54 | FromDiscord | <Rika> comma |
16:27:13 | FromDiscord | <Rika> and even with ; it doesnt seem to work |
16:28:10 | FromDiscord | <Rika> ah |
16:28:12 | FromDiscord | <Rika> i misred |
16:28:21 | FromDiscord | <Rika> you're missing a colon at the if statement |
16:28:25 | FromDiscord | <Rika> misread |
16:28:28 | FromDiscord | <TurtleP> oh ffs |
16:28:35 | FromDiscord | <Rika> lmao |
16:28:43 | FromDiscord | <TurtleP> .. why is it always the dumb stuff |
16:28:46 | FromDiscord | <TurtleP> 😅 |
16:28:48 | FromDiscord | <Rika> yeah same |
16:30:58 | FromDiscord | <Bung> okay |
16:33:08 | FromDiscord | <dom96> #CommaGangRepresent |
16:40:41 | FromDiscord | <Rika> i didnt notice the colon too, been coding in solely C for a while lately |
16:55:16 | * | stkrdknmibalz quit (Remote host closed the connection) |
16:57:11 | arkanoid | where are pushed and popped pragmas applied? Seems not applied to function type declarations: https://play.nim-lang.org/#ix=3sT2 |
17:19:29 | FromDiscord | <haxscramper> pushed pragmas are applied only to procedures |
17:27:55 | FromDiscord | <haxscramper> only to procedure declarations\ |
17:36:16 | arkanoid | thanks |
17:39:03 | arkanoid | I'm doing some experiments with nimcall and closure call conventions. It seems that it is quite messy to handle mixed calling conventions while playing with some functional programming concepts (default nim behavior) and it won't compile declaring all of them nimcall, but it will declaring all them as closure. What's the cons? |
17:40:21 | arkanoid | this goes agains the manual when it says "As a special extension, a procedure of the calling convention nimcall can be passed to a parameter that expects a proc of the calling convention closure." |
17:42:32 | arkanoid | here is where you find the relevant doc https://nim-lang.org/docs/manual.html#types-procedural-type |
17:43:30 | FromDiscord | <Rika> can you give an example of what "goes against the manual" |
17:49:29 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3sTy |
17:49:46 | arkanoid | I'm trying to reduce it to a minimal example. Do you know how to print the calling convention of a function? |
17:49:50 | arkanoid | it would help |
17:50:29 | FromDiscord | <haxscramper> Using `[]` explicitly works, but this is not a solution, since it looks extremely ugly - `[](1, 2 .. 3)` |
17:57:12 | FromDiscord | <gerwy> anyone here uses nim? |
17:57:20 | FromDiscord | <SolitudeSF> no |
17:58:04 | arkanoid | what is nim? |
18:20:23 | arkanoid | I'm going crazy writing a proc that converts a nimcall proc a a closure proc type |
18:22:56 | * | max22- quit (Ping timeout: 256 seconds) |
18:47:21 | FromDiscord | <ynfle (ynfle)> Why? What are you trying to do? |
18:49:27 | arkanoid | ynfle, I'm trying to to write test cases where I check if a generic nimcall proc is of type declared into type block as generic proc type |
18:50:42 | arkanoid | meanwhile, I've found this: https://github.com/nim-lang/Nim/blob/version-1-4/lib/system.nim#L1515 , why this? |
18:52:00 | FromDiscord | <ynfle (ynfle)> My guess for compiler magic |
18:52:24 | FromDiscord | <ynfle (ynfle)> I'm not quite sure what you mean. You want to know if a proc is generic? |
19:00:16 | arkanoid | ynfle, no, let me show you my current experiment, but before that I need to understand why here I'm getting none: https://play.nim-lang.org/#ix=3sTZ |
19:01:16 | arkanoid | "compose" and "|" are exactly the same generic total funtion, but the "type" function works only for one of them |
19:02:28 | * | max22- joined #nim |
19:03:48 | arkanoid | is this a bug? |
19:11:04 | FromDiscord | <Rika> A `|` exists in system |
19:11:17 | FromDiscord | <Rika> So basically nim cannot tell which you refer to |
19:11:33 | arkanoid | Rika, yes, here, and it is discarded https://github.com/nim-lang/Nim/blob/version-1-4/lib/system.nim#L1515 |
19:11:54 | arkanoid | I'm overriding it, and the test confirms that it works correctly |
19:12:12 | FromDiscord | <Rika> You're not, you're overloading it |
19:12:33 | FromDiscord | <Rika> There is a fine distinction |
19:12:55 | arkanoid | wait, you're right, on the last line I'm not submitting parameters |
19:13:01 | FromDiscord | <Rika> Exactly |
19:13:21 | arkanoid | how to point nim in the right direction without providing parameters? |
19:13:48 | arkanoid | the `|` is declared in the root of the module, why is it picking the discarded one? |
19:14:05 | FromDiscord | <Rika> It's not picking the discarded one and it's not actually discarded? |
19:14:15 | FromDiscord | <Rika> It's an empty bodied proc not a discarded proc |
19:14:46 | arkanoid | it is not? :| what's the point |
19:14:47 | FromDiscord | <Rika> And why would nim give priority to a certain proc? That sounds like subtle bug to me |
19:15:17 | FromDiscord | <Rika> I don't know, it's probably there for some reason |
19:15:30 | arkanoid | surely it is not picking the most obvious one |
19:15:33 | FromDiscord | <Rika> Used in template constraint as an or operator perhaps |
19:15:44 | FromDiscord | <Rika> It is no more obvious than the other proc |
19:16:27 | arkanoid | well, how can I point to the one declared in module in that echo line? |
19:18:15 | FromDiscord | <Rika> I do not think there is a way currently |
19:18:25 | FromDiscord | <Rika> I feel like araq discussed a solution before |
19:21:36 | arkanoid | interesting, but quite hard to track. Do you have any pointer? |
19:22:46 | arkanoid | in the meanwhile, I will just obviously change symbol (even if pipe was perfect for the job) |
19:30:25 | * | Helios quit (Read error: Connection reset by peer) |
19:30:26 | * | nixfreak_nim[m] quit (Read error: Connection reset by peer) |
19:45:10 | arkanoid | ynfle, here the code: https://play.nim-lang.org/#ix=3sUb , point is understanding how nim behaves when checking type of generic procs. As you can see you can map the type without the generic, but not with the generic params unless the call convention matches |
20:00:18 | * | neceve quit (Ping timeout: 276 seconds) |
20:10:23 | FromDiscord | <theangryepicbanana> has the syntax highlighting for nim in vscode always been this bad? |
20:10:33 | FromDiscord | <theangryepicbanana> I feel like it used to be a lot better |
20:12:55 | FromDiscord | <theangryepicbanana> like I was able to do this in about 5 minutes tf https://media.discordapp.net/attachments/371759389889003532/864600298794385418/unknown.png |
20:19:14 | FromDiscord | <reilly> In reply to @theangryepicbanana "like I was able": Is this the OG one or the saem one? |
20:19:53 | FromDiscord | <theangryepicbanana> In reply to @reilly "Is this the OG": it's the main one (with 44k downloads), but I edited the syntax highlighting file very briefly because it was terrible |
20:20:28 | FromDiscord | <theangryepicbanana> is there really no good highlighting for any of the nim extensions? |
20:20:34 | FromDiscord | <theangryepicbanana> 🤔 |
20:22:15 | FromDiscord | <reilly> Is saem's version not any better in that regard? That's the version I use, but I haven't bothered to compare the two, so I'm legitimately curious if it's any better. |
20:22:25 | FromDiscord | <theangryepicbanana> it's just as bad |
20:23:20 | * | def- quit (Quit: -) |
20:23:26 | FromDiscord | <reilly> Nim's tooling could really use some improvements, it seems. Not just syntax highlighting, either. |
20:23:34 | FromDiscord | <theangryepicbanana> yeah |
20:23:41 | FromDiscord | <theangryepicbanana> seems like a have another project ig |
20:23:44 | * | def- joined #nim |
20:24:08 | FromDiscord | <theangryepicbanana> (re: highlighting) |
20:25:32 | FromDiscord | <theangryepicbanana> one thing I'd look at is Haxe, which is a language with macro functionality similar to nim (minus templates). one thing that it does is integrate the LSP (autocompletion stuff) directly into the compiler/language so that it's easy to keep track of |
20:25:50 | FromDiscord | <theangryepicbanana> (edit) "one thing I'd look at ... is" added "for the tooling stuff" |
20:26:13 | FromDiscord | <theangryepicbanana> outside of LSP, it generally integrates that stuff into the compiler |
20:26:19 | FromDiscord | <theangryepicbanana> (edit) "outside of LSP, it generally integrates that ... stuff" added "kinda" |
20:26:51 | FromDiscord | <theangryepicbanana> (edit) "that kinda stuff" => "other tooling" |
20:27:16 | FromDiscord | <theangryepicbanana> anyways very pog |
20:29:45 | FromDiscord | <theangryepicbanana> oh yeah for reference on the thing earlier, I make syntax highlighting stuff as a hobby lol |
20:42:16 | * | rockcavera quit (Remote host closed the connection) |
20:53:00 | * | nixfreak_nim[m] joined #nim |
20:54:09 | FromDiscord | <jfmonty2> Any idea why storing threads and their args in an array works fine, but storing them in a seq causes my program to crash? |
20:54:09 | * | Helios joined #nim |
20:54:10 | * | happycorsair[m] joined #nim |
20:55:20 | FromDiscord | <jfmonty2> I know arrays are stack-allocated and seqs are heap-allocated, so maybe the thread has a pointer or something and then the seq gets moved? |
20:55:51 | FromDiscord | <ElegantBeef> If you're growing the seq a lot that could be it |
20:56:02 | FromDiscord | <ElegantBeef> Hard to say without seeing the code |
20:56:48 | FromDiscord | <jfmonty2> So what's the standard method for supporting a non-fixed number of threads? I can't just not store the thread anywhere because that causes it to crash too |
20:57:14 | FromDiscord | <konsumlamm> it should probably be reported as a bug, either way |
20:57:38 | FromDiscord | <ElegantBeef> I mean i use a seq for threads |
20:57:54 | FromDiscord | <ElegantBeef> I've done it multiple times |
20:58:02 | FromDiscord | <jfmonty2> I'm only putting 16 items into it, is that too many? |
20:58:07 | FromDiscord | <jfmonty2> one per logical cpu |
20:58:11 | FromDiscord | <ElegantBeef> It depends what you're doing |
20:58:23 | FromDiscord | <ElegantBeef> The thread sequence doesnt really matter since nothing should point at it |
20:58:50 | FromDiscord | <jfmonty2> that's what I was assuming |
21:00:15 | FromDiscord | <ElegantBeef> Do me a favour and try `--gc:orc` 😄 |
21:00:45 | FromDiscord | <ElegantBeef> I forgot i recently had refc crash my program with my threading but orc didnt |
21:00:55 | FromDiscord | <ElegantBeef> So super odd behaviour that probably needs an issue made 😄 |
21:01:11 | FromDiscord | <jfmonty2> hmm, well it gives me an IndexDefect now, where before it wasn't saying anything at all |
21:01:14 | FromDiscord | <jfmonty2> so... progress! |
21:01:25 | FromDiscord | <ElegantBeef> was it just a segmentation dump? |
21:01:44 | FromDiscord | <ElegantBeef> well segementation fault 😄 |
21:03:22 | FromDiscord | <jfmonty2> not sure, I can' quite figure out where this index defect is coming from because I'm not doing any indexing that I can see |
21:03:27 | FromDiscord | <jfmonty2> (edit) "can'" => "can't" |
21:05:19 | FromDiscord | <konsumlamm> we can't help you if we don't know your code |
21:06:05 | FromDiscord | <reilly> Put it on play.nim-lang.org, maybe? :) |
21:06:17 | FromDiscord | <jfmonty2> I can post a snippet but it won't run without the whole program, is that a problem? |
21:06:25 | FromDiscord | <jfmonty2> I guess I could mock the stuff that's actually doing the work |
21:07:37 | FromDiscord | <jfmonty2> does play.nim-lang do threading? |
21:08:19 | FromDiscord | <reilly> I can't speak for everyone, but I probably wouldn't run it on the site itself. I'd copy it to a file and run it on my own machine. |
21:08:33 | FromDiscord | <reilly> (After checking the code is safe-looking, of course ;) ) |
21:08:54 | FromDiscord | <reilly> (edit) "(After checking ... thelooks" added "that" | "is safe-looking," => "looks safe," |
21:09:26 | FromDiscord | <reilly> Especially for something complicated like threading, since I don't know what's going on behind the scenes on that site. |
21:10:04 | FromDiscord | <ElegantBeef> Well the site doesnt have the thread flag enabled so you couldnt run it there |
21:10:41 | FromDiscord | <jfmonty2> I do have it in a public repo, would that work? https://git.jfmonty2.com/jfmonty2/camelcup |
21:11:06 | FromDiscord | <reilly> In regards to what code to give us, ideally it'll be the minimum amount of code required to reproduce the problem. Trying to figure out what code you don't need to include may also help you track down the bug yourself. |
21:11:16 | FromDiscord | <ElegantBeef> Yea public repos are fantastic for helping |
21:11:18 | FromDiscord | <jfmonty2> er, needs the branch: https://git.jfmonty2.com/jfmonty2/camelcup/src/branch/threads |
21:11:32 | FromDiscord | <reilly> The whole repo gets the job done too, of course. |
21:11:43 | FromDiscord | <jfmonty2> I'll see if I can make a toy version work as well |
21:12:28 | FromDiscord | <jfmonty2> specifically it's `test.nim` that I've been trying to compile and run |
21:12:43 | FromDiscord | <jfmonty2> which imports most of the other stuff |
21:16:53 | FromDiscord | <jfmonty2> the threading all happens in `randomGames` in `simulation.nim` though, should have mentioned that as well |
21:18:01 | * | neceve joined #nim |
21:20:34 | * | rockcavera joined #nim |
21:20:34 | * | rockcavera quit (Changing host) |
21:20:34 | * | rockcavera joined #nim |
21:22:04 | FromDiscord | <jfmonty2> ok, toy example appears to be exhibiting the same behavior: https://play.nim-lang.org/#ix=3sUy |
21:26:32 | * | max22- quit (Quit: Leaving) |
21:31:47 | FromDiscord | <jfmonty2> Apparently storing the threads/args in arrays vs. seqs had nothing to do with it? I am now getting the same crash regardless of how I store them |
21:33:01 | FromDiscord | <ElegantBeef> Well one issue is the way you're doing this |
21:33:16 | FromDiscord | <ElegantBeef> Why are you adding threads? |
21:34:10 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=3sUE is a better way of doing it |
21:34:13 | FromDiscord | <jfmonty2> to speed up execution, since the problem is embarrassingly parallel |
21:34:31 | FromDiscord | <ElegantBeef> No i mean why are you adding threads to a seq instead of just making the seq the size you want 😄 |
21:34:40 | FromDiscord | <jfmonty2> oh 😛 |
21:34:44 | FromDiscord | <jfmonty2> becuase I'm used to Python I guess |
21:35:22 | FromDiscord | <ElegantBeef> Thread is a value type so it doesnt work the way you want and on devel actually has a compile time error due to the `=copy` being set to error |
21:36:21 | FromDiscord | <jfmonty2> ah ok, interesting |
21:37:11 | FromDiscord | <ElegantBeef> Though this doesnt work properly as it returns 48 😄 |
21:37:24 | FromDiscord | <ElegantBeef> Ah nvm |
21:37:39 | FromDiscord | <jfmonty2> that sounds right, 16 3? |
21:37:40 | FromDiscord | <ElegantBeef> Thought each thread ran independently didnt read |
21:37:51 | FromDiscord | <jfmonty2> nope sums em all up 😛 |
21:37:56 | FromDiscord | <ElegantBeef> Then yea |
21:37:58 | FromDiscord | <jfmonty2> I just did that because it more closely mimics what I'm really trying to do |
21:41:07 | FromDiscord | <jfmonty2> Interestingly if I get rid of the seq entirely (just create a new `Thread` every iteration) it crashes again |
21:41:22 | FromDiscord | <jfmonty2> Is that because the thread goes out of scope and is therefore dropped at the end of the iteration? |
21:43:49 | FromDiscord | <ElegantBeef> Seems so, since with orc it works sometimes but othertimes it crashes |
21:45:01 | FromDiscord | <ElegantBeef> I've not overly used threads much so am just suggesting have a single collection of threads be it an array or seq create threads into it |
21:45:41 | FromDiscord | <jfmonty2> Yeah, that seems to work best. |
21:45:53 | FromDiscord | <jfmonty2> I feel like the old saying about regular expressions applies even more so to concurrency |
21:46:10 | FromDiscord | <raid sponsored by kadybat + dei> sent a long message, see http://ix.io/3sUG |
21:46:14 | FromDiscord | <aryn> very cool |
21:46:15 | FromDiscord | <raid sponsored by kadybat + dei> sent a long message, see https://paste.rs/v59 |
21:46:18 | FromDiscord | <barton222> sad |
21:46:19 | FromDiscord | <raid sponsored by kadybat + dei> sent a long message, see http://ix.io/3sUG |
21:46:19 | FromDiscord | <bloatoo> CHAD |
21:46:21 | FromDiscord | <raid sponsored by kadybat + dei> sent a long message, see https://paste.rs/d6q |
21:46:24 | FromDiscord | <raid sponsored by kadybat + dei> @Chilla Chris@Chris3606@chrisw@Churros@citycide@cji@ClawS@Clops@Cloudperry@codescapade@codestorm@Condescending Giraffe@congusbongus@CookiShoos@cp@creatable@crispin@dabmlfz@dan@Daniel@Daniele@DanielVF@daredevelops@darkazer@Dat Boi@Dav1s@Davin@deech@DeltaPHC@deme@demotomohiro@Deorder (aka Komerdoor)@Dinho@djanatyn@djazz@dmoody256@Dobermann@Doctor Darkmantle@dom96@dorei@Dragon@drewp@DRS@Yardanico@ElegantBeef@aust9n@dr |
21:46:25 | FromDiscord | <raid sponsored by kadybat + dei> @Chilla Chris@Chris3606@chrisw@Churros@citycide@cji@ClawS@Clops@Cloudperry@codescapade@codestorm@Condescending Giraffe@congusbongus@CookiShoos@cp@creatable@crispin@dabmlfz@dan@Daniel@Daniele@DanielVF@daredevelops@darkazer@Dat Boi@Dav1s@Davin@deech@DeltaPHC@deme@demotomohiro@Deorder (aka Komerdoor)@Dinho@djanatyn@djazz@dmoody256@Dobermann@Doctor Darkmantle@dom96@dorei@Dragon@drewp@DRS@Yardanico@ElegantBeef@aust9n@dr |
21:46:25 | FromDiscord | <raid sponsored by kadybat + dei> sent a long message, see http://ix.io/3sUH |
21:46:27 | FromDiscord | <raid sponsored by kadybat + dei> @Chilla Chris@Chris3606@chrisw@Churros@citycide@cji@ClawS@Clops@Cloudperry@codescapade@codestorm@Condescending Giraffe@congusbongus@CookiShoos@cp@creatable@crispin@dabmlfz@dan@Daniel@Daniele@DanielVF@daredevelops@darkazer@Dat Boi@Dav1s@Davin@deech@DeltaPHC@deme@demotomohiro@Deorder (aka Komerdoor)@Dinho@djanatyn@djazz@dmoody256@Dobermann@Doctor Darkmantle@dom96@dorei@Dragon@drewp@DRS@Yardanico@ElegantBeef@aust9n@dr |
21:46:27 | FromDiscord | <raid sponsored by kadybat + dei> sent a long message, see https://paste.rs/AUP |
21:46:28 | FromDiscord | <raid sponsored by kadybat + dei> @Chilla Chris@Chris3606@chrisw@Churros@citycide@cji@ClawS@Clops@Cloudperry@codescapade@codestorm@Condescending Giraffe@congusbongus@CookiShoos@cp@creatable@crispin@dabmlfz@dan@Daniel@Daniele@DanielVF@daredevelops@darkazer@Dat Boi@Dav1s@Davin@deech@DeltaPHC@deme@demotomohiro@Deorder (aka Komerdoor)@Dinho@djanatyn@djazz@dmoody256@Dobermann@Doctor Darkmantle@dom96@dorei@Dragon@drewp@DRS@Yardanico@ElegantBeef@aust9n@dr |
21:46:29 | FromDiscord | <brainproxy> on noes, a spamtard |
21:46:29 | FromDiscord | <raid sponsored by kadybat + dei> @Chilla Chris@Chris3606<@!263737557685239808>@Churros@citycide@cji@ClawS@Clops@Cloudperry@codescapade@codestorm@Condescending Giraffe@congusbongus@CookiShoos@cp@creatable@crispin@dabmlfz@dan@Daniel@Daniele@DanielVF@daredevelops@darkazer@Dat Boi@Dav1s@Davin@deech@DeltaPHC@deme@demotomohiro@Deorder (aka Komerdoor)@Dinho@djanatyn@djazz@dmoody256@Dobermann@Doctor Darkmantle@dom96@dorei@Dragon@drewp@DRS@Yardanico@Elegan |
21:46:33 | FromDiscord | <Ahri Fox> NIM is based, dont spam here |
21:46:38 | FromDiscord | <creatable> kinda a bad raid ngl |
21:46:39 | FromDiscord | <raid sponsored by kadybat + dei> no nim sucks lol |
21:46:42 | FromDiscord | <bloatoo> lmao |
21:46:43 | FromDiscord | <barton222> lmao |
21:46:48 | FromDiscord | <! ! Reiter> lol |
21:46:49 | FromDiscord | <bloatoo> what a hustler |
21:46:51 | FromDiscord | <alehander42> /ban me |
21:46:57 | FromDiscord | <alehander42> hm howdo people |
21:47:01 | FromDiscord | <Canelhas> is this friendly or another crypto scam of some sorts? |
21:47:02 | FromDiscord | <alehander42> find the username so fast |
21:47:07 | FromDiscord | <aryn> tfw nim server has better raid prot than a 50k youtuber server lmfao |
21:47:21 | FromDiscord | <bloatoo> Didn't nim already get cancelled by vlang? |
21:47:21 | FromDiscord | <ElegantBeef> Well hey that raid might increase activity |
21:47:29 | FromDiscord | <ElegantBeef> In what way |
21:48:34 | FromDiscord | <theangryepicbanana> raid? |
21:48:35 | FromDiscord | <theangryepicbanana> pog |
21:48:53 | FromDiscord | <ache of head> Damn 6 pings |
21:48:57 | FromDiscord | <ache of head> Someone finally loved me |
21:49:21 | FromDiscord | <aryn> nope |
21:49:22 | FromDiscord | <aryn> raid |
21:49:24 | FromDiscord | <aryn> :KEKW: |
21:49:28 | FromDiscord | <ache of head> 😔 |
21:49:46 | FromDiscord | <tandy> lmao↵(<@864610352858660926>) |
21:51:13 | FromDiscord | <Ahri Fox> i mean, id at least want a more detailed critique of it rather than JUST some app notifications on discord... doesn't convince me yknow |
21:51:50 | FromDiscord | <ElegantBeef> Was that a raid for vlang? 😛 |
21:52:18 | FromDiscord | <theangryepicbanana> lmao |
21:52:40 | FromDiscord | <ElegantBeef> If so much like the language it was a piss poor attempt at it's goal |
21:55:03 | FromDiscord | <konsumlamm> rekt xd |
22:13:39 | * | systemds1cks is now known as systemdsucks |
22:34:10 | * | neceve quit (Ping timeout: 246 seconds) |
22:35:20 | * | Vladar quit (Quit: Leaving) |
22:36:40 | FromDiscord | <TurtleP> sent a code paste, see https://play.nim-lang.org/#ix=3sUV |
23:23:34 | FromDiscord | <ElegantBeef> Looks like an echo of a ref object |
23:23:58 | FromDiscord | <ElegantBeef> Well echo of a object that contains two ref objects |
23:28:31 | FromDiscord | <TurtleP> but none of my echo calls even do that |
23:28:43 | FromDiscord | <ElegantBeef> Are you using a library that emits a vTable? |
23:28:56 | FromDiscord | <TurtleP> maybe iface? |
23:29:02 | FromDiscord | <TurtleP> but I'm not echoing an object anywhere |
23:30:26 | FromDiscord | <ElegantBeef> then iface might be the reason it's happening |
23:44:01 | * | Guest32 joined #nim |
23:44:43 | Guest32 | How do you echo an OOP object? Like the kind that's a ref object of RootObj? |
23:45:07 | Guest32 | When I try, I get an error saying that there's no `$` |
23:45:13 | Guest32 | proc |
23:48:37 | FromDiscord | <ElegantBeef> you can do `echo refObject[]` which will echo the internal structure |
23:48:51 | FromDiscord | <ElegantBeef> But it's more suggested to define your own `$` operator |
23:49:59 | Guest32 | @ElegantBeef That worked, thank you! Yeah, I figured it would be better when the code is more solid, but for now I'm messing around trying to understand OOP objects in nim. |
23:50:37 | Guest32 | Thanks again |
23:50:41 | * | Guest32 quit (Quit: Client closed) |
23:50:53 | FromDiscord | <ElegantBeef> Yea all that does is dereference the ref object so you get the object, if you made the string operator using that in an object that is cyclical bad things would happen 😛 |