<< 18-07-2020 >>

00:01:10*Jjp137 quit (Quit: Leaving)
00:01:37*Jjp137 joined #nim
00:06:49*oddp quit (Ping timeout: 264 seconds)
00:36:11*audiophile joined #nim
00:36:53*krux02 joined #nim
00:39:58*BlameTheRoomba quit (Ping timeout: 256 seconds)
00:40:05*audiophile is now known as BlameTheRoomba
00:46:59*lritter quit (Ping timeout: 240 seconds)
01:05:34*enthus1ast quit (Ping timeout: 256 seconds)
01:07:05*RaycatWhoDat joined #nim
01:08:33RaycatWhoDatHello. I'm trying to make Nim my go-to language but I'm having some trouble with certain analogues between the language I'm translating from. Are there any idiomatic Nim examples for the following:
01:10:03RaycatWhoDatforeach loop with an index, a variadic zip that can be used with the given for loop construct (I've looked at zero_functional and loopfusion; they seem to have issues when used in the for loop)
01:11:01RaycatWhoDatActually, I think that's about it.
01:11:06RaycatWhoDatThanks in advance.
01:18:59*enthus1ast joined #nim
01:19:16shashlickIsn't there a foreach package?
01:20:09*NimBot joined #nim
01:20:13shashlickhttps://github.com/disruptek/foreach
01:20:27RaycatWhoDatLemme give that a try, brb
01:24:08RaycatWhoDatAh, I think it works but I was passing in an iterator that doesn't return a tuple to destructure
01:24:40*vicfred quit (Quit: Leaving)
01:24:42RaycatWhoDatFor context, I'm trying to read a file by lines and get the index variable at the same time
01:26:14RaycatWhoDatOh, that's another thing I wanted to know
01:26:51RaycatWhoDatIs there an equivalent to Raku subsets in Nim?
01:27:02disruptekforeach is for asserting type as part of the loop.
01:27:23RaycatWhoDatOh
01:27:24disruptekpairs() yields the index when run on an openArray|seq|array
01:27:47*apahl quit (Ping timeout: 260 seconds)
01:27:48RaycatWhoDatIs there an easy way to convert an iterator to an array?
01:27:49disruptekother iterators... use toSeq to turn them into seq or just keep track of the index yourself.
01:28:02disruptektoSeq is in the sequtils module.
01:28:09RaycatWhoDatAh. Gotcha. Thank you!
01:28:27disrupteknp
01:29:00disrupteki'm surprised loopfusion doesn't do what you want.
01:29:20*apahl joined #nim
01:29:28RaycatWhoDatThat's fair. I'll try it again.
01:31:21RaycatWhoDatAs an aside, are templates exempt from UFCS?
01:31:49RaycatWhoDat"MOCK_DATA.csv".lines.toSeq seems to break compilation
01:32:29RaycatWhoDat...ooorr not.
01:33:29RaycatWhoDatI swear I was running into these problems a while back but I guess I just made a mistake.
01:49:07*silvernode joined #nim
01:51:00RaycatWhoDatAh. Okay. I found the issue I was running into.
01:51:56RaycatWhoDatIf you do "filename".lines.toSeq in a var/let assignment, Nim says there's an undeclared field called "lines"
01:52:21RaycatWhoDatBut if you put it in the loop, it works
02:10:50*BlameTheRoomba quit (Quit: Default Quit Message)
02:11:58disruptekUFCS is a little funky with templates.
02:13:23disruptekit's actually a pretty subtle bug and one that Clyybber recently looked it. it might be solved in devel.
02:19:48*muffindrake quit (Ping timeout: 256 seconds)
02:21:40*muffindrake joined #nim
02:26:05*krux02 quit (Remote host closed the connection)
02:37:15*ForumUpdaterBot quit (Remote host closed the connection)
02:37:22*ForumUpdaterBot joined #nim
02:39:32*nikita_ joined #nim
02:40:03*waleee-cl quit (Quit: Connection closed for inactivity)
02:41:49*nikita` quit (Ping timeout: 246 seconds)
02:51:19ForumUpdaterBotNew thread by Iffy1: A localization/internationalization library (same purpose as gettext, but with some improvements), see https://forum.nim-lang.org/t/6553
02:51:51*narimiran joined #nim
03:12:29*vicfred joined #nim
03:33:08*canen quit (Ping timeout: 256 seconds)
03:49:16skrylar[m]i wish i could use the forums some days <_<
03:50:01skrylar[m]my account is glitched or something; password resets don't work and i get ignored 100% of the time i try to prod support about it
03:50:06skrylar[m]for like 1-2 years now
03:52:34leorizeping narimiran or dom96
03:52:41leorizeI think they're forum mods
03:53:04narimiranpong
03:53:29narimiranskrylar[m]: what's your forum username?
04:03:22skrylar[m]skrylar
04:03:36skrylar[m]@leorize i've told dom multiple times and he refuses to do anything about it
04:03:54skrylar[m]there was a fight about this
04:04:36leorize[m]well narimiran is offering to help there :P
04:04:41narimiranso what exactly is the problem?
04:05:08skrylar[m]i can reset the password, get a token in e-mail, use that to generate a new password, and then logging in with the new password fails
04:05:10narimiran(and be quick, i'm going offline in 5min)
04:06:02narimiranso, if i send you password reset, it won't help?
04:06:02*supakeen quit (Quit: WeeChat 2.8)
04:06:38*supakeen joined #nim
04:06:39narimiran*password reset email
04:07:30skrylar[m]it hasn't, no. the link works, i put the new password in, it says ok go log in, and then says the password is invalid
04:08:34narimirando you put your username with a capital `S`?
04:09:13skrylar[m]i don't remember anymore
04:09:19skrylar[m]i tried with upper and lower S
04:09:23narimiranit is upper
04:11:26narimirangood luck, i'm off now
04:15:58*narimiran quit (Ping timeout: 246 seconds)
04:32:23*bung joined #nim
04:35:04bunghi , am building web assets preprocessors tool, now work with nim-sass,any other resources recommanded?
04:36:06bungeg for fonts or images optimation
04:56:39*Zectbumo joined #nim
05:11:49*solitudesf joined #nim
05:22:46*B4s1l3 joined #nim
05:22:55*B4s1l3 is now known as opDispatch
05:51:21leorize[m]I wonder if we should expose some type reflection tools from the compiler internals to macros
05:51:54leorize[m]I'd love something to let me match a generic with a constraint pulled from a `bindSym` symbol :p
05:56:00*theelous3 quit (Read error: Connection reset by peer)
06:18:45*marnix joined #nim
06:23:07*icyphox is now known as icy
06:32:22*marnix quit (Ping timeout: 258 seconds)
06:32:37FromGitter<kayabaNerve> What's up with the ObservableStores warning?
06:33:00FromGitter<kayabaNerve> I've had LockLevel for... years? But this one seems to be new to 1.2.2/1.2.4. I've never found meaningful info about either.
06:33:01*marnix joined #nim
06:33:16Yardanicohttps://github.com/nim-lang/RFCs/issues/230
06:33:17disbotβž₯ Nim's NRVO is C++'s inplace construction (placement new) ; snippet at 12https://play.nim-lang.org/#ix=2oor
06:37:14*marnix quit (Ping timeout: 240 seconds)
06:37:26*marnix joined #nim
06:41:57FromGitter<kayabaNerve> Thanks
06:57:50*mbuchel quit (Quit: WeeChat 2.8)
07:15:39*narimiran joined #nim
07:15:42*superbia joined #nim
07:18:06superbiadoes anyone have a link to document with Nim in action differences in code for the newest version of nim
07:22:15superbiaedit: found it https://deepakg.github.io/nim/2019/09/28/nim-in-action-errata.html
07:24:50*nikita_ is now known as nikita`
07:40:40*tane joined #nim
07:52:19*maier joined #nim
08:02:01*maier quit (Ping timeout: 264 seconds)
08:02:02*marnix quit (Read error: Connection reset by peer)
08:02:17*marnix joined #nim
08:04:21*fanta1 joined #nim
08:16:26*oculux joined #nim
08:28:08*arecaceae quit (Remote host closed the connection)
08:28:54*arecaceae joined #nim
08:32:55*oddp joined #nim
08:39:58*waleee-cl joined #nim
09:00:13*Zectbumo quit (Remote host closed the connection)
09:08:33*superbia quit (Quit: WeeChat 2.4)
09:17:06*marnix quit (Ping timeout: 256 seconds)
09:31:34*marnix joined #nim
09:34:14*Trustable joined #nim
09:39:04*NimBot joined #nim
09:49:01*synshroud_ joined #nim
09:51:23*synshroud quit (Ping timeout: 240 seconds)
09:56:26*FromDiscord quit (Remote host closed the connection)
09:56:43*FromDiscord joined #nim
10:02:21ForumUpdaterBotNew thread by Oyster: Embed DLL into EXE?, see https://forum.nim-lang.org/t/6554
10:03:49*fredrikhr joined #nim
10:04:48FromDiscord<dom96> ahh, well, there isn't much I can personally do. We need to fix the password resets.
10:07:56FromDiscord<dom96> (And the performance regression so that we can deploy the new forum)
10:10:49*Vladar joined #nim
10:22:16*marnix quit (Ping timeout: 256 seconds)
10:23:34*dddddd quit (Ping timeout: 240 seconds)
10:25:58*marnix joined #nim
10:47:09*krux02 joined #nim
10:52:46*couven92 joined #nim
10:52:52*marnix quit (Ping timeout: 256 seconds)
10:53:01*fredrikhr quit (Disconnected by services)
10:53:02*marnix joined #nim
10:53:10*couven92 is now known as fredrikhr
10:53:29*couven92 joined #nim
11:00:15*marnix quit (Read error: Connection reset by peer)
11:00:45*marnix joined #nim
11:10:02*neceve quit (Quit: Idle for 30+ days)
11:11:43*sendell quit (Quit: Idle for 30+ days)
11:12:43*Trustable quit (Remote host closed the connection)
11:25:12*nikita` quit (Quit: leaving)
11:25:30*nikita` joined #nim
11:30:34*marnix quit (Ping timeout: 240 seconds)
11:32:00*synshroud_ quit (Quit: ZNC 1.7.5 - https://znc.in)
11:39:30FromDiscord<Kiloneie> Is echoing an object directly(no fields) an error because of information hidding(works with tupples) ? Haven't played with objects much yet.
11:43:32*silvernode quit (Ping timeout: 256 seconds)
11:52:11*oddp quit (Ping timeout: 240 seconds)
12:02:59*marnix joined #nim
12:04:24FromDiscord<Yardanico> You can print an object, it's just that for ref objects your need to reference then soon
12:05:00*marnix quit (Read error: Connection reset by peer)
12:05:05FromDiscord<Technisha Circuit (LGBTQIAP+)> Okay, how would i implement strings in my lang now? Would i just find the pair? And if theres `\` behind it, find the next pair?
12:05:09*marnix joined #nim
12:06:02*supakeen quit (Quit: WeeChat 2.8)
12:06:16FromDiscord<Technisha Circuit (LGBTQIAP+)> (edit) 'it,' => 'it (to escape the string),'
12:06:32FromDiscord<Kiloneie> As much as i could find online, making an object non reference, e.g.. Person = object, is for simple small objects ?... Whats the point of them compared to tuples ?
12:06:36FromDiscord<lqdev> @Technisha Circuit (LGBTQIAP+) find the first ", iterate over characters until you hit \ or ". if it's \, interpret it as an escape sequence, if it's ", end parsing the string
12:06:41*supakeen joined #nim
12:06:51FromDiscord<Technisha Circuit (LGBTQIAP+)> Thanks!
12:06:54FromDiscord<lqdev> (edit) '\,' => '\\,'
12:07:27FromDiscord<Technisha Circuit (LGBTQIAP+)> How would i turn a string into a sequence of characters? :p
12:07:45FromDiscord<Kiloneie> split maybe ?
12:07:58FromDiscord<impbox> `let charSeq = cast[seq[char]](myString)` ?
12:08:23FromDiscord<Technisha Circuit (LGBTQIAP+)> Thanks ;P
12:09:05FromDiscord<lqdev> ^ this works, but personally i'd just create a newSeq[char](str.len) and copyMem(mySeq[0].addr, str[0].unsafeAddr, str.len)
12:09:32FromDiscord<lqdev> because it's safer and doesn't depend on the implementation details
12:09:37FromDiscord<Technisha Circuit (LGBTQIAP+)> Oh okay
12:09:59FromDiscord<impbox> but does do a memcopy, so if it's a really big string the cast might be better depending on your needs
12:10:10FromDiscord<impbox> but is there a reason you need a seq[char] instead of a string?
12:10:37FromDiscord<Technisha Circuit (LGBTQIAP+)> So i can iterate through the characters until i find a pair of a certain character
12:10:45FromDiscord<impbox> you can iterate through a string
12:11:12FromDiscord<Technisha Circuit (LGBTQIAP+)> Oh
12:11:24FromDiscord<Technisha Circuit (LGBTQIAP+)> So with `for in in string:` should work?
12:11:32FromDiscord<Technisha Circuit (LGBTQIAP+)> (edit) 'in' => 'i'
12:11:33FromDiscord<impbox> for c in myString:
12:11:33FromDiscord<lqdev> for char in string, yes
12:11:38FromDiscord<Technisha Circuit (LGBTQIAP+)> Thanks
12:11:42FromDiscord<lqdev> or for i, char in string
12:11:48FromDiscord<impbox> https://play.nim-lang.org/#ix=2rXP
12:12:02FromDiscord<lqdev> though if you're doing parsing i'd recommend using a while loop
12:12:11*oculux quit (K-Lined)
12:12:18FromDiscord<Technisha Circuit (LGBTQIAP+)> Oh?
12:12:30FromDiscord<lqdev> because the i in a pairs() loop is immutable
12:12:36FromDiscord<lqdev> so you can't do backtracking
12:12:48FromDiscord<impbox> @Technisha Circuit (LGBTQIAP+) you should probably use https://nim-lang.org/docs/unicode.html and use `for c in myString.runes:`
12:12:55FromDiscord<Technisha Circuit (LGBTQIAP+)> Oh okay
12:12:55FromDiscord<lqdev> or better yet, write a lexer that outputs tokens, and parse the tokens
12:13:01FromDiscord<lqdev> into some AST
12:13:10FromDiscord<Technisha Circuit (LGBTQIAP+)> Thanks
12:13:11FromDiscord<impbox> since a character might be more than one byte
12:14:30FromDiscord<impbox> https://play.nim-lang.org/#ix=2rXQ
12:14:52FromDiscord<impbox> the first example can't deal with the unicode chars, but the `runes` one does
12:24:24*maier joined #nim
12:27:23icyis there a built-in function in the stdlib that strips out the URI and PORT from a given URL, and returns only the host?
12:28:43FromDiscord<impbox> icy, not exactly but uri.parseUri could split it up for you
12:29:26icyah sick, that's what i was looking for
12:29:46*maier quit (Ping timeout: 256 seconds)
12:29:57FromDiscord<impbox> https://play.nim-lang.org/#ix=2rXW
12:30:34*fredrikhr quit (Quit: Client disconnecting)
12:30:43icythanks!
12:40:02*couven92 is now known as fredrikhr
12:43:06*tane quit (Quit: Leaving)
12:48:54*marnix quit (Ping timeout: 240 seconds)
12:49:04*marnix joined #nim
12:53:35*oddp joined #nim
13:05:06FromGitter<alehander92> oi
13:05:12FromGitter<alehander92> let's talk
13:05:31FromGitter<alehander92> about dsl-s
13:08:45*waleee-cl quit (Quit: Connection closed for inactivity)
13:18:07ZevvYes, talk to me baby
13:18:10Zevvabout dsl-s
13:22:11*marnix quit (Ping timeout: 240 seconds)
13:22:27FromGitter<sheerluck> no Nim developer wants to write Haskell coz in Haskell every library feels like it is written in different dsl
13:22:47*marnix joined #nim
13:24:03*rockcavera quit (Remote host closed the connection)
13:26:36FromGitter<alehander92> dude
13:26:42FromGitter<alehander92> i was just thuinking of haskell these days
13:26:47FromGitter<alehander92> because i am trying to land a job
13:26:51FromGitter<alehander92> with a haskell place
13:27:57FromGitter<alehander92> i feel language extensions might not be such a problem if that's what you mean, if you mean that they just invent their own operators etc, then this might be solvable by just having a ⏎ more "simple-api"
13:28:05FromGitter<alehander92> group of libs
13:28:26FromGitter<alehander92> something like boost for "libs with simpler haskell api"
13:28:39FromDiscord<Clyybber> alehander92: Do you know formality?
13:28:41FromDiscord<Clyybber> https://github.com/moonad/Formality
13:29:06Zevv"the entire language desugars to a 500 lines core type-theory."
13:29:52FromGitter<alehander92> it seems i have starred it
13:29:56Zevvbut why
13:30:01FromGitter<alehander92> but i can't remember much, probably you linked it before
13:30:02Zevvdoes one write this in javascript
13:30:18FromGitter<alehander92> i did write
13:30:25FromGitter<alehander92> a lot of stuff in python before
13:30:32FromGitter<alehander92> even a hindley milner based python to c thing
13:30:42FromGitter<alehander92> (very low quality probably)
13:31:00Zevvbut then again - you wanted to talk about dsl-s
13:31:02FromGitter<alehander92> i think when one knows a language well, it's just easier to go and keep using it for stuff
13:31:11FromGitter<alehander92> formality seems probably nice but
13:31:13FromGitter<alehander92> what i dont get is
13:31:26FromGitter<alehander92> this is good, the simple proving thing
13:31:37FromGitter<alehander92> but why dont we have big libs of most basic stuff prooved
13:31:47FromGitter<alehander92> so we can more easily write complex system proofs
13:31:50FromGitter<alehander92> is it that hard to compose
13:31:59FromGitter<alehander92> zevv eh i wanted to mostly bikeshed
13:32:18Zevvdude I bikeshed 40 hours per week, don't give me that in the week ends
13:32:25FromGitter<alehander92> i am at sea
13:32:48FromGitter<alehander92> i am even more week-endy
13:33:01Zevvand here you are, bikeshedding away on irc
13:33:15FromGitter<alehander92> my wife doesn't even notice
13:33:30FromGitter<alehander92> yeah i tried to do it in offtopic
13:33:40FromGitter<alehander92> but no one answered
13:33:50Zevveverybody is at sea I guess
13:34:20FromGitter<alehander92> i think it's not the most crowded season
13:34:23FromGitter<alehander92> but i might be wrong
13:34:31FromGitter<alehander92> not many people with masks man
13:34:39FromGitter<alehander92> zevv i plan on writing monads in nim
13:34:44FromGitter<alehander92> tell me why this is a bad idea
13:35:07ZevvI think one should write monads and a y combinator in every new language one learns
13:35:10Zevvjust once
13:35:16Zevvand then throw it out and never look back
13:35:33FromGitter<alehander92> even in haskell?
13:35:39ZevvThe only think I really like about haskell is Simpon Peyton Jones
13:35:56FromGitter<alehander92> i've heard of him
13:36:02FromGitter<alehander92> is he like jon skeet
13:36:04FromGitter<alehander92> of haskell
13:36:34ZevvI don't know jon skeet, so couldn't tell :)
13:36:43FromGitter<alehander92> the guy who answers super much on SO
13:37:08FromGitter<alehander92> he is the top guy
13:37:18Zevvah ok
13:37:25FromGitter<alehander92> fun thing is the 5th guy ever writes he is from sofia
13:37:30FromGitter<alehander92> and i don't even know who that is
13:37:45Zevvhehe
13:39:02FromGitter<alehander92> what are you up to in #nim
13:39:10Zevvnot much, lately
13:39:29FromGitter<alehander92> wow `#` autocompletes with issues in gitter
13:39:31ZevvI don't think I typed a single line of nim over the last few weeks
13:39:39FromGitter<alehander92> i feel you
13:39:49FromGitter<alehander92> i mostly code for interviews and learning now
13:40:47Zevvboth good reasons
13:41:26FromGitter<alehander92> i am happy!
13:41:32Zevvso you're also doing it for fun, right
13:41:44FromGitter<alehander92> yeah, especially the haskell thing
13:41:52Zevvit bends your mind
13:41:58FromGitter<alehander92> i still think i would prefer ocaml
13:42:04FromGitter<alehander92> but it's like perl6
13:42:15FromGitter<alehander92> it's useful to just know what those guys with glasses are up to
13:42:36ZevvIf you like this kind of thing, I'd recommend going through http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/
13:42:40FromGitter<alehander92> this glasgow type seamen
13:42:43FromGitter<alehander92> these*
13:43:01FromGitter<alehander92> ah, very disturbing pictures
13:43:11Zevvit's really one of these *wow* things where it all unfolds before your eyes
13:43:25FromDiscord<KingDarBoja> alehander92: So you writing Haskell?
13:43:36FromDiscord<KingDarBoja> Be aware of lazy evaluation πŸ˜›
13:43:49FromGitter<alehander92> zevv hmm
13:43:54FromGitter<alehander92> i want more type theory, sorry
13:44:01FromGitter<alehander92> i think i went through parts of sicp in the past
13:44:20FromGitter<alehander92> kingdarboja eh .. writing is a strong word
13:44:26FromGitter<alehander92> but i think i realized
13:44:31FromGitter<alehander92> why burritos are like monads
13:44:37FromGitter<alehander92> it's like
13:45:31FromGitter<alehander92> laziness yeah, i assume it might be hard : i read i should treat haskell prorgams as recipes which are ran after their construction (the whole code)
13:45:38FromGitter<alehander92> but this might be more about IO / effects
13:47:20FromDiscord<KingDarBoja> Why burritos are like monads? wtf?
13:47:44FromGitter<alehander92> well it's a famous .. i guess thing? meme/?
13:47:56FromDiscord<KingDarBoja> πŸ€”
13:47:59FromGitter<alehander92> they try to explain monads in many tutorials so probably
13:48:04FromGitter<sheerluck> @alehander92 https://idris2.readthedocs.io/en/latest/tutorial/index.html
13:48:06FromGitter<alehander92> the burrito comparison was like a
13:48:17FromGitter<alehander92> good example of what people try
13:48:25FromGitter<alehander92> and how hard it is
13:48:27FromGitter<alehander92> to explain it
13:48:41FromGitter<alehander92> thanks @sheerluck i need to learn haskell a bit first
13:48:50FromGitter<alehander92> but i am interested in idris2
13:51:22FromDiscord<KingDarBoja> https://github.com/zjhmale/vscode-idris/blob/master/package.json
13:51:30FromDiscord<KingDarBoja> Oh yeah, another icon to do now
13:52:44FromDiscord<KingDarBoja> But their website needs some style πŸ™ˆ
13:53:06FromDiscord<KingDarBoja> Ah lmao, it is already supported (the icon)
13:59:57FromDiscord<tomck> Hello
14:00:15icydoes anyone have experience with treeform's ws package?
14:00:16FromDiscord<tomck> Can someone give me a rundown of nim's by value / by ref semantics when passing to functions?
14:00:57FromDiscord<tomck> seems most examples taket hings by value, is it assumed that the nim compiler will optimise to pass by ref when necessary, or does passing by value always copy?
14:01:42FromDiscord<tomck> If i have an object which contains a `seq[T]` and want to create a method which will get the last item of that `seq`, what does it return? `ptr T` or just `T`?
14:02:50FromDiscord<lqdev> the passes all objects whose size < 3 * sizeof(pointer) by value. all other objects are passed by ref
14:03:12FromDiscord<lqdev> return values are always copied afaik, unless you annotate them with `lent T`
14:03:23FromDiscord<tomck> what if it's `var T`?
14:03:32FromDiscord<lqdev> `var T` is always passing by reference
14:03:46FromDiscord<tomck> ok what's `lent T`, did nim catch the rust bug
14:04:08FromDiscord<tomck> oh is nim abandoning its gc?
14:04:19FromDiscord<lqdev> kind of
14:04:30FromDiscord<lqdev> `lent T` is related to the new memory management model, ARC
14:04:36FromDiscord<lqdev> which uses refcounting
14:04:47FromDiscord<lqdev> hold on, let me find the post
14:05:00FromDiscord<tomck> crazy, this is a huge change for a lang after 1.0 no?
14:05:20FromDiscord<tomck> is this available in the latest build?
14:05:25FromDiscord<lqdev> all old code is still functional
14:05:31FromDiscord<lqdev> you can enable it using --gc:arc
14:05:33FromDiscord<lqdev> when compiling
14:05:36FromDiscord<lqdev> read more here https://forum.nim-lang.org/t/5734
14:05:54FromDiscord<tomck> will gc:arc break old code?
14:06:15FromDiscord<lqdev> afaict a little bit. you may have to annotate some closures with {.nosink.}
14:06:22FromDiscord<lqdev> in my experience, at least
14:06:37FromDiscord<lqdev> but keep in mind that ARC is still a work in progress
14:06:43FromDiscord<tomck> is it recommended to convert to arc? i've been using GC stuff so far, i think it'd break a lot of code to swtich
14:06:49FromDiscord<tomck> ah ok
14:06:50*marnix quit (Read error: Connection reset by peer)
14:07:05FromDiscord<lqdev> you don't need to use ARC if you aren't doing hard realtime stuff
14:07:09FromDiscord<lqdev> like audio
14:07:16FromDiscord<tomck> so, in GC land, what's the recommended way to return here? `ptr T`?
14:07:22FromDiscord<tomck> yeah i'm not currently
14:07:22FromDiscord<lqdev> `lent T`
14:07:26FromDiscord<lqdev> if you're indexing a seq
14:07:34FromDiscord<tomck> what, even with using the GC
14:07:36FromDiscord<tomck> (edit) 'GC' => 'GC?'
14:07:49FromGitter<alehander92> tomck it's not really 1.0 change
14:07:54FromDiscord<tomck> can `lent T` be nil? i'm getting an error trying to return nil
14:07:55FromGitter<alehander92> it is still kind of a gc i think
14:08:03FromGitter<alehander92> and big changes can still happen in 2.0
14:08:13FromDiscord<tomck> I see
14:08:51FromGitter<alehander92> @sheerluck do you have experience with coq/lean
14:08:53FromGitter<alehander92> or similar
14:09:04FromGitter<sheerluck> @alehander92 no I'm just a python dev
14:09:11FromDiscord<tomck> Ok so how do i make a nil-able `lent T`?
14:09:17FromDiscord<exelotl> @tomck you want to return a mutable reference to the last element in a seq that was passed in as an argument?
14:09:43FromDiscord<tomck> err the seq is inside an object which is passed in, butyes @exelotl
14:09:56FromDiscord<tomck> Also another function for a non-mutable ref
14:10:41FromGitter<alehander92> sheerluck that's not an issue for checking out stuff like that
14:12:16Oddmongeri see i can have ordinal value of an enum
14:12:26FromGitter<alehander92> `.int`
14:12:43Oddmongervar Compass = enum n=2,s=4,e=8,o=16
14:12:52Oddmongerso ord(n) returns 2
14:12:58FromGitter<alehander92> hm `.ord` yeah
14:13:14Oddmongerbut how to iterate the whole enum ?
14:13:21FromGitter<alehander92> `.low` and `.high`
14:13:27FromGitter<alehander92> but .. i think there was a thing
14:13:33FromGitter<alehander92> to directly do in `Enum` ?
14:13:47*sagax quit (Ping timeout: 246 seconds)
14:13:55*canen joined #nim
14:14:02FromGitter<alehander92> but if not you can
14:14:21Oddmongeryes, but there are Β«holesΒ» in my enum, for i in Compass witll iterate from 2 to 16 (with error due to the holes)
14:14:38FromGitter<alehander92> sorry
14:14:54Oddmongeri tried succ() and pred(), but seem cannot be use on enums
14:15:08FromGitter<alehander92> hey
14:15:40*canen quit (Remote host closed the connection)
14:15:49bunghave you tried .fields ?
14:15:57Oddmongernot yet
14:15:59alehander92_yeaaah
14:16:05alehander92_it seems directly in enum
14:16:08alehander92_works for Ordinal
14:16:13alehander92_but enums with holes are not ordinal
14:16:15Zevvholes in your enum
14:16:17Zevvall bets are off
14:16:18alehander92_i really dont like holes
14:16:56disruptekyou need to make a macro. items() on enums with holes is no longer a thing.
14:17:07disruptekor a compile-time var, at least.
14:18:19alehander92_disruptek
14:18:20disruptektomck: there's no such thing as immutable ref, really.
14:18:35Oddmongerfields is for tuple (if i understand well the error msg)
14:18:36alehander92_what do you think about haskell
14:18:36FromDiscord<exelotl> @tomck here's a thing I found you can do, not sure if it helps: https://play.nim-lang.org/#ix=2rYj
14:19:03disrupteki'm in favor of it.
14:19:53FromDiscord<tomck> disruptek: so how do i return the last item in a seq by reference
14:20:07disruptek^1
14:20:35FromGitter<sheerluck> what lang is best for writing DSLs?
14:20:38FromDiscord<exelotl> returning a var basically gives you an "L-value" which is probably preferable over returning a `ptr`, but you still have to take the address of it if you want to put it in a variable by reference
14:20:57FromDiscord<tomck> I just want to return the last value in an array without copying
14:21:02FromDiscord<tomck> b/c it will probably be large
14:21:15alehander92_https://usercontent.irccloud-cdn.com/file/kWw6bXxv/Screenshot%20from%202020-07-18%2017-20-48.png
14:21:20alehander92_do we need something like that for nim
14:21:23alehander92_https://wiki.haskell.org/wikiupload/8/85/TMR-Issue13.pdf
14:21:38FromDiscord<lqdev> @tomck if the element is large it might be worth making the type `ref`
14:21:38leorize[m]@tomck it will not copy, Nim has return value optimization
14:21:49FromDiscord<lqdev> oh cool
14:21:53FromDiscord<lqdev> didn't know about that
14:22:04FromDiscord<lqdev> another element to add to my list of cool Nim features
14:22:10disruptekit doesn't sound like a design that makes sense.
14:22:37FromDiscord<tomck> RVO isn't going to make it not copy out of the array, it just makes it not copy from one stack frame to another @lqdev , unless i'm misunderstanding?
14:23:30FromDiscord<tomck> Ref means 2 indirections + an allocation per item in the list though - which is not too much of an issue, but i thought the selling point of nim was close to C super-speed, might as well use Java
14:23:38FromGitter<sheerluck> so Nim lang is the best lang for writing DSLs
14:23:39alehander92_sheerluck i think languages with metaprogramming
14:23:43disruptekalehander: it's kinda neat looking, i guess.
14:24:19RaycatWhoDatsheerluck: Nim is very good at it but, by no means, is it the best.
14:24:22*BlameTheRoomba joined #nim
14:24:28leorize[m]@tomck you can return a lent T, then it'll be referenced
14:25:05alehander92_sheerluck i have some ideas but i guess languages already did em
14:25:31alehander92_disruptek i wonder if modelling those in imperative languages is useful
14:25:34disruptektomck: what are these large values that you have that are not refs?
14:26:42*marnix joined #nim
14:26:44FromDiscord<tomck> leorize: what are the semantics of a `lent T` though? Apparently it does some borrow checking - but without lifetime annotations, how can it know what lifetime my `lent T` depends on?
14:26:59disruptekmagic compiler pixie dust.
14:27:04FromDiscord<dom96> ugh, why does koch use the Nim in my PATH?
14:27:13FromDiscord<tomck> disruptek: A function scope, i'm writing an interpreter
14:27:16leorize[m]~destructors
14:27:16disbotno footnotes for `destructors`. πŸ™
14:27:19FromDiscord<dom96> or rather, why does testament
14:27:25disruptek~arc
14:27:25disbotarc: 11a new memory manager for Nim; see https://forum.nim-lang.org/t/5734 -- disruptek
14:27:26FromDiscord<Vindaar> Oddmonger: I wrote a macro for that: https://github.com/jovoy/AxionElectronLimit/blob/master/readOpacityFile.nim#L70-L79
14:27:26leorize[m]~destructor
14:27:26disbotdestructor: 11https://nim-lang.org/docs/destructors.html
14:27:46disruptekdom96: pr submitted, stalled.
14:28:03leorize[m]https://nim-lang.org/docs/destructors.html#lent-type @tomck
14:28:20FromDiscord<tomck> So does my function need to take *in* a `lent seq[T]` then output a `lent T`?
14:28:34alehander92_soo category
14:28:45FromDiscord<tomck> or, `lent Foo` where foo contains a `seq[T]`
14:28:54disruptekthe seq owns the items; you just lent it in rvalue.
14:29:09FromDiscord<tomck> so, i just take in a `seq[T]` and that won't copy?
14:29:14FromDiscord<dom96> > dom96: pr submitted, stalled.↡@disruptek[IRC]#0000 oh bah, I just created an issue for this
14:29:20FromDiscord<dom96> oh well, maybe that'll move it along
14:29:42FromDiscord<tomck> Ah okay, so `lent T` is *only* ever for return values
14:29:52disruptekdom96: it's one of these things that i don't care about. you can argue that the current behavior is correct.
14:30:08FromDiscord<dom96> It's currently wasting my time, so I do care
14:30:09disruptektomck: rtfm, arc is awesome. you will like it.
14:30:19leorize[m]@tomck yea, Nim's parameters won't copy if the size is bigger than 3x float
14:30:21disruptekit does what you want.
14:30:48alehander92_and arrows really confuse me
14:30:50FromDiscord<tomck> I was speaking to someone earlier who said I needed to pass `--gc:arc` as a flag though, which can break non-arc code (which my codebase currently is)
14:31:02FromDiscord<tomck> does `lent T` work alongside the normal GC?
14:31:07leorize[m]use --gc:orc
14:31:12leorize[m]yes it does
14:31:33leorize[m]destructors work with any gc, arc is just a gc built on top of it
14:31:47leorize[m]orc is basically arc but aware of cycles
14:31:54disruptekif it breaks arc, it's a bug that will have priority to get fixed. it won't be a blocker for you.
14:32:39disruptekthe goal is for arc to become the default gc.
14:33:03leorize[m]orc will be default first though :p
14:33:19FromDiscord<tomck> lol ok so let me get this straight↡* `ref T` interacts with the GC↡* `lent T` is a 'reference' which doesn't interact with the GC
14:33:20disruptekdom96: feel free to take over my pr, whatever that means. πŸ˜‰
14:33:52leorize[m]@tomck yea, it's like a const reference in C++
14:33:55FromDiscord<tomck> `arc` is refcounting / RAII a la C++
14:34:13FromDiscord<tomck> `orc` is `arc` but with some extra bullshit to make it work with old nim code
14:34:19FromDiscord<tomck> (edit) '`orc` is `arc` but with some extra bullshit to make it work with old nim code ... ' => '`orc` is `arc` but with some extra bullshit to make it work with old nim code(and free cycles properly)'
14:34:23FromDiscord<dom96> I'm quite surprised nobody ran into this before https://github.com/nim-lang/Nim/pull/15012
14:34:25disbotβž₯ [Backport] Fixes callbacks being dropped on Linux/macOS/BSD. ; snippet at 12https://play.nim-lang.org/#ix=2rYn
14:34:27FromDiscord<dom96> Pretty big bug
14:34:31disruptekwell, orc is arc with some bs to break cycles.
14:35:03leorize[m]it's not some bs, it's pretty damn good
14:35:52leorize[m]comparable to arc performance and can handle cycles without you needing to care
14:36:22disrupteki wouldn't say orc is "pretty damn good", or particularly performant.
14:36:30disruptekbut it doesn't matter.
14:36:46leorize[m]@dom96 might be the same bug that I found developing asyncstdin for @iffy
14:36:47disruptekthe arc tech is superior for myriad reasons.
14:37:08FromDiscord<tomck> I'm struggling to understand why I need to specify gc:arc or gc:orc, surely this whole sink/lent stuff with refcounting should work alongside the GC just fine? Or does `gc:arc` effectively make `ref T` a shared pointer
14:37:39disruptekarc is impl as code transformations.
14:37:46leorize[m]I need to know your problem first, can you elaborate on what you're trying to do?
14:38:07FromDiscord<tomck> basically, why would I ever use the default GC if `orc` is apparently superior?
14:38:10*sagax joined #nim
14:38:20disruptektomck: the default gc is better-tested.
14:38:33leorize[m]it's unstable and is only usable on devel atm
14:38:35*Guest94576 joined #nim
14:38:45leorize[m]it will be the default for 1.4, hopefully
14:38:55leorize[m]wouldn't hold my breath for that though
14:39:05FromDiscord<tomck> Ok cool so I'd rather stick with default if that's the case, BUT does that change some of the semantics of `lent T` / `ref T` or are the semantics the same?
14:39:21disruptekin some cases, arc has not been optimized sufficiently; there may be a corner case that is significantly slower.
14:39:28disrupteksemantics don't change.
14:39:40FromDiscord<tomck> I can use `lent T` in the normal GC just fine, as long as I'm not touching `ref T` then the GC will never actually be called?
14:39:46leorize[m]so... what are you trying to do again?
14:39:48disruptekarc is like someone went through and added memory management on your behalf, because that's exactly what it is.
14:40:16*Guest94576 quit (Client Quit)
14:40:36FromDiscord<tomck> i have an object type, and i want to add a proc to return a ref to an element in a seq thta the object owns
14:40:53leorize[m]have you considered just using a template?
14:40:54FromDiscord<Recruit_main707> > I can use `lent T` in the normal GC just fine, as long as I'm not touching `ref T` then the GC will never actually be called?↡@tomck no, if you compile with gc:none, it will show you a qarning of everything that uses gced memory
14:41:46FromGitter<sheerluck> @dom96 It would be nice if "Packages CI" was not only ubuntu-18.04 + macos-10.15 but also ubuntu-20.04 + linuxmint-20 + archlinux + gentoo
14:42:05leorize[m]the template can inline the seq access for you and you won't have to think about all this lent stuff
14:42:11FromDiscord<tomck> sent a code paste, see https://play.nim-lang.org/#ix=2rYo
14:42:17FromDiscord<tomck> Does this work ^
14:42:18FromDiscord<dom96> sheerluck: why?
14:42:28FromDiscord<Recruit_main707> That includes strings sequences, and slices between others iirc
14:42:55leorize[m]@tomck nope, option[t] is a container
14:43:03leorize[m]you can just raise an exception...
14:43:08FromGitter<sheerluck> to spread Nim everywhere
14:43:38disruptekdoes gitnim not work on your platform?
14:43:43FromDiscord<tomck> sent a code paste, see https://play.nim-lang.org/#ix=2rYp
14:44:06leorize[m]use "^1" as the index
14:44:17FromDiscord<Recruit_main707> ^
14:44:35leorize[m]and yes that would work
14:44:36FromDiscord<tomck> ok regardless of that lol, the `lent T` part, what are the semantics of this
14:44:47leorize[m]you can also just make it a template and don't have to care anymore
14:44:55leorize[m]no stackframes, no nothing
14:45:01FromDiscord<Recruit_main707> There is no generic param though, eouls it?
14:45:06FromDiscord<Recruit_main707> would*
14:45:39FromDiscord<tomck> sent a code paste, see https://play.nim-lang.org/#ix=2rYq
14:45:53leorize[m]no
14:46:09FromDiscord<tomck> ok so what is `lent T`
14:46:15FromDiscord<tomck> just `T` without a copy?
14:46:27FromDiscord<tomck> If `my_foo` is freed and I use `last_foo_val`, that'll segfault, correct?
14:46:31leorize[m]"var T" but not mutable
14:46:49leorize[m]the compiler have some analysis to error out when that happens
14:46:51FromDiscord<Recruit_main707> Essentially a raw pointer then?
14:47:02leorize[m]you can try it yourself
14:47:31FromDiscord<tomck> but can it segfault
14:47:56FromDiscord<tomck> it's hard to test this, b/c often little test programs won't segfault
14:47:57leorize[m]you can just try :p
14:48:04leorize[m]we have a playground for this :p
14:48:12FromDiscord<Recruit_main707> Why do you need a ref to qn index though
14:48:32FromDiscord<Recruit_main707> (item of seq)
14:48:41FromDiscord<tomck> you can't make a test, then if it doesn't segfault, say 'oh this'll be fine for sure'
14:48:56FromDiscord<lqdev> because the item might be really big and he wants to avoid copying it @Recruit_main707
14:49:01FromDiscord<tomck> b/c at a later date I might not have it be a seq,it might be a table
14:49:05FromDiscord<tomck> also that ^
14:49:14leorize[m]use a template
14:49:21leorize[m]then you don't have to care
14:49:39FromDiscord<tomck> template == macro?
14:49:46leorize[m]nope
14:49:53*Vladar quit (Quit: Leaving)
14:50:00leorize[m]you can also look at the generated C code if you're concerned
14:50:53leorize[m]I'm pretty we got some extra analysis for "lent T" to prevent issues like this, but ofc testing is always the best way to check
14:51:10FromDiscord<tomck> idc if it does segfault,i just need to know whether those are the semantics of `lent T`
14:51:14leorize[m]I'd read the C code for you but I'm on phone rn :p
14:51:22leorize[m]~destructor
14:51:23disbotdestructor: 11https://nim-lang.org/docs/destructors.html
14:51:35leorize[m]^ semantics are written in there
14:51:57FromDiscord<tomck> > It is proven by the compiler that the pointer does not outlive its origin
14:51:59leorize[m]you can also just ping Araq and ask him :p
14:52:21FromDiscord<tomck> so the compiler *will* make sure that `last_foo_val` outlives `my_foo`?
14:52:35FromDiscord<tomck> in which case how tf is it doing that w/out lifetime annots?
14:52:46leorize[m]magic
14:52:57leorize[m]ask Araq and/or @Clyybber
14:53:05leorize[m]they wrote most of the analysis logic
14:53:35FromDiscord<tomck> i mean it's possible, but has implications for linking to other nim code if you don't have access toit
14:54:18leorize[m]not really, but again I'd defer the answer to the experts
14:54:28FromDiscord<tomck> if you know what the function is you can analyse it to figure it out,↡but if all you have is a compiled binary + some nim declarations for the types, it's not possible, regardless of how they implemented it
14:55:00FromDiscord<tomck> or does everything have to be an FFI decl if you're linking across multiple libs?
14:55:11FromDiscord<tomck> That would work well i suppose
14:59:55FromGitter<deech> Is Gara currently the most mature pattern matching library?
15:03:24bungI think patty more popular, about "mature" idk
15:04:34alehander92_true
15:04:45alehander92_you can try them both
15:05:00alehander92_but patty is more used maybe
15:07:29FromGitter<deech> alehander92_, oh hey since you're on can you help me with gara? How does the `~` work? I'm trying to destructure a variant object.
15:14:53disruptektomck: if you pass a pointer to ffi code, all bets are off.
15:15:02bungany image optimization lib in nim ?
15:15:33disruptektomck: arc is for refs; managed pointers. you can pass them around and they won't get collected as long as you increment the ref counter manually.
15:15:35federico3can I simply include a file in c?
15:15:41disrupteksure.
15:19:02federico3how?
15:19:05FromDiscord<Shucks> Might repeat but who knows: Did anyone got completions / suggestions with vim and nimlsp working?
15:19:17FromDiscord<Shucks> nvim*
15:19:19federico3it it just importc?
15:26:45*lritter joined #nim
15:31:01icycan the `result` variable only store strings?
15:31:25FromDiscord<treeform> icy, "does anyone have experience with treeform's ws package?" well I do...
15:31:32icyayy
15:31:40icygreat pkg btw
15:31:46FromDiscord<treeform> thanks
15:31:57icywait, lemme pastebin my code and ask my q
15:32:41icytreeform: https://termbin.com/5tgs
15:33:01icyso i'm trying to do this -- but it says 'type mismatch: got <Future[system.string]> but expected 'string''
15:34:54icyand when i use `return` instead, i get https://termbin.com/g013
15:38:07FromDiscord<treeform> you need to `result = await ws.receiveStrPacket()`
15:38:21FromDiscord<treeform> just like you `await ws.send(...)`
15:38:25FromDiscord<treeform> they are all async calls
15:38:43icyyeah that doesn't work either...
15:38:50icylemme paste the error
15:39:02FromDiscord<treeform> When you see `Future[..]` it means it wants `await` in front of it.
15:39:30FromDiscord<treeform> you can think of as `await` unwraps futures by waiting in time...
15:40:04icyyeah but that won't return a Future will it?
15:40:15icyit'll return the type after the Future resolves -- `string` in this case
15:40:30icyhttps://termbin.com/nd3r
15:40:40icybesides, when i await it like you mentioned i get this ^
15:42:52FromDiscord<treeform> If you want to return a future ... (I would not do that) ... you would need to remove the {.async.}
15:43:04FromDiscord<treeform> {.async.} also unwraps the future some how
15:43:40icyoh...
15:43:41icyhmmm
15:43:54icyguess i'll have to rework it so as to not return a Future heh
15:44:52icytreeform: however, if i put {.async.} against a proc, doesn't it /have/ to return a Future?
15:44:52FromDiscord<treeform> I just tried this: https://play.nim-lang.org/#ix=2rYA
15:44:54FromDiscord<treeform> works great
15:45:17icywow
15:45:19icyweird
15:45:52FromDiscord<treeform> are you on nim 1.0.0+ ?
15:45:58icyyeah, 1.2
15:46:01icyon OpenBSD
15:46:02icyif that matters
15:46:05FromDiscord<treeform> it should work then
15:46:11FromDiscord<treeform> does that 5 line file compiles?
15:46:27icylet me try it standalone
15:46:49icyyep it compiles on its own
15:46:54icyok so something else is causing issues then
15:47:01FromDiscord<treeform> it seems to
15:48:04icythanks btw
15:48:12FromDiscord<treeform> no problem
16:00:51alehander92_deech sorry not often online until
16:00:57alehander92_next week]
16:01:48alehander92_i dont think there is `~` currently?
16:04:12*marnix quit (Read error: Connection reset by peer)
16:06:44FromGitter<deech> alehander92_, enjoy your offline time. I'll file an issue. :)
16:09:18alehander92_awesome, thank you
16:18:21*marnix joined #nim
16:21:30*waleee-cl joined #nim
16:29:18FromDiscord<tomck> I have a variant struct, how can i have one of the variant not have any data associated with it?
16:30:28FromDiscord<tomck> sent a code paste, see https://play.nim-lang.org/#ix=2rYL
16:33:08FromDiscord<tomck> Oh i can just use `discard` instead of `pass` here
16:45:03disruptekyep.
16:49:09*idf31 joined #nim
16:51:43FromDiscord<tomck> so, just quickly back to this whole sink/lend thing↡I'm using the default GC↡If a function is taking ownership of something, can I just mark that type as 'sink' and that'll all work & provide me a nice bonus performance benefit if the compiler can figure it out?
16:52:06FromDiscord<tomck> or at least warn me of unneccesary copies or something?
16:59:30FromDiscord<tomck> Okay hang on, now i'm struggling↡↡So, to allocate a traced object you use `new` and that'll initialise an object to its default values on the heap somewhere, tracked by the GC↡What if that object is a variant? If i use `new` then try and change the `kind` of the variant, it (rightfully) complains with `assignment to discriminant changes object branch`
17:05:40FromDiscord<tomck> ohhhhhhh hang on, you don't need `new` to allocate, you just crreate the struct & nim will allocate in the background if you're creating a `ref Foo`? that's cool
17:05:43FromDiscord<tomck> mb!
17:07:55FromDiscord<lqdev> yeah using an object constructor with ref objects is automatically translated to `new(x)`
17:08:06FromDiscord<lqdev> and doesn't trigger case transition warnings
17:10:53*theelous3 joined #nim
17:13:40FromDiscord<KingDarBoja> https://forum.nim-lang.org/t/3124#38670 I was searching for some kind of optional parameter on a proc using `options` module BUT without having to write `some()` everytime I want to use that argument on proc call and found this comment on the forums, do you recommend that converter approach?
17:22:39PrestigeI'm attempting to write a proc that takes any proc as an argument. Is there a way to do this, or do I just need to go a different route with a template/macro?
17:23:14*narimiran quit (Ping timeout: 240 seconds)
17:23:55FromDiscord<KingDarBoja> Also searching for some kind of `readonly` for type fields, but looks like it isn't implemented (yet) on the lang: https://github.com/nim-lang/RFCs/issues/100
17:23:55disbotβž₯ Allow exporting object fields as read-only without requiring custom accesors
17:25:19*Vladar joined #nim
17:25:28PrestigeMy overall goal is to get a seq of all types of the arguments of an arbitrary proc (at compile time)
17:26:24PrestigeMaybe I do only need a macro
17:26:31FromDiscord<KingDarBoja> Example Prestige?
17:26:54PrestigeI'll write one up, just a moment
17:27:38*Vladar quit (Client Quit)
17:30:02FromDiscord<KingDarBoja> What you explained sounds a lot like: https://flow.org/en/docs/types/utilities/#toc-objmap (which I am reading right now)
17:31:06PrestigeYeah I'll just need a macro
17:31:15PrestigeAnyway, essentially this: https://play.nim-lang.org/#ix=2rZ1
17:35:23FromDiscord<KingDarBoja> πŸ™‚
17:35:55*Trustable joined #nim
17:40:02*Vladar joined #nim
17:41:26PrestigeReally need to find a good macro tutorial
17:50:39disruptekwhy?
17:51:21PrestigeStruggling to figure out how to pass a proc to a macro and be able to look at/manipulate the AST
17:52:05disruptekproc bar() {.foo.} = ...; macro foo(n: untyped): untyped = ...manipulations...
17:53:19FromDiscord<Yardanico> @tomck just FYI - it is actually save to change the discriminator for object variant kind with newruntime
17:53:39FromDiscord<Yardanico> Because default destructor for casw objects makes sure that it's safe
17:53:48FromDiscord<Yardanico> (edit) 'casw' => 'case'
17:53:48disruptekjust don't.
18:04:11PrestigeHm so there's no way to have the argument of the macro to be a proc, it's just untyped and I have to manually validate what was passed in?
18:04:50disruptekmake it `typed` if you want. you can `foo bar`, too.
18:05:06disrupteki'm not sure what you mean by "manually validate."
18:05:15*lo0p joined #nim
18:05:32*bung quit (Quit: Lost terminal)
18:05:41PrestigeI want the user to be passing in a proc, not any arbitrary thing
18:05:58disrupteksee `expectKind`
18:13:19*BlameTheRoomba quit (Remote host closed the connection)
18:13:50PrestigeOh so this is interesting: https://play.nim-lang.org/#ix=2rZb the treeRepr is Ident "callback", so I guess it only refers to what is literally in the parens? I'm trying to evaluate the actual callback proc on line 8
18:14:07Prestigeglad I finally found treeRepr lol
18:14:41disrupteksee macros.params
18:15:21disruptekyou cannot get types at runtime, though; they are a purely compile-time animal.
18:16:04PrestigeRight
18:16:53FromDiscord<lqdev> Prestige: also, getImpl
18:17:46PrestigeOh neat, thanks
18:18:13Zevvtypes and macros is sooo much fun
18:18:38ZevvMy all time favorite: https://github.com/nim-lang/RFCs/issues/44
18:18:38disbotβž₯ [RFC] Working with types in macro is difficult.
18:18:50PrestigeBeen hard pressed to find a good source to learn them
18:19:28ZevvI found the only way to learn is bumping your nose until the blood is everywhere
18:22:16*marnix quit (Ping timeout: 246 seconds)
18:23:13*marnix joined #nim
18:24:11FromDiscord<juan_carlos> I found `macros.parseStmt` really easy to work with, is just a string you can `echo`, then switching to `quote do:`.
18:24:34FromDiscord<juan_carlos> But yeah kinda advanced feature of the lang.
18:24:46ZevvI recently threw out all the "do's" after my quotes. Stuff still works.
18:24:56disrupteki'm not very sophisticated; i prefer to just do everything by hand. fewer surprises, i guess.
18:25:19disruptek!mem
18:25:19disbot total: 24469504; free: 3670016; owned: 18891248; max: 24469504
18:26:30*lo0p quit (Quit: WeeChat 2.8)
18:28:37PrestigegetImpl is exactly what I needed to know
18:30:46disruptekZevv: dude.
18:31:45disruptekam i missing something or is there really no way to disambiguate between selector registrations by fd?
18:32:06disruptekdo they clobber each other?
18:33:49*Zectbumo joined #nim
18:37:48*endragor quit (Remote host closed the connection)
18:38:30*endragor joined #nim
18:42:55*endragor quit (Ping timeout: 246 seconds)
18:48:26PrestigeI've gotten this far https://play.nim-lang.org/#ix=2rZi not sure why nothing prints on the playground, though
18:49:05PrestigeI have my Sym nodes, just need to transform them into a seq[typedesc] somehow
18:51:11*waleee-cl quit (Quit: Connection closed for inactivity)
18:56:43FromDiscord<KingDarBoja> How I would do something like this:↡> $ObjMap<O, F> takes an object type `T` and a function `F` and returns an object whose keys are the keys of the object T and each value is the return type of calling the function for each object value.
18:57:21FromGitter<awr1> i forget, how do you index a raw pointer
18:57:23FromGitter<awr1> in nim
18:57:36FromGitter<awr1> do I have to convert it to UncheckedArray or something
18:59:27FromDiscord<Yardanico> Yeah
18:59:55FromDiscord<Yardanico> cast[ptr UncheckedArray[mytype]](mypointer)
19:02:15FromGitter<awr1> oh cool nim has `toOpenArray` for that now
19:02:20disruptekPrestige: types are a thing that you only have at compile-time.
19:02:59disrupteki dunno how to state this more clearly.
19:06:22*fanta1 quit (Quit: fanta1)
19:09:20PrestigeThis is compile time disruptek
19:09:42disruptekhow do you figure?
19:12:12PrestigeWell it's a macro which runs during compilation and is printing out the types of the args of my callback
19:12:26disruptekso what's the problem?
19:12:57PrestigeIdk how to put those types into a seq in the macro
19:13:13disruptekfirstly, a seq can contain items of only one type.
19:13:42PrestigeRight, I wanted that to be typedesc
19:13:49disruptekif you want a compile-time seq of compile-time values, such as ast symbols, simply `var s: NimNode; s.add someSym`
19:14:03disrupteker, var s: seq[NimNode] ...
19:16:53PrestigeSo I'm not sure how to transform e.g. Ident "int" into a typedesc - I also seem to be getting an error when I set the macro's return type to seq[typedesc]
19:21:44*Jesin joined #nim
19:21:50disrupteki'm not sure what you expect to happen.
19:22:05FromDiscord<Vindaar> you simply don't transform it. Just use the `Ident "int"`
19:22:27disruptekwhat are you trying to accomplish?
19:22:53disruptekmaybe he wants $ident?
19:25:22PrestigeI'm writing an ECS framework and I have a table of hashed typedescs to seqs of components, I need to get the typedescs of the callback params to access the appropriate seqs of components
19:25:53disrupteksounds like you need a seq of hashes, not a seq of typedescs.
19:26:02disrupteka typedesc is a funky form of typeclass.
19:26:12Zevv"Golang picking [] instead of <> for Generics"
19:26:35PrestigeIt's a table with hashes as the keys
19:27:33FromDiscord<lqdev> Zevv: at least they used their brains for once and did something sensible
19:27:36PrestigeI want to transform the Ident "MyType" into a typedesc
19:27:51*disruptek sighs.
19:32:34*marnix quit (Ping timeout: 256 seconds)
19:33:22*marnix joined #nim
19:36:58alehander92_[] is good
19:37:17alehander92_go are ok man
19:38:24PrestigeHow do I construct a seq in a macro to return it?
19:38:34alehander92_you can use compile time functions
19:38:38alehander92_and it's better to do so imho
19:38:52alehander92_but the macro itself should return just a node
19:38:57alehander92_you can use stmt list
19:39:03alehander92_if you want many
19:39:05alehander92_!!
19:39:39*silvernode joined #nim
19:39:53FromDiscord<lqdev> Prestige: the AST would be `nnkPrefix(ident"@", nnkBracket(valuesGoHere))`
19:40:27FromDiscord<lqdev> because, if you haven't realized it, `@[]` is simply the @ operator applied on an array
19:41:35PrestigeYeah, just trying to figure out macros lol. I have a for loop getting values from the AST, trying to put them all in a seq and return it
19:41:43FromDiscord<Vindaar> he wants a compile time seq, I believe. You just create a seq in a compile time constant and add to it, just like you would at run time
19:42:06FromDiscord<Vindaar> but a `seq[typedesc]` is simply not valid
19:42:19Prestigeoh really? dang
19:42:22FromDiscord<Vindaar> use a `seq[NimNode]`
19:42:31FromDiscord<Vindaar> each node represents one type
19:42:54FromDiscord<Vindaar> (simply as an ident)
19:43:17Prestigeahh thanks! I thought I had to convert it first to something
19:43:17FromDiscord<Vindaar> still possible that what you're trying isn't possible though
19:43:25FromDiscord<Vindaar> nope
19:44:05*silvernode_ joined #nim
19:44:24*silvernode quit (Ping timeout: 256 seconds)
19:45:34FromGitter<Lecale> Is there an async version of something like execProcess(blah.exe) from osproc ? I've never tried async in nim before
19:45:43disruptek!repo asynctools
19:45:43disbothttps://github.com/cheatfate/asynctools -- 9asynctools: 11Various asynchronous tools for Nim language 15 58⭐ 20🍴
19:45:44*Senketsu joined #nim
19:47:06Prestige@Vindaar I am attempting this: https://play.nim-lang.org/#ix=2rZJ
19:47:43Prestigeoh I need to change the initial result
19:48:11alehander92_ahh sorry
19:48:12FromGitter<Lecale> what a useful bot, although your conversation is a bit limited
19:48:24alehander92_!repo ?
19:48:25disbotno results 😒
19:50:57*azed joined #nim
19:53:24*alehander92_ is now known as alexander92
19:53:51*alexander92 is now known as alehander92
19:59:06PrestigeSo I need to init result as a newStmtList, add the @ prefix and bracket, then somehow add the nodes to it, then close the bracket? All the examples I'm seeing have everything in-lined, like nnkBracket(nnkIntLit(1), nnkIntLit(2), nnkIntLit(3)). I think that's actually just a printed treeRepr, I'm not seeing anything on adding new nodes to the result in the manual
20:00:12YardanicoAnother (somewhat interesting) programming language - https://vale.dev/
20:00:21Yardanicothey have UFCS and "Ownership, move semantics, and deterministic destruction." :P
20:01:15FromDiscord<Vindaar> @Prestige the thing you have to be aware is that you cannot return types (you can of course have a macro that in the end only results in a single type as an expression) or have types in a seq at runtime. You need to use your types for something at compile time.
20:01:49skrylar[m]Yardanico: hm. neat but .. meh
20:01:55FromDiscord<Vindaar> so the question is what do you want to use those types your macro will return for
20:01:58Yardanicowell yeah, I'm not saying it's good or not, just shared it
20:02:16skrylar[m]i could have sworn nim once had region pointers
20:02:16FromDiscord<Vindaar> but I'm gonna be afk for ~1 hour now
20:02:25Yardanicoskrylar[m]: there's --gc:regions if you mean that
20:02:47skrylar[m]no it was something you could subtype pointers with
20:02:51skrylar[m]for arenas
20:03:02skrylar[m]i may be remembering that which never existed again
20:03:10PrestigeI have a lookup table of hashed types. I just have no idea how to return these values I have from my macro
20:03:56skrylar[m]hmm. i should finish the tlsf module
20:04:01skrylar[m]i was admiring how small that algorithm actually is
20:04:02YardanicoI just shared Vale in case Nim can get some ideas from it :P
20:04:48Yardanicoalthough I have to say - the syntax in https://vale.dev/ref/regions (first example) is far from readable for me :P
20:04:49*marnix quit (Read error: Connection reset by peer)
20:05:03Yardanicofn biggestShipName<'a ro>(ships 'a &List<Ship>) Str {
20:05:30skrylar[m]i think nim is mostly fine, although it could maybe do with a compiler overhaul, but eh.
20:05:34*marnix joined #nim
20:05:40Yardanicothe compiler overhaul will eventually happen anyway
20:05:50Yardanicobut not soon :)
20:05:51skrylar[m]i have some ideas but i don't feel like it right now
20:06:26skrylar[m]basically what i wanted to do was have a webasm or muvm (i like Mu because it has tracing pointers) shell, and then basically run the whole thing like lisp/smalltalk does
20:06:36skrylar[m]so you just like
20:06:59skrylar[m]parse the module and dump the images
20:07:58skrylar[m]but theres a lot of experimental shit involved and i uh, have to work on stuff that pays right now ^^;
20:11:13*lmariscal joined #nim
20:11:55Prestige@Vindaar did what I said sound correct in what I'd have to do to return a seq at least? I'm lost at how I should return some value, or transform the result into a seq.
20:19:55PrestigeThink I'm getting close https://play.nim-lang.org/#ix=2s0Z
20:20:38Prestigehttps://play.nim-lang.org/#ix=2s15 *
20:23:57*Vladar quit (Quit: Leaving)
20:27:09FromDiscord<Varriount> Anyone know if C2Nim can translate enums?
20:27:35FromDiscord<Varriount> Also, wasn't there an alternative/complementary tool to C2Nim?
20:27:42Yardaniconimterop?
20:27:48Yardanicobut it's separate from c2nim :P
20:27:54Yardanicoand I think it can translate enums
20:28:20FromDiscord<lqdev> @Varriount nimgen?
20:28:36FromDiscord<lqdev> that's the complementary tool
20:29:11FromDiscord<Varriount> I don't think Nimterop is it, unless it can help extract definitions from C files
20:30:37FromDiscord<Varriount> I'm processing many large header files with complex type definitions
20:31:28Yardaniconimterop can help with that exactly
20:31:36YardanicoIt's made for more automatic process with less manual work
20:32:14*azed quit (Ping timeout: 256 seconds)
20:32:57FromDiscord<Varriount> Yardanico: How does it parse header files?
20:33:01Yardanicowith toast
20:33:24Yardanicoit uses treesitter
20:33:49Yardanicobut of course has a lot of it's own processing stuff too
20:34:00Yardanicosee https://github.com/nimterop/nimterop/blob/master/nimterop/toastlib/ast2.nim
20:34:18Yardanico@shashlick can explain better :P
20:35:09FromDiscord<Varriount> Oh, neat.
20:35:11*silvernode_ quit (Quit: Konversation terminated!)
20:38:00*idf31 quit (Ping timeout: 258 seconds)
20:41:35FromDiscord<Varriount> Yardanico: my biggest pain point right now is that C2Nim can only process simple type definitions.
20:41:46Yardaniconimterop is more advanced in that regard I think
20:41:55Yardanicothere's quite a lot of wrappers you can look at
20:42:22FromDiscord<Varriount> It chokes on definitions of the form `typedef def alias1, alias2, ... `
20:43:10*narimiran joined #nim
20:43:28*azed joined #nim
20:43:47*marnix quit (Ping timeout: 240 seconds)
20:49:10FromDiscord<Varriount> @shashlick If I pass toast multiple files, does it simply output the translation of all of them to stdout, or is there a way to have it write to multiple files?
20:52:20Yardanicowhy won't you use nimterop itself?
20:52:27Yardanicousing toast directly isn't the best idea I think
20:52:32disruptekit makes my teeth hurt.
20:52:47shashlickShould be doable to use toast directly
20:52:54shashlickExcept when you need to override something
20:53:15shashlickYou can pass multiple files, output will be one
20:53:42shashlickBest to see some existing wrappers
20:54:02shashlickAnd the readme and docs
20:54:41shashlickHappy to answer questions in a couple hours
20:54:44shashlickWhat you wrapping
20:55:20FromDiscord<Varriount> Yardanico: If Nimterop can successfully parse and emit sensible Nim code from Windows SDK files, I will personally donate at least $50 to @shashlick
21:00:02FromDiscord<Varriount> (I'm being serious)
21:04:39*NimBot joined #nim
21:07:53FromDiscord<Varriount> Ok... is it @shashlick Does treesitter use any pragmas to modify the C compiler flags?
21:08:04FromDiscord<Varriount> (edit) removed 'Ok... is it'
21:08:38FromDiscord<Varriount> Because Clang is choking on arguments passed to it because the paths contain spaces (My use directory)
21:13:10PrestigeThis is driving me nuts
21:21:27FromDiscord<Vindaar> @Prestige back now.↡I still don't quite understand why you want to return a seq here or rather in what context that macro is supposed to be used
21:23:16PrestigeI have a table with the keys as hashed typedescs, just still trying to figure out how to create and return a seq from a macro (in general)
21:23:45Yardanicoyou don't return "a seq" from a macro directly
21:23:49Yardanicoyou return an AST representing a seq, yes
21:24:08Prestigeright, idk how to do that
21:24:14FromDiscord<Vindaar> this is what I was typing right now (still typing preettyy slow over here...): you mention you have a lookup table of hashes of types. where do those come from? I assume this macro is supposed to extract the type of the callback and...
21:24:44YardanicoPrestige: uhh it's just simple AST construction, you can use dumpAstGen to see
21:24:54*narimiran quit (Ping timeout: 240 seconds)
21:25:01FromDiscord<Vindaar> the problem is: you can construct a `nnkBracket` with idents of types
21:25:16PrestigeYeah, I've done that to see what I need to construct, I'm stuck on the how
21:25:38FromDiscord<Vindaar> however, those "cannot survive" compile time, because at run time that isn't allowed
21:26:12PrestigeThey will be hashed at complie time
21:26:25FromDiscord<Vindaar> then give me a sec
21:26:28Prestigecompile*
21:27:04YardanicoPrestige: simplest seq construction is https://play.nim-lang.org/#ix=2s1p
21:27:11Yardanicobut really can you share more context and code?
21:28:28FromGitter<awr1> is there a way you can get `offsetof` from every field in a field through the `fields` iterator
21:28:33Prestigeah thank you - I'll copy paste my explanation from earlier
21:31:53FromDiscord<Vindaar> here you go: https://play.nim-lang.org/#ix=2s1r
21:32:09*solitudesf quit (Ping timeout: 256 seconds)
21:32:47Yardanicoalso https://github.com/PMunch/macroutils might help
21:32:58Yardanicoit contains a lot of useful stuff for working with macros ;)
21:33:02Prestigeor not, I can't find it. I'm writing an ECS framework, and need to look up a seq of components based on their type. Since typedescs aren't available at runtime, I hashed the typedescs and use them as the keys for the table. The code I'm writing now is so the user can provide a callback with multiple components as params, I get the type descs, hash them, and get the respective component seqs
21:33:42PrestigeThanks all
21:33:49FromDiscord<Vindaar> of course you don't necessarily have to do stuff in that macro (you can have a compile time global table to store NimNodes and use those from some other macro for instance)
21:35:37FromDiscord<Vindaar> @Prestige can you share the rest of the code?
21:36:03FromDiscord<KingDarBoja> I forgot how to initialize some fields on a Type object... Was like calling the object type right?
21:36:13Prestigesure 1 min
21:36:36Prestigehttps://github.com/avahe-kellenberger/EasyECS
21:36:43PrestigeNot much there yet
21:36:48Yardanico@KingDarBoja what's a Type object?
21:37:00Yardanicoif you mean object construction, it's Foo(bar: 1, baz: "hello")
21:37:13Prestigeregistry.nim has the important bits
21:37:25FromDiscord<KingDarBoja> sent a code paste, see https://play.nim-lang.org/#ix=2s1s
21:37:36YardanicoSomething(fieldB: "hi")
21:37:46FromDiscord<KingDarBoja> Thanks πŸ™‚
21:38:13FromGitter<awr1> managed to do it with a macro
21:41:47*Senketsu quit (Read error: Connection reset by peer)
21:43:31FromDiscord<Vindaar> @Prestige I'm trying to wrap my head around how your macro will fit in there.
21:46:10PrestigeIt's going to be a helper function to a public/exposed function (maybe a template) which invokes the callback with the appropriate values from the table
21:47:49PrestigeI'm not sure what the error is here: https://play.nim-lang.org/#ix=2s1u
21:48:05Yardanicoyou can't have arrays of typedescs at runtime
21:48:15Yardanicothey're compile-time only :)
21:48:23PrestigeYeah
21:48:38PrestigeMaybe I just need to do the hashing inside the macro
21:48:55ForumUpdaterBotNew thread by Aviator: Printing Nim AST as Nim code?, see https://forum.nim-lang.org/t/6555
21:49:47skrylar[m]there was an API for that
21:51:44*azed quit (Quit: WeeChat 2.8)
21:56:25*endragor joined #nim
21:58:07FromDiscord<Vindaar> @Avahe an example that might put you on the right track: https://play.nim-lang.org/#ix=2s1x
21:59:33FromDiscord<Vindaar> as you see, I build code that constructs a _runtime_ (!) sequence, with hardcoded types, extracted from the callbacks arguments
21:59:52*Trustable quit (Remote host closed the connection)
22:00:08FromDiscord<Vindaar> * call of hardcoded types to `getTypeId` that should read
22:00:24Prestigethanks, I was trying to figure out exactly how to invoke getTypeId!
22:01:12*endragor quit (Ping timeout: 256 seconds)
22:25:20*laqq3_ joined #nim
22:32:37PrestigeIs there a reason getCallbackArgTypes can't be called from a template?
22:33:23*azed joined #nim
22:35:02*waleee-cl joined #nim
22:37:02FromDiscord<Varriount> @shashlick I was able to compile nimterop. I'll make a PR with the changes I had to make in order to get things to work.
22:37:31FromDiscord<Varriount> It might be tricky though, since you have to sort between using clang+windows sdk, and clang/gcc+mingw
22:42:21Prestige@Vindaar https://0x0.st/ivgv.png does this not make sense? It's wanting the callback to be passed into getCallbackArgTypes as a NimNode
22:42:35FromDiscord<Varriount> It essentially amounted to using quotes around filenames passed via passC, and doing `{.passC: "-Dfdopen=_fdopen".}
22:44:04Yardanicocan't you do that with nimterop itself?
22:44:22FromDiscord<Varriount> Yardanico: Not when it's Nimterop that's not compiling
22:44:28Yardanicooh
22:44:30FromDiscord<Vindaar> no, because the code in a template will be inserted as is (thus the resulting code exists at runtime)
22:53:10PrestigeHmm I'm confused as to why this is an issue, I thought it would resolve the template calling the macro at compile time. It seemed like the problem was I needed to convert the proc to a different type or something
22:56:13PrestigeI found another Nim ECS framework that does what I'm trying to do @Vindaar but I'm not 100% on how its macros work yet (if you're curious): https://github.com/yglukhov/ecs/blob/master/ecs.nim#L73
22:56:39PrestigeThat's pretty much the function I'm trying to make ^
23:08:20*azed quit (Quit: WeeChat 2.8)
23:10:03*sentreen quit (Quit: sentreen)
23:15:05*sentreen joined #nim
23:17:11*krux02_ joined #nim
23:18:52shashlick@varriount so using clang on windows?
23:19:20shashlickWhat was the issue you faced
23:20:04*krux02 quit (Ping timeout: 256 seconds)
23:22:23shashlickIsn't windows sdk c++?
23:25:00*bozaloshtsh_ quit (Quit: ZNC 1.7.5 - https://znc.in)
23:25:36FromDiscord<impbox> Prestige i tried to do something very similar to you, but ran into the issue that I couldn't access a compile time seq at runtime
23:25:45FromDiscord<impbox> I'll find the issue number
23:25:59PrestigeThanks
23:26:46FromDiscord<Elegant Beef> What're we trying to do?
23:27:17FromDiscord<impbox> https://github.com/nim-lang/Nim/issues/13375
23:27:18disbotβž₯ Accessing compileTime variable at runtime returns zeroed data. ; snippet at 12https://play.nim-lang.org/#ix=2bba
23:27:55*bozaloshtsh joined #nim
23:27:55*bozaloshtsh quit (Changing host)
23:27:55*bozaloshtsh joined #nim
23:28:25Yardanico@impbox you can easily workaround it though
23:28:31Yardanicojust do "let procs = nameToProc" and use procs at runtime
23:30:09PrestigeBeef: essentially this https://github.com/yglukhov/ecs/blob/master/ecs.nim#L73
23:30:23FromDiscord<Elegant Beef> I mean use english please
23:30:24FromDiscord<Elegant Beef> πŸ˜„
23:30:49*laqq3_ quit (Ping timeout: 264 seconds)
23:31:53FromDiscord<impbox> Yardanico does that actually work? I'm pretty sure I tried that at the time but it didn't work, though maybe it's fixed since. I'll give it a test tonight
23:31:58Yardanicoyes I just tested
23:32:07Yardanicohttps://play.nim-lang.org/#ix=2s1D
23:32:09FromDiscord<Elegant Beef> https://github.com/beef331/nico-helper/blob/master/src/levelmanager.nim#L37
23:32:13FromDiscord<Elegant Beef> I mean works for me
23:32:27FromDiscord<Elegant Beef> Oh
23:32:30FromDiscord<Elegant Beef> That
23:32:37FromDiscord<Elegant Beef> Good to no yard
23:32:40FromDiscord<Elegant Beef> Danke
23:32:45FromDiscord<Elegant Beef> know*
23:32:54Yardaniconice 5 messages :P
23:32:59FromDiscord<Elegant Beef> No problem
23:33:09FromDiscord<Elegant Beef> Use a better speech platform πŸ˜›
23:33:10FromDiscord<impbox> Cool
23:33:15FromDiscord<impbox> Thanks
23:33:24Yardanico@Elegant even on discord 5 messages in a row takes quite a lot of space :)
23:33:27Yardanicoirc is no different in that regard
23:33:34FromDiscord<Elegant Beef> Eh i have it a portrait monitor
23:33:37FromDiscord<Elegant Beef> Point nullified πŸ˜„
23:34:06Yardanico"Oh, that? Good to know yardanico" is much smaller than 5 lines though :P
23:34:31FromDiscord<Elegant Beef> It indeed is, but i already hit enter, so i couldnt take it back
23:35:04FromDiscord<impbox> Need to enable slowmode
23:35:10Yardanicois it there for discord?
23:35:14Yardanicoor need bots or something?
23:35:19FromDiscord<Elegant Beef> Nah slowmode is a thing
23:35:23FromDiscord<impbox> It's a discord thing
23:35:31FromDiscord<Elegant Beef> I dont think slowmode is really needed, just people that arent inept
23:35:45FromDiscord<impbox> Clientside slowmode
23:35:49Yardanicooh that
23:35:53Yardanicoi thought server-side
23:39:07*tyler569 quit (Quit: WeeChat 2.3)
23:39:42FromDiscord<Rika> > @Elegant Beef even on discord 5 messages in a row takes quite a lot of space :)↡doesnt need 5 messages if you edit
23:39:47FromDiscord<Rika> oops, pinged beef
23:39:59skrylar[m]you know. i should get off my butt and test zulip. the chat streams are supposed to be nice.
23:40:27Yardanico@Rika well, he didn't edit :P
23:41:04FromDiscord<Rika> well prolly because we're used to not edit stuff because of the old bridge
23:41:36YardanicoI don't think Beef really was there before the new bridge :)
23:41:57FromDiscord<Rika> really?
23:42:09FromDiscord<Rika> my head only has 4 kb of storage, sorry
23:42:40Yardanicobtw my invite to this discord server has been used 1707 times
23:42:45Yardanicoand we have 1071 members :P
23:43:34FromDiscord<Elegant Beef> I mean i was
23:43:41FromDiscord<Elegant Beef> I've been here for like 4-6 months
23:44:00Yardanicowell true
23:44:01FromDiscord<Rika> i dont know how long ive been here
23:44:19Yardanico@RIka since 20/09/2019
23:44:22FromDiscord<Rika> 10 months
23:44:27FromDiscord<Rika> ish
23:44:38FromDiscord<Elegant Beef> The way i see it is you made your arguement about 5 messages when you complaining resulted in more than 5 messages πŸ˜›
23:44:46FromDiscord<Yardanico> https://discordapp.com/channels/371759389889003530/371759389889003532/371762716940959755
23:44:48FromDiscord<Rika> big brain
23:45:17FromDiscord<Rika> I CANT BELIEVE THE FIRST BRIDGE WAS IN GO
23:45:22FromDiscord<Rika> I FEEL BETRAYED
23:45:25YardanicoI didn't write it
23:45:27YardanicoI used matterbridge
23:47:25Yardanicobtw if you actually check I have less messages on the discord server than, for example, Beef
23:48:17YardanicoLOL
23:48:49Yardanicoapparently this server is 1001 days old today
23:48:54Yardanicoso it was 1000 days old yesterday
23:49:08Yardanicofrom 2017-10-22 to 2020-07-19
23:49:54FromDiscord<XeroOl> hello
23:50:11FromDiscord<XeroOl> does anybody know how to cast an array into a pointer?
23:50:24Yardanicocast[pointer](myarr[0].addr)
23:50:29Yardanicoah actually
23:50:33Yardanicojust myarr[0].addr
23:50:40Yardanicoyou take the address of the first element of the array
23:50:44Yardanicoworks for seqs too
23:52:21FromDiscord<XeroOl> it says `expression has no address, maybe use "unsafeAddr"`
23:52:39Yardanicocan you show the code?
23:52:47Yardanicoah right
23:52:50FromDiscord<XeroOl> let vertices = [0.0f, 0.5, 0.5, -0.5, -0.5, -0.5]
23:52:52Yardanicoyou need to declare your array with "var"
23:52:52FromDiscord<XeroOl> discard addr(vertices[0])
23:53:09FromDiscord<XeroOl> ahh, that makes sense
23:53:23YardanicoI mean it'll probably work with let + unsafeAddr too, but it's better to just use var :)
23:53:33FromDiscord<XeroOl> var is definitely what I want
23:53:45FromDiscord<XeroOl> thank you very much
23:56:59YardanicoI guess I should also (for fun of course) sort users by message count for all messages in IRC (since all logs are there)
23:57:30FromDiscord<Varriount> Yardanico @shashlick toast seems to be giving me problems - all I get when attempting to run it with a file is:↡```Error: unhandled exception: C:\Users\Clay Sweetser\Documents\Repositories\nimterop\nimterop\toastlib\tshelp.nim(15, 12) `gState.code.nBl` Empty code or preprocessor error [AssertionError]```
23:58:29shashlickAre you on the command line or cimport
23:58:35FromDiscord<Varriount> command line
23:58:40shashlickAdd -d to get debug output
23:58:56shashlickWill tell you what it is trying to parse
23:59:13shashlickAlso make sure you use -p
23:59:25shashlickPreprocess is crucial for non trivial wrappers
23:59:42FromDiscord<Varriount> Nope, same error