<< 17-06-2022 >>

00:24:08*vicfred quit (Quit: Leaving)
01:59:24NimEventerNew thread by Mardiyah: Have a nim tool in nimble installation error, see https://forum.nim-lang.org/t/9240
03:03:26FromDiscord<K.io.S> Hey guys is there any way to use custom allocators in nim?
03:04:24FromDiscord<Elegantbeef> https://forum.nim-lang.org/t/7588
03:37:32*arkurious quit (Quit: Leaving)
04:08:01FromDiscord<ripluke> how can i delete the contents of a file to _n_ lines if the number of lines in the file is greater than _n_
04:12:33NimEventerNew Nimble package! splitmix64 - Tiny random number generator., see https://github.com/IcedQuinn/splitmix64
05:07:25FromDiscord<demotomohiro> @ripluke Read first n lines of the file, reopen it as write mode and overwrite it.
05:10:34FromDiscord<ripluke> Oh
05:15:13FromDiscord<demotomohiro> It seems opening a file with `fmWrite` is the only way to delete content of the file: https://nim-lang.org/docs/io.html
05:16:05FromDiscord<demotomohiro> I cannot file other procs that delete content of a file.
05:33:07*rockcavera quit (Remote host closed the connection)
05:39:36FromDiscord<ynfle> Try `writeFile` with contents being empty string
05:39:45FromDiscord<ynfle> How else do you expect to do it?
05:40:08FromDiscord<ripluke> In reply to @ynfle "Try `writeFile` with contents": Doesn't work
05:40:20FromDiscord<ripluke> What I did is I used exCmd and sed
05:42:11FromDiscord<ynfle> In reply to @ripluke "Doesn't work": I just tested it and it worked
05:44:15FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=40kU
05:45:06FromDiscord<ynfle> In reply to @ripluke "What I did is": If you are using sed then you can just read the file in with nim and write it out. That's what sed does
05:45:13FromDiscord<ynfle> Unless it's many lines
05:49:36FromDiscord<ripluke> In reply to @ynfle "If you are using": That's what I did
06:01:31*PMunch joined #nim
07:06:12*ltriant quit (Ping timeout: 276 seconds)
08:08:56*matt_1337 quit (Quit: Ping timeout (120 seconds))
08:09:13*matt_1337 joined #nim
08:22:42PMunchJust tried out tpix in kitty, pretty neat stuff
08:23:01FromDiscord<Elegantbeef> feh is dead
08:23:24PMunchThis might actually be the final straw for feh for me
08:23:33PMunchfeh can be annoying sometimes
08:36:30madpropsfor image viewing?
08:36:34madpropsi use gwenview
08:36:43madpropsbut if i want to display an image with no other ui elements i run feh
08:36:51FromDiscord<Elegantbeef> Yea but you could view insidie your terminal!
08:37:02FromDiscord<Elegantbeef> tpix + kitty lets you do that
08:37:26madpropsnah, you'd have to resize/maximize terminal to view images nicely
08:37:33madpropsi often resize my image viewers
08:37:40madpropsnot the job of a terminal
08:37:52madpropsalso gwenview can crop, which i use very often
08:37:54FromDiscord<Elegantbeef> Hey dont look at me pmunch is the one that likes it
08:39:14FromDiscord<sealmove> Can someone activate my forum account? I didn't receive a mail.
08:41:03PMunchmadprops, well for just having a quick look at an image it works pretty well
08:41:37madpropsalso another big thing is that i double click the images. you spawn a terminal on double click?
08:41:54PMunchI typically have my terminal either full or half screen anyways (as I'm using a tiling WM)
08:42:03PMunchDouble click in the file explorer?
08:42:08madpropsyeah
08:42:13PMunchI very seldom do that
08:42:23PMunchI spend most of my time in the terminal :P
08:42:29madpropsyou get thumbnails in ranger or whatever?
08:42:42PMunchThis is mostly to replace `devour feh <image>`
08:43:02PMunchI have an image viewer for that kind of use as well, for whenever I want to go full GUI mode
08:43:27madpropswhich one?
08:43:35PMunchUhm
08:43:59madpropsyou mean like a library?
08:44:10PMunchEog apparently
08:44:14madpropseye of gnome
08:44:18PMunchSome Gnome Image Viewer thing
08:44:20PMunchRight
08:44:30PMunchIt varies between my systems
08:44:44madpropsi suggest gwenview, it's very handy
08:44:53madpropsyou can crop, resize, view info
08:45:11madprops"remove red eyes" (i never use that)
08:45:18PMunchHmm, sounds useful
08:45:29PMunchI just run Gimp whenever I need to do stuff like that
08:45:35PMunch@sealmove, what's your nick?
08:45:42FromDiscord<sealmove> "sealmove"
08:46:03PMunchDone
08:46:15FromDiscord<sealmove> thanks!!!
08:47:07PMunchHaven't you got a forum account until now?
08:51:29FromDiscord<sealmove> At some point I did. I forgot what exactly happened but the username "sealmove" got stuck and I couldn't (re)claim it, so after some attempts I gave up and forgot about it. Fast-forward some years, today it just worked : )
08:56:54PMunchAah I see
08:59:36FromDiscord<sealmove> Question: How satisfactory is the result of Nim ---> C --- emscripten ---> wasm? Would Nim benefit from a native wasm backend?
08:59:49FromDiscord<Elegantbeef> It works
09:00:04FromDiscord<Elegantbeef> You can also try nlvm
09:00:40FromDiscord<Elegantbeef> I've toyed with a native WASM runtime and it seems fine to use Nim with it
09:01:42FromDiscord<sealmove> Is your experimentation uploaded somewhere? :)
09:01:59FromDiscord<Elegantbeef> https://github.com/beef331/aiarena/blob/master/aimodules/flytocenter.nim
09:11:56FromDiscord<sealmove> Thanks Elegantbeef. Trying to find the package "wasmedge" which you import :> Looks like it's not in in packages.json
09:12:20FromDiscord<Elegantbeef> https://github.com/beef331/wasmedge_playground
09:23:32FromDiscord<sealmove> so here https://github.com/beef331/wasmedge_playground/blob/master/src/wasmedge.nim you create a wasi module out of Nim AST?
09:23:58FromDiscord<Elegantbeef> That's me wrapping the WASMEdge API
09:24:37FromDiscord<Elegantbeef> https://github.com/beef331/wasmedge_playground/blob/master/wasmsources/config.nims is the magic that generates the `.wasm` file
09:26:17FromDiscord<Elegantbeef> It just uses emscripten to compile the C code to WASM
09:26:18FromDiscord<sealmove> I see. Basically you can load wasm files with Nim and execute functions defined in them by wrapping wasmedge
09:26:42FromDiscord<sealmove> Yeah I was talking about compiling Nim to wasm directly, and whether it's worth the trouble
09:26:44FromDiscord<Elegantbeef> WASMedge is a wasm runtime so you can use it like any other interpreter
09:26:59FromDiscord<Elegantbeef> I dont see the benefit
09:27:04FromDiscord<Elegantbeef> Given nlvm and emscripten exist
09:28:34FromDiscord<d4rckh> how do i convert a string to a json string so i can set properties of my json nodes to it?↵myjsonnode["key"] = "hello"
09:28:37FromDiscord<sealmove> I see. I suppose LangX -> llvm -> wasm is the typical way anyway
09:28:57FromDiscord<Elegantbeef> `newJString("hello")`
09:29:01FromDiscord<d4rckh> thanks
09:29:30FromDiscord<sealmove> Do you know how tinygo does it?
09:29:47FromDiscord<Elegantbeef> What's a tinygo
09:30:31FromDiscord<sealmove> tinygo is a golang compiler which targets architectures of embedded devices and also webassembly
09:30:44FromDiscord<Elegantbeef> Ok
09:30:59FromDiscord<Elegantbeef> The answer is clearly no
09:32:24FromDiscord<Phil> sent a long message, see https://paste.rs/JiH
09:32:42FromDiscord<Elegantbeef> That's how pointers work yes
09:33:05FromDiscord<Phil> Okay I still don't know why my prologue webserver is this damn slow for uploading 400 mb files locally
09:33:21FromDiscord<Phil> I thought maybe it was copying around the 400mb file in memory left and right
09:33:56FromDiscord<Elegantbeef> Profilers exist
09:34:07FromDiscord<Elegantbeef> Dont just throw darts and hope to reason the code into submission
09:34:23FromDiscord<Rika> Maybe it is copying it
09:34:47FromDiscord<Rika> (edit) "is" => "is"
09:40:36FromDiscord<xflywind> https://forum.nim-lang.org/t/4670
09:40:50FromDiscord<xflywind> https://github.com/planety/prologue/issues/103
09:42:05FromDiscord<sealmove> I think tinygo indeed does go -> llvm -> wasm
09:45:14FromDiscord<xflywind> In reply to @Isofruit "Okay I still don't": It seems to be a common problem for frameworks based asynchttpserver and httpbeast: https://forum.nim-lang.org/t/5829 I'm going to wrap/rewrite h2o after fixing the vm bugs (https://github.com/nim-lang/Nim/pull/19902)
09:45:53FromDiscord<Phil> In reply to @flywind "It seems to be": You mean general issue regarding large file uploads?
09:46:37FromDiscord<xflywind> Bugs/features with asynchttpserver and std/asyncfile
09:46:42FromDiscord<xflywind> (edit) "Bugs/features with" => "Bugswith"
09:46:45FromDiscord<xflywind> (edit) "Bugswith" => "Bugs with"
09:48:09FromDiscord<xflywind> asynchttpserver loads big files into memory at once instead of streaming it.
09:48:20FromDiscord<pruno> sent a code paste, see https://play.nim-lang.org/#ix=40li
09:51:59FromDiscord<Phil> sent a long message, see https://paste.rs/g4x
09:52:55FromDiscord<Phil> Actually, allow me to write an issue for this, I've been researching this problem for upwards of 3 hours now and any response I might get is one that others likely would also want
09:55:06*vicecea quit (Remote host closed the connection)
09:55:37*vicecea joined #nim
09:56:12FromDiscord<vindaar> sent a code paste, see https://paste.rs/ui3
09:57:50FromDiscord<pruno> In reply to @vindaar "I don't think such": Oh i though something existed, thanks :)
10:00:24FromDiscord<xflywind> In reply to @Isofruit "Hmmm could this possibly": It is probably the timeout of nginx such as `proxy_send_timeout` default is 60s
10:00:33FromDiscord<xflywind> (edit) "In reply to @Isofruit "Hmmm could this possibly": It is probably ... the" added "caused by"
10:01:23FromDiscord<xflywind> The big file repsonse is slow so nginx close the connect
10:01:26FromDiscord<Phil> In reply to @flywind "It is probably caused": Ohhhhhhhhhh that might be it. I contemplated timeout being an issue, but discarded that idea believing that ` keepalive_timeout 600;` would take care of that for me
10:03:10FromDiscord<Phil> Alright, let's set that to 600 as well and see what happens
10:03:28FromDiscord<xflywind> In reply to @Isofruit "Ohhhhhhhhhh that might be": I see
10:08:22FromDiscord<Phil> Alright, running a direct HTTP Post request through postman uploaded the file in ~120 seconds
10:08:31FromDiscord<Phil> (edit) "Alright, running a direct HTTP Post request through postman uploaded the file ... in" added "(440 Mb)"
10:10:49FromDiscord<sealmove> @ElegantBeef are you aware of fermyon's spin framework? I am thinking adding Nim support.
10:11:14FromDiscord<sealmove> https://github.com/fermyon/spin
10:12:08FromDiscord<sealmove> After digging in, my understanding is that it going back before the container era and does what JVM did in the old times where you had 1 tomcat server and many .war with servlets
10:12:25FromDiscord<sealmove> Only this time you have a wasm runtime instead of jvm, and .wasm files instead of .war
10:12:58FromDiscord<sealmove> It's super easy to use, I've tried it with golang and fell in love
10:16:31FromDiscord<sealmove> In reply to @รєคɭ๓๏שє "After digging in, my": Of course they compare it to FaaS but it's basically the same as JVM + servelts done better. Wasm gives you the desired level of isolation without having to use a whole docker container for each microservice (you use a .wasm file instead).
10:28:58FromDiscord<d4rckh> `output.data[name & "::" & "text"] = enContents`
10:29:06FromDiscord<d4rckh> I think this is causing an illegal storage access
10:29:17FromDiscord<d4rckh> output.data is a jsonNode and enContents is a jstring
10:30:50FromDiscord<d4rckh> oops didnt initialize it
10:41:56FromDiscord<NullCode> me when i come back for help
10:42:15FromDiscord<NullCode> is there a way to send files via puppy's post request?
10:42:22FromDiscord<NullCode> https://github.com/treeform/puppy
10:42:35FromDiscord<NullCode> https://media.discordapp.net/attachments/371759389889003532/987306257473998948/unknown.png
10:42:42FromDiscord<NullCode> the body object is a string
10:42:51FromDiscord<NullCode> so was wondering
10:43:54FromDiscord<xflywind> no, use libcurl nim instead
10:44:10FromDiscord<xflywind> (edit) removed "nim"
10:44:23FromDiscord<NullCode> on nim?
10:44:46FromDiscord<NullCode> https://github.com/Araq/libcurl
10:44:46FromDiscord<NullCode> found it
10:45:07FromDiscord<NullCode> can i static link libcurl like this thoug
10:45:12FromDiscord<NullCode> (edit) "thoug" => "though"
10:45:21FromDiscord<NullCode> https://media.discordapp.net/attachments/371759389889003532/987306954219208744/unknown.png
10:47:20FromDiscord<NullCode> the source itself looks for a dll xd https://media.discordapp.net/attachments/371759389889003532/987307448517931028/unknown.png
10:55:17FromDiscord<gigachad> hi
10:55:31FromDiscord<🌈 comet 🌈> also hi
10:55:42FromDiscord<🌈 comet 🌈> hi five
10:55:57FromDiscord<🌈 comet 🌈> @gigachad
10:56:26FromDiscord<gigachad> oi
10:56:53FromDiscord<🌈 comet 🌈> oi only auzzies can say oi
10:57:22FromDiscord<gigachad> ok mate
10:57:33FromDiscord<🌈 comet 🌈> https://tenor.com/view/aussie-oi-aussie-aussie-aussie-oi-oi-oi-chant-national-chant-gif-16140009
10:58:51FromDiscord<gigachad> lmao
10:59:17FromDiscord<gigachad> hmm i wonder if there is a nim to fabric mod library hehehehe
10:59:27FromDiscord<🌈 comet 🌈> yeah i want that
11:00:08FromDiscord<🌈 comet 🌈> quick google search came up with nothing and i'm not bothered enough to do any actual research
11:00:32FromDiscord<🌈 comet 🌈> i wanna make mc mods in nim :')
11:01:09FromDiscord<gigachad> same
11:01:18FromDiscord<gigachad> it would make life so much easier
11:01:35FromDiscord<🌈 comet 🌈> in fabric cuz i just don't prefer forge
11:01:45FromDiscord<🌈 comet 🌈> i just like fabric better idk why
11:04:01FromDiscord<gigachad> quilt cooler
11:04:14FromDiscord<gigachad> + quilt has a way more powerful API
11:06:14FromDiscord<🌈 comet 🌈> idk
11:06:37FromDiscord<gigachad> quilt is a fabric fork lol
11:06:49FromDiscord<🌈 comet 🌈> this is a dumb reason but: i won't use quilt until curseforge supports it
11:07:14FromDiscord<🌈 comet 🌈> no quilt https://media.discordapp.net/attachments/371759389889003532/987312460828663878/unknown.png
11:07:20FromDiscord<gigachad> it does already + modrinth better
11:07:38FromDiscord<🌈 comet 🌈> i'm talking about the curseforge app
11:07:41FromDiscord<gigachad> dk about launcher tho
11:07:46FromDiscord<gigachad> get a better launcher lmao
11:07:49FromDiscord<gigachad> modrinth is better
11:07:58FromDiscord<🌈 comet 🌈> jokes on u
11:08:58FromDiscord<🌈 comet 🌈> In reply to @gigachad "modrinth is better": atleast curseforge is in beta https://media.discordapp.net/attachments/371759389889003532/987312895031398470/unknown.png
11:09:18FromDiscord<gigachad> lmao it doesnt mean it doesnt work
11:09:22FromDiscord<gigachad> it works great
11:10:10FromDiscord<🌈 comet 🌈> In reply to @gigachad "it works great": then where download?
11:10:19FromDiscord<🌈 comet 🌈> WHERE DOWNLOAD, B
11:10:28FromDiscord<gigachad> bottom of page
11:10:30FromDiscord<gigachad> lmao
11:10:35FromDiscord<🌈 comet 🌈> we should move this to #offtopic
11:10:42FromDiscord<gigachad> defo
11:10:43FromDiscord<d4rckh> how can i iterate key, value pairs of json nodes?
11:17:03PMunch`for key, value in myJsonNode.pairs:`
11:17:16PMunchhttps://nim-lang.org/docs/json.html#pairs.i%2CJsonNode
11:18:33FromDiscord<d4rckh> ty
11:28:49FromDiscord<Olfactory Hallucinations> In reply to @PMunch "Just tried out tpix": I am the author of tpix. Glad that you like it.
11:29:29PMunchI really like the simplicity of it, nice defaults
11:29:56PMunchCouldn't get it to show the svg that pandoc spits out for mermaid graphs though
11:30:09FromDiscord<Rika> SVGs are a different beast lol
11:30:13PMunchIt says that there's limited SVG support, but not really anything about what the limitations are
11:30:20PMunch@Rika, oh trust me, I know :P
11:30:42FromDiscord<Olfactory Hallucinations> Thanks. The main design goal of tpix was to create a image viewer that is easy to install on remote systems where you don't have root access. Though it will work just as well on your home system of course.
11:30:49FromDiscord<ripluke> How can I check if a string matches something in a sequence
11:31:07PMunch@ripluke, define something
11:31:19FromDiscord<ripluke> In reply to @PMunch "<@704106773660827690>, define something": ?
11:31:33FromDiscord<ripluke> I can send my current code lol
11:31:35FromDiscord<Olfactory Hallucinations> It can open any SVG file that Pixie can handle. I'm not sure exactly what the limits are, but for instance a plot generated by matplotlib in python will not work.
11:31:48PMunch@Olfactory_Hallucinations, ooh, I didn't even think of that. Since it's only sending base64 encoded images as normal text it would work just as well over ssh right?
11:31:58PMunchHmm, right
11:32:35FromDiscord<ripluke> sent a code paste, see https://play.nim-lang.org/#ix=40lC
11:33:28FromDiscord<ripluke> sent a code paste, see https://paste.rs/tGV
11:33:57FromDiscord<Olfactory Hallucinations> @PMunch Yes, it will work over SSH exactly like it does when running it locally
11:36:23PMunch@ripluke, and the problem is?
11:36:36FromDiscord<ripluke> In reply to @PMunch "<@704106773660827690>, and the problem": I think I got it
11:37:15FromDiscord<ripluke> Yea I got it
11:37:57FromDiscord<ripluke> sent a code paste, see https://play.nim-lang.org/#ix=40lD
11:41:02PMunchYou should be able to do `if opts.theme notin themes` as well
11:42:02FromDiscord<ripluke> Oh
11:44:40PMunch@Olfactory_Hallucinations, it would be nice if tpix would show the error message from Pixie when it fails to load an SVG
11:45:20FromDiscord<Phil> In reply to @flywind "Bugs with asynchttpserver and": Is there any way for me to avoid this btw? Does httpx not have this issue?
11:45:37PMunchTurns out the thing it doesn't like about the SVG graphs I was feeding it is that it doesn't support the `style` and `text` tags
11:45:46PMunchNot sure why it doesn't support `text`..
11:59:48FromDiscord<xflywind> In reply to @Isofruit "Is there any way": I don't think so. httpx uses string not stream too.
12:07:07FromDiscord<Phil> In reply to @flywind "I don't think so.": Awwww, so close to getting this thing deployed. I think the upload speed is pretty much the last thing that would be an issue to swap out my python backend.↵Hmmm.... maybe I'll look into using pythons encryption lib instead of nimcrypto since it's wrapper around openssl is pretty fast
12:07:34FromDiscord<Phil> (edit) "look" => "implement some other stuff in the meantime then, like looking"
12:08:19FromDiscord<Phil> ~~And yes I could wrap openssl or whatever the lib was called myself, but I can not be arsed and I don't comprehend the other crypto lib that I recall being out there~~
12:08:34FromDiscord<Phil> (edit) "there~~" => "there with a nimwrapper~~"
12:09:31FromDiscord<xflywind> In reply to @Isofruit "Awwww, so close to": openssl is shipped with Nim https://nim-lang.org/docs/openssl.html
12:10:16FromDiscord<Josef> sent a code paste, see https://play.nim-lang.org/#ix=40lK
12:10:29FromDiscord<Phil> In that case I likely screwed up the lib name. It's been a couple month, all I recall was that python had a wrapper around a really fast crypto lib in C with comprehensible function names
12:10:45FromDiscord<Phil> and was a decent chunk faster than nimcrypto
12:10:49FromDiscord<xflywind> See also nimcrypto alternative: https://github.com/status-im/nim-bearssl
12:10:50FromDiscord<Josef> (edit) "https://play.nim-lang.org/#ix=40lL" => "https://paste.rs/upT"
12:27:34PMunch`proc foo(a: pointer, b: cstring, c, d: cint): ptr bool {.dynlib, cdecl.}`
12:27:45PMunchSomething like that
12:34:39FromDiscord<Olfactory Hallucinations> In reply to @PMunch "@Olfactory_Hallucinations, it would be": Yeah, that's a good idea. I'll take a look at it.
12:35:04PMunchI assume you're just catching the exception from Pixie, the exception message contains the reason
12:38:51FromDiscord<Olfactory Hallucinations> Yeah. It shouldn't be too hard to fix.
12:40:21FromDiscord<d4rckh> using {} instead of [] on json nodes wont throw an error if the key doesnt exist, right?
12:50:04PMunchNope, it just returns nil
12:50:23PMunchhttps://play.nim-lang.org/#ix=40lU
13:01:51*ltriant joined #nim
13:06:57FromDiscord<Josef> In reply to @PMunch "`proc foo(a: pointer, b:": Why `ptr bool` instead of `bool`?
13:08:07PMunchBecause that's what the original does?
13:08:13PMunchOr did Discord mangle your message?
13:08:56PMunchAh, it did mangle it
13:09:15PMunchThen just cbool I guess
13:09:19PMunchIf that exists
13:13:18*noeontheend joined #nim
13:24:54*crem quit (Read error: Connection reset by peer)
13:25:57*arkurious joined #nim
13:31:39*noeontheend quit (Ping timeout: 276 seconds)
13:33:19FromDiscord<d4rckh> is there any way i can import everything from a folder?
13:35:44PMunchIs there a way? Yes. Is there a simple way? Not really
13:36:36PMunchThe way to do it is to write a macro which iterates all the files in the folder and outputs `import` statements
13:43:29*kayabaNerve quit (Ping timeout: 256 seconds)
13:51:26*PMunch quit (Quit: Leaving)
14:00:50FromDiscord<Phil> In reply to @flywind "openssl is shipped with": Huh, turns out it was openSSL... I still kinda can't use that because I don't understand the library and how to replicate Django's pbkdf2 hash function with it.
14:01:10*rockcavera joined #nim
14:01:10*rockcavera quit (Changing host)
14:01:10*rockcavera joined #nim
14:01:11FromDiscord<Phil> Question, how would you import python into nimcode? I want to use python's `hashlib` ... because I can understand how to use it mostly
14:01:57FromDiscord<Phil> I know of nimpy but thats kinda the wrong way round
14:02:21FromDiscord<d4rckh> sent a code paste, see https://paste.rs/AaR
14:02:40FromDiscord<d4rckh> what's wrong?
14:02:41FromDiscord<d4rckh> sent a code paste, see https://paste.rs/jz0
14:05:02FromDiscord<enthus1ast> required type for y\: openArray[T]
14:05:14FromDiscord<enthus1ast> please try @[(name\: "mytask", execute\: mytask.executeTask)]
14:09:40*noeontheend joined #nim
14:31:08*rockcavera quit (Remote host closed the connection)
14:40:06FromDiscord<xflywind> In reply to @Isofruit "Huh, turns out it": How about https://github.com/status-im/nim-bearssl It should be more friendly => https://github.com/status-im/nim-bearssl/blob/master/bearssl/abi/bearssl_kdf.nim
14:40:10*rockcavera joined #nim
14:40:10*rockcavera quit (Changing host)
14:40:10*rockcavera joined #nim
14:40:35FromDiscord<xflywind> > Applications using nim-bearssl are fully stand-alone, needing no additional DLL or shared library.
14:42:53FromDiscord<xflywind> In reply to @Isofruit "Question, how would you": see also the nim version of hashlib => https://github.com/khchen/hashlib
14:45:53FromDiscord<xflywind> Both of them are friendly C wrapper.
14:46:51FromDiscord<xflywind> (edit) "wrapper." => "wrapper and mit-licensed,"
14:50:45FromDiscord<xflywind> In reply to @Isofruit "I know of nimpy": Imo, nimpy is the only way to use Python in Nim.
14:50:45FromDiscord<Phil> sent a long message, see http://ix.io/40mi
14:51:09FromDiscord<Phil> In reply to @flywind "Imo, nimpy is the": Yeah I'm an idiot, I just saw that you can also import python into nim with it
14:51:41FromDiscord<Phil> (edit) "http://ix.io/40mi" => "http://ix.io/40mj"
14:53:27FromDiscord<xflywind> In reply to @flywind "Imo, nimpy is the": And it requires Python installed.
14:54:15FromDiscord<Phil> That is a bit of a bummer that I'll have to draw python into my docker image with it
15:04:54*LuxuryMode joined #nim
15:23:13FromDiscord<Olfactory Hallucinations> @PMunch There's an updated version of tpix with better error messages in the github repository now
15:42:42FromDiscord<Phil> In reply to @flywind "And it requires Python": I assume that whatever lib I import using numpy must be installed wherever I run the binary, correct?
15:46:43FromDiscord<d4rckh> In reply to @enthus1ast "please try @[(name\: "mytask",": When defining the task?
15:46:50FromDiscord<d4rckh> (edit) "task?" => "sequence?"
15:47:03FromDiscord<enthus1ast> when calling add
15:47:36FromDiscord<enthus1ast> or change your add to accept a tuple, not an openarray
15:47:43FromDiscord<enthus1ast> T in your case
15:50:28FromDiscord<xflywind> In reply to @Isofruit "I assume that whatever": Yeah
16:02:21*kenran joined #nim
16:05:05FromDiscord<Phil> In reply to @flywind "Yeah": Hmm bloated my docker image by ~30 mb to 80mb total. Not ideal, but it does speed up by encryption endpoint by a factor of 2-4x, so I think I'll eat the larger image size
16:06:00FromDiscord<Phil> (edit) "encryption" => "login"
16:08:52FromDiscord<xflywind> nice
16:10:33FromDiscord<Not Saucx> how can i open this? https://media.discordapp.net/attachments/371759389889003532/987388788781240410/unknown.png
16:11:36*kenran quit (Quit: WeeChat info:version)
16:18:20NimEventerNew thread by Severak: How to switch nim version for vscode extension, see https://forum.nim-lang.org/t/9241
16:21:39FromDiscord<Phil> In reply to @Not Saucx "how can i open": A csv file? Should be just plain text, so should be readable as usual
16:23:38FromDiscord<Phil> I haven't written any code that reads files in nim yet, but it should be a fairly quick affair.↵https://nim-lang.org/docs/asyncfile.html↵The asyncfile module provides a few methods for reading files
16:24:38FromDiscord<Phil> Even comes with an example at the top of the lib on how to use it
16:26:22FromDiscord<vindaar> even simpler, because there's a CSV parser in the stdlib https://nim-lang.github.io/Nim/parsecsv.html
16:28:24FromDiscord<vindaar> depending on your needs (in terms of what you need to do with the content of the file), you might benefit from using datamancer's `readCsv`
16:33:15FromDiscord<lantos> In reply to @Not Saucx "how can i open": just a casual 118GB csv file
16:33:49FromDiscord<Not Saucx> In reply to @lantos "just a casual 118GB": i have a 600gb SHA1 file
16:36:08FromDiscord<lantos> why nim for this btw? would try pandas first unless you are doing it because; fun, you want to, speed or you need to do ops using a binary
16:39:58FromDiscord<vindaar> haha, didn't even look at the image properly. Well, if you have enough RAM `readCsv` should work fine 😜
16:40:05FromDiscord<vindaar> why pandas over nim?↵(@lantos)
16:41:35FromDiscord<Phil> In reply to @vindaar "why pandas over nim?": I haven't used pandas myself, but I would assume it comes with a ton of stuff pre-implemented, meaning you need to spend less time implementing it
16:42:07FromDiscord<Phil> (edit) "it" => "stuff yourself"
16:42:24FromDiscord<Phil> But 118 gb csv?
16:42:31FromDiscord<Phil> Hot damn I overlooked that tidbit
16:42:32FromDiscord<Phil> Errr
16:43:11FromDiscord<Phil> Do we have tooling to allow partially reading in a file? Because that'd be crazy to have in RAM
16:45:27FromDiscord<lantos> https://gcloud-compute.com/m2-ultramem-416.html↵no worries, pocket change
16:45:52FromDiscord<vindaar> sure, open a stream of it, manually memmap chunks of the file, maybe `NimData`'s CSV parser is also lazy, etc.↵Aside from maybe NimData, I'm not sure if we have a CSV parser that is lazy though. Problem with that is always "do you need all data for some computation after or not?". Dealing with large data usually means it's better to write something custom that only does the stuff you actually need↵(@Phil)
16:46:06FromDiscord<lantos> In reply to @Isofruit "Do we have tooling": I was thinking he was going to write some sort of chucking to scroll through the data
16:46:20FromDiscord<Phil> Yeah, makes sense (to both of you)
16:46:20FromDiscord<lantos> In reply to @vindaar "sure, open a stream": ye this
16:46:35FromDiscord<Phil> At that size it also makes sense to use nim for the speed up
16:46:38FromDiscord<lantos> but IRC pandas has some this already?
16:46:44FromDiscord<lantos> (edit) removed "some"
16:46:48FromDiscord<Phil> Because damn I would not want to be the poor sod having to run a python script over 100 gigs of data
16:47:02FromDiscord<lantos> should be fine if you are using pandas
16:47:37FromDiscord<lantos> Actually probably the best & quickest way is to pull it into a sql table and use sql, right?
16:57:54FromDiscord<Phil> In reply to @lantos "Actually probably the best": Hmm for simple querying of the data? Probably.↵For some more elaborate stuff that isn't a simple recursive query? Not sure. I still haven't managed to write SQL that performs a recursive query to get a list of child-ids and all their parents and fetch the actual entries with that at the same time.↵SQL can be hard, man.
16:58:11FromDiscord<Phil> (edit) "with that" => "from those ids"
16:58:33FromDiscord<Phil> It would make for a neat sqlite file though
17:00:23FromDiscord<lantos> always fun smashing your head against a table to make a recursive CTE to work 🙂
17:01:37FromDiscord<lantos> SQL, all I think about is you↵Late nights in the middle of June...
17:08:58FromDiscord<Darkstepan> sent a code paste, see https://play.nim-lang.org/#ix=40mN
17:09:12FromDiscord<Darkstepan> also, where can I find docs for builtin functions?
17:10:04FromDiscord<Generic> use countup
17:10:07FromDiscord<Generic> and -1
17:10:50FromDiscord<Darkstepan> thanks
17:23:40*derpydoo joined #nim
17:28:09FromDiscord<d4rckh> In reply to @enthus1ast "or change your add": but isnt that a tuple im creating?
17:30:04FromDiscord<orenodinner> Hi , what are the most popular GUI modules?↵I believe NiGui(https://github.com/trustable-code/NiGui) is the most popular and used GUI module,↵but it does not support --thread:on. Error.↵I would like to use other GUI libraries. Do you have any recommendations?
17:31:58FromDiscord<d4rckh> In reply to @enthus1ast "please try @[(name\: "mytask",": and this did not work
17:35:14FromDiscord<d4rckh> it gives `tuple[name: string, execute: proc (socket: Socket, taskId: int, params: seq[string]){.gcsafe, locks: <unknown>.}]`↵but expects `tuple[name: string, execute: proc (socket: Socket, taskId: int, params: seq[string]){.closure.}]'`
17:35:28FromDiscord<d4rckh> (edit) "`tuple[name:" => "↵`tuple[name:" | "`tuple[name:" => "↵`tuple[name:"
17:38:20FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=40mW
17:38:25FromDiscord<d4rckh> this is also erroring telling me that: `type mismatch: got 'tuple[name: string, execute: proc (socket: Socket, taskId: int, params: seq[string]){.gcsafe, locks: <unknown>.}]' for '(name: "download", execute: executeTask)' but expected 'tuple[name: string, execute: proc (socket: Socket, taskId: int, params: seq[string]){.closure.}]'`
17:45:58*averell quit (Quit: .)
17:46:20FromDiscord<d4rckh> you cant have procs in tuples? 🤔
17:49:20FromDiscord<Rika> `execute: proc(socket: Socket, taskId: int, params: seq[string]) {.nimcall.}` should make it work i think
18:17:58*eron joined #nim
18:19:12*eron left #nim (#nim)
18:23:05FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=40n6
18:36:23FromDiscord<eyecon> In reply to @pruno "Hello, stupid question but": See `windowed` here: https://github.com/narimiran/itertools#iterutils-iterators
18:54:47FromDiscord<Phil> In reply to @flywind "I don't think so.": I come to report surprising news. It... I dunno why but it works "alright" with httpx.↵Uploaded 430mb locally (as in frontend --> nginx --> prologue all on localhost) within ~30s
18:55:14FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=40nb
19:25:38*jmdaemon joined #nim
19:26:26FromDiscord<dom96> oh cool, didn't even think about it but yeah httpbeast should do a much better job of handling streaming data
19:30:23FromDiscord<dom96> though still not ideal: it will read everything into memory before notifying you the request was received
19:32:40FromDiscord<dom96> created https://github.com/dom96/httpbeast/issues/74 to track this
19:33:04FromDiscord<dom96> nice excuse to play with the `sendfile` posix call if anyone is interested
19:50:58*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
19:52:12*jmdaemon joined #nim
20:15:47FromDiscord<Phil> I have mostly learnt that sendfile exists today because nginx mentioned that a lot in error messages
20:18:42FromDiscord<Elegantbeef> Absolutely not, it's no where near my interest 😄↵(@sealmove)
20:41:34*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
20:43:25FromDiscord<Elegantbeef> Why do you have `--forceBuild` in your command list?↵(@Phil)
20:51:14FromDiscord<Phil> In reply to @Elegantbeef "Why do you have": Primarily because it was in the command I used as blueprint, when I checked what it did it seemed reasonable to me to want to check that all the code I use actually still manages to compile upon release
21:22:09*jmdaemon joined #nim
21:24:22*kayabaNerve joined #nim
21:26:05FromDiscord<Psych0p4th.nim> hey guys, someone can tell me one lib with have the function similar the struct.pack() from python but in nim ?
21:27:22FromDiscord<Elegantbeef> flatty, frosty, streams
21:27:46FromDiscord<Elegantbeef> If you're looking for a binary formatter those are what you want
21:29:09FromDiscord<Psych0p4th.nim> on the truth i want work with raw sockets, and i need one function do pack the packets bytes
21:30:42FromDiscord<Psych0p4th.nim> this libs do this ?
21:32:17FromDiscord<Elegantbeef> streams, frosty, flatty
21:32:34FromDiscord<Psych0p4th.nim> all right, thanks beef
21:34:43*LuxuryMode quit (Quit: Connection closed for inactivity)
21:39:33FromDiscord<xflywind> In reply to @Isofruit "I come to report": lol
22:32:13*dithpri joined #nim
22:41:37*dithpri quit (Quit: '); DROP TABLE Users;--)
22:57:11*derpydoo quit (Ping timeout: 255 seconds)
23:40:31FromDiscord<🌈 comet 🌈> does anybody know of a nim api for minecraft so me and @gigachad can make minecraft mods?↵preferably fabric/quilt
23:40:48FromDiscord<gigachad> yeah would be cool
23:41:42FromDiscord<Elegantbeef> Nim is compiled to native code so you'd probably have to use JNI or w/e their FFI is
23:43:03FromDiscord<gigachad> what
23:43:08FromDiscord<gigachad> oh
23:43:11FromDiscord<gigachad> i see
23:43:20FromDiscord<gigachad> but still, is there any kind of api for this?
23:43:47FromDiscord<Elegantbeef> https://github.com/search?q=language%3Anim+minecraft
23:45:25FromDiscord<gigachad> no apis sadly
23:46:03FromDiscord<Elegantbeef> Well yea you kinda need to use java for mods
23:47:58FromDiscord<🌈 comet 🌈> so just compile it to java?
23:48:10FromDiscord<🌈 comet 🌈> that sounds ineffiecient
23:48:20FromDiscord<Elegantbeef> Have fun making the JVM backend Nim compiler
23:49:06FromDiscord<gigachad> aaaa
23:49:07FromDiscord<gigachad> what
23:49:18FromDiscord<🌈 comet 🌈> In reply to @Elegantbeef "Have fun making the": 😢
23:49:57FromDiscord<🌈 comet 🌈> can i not just steal someone else's jvm nim compiler?
23:50:12FromDiscord<🌈 comet 🌈> i don't want to make my own
23:50:16FromDiscord<Elegantbeef> It doesnt exist so no
23:51:10FromDiscord<🌈 comet 🌈> nooooooooooooooo
23:51:23FromDiscord<Elegantbeef> Well go use kotlin and cry
23:53:20FromDiscord<🌈 comet 🌈> https://github.com/yglukhov/jnim
23:53:43FromDiscord<Elegantbeef> That'd be using the JNI
23:54:03FromDiscord<🌈 comet 🌈> i don't even know what ur talking about anymore
23:54:37FromDiscord<Elegantbeef> That's how java talks to native code
23:54:41FromDiscord<Elegantbeef> https://en.wikipedia.org/wiki/Java_Native_Interface
23:54:51FromDiscord<🌈 comet 🌈> In reply to @Elegantbeef "https://en.wikipedia.org/wiki/Java_Native_Interface": https://tenor.com/view/breaking-bad-walter-white-gif-20348263
23:56:24FromDiscord<exelotl> Kotlin is a pretty nice language for when you have to target the JVM
23:56:50FromDiscord<exelotl> idk how widely used it is in Minecraft modding but I'm guessing you'll have a much better time finding help and resources for it
23:57:07FromDiscord<Elegantbeef> iirc fabric is written in kotlin and uses it's features for performance
23:58:53FromDiscord<huantian> and then they made quilt
23:59:03FromDiscord<huantian> which is fabric but better again
23:59:20FromDiscord<Elegantbeef> But but forge devs said fabric isnt better than forge! 😛
23:59:38*vicfred joined #nim
23:59:42FromDiscord<ripluke> How can I check if a file symlinks to another file?
23:59:56*kayabaNerve quit (Ping timeout: 244 seconds)