<< 22-03-2022 >>

00:16:49FromDiscord<spoon> now create a folder named CON
00:28:06FromDiscord<Bubblie> With nimble can you change the local repo path?
00:28:21FromDiscord<Elegantbeef> What do you mean?
00:29:13FromDiscord<Bubblie> Local git repo path
00:29:38FromDiscord<Elegantbeef> Do you mean like symlinking it to develop it?
00:29:49FromDiscord<Elegantbeef> There is a `nimble develop`
00:30:23FromDiscord<Bubblie> I think that may be it, sorry idk how else to say it
00:30:37FromDiscord<Bubblie> Ill look at nimble develop
00:31:24*Stink joined #nim
00:33:42FromDiscord<Bubblie> Yeah nimble develop seems to be what I needed
00:34:12FromDiscord<Bubblie> Ty
00:41:07*vicfred quit (Quit: Leaving)
01:16:43FromDiscord<Patitotective> In https://nim-lang.org/docs/colors.html how do I `extractRgb` as float values (from 0.0-1.0 instead of 0-255)?
01:17:35FromDiscord<Elegantbeef> `myCol.extractRgb.mapIt(it.float / 255)`
01:17:56FromDiscord<Elegantbeef> Hmm that probably makes a seq eh
01:19:24FromDiscord<Elegantbeef> Actually it doesnt work cause `mapit` expects `typed`
01:19:32FromDiscord<Elegantbeef> so just iterate over the result and div by 255
01:20:01FromDiscord<auxym> see also https://github.com/treeform/chroma which has many color types, including some that use float32
01:42:37FromDiscord<Bubblie> Nim + java = nimava
01:43:02FromDiscord<Bubblie> Cursed
01:45:40FromDiscord<treeform> I agree
01:46:16nrds<Prestige99> Jim
01:46:30FromDiscord<Bubblie> since nim has an embeddable vm for scripting its entirely possible
01:46:32FromDiscord<Bubblie> 😈
01:46:54FromDiscord<Bubblie> In reply to @nrds "<Prestige> Jim": Perfect
01:46:54FromDiscord<Elegantbeef> Except Nim's VM is relatively simple and not JVM supporting
01:46:56FromDiscord<Bubblie> Jim
01:47:10FromDiscord<Bubblie> In reply to @Elegantbeef "Except Nim's VM is": Yeah id have to alter things to support it
01:47:15FromDiscord<Bubblie> But its very possible
01:47:24FromDiscord<Bubblie> Its been done with other langs
01:47:36FromDiscord<Elegantbeef> I mean Nim's VM is relatively simple
01:47:42FromDiscord<Bubblie> Ye
01:47:44FromDiscord<Bubblie> Which is good
02:00:02FromDiscord<Girvo> Hi all 🙂
02:02:44FromDiscord<m4ul3r> With nimcrypto CTR aes256, I'm getting a different decryption with the same key and iv in one program than another. ↵I have one program that generates the key, iv, and encoded sequence. I am then wanting to implement the decryption in another program
02:03:59FromDiscord<Elegantbeef> Hello girvo
02:09:52FromDiscord<m4ul3r> In reply to @m4ul3r "With nimcrypto CTR aes256,": Here is my code:↵https://pastebin.com/iK2XRwma
02:10:51FromDiscord<m4ul3r> (edit) "code:↵https://pastebin.com/iK2XRwma" => "code:↵https://pastebin.com/iK2XRwma↵Error at the bottom, out should be `sc`"
02:16:09FromDiscord<Girvo> I'm having a lot of fun getting interactive JTAG debugging of Nim code working haha
02:16:28NimEventerNew question by Steve0Greatness: Join array in nim, see https://stackoverflow.com/questions/71566204/join-array-in-nim
02:16:49FromDiscord<Elegantbeef> Is that fun like i use the word or the actual meaning of fun?
02:17:20FromDiscord<Girvo> Both 😄
02:17:44FromDiscord<Girvo> Its genuinely fun to see interactive debugging of an embedded chip working with Nim code. Its _nearly_ working perfectly with PlatformIO
02:18:03FromDiscord<Girvo> Nearly. Seems to work best with `-d:danger` interestingly
02:18:12FromDiscord<Elegantbeef> Ah i'm having "fun" tracking down a concept bug 😛
02:18:38FromDiscord<Elegantbeef> Why work on my game when i can fix this bug that isnt impacing
02:18:42FromDiscord<Elegantbeef> impacting me\
02:18:46FromDiscord<Girvo> Haha, yeah that sounds "fun" for sure
02:20:54FromDiscord<Girvo> But yeah, `-d:danger` has the regular old PlatformIO debugging working, though obviously minus the Nim info internally to it. Does `-d:danger` override `--lineDir:on`?
02:21:14*Gustavo6046 joined #nim
02:21:53FromDiscord<Elegantbeef> do not think so
02:22:07FromDiscord<Girvo> Alright, I'm going to have a play
02:22:10FromDiscord<Elegantbeef> Think you should be using `--debugger:native`
02:22:24FromDiscord<Girvo> Yeah I am
02:22:40FromDiscord<Elegantbeef> Doesnt that imply lineDir?
02:22:59FromDiscord<Girvo> I believe so, I'm just not 100% sure what I should be getting haha
02:23:15FromDiscord<Girvo> As its also all `--compileOnly` which makes things slightly more interesting I think
02:23:35FromDiscord<Elegantbeef> Nah it's all the same
02:23:43FromDiscord<Girvo> With `-d:danger` the PlatformIO GDB stuff breaks on AppMain correctly. Without it, it does not
02:23:57FromDiscord<Girvo> sent a code paste, see https://play.nim-lang.org/#ix=3T7T
02:25:49FromDiscord<Girvo> To be honest, it's working well enough for me to debug the C code and map it myself anyway so I'm not too stressed. Would be lovely if there was some way to set a breakpoint in the Nim code and have it map to the C code. Or failing that, I'd love a way to click on a Nim line and have it take me to the corresponding nimcache C code line if it exists haha
02:26:10FromDiscord<Girvo> I might write an extension for VSCode to do that myself actually, the latter idea anyway
02:30:21FromDiscord<Elegantbeef> Time to extend the Nim extension 😛
02:32:18FromDiscord<Girvo> If people would find that useful, absolutely!
02:34:17FromDiscord<Girvo> Interestingly, with `-d:danger` the debugger picks up the C source in nimcache correctly. Without it, it gives me assembly output haha
02:36:55FromDiscord<Girvo> Oh!
02:37:25*neurocyte0917090 quit (Ping timeout: 240 seconds)
02:37:39FromDiscord<Girvo> So: `--debugger:native` and _then_ `-d:danger` -- no `#line` macros in the C source. But with `--debugger:native` _after_ `-d:danger`, there is!
02:38:33FromDiscord<Elegantbeef> Seems like danger does indeed remove `lineDir`
02:39:05FromDiscord<Girvo> Yeah but only if passed after `--lineDir` or `--debugger` -- if passed before, it doesn't override it, it seems
02:39:32FromDiscord<Girvo> I'll have a play and see if I can nail down exactly how to approach this, and I'll document it for others
02:39:56FromDiscord<Girvo> Holy shit it works haha
02:40:03FromDiscord<Girvo> Including Nim code debugging properly
02:40:08FromDiscord<Bubblie> does nim have that ! for flagging whether something should not be true
02:40:13FromDiscord<Bubblie> like c++ and java
02:40:13FromDiscord<Bubblie> so
02:40:18FromDiscord<Bubblie> !isNotClosed
02:40:18FromDiscord<Elegantbeef> `not x`
02:40:21FromDiscord<Bubblie> thanks
02:40:27FromDiscord<Girvo> https://media.discordapp.net/attachments/371759389889003532/955657175429165056/unknown.png
02:42:11FromDiscord<Elegantbeef> Congrats
02:42:53FromDiscord<Girvo> I'm stoked, this is going to make things so much easier haha
02:44:00FromDiscord<Girvo> Will still need to work out how to get a decent representation of certain nim variables in this, but honestly low-level is better on this embedded stuff anyway.
02:44:56*acidsys quit (Excess Flood)
02:45:29*acidsys joined #nim
03:18:07FromDiscord<ajusa> anyone know the status of https://nim-lang.org/docs/hcr.html ? Doesn't seem to work with the example I tried, C codegen issues
03:22:03FromDiscord<Elegantbeef> HCR isnt well supported so that's par for the corse
03:22:10FromDiscord<Elegantbeef> course even
03:22:15FromDiscord<Elegantbeef> Maybe even coarse for funsies
03:24:19FromDiscord<creikey> wait is nim profitable
03:24:30FromDiscord<creikey> like are there people who get paid full time to work on the compiler
03:24:49FromDiscord<Elegantbeef> There are 2/3 core team members who work full time afaik
03:26:36FromDiscord<Elegantbeef> Araq is full time, miran is the paid community manage and i think flywind is soon to be paid in some capacity
03:26:37FromDiscord<Bubblie> nimgl vulkan bindings are annoying
03:26:55FromDiscord<Bubblie> the opengl wrapper from nim uses glfw right?
03:27:12FromDiscord<Bubblie> or, it doesn't
03:27:13FromDiscord<Elegantbeef> No it doesnt use anything
03:27:19FromDiscord<Elegantbeef> What's annoying with the vulkan bindings?
03:27:32FromDiscord<Bubblie> for some reason, I keep coming across this issue with glfwCreateWindow
03:27:38FromDiscord<Bubblie> which is very odd
03:27:43FromDiscord<Bubblie> its specifically that
03:27:56FromDiscord<Elegantbeef> What issues?
03:28:22FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=
03:28:31FromDiscord<Bubblie> is there a stacktrace or something I can do to get more info
03:28:45FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=
03:28:53FromDiscord<Bubblie> this is also one of the things that comes up
03:28:58FromDiscord<Elegantbeef> That's a C assertion
03:29:01FromDiscord<Bubblie> yeah
03:29:08FromDiscord<Elegantbeef> So the issue is you're passing a nil window
03:29:17FromDiscord<Elegantbeef> Or non nil window rather
03:29:27FromDiscord<Bubblie> weird... because even in the glfw usage example in nimgl
03:29:31FromDiscord<Elegantbeef> Cant get a stacktrace from non nim code
03:29:31FromDiscord<Bubblie> it does exactly that
03:29:35FromDiscord<Bubblie> In reply to @Elegantbeef "Cant get a stacktrace": yeah
03:29:36FromDiscord<Bubblie> thought so
03:29:52FromDiscord<Bubblie> so im assuming this may be from the bindings themselves, as it then species two things
03:30:02FromDiscord<Bubblie> my let window
03:30:02FromDiscord<Bubblie> and
03:30:11FromDiscord<Bubblie> the glfw.nim line 5130
03:30:20FromDiscord<Bubblie> where the binding for createWindow is
03:30:34FromDiscord<Bubblie> this is the code for the proc
03:30:34FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3T81
03:30:41FromDiscord<Bubblie> (edit)
03:30:42FromDiscord<Bubblie> well uh
03:30:46FromDiscord<Bubblie> discord didn't do the indents right
03:30:47FromDiscord<Bubblie> thanks discord
03:31:36FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=
03:31:40FromDiscord<Elegantbeef> It's fine here
03:31:40FromDiscord<Bubblie> seems to be causing the trouble
03:31:42FromDiscord<Bubblie> apparantly
03:31:47FromDiscord<Bubblie> In reply to @Elegantbeef "It's fine here": it works?
03:31:49FromDiscord<Bubblie> wait what
03:31:54FromDiscord<Elegantbeef> The code
03:32:11FromDiscord<Elegantbeef> just noticed you edited
03:32:17FromDiscord<Elegantbeef> Generally edits from discord do the die and disappear
03:32:26FromDiscord<Bubblie> you using nimgl's glfw bindings and everything and it worked? Is it okay if I see what you did?
03:32:28FromDiscord<Bubblie> In reply to @Elegantbeef "*just noticed you edited*": oh
03:32:29FromDiscord<Bubblie> LMAO
03:32:42FromDiscord<Bubblie> im not sure if windows is being a piece of shit
03:32:45FromDiscord<Bubblie> I mean I did restart
03:32:54FromDiscord<Bubblie> this wouldn't be the first time windows fucked with glfw windowing
03:33:02FromDiscord<Bubblie> had a problem with lwjgl glfw as well
03:33:05FromDiscord<Bubblie> where windows was the issue
03:33:12FromDiscord<Bubblie> so I restarted and it worked
03:35:39FromDiscord<Elegantbeef> I cant even get the tvulkan example to compile
03:36:59*arkurious quit (Quit: Leaving)
03:41:35FromDiscord<Bubblie> Oh lord
03:41:41FromDiscord<Bubblie> You think the bindings are fucked then?
03:42:19FromDiscord<Elegantbeef> Well the example might not have been kept up to date
03:42:48FromDiscord<Bubblie> Yeah
03:44:19FromDiscord<Bubblie> Its okay if the vulkan bindings cannot work, I might use futhark or c2nim to just use the vulkan dll and glfw stuff instead or just statically link it myself
03:44:42FromDiscord<Bubblie> Thats less than ideal however
03:45:25FromDiscord<Elegantbeef> Static linking vulkan seems weird
03:46:17FromDiscord<Bubblie> Whats also odd is the way nimgl decided to alter some of the glfw methods, weirdly instead of glfwDestroyWindow or ShouldDestroyWindow you assign the glfwwindow variable and then use that variable to destroy it which is window.destroyWindow() which goes against the general flow of glfw entirely its pretty weird
03:46:25FromDiscord<Bubblie> Other bindings dont do this
03:46:33FromDiscord<Bubblie> For glfw
03:46:37FromDiscord<Bubblie> In reply to @Elegantbeef "Static linking vulkan seems": It does
03:46:51FromDiscord<Bubblie> I could use c2nim it may make things super easy
03:46:56FromDiscord<Bubblie> Cause then its just, import and be done
03:47:03FromDiscord<Bubblie> Or futhark maybe
03:47:10FromDiscord<Bubblie> Am I spelling that right?
03:47:11FromDiscord<Bubblie> Idk
03:47:23FromDiscord<Elegantbeef> Well you generally want to dynamically link to give more freedom
03:47:55FromDiscord<Bubblie> Yeah
03:48:10FromDiscord<Bubblie> Ill try dynamic linking maybe, if I cant get nimgl to work
03:48:18FromDiscord<Bubblie> I hope I can because idk whats going on
03:48:36FromDiscord<Bubblie> If you have any ideas or if you get it working throw it my way if you can
03:49:44*Zectbumo joined #nim
03:49:58FromDiscord<Bubblie> Is there any docs on dynamic linking in nim btw?
03:50:32FromDiscord<Elegantbeef> Oh i didnt realize i needed a flag
03:50:44FromDiscord<Bubblie> 👀
03:53:10FromDiscord<Elegantbeef> Example runs here in linux land
03:53:25FromDiscord<Bubblie> 👀can I see what you did
03:53:38FromDiscord<Elegantbeef> I used their TVulkan example
03:53:51FromDiscord<Elegantbeef> then i compiled with `-d:vulkan`
03:54:05FromDiscord<Elegantbeef> And for dynamic linking refer to https://nim-lang.org/docs/manual.html#foreign-function-interface-dynlib-pragma-for-import
03:54:09FromDiscord<Bubblie> Tysm
03:58:16FromDiscord<Bubblie> And oh, maybe thats why
03:58:21FromDiscord<Bubblie> I forgor the flag
03:58:26FromDiscord<Bubblie> -d:vulkan
03:58:39FromDiscord<Bubblie> Although the error in which im getting seems unrelated
03:59:13FromDiscord<Bubblie> Ill try fully compying the example, as I did this with my own code rather than using their example directly
04:01:07FromDiscord<Bubblie> (edit) "compying" => "copying"
04:01:08FromDiscord<Elegantbeef> If it doesnt work for you i can only imagine an issue with windows bindings, drivers
04:01:14FromDiscord<Bubblie> Yeah
04:01:24FromDiscord<Bubblie> I forked nimgl vulkan
04:01:32FromDiscord<Bubblie> So I can take a look at a possible fix
04:02:15FromDiscord<Bubblie> Windows dont be shit challenge IMPOSSIBLE
04:04:23FromDiscord<Bubblie> I want to switch to fedora soon for programming, but its also good im developing on windows since id want my application run everywhere so working on a shit OS has benefits
04:04:56FromDiscord<Elegantbeef> Benefits like riding a bike with no seat, it's all a pain in the ass
04:11:27FromDiscord<Bubblie> Fr
04:22:46nrds<Prestige99> Could you just try running the application via wine?
04:31:12FromDiscord<Elegantbeef> Yea wine build errors @Bubblie
04:31:29FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3T8j
04:31:54FromDiscord<Elegantbeef> Ah that's gfw init
04:36:52*slowButPresent quit (Quit: leaving)
04:50:11FromDiscord<Girvo> In reply to @Elegantbeef "If it doesnt work": Of which there are many 😄 so much "fun"...
04:51:02FromDiscord<Elegantbeef> There you go
04:55:38*xaltsc quit (Remote host closed the connection)
05:07:15FromDiscord<Shinyzenith> Is it possible to use OOP in nim? I was thinking of implementing some functions on this type with a parameter of Self https://media.discordapp.net/attachments/371759389889003532/955694122121986058/unknown.png
05:08:17FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3T8p
05:08:18FromDiscord<Elegantbeef> For instance
05:08:43FromDiscord<Shinyzenith> well I have done that
05:09:00FromDiscord<Shinyzenith> but is that all the choice I have?
05:09:03FromDiscord<Shinyzenith> that's what I wanted to ask
05:09:13FromDiscord<Elegantbeef> I mean you can use libraries to emulate classes
05:09:23FromDiscord<Elegantbeef> What's the issue with the above though?
05:09:41FromDiscord<Shinyzenith> Nothing, I was just wondering if there are other choice
05:09:42FromDiscord<Shinyzenith> (edit) "choice" => "choices"
05:09:50FromDiscord<Elegantbeef> oolib is one example of a macro that implements a classlike behaviour
05:10:07FromDiscord<Shinyzenith> what's that
05:10:36FromDiscord<Elegantbeef> If you want to be able to override the behaviour have inheritance you can make `HerbServer = ref object of RootObj` then you can later do `MyChild = ref object of HerbServer` and use methods
05:10:40FromDiscord<Elegantbeef> Oolib is library
05:11:01FromDiscord<Shinyzenith> Oh ok
05:11:03FromDiscord<Shinyzenith> thank you
05:11:38FromDiscord<Shinyzenith> is it possible to store procedures in a typedef?
05:12:15FromDiscord<Elegantbeef> You mean have pointer procs?
05:12:28FromDiscord<Shinyzenith> loved that feature from zig, just straight up storing functions in structs https://media.discordapp.net/attachments/371759389889003532/955695433395630080/unknown.png
05:12:33FromDiscord<Shinyzenith> In reply to @Elegantbeef "You mean have pointer": Nope
05:12:36FromDiscord<Shinyzenith> just raw procedures
05:12:48FromDiscord<Elegantbeef> No Nim type sections are purely type sections
05:12:58FromDiscord<Shinyzenith> Ok understood
05:12:59FromDiscord<Shinyzenith> thanks!
05:13:12FromDiscord<Elegantbeef> would that be accessed `Server.init`?
05:13:52FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/XWw
05:13:59FromDiscord<Elegantbeef> Though it'd be more idiomatic to return the server
05:14:14FromDiscord<Elegantbeef> `proc init(_: type Server): Server` for instance
05:16:40FromDiscord<Shinyzenith> In reply to @Elegantbeef "would that be accessed": yep
05:16:54FromDiscord<Elegantbeef> Then the above would work for you
05:17:08FromDiscord<Shinyzenith> Cool! i'll try it
05:18:28FromDiscord<Shinyzenith> yep that's how I called it in zig https://media.discordapp.net/attachments/371759389889003532/955696946784395284/unknown.png
05:18:49FromDiscord<Elegantbeef> Oh it's for an instance
05:19:14FromDiscord<Shinyzenith> yep not the raw type, that wouldn't make much sense
05:19:18FromDiscord<Elegantbeef> If it's for an instance just do `proc init(server: var Server)`
05:19:20FromDiscord<Shinyzenith> nor would I t work I think
05:19:30FromDiscord<Elegantbeef> It does make sense in Nim atleast
05:19:45FromDiscord<Shinyzenith> well in the init function I am populating the struct
05:19:46FromDiscord<Shinyzenith> so
05:19:49FromDiscord<Shinyzenith> I think that should work
05:19:59FromDiscord<Shinyzenith> (the example you posted above)
05:20:09FromDiscord<Elegantbeef> You can populate the result in the `proc init(_: type Server): Server`
05:20:18FromDiscord<Elegantbeef> They're the same thing just different use semantics
05:20:22FromDiscord<Shinyzenith> In reply to @Elegantbeef "You can populate the": Yeah I'll do that
05:20:35FromDiscord<Shinyzenith> In reply to @Elegantbeef "They're the same thing": I come from the line of scala and java lol, so the above appeals the most to me
05:20:48FromDiscord<Shinyzenith> 🤣
05:21:13FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/bTH
05:21:24FromDiscord<Elegantbeef> Is one way of doing it
05:21:30FromDiscord<Shinyzenith> I see
05:21:35FromDiscord<Shinyzenith> Just one question
05:21:51FromDiscord<Shinyzenith> sent a code paste, see https://play.nim-lang.org/#ix=3T8q
05:22:14FromDiscord<Elegantbeef> Cause that's what i thought the semantics were in Zig
05:22:15FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3T8r
05:22:33FromDiscord<Elegantbeef> I thought it was forced to be used `Server.init(myVar)`
05:22:33FromDiscord<Shinyzenith> In reply to @Elegantbeef "Or the zig port": yep
05:22:40FromDiscord<Elegantbeef> Cause you said it was
05:22:41FromDiscord<Shinyzenith> In reply to @Elegantbeef "I thought it was": Nope
05:22:52FromDiscord<Elegantbeef> Well you said it was which is why
05:22:53FromDiscord<Shinyzenith> In reply to @Elegantbeef "Cause you said it": I think I didn't explain it properly
05:23:07FromDiscord<Elegantbeef> Yea i got it now
05:23:11FromDiscord<Elegantbeef> It's dispatched on instance not on type
05:23:38FromDiscord<Shinyzenith> sent a code paste, see https://play.nim-lang.org/#ix=3T8s
05:23:42FromDiscord<Shinyzenith> why pass a type and a server struct to it
05:24:17FromDiscord<Elegantbeef> Like i said it was based off what i understood the semantics was
05:24:18FromDiscord<Shinyzenith> idk if self exists in nim, in which case proc init():HerbServer=
05:24:27FromDiscord<Shinyzenith> In reply to @Elegantbeef "Like i said it": Ah Ok, got it
05:24:40FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3T8t
05:24:45FromDiscord<Elegantbeef> Since it's a free standing function and nim doesnt have return inference
05:25:04FromDiscord<Shinyzenith> got it, but why the _:type Server?
05:25:16FromDiscord<Elegantbeef> Cause you need to dispatch based off the type
05:25:16FromDiscord<Shinyzenith> this is the return type, right? https://media.discordapp.net/attachments/371759389889003532/955698655032123462/unknown.png
05:25:31FromDiscord<Elegantbeef> `init(): X` and `init(): Y` are ambigious and nim cannot disambiguate
05:25:40FromDiscord<Elegantbeef> Nim does not do inference based off return type
05:25:46FromDiscord<Shinyzenith> huh I see
05:26:01FromDiscord<Elegantbeef> So you need to pass in `Server` so you can do `Server.init`
05:26:35FromDiscord<Shinyzenith> Oh yea, i remember reading that ↵myfunct(param1) ↵and param1.myfunct are the same
05:26:36FromDiscord<Shinyzenith> in nim
05:26:39FromDiscord<Shinyzenith> So it makes sense now
05:27:02FromDiscord<Elegantbeef> Yes it's UFCS or MCS as nim calls it and it's wonderful
05:27:27FromDiscord<Shinyzenith> Good stuff 😁
05:27:38FromDiscord<Elegantbeef> Allows you to easily expand the functionality of types you dont even author
05:28:43FromDiscord<Shinyzenith> hmm while doing that, the result keyword lost all syntax highlighting ↵i assume I did something wrong? https://media.discordapp.net/attachments/371759389889003532/955699525283106876/unknown.png
05:29:09FromDiscord<Shinyzenith> or is result not a valid keyword here?
05:29:18FromDiscord<Elegantbeef> Syntax highlighting isnt compilation
05:29:27FromDiscord<Shinyzenith> well yes
05:29:30FromDiscord<Elegantbeef> It's a proc with a return type `result` exists
05:29:33FromDiscord<Shinyzenith> but most of the time somethnig fucks up
05:29:40FromDiscord<Elegantbeef> You're defining the proc in the type section
05:29:52FromDiscord<Elegantbeef> You cannot define procs in the type section
05:30:18FromDiscord<Shinyzenith> Oh no I just fucked up the indentation
05:30:44FromDiscord<Elegantbeef> That's what i said in different words
05:31:10FromDiscord<Shinyzenith> yus I was acknowledging that 🙏
05:32:05FromDiscord<Elegantbeef> Thought the "oh no" was to me
05:32:26FromDiscord<Shinyzenith> :catno:
05:32:52FromDiscord<Shinyzenith> anyways, I'm liking nim for complex c projects
05:33:01FromDiscord<Shinyzenith> i think it will be my first class candidate after zig and cpp
05:33:13FromDiscord<Shinyzenith> (edit) "i think it will be my first class candidate after zig and cpp ... " added "for c interop"
05:33:31FromDiscord<Elegantbeef> That far down the list
05:33:32FromDiscord<Elegantbeef> Shame 😀
05:33:52FromDiscord<Shinyzenith> well zig has support for inline functions, it's annoying to redefine them every single time
05:34:03FromDiscord<Shinyzenith> maybe if pmunch patches support for it, it'll definitely be neck to neck with zig
05:34:11FromDiscord<Shinyzenith> (edit) "well zig has support for inline functions, it's annoying to redefine them every single time ... " added "in ni"
05:34:14FromDiscord<Shinyzenith> (edit) "ni" => "nim"
05:34:35FromDiscord<Elegantbeef> Wonder if he can just make a template which emits the C code internally
05:35:01FromDiscord<Shinyzenith> hm that sounds like a possible workaround
05:35:15FromDiscord<Elegantbeef> How many times do we have to say his name to summon him
05:35:23FromDiscord<Shinyzenith> 🤣
05:35:35FromDiscord<Shinyzenith> @PMunch @PMunch 👁️ Hi
05:35:45FromDiscord<Elegantbeef> Beetlejuice
05:35:46FromDiscord<Elegantbeef> Wait that's not it
05:35:58FromDiscord<Shinyzenith> that's not pmunch?
05:36:18FromDiscord<Elegantbeef> No beetlejuice is surprisingly not pmunch
05:36:32FromDiscord<Shinyzenith> what now https://media.discordapp.net/attachments/371759389889003532/955701491610566686/unknown.png
05:36:33FromDiscord<Elegantbeef> He uses matrix and irc anyway so he'll be here when he's here
05:36:45FromDiscord<Shinyzenith> In reply to @Elegantbeef "He uses matrix ": Oh ok
05:37:07FromDiscord<Elegantbeef> It's probably morning for him so he'll be on soon TM
05:37:46FromDiscord<Shinyzenith> Ah ok
05:38:53*sagax joined #nim
05:41:12FromDiscord<Elegantbeef> Suppose he could also emit a procedure that's annotated inline and just emits the C code aswell
05:41:19FromDiscord<Elegantbeef> Should in theory solve the issue
05:43:26FromDiscord<Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/955703227129659412/unknown.png
05:43:37FromDiscord<Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/955703275720675368/unknown.png
05:43:37*toulene quit (Ping timeout: 256 seconds)
05:43:50FromDiscord<Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/955703329277751306/unknown.png
05:43:54FromDiscord<Shinyzenith> we had a small chat about the issue
05:44:48FromDiscord<Elegantbeef> Oh right we're looking at headers not implementation
05:44:58FromDiscord<Elegantbeef> I'm a dumb dumb
05:45:36*toulene joined #nim
05:45:45FromDiscord<Elegantbeef> If you can get the implementation my idea doesnt seem to bad to me, but good luck doing that automatically
05:46:25FromDiscord<Shinyzenith> yeah , hence zig and cpp on top for now 🙏
05:49:49FromDiscord<Elegantbeef> Do you have an example C file with an inline proc?
05:52:53FromDiscord<Elegantbeef> Found that issue
06:05:23*ltriant quit (Ping timeout: 256 seconds)
06:38:54*kayabaNerve quit (Remote host closed the connection)
06:39:28*kayabaNerve joined #nim
06:50:47*acidsys quit (Excess Flood)
06:51:20*acidsys joined #nim
06:54:05*rockcavera quit (Remote host closed the connection)
07:41:58*xaltsc joined #nim
08:38:39NimEventerNew Nimble package! run_exe - A mini DSL for Nim that provides syntactic sugar for running/piping shell commands. , see https://github.com/V0idMatr1x/run_exe
08:39:14FromDiscord<pmunch> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: these are header files where the inline procedures have their implementation in the header.
08:39:42FromDiscord<Elegantbeef> Yea i realize how dumb my calling myself dumb was after
08:39:47FromDiscord<pmunch> What you where proposing is pretty much exactly what I intend to do in order to support them
08:40:11FromDiscord<Elegantbeef> I was thinking how C++ and Zig could use them, then realized my dumb dumb was a dumb dumb dumb
08:40:17FromDiscord<pmunch> But you have to be careful so that all the parameter names match up
08:40:34FromDiscord<pmunch> And that they can call other inlines from their bodies
08:40:52FromDiscord<pmunch> It's just a bit tricky though, should be able to make it work.
08:41:09FromDiscord<Elegantbeef> The calling other inlines shouldnt be a big deal given first in first out of C
08:41:47FromDiscord<pmunch> Of course, but it means I can't rename anything. I need to make sure the inline procedures have the exact same name as in C
08:42:17FromDiscord<Elegantbeef> Yea it's a bunch of tedious work done in string lits 😛
08:43:09FromDiscord<pmunch> Pretty much
08:43:21FromDiscord<pmunch> Which is a pita, but not impossible
08:44:01FromDiscord<Elegantbeef> Which suprises me 😀
08:44:02FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/kvq
08:44:17*kayabaNerve quit (Ping timeout: 240 seconds)
08:47:00FromDiscord<pmunch> Already thought of that 😉
08:47:08FromDiscord<Elegantbeef> Pmunch writes another tick on his notepad of "I already know that beef tells me still"
08:47:23FromDiscord<Rika> bingo
08:47:47FromDiscord<Elegantbeef> Bango bongo
08:47:57FromDiscord<pmunch> Gotta have an exportc and inline on the body as well of course. But the problem is if you're building directly against the sources like in the STB example and not linking to a library
08:48:27FromDiscord<pmunch> Now you will have two of the same definition bearing the same name..
08:49:12FromDiscord<Elegantbeef> Well this is only for header only so clearly time for a new distinct string 😛
08:49:42FromDiscord<Elegantbeef> `implPath"stb_image.h"`!
08:51:25FromDiscord<Elegantbeef> Unless you want to automagically want to detect it by analyzing the entire file
09:15:19FromDiscord<enthus1ast> do we have a module that implements parseutils like procs (parseUntil, skipWhile) etc, but for sequences of objects?
09:17:01FromDiscord<Phil> In reply to @enthus1ast "do we have a": like, parse every individual entry in a seq from type A to B?
09:17:18FromDiscord<Phil> (edit) "B?" => "B causing the creation of a new seq?"
09:17:21FromDiscord<enthus1ast> yep
09:17:22FromDiscord<Elegantbeef> Sounds like they want to define a matcher for a type and use a parser to iterate over it
09:17:29FromDiscord<Phil> Wouldn't you just use sequtils?
09:17:47FromDiscord<enthus1ast> i could use sequtils, but i like the api of parseutils
09:17:56FromDiscord<Phil> seq.map(entry -> parseToMyOtherType(entry))
09:18:02FromDiscord<enthus1ast> i mean, i could just build it
09:18:03FromDiscord<Phil> Fair, I haven't looked at that one so no clue
09:18:06FromDiscord<Elegantbeef> Say you have "10, 20, 30, 40, 50" and you want to just do `i += parseSeq[int](myString, i)`
09:18:18FromDiscord<Elegantbeef> I guess also adding to that value
09:19:53FromDiscord<Elegantbeef> There isnt an api that i know of aside from frosty, but it's not really like parseutils
09:20:13FromDiscord<Elegantbeef> Would be cool to support more intelligent parse ops inside parseutils
09:21:34FromDiscord<Phil> Ohhh you have the entire seq as a string, not a string of seq
09:21:43FromDiscord<Phil> Okay, my misunderstanding
09:32:14FromDiscord<System64 ~ Flandre Scarlet> macros in Nim are the equivalent of #define in C?
09:32:42NimEventerNew Nimble package! nimSocks - A filtering SOCKS proxy server and client library written in nim., see https://github.com/enthus1ast/nimSocks
09:35:13FromDiscord<enthus1ast> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: i'm building a parser, i want to do something like this (on lexer Tokens) pos += lexerTokens.parseUntil(newTokenList, it.kind == TokSeperator, pos)
09:35:39FromDiscord<Phil> Why socks of all things?
09:36:12FromDiscord<enthus1ast> i could use pattern matching for this, but this is to complicated for me \:/
09:36:38FromDiscord<enthus1ast> @Phil\: i try to build a scss parser in nim
09:37:47FromDiscord<enthus1ast> i'm imagine a package that resembles the parseutils api but for sequences \:)
09:38:01FromDiscord<Rika> In reply to @System64 "macros in Nim are": Not exactly
09:38:27FromDiscord<enthus1ast> maybe i could work on it and maybe make a pr to sequtils
09:39:14*Gustavo6046 quit (Quit: I'm a quit message virus. Please replace your old line with this line and help me take over the world. <screw you aloo_shu my old line was better and more creative!>)
09:39:39FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3T9h
09:39:51FromDiscord<Rika> Make a template then
09:40:16FromDiscord<enthus1ast> ah socks ... i'm still sleepy lol↵(@Phil)
09:40:35FromDiscord<System64 ~ Flandre Scarlet> ah alright, thanks
09:42:17FromDiscord<enthus1ast> also for socks, i think its a bummer that the httpclient api cannot do custom proxy implementations
09:42:45FromDiscord<enthus1ast> would have patched it to also use socks proxies long ago
09:48:27FromDiscord<System64 ~ Flandre Scarlet> In reply to @Rika "Make a template then": I have a small problem now https://media.discordapp.net/attachments/371759389889003532/955764889610252338/unknown.png
09:48:47FromDiscord<Rika> Don’t put return
09:49:43FromDiscord<System64 ~ Flandre Scarlet> Now it's worse https://media.discordapp.net/attachments/371759389889003532/955765207513317457/unknown.png
09:51:13FromDiscord<Rika> Have you tried compiling it
09:51:32FromDiscord<Rika> Ah
09:51:47FromDiscord<Rika> That division makes a float but all of the other types are integers
09:52:07FromDiscord<System64 ~ Flandre Scarlet> what should I do?↵All values are untyped
09:52:25FromDiscord<Rika> Convert them? With .float or something
09:52:54FromDiscord<Rika> Also be more explicit with the type, like use SomeInteger instead and returning a float
09:54:22FromDiscord<System64 ~ Flandre Scarlet> I can want interpolate floats one day
09:54:29FromDiscord<enthus1ast> there also is https://github.com/nim-lang/Nim/blob/devel/lib/pure/lenientops.nim
09:55:32FromDiscord<System64 ~ Flandre Scarlet> In reply to @enthus1ast "there also is https://github.com/nim-lang/Nim/blob/": I can create new operators?
09:55:38FromDiscord<enthus1ast> sure
09:55:56FromDiscord<System64 ~ Flandre Scarlet> oh interesting!
09:56:33FromDiscord<enthus1ast> imho when you import lenientops your code might start to work
09:56:47FromDiscord<Rika> It probably would
10:01:19*ltriant joined #nim
10:05:59*ltriant quit (Ping timeout: 256 seconds)
10:07:51*ltriant joined #nim
10:15:20*toulene quit (Quit: Ping timeout (120 seconds))
10:17:16*toulene joined #nim
10:21:46*Zectbumo quit (Remote host closed the connection)
10:29:38NimEventerNew thread by Dabod: How to debug macros used with concept?, see https://forum.nim-lang.org/t/9027
10:34:55*toulene quit (Quit: Ping timeout (120 seconds))
10:36:53*toulene joined #nim
10:37:45FromDiscord<Phil> I keep reading up on the repository pattern and when it's a bad idea and I keep running into walls about it.↵Like, I read the article, it says "avoid repositories with too many methods such as 'findBySurname(surname)', 'findByFirstName(firstName)' etc. " ↵↵but.... if I need those, the best I can do is reduce function calls by genericizing that away into a "findByField(fieldName, value)" and at that point your services need to know abou
10:41:10FromDiscord<Phil> If anyone has any good material about it I'd gladly give it a read
10:41:26FromDiscord<Rika> find(filter) where filter is an arbitrary procedure that gets passed information and returns a Boolean whether the entry is to be kept or not?
10:41:50FromDiscord<Rika> That way you can make any kind of find by procedure
10:42:12FromDiscord<Rika> Maybe you should look into functional programming for a change of pace or ideology
10:45:36FromDiscord<Phil> You mean instead of writing separate SQL for the repository-query to a relational database, query all and filter within the nim-code using the proc?
10:46:32FromDiscord<Rika> Ah
10:46:35FromDiscord<Rika> This is for databases
10:47:01FromDiscord<Rika> Give me a moment I will think
10:50:48FromDiscord<Phil> Thanks for taking the time either way!
10:51:27FromDiscord<sheldon> sent a long message, see https://paste.rs/Afa
10:51:48FromDiscord<sheldon> build_all.sh doesn't work.
10:52:07FromDiscord<Phil> Apparently a lot of the time people work against "too large repositories" by splitting the read-operations from the write operations... which, well, helps against modules of overgrown size but I'm not sure if that addresses the core problem of "too many functions"
10:52:31FromDiscord<Rika> You can do the “Filter object” approach I guess
10:52:46FromDiscord<Rika> Where you pass a filter object with optional fields and whatsoever
10:53:00FromDiscord<Rika> Basically encoding your desired filters there instead of in procedures
10:54:21FromDiscord<Phil> If I were to imagine this in code, that filter object would be something that I build the SQL query with?
10:55:20FromDiscord<Rika> I guess? Seems so yeah
10:55:28FromDiscord<Rika> It’s something you use to make the query
11:19:18FromDiscord<Bubblie> In reply to @Elegantbeef "Ah that's gfw init": Called it
11:19:20FromDiscord<Bubblie> Windows is fucking shit
11:19:28FromDiscord<Bubblie> Ill try and make a fix
11:20:04*gsalazar joined #nim
11:22:37FromDiscord<Bubblie> sent a long message, see http://ix.io/3T9Q
11:23:52FromDiscord<Rika> Easy way to fix: don’t use any sort of GUI or even TUI
11:23:53FromDiscord<enthus1ast> from rants import windows, macos
11:23:59*kayabaNerve joined #nim
11:24:03FromDiscord<Rika> Even then though it’s a pain
11:31:33FromDiscord<Phil> sent a long message, see https://paste.rs/663
11:31:40FromDiscord<Phil> Which one of these is the best solution I'll need to meditate over
11:32:04FromDiscord<Phil> (edit) "http://ix.io/3T9V" => "http://ix.io/3T9W"
11:32:35FromDiscord<Rika> I think the way I proposed is more elegant in the user facing sense but hairy to implement
11:33:07FromDiscord<Phil> I'll need to read up on that approach more to even get an idea for an implementation
11:33:29FromDiscord<Phil> Because I'm way too polluted by java to think of one that would make sense for nim
11:33:56FromDiscord<Bubblie> DONT use ANY graphics programs for mac unless its MoltenVK for vulkan
11:33:59FromDiscord<Bubblie> Holy shit
11:34:02FromDiscord<Bubblie> Opengl is deprecated for mac
11:34:08FromDiscord<Bubblie> They want you to use metal
11:34:12FromDiscord<Bubblie> Thankfully molten exists holy shit
11:34:13FromDiscord<Phil> wait what?
11:34:16FromDiscord<Bubblie> Yeah
11:34:21FromDiscord<Phil> Isn't opengl a pretty wide standard?
11:34:26FromDiscord<Phil> widely used
11:34:31FromDiscord<Rika> Well too bad Apple decided fuck that shit
11:34:36FromDiscord<Bubblie> Widely used, but apple fucks up everything
11:34:44FromDiscord<Bubblie> They want programs to use their stuff
11:34:47FromDiscord<Phil> ~~Still not as bad as nvidia~~
11:34:47FromDiscord<Bubblie> So they force it on you
11:34:51FromDiscord<Bubblie> In reply to @Isofruit "~~Still not as bad": Agreed
11:34:55FromDiscord<Bubblie> I hate nvidia
11:34:58FromDiscord<Bubblie> With a passion
11:35:03FromDiscord<Bubblie> Apple still sucks though
11:35:24FromDiscord<Phil> Fair, I never developed anything for apple so I couldn't get around to that side of disliking them
11:35:42FromDiscord<Rika> Apple deprecates things really quickly
11:35:46FromDiscord<Phil> My approach of dislike stems pretty much from the amount of money they're willing to pour into their products to make them shite to repair
11:36:03FromDiscord<Phil> That and walled garden is annoying
11:36:53FromDiscord<enthus1ast> And all the bugs, and the apple users that still tell you "it just works", and the forums where noone seems to have a clue about anything
11:37:18FromDiscord<Rika> It just works until it doesn’t
11:37:23FromDiscord<auxym> In reply to @Girvo "Will still need to": please do document this somewhere! Very interested 🙂
11:37:23FromDiscord<Phil> But enthus1ast, there is no need for those forums
11:37:25FromDiscord<Phil> It just works
11:37:37FromDiscord<enthus1ast> because all works?
11:37:41FromDiscord<Phil> Precisely
11:37:47FromDiscord<Phil> It's apple, so it just works
11:37:51FromDiscord<Phil> Or you're using it wrong
11:38:14FromDiscord<enthus1ast> it just works! And if not, just buy new stuff
11:38:28FromDiscord<Rika> If it doesn’t work then you’re wrong
11:38:38FromDiscord<Phil> If a chargeport breaks because of very foreseeable wear and tear then you just plugged and unplugged wrong
11:38:50FromDiscord<Rika> It’s not even “you’re using it wrong”, you’re just outright wrong
11:39:11FromDiscord<Phil> Ah yes, the next level of wrong
11:39:36FromDiscord<enthus1ast> "On my Mac Book Proo 2018 it just works"
11:39:51FromDiscord<enthus1ast> 'my'
11:40:26FromDiscord<enthus1ast> Oh man i cannot be triggered every time someone says apple
11:40:35FromDiscord<Phil> How about oranges?
11:40:36FromDiscord<enthus1ast> bad for heart
11:41:27FromDiscord<enthus1ast> My issue is, i have to support apple users and deal with the apple crap and bugs every das
11:41:28FromDiscord<enthus1ast> day
11:41:29FromDiscord<Rika> Pear
11:42:04FromDiscord<Phil> In reply to @enthus1ast "My issue is, i": I still remember in the python implementation of nimstoryfont I was so proud when it finally worked
11:42:15FromDiscord<Phil> Wanted to show my dad during vacation time
11:43:05FromDiscord<Phil> Turns out safari straight up does not do a certain type of redirect (I think from a non "/" ending url to one that ends in "/", something that Django did automatically for you to make your URLs more correct)
11:43:12FromDiscord<Rika> Thank god I’m not one to write desktop applications and instead I have to deal with bespoke operating systems and databases and other bullshit okay I don’t think this is something to thank god for anymore
11:43:15FromDiscord<Phil> Which they changed a couple months ago
11:43:24FromDiscord<Phil> (edit) "ago" => "ago, and suddenly my application worked again"
11:43:41FromDiscord<Rika> In reply to @Isofruit "Turns out safari straight": Well technically they are different URLs
11:44:16FromDiscord<System64 ~ Flandre Scarlet> when using the --opt:speed flag, does it use the -o3 argument in GCC?
11:44:20FromDiscord<Phil> In reply to @Rika "Well technically they are": They are, it's just very hard to account for that kind of stuff if you don't know about it and neither firefox, nor chrome have that sort of behaviour
11:44:36FromDiscord<Rika> In reply to @System64 "when using the --opt:speed": I think only 2
11:44:52FromDiscord<Rika> 3 is funky and I recommend never using it lol
11:44:52FromDiscord<System64 ~ Flandre Scarlet> In reply to @Rika "I think only 2": Ah alright, and how to setup to -o3?µ
11:44:57FromDiscord<System64 ~ Flandre Scarlet> ah alright
11:45:02FromDiscord<System64 ~ Flandre Scarlet> why is it funky?
11:45:15FromDiscord<Rika> Some stuff become nonstandard
11:45:24FromDiscord<System64 ~ Flandre Scarlet> ah so dangerous I guess?
11:46:55FromDiscord<Rika> I searched it up and it seems they moved the nonstandard stuff to -Ofast
11:47:27FromDiscord<System64 ~ Flandre Scarlet> ah alright so now -o3 is safe?
11:48:32FromDiscord<Rika> Probably? But the effect is likely minuscule in runtime speed and large in compile time speed
11:49:02FromDiscord<System64 ~ Flandre Scarlet> Ah alright
11:53:04*neurocyte0917090 joined #nim
11:53:30FromDiscord<Zoom> @Hamid_Bluri\: You promptly giving up on iterrr made me finally poking around ZF's code \:P. Fixed their enumerate, but judging they closed my issue about it earlier, there won't be a merge.
11:55:58FromDiscord<Rika> Why did he give up
11:58:39FromDiscord<Zoom> @Rika)
11:59:15FromDiscord<Zoom> https://github.com/hamidb80/iterrr/issues/18
12:01:18*toulene quit (Read error: Connection reset by peer)
12:02:40*toulene joined #nim
12:19:51NimEventerNew thread by Mros: Multiple definition of NimMainInner, see https://forum.nim-lang.org/t/9029
12:45:23FromDiscord<Bubblie> Apple doesnt even have fuckijg vulkan
12:45:39FromDiscord<Bubblie> You have to use molten
12:45:44FromDiscord<Bubblie> In order to use vulkan on mac
12:45:50FromDiscord<Bubblie> So im glad molten exists
12:45:52FromDiscord<Bubblie> But DAMN
12:46:15FromDiscord<Bubblie> If there is one thing I like about microsoft its the fact they dont deprecate and limit programming
12:46:20FromDiscord<Bubblie> Its just, windows is shit
12:57:59*acidsys quit (Excess Flood)
12:58:32*acidsys joined #nim
12:59:33*rockcavera joined #nim
12:59:33*rockcavera quit (Changing host)
12:59:33*rockcavera joined #nim
12:59:35FromDiscord<enthus1ast> at least smb works on windows
12:59:44FromDiscord<enthus1ast> and office
13:00:43FromDiscord<enthus1ast> and email
13:00:59FromDiscord<enthus1ast> argh i'm triggered again, sorry will stop offtopic stuff now
13:10:15FromDiscord<Phil> One of these days I'll get smb share stuff to actually work well on arch-gnome-nautilus instead of having to mount manually
13:12:37*toulene quit (Ping timeout: 240 seconds)
13:15:02*toulene joined #nim
13:18:05FromDiscord<Bubblie> I have an idea
13:18:23FromDiscord<Bubblie> So, im gonna fix the nimgl vulkan bindings, but im gonna edit things so its not as weird
13:18:47FromDiscord<Bubblie> Cause, the way it does things is not normal in general, it messes with the way you use glfw
13:22:13FromDiscord<Bubblie> And for vulkan init, thats not normal with vulkan either, the way vulkan is meant to be initialized is through your own creation of the pipeline, the problem with having it initialized for you is because now you cant properly add things for your pipeline
13:22:26FromDiscord<Bubblie> Its the reason why the vulkan triangle tutorial has you set up everything yourself
13:25:49FromDiscord<Bubblie> These bindings could be done better
13:26:14FromDiscord<Bubblie> Also, the neat thing about vulkan bindings is that all the headers are generated from an xml file, which helps with bindings surprisingly
13:26:18FromDiscord<Bubblie> Even though its xml
13:26:21FromDiscord<Bubblie> 💀
13:31:03FromDiscord<Zoom> Use systemd to mount smb on boot /offtopic↵(@Phil)
13:48:34*slowButPresent joined #nim
13:58:12*acidsys quit (Excess Flood)
13:58:44*acidsys joined #nim
14:22:35FromDiscord<Forest> Why is Nim's JS backend still around? Wouldn't WASM be better since WASM can be ran in many runtimes and is still just as portable?
14:22:42FromDiscord<Forest> Also I'd imagine it'd be faster too
14:23:18FromDiscord<Forest> Sure you could use Emscripten but wouldn't it just generally make more sense to compile to WASM directly?
14:24:51FromDiscord<demotomohiro> Why make more sense to compile to WASM directly?↵Nim has C generator and I think reuse it for WASM make sense.
14:24:52*arkurious joined #nim
14:25:19FromDiscord<demotomohiro> And you can easily use C/C++ libraries also for WASM.
14:25:31FromDiscord<Rika> does wasm have dom manipulation now
14:25:35FromDiscord<Rika> it didnt before
14:25:43FromDiscord<Rika> nims js gen has been around for a long time
14:33:45FromDiscord<demotomohiro> Maybe when Nim compile to WASM directly, Nim have to optimize code itself. When Nim compile to C and emscripten compile C to WASM, Clang or emcc optimize code and Nim doesn't need to optimize code so much.
14:36:02*acidsys quit (Excess Flood)
14:36:34*acidsys joined #nim
14:56:57FromDiscord<fbpyr> last times I used wasm it always needed at least a loader (e.g. go wasm) ↵or some generated js glue code (e.g. rust via yew) . ↵can nowadays everything be done now from wasm as from js? 🤔
15:07:19*ma7mad joined #nim
15:17:08FromDiscord<Phil> I would doubt it
15:25:57*ma7mad quit (Quit: Client closed)
15:34:42*neurocyte0917090 quit (Quit: The Lounge - https://thelounge.chat)
15:35:24*rockcavera quit (Remote host closed the connection)
15:38:26*neurocyte0917090 joined #nim
15:40:04FromDiscord<Forest> Ah okay, fair enough
15:41:12*rockcavera joined #nim
15:41:12*rockcavera quit (Changing host)
15:41:12*rockcavera joined #nim
15:43:29*neurocyte0917090 quit (Quit: The Lounge - https://thelounge.chat)
15:46:31*neurocyte0917090 joined #nim
15:48:22*noeontheend joined #nim
15:56:57*vicecea quit (Remote host closed the connection)
15:57:28*vicecea joined #nim
16:13:38FromDiscord<enthus1ast> why do wasm when you want to live in js land?
16:14:42*neurocyte0917090 quit (Quit: The Lounge - https://thelounge.chat)
16:16:38*neurocyte0917090 joined #nim
16:30:02FromDiscord<Hamid_Bluri> In reply to @Zoom "<@745944009918251010>\: You promptly giving": honestly, today i thought about some crazy tricks to make it work, but it doesn't seem much readable
16:31:14FromDiscord<Hamid_Bluri> i mean, currently you can easily define your custom reducer, but defining a transformer (AKA adapter) is not as easy as defining a reducer
16:32:29FromDiscord<Hamid_Bluri> the solution in my mind contains `wrapLoop`, `transformer` pragamas, which is not very nice
16:34:09FromDiscord<Hamid_Bluri> maybe I tried it on weekend, but i don't think it worth it. because there are so many edge cases
16:34:17FromDiscord<Hamid_Bluri> (edit) "I tried" => "I'll try"
16:34:36FromDiscord<Hamid_Bluri> (edit) "it" => "it's gonna"
16:36:19FromDiscord<hmmm> hmmm
16:36:39FromDiscord<Hamid_Bluri> in the meantime, you can give me more examples that can encourage me to do so
16:36:40FromDiscord<hmmm> broskis remind me why thingy-1 is different from thingy -1 which is different from thingy - 1
16:36:58FromDiscord<Hamid_Bluri> In reply to @hmmm "broskis remind me why": what
16:37:07FromDiscord<Rika> thingy-1 is the same as thingy - 1
16:37:13FromDiscord<Rika> thingy -1 is the same as thingy(-1)
16:37:16FromDiscord<Hamid_Bluri> oh infix prefix 😄
16:37:27FromDiscord<hmmm> rika now I'm even more confus
16:37:38FromDiscord<Rika> do you remember how procedures are called
16:37:46FromDiscord<Rika> the multiple ways
16:37:50FromDiscord<hmmm> basically I need to type thingy - 1 with two spaces or things don't work 🤔
16:37:57FromDiscord<Rika> either two or none
16:38:05FromDiscord<Rika> as long as the spacing is consistent on each side
16:38:59FromDiscord<Rika> because let's say you use `echo` as thingy
16:39:04FromDiscord<enthus1ast> its actually quite simple↵thingy - 1 and thingy-1 is\: `-`(thingy, 1) while thingy -1 is\: thingy(-1)
16:39:06FromDiscord<hmmm> you are right, zero spaces works the same
16:39:12FromDiscord<Hamid_Bluri> sent a long message, see http://ix.io/3TbD
16:39:29FromDiscord<Rika> `1- 1` should probably ideally be invalid but afaik rn it is but a warning
16:40:25FromDiscord<hmmm> and the reason is because we call functions without parenthesis and nim gets confused?
16:40:40FromDiscord<Hamid_Bluri> !eval 1- 1
16:40:41FromDiscord<Rika> not that nim gets confused
16:40:41NimBotCompile failed: /usercode/in.nim(1, 2) Error: expression '0' is of type 'int literal(0)' and has to be used (or discarded)
16:40:54FromDiscord<Hamid_Bluri> !eval echo 1- 1
16:40:56NimBot0
16:41:04FromDiscord<Rika> well i guess you can say it does get confused
16:41:10FromDiscord<Rika> but its ambiguous anyway
16:43:23FromDiscord<hmmm> also can I do something like $(thingy - 1) without nim thinking it's weird stuff?
16:43:40FromDiscord<Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3TbF
16:44:06FromDiscord<enthus1ast> $(thingy - 1) is perfectly valid
16:44:07FromDiscord<Rika> In reply to @hmmm "also can I do": wdym?
16:44:10FromDiscord<Rika> it looks fine
16:44:30FromDiscord<enthus1ast> thingy decremented then made to string
16:45:00FromDiscord<Rika> In reply to @hamidb80 "I don't know how": maybe try exporting $? idk, possibly some sort of bug
16:45:00FromDiscord<hmmm> perfect, I always think I'm tupling things or calling functions when using parenthesis
16:45:07FromDiscord<Rika> or not bug but
16:45:19FromDiscord<Rika> "unexpected but specified behaviour"
16:45:36FromDiscord<Hamid_Bluri> is there any articles expalning distinct types ? 😕
16:46:06FromDiscord<Rika> what's difficult?
16:46:28FromDiscord<Rika> In reply to @hmmm "perfect, I always think": tuple -> space before function call
16:46:42FromDiscord<Rika> ...usually
17:03:37FromDiscord<Solitude> In reply to @hmmm "perfect, I always think": do you only think about code without ever actually running it?
17:07:00*neurocyte0917090 quit (Quit: The Lounge - https://thelounge.chat)
17:07:50FromDiscord<auxym> In reply to @hamidb80 "is there any articles": there's the manual https://nim-lang.org/docs/manual.html#types-distinct-type
17:08:04*neurocyte0917090 joined #nim
17:10:30FromDiscord<hmmm> In reply to @Solitude "do you only think": bold of you assuming I'm thinking when I code 😃
17:11:39FromDiscord<hmmm> tbh things are getting better, I'm less stumped then before 🤔
17:13:36*noeontheend quit (Ping timeout: 268 seconds)
17:17:32FromDiscord<kevin> is it possible to have variables inside of a formatstring for length, padding character, etc?
17:18:25FromDiscord<kevin> `&"{str:<10}"`↵To↵`&"{str:<{len}}"`
17:18:32FromDiscord<kevin> or something like that
17:19:56FromDiscord<Solitude> !eval import strformat; let str = "test"; let len = 1; echo &"{str:<{len}}"
17:19:58NimBotCompile failed: /playground/nim/lib/system/fatal.nim(53, 5) Error: unhandled exception: /playground/nim/lib/pure/strformat.nim(660, 18) `false` invalid format string: '}' instead of '}}' [AssertionDefect]
17:31:23*crem quit (Quit: WeeChat 3.3)
17:33:11*rockcavera quit (Remote host closed the connection)
17:46:30FromDiscord<Bubblie> If I compile nim to cpp, and I use nim templates, does it compile to cpp’s templates?
17:47:11FromDiscord<Rika> no
17:47:22FromDiscord<Bubblie> What does it compile to
17:47:36FromDiscord<Rika> nothing, they are gone after compiletime
17:49:33FromDiscord<Bubblie> ? Okay but nim can compile to cpp so how does that template code look in the cpp code you just compiled nim to
17:50:04FromDiscord<Solitude> nim templates have nothing to do with cpp templates
17:50:05FromDiscord<Rika> it looks like as if the nim templates were substituted with their bodies
17:50:06FromDiscord<Solitude> its like asking how nim macros look when compiling to c
17:50:17FromDiscord<Bubblie> Oh okay got it
17:56:30FromDiscord<demotomohiro> @kevin Text after ':' in '{}' in strformat is parsed by this proc and you cannot put variables. https://github.com/nim-lang/Nim/blob/c4a0d4c5e35f09430a1c3d465fc62eb1001b7f9f/lib/pure/strformat.nim#L419
17:57:45FromDiscord<kevin> makes sense. I restored to writing my own padding function that does take variable length padding
17:57:58FromDiscord<demotomohiro> generics in Nim is similar to template in C++. template in nim is similar to macro in C.
17:58:01FromDiscord<Rika> you can create custom formatters for strformat, i just forgot how
17:58:34FromDiscord<Bubblie> Alright, yeah I know nim templates are very different but I was confused to whether it was somehow able to compile to cpp templates
18:00:10FromDiscord<hmmm> friendsies how do I extract the last element of a slice range
18:00:28FromDiscord<hmmm> .high and [^-1] don't seem to work
18:01:31FromDiscord<demotomohiro> !eval echo [1, 2, 3, 4][1..2][^1]
18:01:34NimBot3
18:01:58FromDiscord<Rika> !eval echo (1..2).high
18:02:00NimBotCompile failed: /usercode/in.nim(1, 12) Error: type mismatch: got <HSlice[system.int, system.int]>
18:02:04FromDiscord<Rika> did you mean this?
18:02:08FromDiscord<hmmm> ye
18:02:10FromDiscord<Rika> !eval echo (1..2).B
18:02:12NimBotCompile failed: /usercode/in.nim(1, 12) Error: undeclared field: 'B' for type system.HSlice [type declared in /playground/nim/lib/system.nim(497, 3)]
18:02:14FromDiscord<Rika> or was it b
18:02:20FromDiscord<Rika> !eval echo (1..2).b
18:02:23NimBot2
18:02:34FromDiscord<hmmm> 🤨
18:02:36FromDiscord<hmmm> what is b
18:02:41FromDiscord<Rika> a is 1
18:02:42FromDiscord<Rika> b is 2
18:02:49FromDiscord<Rika> lmfao
18:02:54FromDiscord<Rika> you must be confused as hell
18:03:01FromDiscord<Rika> go to the type def of HSlice in system
18:03:30FromDiscord<hmmm> .b actually works 👀
18:03:34FromDiscord<hmmm> wtf
18:04:10FromDiscord<demotomohiro> https://nim-lang.org/docs/system.html#HSlice
18:05:58FromDiscord<Phil> I will be honest, b would have been the last thing I would have assumed would be the name for one of the boundaries
18:06:08FromDiscord<demotomohiro> !eval echo (let r = 1..3; r).typeof
18:06:10NimBotHSlice[system.int, system.int]
18:06:49FromDiscord<Phil> That feels like a pretty weird name
18:06:56FromDiscord<Rika> Homogeneous Slice
18:07:10FromDiscord<Rika> because the start and end may have differing types
18:07:10FromDiscord<hmmm> ha! Phil confirms I'm not getting completely insane 🥳
18:07:30FromDiscord<Rika> are you sure it isnt just that both of you are insane
18:07:43FromDiscord<Phil> No no, I only use nisane
18:07:48FromDiscord<Phil> Barry different
18:07:51FromDiscord<Phil> Very
18:07:57FromDiscord<Phil> Damnit autocorrect
18:08:11FromDiscord<Rika> Barry
18:08:34FromDiscord<Phil> If anyone is insane, then it's Barry
18:08:53FromDiscord<hmmm> Barry is known crackpot imo
18:12:05FromDiscord<Phil> Anyway, even if types in the slice can vary, why not just "upper" and "lower" since apparently that's accurate enough to describe these bounds with comments
18:12:07FromDiscord<demotomohiro> https://nim-lang.org/docs/system.html#HSlice↵That document says "Heterogeneous" slice type
18:12:20*Zectbumo joined #nim
18:12:49*neurocyte0917090 quit (Read error: Connection reset by peer)
18:13:03FromDiscord<hmmm> the only legit slice type is pizza
18:13:30FromDiscord<Rika> oh hetero homo still confuses me
18:13:31FromDiscord<Rika> whatever
18:13:36FromDiscord<Phil> Eh, I'm pretty sure I'm just not understanding one thing about it and that's leading me down dumb roads
18:13:36FromDiscord<Vindaar> In reply to @hmmm "the only legit slice": you do you, I'm enjoying my slice of banana bread alone then 😋
18:13:43*neurocyte0917090 joined #nim
18:13:48FromDiscord<Rika> In reply to @Vindaar "you do you, I'm": wtf i want
18:14:48FromDiscord<Vindaar> hop onto a plane. If you're quick it's still good by the time you arrive!
18:15:23FromDiscord<Phil> EU?
18:15:36*vicfred joined #nim
18:15:46FromDiscord<Vindaar> Yeah, Germany
18:16:22FromDiscord<Phil> Mwahahaha your banana bread is at most 6h away from me if you're not super far south
18:17:04FromDiscord<Vindaar> near Cologne, so hurry 😛
18:17:40FromDiscord<Phil> With the speed of light!
18:17:45FromDiscord<Phil> I mean ICE
18:17:47FromDiscord<Rika> Damn man I live in Asia…
18:17:57FromDiscord<Phil> Almost same thing!
18:18:38FromDiscord<Phil> Plane or really long train ride for you it is
18:18:51FromDiscord<Rika> im not on mainland
18:18:53FromDiscord<Rika> plane
18:19:23FromDiscord<Vindaar> also better avoid that train through Russia atm
18:20:34FromDiscord<untoreh> How can I convert an `untyped` variable into a string?
18:20:45FromDiscord<Vindaar> `astToStr` is probably what you want
18:26:05FromDiscord<untoreh> I want to write something like `withX: code...` and wrap all the code into a string
18:27:26FromDiscord<Vindaar> either I misunderstand, or this is precisely what `astToStr` does: https://play.nim-lang.org/#ix=3Tc2
18:27:46FromDiscord<Vindaar> misunderstand what you want I mean
18:31:13FromDiscord<untoreh> sent a code paste, see https://play.nim-lang.org/#ix=3Tc6
18:36:06*crem joined #nim
18:37:43FromDiscord<hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3Tc9
18:37:55FromDiscord<hmmm> and then autocloses at the end
18:38:01FromDiscord<hmmm> I want that in nim too
18:39:01*Zectbumo quit (Ping timeout: 240 seconds)
18:40:21FromDiscord<demotomohiro> @untoreh Maybe `toStrLit` in macros module is what you need: https://nim-lang.org/docs/macros.html#toStrLit%2CNimNode
18:41:05FromDiscord<Rika> doesnt nim arc/orc use RAII?
18:41:22FromDiscord<Rika> so wouldnt blocks then opening then just exiting the block close the file?
18:41:28FromDiscord<Rika> (edit) "blocks" => "entering a block"
18:41:52FromDiscord<demotomohiro> @hmmm with in Nim is different from python: https://nim-lang.org/docs/with.html
18:42:49FromDiscord<Vindaar> @hmmm write your own, it's cheap in nim https://play.nim-lang.org/#ix=3Tcc
18:42:56FromDiscord<Vindaar> (feel free to adjust to your needs 😉 )
18:43:40FromDiscord<b4mbus> In reply to @Rika "so wouldnt entering a": I was pretty positive one of nim's mm tactis was some raii shit
18:43:44FromDiscord<b4mbus> but idk I cant find it
18:44:06FromDiscord<Rika> i just said that
18:44:25FromDiscord<b4mbus> no, you asked a question
18:44:37FromDiscord<Rika> In reply to @Rika "doesnt nim arc/orc use": .
18:44:44FromDiscord<b4mbus> and that's a questionm
18:44:45FromDiscord<b4mbus> (edit) "questionm" => "question"
18:44:54FromDiscord<Rika> questions can be rhetorical
18:45:06FromDiscord<b4mbus> ^ this guy https://media.discordapp.net/attachments/371759389889003532/955899940993912873/unknown.png
18:45:14FromDiscord<b4mbus> (edit) "^" => "\\/"
18:45:17FromDiscord<Rika> i dont know what you want,
18:45:38FromDiscord<hmmm> hmm I'm still taking template and macro lessons from elegantbeef, iirc we left it at printing dumped ast nodes, so I don't think I'm quite up to it rn Vind
18:46:20FromDiscord<Solitude> In reply to @hmmm "hmm I'm still taking": just write someshit, its that easy
18:46:47FromDiscord<hmmm> yeye it's like learning to ride bycicle
18:47:54FromDiscord<Vindaar> In reply to @hmmm "hmm I'm still taking": just ask about what you don't understand in that template. The `{.inject.}` makes the variable available for the user using the template in the body of it. The rest is pretty straight forward. `body` is just the block given to the template, that is inserted verbatim into that spot in the template
18:48:45FromDiscord<Vindaar> the template essentially just generates this code:
18:48:55FromDiscord<Vindaar> sent a code paste, see https://play.nim-lang.org/#ix=3Tcd
18:49:29FromDiscord<hmmm> hmmmmmm
18:49:39FromDiscord<hmmm> the first question would be why do we untype fvar
18:49:50FromDiscord<hmmm> why we return untyped
18:49:54FromDiscord<Vindaar> @Rika I could be wrong, but I don't think there's `=destroy` hooks for things like `File` objects under ARC by default that close the file again
18:50:12FromDiscord<Vindaar> but you can easily implement some RAII behavior with arc
18:50:15FromDiscord<Rika> probably trivial to implement
18:50:24FromDiscord<Vindaar> In reply to @hmmm "why we return untyped": that's just saying "we return code"
18:50:38FromDiscord<Rika> and it would be better IMO than the template
18:51:47*xet7 quit (Remote host closed the connection)
18:53:03*xet7 joined #nim
18:53:07FromDiscord<exelotl> In reply to @Vindaar "<@!259277943275126785> I could be": I hope this comes for Nim 2.0
18:53:24FromDiscord<Rika> i mean you could just implement it yourself right now no?
18:53:33FromDiscord<demotomohiro> If your template/macro always turn an expression that is int type, you can specify int as return type
18:53:34FromDiscord<hmmm> sent a code paste, see https://paste.rs/B6m
18:53:48FromDiscord<Rika> In reply to @hmmm "vind and why the": to pass the indented block of code as a parameter to the template
18:54:05FromDiscord<demotomohiro> return
18:54:29FromDiscord<Rika> you spelled return properly
18:54:33FromDiscord<Rika> yes
18:54:34FromDiscord<hmmm> woa pretty neat
18:54:35FromDiscord<hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3Tcf
18:54:49FromDiscord<Vindaar> yeah, would have been clearer had I written multiple lines, but I was lazy
18:55:47FromDiscord<Solitude> In reply to @Rika "i mean you could": hooks have to be defined in the same module as their type
18:56:03FromDiscord<Rika> oh yeah i was wondering about that, i forgot about it
18:56:04FromDiscord<Rika> okay
19:00:31FromDiscord<Shinyzenith> should I just stick var infront of my parameter? https://media.discordapp.net/attachments/371759389889003532/955903813099880478/unknown.png
19:02:04FromDiscord<auxym> you should put var in front of the declaration of whatever identifier your are passing in
19:02:28FromDiscord<auxym> if you do actually intend to mutate it
19:02:44FromDiscord<Shinyzenith> well I do not, it's just so nim doesn't copy it under the hood
19:02:49FromDiscord<Shinyzenith> which was an issue earlier
19:03:57FromDiscord<Shinyzenith> In reply to @auxym "you should put var": yep thanks, worked
19:04:02FromDiscord<Shinyzenith> I don't know why I didn't think of it
19:04:08FromDiscord<Shinyzenith> 1 am coding does this to me 🥴
19:04:25FromDiscord<auxym> nim normally does not make a copy unless the object is larger than some size threshold, IIRC 24 bytes
19:04:58FromDiscord<Shinyzenith> In reply to @auxym "nim normally does not": https://canary.discord.com/channels/371759389889003530/371759389889003532/954882215945330719↵https://canary.discord.com/channels/371759389889003530/371759389889003532/954882376125775903
19:05:02FromDiscord<auxym> for smaller objects, the reasoning is that making a copy is actually faster than the cost of a dereference
19:05:19FromDiscord<Shinyzenith> In reply to @auxym "for smaller objects, the": Yeah makes sense
19:05:33FromDiscord<auxym> In reply to @Shinyzenith "https://canary.discord.com/channels/371759389889003": yes, as beef said, "small enough"
19:05:52FromDiscord<Shinyzenith> alskdjad for fucks sake, I had this issue before↵ended up just moving the function call to another file which fixed it but I still don't get why this throws https://media.discordapp.net/attachments/371759389889003532/955905166685659146/unknown.png
19:06:29FromDiscord<auxym> segfaults yay. good luck.
19:06:37FromDiscord<Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/955905354611425280/unknown.png
19:06:38FromDiscord<Shinyzenith> 🥲
19:06:43FromDiscord<Shinyzenith> strace moment I guess
19:07:43FromDiscord<Solitude> In reply to @auxym "nim normally does not": looks like he uses some wrapped shit, so it gets declared wtih `{.bycopy.}` which overrides this
19:07:59FromDiscord<Shinyzenith> Yeah I'm using futhark
19:08:22FromDiscord<auxym> In reply to @Solitude "looks like he uses": ah. does that also override a hypothetical `lent` or `sink` annotation?
19:08:33FromDiscord<Shinyzenith> and I don't think bycopy pragma is used anywhere
19:09:02FromDiscord<Shinyzenith> I'm not sure but it might be cdecl pragma leading to that behavior
19:09:20FromDiscord<auxym> c2nim annotates every struct def with bycopy for c compatibility, would not surprise me if futhark did the same
19:09:30FromDiscord<Shinyzenith> futhark does not
19:09:36FromDiscord<Solitude> In reply to @auxym "ah. does that also": i CBA to test that, i would guess that no one bothered to test this interaction
19:09:42FromDiscord<Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/955906133955055636/unknown.png
19:09:44FromDiscord<Shinyzenith> here's the proof
19:09:50FromDiscord<Shinyzenith> no bycopy pragma used in the entire source tree
19:09:54FromDiscord<Shinyzenith> (edit) "no bycopy pragma used in the entire ... source" added "compiled"
19:10:17FromDiscord<auxym> `rg -ui`, in case your `.cache` is gitignored 🙂
19:10:24FromDiscord<Shinyzenith> it's not
19:10:33FromDiscord<Solitude> he is inside the directory
19:10:33FromDiscord<Shinyzenith> why would I gitignore ~/.cache lol
19:11:11FromDiscord<Shinyzenith> nonetheless https://media.discordapp.net/attachments/371759389889003532/955906506333769770/unknown.png
19:11:16FromDiscord<auxym> In reply to @Solitude "he is inside the": oh yeah you're right.
19:11:46FromDiscord<auxym> though if he wasn't, rg ignores not just gitignore, but hidden folders too
19:12:03FromDiscord<Shinyzenith> that is true if I remember correctly
19:12:31FromDiscord<auxym> anyways, sink/lent could be another way to avoid a copy in case you want to enforce immutability
19:13:00FromDiscord<Shinyzenith> In reply to @auxym "though if he wasn't,": Ok nvm https://media.discordapp.net/attachments/371759389889003532/955906963852627998/unknown.png
19:13:13FromDiscord<Shinyzenith> In reply to @auxym "anyways, sink/lent could be": well var works for now, I don't really mind it
19:14:13FromDiscord<Solitude> its unfortunate that you cant decide that with function declaration
19:14:20FromDiscord<Shinyzenith> I still don't get why it segfaults tho!!1111 😔
19:14:49FromDiscord<Shinyzenith> the same call in the main file works, but as soon as I try it from within the lib file it segfaults 🥲 https://media.discordapp.net/attachments/371759389889003532/955907421606404136/unknown.png
19:14:52FromDiscord<Generic> you can also just explicitly pass a pointer
19:15:09FromDiscord<Shinyzenith> In reply to @Generic "you can also just": I did that and it worked but beef specifically told me to use var
19:15:17FromDiscord<Shinyzenith> i'm not entirely sure of the reason, again I'm not that good at nim
19:15:19FromDiscord<Shinyzenith> still quite new
19:23:33FromDiscord<auxym> what does wl_signal_add do? do you ever use addr to get a raw pointer in there? If so you might be keeping a pointer to something like get gc'd
19:24:23FromDiscord<auxym> (edit) "like get" => "that gets"
19:25:01FromDiscord<auxym> or a pointer to a stack-allocated var that gets popped
19:35:18FromDiscord<greenb1ade> In reply to @Shinyzenith "the same call in": Random but what theme is that?
20:08:37FromDiscord<Bubblie> hey beef, I got this
20:08:45FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3TcB
20:08:46FromDiscord<Bubblie> trying to run exactly the same code
20:09:22FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3TcC
20:09:36FromDiscord<Bubblie> (edit) "https://play.nim-lang.org/#ix=3TcC" => "https://play.nim-lang.org/#ix=3TcD"
20:09:46FromDiscord<Bubblie> (edit) "https://play.nim-lang.org/#ix=3TcD" => "https://play.nim-lang.org/#ix=3TcE"
20:09:46FromDiscord<Bubblie> I pasted it without the import on accident
20:10:03FromDiscord<Bubblie> I was wondering if you knew anything about this, before I start trying to dive in for a windows fix
20:36:32*k0mpjut0r quit (Ping timeout: 240 seconds)
20:43:31NimEventerNew thread by ArchNemesis3301: Runexe: Syntactic sugar for running/piping shell commands., see https://forum.nim-lang.org/t/9030
20:44:58*lumo_e joined #nim
20:45:46*xet7 quit (Ping timeout: 245 seconds)
21:02:47*xet7 joined #nim
21:08:28*xet7 quit (Remote host closed the connection)
21:23:45*xet7 joined #nim
21:24:47FromDiscord<wsantos> I'm trying to do a DatabaseWrapper so my app can work with postgres or sqlite and I'm using generics for that, but I'm receiving this warning `generic methods are deprecated [Deprecated]`. My question is why and what are my options ?
21:32:07FromDiscord<hmmm> hmm I'm trying to & two strings but I'm getting Error: type mismatch: got <void, string>
21:33:44FromDiscord<wsantos> In reply to @hmmm "hmm I'm trying to": Can you share a example on nim playground ?
21:33:46FromDiscord<ynfle> @hmmm What's the code?
21:34:04FromDiscord<ynfle> In reply to @wsantos "I'm trying to do": What are you using the generics for with methods?
21:34:52FromDiscord<hmmm> sent a code paste, see https://paste.rs/iGZ
21:34:58FromDiscord<wsantos> sent a code paste, see https://paste.rs/VIi
21:35:03FromDiscord<hmmm> the first is a proc that returns a string and the second is a string
21:35:08FromDiscord<hmmm> wtf
21:35:15FromDiscord<ynfle> In reply to @wsantos "this is my base": You don't need methods in that case
21:35:36FromDiscord<ynfle> In reply to @hmmm "hmm it's a bit": Are you sure it returns a string
21:35:53FromDiscord<wsantos> But this is just the base class, I'll have other for each type of DB, but I think you are right, I don't think I need method maybe
21:35:58FromDiscord<hmmm> lol I checked 3 times, I'll recheck, what is void btw
21:37:00FromDiscord<ynfle> In reply to @hmmm "lol I checked 3": Try `echo typeof generatePathUtils(i)`
21:37:38FromDiscord<ynfle> In reply to @wsantos "But this is just": Make 2 separate procs. One for `DatabaseWrapper[postgress connection]` and one for the other
21:38:01FromDiscord<ynfle> Make 2 classes that inherit from the `DatabaseWrapper` and drop the generic
21:39:04FromDiscord<hmmm> aaaaaaaaaaaa
21:39:33FromDiscord<hmmm> the forward declaration of that proc didn't match the proc lol 😅
21:39:43FromDiscord<hmmm> ty ynfle ❤️
21:40:02FromDiscord<wsantos> @ynfle I don't think I get it, but how should I be able to choose between without changing code ? Right now I store the typedef in the config to decide what to use.
21:42:55*wyrd quit (Ping timeout: 240 seconds)
21:43:31*xet7 quit (Remote host closed the connection)
21:45:55FromDiscord<ynfle> In reply to @hmmm "ty ynfle ❤️": 👍
21:46:03*xet7 joined #nim
21:46:14*xet7 quit (Remote host closed the connection)
21:46:36FromDiscord<ynfle> In reply to @wsantos "<@!767093711112241162> I don't think": What do you mean by "choose between them"?
21:46:48*xet7 joined #nim
21:48:02FromDiscord<wsantos> With generics I can use the typespec from db_sqilite or db_postgres as generic and everything fits, I don't see what you described working on my mind (I still new to nim, pardon me)
21:48:32*vicecea quit (Remote host closed the connection)
21:49:02*vicecea joined #nim
21:49:53*wyrd joined #nim
21:56:26FromDiscord<luteva> Hi! I am thinking about how c++ bindings could be written in nim and especially how/where/when destructors should be called. I mean: would it be a good idea to "bind" a nim object to a c++ object and automatically call the destructor when the nim object is collected by the gc (the reference counter sees no reference anymore)? Is that possible and if yes is it a good/practical idea? Are there any tutriols on how to do that or are there at l
22:00:27*rockcavera joined #nim
22:00:27*rockcavera quit (Changing host)
22:00:27*rockcavera joined #nim
22:03:07FromDiscord<Elegantbeef> I think you've described exactly how you're supposed to do it, though i could be wrong i've not done C++ interop↵(@luteva)
22:05:07FromDiscord<luteva> are there any tutorials? or at least some examples?
22:06:16*vicfred quit (Quit: Leaving)
22:06:28FromDiscord<Elegantbeef> https://scripter.co/binding-nim-to-c-plus-plus-std-list/ is a tutorial for C++ interop, but dont know about destructors
22:06:36FromDiscord<wsantos> In reply to @ynfle "Make 2 classes that": Do you mind to show me a small example of what you mean ?
22:08:27FromDiscord<ynfle> @wsantos A couple options↵https://play.nim-lang.org/#ix=3Td8
22:08:30FromDiscord<ynfle> Here's one
22:09:59FromDiscord<Elegantbeef> Why are you making it so complicated ynfle?
22:10:01FromDiscord<wsantos> Sure but with this one I'll need to update my code for every single new DB type
22:10:14FromDiscord<Elegantbeef> `proc open(dbConn: type T...`
22:10:24FromDiscord<Elegantbeef> What are we trying to do wsantos?
22:11:08FromDiscord<Elegantbeef> Easy overridable dispatch without OOP?
22:11:18FromDiscord<ynfle> In reply to @Elegantbeef "Why are you making": Overcomplicated is what my wife calls me 🤷‍♂️
22:11:21FromDiscord<ynfle> Just kidding
22:11:39FromDiscord<ynfle> Why is it overly complicated
22:11:58FromDiscord<Elegantbeef> I mean you're making a generic procedure instead of using an implicit generic
22:12:00FromDiscord<Elegantbeef> It's a bit tedious
22:12:10FromDiscord<ynfle> In reply to @wsantos "Sure but with this": You just have separate proc defs for each one
22:13:06FromDiscord<Elegantbeef> Yea it's the same thiing
22:13:06FromDiscord<Elegantbeef> Yea it's the same thing
22:13:32FromDiscord<ynfle> https://play.nim-lang.org/#ix=3Tdb
22:14:06FromDiscord<Elegantbeef> There we go ynfle
22:14:18FromDiscord<ynfle> Thanks big bro
22:14:26FromDiscord<Elegantbeef> You're older than i
22:14:29FromDiscord<wsantos> @ElegantBeef I want to abstract the DB implementation so it's easy to add others without changing my code
22:14:36FromDiscord<Elegantbeef> Well then do the above
22:15:03FromDiscord<Elegantbeef> Want to add a new DB add a new proc and change a type
22:15:06FromDiscord<ynfle> You can also use concepts, but I don't think it's necessary
22:15:11FromDiscord<wsantos> If someone wants to add a new DB they just implement/inherit my DBWrapper
22:15:26FromDiscord<Elegantbeef> You're describing concepts though
22:16:13FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Tdd
22:16:21FromDiscord<Elegantbeef> There we go now we dont have to use inheritance or methods
22:16:31FromDiscord<ynfle> I'm pretty sure the current db_ implementation is already that though? Why reinvent the wheel?
22:17:07FromDiscord<Elegantbeef> I mean you should use concepts to ensure extensibillity
22:18:12FromDiscord<Elegantbeef> It allows you to atleast make abstractions across all dbs
22:21:24FromDiscord<Elegantbeef> @wsantos\: what's the current interaction look like?
22:21:42FromDiscord<ynfle> I know, but just define the concept and all dbs should work because they are designed around the same interface
22:23:48FromDiscord<wsantos> In reply to @Elegantbeef "<@121971538898452482>\: what's the current": I still implementing it, but the idea is to store the DB typedef in a conf, and I was trying to implement a DBWrapper class that one could use to implment a new DB so My system could accept new dbs
22:24:29FromDiscord<Elegantbeef> Sounds like a generic with a concept constraint is ideal, ymmv
22:25:46FromDiscord<wsantos> This is what I have so far, I'll check concepts my only concern is that is a "experimental" feature
22:26:15FromDiscord<Elegantbeef> It's not behind a flag and is only experimental cause araq whats a different API
22:26:29FromDiscord<Elegantbeef> wants a different\
22:26:37FromDiscord<wsantos> sent a code paste, see https://play.nim-lang.org/#ix=3Tdg
22:26:51FromDiscord<Elegantbeef> That is checking if there is a `open` procedure which takes 4 strings and returns the same type as `db`
22:28:33FromDiscord<luteva> euh.... concepts? constraints? any link to a manuel about "concepts" and "constraints"?
22:28:47FromDiscord<wsantos> In reply to @luteva "euh.... concepts? constraints? any": https://nim-lang.org/docs/manual_experimental.html#concepts
22:29:08FromDiscord<Elegantbeef> Constraints are generic limitations the simplest is just `type MyType[T: not int] = object`
22:29:28FromDiscord<Elegantbeef> Concepts work like C++ concepts where they constrain if the body of the concept compiles for a type
22:29:47FromDiscord<Elegantbeef> So you can use them to explicitly state the API required for a generic to function
22:31:01FromDiscord<luteva> oh yes i remember. there was something about constraints in the "nim in action" book.... but only experimental afaik. and just a few senteces.
22:31:14FromDiscord<wsantos> sent a code paste, see https://play.nim-lang.org/#ix=3Tdj
22:31:18FromDiscord<Elegantbeef> constraints are not experimental
22:31:21FromDiscord<luteva> but can't remember "concepts"
22:31:25FromDiscord<Elegantbeef> `DB` is the type of the value being tested
22:31:58FromDiscord<wsantos> I don't get the `type` in there
22:32:16FromDiscord<wsantos> Let me check the docs instead of asking everything here 😄 RTFM 😄
22:32:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Tdk
22:32:37FromDiscord<Elegantbeef> `db` will an instance of `OdbcConnTyp` and `DB` will be `OdbcConnTyp`
22:32:43FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3Tdl
22:32:45FromDiscord<Elegantbeef> It's a shorthand for `typeof(DB)`
22:32:50FromDiscord<ynfle> (edit) "https://play.nim-lang.org/#ix=3Tdl" => "https://play.nim-lang.org/#ix=3Tdm"
22:32:59FromDiscord<Elegantbeef> Oh god it's all module based dispatch?
22:33:05FromDiscord<Elegantbeef> Fuck i hate that
22:33:05FromDiscord<ynfle> In reply to @Elegantbeef "Oh god it's all": Yup
22:33:24FromDiscord<ynfle> You could import different modules depending on a `-d` switch
22:33:31FromDiscord<Elegantbeef> I'd enforce `DB.open("", "", "", "")` instead
22:33:46FromDiscord<Elegantbeef> It's just stupid to rely on module namespace to distinguish procedures for stuff like this imo
22:34:24FromDiscord<Elegantbeef> I'll be in my corner sulking
22:35:22FromDiscord<luteva> oh yeah. concepts: kind of typeclasses (in haskell)?!? great!
22:35:42FromDiscord<Elegantbeef> Yep
22:36:03FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3Tdn
22:36:21FromDiscord<Elegantbeef> You can ping me with my name
22:36:22FromDiscord<Elegantbeef> It's magic
22:36:30FromDiscord<Elegantbeef> Elegantbeef just magic summons me
22:36:40FromDiscord<Bubblie> Oh wait you have a discord account?
22:36:51FromDiscord<Elegantbeef> I do, not that i use it here
22:36:55FromDiscord<Bubblie> Ah okay
22:36:59FromDiscord<Elegantbeef> Throw the code on playground 😛
22:37:09FromDiscord<Bubblie> Alright
22:37:53FromDiscord<Bubblie> Can I even import vulkan in playground though
22:38:14FromDiscord<Bubblie> Doesnt it need the dll
22:38:21FromDiscord<Bubblie> Or dylib or so
22:38:39FromDiscord<wsantos> @ElegantBeef so to summarise use concept as generic constraint, right ? the documentation about concepts is huge holy F* 😄
22:38:44*lumo_e quit (Quit: Quit)
22:38:46FromDiscord<Elegantbeef> Yes
22:38:50FromDiscord<Elegantbeef> Concepts are generic constraints
22:39:03FromDiscord<Elegantbeef> That allow you to use "this much match X" to compile
22:39:16FromDiscord<Bubblie> Yeah uh I dont think I can import vulkan in playground
22:39:25FromDiscord<wsantos> Perfect, I'll play around and share so you guys can double share before committing to it, thanks !
22:39:38FromDiscord<Elegantbeef> Doesnt fuckiing matter bubblie i just want a nice editor to read the code
22:39:45FromDiscord<Bubblie> OH
22:39:48FromDiscord<Bubblie> Thats what you meant?
22:39:52FromDiscord<Elegantbeef> You double edited it so it disappeared here
22:39:56FromDiscord<Bubblie> OH
22:40:01FromDiscord<Bubblie> Okay I got you fam mb LOL
22:40:58FromDiscord<Elegantbeef> actually wsantos we dont need to bitch and moan about the lack of type in first parameter i think
22:41:01FromDiscord<Elegantbeef> Gotta check something
22:42:00FromDiscord<wsantos> Not sure what you mean ;/
22:42:03FromDiscord<wsantos> (edit) ";/" => ":/"
22:42:21FromDiscord<Elegantbeef> Well Nim doesnt let you disambiguate based off returrn type
22:42:46FromDiscord<Elegantbeef> So the fact the nim builting `db` `open` procedures all use `open(a, b, c, d: string): DB` means if you have 2 DB modules you get a compile time error
22:45:12FromDiscord<wsantos> Ok, yeah let me play with it
22:46:55FromDiscord<Bubblie> @ElegantBeef https://play.nim-lang.org/#ix=3Tdo here you go sorry that took a bit my wifi shat itself
22:50:34FromDiscord<Elegantbeef> Ok now what's the issue?
22:58:37FromDiscord<Elegantbeef> @Bubblie\: are you still using nimgl?
23:03:39FromDiscord<ynfle> In reply to @Elegantbeef "Gotta check something": Did you figure something out?
23:03:51FromDiscord<Elegantbeef> I'm still fighting concepts
23:04:25*ltriant_ joined #nim
23:05:16FromDiscord<ynfle> You mean programming with concepts
23:05:24FromDiscord<ynfle> Their quite esoteric
23:05:30FromDiscord<ynfle> they're
23:05:44FromDiscord<Elegantbeef> Nah they generally work fine it's quite difficult to reason what i'm trying
23:06:17*ltriant quit (Ping timeout: 240 seconds)
23:06:33FromDiscord<ynfle> Nice
23:10:23FromDiscord<Bubblie> In reply to @Elegantbeef "<@415227941408997381>\: are you still": yes
23:10:39FromDiscord<Bubblie> essentially the issue here
23:10:42FromDiscord<Bubblie> let me get the error
23:10:45FromDiscord<Elegantbeef> `import nimgl/vulkan`
23:11:40FromDiscord<Bubblie> doing nimgl/vulkan causes it to state it cannot open the file, see the thing is I installed the vulkan bindings seperately so I didn't have to get the entiriety of nimgl
23:11:46FromDiscord<Elegantbeef> Ah
23:11:54FromDiscord<Bubblie> but let me just try installing nimgl entirely and see if that makes a difference
23:15:03FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3Tdr
23:15:12FromDiscord<Bubblie> also, this time I did nimgl/vulkan
23:15:14FromDiscord<Bubblie> for the import
23:15:16FromDiscord<Bubblie> everything else is the same
23:15:34FromDiscord<Bubblie> at this point I think I might just do the bindings myself
23:15:53FromDiscord<Elegantbeef> Have fun
23:16:43FromDiscord<Bubblie> If you have an idea please throw it my way, if you dont then yeah thats fine too
23:17:13FromDiscord<Elegantbeef> I mean i had the same error so seems something either needs imported or exported
23:17:24FromDiscord<Elegantbeef> Look at the bindings and see if there's a missing ``
23:18:19FromDiscord<Bubblie> Missing in the example?
23:18:24FromDiscord<Bubblie> Or in the bindings themselves
23:18:37FromDiscord<Elegantbeef> The bindings
23:18:42FromDiscord<Bubblie> Alright ill take a look
23:19:26FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Tds
23:22:12FromDiscord<ynfle> Nice!
23:22:36FromDiscord<ynfle> Intense nimnastics
23:33:49FromDiscord<Shinyzenith> In reply to @greenb1ade "Random but what theme": Toykonight
23:34:21FromDiscord<Shinyzenith> In reply to @auxym "what does wl_signal_add do?": It adds a callback to a wl-listener struct
23:35:23FromDiscord<auxym> no addr? time for gdb then I guess?
23:36:14FromDiscord<Elegantbeef> Or i look at code
23:39:27FromDiscord<Elegantbeef> Herb output is a stack variable afaict so this is unsafe
23:43:44FromDiscord<Elegantbeef> So it's due to abusing the stack i imagine
23:43:46FromDiscord<Elegantbeef> I could be wrong
23:51:02*vicecea quit (Remote host closed the connection)
23:51:33*vicecea joined #nim