<< 12-07-2023 >>

00:28:38*jmd_ quit (Ping timeout: 246 seconds)
00:50:15*jmd_ joined #nim
00:52:36FromDiscord<uninnocent> How do I communicate with sockets in python and net in nimlang?
00:52:54FromDiscord<uninnocent> When I just try to connect the two, it doesn't do anything. The message is blank.
00:58:41FromDiscord<demotomohiro> If you use TCP protocol, one socket have to listen, and another socket connect to it.
01:00:41FromDiscord<uninnocent> I know
01:05:00*nyeaa492842301 joined #nim
01:05:21FromDiscord<uninnocent> sent a code paste, see https://play.nim-lang.org/#ix=4Aop
01:05:46FromDiscord<uninnocent> sent a code paste, see https://play.nim-lang.org/#ix=4Aoq
01:05:52FromDiscord<heysokam> In reply to @uninnocent "How do I communicate": do you -need- raw sockets?↵there is `treeform/netty` which is really good, so you might find it useful
01:05:57FromDiscord<uninnocent> (edit) "https://play.nim-lang.org/#ix=4Aoq" => "https://play.nim-lang.org/#ix=4Aor"
01:06:10FromDiscord<uninnocent> In reply to @heysokam "do you -need- raw": Not sure what that is
01:06:18FromDiscord<uninnocent> I just want fast communication between devices
01:06:36FromDiscord<heysokam> https://github.com/treeform/netty/
01:06:50FromDiscord<uninnocent> In reply to @heysokam "https://github.com/treeform/netty/": will this work with python
01:06:51FromDiscord<heysokam> (edit) "https://github.com/treeform/netty/" => "Netty - reliable UDP connection library for games in Nim.↵https://github.com/treeform/netty/"
01:07:01FromDiscord<uninnocent> like if I set up that server
01:07:02FromDiscord<uninnocent> I sent
01:07:09FromDiscord<uninnocent> and use that library for my nim client
01:07:12FromDiscord<heysokam> In reply to @uninnocent "will this work with": it will work with anything you can communicate from with nim
01:07:28FromDiscord<heysokam> (edit) "In reply to @uninnocent "will this work with": it will work with anything you can communicate ... from" added "with" | removed "with"
01:07:31FromDiscord<uninnocent> In reply to @heysokam "it will work with": Im trying to do python + nim cross-communication
01:07:53FromDiscord<heysokam> how would you communicate with a C backend?
01:07:58FromDiscord<heysokam> apply that to nim, its the same answer
01:07:59FromDiscord<uninnocent> c?
01:08:04FromDiscord<uninnocent> Ive never written in c
01:08:31FromDiscord<heysokam> rust, C, any-other-systems-language-backend
01:08:36FromDiscord<heysokam> its all the same
01:09:19FromDiscord<uninnocent> I haven't used anything other than python. Im just looking for a straight answer as to how I can communicate between python / nim, not references to things that I've never done / dont know about
01:10:26FromDiscord<heysokam> i see. i haven't communicated from python with any backend, so can't guide you on that myself. but its basically the same as interoperating with C, which there should be a lot of information in the python community, since its backend is technically C
01:10:26FromDiscord<heysokam> thats why i assumed you could know about it already
01:11:28FromDiscord<graveflo> so this code doesn't even print "connected by" on the python scripts end?
01:11:36FromDiscord<uninnocent> it does, it prints connceted
01:11:41FromDiscord<uninnocent> But after I send a command, no response
01:11:44FromDiscord<graveflo> well you said that nothing is printed
01:11:59FromDiscord<uninnocent> In reply to @graveflo "well you said that": I meant to say no response from client
01:11:59FromDiscord<uninnocent> mb
01:12:51FromDiscord<graveflo> ok print the size of the cmd recved from nims end. The first one and see how much data is in the buffer
01:15:26FromDiscord<graveflo> you could also try using this version of `recv` since it doesn't try as hard to fill the buffer: https://nim-lang.org/docs/net.html#recv%2CSocket%2Cstring%2Cint%2Cint
01:16:10FromDiscord<graveflo> (edit) "you" => "~~you" | "https://nim-lang.org/docs/net.html#recv%2CSocket%2Cstring%2Cint%2Cint" => "https://nim-lang.org/docs/net.html#recv%2CSocket%2Cstring%2Cint%2Cint~~↵actually nvm that"
01:17:11*nyeaa492842301 quit (Read error: Connection reset by peer)
01:17:36*nyeaa492842301 joined #nim
01:18:53FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4Aos
01:19:48FromDiscord<demotomohiro> So I think `var cmd: string = socket.recv(1024)` waits for receiving 1024 byte data.
01:20:39FromDiscord<demotomohiro> Probably `data = conn.recv(1024)` in python code also doesn't return until it receive 1024 byte data.
01:32:44*disso-peach joined #nim
01:34:55*lucasta joined #nim
01:41:27FromDiscord<spotlightkid> For any socket based protocol you'll have to either agree on fixed length messages on each side or define some sort of message framing. E.g. sending a separator between each message (that doesn't occur in messages, ofc). Like `\n` or `\r\n` for example. The recipient can then read until it finds the separator, so that it knows a message is complete.
01:43:29FromDiscord<spotlightkid> No, it reads up to 1024 at maximum. With sockets you can not rely on reading the desired number of bytes in one `recv` call.↵(@demotomohiro)
01:51:21FromDiscord<sl0vak_> sent a code paste, see https://play.nim-lang.org/#ix=4Aow
01:51:32FromDiscord<spotlightkid> @uninnocent\: a few comments on you code\: in the Python code your `reponse` variable has a confusing name. It should really be called `request` imo, even if the server sends it. On line 21 you may receive the whole response or not (see my message abaove).↵In the nim code, on line 19 you need to check whether you received a complete command or otherwise repeat the rad until you do. How do you know whether the command is complete?
01:55:20FromDiscord<demotomohiro> In reply to @sl0vak_ "Hi, does anyone know": How about to use `os.copyFile`?↵https://nim-lang.org/docs/os.html#copyFile%2Cstring%2Cstring
01:55:43FromDiscord<arathanis> In reply to @sl0vak_ "Hi, does anyone know": what does reduce mean in this context?
01:57:00FromDiscord<arathanis> you write the character 4 to stdout, then copy the contents of the current file to a file called "4"?
01:57:05FromDiscord<sl0vak_> In reply to @arathanis "what does reduce mean": text
01:57:14FromDiscord<arathanis> In reply to @sl0vak_ "text": like code golf?
01:57:18FromDiscord<sl0vak_> In reply to @arathanis "you write the character": Yeah
01:57:26FromDiscord<sl0vak_> In reply to @arathanis "like code golf?": Yeah
01:57:36FromDiscord<arathanis> any particular reason why? and why on a single line?
01:57:57FromDiscord<sl0vak_> In reply to @arathanis "any particular reason why?": Bytes size
01:58:53FromDiscord<arathanis> it seems pretty reduced to me tbh
01:59:07FromDiscord<arathanis> why do you need to reduce the # of bytes?
01:59:38FromDiscord<sl0vak_> In reply to @arathanis "why do you need": For fun, a simple challenge
02:00:03FromDiscord<demotomohiro> `copyFile` doesnt reduce code size?
02:00:22FromDiscord<spotlightkid> It's not a really challenge if you ask other how to do it, isn't it?
02:00:28FromDiscord<sl0vak_> In reply to @demotomohiro "`copyFile` doesnt reduce code": I'll try it
02:00:37FromDiscord<arathanis> In reply to @spotlightkid "It's not a really": damn, true
02:00:42FromDiscord<sl0vak_> In reply to @spotlightkid "It's not a really": True
02:01:04FromDiscord<arathanis> code golf is evil outside of code golf tournaments anyway
02:01:30FromDiscord<sl0vak_> In reply to @arathanis "code golf is evil": Yep
02:12:23*Ekho quit (Quit: CORE ERROR, SYSTEM HALTED.)
02:13:03FromDiscord<gogolxdong666> sent a code paste, see https://play.nim-lang.org/#ix=4AoC
02:13:38FromDiscord<gogolxdong666> any solution to fix this up?
02:14:07FromDiscord<swordtrait> Can this code be made faster? https://media.discordapp.net/attachments/371759389889003532/1128509560307585114/image_7.png
02:15:41*Ekho joined #nim
02:15:56FromDiscord<swordtrait> This program now takes around 50ms
02:16:16FromDiscord<Elegantbeef> Did you compile it to release?
02:16:25FromDiscord<swordtrait> yes
02:16:33FromDiscord<swordtrait> -d:danger
02:21:34FromDiscord<swordtrait> Can it add parallel iterators, but I won't
02:22:06FromDiscord<swordtrait> (edit) "iterators, but I won't" => "iterators?"
02:22:45FromDiscord<Elegantbeef> If you write multithreaded iterators
02:25:00FromDiscord<swordtrait> I don't have the ability to use parallel iterators, I just started learning nim🤣
02:26:29FromDiscord<arathanis> In reply to @Elegantbeef "If you write multithreaded": is this just an iterator that is safe to share between threads?
02:26:43FromDiscord<Elegantbeef> Who knows you'd be writing it
02:33:14FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4AoH
02:33:26FromDiscord<Elegantbeef> Cause you don't want it to
02:33:40FromDiscord<ringabout> In reply to @gogolxdong666 "any idea to fix": Did you use the latest nightlies? what becomes of `nim -v`?
02:33:56FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/v0x5t
02:34:08FromDiscord<gogolxdong666> sent a long message, see http://ix.io/4AoJ
02:34:34FromDiscord<gogolxdong666> Is this a relative issue?
02:34:51FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4AoK
02:35:34FromDiscord<gogolxdong666> latest devel
02:41:04*rockcavera quit (Remote host closed the connection)
02:52:01FromDiscord<uninnocent> In reply to @graveflo "ok print the size": How would I do that?
02:53:40FromDiscord<graveflo> just echo the `len` of data. Don't just look at the string, See if there is anything there. If it blocks then it might be trying to fill the buffer.
02:53:47FromDiscord<uninnocent> Alright
02:54:36FromDiscord<uninnocent> sent a long message, see http://ix.io/4AoM
02:54:51FromDiscord<uninnocent> No output at all
02:54:52FromDiscord<graveflo> then it is blocking. It might be trying to fill the buffer
02:56:32FromDiscord<ringabout> @graveflo hi, would you mind fixing the render bug mentioned in the internals channel https://discord.com/channels/371759389889003530/768367394547957761/1125529732855906375 ?
02:57:00FromDiscord<uninnocent> Oh, it actually does print something when I close the server @graveflo
02:57:51FromDiscord<uninnocent> https://media.discordapp.net/attachments/371759389889003532/1128520566203224115/image.png
02:58:34FromDiscord<uninnocent> https://media.discordapp.net/attachments/371759389889003532/1128520747812393132/image.png
02:58:42FromDiscord<uninnocent> window 1 = client↵window 2 = server
02:59:06FromDiscord<uninnocent> echo len(data) only runs when I kill the servre
02:59:13FromDiscord<graveflo> In reply to @ringabout "<@200775012796334081> hi, would you": oh sure, I forgot about that. Thanks
02:59:22FromDiscord<uninnocent> if I run a command and THEN kill the server, 0 isnt echoed
02:59:45FromDiscord<uninnocent> (edit) "servre" => "server"
03:00:45FromDiscord<graveflo> In reply to @uninnocent "if I run a": does the python script print "Sent to... "
03:01:13FromDiscord<uninnocent> https://media.discordapp.net/attachments/371759389889003532/1128521415595921458/image.png
03:01:17FromDiscord<uninnocent> this is all t gets up to every time
03:01:22FromDiscord<uninnocent> (edit) "t gets" => "igets"
03:01:27FromDiscord<uninnocent> (edit) "igets" => "it gets"
03:07:42FromDiscord<uninnocent> @graveflo forgot to mention this, but the client can send data to the server fine
03:07:50FromDiscord<uninnocent> It just cant read the server's responded
03:07:53FromDiscord<uninnocent> (edit) "responded" => "responses"
03:08:58FromDiscord<graveflo> ok try using the `recvLine` instead, just for now. And make sure the python script is using a line termination character
03:10:00FromDiscord<uninnocent> I did something to fix it but idk what
03:10:04FromDiscord<uninnocent> its not fully fixed
03:12:40FromDiscord<uninnocent> https://media.discordapp.net/attachments/371759389889003532/1128524296071946312/image.png
03:13:02FromDiscord<uninnocent> if I make the server error at a certian point the command goes through
03:13:25FromDiscord<uninnocent> sent a code paste, see https://play.nim-lang.org/#ix=4AoQ
03:14:13FromDiscord<graveflo> you can try using `send` instead of `sendall` the python script. I think you might be able to `flush` in python too if that is the issue
03:15:41FromDiscord<uninnocent> send instead of sendall didnt do anything.
03:15:44FromDiscord<uninnocent> And what's flush
03:16:56FromDiscord<graveflo> on buffered streams it tries to dump everything from the buffer to the device
03:18:42FromDiscord<graveflo> well idk if this is just a typo or something but you have `conn.recv` instead of `conn.recv(1024)` for example. So you are not getting bytes.. `data` in this case would be a callable object
03:19:52FromDiscord<uninnocent> In reply to @graveflo "well idk if this": I know, I put a comment there.
03:20:08FromDiscord<uninnocent> In reply to @uninnocent "": If I intentonally make that line error, it shows this
03:20:16FromDiscord<uninnocent> if I add the 1024 thing, it just hangs
03:25:09FromDiscord<graveflo> it works if you add `os.linesep` on pythons side and use `recvLine` on nims side. This seems to be a buffering issue. You need to maybe use an unbuffered socket in Nim or look into how to dump the buffer on demand. It seems Nim is trying to fill the entire 1024 bytes when you call `recv`. That is my guess
03:26:27*Onionhammer quit (Quit: The Lounge - https://thelounge.chat)
03:28:51FromDiscord<graveflo> yea looks like `newSocket(AF_INET, SOCK_STREAM, buffered=false)` works if you dont want to use `recvLine`
03:31:58*Onionhammer joined #nim
03:36:23FromDiscord<demotomohiro> https://stackoverflow.com/questions/9563563/what-is-a-message-boundary
03:38:09FromDiscord<demotomohiro> https://stackoverflow.com/questions/17446491/tcp-stream-vs-udp-message
05:07:02FromDiscord<ri> v2.0?
05:07:29FromDiscord<ri> 🧐
05:29:18FromDiscord<uninnocent> In reply to @graveflo "yea looks like `newSocket(AF_INET,": Perfect, thank you so much. This worked.
06:01:41*jmdaemon- joined #nim
06:02:32*jmd_ quit (Ping timeout: 246 seconds)
06:09:49FromDiscord<PingusMcDuck> You guys see this Mojo language, supposed to be pythons exact syntax with C performance
06:13:05FromDiscord<Elegantbeef> "pythons exact syntax"
06:13:05FromDiscord<Elegantbeef> It's like people don't even look at things
06:16:54*lucasta quit (Remote host closed the connection)
06:19:43FromDiscord<huantian> They probably just don’t know how to phrase mojo’s supersettyness of python
06:20:03FromDiscord<Elegantbeef> Awful
06:20:08FromDiscord<Elegantbeef> That's how one phrases it
06:26:33FromDiscord<PingusMcDuck> "Embracing Python massively simplifies our design efforts, because most of the syntax is already specified"↵↵As far as syntax goes am I reading ir incorrect?
06:26:40FromDiscord<Elegantbeef> Sure they support python, but they also introduced their own superset language
06:28:16FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Apa
06:30:15FromDiscord<Elegantbeef> or `fn doThing(inout a: MyType)`
06:30:19FromDiscord<Elegantbeef> Apparently they changed that I could've sworn that used to be `a: &MyType`
06:32:18*ntat joined #nim
06:41:10*PMunch joined #nim
07:02:16FromDiscord<uninnocent> sent a code paste, see https://play.nim-lang.org/#ix=4Apd
07:03:24FromDiscord<Elegantbeef> by using`startProcess`
07:03:31FromDiscord<Elegantbeef> Hmm is this on the edge of malware... I cannot tell
07:04:44Amun-Rathis and the nickname… ;)
07:05:03FromDiscord<uninnocent> In reply to @Amun-Ra "this and the nickname…": Lol
07:11:08*Jjp137 quit (Ping timeout: 246 seconds)
07:20:18*Jjp137 joined #nim
08:00:01FromDiscord<System64 ~ Flandre Scarlet> Hi, do you know why I have those errors with Clang please?↵Everything is fine wigth gcc https://media.discordapp.net/attachments/371759389889003532/1128596612789309450/message.txt
08:00:05FromDiscord<System64 ~ Flandre Scarlet> (edit) "wigth" => "with"
08:03:15FromDiscord<System64 ~ Flandre Scarlet> I also use C++ backend
08:04:54PMunchSeems like you're missing a linker flag
08:07:48FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "Seems like you're missing": Ah alright, which one?
08:09:13PMunchNo idea, but those are linker errors which says it can't find various functions. So either you're trying to link against a different version of the library which is missing those functions, or you're missing a linker flag
08:28:01FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "No idea, but those": But why GCC has no problem with that?
08:28:39NimEventerNew thread by grd: Does anyone knows how good github copilot is when..., see https://forum.nim-lang.org/t/10334
08:28:50PMunchDifferent search paths? Different default options? Could be anything
08:30:44*ovenpasta joined #nim
08:47:22FromDiscord<System64 ~ Flandre Scarlet> Will try to solve this↵Btw I have a question↵Is it possible to generate code with a macro?
08:47:50Amun-RaI can see no contents in this message.txt
08:49:24FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "I can see no": You need to download it because too big for Discord to display it
08:49:48Amun-RaI see "content-length: 0"
08:51:31FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Apr
09:06:07FromDiscord<ieltan> In reply to @sys64 "Will try to solve": I think it's literally what they are meant to be used for but I am a dunce at macros
09:07:08FromDiscord<ieltan> In reply to @sys64 "For example I want": Shouldn't the optimizing compiler do this for you ?
09:12:10FromDiscord<ambient3332> TIL: nimble generateApi
09:12:48FromDiscord<Yardanico> In reply to @sys64 "Will try to solve": > Is it possible to generate code with a macro?↵that's literally what they're meant for, so yes
09:13:10FromDiscord<Yardanico> in fact there's at least one package that does some unroll at compile time thing, and i've made a toy macro for unrolling loops with static iteration expressions a while ago
09:13:36FromDiscord<Yardanico> you just loop over the values in the macro yourself and generate the code repeatedly with the changed `i` in the code
09:14:47FromDiscord<ambient3332> (it was actually just a rule for exec("nim r bindgen/bindgen.nim"))
09:15:54FromDiscord<ambient3332> Wouldn't it be wonderful if you could just press a button and a Nim API magically appeared for any C++ library or software you want
09:15:55*lukasp joined #nim
09:16:04lukaspDear all. Since Nim errs on funcs with side effects, it apparently has knowledge about side effects. I was wondering if Nim automatically turns a proc into a func when it has no side effects. In other words, if func just exists for developers to express their assumptions but given the assumptions hold, it would not make a difference to use proc.
09:16:31FromDiscord<Yardanico> In reply to @ambient3332 "Wouldn't it be wonderful": Futhark is kind of meant for this, but it's not always 100% automatic :)
09:16:36FromDiscord<Yardanico> before futhark there was also nimporter
09:17:08FromDiscord<ambient3332> Yeah, but is it actually robust enough to be used or do I end up chasing some rabbit hole for a month?
09:17:38PMunchambient3332, I've used it for production software
09:17:40FromDiscord<System64 ~ Flandre Scarlet> In reply to @ieltan "Shouldn't the optimizing compiler": I'm not sure, since a is a variable
09:17:55PMunchI wrote it because I was tired of chasing rabbit holes..
09:18:10FromDiscord<System64 ~ Flandre Scarlet> In reply to @yardanico "> Is it possible": How can I do that in the case of my for loop?
09:18:14PMunchBe warned though, it doesn't do C++ at the moment. Only C
09:18:25PMunchBut it has been really solid for me
09:18:25FromDiscord<Yardanico> In reply to @sys64 "How can I do": make a macro? :P
09:18:46PMunchEven managed to wrap Gtk with GtkWebView without fuzz
09:19:08FromDiscord<ambient3332> I can write a simple C API for a C++ lib myself as long as the process is stable
09:19:21FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "Be warned though, it": Ah so I compile to C++, the compiler will yield an error?
09:19:41FromDiscord<Yardanico> In reply to @sys64 "Ah so I compile": no, it just won't work, futhark only does C
09:20:28FromDiscord<Yardanico> In reply to @yardanico "make a macro? :P": i've had one simple one, but I don't know where to find it now
09:20:32PMunchSystem64_~_Flandre_Scarlet, that was meant for ambient. Futhark will work just fine if you're importing a C library but compiling for C++
09:21:15FromDiscord<System64 ~ Flandre Scarlet> Oh, srry
09:21:46FromDiscord<Yardanico> In reply to @sys64 "Oh, srry": https://forum.nim-lang.org/t/9504
09:22:28FromDiscord<Yardanico> <https://github.com/juancarlospaco/nodejs/blob/main/src/nodejs/jsunrolls.nim#L4> should work too (it doesn't seem to be js specific at all)
09:22:49FromDiscord<Yardanico> although it has an extra runtime variable, while it could just inline the variable itself to the call
09:23:05FromDiscord<Yardanico> but this does make the implementation much easier
09:23:15FromDiscord<System64 ~ Flandre Scarlet> Ah thanks!
09:29:46FromDiscord<System64 ~ Flandre Scarlet> In reply to @yardanico "https://forum.nim-lang.org/t/9504": https://github.com/schneiderfelipe/unrolled↵Found this, but doesn't work
09:30:34FromDiscord<ieltan> In reply to @yardanico "before futhark there was": Btw I heard very little things about nimporter, what gives ?
09:30:48FromDiscord<Yardanico> In reply to @ieltan "Btw I heard very": wait sorry
09:30:57FromDiscord<Yardanico> that's the wrong name, nimporter is just a small wrapper on top of nimpy for nim
09:30:59FromDiscord<Yardanico> i meant nimterop :)
09:31:07FromDiscord<ieltan> Oh I see haha
09:31:14FromDiscord<Yardanico> nimterop is unmaintained now, the maintained alternative is futhark
09:31:16FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4Apw
09:31:40FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4Apx
09:32:00FromDiscord<Yardanico> it's usually not hard to see that
09:33:09PMunchPersonally I could never get nimterop to work. Some people seemed to get it working though
09:33:54PMunchGranted I couldn't get c2nim to work either, so maybe I was the problem
09:35:18FromDiscord<demotomohiro> In reply to @yardanico "> Translater has AI": If you know C lang and read C library documents, it would be not hard.↵But how automatic translater like futhark or c2nim do that?
09:35:26FromDiscord<Yardanico> they don't do that, they do best effort
09:38:12FromDiscord<ambient3332> How I use c2nim is just run it on the C API and do a couple of manual fixes. Worked well so far
09:38:18FromDiscord<demotomohiro> Then, if you want good translated Nim code, you need to know C lang, read C library documents and fix translated code.
09:39:05*lukasp quit (Quit: Client closed)
09:39:08FromDiscord<ambient3332> Couldn't I just write a C api for a C++ lib with Nim directly?
09:39:16FromDiscord<ambient3332> Just do .emit.
09:39:33FromDiscord<ambient3332> or something
09:41:10FromDiscord<ambient3332> The way I figure out is that you have 1. C++ lib that's C++ object file (mangled names), 2. C API for C++ lib that just calls C++ funcs and gives C ABI, 3. Nim lib that consumes the C ABI. But could the 2. just not be replaced directly with Nim instead?
09:43:06FromDiscord<ambient3332> So I would not have to mess with any C/C++ build systems and could stay inside Nim the whole time
09:43:41FromDiscord<demotomohiro> Nim has pragmas to import C++ classes or functions:↵https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma
09:44:04FromDiscord<ambient3332> Indeed, but I need to do separate `nim cpp`
09:44:11FromDiscord<ambient3332> (which is fine)
09:44:31FromDiscord<ambient3332> Just looking the least painful proces to import complex C++ libs so I can run `nim c`
09:46:31FromDiscord<demotomohiro> Maybe, import C++ lib to Nim code with importcpp pragma, export C functions and compile it as static or dynamic link library?
10:06:01*Guest99 joined #nim
10:17:22PMunchambient, using c2nim and manual fixes is fine if you only have a few fixes to make and you don't ever update what you're interfacing against. Problem is if you wrap a large library there is a lot of stuff to manually fix, and each fix has the potential to introduce hard-to-spot bugs. Then the library updates and you have to do everything all over again, which is just a world of pain.
10:17:56PMunchAnd Futhark could support C++, it's just a matter of figuring out and writing the rules for how to wrap C++ stuff in Nim.
10:18:31PMunchSay you have something which returns a std::vector, what does that map to in C? What should it map to in Nim?
10:39:30FromDiscord<System64 ~ Flandre Scarlet> How can I make my Nim program not detected as a virus please?
10:42:50PMunchPlead with AV vendors to stop their poor fingerprinting of Nim binaries
10:43:48FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "Plead with AV vendors": Even worse : This is Windows Defender's antivirus
10:44:14FromDiscord<spotlightkid> then plead wih MS
10:45:07FromDiscord<System64 ~ Flandre Scarlet> MS sucks
10:45:09PMunchPoint still stands, MS makes AV = MS is an AV vendor
10:52:36FromDiscord<System64 ~ Flandre Scarlet> would signing the program work?
10:55:15FromDiscord<Andreas> In reply to @PMunch "Point still stands, MS": maybe, join with people from other affected groups first, collect some money, hire a FSF-lawyer and hope for the best..
11:03:54FromDiscord<demotomohiro> Or somehow convince people that your program is not virus and ask people to ignore AV.↵Or stop using windows and use Linux, ReactOS or other OS.
11:17:32*Guest99 quit (Quit: Client closed)
11:20:56*Guest99 joined #nim
11:21:04*PMunch_ joined #nim
11:22:13*Guest99 is now known as m2a2
11:23:01FromDiscord<Andreas> In reply to @demotomohiro "Or somehow convince people": no, it the AV-Vendors duty to deliver a proof, that binaries generated by Nim|D|other-languages perform malicious actions. What they do is -> there has been a malware made by nim, so we block anything and that is imo not fair or legal. Any affected company would take this to court.
11:24:35*PMunch quit (Ping timeout: 264 seconds)
11:31:01FromDiscord<System64 ~ Flandre Scarlet> The open source community is affected by this too
11:33:19FromDiscord<Andreas> In reply to @sys64 "The open source community": correct, even some Python-packages seem to be affected - i wonder how the Python-Foundation would react if anything-python would be detected as malware ?
11:34:21FromDiscord<System64 ~ Flandre Scarlet> In reply to @Andreas "correct, even some Python-packages": I can't distribute my synthesizer without anyone saying "uh oh! Detected as virus"
11:35:31FromDiscord<System64 ~ Flandre Scarlet> And I can't download an open source program without SmartScreen saying "uh oh! It can be dangerous! Be careful!"
11:38:52*jmdaemon- quit (Ping timeout: 240 seconds)
11:40:29FromDiscord<spotlightkid> welcome to corporate walled gardens!
11:42:56FromDiscord<Andreas> In reply to @sys64 "I can't distribute my": mybe try to follow https://forum.nim-lang.org/t/9850 pietpropers suggestions and have your music-app tested and signed to get around the virus-detection ?
11:43:37FromDiscord<System64 ~ Flandre Scarlet> In reply to @spotlightkid "welcome to corporate walled": I think you can sign your app but obviously... It costs moneeeey!↵I doubt it's still about security anymore, more like it's about money
11:43:48FromDiscord<System64 ~ Flandre Scarlet> In reply to @Andreas "mybe try to follow": Gotta read that
11:44:59FromDiscord<Andreas> In reply to @sys64 "I think you can": if thats really true, then the FSF should be interested to step-in, because this hinders free-software-developments..
11:51:06*ntat quit (Quit: Leaving)
11:52:48FromDiscord<jmgomez> In reply to @PMunch "Say you have something": why just dont use the cpp backend instead?
11:54:09FromDiscord<jmgomez> In reply to @demotomohiro "Maybe, import C++ lib": this is the way to go about it but @ambient3332 if `nim c` is not a hard requirement, just use the cpp backend
11:56:34FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4ApP
11:58:41FromDiscord<jviega> Well, almost certainly libclang.a is not in your path. Add a C flag, -L/path/to/where/lib/clang/is
11:59:12FromDiscord<pmunch> Yup, this has been mentioned in several issues already: https://github.com/PMunch/futhark/issues/27
12:00:14FromDiscord<pmunch> It should be fixed once I merge this: https://github.com/PMunch/futhark/pull/78
12:06:04FromDiscord<dlesnoff> Thanks. Sorry, I could have searched a little harder.
12:08:33FromDiscord<spotlightkid> Debian/Ubuntu and their stupid messing with installation paths. I had fun with this with a Python project too. They patch their python's `sys.path` to change the install location for third-party packages but then don't fix the stdlib `sysconfig` module.
12:28:57FromDiscord<fabricio> I don't know if there is a better place to ask this, but has anyone tried to integrate nim.nvim or nimsuggest autocompletion with coq_nvim?
12:51:36FromDiscord<djazz> In reply to @jiezron "Thanks. Sorry, I could": I opened that PR just the other day 😄
12:52:43FromDiscord<djazz> Meanwhile use nimble --passL:-L/usr/lib/llvm-14/lib install futhark
12:58:19FromDiscord<ambient3332> In reply to @PMunch "Say you have something": Probably something like this https://github.com/SciNim/impulse/blob/26e25e701be75446ad2b91403a4538465f44f1b5/impulse/fft/std_cpp.nim
13:11:01FromDiscord<takemichihanagaki3129> In reply to @Andreas "correct, even some Python-packages": I had this problem twice on the same year.↵A nim version was detected by my Windows Defender as a malware. ↵And in other occasion, an application that I developed using Python and compiling via Nuitka was flagged the same way too...
13:16:01FromDiscord<Andreas> In reply to @takemichihanagaki3129 "I had this problem": i just emailed to FSF and brought the case of "false positives' to their attention. Currently there is no 'campain' covering this topic. I'm sure they are already aware - lets wait a bit and maybe the FSF surveys their members and starts acting upon it..
13:16:56*rockcavera joined #nim
13:41:22PMunch_ambient, yeah probably. I basically just need someone with enough C++ knowledge (and preferably wrapper knowledge) to help out with Futhark
13:58:11FromDiscord<jmgomez> In reply to @PMunch_ "ambient, yeah probably. I": not a cpp expert but feel free to ask, learned a thing or two about it by doing NUE 🙂
13:59:58PMunch_jmgomez, yeah I've been meaning to get in touch about it :) But I've been very busy at work and with renovating the house we just bought
14:01:49FromDiscord<blashyrk> Is every source file a separate module in nim? If I have multiple source files and `import X` in one or another, I can't access "private" fields. Is there a way to have multiple source files in a single module?
14:02:08PMunch_You could use include
14:02:21PMunch_include basically copy-pastes one file into another
14:02:37PMunch_While import treats it as a separate module
14:03:32FromDiscord<ieltan> Is it possible for a macro to extract type information about a closure and manipulate it ?
14:03:55FromDiscord<ieltan> also wish to do the same for an object field
14:05:23*PMunch_ quit (Quit: Leaving)
14:10:02*lucasta joined #nim
14:11:33*lucasta quit (Remote host closed the connection)
14:11:57*lucasta joined #nim
14:12:25*disso-peach quit (Quit: Leaving)
14:13:15FromDiscord<jmgomez> In reply to @PMunch_ "<@726017160115126333>, yeah I've been": cool, take your time and congrats for the house!
14:50:55FromDiscord<bung8954> sent a code paste, see https://play.nim-lang.org/#ix=4Aqw
15:16:53NimEventerNew thread by beckx: GUI-LIB nip - button callback and object data, see https://forum.nim-lang.org/t/10335
16:15:17*lucasta quit (Remote host closed the connection)
17:25:21*m2a2 quit (Quit: Client closed)
17:26:37*Guest99 joined #nim
17:27:54*Guest99 is now known as m2a2
17:45:46FromDiscord<eliot> hello, i've recently installed nim using choosenim on windows but i seem to be getting an error related to git when installing a package thru nimble. heres the output of when i try to install winim:
17:45:59FromDiscord<eliot> sent a long message, see http://ix.io/4Arw
17:46:20FromDiscord<eliot> (edit) "http://ix.io/4Arw" => "http://ix.io/4Arx"
17:46:29FromDiscord<eliot> it then shows every git argument
17:46:40FromDiscord<eliot> (edit) "http://ix.io/4Arx" => "http://ix.io/4Ary"
17:47:19FromDiscord<graveflo> its a bug
17:47:33FromDiscord<graveflo> your username has a space and the command is formatted improperly because of this
17:47:39FromDiscord<eliot> ooh
17:47:47*ntat joined #nim
17:56:50*anddam quit (Quit: WeeChat 4.0.1)
18:02:11*anddam joined #nim
18:04:33*anddam quit (Client Quit)
18:05:33*anddam joined #nim
18:30:38FromDiscord<bostonboston> When generating a dll I specify the stdcall calling conv but the produced symbols are not prefixed with an underscore, infact no matter what calling conv I specify the symbols do not seem to change?
18:32:20FromDiscord<bostonboston> sent a code paste, see https://play.nim-lang.org/#ix=4ArM
18:46:55FromDiscord<bostonboston> Okay I figured out why my symbols weren't changing based on the calling conv but I still don't know why stdcall doesn't prepend an underscore
18:52:29FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4ArP
18:53:05FromDiscord<System64 ~ Flandre Scarlet> Because it struggles with high window lengths
19:04:04FromDiscord<juan_carlos> In reply to @bostonboston "Okay I figured out": `{.exportc: "_foo".}` can take a name.
19:05:37FromDiscord<bostonboston> Yes but I shouldn't have to do that if the stdcall standard is to do it by default right?
19:06:18*azimut_ quit (Ping timeout: 240 seconds)
19:07:39FromDiscord<juan_carlos> In reply to @bostonboston "Yes but I shouldn't": If you think its a bug, then should be reported.
19:20:00FromDiscord<bostonboston> I don't necessarily think it's a bug, I was assuming I'm doing something wrong
19:20:08*m2a2 quit (Quit: Client closed)
19:37:49FromDiscord<nnsee> In reply to @sys64 "Because it struggles with": profile to find out?
19:37:55FromDiscord<nnsee> check out https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html#profiling-your-code
19:43:53*ntat quit (Quit: Leaving)
19:47:42*ntat joined #nim
21:10:12*ntat quit (Quit: Leaving)
21:10:23FromDiscord<ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=4Asb
21:10:37FromDiscord<ambient3332> for example instead of dividing by a constant, you can put var foo = 1/CONSTANT outside the loop
21:10:41FromDiscord<ambient3332> then multiply by it
21:11:27FromDiscord<Elegantbeef> Also not using recursive logic
21:11:44FromDiscord<ambient3332> Yeah, I was thinking the same but not knowing anything of the outside logic, can't say much
21:11:53FromDiscord<Elegantbeef> Also not using methods
21:12:18FromDiscord<meriem> Hi
21:12:38FromDiscord<ambient3332> Generally as your synth is in dataflow format, it should be unnecessary to do anything recursive, just do a toposort
21:13:09FromDiscord<ambient3332> (although as I know very little who know, just as general guidelines)
21:28:22FromDiscord<System64 ~ Flandre Scarlet> In reply to @ambient3332 "Generally as your synth": toposort?↵Also output call a module that call a module that call a module and so on
21:28:48FromDiscord<System64 ~ Flandre Scarlet> so it's like↵function(function(function(function(function(function(function(...)))))))
21:47:48FromDiscord<Elegantbeef> Recursion bad
21:56:14FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Recursion bad": I don't see any other way to make a modular synth like this
21:56:55FromDiscord<Elegantbeef> Well profile it first
22:18:04*jmdaemon joined #nim
22:21:41*ovenpasta quit (Ping timeout: 245 seconds)
23:04:24FromDiscord<Elegantbeef> @ringabout\: an inane wiki page was created.
23:04:25FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/wiki/World
23:24:16*ormiret_ joined #nim
23:26:22*blackbeard420_ joined #nim
23:26:29*blackbeard420_ quit (Remote host closed the connection)
23:26:53*blackbeard420_ joined #nim
23:29:13*lumidify_ joined #nim
23:32:30*ormiret quit (*.net *.split)
23:32:30*lumidify quit (*.net *.split)
23:32:30*mahlon quit (*.net *.split)
23:32:31*blackbeard420 quit (*.net *.split)
23:32:31*ormiret_ is now known as ormiret