<< 10-11-2021 >>

01:21:43*mahlon quit (Ping timeout: 244 seconds)
01:27:28*mahlon joined #nim
01:56:53*jimmoth_44 joined #nim
01:59:33*jimmoth_44 quit (Client Quit)
02:10:15FromDiscord<Just Jasmine, Please> Hi! I'm getting back into nim after a little break and was wondering if there where any good tutorials on making games using godot and nim? Not necessarily setting it up, I feel that I would learn faster if I could see how the language interacts with godot
02:29:53FromDiscord<impbox [ftsf]> I've seen a few people posting about using nim with Godot in the #gamedev channel, not sure if there's any tutorials but maybe someone can help you out
02:42:08FromDiscord<hyu1996> choosenim does not support centos7.6
02:42:24FromDiscord<hyu1996> https://media.discordapp.net/attachments/371759389889003532/907822468960501760/unknown.png
02:43:29FromDiscord<hyu1996> I need to install a new version of the compiler to compile the new version of glibc
02:44:37FromDiscord<Rika> afaik choosenim expects modern glibc yeah
02:52:48NimEventerNew thread by Tmsa04: Fix for Warning: implicit conversion to 'cstring' from a non-const location, see https://forum.nim-lang.org/t/8608
02:55:02*neurocyte0132889 quit (Ping timeout: 240 seconds)
03:03:32*krux02 quit (Quit: Leaving)
03:11:20FromDiscord<Yardanico> In reply to @hyu1996 "I need to install": If you just want Nim on an system with old glibc you can get nightlies for 1.6 branch
03:12:25FromDiscord<Yardanico> https://github.com/nim-lang/nightlies/releases/tag/2021-10-19-version-1-6-727c6378d2464090564dbcd9bc8b9ac648467e38
03:12:55FromDiscord<Yardanico> binaries there are statically linked with musl
03:13:19FromDiscord<Yardanico> Also this is not a "nightly" in the stability sense, but the 1.6 release
03:17:27FromDiscord<ajusa> How do I install Futhark on Linux? https://github.com/PMunch/futhark↵I'm getting a `cannot find -lclang`, not sure what packages I need other than clang. Also not sure what path I'm supposed to pass to it
03:18:22FromDiscord<ajusa> And I answered my own question: I needed to install `clang-devel`, my bad
03:24:35FromDiscord<hyu1996> In reply to @Yardanico "If you just want": thx bro, I am already compiling gcc7.5
03:32:16FromDiscord<hyu1996> this code is a bit counter-intuitive https://media.discordapp.net/attachments/371759389889003532/907835018653618196/WXGEQIVVKCXUWBZIKLB.png
03:37:23FromDiscord<hyu1996> This is the result of running python https://media.discordapp.net/attachments/371759389889003532/907836310058856458/unknown.png
03:40:15FromDiscord<hyu1996> intuitively, the path a/../d/e is d/e, not a/d/e
03:44:14*arkurious quit (Quit: Leaving)
03:48:05FromDiscord<Rika> In reply to @hyu1996 "intuitively, the path `a/../d/e`": python does not resolve ".." afaik
03:54:07FromDiscord<hyu1996> there is bad news. my glibc is broken. I will take a moment to restore from the system backup. https://media.discordapp.net/attachments/371759389889003532/907840518610907216/unknown.png
03:57:21FromDiscord<hyu1996> In reply to @Rika "python does not resolve": I think python’s approach is correct because`a` is not the root directory, it is a relative directory
04:06:01*supakeen quit (Quit: WeeChat 3.3)
04:06:32*supakeen joined #nim
04:16:50Amun-Ra7.6 is eol, what can you do
04:32:42*rockcavera quit (Remote host closed the connection)
04:52:04FromDiscord<hyu1996> in my country, centos7 is still very popular, and many production environments are afraid to upgrade or replace the system easily.
04:54:25FromDiscord<hyu1996> our company’s test environment is centos7.64, so we use this version of the system for development and testing
06:06:44Amun-Rathat's pretty unfortunate as iirc they stopped releasing security fixes for 7.x
07:26:35FromDiscord<evoalg> I get why `newSeqOfCap` is more efficient than Seq, but why would `newSeqOfCap` be used instead of an array? Both are limited by size, and both grab all the memory they need upon initialization ... have I got that right?
07:27:52FromDiscord<Elegantbeef> sequences can grow
07:27:58FromDiscord<Elegantbeef> So if you do hit the capacity it can grow over it
07:28:06FromDiscord<Elegantbeef> But with an array if you need more you're SoL
07:28:33FromDiscord<evoalg> newSeqOfCap can grow? - oh I didn't know ...
07:28:52FromDiscord<Elegantbeef> It's just a sequence underneath, it just allocates a given amount on usage
07:29:39FromDiscord<evoalg> I see ... then what's the difference between the cap and a seq where you define the length? ... ie `newSeq[string](3)`
07:30:43FromDiscord<Rika> Capacity means only memory
07:30:50FromDiscord<evoalg> eg `newSeq[string](3)` vs `newSeqOfCap[string](3)`
07:30:59FromDiscord<Rika> (Empty seq)
07:31:11FromDiscord<Rika> Defined length means the seq is filled with default entries of the type
07:31:58FromDiscord<evoalg> ohhhh the Cap version isn't filled ... why is that a good thing? ... I mean why would one be used over the other?
07:33:52FromDiscord<evoalg> Oh I guess you can filled the already filled one with proper values out of order
07:34:17FromDiscord<evoalg> but for the Cap version I'd have to use .add
07:41:02FromDiscord<Elegantbeef> Indeed `newSeq[int](3)[0]` is fine but `newSeqOfCap[int](3)[0]` is an error
07:50:24FromDiscord<evoalg> Thank you once again for patiently & expertly answering my noob questions
08:00:11*pro joined #nim
08:08:50*PMunch joined #nim
08:11:09FromDiscord<evoalg> So I was wrong to think they were limited in size, it's more that they grab that much memory in one go
08:12:23FromDiscord<Elegantbeef> Yep
08:12:26FromDiscord<Elegantbeef> You've got it!
08:13:52FromDiscord<evoalg> Nice lol I'm getting there slowly (with your help)
08:14:56FromDiscord<Elegantbeef> Hey my help is offered gladly especially today! 😛
08:15:13FromDiscord<evoalg> why especially today?
08:15:51FromDiscord<Elegantbeef> My dogs were attacked when i was walking them today, so the distraction is nice 🙂
08:16:14FromDiscord<evoalg> ahhh no sorry to hear that
08:16:28FromDiscord<evoalg> well I do have another question...
08:16:33FromDiscord<Elegantbeef> Good
08:17:06FromDiscord<evoalg> let me prep it ....
08:19:49FromDiscord<evoalg> https://play.nim-lang.org/#ix=3EyS
08:20:19FromDiscord<evoalg> I want to know if my "find all" proc is a good idea or if I'm missing something obvious
08:20:41FromDiscord<Elegantbeef> Depends on what you're after, do you want them all in a collection?
08:20:44FromDiscord<evoalg> (as I thought there would be the function already in nim but I can't see anything)
08:21:45FromDiscord<evoalg> I was after the indexes, as I wanted to replace those chars by something else (but not with the same char)
08:21:56FromDiscord<Rika> I feel like that’s fine
08:22:10FromDiscord<Rika> If you’re finding all you have to scan all indices
08:22:19FromDiscord<Rika> Given an unsorted sequence
08:23:04FromDiscord<evoalg> ok phew - I was thinking I was taking the long way as I usually do 😉
08:23:43FromDiscord<Elegantbeef> You can do it a bit simpler(also included an inplace iterator version) https://play.nim-lang.org/#ix=3EyT
08:24:05FromDiscord<evoalg> oooo let me digest!
08:24:15FromDiscord<Rika> Smh beef code duplication that’s bad
08:24:52FromDiscord<Rika> Personally would make the iterator only, I can always use to seq for the value returning version
08:25:33FromDiscord<Elegantbeef> Yep
08:28:49FromDiscord<evoalg> woah I'm still trying to figure out how that inplace iterator works
08:29:30FromDiscord<Elegantbeef> iterators are just copy pastes basically
08:30:26FromDiscord<Elegantbeef> So where you call `for x in findAllIndsof(s, c)` imagine it copying the iterator body there and each `yield` is doing `let x = yieldValue` followed by your code
08:31:12FromDiscord<evoalg> ok I sort of get that ... but the yield seems to be returning an address?
08:31:47FromDiscord<Elegantbeef> yea `var string` `var char` are references
08:32:16FromDiscord<evoalg> ohhhhh!
08:32:41FromDiscord<evoalg> lol that's very tricky and cute
08:33:59FromDiscord<Elegantbeef> What's probably clear is that this wouldnt work for `let` variables, so you'd need to do a copy first
08:34:17FromDiscord<Elegantbeef> `var myNewStr = myString` before the iterator
08:34:44FromDiscord<Tuatarian> anyone here do graphics programming in Nim?
08:34:48FromDiscord<Tuatarian> or game programming
08:34:56FromDiscord<Elegantbeef> Some schmuck named beef
08:35:05FromDiscord<Tuatarian> wonder who that could be
08:35:13FromDiscord<Tuatarian> any idea what tooling he uses?
08:35:33FromDiscord<Tuatarian> (gameengine/library/whatever)
08:35:37FromDiscord<Elegantbeef> He's presently using his own "framework"
08:35:42FromDiscord<Tuatarian> I see
08:35:48FromDiscord<Tuatarian> has he written it from scratch?
08:36:08FromDiscord<Elegantbeef> Using SDL2 + opengl + assimp yes
08:36:11FromDiscord<Tuatarian> if so, I am very impressed with his work
08:36:19FromDiscord<Tuatarian> what's his opinion on SDL2?
08:36:27FromDiscord<Elegantbeef> It's fine so far
08:36:46FromDiscord<Tuatarian> I've been using raylib, but I want to try other things since shaders have never worked properly for me
08:36:49FromDiscord<Elegantbeef> Window events being in the same event queue as buttons kinda sucks
08:37:02FromDiscord<Tuatarian> somehow the examples work fine, but my code does not, and I cannot identify the difference between me and the examples
08:37:06FromDiscord<Tuatarian> oh I see
08:37:07FromDiscord<Tuatarian> that's strange
08:37:17FromDiscord<Elegantbeef> drop-2021-11-09\_01.53.02.mp4 https://media.discordapp.net/attachments/371759389889003532/907911779634540554/drop-2021-11-09_01.53.02.mp4
08:37:17FromDiscord<Elegantbeef> This is my present work with it
08:37:27FromDiscord<Elegantbeef> Mostly building it out with it, but truss3d is very much "not finished"
08:37:30FromDiscord<Tuatarian> pretty solid
08:37:54FromDiscord<Elegantbeef> Today i was working on framebuffers before the aforementioned event
08:37:57FromDiscord<Tuatarian> yeah this looks very good
08:38:03FromDiscord<Tuatarian> the wonder event?
08:38:12FromDiscord<Tuatarian> window?
08:38:30FromDiscord<Elegantbeef> Nope the thing about my dogs i mentioned earlier
08:38:49FromDiscord<Tuatarian> oh god
08:38:52FromDiscord<Tuatarian> wow I did not see that
08:38:55FromDiscord<Tuatarian> that's horrible
08:39:12FromDiscord<Tuatarian> are they ok?
08:39:17FromDiscord<Elegantbeef> https://github.com/beef331/truss3d if you want to look about the framework feel free too, looking now forgot to throw a license on it
08:39:38FromDiscord<Tuatarian> debating whether to work from this or to try to make my own thing
08:39:56FromDiscord<Elegantbeef> Aside from stitches and being uncomfortable yea they're fine, one got vastly more injured
08:40:18FromDiscord<Elegantbeef> And if you wanted to see how it looks in use the above game is being developed openly
08:40:26FromDiscord<Elegantbeef> https://github.com/beef331/mindthegap3D
08:41:16FromDiscord<Tuatarian> how does rendering work with SDL?
08:41:21FromDiscord<Tuatarian> like lets say I want to draw a triangle
08:41:32FromDiscord<Elegantbeef> I'm not using sdl2 for rendering
08:41:39FromDiscord<Tuatarian> pure opengl for rendering?
08:41:44FromDiscord<Elegantbeef> I'm using opengl for rendering, sdl2 for IO/windowing and assimp for loading models
08:41:55FromDiscord<Tuatarian> is managing the 3 libs a pain?
08:42:19FromDiscord<Elegantbeef> Not too bad, i'm using my own fork of the last's bindings to add features i want/need
08:42:24FromDiscord<Elegantbeef> The other two work as if C
08:43:22FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/907913310798770186/image.png
08:43:26FromDiscord<Elegantbeef> https://github.com/beef331/truss3d/blob/master/examples/shapes.nim generated by this
08:43:36FromDiscord<Elegantbeef> Just so you can get an understanding of the API presently
08:45:01FromDiscord<Tuatarian> seems pretty reasonable
08:45:12FromDiscord<Tuatarian> I really hate the organization of opengl though
08:45:29FromDiscord<Tuatarian> it basically being a state machine really makes life hard
08:45:57FromDiscord<Elegantbeef> Yea that's what most of the abstractions are about removing that nusiance part
08:47:49FromDiscord<Elegantbeef> You might be interested in https://github.com/Ethosa/nodesnim or https://github.com/abisxir/alasgar
08:54:14PMunchIs the playground down for anybody else? It appears up from my end.. https://forum.nim-lang.org/t/5052#55908
08:54:41FromDiscord<Elegantbeef> Fine here
08:56:33FromDiscord<evoalg> Will you be walking with a big stick in future? Hmmmm I dunno what the answer is
08:58:01FromDiscord<Elegantbeef> I'm not Teddy Roosevelt
08:59:10FromDiscord<evoalg> So in your tricky iterator, `s: var string` bit means a ref, and with the `for i, x in s:` part, i and x aren't addresses, but the `yield s[i]` is because s[i] is an address, so that's why you yield that instead of x?
08:59:31FromDiscord<Elegantbeef> Yep
08:59:45FromDiscord<Rika> Be careful when calling them references
08:59:51FromDiscord<Elegantbeef> `for i, x in s` calls `x.pairs` which yields `(int, char)`
09:00:04FromDiscord<Rika> You’ll get confused easily
09:00:33FromDiscord<evoalg> I get confused easily enough as it is lol
09:00:53FromDiscord<Rika> In reply to @evoalg "So in your tricky": Not because it’s an address but because x is immutable
09:01:25FromDiscord<Rika> s[i] is “var char” and x is “char”
09:01:41FromDiscord<Rika> You could yield x if you used mitems
09:02:02FromDiscord<Elegantbeef> But then you need to use your own increment counter
09:03:09FromDiscord<Rika> ?? What increment counter
09:03:20FromDiscord<Elegantbeef> `i, x`
09:03:38FromDiscord<Rika> Again, what about it
09:03:49FromDiscord<Elegantbeef> Ah right nevermind
09:03:54FromDiscord<Rika> Smh
09:03:57FromDiscord<evoalg> interesting! ... I think in python I can change the x (in a for x in...)
09:04:16FromDiscord<Rika> In reply to @evoalg "interesting! ... I think": Python doesn’t have a concept of immutability
09:04:30FromDiscord<evoalg> ahh gotcha
09:04:38FromDiscord<evoalg> I googled smh ... Shaking my head ?
09:04:41FromDiscord<Rika> Unless you shoehorn it in with custom classes
09:04:44FromDiscord<Rika> In reply to @evoalg "I googled smh ...": Yes
09:05:29FromDiscord<evoalg> Do both of you know how to program in C too?
09:05:39FromDiscord<Elegantbeef> I do not
09:05:56FromDiscord<Elegantbeef> I know enough C i can wrap stuff, but aside from that i do not know anything
09:06:32FromDiscord<evoalg> I'm encouraged to hear that because with lots of C talk in this channel I was fearing I'd have to have a good understanding of C to be able to program in nim properly
09:07:06FromDiscord<Elegantbeef> C will help but to learn lower level stuff Nim will do just aswell
09:07:32FromDiscord<Elegantbeef> I came from C# a few years ago and didnt have much of a grasp on pretty much any lower level stuff
09:07:59FromDiscord<evoalg> ahhh interesting!
09:09:45FromDiscord<Rika> In reply to @evoalg "Do both of you": I do
09:09:48FromDiscord<Rika> Sorry to say
09:09:53FromDiscord<Rika> And also unfortunately for me
09:10:11FromDiscord<evoalg> lol ... why unfortunately?
09:10:17FromDiscord<Elegantbeef> It's C
09:10:22FromDiscord<evoalg> lol
09:10:25FromDiscord<Rika> Try it. You may cry
09:10:46PMunchPfft, C isn't all that bad
09:10:53PMunchOnce you get a hang of pointers
09:11:08FromDiscord<Rika> It isn’t but it is if you’re under time pressure and have to write a lot of shit from scratch
09:11:21FromDiscord<Rika> Also lack of overloading was painful
09:11:41FromDiscord<Rika> Library name + type name prefixes
09:11:43FromDiscord<Rika> How nice
09:12:30FromDiscord<evoalg> when people talk of C in here, are they talking C or really C++ ?
09:12:43PMunchI talk of C
09:12:49FromDiscord<Elegantbeef> Depends if it's Gumber, it's C++ else it's C
09:13:09PMunchI've programmed C++, but I was told my code resembled C code :P
09:14:02FromDiscord<evoalg> hehe ... I was under the impression that everyone uses C++ now ... I was lied to
09:14:34FromDiscord<Elegantbeef> C++ is a common language in some domains
09:15:11FromDiscord<evoalg> C is faster then C++ and that's why it's still used?
09:15:23FromDiscord<Elegantbeef> uh oh language speeds 😀
09:15:33FromDiscord<evoalg> oh damn sorry
09:15:43FromDiscord<Elegantbeef> When it comes to system languages they're pretty much all the same
09:15:47FromDiscord<konsumlamm> you can essentially write C in C++, so not really
09:16:18prohttps://www.youtube.com/watch?v=1i4-e1okZtw 5min thoughts on c+++
09:17:27FromDiscord<Rika> Barney starsoup lmao
09:22:28FromDiscord<evoalg> hash - but interesting
09:41:54FromDiscord<evoalg> Rika when you said that with the "find all indices" proc and the iterator that code duplication is bad and the iterator is all that's needed (if I understood rightly), how can I use that iterated to get the index rather than the address, if i really wanted the index?
09:42:24FromDiscord<evoalg> iterator
09:43:56FromDiscord<Rika> In reply to @evoalg "Rika when you said": You would make the index the “base iterator” and derive an address iterator from that
09:45:48FromDiscord<evoalg> over my head, but that's ok, I have a lot to learn yet 😉
09:46:38FromDiscord<Rika> I use these terms but it’s not specific to Nim
09:46:49FromDiscord<Rika> I would show how but I am not at a large computer
09:48:58FromDiscord<evoalg> that's fine! 🙂
10:18:33FromDiscord<Zoom> The books are shorter.↵(@evoalg)
10:38:41NimEventerNew thread by Gyohng: Proc doSomething(msg="", opt=-1), see https://forum.nim-lang.org/t/8609
10:48:21*NeoCron joined #nim
10:51:53*NeoCron quit (Remote host closed the connection)
11:05:44Amun-Raevoalg: if you don't know the max # of elements compile time you can't use array
11:06:54FromDiscord<evoalg> ahhh true - thanks!
11:07:40FromDiscord<Zoom> Sorry for repeating myself. I'd appreciate if any occasional Geany user could comment there\: https://github.com/geany/geany/pull/2988 [HJarausch (HJarausch)](https://matrix.to/#/@hjarausch-54468881db8155e6700cd3cf:gitter.im), you might be interested.
11:10:12FromDiscord<Rika> Geany users are very limited in number
11:14:11FromDiscord<Zoom> And the sky is blue.
11:15:05FromDiscord<Zoom> I like its simplicity, it's nice to quickly drop onto a bare Win machine.
11:16:42FromDiscord<amadan> Messing around your changes, anything in particular to look for?↵Only issue I can find is that it doesn't pick up nim when trying to build a file
11:19:28FromDiscord<Zoom> @amadan\: it should look in your path for this. Anyway, if it doesn't pick up it's not this config's fault \:D
11:19:50FromDiscord<Zoom> It's mostly just an updated identifiers list
11:23:36FromDiscord<Zoom> Though, it were the missing ident settings that made me do it. Config's been there for two years 🤦
11:25:57FromDiscord<amadan> sent a code paste, see https://play.nim-lang.org/#ix=3EzP
11:26:08FromDiscord<amadan> (edit) "https://play.nim-lang.org/#ix=3EzP" => "https://play.nim-lang.org/#ix=3EzQ"
11:31:57*koltrast quit (Remote host closed the connection)
11:33:37*koltrast joined #nim
11:42:42*krux02 joined #nim
11:47:42FromDiscord<Zoom> We can add it and complain. It's probably because it uses Python lexer
11:54:18FromDiscord<Zoom> Hm, Lexilla actually has a lexer for Nim, it's just not imported into Geany.
12:06:02*supakeen quit (Quit: WeeChat 3.3)
12:06:32*supakeen joined #nim
12:07:40FromDiscord<hmmm> yo nimscords, anyone familiar with datamancer?
12:08:06FromDiscord<Rika> No
12:08:37FromDiscord<hmmm> rika sama I expect you to be familiar with everything, I'm surprised
12:09:41FromDiscord<hmmm> I'm kind of surviving the impact by googling how to do xyz in pandas and see if datamancer has the facilities but I'm hitting some roadblocks
12:10:06FromDiscord<Rika> In reply to @hmmm "rika sama I expect": Why
12:10:12*Freneticks quit (Quit: WeeChat 2.8)
12:10:15FromDiscord<Rika> I’m not a data scientist
12:10:45FromDiscord<hmmm> you are a nim guru I expect you to know everything :3
12:11:11FromDiscord<Rika> I haven’t written proper Nim code in probably months
12:11:29FromDiscord<hmmm> your unproper code is still sama level of quality
12:11:45FromDiscord<Rika> Okay
12:11:54FromDiscord<Rika> Well let’s hear your problem then
12:12:50FromDiscord<hmmm> well there are lots, but the most recent one is that pandas let you select columns without identifier with loc or iloc and I don't know yet how to do it on datamancer
12:13:24FromDiscord<Rika> Okay now wait for someone who knows about this to answer you lol
12:13:28FromDiscord<hmmm> lol
12:13:33FromDiscord<hmmm> I love you rika
12:13:51FromDiscord<Rika> I’ll actually look into it maybe later but I’m not at my apartment lol
12:14:48FromDiscord<hmmm> don't worry about it I'm sure I'll find some dataframe guru around, usually it's vindaar
12:18:23arkanoidthough experiment: nim is the third most popular language, millions of developers dive into the community and creates nim packages all over the web. What makes nim more resilient than npm in handling the micropackaging problem?
12:19:49FromDiscord<Rika> Nothing
12:22:59arkanoidI'd bet on the type system
12:23:37FromDiscord<Rika> Hmm I guess that’s true
12:23:59FromDiscord<Rika> But that wouldn’t stop dumb users abusing auto and adding type names to proc names
12:27:30FromDiscord<hmmm> having millions of devs means having millions of pages of documentation and tutorials, I'm drooling
12:27:57FromDiscord<hmmm> why the rest of the world can't understand nim greatness
12:28:35FromDiscord<hmmm> I mean you write echo "hello" and it does something what's more beautiful than that
12:31:56*neurocyte0132889 joined #nim
12:31:56*neurocyte0132889 quit (Changing host)
12:31:56*neurocyte0132889 joined #nim
12:32:02FromDiscord<ajusa> Anyone have any idea as to why this library might be slower than python? https://github.com/z-------------/nim-mmdb/blob/master/src/mmdb.nim
12:33:55FromDiscord<Zoom> sent a code paste, see https://play.nim-lang.org/#ix=3EAg
12:34:16PMunchWithout looking at the code I'm going to guess either unnecessary copying, or poor choice of compilation flags
12:37:13FromDiscord<faix> millons of devs does having many other problems and other point of views. not all what does twinkle is gold !↵(@hmmm)
12:38:08FromDiscord<ajusa> In reply to @PMunch "Without looking at the": I used Nim release when I tested it, and after reading it I get the impression that it is idiomatic Nim?
12:38:56FromDiscord<ajusa> Fwiw I think the python implementation is actually calling C, but straight Nim should be faster than Nimpy
12:50:04*neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat)
12:54:22*neurocyte0132889 joined #nim
12:54:22*neurocyte0132889 quit (Changing host)
12:54:22*neurocyte0132889 joined #nim
13:14:30FromDiscord<sOkam!> New to Nim. Is it possible to create aliases for func, proc and method?↵eg. `fn name()` vs `func name()`↵Saw that macros can do some fancy stuff, but wondering if they include those too
13:18:48FromDiscord<Rika> you can but it will not be pretty
13:19:05FromDiscord<Rika> and it wont look exactly like that
13:19:37FromDiscord<Rika> basically: not without massive amounts of effort and probably many tears, and much changed syntax
13:37:01*rockcavera joined #nim
13:37:02*rockcavera quit (Changing host)
13:37:02*rockcavera joined #nim
13:45:19PMunchUhm, not sure what sOkam meant, but it shouldn't be that hard..
13:46:09FromDiscord<Yardanico> @PMunch he meant creating keyword aliases
13:46:20FromDiscord<Yardanico> so instead of "proc" you can write "prc", instead of "func" you write "fn", etc
13:46:27PMunchOooh, right
13:46:38PMunchI thought he meant something like this: https://play.nim-lang.org/#ix=3EAu
13:46:40FromDiscord<Yardanico> that's easily possible with source code filters, but they don't really understand the syntax so they will also replace the words in the wrong places
13:46:48PMunchAnd was confused why @Rika thought that would be painful
13:46:50FromDiscord<Yardanico> and making a macro for aliased keywords can be pretty hard
13:47:27FromDiscord<enthus1ast> @sOkam!\: why you wanna do this?
13:56:07FromDiscord<exelotl> wow lol I went to search something on nimble.directory and saw my own library in the trending section xD
14:00:12FromDiscord<dom96> you're famous
14:00:25FromDiscord<dom96> really awesome that nimble.directory has this feature
14:06:39FromDiscord<hmmm> put nimble.directory on the website somewhere, I lost the link recently and it was a pain to find it again
14:07:14FromDiscord<exelotl> I was thinking of moving the library to sourcehut but then I'd lose my stars 😅
14:07:30FromDiscord<exelotl> they've got me hooked
14:07:41FromDiscord<hmmm> first world dev problems, I see 😋
14:08:53*Gentoolman joined #nim
14:09:01GentoolmanHello!
14:09:33prowelcome
14:10:55FromDiscord<willyboar> In reply to @hmmm "put nimble.directory on the": there is in the search section here https://nim-lang.org/documentation.html
14:12:50GentoolmanI would like if you helped me with one thing. I'm trying to set a value in a JSON dictionary, yet it doesn't seem to work with Python-esque syntax
14:12:52FromDiscord<hmmm> too hidden and it should use the proper name nimble.directory so google can see it. Ideally it should be on main page near irc and github links
14:12:58GentoolmanSomething of that sort
14:13:01Gentoolmanhttps://pastebin.com/vbuXnTde
14:13:44FromDiscord<Yardanico> first of all, in nim you have to define new variables with var let or const
14:13:47FromDiscord<Yardanico> in your case `var` is the best choicer
14:13:48FromDiscord<Yardanico> (edit) "choicer" => "choice"
14:14:00GentoolmanThat's not the ful source code ;)
14:14:41FromDiscord<Yardanico> ah right, you need to do %
14:14:47FromDiscord<Yardanico> %getEnv("VAULT_ROLE_ID")
14:14:58Gentoolmanlet me try that one out
14:15:00FromDiscord<Yardanico> % is defined in json and it makes a json object out of a variable
14:15:19GentoolmanDamn, that's crazy
14:15:25GentoolmanThanks a billion times
14:19:21GentoolmanMy bad, it actually was on json page. :)
14:30:37arkanoidwhat is zig c compiler and why it can be used with nim too?
14:31:15FromDiscord<Yardanico> `zig cc` wraps clang and adds a lot of versions of glibc, musl, mingw to allow cross-compiling for a lot of architectures and OSes
14:31:42FromDiscord<Yardanico> it's generally easier to use it for cross-compilation because then you don't need to have a separate compiler for every architecture/os combination
14:32:22FromDiscord<Yardanico> for example https://github.com/Yardanico/ircord/blob/master/zig-compile-vps.sh compiling for an older version of glibc
14:32:49FromDiscord<Yardanico> -fno-sanitize=undefined is here because `zig cc` has it on by default, and ASAN really doesn't like refc
14:36:29FromDiscord<dom96> Anybody interested? https://twitter.com/contextfreeinfo/status/1458434818492887049?s=21
14:37:37FromDiscord<Yardanico> In reply to @dom96 "Anybody interested? https://twitter.com/contextfree": would it be hard though? they seem to have a simple C interface
14:38:11FromDiscord<Yardanico> ah, not that simple since they don't use emscripten, so will need to use something like https://github.com/yglukhov/wasmrt
14:38:57FromDiscord<dom96> anything stopping from using emscripten?
14:40:09FromDiscord<Yardanico> because wasm-4 is not really made for it? i mean it should be possible, but won't be very simple too
14:40:14FromDiscord<Yardanico> i can't find anything related to wasm-4 with emscripten
14:41:01FromDiscord<dom96> In reply to @Yardanico "ah, not that simple": huh, didn't see this before
14:41:08FromDiscord<dom96> I guess it calls clang to generate wasm?
14:41:15FromDiscord<Yardanico> yes
14:42:24FromDiscord<dom96> Another approach: https://github.com/dom96/webasmio
14:42:44FromDiscord<Yardanico> how would that work for pure wasm though?
14:42:51FromDiscord<dom96> Much more to implement but also much more fun, if anyone wants to help I'd love to collab
14:43:06FromDiscord<Yardanico> well, you basically want a wasm backend for nim I guess :P
14:43:11FromDiscord<dom96> yes
14:43:44FromDiscord<dom96> I think it's cool this kind of thing is possible as a library
14:45:45FromDiscord<dom96> Guess I'll be starting an async-wg and a webasm-wg
14:45:59FromDiscord<dom96> so many fun projects, so little time
14:46:33NimEventerNew post on r/nim by GeroSchorsch: how to pass argument to proc by value without changing its value outside of the proc?, see https://reddit.com/r/nim/comments/qqvzpn/how_to_pass_argument_to_proc_by_value_without/
14:48:25FromDiscord<Rika> In reply to @dom96 "so many fun projects,": ikr
14:51:07FromDiscord<Yardanico> anyway, doing the wasm4 thing now, let's see if it's easy enough
14:52:54FromDiscord<dom96> awesome, thanks for looking into it 🙂
15:08:39FromDiscord<vindaar> Indeed, there is no such thing at the moment. I don't really see the point of indexing a data frame using integers. If you can enlighten me, I might be willing to add the option↵(@hmmm)
15:10:52FromDiscord<Rika> has anyone made an LV2/LADSPA/some daw plugin with nim? just curious, dont have a specific question
15:11:57FromDiscord<jorjun-666> On a mac with DYLD_LIBRARY_PATH set to my custom homebrew setup.. but linker is not searching in there.. any tips ?
15:13:08FromDiscord<enthus1ast> this is for the dynamic linker
15:14:16FromDiscord<enthus1ast> so it should search on app start for in this folder BUT this depends on how the libraries are linked. iirc nim does not respect this variable (at least on linux)
15:14:18FromDiscord<jorjun-666> yep, have installed libgd (with homebrew) and getting "dlopen(libgd.dylib, 0x0002): tried: 'libgd.dylib' (no such file), '/usr/local/lib/libgd.dylib' (no such file), '/usr/lib/libgd.dylib' (no such file)"
15:15:06FromDiscord<jorjun-666> I don't use those folders at all... maybe I can attempt to fix..?
15:15:09FromDiscord<enthus1ast> in fact, nim calls dlopen / dlsym by itself
15:15:39FromDiscord<Yardanico> @dom96 that was too easy :) https://media.discordapp.net/attachments/371759389889003532/908012034443075645/unknown.png
15:15:44FromDiscord<Yardanico> i expected more troubles from the C compiler
15:16:01FromDiscord<Yardanico> this is their default C example https://media.discordapp.net/attachments/371759389889003532/908012125308481606/unknown.png
15:16:07FromDiscord<Yardanico> translated to nim
15:18:31FromDiscord<tandy> is this a nico example in wasm?↵(@Yardanico)
15:18:40FromDiscord<Yardanico> no, it's https://wasm4.org/docs/
15:18:45FromDiscord<Yardanico> In reply to @dom96 "Anybody interested? https://twitter.com/contextfree": ^
15:19:07FromDiscord<tandy> oh intersting↵(@Yardanico)
15:21:03FromDiscord<Yardanico> file size is much higher than the one compiled for C though
15:21:58FromDiscord<dom96> nice! Do you have Twitter? Can you tweet the example to ContextFreeInfo? 🙂
15:23:23FromDiscord<Yardanico> yeah sure I'll tweet him, need to organize the files a bit better though
15:23:59FromDiscord<enthus1ast> @jorjun-666\: on linux dlopen is used ( https://linux.die.net/man/3/dlopen ) and this should respect the LD\_LIBRARY\_PATH.https://github.com/nim-lang/Nim/blob/141b76e36519219915ada9086d1c9b1d0b465659/lib/system/dyncalls.nim
15:25:05FromDiscord<Yardanico> @dom96 ah nvm the big file size was because I left out some text code where I tried nim strings (they work)
15:25:20FromDiscord<Yardanico> but with dynamic allocations wasm cartridge size seems to increase quite a lot (from ~200 bytes to 6kb)
15:26:20FromDiscord<Yardanico> the resulting binary for the same example in C and Nim is only 6 bytes larger in Nim
15:26:31FromDiscord<Yardanico> 218 vs 224
15:30:21FromDiscord<IsaacPaul> Very cool
15:30:30FromDiscord<enthus1ast> @jorjun-666\: it seems that the use of DYLD\_LIBRARY\_PATH was restricted, for "system integrity purpose"
15:31:10FromDiscord<enthus1ast> others also fighting with it, the document that was linked in this thread ( https://github.com/rbenv/rbenv/issues/962 ) is not available any more on the apple site.
15:32:12FromDiscord<enthus1ast> fuzzy feeling that apple respects your integrity right? \:D
15:34:38FromDiscord<jorjun-666> In reply to @enthus1ast "others also fighting with": But not my time, right... thanks so much... what do people do symlink libs into current folder?
15:36:03FromDiscord<enthus1ast> i do not programm on apple devices. But yeah this could work.
15:36:34FromDiscord<enthus1ast> Another interesting thing could be to strace the execution (if strace is available on macos) and see where it also looks for the lib
15:36:50FromDiscord<enthus1ast> just for curiosity
15:39:57FromDiscord<enthus1ast> @jorjun-666\:↵https://stackoverflow.com/questions/39927235/alternative-for-the-dyld-library-path-trick-since-mac-os-10-11-el-capitan-with-shttps://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/RunpathDependentLibraries.htmlMaybe this can work, but i think this requires a rebuild of the libs.
15:40:18FromDiscord<enthus1ast> which defeats the purpose of brew i guess
15:49:58FromDiscord<pietroppeter> hi @PMunch did you get any response - I remember you asking somewhere - on what do we think about fosdem 2022 (remote)? I see deadline for devroom proposal is in a few days (Nov 15), do we usually propose a devroom or do we wait for an appropriate devroom to be there and send nim talks there? I might be interested in submitting a talk proposal if there is a devroom that fits nim... https://fosdem.org/2022/news/2021-11-02-devroom-cfp/
15:51:12PMunchNo one responded as far as I know. But I've gotten a couple emails from the minimalistic room that we've been welcome in before (even helped them with organisation a while back)
15:51:47PMunchNow that we've done NimConf I feel like we have more to show to FOSDEM in regards to what they can expect from a Nim room and the quality of the talks
15:51:57PMunchSo it might be worth trying to get our own room this year
15:53:36FromDiscord<Yardanico> @dom96 https://github.com/Yardanico/wasm4nim
15:53:40*arkurious joined #nim
15:54:04FromDiscord<Yardanico> tweeted to contextfree
15:56:17FromDiscord<dom96> thanks for the call out about FOSDEM @pietroppeter and PMunch. Would love to see a Nim-specific devroom this time
15:56:24FromDiscord<dom96> Wasn't there a Zig one last year?
15:56:36PMunchWas there?
15:57:00PMunchThe deadline for room proposals is in 5 days by the way
15:57:53FromDiscord<pietroppeter> thanks @PMunch for the answer, good to know @dom96 is in on this. pretty new to FOSDEM so I would prefer not taking ownership of anything (except a talk proposal as mentioned :)) but let me know if I can help in some way!
15:58:33*pro quit (Quit: WeeChat 3.3)
16:00:03FromDiscord<dom96> CC @narimiran who's organised NimConf
16:03:07FromDiscord<pietroppeter> In reply to @PMunch "Was there?": it seems there was indeed a zig devroom in 2021: https://archive.fosdem.org/2021/live/#devrooms
16:03:18PMunchHuh cool
16:07:59PMunchOh well, I've gotta go walk the dog. But I'll be back later
16:08:01*PMunch quit (Quit: leaving)
16:08:19FromDiscord<pietroppeter> sent a long message, see http://ix.io/3EBv
16:08:33FromDiscord<pietroppeter> I can help out as one of the 5 volunteers if needed
16:08:45FromDiscord<Daniel M. Jaén> What is the best package for HTTP?
16:09:46FromDiscord<enthus1ast> @Daniel M. Jaén\: it depends 😀
16:10:03FromDiscord<enthus1ast> For client or server?
16:10:10FromDiscord<Daniel M. Jaén> server
16:10:17*rockcavera quit (Remote host closed the connection)
16:11:19FromDiscord<enthus1ast> sent a long message, see http://ix.io/3EBz
16:11:41FromDiscord<enthus1ast> I like prologue, but have used alm the three successfully
16:11:47FromDiscord<enthus1ast> All
16:13:19FromDiscord<Daniel M. Jaén> Oh, and what about `httpx`?
16:13:52FromDiscord<xflywind> a fork of httpbeast; just use httpbeast
16:14:55FromDiscord<Daniel M. Jaén> nice
16:15:02FromDiscord<Yardanico> @dom96 I could've removed the header file but I can't get Nim to export the C symbol without N_LIB_PRIVATE
16:15:16FromDiscord<Yardanico> (that's the default even with exportc)
16:17:26FromDiscord<dom96> In reply to @pietroppeter "I can help out": you can count me in too, who wants to do the submission? 🙂
16:17:55FromDiscord<Yardanico> ah I can probably do codegenDecl but it's quite ugly
16:18:09FromDiscord<dom96> In reply to @flywind "a fork of httpbeast;": kinda wishing httpx was just called httpbeast_win 🙂
16:19:12FromDiscord<dom96> btw with io_uring I think there is room for a httpbeast-like package that specifically takes advantage of IOCP and io_uring (afaik these have a similar model)
16:21:05FromDiscord<xflywind> In reply to @dom96 "btw with io_uring I": I hope so. Maybe `cps-nim` will implement that eventually.
16:22:45FromDiscord<dom96> Maybe
16:23:24FromDiscord<dom96> it doesn't depend on coroutines though
16:24:09FromDiscord<xflywind> yeah, and https://github.com/alaviss/nim-sys provides OS support cps
16:24:16FromDiscord<xflywind> (edit) "yeah, and https://github.com/alaviss/nim-sys provides OS support ... cps" added "for"
16:24:54FromDiscord<xflywind> https://github.com/alaviss/nim-sys/blob/master/tests/ioqueue/asyncio.nim
16:25:28FromDiscord<xflywind> (edit) "provides" => "will provide"
16:31:26FromDiscord<willyboar> In reply to @dom96 "kinda wishing httpx was": ugly naming detected..
16:39:09FromDiscord<Yardanico> ok I made it work without a header
16:39:18FromDiscord<Yardanico> but with ugly codegenDecl :P i guess I can hide them with pragmas though
16:41:06NimEventerNew post on r/nim by smazga: Proper way to do an async timeout, see https://reddit.com/r/nim/comments/qqyeky/proper_way_to_do_an_async_timeout/
16:45:39FromDiscord<Daniel M. Jaén> What is the correct way to use inputs?
16:48:26FromDiscord<dom96> In reply to @pietroppeter "from devroom submission page": just so that this doesn't get lost, you wanna create a thread on the forum? 🙂
16:49:56FromDiscord<Yardanico> @dom96 i made it so that the header is not needed but because of that I have to do https://github.com/Yardanico/wasm4nim/blob/master/examples/hello.nim#L14
16:50:13FromDiscord<Yardanico> the thing is - I can't hide that in a module since you can't export custom pragmas from modules
16:51:06FromDiscord<dom96> Could you use a macro as a workaround? i.e. a macro that just adds those pragmas to a proc (which can be used as a pragma)
16:51:06FromDiscord<Yardanico> i guess it's okay anyway :)
16:51:10FromDiscord<Yardanico> In reply to @dom96 "Could you use a": i guess
16:54:44NimEventerNew Nimble package! textformats - Easy specification of text formats for structured data, see https://github.com/ggonnella/textformats
16:57:13FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3EBZ
16:58:46FromDiscord<Yardanico> pushed to the repo
16:59:42FromDiscord<Recruit_main707> isnt there a pragma pragma for this kind of stuff?
17:00:10FromDiscord<Yardanico> In reply to @Recruit_main707 "isnt there a pragma": you can't export it
17:00:18FromDiscord<Yardanico> so if you define it in a module and import that module, you won't be able to use it
17:10:54*riceman joined #nim
17:15:08*rockcavera joined #nim
17:15:08*rockcavera quit (Changing host)
17:15:08*rockcavera joined #nim
17:20:58FromDiscord<Yardanico> seems like i can make it 100% identical to the C wasm output if I make the array as `const` and then `cast[ptr uint8](unsafeAddr smiley)`
17:21:14FromDiscord<Yardanico> but I guess I'll keep it with `var` and `addr smiley[0]` for now since it's only a 4 bytes difference :)
17:22:22FromDiscord<hmmm> in my days 4 bytes would have made a difference between eating or starving 🧐
17:22:29FromDiscord<Recruit_main707> Lmao
17:23:51FromDiscord<Yardanico> 4 bytes difference is because when the array is `const` the compiler can put all strings and the array itself into a single contiguous block https://media.discordapp.net/attachments/371759389889003532/908044294210854942/unknown.png
17:24:48FromDiscord<Yardanico> but with `var` it stores array data in a separate block https://media.discordapp.net/attachments/371759389889003532/908044536712949790/unknown.png
17:26:53FromDiscord<Yardanico> i mean size is quite important for wasm4 - they impose strict limits - 64KB max cartridge size (wasm file), 64KB RAM
17:26:59*rockcavera quit (Remote host closed the connection)
17:27:03FromDiscord<Yardanico> and 1024 disk storage (for saves and stuff)
17:27:08FromDiscord<Yardanico> (edit) "and 1024 ... disk" added "bytes of"
17:28:08FromDiscord<Yardanico> and yes ram allocation works just fine with arc and -d:useMalloc
17:28:19*rockcavera joined #nim
17:28:19*rockcavera quit (Changing host)
17:28:19*rockcavera joined #nim
17:31:38FromDiscord<dom96> now I'm really tempted to get webasmio running for this example
17:35:22NimEventerNew post on r/nim by floscr: Reading continuously from stdin?, see https://reddit.com/r/nim/comments/qqzllc/reading_continuously_from_stdin/
17:43:47FromDiscord<Daniel M. Jaén> What is the default port of httpbeast?
17:44:20FromDiscord<Yardanico> In reply to @Daniel M. Jaén "What is the default": httpbeast' default port is 8080
17:44:26FromDiscord<Yardanico> jester is 5000
17:44:29FromDiscord<Daniel M. Jaén> In reply to @Yardanico "httpbeast' default port is": ok, thx
18:25:38*neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat)
18:26:29FromDiscord<Schelz> what is not working pls help: ↵var t: Thread[void]↵t.createThread(main) https://media.discordapp.net/attachments/371759389889003532/908060056610811955/unknown.png
18:28:05*neurocyte0132889 joined #nim
18:28:05*neurocyte0132889 quit (Changing host)
18:28:05*neurocyte0132889 joined #nim
18:28:41FromDiscord<IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3ECn
18:30:07FromDiscord<IsaacPaul> Granted you need to compile with `--threads:on`
18:31:50FromDiscord<dom96> iirc you cannot use `void`, it's a quirk of how `Thread` is implemented
18:32:20FromDiscord<Schelz> --threads:on solved the problem thx @IsaacPaul
18:32:22FromDiscord<Yardanico> In reply to @dom96 "iirc you cannot use": you can though
18:32:23FromDiscord<Yardanico> :P
18:35:58*federico3_ joined #nim
18:36:33*PMunch joined #nim
18:38:49FromDiscord<zannzen> hello, very new to nim but: is there a proper way of reading using a `FileHandle` type? ↵↵Was trying to just do the basic `inotify` example from the std library docs but `read` doesn't exist apparently and all the functions in `io` seem to work for `File`. I tried converting it using `open(File, FileHandle)` but it didn't seem to actually get inotify events properly
18:44:58PMunchWhat kind of file handle are you trying to read from
18:45:14FromDiscord<zannzen> the `inotify` file descriptor
18:45:30PMunchAnd what do you expect to read from it?
18:45:43*riceman quit (Read error: Connection reset by peer)
18:46:10*riceman joined #nim
18:46:38PMunchIf you want to get events you should probably use inotify_events from the same module
18:46:50*riceman quit (Read error: Connection reset by peer)
18:47:59FromDiscord<zannzen> sent a code paste, see https://play.nim-lang.org/#ix=3ECq
18:48:16FromDiscord<zannzen> where `fd` is the inotify file descriptor
18:48:30FromDiscord<zannzen> but this fails to compile
18:48:36FromDiscord<zannzen> as `read` doesn't exist
18:49:11PMunchAh, you need to import posix
18:49:28PMunchWhich is where the read procedure used there is defined
18:51:18FromDiscord<zannzen> that did it, thanks! - in general for non-file `fd`s is that how I should handle this behavior? or is there a nim-ism for similar activities (e.g. epoll)?
18:53:33PMunchPretty much
18:53:43PMunchOr at least that's how I tend to do it
18:54:14FromDiscord<zannzen> cool, easy enough. appreciate the help
18:56:01*riceman joined #nim
18:56:01*riceman quit (Client Quit)
18:56:10PMunchHappy to be of assistance
18:56:17*riceman joined #nim
18:56:20*riceman quit (Client Quit)
18:57:15*riceman joined #nim
18:57:52*riceman quit (Client Quit)
18:58:37*riceman joined #nim
18:58:39*riceman is now known as riceman_
18:58:42*riceman_ quit (Client Quit)
18:58:55*riceman_ joined #nim
18:59:45*riceman_ quit (Client Quit)
19:01:01*riceman joined #nim
19:01:57*riceman quit (Remote host closed the connection)
19:12:39*riceman_ joined #nim
19:14:14*Gentoolman quit (Quit: WeeChat 3.3)
19:20:02*PMunch quit (Quit: leaving)
19:26:00FromDiscord<sOkam!> @Yardanico @enthus1ast @PMunch thx for the answers 🙂↵Was just curious if its possible, since it tends to fit my syntax style to have short words (1-2 letters) for very frequently used things
19:26:29FromDiscord<sOkam!> Might not be too worth it to do it manually, from what you guys say
19:38:28*riceman_63 joined #nim
19:38:45*riceman_ quit (Quit: Client closed)
19:42:01*riceman_63 quit (Client Quit)
19:42:14*riceman_ joined #nim
19:54:46FromDiscord<dom96> In reply to @zannzen "that did it, thanks!": For epoll/kqueue we have the selectors module that abstracts over these.
19:55:05FromDiscord<enthus1ast> @sOkam!\: i think its not worth to shorten proc or func just so save a few keystrokes (maybe you editor can help here). However Nim has a lot of opportunity to save keystrokes, just skim through the nice stdlib, it already can do alot cool stuff, then the even bigger keystroke saving comes from template, macros, custom pragmas, which can make nim code very dense, elegant and efficient to type.
20:42:52*PMunch joined #nim
20:45:32arkanoidhow can I creare a proc that takes a range as an argument?
20:46:01arkanoidI just want a func that does "myRange.toSeq.join(",")"
20:46:17arkanoidbut I'm getting Error: invalid type: 'range' in this context: 'proc (r: range)
20:50:28PMunchYou probably want an HSlice: https://play.nim-lang.org/#ix=3ECZ
20:51:47nrds<Prestige99> https://nim-lang.org/docs/system.html#HSlice found it
20:52:24nrds<Prestige99> Looks like `Slice` is an alias for HSlice
20:52:34nrds<Prestige99> https://github.com/nim-lang/Nim/blob/version-1-6/lib/system.nim#L497
20:55:24PMunchWell Slice is homogenous, while HSlice is not
20:56:10nrds<Prestige99> True
20:56:19nrds<Prestige99> Interesting I hadn't seen HSlice previously
20:58:13PMunchIt's typically used for negative indexes
20:58:27PMunchWhere the second argument is a BackwardsIndex
21:01:30*riceman_ quit (Quit: Client closed)
21:04:11FromDiscord<zentoad> I am having trouble getting nim to find the c++ library installed by CMake.↵`switch("clib", "jxl")` is in my confg.nims but is searches the current directory.↵adding `switch("clibdir", "/usr/local/lib")` doesn't do anything
21:14:06*PMunch quit (Changing host)
21:14:07*PMunch joined #nim
21:33:35FromDiscord<hmmm> hey I have a: if thingy == condition: <do absolutely nothing> , what was the incantation? discard pass or what
21:33:43nrds<Prestige99> discard
21:33:51FromDiscord<hmmm> ty bro 👍
21:33:58nrds<Prestige99> Any time
21:34:14FromDiscord<Elegantbeef> You can also do `if x: ## Todo: anything` since doc comments are AST
21:35:26FromDiscord<hmmm> this looks cooler than discard
21:36:11FromDiscord<hmmm> but I intend for it to do nothing forever so no todo 😊
21:36:48FromDiscord<Elegantbeef> What's the point of a `if thing == condition` 😀
21:37:13FromDiscord<hmmm> skip the first line reading a file
21:38:13FromDiscord<Elegantbeef> I dont see how that achieves this but ok
21:38:30FromDiscord<hmmm> hmm it works trust me, I have a plan
21:39:49PMunch@Elegantbeef, probably something like `if myStream.readLine().len == 0:` or something like that
21:40:02PMunchWhere the condition has a side effect
21:44:57FromDiscord<hmmm> oh god munchie knows the plan 😳
21:45:16FromDiscord<Elegantbeef> i spose, but my instinct is to use the iterator the just do `if line.len >0: #do stuff`
21:45:20FromDiscord<hmmm> anyway inc somevar is idiomatic nim or cool people do something better?
21:46:11FromDiscord<Elegantbeef> It's idiomatic
21:46:20FromDiscord<hmmm> 👍
21:47:12PMunchI'd say `inc` is the most idiomatic
21:47:26PMunchIf what you are doing is in fact incrementing a counter
21:47:34FromDiscord<hmmm> yes
21:47:44PMunchIf you just need to add one to a variable for some other purpose then I'd do `+= 1`
21:48:18PMunchAnd it's not so much that I know the plan as that I've done exactly the same thing before :P
21:49:02FromDiscord<hmmm> we all had to take that route in our path to greatness I guess 🤔
22:13:21*sagax quit (Quit: Konversation terminated!)
22:20:10*PMunch quit (Quit: leaving)
22:40:31FromDiscord<deech> If I have a `proc` returning a `NimNode` do I have to call it through a template/macro to get it splice in that NimNode at this some point?
22:42:46FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3EDr
22:42:58FromDiscord<Elegantbeef> Generally you only call them inside macros though
22:43:13FromDiscord<deech> Ahhah! Thanks
22:43:59FromDiscord<deech> What do I if the NimNode is some proc I'd like to splice in at the toplevel?
22:44:19FromDiscord<Elegantbeef> You'd need to call a macro which returns the AST
22:44:29FromDiscord<Elegantbeef> NimNodes are data not sem'd AST
22:44:43FromDiscord<Elegantbeef> Well they can be sem'd, but they're still just data
22:45:00FromDiscord<deech> Is there something like `toAst(doThing)`?
22:45:22FromDiscord<Elegantbeef> there is `getTypeImpl` and `getTypeInst`
22:45:31FromDiscord<Elegantbeef> Those let you extract the procedure def from the symbol
22:45:32FromDiscord<deech> Or is that simply the "identity" macro? `macro m(x:untyped):untyped = x`
22:45:48FromDiscord<Elegantbeef> That'd be what you want
22:45:57FromDiscord<Elegantbeef> Assuming `doThing` returns vali AST
22:46:01FromDiscord<Elegantbeef> valid even
22:47:47FromDiscord<deech> Is there such a macro/template in the stdlib?
22:48:16FromDiscord<Elegantbeef> I dont think so
22:48:37FromDiscord<deech> Cool. Seems useful.
22:48:44FromDiscord<Elegantbeef> Though i guess you'd want `macro m(x: typed): untyped`
22:49:09FromDiscord<Elegantbeef> Though I'm still uncertain the API desire so I guess I may be wrong
22:49:28FromDiscord<deech> I seem to remember seeing somewhere that `typed` arguments to macros is deprecated?
22:49:35FromDiscord<Elegantbeef> Nope
22:50:24FromDiscord<Elegantbeef> `typed` arguments are the only way to get a sem'd ast inside the macro, so it'd very much be bad to be deprecated
22:50:24FromDiscord<Elegantbeef> Well there are also the specific parameter types, but for an entire body there is no other way
22:50:36FromDiscord<Elegantbeef> Typed macros are really the bread and butter of the code introspection
22:50:49FromDiscord<Elegantbeef> If you can get around the odd differences in some AST
22:52:00FromDiscord<Elegantbeef> Araq's actually explictly said the opposite that i've seen in that he'd prefer only typed macros
22:52:58FromDiscord<Elegantbeef> Untyped macros are really double edged swords, they give tons of syntax flexibility at the cost of readability and understanding
22:57:56*sagax joined #nim
23:58:51*emery quit (Remote host closed the connection)
23:59:11*lain quit (Ping timeout: 260 seconds)