<< 27-03-2022 >>

00:47:18FromDiscord<ynfle> In reply to @Elegantbeef "I'm going to start": Pointers on pointers?
00:48:13FromDiscord<Elegantbeef> Pretty much, i was thinking more "Pointers? Point who I hardly know her" 😛
01:23:28FromDiscord<Patitotective> @ElegantBeef is there a way to check the stack trace of the cimgui functions called? cause im haven't been able to find anything lol
01:23:47FromDiscord<Elegantbeef> What do you mean?
01:24:36FromDiscord<Patitotective> like to see which files (`.h`) are being used by which functions in which lines
01:25:03FromDiscord<Elegantbeef> C doesnt have a stack trace
01:25:04FromDiscord<Elegantbeef> So nope
01:25:28FromDiscord<Elegantbeef> Not easily
01:25:41FromDiscord<Elegantbeef> You might be able to use debug tools to do it
01:25:50FromDiscord<Patitotective> In reply to @Elegantbeef "You might be able": like?
01:26:06FromDiscord<Elegantbeef> You're a windows user so no clue
01:26:19FromDiscord<Elegantbeef> callgrind might work, gdb might work
01:26:23FromDiscord<Patitotective> im an ubuntu user LOL
01:26:29FromDiscord<Elegantbeef> Oh
01:26:34FromDiscord<Elegantbeef> Why did i think you used windows
01:27:43FromDiscord<Elegantbeef> Well i have a writeup for the basic of pointers, it's fucking useless methinks
01:27:58FromDiscord<Elegantbeef> Doesnt explain anything so time well spent
01:28:24FromDiscord<Elegantbeef> If anyone wants to take a peak at it https://www.jasonbeetham.com/pointerexplaination.html
01:45:44FromDiscord<Patitotective> In reply to @Elegantbeef "C doesnt have a": and cpp?
01:45:57FromDiscord<Elegantbeef> No clue
01:46:31FromDiscord<Elegantbeef> Doubt it
01:47:15FromDiscord<michaelb.eth> sent a code paste, see https://paste.rs/NCN
01:47:27FromDiscord<Elegantbeef> `for _ in 0..<someInt`
01:47:32FromDiscord<michaelb.eth> (edit) "https://play.nim-lang.org/#ix=3Tzq" => "https://paste.rs/byj"
01:48:10FromDiscord<michaelb.eth> (edit) "https://play.nim-lang.org/#ix=3Tzs" => "https://play.nim-lang.org/#ix=3Tzr"
01:50:16FromDiscord<michaelb.eth> In reply to @Elegantbeef "If anyone wants to": I like it 🙂
01:51:03FromDiscord<ElegantBeef> Thanks
01:52:03FromDiscord<Elegantbeef> Uh oh the matrix bridge machine borkeded
01:52:03FromDiscord<Elegantbeef> Hmm this bridge likes dying randomly
01:52:23FromDiscord<michaelb.eth> probably a bad pointer
01:52:41FromDiscord<Elegantbeef> It happened after you edited your message so i blame you
01:53:34FromDiscord<michaelb.eth> I'm pretty sure someone didn't have their fingers crossed and their lips twisted in just the right way to keep it from crashing
01:53:53FromDiscord<Elegantbeef> Ah my bad, i'll get the glue
02:11:44FromDiscord<huantian> It is unfortunate that edits don’t transfer perfectly with the bridge
02:12:01FromDiscord<Elegantbeef> They do sometimes but for some reason the bridge removes the message
02:12:16FromDiscord<Elegantbeef> Probably a case of no one fed up enough to fix it
02:13:39FromDiscord<Elegantbeef> Dont even know which bridge they use
02:34:46*mal`` quit (Quit: Leaving)
02:37:06FromDiscord<huantian> Maybe we should make our own bridge in Nim
02:37:33FromDiscord<Elegantbeef> Well the matrix API is being wrapped, no clue if it supports bots
02:42:36*wyrd quit (Quit: Lost terminal)
02:52:11*mal`` joined #nim
03:24:21*wyrd joined #nim
03:28:07FromDiscord<Patitotective> how do i know which compiler nim is using?
03:28:18FromDiscord<Patitotective> (edit) "using?" => "using (gcc or clang)?"
03:28:31FromDiscord<Elegantbeef> by default on linux it uses `gcc`
03:29:22FromDiscord<Elegantbeef> `defined(gcc)` is atleast for gcc check
03:30:06FromDiscord<Patitotective> In reply to @Patitotective "<@!145405730571288577> is there a": i couldn't find anything lol↵i created an issue https://github.com/nimgl/nimgl/issues/77
03:32:43FromDiscord<Elegantbeef> The issue is your string
03:32:43FromDiscord<creikey> something I'm just now considering, if the bulk of my SE work is in nim how will I even get hired?
03:33:29FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/QvV
03:33:30FromDiscord<Elegantbeef> There you go how you're supposed to do it
03:33:46FromDiscord<Elegantbeef> Wait people hire software devs?↵(@creikey)
03:33:58FromDiscord<Elegantbeef> It's a system programming language I'd imagine if you have good projects it doesnt matter
03:34:08FromDiscord<creikey> In reply to @Elegantbeef "It's a system programming": even if everybody uses C++?
03:34:17FromDiscord<creikey> In reply to @Elegantbeef "Wait people hire software": not even sure at this point tbh
03:35:06FromDiscord<Patitotective> sent a code paste, see https://paste.rs/Tz8
03:35:15FromDiscord<Elegantbeef> No clue, i'd imagine application of knowledge is more important than language
03:35:23FromDiscord<creikey> sent a code paste, see https://play.nim-lang.org/#ix=3TzI
03:35:38FromDiscord<Elegantbeef> Shouldnt matter
03:36:03FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3TzJ
03:37:14FromDiscord<Elegantbeef> Dont take my view as gospel anyway, i'm not a software developer
03:39:30FromDiscord<Elegantbeef> Anyway the 64 is the length of the string without a null terminator, it's what imgui will draw up to or input up to
03:42:17FromDiscord<Patitotective> :O
03:42:19FromDiscord<Patitotective> it worked
03:42:35FromDiscord<Patitotective> In reply to @Elegantbeef "Dont take my view": are you sure you're not a software developer? lol
03:43:47FromDiscord<Elegantbeef> In an ideal world there is a `proc igInputText(label: string, buff: var openArray[char], ...)`
03:43:47FromDiscord<Elegantbeef> Also patito you do realize `igInputText` returns true if the buffer has been changed right?
03:43:48FromDiscord<Elegantbeef> You dont need to use the callback/userdata for what you were doing
03:44:19FromDiscord<Elegantbeef> I'm not a professional one
03:44:45*fowl joined #nim
03:45:20FromDiscord<creikey> In reply to @Elegantbeef "I'm not a professional": I'm curious do you have a day job?
03:45:56FromDiscord<Patitotective> In reply to @Elegantbeef "You dont need to": I thought the same but if you see `IgInputText` https://nimgl.dev/docs/imgui.html#igInputText%2Ccstring%2Ccstring%2Cuint%2CImGuiInputTextFlags%2CImGuiInputTextCallback%2Cpointer↵`buf` is not `var` and the only way to get the `buf` is by using the `callback`
03:46:02FromDiscord<Patitotective> (edit) "In reply to @Elegantbeef "You dont need to": I thought the same but if you see ... `IgInputText`" added "in"
03:48:18FromDiscord<Elegantbeef> uhh
03:48:29FromDiscord<Elegantbeef> It mutates `buf`
03:49:11FromDiscord<Patitotective> :O how?
03:49:18FromDiscord<Elegantbeef> It's a cstring
03:49:28FromDiscord<Elegantbeef> that `buf` is the `buf` you get back
03:49:42FromDiscord<Patitotective> time to stop living LMAO
03:52:51FromDiscord<Patitotective> 🌃
03:52:54FromDiscord<Patitotective> good night everyone
03:53:34FromDiscord<Elegantbeef> @Patitotective\: goodnight, but take this https://play.nim-lang.org/#ix=3TzO
04:08:10*arkurious quit (Quit: Leaving)
04:34:07*slowButPresent quit (Quit: leaving)
05:39:01FromDiscord<Mikerah (Mikerah)> I'm trying to cross-compile a simple nim program (just a hello world for testing purposes) to C and I'm missing a nimbase.h file.
05:39:45FromDiscord<Elegantbeef> depends on your install path if using choosenim it's `.choosenim/toolchains/version/lib/nimbase.h`
05:39:47FromDiscord<Mikerah (Mikerah)> I noticed that within the choosenim folder, I can find it but I have a feeling that this is somewhat unnecessary and the nim compiler probably has an option for this somewhere
05:40:09FromDiscord<Elegantbeef> Are you compiling Nim, or using nim to output C?
05:40:22FromDiscord<Mikerah (Mikerah)> The latter
05:40:47FromDiscord<Mikerah (Mikerah)> I guess it's inaccurate to say nim compiler even though I'm running `nim cc ...` ?
05:41:06FromDiscord<Elegantbeef> If you're doing `nim c ./myNim.nim` it's the former
05:41:25FromDiscord<Elegantbeef> If you're doing `nim c -c --nimcache:someDir myNim.nim` it's the latter
05:41:38FromDiscord<Mikerah (Mikerah)> Okay. I see
05:41:58FromDiscord<Elegantbeef> If nim is doing everything you shouldnt need to do anything with the nimbase
05:42:05FromDiscord<Elegantbeef> So what's the exact command you're using/process
05:42:29FromDiscord<Mikerah (Mikerah)> I'm running `nim cc --nimcache:. --cpu:amd64 --os:linux mininimbus.nim`.
05:42:37FromDiscord<Mikerah (Mikerah)> My goal is to get c code
05:42:49FromDiscord<Elegantbeef> Ok so then yes you need to copy the nimbase manually afaik
05:42:57FromDiscord<Elegantbeef> It'd be nice if you didnt, but it's a one time thing
05:43:22FromDiscord<Mikerah (Mikerah)> I see.
05:43:36FromDiscord<Mikerah (Mikerah)> Might a good first contribution to automate this process
05:43:49FromDiscord<Mikerah (Mikerah)> Anyways, thank you @elegantbeef\:matrix.org for the clarification
05:44:02FromDiscord<Elegantbeef> Perhaps, though might be a bit odd if you change your compiler
05:45:01FromDiscord<Elegantbeef> Guess it can always compare the two
05:45:45FromDiscord<Mikerah (Mikerah)> I need a specific version of the nim compiler though. Otherwise it doesn't build
05:47:32FromDiscord<Elegantbeef> Sounds like great software 😛
05:48:04FromDiscord<Mikerah (Mikerah)> I'm just trying to write a quick-ish prototype for something and nim was the best option given its ability to compile to MIPS and C
05:48:41FromDiscord<Elegantbeef> Yea i'm just joking, manually copying is what we have
06:21:20*Zectbumo joined #nim
07:01:48*jmdaemon quit (Ping timeout: 240 seconds)
07:47:03*pro joined #nim
08:34:37*Zectbumo quit (Remote host closed the connection)
09:23:56FromDiscord<iencec> how would I convert a `seq[Rune]` to `string`?
09:24:38FromDiscord<Elegantbeef> `$`
09:24:56FromDiscord<iencec> ah - forgot about that one - thanks!
09:26:42FromDiscord<Rika> Maybe we should have a proc called to string that’s literally just an alias to that
09:26:43FromDiscord<Rika> Lol
09:27:57FromDiscord<iencec> I indeed was trying `toString` earlier.. \:-D
10:24:07*PMunch joined #nim
10:39:12FromDiscord<Require Support> is there a way to get type of var in nim?
10:41:45FromDiscord<Require Support> sent a code paste, see https://play.nim-lang.org/#ix=3TAz
10:42:07FromDiscord<Solitude> yes, you just did it
10:42:14FromDiscord<Require Support> wait no way LOL
10:42:50FromDiscord<Require Support> omg its actually right, im dumb
10:46:19*xet7 joined #nim
10:48:30FromDiscord<Rika> lol
11:41:25*xet7 quit (Remote host closed the connection)
11:49:33FromDiscord<Patitotective> sent a code paste, see https://paste.rs/w9j
11:58:00PMunchHmm, anyone here used plotly?
11:59:25PMunchI have a Raspberry Pi which reads a temperature/humidity sensor and outputs the data to a file in a cron-job. Now I want to display that data on a website, I was initially thinking of using some JavaScript library like Chart.js, but Plotly looks really nice, and since it outputs HTML there is (hopefully) a way to get that HTML and embed it into a site?
12:04:26PMunchAha, so the Plotly library only generates the JSON required for the Plotly JS library
12:05:19PMunchSo I should be able to make a HTML file with the Plotly library and then use the `toPlotJson` to get the JSON I need for the library?
12:08:09FromDiscord<hotdog> In reply to @PMunch "So I should be": Sounds about right
12:08:15FromDiscord<hotdog> Are there no examples?
12:08:39PMunchNot of this particular use-case, no
12:08:47PMunchHmm, there is a `save` function
12:08:59PMunchBut I want to embed this into another site
12:11:44PMunchHmm, there is `fillHtmlTemplate`
12:11:50PMunchBut it's not exported by default
12:20:30procan't you just generate svg and embedd svg ?
12:22:20PMunchpro, I could, but that sounds like more work for me
12:22:52prohonestly, I enjoy creating simple graphics with simple elements, so I thought you would too :P
12:23:20PMunchOh, don't get me wrong, I'd love to do it. But sometimes you just need things done fast .)
12:23:50proI remmember that I had some sqlite or .csv files I needed to visualize, and I used some software that generated .png's, which scaled nicely to any res
12:24:01prognuplot iirc
12:24:07PMunchYeah I could use something like gnuplot
12:25:06FromDiscord<Recruit_main707> at that point you may also use matplotlib and generate a png file, from the little ive seen of gnuplot its worse than it
12:25:10proif it's production or critical sensor, then I'd self host graylog or something like that, which has several notifications of data stopping to come
12:25:29PMunchOh it's nothing like that
12:25:41PMunchIt's just a small Raspberry Pi chilling behind my TV :P
12:27:11FromDiscord<auxym> ggplotnim can probably generate svg?
12:28:21proI want to get into hardware projects now...
12:28:42*slowButPresent joined #nim
12:47:09FromDiscord<auxym> join us in embedded 😉
12:47:52prous?
12:58:01FromDiscord<Rika> there is a channel `nim-embedded` i believe
12:59:06PMunchYes, it's #nim-embedded on IRC
13:02:36FromDiscord<auxym> us 😏
13:02:38FromDiscord<hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3TB5
13:02:43FromDiscord<hmmm> basically this fails because seq grows while iterating
13:03:01FromDiscord<hmmm> but I still need to do it, the objective is to add test 3 times to that seq
13:03:12FromDiscord<hmmm> how do I get around dat
13:03:23FromDiscord<Rika> `for _ in 0..a.high:` since you dont need i
13:03:26FromDiscord<auxym> iterate with an index index?
13:03:33FromDiscord<auxym> yeah that
13:03:39FromDiscord<hmmm> what does the underscore do
13:03:43FromDiscord<Rika> nothing
13:03:43FromDiscord<auxym> nothing
13:03:44FromDiscord<Rika> its a variable name
13:03:46FromDiscord<hmmm> wot
13:03:48FromDiscord<Rika> but not really
13:04:08FromDiscord<Rika> you could name it i but you dont use it anyway
13:04:24FromDiscord<hmmm> nununu this was a simple example lol I need to use it
13:04:55FromDiscord<hmmm> basically I use a.high and it will lock it
13:04:56FromDiscord<Rika> then put that in the damn example]
13:04:58FromDiscord<hmmm> ok I'll try
13:06:05FromDiscord<auxym> or something like that
13:06:05FromDiscord<auxym> sent a code paste, see https://play.nim-lang.org/#ix=3TB7
13:12:17*BEST_Flibra_Gaia joined #nim
13:16:06PMunchMan, running Nim on the Raspberry Pi really makes me appreciate how fast my computer is :P
13:16:52proman I wish I had RPI when I grew up
13:17:02FromDiscord<exelotl> it makes me really long for IC 😅
13:18:06*BEST_Flibra_Gaia quit (Quit: Client closed)
13:18:16prowhy aren't you compiling for rpi on your desktop?
13:21:32PMunchI had some trouble setting up the cross-compilation, and I just never got around to setting it up properly :P
13:22:06prowhy deal with cross compilation when you can emulate the entire thing with qemu/kvm
13:22:49PMunchTbh that sounds like more work to set up than a cross-compiler
13:23:18prohonestly, it's just a virtual machine
13:23:21pro:)
13:32:02FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3TBb
13:32:25FromDiscord<Rika> `find` i think is the name
13:39:52PMunchYup, it's find from the system module: https://nim-lang.org/docs/system.html#find%2CT%2CS
13:49:48PMunchHmm, I think I should turn https://github.com/PMunch/autotemplate into a library
13:52:03PMunchI just used it for this actual project and it's pretty neat
14:27:31FromDiscord<ajusa> Still not sure how it is different from Ninja tbh
14:27:38FromDiscord<ajusa> (edit) "Ninja" => "Nimja"
14:28:36FromDiscord<ajusa> Both seem to generate HTML by using HTML templates at compile time
14:28:59FromDiscord<ajusa> Only Nimja has more features as it's been developed longer
14:31:15PMunchOh sure, autotemplates could easily use Nimja instead of templates
14:31:23PMunchI just grabbed the simplest one I could find for my testing
14:31:54PMunchBasically all autotemplates does is automatically create templates from files in a directory
14:32:53PMunchIf you have a file called `Chart.html` and `Chart` is a type in your Nim code it will generate `proc toHtml(x: Chart): string` which will take that object and format it based on that template
14:33:10PMunchI plan to add filetype support as well
14:34:14PMunchAnd a way for Jester to respond with different types dependent on the query (by an "Accept" header or a `.html` postfix)
14:35:31PMunchSo if you had both `Chart.html` and `Chart.json` you could call `127.0.0.1:5000/getchart.html` and it would return a HTML version and `127.0.0.1:5000/getchart.json` would return a JSON version
14:36:26FromDiscord<ajusa> Gotcha, I understand the difference now. You are focused on automatically generating those procs, while Nimja focuses on generating the HTML itself
14:36:33PMunchYup
14:36:50PMunchI don't generate any HTML, I let `onionhammer/nim-templates` handle that for me
14:37:00PMunchBut that could just as easily be Nimja or any other templating library
14:57:35*ltriant quit (Ping timeout: 260 seconds)
15:10:22*arkurious joined #nim
15:26:44*ltriant joined #nim
15:33:29FromDiscord<ajusa> if I wanted to generate code based on a string at compile time, I'd need to use macros right? No way to do it with a template?
15:35:32FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3TCp
15:39:05PMunchCorrect
15:39:29PMunchYou need a macro for that
15:39:53FromDiscord<Bubblie> PMunch sorry to interrupt, but did you see what I said yesterday? i can resend the post
15:40:08FromDiscord<Bubblie> (edit) "post" => "message"
15:40:44FromDiscord<Bubblie> I was just unsure if it was seen through IRC
15:40:53FromDiscord<Bubblie> Sorry if I am being annoying
15:41:35PMunchI saw you asking if you could get some help, then I said yes and you never replied :P
15:42:26FromDiscord<Bubblie> Oh no I did
15:42:36FromDiscord<Bubblie> Wait shit on IRC you cant see replies right
15:42:52PMunchWell I can see that you reply, but only a small snippet of what you replied to
15:43:40FromDiscord<Bubblie> sent a code paste, see https://paste.rs/zDQ
15:43:42FromDiscord<Bubblie> This was the original message
15:44:19PMunchAh, backslashes like that are treated as escape codes in Nim
15:44:33PMunchSo you need double backslashes
15:44:57FromDiscord<Bubblie> I added double
15:45:02FromDiscord<Bubblie> Problem is that didnt work either
15:45:09PMunchYou also appear to not have sysPath set correctly
15:45:15FromDiscord<Bubblie> Oh
15:45:20FromDiscord<Bubblie> How do I set sysPath
15:45:21PMunchIt's supposed to point to the system include path
15:45:43FromDiscord<Bubblie> ?
15:45:52PMunchAs you can see in the stb example it points to the clang or gcc libraries IIRC
15:46:07PMunchIt should basically point to the standard C library of whichever C compiler you're using
15:46:15FromDiscord<Bubblie> Ohhh
15:46:22FromDiscord<Bubblie> So, since futhark is using clang
15:46:25FromDiscord<Bubblie> It should point to clang
15:46:31FromDiscord<Bubblie> Then I can specify the library I want
15:46:34FromDiscord<Bubblie> Like GLDW
15:46:38FromDiscord<Bubblie> (edit) "GLDW" => "GLFW"
15:46:39FromDiscord<Bubblie> Right?
15:46:52PMunchWell Øpir uses clang to read C files, but that's already compiled, what you need is the one for your compiler
15:47:00PMunchThat you use to compile your project with
15:47:10PMunchWhich on Windows is probably mingw or something
15:47:19FromDiscord<Bubblie> OH so I point to mingw in this case
15:47:30FromDiscord<Bubblie> Ah that makes a lot more sense
15:48:20PMunchYeah, sysPath points to the standard C library, path points to whichever library you want to import, and then the imports have to exist somewhere in those two paths, and anything `#include`-ed that resides in path will be automatically imported into Nim
15:48:36PMunchAnd thanks for the Windows instructions
15:52:01FromDiscord<Bubblie> Of course
15:52:14FromDiscord<Bubblie> And thank you, ill fix that now
15:58:20NimEventerNew Nimble package! rconv - Universal Rhythm-Game File parser and converter, see https://github.com/prefixaut/rconv
16:03:03FromDiscord<frobnicate> Do people who use Nim have a name? Like Go is Gophers and C++ is boomers?
16:04:05FromDiscord<hmmm> nimions
16:04:14pronimblers
16:04:41FromDiscord<hmmm> if low IQ nimlets (I'm one)
16:05:06PMunchVarious names have been proposed, but none of them are in common use
16:05:17PMunchI think Nimions is the one you'll see the most
16:07:15FromDiscord<hmmm> I see a bunch of config packages in directory, what can I use to read and write a simple config.ini
16:08:48*jmdaemon joined #nim
16:09:01FromDiscord<Recruit_main707> > c++ is boomers↵lol
16:09:53FromDiscord<hmmm> maybe I'll just jsony it, seems simpler
16:11:13PMunch@hmmm, what format is the configuration currently?
16:11:55FromDiscord<Bubblie> In reply to @frobnicate "Do people who use": Boomers LMAO
16:11:55FromDiscord<hmmm> hmm no format pmunch, it should just contain all preferences for my app
16:12:31FromDiscord<Solitude> In reply to @hmmm "I see a bunch": parsecfg from stdlib sometimes works
16:12:38PMunch@hmmm, do you want them user editable?
16:12:57PMunchTOML comes to mind as a format if you where considering .ini
16:13:05PMunchAnd Nim has a fairly good TOML parser
16:13:07FromDiscord<hmmm> I think I'll provide in app clicky clocky, but that would be comfy too
16:13:21FromDiscord<Patitotective> https://patitotective.github.io/niprefs/ 👀
16:13:43PMunchOr you could of course go full balls to wall and use NimScript as a configuration language :)
16:14:22FromDiscord<Rika> or other vm languages like lua
16:14:28FromDiscord<Solitude> ugh
16:14:30FromDiscord<Rika> if you're that insane
16:14:33FromDiscord<Bubblie> Lua is cool
16:14:35FromDiscord<Bubblie> I like it
16:14:46FromDiscord<Bubblie> Except it lacks a ton of shit
16:14:47FromDiscord<hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3TCC
16:14:49PMunchWhy use Lua when you can use Nim :)
16:14:53FromDiscord<Bubblie> Because its supposed to be very small
16:14:53FromDiscord<Rika> In reply to @Bubblie "Except it lacks a": like?
16:14:57FromDiscord<Rika> In reply to @PMunch "Why use Lua when": preference perhaps
16:15:16FromDiscord<Solitude> In reply to @Rika "preference perhaps": mental illness
16:15:29PMunchHaha :P
16:15:36FromDiscord<Bubblie> Hold on there was one major thing in lua that isn’t there I forgot the proper terminology
16:15:38PMunchI've actually never used Lua myself
16:15:42FromDiscord<Bubblie> Let me look for it
16:16:03FromDiscord<Patitotective> In reply to @hmmm "I like niprefs because": lol
16:16:10FromDiscord<Patitotective> In reply to @Bubblie "Except it lacks a": im planning to add tuples
16:16:23FromDiscord<Bubblie> 👀
16:16:26FromDiscord<Bubblie> That would be insane
16:16:29FromDiscord<Bubblie> But yeah lua lacks threads
16:16:30FromDiscord<Bubblie> There we go
16:16:33FromDiscord<hmmm> I'll give it a spin parti
16:16:52FromDiscord<Bubblie> Nim feels like a great scripting language and a great language by itself
16:16:59FromDiscord<Bubblie> Its like both
16:17:00PMunchWhy would you want threads for a configuration?
16:17:29FromDiscord<Bubblie> Also lua arrays are weird especially with the indexes if I remember
16:17:44PMunchI mean I'm not complexity-shaming, but if your configuration logic requires multi-threading then you might be doing something wrong :P
16:18:33FromDiscord<Bubblie> Im confused I was talking about lua as a language
16:19:02FromDiscord<Bubblie> Im not shaming it for having these features, as it actually does make sense why it doesn’t have a lot of features other languages have because of how small and light it was meant to be
16:19:17FromDiscord<Bubblie> Its supposed to be one the kost embeddable languages out there
16:19:23FromDiscord<Bubblie> (edit) "kost" => "most"
16:20:32PMunchHmm, I'm struggling with how I want to organise this code
16:20:53FromDiscord<Bubblie> ?
16:21:01PMunchI'm using a C library, libcoap, to send some messages to turn on and off the lights at home
16:21:13prolibcoap nice :)
16:22:52PMunchThe way it's designed is that you set a callback then queue a request, then call `coap_io_process` which will then process IO until it has received the next message. I have to call coap_io_process multiple times before the callback is triggered and I get the response to my request
16:23:06FromDiscord<Patitotective> In reply to @hmmm "I like niprefs because": check it again https://patitotective.github.io/niprefs/niprefs.html 👀
16:23:11FromDiscord<Patitotective> (edit) "https://patitotective.github.io/niprefs/niprefs.html" => "https://patitotective.github.io/niprefs/"
16:23:12PMunchThis works, but it's a bit messy
16:23:26FromDiscord<frobnicate> Would you guys represent a 4x4 matrix as a type object with a one dimensional array or two dimensional array? I'm not sure it does a ton of difference since it's known size
16:23:46FromDiscord<Rika> if its an array
16:23:53FromDiscord<Bubblie> In reply to @PMunch "I'm using a C": Thats really cool!
16:23:53FromDiscord<Rika> theyre memory-equivalent
16:23:55FromDiscord<Rika> so use array
16:23:59FromDiscord<Rika> 2d
16:24:08PMunch@frobnicate, the memory layout is the same for array[4, array[4, int]] and array[4*4, int]
16:24:13PMunchSo it doesn't really matter
16:24:27FromDiscord<frobnicate> Yeah that was why I was asking
16:24:28PMunchUse whatever is more convenient in your code :)
16:24:31FromDiscord<Rika> 2d array has "better" api
16:25:35PMunch`coap_io_process` takes a timeout value, so I could wrap it all in an async call I guess
16:25:53PMunchWith a 100ms timeout or something like that..
16:28:51*Gustavo6046 quit (Read error: Connection reset by peer)
16:29:43FromDiscord<hmmm> In reply to @Patitotective "check it again https://patitotective.github.io/nipr": lol seems appropriate I'm a new user of nipref
16:30:10FromDiscord<hmmm> I hope you set it up to be nimble installed because that's the extent of my installing powers 😄
16:30:22FromDiscord<Bubblie> PMunch, could there be a way to specify the sysPath automatically on install of Futhark?
16:30:47FromDiscord<Bubblie> Depending on the OS
16:31:10FromDiscord<frobnicate> I forget if there was a way to put restraints on generics
16:31:11FromDiscord<Bubblie> And could be specified yourself if needed
16:31:27FromDiscord<Rika> In reply to @frobnicate "I forget if there": like?
16:31:33FromDiscord<Solitude> In reply to @frobnicate "I forget if there": [T: not int]
16:31:40FromDiscord<frobnicate> Like only numbers
16:31:42FromDiscord<Rika> or any other type
16:31:50FromDiscord<Rika> `[T: SomeNumber]`
16:31:52FromDiscord<Rika> prolly?
16:32:15FromDiscord<Rika> https://nim-lang.org/docs/system.html#SomeNumber
16:32:49FromDiscord<frobnicate> ah thanks a bunch
16:33:01FromDiscord<frobnicate> it wasn't obvious from the generics tutorial page
16:35:11PMunch@Bubblie, yeah I'm looking into something like that
16:35:41PMunchOptimally I'd want to check which C compiler Nim was going to use, and then query that for where it keeps system libraries
16:35:49FromDiscord<frobnicate> Also the "refactor symbol" function doesn't work for me with the Konstantin Zaitsev Nim extension in VSC which is a little frustrating :/
16:36:07PMunchBut I think a define symbol might be the easiest way to do it for now
16:36:21PMunchThen you could put it in your system Nim config
16:37:27FromDiscord<Rika> doesnt nim have facilities for checking what c compiler its gonna use or what
16:38:07FromDiscord<Bubblie> In reply to @PMunch "But I think a": Yeah
16:38:09PMunchYeah it should have something
16:38:11FromDiscord<Recruit_main707> `when compileOption("cc") == "compiler"`?
16:38:23PMunchThe problem is querying them
16:38:42FromDiscord<Bubblie> Futhark doesnt have cpp support yet right?
16:40:09PMunchNope
16:41:18FromDiscord<Bubblie> Ah thats okay for the time being ig, I am mostly using c libraries anyway
16:42:16FromDiscord<Bubblie> Nim has c++ support right? I could just use full on nim if needed
16:43:44FromDiscord<Rika> yes
16:44:23*Gustavo6046 joined #nim
16:44:36FromDiscord<Bubblie> I think nim’s ffi is the best ffi ive seen in any language
16:45:23FromDiscord<Bubblie> Its so easy like what the hell, for java I have to use shitty jni and nim has really been spoiling me with the stuff it has
16:45:24*Gustavo6046_ joined #nim
16:45:34*Gustavo6046 quit (Remote host closed the connection)
16:47:09PMunchIt certainly helps compiling to C/C++ :P
16:47:22PMunchFFI in Nim is basically just telling Nim how to call C functions
16:48:02FromDiscord<Bubblie> Yeah
16:50:26FromDiscord<auxym> for c++ ffi I assume you have to use the cpp backend?
16:51:09PMunchCorrect
17:06:40NimEventerNew thread by Solomonthewise: `$` not working on custom type when imported in other modules, see https://forum.nim-lang.org/t/9050
17:11:04FromDiscord<Patitotective> if i have some type defined in the main module of my library and i want to use it on a module that is in `src/`, should i move the type from the main module to the one in `src/` or should i import the main module?
17:12:06FromDiscord<Rika> depends on you
17:12:21FromDiscord<Rika> either one works in certain circumstances
17:13:50FromDiscord<auxym> third option is to move the type into its own module, imported where its needed. Not uncommon to do that, or have a `common_types.nim` module with all shared types, since nim doesn't have circular imports (yet)
17:16:34FromDiscord<Rika> i personally use that third option, usually named `prelude` or `common`
17:16:44FromDiscord<huantian> In reply to @NimEventer "New Nimble package! rconv": Interesting…↵Universal is kind of misleading though, I’d expect more if it was truly universal
17:17:18FromDiscord<Patitotective> In reply to @Rika "i personally use that": only `common.nim`?
17:17:22FromDiscord<Rika> yes
17:17:37FromDiscord<Rika> because i do not only put types there
17:19:35FromDiscord<Patitotective> also, for nim modules, should i use camel or snake case?
17:23:33FromDiscord<Rika> snake
17:23:44FromDiscord<Rika> i believe it is snake
17:32:26PMunchNo, it's camel
17:32:34PMunchOh wait, for modules..
17:32:45PMunchThose tend to just be all lowercase
17:32:51PMunchBut most are a single word
17:36:29FromDiscord<Patitotective> In reply to @PMunch "Those tend to just": well, if you say so
17:36:36FromDiscord<Patitotective> (edit) removed "well,"
18:08:38*ltriant quit (Ping timeout: 272 seconds)
18:09:49FromDiscord<frobnicate> btw why isn't `--implicitStatic:on` default?
18:15:27FromDiscord<Rika> what does that do?
18:15:47FromDiscord<Rika> `--implicitStatic:on|off turn implicit compile time evaluation on|off`
18:15:58FromDiscord<Rika> i dont know probably buggy/experimental in some way
18:18:29FromDiscord<Solitude> wtf, first time i see that flag
18:20:33FromDiscord<huantian> Maybe backwards compat?
18:25:48FromDiscord<Solitude> looking at the code, it is implicitly on
18:26:57FromDiscord<frobnicate> huh, I was led to believe that it wasn't because it doesn't work with the `compileTime` pragma
18:27:10FromDiscord<auxym> @ElegantBeef thanks for that pointer tutorial you linked yesterday, learned about the gcref/gcunref trick
18:27:19FromDiscord<frobnicate> Then again I'm looking at 3 year old stuff but it's the only I could find
18:27:49FromDiscord<Solitude> no clue, what are you talking about
18:28:12FromDiscord<Solitude> (edit) "clue," => "clue"
18:30:31FromDiscord<frobnicate> https://stackoverflow.com/questions/54766274/how-to-make-a-proc-available-compile-time-and-run-time
18:35:08FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3TDt
18:36:04FromDiscord<Solitude> just call it with `static` if you need to force it to run at compiletime
18:40:44FromDiscord<frobnicate> In reply to @Solitude "just call it with": Well it was to avoid having to do static and leave it up to the compiler. But if you say it's on, I trust you
18:41:16FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3TDv
18:41:17FromDiscord<frobnicate> also that post was like 3 years old so
18:41:34FromDiscord<frobnicate> I was just playing around with features
18:42:35FromDiscord<Solitude> In reply to @frobnicate "Well it was to": you can look for yourself, the only time the flag mentioned in compiler is for early return from compiletime optimisation
18:44:07FromDiscord<Solitude> but maybe im misunderstanding direction of logic there
18:47:32FromDiscord<Solitude> nah, im wrong, it isnt enabled by default
18:50:43FromDiscord<Rika> In reply to @huantian "Hm does overloading with": i would assume so, and i believe it does; the stdlib uses it
18:50:47FromDiscord<Rika> but not in that form
18:51:57FromDiscord<Solitude> sent a code paste, see https://play.nim-lang.org/#ix=3TDx
19:01:36FromDiscord<salt> sent a code paste, see https://play.nim-lang.org/#ix=3TDB
19:01:54FromDiscord<salt> (edit) "https://play.nim-lang.org/#ix=3TDB" => "https://play.nim-lang.org/#ix=3TDC"
19:01:58FromDiscord<Rika> static Size required
19:02:04FromDiscord<salt> (edit) "https://play.nim-lang.org/#ix=3TDC" => "https://play.nim-lang.org/#ix=3TDD"
19:02:14FromDiscord<Rika> hence you cannot use let as well
19:02:52FromDiscord<salt> const?
19:03:10FromDiscord<Solitude> yas
19:03:40FromDiscord<Rika> yes that works
19:04:03FromDiscord<salt> sent a code paste, see https://play.nim-lang.org/#ix=3TDF
19:05:42FromDiscord<Rika> huh
19:06:14FromDiscord<Rika> if i change it to `size[0]` and [1] it works
19:06:15FromDiscord<Rika> huuuuuuuuh
19:06:24FromDiscord<Rika> probably something about field access then no?
19:07:37FromDiscord<salt> doesn't like a named tuple there? i dunno, i'm new to nim and just exploring
19:09:37FromDiscord<salt> sent a code paste, see https://play.nim-lang.org/#ix=3TDG
19:10:16FromDiscord<wsantos> How do you guys do unittest/tdd with Nim ? how do you guys organize them also is there a way to mock/monkey patch stuff ?
19:10:33FromDiscord<Rika> exploit generics and concepts?
19:10:57FromDiscord<wsantos> Oh so "same" as in golang with interfaces, right ?
19:11:02FromDiscord<huantian> Organization isn’t reqllyvlang dependent
19:12:38FromDiscord<huantian> I’ve never been too sure how mocking works
19:35:05PMunch@wsantos, lot of different ways to do it
19:36:51PMunchHowever with the very strict type system it's not that useful to write too many tests. Write ones that shows positive and negative use-cases, if you want to mock something you can use patchFile: https://nim-lang.org/docs/nimscript.html#patchFile%2Cstring%2Cstring%2Cstring or something similar.
19:37:14FromDiscord<Solitude> In reply to @Rika "probably something about field": think beef fixed it in devel
19:39:16FromDiscord<Rika> okay nice to know
19:39:53FromDiscord<frobnicate> In reply to @wsantos "How do you guys": I just use the standard `nimble test` stuff and do a file for each module
19:51:45*mahlon quit (Ping timeout: 252 seconds)
19:56:56*Zectbumo joined #nim
20:29:02*jjido joined #nim
20:29:23NimEventerNew thread by Alexsad: Very need to understand of locks and condition, see https://forum.nim-lang.org/t/9051
20:32:22*mahlon joined #nim
20:44:10FromDiscord<retkid> opinion
20:44:19FromDiscord<retkid> theres an open source steam game that costs $20
20:44:22FromDiscord<retkid> game more like software
20:44:32FromDiscord<retkid> theres bugs and i want to PR them
20:44:38FromDiscord<retkid> (edit) "them" => "them, but its developed by a big company"
20:44:50FromDiscord<retkid> should i spent time fixing their shit, when they aren't paying me and are a larger company
20:45:08FromDiscord<retkid> its also in... go...
20:45:40FromDiscord<spoon> do you need it fixed/do they offer bounties
20:46:02FromDiscord<retkid> I don't need it but its bugs and qol
21:00:29*noeontheend joined #nim
21:00:31*pro quit (Quit: pro)
21:10:00FromDiscord<Alea> is there any speed difference between using var and let for data that's going to be called a lot?
21:10:24PMunchShouldn't be
21:10:33PMunchUnless the C compiler manages some optimisation on it
21:10:38PMunchBut I don't think that happens
21:14:07*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!>)
21:18:32FromDiscord<auxym> is there even a difference in the emitted C code between var and let? I didn't think so, except for var params which always use a hidden pointer
21:21:58*ltriant joined #nim
21:30:31FromDiscord<Goat> sent a code paste, see https://play.nim-lang.org/#ix=3TE9
21:31:21PMunch@auxym, there might be a different in how they are passed around in certain cases
21:35:18FromDiscord<retkid> does Nim compile to c++
21:35:24FromDiscord<retkid> or well
21:35:25FromDiscord<retkid> can
21:35:51PMunchYpu
21:35:54PMunchYup*
21:36:11FromDiscord<Freyr> btw retkid was it aseprite on steam you were talking about earlier?
21:36:13FromDiscord<retkid> If i have a job where i have to write c++ do you think I can pass of my C++ as not written by the nim compiler
21:36:21FromDiscord<retkid> In reply to @Equinox "btw retkid was it": no but similar
21:36:49FromDiscord<retkid> these motherfuckers wrote a function to download webcontent but didn't actually implement a seralization method for it
21:37:03FromDiscord<retkid> so when you save the project it just panics
21:37:09FromDiscord<retkid> because the url obviously cant be opened
21:37:12FromDiscord<retkid> (edit) "opened" => "opened, its not a file"
21:37:47FromDiscord<retkid> now do I make it write the file to disk and not ram, or just make it so you need to write it to ram every time you load a project 🤔 \
21:40:19*noeontheend quit (Ping timeout: 260 seconds)
21:40:49*PMunch quit (Quit: leaving)
21:42:55*wyrd quit (Ping timeout: 240 seconds)
21:44:42*noeontheend joined #nim
21:49:54*wyrd joined #nim
21:52:09FromDiscord<spoon> hm?
21:55:41FromDiscord<auxym> In reply to @retkid "If i have a": 100% no. lol.
21:56:11FromDiscord<retkid> In reply to @auxym "100% no. lol.": sad
21:56:12FromDiscord<retkid> :(
21:56:20FromDiscord<retkid> i dont wanna write c++
21:57:20FromDiscord<auxym> yeah well you're preaching to the choir 😉
21:58:03FromDiscord<spoon> what makes it unreadable? is it just the var names being stripped and its minified?
21:58:09FromDiscord<spoon> havent read converted code
21:59:28*Zectbumo quit (Remote host closed the connection)
22:00:15FromDiscord<auxym> well you can look at your local .cache/nimcache right now for the generated .c / .cpp files. Nim uses a bunch of macros for its types (NU16, NISTRING, etc), generates a bunch of vars and typedefs with random names for internal purposes, etc. its code output was never meant or designed to be consumed by a human.
22:00:38FromDiscord<spoon> yea that makes sense
22:01:49FromDiscord<retkid> In reply to @auxym "well you can look": niether were animals yet we still eat them
22:01:52FromDiscord<retkid> (edit) "niether" => "neither"
22:02:25FromDiscord<spoon> asked in #gamedev earlier but right now i want to make a proc or a method part of an object and preferably make it optional/make its default value null or something similar
22:02:44FromDiscord<retkid> ez pz
22:02:47FromDiscord<retkid> but i dont remember how
22:02:54FromDiscord<auxym> here's a random one (C backend) from my nimcache; https://pastebin.com/w9YydyMR
22:03:10FromDiscord<retkid> static N_INLINE(void, writeOOZOOZOOZOOZOnimbleZpkgsZpicostdlib4535config45fileZpicostdlibZtusb_684)(NU8 itf, NimStringV2 s);
22:03:14FromDiscord<retkid> nah i totally understand this
22:03:16FromDiscord<retkid> what you mean
22:03:22FromDiscord<retkid> yea writeOOZOOZOOZOOZOnimbleZpkgsZpicostdlib4535config45fileZpicostdlibZtusb_684
22:03:43FromDiscord<spoon> yea, i tried but i dont know the syntax, but didnt complain when i made it type proc
22:04:00FromDiscord<retkid> i would make a proc to instantiate the class
22:04:03FromDiscord<spoon> couldnt find any guides or examples online though
22:04:10FromDiscord<retkid> and if x then y = nil
22:04:54FromDiscord<auxym> In reply to @spoon "asked in <#706542664643772436> earlier": consider using std/options
22:04:57FromDiscord<spoon> well my goal is just to have weapons have the ability to have custom effects/make scriptable mod weapons that can make use of it down the line
22:05:17FromDiscord<retkid> ah
22:05:18FromDiscord<spoon> wanna see if nimscript works out
22:05:35FromDiscord<retkid> oddly enough I know how i would do that with C++
22:05:48FromDiscord<retkid> but not Nim
22:05:56FromDiscord<spoon> In reply to @auxym "consider using std/options": i tried making the argument an Option[proc] but the initialization got mad at me
22:06:00FromDiscord<retkid> so
22:06:01FromDiscord<spoon> not entirely sure how to use it
22:06:14FromDiscord<retkid> you can instantiate procs with this syntax
22:06:38FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3TEi
22:06:39FromDiscord<retkid> like you might see in nimpy code
22:06:46FromDiscord<retkid> but i dont know if you can cast a proc to it without macros
22:06:49FromDiscord<retkid> the solution is probably macros
22:07:17FromDiscord<spoon> alternatively i can just make a weapon/specialweapon object and have them seperate
22:07:25FromDiscord<spoon> instead of using options
22:07:35FromDiscord<retkid> @Rika feel like they'd be good at this
22:07:37FromDiscord<spoon> just need to figure out procs in objects
22:08:12FromDiscord<retkid> I would like nim's objects to be fleshed out
22:08:19FromDiscord<retkid> but also remain optionally minimal
22:09:14FromDiscord<spoon> yea, i dont need much from them
22:10:13FromDiscord<auxym> In reply to @spoon "not entirely sure how": this seems to work: https://play.nim-lang.org/#ix=3TEj
22:10:14FromDiscord<spoon> where do you think they need improvement
22:10:40FromDiscord<spoon> as long as libraries dont start turning into java
22:11:01FromDiscord<retkid> init functions
22:11:08FromDiscord<retkid> it does stuff on instanciation
22:11:13FromDiscord<retkid> (edit) "instanciation" => "instantiation"
22:11:19FromDiscord<retkid> default properties, etc
22:11:30FromDiscord<spoon> hmm
22:11:47FromDiscord<retkid> static types
22:11:50FromDiscord<retkid> i dont think they exist?
22:11:52FromDiscord<spoon> In reply to @retkid "init functions": does nim have constructors and deconstructors?
22:12:08FromDiscord<retkid> nope
22:12:21FromDiscord<spoon> In reply to @auxym "this seems to work:": not sure i get it
22:12:28FromDiscord<retkid> unless they do...
22:12:53FromDiscord<retkid> you gotta make your own
22:12:56FromDiscord<retkid> but its like kinda weird
22:12:58FromDiscord<retkid> idk
22:13:00FromDiscord<spoon> yea, i think theres =destroy
22:13:21FromDiscord<spoon> https://nim-lang.org/docs/destructors.html
22:13:26FromDiscord<spoon> this?
22:13:44FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3TEk
22:13:50FromDiscord<retkid> because you had to write the proc seperately
22:14:32FromDiscord<auxym> In reply to @spoon "not sure i get": the point was that you can call `some` on a proc to make it into an `Option[T]` (in this case `Option[Cb]` , see the Cb typedef
22:15:04FromDiscord<spoon> ah
22:15:35FromDiscord<auxym> alternatively, `none[Cb]` would be used to signify no value
22:16:31FromDiscord<spoon> hm, ok
22:16:43*ltriant_ joined #nim
22:17:28FromDiscord<spoon> main problem i think i'm having is i have an object, it has variables and a proc, how do i define that proc when i initialize the object
22:18:10*ltriant quit (Ping timeout: 272 seconds)
22:19:07FromDiscord<auxym> if you change the proc for `Option[YourProcType]` it defaults to `none`.
22:19:18FromDiscord<auxym> otherwise iirc it defaults to nil
22:20:35FromDiscord<auxym> you can have a look at the std/streams module that uses this pattern a lot (procs as an object member). no with options but with nil checks: https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/streams.nim#L1
22:21:59FromDiscord<spoon> alright, i'll test something real quick
22:22:28*kipukun joined #nim
22:24:59FromDiscord<spoon> added a quick test "onHit" proc to my player object that takes an enemy as an argument, added it to my attack function and it didn't like that https://media.discordapp.net/attachments/371759389889003532/957767216886079538/unknown.png
22:25:41FromDiscord<spoon> wait nvm one sec
22:25:56FromDiscord<spoon> forgot to make it public
22:28:33*sagax quit (Quit: Konversation terminated!)
22:28:59FromDiscord<spoon> okay, it works!
22:29:23FromDiscord<spoon> looking at that helped, thanks
22:31:03FromDiscord<auxym> you can check for nil with isNil btw, if you want to make that proc optional and check if it's set
22:31:25FromDiscord<spoon> sent a code paste, see https://play.nim-lang.org/#ix=3TEs
22:31:27FromDiscord<spoon> here's a brief version for lurkers
22:31:31FromDiscord<spoon> lol
22:32:34FromDiscord<spoon> yea, i'll make sure to use that
22:41:44FromDiscord<spoon> syntax is pretty easy in hindsight
22:41:47FromDiscord<creikey> > Reads up to size bytes from socket into the result.↵↵I'm not sure I really understand what the nim documentation means by this part of `recv`. Will it block until all of those bytes are read in size?
22:42:00FromDiscord<creikey> https://nim-lang.org/docs/net.html#recv%2CSocket%2Cint%2Cint from this
22:42:34FromDiscord<creikey> I think for buffered sockets it waits until all of the data is received is what it means
22:49:51*noeontheend quit (Ping timeout: 260 seconds)
22:50:56FromDiscord<Elegantbeef> Yes↵(@creikey)
22:51:02FromDiscord<Elegantbeef> Until data is read or timeout is achieved
22:51:15FromDiscord<Elegantbeef> @auxym\: glad to hear it wasnt pointless 😀
22:51:25FromDiscord<creikey> I'm assuming it works the same with python so I can send data between the two like this
22:51:35FromDiscord<creikey> maybe I should just be using http
22:51:47FromDiscord<Elegantbeef> What are you doing?
22:52:03FromDiscord<creikey> sending hundreds of kilobytes of json between two computers through a relay server
22:52:16FromDiscord<creikey> one of the codebases is in python the other in nim
22:53:25FromDiscord<Elegantbeef> Ok generally what i do is prefix the message with length
22:53:41FromDiscord<creikey> yeah that seems to be what everybody does
22:53:47FromDiscord<creikey> I'm not super sure about what's actually going on though
22:53:55FromDiscord<Elegantbeef> What do you mean?
22:53:58FromDiscord<creikey> if I do recv(1289129) does it like send the data in a bunch of tcp packets
22:54:00FromDiscord<creikey> like split up
22:54:21FromDiscord<Elegantbeef> I believe it does, depends on the socket setup i think
22:55:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3TEt
22:56:08FromDiscord<Elegantbeef> This way you send messages packs of 1024 but your `sock.recv` will block until you get it all or it times out
22:56:13FromDiscord<creikey> sent a code paste, see https://play.nim-lang.org/#ix=3TEu
22:56:41FromDiscord<Elegantbeef> I dont know the difference much i just use sockets and if they work i'm happy 😛
22:56:41FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/957775196067086466/image.png
22:56:55FromDiscord<Elegantbeef> Well there you go
22:57:06FromDiscord<creikey> I'm very much not sure if python does the same thing though with sendv
22:57:14FromDiscord<Elegantbeef> Well test
22:57:17FromDiscord<creikey> it seems like jester for a web server seems very complicated though
22:57:38FromDiscord<Elegantbeef> Send a super large message from python to a buffered nim socket and if it gets it all it does
22:59:32FromDiscord<Elegantbeef> I'd imagine python is buffered just cause it's a high level thing
23:39:54FromDiscord<dom96> In reply to @creikey "> Reads up to": for buffered sockets, yes
23:40:14FromDiscord<dom96> See the following line in the docs: "For buffered sockets this function will attempt to read all the requested data"
23:40:33FromDiscord<dom96> the reason the docs say "up to" is because the socket might get closed during a recv
23:40:41FromDiscord<dom96> so you might get less
23:48:39Amun-Rado I get right from nim standpoint there's no difference between those two functions? https://play.nim-lang.org/#ix=3TEH
23:48:50FromDiscord<Elegantbeef> @pietroppeter\: for nimib is there a way to get the `nbCode` to gensym symbols so you can reuse variable/procedure names without manually annotating `gensym`?
23:49:53Amun-Raok, these are identical, https://godbolt.org/z/sb1exaecc
23:50:49FromDiscord<Elegantbeef> Damn it
23:50:54FromDiscord<Elegantbeef> I was going to send the godbolt link
23:50:56FromDiscord<Elegantbeef> Shame! 😛
23:51:37Amun-Ra:>
23:51:53FromDiscord<Elegantbeef> Took me longer to figure out how to share it than i'd like to admit
23:52:11*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
23:52:22Amun-Ra;)