<< 06-03-2022 >>

00:23:29FromDiscord<Schelz> can somebody tell me why this ``proc testfunc(a, b: cint): int {.importcpp: "testfunc(@)", header: "function.h".} = result = a+b echo testfunc(2, 3) ``↵returns ``undefined reference to testfunc(int, int)``
00:23:49FromDiscord<Schelz> (edit) removed "" | "result" => "↵result"
00:24:04FromDiscord<Schelz> (edit) "``proc" => "↵``proc"
00:24:14FromDiscord<Schelz> (edit) "can somebody tell me why this ↵``proc testfunc(a, b: cint): int {.importcpp: "testfunc(@)", header: "function.h".} = ↵result = a+b echo testfunc(2, 3) ``↵returns ``undefined reference to testfunc(int, int)``" => "sent a long message, see http://ix.io/3RrZ"
00:35:15PMunchGet it while it's hot! Ratel v0.2.0: https://github.com/PMunch/ratel/tree/v0.2.0
00:35:34FromDiscord<Elegantbeef> Nah hot stuff burns
00:35:48PMunch@Elegantbeef, it uses nimscripter ;)
00:35:55*neurocyte0917090 quit (Quit: The Lounge - https://thelounge.chat)
00:36:04FromDiscord<Elegantbeef> Shame
00:36:26FromDiscord<b4mbus>
00:36:43FromDiscord<Elegantbeef> Like i said in the issue though pmunch `requires "compiler"` is nothing but a headache
00:37:35*ltriant joined #nim
00:37:44PMunchI know..
00:37:52PMunchBut what I did in nimlsp is more of a headache :P
00:38:34FromDiscord<Elegantbeef> Just make a config with `--path:"$nim"` and it solves the versioning issue
00:39:09FromDiscord<Elegantbeef> Given that ratel is using it for a binary i think it should be fine
00:39:11PMunchHmm, is $nim set automatically in a config?
00:39:49FromDiscord<Elegantbeef> It will use add the active compiiler's path to the library path, so yes
00:40:04FromDiscord<Elegantbeef> It's set somewhere atleast
00:40:27FromDiscord<Elegantbeef> Wonder if I can always use that config, no clue
00:40:28*neurocyte0917090 joined #nim
00:41:02FromDiscord<Elegantbeef> Does putting a `nimscripter.nims` in `src` work... hmmm
00:41:03PMunchI just tried to pass it as a configuration option and that obviously failed
00:41:18PMunchWhat do you mean?
00:41:55FromDiscord<Elegantbeef> well ideally I make it so the program doesnt need `--path:"$nim"`
00:42:12FromDiscord<Elegantbeef> So if i move the config to the `src` directory, it might use that?
00:42:36*ltriant quit (Ping timeout: 272 seconds)
00:44:00PMunchAh, no I don't think so
00:44:15PMunchThat's why I do `import boardConf` in Ratel
00:44:43FromDiscord<Elegantbeef> Ugh
00:44:58FromDiscord<Elegantbeef> Adding nim to the path isnt the end of the world, but it very much isnt ideal
00:45:08PMunchOh wait, it might actually use it for binary building
01:01:37*icebattle quit (Ping timeout: 240 seconds)
01:16:16PMunchYup, just pushed a tiny fix to the repo to use that instead
01:16:43PMunchBy the way, do you know why it messes up if I add the `os` import?
01:17:22FromDiscord<Elegantbeef> https://github.com/beef331/nimscripter/issues/11
01:17:34FromDiscord<Elegantbeef> I looked at it, still not certain how to fix it
01:17:47PMunchAh, bummer
01:18:08PMunchI wanted to check if a file existed in the upload hook and if not run the build hook manually
01:18:17PMunch*automatically
01:20:28FromDiscord<Elegantbeef> https://github.com/beef331/nimscripter/blob/master/src/nimscripter/vmops.nim might work for you
01:20:53FromDiscord<Elegantbeef> Might need more ops exposed
01:21:13PMunchI guess I could check if it was listed in listFiles
01:21:27FromDiscord<Elegantbeef> Well that module can always be expanded
01:22:14PMunchYeah I know, I just want to easy the friction of anyone wanting to use this
01:24:33FromDiscord<Mysterysib> Hey, are there any docs for lambdas in nim?
01:25:00FromDiscord<Elegantbeef> Lambdas in nim are just anonymous functions, there are sugar for `=>` and `->` in std/sugar
01:26:02FromDiscord<Elegantbeef> Do you have any more elaborate questions?
01:32:22FromDiscord<Mysterysib> Thanks. Just playing around with it atm, but I'm trying to figure out the position of the anon function in the params and how to define both the data type and lambda itself
01:32:58FromDiscord<Elegantbeef> `var myAnon = proc(a: int, b: string): float = echo a, " ", b`
01:33:27FromDiscord<Mysterysib> ahhh perfect tysm, proc was what I missed thought I could just write it
01:34:26FromDiscord<Elegantbeef> With sugar imported you can write it `(a: int, b: string): float => echo a, " ", b` afaik, though i dont really use anonymous procedures much
01:35:16FromDiscord<Mysterysib> I like them sometimes just so that the code is easier to read and I don't have hundreds of small functions doing one or two operations and are only used once
01:36:04FromDiscord<Evrensel Kişilik> meoooow
01:36:15FromDiscord<Evrensel Kişilik> i got a cute name for online debugger
01:36:18FromDiscord<Evrensel Kişilik> https://debugme.online/
01:36:43FromDiscord<Mysterysib> sadly debug.me was probably taken :l
01:36:46FromDiscord<Mysterysib> but it's still cute
01:37:00FromDiscord<Evrensel Kişilik> yessss
01:37:40FromDiscord<loaf> i know i keep asking dumb questions but is there a way to use all parts of an array in a proc without it making a for loop
01:37:51FromDiscord<Mysterysib> while ago I was making a website for certain crypto exchanges and I secured xch.io, and the exchange was named ExchangeDog, but I quit paying for it
01:38:09FromDiscord<Elegantbeef> "use all parts"?
01:38:14FromDiscord<loaf> like instead of
01:38:56FromDiscord<loaf> sent a code paste, see https://play.nim-lang.org/#ix=3Rs9
01:39:10FromDiscord<loaf> more like proc(array.all)
01:39:16FromDiscord<Elegantbeef> `import std/sequtils; myArray.apply(myProc)`
01:39:42FromDiscord<loaf> oh okay
01:39:57FromDiscord<Elegantbeef> can also do `applyIt`
01:40:36FromDiscord<Mysterysib> I was thinking of using a lambda for that but that's a lot better. Apply reminds me of something.. forget what, some data science language. maybe R
01:41:05FromDiscord<huantian> If proc doesnt return a value the for loop is probably the best
01:41:07FromDiscord<huantian> Imo
01:41:11FromDiscord<Elegantbeef> yea templates that expose an `it` are nicer than lambdas 😛
01:41:25FromDiscord<Elegantbeef> There is a variant of `apply` that doesnt mutate the collection
01:41:51FromDiscord<loaf> is it functionally still just a for loop?
01:42:00FromDiscord<Elegantbeef> Of course
01:42:17FromDiscord<Mysterysib> What's an `it`?
01:42:28FromDiscord<Elegantbeef> There's no otherway unless you inline it
01:43:00FromDiscord<Elegantbeef> `applyIt` makes a variable for each iteration which is `it` so you then can do things like `[10, 20, 30].applyIt(echo it)` which would echo each element
01:43:30FromDiscord<Mysterysib> That's really cool
01:47:19PMunchI really want Eritrea to start dishing out their TLD
01:47:25PMunchThat way I could try and snatch pet.er
01:47:42FromDiscord<Elegantbeef> Ah yes pet her
01:47:54PMunchPet her? I hardly know her!
01:48:21FromDiscord<Elegantbeef> Didnt expect that response from you 😀
01:48:34PMunchHaha, why not=
01:48:48FromDiscord<loaf> what if the proc takes multiple arguments
01:48:50FromDiscord<huantian> Sounds like Ethoslab :p
01:49:25FromDiscord<Elegantbeef> Expect it more from someone who was from an English country
01:50:27FromDiscord<Elegantbeef> Use `applyIt` or just use a for loop↵(@loaf)
01:50:33FromDiscord<Elegantbeef> There isnt any reason really to avoid it
01:51:07PMunchI've been on the internet for longer than some of the people in this channel, my repertoire of english jokes and slangs is quite impressive
01:51:24FromDiscord<Elegantbeef> But you still sometimes forget V and W are different 😛
01:51:36FromDiscord<loaf> i guess the main reason to avoid it is to easily fit it on one line
01:51:48FromDiscord<Elegantbeef> `for x in arr: proc(x, y)`
01:51:53FromDiscord<loaf> okay yeah
01:51:54PMunchWell that's just my pronunciation :P
01:51:55FromDiscord<Elegantbeef> We did it we one lined it
01:52:07FromDiscord<huantian> Why are people so obsessed with onelining
01:52:19FromDiscord<loaf> why bother with apply at all then
01:52:19FromDiscord<Elegantbeef> Cause one lining means the code is simple or something
01:52:26FromDiscord<Elegantbeef> It's why i write C++ on one line
01:52:32FromDiscord<huantian> It’s fine when its short like that, but its just horrible to read when it gets long
01:52:33FromDiscord<Elegantbeef> Cause apply is more FPy and there are FPy people
01:52:43PMunchI mean I tend to one-line quite a few things
01:52:45FromDiscord<huantian> And it mutates the array as well
01:52:58FromDiscord<Elegantbeef> It doesnt have to mutate
01:53:04PMunchSometimes it just makes it easier to read the code if each line does it's own logic
01:53:05FromDiscord<Elegantbeef> There are pure variants of apply
01:53:33FromDiscord<Elegantbeef> I'm not opposed to one lining, but we're trying to one line for no real reason at points
01:53:41*icebattle joined #nim
01:53:44FromDiscord<Elegantbeef> Like i hate one line if expressions
01:54:00PMunchIf you have one important function call between five loops which just applies a function to an array I'd rather have 6 lines 5 of which are fairly similar than a bunch of lines where I might miss the important procedure call
01:54:22PMunchI mean sometimes they make sense
01:54:53PMunchI love ternaries in C and the similar if statements in Nim
01:55:01FromDiscord<Elegantbeef> It's harder to read imo
01:55:09PMunchNaming things is hard, why create more variables than I have to?
01:55:15FromDiscord<Elegantbeef> I dont mind if expressions, i use them frequently, my issue is doing it on one line is just hard to read
01:55:36PMunchAh right
01:55:39PMunchFair enough
01:55:49PMunchDepends a bit on how long it is though
01:56:07FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Rsi
01:56:15PMunchFor example for Ratel I had `if not fileExists(file): build(file & ".nim")`
01:56:18FromDiscord<Elegantbeef> Eh i never one line if expressions regardless of length
01:56:29PMunchAt the top of the procedures which needed the file
01:56:38PMunchThat's a oneliner I appreciate
01:56:56FromDiscord<Elegantbeef> Yea i pretty much avoid all one liners
01:57:01FromDiscord<Elegantbeef> I prefer vertical over horizontal code
01:57:09PMunchLike the procedure itself is one line, so adding a two line check to it doesn't make much sense
01:57:19PMunchNow the procedure is suddenly more check than content
01:57:49PMunchJust flip your monitor around, problem solved!
01:57:58FromDiscord<Elegantbeef> Lol
01:58:12FromDiscord<Elegantbeef> I have 3 monitors so let me put them all in portrait mode so i can program in java
01:58:19PMunchHaha
01:58:29PMunchI actually have one of my three monitors in portrait mode
01:58:34FromDiscord<Elegantbeef> Fuck i meant landscape
01:58:36PMunchMostly have IRC on it though :P
01:58:47FromDiscord<Elegantbeef> Hey same
01:58:50FromDiscord<Elegantbeef> Two landscape 1 portrait
01:59:00FromDiscord<Elegantbeef> portrait is best aspect for splitting imo
01:59:06PMunchSplitting?
01:59:19FromDiscord<Elegantbeef> having multiple windows open
01:59:37PMunchHmm, I guess in a way
01:59:37FromDiscord<huantian> I wanna do that thing when you get two vertical monitors and have the, right next to each other
01:59:39FromDiscord<Elegantbeef> 9\:16 split gives you more horizontal space vs landscape
01:59:58PMunchTrue
02:00:05FromDiscord<Elegantbeef> Most applications benefit from horizontal space i reason
02:00:18PMunchI prefer moving my head side to side though
02:00:57PMunchBut maybe I should try and flip all my monitors just for fun
02:01:09PMunchMaybe I'll like it
02:01:09FromDiscord<Elegantbeef> You dont game do you? 😛
02:01:16FromDiscord<huantian> Diagonal monitor is the best
02:01:20PMunchHaha, actually just gotten into some Elden Ring
02:01:26PMunchBut man do I suck at that game
02:01:36FromDiscord<Elegantbeef> First soulslike?
02:01:39PMunchWell I guess it's a Souls game so it's supposed to be hard..
02:01:43PMunchYeah
02:02:00FromDiscord<Elegantbeef> Ah welcome to hell
02:02:14PMunchI don't really play much to begin with, but this was so hyped and I was curious how it would run on Linux via Proton on day 1
02:02:23FromDiscord<Elegantbeef> My favourite souls like isnt even a from software game, it's salt and sanctuary so I'm an odd duck
02:02:28PMunchI mean the game is fun, and really cool aesthetic
02:02:32FromDiscord<Elegantbeef> Yea worked "flawlessly" day 1 i heard
02:02:38FromDiscord<Elegantbeef> Minus the stutter issue
02:02:46FromDiscord<huantian> I never got into those kinds of game
02:03:01PMunchTiny stutter and I have to use experimental Proton, but apart from that it's flawless
02:03:14PMunchOh and the cutscenes seems to be a bit oddly timed
02:03:28PMunchLike the text seems to go out of sync with the animations
02:03:35FromDiscord<huantian> I like games for the graphics but dying is too easy
02:03:59PMunchI do want to get my hands on an old wired Xbox 360 controller though
02:04:17PMunchI feel like the game was really designed for controllers
02:04:18FromDiscord<Elegantbeef> Wait are you playing it without a controller?
02:04:29PMunchMhm, keyboard and mouse
02:04:39FromDiscord<Elegantbeef> Well there's your problem
02:04:46PMunchBut I mean to get on my horse it's E+right arrow
02:05:03PMunchWhich means I need to move my hand off-of my mouse and have two hands on the keyboard
02:05:15PMunchAnd moving is just a pain, basically impossible to strafe
02:05:31FromDiscord<Elegantbeef> Yea DS with KBM is masochistic
02:05:44nrds<Prestige99> been playing apex on linux, been great
02:05:50FromDiscord<Elegantbeef> It's a game series that really only becomes playable with a controller
02:05:54nrds<Prestige99> well, performance-wise
02:06:08PMunchHaha, good to know it's not just me thinking I'd be better at it with a controller :P
02:06:11FromDiscord<Elegantbeef> My trusty steam controller got me through most of DS1 and DS3 😛
02:07:19FromDiscord<Elegantbeef> Apex does work well, cant wait for more games. Still waiting for hunt showdown though seems that's never going to happen
02:08:45PMunchI remember playing MDK back in the day (yes I'm old..) and getting my ass handed to me. Tried it a few years later with a controller and wiped the floor with my enemies :P
02:08:59PMunchSome guys really just aren't meant for keyboard and mouse
02:09:10FromDiscord<Elegantbeef> MDK?
02:09:16PMunchOoh, maybe I should get myself a steam controller
02:09:22PMunchhttps://en.wikipedia.org/wiki/MDK
02:09:27FromDiscord<Elegantbeef> Good luck they're no longer produced
02:10:23PMunchOld shooter game, IIRC it was one of the first games where you could actually snipe because the rendering engine was optimised so well you could actually have large levels without an oppressive distance fog
02:10:36FromDiscord<Elegantbeef> At one point valve sold their remaining stock for $1 a controller iirc, sadly was too late could've got a second one, i really like mine
02:11:02PMunch"Because the game was attempting things never before seen in a PC game, the team decided to write their own programming language from scratch."
02:11:24PMunchDamn, not even just a new rendering engine, they made a completely new language for it
02:14:21PMunchThe game's original system requirements were a 60 MHz Pentium (although 90 MHz was recommended), 16MB of RAM, 17MB of hard drive storage for basic installation (37MB for full installation)
02:14:35PMunchFor a fully software-rendered 3D game
02:16:12FromDiscord<typedeck> How do i know if {.compile:"foo.c".} gets linked correctly?
02:16:35PMunchIt should be
02:16:48PMunchI mean I guess you know by testing if it works..
02:17:00FromDiscord<typedeck> It doesnt, lol
02:17:21PMunchWhat exactly are you trying to do?
02:17:55FromDiscord<typedeck> sent a code paste, see https://paste.rs/usa
02:18:05PMunchI mean the game is a bit basic, but all of this crammed into 17MB?! https://www.youtube.com/watch?v=7KxhI2xSfTA
02:18:40FromDiscord<typedeck> it crashes on execution
02:19:10FromDiscord<typedeck> when staticly linked it says can not find ref to said functions
02:20:15FromDiscord<typedeck> sent a code paste, see https://paste.rs/rz4
02:20:17PMunchMost likely you've just messed up a signature
02:20:40PMunchMay I interest you in Futhark? The main example is basically exactly what you're trying to do: https://github.com/pmunch/futhark
02:20:40FromDiscord<typedeck> buggers, I ran it through c2nim
02:20:59PMunchAh, well there's your problem :P
02:21:12FromDiscord<typedeck> oh c2nim not so good?
02:21:25PMunchPersonally I've never gotten it to work
02:21:31PMunchWhich is why I wrote Futhark
02:22:11FromDiscord<typedeck> oh nice, ill read up on it
02:22:37PMunchI mean you could literally just copy the example which actually uses stb_image
02:23:40FromDiscord<Elegantbeef> Depending what you're doing/wanting you could also use Pixie and dont have to worry about linking 😛
02:23:44FromDiscord<typedeck> which parts of the example is using the futhark module
02:24:03FromDiscord<typedeck> the importc: and static: ?
02:24:14PMunchNope, only the importc
02:24:25PMunchstatic is just Nim for "run this on compile-time"
02:24:47PMunchIt's only the `importc` block there which is Futhark code
02:26:57FromDiscord<typedeck> syspath for windows would be \mingw64\include instead of clang/12.0.1/include ?
02:27:39PMunchYeah that would probably work
02:28:00PMunchYou do need clang though for Futhark to work, so you can just as well link to the libraries that it ships
02:28:50FromDiscord<typedeck> I see that now, futhark failed ot build
02:28:54FromDiscord<typedeck> (edit) "ot" => "to"
02:29:20PMunchYeah, see the installation section for more details: https://github.com/pmunch/futhark#installation
02:30:04PMunchThe paths on Windows are also a bit messy. I've developed the whole thing on Linux and haven't found anyone with enough Nim knowhow who runs Windows to help me make it more robust over there
02:30:45PMunchBut once you've got it running it's basically magic
02:32:05PMunchBut I've gotta go to bed now
02:32:11*PMunch quit (Quit: leaving)
02:32:15FromDiscord<typedeck> ty for the help!
02:37:07FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "The paths on Windows": yeah, I had some trouble too, but as he said, when everything is set up, it works like magic
02:39:01FromDiscord<typedeck> im fighting spaces in paths, lol
02:39:53FromDiscord<typedeck> sent a code paste, see https://play.nim-lang.org/#ix=3Rst
02:40:29FromDiscord<System64 ~ Flandre Scarlet> In reply to @typedeck "im fighting spaces in": ah exactly the same trouble as me
02:40:41FromDiscord<System64 ~ Flandre Scarlet> okay so copy the LLVM folder to C:\
02:40:50FromDiscord<typedeck> lol ofc
02:40:55FromDiscord<System64 ~ Flandre Scarlet> you did that?
02:41:57FromDiscord<typedeck> yeah that worked
02:42:28FromDiscord<typedeck> wonder how you pass spaces to --passL
02:42:55FromDiscord<System64 ~ Flandre Scarlet> no idea
02:43:45FromDiscord<huantian> Try putting literal “ around the path inside the string
02:44:31FromDiscord<typedeck> no that completely breaks it
02:44:48FromDiscord<typedeck> sent a code paste, see https://play.nim-lang.org/#ix=3Rsu
02:45:09FromDiscord<huantian> No like \”
02:45:15FromDiscord<huantian> (edit) "\”" => "\\”"
02:45:20FromDiscord<Elegantbeef> do \`--passL\:"-L'C\:\\Program Files\\LLVM\\bin'"
02:46:01FromDiscord<typedeck> sent a code paste, see https://play.nim-lang.org/#ix=
02:46:08FromDiscord<typedeck> breaks at the space still
02:46:35FromDiscord<Rika> doesn’t look like it to me
02:47:11FromDiscord<typedeck> for one its not looking in C: but in project directory in the last one
02:47:23FromDiscord<System64 ~ Flandre Scarlet> try --passL:"-L'C:/Program Files/LLVM/bin
02:47:31FromDiscord<System64 ~ Flandre Scarlet> (edit) "Files/LLVM/bin" => "Files/LLVM/bin'""
02:47:56FromDiscord<typedeck> sent a code paste, see https://paste.rs/ZP4
02:48:17FromDiscord<typedeck> sent a code paste, see https://play.nim-lang.org/#ix=3Rsv
02:48:50FromDiscord<typedeck> same with single quotes
02:48:50FromDiscord<System64 ~ Flandre Scarlet> and ``--passL:"-L'C:/Program\ Files/LLVM/bin'"`` ???
02:49:17FromDiscord<typedeck> same with that
02:49:17FromDiscord<Rika> That sounds broken, might be a nimble issue
02:50:37*neurocyte0917090 quit (Ping timeout: 240 seconds)
02:50:40FromDiscord<System64 ~ Flandre Scarlet> In reply to @typedeck "same with that": try to copy the llvm folder into the root of C:
02:51:14FromDiscord<typedeck> yeah that worked
02:51:23FromDiscord<typedeck> im just fiddling with spaced directories
02:51:58FromDiscord<System64 ~ Flandre Scarlet> you still try with spaces?
02:53:02FromDiscord<typedeck> the spaces paths are broken, ill just use C:/, just that llvm installs in "Program Files" so kinda awkward
02:53:52*ltriant joined #nim
02:54:04FromDiscord<System64 ~ Flandre Scarlet> copy the LLVM folsze inro C:/↵And then, do --passL:"-LC:/LLVM/bin
02:54:39FromDiscord<typedeck> yup, works
02:54:56FromDiscord<System64 ~ Flandre Scarlet> nice
02:55:04FromDiscord<System64 ~ Flandre Scarlet> now what does it say? is it installed?
02:55:34FromDiscord<typedeck> sent a code paste, see https://play.nim-lang.org/#ix=
02:55:55FromDiscord<System64 ~ Flandre Scarlet> Nice, here you go!
02:59:24*ltriant quit (Ping timeout: 240 seconds)
03:15:39*arkurious quit (Quit: Leaving)
03:19:59FromDiscord<typedeck> wow ok i figured out my problem at large, the mingw gcc in my path compiled binaries that were not compatable with the mingw that nim uses
03:20:24FromDiscord<typedeck> so i had to remove my previous mingw from the path and add the mingw dist with nim
03:20:44FromDiscord<typedeck> (edit) "dist" => "that distributes"
03:21:22FromDiscord<typedeck> maybe have {.compile} use dist mingw gcc instead of path
03:22:05FromDiscord<System64 ~ Flandre Scarlet> In reply to @typedeck "wow ok i figured": which bins are you trying to compile?
03:22:43FromDiscord<typedeck> {.compile:"stb_image.c".} works now, even without futhark
03:24:32FromDiscord<typedeck> sent a code paste, see https://play.nim-lang.org/#ix=3RsC
03:26:46FromDiscord<typedeck> hmm i guess i just didnt have mingw64 isntall
03:26:57FromDiscord<typedeck> (edit) "isntall" => "installed"
03:27:23FromDiscord<typedeck> (edit) "installed" => "installed, but {.compile} didnt check that it was using 64bit"
03:27:36FromDiscord<typedeck> (edit) "hmm i guess i just didnt have mingw64 installed, but {.compile} didnt check that it was using ... 64bit" added "32bit instead of"
03:33:31*ltriant joined #nim
03:35:37FromDiscord<Bung> wheres old version nim document ? didn't it exists here? https://nim-lang.org/documentation.html
03:36:25FromDiscord<xflywind> Which version you need?
03:36:32FromDiscord<Bung> 1.4
03:37:08FromDiscord<xflywind> You can specify the version number like this: https://nim-lang.org/1.4.8/tut1.html
03:38:14FromDiscord<Bung> oh, that's nice
03:40:13FromDiscord<Bung> I just add CI to nimlsp https://github.com/bung87/nimlsp/runs/5436490105?check_suite_focus=true it only fails on windows, dont know the reason
03:40:28FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=3RsH
04:01:05*rockcavera quit (Remote host closed the connection)
04:03:00NimEventerNew thread by Elcritch: Fidget UI: animation using Nim async , see https://forum.nim-lang.org/t/8982
04:06:02*supakeen quit (Quit: WeeChat 3.4)
04:06:31*supakeen joined #nim
04:34:23*ltriant quit (Ping timeout: 256 seconds)
04:53:53*slowButPresent quit (Quit: leaving)
05:21:21FromDiscord<sOkam!> In reply to @sOkam! "Any clue what I": Any pointers?↵It must be in front of my face, but I'm super lost↵What type of cases would case this type of error?
05:21:47FromDiscord<Elegantbeef> Isnt it clear
05:21:50FromDiscord<sOkam!> It has worked before, I'm just restructuring and I must have missed something
05:21:57FromDiscord<Elegantbeef> You're passing a ptr uint32 instead of Gluint
05:22:24FromDiscord<sOkam!> In reply to @Elegantbeef "You're passing a ptr": but its pointing to the same thing than before
05:22:50FromDiscord<Elegantbeef> Missing a converter?
05:23:34FromDiscord<sOkam!> This is the original code, I'm just changing the structure of things https://github.com/nimgl/nimgl/blob/309d6ed8164ad184ed5bbb171c9f3d9d1c11ff81/examples/topengl.nim#L72
05:25:05FromDiscord<sOkam!> In reply to @Elegantbeef "Missing a converter?": could it change anything that the values are initialized like this? https://media.discordapp.net/attachments/371759389889003532/949900404559327302/unknown.png
05:25:21FromDiscord<Elegantbeef> `uint32`
05:25:48FromDiscord<sOkam!> it has worked before with uint32
05:26:32FromDiscord<Elegantbeef> What's the error
05:26:32FromDiscord<sOkam!> Which is what the original uses https://github.com/nimgl/nimgl/blob/309d6ed8164ad184ed5bbb171c9f3d9d1c11ff81/examples/topengl.nim#L55
05:26:35FromDiscord<Elegantbeef> And line
05:27:54FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3RsV
05:29:41FromDiscord<demotomohiro> I think GLsizei is unsigned int.
05:29:44FromDiscord<sOkam!> Its something to do with the value of that vbo thing, but it has been uint32 before and it worked. So its something to do with the restructuring https://media.discordapp.net/attachments/371759389889003532/949901577630658610/unknown.png
05:30:21*ltriant joined #nim
05:31:20FromDiscord<demotomohiro> Which type is mismatching? Please show all error messages.
05:31:33FromDiscord<sOkam!> how to show more error messages?
05:31:40FromDiscord<Elegantbeef> lol
05:31:48FromDiscord<Elegantbeef> The issue is they're doing `glGenBuffers (1, x)`
05:31:49FromDiscord<sOkam!> thats all the output of the cli
05:31:54FromDiscord<Elegantbeef> That's a command call with tuple
05:32:00FromDiscord<Elegantbeef> remove the fucking spaces!
05:32:20FromDiscord<demotomohiro> Maybe, space between procedure name and `(` is a root of problem.
05:32:38FromDiscord<sOkam!> ill try
05:33:01FromDiscord<Elegantbeef> that's not a anger "fucking" it's a laughing
05:33:08FromDiscord<Rika> beef wtf so rude
05:33:15FromDiscord<Rika> i cant believe you
05:33:16FromDiscord<Elegantbeef> lol rika
05:33:26FromDiscord<sOkam!> 😄
05:33:32FromDiscord<Rika> now youre laughing at me wtf
05:33:36FromDiscord<sOkam!> welp that changed the error line, so yep
05:34:28FromDiscord<Elegantbeef> RFC\: Make it so a command call that gets a tuple unpacks the tuple if it matches the arguments of a overload 😛
05:34:52FromDiscord<Rika> not a good idea id say
05:35:00*ltriant quit (Ping timeout: 240 seconds)
05:38:05FromDiscord<Elegantbeef> I agree morer just a joke due to this common noob trabp
05:38:08FromDiscord<Elegantbeef> trap even
05:38:40FromDiscord<Rika> morer
05:38:44FromDiscord<Rika> trabp
05:39:22FromDiscord<Elegantbeef> Will i ever be able to type and proofread a message, guess we'll never know
05:41:36FromDiscord<demotomohiro> If Nim compiler found command call syntax with 1 tuple arugment but no matching proc, how about to show message like "You might need to remove space between proc name and `(`".
05:41:48FromDiscord<Elegantbeef> That also could work
05:43:00FromDiscord<Rika> that would work best
05:43:15FromDiscord<Elegantbeef> Who makes the PR?
05:43:25FromDiscord<Elegantbeef> I votee RIka
05:43:33FromDiscord<Elegantbeef> That one was my keyboard
05:43:56FromDiscord<Rika> no
05:44:05FromDiscord<Rika> i dont write PRs or RFCs
05:44:10FromDiscord<Rika> i mean i could but eh
05:44:11FromDiscord<Rika> idk
05:44:37FromDiscord<Mysterysib> Does nim have a this pointer?
05:44:51FromDiscord<Elegantbeef> Nim isnt C#/Java so no
05:45:17FromDiscord<Elegantbeef> Unless you mean something else by "this pointer\:
05:45:19FromDiscord<Mysterysib> Doesn't C++ have it to?
05:45:33FromDiscord<Elegantbeef> Sure Nim isnt OOP though
05:45:38FromDiscord<demotomohiro> C++ has this pointer.
05:45:39FromDiscord<Rika> nim is closer to C
05:45:41FromDiscord<Rika> than C++
05:45:44FromDiscord<Rika> in this sense
05:45:45FromDiscord<Elegantbeef> It doesnt have class scopes so `this` is ambigious
05:45:59FromDiscord<Mysterysib> Yeah I feel that it's like C
05:46:05FromDiscord<Rika> everything is a regular function and there is no sense of class bound functions
05:46:39FromDiscord<Rika> it (kinda) doesnt really need class bound functions because of mcs anyway
05:46:44FromDiscord<Elegantbeef> Well typehooks are type bounds 😀
05:47:12FromDiscord<demotomohiro> If first parameter is ref or pointer, I assume it is this pointer.
05:47:20FromDiscord<Rika> by type bound i mean functions that come with the type without explicit import or explicit storage in the type
05:48:39FromDiscord<demotomohiro> In C++, compiler implicitly pass this pointer. In Nim, you pass it explicitly.
05:49:39FromDiscord<loaf> so i have a list of objects, with some types being inherited from others. is there a way to only get a specific type?
05:49:55FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3Rt5
05:50:51FromDiscord<loaf> like for example
05:51:34FromDiscord<Rika> In reply to @sOkam! "does object have a": objects are always empty unless specified otherwise, wdym?
05:51:49FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Rt7
05:51:58FromDiscord<loaf> oh
05:51:58FromDiscord<demotomohiro> You can search for a specific type using `of` operator.
05:53:05FromDiscord<sOkam!> In reply to @Rika "objects are always empty": ah nvm, i was reading the wrong number 🧑‍🔧
05:53:47FromDiscord<sOkam!> it printed a number once, fixed it, printed a different one next, but misread and thought it was the same line giving the issue
05:55:40FromDiscord<Rika> classic
05:59:07FromDiscord<Elegantbeef> Guess i should note that you can get any child type of that subtype with `of`
06:08:32FromDiscord<sOkam!> are there any extra tools to debug nim code, other than the compiler?
06:08:54FromDiscord<Elegantbeef> Native debuggers such as GDB
06:09:12FromDiscord<Elegantbeef> Since you're doing graphics programming render doc also is there to help
06:10:16FromDiscord<Elegantbeef> Unless you're talking about static errors
06:10:23FromDiscord<Elegantbeef> Then nope, read the error message and fix the code 😛
06:20:37FromDiscord<sOkam!> In reply to @Elegantbeef "Since you're doing graphics": 😮 ty for pointing me towars that app? it looks poggers 🤩
06:20:50FromDiscord<sOkam!> (edit) "app?" => "app!"
06:21:28FromDiscord<Elegantbeef> I regret it now 😛
06:29:52FromDiscord<loaf> is there a way to make sure the output of a proc is the same subtype as the input if it can take anything under the larger type?
06:51:09FromDiscord<Mysterysib> i'm starting to go crazy with pointers and other stuff. I want to pass a function to another function, but not a C function, a regular nim function
06:51:32FromDiscord<Rika> You don’t need pointers for that
06:51:58FromDiscord<Mysterysib> Yeah I tend to think that when I cant figure something out the solution is pointers xd
06:52:04FromDiscord<loaf> i guess the easy way to do that would be to make the result of the function a variable right?
06:52:36FromDiscord<Rika> In reply to @loaf "i guess the easy": ?
06:54:36FromDiscord<Mysterysib> Basically I'm attempting to write a function that takes any function as its variable and determines the number of possible return values it has using a for loop (this would be awfully slow in runtime, but it's a statically compiled function)
06:55:09FromDiscord<Mysterysib> I was trying to figure out how to get the number of parameters a function has and the type
06:55:24FromDiscord<Mysterysib> I cannot do it when the function takes a string, but otherwise I can
06:55:36FromDiscord<Mysterysib> (edit) "can" => "should be able to"
06:55:54FromDiscord<Elegantbeef> Macros are how you'd do that
06:56:38FromDiscord<Elegantbeef> "possible return values" what does that even mean
06:56:52FromDiscord<Elegantbeef> `proc doThing: int` can return `int.low .. int.high`
07:04:10FromDiscord<Rika> You can’t make a runtime function do that (and it doesn’t really make sense to since functions are static anyway)
07:09:05FromDiscord<Mysterysib> sent a long message, see https://paste.rs/NgN
07:09:13FromDiscord<Mysterysib> I am like way over my head in this, but yeah
07:09:42FromDiscord<Mysterysib> I'm guessing there is a much better way to do this with something completely different
07:09:43FromDiscord<Rika> I can’t read that mess of format
07:10:01FromDiscord<Mysterysib> (edit) "http://ix.io/3Rto" => "http://ix.io/3Rtp"
07:10:12FromDiscord<Elegantbeef> Use 3 back ticks before and after (\`) and write the pseudo code
07:12:12FromDiscord<Elegantbeef> What are you after?
07:12:30FromDiscord<Elegantbeef> Like written words of the behaviour you want
07:12:58FromDiscord<Elegantbeef> Remove any aspect of Nim semantics or ideas from the equation
07:13:33FromDiscord<Mysterysib> In a nutshell, to create functions of which the runtime code and parameters are dependent on the results of another function, that reads a file and parses + does logic on it (so the output is variant on the file)
07:14:15FromDiscord<Elegantbeef> Is this a long winded way of saying "I want to precompute a cache from a file"?
07:14:40FromDiscord<Elegantbeef> What does this file contain?
07:16:18FromDiscord<Mysterysib> The file is a .har in json format storing a bunch of data from request and response to a site. And I guess the shortest way to say this is I want my code to be able to modify itself
07:16:48FromDiscord<Elegantbeef> Let's see one instance of this file and what you want to happen
07:17:43FromDiscord<Mysterysib> I think in C++ it's done with templates if that gives you a better idea of what I mean
07:17:52FromDiscord<Mysterysib> Okay
07:18:01FromDiscord<Elegantbeef> Nim has generics, but i still dont know what you're trying to do
07:20:28FromDiscord<Mysterysib> sent a long message, see http://ix.io/3Rtq
07:21:14FromDiscord<Mysterysib> (edit) "http://ix.io/3Rtr" => "https://paste.rs/NOH"
07:21:21FromDiscord<Mysterysib> (edit) "http://ix.io/3Rts" => "https://paste.rs/Fmp"
07:21:50FromDiscord<Mysterysib> now some other Json files may not have a certain datatype, like say some have floats, others do not
07:23:22FromDiscord<Mysterysib> Based on the number of datatypes (which are in my case statement cases) the original function with the case statement will recursively call itself until its worked with all the data in the json file (already got this part figure out)
07:23:48FromDiscord<Elegantbeef> I still have 0 clue what's going on
07:24:05FromDiscord<Elegantbeef> I'm looking for input -\> output for a single case
07:24:07FromDiscord<Mysterysib> I'm sooorrry okay let me try this
07:24:31FromDiscord<Mysterysib> A function has a case statement. There are different cases, that end in different returns.
07:25:27FromDiscord<Mysterysib> This function calls itself recursively while it processes all the data in a dataset, so you get a bunch of returns
07:25:44FromDiscord<Mysterysib> the return value is stored in an array, or even just echoed
07:26:18FromDiscord<Mysterysib> but based on the amount and datatype of these possible cases and their returns, I want to define a custom function
07:26:50FromDiscord<Mysterysib> for instance, with a dynamic number of parameters
07:26:57FromDiscord<Elegantbeef> Well i can only say read the json data from a macro and emit the procedures
07:27:05FromDiscord<Elegantbeef> Cause i cannot understand anything you're wanting
07:30:23FromDiscord<Rika> `that end in different returns` makes no sense, same object with different kind?↵`so you get a bunch of returns` also makes no sense, what does this mean?
07:30:34FromDiscord<Rika> `but based on the amount and datatype of these possible cases and their returns` ?????????
07:36:53FromDiscord<Mysterysib> I think I need to use macros. The docs on them are confusing to me, so I will have to practice until I get it
07:37:12FromDiscord<Mysterysib> but look, this is the code with the different returns and datatypes
07:37:20FromDiscord<Mysterysib> sent a long message, see http://ix.io/3Rtx
07:37:31FromDiscord<Mysterysib> (edit) "http://ix.io/3Rtx" => "https://paste.rs/ULN"
07:38:59FromDiscord<Mysterysib> (edit) "long message," => "code paste," | "http://ix.io/3Rty" => "https://play.nim-lang.org/#ix=3Rtz"
07:41:56FromDiscord<feldharke> What GUI should I use if I want populate data in a grid(view)?
07:46:50FromDiscord<Elegantbeef> Are you talking about what library or what program? 😀
07:54:00FromDiscord<feldharke> In reply to @Elegantbeef "Are you talking about": Library I think. Programming with Nim
07:57:32FromDiscord<Elegantbeef> You could use illwill if you want TUI. Gintro, wNim(if windows), or WxNim should be useable for a table gui, not that i know how to use any of them well 😛
08:01:34FromDiscord<feldharke> In reply to @Elegantbeef "You could use illwill": Havent' found a database front-end example yet. Do you know one?
08:01:55FromDiscord<Elegantbeef> Nope
08:09:34FromDiscord<Hamid_Bluri> Hey, I wanna copy a `NimNode` without it's children
08:09:43FromDiscord<Hamid_Bluri> what should I do?
08:10:05FromDiscord<Elegantbeef> `copyNimNode`
08:11:08FromDiscord<Hamid_Bluri> thanks beef
08:11:16FromDiscord<Elegantbeef> Or just `newNimNode(myNode.kind)`
08:31:25*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
08:33:15*jmdaemon joined #nim
08:43:08*[RMS] quit (Ping timeout: 256 seconds)
08:45:11*ltriant joined #nim
08:49:56*ltriant quit (Ping timeout: 256 seconds)
08:50:53FromDiscord<aph> sent a code paste, see https://play.nim-lang.org/#ix=3RtN
08:51:06FromDiscord<aph> idk why but it works with code runner
08:51:20FromDiscord<aph> i want to use vscode's terminal because code runner's one is read only
08:51:35FromDiscord<aph> `nim c --run test.nim` is the command i ran
08:51:41FromDiscord<aph> thx :)
08:54:16FromDiscord<demotomohiro> Did you try to recompile the code while your executable is still running?
08:56:38FromDiscord<demotomohiro> If so, you need to stop your `test.exe`.
08:57:35FromDiscord<demotomohiro> Maybe anti-virus software open `test.exe`.
09:07:55*ltriant joined #nim
09:14:52*ltriant quit (Ping timeout: 256 seconds)
09:26:54*rawrrr joined #nim
09:30:50*ltriant joined #nim
09:35:24*ltriant quit (Ping timeout: 240 seconds)
09:56:47FromDiscord<aph> oh thx
09:56:54FromDiscord<aph> sorry late response
10:07:05*ltriant joined #nim
10:10:31*Zectbumo quit (Remote host closed the connection)
10:17:40*ltriant quit (Ping timeout: 272 seconds)
10:19:09*jjido joined #nim
11:06:49*ltriant joined #nim
11:11:36*ltriant quit (Ping timeout: 256 seconds)
11:12:53NimEventerNew post on r/nim by Wouter-van-Ooijen: specify address of a variable, see https://reddit.com/r/nim/comments/t7wnrr/specify_address_of_a_variable/
12:06:01*supakeen quit (Quit: WeeChat 3.4)
12:06:32*supakeen joined #nim
12:06:34NimEventerNew thread by Mardiyah: The dynamical scope of proc, see https://forum.nim-lang.org/t/8986
12:07:28*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
12:11:05*Gustavo6046 quit (Quit: Leaving)
12:12:12*ltriant joined #nim
12:17:00*ltriant quit (Ping timeout: 240 seconds)
12:38:01*krux02 joined #nim
12:48:27*[R] joined #nim
13:27:29*ltriant joined #nim
13:28:25*wyrd quit (Remote host closed the connection)
13:28:48*wyrd joined #nim
13:32:44*ltriant quit (Ping timeout: 272 seconds)
14:07:49FromDiscord<Require Support> sent a code paste, see https://play.nim-lang.org/#ix=3RuS
14:10:09FromDiscord<auxym> nim doesn't support anonymous unions so you'll need to create an object type def for the union
14:11:12FromDiscord<Rika> sent a code paste, see https://paste.rs/kwL
14:12:08FromDiscord<Require Support> sent a code paste, see https://play.nim-lang.org/#ix=3RuT
14:17:53FromDiscord<Waldecir Santos> How do I check if a variable is nil ? I'm doing `if isNil(myObj):` and I keep getting `SIGSEGV: Illegal storage access. (Attempt to read from nil?)`
14:18:24FromDiscord<Rika> Then a different variable is nil
14:19:40FromDiscord<Waldecir Santos> But the traceback points to `if isNil(myObj):`
14:22:45FromDiscord<Rika> more info is needed then
14:39:00*jmdaemon quit (Ping timeout: 256 seconds)
14:44:14*arkurious joined #nim
15:09:46Amun-Rathere's sth wrong with myObj (type/address it points to/etc.)
15:11:27FromDiscord<Rika> okay...?
15:21:33Amun-RaI mean that's my reply for Waldecir Santos
15:21:49FromDiscord<Rika> didnt realise
15:21:59FromDiscord<Rika> i dont think that would be the case
15:23:26Amun-RaI had silimar issue, I forgot what was the case
15:23:29Amun-Racause*
15:32:16*vicecea quit (Remote host closed the connection)
15:32:48*vicecea joined #nim
15:35:58*PMunch joined #nim
15:45:56*nrds quit (Remote host closed the connection)
15:46:13*nrds joined #nim
16:08:20*jjido joined #nim
16:18:21*ltriant joined #nim
16:23:06*ltriant quit (Ping timeout: 260 seconds)
16:41:05*PMunch quit (Quit: leaving)
17:02:31FromDiscord<Phil> ... I am confused, why does nim take issue with some characters in const strings?↵`const ID = "(?P<id>[\d]+)"` this causes a "Invalid character constant" error during compilation.↵The goal I'm trying to achieve with this is having constants of partial regular expressions to put into my URLs. Because typing the same regex for a URL parameter that is just going to denote "this is the name of a dnd campaign" gets old fast (same for ids of
17:03:24FromDiscord<Rika> `\d` is an escape character
17:03:32FromDiscord<typedeck> try """ """
17:03:46FromDiscord<Rika> either make it raw `r"(?P<id>[\d]+)"` or escape the `\` by doubling `\\`
17:03:53FromDiscord<Phil> Ohhh wait, when I wrote it in the url as a `re""` it didn't interpret that as such and thus didn't cause issues
17:04:01FromDiscord<Rika> yes
17:04:04FromDiscord<Phil> (edit) "`re""`" => "`re"<Lots of stuff>"`"
17:04:05FromDiscord<typedeck> or is """ """ just multiline ?
17:04:12FromDiscord<Rika> In reply to @typedeck "or is """ """": just multiline
17:04:16FromDiscord<Rika> actually
17:04:19FromDiscord<Rika> idk if it makes it raw
17:04:21FromDiscord<Rika> i dont think it does
17:04:41FromDiscord<Phil> Fixes compiling issues as well though
17:05:01FromDiscord<Phil> I'd like to write that as string for now since I assemble these strings into actual regex's later
17:05:14FromDiscord<Rika> wdym
17:05:20FromDiscord<Rika> raw strings are just strings
17:05:28FromDiscord<Rika> interpreted differently
17:05:33FromDiscord<Rika> but ultimately still strings
17:05:42FromDiscord<Phil> doesn't re transform a string into a special type of sorts?
17:05:50FromDiscord<Phil> Or did I jump somewhere?
17:05:51FromDiscord<Rika> re does
17:05:53FromDiscord<Rika> r doesnt
17:06:03FromDiscord<Phil> Ohhhhh check
17:06:52FromDiscord<Phil> Well, """ appears to also do raw string (I think?), I'll stick with r though since that conveys more clearly that its intentionally a raw string
17:07:49FromDiscord<Rika> it probably does
17:09:12*rockcavera joined #nim
17:09:13*rockcavera quit (Changing host)
17:09:13*rockcavera joined #nim
17:09:27FromDiscord<Phil> now, time to rewrite like 30 urls
17:19:13*slowButPresent joined #nim
17:39:15FromDiscord<DMI-1407> btw nim uses clang by default to compile C code right ?
17:39:27FromDiscord<DMI-1407> (edit) "?" => "?↵(i forgot where i found the info)"
17:39:42FromDiscord<typedeck> on windows its gcc
17:39:47FromDiscord<DMI-1407> crap
17:40:00FromDiscord<DMI-1407> can i change that ?
17:40:22FromDiscord<typedeck> https://nim-lang.org/docs/nimc.html#compiler-selection
17:40:50FromDiscord<DMI-1407> ok
17:40:54FromDiscord<DMI-1407> (edit) "ok" => "ok, thanks"
17:43:44FromDiscord<typedeck> its defined in nim-1.6.4\config\nim.cfg
17:48:27rockcaveraDMI-1407, I use gcc, clang, vcc and tcc on windows with no problems.
17:50:09rockcaverayou can add the "bin" folder of each compiler in the %PATH% of windows, or configure the config\nim.cfg
17:50:37rockcaverajust the vcc that you don't need...
18:04:00FromDiscord<b4mbus> How would I make nimlsp recognize nimble packages?
18:10:45FromDiscord<ynfle> In reply to @b4mbus "How would I make": It should if they are in ~/.nimble/pkgs and imported. I does for me
18:10:49FromDiscord<ynfle> Not package names though
18:11:03FromDiscord<ynfle> Is there a way to check if a variable is var or let?
18:14:11FromDiscord<DMI-1407> dunno if you can catch the exception... but you cant write a second time into an let... 😅
18:15:09FromDiscord<ynfle> Ya but I want to compiler if it's not
18:15:21FromDiscord<ynfle> stil want to
18:15:50FromDiscord<b4mbus> In reply to @ynfle "Is there a way": prolly with macros?
18:16:47FromDiscord<b4mbus> In reply to @ynfle "It should if they": some of them are there and some not
18:16:57FromDiscord<b4mbus> w8
18:17:39FromDiscord<b4mbus> ok it does indeed work, I had to nimble-run again
18:17:43FromDiscord<b4mbus> thanks
18:20:18FromDiscord<b4mbus> ok
18:20:21FromDiscord<b4mbus> got it
18:21:45FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "Yeah, see the installation": https://github.com/WohlSoft/SDL-Mixer-X↵Okay I want to Futhark this (I have the header and the DLL) but the header includes some other SDL2 headers, so, I'm affraid it becomes messy
18:28:05*kayabaNerve joined #nim
18:32:25FromDiscord<ynfle> In reply to @b4mbus "prolly with macros?": I can't seem to figure out a way
18:33:41FromDiscord<huantian> ~~what if you check if assigning to it compiles~~
18:34:15FromDiscord<ynfle> In reply to @huantian "~~what if you check": True either way for some reason
18:36:10FromDiscord<krisppurg> sent a long message, see http://ix.io/3Rwq
18:36:44FromDiscord<huantian> I’d assume modals are still a wip?
18:38:24FromDiscord<huantian> Is that what they’re called I cannot remember
18:38:49FromDiscord<krisppurg> well I actually was implementing them like 2 or 3 weeks ago, but then I had to put it on hold.
18:42:59FromDiscord<huantian> Ah neato
18:43:23FromDiscord<System64 ~ Flandre Scarlet> In reply to @krisppurg "Sorry for the late": Oh alright! I should give it a try
18:43:56FromDiscord<huantian> I would recommend using dimscmd if you’re going to do commands
18:45:17FromDiscord<System64 ~ Flandre Scarlet> In reply to @huantian "I would recommend using": is it the same thing?
18:56:52FromDiscord<huantian> It’s like an “addon”
19:01:41FromDiscord<krisppurg> dimscmd is much more user friendly basically
19:02:03FromDiscord<System64 ~ Flandre Scarlet> Good to know
19:13:41*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
19:31:15*jjido joined #nim
19:36:12FromDiscord<gibson> sent a code paste, see https://play.nim-lang.org/#ix=3RwH
19:37:29Amun-Radon't assume string layout
19:39:36FromDiscord<gibson> okay, thanks. I'll avoid this whole debacle.
19:40:30Amun-RaI mean it will, sooner or later, shoot you in your foot (prolly sooner than later) ;)
19:44:47FromDiscord<gibson> I was trying to give an often-called external C function direct access to a list of complex nim datatype for fast read access, while retaining fancy nim types in the object, such as string. I'll force the nim-side to use cstring with a "Deal with it" attitude. I'll use cstringutils where I can.
19:46:27Amun-RaI usually represent low level api 1:1 and then write high level api that protects me/the user from shooting the foot
19:51:13FromDiscord<gibson> Hmm, I think what I'm looking for is something like an Entity Component System, where the high-level nim code would look like an object description, but the underlying code would be separated arrays that would allow easy interoperability with C. For now I'll do something simpler.
19:52:09FromDiscord<gibson> (edit) "description," => "description of related fields," | "description of related fields,but the underlying code would be separated arrays ... that" added "by field"
19:56:14*rwb is now known as rb
19:59:56*ltriant joined #nim
20:04:31*ltriant quit (Ping timeout: 245 seconds)
20:15:26FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3RwP
20:22:33FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3RwQ
20:22:35FromDiscord<tandy> this doesnt work \:(
20:26:48*Gustavo6046 joined #nim
20:32:02*jmdaemon joined #nim
20:32:31FromDiscord<tandy> nvm i figured out a better solution \:)
20:51:55*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
20:58:05*jjido joined #nim
21:00:32FromDiscord<b4mbus> How do I put a quote in a regex ;-;
21:00:48FromDiscord<b4mbus> doesnt seem to work for some reason
21:00:49FromDiscord<b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3Rx1
21:00:59FromDiscord<b4mbus> it basically generates hella syntax errors
21:04:17*PMunch joined #nim
21:11:39*PMunch quit (Quit: leaving)
21:15:20*Zectbumo joined #nim
21:24:01FromDiscord<ynfle> Use triple quotes on the outer one and remove the backslashes
21:28:43*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
21:38:21*kayabaNerve quit (Ping timeout: 252 seconds)
21:41:42FromDiscord<b4mbus> In reply to @ynfle "Use triple quotes on": Thanks, worked
21:42:16*wyrd quit (Ping timeout: 240 seconds)
21:42:29FromDiscord<ynfle> 👍
21:46:01FromDiscord<b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3Rxd
21:46:16FromDiscord<b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3Rxe
21:47:40*ltriant joined #nim
21:48:18FromDiscord<b4mbus> It does correctly match the values, correctly splits them
21:48:23FromDiscord<b4mbus> But Im not sure about the conversion part
21:48:46FromDiscord<b4mbus> And with the `.get()` I assume the input is always correct, not point in error handling for now
21:49:27*wyrd joined #nim
21:50:07FromDiscord<typedeck> looks like it doesnt like 3 length hex codes
21:51:32FromDiscord<b4mbus> Well I can implement literally everything or some parts of it by hand but the Nims stdlib is so big that I assumed I'd find all the tools I needed
21:51:54FromDiscord<typedeck> what are your trying to do hex string to int?
21:51:59FromDiscord<typedeck> (edit) "do" => "do,"
21:52:19FromDiscord<b4mbus> (?) Well I said what I wanna do
21:52:24FromDiscord<b4mbus> I have some codepoints in hex
21:52:38FromDiscord<b4mbus> I want to convert them to utf8 characters
21:53:32FromDiscord<typedeck> maybe fromHex[uint8](codepoint)
21:53:46FromDiscord<typedeck> mmm no thats too small
21:54:03FromDiscord<typedeck> erm idk
21:54:12FromDiscord<typedeck> try it and see
21:54:22FromDiscord<b4mbus> Well aight I'll just implement some stuff by hand
21:54:35FromDiscord<b4mbus> In reply to @typedeck "maybe fromHex[uint8](codepoint)": A codepoint can range from 1 to 4 bytes, technically even 6
21:55:23FromDiscord<typedeck> yeah so just parse as the largest uint and then chop off values not defeined by utf-8
21:56:49FromDiscord<ynfle> https://nim-lang.org/docs/strutils.html#parseHexInt%2Cstring
21:58:44*kayabaNerve joined #nim
22:02:11FromDiscord<b4mbus> In reply to @ynfle "https://nim-lang.org/docs/strutils.html#parseHexInt": well yeah but that will just give me the codepoint in an integer form but I want to turn the codepoint into a sequence of UTF8 encoded characters
22:06:13FromDiscord<Elegantbeef> Add the characters to a string then use `toRunes`
22:06:22FromDiscord<typedeck> .mapIt(fromHex[int32](it).Rune)
22:07:04FromDiscord<b4mbus> :OOOOOOOOOO
22:07:27FromDiscord<b4mbus> that works
22:07:30FromDiscord<b4mbus> hell yeah, thanks a lot
22:07:30FromDiscord<b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3Rxo
22:07:51FromDiscord<b4mbus> Im wondering, why cant I do `it.fromHex[int32]().Rune`, but `fromHex[int32](it).Rune` is fine?
22:08:30FromDiscord<typedeck> i think cause its casting, but im not sure
22:09:21FromDiscord<Elegantbeef> No the issue is MCS doesnt work with generics
22:09:29FromDiscord<Elegantbeef> you need to do `it.fromHex[: int32]().Rune`
22:09:43FromDiscord<typedeck> whats mcs?
22:10:06FromDiscord<Elegantbeef> Method call syntax
22:11:23FromDiscord<b4mbus> what's with the `:` there?
22:12:38FromDiscord<ynfle> In reply to @b4mbus "what's with the `:`": Clarify it's a generic param as apposed to array index
22:14:01FromDiscord<Elegantbeef> It makes it so the procedure is resolved properly
22:14:41FromDiscord<Elegantbeef> `it.fromHex[int]` is taken as a `[]` operator of `it.fromHex` but `it.fromHex[:int]` is taken as `fromHex[int](it)`
22:14:47FromDiscord<typedeck> would be cool if Rune could be thrown in since it is implemented as int32
22:15:54FromDiscord<ynfle> In reply to @typedeck "would be cool if": It is
22:16:18FromDiscord<Elegantbeef> Well it's a distinct, so that's kinda the point 😛
22:16:18FromDiscord<typedeck> sent a code paste, see https://play.nim-lang.org/#ix=
22:16:26FromDiscord<typedeck> yeah...
22:17:24FromDiscord<typedeck> ah i see
22:18:26FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Rxp
22:19:07FromDiscord<huantian> Is it better to have the method return sig be T or Rune here
22:19:22FromDiscord<huantian> Ig it doesn’t matter since T is always Rune
22:19:58FromDiscord<Elegantbeef> Well you dont want to make it so you have to call `strutils.fromhex` everywhere
22:21:32FromDiscord<typedeck> sent a code paste, see https://play.nim-lang.org/#ix=3Rxq
22:21:37FromDiscord<ynfle> Ya
22:21:40FromDiscord<Elegantbeef> It's a type conversion yes
22:21:48FromDiscord<Elegantbeef> Command syntax instead of method call syntax
22:22:08FromDiscord<Elegantbeef> Command syntax is `()` less calls
22:22:28FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3Rxr
22:23:14FromDiscord<Elegantbeef> But `Rune (it,)` is not 😛
22:23:36FromDiscord<ynfle> That's an issue with nimfmt
22:24:25FromDiscord<Elegantbeef> It doesnt let you do dumb things?
22:25:11FromDiscord<ynfle> See first example https://github.com/FedericoCeratto/nimfmt#examples with the foo call
22:25:35FromDiscord<Elegantbeef> Yea like i said it doesnt let you do dumb things
22:25:48FromDiscord<ynfle> How do you echo a tuple?
22:25:52FromDiscord<Elegantbeef> If you have a procedure which has a single argument that's a tuple
22:26:11FromDiscord<huantian> I do wish we had a full Nim formatted like pythons black
22:26:11FromDiscord<Elegantbeef> Who the fuck echo's a tuple they constructed on the line of the echo?
22:26:43FromDiscord<ynfle> 🤷‍♂️
22:26:48FromDiscord<huantian> Maybe you’re testing a custom $ you made for your tuple 😛
22:27:17FromDiscord<Elegantbeef> Sure
22:27:23FromDiscord<Elegantbeef> And then who makes a custom `$` for a tuple
22:27:36FromDiscord<Elegantbeef> Way to ruin everything
22:28:49FromDiscord<Elegantbeef> If you're making operators or procedures for specific tuples i hate you, you need help 😛
22:28:55FromDiscord<ynfle> In reply to @huantian "Maybe you’re testing a": It won't ruin anything because `$` would disambiguate tuple, versus multiple params
22:29:42FromDiscord<Elegantbeef> What?
22:29:45FromDiscord<Elegantbeef> `$` would effect all tuples of that type
22:29:50FromDiscord<Elegantbeef> They are not distinct
22:31:23FromDiscord<ynfle> That's not what I was trying to say, but what I was trying to say wasn't right either
22:31:45FromDiscord<Elegantbeef> Ok i'm mostly joking anyway so it doesnt matter
22:38:12*kayabaNerve quit (Ping timeout: 240 seconds)
23:07:48*jmdaemon quit (Ping timeout: 272 seconds)
23:25:39*jmdaemon joined #nim
23:29:10*jmdaemon quit (Client Quit)
23:30:44FromDiscord<Waldecir Santos> How can I clone on `ref object` ? deepCopy is the write tool for the job ?
23:32:00*jmdaemon joined #nim
23:32:02FromDiscord<Elegantbeef> Depends on the fields but probably
23:32:34FromDiscord<Waldecir Santos> My object have another object and a `Option[seq[T]]`
23:32:52FromDiscord<Waldecir Santos> I'll play around with it, thank you @ElegantBeef !