| 00:01:30 | madprops | ok got something |
| 00:01:35 | madprops | getTime() - initTime(seconds, 0) |
| 00:23:10 | * | beshr quit (Ping timeout: 240 seconds) |
| 00:26:42 | * | xet7 quit (Read error: Connection reset by peer) |
| 00:27:18 | * | xet7 joined #nim |
| 00:43:56 | * | arkurious quit (Quit: Leaving) |
| 00:48:52 | madprops | anything that could be improved here? https://dpaste.org/APJg |
| 00:53:28 | madprops | cleaned it up a bit |
| 00:53:35 | madprops | less repetition |
| 01:06:01 | madprops | something that i haven't seen is a var that turns into a let when assigned |
| 01:06:11 | madprops | don't know of a prog lang that does it |
| 01:06:19 | madprops | maybe it's hard to implement |
| 01:09:08 | FromDiscord | <Elegantbeef> You can emulate that behaviour using a block |
| 01:10:11 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3wjv for instance |
| 01:11:08 | madprops | or an if/else similarly right ? |
| 01:11:47 | madprops | for some reason some if/else block assigning wasn't working |
| 01:12:02 | madprops | if something: "somestring" |
| 01:12:04 | FromDiscord | <Elegantbeef> Yes all expressions can return a value |
| 01:12:22 | FromDiscord | <Elegantbeef> you need all branches to have a returned value |
| 01:12:31 | madprops | oh maybe I was missing an else |
| 01:12:45 | FromDiscord | <Elegantbeef> Probably |
| 01:26:14 | FromDiscord | <j-james> Can someone explain what the `{. bycopy .}` pragma does in more detail? |
| 01:27:40 | FromDiscord | <Elegantbeef> Instead of doing reference passing optimizations it always copies the object afaik |
| 01:28:46 | FromDiscord | <Elegantbeef> In Nim objects are often passed by hidden references which is more efficient, but you may not when interacting with something that doesnt know that it's a copy |
| 01:30:04 | FromDiscord | <j-james> That makes a lot of sense, thanks |
| 01:30:51 | FromDiscord | <j-james> Off the top of your head, can you think of any cases where one or the other could cause issues? |
| 01:36:28 | FromDiscord | <Elegantbeef> Presently writing an example \:D |
| 01:41:52 | FromDiscord | <Elegantbeef> here is a bit of a contrived issue but https://play.nim-lang.org/#ix=3wjJ |
| 01:42:21 | FromDiscord | <Elegantbeef> Do to forcing the compiler to emit a `doThing(SomeThing)` it mismatches with `doThing(SomeThing)` |
| 02:29:56 | FromDiscord | <eliyanov> Hello everyone, I'm new here |
| 02:31:58 | FromDiscord | <Elegantbeef> Hello |
| 02:32:07 | FromDiscord | <eliyanov> I have a quick question\: if I write `stream.readData(value.unsafeAddr, sizeof(value))` where stream is a FileStream and value is a string, how is the function able to deserialize a string of any length? |
| 02:33:30 | FromDiscord | <Elegantbeef> It isnt, it writes the data at the pointer |
| 02:34:02 | FromDiscord | <Elegantbeef> For serializing a string you'd want to write `len` followed by the data of the string, though you may want to look at frosty, or flatty for binary serialization |
| 02:34:57 | FromDiscord | <Elegantbeef> So in the case of a string it'll write probably `len, dataAddress` |
| 02:35:46 | FromDiscord | <eliyanov> I'm seeing behavior where I write a string to the binary file and that line given is able to deserialize the whole thing. |
| 02:36:03 | FromDiscord | <Elegantbeef> Cause the string is still in memory so it's stil lvalid |
| 02:36:04 | FromDiscord | <Elegantbeef> Cause the string is still in memory so it's stil valid |
| 02:37:11 | * | TakinOver joined #nim |
| 02:38:31 | FromDiscord | <eliyanov> Screen Shot 2021-08-17 at 9.38.00 PM.png https://media.discordapp.net/attachments/371759389889003532/877380915523891210/Screen_Shot_2021-08-17_at_9.38.00_PM.png |
| 02:38:39 | FromDiscord | <eliyanov> Even in this example? |
| 02:39:12 | * | rockcavera quit (Remote host closed the connection) |
| 02:40:23 | FromDiscord | <Elegantbeef> yea `dat` is likely not freed by by the end of main |
| 02:41:13 | FromDiscord | <eliyanov> Oh the unsafe pointers are the issue maybe |
| 02:41:45 | FromDiscord | <Elegantbeef> Well to prove my point https://play.nim-lang.org/#ix=3wjR |
| 02:41:59 | FromDiscord | <Elegantbeef> The character array isnt written |
| 02:42:42 | FromDiscord | <eliyanov> Yeah that makes sense, thanks for the help |
| 02:50:04 | FromDiscord | <Elegantbeef> If interested this is what my suggestion was https://play.nim-lang.org/#ix=3wjS |
| 02:50:47 | FromDiscord | <Elegantbeef> But frosty/flatty make this serialization super easy if you want something already all together 😀 |
| 02:56:37 | FromDiscord | <j-james> What is the difference between `uint32` and `uint32_t`? |
| 02:58:22 | FromDiscord | <j-james> Particularly in a wrapping-C context |
| 02:59:07 | FromDiscord | <Elegantbeef> Nim's uint32 is the same as uint32\_t |
| 03:14:46 | * | xet7 quit (Remote host closed the connection) |
| 03:35:37 | * | kayabaNerve_ is now known as kayabaNerve |
| 03:35:41 | * | xet7 joined #nim |
| 03:56:37 | * | kayabaNerve quit (Remote host closed the connection) |
| 04:01:10 | * | kayabaNerve joined #nim |
| 04:06:01 | * | supakeen quit (Quit: WeeChat 3.2) |
| 04:06:30 | * | supakeen joined #nim |
| 04:40:42 | FromDiscord | <creonico> How can I use nim in web-assembly? |
| 04:42:04 | FromDiscord | <Elegantbeef> Emscripten https://github.com/treeform/nim_emscripten_tutorial |
| 04:47:28 | FromDiscord | <creonico> Does nim not have a standard wasm compilation? |
| 04:50:05 | FromDiscord | <Elegantbeef> Emscripten would be the "standard" |
| 05:37:16 | FromDiscord | <impbox [ftsf]> nim can compile to js, not wasm directly |
| 05:37:28 | FromDiscord | <impbox [ftsf]> if you want wasm, compile to c then use emscripten |
| 05:50:30 | * | xet7 quit (Remote host closed the connection) |
| 05:57:15 | * | xet7 joined #nim |
| 06:02:57 | FromDiscord | <Chiggy> Can anyone confirm me if this is a good way to continue fetching a url until a response if received? Coz the server sometimes breaks connection or something. https://media.discordapp.net/attachments/371759389889003532/877432360273068042/unknown.png |
| 06:03:40 | NimEventer | New thread by Alexeypetrushin: Why `using` not working? Bug?, see https://forum.nim-lang.org/t/8341 |
| 06:03:51 | FromDiscord | <Chiggy> (I didnt know of python's `pass` pass equivalent in nim) |
| 06:03:55 | FromDiscord | <Chiggy> (edit) "nim)" => "nim so I just used discard)" |
| 06:04:49 | FromDiscord | <impbox [ftsf]> might want to check the exception type |
| 06:05:00 | FromDiscord | <impbox [ftsf]> and probably wait a little between attempts |
| 06:07:37 | FromDiscord | <Chiggy> from what I have noticed, it seems to be protocol error always (I have only seen 5 times as of now) https://media.discordapp.net/attachments/371759389889003532/877433534699171880/unknown.png |
| 06:08:00 | FromDiscord | <impbox [ftsf]> are you reusing the client for multiple requests? |
| 06:08:04 | FromDiscord | <Chiggy> no |
| 06:08:20 | FromDiscord | <Chiggy> I just make one request each time my code runs |
| 06:08:37 | FromDiscord | <Chiggy> my code runs every minute |
| 06:10:37 | FromDiscord | <Chiggy> In reply to @impbox "and probably wait a": ig thats good? https://media.discordapp.net/attachments/371759389889003532/877434290831515648/unknown.png |
| 06:12:11 | FromDiscord | <impbox [ftsf]> i guess so, you may as well make it while true: since raw_content could be "" it'll still break |
| 06:12:51 | FromDiscord | <impbox [ftsf]> you might want to create your client inside the loop |
| 06:12:56 | FromDiscord | <impbox [ftsf]> so if it fails you get a new client |
| 06:13:10 | FromDiscord | <impbox [ftsf]> i've had issues with reusing httpclients before |
| 06:13:22 | FromDiscord | <Chiggy> In reply to @impbox "i guess so, you": Huh? The api will never return an empty string |
| 06:13:29 | FromDiscord | <Chiggy> In reply to @impbox "i've had issues with": h ok |
| 06:13:30 | FromDiscord | <Chiggy> (edit) "h" => "oh" |
| 06:13:36 | FromDiscord | <impbox [ftsf]> @Chiggy how do you know? |
| 06:13:46 | FromDiscord | <impbox [ftsf]> they might update the API |
| 06:13:58 | FromDiscord | <Chiggy> my friend is hosting the api |
| 06:14:20 | FromDiscord | <Chiggy> but yeah while true will work too |
| 06:14:30 | FromDiscord | <Chiggy> (edit) "my friend is hosting the api ... " added "so I will know if anything changes at all" |
| 06:14:39 | FromDiscord | <impbox [ftsf]> ok |
| 06:15:41 | FromDiscord | <j-james> Should I use `cint` for all of `int16, int32, uint32_t` when wrapping C code? |
| 06:15:51 | FromDiscord | <impbox [ftsf]> nope |
| 06:16:07 | FromDiscord | <impbox [ftsf]> only use cint for int in c |
| 06:16:24 | FromDiscord | <Elegantbeef> cint is the platform dependant C integer type |
| 06:16:30 | FromDiscord | <j-james> Are the rest fine as they are? |
| 06:16:35 | FromDiscord | <Elegantbeef> The others are fixed size so map to Nim fine |
| 06:17:10 | FromDiscord | <impbox [ftsf]> from my understanding cint in nim == int in c |
| 06:17:19 | FromDiscord | <Elegantbeef> actually isnt cint not platform dependant but completely user configurable? |
| 06:17:39 | FromDiscord | <impbox [ftsf]> and cuint in nim == unsigned int in c |
| 06:18:17 | FromDiscord | <Elegantbeef> Yea i just dont recall if `int` in C is user definable size 😀 |
| 06:18:30 | FromDiscord | <impbox [ftsf]> i guess it's up to the compiler |
| 06:18:35 | FromDiscord | <Elegantbeef> I know atleast one data type somewhere is configurable, just dont recall what |
| 06:19:46 | FromDiscord | <Elegantbeef> Anywho this is way off the point, if there is a bitsize in the name it's safe to use the nim variant |
| 06:22:28 | * | PMunch joined #nim |
| 06:25:18 | * | Vladar joined #nim |
| 07:38:00 | FromDiscord | <enthus1ast> https://nimble.directory/ heavily suffers from crosstalk issue, go on and hit ctrl + r a few times, it is completely broken some times, sometimes it delivers the logo on the "/" route... |
| 07:39:23 | FromDiscord | <KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=3wkP |
| 07:40:04 | FromDiscord | <enthus1ast> https://nimble.directory/ heavily suffers from crosstalk issues, go on and hit ctrl + r a few times, it is completely broken some times, sometimes it delivers the logo on the "/" route... (OK some are 429s) |
| 07:44:10 | FromDiscord | <Clonkk> you need before\_install / after\_install |
| 07:46:55 | FromDiscord | <Clonkk> Basically if you have `task b, "b":...`, you can define `before b` and `after b` (no underscore actually), this works with `install` and \`\`develop tasks as well in the nimble file↵(@KnorrFG) |
| 07:47:46 | FromDiscord | <KnorrFG> so, setting flags in a 'before install' will make install respect those flags for compilation? |
| 07:50:19 | FromDiscord | <Clonkk> For linkage, you use`after install` to install external library and then link in Nim code using pragma |
| 07:50:36 | FromDiscord | <KnorrFG> ok, ill try, thanks |
| 07:51:46 | FromDiscord | <Clonkk> Sadly, Nimble doesn't have a way to handle shared libraries properly |
| 07:56:03 | * | tdc joined #nim |
| 08:25:37 | * | max22- joined #nim |
| 09:07:13 | FromDiscord | <tandy> with object variants (https://nim-lang.org/docs/manual.html#types-object-variants) |
| 09:07:25 | FromDiscord | <tandy> can you have an object which has both types? |
| 09:08:20 | FromDiscord | <Rika> “Both”? |
| 09:08:36 | FromDiscord | <Rika> Both of what’s |
| 09:08:43 | FromDiscord | <Rika> (edit) "what’s" => "what?" |
| 09:08:54 | FromDiscord | <Elegantbeef> presently there is no reuse of the trees so you need repetitive branches if they arent identical |
| 09:09:03 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3wlh |
| 09:09:14 | FromDiscord | <Elegantbeef> no you cannot |
| 09:09:16 | FromDiscord | <tandy> hmm |
| 09:09:23 | FromDiscord | <tandy> i guess i dont need enums then |
| 09:10:11 | FromDiscord | <Elegantbeef> why are you using `Option[seq[Track]]`? |
| 09:10:38 | FromDiscord | <Elegantbeef> Seems redundant when you can just check the length, but might just be me |
| 09:10:46 | * | flynn quit (Read error: Connection reset by peer) |
| 09:11:29 | FromDiscord | <tandy> hmm i thought it would be easier to initialise |
| 09:11:32 | FromDiscord | <tandy> u might be right tho |
| 09:11:35 | FromDiscord | <Rika> It would be harder |
| 09:11:53 | * | flynn joined #nim |
| 09:12:03 | FromDiscord | <Rika> Unless an empty sequence is different from your none type, there is no reason to use option here |
| 09:12:16 | FromDiscord | <tandy> true |
| 09:12:38 | FromDiscord | <Elegantbeef> same could be said about the strings |
| 09:14:14 | FromDiscord | <Elegantbeef> Assuming `""` is unwanted it's the same s `Option[string]` |
| 09:14:34 | FromDiscord | <tandy> hmm |
| 09:14:37 | FromDiscord | <tandy> what really is the use of options then hahah |
| 09:15:02 | FromDiscord | <Elegantbeef> For types that dont have this information |
| 09:15:22 | FromDiscord | <Elegantbeef> integers, returned value objects, and so forth |
| 09:16:00 | FromDiscord | <Elegantbeef> For instance https://nim-lang.org/docs/nre.html#match%2Cstring%2CRegex%2Cint |
| 09:16:22 | FromDiscord | <Elegantbeef> It's equivlent to a `(bool, RegexMatch)` but it's an API which encourages checking the former |
| 09:16:31 | FromDiscord | <tandy> oh i remember why im using options |
| 09:16:38 | FromDiscord | <tandy> in some places anyway |
| 09:17:01 | FromDiscord | <tandy> im using jsony and when converting my types to json i discard empty options |
| 09:17:42 | FromDiscord | <Elegantbeef> Cant you do the same just with the `""` and `len > 0`, or do you not want hooks? |
| 09:19:21 | FromDiscord | <tandy> i was using hooks yeah |
| 09:19:27 | FromDiscord | <tandy> il look into it thanks |
| 09:20:28 | FromDiscord | <tandy> are there plans to add reuse? |
| 09:21:07 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/RFCs/issues/368 yes |
| 09:21:25 | FromDiscord | <tandy> the reason i was look at enums for this was because i want to have a user url which will be either last.fm/user/{} or listenbrainz.org/user/{} |
| 09:22:09 | FromDiscord | <Elegantbeef> sure but couldnt that just be an enum for `service` and then a `token: string`? |
| 09:23:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3wlk |
| 09:23:55 | FromDiscord | <Elegantbeef> Seems like it covers the same(yes i got lazy) |
| 09:24:54 | FromDiscord | <tandy> i dont get what service does in this case? also does this mean that i cant have a user for both services (for now) ? |
| 09:25:07 | FromDiscord | <tandy> is it like a toggle switch kinda |
| 09:25:11 | FromDiscord | <Elegantbeef> No, it just tells you in other code where you want to connect |
| 09:25:17 | FromDiscord | <Rika> If you want you can probably make it a set |
| 09:25:36 | FromDiscord | <Rika> So you can have a user of one or both (but it also means you can have a user of none so) |
| 09:25:52 | FromDiscord | <tandy> tbh i need to think of a better way to abstract this, because some users may have accounts on both but with different usernames |
| 09:26:03 | FromDiscord | <Rika> Then just make multiple users |
| 09:26:24 | FromDiscord | <tandy> yeah but i wanted to have them abstracted as one user on my spa |
| 09:26:33 | FromDiscord | <tandy> for convenienc |
| 09:26:38 | FromDiscord | <Elegantbeef> Ok so that's not difficult |
| 09:27:00 | FromDiscord | <Rika> Then use one User type and another linking type (maybe “ExternalUser) |
| 09:27:02 | FromDiscord | <Elegantbeef> `services: set[Service]` `userNames: array[Service, string]` |
| 09:27:11 | FromDiscord | <Rika> Then have a sequence in User of Externals |
| 09:28:07 | FromDiscord | <Rika> In reply to @Elegantbeef "`services: set[Service]` `userNames: array[Service,": You think too much in game programming style smh |
| 09:28:19 | FromDiscord | <tandy> lol |
| 09:28:28 | FromDiscord | <Elegantbeef> Was that directed to me? |
| 09:28:36 | FromDiscord | <Rika> Who else |
| 09:28:44 | FromDiscord | <Elegantbeef> Just making sure 😛 |
| 09:31:25 | FromDiscord | <tandy> i settled on this |
| 09:31:34 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3wln |
| 09:31:50 | FromDiscord | <Rika> You don’t need those to be ref objects by the way |
| 09:31:54 | FromDiscord | <Elegantbeef> Now time to bike shed the ref |
| 09:32:00 | FromDiscord | <Rika> It seems wasteful |
| 09:32:12 | FromDiscord | <Elegantbeef> A pointer to a list of pointers is just fun! |
| 09:32:44 | FromDiscord | <Rika> Beef would probably get an aneurysm when he sees what JsonNode looks like |
| 09:32:46 | FromDiscord | <tandy> oh ok lol, i wasnt really sure what it did and just kept it from other project (lol) |
| 09:32:49 | FromDiscord | <Rika> I kid, he already has |
| 09:32:59 | FromDiscord | <Elegantbeef> I know what it looks like |
| 09:33:08 | FromDiscord | <Elegantbeef> Ref is if you want a reference(managed pointer) |
| 09:33:10 | FromDiscord | <Rika> See second message |
| 09:33:55 | FromDiscord | <Elegantbeef> Rika i'm not good at anything i can atleast pretend I know better than others! |
| 09:35:34 | FromDiscord | <Elegantbeef> Also ref's give you `nil` so you dont really need `Option[SomeRef]` |
| 09:36:04 | FromDiscord | <Elegantbeef> since `ref bool` and `Option[bool]` are practically the same if you're not looking for reference semantics |
| 09:36:41 | FromDiscord | <tandy> oh thats neat |
| 09:36:43 | FromDiscord | <tandy> so options is redundant \:?) |
| 09:37:12 | FromDiscord | <Elegantbeef> It's got it's purpose, just you have to know when/where to use it |
| 09:37:34 | FromDiscord | <tandy> but with this, why would i not just use ref? |
| 09:37:53 | FromDiscord | <Elegantbeef> one is heap allocated, the other is not |
| 09:38:20 | FromDiscord | <Rika> They are different |
| 09:38:25 | FromDiscord | <Rika> They have different behaviours |
| 09:39:19 | FromDiscord | <Elegantbeef> Yea i'm mostly just talking about interaction and the fact both give n + 1 values |
| 09:39:49 | FromDiscord | <Elegantbeef> They're different, but in the case of a `ref object` and a `option[ref object]` there isnt much difference unless `nil` means something to you |
| 09:41:24 | FromDiscord | <Elegantbeef> Actually they're identical now that i think about it for pointers the option doesnt use `has` it's just `val != nil` |
| 09:58:17 | FromDiscord | <tandy> when i dont use a ref object i cant do `new(result)` |
| 10:00:58 | FromDiscord | <tandy> oh you dont need to do that at all |
| 10:31:33 | FromDiscord | <ericdp> is there a nim equivalent to elixir's doctest ? ( https://elixir-lang.org/getting-started/mix-otp/docs-tests-and-with.html tldr comments that could be feeded to the repl are unit tests) |
| 10:41:12 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wlM |
| 10:42:11 | FromDiscord | <ericdp> thanks |
| 10:45:34 | FromDiscord | <System64 ~ Flandre Scarlet> How can I make my binding more Nim-friendly please? (or is it already?) |
| 10:48:13 | FromDiscord | <hamidb80> ?! |
| 10:48:52 | FromDiscord | <haxscramper> define "more Nim-friendly" |
| 10:50:00 | FromDiscord | <System64 ~ Flandre Scarlet> Something like a Nim program↵'cause my binding looks like more a C thing no? |
| 10:50:24 | FromDiscord | <hamidb80> where are your bindings? |
| 10:51:03 | FromDiscord | <haxscramper> In reply to @System64 "Something like a Nim": You can start by removing this `tLN_` garbage prefix from all definitions |
| 10:51:05 | FromDiscord | <haxscramper> as a start |
| 10:51:49 | FromDiscord | <haxscramper> and instead use `proc normalName(): {.importcpp: "C name".}` |
| 10:52:04 | FromDiscord | <System64 ~ Flandre Scarlet> why cpp? |
| 10:52:11 | FromDiscord | <haxscramper> importc |
| 10:52:12 | FromDiscord | <System64 ~ Flandre Scarlet> I don't use C++ |
| 10:52:20 | FromDiscord | <System64 ~ Flandre Scarlet> ah alright |
| 10:52:36 | FromDiscord | <System64 ~ Flandre Scarlet> so importc, not importcpp? |
| 10:55:17 | FromDiscord | <tandy> i just realised, how will i index the sequence though? how will i know which service is which index?↵(@Rika) |
| 10:55:51 | FromDiscord | <haxscramper> In reply to @System64 "so importc, not importcpp?": Yes |
| 10:56:15 | FromDiscord | <Rika> In reply to @tandy "i just realised, how": The one beef sent uses the enum as the index |
| 10:56:22 | FromDiscord | <Rika> You can do that using arrays |
| 10:58:19 | FromDiscord | <System64 ~ Flandre Scarlet> but if I remove the tLN prefix won't people be confused from where does it come? |
| 11:00:13 | FromDiscord | <haxscramper> Then don't change wrappers at all, because someone might be confused by something somewhere, and you surely don't want that, right? |
| 11:00:32 | FromDiscord | <tandy> but the enum isnt a string, and array index has to be an ordinal type?↵(@Rika) |
| 11:00:40 | FromDiscord | <tandy> \`services\\: array[ServiceUser, Service]\` |
| 11:00:45 | FromDiscord | <Rika> Enums are ordinal |
| 11:01:18 | FromDiscord | <PsychoClay> what does `Error: 'sources' is of type <openArray[string]> which cannot be captured as it would violate memory safety,` mean? |
| 11:01:34 | FromDiscord | <haxscramper> you have a closure that tries to access `var` variable |
| 11:01:35 | FromDiscord | <tandy> oh my ordering is wrong |
| 11:02:47 | FromDiscord | <haxscramper> In reply to @PsychoClay "what does `Error: 'sources'": If closure does not outlive its environment, you can do `import std/decls; var sources {.byaddr.} = actualSources` |
| 11:03:43 | FromDiscord | <PsychoClay> but sources is a proc arg |
| 11:03:58 | FromDiscord | <haxscramper> it is a mutable proc arg? |
| 11:04:03 | FromDiscord | <PsychoClay> no |
| 11:04:17 | FromDiscord | <haxscramper> can you give a code example? |
| 11:04:36 | FromDiscord | <PsychoClay> sent a code paste, see https://play.nim-lang.org/#ix=3wlT |
| 11:07:55 | FromDiscord | <PsychoClay> i just turned it into a seq |
| 11:07:56 | FromDiscord | <haxscramper> with imports please |
| 11:08:16 | FromDiscord | <haxscramper> well, I guess it has something to do with async transformations |
| 11:08:50 | FromDiscord | <haxscramper> something somewhere created some kind of maybe closure iterator that theoretically had the capability of producing some kind of error that looked somewhat like yours |
| 11:14:44 | * | stkrdknmibalz quit (Ping timeout: 268 seconds) |
| 11:37:07 | federico3 | @Araq @dom96 did you get my email? |
| 11:42:22 | * | pro joined #nim |
| 11:43:46 | arkanoid | is it possible to "annotate" type attribute with custom pragma and read back that info at runtime? |
| 11:43:57 | FromDiscord | <System64 ~ Flandre Scarlet> @haxscramper Is it better? https://media.discordapp.net/attachments/371759389889003532/877518176307535912/Tilengine_copy.nim |
| 11:44:55 | FromDiscord | <haxscramper> https://nim-lang.org/docs/nep1.html#introduction-naming-conventions just read style guide |
| 11:51:28 | arkanoid | is it possible to get the module a symbol come from at compile time? |
| 11:54:46 | FromDiscord | <haxscramper> You mean like `getType().getParentModuleSym()`? No, this is not possible |
| 12:03:04 | * | max22- quit (Ping timeout: 256 seconds) |
| 12:04:07 | arkanoid | k |
| 12:05:33 | arkanoid | if I do $myXmlNode the output string is everything but a well formatted xml string |
| 12:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
| 12:06:32 | * | supakeen joined #nim |
| 12:14:38 | FromDiscord | <haxscramper> what is wrong exactly? |
| 12:24:01 | * | rockcavera joined #nim |
| 12:24:01 | * | rockcavera quit (Changing host) |
| 12:24:01 | * | rockcavera joined #nim |
| 12:25:24 | * | NeoCron joined #nim |
| 12:31:07 | * | arkurious joined #nim |
| 12:33:23 | FromDiscord | <System64 ~ Flandre Scarlet> ah yeah good to know↵And should I turn my bindings into more OOP thing? |
| 12:34:07 | FromDiscord | <haxscramper> I would first recommend actually using them for something, and writing required helper procs as you go |
| 12:35:09 | FromDiscord | <haxscramper> Because it is clear you don't quite understand yourself what can you improve, and neither does anyone who haven't used your library, so |
| 12:36:22 | FromDiscord | <System64 ~ Flandre Scarlet> yeah true |
| 12:39:03 | FromDiscord | <System64 ~ Flandre Scarlet> also, does nim have objects procedure? (like a method in a class in Java or classmethod in Python) |
| 12:44:53 | PMunch | You mean methods? |
| 12:45:35 | FromDiscord | <System64 ~ Flandre Scarlet> Yeah |
| 12:46:23 | FromDiscord | <System64 ~ Flandre Scarlet> And also instance méthods (you have to instanciate the class to use the méthod) |
| 12:49:49 | * | max22- joined #nim |
| 12:55:54 | arkanoid | everytime I have to write a function that may return nothing but of ref type, I'm unsure if it is more nim like to return nil or nothing(MyRefType) |
| 12:56:36 | FromDiscord | <haxscramper> what you mean by "nim like" |
| 12:56:58 | arkanoid | nim stdlib doesn't use Option |
| 12:57:21 | arkanoid | so it suggests that returnin nil is the way to go |
| 12:57:22 | FromDiscord | <haxscramper> and? you are not writing stdlib module, right? |
| 12:57:41 | FromDiscord | <haxscramper> stdlib does not use option due to multiple reasons |
| 12:57:47 | FromDiscord | <haxscramper> For example araq does not like option |
| 12:58:32 | FromDiscord | <haxscramper> is that good enough of a reason for you to change how you write code or what? Use I would use option |
| 12:58:37 | FromDiscord | <haxscramper> `none(T)` |
| 12:59:42 | FromDiscord | <haxscramper> another reason why stdlib does not use option, is that it was added 6 years ago |
| 12:59:49 | FromDiscord | <haxscramper> while stdlib is 10+ year old |
| 13:00:21 | arkanoid | the point that the creator of the language doesn't like it AND is not used in stdlib is a STRONG suggestion that it is not the nim way |
| 13:00:35 | FromDiscord | <haxscramper> NO IT IS NOT |
| 13:00:57 | FromDiscord | <haxscramper> ffs, I just can't understand why you would want to do it like this |
| 13:01:10 | FromDiscord | <haxscramper> does your code benefit from Option or not? |
| 13:01:32 | FromDiscord | <haxscramper> there is no "STRONG" suggestion for anyting, we are not Go/V, |
| 13:01:38 | FromDiscord | <haxscramper> write code how you think is good |
| 13:01:40 | arkanoid | possibly, yes, I'm writing a parser, so your hint is VERY valuable |
| 13:02:32 | FromDiscord | <haxscramper> now we are talking about something more specific. For a parser I would much rather raise than return nil, and nim parser does not return `nil` for empty nodes, instead it returns `nnkEmpty()` |
| 13:02:59 | FromDiscord | <haxscramper> Do you parse xml or custom AST? |
| 13:03:35 | arkanoid | parsing xml. Still trying to turn a wsdl document into nim modules |
| 13:05:45 | FromDiscord | <haxscramper> Then it all depends on what exactly you are parsing - like if failure is a possibility or not? |
| 13:05:52 | FromDiscord | <haxscramper> or is it an exceptional case |
| 13:06:22 | FromDiscord | <haxscramper> and if you immediately return result of the `<can fail>` and put it somewhere else you can return `Empty()` |
| 13:08:02 | arkanoid | it is actually an error when it returns none, but I'm writing an helper function and not sure if the error should be raised there, helper function should just say "none" |
| 13:36:32 | * | tdc_ joined #nim |
| 13:39:39 | * | tdc quit (Ping timeout: 268 seconds) |
| 13:47:32 | FromDiscord | <dom96> In reply to @federico3 "<@413679055897100289> <@132595483838251008> did you": we replied to the draft security issue |
| 13:47:57 | federico3 | I saw that. |
| 13:49:45 | FromDiscord | <dom96> In reply to @arkanoid "the point that the": doesn't the fact that it's in the stdlib imply that the creator at least thinks it's a valuable construct? FWIW I use it a lot in my libraries and would have used it in the stdlib if it was added earlier. |
| 14:04:41 | * | PMunch quit (Quit: Leaving) |
| 14:10:41 | FromDiscord | <konsumlamm> araq has said on multiple occasions that he doesn't really like it though |
| 14:31:32 | * | pro quit (Quit: WeeChat 3.2) |
| 14:36:08 | * | pro joined #nim |
| 14:37:56 | * | pro quit (Client Quit) |
| 14:41:11 | * | idf joined #nim |
| 14:42:12 | * | max22- quit (Ping timeout: 245 seconds) |
| 14:47:14 | FromDiscord | <Rika> Well why |
| 14:54:12 | FromDiscord | <haxscramper> I think I'm doing something wrong in the benchmark, because I doubt handwritten vtable implementation would be slower than `case of` |
| 14:56:34 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wmI |
| 15:11:15 | arkanoid | dom96: thanks for the feedback |
| 15:30:01 | * | beshr joined #nim |
| 15:35:40 | * | Gustavo6046 quit (Ping timeout: 240 seconds) |
| 15:35:41 | * | Gustavo6046_ joined #nim |
| 15:36:00 | * | Vladar quit (Quit: Leaving) |
| 15:37:37 | * | perro joined #nim |
| 15:37:44 | * | Gustavo6046_ is now known as Gustavo6046 |
| 15:38:55 | FromDiscord | <mratsim> In reply to @haxscramper "<@!570268431522201601> I wrote a": you might not be doing something wrong. My bench machine was only a dual core from 2015, I can retry your code |
| 15:40:16 | FromDiscord | <haxscramper> Yes, if you could, it would be awesome. You also need to have https://github.com/haxscramper/hack/blob/master/testing/nim/c_interop/cpp_tests/cxx_opcodes.hpp and https://github.com/haxscramper/hack/blob/master/testing/nim/c_interop/cpp_tests/nim.cfg to compile this |
| 15:41:27 | FromDiscord | <mratsim> https://media.discordapp.net/attachments/371759389889003532/877577941846994975/unknown.png |
| 15:41:44 | FromDiscord | <mratsim> `nim cpp -d:danger -r --hints:off --warnings:off --verbosity:0 testing/nim/c_interop/cpp_tests/switch_vs_dispatch.nim` |
| 15:42:45 | FromDiscord | <mratsim> on i9-9980XE overclocked at 4GHz, 18 cores, I closed VScode and my browser cause they tend to wakeup CPU at odd times. |
| 15:44:04 | FromDiscord | <mratsim> methods in the past were multidispatch though |
| 15:44:19 | FromDiscord | <mratsim> note: test done on Nim 1.4.6 |
| 15:45:08 | FromDiscord | <mratsim> I think Nim at the time was 0.19.6 or 0.20 something |
| 15:45:21 | FromDiscord | <mratsim> might be worth trying with that version |
| 15:45:22 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/4jX |
| 15:47:17 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wmV |
| 15:50:42 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wmW |
| 15:51:03 | FromDiscord | <xflywind> Maybe you should also test ref object with attributes |
| 15:51:17 | FromDiscord | <xflywind> it maybe generate a bit slow code. |
| 15:51:41 | FromDiscord | <xflywind> sent a code paste, see https://play.nim-lang.org/#ix=3wmY |
| 15:52:16 | * | max22- joined #nim |
| 16:16:17 | arkanoid | how can I fill a Table[string,string] or a StringTableRef at compile time? |
| 16:16:56 | FromDiscord | <konsumlamm> ref objects can't currently be constructed at compile time |
| 16:21:07 | arkanoid | no way to have a const table anywhere? |
| 16:22:46 | FromDiscord | <konsumlamm> shouldn't a normal `Table` work? |
| 16:22:57 | FromDiscord | <konsumlamm> just like you'd define anything else at compile time |
| 16:24:58 | FromDiscord | <konsumlamm> i.e. make the table a `const` (if you don't need to change it at runtime) or initialize it in a `static:` block |
| 16:31:19 | arkanoid | konsumlamm seems easy but I'm trying to building a const table via a recursive function and it doesn't like it |
| 16:37:09 | FromDiscord | <hamidb80> hey |
| 16:37:17 | FromDiscord | <hamidb80> when i install a package using nimble |
| 16:37:23 | FromDiscord | <hamidb80> with specified hash |
| 16:37:34 | FromDiscord | <hamidb80> nim can't find it |
| 16:38:20 | FromDiscord | <hamidb80> for example it installed `print@#head` |
| 16:38:32 | FromDiscord | <hamidb80> nim is looking for `print-1.0.0` |
| 16:38:42 | FromDiscord | <hamidb80> and can't find it |
| 16:38:58 | FromDiscord | <hamidb80> (edit) "it installed" => "i install " |
| 16:39:33 | FromDiscord | <hamidb80> @treeform are you around? |
| 16:40:16 | FromDiscord | <hamidb80> i think you didn't update your package info |
| 16:42:01 | FromDiscord | <treeform> where? |
| 16:42:37 | FromDiscord | <hamidb80> in `print.nimble` |
| 16:42:58 | FromDiscord | <hamidb80> print 1.0.0 still has that bug that you fixed in head |
| 16:43:01 | FromDiscord | <hamidb80> (edit) "head" => "`head`" |
| 16:43:17 | FromDiscord | <hamidb80> and nimble automacally downaloads print 1.0.0 |
| 16:43:31 | FromDiscord | <hamidb80> (edit) "print 1.0.0" => "`print-1.0.0`" |
| 16:43:46 | FromDiscord | <hamidb80> when i enter `nimble install print` |
| 16:44:13 | FromDiscord | <treeform> ok |
| 16:44:18 | FromDiscord | <treeform> which bug? |
| 16:44:36 | FromDiscord | <hamidb80> https://github.com/treeform/print/issues/11 |
| 16:45:21 | FromDiscord | <treeform> oh yeah |
| 16:45:22 | FromDiscord | <hamidb80> maybe updating version in `print.nimble` to 1.0.1 fixes this issue |
| 16:45:25 | FromDiscord | <treeform> will cut new version now |
| 16:46:24 | FromDiscord | <treeform> done https://github.com/treeform/print/releases/tag/1.0.1 |
| 16:46:49 | FromDiscord | <hamidb80> In reply to @hamidb80 "nim is looking for": but it's super wierd |
| 16:50:06 | FromDiscord | <treeform> what do you mean? |
| 16:50:41 | FromDiscord | <treeform> thank you for reporting the bug btw |
| 16:51:13 | FromDiscord | <Erik L> Hello, any ideas what to do to prevent nimsuggest to go to 100% cpu usage in Mac Os and VS Code? |
| 16:51:28 | arkanoid | SOLVED! |
| 16:51:35 | arkanoid | ups, sorry for the caps |
| 16:51:48 | * | xet7 quit (Remote host closed the connection) |
| 16:52:25 | * | xet7 joined #nim |
| 16:53:03 | FromDiscord | <hamidb80> In reply to @treeform "what do you mean?": issue fixed after you released a new version 😕 |
| 16:53:06 | FromDiscord | <hamidb80> (edit) "In reply to @treeform "what do you mean?": ... issue" added "the" |
| 16:54:34 | FromDiscord | <treeform> In reply to @Erik L "Hello, any ideas what": Disable it 😦 |
| 16:58:03 | FromDiscord | <jseb> excuse me, how to declare `uSeconds` for uSleep ? I've imported `posix` and tried `uSleep(0)` , `uSleep(0.uSeconds)` , `uSleep(cast[uSeconds](0))` _(doh)_ . But compiler keeps telling me _undeclared identifier uSeconds_ |
| 16:59:09 | FromDiscord | <Rika> capital U |
| 16:59:14 | FromDiscord | <Rika> Useconds |
| 16:59:30 | FromDiscord | <jseb> omg |
| 17:48:30 | arkanoid | is it possible to cast a global let variable into something that doesn't trigger effects? |
| 17:48:48 | arkanoid | I need an escape hatch not on a proc but on a variable |
| 17:59:52 | FromDiscord | <Elegantbeef> the `{.noSideEffect.}:` works regardless if the side effect comes from a global variable or a function https://play.nim-lang.org/#ix=3wnu |
| 18:00:09 | FromDiscord | <undersquire> why cant you use func in parameters? |
| 18:00:16 | FromDiscord | <undersquire> i see no reason why u cannot |
| 18:01:07 | FromDiscord | <Elegantbeef> It's not a limitation of idea but implementation, you'll need to use `proc(){.noSideEffect.}` until `func` is allowed |
| 18:01:56 | FromDiscord | <deech> Is there a sense for how stable `views` are right now? I keep up with `devel` wanted to get a feel for whether any projects are using them extensively. |
| 18:09:00 | FromDiscord | <krisppurg> Is there in any way I could reduce memory usage in nim, I am compiling with ORC, but it still is not as that as effective? https://media.discordapp.net/attachments/371759389889003532/877615074494267392/unknown.png |
| 18:09:10 | FromDiscord | <undersquire> In reply to @Elegantbeef "It's not a limitation": ye, just curious as it has an error message saying it cant be used here, but just saw no reason for why |
| 18:13:14 | FromDiscord | <Yardanico> In reply to @krisppurg "Is there in any": You can try debugging with things like heaptrack to see where does it allocate all that memory |
| 18:13:18 | FromDiscord | <Yardanico> Is it open source? |
| 18:13:34 | FromDiscord | <krisppurg> You mean my code? |
| 18:15:23 | FromDiscord | <Yardanico> Yeah |
| 18:16:33 | FromDiscord | <krisppurg> Nope, I was going to make it open source, but then I thought setting it up with git would be a problem because of where I would push changes |
| 18:16:56 | FromDiscord | <krisppurg> but I send it here |
| 18:17:18 | FromDiscord | <krisppurg> (edit) "but I send it here ... " added "if i am allowed to" |
| 18:18:03 | FromDiscord | <Yardanico> Well you can try heaptrack yourself |
| 18:18:21 | FromDiscord | <Yardanico> Is the usage high because you think ORC isn't collecting something it should? |
| 18:18:24 | FromDiscord | <Yardanico> What about refc? |
| 18:18:29 | FromDiscord | <krisppurg> How do I debug with heaptrack? |
| 18:18:37 | FromDiscord | <krisppurg> Well sort of high |
| 18:19:03 | FromDiscord | <krisppurg> https://media.discordapp.net/attachments/371759389889003532/877617605718974474/unknown.png |
| 18:25:28 | FromDiscord | <leorize> @krisppurg\: try `-d:useMalloc` |
| 18:25:44 | FromDiscord | <Yardanico> also --debugger:native |
| 18:25:48 | FromDiscord | <Yardanico> and then just run heaptrack on your binary |
| 18:26:10 | NimEventer | New thread by Alexeypetrushin: Why `except` doesn't catch `SIGSEGV: Illegal storage access. (Attempt to read from nil?)`?, see https://forum.nim-lang.org/t/8342 |
| 18:26:29 | FromDiscord | <leorize> Nim's allocator doesn't return the memory to the OS most of the time |
| 18:26:48 | FromDiscord | <leorize> also if you're using asyncdispatch, then memory inflation is a known side-effect |
| 18:27:03 | FromDiscord | <Yardanico> well, but he's comparing it to refc which uses 2x less memory |
| 18:28:12 | FromDiscord | <leorize> it's fairly unstable. Araq#0647 had been talking about how he thinks views design still need a few revisions↵(@deech) |
| 18:30:40 | * | max22- quit (Ping timeout: 256 seconds) |
| 18:35:48 | FromDiscord | <krisppurg> be right back im trying to install gdb (which is used for heaptrack), but for some reason my download speed is slow |
| 18:37:11 | FromDiscord | <Yardanico> change mirrors? :P |
| 18:46:48 | madprops | if c not in a_bowels: |
| 18:46:52 | madprops | what's wrong with this? |
| 18:47:09 | madprops | "expected: ':', but got: 'keyword not'" |
| 18:49:07 | madprops | oh there's notin |
| 18:49:36 | FromDiscord | <Yardanico> there's no "not in" in nim, you have to use notin |
| 18:49:55 | FromDiscord | <Yardanico> or you can also write it as "not_in" as nim's case insensitivity rules apply to keywords as well |
| 18:50:04 | FromDiscord | <Yardanico> so p_R_o_C is the same as proc :) |
| 18:50:08 | FromDiscord | <Yardanico> now you have to live with that knowledge |
| 18:51:18 | madprops | is there a reason why notin exists? |
| 18:51:29 | FromDiscord | <Yardanico> because nim is not python :P |
| 18:51:54 | madprops | i guess it makes compilation parsing easier |
| 18:58:49 | FromDiscord | <undersquire> isnt notin a function? |
| 18:58:58 | FromDiscord | <undersquire> (edit) "function?" => "function defined by stdlib?" |
| 18:59:28 | FromDiscord | <undersquire> sent a code paste, see https://play.nim-lang.org/#ix=3wnM |
| 19:00:03 | FromDiscord | <Elegantbeef> it's some sugar that does `not(x in y)` |
| 19:00:48 | FromDiscord | <Elegantbeef> But yes it's in the stdlib |
| 19:02:08 | FromDiscord | <undersquire> so is `in` right? |
| 19:02:18 | FromDiscord | <undersquire> at this point everything is a function 😉 |
| 19:02:25 | FromDiscord | <undersquire> (which is honestly really cool( |
| 19:02:27 | FromDiscord | <undersquire> (edit) "cool(" => "cool)" |
| 19:02:31 | FromDiscord | <Elegantbeef> well they're templates but yes |
| 19:02:56 | FromDiscord | <Elegantbeef> They're all operators though hence the infix abillities |
| 19:03:28 | FromDiscord | <undersquire> yeah |
| 19:03:38 | FromDiscord | <undersquire> In reply to @Elegantbeef "well they're templates but": yeah i meant that Xd |
| 19:10:55 | * | max22- joined #nim |
| 19:11:37 | madprops | so I'm trying to have a random seed for sample selectio |
| 19:11:37 | madprops | var r_gen = initRand(int(epochTime())) |
| 19:11:58 | madprops | is there way to have that be in milliseconds ... or is there a better way to produce a "unique" rng? |
| 19:12:36 | FromDiscord | <Yardanico> ehm |
| 19:12:39 | FromDiscord | <Yardanico> random by default uses time already |
| 19:12:55 | FromDiscord | <Yardanico> ah, you want a stateful random seed generator |
| 19:13:15 | FromDiscord | <Yardanico> @madprops see how randomize does it - https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/random.nim#L627 |
| 19:13:32 | madprops | i don't reallly need the seed. but using random wasn't giving out random results, it seems to use some sort of default seed |
| 19:13:47 | FromDiscord | <Yardanico> you need to call `randomize()` first |
| 19:13:58 | FromDiscord | <Yardanico> that will initialize the global rng state |
| 19:14:17 | FromDiscord | <Yardanico> but if you don't need a global state, you can just use the code from the link I gave |
| 19:14:52 | madprops | ah i see |
| 19:16:44 | FromDiscord | <Yardanico> but generally you can use any seed you want, just remember to not use random for cryptographic purposes |
| 19:20:48 | FromDiscord | <deech> Is there a `compiles(...)` like thing that also captures the suggestions and error message that would have been printed to stderr? Same with `typeof(...)`. |
| 19:21:36 | FromDiscord | <Yardanico> don't think so |
| 19:21:45 | FromDiscord | <Yardanico> i think you'll have to write a compiler plugin or something if you want this functionality |
| 19:28:03 | FromDiscord | <Yardanico> or if you code is self-contained, you can do it the dirty way and write the code to the nim file, run nim compiler on it and capture the result :D |
| 19:28:51 | FromDiscord | <deech> Would be useful I think, something like `compilesWithSuggestions` which outputs candidates and which argument failed to match in some structured way, maybe even a Nim object. |
| 19:30:47 | FromDiscord | <undersquire> i mean couldnt u just use execCmd or wtever it is and call the nim compiler and just get the result as a string? |
| 19:30:58 | FromDiscord | <undersquire> you would have to manually parse the result information though |
| 19:31:33 | FromDiscord | <undersquire> https://nim-lang.org/docs/osproc.html#execProcess%2Cstring%2Cstring%2CopenArray%5Bstring%5D%2CStringTableRef%2Cset%5BProcessOption%5D |
| 19:31:41 | FromDiscord | <undersquire> why was that so long tf |
| 19:32:26 | FromDiscord | <Yardanico> In reply to @undersquire "i mean couldnt u": that requires the code to be self-contained |
| 19:32:37 | FromDiscord | <Yardanico> and deech is asking to do that on compile-time which is a bit more complicated |
| 19:32:50 | FromDiscord | <Yardanico> In reply to @undersquire "why was that so": because it encodes the name of the proc along with all arguments |
| 19:33:09 | FromDiscord | <undersquire> In reply to @Yardanico "and deech is asking": oh |
| 19:33:10 | FromDiscord | <Yardanico> so the browser can jump right to it |
| 19:33:17 | FromDiscord | <undersquire> ah ok |
| 19:33:22 | FromDiscord | <Yardanico> anyway, execProcess wouldn't work at compile-time |
| 19:33:37 | FromDiscord | <undersquire> u cant use it in a static context can you? |
| 19:33:40 | FromDiscord | <undersquire> or no |
| 19:34:01 | FromDiscord | <Yardanico> In reply to @Yardanico "anyway, execProcess wouldn't work": ^ |
| 19:34:02 | FromDiscord | <undersquire> sent a code paste, see https://play.nim-lang.org/#ix=3wnW |
| 19:34:12 | FromDiscord | <undersquire> ye k |
| 20:20:28 | * | supakeen quit (Remote host closed the connection) |
| 20:20:42 | arkanoid | do you know if someone has already built a macro that given a type builds it's init? I mean a proc where all the object's attributes are layed horizontally as proc parameters just like an init |
| 20:20:53 | * | supakeen joined #nim |
| 20:24:59 | FromDiscord | <Elegantbeef> Apparently my construct macro does, not that i remember including that https://github.com/beef331/constructor#construct |
| 20:25:25 | FromDiscord | <Elegantbeef> All required though, cause if you want them optional, use the object constructor syntax |
| 20:27:40 | arkanoid | great! thanks beef! |
| 20:33:04 | FromDiscord | <undersquire> In reply to @Elegantbeef "Apparently my construct macro": this is really cool! |
| 20:34:40 | * | beshr quit (Ping timeout: 240 seconds) |
| 21:24:00 | * | tdc_ quit (Ping timeout: 268 seconds) |
| 21:25:16 | NimEventer | New Nimble package! notcurses - A low-level Nim wrapper for Notcurses: blingful TUIs and character graphics, see https://github.com/michaelsbradleyjr/nim-notcurses |
| 21:25:50 | * | kayabaNerve quit (Ping timeout: 268 seconds) |
| 21:49:19 | FromDiscord | <undersquire> wow i never realized how close nim syntax is to pascal |
| 21:49:25 | * | max22- quit (Quit: Leaving) |
| 21:51:10 | FromDiscord | <Yardanico> In reply to @undersquire "wow i never realized": yeah, nim is quite influenced by pascal, in fact nim's compiler was written in Object Pascal in the past before being rewritten in Nim itself |
| 21:51:24 | FromDiscord | <undersquire> lol htats pretty cool |
| 21:51:48 | FromDiscord | <undersquire> Nim feels like modern pascal now after comparing the two |
| 21:51:58 | FromDiscord | <undersquire> (edit) "two" => "syntax's" |
| 21:53:09 | FromDiscord | <tandy> why does seq.add() need to have a var string? |
| 21:53:21 | FromDiscord | <Yardanico> huh? |
| 21:55:11 | FromDiscord | <tandy> im trying to add a parameter from a proc into a seq |
| 21:55:40 | FromDiscord | <tandy> oh |
| 21:55:41 | FromDiscord | <Yardanico> but it doesn't need to be a var string, can you show the full error and the code? |
| 21:55:44 | FromDiscord | <tandy> wait i think i know why |
| 21:56:01 | FromDiscord | <tandy> its the seq which im adding it to |
| 21:56:07 | FromDiscord | <tandy> can i pass by reference in nim? |
| 21:56:14 | FromDiscord | <Yardanico> use `var` |
| 21:56:27 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html#procedures-var-parameters |
| 21:57:05 | FromDiscord | <tandy> nice that works |
| 21:57:17 | FromDiscord | <Yardanico> also, you don't usually need to optimize pass-by-reference yourself, Nim will pass by reference if it thinks that it's better for performance |
| 21:57:22 | FromDiscord | <Yardanico> `var` in parameters is used for mutability |
| 21:58:06 | * | byanka joined #nim |
| 21:58:24 | FromDiscord | <tandy> i see, that makes sense |
| 22:09:22 | FromDiscord | <treeform> In reply to @Ayy Lmao "Has anyone gotten pixie": I remember having this problem with visual studio, I think we fixed it, but maybe the problem is back, you can just disable the SIMD with -d:pixieNoSimd and that should make it compile. |
| 22:10:11 | FromDiscord | <Elegantbeef> I assume tandy you got confused by the mismatch error message? |
| 22:10:28 | FromDiscord | <tandy> yepp |
| 22:10:59 | FromDiscord | <Elegantbeef> I should add that `Atleast one mismatch due to a parameter not being mutable` |
| 22:11:58 | FromDiscord | <tandy> that would be much clearer |
| 22:12:11 | FromDiscord | <Elegantbeef> Well it'd still say the mismatches, but it'd give more concise errors |
| 22:12:18 | FromDiscord | <Elegantbeef> Though i think there are other PR's that also help |
| 22:39:09 | * | NeoCron quit (Remote host closed the connection) |
| 22:44:41 | * | kayabaNerve joined #nim |
| 23:08:04 | FromDiscord | <Ayy Lmao> In reply to @treeform "I remember having this": Yeah I am able to compile it with `-d:pixieNoSimd` on visual studio |
| 23:10:53 | * | stkrdknmibalz joined #nim |
| 23:13:28 | FromDiscord | <treeform> We are able to use simd with visual studio |
| 23:13:39 | FromDiscord | <treeform> maybe your nimsimd package is old? |
| 23:13:52 | FromDiscord | <treeform> maybe your visual studio is older or newer then what we use? |
| 23:37:27 | FromDiscord | <Ayy Lmao> @treeform It seems to be specifically when compiling to c++ for me |
| 23:38:39 | FromDiscord | <Ayy Lmao> The errors have the note `note: Conversion from 'void' to pointer to non-'void' requires an explicit cast` |
| 23:47:27 | madprops | what's wrong here? s &= &"{i + 1}) {s}" |
| 23:48:20 | madprops | oh wait |
| 23:48:59 | FromDiscord | <Elegantbeef> You found out nothing was wrong 😀 |
| 23:51:12 | madprops | I have a question though |
| 23:51:20 | madprops | if I do.. var new_array: seq[string] |
| 23:51:33 | madprops | without initializing it, I can still add stuff to it later, why is that? |
| 23:51:43 | madprops | i mean why is specifying the type enough |
| 23:51:48 | FromDiscord | <Elegantbeef> Cause nim seq's and string's are not nilable |
| 23:52:13 | FromDiscord | <Elegantbeef> As such they're 0 init'd to a usable sequence |
| 23:53:09 | FromDiscord | <konsumlamm> ig by 0 init'd you mean they're initialized to an empty seq/string |
| 23:53:49 | FromDiscord | <Elegantbeef> Yea didnt mean 0 init'd but yea |
| 23:54:02 | FromDiscord | <Elegantbeef> just they're init'd to something usable which reduces errors |
| 23:54:07 | madprops | i see |