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:54 | NimEventer | New 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:28 | FromDiscord | <CarmoNoSadame> heya friends, I'm somewhat new to nim, would it be alright to ask a question regarding nim on emacs here? |
00:49:49 | FromDiscord | <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:09 | FromDiscord | <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:23 | FromDiscord | <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:11 | FromDiscord | <Elegantbeef> There is nimlsp which doesnt rely on `--v3` |
01:04:29 | FromDiscord | <carmo> is there much of a difference between it and nimlangserver? |
01:05:08 | FromDiscord | <Elegantbeef> nimlsp doesnt rely on modern changes, but it has issues |
01:05:40 | FromDiscord | <carmo> hmm, I'll try it |
01:06:05 | FromDiscord | <carmo> but still, why is the --v3 option missing? just trying to understand how exactly the versioning works here |
01:06:19 | FromDiscord | <Elegantbeef> Cause it's for the devel nimsuggest |
01:08:35 | FromDiscord | <carmo> they mentioned this commit that apparently got merged to the nim-lang:version-1-6 branch |
01:08:36 | FromDiscord | <carmo> https://github.com/nim-lang/Nim/pull/19892 |
01:08:49 | FromDiscord | <carmo> is that branch part of the devel branch(es)? |
01:09:04 | FromDiscord | <Elegantbeef> It means it'll be backported to the next 1.6.x release |
01:09:20 | FromDiscord | <carmo> oh, to the next one, icic |
01:09:32 | FromDiscord | <carmo> ty, it makes more sense now |
01:09:37 | FromDiscord | <carmo> still learning how things work hehe |
01:27:10 | FromDiscord | <Yardanico> @ElegantBeef you around? |
01:27:25 | FromDiscord | <Elegantbeef> Depends are you a cop? |
01:27:32 | FromDiscord | <Yardanico> not as of now |
01:27:38 | FromDiscord | <Yardanico> do you think it's intended that https://play.nim-lang.org/#ix=415f works or not? |
01:27:49 | FromDiscord | <Yardanico> I thought you couldn't convert (!) negative numbers to uint |
01:27:50 | FromDiscord | <Yardanico> only cast |
01:27:56 | FromDiscord | <Yardanico> but this seems to behave like a cast |
01:28:24 | FromDiscord | <Yardanico> I guess it's because Ordinal is a separate type from negative integer types |
01:28:39 | FromDiscord | <Yardanico> Ordinal[T] {.magic: Ordinal.} |
01:34:20 | FromDiscord | <Elegantbeef> Dont know if it should work seems somewhat bugg |
01:37:07 | FromDiscord | <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:11 | FromDiscord | <Yardanico> actually it doesn't have compile-time vs runtime hash comparison either |
01:40:35 | FromDiscord | <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:48 | FromDiscord | <Yardanico> hashes.nim has some weird logic for JS |
02:06:35 | * | wallabra joined #nim |
02:06:44 | FromDiscord | <Yardanico> aha |
02:07:31 | FromDiscord | <Yardanico> 🤔 |
02:10:43 | FromDiscord | <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:32 | FromDiscord | <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:10 | FromDiscord | <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:53 | FromDiscord | <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:14 | FromDiscord | <Yardanico> Unless the intention was reverse to do `cast[Hash](x) and cast[Hash](0xFFFFFFFF)` in both cases |
02:15:45 | FromDiscord | <Yardanico> but that would make hashing not work for any big enough integers |
02:16:58 | NimEventer | New post on r/nim by owl_000: Nimeme, see https://reddit.com/r/nim/comments/vmbxwg/nimeme/ |
02:30:34 | FromDiscord | <🐒🧠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:12 | FromDiscord | <Elegantbeef> No it reads small chunks |
02:32:59 | FromDiscord | <🐒🧠br4n_d0n> So what would be considered a "line" in that example if it's all one minified file? |
02:33:12 | FromDiscord | <Yardanico> if it's 1 line then it'll be 1 line obviously |
02:33:16 | FromDiscord | <Yardanico> `lines` iterator iterates, well, on lines |
02:33:32 | FromDiscord | <Yardanico> bytes of text that are separated by LF or CRLF |
02:34:04 | FromDiscord | <🐒🧠br4n_d0n> So, what happens if I have something like a 1 GB file like this? |
02:34:13 | FromDiscord | <Yardanico> it'll have to load whole 1GB obviously |
02:34:14 | FromDiscord | <Yardanico> since it's 1 line |
02:34:26 | FromDiscord | <Elegantbeef> It's likely to have `\n` in it |
02:34:33 | FromDiscord | <Yardanico> In reply to @Elegantbeef "It's likely to have": not really |
02:34:40 | FromDiscord | <Yardanico> minified files usually get stripped of newlines for things like JS |
02:34:50 | FromDiscord | <Elegantbeef> oh i thought they meant binary |
02:35:07 | FromDiscord | <🐒🧠br4n_d0n> Damn, so what be the most efficient method to read a file like that then? |
02:35:13 | FromDiscord | <Yardanico> depends on what you want to do with it |
02:35:31 | FromDiscord | <🐒🧠br4n_d0n> Parse it for certain characters and strings |
02:35:40 | FromDiscord | <Yardanico> you can read in chunks yourself |
02:35:46 | FromDiscord | <Yardanico> and look for certain characters and strings |
02:36:02 | FromDiscord | <xflywind> In reply to @Yardanico "then there's also `if": We probably can drop hasBigInt, since IE is dead. |
02:36:18 | FromDiscord | <Yardanico> maybe, but it doesn't work even then for negative numbers |
02:37:08 | FromDiscord | <xflywind> Yeah, I'm checking the example. |
02:37:42 | FromDiscord | <Yardanico> is enough to test it |
02:37:45 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=415o |
02:38:23 | FromDiscord | <xflywind> thanks |
02:38:34 | FromDiscord | <🐒🧠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:14 | FromDiscord | <Yardanico> yeah probably, with the way described in the other deprecated readChars overload |
02:40:16 | FromDiscord | <Yardanico> or use streams |
02:40:28 | FromDiscord | <Yardanico> or https://nim-lang.org/docs/memfiles.html |
02:48:27 | FromDiscord | <carmo> is there a way to copy a slice of a string to a char array? |
02:50:20 | FromDiscord | <carmo> sent a code paste, see https://paste.rs/Rhj |
02:51:34 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=415q |
02:51:36 | * | noeontheend joined #nim |
02:51:40 | FromDiscord | <Yardanico> ofc if you use unsafe features you can use `copyMem` or similar |
02:52:33 | FromDiscord | <carmo> hmm yeah copyMem could work as well |
02:52:39 | FromDiscord | <Yardanico> well, it's better to be safe |
02:52:39 | FromDiscord | <carmo> but I'll stick to that other form for now |
02:52:44 | FromDiscord | <Yardanico> also, Nim has inclusive ranges |
02:52:45 | FromDiscord | <carmo> ye |
02:52:52 | FromDiscord | <Yardanico> so 0..5 means from 0 to 5th character inclusively |
02:52:55 | FromDiscord | <Yardanico> which means 6 characters |
02:53:12 | FromDiscord | <Yardanico> if you want 5 characters you'd do 0..4 |
02:53:17 | FromDiscord | <carmo> yeah I also noticed that right after I posted lol, gonna take a lil bit getting used to |
02:54:21 | FromDiscord | <carmo> but ty! |
02:54:23 | noeontheend | Or 0..<5, which you might find clearer |
02:55:48 | FromDiscord | <🐒🧠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:01 | FromDiscord | <Yardanico> well, I did `0..<t.len` as you can see |
02:57:05 | FromDiscord | <Yardanico> which is the same as `0..t.len-1` |
02:57:19 | FromDiscord | <Yardanico> he was talking about general usage of ranges |
02:57:46 | FromDiscord | <carmo> for this case it could be `0..^1` too, right? |
02:57:53 | FromDiscord | <carmo> in the case of t |
02:57:55 | FromDiscord | <carmo> (edit) "t" => "`t`" |
02:58:04 | FromDiscord | <carmo> (edit) "`t`" => "`t`, not `s`" |
02:59:09 | FromDiscord | <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:15 | FromDiscord | <carmo> (edit) "but on another note, what would be a good way of turning a char ... into" added "array" |
03:00:09 | FromDiscord | <carmo> I assume I could do the same thing we did here but backwards (copying the ranges, I mean) |
03:00:55 | FromDiscord | <Elegantbeef> you dont you write a proc that takes `openarray[char]` 😛 |
03:02:30 | FromDiscord | <🐒🧠br4n_d0n> Umm, isn't a string a char array with the added `\0` character? |
03:05:04 | FromDiscord | <carmo> oh yeah right, elegantbeef, that's much easier hehe |
03:05:38 | FromDiscord | <carmo> can openarrays be passed with `var`, though, to modify the original variable? |
03:05:45 | FromDiscord | <Elegantbeef> yes |
03:05:47 | FromDiscord | <Elegantbeef> cant grow them |
03:05:58 | FromDiscord | <carmo> yeah that's nice, no need to grow |
03:06:06 | FromDiscord | <carmo> I'll be reading a string from stdin and then just trimming |
03:06:09 | FromDiscord | <carmo> (edit) "trimming" => "trim it" |
03:06:16 | FromDiscord | <carmo> (edit) "I'll be reading a string from stdin and then just trim it ... " added "using slices" |
03:07:12 | FromDiscord | <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:39 | FromDiscord | <carmo> and the data structure I'm serializing only allows strings of very specific lengths |
03:07:48 | FromDiscord | <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:43 | FromDiscord | <proton> How is the GPU backend going? |
07:28:46 | FromDiscord | <eyecon> In reply to @Elegantbeef "cant grow them": Can we shrink them, or is the size fixed? |
08:06:06 | FromDiscord | <Entikan> sent a code paste, see https://play.nim-lang.org/#ix=415T |
08:07:50 | FromDiscord | <Elegantbeef> Cant change their size whatsoever they're pointer + len↵(@eyecon) |
08:08:08 | FromDiscord | <Elegantbeef> Tuples are not objects so no it's not↵(@Entikan) |
08:09:00 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=415U |
08:41:17 | FromDiscord | <eyecon> In reply to @Elegantbeef "Cant change their size": Ty! |
09:05:56 | FromDiscord | <mahdibehkar> Does nim Garbage Collection use orc/arc by default? |
09:09:38 | FromDiscord | <Rika> Not as of now |
09:17:25 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=4169 |
09:17:55 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=416a |
09:17:58 | FromDiscord | <ripluke> Does Nim work well with copilot? Like well enough to switch from neovim to vscode |
09:19:02 | FromDiscord | <d4rckh> (edit) "https://play.nim-lang.org/#ix=4169" => "https://play.nim-lang.org/#ix=416c" |
09:19:05 | FromDiscord | <enthus1ast> you might be able to check if data is still buffered and keep calling recvLine↵(@d4rckh) |
09:19:08 | FromDiscord | <d4rckh> (edit) "https://play.nim-lang.org/#ix=416c" => "https://play.nim-lang.org/#ix=416d" |
09:19:40 | FromDiscord | <d4rckh> In reply to @enthus1ast "you might be able": how can i do that? |
09:19:58 | FromDiscord | <d4rckh> `socket.isBuffered`? |
09:20:05 | FromDiscord | <enthus1ast> mh |
09:20:06 | FromDiscord | <enthus1ast> no |
09:20:17 | FromDiscord | <enthus1ast> https://nim-lang.org/docs/net.html#hasDataBuffered%2CSocket |
09:20:31 | FromDiscord | <d4rckh> ah |
09:20:33 | FromDiscord | <d4rckh> haha okay thanks |
09:21:08 | FromDiscord | <enthus1ast> another option is to peek on the socket |
09:21:36 | FromDiscord | <enthus1ast> this way you could peek first if a whole line is received, then read, |
09:21:51 | FromDiscord | <enthus1ast> when data is buffered it could be that no complete line has been received yet |
09:22:18 | FromDiscord | <enthus1ast> i think it depends if you can tolerate that your applications stalls on a read |
09:23:08 | FromDiscord | <d4rckh> yeah that does not seem to work |
09:23:23 | FromDiscord | <d4rckh> 🤔 or maybe im doing something wrong https://media.discordapp.net/attachments/371759389889003532/991272592650543135/unknown.png |
09:23:30 | FromDiscord | <d4rckh> i have a recvLine call instead the second while |
09:24:33 | FromDiscord | <d4rckh> how can i peek first? |
09:25:28 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=416f |
09:26:04 | FromDiscord | <enthus1ast> in your case it would be recvLine i guess |
09:26:17 | FromDiscord | <d4rckh> do i keep the second while loop? |
09:26:44 | FromDiscord | <enthus1ast> a peek does not block, so it will be a busy loop |
09:28:01 | FromDiscord | <enthus1ast> i do not know the best practive in your case, maybe play with it a little |
09:29:40 | FromDiscord | <d4rckh> hmm, and what would the buffer be? |
09:29:42 | FromDiscord | <d4rckh> a string? |
09:30:14 | FromDiscord | <enthus1ast> just copied the line from old code of mine |
09:30:15 | FromDiscord | <enthus1ast> i |
09:30:33 | FromDiscord | <d4rckh> looks like recv in that case returns a string |
09:30:38 | FromDiscord | <enthus1ast> yes |
09:30:45 | FromDiscord | <d4rckh> so i assume buffer will be the list of lines that i need to handle at that time |
09:30:55 | FromDiscord | <d4rckh> and then i empty it and wait again? |
09:31:05 | FromDiscord | <enthus1ast> yeah could work |
09:32:08 | FromDiscord | <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:41 | FromDiscord | <enthus1ast> i guess we have no decent disam in nim right? |
09:33:54 | FromDiscord | <enthus1ast> so i might just use capstone |
09:43:24 | FromDiscord | <d4rckh> https://media.discordapp.net/attachments/371759389889003532/991277627186876446/unknown.png |
09:43:25 | FromDiscord | <d4rckh> hm what |
09:51:10 | FromDiscord | <deadmeme77> In reply to @ripluke "Does Nim work well": I dont think they have any option to output nim code yet |
09:53:03 | FromDiscord | <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:54 | FromDiscord | <Rika> In reply to @d4rckh "": You’re discarding something that doesn’t return anything are you |
10:15:44 | FromDiscord | <Rika> Copilot tries to be language agnostic but Nim is so close to Python that it becomes confused |
10:19:44 | FromDiscord | <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:43 | FromDiscord | <Rika> Can you show the whole context? Or can you try compiling and not just looking at editor errors |
10:21:19 | FromDiscord | <d4rckh> ouch |
10:21:20 | FromDiscord | <d4rckh> right |
10:21:29 | FromDiscord | <d4rckh> I get `Error: await expects Future[T], got string` when I try to compile |
10:21:49 | FromDiscord | <d4rckh> located here https://media.discordapp.net/attachments/371759389889003532/991287297444167730/unknown.png |
10:22:00 | FromDiscord | <d4rckh> (edit) "here" => "in `C:\nim-1.6.6\lib\pure\asyncmacro.nim(126, 11)`" |
10:22:01 | FromDiscord | <d4rckh> lol |
10:22:08 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=416m |
10:23:28 | FromDiscord | <d4rckh> https://www.toptal.com/developers/hastebin/loqotimaga.csharp |
10:23:35 | FromDiscord | <d4rckh> here's more context |
10:24:01 | FromDiscord | <d4rckh> In reply to @d4rckh "im using sockets, can": i am trying to do this |
10:29:42 | FromDiscord | <enthus1ast> does one know who manages the discord \<-\> matrix bridge? |
10:30:20 | FromDiscord | <enthus1ast> because there seems to be an error somewhere |
10:30:24 | FromDiscord | <enthus1ast> image.png https://media.discordapp.net/attachments/371759389889003532/991289458165039114/image.png |
10:30:41 | FromDiscord | <enthus1ast> "This event could not be displayed" |
10:30:53 | FromDiscord | <enthus1ast> i saw this a few times already |
10:30:55 | FromDiscord | <Phil> Yard maybe? Not sure why his name was the first that popped into my head |
10:32:14 | FromDiscord | <Rika> In reply to @d4rckh "I get `Error: await": That means as it says |
10:32:21 | FromDiscord | <Rika> You’re awaiting something that you can’t await |
10:32:53 | FromDiscord | <enthus1ast> @d4rckh you told me you use socket, not asyncsocket right? |
10:33:04 | * | dithpri[m] joined #nim |
10:33:23 | FromDiscord | <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:40 | FromDiscord | <d4rckh> In reply to @enthus1ast "<@648552095531663361> you told": yes socket |
10:33:47 | FromDiscord | <d4rckh> from std/net |
10:35:06 | FromDiscord | <enthus1ast> then you do not need await |
10:35:15 | FromDiscord | <enthus1ast> you only need to await async functions |
10:35:40 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=416r |
10:36:30 | FromDiscord | <enthus1ast> idk if this works for you |
10:36:58 | FromDiscord | <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:26 | FromDiscord | <enthus1ast> you can omit the hashing |
10:37:45 | FromDiscord | <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:59 | FromDiscord | <Phil> I'll compile that real quick |
10:39:00 | FromDiscord | <enthus1ast> mh it seems to not work, then you must use a macro i guess |
10:40:00 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=416t |
10:40:28 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=416u |
10:41:31 | FromDiscord | <Phil> So you get the proc signature, but not the proc name of "baa" |
10:41:48 | FromDiscord | <Phil> (edit) "signature," => "type," |
10:42:53 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=416v |
10:43:12 | FromDiscord | <Phil> Huh, that's actually pretty wild |
10:43:46 | FromDiscord | <Phil> std/macros has a lot of stuff in it |
10:44:27 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=416w |
10:47:24 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/nYW |
10:49:49 | FromDiscord | <Rika> Yeah you’re not really gonna be able to get the name without reforming the proc in some way |
10:50:00 | FromDiscord | <Rika> Or an intermediate type for the proc |
10:51:18 | FromDiscord | <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:53 | FromDiscord | <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:39 | FromDiscord | <Zoom> Ah, that would be a block-local variable with a custom destructor, thanks everybody. |
11:34:18 | NimEventer | New Nimble package! pwnedpass - Check if a passphrase has been pwned using the Pwned Passwords v3 API, see https://github.com/foxoman/pwnedpass |
11:44:50 | FromDiscord | <Zoom> Well, except we still don't have overloadable `default` or `init=` to properly initialize the variable. 😠 |
11:46:59 | FromDiscord | <d4rckh> In reply to @enthus1ast "you only need to": ah |
11:47:03 | FromDiscord | <d4rckh> now it compiles fine |
11:47:48 | FromDiscord | <d4rckh> but now it wont receive anything 🤔 |
11:48:26 | FromDiscord | <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:08 | FromDiscord | <d4rckh> i replaced recv with recvLine and not it behaves just like before lol |
11:50:34 | FromDiscord | <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:19 | FromDiscord | <enthus1ast> are you peeking? |
11:51:42 | FromDiscord | <d4rckh> yes |
11:51:55 | FromDiscord | <enthus1ast> mhh |
11:52:05 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=416K |
11:52:20 | FromDiscord | <d4rckh> https://media.discordapp.net/attachments/371759389889003532/991310077908766750/unknown.png |
11:53:06 | FromDiscord | <enthus1ast> mhh maybe you must also set to non blocking |
11:54:03 | FromDiscord | <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:12 | FromDiscord | <enthus1ast> maybe you must do nonblock even with peeking |
11:54:38 | FromDiscord | <enthus1ast> but then you application could behave differently on other cases |
11:54:52 | FromDiscord | <enthus1ast> on other places i mean |
11:56:05 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=416L |
11:57:30 | FromDiscord | <Zoom> And there's also a risk of an unused variable being optimized out. Any other ideas? |
12:01:08 | FromDiscord | <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:23 | FromDiscord | <d4rckh> In reply to @enthus1ast "but then you application": wdym could behave differently on other cases? |
12:40:00 | FromDiscord | <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:08 | FromDiscord | <d4rckh> is there any way of checking if there is data to be received? |
13:04:17 | FromDiscord | <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:53 | FromDiscord | <enthus1ast> when you rely on the blocking behaviour i mean↵(@d4rckh) |
13:19:22 | FromDiscord | <d4rckh> ah, but why hasDataBuffered doesnt work in that case? |
13:19:54 | FromDiscord | <enthus1ast> no clue |
13:20:03 | FromDiscord | <enthus1ast> s.isBuffered is maybe false? |
13:30:10 | FromDiscord | <d4rckh> yes |
13:50:16 | * | arkurious joined #nim |
13:57:54 | FromDiscord | <PyryTheBurger> how do i declare an empty seq |
13:58:44 | FromDiscord | <Prestige> `var foo: seq[int] = @[]` or whatever type you want |
13:58:55 | FromDiscord | <PyryTheBurger> oh |
13:59:04 | FromDiscord | <PyryTheBurger> and then i can add thingsd later right |
14:01:19 | FromDiscord | <enthus1ast> also foo.setLen(0) |
14:03:06 | FromDiscord | <PyryTheBurger> how do i make a seq that is full of a variable amount of seqs? |
14:03:37 | FromDiscord | <enthus1ast> could loop and create them |
14:03:48 | FromDiscord | <enthus1ast> not aware of a command that does this |
14:03:58 | FromDiscord | <PyryTheBurger> but how would i declare it |
14:04:45 | FromDiscord | <Prestige> `var foo: seq[seq[int]]` for instance |
14:04:49 | FromDiscord | <d4rckh> seq[seq[int]] |
14:05:09 | FromDiscord | <PyryTheBurger> but then dont i need that = @[[]] or smth |
14:05:28 | FromDiscord | <Prestige> you could do `foo.add(@[])` I think |
14:06:00 | FromDiscord | <d4rckh> no just @[] |
14:06:15 | FromDiscord | <PyryTheBurger> but the amount of seqs inside that could vary |
14:06:30 | FromDiscord | <enthus1ast> yes sequences can grow |
14:06:31 | FromDiscord | <d4rckh> seqs dont have a limit |
14:06:59 | FromDiscord | <PyryTheBurger> yeah ok imma try it |
14:13:42 | FromDiscord | <carmo> is there a way to have finer control over an object's creation? |
14:14:10 | FromDiscord | <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:43 | FromDiscord | <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:47 | FromDiscord | <carmo> is there maybe a way to disallow access to simply creating the object using `Object(fields)`? |
14:15:56 | FromDiscord | <Rika> dont export the type |
14:16:11 | FromDiscord | <Rika> that also means you cant use the type as a typedef outside of the module though 🙂 |
14:16:33 | FromDiscord | <Rika> perhaps test for validity on all functions that use your type |
14:16:42 | FromDiscord | <Rika> process not use |
14:16:54 | FromDiscord | <Rika> but theres no other way otherwise |
14:17:36 | FromDiscord | <carmo> pity, seems a bit flawed imo |
14:17:52 | FromDiscord | <carmo> maybe I could export the type, but none of the fields and make custom setters/getters |
14:18:13 | FromDiscord | <carmo> and then allow use of the standard constructor and also provide a `initObj` proc |
14:19:28 | FromDiscord | <Rika> i forgot that works yeah |
14:34:00 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=417t |
14:37:43 | FromDiscord | <Rika> perhaps there literally isnt any data buffered and you're blocking on recvline for a short time |
14:41:04 | FromDiscord | <d4rckh> well i sent data while the app is sleeping |
14:42:22 | FromDiscord | <d4rckh> there should be some data available |
14:42:41 | FromDiscord | <enthus1ast> any particular reason you do not want to use async for this btw? |
15:03:24 | FromDiscord | <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:43 | FromDiscord | <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:07 | FromDiscord | <Kermithos> <@&371760044473319454> |
15:24:24 | FromDiscord | <d4rckh> In reply to @enthus1ast "any particular reason you": maybe i can use async |
15:24:29 | FromDiscord | <d4rckh> i use async for the server |
15:30:55 | FromDiscord | <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:59 | FromDiscord | <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:14 | FromDiscord | <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:50 | FromDiscord | <!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:52 | FromDiscord | <!Patitotective> (edit) "termina" => "terminal" |
15:58:03 | FromDiscord | <!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:57 | FromDiscord | <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:33 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4182 |
16:04:57 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=4183 |
16:05:35 | FromDiscord | <gjyljljjl> Thank you! |
16:20:25 | FromDiscord | <alehander42> hey |
16:20:56 | FromDiscord | <alehander42> i am changing some of my code from async to multithreading |
16:21:52 | FromDiscord | <alehander42> does it matter if i read from a global gc-ed variable? |
16:22:11 | FromDiscord | <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:34 | FromDiscord | <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:55 | FromDiscord | <alehander42> is it that it contents can move around? |
16:24:00 | FromDiscord | <alehander42> (edit) "it" => "its" |
16:25:48 | FromDiscord | <alehander42> i use `{.gcsafe.}` annotations to workaround that for now |
16:26:00 | FromDiscord | <alehander42> but now i see that many of the `mm` options use a shared heap anyway |
16:27:41 | FromDiscord | <Yardanico> In reply to @alehander42 "i know i get": Because with the default GC threads have local heap |
16:27:45 | FromDiscord | <alehander42> ok |
16:28:00 | FromDiscord | <alehander42> if i use a different one is it ok? |
16:34:36 | NimEventer | New 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:09 | FromDiscord | <ezquerra> How do you select among the different versions of an installed nimble package? |
17:26:10 | FromDiscord | <enthus1ast> i recently learned that you can use "nimble run" then it takes the annotated version from the nimble file |
17:26:22 | FromDiscord | <ezquerra> What if I am not using nimble? |
17:26:29 | FromDiscord | <ezquerra> I am compiling with nim c directly |
17:26:43 | FromDiscord | <ezquerra> (or rather, Visual Studio code is 😅) |
17:27:01 | FromDiscord | <Phil> sidenote, I'm pretty sure you can set up a tasks json so that it just goes "nimble release" |
17:27:03 | FromDiscord | <Phil> or the like |
17:27:17 | FromDiscord | <Phil> actually, let me see if I can do that right now |
17:27:41 | FromDiscord | <Phil> Yep, you can do that |
17:27:45 | FromDiscord | <ezquerra> Yeah, but how does the nim compiler itself decide which version to use when it is called directly? |
17:28:30 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=418y |
17:28:40 | FromDiscord | <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:53 | FromDiscord | <enthus1ast> idk sorry |
17:29:19 | * | krux02 quit (Remote host closed the connection) |
17:30:05 | * | krux02 joined #nim |
17:30:28 | FromDiscord | <Phil> I know Yard is vaguely around, push comes shove, dom and bobeff (?) wrote most of nimble so they should know |
17:30:41 | FromDiscord | <Phil> (edit) "push" => "he's a decent candidate for knowing.↵Push" |
17:30:52 | FromDiscord | <enthus1ast> afaik the compiler gets the lib paths via nimble path |
17:30:54 | FromDiscord | <enthus1ast> "--NimblePath\:PATHadd a path for Nimble support" |
17:31:11 | FromDiscord | <ezquerra> I think that specifies where the root of the nimble path is |
17:31:24 | FromDiscord | <ezquerra> Which by default is ~/.nimble, I think |
17:31:27 | FromDiscord | <mahdibehkar> I use Moe↵(@ezquerra) |
17:36:32 | FromDiscord | <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:34 | FromDiscord | <carmo> (edit) "access"" => "access (attempt to read from nil?)"" |
17:50:05 | * | noeontheend quit (Ping timeout: 260 seconds) |
17:50:05 | FromDiscord | <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:09 | FromDiscord | <carmo> ...and now when I tried to launch it again it worked |
17:52:11 | FromDiscord | <carmo> wack |
17:52:27 | FromDiscord | <Phil> Is nimlsp multithreaded? Sounds like a race condition |
17:52:41 | FromDiscord | <carmo> last I checked it only had one thread running on my pc |
17:52:54 | FromDiscord | <Yardanico> In reply to @Isofruit "Hmmm nimlsp is written": It uses nimsuggest as a library |
17:53:01 | FromDiscord | <Yardanico> And nimsuggest can be pretty weird |
17:53:25 | FromDiscord | <carmo> it uses a static version of nimsuggest right |
17:53:42 | FromDiscord | <Phil> Check. Other question, does nimlsp provide any benefits over to e.g. the vscode packages? |
17:53:42 | FromDiscord | <Yardanico> It just uses it as a library |
17:53:48 | FromDiscord | <carmo> (as in it comes with the nimlsp installation as opposed to the one that is installed with nim) |
17:54:06 | FromDiscord | <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:11 | FromDiscord | <Phil> check |
17:54:15 | FromDiscord | <carmo> yeah I use emacs |
17:54:23 | FromDiscord | <Yardanico> In reply to @CarmoNoSadame "(as in it comes": nimlsp uses nimsuggest you have installed when you're installing it |
17:54:24 | FromDiscord | <carmo> so I no nim plugin |
17:54:30 | FromDiscord | <Yardanico> There's an Emacs plugin |
17:54:36 | FromDiscord | <Yardanico> that has direct nimsuggest support |
17:54:40 | FromDiscord | <Yardanico> Not sure how good it is |
17:54:41 | FromDiscord | <carmo> nim-mode, you mean? |
17:54:44 | FromDiscord | <carmo> it was kinda... wack |
17:54:58 | FromDiscord | <carmo> it's because lsp-mode is a lot more interesting |
17:55:06 | FromDiscord | <carmo> but ofc, it needs an lsp |
17:57:37 | FromDiscord | <Prestige> In reply to @Patitotective "after it opens the": Thanks, I didn't know it even wanted me to input anything. Lol |
18:30:26 | FromDiscord | <soundmodel> Anyone know how Nim-to-JS single-page apps do GUI? |
18:36:19 | FromDiscord | <soundmodel> Or any other input on PWAs using Nim? |
18:45:08 | FromDiscord | <tandy> i made a spa in nim↵(@soundmodel) |
18:51:46 | FromDiscord | <ynfle> I think karax uses vdom |
19:08:35 | * | noeontheend joined #nim |
19:19:36 | FromDiscord | <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:45 | FromDiscord | <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:21 | NimEventer | New 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:00 | FromDiscord | <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:42 | FromDiscord | <exelotl> Java is so painful to use... but other JVM languages like Kotlin are a great fit for Android development |
22:32:40 | FromDiscord | <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:19 | FromDiscord | <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:49 | FromDiscord | <Elegantbeef> IME it's due to tedium of native code on android |
23:50:01 | FromDiscord | <Elegantbeef> i mean it's not too annoying to do with SDL2 but the entire android build experience is fucking terrible |