<< 20-08-2023 >>

00:04:02FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=4E09
00:04:03FromDiscord<etra> stfu and just reply lol
00:04:13FromDiscord<etra> (edit) "stfu and just reply ... lol" added "the specific question"
00:23:12FromDiscord<burnysc2> sent a code paste, see https://play.nim-lang.org/#ix=4E0e
00:24:46FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4E0f
00:26:00FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4E0g
00:26:04FromDiscord<Elegantbeef> Since there is a procedure variant of `splitWhiteSpace`
00:28:47FromDiscord<burnysc2> with your first example i would end up like in the playground, with `seq[seq[string]]`, but i'd also want to have them as integers (i know map would probably be useful here, but coming from python i was wondering if 2d seq comprehesion also worked)↵↵surprisingly, with your second example we will end up with a 1d seq `@["1", "2", "3", "4", "5", "6", "7", "8", "9"]` (dont ask me why)
00:29:31FromDiscord<odexine> Collect might be flattening
00:29:50FromDiscord<Elegantbeef> Oh i missed the parse
00:29:59FromDiscord<Elegantbeef> I mean it appends to the collection so that's why it flattens it
00:30:31FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=4E0h
00:30:47FromDiscord<huantian> (edit) "https://play.nim-lang.org/#ix=4E0h" => "https://play.nim-lang.org/#ix=4E0i"
00:32:02FromDiscord<huantian> In reply to @Elegantbeef "I mean it appends": I think it's cus collect uses the iterator version of `splitWhiteSpace`?
00:32:13FromDiscord<huantian> if you use `row.splitWhiteSpace().toSeq` it doesn't flatten
00:32:50FromDiscord<burnysc2> In reply to @huantian "you can do nested": this didnt work for me sadly <https://play.nim-lang.org/#ix=4E0j>
00:33:42FromDiscord<burnysc2> nevermind - sorry, had a typo, that worked thank you!
00:33:50FromDiscord<jviega> I missed the discussion about bit shifting, but shifting != rotating. The two variants of shifting map to whether you do sign extension or not. I've never seen much of a use for signed shifting other than strength reduction when optimizing
00:53:06FromDiscord<odexine> in nim the docs for shr and ashr seem to suggest that they do the same thing
01:01:02FromDiscord<jviega> At the machine level they sure don't
01:01:14FromDiscord<jviega> And I've used shl and shr, they don't rotate
01:01:33FromDiscord<jviega> (even in nim I mean)
01:03:49FromDiscord<jviega> x86 does have a rotate instruction, and most C compilers should be good enough to know that if you do `(x << n) | x >> (64-n))` to turn it into a rotl
01:08:36FromDiscord<odexine> I do believe that they don’t rotate but I mean more of that they both sign extend it seems
01:09:52FromDiscord<jviega> Depends on the data type
01:10:02FromDiscord<jviega> If it's an uint it doesn't
01:10:27FromDiscord<jviega> It's the same in C
01:10:29FromDiscord<odexine> Does shift right sign extend for signed in C? I don’t
01:10:30FromDiscord<odexine> Okay
01:10:34FromDiscord<odexine> Was just about to ask
01:10:36*azimut quit (Ping timeout: 246 seconds)
01:10:48FromDiscord<jviega> I have always hated that, since rarely do people want sign extension even when it's a signed int
01:30:00*marcus quit (Remote host closed the connection)
01:31:58*marcus joined #nim
01:56:01FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=4E2n
02:01:45*fallback quit (Ping timeout: 245 seconds)
02:10:01*fallback joined #nim
02:26:17*lucasta_ quit (Ping timeout: 260 seconds)
02:30:18FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4E2F
02:30:38FromDiscord<odexine> Since forever, ignore the warning
02:30:48FromDiscord<heysokam> i haven't had that warning ever
02:30:59FromDiscord<odexine> I’ve seen it for a long time
02:31:21FromDiscord<heysokam> i have seen it for files that are not named like the package... but... for `src`?
02:47:47FromDiscord<jviega> I think the structure they want is different depending on whether you are doing a library, cmd, or mixed. But it's all rubbish and nimble is effectively never getting more development. Ubdoubtedly, it will go away and Atlas will replace it anyway
02:51:22*rockcavera quit (Remote host closed the connection)
02:57:03FromDiscord<odexine> Personally I’d rather it improve alongside but oh well
03:01:50FromDiscord<dromedariodechapeu> Does anyone know of any language made with Nim? Don't need to be a stable or big lang.
03:07:01FromDiscord<Elegantbeef> https://min-lang.org/learn/↵https://h3rald.com/mn/↵https://arturo-lang.io/
03:14:06FromDiscord<Chronos [She/Her]> Our language will probably briefly be in that last before the compiler is rewritten to be self-hosting lol
03:20:27FromDiscord<Elegantbeef> Just always keep a branch written in Nim for posterity sake! 😄
03:21:02FromDiscord<Chronos [She/Her]> Pffff that sounds horrid
03:21:29FromDiscord<Elegantbeef> Why? You can say "Nim will no longer be used", but you work is still there
03:21:32FromDiscord<Chronos [She/Her]> ~~Instead I'll add nim codegen as a backend and have nimsources, just like how C has csources~~
03:21:44FromDiscord<Elegantbeef> your work\
03:21:54FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Why? You can say": It'd already be saved as a tag, no? As the last release
03:22:00FromDiscord<Chronos [She/Her]> Last Nim release
03:22:23FromDiscord<Elegantbeef> That works aswell, just something linking back to use it as reference if anyone needs it
03:22:56FromDiscord<Chronos [She/Her]> Idk why someone would need it but fair
03:23:26FromDiscord<Elegantbeef> Someone did quite literally just ask "Any languages written in Nim?" 😛
03:41:04termerI almost rewrote my scripting lang's interpreter in Nim
04:01:45*dithpri quit (Ping timeout: 246 seconds)
04:05:55FromDiscord<Elegantbeef> Is naming a program that calls nim doc on a package 'dawker' too on the nose?
04:14:12termerJust realized I forgot to stream today
04:14:24termerElegantbeef, Makes me think of DOcker
04:14:25termer*docker
04:19:43FromDiscord<Elegantbeef> Yea but I cannot use that 😛
04:25:49FromDiscord<odexine> doxer not to be confused with doxxer
04:25:53FromDiscord<odexine> :baqua:
04:44:20*fallback quit (Ping timeout: 256 seconds)
04:50:21*fallback joined #nim
04:57:26*jmd_ joined #nim
05:42:50FromDiscord<that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4E3f
05:42:56FromDiscord<that_dude.> (edit) "https://play.nim-lang.org/#ix=4E3f" => "https://play.nim-lang.org/#ix=4E3g"
05:44:53FromDiscord<that_dude.> Would it just be a better idea just to use something like `temp = temp[0 ..< temp.len - dist]`?
06:12:36FromDiscord<Phil> It will never not fuck me up that in common speak it is "try-catch" but in the nim language it is written as "try-except"
06:14:14FromDiscord<Elegantbeef> I mean python is also try except isnt iit?
06:15:42FromDiscord<Phil> Yeh, it's less that the language construct is rare or anything, it's the discrepancy between how the term is coined (in my head at least) and how it is expressed in programming
06:16:49FromDiscord<Phil> Given that you always "throw" exceptions in any exception-having language as that kind of wording is ubiquitous, it thus makes sense to also always "catch" exceptions.↵Instead we "except" them which wording wise is always a stumbling block
06:17:20FromDiscord<Phil> Though I guess I'm wrong there as sometimes it is "raise new Exception" rather than "throw new Exception"
06:17:26FromDiscord<odexine> In reply to @isofruit "Given that you always": Raise
06:17:34FromDiscord<odexine> Some languages use raise
06:18:32FromDiscord<Phil> Still, "throw-catch" wording wise seems like the more intuitive pair compared to "throw-except", "raise-except" or "raise-catch"
06:19:53FromDiscord<Phil> sent a long message, see http://ix.io/4E3p
06:20:13FromDiscord<Phil> (edit) "http://ix.io/4E3p" => "http://ix.io/4E3q"
06:20:46FromDiscord<Phil> (edit) "http://ix.io/4E3q" => "http://ix.io/4E3r"
06:20:59FromDiscord<Elegantbeef> I do that unless this exception is raised
06:21:27FromDiscord<Elegantbeef> https://github.com/beef331/docunimit well this is as close as I get to that whole generating a pdf for packages locally
06:22:12FromDiscord<ShalokShalom (ShalokShalom)> FSharp does "try ... with"
06:22:32FromDiscord<ShalokShalom (ShalokShalom)> And that is a perfect showcase of declarative naming, that Phil is describing
06:23:13FromDiscord<ShalokShalom (ShalokShalom)> People focus on either the imperative point of view, so towards the machine. Or you describe a thing towards the user
06:24:22FromDiscord<ShalokShalom (ShalokShalom)> So you describe it, that it speaks towards a human, put yourself in the position of somebody who reads it. Or you describe on a technical level, what it does on the device itself. Very different wording
06:24:41FromDiscord<ShalokShalom (ShalokShalom)> Most people seem to be not even aware, that there is this distinction.
06:25:52FromDiscord<ShalokShalom (ShalokShalom)> sent a code paste, see https://play.nim-lang.org/#ix=4E3u
06:29:32FromDiscord<Phil> Yeah try-with also groks with me.↵"Try X with DividedByZeroException causing Y"
06:31:40FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4E3v
06:37:08FromDiscord<ShalokShalom (ShalokShalom)> It is just one more example, of how people ignore that we read code 10x as often as we write it.↵(@Phil)
06:42:00FromDiscord<ShalokShalom (ShalokShalom)> And that they cant put themself into the position of someone, who just reads the code as English text. \:)
06:42:48FromDiscord<ShalokShalom (ShalokShalom)> I am currently pretty absorbed by the fish scripting language
06:42:51FromDiscord<Phil> My perspective is just that the code you read generates an english sentence in my head.↵If that sentence is weird, the code is weird.
06:42:59FromDiscord<ShalokShalom (ShalokShalom)> Yep
06:43:20FromDiscord<Phil> So I think a lot of "What does this code express" rather than "what does it do"
06:43:32FromDiscord<ShalokShalom (ShalokShalom)> Its just requiring to level up or down the abstraction in your head
06:43:49FromDiscord<ShalokShalom (ShalokShalom)> You have to translate internally and that makes it complicated
06:43:54FromDiscord<Phil> And OO drives me up the wall with that because constructing coherent english with that seems incredibly rough.
06:44:05FromDiscord<ShalokShalom (ShalokShalom)> Yeah, that too
06:44:11FromDiscord<ShalokShalom (ShalokShalom)> OO is just the worst
06:44:39FromDiscord<ShalokShalom (ShalokShalom)> Imperative is sometimes useful, particularly if you really want to describe, what happens on the hardware
06:45:18FromDiscord<ShalokShalom (ShalokShalom)> But OO just makes no sense at all. Particularly, since it tries to explain the world in a way, that is not reflective of reality.
06:45:32FromDiscord<ShalokShalom (ShalokShalom)> DDD is very hard due to that, obviously.
06:45:41FromDiscord<Elegantbeef> Lies everything is an object! Just don't say that near a feminist
06:46:57FromDiscord<Phil> Too late beef, I am in chat
06:47:22FromDiscord<Elegantbeef> Oh noes
06:47:40FromDiscord<Phil> Time to copy paste code from my project in here and watch you dispair at the code-style
06:51:20FromDiscord<odexine> Maybe I’m strange but I don’t read code into a natural language
06:51:32FromDiscord<Elegantbeef> I don't either
06:51:49FromDiscord<Elegantbeef> I generally attempt to reason the state and store that
06:57:49*rockcavera joined #nim
07:07:14FromDiscord<heysokam> if you guys don't know `lazygit`, its amazing. so handy
07:07:51FromDiscord<heysokam> can even run graffiti push from inside it with some custom commands, that are saved. legit time saver
07:10:10FromDiscord<Phil> How do I get the memory-address of a ref in hex-representation again?↵Would like to use that for logging where in a heap an object is from
07:10:53FromDiscord<Elegantbeef> `repr` or `cast[uint64](youRef).toHex`
07:12:46FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4E3J
07:13:03FromDiscord<Elegantbeef> So add `0x` beforeit 😄
07:13:14*azimut joined #nim
07:13:45FromDiscord<Phil> But what is the 0x stand for?
07:13:52FromDiscord<odexine> That it’s a hex number
07:14:03FromDiscord<odexine> 0x hex↵0b binary↵0o octal
07:14:03FromDiscord<Elegantbeef> It's just a human friendly "this is a hex"
07:14:07FromDiscord<Elegantbeef> It's not used in any other way
07:14:32FromDiscord<Elegantbeef> If you notice colours are often prefixed with `#` and it's also as pointless
07:14:51FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4E3K
07:15:23FromDiscord<Phil> That is a value from a 7 month old quesiton so that should be also an address from a 64 bit system 🤔 ↵https://stackoverflow.com/questions/75122597/understanding-hexadecimal-and-memory-addresses
07:15:37FromDiscord<Elegantbeef> You generally axe hex at the start when the nibbles are 00
07:15:49FromDiscord<Elegantbeef> But also memory addresses are only 40 someodd bits
07:15:58FromDiscord<Elegantbeef> Cannot remember if it's 48 or 40
07:20:21FromDiscord<ShalokShalom (ShalokShalom)> sent a code paste, see https://play.nim-lang.org/#ix=4E3L
07:21:09FromDiscord<ShalokShalom (ShalokShalom)> I know, that I didnt. So I created that abstraction. But what it does technically, is to work together with an `if` statement, so it gives\:if argument\_is\_provided
07:23:00FromDiscord<Phil> why not `has_argument` 😛 ↵But yeah I agree, I could see something about arguments but the rest is a lot of questionmarks and requires you to "just know"
07:23:04FromDiscord<ShalokShalom (ShalokShalom)> etc. That reads normally, like English. And on top of that\: It does technically not check if there is an argument at all, as the description says. It does technically check, if there is at least one argument. The syntax kinda indicates that, and this is how you have to understand the implementation.But did I say at\_least\_one\_argument?
07:23:41FromDiscord<ShalokShalom (ShalokShalom)> No. Because this is not what I wanted. I dont care about the implementation. I care about what the function does for me, not for the computer.
07:23:53FromDiscord<ShalokShalom (ShalokShalom)> if has argument?↵(@Phil)
07:24:02FromDiscord<ShalokShalom (ShalokShalom)> That sounds corky to me. \:P
07:24:25FromDiscord<Phil> Ah fair, no object context.↵shell_has_argument or script_has_argument
07:24:30FromDiscord<ShalokShalom (ShalokShalom)> And then comes the wonderful world of documentation into play \:D↵(@Phil)
07:24:37FromDiscord<Phil> For boolean checks I tend to very quickly fall back to my defaults
07:24:43FromDiscord<ShalokShalom (ShalokShalom)> yeah, command in that sense↵(@Phil)
07:24:48FromDiscord<ShalokShalom (ShalokShalom)> Remind, fish is a shell.
07:25:13FromDiscord<ShalokShalom (ShalokShalom)> So I ask if the user has provided an argument to my command, and I act in response to that. \:)
07:25:20FromDiscord<Phil> Also fair
07:30:16FromDiscord<ShalokShalom (ShalokShalom)> Its nice that its functions all the way down, in a sense. Since I dont need to care about the distinction between objects, scripts, or anything
07:31:36FromDiscord<ShalokShalom (ShalokShalom)> I can just say `if argument is provided` and so on
07:31:52FromDiscord<ShalokShalom (ShalokShalom)> or simply `if status_is_positive` \:)
07:32:44FromDiscord<ShalokShalom (ShalokShalom)> I would just wish, I could use spaces, but for that, I would need to change the language \:P
07:33:36FromDiscord<ShalokShalom (ShalokShalom)> Interestingly, Douglas Crockford also thinks that is the perfect solution
07:35:57*azimut quit (Ping timeout: 246 seconds)
07:36:17*azimut joined #nim
07:37:40FromDiscord<ShalokShalom (ShalokShalom)> He suggests this for "the language after Javascript" that he proposes. \:)
07:40:38FromDiscord<ShalokShalom (ShalokShalom)> I am talking about the snake\_case here \:D
08:46:47FromDiscord<System64 ~ Flandre Scarlet> Does someone knows how to compile to Android without gradle and stuff?
08:47:00FromDiscord<System64 ~ Flandre Scarlet> (edit) "Does" => "hi↵Does" | "stuff?" => "stuff please?"
09:08:58FromDiscord<ShalokShalom (ShalokShalom)> Something for Elegant maybe\: https://lunatic.solutions/
09:09:03FromDiscord<ShalokShalom (ShalokShalom)> Its with wasmtime
09:12:14FromDiscord<ShalokShalom (ShalokShalom)> There is a nice video around this\: https://www.youtube.com/watch?v=HdWEA_erA6w
09:16:26FromDiscord<Elegantbeef> Seems like a wasm runtime that allows you to describe the exposed WASI api
09:16:27FromDiscord<Elegantbeef> Not overly interesting to me
09:17:12FromDiscord<ShalokShalom (ShalokShalom)> well, it makes actors of your non-actor code
09:18:01FromDiscord<Elegantbeef> Nice something I do not need 😛
09:21:58FromDiscord<ShalokShalom (ShalokShalom)> I guessed so
09:24:37FromDiscord<ShalokShalom (ShalokShalom)> I think Actors are unavoidable long term
09:27:41FromDiscord<Elegantbeef> Not if you do not write any serious code
09:28:06FromDiscord<ShalokShalom (ShalokShalom)> You write serious code \:D
10:19:38FromDiscord<sirius_3x> o/↵Is there an easy way to fill an array of any length with a bunch of default values like 0,0,0... instead of having to create a loop?
10:21:22FromDiscord<intellij_gamer> `std/sequtils` has [newSeqWith](https://nim-lang.org/docs/sequtils.html#newSeqWith.t%2Cint%2Cuntyped)
10:21:34FromDiscord<intellij_gamer> Its just a loop under the hood though
10:21:35FromDiscord<odexine> If it is mutable and an array,↵arr = default(typeof(arr))
10:21:45FromDiscord<intellij_gamer> ah, array whoops
10:21:48FromDiscord<odexine> If it’s a sequence then that doesn’t work
10:24:08FromDiscord<sirius_3x> In reply to @odexine "If it is mutable": oof thanks that worked! 🙏
10:24:22FromDiscord<sirius_3x> In reply to @intellij_gamer "`std/sequtils` has [newSeqWith](https://nim-lang.or": thanks also! might come in handy at some point 🙂
10:35:47FromDiscord<that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4E4I
10:36:42FromDiscord<that_dude.> Every single time I find anything online, it always start with a ref type or copies the data into a new ref location which I don't want because I already have my data in an object
10:46:24FromDiscord<odexine> In reply to @that_dude. "Every single time I": you must copy
10:46:28FromDiscord<odexine> there is no avoiding that
10:50:33FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4E4S
10:52:46FromDiscord<odexine> distincts do not "inherit" anything, including field access
10:53:21FromDiscord<Phil> field-access counts as a sort of proc?
10:53:23FromDiscord<Phil> wild
10:54:04FromDiscord<odexine> In reply to @isofruit "field-access counts as a": kinda, like the dot operator
10:54:12FromDiscord<odexine> which is why you borrow the dot operator
10:54:15FromDiscord<odexine> for field access
10:55:12FromDiscord<Phil> You can do that? I have not ever seen that
10:55:30FromDiscord<Phil> What is even the syntax for that? I mean, dotexpr is a macro, how do you even borrow a macro?
10:56:59FromDiscord<Phil> ` Bar {.borrow: `.`.} = distinct Foo`↵Huh
10:57:54FromDiscord<that_dude.> In reply to @odexine "you must copy": So my only option is to use a ptr then? I don't think I could create a clean wrapper to get and set into the seq/object
11:00:28FromDiscord<sirius_3x> sent a code paste, see https://play.nim-lang.org/#ix=4E4Y
11:00:52FromDiscord<sirius_3x> (edit) "https://play.nim-lang.org/#ix=4E4Y" => "https://play.nim-lang.org/#ix=4E4Z"
11:00:53FromDiscord<odexine> ofc that means you also might have the issue of pointer to dead memory
11:02:44FromDiscord<Phil> TFW you want to install traitor and you can't nimble install it
11:03:01FromDiscord<Phil> (edit) "TFW you want to install traitor and you can't nimble install it ... " added "without the github link"
11:03:29FromDiscord<that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4E50
11:03:56FromDiscord<odexine> In reply to @that_dude. "That's basically what I'm": you cannot make a ref point to an existing object
11:04:06FromDiscord<sirius_3x> In reply to @that_dude. "That's basically what I'm": ay
11:04:10FromDiscord<odexine> a ref has to be constructed, then the data be copied into it
11:04:33FromDiscord<that_dude.> In reply to @odexine "ofc that means you": I can guarantee it won't happen because I'm basically just using a proc to clean up searching through sequences of objects
11:04:52FromDiscord<odexine> should be "fine" then
11:07:17FromDiscord<that_dude.> I'm trying harder to follow "best practices" with that I do. I just don't really want to change my object to a ref to accommodate one proc when I know that I sometimes take intentional advantage of the implicit copy that comes from =
11:11:11FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4E53
11:15:24*cnx quit (Ping timeout: 248 seconds)
11:15:39*cnx joined #nim
11:16:32NimEventerNew thread by axyz: [Advice] Ways to handle "dynamicity", see https://forum.nim-lang.org/t/10423
11:22:16*lucasta_ joined #nim
11:34:04FromDiscord<odexine> In reply to @isofruit "Okay I think I'm": inh--
11:37:08FromDiscord<Phil> You don't believe that yourself.
11:38:02FromDiscord<Phil> Although you can do inheritance with static dispatch...
11:38:15FromDiscord<Phil> And I'm doing all of this via heap anyway...
11:41:21FromDiscord<Phil> Wait no that wouldn't work, I'd need to move to dynamic dispatch
11:41:28FromDiscord<Phil> Which is eh
11:46:04FromDiscord<Phil> sent a code paste, see https://paste.rs/FEXJV
11:50:38FromDiscord<odexine> seems to be broken from being a ref
11:50:46FromDiscord<odexine> because . in refs are special
11:52:12FromDiscord<Phil> ... I'll just write myself wrapper procs for the distinct types
12:09:44*jmd_ quit (Ping timeout: 244 seconds)
12:41:00FromDiscord<System64 ~ Flandre Scarlet> @treeform Hi, I have a question about Netty↵Is it better to send a lot of small packets or only one big packet?
12:52:50FromDiscord<saint._._.> Anyone tried using nimterop? https://github.com/nimterop/nimterop
12:53:22FromDiscord<saint._._.> Was wondering if anyone has experience with c++ interop. How bad is it or is it workable at all?
13:35:47FromDiscord<ieltan> buh
13:36:33*lucasta joined #nim
13:43:48FromDiscord<heysokam> In reply to @sirius_3x "o/ Is there an": arrays are fixed size mandatory. use `seq[TheType]`. newSeqWith is your friend for that task, like mentined
13:43:51FromDiscord<heysokam> (edit) "mentined" => "mentioned"
13:45:07FromDiscord<odexine> In reply to @heysokam "arrays are fixed size": im pretty sure they are aware
13:45:09FromDiscord<heysokam> In reply to @saint._._. "Was wondering if anyone": workable, but your entire project becomes the cpp backend, which forces you into the cpp compiler↵otherwise, just compile the cpp code into a static binary with a C ABI and make a C wrapper. That's an option↵But if you don't mind the `backend = "cpp"` then it works perfectly fine
13:45:53FromDiscord<heysokam> In reply to @odexine "im pretty sure they": they asked for `array` with a `newuser` discord tag. hence the tip
13:49:31FromDiscord<heysokam> In reply to @saint._._. "Anyone tried using nimterop?": `futhark` is a lot better _(and maintained, nimterop is long dead afaik)_ for making wrappers in an automated way↵I heard they were working on cpp support, but don't know how that went↵@PMunch should be able to tell↵https://github.com/PMunch/futhark
13:55:48NimEventerNew thread by Akito: Explanation for SSL/TLS Error, see https://forum.nim-lang.org/t/10424
13:59:04FromDiscord<Chronos [She/Her]> Why is async stuff integrated in the compiler? I think Nimskull said something about that ages ago
13:59:09*fanta1 joined #nim
14:02:52FromDiscord<pmp_p> could be that async require fine control of stacks usage for save/restore that only compiler can be aware of
14:05:19FromDiscord<odexine> In reply to @chronos.vitaqua "Why is async stuff": it isnt?
14:05:25FromDiscord<odexine> i dont understand what you mean by that
14:06:02FromDiscord<jmgomez> In reply to @saint._._. "Was wondering if anyone": It is pretty good. One of the best out there
14:11:40FromDiscord<sirolaf> In reply to @chronos.vitaqua "Why is async stuff": https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncmacro.nim async is mostly here so part of stdlib rather than compiler
14:15:17FromDiscord<Chronos [She/Her]> Ah alright, thought it was something that the compiler had to do behind the scenes with magic
14:18:42FromDiscord<saint._._.> In reply to @heysokam "`futhark` is a lot": Thanks for the info!
14:18:52FromDiscord<saint._._.> In reply to @jmgomez "It is pretty good.": The project does seem to be dead, no?
14:19:23FromDiscord<jmgomez> I meant, the raw Nim interop. Never used NimInterop
14:20:31FromDiscord<jmgomez> In reply to @chronos.vitaqua "Ah alright, thought it": Keep in mind there are multiple implementations/backends i.e. Chronos
14:21:02FromDiscord<Chronos [She/Her]> Fair
14:25:57*lucasta quit (Quit: Leaving)
14:37:38*arkanoid quit (Ping timeout: 256 seconds)
14:58:44FromDiscord<saint._._.> In reply to @jmgomez "I meant, the raw": Gotcha
15:02:04FromDiscord<treeform> In reply to @sys64 "<@107140179025735680> Hi, I have": Does not matter. Its best to send UDP packets that are 512 bytes or less. So netty will breakup your big packet into small chunks.
15:02:45*dithpri joined #nim
15:03:19FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4E5Y
15:03:43*dithpri quit (Read error: Connection reset by peer)
15:04:09*dithpri joined #nim
15:14:45FromDiscord<System64 ~ Flandre Scarlet> In reply to @treeform "Does not matter. Its": Oh alright, thanks
15:15:23FromDiscord<odexine> sent a code paste, see https://play.nim-lang.org/#ix=4E62
15:16:02FromDiscord<k0ts> also with `-> int` instead of `: int`
15:16:20FromDiscord<odexine> was going to point out as i just tested it
15:19:44FromDiscord<Phil> I mean, none of them work well, the `->` variations have not worked across the board and the `=>` seem to work as long as you don't specify a return-type for some reason
15:20:28FromDiscord<Phil> Though the way I read it I appear to be doing it wrong from the get go, this sugar is supposed to not take in types in the first place
15:22:42FromDiscord<odexine> what?
15:26:59FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4E65
15:27:11FromDiscord<jmgomez> > => seem to work as long as you don't specify a return-type for some reason↵For some reason is mostly because it cant infer `auto`
15:27:15FromDiscord<Phil> And -> doesn't work ever in those cases
15:28:02FromDiscord<k0ts> sent a code paste, see https://play.nim-lang.org/#ix=4E66
15:28:02FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4E65" => "https://paste.rs/44yrX"
15:28:07FromDiscord<Phil> What in the
15:29:29FromDiscord<jmgomez> In reply to @jmgomez "> => seem": but it only applies when n-arity > 2
15:30:02FromDiscord<Phil> Basically the rules on when which arrow function syntax is supposed to apply is a bit of a mystery
15:31:00FromDiscord<jmgomez> I dont think the problem is the arrow function syntax but the result of the macro being: `(a.. : auto): auto`
15:32:33FromDiscord<Phil> If the syntax doesn't consistently work and I need to think about what nim-node pattern it generates and what that patterns must look like, then the syntax is the problem.
15:32:44FromDiscord<jmgomez> It was discussed not so long ago here: https://discord.com/channels/371759389889003530/768367394547957761/1119268332022026280↵I tried to improve it but then other scenarios failed. I have a few ideas to try but didnt find the time..
15:36:49FromDiscord<ieltan> Is there a way to prevent Nim from extending template/macro transformation in error messages? It's so annoying and nigh dev-unfriendly when you have to deal with walls of text that means nothing only to find you discarded a `void` value
15:37:24FromDiscord<sirolaf> The auto type just doesn't play well with generics, in generic inference feature I also explicitly exclude auto for that reason
15:37:45FromDiscord<ieltan> That's only one example, I could always make a safeguard to prevent discarding void values but the cause are still there
16:17:13FromDiscord<jos7388> sent a code paste, see https://play.nim-lang.org/#ix=4E6n
16:17:24FromDiscord<jos7388> sent a code paste, see https://play.nim-lang.org/#ix=4E6o
16:17:27FromDiscord<jos7388> anyone know why quasi quotation makes such a weird AST
16:17:39FromDiscord<jos7388> i'm trying to generate the first expression
16:25:59FromDiscord<Phil> You want to have a seq of empty tuples that can only ever be empty?
16:26:40FromDiscord<jos7388> i'm just using an empty tuple as a placeholder
16:26:44FromDiscord<Phil> check
16:26:50FromDiscord<jos7388> but you can see it generates weird symbol things
16:27:02FromDiscord<jos7388> the second tree printed isn't the same as the first one even though i expect it to be
16:27:16FromDiscord<jos7388> i'm getting that for any generics like `seq[int]` parses the same way
16:28:19FromDiscord<jos7388> sent a code paste, see https://play.nim-lang.org/#ix=4E6t
16:29:57*dithpri quit (Quit: '); DROP TABLE Users;--)
16:30:05FromDiscord<Phil> It interprets them completely differently. As to why that is I can't tell, that's an internals question
16:30:27FromDiscord<Phil> Best I can tell you is that you have the exact same proble with std/genasts
16:31:30FromDiscord<Phil> I assume it is that way because with dumpTree you have your assignment as actual statements, as in it is all typed and nim knows what each bit is.↵With the second statement, nim basically is just gluing nodes together and does not know whether that makes sense or not, it's just repeating.↵↵But that is my assumption based on my mediocre macro knowledge.
16:32:03FromDiscord<Phil> I don't have the words to express it well but I think in the first one nim has "meaning" in the sentence, in the second it doesn't
16:32:10FromDiscord<jos7388> ye i basically agree
16:32:11FromDiscord<Phil> (edit) "sentence," => "NimNode-construct,"
16:32:25FromDiscord<jos7388> the quasi quotation parser is much simpler than nim's real parser
16:32:31FromDiscord<jos7388> so i probably have to build the AST by hand
16:32:37FromDiscord<jos7388> or find a different quasi quotation lib
16:32:47FromDiscord<jos7388> and yeah i do have the same issue with genAsts btw
16:33:32FromDiscord<Phil> TBF it is not that hard to write yourself procs that generate the Ast, assuming you add doc-comments that explain the nim-node structure you assume to receive and the generated syntax it represents (and do the same for the output NimNode)
16:35:28FromDiscord<jos7388> ye and i can still use quasi quotation for
16:35:31FromDiscord<jos7388> most of it probably
16:35:41FromDiscord<jos7388> i just need to build seq[T] manually i figure
16:35:46*junaid_ joined #nim
16:35:56FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4E6u
16:38:01FromDiscord<Phil> In your case you can of course pass in parts of the expression as a NimNode-parameter in case you can get the type for your seq in a NimNode somewhere else
16:38:09FromDiscord<Phil> That should make it easier
16:45:47FromDiscord<jos7388> oh actually its working..
16:45:53FromDiscord<jos7388> the weird AST actually works
16:45:56FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4E6v
16:45:58FromDiscord<jos7388> yee
16:46:03FromDiscord<jos7388> that works too
16:46:08FromDiscord<Phil> generates `let x: seq[int] = @[]`
16:46:12FromDiscord<jos7388> but my cursed AST that looks totally different than dumptree is somehow working as well
16:46:16FromDiscord<jos7388> idk why
16:46:27FromDiscord<jos7388> i guess thats just how it is
16:46:39FromDiscord<Phil> It gets filled with meaning after the compiler resolves it
16:47:04FromDiscord<Phil> Like first generates the thing to compile, then goes over it and realizes "ah, that's this type etc." and compiles with that accordingly
16:47:23FromDiscord<jos7388> that's interesting
16:47:27FromDiscord<jos7388> i guess that makes sense
16:47:43FromDiscord<Phil> ~~More than the sugar for lambda procs~~
17:01:36*junaid_ quit (Remote host closed the connection)
17:12:32FromDiscord<yaarb> what's the equivalent of golang `new(bytes.Buffer)` in nim ? ( it's just to create a buffer to read / write for temporary data )
17:16:45*lucasta_ quit (Ping timeout: 245 seconds)
17:17:00*Mister_Magister quit (Quit: bye)
17:17:02FromDiscord<yaarb> maybe just an array[byte] + the std method for array ?
17:21:47Amun-RanewSeq[byte](length)
17:22:22Amun-Raor array in the length is known in compile time
17:23:48FromDiscord<yaarb> perfect thx
17:24:04Amun-Rain→if
17:43:52*ntat joined #nim
17:49:01*fanta1 quit (Quit: fanta1)
17:58:26*ntat quit (Quit: leaving)
18:00:57FromDiscord<heysokam> Is there a way to specify that a function comes from this module where its being used, in case of a name overload? 🤔
18:12:17*lucasta_ joined #nim
18:20:50Amun-Ramodulename.functioname()
18:23:56Amun-Raoh, I think I misunderstood the question, local function has priority over other imported ones
18:24:08Amun-Raheysokam: https://play.nim-lang.org/#ix=4E6T
18:24:43FromDiscord<heysokam> In reply to @Amun-Ra "<@186489007247589376>: https://play.nim-lang.org/#i": but i want to name.qualify the function
18:25:07FromDiscord<heysokam> even if it comes from this module, just to be explicit, since its a documentation-like example
18:25:43FromDiscord<heysokam> seems like it works like normal by using the filename of the module, without importing it
18:26:02FromDiscord<heysokam> i was incorrectly trying to import it, so was failing on me
18:26:35Amun-Rawell, that works (to my surprise) ;)
18:26:49Amun-RaTIL
19:07:37*fanta1 joined #nim
19:19:00FromDiscord<saint._._.> How hard is it to have a nim program have a C header so that I can use my nim program in a cpp project
19:19:04FromDiscord<saint._._.> If that makes sense
19:19:45*Mister_Magister joined #nim
19:24:03FromDiscord<that_dude.> In reply to @saint._._. "How hard is it": I know that this exists https://nim-lang.org/docs/backends.html#interfacing-backend-code-calling-nim, but I'm not sure if there is a direct way to produce headers
19:24:47FromDiscord<Elegantbeef> Nim does have the `--header` argument but it's not supported
19:26:35FromDiscord<that_dude.> https://github.com/treeform/genny I found this
19:26:59FromDiscord<Elegantbeef> Depending on the API it's quite easy to write the bindings
19:27:36FromDiscord<that_dude.> (edit) "this" => "this, It's treeform being a legend again and creating a lib to help generate bindings"
19:28:10FromDiscord<heysokam> In reply to @saint._._. "How hard is it": `treeform/genny` is your friend
19:40:52FromDiscord<jmgomez> In reply to @Elegantbeef "Nim does have the": I have been supporting it in the shadows
19:41:49FromDiscord<jmgomez> In reply to @heysokam "even if it comes": The best way to use your Nim program in a Cpp project is to use the Cpp backend where `genny` wont help you that much
19:45:15FromDiscord<Elegantbeef> well in the present state I wouldnt use the generated header for .h atleast
19:45:50FromDiscord<Elegantbeef> Tonnes of unreadable type defs and procedures
19:46:01FromDiscord<Elegantbeef> `N_LIB_IMPORT N_CDECL(void, nimscripter_vmargs_set_result_int)(tyObject_VmArgsDi2DMfkd5G6jMpVDxagj1g args_p0, NI64 val_p1);` ah yes 😄
19:47:03*junaid_ joined #nim
19:51:05FromDiscord<jmgomez> I use it in NimForUE but I consume it back in Nim
19:51:08FromDiscord<heysokam> In reply to @jmgomez "The best way to": doesn't it generate cpp interface too?
19:51:16FromDiscord<heysokam> i thought i read in the readme that it does
19:51:29FromDiscord<that_dude.> Hey Beef, can I have a link to your website? I always loose it, I'm looking into concepts rn
19:51:35FromDiscord<jmgomez> In reply to @Elegantbeef "`N_LIB_IMPORT N_CDECL(void, nimscripter_vmargs_set_": Also readability improves when using exportc
19:52:02FromDiscord<Elegantbeef> I used exportc
19:52:09FromDiscord<jmgomez> In reply to @heysokam "doesn't it generate cpp": Didn’t look much it into it but I bet it doesn’t support latest cpp additions
19:52:36FromDiscord<jmgomez> In reply to @Elegantbeef "I used exportc": Maybe it behaves differently in c? It should not mangle in cpp
19:53:56FromDiscord<jmgomez> (edit) removed "it"
19:54:35FromDiscord<heysokam> In reply to @jmgomez "Didn’t look much into": me neither, but my understanding was that treeform made genny to port pixie to python as a backend and also cpp 🤷‍♂️
19:54:56*cedb is now known as yeet
19:55:01*yeet is now known as cedb
19:56:39*fanta1 quit (Quit: fanta1)
20:04:06*junaid_ quit (Remote host closed the connection)
20:06:21FromDiscord<Elegantbeef> Jm I do not own all these types I'm using so no amount of exportc will stop mangling of these types, unless I alias them myself 😄
20:06:42FromDiscord<Elegantbeef> Inside the C API I just want them to be opaque pointers
20:14:30FromDiscord<jmgomez> In reply to @heysokam "me neither, but my": Im referring to this https://nim-lang.github.io/Nim/manual_experimental.html#virtual-pragma (`virtual`, `member` and `constructor`). It will be a nightmare to support that outside the compiler (same applies to `codegenDecl` btw). IMO for anything to really replace `--header` needs to be a compiler backend
20:15:32FromDiscord<jmgomez> Yeah, Jason I get that. But if you pretend someone to use it as an API you kinda curate it, so `header` even if far from ideal, will look better
20:19:29FromDiscord<Elegantbeef> "will look better"?
20:20:05FromDiscord<jmgomez> BTW Jason, now that you are there 😛 ↵Any idea of why this may be failing? https://github.com/nim-lang/Nim/actions/runs/5919248783/job/16049337964?pr=22513↵Cant reproduce it locally. The PR is about moving instances to the module that uses it (which would improve comp times). What bothers me is that those procs, specifically for `polybrenpkg` arent even generics but with this shape: `func m512d(a: array[8, float64]): M512d {.inline
20:20:42FromDiscord<jmgomez> In reply to @Elegantbeef ""will look better"?": Yeah, if you pretend someone to consume the type, you would export it. Not the case on the example above for the reasons you said
20:21:22FromDiscord<jmgomez> (edit) removed "was"
20:28:33FromDiscord<ShalokShalom (ShalokShalom)> I will never not imagine Elegantbeef without a mask of Jason, the serial killer, now that I know his name
20:28:41FromDiscord<ShalokShalom (ShalokShalom)> Just too fitting
20:30:37*jmdaemon joined #nim
20:32:04FromDiscord<Elegantbeef> You kill one person and no one lets you ever forget it
20:38:17FromDiscord<jos7388> ok so
20:38:22FromDiscord<jos7388> in Rust there's this awesome lib called Matchbox
20:38:37FromDiscord<jos7388> it basically lets you abstract over WebRTC and UDP for peer2peer comms
20:38:57FromDiscord<jos7388> and if you can't natively connect to a client, it supports a signaling server to act as a proxy to dodge whatever network issue
20:39:14FromDiscord<jos7388> is there something similar for nim? i really need peer2peer for this project, and i need it over web or desktop
20:39:45FromDiscord<jos7388> if not-- is there a way to mix rust/nim in a WASM environment?
20:39:54FromDiscord<jos7388> cos i'd rather just use Matchbox and write nim bindings for it
20:40:16FromDiscord<Elegantbeef> Of course there is, load both of your modules together
20:41:27FromDiscord<jos7388> i thought there wasn't a standard linker for wasm
20:42:03*azimut quit (Ping timeout: 246 seconds)
20:43:58FromDiscord<Elegantbeef> I mean you load both modules together at the runtime
20:44:09FromDiscord<Elegantbeef> atleast iirc that's how this is done
20:46:49FromDiscord<Elegantbeef> Like wasm3 has this procedure https://github.com/beef331/wasm3/blob/master/src/wasm3/wasm3c.nim#L202
20:47:06FromDiscord<Elegantbeef> So I assume browser runtimes have a similar API
20:52:33FromDiscord<jos7388> iight worth a shot
20:52:36FromDiscord<jos7388> ty
20:56:46FromDiscord<jmgomez> In reply to @jmgomez "BTW Jason, now that": agh, found the issue. Seems like they are passing a local compiler option
20:57:50FromDiscord<Elegantbeef> PS if you want me to actually notice a message write 'beef' not 'jason'
20:58:01FromDiscord<Elegantbeef> One of those has a ping notification
21:06:14FromDiscord<ShalokShalom (ShalokShalom)> #Beef\_with\_Jason
21:06:19FromDiscord<ShalokShalom (ShalokShalom)> Does that ping you?
21:06:51FromDiscord<JJ> can i dumptree a typed block?
21:07:15FromDiscord<JJ> also beef's pfp is back woot
21:07:31FromDiscord<Elegantbeef> `expandMacros`
21:07:35FromDiscord<Elegantbeef> or make your own `typedDump`
21:07:43FromDiscord<Elegantbeef> No it doesnt shalok
21:07:53FromDiscord<Elegantbeef> elegantbeef and beef ping me, otherthings do not
21:09:45FromDiscord<JJ> hm how can `expandMacros` be used in this context beef
21:10:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4E7j
21:10:15FromDiscord<Elegantbeef> You've given 0 context
21:10:27FromDiscord<Elegantbeef> Are you in a macro, do you want to see expanded code, do you want cheese and fries?
21:10:37FromDiscord<JJ> dumptree gives me what is passed into an `untyped` parameter, but i don't know what the representation of `typed` parameters looks like
21:11:02FromDiscord<Elegantbeef> `echo myTree.repr` `echo mytree.treeRepr`
21:12:25FromDiscord<JJ> ah! tysm
21:12:37FromDiscord<Elegantbeef> Context matters
22:36:42*xet7 quit (Quit: Leaving)
22:50:30FromDiscord<Andreas> is it possible to write a template/macro that ensures that a user-type is properly aligned ? as by doing `{.align(64).}` ?
22:50:56FromDiscord<Andreas> (edit) "?" => "?↵so scream/warn in case one forgot it.."
22:56:23FromDiscord<nomad> how do i zip an entire dir into one file?
23:02:19FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4E7N @Andreas
23:04:09FromDiscord<arathanis> In reply to @nomad "how do i zip": https://github.com/nim-lang/zip
23:15:23FromDiscord<Andreas> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=4E7N <@75428451731688": beautifull, thx beef
23:24:30FromDiscord<Andreas> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=4E7N <@75428451731688": this comes in handy when trying SIMD-stuff with guzbas wonderfull `nimsimd`-lib. If you missed Bob Steagall talk - here comes IMHO the best SIMD-talk of-all-times https://www.youtube.com/watch?v=1FPobiebZLE
23:27:38*xet7 joined #nim
23:56:18FromDiscord<Elegantbeef> @Andreas\: that only reminds me that I wanted to do some things like "simd accelerated string find" 😄