00:24:08 | * | vicfred quit (Quit: Leaving) |
01:59:24 | NimEventer | New thread by Mardiyah: Have a nim tool in nimble installation error, see https://forum.nim-lang.org/t/9240 |
03:03:26 | FromDiscord | <K.io.S> Hey guys is there any way to use custom allocators in nim? |
03:04:24 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/7588 |
03:37:32 | * | arkurious quit (Quit: Leaving) |
04:08:01 | FromDiscord | <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:33 | NimEventer | New Nimble package! splitmix64 - Tiny random number generator., see https://github.com/IcedQuinn/splitmix64 |
05:07:25 | FromDiscord | <demotomohiro> @ripluke Read first n lines of the file, reopen it as write mode and overwrite it. |
05:10:34 | FromDiscord | <ripluke> Oh |
05:15:13 | FromDiscord | <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:05 | FromDiscord | <demotomohiro> I cannot file other procs that delete content of a file. |
05:33:07 | * | rockcavera quit (Remote host closed the connection) |
05:39:36 | FromDiscord | <ynfle> Try `writeFile` with contents being empty string |
05:39:45 | FromDiscord | <ynfle> How else do you expect to do it? |
05:40:08 | FromDiscord | <ripluke> In reply to @ynfle "Try `writeFile` with contents": Doesn't work |
05:40:20 | FromDiscord | <ripluke> What I did is I used exCmd and sed |
05:42:11 | FromDiscord | <ynfle> In reply to @ripluke "Doesn't work": I just tested it and it worked |
05:44:15 | FromDiscord | <ynfle> sent a code paste, see https://play.nim-lang.org/#ix=40kU |
05:45:06 | FromDiscord | <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:13 | FromDiscord | <ynfle> Unless it's many lines |
05:49:36 | FromDiscord | <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:42 | PMunch | Just tried out tpix in kitty, pretty neat stuff |
08:23:01 | FromDiscord | <Elegantbeef> feh is dead |
08:23:24 | PMunch | This might actually be the final straw for feh for me |
08:23:33 | PMunch | feh can be annoying sometimes |
08:36:30 | madprops | for image viewing? |
08:36:34 | madprops | i use gwenview |
08:36:43 | madprops | but if i want to display an image with no other ui elements i run feh |
08:36:51 | FromDiscord | <Elegantbeef> Yea but you could view insidie your terminal! |
08:37:02 | FromDiscord | <Elegantbeef> tpix + kitty lets you do that |
08:37:26 | madprops | nah, you'd have to resize/maximize terminal to view images nicely |
08:37:33 | madprops | i often resize my image viewers |
08:37:40 | madprops | not the job of a terminal |
08:37:52 | madprops | also gwenview can crop, which i use very often |
08:37:54 | FromDiscord | <Elegantbeef> Hey dont look at me pmunch is the one that likes it |
08:39:14 | FromDiscord | <sealmove> Can someone activate my forum account? I didn't receive a mail. |
08:41:03 | PMunch | madprops, well for just having a quick look at an image it works pretty well |
08:41:37 | madprops | also another big thing is that i double click the images. you spawn a terminal on double click? |
08:41:54 | PMunch | I typically have my terminal either full or half screen anyways (as I'm using a tiling WM) |
08:42:03 | PMunch | Double click in the file explorer? |
08:42:08 | madprops | yeah |
08:42:13 | PMunch | I very seldom do that |
08:42:23 | PMunch | I spend most of my time in the terminal :P |
08:42:29 | madprops | you get thumbnails in ranger or whatever? |
08:42:42 | PMunch | This is mostly to replace `devour feh <image>` |
08:43:02 | PMunch | I have an image viewer for that kind of use as well, for whenever I want to go full GUI mode |
08:43:27 | madprops | which one? |
08:43:35 | PMunch | Uhm |
08:43:59 | madprops | you mean like a library? |
08:44:10 | PMunch | Eog apparently |
08:44:14 | madprops | eye of gnome |
08:44:18 | PMunch | Some Gnome Image Viewer thing |
08:44:20 | PMunch | Right |
08:44:30 | PMunch | It varies between my systems |
08:44:44 | madprops | i suggest gwenview, it's very handy |
08:44:53 | madprops | you can crop, resize, view info |
08:45:11 | madprops | "remove red eyes" (i never use that) |
08:45:18 | PMunch | Hmm, sounds useful |
08:45:29 | PMunch | I just run Gimp whenever I need to do stuff like that |
08:45:35 | PMunch | @sealmove, what's your nick? |
08:45:42 | FromDiscord | <sealmove> "sealmove" |
08:46:03 | PMunch | Done |
08:46:15 | FromDiscord | <sealmove> thanks!!! |
08:47:07 | PMunch | Haven't you got a forum account until now? |
08:51:29 | FromDiscord | <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:54 | PMunch | Aah I see |
08:59:36 | FromDiscord | <sealmove> Question: How satisfactory is the result of Nim ---> C --- emscripten ---> wasm? Would Nim benefit from a native wasm backend? |
08:59:49 | FromDiscord | <Elegantbeef> It works |
09:00:04 | FromDiscord | <Elegantbeef> You can also try nlvm |
09:00:40 | FromDiscord | <Elegantbeef> I've toyed with a native WASM runtime and it seems fine to use Nim with it |
09:01:42 | FromDiscord | <sealmove> Is your experimentation uploaded somewhere? :) |
09:01:59 | FromDiscord | <Elegantbeef> https://github.com/beef331/aiarena/blob/master/aimodules/flytocenter.nim |
09:11:56 | FromDiscord | <sealmove> Thanks Elegantbeef. Trying to find the package "wasmedge" which you import :> Looks like it's not in in packages.json |
09:12:20 | FromDiscord | <Elegantbeef> https://github.com/beef331/wasmedge_playground |
09:23:32 | FromDiscord | <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:58 | FromDiscord | <Elegantbeef> That's me wrapping the WASMEdge API |
09:24:37 | FromDiscord | <Elegantbeef> https://github.com/beef331/wasmedge_playground/blob/master/wasmsources/config.nims is the magic that generates the `.wasm` file |
09:26:17 | FromDiscord | <Elegantbeef> It just uses emscripten to compile the C code to WASM |
09:26:18 | FromDiscord | <sealmove> I see. Basically you can load wasm files with Nim and execute functions defined in them by wrapping wasmedge |
09:26:42 | FromDiscord | <sealmove> Yeah I was talking about compiling Nim to wasm directly, and whether it's worth the trouble |
09:26:44 | FromDiscord | <Elegantbeef> WASMedge is a wasm runtime so you can use it like any other interpreter |
09:26:59 | FromDiscord | <Elegantbeef> I dont see the benefit |
09:27:04 | FromDiscord | <Elegantbeef> Given nlvm and emscripten exist |
09:28:34 | FromDiscord | <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:37 | FromDiscord | <sealmove> I see. I suppose LangX -> llvm -> wasm is the typical way anyway |
09:28:57 | FromDiscord | <Elegantbeef> `newJString("hello")` |
09:29:01 | FromDiscord | <d4rckh> thanks |
09:29:30 | FromDiscord | <sealmove> Do you know how tinygo does it? |
09:29:47 | FromDiscord | <Elegantbeef> What's a tinygo |
09:30:31 | FromDiscord | <sealmove> tinygo is a golang compiler which targets architectures of embedded devices and also webassembly |
09:30:44 | FromDiscord | <Elegantbeef> Ok |
09:30:59 | FromDiscord | <Elegantbeef> The answer is clearly no |
09:32:24 | FromDiscord | <Phil> sent a long message, see https://paste.rs/JiH |
09:32:42 | FromDiscord | <Elegantbeef> That's how pointers work yes |
09:33:05 | FromDiscord | <Phil> Okay I still don't know why my prologue webserver is this damn slow for uploading 400 mb files locally |
09:33:21 | FromDiscord | <Phil> I thought maybe it was copying around the 400mb file in memory left and right |
09:33:56 | FromDiscord | <Elegantbeef> Profilers exist |
09:34:07 | FromDiscord | <Elegantbeef> Dont just throw darts and hope to reason the code into submission |
09:34:23 | FromDiscord | <Rika> Maybe it is copying it |
09:34:47 | FromDiscord | <Rika> (edit) "is" => "is" |
09:40:36 | FromDiscord | <xflywind> https://forum.nim-lang.org/t/4670 |
09:40:50 | FromDiscord | <xflywind> https://github.com/planety/prologue/issues/103 |
09:42:05 | FromDiscord | <sealmove> I think tinygo indeed does go -> llvm -> wasm |
09:45:14 | FromDiscord | <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:53 | FromDiscord | <Phil> In reply to @flywind "It seems to be": You mean general issue regarding large file uploads? |
09:46:37 | FromDiscord | <xflywind> Bugs/features with asynchttpserver and std/asyncfile |
09:46:42 | FromDiscord | <xflywind> (edit) "Bugs/features with" => "Bugswith" |
09:46:45 | FromDiscord | <xflywind> (edit) "Bugswith" => "Bugs with" |
09:48:09 | FromDiscord | <xflywind> asynchttpserver loads big files into memory at once instead of streaming it. |
09:48:20 | FromDiscord | <pruno> sent a code paste, see https://play.nim-lang.org/#ix=40li |
09:51:59 | FromDiscord | <Phil> sent a long message, see https://paste.rs/g4x |
09:52:55 | FromDiscord | <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:12 | FromDiscord | <vindaar> sent a code paste, see https://paste.rs/ui3 |
09:57:50 | FromDiscord | <pruno> In reply to @vindaar "I don't think such": Oh i though something existed, thanks :) |
10:00:24 | FromDiscord | <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:33 | FromDiscord | <xflywind> (edit) "In reply to @Isofruit "Hmmm could this possibly": It is probably ... the" added "caused by" |
10:01:23 | FromDiscord | <xflywind> The big file repsonse is slow so nginx close the connect |
10:01:26 | FromDiscord | <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:10 | FromDiscord | <Phil> Alright, let's set that to 600 as well and see what happens |
10:03:28 | FromDiscord | <xflywind> In reply to @Isofruit "Ohhhhhhhhhh that might be": I see |
10:08:22 | FromDiscord | <Phil> Alright, running a direct HTTP Post request through postman uploaded the file in ~120 seconds |
10:08:31 | FromDiscord | <Phil> (edit) "Alright, running a direct HTTP Post request through postman uploaded the file ... in" added "(440 Mb)" |
10:10:49 | FromDiscord | <sealmove> @ElegantBeef are you aware of fermyon's spin framework? I am thinking adding Nim support. |
10:11:14 | FromDiscord | <sealmove> https://github.com/fermyon/spin |
10:12:08 | FromDiscord | <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:25 | FromDiscord | <sealmove> Only this time you have a wasm runtime instead of jvm, and .wasm files instead of .war |
10:12:58 | FromDiscord | <sealmove> It's super easy to use, I've tried it with golang and fell in love |
10:16:31 | FromDiscord | <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:58 | FromDiscord | <d4rckh> `output.data[name & "::" & "text"] = enContents` |
10:29:06 | FromDiscord | <d4rckh> I think this is causing an illegal storage access |
10:29:17 | FromDiscord | <d4rckh> output.data is a jsonNode and enContents is a jstring |
10:30:50 | FromDiscord | <d4rckh> oops didnt initialize it |
10:41:56 | FromDiscord | <NullCode> me when i come back for help |
10:42:15 | FromDiscord | <NullCode> is there a way to send files via puppy's post request? |
10:42:22 | FromDiscord | <NullCode> https://github.com/treeform/puppy |
10:42:35 | FromDiscord | <NullCode> https://media.discordapp.net/attachments/371759389889003532/987306257473998948/unknown.png |
10:42:42 | FromDiscord | <NullCode> the body object is a string |
10:42:51 | FromDiscord | <NullCode> so was wondering |
10:43:54 | FromDiscord | <xflywind> no, use libcurl nim instead |
10:44:10 | FromDiscord | <xflywind> (edit) removed "nim" |
10:44:23 | FromDiscord | <NullCode> on nim? |
10:44:46 | FromDiscord | <NullCode> https://github.com/Araq/libcurl |
10:44:46 | FromDiscord | <NullCode> found it |
10:45:07 | FromDiscord | <NullCode> can i static link libcurl like this thoug |
10:45:12 | FromDiscord | <NullCode> (edit) "thoug" => "though" |
10:45:21 | FromDiscord | <NullCode> https://media.discordapp.net/attachments/371759389889003532/987306954219208744/unknown.png |
10:47:20 | FromDiscord | <NullCode> the source itself looks for a dll xd https://media.discordapp.net/attachments/371759389889003532/987307448517931028/unknown.png |
10:55:17 | FromDiscord | <gigachad> hi |
10:55:31 | FromDiscord | <🌈 comet 🌈> also hi |
10:55:42 | FromDiscord | <🌈 comet 🌈> hi five |
10:55:57 | FromDiscord | <🌈 comet 🌈> @gigachad |
10:56:26 | FromDiscord | <gigachad> oi |
10:56:53 | FromDiscord | <🌈 comet 🌈> oi only auzzies can say oi |
10:57:22 | FromDiscord | <gigachad> ok mate |
10:57:33 | FromDiscord | <🌈 comet 🌈> https://tenor.com/view/aussie-oi-aussie-aussie-aussie-oi-oi-oi-chant-national-chant-gif-16140009 |
10:58:51 | FromDiscord | <gigachad> lmao |
10:59:17 | FromDiscord | <gigachad> hmm i wonder if there is a nim to fabric mod library hehehehe |
10:59:27 | FromDiscord | <🌈 comet 🌈> yeah i want that |
11:00:08 | FromDiscord | <🌈 comet 🌈> quick google search came up with nothing and i'm not bothered enough to do any actual research |
11:00:32 | FromDiscord | <🌈 comet 🌈> i wanna make mc mods in nim :') |
11:01:09 | FromDiscord | <gigachad> same |
11:01:18 | FromDiscord | <gigachad> it would make life so much easier |
11:01:35 | FromDiscord | <🌈 comet 🌈> in fabric cuz i just don't prefer forge |
11:01:45 | FromDiscord | <🌈 comet 🌈> i just like fabric better idk why |
11:04:01 | FromDiscord | <gigachad> quilt cooler |
11:04:14 | FromDiscord | <gigachad> + quilt has a way more powerful API |
11:06:14 | FromDiscord | <🌈 comet 🌈> idk |
11:06:37 | FromDiscord | <gigachad> quilt is a fabric fork lol |
11:06:49 | FromDiscord | <🌈 comet 🌈> this is a dumb reason but: i won't use quilt until curseforge supports it |
11:07:14 | FromDiscord | <🌈 comet 🌈> no quilt https://media.discordapp.net/attachments/371759389889003532/987312460828663878/unknown.png |
11:07:20 | FromDiscord | <gigachad> it does already + modrinth better |
11:07:38 | FromDiscord | <🌈 comet 🌈> i'm talking about the curseforge app |
11:07:41 | FromDiscord | <gigachad> dk about launcher tho |
11:07:46 | FromDiscord | <gigachad> get a better launcher lmao |
11:07:49 | FromDiscord | <gigachad> modrinth is better |
11:07:58 | FromDiscord | <🌈 comet 🌈> jokes on u |
11:08:58 | FromDiscord | <🌈 comet 🌈> In reply to @gigachad "modrinth is better": atleast curseforge is in beta https://media.discordapp.net/attachments/371759389889003532/987312895031398470/unknown.png |
11:09:18 | FromDiscord | <gigachad> lmao it doesnt mean it doesnt work |
11:09:22 | FromDiscord | <gigachad> it works great |
11:10:10 | FromDiscord | <🌈 comet 🌈> In reply to @gigachad "it works great": then where download? |
11:10:19 | FromDiscord | <🌈 comet 🌈> WHERE DOWNLOAD, B |
11:10:28 | FromDiscord | <gigachad> bottom of page |
11:10:30 | FromDiscord | <gigachad> lmao |
11:10:35 | FromDiscord | <🌈 comet 🌈> we should move this to #offtopic |
11:10:42 | FromDiscord | <gigachad> defo |
11:10:43 | FromDiscord | <d4rckh> how can i iterate key, value pairs of json nodes? |
11:17:03 | PMunch | `for key, value in myJsonNode.pairs:` |
11:17:16 | PMunch | https://nim-lang.org/docs/json.html#pairs.i%2CJsonNode |
11:18:33 | FromDiscord | <d4rckh> ty |
11:28:49 | FromDiscord | <Olfactory Hallucinations> In reply to @PMunch "Just tried out tpix": I am the author of tpix. Glad that you like it. |
11:29:29 | PMunch | I really like the simplicity of it, nice defaults |
11:29:56 | PMunch | Couldn't get it to show the svg that pandoc spits out for mermaid graphs though |
11:30:09 | FromDiscord | <Rika> SVGs are a different beast lol |
11:30:13 | PMunch | It says that there's limited SVG support, but not really anything about what the limitations are |
11:30:20 | PMunch | @Rika, oh trust me, I know :P |
11:30:42 | FromDiscord | <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:49 | FromDiscord | <ripluke> How can I check if a string matches something in a sequence |
11:31:07 | PMunch | @ripluke, define something |
11:31:19 | FromDiscord | <ripluke> In reply to @PMunch "<@704106773660827690>, define something": ? |
11:31:33 | FromDiscord | <ripluke> I can send my current code lol |
11:31:35 | FromDiscord | <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:48 | PMunch | @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:58 | PMunch | Hmm, right |
11:32:35 | FromDiscord | <ripluke> sent a code paste, see https://play.nim-lang.org/#ix=40lC |
11:33:28 | FromDiscord | <ripluke> sent a code paste, see https://paste.rs/tGV |
11:33:57 | FromDiscord | <Olfactory Hallucinations> @PMunch Yes, it will work over SSH exactly like it does when running it locally |
11:36:23 | PMunch | @ripluke, and the problem is? |
11:36:36 | FromDiscord | <ripluke> In reply to @PMunch "<@704106773660827690>, and the problem": I think I got it |
11:37:15 | FromDiscord | <ripluke> Yea I got it |
11:37:57 | FromDiscord | <ripluke> sent a code paste, see https://play.nim-lang.org/#ix=40lD |
11:41:02 | PMunch | You should be able to do `if opts.theme notin themes` as well |
11:42:02 | FromDiscord | <ripluke> Oh |
11:44:40 | PMunch | @Olfactory_Hallucinations, it would be nice if tpix would show the error message from Pixie when it fails to load an SVG |
11:45:20 | FromDiscord | <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:37 | PMunch | Turns 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:46 | PMunch | Not sure why it doesn't support `text`.. |
11:59:48 | FromDiscord | <xflywind> In reply to @Isofruit "Is there any way": I don't think so. httpx uses string not stream too. |
12:07:07 | FromDiscord | <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:34 | FromDiscord | <Phil> (edit) "look" => "implement some other stuff in the meantime then, like looking" |
12:08:19 | FromDiscord | <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:34 | FromDiscord | <Phil> (edit) "there~~" => "there with a nimwrapper~~" |
12:09:31 | FromDiscord | <xflywind> In reply to @Isofruit "Awwww, so close to": openssl is shipped with Nim https://nim-lang.org/docs/openssl.html |
12:10:16 | FromDiscord | <Josef> sent a code paste, see https://play.nim-lang.org/#ix=40lK |
12:10:29 | FromDiscord | <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:45 | FromDiscord | <Phil> and was a decent chunk faster than nimcrypto |
12:10:49 | FromDiscord | <xflywind> See also nimcrypto alternative: https://github.com/status-im/nim-bearssl |
12:10:50 | FromDiscord | <Josef> (edit) "https://play.nim-lang.org/#ix=40lL" => "https://paste.rs/upT" |
12:27:34 | PMunch | `proc foo(a: pointer, b: cstring, c, d: cint): ptr bool {.dynlib, cdecl.}` |
12:27:45 | PMunch | Something like that |
12:34:39 | FromDiscord | <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:04 | PMunch | I assume you're just catching the exception from Pixie, the exception message contains the reason |
12:38:51 | FromDiscord | <Olfactory Hallucinations> Yeah. It shouldn't be too hard to fix. |
12:40:21 | FromDiscord | <d4rckh> using {} instead of [] on json nodes wont throw an error if the key doesnt exist, right? |
12:50:04 | PMunch | Nope, it just returns nil |
12:50:23 | PMunch | https://play.nim-lang.org/#ix=40lU |
13:01:51 | * | ltriant joined #nim |
13:06:57 | FromDiscord | <Josef> In reply to @PMunch "`proc foo(a: pointer, b:": Why `ptr bool` instead of `bool`? |
13:08:07 | PMunch | Because that's what the original does? |
13:08:13 | PMunch | Or did Discord mangle your message? |
13:08:56 | PMunch | Ah, it did mangle it |
13:09:15 | PMunch | Then just cbool I guess |
13:09:19 | PMunch | If 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:19 | FromDiscord | <d4rckh> is there any way i can import everything from a folder? |
13:35:44 | PMunch | Is there a way? Yes. Is there a simple way? Not really |
13:36:36 | PMunch | The 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:50 | FromDiscord | <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:11 | FromDiscord | <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:57 | FromDiscord | <Phil> I know of nimpy but thats kinda the wrong way round |
14:02:21 | FromDiscord | <d4rckh> sent a code paste, see https://paste.rs/AaR |
14:02:40 | FromDiscord | <d4rckh> what's wrong? |
14:02:41 | FromDiscord | <d4rckh> sent a code paste, see https://paste.rs/jz0 |
14:05:02 | FromDiscord | <enthus1ast> required type for y\: openArray[T] |
14:05:14 | FromDiscord | <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:06 | FromDiscord | <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:35 | FromDiscord | <xflywind> > Applications using nim-bearssl are fully stand-alone, needing no additional DLL or shared library. |
14:42:53 | FromDiscord | <xflywind> In reply to @Isofruit "Question, how would you": see also the nim version of hashlib => https://github.com/khchen/hashlib |
14:45:53 | FromDiscord | <xflywind> Both of them are friendly C wrapper. |
14:46:51 | FromDiscord | <xflywind> (edit) "wrapper." => "wrapper and mit-licensed," |
14:50:45 | FromDiscord | <xflywind> In reply to @Isofruit "I know of nimpy": Imo, nimpy is the only way to use Python in Nim. |
14:50:45 | FromDiscord | <Phil> sent a long message, see http://ix.io/40mi |
14:51:09 | FromDiscord | <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:41 | FromDiscord | <Phil> (edit) "http://ix.io/40mi" => "http://ix.io/40mj" |
14:53:27 | FromDiscord | <xflywind> In reply to @flywind "Imo, nimpy is the": And it requires Python installed. |
14:54:15 | FromDiscord | <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:13 | FromDiscord | <Olfactory Hallucinations> @PMunch There's an updated version of tpix with better error messages in the github repository now |
15:42:42 | FromDiscord | <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:43 | FromDiscord | <d4rckh> In reply to @enthus1ast "please try @[(name\: "mytask",": When defining the task? |
15:46:50 | FromDiscord | <d4rckh> (edit) "task?" => "sequence?" |
15:47:03 | FromDiscord | <enthus1ast> when calling add |
15:47:36 | FromDiscord | <enthus1ast> or change your add to accept a tuple, not an openarray |
15:47:43 | FromDiscord | <enthus1ast> T in your case |
15:50:28 | FromDiscord | <xflywind> In reply to @Isofruit "I assume that whatever": Yeah |
16:02:21 | * | kenran joined #nim |
16:05:05 | FromDiscord | <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:00 | FromDiscord | <Phil> (edit) "encryption" => "login" |
16:08:52 | FromDiscord | <xflywind> nice |
16:10:33 | FromDiscord | <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:20 | NimEventer | New thread by Severak: How to switch nim version for vscode extension, see https://forum.nim-lang.org/t/9241 |
16:21:39 | FromDiscord | <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:38 | FromDiscord | <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:38 | FromDiscord | <Phil> Even comes with an example at the top of the lib on how to use it |
16:26:22 | FromDiscord | <vindaar> even simpler, because there's a CSV parser in the stdlib https://nim-lang.github.io/Nim/parsecsv.html |
16:28:24 | FromDiscord | <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:15 | FromDiscord | <lantos> In reply to @Not Saucx "how can i open": just a casual 118GB csv file |
16:33:49 | FromDiscord | <Not Saucx> In reply to @lantos "just a casual 118GB": i have a 600gb SHA1 file |
16:36:08 | FromDiscord | <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:58 | FromDiscord | <vindaar> haha, didn't even look at the image properly. Well, if you have enough RAM `readCsv` should work fine 😜 |
16:40:05 | FromDiscord | <vindaar> why pandas over nim?↵(@lantos) |
16:41:35 | FromDiscord | <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:07 | FromDiscord | <Phil> (edit) "it" => "stuff yourself" |
16:42:24 | FromDiscord | <Phil> But 118 gb csv? |
16:42:31 | FromDiscord | <Phil> Hot damn I overlooked that tidbit |
16:42:32 | FromDiscord | <Phil> Errr |
16:43:11 | FromDiscord | <Phil> Do we have tooling to allow partially reading in a file? Because that'd be crazy to have in RAM |
16:45:27 | FromDiscord | <lantos> https://gcloud-compute.com/m2-ultramem-416.html↵no worries, pocket change |
16:45:52 | FromDiscord | <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:06 | FromDiscord | <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:20 | FromDiscord | <Phil> Yeah, makes sense (to both of you) |
16:46:20 | FromDiscord | <lantos> In reply to @vindaar "sure, open a stream": ye this |
16:46:35 | FromDiscord | <Phil> At that size it also makes sense to use nim for the speed up |
16:46:38 | FromDiscord | <lantos> but IRC pandas has some this already? |
16:46:44 | FromDiscord | <lantos> (edit) removed "some" |
16:46:48 | FromDiscord | <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:02 | FromDiscord | <lantos> should be fine if you are using pandas |
16:47:37 | FromDiscord | <lantos> Actually probably the best & quickest way is to pull it into a sql table and use sql, right? |
16:57:54 | FromDiscord | <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:11 | FromDiscord | <Phil> (edit) "with that" => "from those ids" |
16:58:33 | FromDiscord | <Phil> It would make for a neat sqlite file though |
17:00:23 | FromDiscord | <lantos> always fun smashing your head against a table to make a recursive CTE to work 🙂 |
17:01:37 | FromDiscord | <lantos> SQL, all I think about is you↵Late nights in the middle of June... |
17:08:58 | FromDiscord | <Darkstepan> sent a code paste, see https://play.nim-lang.org/#ix=40mN |
17:09:12 | FromDiscord | <Darkstepan> also, where can I find docs for builtin functions? |
17:10:04 | FromDiscord | <Generic> use countup |
17:10:07 | FromDiscord | <Generic> and -1 |
17:10:50 | FromDiscord | <Darkstepan> thanks |
17:23:40 | * | derpydoo joined #nim |
17:28:09 | FromDiscord | <d4rckh> In reply to @enthus1ast "or change your add": but isnt that a tuple im creating? |
17:30:04 | FromDiscord | <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:58 | FromDiscord | <d4rckh> In reply to @enthus1ast "please try @[(name\: "mytask",": and this did not work |
17:35:14 | FromDiscord | <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:28 | FromDiscord | <d4rckh> (edit) "`tuple[name:" => "↵`tuple[name:" | "`tuple[name:" => "↵`tuple[name:" |
17:38:20 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=40mW |
17:38:25 | FromDiscord | <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:20 | FromDiscord | <d4rckh> you cant have procs in tuples? 🤔 |
17:49:20 | FromDiscord | <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:05 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=40n6 |
18:36:23 | FromDiscord | <eyecon> In reply to @pruno "Hello, stupid question but": See `windowed` here: https://github.com/narimiran/itertools#iterutils-iterators |
18:54:47 | FromDiscord | <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:14 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=40nb |
19:25:38 | * | jmdaemon joined #nim |
19:26:26 | FromDiscord | <dom96> oh cool, didn't even think about it but yeah httpbeast should do a much better job of handling streaming data |
19:30:23 | FromDiscord | <dom96> though still not ideal: it will read everything into memory before notifying you the request was received |
19:32:40 | FromDiscord | <dom96> created https://github.com/dom96/httpbeast/issues/74 to track this |
19:33:04 | FromDiscord | <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:47 | FromDiscord | <Phil> I have mostly learnt that sendfile exists today because nginx mentioned that a lot in error messages |
20:18:42 | FromDiscord | <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:25 | FromDiscord | <Elegantbeef> Why do you have `--forceBuild` in your command list?↵(@Phil) |
20:51:14 | FromDiscord | <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:05 | FromDiscord | <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:22 | FromDiscord | <Elegantbeef> flatty, frosty, streams |
21:27:46 | FromDiscord | <Elegantbeef> If you're looking for a binary formatter those are what you want |
21:29:09 | FromDiscord | <Psych0p4th.nim> on the truth i want work with raw sockets, and i need one function do pack the packets bytes |
21:30:42 | FromDiscord | <Psych0p4th.nim> this libs do this ? |
21:32:17 | FromDiscord | <Elegantbeef> streams, frosty, flatty |
21:32:34 | FromDiscord | <Psych0p4th.nim> all right, thanks beef |
21:34:43 | * | LuxuryMode quit (Quit: Connection closed for inactivity) |
21:39:33 | FromDiscord | <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:31 | FromDiscord | <🌈 comet 🌈> does anybody know of a nim api for minecraft so me and @gigachad can make minecraft mods?↵preferably fabric/quilt |
23:40:48 | FromDiscord | <gigachad> yeah would be cool |
23:41:42 | FromDiscord | <Elegantbeef> Nim is compiled to native code so you'd probably have to use JNI or w/e their FFI is |
23:43:03 | FromDiscord | <gigachad> what |
23:43:08 | FromDiscord | <gigachad> oh |
23:43:11 | FromDiscord | <gigachad> i see |
23:43:20 | FromDiscord | <gigachad> but still, is there any kind of api for this? |
23:43:47 | FromDiscord | <Elegantbeef> https://github.com/search?q=language%3Anim+minecraft |
23:45:25 | FromDiscord | <gigachad> no apis sadly |
23:46:03 | FromDiscord | <Elegantbeef> Well yea you kinda need to use java for mods |
23:47:58 | FromDiscord | <🌈 comet 🌈> so just compile it to java? |
23:48:10 | FromDiscord | <🌈 comet 🌈> that sounds ineffiecient |
23:48:20 | FromDiscord | <Elegantbeef> Have fun making the JVM backend Nim compiler |
23:49:06 | FromDiscord | <gigachad> aaaa |
23:49:07 | FromDiscord | <gigachad> what |
23:49:18 | FromDiscord | <🌈 comet 🌈> In reply to @Elegantbeef "Have fun making the": 😢 |
23:49:57 | FromDiscord | <🌈 comet 🌈> can i not just steal someone else's jvm nim compiler? |
23:50:12 | FromDiscord | <🌈 comet 🌈> i don't want to make my own |
23:50:16 | FromDiscord | <Elegantbeef> It doesnt exist so no |
23:51:10 | FromDiscord | <🌈 comet 🌈> nooooooooooooooo |
23:51:23 | FromDiscord | <Elegantbeef> Well go use kotlin and cry |
23:53:20 | FromDiscord | <🌈 comet 🌈> https://github.com/yglukhov/jnim |
23:53:43 | FromDiscord | <Elegantbeef> That'd be using the JNI |
23:54:03 | FromDiscord | <🌈 comet 🌈> i don't even know what ur talking about anymore |
23:54:37 | FromDiscord | <Elegantbeef> That's how java talks to native code |
23:54:41 | FromDiscord | <Elegantbeef> https://en.wikipedia.org/wiki/Java_Native_Interface |
23:54:51 | FromDiscord | <🌈 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:24 | FromDiscord | <exelotl> Kotlin is a pretty nice language for when you have to target the JVM |
23:56:50 | FromDiscord | <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:07 | FromDiscord | <Elegantbeef> iirc fabric is written in kotlin and uses it's features for performance |
23:58:53 | FromDiscord | <huantian> and then they made quilt |
23:59:03 | FromDiscord | <huantian> which is fabric but better again |
23:59:20 | FromDiscord | <Elegantbeef> But but forge devs said fabric isnt better than forge! 😛 |
23:59:38 | * | vicfred joined #nim |
23:59:42 | FromDiscord | <ripluke> How can I check if a file symlinks to another file? |
23:59:56 | * | kayabaNerve quit (Ping timeout: 244 seconds) |