<< 07-01-2023 >>

00:00:08FromDiscord<Leastrio> Are there any good http libs out there?
00:00:16FromDiscord<Leastrio> The std one doesnt fit my needs
00:00:27FromDiscord<Leastrio> (edit) "there?" => "there that you guys recommend?"
00:06:22FromDiscord<Elegantbeef> assign↵(@Mustache Man)
00:06:28FromDiscord<Elegantbeef> `let a = b` is copy by value
00:19:29*pbsds quit (Quit: The Lounge - https://thelounge.chat)
00:22:09*pbsds joined #nim
01:17:19*ltriant joined #nim
01:29:52*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
01:35:00*ltriant quit (Ping timeout: 272 seconds)
01:55:46*xet7 quit (Quit: Leaving)
01:56:20*xet7 joined #nim
02:09:23*ltriant joined #nim
02:15:29*azimut_ quit (Ping timeout: 255 seconds)
02:20:22*ltriant quit (Ping timeout: 268 seconds)
02:49:58*ltriant joined #nim
02:55:26*ltriant quit (Ping timeout: 272 seconds)
03:00:02FromDiscord<@thatrandomperson5-6310e3b26da03> Anyone have a nodetree template? I don’t want to manually add all the basic procs like `add` or `[]`. It can also just be an inheritable object or a macros
03:21:36*krux02 quit (Remote host closed the connection)
03:22:20*ltriant joined #nim
03:27:44*ltriant quit (Ping timeout: 272 seconds)
03:49:38*ltriant joined #nim
03:50:58*arkurious quit (Quit: Leaving)
03:55:04*ltriant quit (Ping timeout: 260 seconds)
04:21:12*ltriant joined #nim
04:26:05*ltriant quit (Ping timeout: 246 seconds)
04:52:47*ltriant joined #nim
04:58:04*ltriant quit (Ping timeout: 260 seconds)
08:34:33FromDiscord<Leastrio> Im setting a few headers in my httpClient, and one is getting removed when i make a request. Is there a way to make it not remove the header?
08:35:43*pro joined #nim
08:35:55*pro quit (Client Quit)
08:36:12FromDiscord<Leastrio> (edit) "one" => "the Authorization header"
09:28:22FromDiscord<sOkam!> How would you use strings and sequences in a gc:none situation?↵I imagine they would need to be coded, but question is related to learning to do that↵Are both seq and string GC'ed, or is that only the case for seq?
09:40:34FromDiscord<ElegantBeef> Both are gc'd
09:40:52FromDiscord<ElegantBeef> You would make your own collection and manually manage it using hooks
09:41:10FromDiscord<ElegantBeef> Though i wouldnt suggest doing that
09:41:16*jmdaemon quit (Ping timeout: 252 seconds)
09:47:15*jjido joined #nim
09:52:50FromDiscord<sOkam!> Goal is just learning manual mm↵Or do you mean that there is a better way in that context than strings/seq?
09:55:06FromDiscord<ElegantBeef> I meant i wouldnt manual manage memory
09:56:45FromDiscord<sOkam!> ah, yeah. i get that. i have no intention of making anything serious with it either, its just for toy learning on the side
09:57:18FromDiscord<sOkam!> any pointers on how to learn that concept of "collection" and "hooks" that you mention?
09:57:45FromDiscord<ElegantBeef> for the former it's just "C vector" or "C growable array"
09:57:56FromDiscord<ElegantBeef> https://nim-lang.org/docs/destructors.html for hooks
09:58:24FromDiscord<ElegantBeef> Growable arrays are really extraordinary simple to implement
09:59:18FromDiscord<AmjadHD> In reply to @hmmm "<@629598664452734989> broski how do": git clone my fork of the repo to the Packages folder (reachable from sublime text through `Preferences > Browse Packages ...`) and checkout the rework branch.
10:01:07FromDiscord<sOkam!> In reply to @ElegantBeef "Growable arrays are really": oh just found this with a quick search with those keywords. they do look simple indeed. tyty https://media.discordapp.net/attachments/371759389889003532/1061222941641154601/image.png
10:02:39FromDiscord<ElegantBeef> The trick in Nim is to make them generic of course 😄
10:03:18FromDiscord<ElegantBeef> We also have the nice `type GrowableArray[T] = ptr object` 😄
10:03:49FromDiscord<ElegantBeef> Or i guess just object depending on the way you lay them out
10:05:09FromDiscord<ElegantBeef> sent a code paste, see https://paste.rs/l0Q
10:06:06FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4ky4
10:06:14FromDiscord<ElegantBeef> Bunch of different ways to lay out the data of course
10:07:42*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
10:08:10FromDiscord<badmachine> Hello! I'm new here. I couldn't find a good answer via google - what's the easiest way to interop with rust crates?
10:08:29FromDiscord<ElegantBeef> Use the c-api if they provide it
10:08:58FromDiscord<ElegantBeef> Otherwise make your own bindings for them either manually or with things like https://github.com/arnetheduck/nbindgen
10:09:21FromDiscord<badmachine> I looked through nbindgen, but some of the docs point to cbindgen docs
10:09:29FromDiscord<ElegantBeef> To wrap C-api you can try c2nim, futhark, nimterop
10:09:42FromDiscord<badmachine> Gotcha, thanks!
10:11:34FromDiscord<ElegantBeef> Futhark is generally the easiest but it's also the most, how do i put it .... uhhh ugly
10:36:29FromDiscord<ShalokShalom> Elegant, does Kate pick up your nimlsp without further doing?
10:37:12FromDiscord<ShalokShalom> https://invent.kde.org/utilities/kate/-/merge_requests/680↵I actually merged this 9 months ago and never came to actually testing it extensively. ^^
10:53:38FromDiscord<4zv4l> sent a long message, see http://ix.io/4kyg
10:55:02FromDiscord<4zv4l> but I found why I guess↵I was using `out` variable which is a reserved word
10:58:35FromDiscord<cellux (Ruzsa Balázs)> sent a code paste, see https://paste.rs/dYA
11:14:10FromDiscord<Phil> @jtv I don't think I asked you this one yet, what are your testing approaches in nim or procedural languages in general?↵Solely integration tests?
11:18:49*azimut joined #nim
11:24:00FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4kyl
11:28:07FromDiscord<4zv4l> oh maybe because the file doesn't exist and `fmappend` won't create it ?
11:28:28FromDiscord<4zv4l> yeah no idk
11:37:10FromDiscord<4zv4l> seems that when I change the buffer size↵it works
12:00:21FromDiscord<untoreh> sent a code paste, see https://paste.rs/hOa
12:28:24FromDiscord<d4> sent a code paste, see https://play.nim-lang.org/#ix=4kyK
12:28:27FromDiscord<d4> basically im trying to append the contents to the file instead of rewriting it
12:51:17FromDiscord<d4> there are no errors happening, it just doesnt write anything to the file
12:54:33FromDiscord<ShalokShalom> In reply to @ShalokShalom "Elegant, does Kate pick": ElegantBeef: I try to get Kate running with Nim, and it seems to break the syntax highlighting. I assume you are running Kubuntu, or something? Does this work for you? https://media.discordapp.net/attachments/371759389889003532/1061266592408817705/grafik.png
12:55:02FromDiscord<ShalokShalom> The test file I used: https://raw.githubusercontent.com/Vindaar/shell/master/shell.nim
13:12:10FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4kyV
13:16:31*PMunch joined #nim
13:21:24FromDiscord<planetis> Add a # " comment where the error starts lol
13:28:11FromDiscord<jmgomez> In reply to @planetis "Add a # "": what do you mean?
13:29:22FromDiscord<planetis> Sorry I replied to @ShalokShalom to stop the error in syntax highlighting
13:29:49FromDiscord<planetis> That's what I do
13:30:24FromDiscord<jmgomez> ahh sorry, I thought it was an answer to my issue
13:32:26FromDiscord<ShalokShalom> In reply to @planetis "Add a # "": And then?
13:32:43FromDiscord<ShalokShalom> It seems to break at that "\\"
13:32:58FromDiscord<ShalokShalom> So that seems like Kate could use an outdated syntax highlighting file?
13:33:32FromDiscord<ShalokShalom> (edit) ""\\"" => "`"\\"`"
13:34:50*Guest46 joined #nim
13:35:09Guest46What's up guys. It's quandale dingle here!
13:35:48Guest46NimBot
13:36:12*Guest46 quit (Client Quit)
13:40:46FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4kyZ
13:59:21*arkurious joined #nim
14:04:01*byanka_ quit (Read error: Connection reset by peer)
14:04:24*byanka_ joined #nim
14:12:11FromDiscord<planetis> In reply to @ShalokShalom "It seems to break": yes after that add # "
14:12:45FromDiscord<planetis> it needs fixing, there is no newer version
14:13:24FromDiscord<ShalokShalom> You mean the source code is wrong?
14:13:44FromDiscord<ShalokShalom> Since its the package of someone else. I would launch a PR then.
14:14:01FromDiscord<dlesnoff> I am tinkering with graphviz. I would like to convert a Nim's AST to a GraphViz specification to render it like so for example.↵Has someone already done something similar ? https://media.discordapp.net/attachments/371759389889003532/1061286589457776640/graph.svg
14:15:12FromDiscord<dlesnoff> https://media.discordapp.net/attachments/371759389889003532/1061286886187999364/graph.jpg
14:15:20FromDiscord<ShalokShalom> In reply to @planetis "it needs fixing, there": With fixing, you mean the current syntax file
14:20:33FromDiscord<dlesnoff> Googled it and found this: https://github.com/petermora/nimDot
14:20:39FromDiscord<ShalokShalom> Since the same file is fine in VSCode, I assume thats down to https://invent.kde.org/frameworks/syntax-highlighting/-/blob/master/data/syntax/nim.xml
14:20:53FromDiscord<ShalokShalom> @planetis Thanks!
14:22:30FromDiscord<planetis> Really they use the same file? I thought VScode uses it's own format.
14:24:16PMunchdjazz, you around?
14:25:54FromDiscord<djazz> In reply to @PMunch "<@81390960805675008>, you around?": Whats up
14:27:22PMunchLooking at your Futhark PR
14:27:31PMunchHad a question, but managed to sort it out myslf
14:29:47FromDiscord<djazz> What about it?
14:29:58FromDiscord<ShalokShalom> In reply to @planetis "Really they use the": https://bugs.kde.org/show_bug.cgi?id=463969↵↵No, thats what I mean.
14:30:05FromDiscord<ShalokShalom> VSCode highlights correctly.
14:30:15FromDiscord<ShalokShalom> And it does use another format.
14:30:26PMunch@djazz, I was just wondering why you had removed the pragma thing instead of just adding your pragma to it
14:30:54PMunchBut I see that the feature has never been used and your solution is closer to what is done everywhere else in Futhark and a much cleaner solution
14:30:58FromDiscord<ShalokShalom> In reply to @planetis "Really they use the": I said the same file is fine in VSCode 🙂
14:31:18FromDiscord<planetis> Oh ok
14:31:23FromDiscord<djazz> The old pragma code didnt do anything and added the pragmas in the wrong place, before the
14:31:40FromDiscord<planetis> Got excited for a moment
14:32:15PMunch@djazz, yeah that seems to have been some stale code from when I created Futhark
14:32:15FromDiscord<djazz> Besides, it only worked for pragmas without values
14:32:44PMunchIt has existed in the codebase since the initial commit, but never actually been used for anything
14:33:07PMunchThe PR looks good
14:33:07FromDiscord<ShalokShalom> In reply to @planetis "Got excited for a": Why? would you like to use Kate
14:33:16PMunchI wish I had some better testing for Futhark though..
14:33:27FromDiscord<djazz> I found another issue last night, when enums contain same value multiple times, futhark makes a const, but without the with defined guards
14:33:58PMunchAh, that's not great
14:33:58FromDiscord<djazz> So it collides with other already defined consts
14:34:34FromDiscord<djazz> I tried to split lwip into lwip core and lwip apps, with the apps depending on the core. But const collision
14:35:02FromDiscord<ShalokShalom> @Vindaar By loading your `shell` into my VSCode, I saw that len is declared by not used. ↵https://github.com/Vindaar/shell/blob/master/shell.nim#L54
14:35:10FromDiscord<djazz> Works when you only import apps and not apps and core in same nim file
14:35:20FromDiscord<djazz> (since apps export lwip core)
14:51:18FromDiscord<djazz> PMunch: dont forget to bump version number if you want
14:52:19PMunchI will, just working on some other stuff as well
14:54:01FromDiscord<deech> What is the difference between `std/syncio` and `system/ansi_c`? Both seem to cover similar `FILE` functionality.
14:59:35PMunchsyncio is a nice Nim API to synchronous IO, ansi_c is a raw wrapper of C style file handling
15:00:06PMunchOh, and some other things in ANSI C of course
15:00:22PMunchLike jumps and printf
15:00:40PMunchThe C compiler uses ansi_c for targets that can use it I believe
15:04:58FromDiscord<dlesnoff> Can we output a Nim's AST in a file ? Dump[Tree,Ast,Lisp] output only appears in the Nim's compiler output.↵Macro output has to be untyped. If I understand correctly, no untyped variable can become a typed variable (it would be at runtime) ?
15:05:15FromDiscord<dlesnoff> (edit) "untyped. If" => "untyped.↵If"
15:07:34FromDiscord<pyryrin> sent a code paste, see https://play.nim-lang.org/#ix=4kzk
15:08:18FromDiscord<planetis> either is fine, you can also write 42'i32
15:08:34FromDiscord<pyryrin> what would you prefer planetis
15:09:14FromDiscord<planetis> the second one
15:09:20FromDiscord<pyryrin> actually that is very cool doing `42'i32`
15:09:41FromDiscord<dlesnoff> but is less explicit for newcomers to Nim
15:10:51FromDiscord<Rika> personally would do 1st or 3rd
15:11:00FromDiscord<planetis> actually I use all of them, you have to. if you're trying to safe convert a variable, you do myVar.int32
15:15:23PMunch@djazz, here you go: https://github.com/PMunch/futhark/releases/tag/v0.7.0
15:16:21PMunch@dlesnoff, `result.repr` is what Futhark uses to write Nim AST to a file as proper Nim code
15:17:12PMunch@pyryrin, I use `42'i32`
15:20:40FromDiscord<jtv> PMunch, that projecting is fing cool. Definitely going to reach for it first time I need it.
15:21:51PMunch@jtv, huh?
15:22:57FromDiscord<Rika> projecting -> project
15:22:58FromDiscord<Rika> i assume
15:26:20FromDiscord<jtv> Yes sorry, autocorrect 😦
15:27:04PMunchOh you're talking about Futhark :P Yes it's a pretty neat project
15:27:52PMunchWorks surprisingly well
15:29:09FromDiscord<djazz> In reply to @PMunch "<@81390960805675008>, here you go:": Thanks! Will try it out later
15:31:04FromDiscord<dlesnoff> In reply to @PMunch "<@610977647601909781>, `result.repr` is what": Thanks ! I will manage with this.
15:49:22PMunch@djazz, was it you who had the clang path finder?
15:49:29FromDiscord<djazz> yeah
15:51:19FromDiscord<djazz> here https://github.com/daniel-j/nim-picosdk/blob/master/src/picostdlib/private.nim#L7-L19
15:51:33PMunchThanks
15:52:02PMunchThanks :)
15:53:14FromDiscord<djazz> It could be improved
15:53:35FromDiscord<djazz> More of a demonstration of that it can be done
15:55:24FromDiscord<djazz> another solution would be that compiling opir would copy the include path inside the nimble thing? so that opir always works
15:55:36FromDiscord<djazz> even on systems without clang
15:55:46FromDiscord<djazz> i dunno
15:56:01FromDiscord<djazz> (if you copy opir to a system without clang)
15:56:25FromDiscord<djazz> nvm, it links to libclang dynamically
15:56:50FromDiscord<djazz> maybe opir can add clang's include paths to the json?
15:57:31FromDiscord<djazz> or as a separate opir --get-clang-includes
15:59:20PMunchHmm, that's a good idea
15:59:24FromDiscord<djazz> hmm, did alias stop work? pretty sure it worked before↵`{"kind":"const","file":".../cyw43-driver/src/cyw43_ll.h","position":{"column":9,"line":101},"name":"CYW43_SUP_KEYXCHANGE_WAIT_M1","type":{"kind":"alias","value":"CYW43_SUP_AUTHENTICATED"}}`
15:59:35FromDiscord<djazz> i see no const pointing to the other const
15:59:53PMunchHmm, if so then that's a bug
15:59:58FromDiscord<djazz> in nim it would be `const Cyw43SupKeyxchangeWaitM1 = Cyw43SupAuthenticated`
16:00:13PMunchI added support for your parenthesis constants, that might've broken something else..
16:00:19PMunchDo you have a minimal sample I can test with?
16:00:19FromDiscord<djazz> yeah perhaps
16:01:12FromDiscord<djazz> these C lines https://github.com/georgerobotics/cyw43-driver/blob/main/src/cyw43_ll.h#L93-L108
16:01:22PMunchHmm, it's Futhark who passes the Clang path to Opir though..
16:01:57FromDiscord<djazz> In reply to @PMunch "Hmm, it's Futhark who": ah right... well, opir uses libclang and should know the paths?
16:02:18FromDiscord<djazz> or maybe thats a feature of the frontend of the compiler
16:02:25PMunchYeah I think so
16:02:34PMunchI need to pass the path in with `-I` for it to work
16:02:38FromDiscord<djazz> wanna have a look at the alias thing?
16:02:46PMunchYeah I'm looking at it now
16:03:31FromDiscord<djazz> wrapping numbers with parens seems quite common with C macros
16:03:53FromDiscord<djazz> probably how macros work since they are just working on the text
16:04:11FromDiscord<djazz> making them more safer to use
16:04:16FromDiscord<jtv> It's incredibly common otherwise you end up having your numbers bind to the wrong things too easily, yes
16:04:57FromDiscord<deech> Currently in `std/sync_io`, `close` (https://github.com/nim-lang/Nim/blob/2564b5c938602e4f8820d2ed2b778c6d4f1d0cd5/lib/std/syncio.nim#L326-L329) allows you to close `stdin` and `stderr` which is probably not what the user wants most of the time. Any opinions on whether we should make this an error and add dedicated functions like `closeStdin`?
16:06:23FromDiscord<djazz> PMunch, you can also do this instead of adding another const, in case the C file doesnt use the correct order: `template Cyw43SupKeyxchangeWaitM1: untyped = Cyw43SupAuthenticated`
16:06:37FromDiscord<djazz> bit of a hack maybe
16:06:56FromDiscord<deech> (edit) "`std/sync_io`," => "`std/syncio`,"
16:07:38FromDiscord<djazz> then it will work like C macros xD
16:07:54PMunchYeah I don't quite remember why I didn't do that..
16:08:51FromDiscord<djazz> C: It's macros all the way down↵Nim: Macros is my speciality!
16:09:59FromDiscord<djazz> you can also do this for the "constants": `template Cyw43SupAuthenticated: untyped = (4)` although I prefer real consts
16:10:17FromDiscord<djazz> but for more complex stuff than ints...
16:11:50FromDiscord<djazz> for C macro "functions" etc
16:27:25FromDiscord<@thatrandomperson5-6310e3b26da03> Is it possible to parse a nim string into a NimNode at compile-time?
16:28:59FromDiscord<auxym> In reply to @@thatrandomperson5-6310e3b26da03 "Is it possible to": see parseStmt/parseExpr in https://nim-lang.org/docs/macros.html
16:29:31FromDiscord<Phil> Is it actually possible to include images into nim docs I wonder
16:30:03FromDiscord<Gumbercules> They are just rst no?
16:30:10FromDiscord<djazz> In reply to @Isofruit "Is it actually possible": data uris? 🤣
16:30:38FromDiscord<Phil> I have actually only seen rst mentioned, never read actually into what it is so I'm not familiar with anything in that space
16:31:25FromDiscord<Gumbercules> It's just a markup language that is focused on technical/engineering related documentation
16:31:48FromDiscord<Phil> Why not just use markdown?
16:32:06FromDiscord<Gumbercules> Whereas markdown is much more about producing nice looking legible documents
16:32:24FromDiscord<Phil> But eh, that wasn't the topic, sorry for the diverting question, so rst has image support?
16:32:40FromDiscord<Gumbercules> Because someone had a hardon for restructured text or had used it previously probably
16:33:10FromDiscord<Gumbercules> It's also the preferred markup language for Nim forum
16:33:22FromDiscord<Gumbercules> I believe it does.... Let me do the Google thing
16:33:42FromDiscord<Phil> The main reason I'm asking about this is because I think about macros fairly graphically, with symbols as individual bubbles
16:33:48FromDiscord<Phil> Yeh, just found something for that
16:33:52FromDiscord<Phil> https://sublime-and-sphinx-guide.readthedocs.io/en/latest/images.html
16:34:14FromDiscord<Gumbercules> https://restructuredtext.documatt.com/element/inline-image.html
16:34:16FromDiscord<Phil> Which I don't think is rst spec, rather something interpreting rst files or sth
16:34:25FromDiscord<Phil> Ah check, I'll read into that
16:34:27FromDiscord<Gumbercules> Yeah it might be an extension or some shit
16:34:49FromDiscord<Gumbercules> I'd be surprised though if it didn't work
16:35:22FromDiscord<Gumbercules> I feel like I've seen docs produced with nimdoc that have inline images
16:36:15PMunch@djazz, it appears to be an order issue I believe
16:36:26FromDiscord<djazz> hmm
16:36:30FromDiscord<djazz> the aliasing?
16:36:35PMunchYeah..
16:36:44FromDiscord<djazz> wrong order in opir output?
16:36:46PMunchThe problem is that Futhark will only create aliases to things it knows about
16:37:06PMunchNah, it's dumber than that
16:37:25PMunchIt uses a HashSet to keep track of what is marked as used
16:37:34PMunchAnd then it iterates over that and generates stuff
16:37:43FromDiscord<djazz> ah, so order is pretty much random?
16:37:48PMunchYup
16:38:28FromDiscord<djazz> well, #define doesnt care about order anyway...
16:39:18FromDiscord<djazz> maybe try the template idea?
16:39:37FromDiscord<djazz> but im pretty sure it worked before, but then it maybe was just lucky with the hasing...
16:39:42FromDiscord<djazz> hashing
16:42:32PMunch@djazz, I've fixed it
16:42:59FromDiscord<djazz> nice
16:43:42FromDiscord<djazz> this is now #futhark channel xD
16:47:07FromDiscord<djazz> should I open an issue about const collision with enums?
16:47:12FromDiscord<djazz> for futhark
16:47:41FromDiscord<djazz> I'll try make a minimal example
16:48:40PMunchHmm, is there no way to generate a `-d:somevar:somevalue` from config.nims?
16:49:10FromDiscord<djazz> switch("d", "somevar:somevalue")
16:49:18FromDiscord<djazz> I use it to set wifi ssid in my embedded thing
16:50:11FromDiscord<djazz> with `{.strdefine.}`
16:52:04Amun-Rais there a way to detect config.nims is included when nim doc is running?
16:53:18PMunch@djazz, right
16:53:37PMunch@djazz, uploaded my fix now, and a test case for it ;)
16:53:41Amun-Ra(it's not "when defined nimdoc", that doesn't work in .nims)
16:54:28FromDiscord<djazz> tests, nice!
16:55:25FromDiscord<@thatrandomperson5-6310e3b26da03> thanks!↵(@auxym)
16:55:55FromDiscord<djazz> PMunch: it also fixed the U16t stuff i was seeing on first compile!
16:56:07FromDiscord<djazz> awesome
16:56:16FromDiscord<jtv> Yeah, the adoption of RST is weird. Markdown has the ecosystem, at this point, RST is only really for projects that have been using it for 20 plus years. They'd all use Markdown if starting over
16:56:28FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4kA6
16:56:45Amun-Raor asciidoc
16:56:47FromDiscord<4zv4l> like any example on how I could do the same behavior but in Nim ?↵I would have to use sigaction ?
16:56:51PMunch@djazz, U16t stuff?
16:56:58PMunchOh right, you had some weird bug
16:57:04FromDiscord<djazz> missing types on first build
16:57:08FromDiscord<jtv> I assume there's a wrapper in posix
16:57:09FromDiscord<djazz> order issue i guess
16:57:16PMunchProbably
16:57:36FromDiscord<jtv> or you can just directly wrap it yourself, since it's always going to be linked in, it's no big challenge
16:57:48FromDiscord<jtv> But I'm pretty sure it'll be in posix
16:59:05FromDiscord<djazz> PMunch: add the when not declared wrapper for consts outside enums and I'll be happy 😄
17:01:22Amun-Rabtw, you can check config.nims was included by "nim doc" by checking getCommand()
17:01:39PMunch@djazz, do you have a minimal sample of that not working? If so please create an issue for it and I'll have a look at it after dinner
17:01:49FromDiscord<djazz> alright
17:01:53FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4kA8
17:02:12PMunch@djazz, are you aware of this? https://github.com/PMunch/futhark/issues/48 :P
17:02:42FromDiscord<djazz> neat
17:02:54FromDiscord<djazz> I did not read through all issues when looking for this lol
17:02:58PMunchI added this to config.nims for the tests: https://github.com/PMunch/futhark/blob/v0.7.1/tests/config.nims
17:03:04PMunchShould probably be updated to use that
17:03:11FromDiscord<djazz> yeah
17:03:58FromDiscord<djazz> make sure it gracefully fails on windows etc
17:04:06FromDiscord<djazz> aka empty path
17:04:11FromDiscord<djazz> staticExec should do that though
17:04:50FromDiscord<djazz> plus /include after the path, with correct dirSep
17:07:56FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4kA9
17:17:46FromDiscord<N4v> Just curious, is there a certain meaning to this Bible verse posted at the top of the Nim roadmap (https://github.com/nim-lang/RFCs/issues/503) ?↵↵See, I am sending an angel ahead of you to guard you along the way and to bring you to the place I have prepared. -- Exodus 23:20
17:19:53FromDiscord<@thatrandomperson5-6310e3b26da03> Im trying to search and replace NimNodes, any got any ideas, mine seems to not work\: https://play.nim-lang.org/#ix=4kAc
17:26:13*pro joined #nim
17:28:02*pro left #nim (#nim)
17:28:44FromDiscord<djazz> In reply to @N4v "Just curious, is there": It's a roadmap, angel guarding us along the way to Nim 2.0 😄
17:45:14FromDiscord<pyryrin> is in nim `when` like in c `#if`
17:46:16FromDiscord<demotomohiro> Yes. when statement only works at compile time.
17:48:08FromDiscord<djazz> PMunch: PR submitted, now dinner time for me 😄
18:01:42*ltriant joined #nim
18:06:13*ltriant quit (Ping timeout: 252 seconds)
18:40:13FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4kAt
18:41:15FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4kAt" => "https://play.nim-lang.org/#ix=4kAu"
18:43:32FromDiscord<Ailuros 💖🧡💛💚💙💜🖤> sent a code paste, see https://play.nim-lang.org/#ix=4kAv
18:45:15FromDiscord<Rika> In reply to @sOkam! "<@145405730571288577> you mentioned earlier": It is a pointer tuple essentially, the capacity is stored with the data chunk
18:51:27FromDiscord<jos> is there any way to forward declare types in nim?
18:51:59PMunchWhat do you mean @jos?
18:52:00FromDiscord<jos> sent a code paste, see https://play.nim-lang.org/#ix=4kAx
18:52:05FromDiscord<jos> they're in two separate files so i can't feasibly put them in the same type block
18:52:45PMunchDon't think it's possible across two separate files, no
18:58:58FromDiscord<jos> interesting, okay
18:59:16FromDiscord<jos> the only workaround i can think of is to make A generic and then specialize it under B
18:59:40FromDiscord<jos> sent a code paste, see https://play.nim-lang.org/#ix=4kAy
18:59:41FromDiscord<jos> i've done this workaround before
18:59:45PMunchThat's a possibility, or place all your types in one file, and import that file in both modules
19:00:04PMunchWhat's up with the brackets by the way?
19:00:10FromDiscord<jos> oh
19:00:14FromDiscord<jos> i write too much rust
19:00:30PMunchHaha, okay
19:00:56Zevvhttps://github.com/nim-lang/rfcs/issues/6
19:06:32FromDiscord<jos> that's a good read
19:06:51FromDiscord<jos> also unrelated, is there a way to make += and friends work with a setter
19:06:57FromDiscord<4zv4l> sent a long message, see http://ix.io/4kAB
19:07:23FromDiscord<jos> probably depends on your priorities
19:07:30FromDiscord<jos> you could argue either way
19:08:14ZevvNim is pretty easy to get started with, which is both a virtue and a curse
19:08:34Zevvit's obviously nice because, well, it's easy to get started with nim because it's friendly and simeply and pythonish
19:08:37FromDiscord<4zv4l> so you think that even with Nim the `Python curse` will also happen ?
19:08:37FromDiscord<jos> personally i wouldn't push them towards nim just because the tooling isn't quite there yet imo
19:08:55FromDiscord<jos> like ideally they would be able to use a language server with autocomplete, and not have to deal with stuff like `make` or linkers or c compilers
19:09:10Zevvthe curse part is that stuff is not actually always simple; when you learn C or Rust you are forst to actually understand what's happening under the hood. With Nim, you will run into stuff one day and realize you might not have truly understood what you were doing all the time
19:09:32Zevvs/forst/forced/
19:09:32FromDiscord<4zv4l> In reply to @jos "like ideally they would": vscode doesn't have a plugin for Nim ?
19:10:32FromDiscord<jos> it does, but it's not that great
19:10:33FromDiscord<4zv4l> yes I understand, it's just for some I think C is too low level to start ↵they don't get result quickly enough↵same goes with Rust which is even worst to me with all the syntax you can get
19:10:36FromDiscord<jos> it's buggy
19:10:58FromDiscord<jos> i think c# is a really good first language-- the tooling is top-tier
19:11:00FromDiscord<4zv4l> like in high school in C we were making shape in the terminal to train our logic↵that's probably not what a person who wanna learn programming want to do xD
19:11:05FromDiscord<jos> and it's statically typed
19:11:09FromDiscord<jos> also unity uses c#
19:11:13FromDiscord<jos> so if they're into games that's a nice motivator
19:11:18Zevv4zv4l: true; in that case nim could be a nice tradeoff. But if they have problems grasping low level things in python, that will not be any better with nim
19:11:30Zevvimho to truly understand nim, you need to understand C
19:11:37FromDiscord<jos> ^ i agree with that
19:11:40FromDiscord<jos> especially with the tooling
19:11:44FromDiscord<4zv4l> yeah I agree too actually
19:11:48FromDiscord<4zv4l> unfortunately
19:12:20Zevv4zv4l: if have a writeup about how nim does basic memory management, if that is any help for them.
19:12:33FromDiscord<jos> with orc?
19:12:36FromDiscord<jos> and move semantics
19:12:47Zevvno, that part is yet to be written :)
19:12:54FromDiscord<4zv4l> well, they're chinese and learning English, can be a good exercise to learn both I guess
19:12:59Zevvit's the bare basics: stack, heap, seqs, objects, etc
19:13:09FromDiscord<4zv4l> oooh that would be great yeah
19:13:11Zevvhttps://zevv.nl/nim-memory/
19:13:45FromDiscord<4zv4l> thanks !
19:13:48Zevvyw
19:13:49FromDiscord<4zv4l> I'll check that
19:13:55FromDiscord<4zv4l> you made that in Markdown ?
19:14:01Zevvyes
19:15:02FromDiscord<4zv4l> do you mind if I ask for a pdf version ? I don't know if they can access it with the firewall there↵and making a pdf through my browser won't look amazing xD
19:15:09Zevvgimme a sec
19:16:16Zevvhttp://zevv.nl/div/nim-memory.pdf
19:16:36FromDiscord<4zv4l> thank you !
19:17:47Zevvhm sorry that's old, let me convert the latest version
19:18:51FromDiscord<4zv4l> how do you convert the markdown with the css into pdf ?↵I try with pandoc but I'm not super used to that tool yet
19:19:02Zevvi forgot, i'm just figuring that out
19:19:12FromDiscord<4zv4l> oh alright xD
19:20:21Zevvnew version is at the same url, please reload
19:20:24ZevvI used asciidoctor-pdf
19:22:05FromDiscord<4zv4l> oooh made in Ruby
19:22:18FromDiscord<4zv4l> I'll try compiling it myself and see how it goes
19:22:20FromDiscord<! Nilts> sent a code paste, see https://paste.rs/FYB
19:25:56FromDiscord<4zv4l> In reply to @Zevv "http://zevv.nl/div/nim-memory.pdf": thank you so much again ! really nice doc
19:26:07FromDiscord<! Nilts> In reply to @not logged in "Whats going on with": why is empty string trying to be an ident?
19:50:19FromDiscord<! Nilts> fixed it, compile time errors do be unheplful tho
19:57:49FromDiscord<jos> sent a code paste, see https://play.nim-lang.org/#ix=4kAI
19:58:05FromDiscord<jos> am i doing something wrong or does the method call syntax not work in this scenario
19:58:31Zevvhttps://nim-lang.github.io/Nim/manual.html#templates-limitations-of-the-method-call-syntax
19:59:27Zevvwell, no, that's not related, is it
19:59:34FromDiscord<jos> yea
19:59:43FromDiscord<jos> it might be a limitation but i don't think it falls under one of those two
19:59:48Zevvright
20:00:03FromDiscord<Recruit_main707> iirc `discard 123.test[:string]()` worked
20:00:15FromDiscord<Recruit_main707> or smth like that
20:01:01FromDiscord<jos> weeeeeeeeeird
20:01:03FromDiscord<jos> why does that work?
20:01:10FromDiscord<jos> what does the colon do in that position
20:06:03FromDiscord<cow> sent a code paste, see https://play.nim-lang.org/#ix=4kAL
20:07:00FromDiscord<cow> I'm surprised the first example works, since you're passing an int to it and not a uint32
20:07:30FromDiscord<cow> maybe the compiler can deduce that it's probably fine to assume you meant an uint32 123 in the first case?
20:08:26FromDiscord<cow> nevermind it doesn't help to specify that it's an uint32
20:09:08FromDiscord<cow> but if you change the type of `ok` to `int` it works
20:18:05Zevvfound it: https://nim-lang.github.io/Nim/manual.html#procedures-method-call-syntax
20:18:07Zevvbottom of the paragraph
20:18:11Zevvi knew it was in there
20:18:16Zevv"The method call syntax conflicts with explicit generic instantiations: p[T](x) cannot be written as x.p[T] because x.p[T] is always parsed as (x.p)[T].
20:18:19ZevvSee also: Limitations of the method call syntax.
20:18:21ZevvThe [: ] notation has been designed to mitigate this issue: x.p[:T] is rewritten by the parser to p[T](x), x.p[:T](y) is rewritten to p[T](x, y). Note that [: ] has no AST representation, the rewrite is performed directly in the parsing step."
20:18:45FromDiscord<jos> interesting
20:18:47FromDiscord<jos> hmmm
20:18:56FromDiscord<jos> this messes with my api a little but i think i can fix it with a macro
20:19:59FromDiscord<cow> maybe this is a consequence of [] being both indexing and generics?
20:20:27FromDiscord<cow> since if you are indexing (p.x)[T] is the right precedence
20:21:08FromDiscord<huantian> In reply to @jos "this messes with my": you might want to consider using a `typedesc` arg i
20:21:12FromDiscord<huantian> that might be cleaner for your api
20:21:18FromDiscord<huantian> kinda like how jsony does it
20:22:02*pro joined #nim
20:22:33*pro left #nim (#nim)
20:27:34FromDiscord<Elegantbeef> It means tuple↵(@sOkam!)
20:28:24FromDiscord<Elegantbeef> The int is the capacity and the unchecked array is just the allocated block
20:28:43FromDiscord<Elegantbeef> I'm using endeveour os and it works ine↵(@ShalokShalom)
20:28:45FromDiscord<Elegantbeef> fine even
20:40:41FromDiscord<jos> is there any way to get the type from a generic arg in a macro?
20:41:10FromDiscord<ShalokShalom> In reply to @Elegantbeef "I'm using endeveour os": So you mean, out of the box?
20:41:24FromDiscord<ShalokShalom> Like, you didnt have to configure anything?
20:42:21FromDiscord<ShalokShalom> And you did that within the last 9 months, since the PR got merged?
20:58:53FromDiscord<pietroppeter> Hi @ElegantBeef are you planning on doing the this month with Nim Nov/Dec blogpost? I can help (e.g. doing the PR myself) if needed
21:07:25*jmdaemon joined #nim
21:20:07*genpaku quit (Read error: Connection reset by peer)
21:20:51*genpaku joined #nim
21:27:51*oprypin quit (Read error: Connection reset by peer)
21:27:58*oprypin_ joined #nim
21:28:56FromDiscord<Elegantbeef> Oh forgot that juan had so many packages, if you're offering to do it i'd be very thankful 😛↵(@pietroppeter)
21:29:33FromDiscord<Elegantbeef> What do you mean?↵(@jos)
21:33:39FromDiscord<jos> In reply to @Elegantbeef "What do you mean?": I wanted to use the inferred generic from a param i.e. macro zzz[T](x: T)
21:33:49FromDiscord<jos> I found getTypeInst and that worked
21:43:25*knallvar joined #nim
21:53:39PMunch@Elegantbeef, just added a `-d:nodeclguards` switch to Futhark which gives you that readable output you've been asking for
21:54:00PMunchhttps://github.com/PMunch/futhark/tree/v0.7.2#compatibility-features-and-readability
21:56:10FromDiscord<Elegantbeef> We did it, bitching and moaning works! 😛
22:03:27*knallvar quit (Quit: knallvar)
22:13:48PMunchJust took what? 7 versions?
22:14:03FromDiscord<⚶ Zeno> In reply to @Elegantbeef "We did it, bitching": i enter in this server and this is the first thing i see
22:14:06FromDiscord<⚶ Zeno> LMAO
22:16:23FromDiscord<planetis> nice
22:17:51PMunchDamn it, I was supposed to just check out a PR for Futhark this morning before doing what I was going to do. But now I've spent the entire day on Futhark..
22:18:44FromDiscord<Elegantbeef> You're welcome/sorry
22:19:16PMunchOh that's not your fault, @djazz is the one who made the PR, I blame them
22:21:06FromDiscord<djazz> Awesome!
22:21:37FromDiscord<djazz> At this rate, futhark 2.0 will release before nim 2.0 😉
22:21:48PMunchHaha, Futhark isn't even 1.0 :P
22:21:56PMunchI guess it's getting stable enough though
22:22:02FromDiscord<djazz> 😄
22:22:53FromDiscord<Elegantbeef> This is where i bring up the `#define own`
22:23:04PMunchAt least it's better than c2nim and nimterop :)
22:23:12PMunch@Elegantbeef, don't you dare!
22:23:21PMunchYou'll ruin tomorrow as well at this rate
22:23:40PMunchThat was the varargs issue wasn't it?
22:23:56FromDiscord<Elegantbeef> Yea clang thinks the procedure is varargs
22:23:59PMunchI don't think that's fixable in Nim unfortunately, seems like a clang bug
22:24:06FromDiscord<Elegantbeef> I dont think you can really fix it aside from making an issue with libclang
22:26:07FromDiscord<djazz> Would be nice to have control over where the generated nim code goes, instead of cache
22:26:57FromDiscord<djazz> To be able to import it directly
22:26:59FromDiscord<Elegantbeef> djazz is literally just me
22:27:09PMunch@djazz, PRs welcome :P
22:27:21PMunchWhy would you import it though?
22:27:30FromDiscord<djazz> ElegantBeef, you make PR 🙂
22:27:34PMunchimportc automatically includes it
22:27:36FromDiscord<Elegantbeef> Lol
22:27:59PMunchWould be a super simple one-liner on line 518
22:28:02FromDiscord<djazz> I dont get syntax highlight etc with futhark importc
22:28:10PMunchHmm, strange
22:28:10FromDiscord<Elegantbeef> Pmunch as much as you dislike it most people would like to be able to ship the bindings 😄
22:28:20FromDiscord<Elegantbeef> https://github.com/beef331/miniaudio/blob/master/src/miniaudio.nim#L4-L10 is a bit annoying
22:28:23PMunchI do, as long as the module is in cache before I open my editor :P
22:28:58PMunchWhy is that annoying? It's the best of both worlds
22:29:13FromDiscord<djazz> In my case, the bindings depend heavily on a header file with flags on what to include, so it cant be committed
22:29:14FromDiscord<Elegantbeef> Cause i have to manually copy the file
22:29:52PMunchNow users who don't have clang/futhark installed can just use that, and if you want to add an extra define or use an updated version of the C library they can just throw that switch and you don't have to do anything
22:30:19PMunch@Elegantbeef, oh you want a -d:putmyfutharkfilehere:futharkminaudio.nim switch?
22:31:05FromDiscord<djazz> -d:elegantpath:miniaudio.nim
22:31:08FromDiscord<Elegantbeef> The annoying part is that i have to manually copy the file like it's the year 2001 😛
22:31:09FromDiscord<Elegantbeef> Yes yes PRs welcome
22:31:19FromDiscord<ted__> sent a code paste, see https://play.nim-lang.org/#ix=4kB6
22:31:27FromDiscord<Elegantbeef> A bit simpler pmunch
22:31:39FromDiscord<Elegantbeef> Just a \`outputPath "somePath"
22:31:41PMunchYeah I guess that would be nice
22:31:54FromDiscord<Elegantbeef> Ted\_ you need a new name for the fields
22:32:02PMunchIt would be super easy to implement, just saying
22:32:03FromDiscord<Elegantbeef> Field names cannot overlap
22:32:36FromDiscord<ted__> ok, thanks Elegantbeef, yeah that feels like the only option now, but it's making the code kind of gross
22:32:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4kB7
22:33:07FromDiscord<Elegantbeef> I guess that should be `raiseAssert`
22:33:52FromDiscord<Elegantbeef> A macro/template could be used to make it a bit less redundant
22:34:06PMunchTIL raiseAssert
22:34:25FromDiscord<ted__> hmm, I'll have to think about using a template for pulling out the appropriate field given the `kind`
22:35:03FromDiscord<ted__> oh, but the `proc x` you defined might work in most of the cases and at least centralizes it
22:35:16FromDiscord<sOkam!> In reply to @ted__ "I hit a dead-end": I use different names, with aliases for the real names i want to access
22:36:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4kB8
22:36:22FromDiscord<sOkam!> you can also do `x=` and assign the value with `x = thing`
22:36:30FromDiscord<Elegantbeef> Anyway it's kinda redundant
22:36:53FromDiscord<Elegantbeef> Also need a getter that is `proc x(dim: var DimensionalShape): var int`
22:37:13FromDiscord<Elegantbeef> But with those you can relatively easily get the desired api with the same safety that Nim provides
22:37:48FromDiscord<Elegantbeef> Like you said you can make a template to generate getter and setters
22:38:02FromDiscord<ted__> thanks, those look like the alternatives I was looking for and are cleaner than what I was trying. Hope that RFC gets implemented at some point, but this seems like the best way till then
22:39:15FromDiscord<Elegantbeef> Shit
22:39:15FromDiscord<Elegantbeef> 😄
22:39:17FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4kB9
22:40:30FromDiscord<Elegantbeef> There we go
22:40:31FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4kBa
22:40:38FromDiscord<Elegantbeef> \Add a export marker if you want
22:41:07FromDiscord<Elegantbeef> Also add a `{.inline.}` if you're really anal
22:42:21FromDiscord<ted__> wrapping my brain around that now 😀
22:42:34FromDiscord<Elegantbeef> Shit i messed that up
22:42:44FromDiscord<Elegantbeef> There we go
22:42:48FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4kBc
22:44:49FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4kBd
22:44:50FromDiscord<Elegantbeef> Run this code locally and see what `genProps` makes
22:45:44FromDiscord<ted__> ok, got it, so that'll put the `xVal`, `yVal`, and `zVal` fields as private ones on all variants, but the templates could then be made public so that code calling it would only have access to the `x`, `y`, and `z` generated `proc`s
22:45:53FromDiscord<Elegantbeef> Yep
22:46:24FromDiscord<Elegantbeef> Unless you really need the memory savings that a union gives you this is fine
22:46:43FromDiscord<Elegantbeef> If you need the memory savings then using branches inside the object with accessors is the best you can do in Nim
22:47:36FromDiscord<ted__> for the real use case I'm looking at right now there are really only a very few (or even one) of these objects that'd be instantiated at any one time, so this totally works
22:48:17FromDiscord<Elegantbeef> Say you have a 4th branch that doesnt have x,y,z. It has it's own string and whatever else
22:48:19FromDiscord<Elegantbeef> When you use branches in the typedef there is a hidden union that allows memory to overlap so the type is just the size of the largest branch
22:48:34FromDiscord<Elegantbeef> Which is partially why you cannot reuse field names
22:49:14FromDiscord<Elegantbeef> When you can reuse field names you basically need to generate a check of X branches to figure out which offset you actually want
22:50:00FromDiscord<Elegantbeef> Luckily no one has suggested reusing different field names with different types
22:50:30FromDiscord<Elegantbeef> That's a complex beast that requires a rust style "To access fields we have to do it inside a concrete pattern"
22:53:43FromDiscord<ted__> In reply to @Elegantbeef "Luckily no one has": I did see on the RFC that using different types (rust-style) was a suggestion that was had: https://github.com/nim-lang/RFCs/issues/368#issuecomment-820701871↵↵and that seems to be why at least some folks are pushing against the current syntax proposal. That's not something I've needed. But in the short time that I've been using Nim, I've hit this limitation for variants to share a fie
22:54:46FromDiscord<Elegantbeef> I see i forgot about the entire contents of the RFC 😄
23:02:40FromDiscord<pietroppeter> In reply to @Elegantbeef "Oh forgot that juan": Yep no problem, will do it!
23:28:57*PMunch quit (Quit: leaving)