<< 20-07-2021 >>

00:09:11FromDiscord<Jakraes> Is there a way to return an array in a proc?
00:09:35FromDiscord<Jakraes> I'm trying to do like, proc x(): [bool, int]
00:09:57FromDiscord<RattleyCooper> I think the first parameter for arrays is the length
00:10:03FromDiscord<RattleyCooper> You might need `tables`?
00:10:10FromDiscord<Jakraes> Oh lemme check that out
00:13:29FromDiscord<RattleyCooper> Just depends on if you're trying to create an actual array or a set of key/value pairs
00:15:21FromDiscord<Jakraes> Yeah I just want to return an array with a bool and an int inside
00:17:14FromDiscord<RattleyCooper> I'm pretty sure I was trying to do something similar at one point and was told to use a custom object/type. There aren't multi-type arrays. You might be able to use something like `Dik`
00:17:38FromDiscord<RattleyCooper> https://github.com/juancarlospaco/dik
00:17:40fn<R2D299> itHub: 7"Table implemented as optimized sorted hashed dictionary for heterogeneous values"
00:17:57FromDiscord<RattleyCooper> Easier to make a custom object/type though
00:33:00FromDiscord<ElegantBeef> do you want ints or bools or int and bool?
00:33:39FromDiscord<ElegantBeef> if you want a bool and int together you could do `seq[(bool, int)]` but if it's int or bool best to use an object variant
01:07:05FromDiscord<dan> @ElegantBeef Didnt you do something with android ndk using the generated c files from nim?
01:07:15FromDiscord<dan> did that work out?
01:11:21FromDiscord<ElegantBeef> I mean i used the android.mk file that impbox made for nico, but yea
01:11:30FromDiscord<ElegantBeef> I've also ran nim on the rpi pico
01:13:28FromDiscord<dan> is that public?
01:17:21FromDiscord<ElegantBeef> Which part?
01:17:39FromDiscord<dan> ah sry, the android.mk
01:18:13FromDiscord<ElegantBeef> It's really just a "include all c files in X folder" but i can get it for you
01:18:56FromDiscord<dan> its more of the other stuff thats really interesting to me
01:19:05FromDiscord<dan> like includes flags etc
01:19:31FromDiscord<dan> if its parsed from the json or something
01:19:32FromDiscord<ElegantBeef> Well it's just outputting C to a folder then including it
01:19:41FromDiscord<ElegantBeef> https://hastebin.com/ehuqemohuj.makefile
01:19:52FromDiscord<ElegantBeef> That's the important part afaik
01:21:25FromDiscord<dan> 🤔 i cant quite make sense of how this is working
01:21:45FromDiscord<ElegantBeef> It's just including the c files to be included
01:21:51FromDiscord<dan> yes of course
01:22:02FromDiscord<ElegantBeef> So when ndk-build is called it compiles it as is
01:22:08FromDiscord<dan> but this does not consider anything that nim spits out about how it needs to be compiled
01:22:17FromDiscord<ElegantBeef> Cause it doesnt need to
01:22:30FromDiscord<ElegantBeef> Atleast i dont think so
01:22:40FromDiscord<dan> i somehow assumed it would
01:23:11FromDiscord<dan> did you use the nim dump command before?
01:23:28FromDiscord<ElegantBeef> Nah ` nim c -c --nimcache:android/app/jni/src/arm $(RELEASEOPTS) --cpu:arm --os:android -d:androidNDK --noMain:on --genScript ./src/main.nim`
01:23:32FromDiscord<ElegantBeef> Is the compile command
01:24:00FromDiscord<ElegantBeef> Worth noting that nico emits a `sdlMain` procedure which is what's called from the javaa
01:24:16FromDiscord<dan> what is the genScript for?
01:26:04FromDiscord<dan> https://tenor.com/view/thinking-interesting-hmmm-emoji-3d-gif-7838382
01:26:07FromDiscord<ElegantBeef> Emits a `.sh` for compiling, though dont know if it's used
01:27:47FromDiscord<dan> you think i should try and pester impbox about how this works? 🤔
01:27:53FromDiscord<ElegantBeef> If you want
01:28:07FromDiscord<ElegantBeef> He knows more than me in this regard i didnt touch it much
01:28:39FromDiscord<ElegantBeef> The pico work was easier since it had fewer layers of indirection 😄
01:32:04FromDiscord<dan> alright 😄 @impbox [ftsf] would you mind me picking your brain about some of the nico stuff?
01:43:28fn<ForumUpdaterBot99> New post on r/nim by PhotonicBlindness: Question from a C# guy. If anyone here worked with C# , how would you compare the 2., see https://reddit.com/r/nim/comments/ons89i/question_from_a_c_guy_if_anyone_here_worked_with/
01:43:58*kayabaNerve_ quit (Remote host closed the connection)
01:44:23*kayabaNerve_ joined #nim
01:53:06*kayabaNerve_ quit (Ping timeout: 255 seconds)
02:00:40FromDiscord<creonico> Hey, so I watched a video saying that rust is memory safe without a garbage collector, and it made me wonder if nim can also be memory safe without a garbage collector
02:01:36FromDiscord<dan> now that i can answer without knowing too much about nim
02:02:06FromDiscord<dan> nim does have a garbage collector and any language can be memory safe
02:02:30FromDiscord<dan> really depends on your code
02:11:24FromDiscord<ElegantBeef> Well rust uses a similar memory management method to Nim's Arc, which is what they mean by "no GC" afaik
02:11:52FromDiscord<ElegantBeef> So if you use the strict not nil annotation you can get similar memory safety
02:12:40FromDiscord<ElegantBeef> Remember that rust doesnt give nil, so just by making sure you cannot have nil you get a fair bit of memory safety
02:17:39FromDiscord<ElegantBeef> So nil aside you can say using the same definition of GC that rust does that Nim's orc is "memory safe without a garbage collector" 😄
02:18:07FromDiscord<@bracketmaster-5a708063d73408ce4> I'm writing a library in Nim. How can I have a file withing the `src` directory echo the name of the library?
02:18:52FromDiscord<generic linux user> like ehen you launch it?
02:19:01FromDiscord<generic linux user> confusing question tho
02:22:17FromDiscord<@bracketmaster-5a708063d73408ce4> well... more when I run a function in the library
02:22:59FromDiscord<generic linux user> so when someone uses your lib, it will print that this uses your library?
02:23:13FromDiscord<@bracketmaster-5a708063d73408ce4> yes
02:23:22FromDiscord<@bracketmaster-5a708063d73408ce4> I know it sounds silly - but I have reasons
02:23:45FromDiscord<ElegantBeef> Well you could make a macro that inserts a `echo "Using library X"` in the proc statement list
02:24:25FromDiscord<@bracketmaster-5a708063d73408ce4> yeah - I'm just wondering if there is a library define or something
02:28:31FromDiscord<ElegantBeef> It's an odd want inserting calls to all procedures from a specific module
02:30:57FromDiscord<@bracketmaster-5a708063d73408ce4> yeah... don't worry about it - not super important
02:40:55FromDiscord<Bung> @ElegantBeef have you checked hax's updated exmaple?
02:41:15FromDiscord<ElegantBeef> Nope
02:41:31FromDiscord<ElegantBeef> Got a link?
02:42:02FromDiscord<Bung> https://github.com/haxscramper/hnimast/blob/master/tests/tNimscriptInterop.nim seems ready for use, only pointer type not handled
02:47:30FromDiscord<ElegantBeef> Seems nice, looks like a worry i had is a non issue
02:49:40FromDiscord<Bung> I havn't tried yet, reading frontend things .
02:50:12FromDiscord<ElegantBeef> Well i cannot just paste this into nimscripter thanks to that `std/` issue i atleast experienced
02:50:49FromDiscord<ElegantBeef> Meaning it relies on any version past that commit 😄
02:51:56FromDiscord<Bung> okay, so wait
03:29:27*arkurious quit (Quit: Leaving)
03:34:54FromDiscord<impbox [ftsf]> In reply to @dan "alright 😄 <@!309937753699778561> would": sure, what's up?
03:35:47FromDiscord<impbox [ftsf]> (best to ask your question so i can answer it)
03:36:11FromDiscord<ElegantBeef> It'll be about the android build process with nim
03:55:54FromDiscord<offbeat-stuff (offbeat-stuff)> addExitProc doesn't work
03:56:00FromDiscord<offbeat-stuff (offbeat-stuff)> how do i import it
03:56:08FromDiscord<ElegantBeef> `import std/exitprocs`
03:56:26FromDiscord<ElegantBeef> Its how you should be importing stdlib files presently
03:56:27FromDiscord<offbeat-stuff (offbeat-stuff)> thanks
04:06:02*supakeen quit (Quit: WeeChat 3.2)
04:06:39*supakeen joined #nim
04:21:18*kayabaNerve joined #nim
04:21:24*kayabaNerve quit (Remote host closed the connection)
04:21:48*kayabaNerve joined #nim
04:35:33FromDiscord<Bung> implement a new backend ,does it need to be in nim repo or plugable ?
04:44:39FromDiscord<haxscramper> In reply to @Bung "https://github.com/haxscramper/hnimast/blob/master/": I realized toVm for objects is implemented incorrectly - simple fieldPairs is not sufficient, I must also use 'iterateFields' on the object implementation to correctly position all fields
04:45:01FromDiscord<haxscramper> But that can be easily fixed
04:52:39FromDiscord<bung87 (Bung)> Okay
04:58:30FromDiscord<Rika> In reply to @ElegantBeef "So nil aside you": technically only arc, not orc
05:24:25nixfreak_nim[m]using tables , how do you get back only one key or value
05:25:43FromDiscord<ElegantBeef> What do you mean?
05:26:57nixfreak_nim[m]so I iterate over all the keys or values or both but how can I just show one key or one value
05:27:58FromDiscord<ElegantBeef> do the first then put a break after, can always make a proc to do it for you
05:29:02nixfreak_nim[m]I can't just echo the int of a value ?
05:29:15FromDiscord<ElegantBeef> You can
05:29:32nixfreak_nim[m]echo x["Cat"]
05:29:42nixfreak_nim[m]echo x(10) ?
05:30:03FromDiscord<ElegantBeef> Oh you want to get the key from the value?
05:30:20nixfreak_nim[m]sorry had it backwards
05:30:54FromDiscord<ElegantBeef> You cant really, you can get a list of all keys with that value but not a specific key
05:31:16FromDiscord<ElegantBeef> So if you just want the first you can just iterate over find the value that's the same and break
05:32:27nixfreak_nim[m]ahh ok ,I was looking over the tables section and didn't see a way but that makes sense
05:33:02nixfreak_nim[m]so iterate over all then use an if statement for the first one then break
05:33:27FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=3tu4 for an example of what i'd do, though preferablly make it a proc instead of course
05:36:33nixfreak_nim[m]ok how would you do it if you didn't know the key?
05:36:49FromDiscord<ElegantBeef> That example doesnt know the key
05:37:09nixfreak_nim[m]ok either one then , the value or the key
05:37:31FromDiscord<ElegantBeef> I dont follow, if you have the key you can get the value, if you have the value you can only get a possible key
05:37:40FromDiscord<ElegantBeef> It's only associative key -> value
05:37:51FromDiscord<ElegantBeef> There is no connection from value to key
05:38:20nixfreak_nim[m]oh so not like an array , there is no index with key,value
05:38:39FromDiscord<Rika> Well that’s not how tables work
05:39:05nixfreak_nim[m]I get it , I didn't think there was just curious
05:39:12FromDiscord<Rika> In arrays you cannot set arbitrary keys like in tables
05:39:56nixfreak_nim[m]so not like python dicts then
05:40:12FromDiscord<Rika> Python dictionaries cannot do what you say either
05:40:42FromDiscord<Rika> You can always use two tables with the value and key reversed in one of them
05:41:10FromDiscord<ElegantBeef> The same issue arises though you can have 200 `10`s and have a list of keys
05:41:11FromDiscord<Rika> That is only if the value is hashable like the key
05:41:21FromDiscord<Rika> And yes
05:41:27FromDiscord<Rika> If the value is unique to the key
05:42:07FromDiscord<Rika> Though Nim tables have an interesting feature where a key can have more than one value
05:42:30FromDiscord<Rika> In reply to @nixfreak_nim "d.iterkeys().next()": You’re iterating through the keys still, which is O(n)
05:42:41FromDiscord<Rika> Accesses for dictionaries are typically constant time
05:43:25FromDiscord<Rika> You will not have fun trying to search for a key with a certain value in a dictionary with a few hundred thousand or a million entries
05:43:57FromDiscord<Rika> And the issue of non unique values still exists
05:44:23nixfreak_nim[m]Sorry element crashed on sway
05:45:04nixfreak_nim[m]ok I understand , thanks
05:47:41*max22- joined #nim
05:47:58*max22- quit (Remote host closed the connection)
05:48:20*max22- joined #nim
06:13:42FromDiscord<checkersai> What's the purpose of `lent`?
06:15:19FromDiscord<checkersai> Oh is it basically like a const reference?
06:20:36FromDiscord<ElegantBeef> It's an read only borrow
06:21:36FromDiscord<ElegantBeef> So based off my minute understanding of what a const reference is yea basically, a read only reference
06:22:03FromDiscord<ElegantBeef> Though i'm uncertain if in Nim it's forced to be read only, in that if you mutate it i believe it's a copy
06:24:26FromDiscord<impbox [ftsf]> maybe check out the ARC talk
06:24:39FromDiscord<impbox [ftsf]> https://www.youtube.com/watch?v=yA32Wxl59wo i think?
06:24:43fn<R2D299> outube: 7"Move semantics for Nim"
06:25:03FromDiscord<impbox [ftsf]> or https://www.youtube.com/watch?v=aUJcYTnPWCg
06:25:06fn<R2D299> outube: 7"Andreas Rumpf: Nim ARC/ORC (NimConf 2020)"
06:25:20FromDiscord<impbox [ftsf]> goes into detail about sink/lent
06:26:38FromDiscord<checkersai> cool
06:27:08FromDiscord<checkersai> another question, is there a significant difference between using `SharedPtr` and using `ref` with `--gc:arc`?
06:28:01FromDiscord<ElegantBeef> Wouldnt a sharedptr just be equivlent to any GC'd method?
06:28:32FromDiscord<checkersai> Well it's a reference counted pointer so `arc` is the most similar
06:30:35FromDiscord<ElegantBeef> I'll dumbly say sure then
06:35:25FromDiscord<Rika> Well I assume it is because arc doesn’t use thread local heaps anymore right?
06:36:45FromDiscord<ElegantBeef> Probably
06:37:16FromDiscord<ElegantBeef> My experience with shared ptrs is reading the C++ standard and going "Yep sound about what Nim offers now"
06:41:29*rockcavera quit (Remote host closed the connection)
06:42:34FromDiscord<Rika> Why would you read the C++ standard willingly
06:51:11FromDiscord<ElegantBeef> Elaborate explanation of what it's supposed to do 😄
06:54:03*max22- quit (Remote host closed the connection)
06:55:54*Vladar joined #nim
06:56:31*max22- joined #nim
07:09:02fn<ForumUpdaterBot99> New post on r/nim by unquietwiki: Nim in DevOps?, see https://reddit.com/r/nim/comments/onx0z3/nim_in_devops/
07:15:34*botenkhamen|2 joined #nim
07:25:15*botenkhamen|2 left #nim (No boundaries on the net!)
07:32:21*max22- quit (Remote host closed the connection)
07:33:25*max22- joined #nim
07:43:19*TakinOver joined #nim
07:47:15fn<ForumUpdaterBot99> New post on r/nim by rangerelf: json / nimongo data exchange?, see https://reddit.com/r/nim/comments/onxhd5/json_nimongo_data_exchange/
08:21:57*icebattle quit (Ping timeout: 268 seconds)
08:22:56*krux02 joined #nim
08:28:15*icebattle joined #nim
09:06:09*pro joined #nim
09:10:07fn<ForumUpdaterBot99> New thread by Stefan_Salewski: Templates as aliases, see https://forum.nim-lang.org/t/8252
09:10:10FromDiscord<planetis> one can be shared across threads, the other is not atomic. arc actually stands for automatic.↵(@checkersai)
09:15:04*pro quit (Quit: WeeChat 3.2)
09:18:03*pro joined #nim
09:37:42FromDiscord<System64 ~ Flandre Scarlet> Is it normal I have that? https://media.discordapp.net/attachments/371759389889003532/866977153714618368/unknown.png
09:38:12FromDiscord<haxscramper> yes, you need to provide an implementation for a procedure
09:38:27*pro quit (Ping timeout: 265 seconds)
09:38:33FromDiscord<System64 ~ Flandre Scarlet> wdym?
09:39:26FromDiscord<haxscramper> I mean you need to provide implementation for a procedure
09:39:26FromDiscord<Rika> you need to have a body for the procedure
09:39:36FromDiscord<Rika> you cannot export an unimplemented procedure; how would you call it?
09:39:47FromDiscord<haxscramper> Or forward-declare it, but still provide an implementation
09:40:10FromDiscord<haxscramper> Or `.importc.` it from somewhere
09:40:41FromDiscord<System64 ~ Flandre Scarlet> I should importc then
09:42:00*max22- quit (Remote host closed the connection)
09:42:48*max22- joined #nim
09:44:10FromDiscord<System64 ~ Flandre Scarlet> When I do that, should I cdecl? https://media.discordapp.net/attachments/371759389889003532/866978782682415114/unknown.png
09:44:34FromDiscord<generic linux user> i am SysV
10:05:31*max22- quit (Ping timeout: 246 seconds)
10:40:08*xet7 quit (Remote host closed the connection)
10:40:24*SebastianM joined #nim
10:41:11*SebastianM quit (Client Quit)
10:41:44*xet7 joined #nim
10:44:31*max22- joined #nim
10:47:13*xet7 quit (Remote host closed the connection)
11:09:54*pro joined #nim
11:10:27*pro quit (Client Quit)
11:14:14*max22- quit (Remote host closed the connection)
11:14:32*pro joined #nim
11:20:55*vsantana joined #nim
11:21:12*max22- joined #nim
11:36:29*vsantana quit (Ping timeout: 255 seconds)
11:50:35*pro quit (Quit: WeeChat 3.2)
11:52:44*vsantana joined #nim
12:02:00*max22- quit (Ping timeout: 265 seconds)
12:06:02*supakeen quit (Quit: WeeChat 3.2)
12:06:37*supakeen joined #nim
12:15:22*kayabaNerve quit (Remote host closed the connection)
12:18:37*kayabaNerve joined #nim
12:28:27*sagax quit (Ping timeout: 258 seconds)
12:43:49FromDiscord<Justaus3r (Justaus3r)> sent a code paste, see https://paste.rs/5Fi
12:45:48FromDiscord<Justaus3r (Justaus3r)> sent a code paste, see https://play.nim-lang.org/#ix=3tvx
12:49:04FromDiscord<haxscramper> yes, you need to declare type of procedure argument. And by the way, `var1` in `var var1: int` and the argument are not related
12:49:18FromDiscord<haxscramper> You defined variable and procedure separately, they just happened to have the same name
12:49:49FromDiscord<fajjida> sent a code paste, see https://paste.rs/e17
12:50:17FromDiscord<fajjida> sent a code paste, see https://play.nim-lang.org/#ix=3tvA
12:50:20FromDiscord<fajjida> sent a code paste, see https://play.nim-lang.org/#ix=3tvA
12:51:12FromDiscord<fajjida> sent a code paste, see https://play.nim-lang.org/#ix=3tvC
12:51:16FromDiscord<fajjida> sent a code paste, see https://paste.rs/KN9
12:51:26FromDiscord<fajjida> sent a code paste, see https://play.nim-lang.org/#ix=3tvD
12:52:09FromDiscord<haxscramper> Can't reproduce the issue
12:52:15FromDiscord<Rika> do you mind checking for issues before sending your message instead of editing, because the bridge does not work well with edits
12:52:48FromDiscord<haxscramper> yes, that looks horrible on the discord side
12:54:28FromDiscord<haxscramper> How do you run the code? `./script.nims` and `nim script.nims` both produce correct results
12:58:22FromDiscord<fajjida> I suddenly can't reproduce it either? I tried fixing this for 20 minutes and resetarted code and such?? Thanks for trying to help...
12:59:10FromDiscord<Justaus3r (Justaus3r)> sent a code paste, see https://play.nim-lang.org/#ix=3tvE
13:01:26FromDiscord<Justaus3r (Justaus3r)> Also is it necessary for me to set a return type,i mean if my code is returning values of different types then what should i do?.
13:01:29FromDiscord<haxscramper> Yes, that is correct
13:01:52FromDiscord<Justaus3r (Justaus3r)> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/867028425016082432): Also is it necessary for me to set a return type,i mean if my code is returning values of different types depending on the condition then what should i do?.
13:02:02FromDiscord<haxscramper> If your code returns values of different type you have seveal options depending on what you do
13:02:31FromDiscord<haxscramper> If return type is based on the argument types you can create an overloaded or generic proc
13:03:11FromDiscord<haxscramper> If return type is based on some internal logic you can use object variants
13:03:11FromDiscord<haxscramper> You can also use inheritance, but that is usually unnecessary
13:03:48FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3tvH
13:05:24FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3tvI
13:06:01FromDiscord<haxscramper> Last one should be just `proc calc(arg: int): Res =`
13:08:18FromDiscord<planetis> anyone knows what's the story with =deepcopy in arc/orc?
13:08:20FromDiscord<planetis> is it implemented?
13:11:35*arkurious joined #nim
13:14:50fn<ForumUpdaterBot99> New thread by Jasonfi: Building JSON objects with JsonNode?, see https://forum.nim-lang.org/t/8253
13:14:51FromDiscord<planetis> doesn't seem to work, I get\: "Error\: signature for 'deepCopy' must be proc[T\: ptr\|ref](x\: T)\: T"
13:17:26FromDiscord<planetis> that signature doesn't help me, I would expect the same as =copy
13:19:55FromDiscord<deech> Is this expected behavior? Running `import options; var c : cstring: echo c.option` results in a segfault. I see `option` is overloaded on `ptr` and `pointer` types so I expected it to print `none()`.
13:23:18FromDiscord<Justaus3r (Justaus3r)> sent a code paste, see https://play.nim-lang.org/#ix=3tvO
13:23:47FromDiscord<Rika> deech cstring doesnt actually match ptr/pointer/ref
13:23:49FromDiscord<Rika> i dont think
13:25:00FromDiscord<Rika> !eval echo cstring is SomePointer
13:25:02NimBotCompile failed: /usercode/in.nim(1, 17) Error: undeclared identifier: 'SomePointer'
13:25:23FromDiscord<Justaus3r (Justaus3r)> sent a code paste, see https://play.nim-lang.org/#ix=3tvP
13:25:28FromDiscord<Rika> !eval echo cstring is (ref | ptr | pointer | proc)
13:25:42FromDiscord<Rika> yeah so thats why it's broken
13:25:43FromDiscord<haxscramper> cstring is magic
13:26:06FromDiscord<deech> That is unfortunate
13:26:31FromDiscord<haxscramper> you can overload `isSome()` for `cstring`
13:26:31FromDiscord<haxscramper> This might work
13:27:12FromDiscord<haxscramper> Object variants are not related to OOP. You can say it is quite the opposite - they allow you to move from object inhertance to just putting all variants of data in a single structure
13:27:16FromDiscord<haxscramper> [Justaus3r (Justaus3r)](https://matrix.to/#/@justaus3r-601fefa16da03739846156cd:gitter.im)\:
13:27:33FromDiscord<haxscramper> In other programming languages it is called 'tagged union' or 'sum type"
13:27:34FromDiscord<deech> Oh wow, apparently the `c` in `cstring` doesn't stand for `C` but `compatible`: `cstring {.magic: Cstring.} ## Built-in cstring (compatible string) type.`
13:27:49FromDiscord<haxscramper> https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants tutorial has a section on object variants
13:28:14*max22- joined #nim
13:28:48FromDiscord<haxscramper> Also, for your speific use case you can either return `Option[float]`, or use one of the `Result` packages to return `Result[float, string]`
13:30:48FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3tvS
13:31:07FromDiscord<haxscramper> `assert false` is not the best choice, but IIRC there is no `ArgumentError` or `LogicError` exceptions in the stdlib
13:31:54FromDiscord<Justaus3r (Justaus3r)> Thanks alot for the help
13:32:51FromDiscord<Justaus3r (Justaus3r)> so this is an alternative to C's switch-case statement?
13:33:46*vsantana quit (Remote host closed the connection)
13:34:34FromDiscord<haxscramper> Yes, but it does not require `break` on each clause and can be used as expression
13:34:41FromDiscord<haxscramper> see I have no `return` anywhere
13:36:20FromDiscord<Justaus3r (Justaus3r)> Oh i see,pretty handy!
13:37:55*vsantana joined #nim
13:41:18*rockcavera joined #nim
13:41:18*rockcavera quit (Changing host)
13:41:18*rockcavera joined #nim
13:51:43*max22- quit (Ping timeout: 265 seconds)
13:54:27FromDiscord<deech> It's so odd that this also segfaults: `var c: cstring; assert c[0] == '\0'`. I would expect the default `cstring` to at least be a null terminator.
13:57:23FromDiscord<deech> More shenanigans: `var c: cstring; echo c.len; assert c[0] == '\0';` outputs `0` and segfaults, `var c: cstring = ""; echo c.len; assert c[0] == '\0';` outputs `0` and doesn't segfault. Yeah this is just broken.
13:57:36FromDiscord<haxscramper> no, default `cstring` is `NULL` in C
13:57:47FromDiscord<haxscramper> So why should it have null terminator
13:58:29FromDiscord<haxscramper> If you init it with `""` then it has null terminator
13:58:48FromDiscord<haxscramper> And it makes perfect sense, since you default-init pointer with an expression
13:58:48FromDiscord<deech> `len` of a default `NULL` cstring and `len` with empty cstring have the same value, `0`.
13:59:05FromDiscord<haxscramper> I bet `strlen` does the same
13:59:23FromDiscord<deech> And if the default value is `NULL` like in C it should behave like `char` in other cases too (like `option`).
14:00:39FromDiscord<haxscramper> https://github.com/nim-lang/Nim/blob/8ccde68f132be4dba330eb6ec50f4679e564efac/lib/system/memory.nim#L45
14:00:50FromDiscord<haxscramper> https://github.com/nim-lang/Nim/blob/4ec2f74246158759735149e3dd087f373fd787b2/compiler/ccgexprs.nim#L1750
14:00:58FromDiscord<haxscramper> It is defined to be that way explicitly
14:01:21FromDiscord<haxscramper> `($1 ? #nimCStrLen($1) : 0)`
14:19:04FromDiscord<Rika> In reply to @deech "And if the default": the option issue is an oversight
14:19:13FromDiscord<Rika> a bug if you want
14:52:21*springb0k joined #nim
14:58:20*max22- joined #nim
15:51:32*max22- quit (Remote host closed the connection)
15:58:17*max22- joined #nim
16:00:23FromDiscord<emmа> <@&371760044473319454> can you ban `Max567#1483`? they DMed me trying a steam account scam. https://media.discordapp.net/attachments/371759389889003532/867073462564552714/unknown.png
16:02:03FromDiscord<Zachary Carter> In reply to @emmа "<@&371760044473319454> can you ban": They're not a member of this server
16:02:07FromDiscord<alehander42> /ban Max567#1483
16:02:17FromDiscord<Zachary Carter> So they can't be banned from here
16:02:17FromDiscord<alehander42> 😄
16:02:19FromDiscord<Zachary Carter> You can block them though
16:02:28FromDiscord<alehander42> maybe already banned
16:02:28FromDiscord<emmа> oh, they mustve left after i sent that
16:02:33FromDiscord<emmа> they were a minute ago
16:03:00*vsantana quit (Remote host closed the connection)
16:11:11*vsantana joined #nim
16:14:41*springb0k quit (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/)
16:16:04*springb0k joined #nim
16:36:07FromDiscord<haxscramper> what can be the reason for `nim doc` to hang infinitely in the CI?
16:36:30FromDiscord<haxscramper> I run the same documentation generator command locally and in CI, and it randomly breaks there
16:50:57FromDiscord<treeform> [macros] Any on know how to get a name of nnkEnumTy ?
18:03:27*sagax joined #nim
18:05:56*max22- quit (Ping timeout: 268 seconds)
18:15:43FromDiscord<checkersai> I'm a little bit confused, is `lent T` necessary when large `T`'s are already converted to pointers?
18:15:55FromDiscord<checkersai> Or am I misunderstanding something
18:19:25FromDiscord<haxscramper> `lent` is an immutable view, so if your data is already in form of a pointer (which is also can be considered a view) then you probably don't need this
18:23:45FromDiscord<arnetheduck> In reply to @deech "More shenanigans: `var c:": there's lots of fun you can do with cstring: https://play.nim-lang.org/#ix=3txx - gotta love that implicit conversion
18:33:31FromDiscord<zidsal> sent a code paste, see https://play.nim-lang.org/#ix=3txz
18:39:27*max22- joined #nim
18:50:07FromDiscord<deech> In reply to @arnetheduck "there's lots of fun": This is discouraging. 🙂
19:06:29FromDiscord<haxscramper> why do you use cstring in the first place?
19:06:56FromDiscord<haxscramper> I mean wrapping it in `Option` etc.
19:06:58arkanoidjust compiler nim from source for the first time. Everything went fine, I'm just curious about the steps. What is "https://github.com/nim-lang/csources_v1", what is the meaning of iteration 1 2 and 3?
19:07:18FromDiscord<leorize> i think the point is that cstring is too magical while being unsafe
19:07:48FromDiscord<leorize> but that probably won't change until @Araq finally figured out how views should work
19:07:57FromDiscord<haxscramper> to me `cstring` is approximately in the same area as `pointer`
19:08:05FromDiscord<haxscramper> stuff for interop, don't touch otherwise
19:08:20FromDiscord<leorize> it's not getting that support from the compiler
19:08:37FromDiscord<leorize> the compiler treats it as perfectly safe and that's where trouble lies
19:09:11FromDiscord<carmysilna> In reply to @arkanoid "just compiler nim from": I think the three iterations are meant to check that compiling nim with number 0 (before change version of nim compiler) produces the same executable as compiling nim with the compiled version (number 1) and so on.
19:10:02FromDiscord<carmysilna> nim1 is the compiler compiled with nim0, nim2 is the compiler compiled with nim1, and nim3 is the compiler compiled with nim3, and the script checks to make sure each executable is the same
19:10:20FromDiscord<leorize> iirc that check was removed
19:10:24FromDiscord<leorize> did it return?
19:10:56arkanoidwell, I got "executables are equal: SUCCESS!" at the end of third iteration
19:11:36arkanoidhow is possible that the binary produced by nim < 1.0 is equal to latest nim? It it mean logically equivalent and not binary equivalent?
19:11:56FromDiscord<leorize> it's only comparing iteration #2 and #3
19:14:31arkanoidI was expecting nimlint https://github.com/nim-dev/nimlint , is this project available?
19:14:34fn<R2D299> itHub: 7"nimlint makes developing softer."
19:51:14FromDiscord<RattleyCooper> I was going to post on nim lang forum but it says I have to confirm my email. I never got a confirmation email and I don't have an option to resend it. Anybody know how to fix that? Should I try making a new account?
19:53:49FromDiscord<zidsal> whatever you do don't delete the account or you're boned
19:57:14FromDiscord<RattleyCooper> Lol, ok
19:57:54FromDiscord<treeform> Its very touchy
20:02:06FromDiscord<RattleyCooper> I'll try making a new account tomorrow
20:28:44*vsantana quit (Ping timeout: 252 seconds)
20:36:26*beshr quit (Ping timeout: 252 seconds)
20:39:03*beshr joined #nim
20:39:03*beshr quit (Changing host)
20:39:03*beshr joined #nim
20:39:50*xet7 joined #nim
20:42:09*max22- quit (Remote host closed the connection)
21:12:26FromDiscord<checkersai> sent a code paste, see https://play.nim-lang.org/#ix=3tyi
21:14:32FromDiscord<dom96> In reply to @RattleyCooper "I was going to": I can confirm your account
21:14:37FromDiscord<dom96> just tell me what the nickname is 🙂
21:19:21FromDiscord<InventorMatt> sent a code paste, see https://play.nim-lang.org/#ix=3tyj
21:22:28FromDiscord<checkersai> In reply to @InventorMatt "you can do this": I don't want to change the variable outside the scope, I just want a local mutable variable
21:23:51FromDiscord<InventorMatt> in that case I don't think there is a better way to do that
21:23:51FromDiscord<RattleyCooper> In reply to @dom96 "just tell me what": It's RattleyCooper 😛
21:24:20FromDiscord<RattleyCooper> In reply to @dom96 "I can confirm your": And thank you!!!
21:26:04FromDiscord<dom96> done
21:40:24FromDiscord<theangryepicbanana> In reply to @InventorMatt "in that case I": wait, parameters in nim are immutable?
21:40:37FromDiscord<theangryepicbanana> I don't recall the docs ever mentioning that
21:41:50FromDiscord<dom96> depends on the parameter's type
21:42:14FromDiscord<theangryepicbanana> In reply to @dom96 "depends on the parameter's": besides var types
21:42:22FromDiscord<theangryepicbanana> just like regular types
21:44:12FromDiscord<dom96> and ref types
21:45:10FromDiscord<theangryepicbanana> sent a code paste, see https://play.nim-lang.org/#ix=3tyr
21:49:21FromDiscord<checkersai> sent a code paste, see https://play.nim-lang.org/#ix=3tys
21:50:18FromDiscord<theangryepicbanana> In reply to @checkersai "yeah you can't do": why though? not even a pragma for it?
21:50:30FromDiscord<theangryepicbanana> (edit) "In reply to @checkersai "yeah you can't do": why though? not even a pragma for it? ... " added "(without macros!)"
21:51:19FromDiscord<Hi02Hi> In reply to @theangryepicbanana "wait, parameters in nim": ^
21:51:39FromDiscord<carmysilna> Because just like Rust, mutability is explicit. if you don't say something is `var` or `ref`, you can't mutate it
21:51:48FromDiscord<theangryepicbanana> not in the slightest
21:52:08FromDiscord<theangryepicbanana> nim has explicit keywords for both mutable and immutable variables
21:52:32FromDiscord<theangryepicbanana> in that case, I don't see why something like `proc thing(var a: int): int` couldn't be allowed
21:52:46FromDiscord<carmysilna> It is allowed
21:52:55FromDiscord<carmysilna> but written `a: var int`
21:53:03FromDiscord<theangryepicbanana> that's still a different thing
21:53:17FromDiscord<carmysilna> it returns an immutable int, though.
21:53:41FromDiscord<theangryepicbanana> `var a: int` would allow `a` to be mutated locally, and not mutate its argument
21:54:23FromDiscord<carmysilna> sent a code paste, see https://play.nim-lang.org/#ix=3tyt
21:54:30FromDiscord<carmysilna> In reply to @theangryepicbanana "`var a: int` would": I'd assume the idiom for this is a local var shadow, like Rust
21:54:31FromDiscord<theangryepicbanana> that's not what I'm wanting bruh
21:55:13FromDiscord<theangryepicbanana> sent a code paste, see https://play.nim-lang.org/#ix=3tyu
21:56:06FromDiscord<carmysilna> sent a code paste, see https://play.nim-lang.org/#ix=3tyv
21:56:13FromDiscord<theangryepicbanana> did you not see the first thing I said about how that's dumb
21:56:44FromDiscord<theangryepicbanana> I don't even understand why parameters would be immutable by default in the first place if nothing else behaves like that
21:57:51FromDiscord<ElegantBeef> "if nothing else behaves like that"?
22:00:37FromDiscord<ElegantBeef> If you can mutate parameters dont you have to pass them by copy every time regardless of size?
22:00:45FromDiscord<theangryepicbanana> In reply to @ElegantBeef ""if nothing else behaves": last time I checked, fields on objects(/tuples?) aren't immutable by default, with no way to specify otherwise
22:01:24FromDiscord<theangryepicbanana> In reply to @ElegantBeef "If you can mutate": by mutable parameters, I mean parameters that can be modified locally without affecting the original argument
22:01:33FromDiscord<ElegantBeef> Exactly, which means you have to copy it
22:02:01FromDiscord<theangryepicbanana> I'm again saying that there should be a default syntax for it rather than a workaround
22:03:50FromDiscord<ElegantBeef> The issue is going to be this is super easy to do in a macro so there isnt going to much reason to support it in compiler
22:04:58FromDiscord<theangryepicbanana> In reply to @ElegantBeef "The issue is going": I don't see how that's possible if you'd have to redefine the semantics of proc, func, iterator, method, and converter
22:05:12FromDiscord<theangryepicbanana> or rather, I don't see how it's convenient
22:05:16FromDiscord<ElegantBeef> To do what?
22:05:31FromDiscord<theangryepicbanana> In reply to @ElegantBeef "The issue is going": to do this
22:05:46FromDiscord<ElegantBeef> It's really not that hard
22:07:23FromDiscord<theangryepicbanana> In reply to @ElegantBeef "It's really not that": last time I checked, `var` sections don't stop after a semicolon. even if they didn't that wouldn't match nim's parameter syntax because parameters can also be delimited on commas
22:07:35FromDiscord<theangryepicbanana> (edit) "on" => "by"
22:08:15FromDiscord<theangryepicbanana> so something like `proc thing(var a: int, b: string)` either wouldn't do what you'd expect, or `proc thing(var a: int; b: string)` wouldn't work at all
22:08:40FromDiscord<theangryepicbanana> (edit) "so something like `proc thing(var a: int, b: string)` either wouldn't do what you'd expect, or `proc thing(var a: int; b: string)` wouldn't work at all ... " added "(or it'd just make the impl a lot harder)"
22:09:14FromDiscord<konsumlamm> propose it then, if you really think it's important
22:09:30FromDiscord<ElegantBeef> There we did it we shadowed it https://play.nim-lang.org/#ix=3tyA
22:09:40FromDiscord<theangryepicbanana> not that I think it's super important, I just don't see why a workaround is accepted as a solution
22:10:38FromDiscord<konsumlamm> a situation where you need something like that rarely ever happens in the first place
22:10:39FromDiscord<ElegantBeef> removed the wrong code
22:10:40FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=3tyB
22:11:08FromDiscord<ElegantBeef> And you could support the code your propsed with a macro
22:11:21FromDiscord<leorize> parameters are immutable by default because that's what people want 90% of the time
22:11:24FromDiscord<theangryepicbanana> In reply to @konsumlamm "a situation where you": I've seen it happen in langs with similar macro capabilities as nim (e.g haxe, ocaml, crystal) and they all end up never getting QoL features because it's either not important (sometimes understandable) or "it can be done with a macro"
22:11:49FromDiscord<theangryepicbanana> In reply to @leorize "parameters are immutable by": what about the other 10% of the time lol
22:11:59FromDiscord<ElegantBeef> you shadow the specific variable you want
22:12:12FromDiscord<leorize> you either create a local variable or you just use the built-in result
22:12:24FromDiscord<konsumlamm> OCaml doesn't even have (normal) mutable variables lol
22:12:30FromDiscord<theangryepicbanana> like I can see why they're immutable by default and that's fine, but not having a builtin keyword or pragma to change that is a bit annoying
22:12:33FromDiscord<ElegantBeef> Exactly in this example result is what you' want
22:12:37*sagax quit (Ping timeout: 245 seconds)
22:12:40FromDiscord<ElegantBeef> (edit) "you'" => "you'd"
22:12:54FromDiscord<ElegantBeef> `result = a 3` is a proper solution
22:12:59FromDiscord<theangryepicbanana> (edit) "like I can see why they're immutable by default and that's fine, but not having a builtin keyword or pragma to change that ... is" added "for a variable"
22:13:04FromDiscord<theangryepicbanana> but that doesn't always work
22:13:12FromDiscord<ElegantBeef> My shadow macro does
22:13:13FromDiscord<theangryepicbanana> what if you want to change a parameter and then keep using it
22:13:20FromDiscord<konsumlamm> In reply to @theangryepicbanana "like I can see": again, make an RFC if you think that matters
22:13:32FromDiscord<theangryepicbanana> like sure macros yay, but it's just a bit irritating is all
22:13:52FromDiscord<leorize> well sink is there but the mutability is kind of a side-effect...
22:14:14FromDiscord<ElegantBeef> You could always implement the syntax you want but yes you'd have to annotate it with some pragma
22:14:33FromDiscord<theangryepicbanana> In reply to @leorize "well sink is there": lol isn't mutability supposed to be a side effect though?
22:14:50FromDiscord<theangryepicbanana> (anyways sink seems dangerous, staying away from it for now)
22:14:51FromDiscord<dom96> writing `var a = a` isn't a workaround
22:14:59FromDiscord<dom96> it works very well
22:15:05FromDiscord<dom96> there is no need for the syntax sugar here
22:15:07FromDiscord<leorize> sink is perfectly safe btw↵(@theangryepicbanana)
22:15:16FromDiscord<ElegantBeef> Sink will copy if it cannot move
22:15:21FromDiscord<theangryepicbanana> isn't it still in the experimental docs though
22:15:26FromDiscord<ElegantBeef> Nope
22:15:31FromDiscord<ElegantBeef> It's in the destructor docs
22:15:35FromDiscord<theangryepicbanana> huh
22:15:48FromDiscord<ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/867167938863955978/unknown.png
22:15:53FromDiscord<leorize> side effect is that it's not to express that you want the parameter to be proc-mutable-only
22:16:04FromDiscord<theangryepicbanana> well anyways I suppose a pragma could be fine
22:16:36FromDiscord<theangryepicbanana> @ElegantBeef in your example, would there be a way to just annotate the parameter to shadow with the pragma?
22:16:44FromDiscord<leorize> the mutability comes from the ownership transfer
22:17:14FromDiscord<ElegantBeef> Ah shame you cannot write `var a: t`
22:17:37FromDiscord<theangryepicbanana> oh are var sections not considered expressions
22:17:40FromDiscord<leorize> you can attach a pragma to the parameter though
22:17:55FromDiscord<ElegantBeef> or do `i: mut int` like a sadist
22:17:56FromDiscord<theangryepicbanana> well sure, but I'm not sure if that'd give me access to the proc as well
22:18:05FromDiscord<ElegantBeef> well the pragma on the proc would
22:18:12FromDiscord<theangryepicbanana> yes but what if it's on the param instead
22:18:21FromDiscord<ElegantBeef> You'd also need one on the proc
22:18:26FromDiscord<theangryepicbanana> :/
22:18:36FromDiscord<leorize> `i: copy int` or `i {.copy.}: int`
22:18:53FromDiscord<leorize> both of which can be transformed by the macro
22:19:15FromDiscord<theangryepicbanana> yeah but I don't really want a pragma attached to the proc as well
22:19:25FromDiscord<ElegantBeef> Well then you cannot do this
22:19:36FromDiscord<ElegantBeef> You need a pragma attached to the proc to insert the shadow calls
22:19:54FromDiscord<ElegantBeef> Only a macro operating on the procdef can change it's contents
22:20:20FromDiscord<ElegantBeef> So then you need to make an RFC detailing what you want and why a macro doesnt suffice
22:20:52FromDiscord<theangryepicbanana> yeah that makes sense ig. it's definitely nitpick-y, but I'm not a fan of using macros where stuff could easily be builtin
22:21:24FromDiscord<konsumlamm> most uses of macros could be replaced by something builtin
22:21:29FromDiscord<ElegantBeef> all
22:21:38FromDiscord<konsumlamm> but that doesn't necessarily make it s good idea to do so
22:21:41FromDiscord<theangryepicbanana> well yes but that's not the point
22:21:43FromDiscord<konsumlamm> (edit) "s" => "a"
22:22:19FromDiscord<leorize> the rfc process is always there for adding new features to the language
22:22:19FromDiscord<dom96> Nim's philosophy is explicitly to implement a small core language that's extensible via macros
22:22:33FromDiscord<dom96> and in fact we've got too much implemented in the compiler
22:22:42FromDiscord<leorize> not all can be done like that tbf
22:24:00FromDiscord<theangryepicbanana> again I don't really need to propose it because I don't think it matters all too much, but allowing var sections as an expression (for use in macros) might actually be a decent idea
22:24:40FromDiscord<leorize> it's not about expression, unfortunately
22:25:01FromDiscord<theangryepicbanana> why else wouldn't it be able to work?
22:25:22FromDiscord<leorize> it's about what the compiler considers well-formed ast
22:25:32FromDiscord<ElegantBeef> The semantic pass on the keyword var has an explicit path to valid code
22:25:41FromDiscord<theangryepicbanana> oh that makes sense
22:26:08FromDiscord<ElegantBeef> not to say you cannot use macros with var statements they're just pragmas on the ident like so `var a {.byaddr.} = c`
22:26:24FromDiscord<theangryepicbanana> so `var` will otherwise be an actual invalid token, and not just parsed a function call or something?
22:27:14FromDiscord<ElegantBeef> Interestingly there is an explict error for that syntax you proposed 😄 `Error: the syntax is 'parameter: var T', not 'var parameter: T'`
22:27:19FromDiscord<theangryepicbanana> In reply to @ElegantBeef "not to say you": yeah I mean the other way around, like `myMacro(var thing = 1)`
22:27:29FromDiscord<theangryepicbanana> lmao that's what I was thinking
22:27:45FromDiscord<ElegantBeef> That's valid since the entire statement is inside the macro, and is a valid statement
22:28:17FromDiscord<theangryepicbanana> would `myMacro(a: int, var b: string)` also be valid or no?
22:28:21FromDiscord<ElegantBeef> For these experiments i highly suggest playing around with dumptree to see what chooches like so https://play.nim-lang.org/#ix=3tyC
22:28:29FromDiscord<theangryepicbanana> 👍
22:28:49FromDiscord<leorize> the ast goes more or less like this\: ProcDef(..., FormalParams(Sym, IdentDefs...), ...)
22:28:49FromDiscord<theangryepicbanana> thanks for the help
22:28:55FromDiscord<theangryepicbanana> hmm
22:29:18FromDiscord<theangryepicbanana> that reminds me (completely different topic ik), will nim support pattern matching on ast nodes/syntax?
22:29:23FromDiscord<leorize> the params is the FormalParams part and VarSection is not a valid child for it
22:30:00FromDiscord<leorize> see fusion/matching↵(@theangryepicbanana)
22:30:15FromDiscord<theangryepicbanana> haxe has this really cool thing where you can do something like `case macro thing($a + $b):` to match the expr `thing(<anything> + <anything>)`
22:30:51FromDiscord<ElegantBeef> Nim already does
22:30:51FromDiscord<dom96> !eval import macros; const s = parseStmt("myMacro(var x=1)").treeRepr; echo s
22:30:53NimBotStmtList↵ Call↵ Ident "myMacro"↵ ExprEqExpr↵ VarTy↵ Ident "x"↵ IntLit 1
22:31:15FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual_experimental.html#term-rewriting-macros-pattern-operators
22:31:17FromDiscord<theangryepicbanana> In reply to @ElegantBeef "Nim already does": oh? like, actual pattern matching?
22:31:19FromDiscord<dom96> heh, best do it in play.nim-lang.org
22:31:24FromDiscord<theangryepicbanana> oh yeah that thing
22:31:38FromDiscord<theangryepicbanana> I meant like inside a macro as a statement or something (like in case...of)
22:31:49FromDiscord<ElegantBeef> Ah there is a matching macro package in `fusion`
22:31:55FromDiscord<ElegantBeef> https://nim-lang.github.io/fusion/src/fusion/matching.html
22:32:28FromDiscord<theangryepicbanana> yeah I've seen that, but I'm not sure if it supports direct matching on syntax like I described
22:32:39FromDiscord<theangryepicbanana> like on NimNode, etc
22:33:01*lain quit (Quit: brb!)
22:33:02FromDiscord<ElegantBeef> Nah it'd have to be on the `infix(ident"+", a, b)` if that's even possible
22:33:12FromDiscord<theangryepicbanana> oof
22:33:15FromDiscord<hugogranstrom> The `quote do` of pattern matching would be lit
22:33:32FromDiscord<ElegantBeef> I generally dont follow pattern matching, so i dont actually know
22:34:16FromDiscord<theangryepicbanana> here's an example of where I've actually used it btw <https://github.com/ALANVF/star/blob/master/src/Util.hx#L59-L76>
22:34:26FromDiscord<theangryepicbanana> (in haxe)
22:35:04FromDiscord<ElegantBeef> It could be done by parsingExpr the given nimnode and doing string compare i guess, though might be dangerous to do that way
22:35:52FromDiscord<theangryepicbanana> that sounds kinda hacky
22:36:02FromDiscord<ElegantBeef> Well reading pattern matching seems hacky to me 😛
22:36:53*Vladar quit (Quit: Leaving)
22:37:05FromDiscord<theangryepicbanana> eh
22:37:09FromDiscord<theangryepicbanana> I quite like it
22:37:09*lain joined #nim
22:37:17FromDiscord<theangryepicbanana> it tunes down the verbosity of the rest of the code
22:38:21FromDiscord<ElegantBeef> Hey i'm a numpty no one needs to defend their views to me
22:40:45FromDiscord<theangryepicbanana> In reply to @ElegantBeef "Hey i'm a numpty": no I'm just saying it makes the code a lot cleaner is all
23:00:33*xet7 quit (Remote host closed the connection)
23:05:23FromDiscord<Ayy Lmao> I'm making an extension .dll for a program, and when I do something bad like try to call a function that is nil, it crashes my program silently. Is there a way to stop that and somehow display an error message? I know about `globalRaiseHook` but I'm not sure what to do there.
23:13:42FromDiscord<demotomohiro> try statement doesn't catch such err?
23:17:20FromDiscord<Ayy Lmao> I will test that out
23:20:29FromDiscord<Ayy Lmao> Yeah it's still crashing my program inside the try statement
23:21:20FromDiscord<Ayy Lmao> It's because it involves window messages I guess.
23:29:31FromDiscord<theangryepicbanana> In reply to @Ayy Lmao "I'm making an extension": try checking it for nil manually?
23:34:09FromDiscord<Ayy Lmao> @theangryepicbanana My problem isn't that I can't get the code to run. If I check for nil manually the code runs. My problem is that I forgot to check for nil and it took me a long time to figure out what was wrong because the program crashes silently. I'm wondering if there is a way to get the program to give some feedback if I forget to check for nil.
23:34:32FromDiscord<theangryepicbanana> In reply to @Ayy Lmao "<@!356108561232953344> My problem isn't": the `notNil` pragma might help
23:34:41FromDiscord<theangryepicbanana> (edit) "In reply to @Ayy Lmao "<@!356108561232953344> My problem isn't": the `notNil` ... pragma" added "experimental"
23:36:01FromDiscord<Ayy Lmao> In reply to @theangryepicbanana "the `notNil` experimental pragma": I'll look into it, thanks for the tip
23:50:51*krux02 quit (Remote host closed the connection)