<< 02-12-2022 >>

00:03:01FromDiscord<Tuatarian> Ok thanks
00:05:18FromDiscord<Elegantbeef> It's kinda odd how often people seem to think that macros can work with runtime information
00:05:50FromDiscord<voidwalker> how do you check if an UDP socket still has data ? This protocol does not send message length, and I have to read "all" the bytes sent, however long that is
00:08:07FromDiscord<Yepoleb> Can you link the standard you are referencing?
00:09:31FromDiscord<voidwalker> https://www.libtorrent.org/udp_tracker_protocol.html
00:09:47FromDiscord<voidwalker> announcing, Server replies with packet:
00:11:06FromDiscord<Elegantbeef> You know how big the response is so just read it into your struct
00:11:18FromDiscord<Elegantbeef> Are... you not using objects for these
00:13:03FromDiscord<voidwalker> nope, didn't consider using an object :-?
00:13:36FromDiscord<huantian> In reply to @Elegantbeef "It's kinda odd how": In this case it’s kinda valid since a is set to a lit
00:13:40FromDiscord<huantian> But it’s not const so
00:14:21FromDiscord<voidwalker> I know how big the response header is, 20 bytes, and the rest of the data is supposed to be multiples of 6. but you only know how long "when data stops coming"
00:14:44FromDiscord<QuiteQuietQ> sent a code paste, see https://play.nim-lang.org/#ix=4hpN
00:14:45FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/tFh
00:15:00FromDiscord<Elegantbeef> Arent all packets fixed size?
00:15:13FromDiscord<Elegantbeef> `proc(x: string): int`
00:15:19FromDiscord<Yepoleb> > The rest of the server reply is a variable number of the following structure:
00:15:20FromDiscord<Elegantbeef> also you cannot do what you want
00:15:23FromDiscord<Yepoleb> This is dumb
00:15:26FromDiscord<Elegantbeef> Nim is static typed
00:15:37FromDiscord<Elegantbeef> a `seq[string]` cannot be turned into a `seq[int]`
00:16:28FromDiscord<voidwalker> ohh, just noticed, the async - socket.recvFrom(size) reads all of the data available, but cuts it to size length ?
00:16:46FromDiscord<voidwalker> tried recvFrom(1) then recvFrom(6), and the second call stalls
00:16:54FromDiscord<Elegantbeef> Isnt it just `sizeof(int16) + sizeof(uint32) (leechers + seeders)`?↵(@Yepoleb)
00:17:05FromDiscord<Elegantbeef> Whoops order of op issue
00:17:05FromDiscord<QuiteQuietQ> ah, ok
00:17:18FromDiscord<Elegantbeef> But yea you have seeders/leachers so you know how many of those it's sending back i'd imagine
00:17:51FromDiscord<Yepoleb> I don't think so
00:17:59FromDiscord<voidwalker> hm theroetically, that should be the size of the peer list segment, yes
00:18:09FromDiscord<voidwalker> if the tracker is correctly written
00:18:43FromDiscord<Yepoleb> Because some torrents might have way too many clients to send them at once
00:18:49FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4hpO
00:18:51FromDiscord<voidwalker> You get that info with a scrape, I started to write the announce first
00:19:20FromDiscord<Elegantbeef> You say that but how else do you delimit the stream?
00:19:46FromDiscord<Elegantbeef> There is no other length encoded
00:20:13FromDiscord<voidwalker> I was thinking something like, "if 5 miliseconds pass from the first read, and there is nothing left to read : D
00:20:19FromDiscord<Yepoleb> It's impossible to get right
00:20:45FromDiscord<voidwalker> yeah they saved up on 4 bytes not specifying the length...
00:20:51FromDiscord<Elegantbeef> I'm going to believe it does use that length, but i'm probably wrong
00:21:01FromDiscord<Elegantbeef> Think of the picojoules
00:21:12FromDiscord<Yepoleb> Fucking garbage protocol
00:21:15*rockcavera joined #nim
00:22:25FromDiscord<voidwalker> `Receives a datagram data from socket into data, which must be at least of size size.`
00:22:42FromDiscord<voidwalker> What is a datagram hm
00:22:50FromDiscord<Yepoleb> You can just wait for a set amount an then read everything from the socket
00:23:13FromDiscord<Yepoleb> And hope you got it all
00:24:06FromDiscord<Yepoleb> Because if a packet arrives late you don't know which request it belonged to
00:24:29FromDiscord<Elegantbeef> Oh right this is udp
00:24:29FromDiscord<Yepoleb> In reply to @voidwalker "What is a datagram": Another word for a udp packet
00:24:40FromDiscord<arkanoid> Datagram = udp packet
00:24:41*disso_peach joined #nim
00:25:10FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4hpP
00:25:13FromDiscord<Elegantbeef> Then yea it's just 'try to read all the seeders and leachers info, and if you hit end stop'
00:26:04FromDiscord<voidwalker> so what's the idea here, with the recvFrom size, is it really trimming the data to the size var, if the data is bigger?
00:26:22FromDiscord<ChocolettePalette> It can with type conversion procs or operators
00:26:24FromDiscord<voidwalker> If I .recvFrom (32 - 20+6+6), it reads it all
00:26:37FromDiscord<voidwalker> (edit) "(32 - 20+6+6)," => "(32)- 20+6+6,"
00:26:37FromDiscord<Elegantbeef> What?
00:26:39FromDiscord<Yepoleb> If the data is bigger it gets left in the socket buffer
00:26:47*pch__ quit (Ping timeout: 246 seconds)
00:27:04FromDiscord<Yepoleb> And you need to pull it all out before you get any new data
00:28:25FromDiscord<voidwalker> it doesn't seem to be left in the buffer though ?
00:28:59FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4hpR
00:29:15FromDiscord<voidwalker> program blocks after echoing "we got a peer"
00:29:38*disso_peach quit (Read error: Connection reset by peer)
00:29:40*pech joined #nim
00:31:25*LuxuryMode quit (Quit: Connection closed for inactivity)
00:31:55*pch__ joined #nim
00:33:30FromDiscord<voidwalker> if I do recvFrom(100), it still gets me the whole expected message, of size 32 :-? `Receives a datagram data from socket into data, which must be at least of size size`
00:33:38FromDiscord<voidwalker> what is the point of size then
00:34:00FromDiscord<Yepoleb> It's the maximum you can handle
00:34:08*pech quit (Read error: Connection reset by peer)
00:34:18*pech joined #nim
00:34:41FromDiscord<voidwalker> at least makes me think of minimum, not max
00:37:18*pch__ quit (Ping timeout: 256 seconds)
00:37:22FromDiscord<Yepoleb> Minimum is 1 for a blocking socket
00:47:13FromDiscord<Yepoleb> Man you chose the most cursed protocol to learn udp
01:37:24*wallabra quit (Ping timeout: 264 seconds)
01:44:12FromDiscord<yrashk> I am curious about the design reason for making testament's spec a `discard <string>`, does anybody have a clue?
02:10:01*derpydoo joined #nim
02:18:27FromDiscord<!!sharpcdf!!> whats a portable way to get the command line args? it says `commandLineParams()` isnt supported on posix
02:28:56*derpydoo quit (Ping timeout: 268 seconds)
02:33:46FromDiscord<pyolyokh> the portable way is commandLineParams()
02:37:23FromDiscord<pyolyokh> maybe the error you're looking at is `commandLineParams() unsupported by dynamic libraries`? You'll need whatever's using your library to pass the args to you.
02:52:10FromDiscord<!!sharpcdf!!> In reply to @pyolyokh "maybe the error you're": im reading the docs for it lol
02:52:16FromDiscord<!!sharpcdf!!> must be nderstanding it wrong
02:52:42FromDiscord<pyolyokh> yeah it's worked on posix for years
02:52:58FromDiscord<!!sharpcdf!!> oh weird i wonder why it says that on the docs
02:53:00FromDiscord<!!sharpcdf!!> let me recheck
02:53:30FromDiscord<pyolyokh> maybe you're reading this?↵>Availability: On Posix there is no portable way to get the command line from a DLL and thus the proc isn't defined in this environment
02:53:42FromDiscord<pyolyokh> "this environment" is a shared library on posix
02:53:56FromDiscord<pyolyokh> if you make an executable you'll get the params and this is the proc to use
02:54:09FromDiscord<pyolyokh> although the `cligen` module is pretty nice
02:54:10FromDiscord<!!sharpcdf!!> ohhh
02:54:14FromDiscord<!!sharpcdf!!> yea i was just reading it wrong lmao
02:54:26FromDiscord<!!sharpcdf!!> thanks
02:54:39FromDiscord<!!sharpcdf!!> ill look at cligen too, not trying to use nimble packages though
02:57:28FromDiscord<auxym> i agree it's not that clear
03:16:34*ltriant quit (Ping timeout: 260 seconds)
03:28:15*ltriant joined #nim
03:32:05FromDiscord<!!sharpcdf!!> how can i use `proc readLines(filename: string; n: Natural): seq[string]` to get all lines of the file? what value do i pass to `n`?
03:32:21FromDiscord<jtv> Just use readAll() and call split
03:32:39FromDiscord<!!sharpcdf!!> In reply to @jtv "Just use readAll() and": isnt splitting by `\n` not accurate?
03:33:25FromDiscord<jtv> Well, if you want to also consider \r\n you could, but generally you're going to end up calling strip() anyway, no?
03:33:48FromDiscord<!!sharpcdf!!> dont operating systems use differnet methods for representing the ends of lines
03:33:53FromDiscord<huantian> In reply to @sharpcdf "how can i use": see the documetnation: "read n lines from the file named filename."
03:33:57FromDiscord<huantian> n is the number of lines you read
03:33:59FromDiscord<!!sharpcdf!!> (edit) "differnet" => "different"
03:34:08FromDiscord<huantian> if you want to read all the lines, this is not the right function to use
03:34:22FromDiscord<!!sharpcdf!!> what function should i use then
03:34:28FromDiscord<jtv> For the most part the \r\n line ending is long gone
03:34:35FromDiscord<!!sharpcdf!!> oh ok
03:34:40FromDiscord<!!sharpcdf!!> i guess i could try that
03:35:15FromDiscord<huantian> In reply to @sharpcdf "what function should i": like jtv said, use `readAll` and `splitLines↵`
03:35:15FromDiscord<jtv> If you're only on unix systems, it's fine
03:35:27FromDiscord<jtv> Windows might use \r\n depending on the subsystem
03:35:55FromDiscord<!!sharpcdf!!> oh wait theres also the `lines` iterator i could use
03:36:00FromDiscord<jtv> But again, that's easy to deal with, the split still works, and you just need to remove the \r
03:36:11FromDiscord<!!sharpcdf!!> alright yea ill do it, thanks for the help
03:52:59*arkurious quit (Quit: Leaving)
03:53:22*ltriant quit (Ping timeout: 256 seconds)
04:18:12FromDiscord<yrashk> https://ssalewski.de/nimprogramming.html#_defer_statement suggests that `defer` may get deprecated; is this a likely possibility?
04:42:19NimEventerNew post on r/nim by mishokthearchitect: Hey! Does anybody using Nim to solve this years Advent of Code?, see https://reddit.com/r/nim/comments/zabmrt/hey_does_anybody_using_nim_to_solve_this_years/
04:44:55FromDiscord<Generic> In reply to @yrashk "https://ssalewski.de/nimprogramming.html#_defer_sta": iirc Araq doesn't like it
04:45:39FromDiscord<Generic> but I don't think there are any concrete plans to remove it
04:45:57FromDiscord<Generic> https://github.com/nim-lang/RFCs/issues/236
04:46:33FromDiscord<Generic> ah well, it ended a bit unresolved
05:02:10NimEventerNew Nimble package! mummy - Multithreaded HTTP + WebSocket server, see https://github.com/guzba/mummy
05:04:03FromDiscord<huantian> Ooh
05:04:13FromDiscord<huantian> Looks neato
05:09:17NimEventerNew thread by guzba: Show Nim: Mummy, a new HTTP + WebSocket server that returns to the ancient ways of threads, see https://forum.nim-lang.org/t/9683
05:14:27NimEventerNew post on r/nim by guzba: Mummy, a new multithreaded HTTP + WebSocket server that returns to the ancient ways of threads, see https://reddit.com/r/nim/comments/zace7n/mummy_a_new_multithreaded_http_websocket_server/
05:16:38FromDiscord<ringabout> The comparison to a bug in other frameworks is not fair, though 😆
05:19:14FromDiscord<guzba> i specifically say its probably due to a bug and will update benchmarks the instant it is fixed
05:21:33FromDiscord<guzba> also happy to add more varied benchmarking approaches to ensure value↵or even de-prioritize it since honestly once the bug is fixed, the http server is just not likely to matter
05:21:43FromDiscord<guzba> (edit) "value↵or" => "value if you have suggestions↵or"
05:22:06FromDiscord<Elegantbeef> Ps guzba `rand('\33'..'\126')` is valid
05:22:06FromDiscord<guzba> but people love numbers haha
05:22:40FromDiscord<guzba> yeah that does make sense, i totally missed that
05:22:45FromDiscord<Elegantbeef> same with `0u8..255u8` 😛
05:22:56FromDiscord<guzba> yeah im being dumb lol fortunately its a harmless form of dumb
05:24:49FromDiscord<Elegantbeef> I was just looking at the fuzzer, thought it was a shipped binary and not just a test
05:25:39FromDiscord<guzba> its just what ive got now, more fuzzing approaches will be applied in time
05:25:43FromDiscord<guzba> always lots to do
05:26:47FromDiscord<guzba> the fuzzing approach is taking a known good buffer and then poke random bytes to see if bad things happen↵this when run a lot can catch dangerous reads, all sorts of crazy stuff↵It is not the only way to fuzz ofc
05:31:36FromDiscord<Yardanico> btw, have you checked mummy with thread sanitizer or something like that? just to be sure, threads can be sometimes weird :P
05:34:30FromDiscord<guzba> no not yet but i certainly will, do you have a suggestion?
05:35:01FromDiscord<guzba> not sure if something works best with nim that maybe youre aware of
05:35:12FromDiscord<Yardanico> clang has a thread sanitizer for example, it should just work for arc
05:35:20FromDiscord<Yardanico> with useMalloc to be more sure
05:35:57FromDiscord<Yardanico> but yeah, nummy looks cool, now we need someone to make prologue-like "frontend" for mummy with all the "meat" like middleware and whatnot
05:37:21FromDiscord<guzba> thanks, yeah mummy is currently somewhat like asynchttpserver in what it offers out of the box, in that it is simple and bring-your-own from here↵i think some nice routing stuff and cookie help etc could be great from here
05:38:36FromDiscord<guzba> there are just 3 key handlers which imo mean routing and all sorts of stuff can be optionally pulled in as a module and used together without necessitating going all-in but who knows what will work for folks
05:38:46FromDiscord<guzba> (edit) "there are just 3 key handlers ... which" added "for Mummy"
05:39:01FromDiscord<guzba> (edit) "there are just 3 key handlers for Mummy which imo mean routing and all sorts of stuff can be optionally pulled in as a module and used together without necessitating going all-in ... but" added "on a framework"
05:52:35FromDiscord<Yardanico> oh, and yeah, using mummy means saving on all the memory from async futures, although they do offer some advantages that need to be manually written otherwise. For example in one of my small projects if I get a request, I start a background task with asyncCheck, then store the results in a global variable, and if I get a corresponding request to get the result and it's there, I return it
05:53:04FromDiscord<Yardanico> With normal threads I guess I'll have to use threads themselves to do the same
05:54:03FromDiscord<ravinder387> i installed nim by click finish.exe
05:54:30FromDiscord<Yardanico> But i agree that it's not mummy's fault,
05:54:32FromDiscord<guzba> In reply to @Yardanico "oh, and yeah, using": both approaches totally have their strengths, i really felt the option itself to not require async wass valuable
05:54:35FromDiscord<ravinder387> sent a long message, see http://ix.io/4hqB
05:54:38FromDiscord<Yardanico> Maybe I should try taskpools
05:54:40FromDiscord<guzba> (edit) "wass" => "was"
05:54:55FromDiscord<ravinder387> anybody know from where nim find c compiler and compile the code
05:54:58FromDiscord<Yardanico> In reply to @guzba "both approaches totally have": Yes that's true
05:55:12FromDiscord<Yardanico> In reply to @ravinder387 "`CC: ../../../../Downloads/nim-1.6.10/lib/std/priva": And what's the problem? This is compiling Nim code
05:55:24FromDiscord<Yardanico> In reply to @ravinder387 "anybody know from where": It downloads mingw by itself
05:55:57FromDiscord<Yardanico> finish.exe I mean
05:56:05FromDiscord<ringabout> We are running out of time, otherwise async stuffs will have been moved out of stdlibs.
05:56:18FromDiscord<ravinder387> In reply to @Yardanico "It downloads mingw by": thanks
05:56:30FromDiscord<Yardanico> In reply to @ringabout "We are running out": huh?
05:56:32FromDiscord<ravinder387> it is different than choosenim installation
05:56:46FromDiscord<Yardanico> In reply to @ravinder387 "it is different than": not much, choosenim also installs mingw by itself
05:56:53FromDiscord<ringabout> (edit) "time," => "time for v2,"
05:57:23FromDiscord<ringabout> v2rc1 will be released next week.
05:58:26FromDiscord<guzba> thats big news to me, i knew nim 2.0 was soon and araq said this year but dang
05:58:31FromDiscord<Yardanico> I think we need to actively tell people to test, otherwise some showstopper bugs might be hit
05:58:40FromDiscord<Yardanico> Also we need more docs for the new breaking changes, especially for effects
06:02:10*rockcavera quit (Remote host closed the connection)
06:02:31FromDiscord<ravinder387> MinGW32.7z what does it mean by this
06:02:48FromDiscord<ravinder387> is is zip file
06:02:54FromDiscord<Yardanico> 7zip file
06:22:59FromDiscord<Yardanico> oh right @guzba did you test mummy with wrk on devel?
06:23:41FromDiscord<guzba> i have not yet, but now that i am aware an rc1 is headed our way soon i am excited to give it a try
06:24:08FromDiscord<Yardanico> it's just that I seem to be getting random SIGSEGV crashes with orc, will recompile latest devel and check again with arc/orc
06:24:15FromDiscord<Yardanico> it might have something to do with <https://github.com/nim-lang/Nim/pull/20492> too
06:24:40FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4hqG
06:24:48FromDiscord<Yardanico> it does seem to crash in the allocator code
06:25:13FromDiscord<guzba> that code in mummy is taking a slice / substring
06:25:15FromDiscord<guzba> which would allocate
06:25:38FromDiscord<Yardanico> and doesn't seem to crash with -d:useMalloc, I'll also check with mimalloc
06:26:12FromDiscord<guzba> great yeah im interested to ensure 2.0 is successful
06:26:41FromDiscord<Yardanico> araq would be interested too of course, the main thing is to see if it's an allocator bug or a mummy bug related to threads
06:27:28FromDiscord<guzba> the afterrcv code is before any threads have been brought in, thats the selector / poller / io thread↵obv that is not a guarantee of anything, but this is before any cross-thread handoffs
06:27:38FromDiscord<guzba> (edit) "afterrcv" => "afterRecv"
06:28:08FromDiscord<guzba> i have not seen this crash in 1.6.8 or 1.6.10 but who knows in devel
06:28:36FromDiscord<Yardanico> yeah 1.6.10 is quite far from devel
06:28:42FromDiscord<Yardanico> especially regarding these allocator changes
06:28:52FromDiscord<ringabout> I saw this error somewhere.
06:31:01FromDiscord<guzba> well in a twist of timing, perhaps mummy with 1000 threads is a great way to test allocation code hahaha, just wrk -c 1024 or something then have the handlers allocate strings or whatever else
06:31:54FromDiscord<Yardanico> that said, clang's sanitizers don't seem to catch anything with -d:useMalloc in mummy
06:32:00FromDiscord<Yardanico> i mean thread/undefined/memory sanitizers
06:32:31FromDiscord<guzba> awesome to hear. i have been really working on this so im avoiding doing things that will make me do more work tonight (midnight where i am)
06:32:36FromDiscord<guzba> will start back on things in the morning
06:34:13FromDiscord<Yardanico> @ringabout i added sysasserts to the atomicPrepend https://media.discordapp.net/attachments/371759389889003532/1048124911438282833/image.png
06:35:18FromDiscord<Yardanico> but yeah, just compile mummy's `tests/wrk_mummy.nim` with `arc` in full debug mode with threads and use something like `wrk -t10 -c100 -d10s http://localhost:8080`
06:35:21FromDiscord<Yardanico> and it should crash instantly
06:41:18*ltriant joined #nim
06:51:00*ltriant quit (Ping timeout: 268 seconds)
06:54:18FromDiscord<ringabout> Weird 😕
07:08:03*xet7 quit (Remote host closed the connection)
07:10:21*xet7 joined #nim
07:32:10*kenran joined #nim
07:32:40*kenran quit (Remote host closed the connection)
07:41:39FromDiscord<ravinder387> `proc add0(x,y: int): int = ↵ return x + y`
07:42:03FromDiscord<ravinder387> `echo add0 2, 3`
07:42:08FromDiscord<ravinder387> error
07:43:03FromDiscord<ravinder387> sent a long message, see http://ix.io/4hqZ
07:43:20FromDiscord<ChocolettePalette> echo(yourstuff)
07:47:08FromDiscord<ravinder387> add0(2,3) same as add0 2,3 https://media.discordapp.net/attachments/371759389889003532/1048143262055153734/2022-12-02.png
07:48:13FromDiscord<Elegantbeef> command syntax in a expression only works with a single parameter
07:48:24FromDiscord<Elegantbeef> `echo add0 2, 3` is `echo(add0(2), 3)`
07:52:21FromDiscord<ravinder387> what does it mean by command syntax
07:53:24FromDiscord<Elegantbeef> calls without `()`
07:53:31FromDiscord<Elegantbeef> those are called command syntax
07:53:51*PMunch joined #nim
08:00:10FromDiscord<Rika> Didn’t you ask this same question months ago
08:00:38FromDiscord<Elegantbeef> I'm 99% certain they did
08:01:16FromDiscord<metagn> @ringabout can you merge <https://github.com/nim-lang/Nim/pull/20992> it gets rid of a merge conflict in a PR
08:01:20FromDiscord<Elegantbeef> And i answered it the exact same last time
08:01:24FromDiscord<Elegantbeef> So i guess fuck me i guess
08:01:34FromDiscord<Elegantbeef> Fuck metagn active in real time chats, the end of times
08:02:10FromDiscord<metagn> saying it here so i don't forget later
08:03:25FromDiscord<Elegantbeef> Now metagn will not speak in here for another decade
08:04:07FromDiscord<metagn> i dont go in big servers on my main discord account
08:05:47FromDiscord<ravinder387> In reply to @Rika "Didn’t you ask this": yes
08:06:08PMunch@metagn, you don't have to use a Discord account to get on here ;)
08:06:16FromDiscord<metagn> even worse
08:06:19FromDiscord<metagn> then i would have to juggle multiple websites
08:06:22FromDiscord<Elegantbeef> What that dumb bot said
08:06:31FromDiscord<ravinder387> I'm persistant guy
08:06:47FromDiscord<Elegantbeef> persistent? You got your answer already
08:06:53FromDiscord<Elegantbeef> You're just ignoring educated answers
08:07:28FromDiscord<Rika> Woah, beef didn’t misspell persistent
08:10:23FromDiscord<ravinder387> In reply to @Elegantbeef "persistent? You got your": ok
08:10:48FromDiscord<ravinder387> by the way how's going
08:14:36FromDiscord<ravinder387> In reply to @Rika "Woah, beef didn’t misspell": hi rika
08:18:17FromDiscord<ringabout> In reply to @metagn "<@658563905425244160> can you merge": Sure
08:18:35FromDiscord<metagn> thank you
08:20:17FromDiscord<ringabout> done, you are welcome
08:25:18FromDiscord<ravinder387> in which area nim is growing
08:32:48*piertoni joined #nim
08:33:24piertonihi guys! Can anyone give me an advice upon httprequest not working?
08:33:24piertonihttps://play.nim-lang.org/#ix=4hr7
08:33:25piertoniThanks!
08:35:15FromDiscord<Elegantbeef> > Puzzle inputs differ by user. Please log in to get your puzzle input.
08:35:44FromDiscord<Elegantbeef> You get a 400 error from the server due to not having a login
08:36:11piertonioh, I see, I need to perform a login, that's clear
08:36:40piertonireally thanks Elegantbeef! :)
08:51:16*piertoni quit (Quit: Client closed)
09:12:07*ltriant joined #nim
09:23:24FromDiscord<ringabout> @metagn could you give my access to stmp and asyncftpclient?
09:23:52FromDiscord<ringabout> (edit) "@metagn ... could" added "Btw,"
09:23:58FromDiscord<ringabout> (edit) "stmp" => "smtp"
09:28:12FromDiscord<metagn> In reply to @ringabout "<@966428375222730773> Btw, could you": https://media.discordapp.net/attachments/371759389889003532/1048168698063626252/image.png
09:28:15FromDiscord<metagn> my access was removed
09:28:36FromDiscord<ringabout> That's weird.
09:28:58FromDiscord<ringabout> Probably the mechanism of GitHub.
09:29:44FromDiscord<metagn> actually i can still make commits but i can't edit settings
09:32:30FromDiscord<ringabout> I see, thank you!
09:37:00FromDiscord<ringabout> `gh-pages` preview is quite neat https://nim-lang.github.io/Nim/pr-preview/pr-20986/
09:37:09FromDiscord<ringabout> https://github.com/nim-lang/Nim/pull/20986#issuecomment-1334972720
09:47:12FromDiscord<sOkam!> Is it possible to create a template that will act as an alias for an object field, that will allow you assign a value to the field?
09:47:26FromDiscord<Elegantbeef> Just make a property
09:47:33FromDiscord<sOkam!> whats that?
09:47:47FromDiscord<Elegantbeef> https://nim-lang.org/docs/tut2.html#object-oriented-programming-properties
09:47:52FromDiscord<Elegantbeef> Really read the tutorial
09:47:52FromDiscord<Elegantbeef> Thanks
09:48:45*ltriant quit (Ping timeout: 265 seconds)
09:49:24FromDiscord<sOkam!> i don't understand what that is doing
09:51:28FromDiscord<sOkam!> or how that is going to allow the syntax to become `vector.yaw = 1.0`, when vector only contains `x,y,z` fields↵if it does, its going over my head with those examples
09:53:28FromDiscord<Elegantbeef> It's a property it allows you to use field access and assign to it
09:53:49FromDiscord<Elegantbeef> `thing=` is usable `mything.thing = ...`
09:54:06FromDiscord<Elegantbeef> I honestly disbelief that you read the code
09:54:13FromDiscord<Elegantbeef> disbelieve\ before rika steps in
09:54:15FromDiscord<sOkam!> i think i was reading the wrong example, because it was titling the correct one as "no need for getters"↵so i went to the next one, which is incorrect↵the right one is the top one
09:55:38FromDiscord<sOkam!> In reply to @Elegantbeef "I honestly disbelief that": well, i read the description, and skipped the top example because the description said that it was for getters, so went on to read the next block of code thinking that it would be for setters instead, which is what i was looking for 🤷‍♂️
09:55:56FromDiscord<Elegantbeef> Read the entire thing before jumping to conclusions
09:56:09FromDiscord<sOkam!> which is what i did, and just asked here
09:56:18FromDiscord<sOkam!> because i was lost
09:56:30FromDiscord<Elegantbeef> Do yourself a favour and read the entire tutorial top to bottom without searching when you have the time
09:56:47FromDiscord<sOkam!> excuse me for being lost in a description, i guess. i can misread just as everyone else
09:56:57FromDiscord<Elegantbeef> I'm not being a dick
09:57:33FromDiscord<Elegantbeef> I'm being helpful, you've asked a few different questions that are answered just by reading the tutorial, and even if you dont absorb the information initially you'll recall it and will be able to find it
09:57:37FromDiscord<sOkam!> In reply to @Elegantbeef "Do yourself a favour": well i have in the past, and i ended up more lost than found. because for some reason the wording of the docs leave me extremely confused every single time
09:57:55madpropsmake yourself a flavour and buy Araq's book
09:58:22FromDiscord<sOkam!> which is why i gravitate towards asking here first, because sometimes the docs break my brain big time, when the result is actually really damn fucking simple and its just the descriptions getting me confused
09:58:55FromDiscord<sOkam!> In reply to @madprops "make yourself a flavour": after reading the docs, which I assume he wrote, I would rather not to be honest 😔
10:00:19FromDiscord<sOkam!> not saying its bad, btw. i figure its fucking great↵but for some reason i don't understand, his language makes a crap ton of sense but his descriptions on that same language make no sense in my brain↵It's just a me thing, not an araq thing, for whatever reason I don't understand 🤷‍♂️
10:00:35madpropsmaybe make a newb channel on discord for this kind of learning
10:00:38FromDiscord<sOkam!> (edit) "reason i don't understand," => "reason,"
10:00:39madprops(to the mods)
10:06:15FromDiscord<Gumbercules> In reply to @sOkam! "or how that is": I'm not sure why that example is going over your head. It sounds like you're more confused by the linear algebra than the actual programming semantics
10:06:46FromDiscord<albassort> seq[cstring] can be converted to char right
10:07:00FromDiscord<sOkam!> In reply to @Gumbercules "I'm not sure why": because i was reading the bottom example, instead of the top one. and the bottom one doesn't work for such aliasing
10:07:12FromDiscord<basilajith> Which is the channel where I can ask questions related to os/kernel development?
10:07:16FromDiscord<albassort> cstringArray
10:07:18FromDiscord<Gumbercules> The example simply creates a "getter" and "setter named 'host' and 'host=' which assign a value to the 'h' field
10:07:42FromDiscord<Elegantbeef> does it need to be a nil terminated array, or is it a length delimited?
10:08:34FromDiscord<Gumbercules> In reply to @albassort "cstringArray": Or ptr UncheckedArray of cstring
10:10:06FromDiscord<Elegantbeef> the real question is what does what you're attempting to call expect
10:10:36FromDiscord<Elegantbeef> Cause you can always pass it, but if you dont take percaussions(add a nil) it'll wreak havoc
10:11:15FromDiscord<Elegantbeef> Some silly people have some arrays that are nil terminated, and others hold onto the length
10:11:34FromDiscord<Elegantbeef> There arent many that do OS/Kernel dev, but you can ask here
10:11:49FromDiscord<albassort> so, I never actually had to use argv in c
10:12:06FromDiscord<albassort> does it have any data which nim doesn't in its params?
10:12:49FromDiscord<basilajith> In reply to @basilajith "Which is the channel": ☝️
10:13:15FromDiscord<Elegantbeef> 👇️
10:13:38FromDiscord<Elegantbeef> No it does not have any extra information
10:14:34FromDiscord<albassort> alright so now i gotta deal with cursed gtk compiling problems
10:15:21*ltriant joined #nim
10:19:23*vicecea quit (Remote host closed the connection)
10:22:09*ltriant quit (Ping timeout: 260 seconds)
10:22:39FromDiscord<albassort> yea
10:22:46FromDiscord<albassort> it seems i cant enter the function without it crashing
10:23:16FromDiscord<albassort> ahem
10:23:48FromDiscord<albassort> any ideas
10:23:50FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4hrO
10:24:13FromDiscord<albassort> (edit) "https://play.nim-lang.org/#ix=4hrO" => "https://play.nim-lang.org/#ix=4hrP"
10:24:21FromDiscord<albassort> (edit) "https://play.nim-lang.org/#ix=4hrP" => "https://play.nim-lang.org/#ix=4hrQ"
10:24:58*vicecea joined #nim
10:28:43FromDiscord<ChocolettePalette> tasty\
10:29:40FromDiscord<albassort> shh
10:30:05FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1048184271715704832/image.png
10:30:25FromDiscord<albassort> so yea it seems that, there are args that i cant get in nim?
10:30:37FromDiscord<albassort> hmm
10:30:58FromDiscord<albassort> maybe its gtk being annoying
10:31:16FromDiscord<ravinder387> what's alternative to inheritance in nim. I wanna do as a procedural paradym in nim how can i do it?
10:31:18FromDiscord<ravinder387> any idea
10:31:32FromDiscord<albassort> nim has inheritance kinda, but im not the one to ask
10:31:53FromDiscord<albassort> keep in mind, nim is a static language :D
10:32:33FromDiscord<ravinder387> can i use function overloading instead of inheritance
10:32:45FromDiscord<ravinder387> how can i extend my application in nim
10:33:00FromDiscord<ravinder387> as procedure way
11:02:40*wallabra joined #nim
11:25:28FromDiscord<Yepoleb> In reply to @albassort "so yea it seems": Those are environment variables, not args
11:27:10PMunch@ravinder387, not quite sure what you're confused about. You can do procedural programming in Nim just fine, some might even say it's the default
11:27:32PMunchAnd procedure overloading is also the default
11:27:44PMunchIn fact Nim doesn't have a concept of a procedure belonging to an object type
11:28:04PMunchAs for extension I'm not quite sure what you mean
11:35:30FromDiscord<albassort> In reply to @Yepoleb "Those are environment variables,": yea far past that
11:35:38FromDiscord<albassort> now dealing with something more annoying
11:36:18FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1048200937958805504/image.png
11:36:41FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1048201029587583036/image.png
11:36:44FromDiscord<albassort> normal c stuff
11:37:17FromDiscord<albassort> bell
11:37:21FromDiscord<albassort> (edit) "bell" => "bella"
11:41:57PMunchAnyone know what this issue is by the way? https://youtu.be/2r8JYqrjO3c?t=2354
11:42:10PMunchCame up while solving AoC yesterday, compiler crash no less
11:43:07FromDiscord<albassort> yo pmuch i like your beard
11:44:20*ltriant joined #nim
11:44:23FromDiscord<albassort> i like how pmuch knows how to quit when i would have bashed my head against my keyboard for an hour
11:49:05*ltriant quit (Ping timeout: 265 seconds)
11:59:04FromDiscord<Yepoleb> He's getting so many compliments, i think we need a fan channel
12:04:14FromDiscord<planetis> distinct array without a static int parameter huh? likes to live dangerously
12:04:26FromDiscord<planetis> size needs to be static
12:11:40FromDiscord<Jessa> sent a code paste, see https://play.nim-lang.org/#ix=4hsd
12:16:22PMunch@albassort, haha thanks :) By the way, if you spell my name right I get notified when you talk to me
12:25:01FromDiscord<Rika> In reply to @Jessa "can i import a": No you cannot
12:25:07FromDiscord<Rika> You must use include in such case
12:27:23FromDiscord<voidwalker> I see that `buffered = true;` by default for AsyncSocket. I create it like this `newAsyncSocket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)` and called hasDataBuffered on it.. it returns false. I cannot access the isBuffered field on it for some reason. Udp sockets are maybe unbuffered ? I am trying to figure out why it eats all the data with recvFrom(size), if size<data to read from socket, and thus the rest of the data is lost
12:30:32*clemens3 joined #nim
12:34:17FromDiscord<voidwalker> https://nim-lang.org/docs/net.html#recvFrom%2CSocket%2Cstring%2Cint%2Cstring%2CPort%2Cint32 `Warning: This function does not yet have a buffered implementation, so when socket is buffered the non-buffered implementation will be used. Therefore if socket contains something in its buffer this function will make no effort to return it.` - I wonder if this is true for recvFrom async as well ?
12:41:17FromDiscord<albassort> In reply to @PMunch "<@217459674700578816>, haha thanks :)": i'm stupid as well as dyslexic so i typo a lot especially on non arbitrary data
12:43:30PMunchAh I see, I thought you did it on purpose for some reason
12:54:41FromDiscord<Jessa> can you re-write parts of a proc using macros?↵for example, remove/add arugments?
12:55:12PMunchYes
12:55:49FromDiscord<Jessa> how would i go about it?↵I'm having a hard time finding/understanding what i find online
12:58:42PMunchYou get a tree structure in, read it, and replace the parts you want
13:01:27FromDiscord<Jessa> sent a code paste, see https://play.nim-lang.org/#ix=4hss
13:02:07NimEventerNew thread by archnim: Nimsugest Goes out of control, see https://forum.nim-lang.org/t/9684
13:02:47FromDiscord<Jessa> (edit) "https://play.nim-lang.org/#ix=4hss" => "https://play.nim-lang.org/#ix=4hst"
13:03:24PMunch@Jessa, you have to attach it as a pragma
13:04:08PMunchOh, and you need to return something
13:04:11FromDiscord<Jessa> but this macro doesn't even compile
13:04:23FromDiscord<Jessa> https://media.discordapp.net/attachments/371759389889003532/1048223104050155611/image.png
13:04:39PMunchThat's not how you create NimNodes
13:05:18FromDiscord<Jessa> then how do i?
13:08:59PMunchA good start is to read the macros manual
13:09:07PMunchOr find a tutorial
13:09:20FromDiscord<Jessa> i read thruogh the manual, but like i said, it's confusing
13:09:22FromDiscord<Jessa> (edit) "i read thruogh the manual, but like i said, it's confusing ... " added "me"
13:09:35FromDiscord<Jessa> and there's barely any tutorial i can find
13:14:59FromDiscord<zingstrok> hi, I'm looking for a list with all the nim specific keyword that come from the nim compiler. Do anyone here know where i can find that ?
13:15:44FromDiscord<zingstrok> (edit) "compiler." => "compiler(strring present inside a PE that was made by the nim compiler)."
13:16:07FromDiscord<zingstrok> (edit) "hi, I'm looking for a list with all the nim specific keyword that come from the nim compiler(strring present inside a PE that was made by the nim compiler). Do anyone here know where i can find that ... ?" added "or how i can make my own"
13:17:06PMunch@Jessa, I have one here: https://peterme.net/metaprogramming-and-read-and-maintainability-in-nim.html
13:17:15PMunchNot the most succinct one though
13:24:06*jmdaemon quit (Ping timeout: 255 seconds)
13:28:25FromDiscord<Jessa> ah, that actually helped a lot
13:28:26FromDiscord<Jessa> thanks
13:34:56FromDiscord<ahungry> i see @PMunch is doing some AOC - I did day one and two with nim - anyone here have a private leaderboard they wanna share? the global is too competitive for me - I started late, submitted 30m after it opened, still 8000th place lol
13:35:57PMunch@Jessa, oh that's good to hear :)
13:36:20PMunch@ahungry, we have a Nim leaderboard you can join?
13:41:12FromDiscord<Archspect> Hello!
13:45:40*derpydoo joined #nim
13:45:55*ltriant joined #nim
13:46:23FromDiscord<ahungry> @PMunch nice - code/link?
13:47:00PMunchIt's in the forumpost I believe
13:50:23*ltriant quit (Ping timeout: 246 seconds)
14:08:19FromDiscord<auxym> In reply to @ahungry "i see <@696333749570371585> is": also join us in #aoc
14:14:13*Phytolizer joined #nim
14:15:50*rockcavera joined #nim
14:42:37*Phytolizer quit (Remote host closed the connection)
14:42:57*Phytolizer joined #nim
14:50:40FromDiscord<ambient> is there an easy way to build a sub-language of Nim by disabling language features?
14:51:49FromDiscord<ChocolettePalette> Like Lua or Scheme?
14:52:26FromDiscord<ambient> for example if I wanted to use Nim in Godot intead of GDscript but make sure I only use a limited set of features to maintain better project cohesion and maintainability etc
14:52:49FromDiscord<ambient> Lua is only floats (it's out). Scheme has too many parentheses (it's out)
14:54:11FromDiscord<ambient> imports don't have to have this limitation of course
14:54:15PMunchDepends on which language features you want to disable..
14:54:34FromDiscord<ambient> probably around 90% of them
14:54:54FromDiscord<ambient> i just want make a gdscript that is fast and has nim ergonomics 😉
14:55:51PMunch90% doesn't really tell me anything though..
14:57:04FromDiscord<ambient> well, enable all features GDscript has and disable all the rest is the starting point. anything that have multiple ways of doing it, just pick one good way of doing it and stick to that
14:57:29FromDiscord<ambient> but I guess there's no config file or anything like that that I could just use to pick and choose, it's a lot more complicated than that?
14:57:57FromDiscord<ambient> like disabling how functions are called (which seems a core feature)
14:57:58PMunchAgain, you don't really explain what you mean by "feature", do you want to disable for loops? Is that a feature? Or do you want to disable threads?
14:58:24FromDiscord<ambient> instead of x.foo, foo(x), foo x -- just use foo(x)
14:58:26PMunchDisable how a function is called?
14:58:34PMunchAh, no that's not possible
14:58:59FromDiscord<Yepoleb> why does it matter if they are hard disabled?
14:59:19FromDiscord<ambient> because I'm a faulty human being and writing tests is often useful
14:59:25PMunchI mean you might be able to bend the compiler to your will if you spent enough time, but why make a dialect out of it instead of just using Nim as it is?
15:00:13FromDiscord<ambient> well the goal is to use only a subset of Nim and use a programmatic way to force myself to use that subset. If only way is to modify the compiler, that's out of my reach then
15:00:51PMunchBut why?
15:00:55PMunchI mean there is Nimpretty
15:01:03PMunchYou might be able to use that to enforce style rules
15:01:15FromDiscord<Yepoleb> yeah, i'd go that route
15:01:49FromDiscord<Yepoleb> write a custom linter to enforce your language restrictions
15:02:19FromDiscord<Yepoleb> or maybe wrap all code in a macro that checks for forbidden features
15:02:34FromDiscord<ambient> something like parser hooks would probably be useful. just throw and error if some parser branch is reached
15:02:52FromDiscord<ambient> (edit) "and" => "an" | "reached" => "reached. but also probably something that is not importable"
15:03:53FromDiscord<ringabout> Nim doesn't support it. Irrc a script language written by/for Rust supports disabling part of its syntax.
15:05:06FromDiscord<ringabout> https://rhai.rs/book/engine/disable-keywords.html
15:05:18*Phytolizer quit (Ping timeout: 260 seconds)
15:06:50PMunchSeems like a massive PITA to maintain..
15:07:59FromDiscord<ambient> why? wouldn't using less features make it easier to maintain?
15:08:53PMunchOh I meant a compiler with switchable features
15:09:16FromDiscord<ambient> well if you're building a Forth you just comment out lines
15:09:22PMunchBut yeah, the much more common route is to define and enforce a style through some tool
15:09:36PMunchSure, and if you're building your own Nim compiler you can also just comment out lines
15:10:26PMunchOf course Nim isn't designed for it, so it would likely feel more like live patient brain surgery to get the correct parts commented out
15:10:29PMunchBut I've gotta go
15:10:31*PMunch quit (Quit: Leaving)
15:12:21FromDiscord<ambient> maybe I will just somehow fork Nim parser and instead of code generation, it will just throw errors
15:17:37*cp- joined #nim
15:47:29*ltriant joined #nim
15:52:09*ltriant quit (Ping timeout: 255 seconds)
15:53:39FromDiscord<basilajith> In reply to @Elegantbeef "There arent many that": Any particular reason why there aren't many that do OS/kernel dev?
16:16:59*Phytolizer joined #nim
16:18:08*junaid_ joined #nim
16:28:55FromDiscord<auxym> because most people use linux/windows/macos? Developing a (practical) new OS is a huge endeavor, and developing a "toy" OS is sort of a very niche hobby
16:31:19*junaid_ quit (Remote host closed the connection)
16:33:46*PMunch joined #nim
16:40:09FromDiscord<guttural666> can anybody experienced with NimYAML explain, why object field names with underscores lead to compile errors when trying to save and load yamls to and from disk? band_id will give me the compile error, bandId wont't https://media.discordapp.net/attachments/371759389889003532/1048277401991381022/image.png
16:42:23FromDiscord<demotomohiro> In reply to @guttural666 "can anybody experienced with": https://nim-lang.org/docs/manual.html#lexical-analysis-identifier-equality
16:42:43FromDiscord<guttural666> ahh, this again
16:42:45FromDiscord<demotomohiro> So `band_id` and `bandId` is same name
16:43:11FromDiscord<wick3dr0se> Is there some way to read a line with two columns into two different variables at once?
16:44:07FromDiscord<guttural666> In reply to @demotomohiro "So `band_id` and `bandId`": still trying to figure out how the compiler would complain then, it's having trouble finding a correct proc overload in the yaml module it seems
16:44:50PMunchAnyone ready for day 2 AoC stream?
16:47:05FromDiscord<demotomohiro> In reply to @ambient "maybe I will just": You can import modules in Nim compiler code like library: https://play.nim-lang.org/#ix=4hvO
16:48:11PMunchGot YouTube working as well today, so it's a dual stream: https://www.youtube.com/watch?v=sJN_oeSsMKQ and Twitch of course https://www.twitch.tv/pmunche
17:20:00Zevvyou can't do AOC sessions without lighting the fireplace PMunch
17:20:31Zevvgood. good.
17:27:54*PMunch quit (Quit: leaving)
17:40:24FromDiscord<exelotl> In reply to @ambient "Lua is only floats": Lua 5.3 and onwards has integers I believe
17:42:39FromDiscord<exelotl> In reply to @ambient "instead of x.foo, foo(x),": this seems silly though, these sugar features are a key design aspect of the language and not really footguns.
17:42:55FromDiscord<basilajith> In reply to @auxym "because most people use": But it's not because of any limitations in Nim, right?
17:44:20FromDiscord<exelotl> (edit) "these sugar features" => "the method call syntax & command syntax" | "the method call syntax & command syntaxare a key design aspect of the language and not really footguns. ... " added "It's hard to have something go wrong by using them."
17:44:28FromDiscord<Rika> In reply to @basilajith "But it's not because": It’s not, it’s really just that in general people don’t program kernels lol
17:49:02*ltriant joined #nim
17:53:24*ltriant quit (Ping timeout: 248 seconds)
18:20:36*ltriant joined #nim
18:24:51FromDiscord<メッリーレイムー 🎄> is there an equivalent to C#/Java `Object` in Nim?
18:25:02FromDiscord<メッリーレイムー 🎄> basically dont care what type i pass to it
18:25:03FromDiscord<haxscramper> `RootObj`
18:25:20FromDiscord<haxscramper> Ah, in this sense there is no direct alternative
18:25:22*ltriant quit (Ping timeout: 268 seconds)
18:25:49FromDiscord<haxscramper> You can use `pointer` to hack things around, but that's unsafe. What is your use case?
18:26:08FromDiscord<haxscramper> Store multiple types in sequence or some kind of generic-ish processing?
18:28:24FromDiscord<メッリーレイムー 🎄> In reply to @haxscramper "You can use `pointer`": so i dont have to do this
18:28:29FromDiscord<メッリーレイムー 🎄> ideally
18:28:31FromDiscord<メッリーレイムー 🎄> sent a code paste, see https://play.nim-lang.org/#ix=4hwn
18:34:43FromDiscord<haxscramper> This is an idiomatic code so I don't think there is any built-in support for moving way from it. Although you can save a bit on typing and use object variant generators like ones in https://github.com/andreaferretti/patty
18:35:12*pro joined #nim
18:48:58*Phytolizer quit (Remote host closed the connection)
18:52:10*ltriant joined #nim
18:52:17*Phytolizer joined #nim
18:57:12*ltriant quit (Ping timeout: 256 seconds)
19:10:48*wallabra quit (Ping timeout: 256 seconds)
19:16:03*wallabra joined #nim
19:33:07*TakinOver joined #nim
19:36:03*TakinOver quit (Client Quit)
19:36:25*TakinOver joined #nim
19:36:40*adium quit (Quit: Stable ZNC by #bnc4you)
19:44:55*jmdaemon joined #nim
19:45:20*adium joined #nim
19:46:48FromDiscord<Require Support> sent a code paste, see https://play.nim-lang.org/#ix=4hwH
19:50:00*arkurious joined #nim
19:53:28*xet7 quit (Quit: Leaving)
19:57:23*adium quit (Quit: Stable ZNC by #bnc4you)
20:04:40*adium joined #nim
20:12:48*xet7 joined #nim
20:14:42*kenran joined #nim
20:15:46*kenran quit (Remote host closed the connection)
20:20:23FromDiscord<Jessa> sent a code paste, see https://play.nim-lang.org/#ix=4hwN
20:22:20FromDiscord<Jessa> (edit) "https://play.nim-lang.org/#ix=4hwN" => "https://play.nim-lang.org/#ix=4hwO"
20:26:24FromDiscord<.tochka> need to mark proc storages static, and then create runtime seq from static seq as i remember
20:26:44FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4hwP
20:29:11*ltriant joined #nim
20:34:06*ltriant quit (Ping timeout: 256 seconds)
20:41:31FromDiscord<Jessa> sent a code paste, see https://play.nim-lang.org/#ix=4hwU
20:42:29FromDiscord<.tochka> In reply to @Jessa "can i somehow store": https://play.nim-lang.org/#ix=4hwV
20:43:04FromDiscord<Jessa> oo
20:44:58FromDiscord<メッリーレイムー 🎄> could anyone help me w/ implementing shunting yard algorithm in nim? i am kinda lost
20:46:42FromDiscord<.tochka> hm, what is exactly problematic
20:46:43FromDiscord<Require Support> is it possible to create a `goto` block within a `proc` just like c++? or something along that line
20:47:19FromDiscord<.tochka> not really
20:47:35FromDiscord<.tochka> you can emit c/c++ gotos if you want
20:47:55FromDiscord<.tochka> question is whether you really should
20:48:37FromDiscord<spoon> dunno, i've had cases where goto prevented me from having a third nesting layer
20:48:49*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
20:49:07FromDiscord<spoon> forbidden control flow :)
20:49:22FromDiscord<spoon> but instead of a goto, you can use a `block` and escape it
20:49:27FromDiscord<.tochka> use gnu extension, place gotos outside of functions
20:49:39FromDiscord<.tochka> maximum control
20:50:18*wallabra joined #nim
20:50:41FromDiscord<.tochka> In reply to @spoon "but instead of a": that would only work for back referencing gotos, C allows jumping to labels that are further also
20:51:19FromDiscord<.tochka> so, not exactly the same
20:51:19FromDiscord<spoon> nested blocks would work too
20:51:27FromDiscord<.tochka> hmmmmm
20:51:28FromDiscord<spoon> but thatd be kinda ugly
20:51:34FromDiscord<.tochka> you're right
20:53:30FromDiscord<.tochka> https://play.nim-lang.org/#ix=4hwZ
20:53:31FromDiscord<メッリーレイムー 🎄> In reply to @メッリーレイムー 🎄 "could anyone help me": would anyone be able to? ^
20:54:34FromDiscord<.tochka> In reply to @メッリーレイムー 🎄 "would anyone be able": you would have better luck at asking specific questions and not waiting for work to be done by strangers
20:55:11FromDiscord<メッリーレイムー 🎄> ok ill clarify, i have taken a look at the algorithm but i dont fully understand it
20:56:32FromDiscord<Jessa> In reply to @.tochka "https://play.nim-lang.org/#ix=4hwV": while this works, it requires me to put it at the very end (and thus also in the file that imports it)↵is there a way to do this at the very end at compiling?
20:56:40FromDiscord<.tochka> you parse the output and push every token in the stack, when you have valid operation in the stack => spit new representation by reordering and moving operation from the stack
20:57:03FromDiscord<メッリーレイムー 🎄> it would help if i can see a psuedocode of it
20:57:38FromDiscord<.tochka> In reply to @Jessa "while this works, it": imports have separated execution
20:57:44FromDiscord<.tochka> include would be messed
20:57:48FromDiscord<.tochka> (edit) "include" => "includes"
20:57:54FromDiscord<.tochka> (edit) "separated" => "separate"
20:58:06FromDiscord<.tochka> (edit)
20:58:36FromDiscord<Jessa> Hmm.. i see-↵↵so i would need to include it, rather than import it?
20:58:40FromDiscord<.tochka> oh stop lill
20:58:52FromDiscord<.tochka> i answered to you as to other person
21:00:41FromDiscord<.tochka> if you're making executable then end of main could be used for assigning of var
21:00:56FromDiscord<.tochka> and default initialized var could be declared in the module itself
21:01:12FromDiscord<.tochka> hmmm, actually, no, it would not work either
21:01:35FromDiscord<.tochka> messy stuff
21:03:02FromDiscord<.tochka> In reply to @メッリーレイムー 🎄 "it would help if": whats wrong with pseudocode on wikipedia?
21:03:16FromDiscord<.tochka> https://media.discordapp.net/attachments/371759389889003532/1048343619691614258/image.png
21:03:50FromDiscord<Jessa> maybe stupid idea, but just change the AST of a variable everytiime the pragma gets called? lol
21:05:20FromDiscord<.tochka> afaik thats how std/macrocache works
21:06:17FromDiscord<.tochka> actually it exist for exactly your purpose, for module boundary relations
21:06:50FromDiscord<.tochka> lul
21:07:16FromDiscord<Jessa> ah
21:07:18FromDiscord<Jessa> i'll look into that
21:17:33*pro quit (Quit: pro)
21:36:33FromDiscord<ahungry> is there a way to reference a func/proc as a higher order function? I have a working `compose` call that I derived from the Rosetta Code sample, but when I'm tinkering in the repl with `inim` and I want to see if a function exists, I type something like `foo` and instead of seeing something like `foo: func blabla` it gives me the error that it must be used or discarded
21:36:58FromDiscord<ahungry> in lisp2s, I know i could sharp quote with `#'whatever`
21:38:00*pro joined #nim
21:38:25FromDiscord<.tochka> type `discard foo`
21:38:38FromDiscord<.tochka> but it would not echo anything i think
21:39:42FromDiscord<メッリーレイムー 🎄> how do i check if a char literal is empty?
21:39:58Amun-Ra#define empty
21:40:06FromDiscord<メッリーレイムー 🎄> has no content
21:40:25Amun-Ravar c: char
21:40:31Amun-Ra^ c == 0
21:40:54FromDiscord<.tochka> In reply to @メッリーレイムー 🎄 "how do i check": dont think char literal could be empty
21:40:59Amun-RaI mean '\0'
21:41:20FromDiscord<.tochka> or you mean char value instead
21:41:25Amun-RaI guess he mean "not explicitely initialized"
21:41:26FromDiscord<メッリーレイムー 🎄> value
21:41:39FromDiscord<Elegantbeef> There is no 'empty' value
21:41:46FromDiscord<Elegantbeef> Do you mean the null character?
21:45:17*ltriant joined #nim
21:48:17*Phytolizer quit (Remote host closed the connection)
21:48:59FromDiscord<Yepoleb> i think he means string literal
21:49:57FromDiscord<Yepoleb> and the answer would be `s.len == 0`
21:49:58FromDiscord<Elegantbeef> Perhaps, but without a clear example or explanation....
21:50:45FromDiscord<c4ulmu> Hello. When I assign seq to a variable or pass it to a function, does it copied or passed by reference ?
21:50:55FromDiscord<Elegantbeef> Passed to a function it's passed by reference
21:51:05FromDiscord<Elegantbeef> They're value types otherwise
21:51:27FromDiscord<Elegantbeef> Which means they copy on assignment
21:51:35FromDiscord<Elegantbeef> \Unless you use arc/orc and a move can be done
21:52:25FromDiscord<c4ulmu> I see, thank you
21:54:06FromDiscord<Jessa> I don't think that macrocache is what i'm looking for, as i cannot use iit during runtime
21:54:36*pro quit (Quit: pro)
21:57:49FromDiscord<Elegantbeef> What are you exactly trying to do
21:58:21FromDiscord<Elegantbeef> I mean you can use it during runtime cause you can do `const myTable = genMyTable` after all subscriptions
22:06:00FromDiscord<Jessa> `genMyztable`??
22:06:03FromDiscord<Jessa> (edit) "`genMyztable`??" => "`genMytable`??"
22:07:00FromDiscord<Elegantbeef> Yes you can write macros that consume a macro cache and emit things
22:07:17FromDiscord<Elegantbeef> What exactly are you trying to do, for the secodn time
22:09:13*rockcavera quit (Remote host closed the connection)
22:10:19FromDiscord<Jessa> sent a code paste, see https://play.nim-lang.org/#ix=4hxf
22:10:24FromDiscord<Jessa> (edit) "https://play.nim-lang.org/#ix=4hxf" => "https://play.nim-lang.org/#ix=4hxg"
22:13:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4hxh
22:15:52FromDiscord<.tochka> jason to the rescue
22:17:12*Phytolizer joined #nim
22:22:43FromDiscord<voidwalker> sent a long message, see http://ix.io/4hxi
22:23:25FromDiscord<メッリーレイムー 🎄> are funcs just implying {.pure.}
22:23:51FromDiscord<Elegantbeef> noSideEffect but yes
22:23:54FromDiscord<Elegantbeef> They're 'pure'
22:24:06FromDiscord<voidwalker> Bottom line: how to make an UDP socket that I can read the first X bytes from, without losing data if available length is > X ?
22:24:10FromDiscord<Elegantbeef> `func() is proc(){.noSideEffect.}`
22:26:55FromDiscord<.tochka> In reply to @メッリーレイムー 🎄 "are funcs just implying": pure pragma is for types
22:27:51FromDiscord<.tochka> func means more debugecho, proc means more echo, nothing different otherwise ;p
22:29:11FromDiscord<planetis> Can't argue with that lol
22:30:04FromDiscord<メッリーレイムー 🎄> In reply to @Elegantbeef "`func() is proc(){.noSideEffect.}`": ah ok
22:36:02FromDiscord<voidwalker> Can someone enlighten me about the (async) udp sockets ? Are they unbuffered by default ? The new socket definition has buffered = true, but hasDataBuffered on my socket returns false, even if it has data to read. :-?
22:41:41FromDiscord<Require Support> sent a code paste, see https://play.nim-lang.org/#ix=4hxm
22:41:57FromDiscord<Require Support> (edit) "https://play.nim-lang.org/#ix=4hxm" => "https://play.nim-lang.org/#ix=4hxn"
22:42:05FromDiscord<Require Support> (edit) "https://play.nim-lang.org/#ix=4hxn" => "https://play.nim-lang.org/#ix=4hxo"
22:42:14FromDiscord<Elegantbeef> You dont have `Fetch` defined on your mingw
22:42:55FromDiscord<Elegantbeef> VoidWalker i'd suggest setting up your own udp server to see if you can reproduce your issue in a small scale
22:44:14FromDiscord<Require Support> In reply to @Elegantbeef "You dont have `Fetch`": Thanks, I get this error when nim compiler uses mingw linker. Any idea how I can track the code that generates this error?
22:45:01FromDiscord<Elegantbeef> `ccV9tuKq.ltrans0.ltrans` is the file it originals from so uhh whatever generates that 😄
22:45:20FromDiscord<voidwalker> why would I @ElegantBeef ? I am not sure if it's an issue rather than an expected behaviour I don't understand.
22:45:46FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4hxq
22:46:19FromDiscord<Elegantbeef> To me it seems like a bug, which is why i said that
22:46:27FromDiscord<Elegantbeef> But i dont know i rarely use async
22:46:39FromDiscord<voidwalker> var resp2 = await socket.recvFrom(100000) - gets me a 32bytes resp2.data
22:47:18FromDiscord<voidwalker> hm dom is the async/sockets expert here, right ?
22:48:38FromDiscord<Elegantbeef> Though if i recall correctly i did i have an issue with async sockets which was resolved with `buffered = false`
22:48:54FromDiscord<Elegantbeef> Though that was me getting the wrong data
22:49:10*ltriant quit (Ping timeout: 260 seconds)
22:49:10FromDiscord<Elegantbeef> I guess, not like we wear nametags
22:50:18FromDiscord<huantian> `A nested proc can have generic parameters only when it is used as an operand to another routine and the types of the generic paramers can be inferred from the expected signature.` wow I have never seen this error before
22:50:51FromDiscord<Elegantbeef> That's a long message please shorten it to "Proc cannot have generic parameters" 😄
22:51:53FromDiscord<voidwalker> same behaviour with buffered/unbuffered socket setting...
22:52:14FromDiscord<huantian> it's the weird error I get when I accidentally pass an => proc to mapIt :)
23:17:03FromDiscord<!!sharpcdf!!> how could i make a proc return a type based on regex that it finds?
23:17:44FromDiscord<!!sharpcdf!!> like if it finds match 1 in a string it returns string, if it finds match 2 in a string it returns int
23:21:08*Phytolizer quit (Ping timeout: 260 seconds)
23:27:08FromDiscord<juan_carlos> Hows the best way to rewrite Python `int(42, base=16)` in Nim with stdlib?. 🤔
23:29:53FromDiscord<Yepoleb> @voidwalker i will take a look at your issue soon
23:34:12FromDiscord<guttural666> sent a long message, see http://ix.io/4hxG
23:35:23FromDiscord<guttural666> so I use the last proc to do the thing from outside, but that's kinda stupid