<< 28-06-2022 >>

00:00:06*adium quit (*.net *.split)
00:00:06*euantorano quit (*.net *.split)
00:00:06*cyraxjoe quit (*.net *.split)
00:00:06*mahlon quit (*.net *.split)
00:00:06*GreaseMonkey quit (*.net *.split)
00:00:07*DixieFlatline quit (*.net *.split)
00:00:07*madprops quit (*.net *.split)
00:00:16*greaser|q joined #nim
00:00:18*madprops joined #nim
00:00:21*DixieFlatline joined #nim
00:00:40*euantorano joined #nim
00:00:44*mahlon joined #nim
00:01:24*madprops quit (Changing host)
00:01:24*madprops joined #nim
00:02:24*cyraxjoe joined #nim
00:03:22*adium joined #nim
00:05:54NimEventerNew thread by Niminem: Why does JS backend return array with object?, see https://forum.nim-lang.org/t/9269
00:15:28*Guest6357 quit (Ping timeout: 260 seconds)
00:29:57*Guest6357 joined #nim
00:48:28FromDiscord<CarmoNoSadame> heya friends, I'm somewhat new to nim, would it be alright to ask a question regarding nim on emacs here?
00:49:49FromDiscord<carmo> been trying to get `nimlangserver` to work but it doesn't seem to function correctly with my current version of `nimsuggest`, and I don't quite understand why
00:50:09FromDiscord<carmo> (edit) "`nimsuggest`," => "`nimsuggest` (which is just the one that came together with the stable build in choosenim),"
00:58:44*noeontheend quit (Ping timeout: 255 seconds)
00:59:18*greaser|q quit (Changing host)
00:59:18*greaser|q joined #nim
00:59:47*greaser|q is now known as GreaseMonkey
01:00:23FromDiscord<carmo> it's almost as if nimsuggest is not up to date, because nimlangserver requires nimsuggest to be able to use the `--v3` option, and the one that came in the stable channel doesn't have it
01:02:11FromDiscord<Elegantbeef> There is nimlsp which doesnt rely on `--v3`
01:04:29FromDiscord<carmo> is there much of a difference between it and nimlangserver?
01:05:08FromDiscord<Elegantbeef> nimlsp doesnt rely on modern changes, but it has issues
01:05:40FromDiscord<carmo> hmm, I'll try it
01:06:05FromDiscord<carmo> but still, why is the --v3 option missing? just trying to understand how exactly the versioning works here
01:06:19FromDiscord<Elegantbeef> Cause it's for the devel nimsuggest
01:08:35FromDiscord<carmo> they mentioned this commit that apparently got merged to the nim-lang:version-1-6 branch
01:08:36FromDiscord<carmo> https://github.com/nim-lang/Nim/pull/19892
01:08:49FromDiscord<carmo> is that branch part of the devel branch(es)?
01:09:04FromDiscord<Elegantbeef> It means it'll be backported to the next 1.6.x release
01:09:20FromDiscord<carmo> oh, to the next one, icic
01:09:32FromDiscord<carmo> ty, it makes more sense now
01:09:37FromDiscord<carmo> still learning how things work hehe
01:27:10FromDiscord<Yardanico> @ElegantBeef you around?
01:27:25FromDiscord<Elegantbeef> Depends are you a cop?
01:27:32FromDiscord<Yardanico> not as of now
01:27:38FromDiscord<Yardanico> do you think it's intended that https://play.nim-lang.org/#ix=415f works or not?
01:27:49FromDiscord<Yardanico> I thought you couldn't convert (!) negative numbers to uint
01:27:50FromDiscord<Yardanico> only cast
01:27:56FromDiscord<Yardanico> but this seems to behave like a cast
01:28:24FromDiscord<Yardanico> I guess it's because Ordinal is a separate type from negative integer types
01:28:39FromDiscord<Yardanico> Ordinal[T] {.magic: Ordinal.}
01:34:20FromDiscord<Elegantbeef> Dont know if it should work seems somewhat bugg
01:37:07FromDiscord<Yardanico> heh, funny that stdlib/thashes.nim tests a lot of stuff (C, C++, JS both VM and runtime), but doesn't have _any_ tests for negative int hashes
01:38:11FromDiscord<Yardanico> actually it doesn't have compile-time vs runtime hash comparison either
01:40:35FromDiscord<Yardanico> so for some reason with current hash impl hashes of negative numbers are different when compiling to JS compile-time vs runtime
01:40:48FromDiscord<Yardanico> hashes.nim has some weird logic for JS
02:06:35*wallabra joined #nim
02:06:44FromDiscord<Yardanico> aha
02:07:31FromDiscord<Yardanico> 🤔
02:10:43FromDiscord<Yardanico> @xflywind when you get online - do you have any ideas on https://github.com/nim-lang/Nim/issues/19929 ? I'm not sure when exactly it regressed, but hashes for negative numbers on JS don't match the compile-time values
02:13:32FromDiscord<Yardanico> first of all, the template h(x) in hashWangYi1 works differently in comp-time and JS since JS doesn't support exact 64-bit arithmetic
02:14:10FromDiscord<Yardanico> then there's also `if hasJsBigInt` check which assumes that the hash is always computed with this, but we don't know at compile-time if the JS environment will have bigints or not
02:14:53FromDiscord<Yardanico> and then also the nimvm js is `cast[Hash](h(x)) and cast[Hash](0xFFFFFFFF)` but then in runtime it's `cast[Hash](x) and cast[Hash](0xFFFFFFFF)` which seems like a typo for me (`h(x)` doesn't get called)
02:15:14FromDiscord<Yardanico> Unless the intention was reverse to do `cast[Hash](x) and cast[Hash](0xFFFFFFFF)` in both cases
02:15:45FromDiscord<Yardanico> but that would make hashing not work for any big enough integers
02:16:58NimEventerNew post on r/nim by owl_000: Nimeme, see https://reddit.com/r/nim/comments/vmbxwg/nimeme/
02:30:34FromDiscord<🐒🧠br4n_d0n> How does this https://nim-lang.org/docs/io.html#lines.i%2Cstring handle a massive file that is all one line? Will it eat a ton of memory?
02:32:12FromDiscord<Elegantbeef> No it reads small chunks
02:32:59FromDiscord<🐒🧠br4n_d0n> So what would be considered a "line" in that example if it's all one minified file?
02:33:12FromDiscord<Yardanico> if it's 1 line then it'll be 1 line obviously
02:33:16FromDiscord<Yardanico> `lines` iterator iterates, well, on lines
02:33:32FromDiscord<Yardanico> bytes of text that are separated by LF or CRLF
02:34:04FromDiscord<🐒🧠br4n_d0n> So, what happens if I have something like a 1 GB file like this?
02:34:13FromDiscord<Yardanico> it'll have to load whole 1GB obviously
02:34:14FromDiscord<Yardanico> since it's 1 line
02:34:26FromDiscord<Elegantbeef> It's likely to have `\n` in it
02:34:33FromDiscord<Yardanico> In reply to @Elegantbeef "It's likely to have": not really
02:34:40FromDiscord<Yardanico> minified files usually get stripped of newlines for things like JS
02:34:50FromDiscord<Elegantbeef> oh i thought they meant binary
02:35:07FromDiscord<🐒🧠br4n_d0n> Damn, so what be the most efficient method to read a file like that then?
02:35:13FromDiscord<Yardanico> depends on what you want to do with it
02:35:31FromDiscord<🐒🧠br4n_d0n> Parse it for certain characters and strings
02:35:40FromDiscord<Yardanico> you can read in chunks yourself
02:35:46FromDiscord<Yardanico> and look for certain characters and strings
02:36:02FromDiscord<xflywind> In reply to @Yardanico "then there's also `if": We probably can drop hasBigInt, since IE is dead.
02:36:18FromDiscord<Yardanico> maybe, but it doesn't work even then for negative numbers
02:37:08FromDiscord<xflywind> Yeah, I'm checking the example.
02:37:42FromDiscord<Yardanico> is enough to test it
02:37:45FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=415o
02:38:23FromDiscord<xflywind> thanks
02:38:34FromDiscord<🐒🧠br4n_d0n> In reply to @Yardanico "you can read in": Would this https://nim-lang.org/docs/io.html#readChars%2CFile%2CopenArray%5Bchar%5D be the route to go then?
02:40:14FromDiscord<Yardanico> yeah probably, with the way described in the other deprecated readChars overload
02:40:16FromDiscord<Yardanico> or use streams
02:40:28FromDiscord<Yardanico> or https://nim-lang.org/docs/memfiles.html
02:48:27FromDiscord<carmo> is there a way to copy a slice of a string to a char array?
02:50:20FromDiscord<carmo> sent a code paste, see https://paste.rs/Rhj
02:51:34FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=415q
02:51:36*noeontheend joined #nim
02:51:40FromDiscord<Yardanico> ofc if you use unsafe features you can use `copyMem` or similar
02:52:33FromDiscord<carmo> hmm yeah copyMem could work as well
02:52:39FromDiscord<Yardanico> well, it's better to be safe
02:52:39FromDiscord<carmo> but I'll stick to that other form for now
02:52:44FromDiscord<Yardanico> also, Nim has inclusive ranges
02:52:45FromDiscord<carmo> ye
02:52:52FromDiscord<Yardanico> so 0..5 means from 0 to 5th character inclusively
02:52:55FromDiscord<Yardanico> which means 6 characters
02:53:12FromDiscord<Yardanico> if you want 5 characters you'd do 0..4
02:53:17FromDiscord<carmo> yeah I also noticed that right after I posted lol, gonna take a lil bit getting used to
02:54:21FromDiscord<carmo> but ty!
02:54:23noeontheendOr 0..<5, which you might find clearer
02:55:48FromDiscord<🐒🧠br4n_d0n> In reply to @noeontheend "Or 0..<5, which you": True, but that doesn't allow for the flexibility of changing the size of `t`
02:57:01FromDiscord<Yardanico> well, I did `0..<t.len` as you can see
02:57:05FromDiscord<Yardanico> which is the same as `0..t.len-1`
02:57:19FromDiscord<Yardanico> he was talking about general usage of ranges
02:57:46FromDiscord<carmo> for this case it could be `0..^1` too, right?
02:57:53FromDiscord<carmo> in the case of t
02:57:55FromDiscord<carmo> (edit) "t" => "`t`"
02:58:04FromDiscord<carmo> (edit) "`t`" => "`t`, not `s`"
02:59:09FromDiscord<carmo> but on another note, what would be a good way of turning a char into a string, for the sake of easier manipulation?
02:59:15FromDiscord<carmo> (edit) "but on another note, what would be a good way of turning a char ... into" added "array"
03:00:09FromDiscord<carmo> I assume I could do the same thing we did here but backwards (copying the ranges, I mean)
03:00:55FromDiscord<Elegantbeef> you dont you write a proc that takes `openarray[char]` 😛
03:02:30FromDiscord<🐒🧠br4n_d0n> Umm, isn't a string a char array with the added `\0` character?
03:05:04FromDiscord<carmo> oh yeah right, elegantbeef, that's much easier hehe
03:05:38FromDiscord<carmo> can openarrays be passed with `var`, though, to modify the original variable?
03:05:45FromDiscord<Elegantbeef> yes
03:05:47FromDiscord<Elegantbeef> cant grow them
03:05:58FromDiscord<carmo> yeah that's nice, no need to grow
03:06:06FromDiscord<carmo> I'll be reading a string from stdin and then just trimming
03:06:09FromDiscord<carmo> (edit) "trimming" => "trim it"
03:06:16FromDiscord<carmo> (edit) "I'll be reading a string from stdin and then just trim it ... " added "using slices"
03:07:12FromDiscord<carmo> In reply to @br4n_d0n "Umm, isn't a string": yeah, only reason I'm doing all this is because I'm working with data serialization
03:07:39FromDiscord<carmo> and the data structure I'm serializing only allows strings of very specific lengths
03:07:48FromDiscord<carmo> so char arrays seemed like a better choice
03:17:54*noeontheend quit (Ping timeout: 276 seconds)
03:38:56*arkurious quit (Quit: Leaving)
04:02:36*FromDiscord quit (Ping timeout: 246 seconds)
04:02:57*genpaku quit (Ping timeout: 246 seconds)
04:03:03*FromDiscord joined #nim
04:05:20*genpaku joined #nim
05:25:41*rockcavera quit (Remote host closed the connection)
05:28:43FromDiscord<proton> How is the GPU backend going?
07:28:46FromDiscord<eyecon> In reply to @Elegantbeef "cant grow them": Can we shrink them, or is the size fixed?
08:06:06FromDiscord<Entikan> sent a code paste, see https://play.nim-lang.org/#ix=415T
08:07:50FromDiscord<Elegantbeef> Cant change their size whatsoever they're pointer + len↵(@eyecon)
08:08:08FromDiscord<Elegantbeef> Tuples are not objects so no it's not↵(@Entikan)
08:09:00FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=415U
08:41:17FromDiscord<eyecon> In reply to @Elegantbeef "Cant change their size": Ty!
09:05:56FromDiscord<mahdibehkar> Does nim Garbage Collection use orc/arc by default?
09:09:38FromDiscord<Rika> Not as of now
09:17:25FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=4169
09:17:55FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=416a
09:17:58FromDiscord<ripluke> Does Nim work well with copilot? Like well enough to switch from neovim to vscode
09:19:02FromDiscord<d4rckh> (edit) "https://play.nim-lang.org/#ix=4169" => "https://play.nim-lang.org/#ix=416c"
09:19:05FromDiscord<enthus1ast> you might be able to check if data is still buffered and keep calling recvLine↵(@d4rckh)
09:19:08FromDiscord<d4rckh> (edit) "https://play.nim-lang.org/#ix=416c" => "https://play.nim-lang.org/#ix=416d"
09:19:40FromDiscord<d4rckh> In reply to @enthus1ast "you might be able": how can i do that?
09:19:58FromDiscord<d4rckh> `socket.isBuffered`?
09:20:05FromDiscord<enthus1ast> mh
09:20:06FromDiscord<enthus1ast> no
09:20:17FromDiscord<enthus1ast> https://nim-lang.org/docs/net.html#hasDataBuffered%2CSocket
09:20:31FromDiscord<d4rckh> ah
09:20:33FromDiscord<d4rckh> haha okay thanks
09:21:08FromDiscord<enthus1ast> another option is to peek on the socket
09:21:36FromDiscord<enthus1ast> this way you could peek first if a whole line is received, then read,
09:21:51FromDiscord<enthus1ast> when data is buffered it could be that no complete line has been received yet
09:22:18FromDiscord<enthus1ast> i think it depends if you can tolerate that your applications stalls on a read
09:23:08FromDiscord<d4rckh> yeah that does not seem to work
09:23:23FromDiscord<d4rckh> 🤔 or maybe im doing something wrong https://media.discordapp.net/attachments/371759389889003532/991272592650543135/unknown.png
09:23:30FromDiscord<d4rckh> i have a recvLine call instead the second while
09:24:33FromDiscord<d4rckh> how can i peek first?
09:25:28FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=416f
09:26:04FromDiscord<enthus1ast> in your case it would be recvLine i guess
09:26:17FromDiscord<d4rckh> do i keep the second while loop?
09:26:44FromDiscord<enthus1ast> a peek does not block, so it will be a busy loop
09:28:01FromDiscord<enthus1ast> i do not know the best practive in your case, maybe play with it a little
09:29:40FromDiscord<d4rckh> hmm, and what would the buffer be?
09:29:42FromDiscord<d4rckh> a string?
09:30:14FromDiscord<enthus1ast> just copied the line from old code of mine
09:30:15FromDiscord<enthus1ast> i
09:30:33FromDiscord<d4rckh> looks like recv in that case returns a string
09:30:38FromDiscord<enthus1ast> yes
09:30:45FromDiscord<d4rckh> so i assume buffer will be the list of lines that i need to handle at that time
09:30:55FromDiscord<d4rckh> and then i empty it and wait again?
09:31:05FromDiscord<enthus1ast> yeah could work
09:32:08FromDiscord<enthus1ast> i spend the last few evenings building a x64 hooking lib for nim, i just got the "naive" hooking working \:), no RIP handling yet but still, quite happy that this hacky code works
09:33:41FromDiscord<enthus1ast> i guess we have no decent disam in nim right?
09:33:54FromDiscord<enthus1ast> so i might just use capstone
09:43:24FromDiscord<d4rckh> https://media.discordapp.net/attachments/371759389889003532/991277627186876446/unknown.png
09:43:25FromDiscord<d4rckh> hm what
09:51:10FromDiscord<deadmeme77> In reply to @ripluke "Does Nim work well": I dont think they have any option to output nim code yet
09:53:03FromDiscord<deadmeme77> I cant find any list, but funnily enough Clojure is the only language mentioned in the front page (by a reviewer). Interesting.
10:00:49*reversem3[m] quit (Ping timeout: 252 seconds)
10:01:19*Guest6357 quit (Ping timeout: 264 seconds)
10:14:54FromDiscord<Rika> In reply to @d4rckh "": You’re discarding something that doesn’t return anything are you
10:15:44FromDiscord<Rika> Copilot tries to be language agnostic but Nim is so close to Python that it becomes confused
10:19:44FromDiscord<d4rckh> In reply to @Rika "You’re discarding something that": hm I am not discarding anything
10:20:24*tinystoat is now known as CAPSLOCKSTOAT
10:20:43FromDiscord<Rika> Can you show the whole context? Or can you try compiling and not just looking at editor errors
10:21:19FromDiscord<d4rckh> ouch
10:21:20FromDiscord<d4rckh> right
10:21:29FromDiscord<d4rckh> I get `Error: await expects Future[T], got string` when I try to compile
10:21:49FromDiscord<d4rckh> located here https://media.discordapp.net/attachments/371759389889003532/991287297444167730/unknown.png
10:22:00FromDiscord<d4rckh> (edit) "here" => "in `C:\nim-1.6.6\lib\pure\asyncmacro.nim(126, 11)`"
10:22:01FromDiscord<d4rckh> lol
10:22:08FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=416m
10:23:28FromDiscord<d4rckh> https://www.toptal.com/developers/hastebin/loqotimaga.csharp
10:23:35FromDiscord<d4rckh> here's more context
10:24:01FromDiscord<d4rckh> In reply to @d4rckh "im using sockets, can": i am trying to do this
10:29:42FromDiscord<enthus1ast> does one know who manages the discord \<-\> matrix bridge?
10:30:20FromDiscord<enthus1ast> because there seems to be an error somewhere
10:30:24FromDiscord<enthus1ast> image.png https://media.discordapp.net/attachments/371759389889003532/991289458165039114/image.png
10:30:41FromDiscord<enthus1ast> "This event could not be displayed"
10:30:53FromDiscord<enthus1ast> i saw this a few times already
10:30:55FromDiscord<Phil> Yard maybe? Not sure why his name was the first that popped into my head
10:32:14FromDiscord<Rika> In reply to @d4rckh "I get `Error: await": That means as it says
10:32:21FromDiscord<Rika> You’re awaiting something that you can’t await
10:32:53FromDiscord<enthus1ast> @d4rckh you told me you use socket, not asyncsocket right?
10:33:04*dithpri[m] joined #nim
10:33:23FromDiscord<Rika> In reply to @Isofruit "Hmmm if I pass": No, same idea as getting the variable name of a passed in integer; I don’t recall procs holding on to their names
10:33:25*reversem3[m] joined #nim
10:33:26*dithpri[m] is now known as Guest6277
10:33:40FromDiscord<d4rckh> In reply to @enthus1ast "<@648552095531663361> you told": yes socket
10:33:47FromDiscord<d4rckh> from std/net
10:35:06FromDiscord<enthus1ast> then you do not need await
10:35:15FromDiscord<enthus1ast> you only need to await async functions
10:35:40FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=416r
10:36:30FromDiscord<enthus1ast> idk if this works for you
10:36:58FromDiscord<Phil> you get a type from a typedesc and hash it and that gets you the name of... hmm I don't think I get it
10:37:26FromDiscord<enthus1ast> you can omit the hashing
10:37:45FromDiscord<Phil> if ty is for example `type Potato` , then $Potato likely gives you "Potato" and then you throw a type on top of it?
10:37:59FromDiscord<Phil> I'll compile that real quick
10:39:00FromDiscord<enthus1ast> mh it seems to not work, then you must use a macro i guess
10:40:00FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=416t
10:40:28FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=416u
10:41:31FromDiscord<Phil> So you get the proc signature, but not the proc name of "baa"
10:41:48FromDiscord<Phil> (edit) "signature," => "type,"
10:42:53FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=416v
10:43:12FromDiscord<Phil> Huh, that's actually pretty wild
10:43:46FromDiscord<Phil> std/macros has a lot of stuff in it
10:44:27FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=416w
10:47:24FromDiscord<Phil> sent a code paste, see https://paste.rs/nYW
10:49:49FromDiscord<Rika> Yeah you’re not really gonna be able to get the name without reforming the proc in some way
10:50:00FromDiscord<Rika> Or an intermediate type for the proc
10:51:18FromDiscord<Phil> My passing curiosity has thus been sated. I'd really just been wondering if you can dig deeper into a proc-parameter or not when I recalled how much crap comes bundled in python with functions
11:07:12*dtomato quit (Ping timeout: 276 seconds)
11:25:53FromDiscord<Zoom> Is there a way to get something like a `withLock` template, but safe to use inside a block, which could be escaped from (such as a loop body)?
11:27:39FromDiscord<Zoom> Ah, that would be a block-local variable with a custom destructor, thanks everybody.
11:34:18NimEventerNew Nimble package! pwnedpass - Check if a passphrase has been pwned using the Pwned Passwords v3 API, see https://github.com/foxoman/pwnedpass
11:44:50FromDiscord<Zoom> Well, except we still don't have overloadable `default` or `init=` to properly initialize the variable. 😠
11:46:59FromDiscord<d4rckh> In reply to @enthus1ast "you only need to": ah
11:47:03FromDiscord<d4rckh> now it compiles fine
11:47:48FromDiscord<d4rckh> but now it wont receive anything 🤔
11:48:26FromDiscord<d4rckh> i think its probably because i set it the recv size to `10000` so it will continue only after i sent `10000` bytes but im actually sending lines
11:50:08FromDiscord<d4rckh> i replaced recv with recvLine and not it behaves just like before lol
11:50:34FromDiscord<d4rckh> it waits 5 seconds and then waits for a new line to be received. but i dont want to wait for a new line if none was sent
11:51:19FromDiscord<enthus1ast> are you peeking?
11:51:42FromDiscord<d4rckh> yes
11:51:55FromDiscord<enthus1ast> mhh
11:52:05FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=416K
11:52:20FromDiscord<d4rckh> https://media.discordapp.net/attachments/371759389889003532/991310077908766750/unknown.png
11:53:06FromDiscord<enthus1ast> mhh maybe you must also set to non blocking
11:54:03FromDiscord<enthus1ast> https://pubs.opengroup.org/onlinepubs/007904975/functions/recv.html↵↵"If no messages are available at the socket and O\_NONBLOCK is not set on the socket's file descriptor, recv() shall block until a message arrives. If no messages are available at the socket and O\_NONBLOCK is set on the socket's file descriptor, recv() shall fail and set errno to [EAGAIN] or [EWOULDBLOCK]."
11:54:12FromDiscord<enthus1ast> maybe you must do nonblock even with peeking
11:54:38FromDiscord<enthus1ast> but then you application could behave differently on other cases
11:54:52FromDiscord<enthus1ast> on other places i mean
11:56:05FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=416L
11:57:30FromDiscord<Zoom> And there's also a risk of an unused variable being optimized out. Any other ideas?
12:01:08FromDiscord<Zoom> And the other idea is just put a block inside an enclosing block and use only `break` to leave the inner one (i.e. wait for when you forget about it and put `continue` and break everything) 🫤
12:09:43*dtomato joined #nim
12:17:23FromDiscord<d4rckh> In reply to @enthus1ast "but then you application": wdym could behave differently on other cases?
12:40:00FromDiscord<d4rckh> why is hasDataBuffered false? https://media.discordapp.net/attachments/371759389889003532/991322070661214218/unknown.png
12:40:43*jmdaemon quit (Ping timeout: 268 seconds)
13:04:08FromDiscord<d4rckh> is there any way of checking if there is data to be received?
13:04:17FromDiscord<d4rckh> (edit) "is there any ... way" added "other"
13:16:49*vicecea quit (Remote host closed the connection)
13:17:20*vicecea joined #nim
13:18:53FromDiscord<enthus1ast> when you rely on the blocking behaviour i mean↵(@d4rckh)
13:19:22FromDiscord<d4rckh> ah, but why hasDataBuffered doesnt work in that case?
13:19:54FromDiscord<enthus1ast> no clue
13:20:03FromDiscord<enthus1ast> s.isBuffered is maybe false?
13:30:10FromDiscord<d4rckh> yes
13:50:16*arkurious joined #nim
13:57:54FromDiscord<PyryTheBurger> how do i declare an empty seq
13:58:44FromDiscord<Prestige> `var foo: seq[int] = @[]` or whatever type you want
13:58:55FromDiscord<PyryTheBurger> oh
13:59:04FromDiscord<PyryTheBurger> and then i can add thingsd later right
14:01:19FromDiscord<enthus1ast> also foo.setLen(0)
14:03:06FromDiscord<PyryTheBurger> how do i make a seq that is full of a variable amount of seqs?
14:03:37FromDiscord<enthus1ast> could loop and create them
14:03:48FromDiscord<enthus1ast> not aware of a command that does this
14:03:58FromDiscord<PyryTheBurger> but how would i declare it
14:04:45FromDiscord<Prestige> `var foo: seq[seq[int]]` for instance
14:04:49FromDiscord<d4rckh> seq[seq[int]]
14:05:09FromDiscord<PyryTheBurger> but then dont i need that = @[[]] or smth
14:05:28FromDiscord<Prestige> you could do `foo.add(@[])` I think
14:06:00FromDiscord<d4rckh> no just @[]
14:06:15FromDiscord<PyryTheBurger> but the amount of seqs inside that could vary
14:06:30FromDiscord<enthus1ast> yes sequences can grow
14:06:31FromDiscord<d4rckh> seqs dont have a limit
14:06:59FromDiscord<PyryTheBurger> yeah ok imma try it
14:13:42FromDiscord<carmo> is there a way to have finer control over an object's creation?
14:14:10FromDiscord<carmo> i have this object that has three string fields, but I want two of them to get trimmed to a specific size when the object gets created
14:14:43FromDiscord<carmo> I considered making a proc for creating the object, but the constructor would still be available and that could cause some issues
14:15:47FromDiscord<carmo> is there maybe a way to disallow access to simply creating the object using `Object(fields)`?
14:15:56FromDiscord<Rika> dont export the type
14:16:11FromDiscord<Rika> that also means you cant use the type as a typedef outside of the module though 🙂
14:16:33FromDiscord<Rika> perhaps test for validity on all functions that use your type
14:16:42FromDiscord<Rika> process not use
14:16:54FromDiscord<Rika> but theres no other way otherwise
14:17:36FromDiscord<carmo> pity, seems a bit flawed imo
14:17:52FromDiscord<carmo> maybe I could export the type, but none of the fields and make custom setters/getters
14:18:13FromDiscord<carmo> and then allow use of the standard constructor and also provide a `initObj` proc
14:19:28FromDiscord<Rika> i forgot that works yeah
14:34:00FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=417t
14:37:43FromDiscord<Rika> perhaps there literally isnt any data buffered and you're blocking on recvline for a short time
14:41:04FromDiscord<d4rckh> well i sent data while the app is sleeping
14:42:22FromDiscord<d4rckh> there should be some data available
14:42:41FromDiscord<enthus1ast> any particular reason you do not want to use async for this btw?
15:03:24FromDiscord<PyryTheBurger> how do you do manual memory manangement in nim
15:13:44*rockcavera joined #nim
15:13:44*rockcavera quit (Changing host)
15:13:44*rockcavera joined #nim
15:19:43FromDiscord<frankcryptic> I'll help 10 individuals how to earn $20,000 in just 72 hours from the crypto market. But you will pay me 10% commission when you receive your profit. if interested send me a direct message via Whatapp by asking me HOW for more details on how to get started↵+1 (570) 801-0862
15:20:07FromDiscord<Kermithos> <@&371760044473319454>
15:24:24FromDiscord<d4rckh> In reply to @enthus1ast "any particular reason you": maybe i can use async
15:24:29FromDiscord<d4rckh> i use async for the server
15:30:55FromDiscord<Prestige> When publishing a nimble package, how is it looking for the github access token? I have one, but it just opens my browser for me to create a new token
15:42:30*krux02 joined #nim
15:55:59FromDiscord<deadmeme77> In reply to @PyryTheBurger "how do you do": I'm not sure, but from what I've read you use alloc, create, and dealloc, similar to C↵like https://play.nim-lang.org/#ix=3uVt
15:57:14FromDiscord<deadmeme77> though I don't think nim playground has the option to set -gc=none? You'd need to try in your own machine
15:57:50FromDiscord<!Patitotective> In reply to @Avahe "When publishing a nimble": after it opens the browser you can just enter the token in the termina
15:57:52FromDiscord<!Patitotective> (edit) "termina" => "terminal"
15:58:03FromDiscord<!Patitotective> (edit) "In reply to @Avahe "When publishing a nimble": after it opens the browser you can ... just" added "(close the tab and)"
16:03:57FromDiscord<gjyljljjl> Hi all. I'm wondering - is there an easy way to swap variables like in Python? e.g. a, b = b, a
16:04:33FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4182
16:04:57FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=4183
16:05:35FromDiscord<gjyljljjl> Thank you!
16:20:25FromDiscord<alehander42> hey
16:20:56FromDiscord<alehander42> i am changing some of my code from async to multithreading
16:21:52FromDiscord<alehander42> does it matter if i read from a global gc-ed variable?
16:22:11FromDiscord<alehander42> i know i get warnings/errors for that, but i am not sure why it's a problem to read from it
16:23:34FromDiscord<alehander42> i read that this is because of the gc and thread-specific heaps, but i am still not sure what's the problem with accessing it
16:23:55FromDiscord<alehander42> is it that it contents can move around?
16:24:00FromDiscord<alehander42> (edit) "it" => "its"
16:25:48FromDiscord<alehander42> i use `{.gcsafe.}` annotations to workaround that for now
16:26:00FromDiscord<alehander42> but now i see that many of the `mm` options use a shared heap anyway
16:27:41FromDiscord<Yardanico> In reply to @alehander42 "i know i get": Because with the default GC threads have local heap
16:27:45FromDiscord<alehander42> ok
16:28:00FromDiscord<alehander42> if i use a different one is it ok?
16:34:36NimEventerNew Nimble package! libp2pdht - DHT based on the libp2p Kademlia spec, see https://github.com/status-im/nim-libp2p
16:51:43*noeontheend joined #nim
17:17:47*krux02 quit (Remote host closed the connection)
17:18:50*krux02 joined #nim
17:25:09FromDiscord<ezquerra> How do you select among the different versions of an installed nimble package?
17:26:10FromDiscord<enthus1ast> i recently learned that you can use "nimble run" then it takes the annotated version from the nimble file
17:26:22FromDiscord<ezquerra> What if I am not using nimble?
17:26:29FromDiscord<ezquerra> I am compiling with nim c directly
17:26:43FromDiscord<ezquerra> (or rather, Visual Studio code is 😅)
17:27:01FromDiscord<Phil> sidenote, I'm pretty sure you can set up a tasks json so that it just goes "nimble release"
17:27:03FromDiscord<Phil> or the like
17:27:17FromDiscord<Phil> actually, let me see if I can do that right now
17:27:41FromDiscord<Phil> Yep, you can do that
17:27:45FromDiscord<ezquerra> Yeah, but how does the nim compiler itself decide which version to use when it is called directly?
17:28:30FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=418y
17:28:40FromDiscord<ezquerra> I'm just playing around with a simple, single file program. I do not need/want (unless 100% necessary) to create a nimble project just for that
17:28:53FromDiscord<enthus1ast> idk sorry
17:29:19*krux02 quit (Remote host closed the connection)
17:30:05*krux02 joined #nim
17:30:28FromDiscord<Phil> I know Yard is vaguely around, push comes shove, dom and bobeff (?) wrote most of nimble so they should know
17:30:41FromDiscord<Phil> (edit) "push" => "he's a decent candidate for knowing.↵Push"
17:30:52FromDiscord<enthus1ast> afaik the compiler gets the lib paths via nimble path
17:30:54FromDiscord<enthus1ast> "--NimblePath\:PATHadd a path for Nimble support"
17:31:11FromDiscord<ezquerra> I think that specifies where the root of the nimble path is
17:31:24FromDiscord<ezquerra> Which by default is ~/.nimble, I think
17:31:27FromDiscord<mahdibehkar> I use Moe↵(@ezquerra)
17:36:32FromDiscord<carmo> hey, so for whatever reason nimlsp refuses to work now, saying "illegal storage access" whenever I try to boot it up. any ideas?
17:37:34FromDiscord<carmo> (edit) "access"" => "access (attempt to read from nil?)""
17:50:05*noeontheend quit (Ping timeout: 260 seconds)
17:50:05FromDiscord<Phil> Hmmm nimlsp is written in nim so that smells like there's a ref object accessed somewhere that hasn't been initialized
17:52:09FromDiscord<carmo> ...and now when I tried to launch it again it worked
17:52:11FromDiscord<carmo> wack
17:52:27FromDiscord<Phil> Is nimlsp multithreaded? Sounds like a race condition
17:52:41FromDiscord<carmo> last I checked it only had one thread running on my pc
17:52:54FromDiscord<Yardanico> In reply to @Isofruit "Hmmm nimlsp is written": It uses nimsuggest as a library
17:53:01FromDiscord<Yardanico> And nimsuggest can be pretty weird
17:53:25FromDiscord<carmo> it uses a static version of nimsuggest right
17:53:42FromDiscord<Phil> Check. Other question, does nimlsp provide any benefits over to e.g. the vscode packages?
17:53:42FromDiscord<Yardanico> It just uses it as a library
17:53:48FromDiscord<carmo> (as in it comes with the nimlsp installation as opposed to the one that is installed with nim)
17:54:06FromDiscord<Yardanico> In reply to @Isofruit "Check. Other question, does": Not really, it allowd you to use editors that don't have a Nim plugin but have LSP support
17:54:11FromDiscord<Phil> check
17:54:15FromDiscord<carmo> yeah I use emacs
17:54:23FromDiscord<Yardanico> In reply to @CarmoNoSadame "(as in it comes": nimlsp uses nimsuggest you have installed when you're installing it
17:54:24FromDiscord<carmo> so I no nim plugin
17:54:30FromDiscord<Yardanico> There's an Emacs plugin
17:54:36FromDiscord<Yardanico> that has direct nimsuggest support
17:54:40FromDiscord<Yardanico> Not sure how good it is
17:54:41FromDiscord<carmo> nim-mode, you mean?
17:54:44FromDiscord<carmo> it was kinda... wack
17:54:58FromDiscord<carmo> it's because lsp-mode is a lot more interesting
17:55:06FromDiscord<carmo> but ofc, it needs an lsp
17:57:37FromDiscord<Prestige> In reply to @Patitotective "after it opens the": Thanks, I didn't know it even wanted me to input anything. Lol
18:30:26FromDiscord<soundmodel> Anyone know how Nim-to-JS single-page apps do GUI?
18:36:19FromDiscord<soundmodel> Or any other input on PWAs using Nim?
18:45:08FromDiscord<tandy> i made a spa in nim↵(@soundmodel)
18:51:46FromDiscord<ynfle> I think karax uses vdom
19:08:35*noeontheend joined #nim
19:19:36FromDiscord<soundmodel> I've been really confused about viability of PWAs, but they could be the only way to use something else than Java on Android.
19:19:45FromDiscord<soundmodel> (edit) "I've been really confused about ... viability" added "the"
19:30:49*pro joined #nim
19:32:45*noeontheend quit (Ping timeout: 260 seconds)
19:37:06*krux02 quit (Remote host closed the connection)
19:42:45*pro quit (Quit: pro)
20:01:36*adium quit (*.net *.split)
20:01:36*ltriant quit (*.net *.split)
20:01:36*gsalazar quit (*.net *.split)
20:01:36*ehmry quit (*.net *.split)
20:01:36*Network2501 quit (*.net *.split)
20:01:37*arkanoid quit (*.net *.split)
20:01:37*dom96 quit (*.net *.split)
20:01:37*void09 quit (*.net *.split)
20:01:38*Guest6277 quit (*.net *.split)
20:01:38*reversem3[m] quit (*.net *.split)
20:01:38*ecs quit (*.net *.split)
20:01:38*toothlessgear quit (*.net *.split)
20:01:38*dmichiels quit (*.net *.split)
20:01:38*Schnouki quit (*.net *.split)
20:01:39*Ekho quit (*.net *.split)
20:01:39*tafa quit (*.net *.split)
20:01:39*GreaseMonkey quit (*.net *.split)
20:01:40*oprypin quit (*.net *.split)
20:01:40*averell quit (*.net *.split)
20:01:40*lain quit (*.net *.split)
20:01:40*Onionhammer quit (*.net *.split)
20:01:40*koltrast quit (*.net *.split)
20:01:40*CAPSLOCKSTOAT quit (*.net *.split)
20:04:08*xet7 joined #nim
20:04:12*xet7 quit (Remote host closed the connection)
20:04:26*xet7 joined #nim
20:06:20*xet7 quit (Remote host closed the connection)
20:06:48*systemdsucks quit (Ping timeout: 248 seconds)
20:07:43*systemdsucks joined #nim
20:14:45*reversem3[m] joined #nim
20:14:45*Guest6277 joined #nim
20:14:45*adium joined #nim
20:14:45*GreaseMonkey joined #nim
20:14:45*ltriant joined #nim
20:14:45*gsalazar joined #nim
20:14:45*void09 joined #nim
20:14:45*ehmry joined #nim
20:14:45*Network2501 joined #nim
20:14:45*arkanoid joined #nim
20:14:45*oprypin joined #nim
20:14:45*dom96 joined #nim
20:14:45*averell joined #nim
20:14:45*tafa joined #nim
20:14:45*ecs joined #nim
20:14:45*toothlessgear joined #nim
20:14:45*dmichiels joined #nim
20:14:45*Schnouki joined #nim
20:14:45*lain joined #nim
20:14:45*Onionhammer joined #nim
20:14:45*Ekho joined #nim
20:14:45*koltrast joined #nim
20:14:45*CAPSLOCKSTOAT joined #nim
20:55:44*noeontheend joined #nim
21:25:21NimEventerNew thread by Matthesoundman: How to pass int pointer to C?, see https://forum.nim-lang.org/t/9270
21:58:18*noeontheend quit (Ping timeout: 264 seconds)
22:13:00FromDiscord<soundmodel> In reply to @soundmodel "I've been really confused": But I've also been confused as to why I'd look for Nim for the use cases that are already quite covered by Java.
22:27:17*matt_13377 quit (Remote host closed the connection)
22:27:19*sagax joined #nim
22:27:33*matt_13377 joined #nim
22:28:42FromDiscord<exelotl> Java is so painful to use... but other JVM languages like Kotlin are a great fit for Android development
22:32:40FromDiscord<exelotl> the main reason you'd make an Android app in Nim is because you wanted to, or maybe if Nim happened a good fit for the kind of app you wanted to make (e.g. a video game which doesn't have to rely on native UI)
22:36:58*jmdaemon joined #nim
23:35:45*matt_13377 quit (Quit: Ping timeout (120 seconds))
23:36:01*matt_13377 joined #nim
23:46:16*noeontheend joined #nim
23:48:19FromDiscord<Prestige> Is it cumbersome to make an android app in Nim because the tooling isn't really there, or is there a lot of jumping through hoops to make it work?
23:48:49FromDiscord<Elegantbeef> IME it's due to tedium of native code on android
23:50:01FromDiscord<Elegantbeef> i mean it's not too annoying to do with SDL2 but the entire android build experience is fucking terrible