<< 05-07-2021 >>

00:00:15fn<ForumUpdaterBot99> New thread by Sixte: Nonlinear module behaviour in Nim, see https://forum.nim-lang.org/t/8197
00:30:26FromDiscord<@bracketmaster-5a708063d73408ce4> Thx @\_discord\_145405730571288577\:t2bot.io
00:30:41FromDiscord<timotheecour> In reply to @@bracketmaster-5a708063d73408ce4 "say I have an": `typetraits.enumLen`
00:33:19FromDiscord<@bracketmaster-5a708063d73408ce4> @\_discord\_427948629249228800\:t2bot.io , not seeing that? https://nim-lang.org/docs/typetraits.html
00:34:03FromDiscord<@bracketmaster-5a708063d73408ce4> I do however see TupleLen - maybe convert enum to Tuple?🤷
00:36:47FromDiscord<ElegantBeef> probably just on devel
00:38:43FromDiscord<timotheecour> ya devel
01:18:45FromDiscord<@bracketmaster-5a708063d73408ce4> ah
02:19:10FromDiscord<aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3s01
02:19:15FromDiscord<aleclarson> So this isn't possible then?↵https://discord.com/channels/371759389889003530/371759389889003532/861324736856719361
02:23:02FromDiscord<aleclarson> btw is there documentation on what all the `macro` pragmas do?↵https://nim-lang.org/docs/compiler/pragmas.html#macroPragmas
02:25:29*arkurious quit (Quit: Leaving)
02:33:26FromDiscord<ElegantBeef> It's sorta possible
02:33:36FromDiscord<ElegantBeef> But you have to play with the syntax nim lets you parse
02:34:44FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=3s03
02:35:29FromDiscord<ElegantBeef> Ah that didnt work for multiple statements, https://play.nim-lang.org/#ix=3s04 this could be a starter
02:36:24FromDiscord<ElegantBeef> That's all internal compiler stuff that corresponds to stuff here https://nim-lang.org/docs/manual.html#pragmas
02:37:56FromDiscord<ElegantBeef> @aleclarson as i just noticed when you posted that 😄
02:47:48*rockcavera joined #nim
02:47:48*rockcavera quit (Changing host)
02:47:48*rockcavera joined #nim
03:25:32*vicfred quit (Quit: Leaving)
03:31:31FromDiscord<Raws> @zetashift Have you had any more progress working with neovim and msgpack? I have mostly been trying in an isolated project. My attempts to work with nvim_client were brief because it seemed like a bigger undertaking than doing what I need from scratch. But it turns out I'm struggling with both 🤷‍♂️.
03:37:09FromDiscord<aleclarson> is there nothing like `parseEnum` for ordinal enums? (ie: to convert the ordinal to an ident string)
03:38:38FromDiscord<ElegantBeef> `strutils` has a parseEnum that goes str -> enum
03:38:43FromDiscord<Raws> @aleclarson https://stackoverflow.com/questions/63931540/string-enum-type-in-nim
03:39:34FromDiscord<aleclarson> yeah i saw that, but i want to convert `NimNodeKind` integer back to the `nnkProc` string, for example
03:39:37FromDiscord<aleclarson> for debugging
03:40:29FromDiscord<aleclarson> i could make a massive `case` stmt that does it manually, but i'd like to that
03:40:35FromDiscord<aleclarson> (edit) "i could make a massive `case` stmt that does it manually, but i'd like to ... that" added "avoid"
03:41:33fn<Prestige99> you want to go from int to enum?
03:47:34FromDiscord<aleclarson> more like "int to string" if you know what i mean
03:48:42FromDiscord<aleclarson> so i can know what a specific `NimNodeKind` represents when echoing it
03:49:21FromDiscord<ElegantBeef> Can you provide an example?
03:49:34FromDiscord<aleclarson> i guess i can reverse engineer it, so to speak, by running a single statement in isolation and checking its `kind`
03:49:51FromDiscord<aleclarson> (edit) "running" => "passing"
03:56:12FromDiscord<aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3s0d
03:57:40FromDiscord<ElegantBeef> but that's just `$foo == "foo"`
03:58:16FromDiscord<aleclarson> oh perfect xD
03:58:20FromDiscord<aleclarson> thx
03:58:52FromDiscord<ElegantBeef> All things but `ptr`, `ref`, and `distinct` will have a `$` by default
03:59:20FromDiscord<aleclarson> yeah i dumbly assumed `$foo` would just stringify the int value
03:59:34FromDiscord<ElegantBeef> it returns the actual ident or the given string
03:59:49FromDiscord<ElegantBeef> so if you did `foo = "SomeLongString"` it'd return that string
04:00:42FromDiscord<aleclarson> sent a code paste, see https://paste.rs/s30
04:00:46FromDiscord<aleclarson> this is what confused me i think
04:01:20fn<Prestige99> can you just do $MyInt(i)
04:01:34fn<Prestige99> Where MyInt is the enum name
04:02:04FromDiscord<ElegantBeef> That should work
04:02:11FromDiscord<ElegantBeef> Assuming `i` is a valid enum value
04:02:25FromDiscord<ElegantBeef> And now for the safest way to know that refer to arne's forum post with no concrete single solution 😛
04:04:26FromDiscord<aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3s0i
04:04:33FromDiscord<aleclarson> whatever im just glad i got a solution \:)
04:04:50FromDiscord<ElegantBeef> Maybe you aliased the enum with a variable?
04:06:02*supakeen quit (Quit: WeeChat 3.2)
04:06:38*supakeen joined #nim
04:25:11*rockcavera quit (Remote host closed the connection)
05:01:55*mjsir911 quit (*.net *.split)
05:01:55*emery quit (*.net *.split)
05:01:55*joast quit (*.net *.split)
05:01:55*redj quit (*.net *.split)
05:01:55*crem quit (*.net *.split)
05:02:07*mjsir911 joined #nim
05:02:07*mjsir911 quit (Changing host)
05:02:07*mjsir911 joined #nim
05:02:10*crem joined #nim
05:03:58*jfinkhaeuser quit (*.net *.split)
05:03:58*blackbeard420 quit (*.net *.split)
05:04:07*blackbeard420_ joined #nim
05:05:18*mal`` quit (*.net *.split)
05:05:18*Oddmonger quit (*.net *.split)
05:05:18*dom96 quit (*.net *.split)
05:05:18*Amun-Ra quit (*.net *.split)
05:05:18*mst quit (*.net *.split)
05:05:18*mahlon quit (*.net *.split)
05:05:18*pjz quit (*.net *.split)
05:05:24*mst joined #nim
05:05:48*pjz joined #nim
05:05:49*Oddmonger joined #nim
05:05:54*mahlon joined #nim
05:05:58*Amun-Ra joined #nim
05:06:18*nisstyre quit (*.net *.split)
05:06:18*snowolf quit (*.net *.split)
05:06:18*oz quit (*.net *.split)
05:06:26*snowolf joined #nim
05:06:30*mal`` joined #nim
05:06:47*nisstyre joined #nim
05:10:42*emery joined #nim
05:12:57*ox joined #nim
05:13:43*redj joined #nim
05:14:14*jfinkhaeuser joined #nim
05:14:27FromDiscord<aleclarson> Are custom pragmas possible?
05:15:08FromDiscord<ElegantBeef> Yes
05:15:44FromDiscord<ElegantBeef> Nim's macros can be used like pragmas, but you can also make annotative pragms by doing `template yourPragma {.pragma.}`
05:15:45*dom96 joined #nim
05:15:49FromDiscord<ElegantBeef> (edit) "pragms" => "pragmas"
05:17:01FromDiscord<ElegantBeef> What type of pragma are you after?
05:18:08FromDiscord<aleclarson> A pragma that can alter the AST, so i guess `macro` is the way to go?
05:18:29FromDiscord<ElegantBeef> Well yea but i mean where's the usecase, on a procbody?
05:18:34FromDiscord<aleclarson> yeah
05:18:53FromDiscord<ElegantBeef> Then yep a macro will get the proc body and you'll be able to mutate it
05:19:03FromDiscord<ElegantBeef> I've got many examples of those if you need one, not that they're overly clear 😄
05:19:27FromDiscord<aleclarson> haha thx, i'll let you know if i run into any problems \:)
05:21:42FromDiscord<Rika> ~~`async` is a macro used like a pragma~~
05:32:52FromDiscord<emef> is it possible to implement specializations of a generic proc?
05:32:57FromDiscord<emef> something like this
05:33:04FromDiscord<emef> sent a code paste, see https://play.nim-lang.org/#ix=3s0s
05:33:07FromDiscord<ElegantBeef> `T: int32`
05:33:19FromDiscord<ElegantBeef> then use T elsewhere
05:33:24FromDiscord<emef> nice
05:33:24FromDiscord<emef> ty
05:33:55FromDiscord<saem> There is a sub-type relation hiding in there.
05:34:11FromDiscord<ElegantBeef> No need to hold that string value inside the object
05:34:18FromDiscord<ElegantBeef> You can always retrieve that for free
05:34:31FromDiscord<ElegantBeef> And it makes more sense to do `T: int32 or int64`
05:34:41FromDiscord<ElegantBeef> Unless you have code that relies on the difference ofc
05:34:55FromDiscord<emef> yea I do, was just trying to synthesize a simple example
05:35:43FromDiscord<aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3s0t
05:35:51FromDiscord<ElegantBeef> I actually can help here!
05:35:59FromDiscord<ElegantBeef> With one of those afformentioned examples
05:36:08FromDiscord<aleclarson> thank the gods
05:36:43FromDiscord<ElegantBeef> https://github.com/beef331/kashae/blob/master/src/kashae.nim#L113
05:37:04FromDiscord<ElegantBeef> It's as simple as that `procBody[3]` is the formal params, so adding a `identDef` will add a new parameter
05:37:33FromDiscord<aleclarson> hmm, isn't that what my snippet is doing?
05:37:56FromDiscord<ElegantBeef> You dont set the result
05:38:07FromDiscord<aleclarson> ahh newb mistake
05:38:23FromDiscord<ElegantBeef> macros return stuffs, so make it an `: untyped` to make it clear 😄
05:38:49FromDiscord<ElegantBeef> Here's me learning there is a params shortcut
05:38:58FromDiscord<ElegantBeef> What was remembering `[3]` good for then? 😦
05:39:12FromDiscord<aleclarson> yay i taught the teacher \:D
05:39:29FromDiscord<aleclarson> hmm, still not working after adding `: untyped`↵https://play.nim-lang.org/#ix=3s0u
05:40:18FromDiscord<ElegantBeef> Well this is semantically checked before the macro is ran
05:40:22FromDiscord<ElegantBeef> So this will never work properly
05:40:56FromDiscord<aleclarson> ohhhh of course
05:40:56FromDiscord<ElegantBeef> Anything that is a specific parameter in a macro requires that to be semantically checked
05:41:08FromDiscord<aleclarson> just used `untyped` instead of proc
05:41:19FromDiscord<ElegantBeef> So you can make the parameter untyped and then inside make sure you do some checking to ensure it only runs on procs
05:41:24FromDiscord<ElegantBeef> be it `expectKind` or `assert`
05:41:28FromDiscord<aleclarson> thx alot
05:43:34FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=3s0w for the working version of my suggestion 😄
05:44:20FromDiscord<emef> I think what I was looking for is more likely a concept, is that feature fairly stable? (I see it's in the experimental docs)
05:46:23FromDiscord<ElegantBeef> They're fairly stable imo
05:47:47FromDiscord<emef> maybe someone has a suggestion on a more elegant way to handle this
05:47:49FromDiscord<emef> https://github.com/emef/nimarrow#typed-tables
05:47:52fn<R2D299> itHub: 7"<No Description>"
05:48:43FromDiscord<emef> I would like to be able call `newTypedBuilter[MyType]()` after running the macro
05:49:24FromDiscord<emef> rather than use this `TypeTag[MyType]()` to work around it
05:49:37FromDiscord<emef> (edit) "`newTypedBuilter[MyType]()`" => "`newTypedBuilder[MyType]()`"
05:52:21FromDiscord<ElegantBeef> declareTypeTable subscribes it somewhere right?
05:54:24FromDiscord<aleclarson> is there any way to insert a statement at a specific index in a statement list?
05:54:37FromDiscord<ElegantBeef> `insert 0, yourNimNode`
05:55:19FromDiscord<ElegantBeef> If it doesnt subscribe presently, you should probably do the subscription in there, and then make `newTypeBuilder` a macro that takes a typedef and checks if it's in the macrocache, if not it throws a compile time error that's helpful
05:55:25FromDiscord<ElegantBeef> @emef ^ that's for you ofc 😄
05:56:14FromDiscord<emef> oh interesting
05:56:26FromDiscord<ElegantBeef> (edit) "typedef" => "typedesc"
05:56:33FromDiscord<emef> what is the macrocache
05:56:37FromDiscord<ElegantBeef> https://nim-lang.github.io/Nim/macrocache.html
05:56:57FromDiscord<ElegantBeef> It's a cross module cache that's designed to hold nimnodes for things like this
05:58:58FromDiscord<emef> I'll look into using this instead, I was hoping there was some way to do this without having to explicitly call a macro to generate those functions
05:59:10FromDiscord<emef> macrocache looks like a good option
05:59:21FromDiscord<ElegantBeef> Oh that's what you were after
05:59:51FromDiscord<ElegantBeef> You actually can probably use the macrocache in the concept
06:00:06FromDiscord<ElegantBeef> Though, that might not work
06:00:44FromDiscord<ElegantBeef> Now has to test that
06:00:53FromDiscord<emef> thanks for the tip
06:00:55FromDiscord<aleclarson> is there a reversed `items` iterator?
06:01:58FromDiscord<ElegantBeef> Doesnt appear so, probably smart to make your own based off the requirements
06:02:10FromDiscord<ElegantBeef> Are you destroying/adding to a collection?
06:03:12FromDiscord<aleclarson> since i'm using `insert` on a NimNode, i decided using `ipairs` works just fine \:)
06:03:25FromDiscord<aleclarson> no, i'm redefining proc params as let stmts
06:04:51FromDiscord<ElegantBeef> ipairs?
06:05:46FromDiscord<aleclarson> whoops, i think that's lua terminology slipping thru \:)
06:06:17FromDiscord<aleclarson> `for index, param in ast.params:` basically
06:06:33FromDiscord<ElegantBeef> Ah
06:06:37FromDiscord<ElegantBeef> so `pairs`
06:06:45FromDiscord<aleclarson> haha ya
06:16:28FromDiscord<ElegantBeef> @emef So it does work! 😛 https://play.nim-lang.org/#ix=3s0D
06:24:06FromDiscord<richard stallmen(crazy GNU guy)> sent a code paste, see https://play.nim-lang.org/#ix=3s0G
06:24:23FromDiscord<ElegantBeef> No trinary operators
06:24:54FromDiscord<ElegantBeef> What are you after?
06:27:48*lucerne quit (Remote host closed the connection)
06:29:52FromDiscord<richard stallmen(crazy GNU guy)> just checking if 3 vars are equal
06:29:54fn<Prestige99> Like a == b == c as a conditional?
06:30:01FromDiscord<richard stallmen(crazy GNU guy)> yes
06:30:55fn<Prestige99> I would just do a == b and b == c
06:32:09FromDiscord<richard stallmen(crazy GNU guy)> but there are 9 variables lol, thats big
06:32:17FromDiscord<richard stallmen(crazy GNU guy)> anyways , thanks
06:32:24FromDiscord<ElegantBeef> well we can do better
06:32:31FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=3s0J 😄
06:32:56FromDiscord<ElegantBeef> But if you're comparing 9 things might be doing something wrong
06:33:41fn<Prestige99> There may be an array iterator that exists that you could do this with, without writing something new
06:33:59FromDiscord<haxscramper> In reply to @richard stallmen(crazy GNU guy) "but there are 9": You can compare tuples
06:34:01FromDiscord<richard stallmen(crazy GNU guy)> sent a code paste, see https://play.nim-lang.org/#ix=3s0K
06:34:19FromDiscord<haxscramper> Or you need all of them equal 5o each other?
06:35:11fn<Prestige99> sequtils.allIt might be a good choice
06:35:21FromDiscord<ElegantBeef> Well if it's a sequence already
06:35:35FromDiscord<ElegantBeef> But this just seems odd
06:35:38FromDiscord<richard stallmen(crazy GNU guy)> like all of them if they are equal
06:35:46FromDiscord<ElegantBeef> Can we see more of the code?
06:35:50FromDiscord<richard stallmen(crazy GNU guy)> ok
06:36:20FromDiscord<richard stallmen(crazy GNU guy)> sent a code paste, see https://play.nim-lang.org/#ix=3s0L
06:37:15FromDiscord<ElegantBeef> Seems like you could use a vector here and that'd make the comparison simpler
06:37:38FromDiscord<richard stallmen(crazy GNU guy)> [nūb here]
06:37:42FromDiscord<ElegantBeef> Eh might be speaking out my arse
06:38:26FromDiscord<ElegantBeef> Dont know why speaking out one's ass invokes germany, but ok 😄
06:50:24FromDiscord<richard stallmen(crazy GNU guy)> sent a code paste, see https://play.nim-lang.org/#ix=3s0N
06:50:50FromDiscord<richard stallmen(crazy GNU guy)> thanks guys
06:53:38*max22- joined #nim
07:00:49*PMunch joined #nim
07:27:25FromDiscord<Rika> There are better ways to do this but you need a lot of transforms
07:27:40FromDiscord<Rika> Might be a good idea to look at other matrix libraries?
07:36:17*Schnouki joined #nim
07:36:26*Oddmonger quit (Changing host)
07:36:26*Oddmonger joined #nim
07:37:03FromDiscord<hamidb80> hey
07:38:01FromDiscord<hamidb80> https://play.nim-lang.org/#ix=3s0V
07:38:41FromDiscord<hamidb80> it says my functions have to be `{.closure.}`
07:40:15FromDiscord<hamidb80> and i don't know what the problem is
07:40:27FromDiscord<hamidb80> i tried to add {.closure.} pragma to my functions
07:41:12FromDiscord<hamidb80> but it introduce me into another error:↵> Error: '.closure' calling convention for top level routines is invalid
07:46:12FromDiscord<hamidb80> new edit↵https://play.nim-lang.org/#ix=3s10
07:47:00FromDiscord<ElegantBeef> `func` presently cannot be used in type defnitions you need to use `proc{.noSideEffect.}`
07:48:56FromDiscord<hamidb80> > Error: type mismatch: got <seq[proc (a: int): int{.noSideEffect, gcsafe, locks: 0.}]> but expected 'seq[proc (t: int): int{.closure, noSideEffect.}]'
07:49:21FromDiscord<ElegantBeef> Yep type defs default to `proc{.closure.}`
07:49:29FromDiscord<ElegantBeef> so you need to do `proc{.nimcall.}`
07:49:41FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=3s11 as such
07:51:00FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual.html#types-procedural-type talked about here
07:51:12FromDiscord<hamidb80> thank u
07:51:23FromDiscord<hamidb80> i should read manual again
07:52:05FromDiscord<hamidb80> (edit) "i should read ... manual" added "the whole"
07:54:14*Vladar joined #nim
07:57:43FromDiscord<Rika> Well I think the confusion is that you need closure to store a proc or to use a proc as a first class member
07:57:55FromDiscord<Rika> I’m pretty sure you don’t
08:00:23FromDiscord<ElegantBeef> You do not need a closure, you just need to annotate with nimcall
08:05:16FromDiscord<hamidb80> can a seq store both `{.nimcall.}` and `{.closure.}`?
08:05:40FromDiscord<hamidb80> or i need to create a object?
08:06:18FromDiscord<hamidb80> type object:↵ case kind:..↵ of closureType:↵ of nimCallTyep
08:06:24FromDiscord<ElegantBeef> Yea you need to box them
08:06:36*wan joined #nim
08:06:38FromDiscord<ElegantBeef> They're not homogenous
08:06:58FromDiscord<hamidb80> tnks
08:07:51FromDiscord<ElegantBeef> It's annoying with many procedures
08:08:30FromDiscord<ElegantBeef> was meaning to test/support this with my object variant generator but forgot to
08:10:32FromDiscord<ElegantBeef> oh yea it works it's just tedious to use
08:14:21*wan quit (Quit: WeeChat 3.2)
09:31:38*arkanoid quit (Quit: WeeChat 2.8)
09:38:26fn<ForumUpdaterBot99> New thread by Neodim: Nim library for stream video processing?, see https://forum.nim-lang.org/t/8199
09:57:42*emery quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
09:58:41*emery joined #nim
10:05:28*max22- quit (Remote host closed the connection)
10:06:01*max22- joined #nim
10:17:08*emery quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
10:17:35*emery joined #nim
10:32:02*neceve joined #nim
10:33:37*xet7 joined #nim
10:53:05FromDiscord<hamidb80> hey
10:53:31FromDiscord<hamidb80> i'm looking for a nimble package for making ascii tables
10:54:42FromDiscord<hamidb80> (edit) "for making" => "to print" | "to printascii tables ... " added "in console"
11:02:33FromDiscord<hamidb80> something like this https://www.npmjs.com/package/cli-table-redemption
11:03:15FromDiscord<hamidb80> found it https://github.com/xmonader/nim-terminaltables
11:03:18fn<R2D299> itHub: 7"terminal tables for nim"
11:23:51FromDiscord<haxscramper> What do you think about `..` also supporting countdown? I wanted to write RFC on that but I guess that's too minor thing for full RFC
11:24:12FromDiscord<haxscramper> I mean change `..` so that would work
11:24:13FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s1T
11:24:34FromDiscord<haxscramper> Or at least give an errors if range elements are reversed instead of silently iterating zero times
11:27:15FromDiscord<vindaar> I agree. The one case where implicit countdown might be problematic is if runtime values are used. It may not be obvious what's going on if accidentally (larger, smaller) pairs are passed
11:28:21FromDiscord<haxscramper> so you mean to introduce `iterator ..(a, b: static[int])`?
11:28:34FromDiscord<haxscramper> that would work with countdowns, otherwise don't change anything
11:32:08FromDiscord<Rika> In reply to @haxscramper "What do you think": some code might rely on `a..b` not counting for a > b
11:32:23FromDiscord<vindaar> a fully static one like you mentioned would be neat anyway (but will probably be refused due to "too much bloat)
11:32:23FromDiscord<vindaar> I mainly just realized that it's not obvious to me what the best solution is, hehe
11:32:23FromDiscord<Zoom> Hate to be that guy, but. @richard stallmen(crazy GNU guy)\: could you please change your nick? It's not very funny and is actually vilifying.
11:32:24FromDiscord<Rika> but i think they should get bug fixes instead
11:32:27FromDiscord<vindaar> yup
11:32:54FromDiscord<vindaar> not sure. In a way it's totally fine behavior, no?
11:33:05FromDiscord<Rika> teeeeechnically yeah
11:33:34FromDiscord<Rika> but it might be unintentional too
11:33:58FromDiscord<Rika> well
11:34:00FromDiscord<Rika> no never mind
11:34:07FromDiscord<Rika> most of the time its intentional yeah
11:34:42FromDiscord<haxscramper> well, I meant this
11:34:43FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s1W
11:34:43FromDiscord<vindaar> what I mean is\: it's quite common to write something like `for a in x`, which by intent is supposed to do nothing if `x` has no length. Under certain circumstances that might be extended to a `for i in x .. y` case instead
11:34:58FromDiscord<haxscramper> since it's too ambiguous
11:35:08FromDiscord<haxscramper> I'm just going to write `...` for myself or something like that
11:35:36FromDiscord<vindaar> for statics I don't see any downside to it, so I'd be in favor of that
11:35:51FromDiscord<vindaar> raising in the runtime case is problematic for the reason I just mentioned
11:36:13FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s1X
11:36:57FromDiscord<Rika> In reply to @vindaar "what I mean is\:": yes i was thinking of that
11:38:43FromDiscord<haxscramper> Cps uses `...`
11:39:50FromDiscord<haxscramper> Also it's in the `system`, so I guess it would be easier to not even think about touching that part
11:40:18FromDiscord<haxscramper> Araq probably has better use for his time then to argue against another crap creeping into `system.nim`
11:40:34FromDiscord<vindaar> yup, that was on my mind too
11:42:29FromDiscord<Zoom> Good day everyone! A little question. I'd like to shift a slice of an array left (doesn't matter what happens with the shifted slots). Does HSlice assignment just makes a dumb copy in a loop? What's the right approach here? `copyMem`/`moveMem`?
11:44:32FromDiscord<vindaar> you mean for an actual `array`? Imo it really depends on what you need. Under certain use cases you may be fine with a `toOpenArray(myArray, N, myArray.len - N)`
11:45:13FromDiscord<Zoom> Nope, I don't need to do anything besides shifting elements. Just wanted to optimize a bit and not do it one by one
11:45:24FromDiscord<Zoom> And yes, I'm talking about actual array
11:47:05FromDiscord<vindaar> So the length of the array should remain unchanged then (that's what you mean by shifted slots don't matter?)
11:47:29FromDiscord<Zoom> Of course, it's an array, the length doesn't change \:)
11:47:52FromDiscord<vindaar> you might want to have a statically different array as a result though ;)
11:48:50FromDiscord<vindaar> I think then you have to copy. An array is just essentially `ptr UncheckedArray[T]`. You need to move those numbers somehow.
11:48:58FromDiscord<Zoom> That's not what I asked though \:) But thanks for double checking my intent
11:49:34FromDiscord<Zoom> That was for the previous msg of yours
11:50:10FromDiscord<Zoom> I think I need moveMem, just was checking if I skipped something that is already there
11:50:45FromDiscord<richard stallmen(crazy GNU guy)> In reply to @Zoom "Hate to be *that*": :[ ok
12:06:02*supakeen quit (Quit: WeeChat 3.2)
12:06:37*supakeen joined #nim
12:08:39FromDiscord<Zoom> To follow up on my question. Is there a reason `a[i..j] = a[i+n..j+n]` couldn't use `moveMem`?
12:23:12*arkurious joined #nim
12:26:10FromDiscord<talaing> sent a code paste, see https://paste.rs/fLF
12:26:19FromDiscord<talaing> (edit) "https://play.nim-lang.org/#ix=3s29" => "https://play.nim-lang.org/#ix=3s28"
12:27:23*PMunch quit (Quit: leaving)
12:27:44FromDiscord<talaing> sent a code paste, see https://play.nim-lang.org/#ix=3s2a
12:29:29FromDiscord<Rika> use a tuple
12:29:49FromDiscord<Rika> `Thread[tuple[a: Socket, b: string]]`
12:30:02FromDiscord<talaing> Thanks, I'll try it out in a moment 🙂
12:30:12FromDiscord<Rika> you're actually technically already using one
12:30:22FromDiscord<Rika> in `thr.createThread(doWork, (socks[i], "HelloWorld"))` you use a tuple
12:30:31FromDiscord<Rika> doWork needs to be changed too
12:30:36FromDiscord<konsumlamm> or just `Thread[(Socket, string)]` if you don't want to name the parameters
12:31:25FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3s2d
12:35:53FromDiscord<talaing> Works perfectly, thanks!
12:41:01*Torro joined #nim
13:10:58FromDiscord<⃟⃟> does the `..` syntax for ranges have a way of specifying a step amount?
13:11:21FromDiscord<arnetheduck> In reply to @haxscramper "**ALLOW `ITERATOR `..`*(A, B:": whatever you end up with, it will ideally be as consistent as is possible with https://github.com/nim-lang/Nim/issues/16492
13:11:48FromDiscord<hugogranstrom> In reply to @⃟⃟ "does the `..` syntax": Don't think so, you have to use the `countup` iterator for steps
13:12:07FromDiscord<hugogranstrom> `for i in countup(start, stop, step)`
13:14:51FromDiscord<⃟⃟> !eval echo countup(1,10)
13:14:53NimBotCompile failed: /usercode/in.nim(1, 13) Error: attempting to call routine: 'countup'
13:16:33FromDiscord<haxscramper> In reply to @arnetheduck "whatever you end up": I think in the end I won't do anything. Maybe write `...` for myself
13:16:43FromDiscord<haxscramper> certainly not going to push it in stdlib
13:17:06FromDiscord<haxscramper> Right now I'm more focused on my nimble RFC, this was almost random idea
13:21:38FromDiscord<hugogranstrom> In reply to @⃟⃟ "!eval echo countup(1,10)": `countup` is an iterator so you can't just print it, you have to loop over it like this:
13:22:00FromDiscord<hugogranstrom> https://play.nim-lang.org/#ix=3s2n
13:22:11FromDiscord<dom96> !eval import sequtils; echo(toSeq(countup(1,10))
13:22:13NimBotCompile failed: /usercode/in.nim(1, 43) Error: expected: ')', but got: '[EOF]'
13:22:24FromDiscord<dom96> !eval import sequtils; echo(toSeq(countup(1,10)))
13:22:26NimBot@[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
13:23:01FromDiscord<⃟⃟> !eval for i in countup(0.5, 10.5): echo i
13:23:03NimBotCompile failed: /playground/nim/lib/system/iterators_1.nim(64, 12) Error: type mismatch: got <float64, Positive>
13:23:11FromDiscord<⃟⃟> ??
13:23:18FromDiscord<hugogranstrom> You used floats
13:23:23FromDiscord<hugogranstrom> It can only handle ints
13:23:42FromDiscord<hugogranstrom> You can't do `0.5 .. 10.5` for that matter either
13:24:32FromDiscord<hugogranstrom> If you want floats you need to either write a custom version yourself or find someone else who has written it
13:25:04FromDiscord<hugogranstrom> `arange` is a good search term used for this when working with floats
13:25:25FromDiscord<⃟⃟> in the documentation it looked like it would handle other types cause i thought it uses generics
13:25:35FromDiscord<hugogranstrom> Link?
13:26:34FromDiscord<⃟⃟> i closed it
13:26:46FromDiscord<hugogranstrom> Ok found it. `T may be any ordinal type, step may only be positive.`
13:27:06FromDiscord<hugogranstrom> It is generic but `T` must be ordinal, and floats are not ordinal
13:27:27FromDiscord<hugogranstrom> You can't say "what is the next real number after 1.0" for example
13:27:45FromDiscord<Rika> ~~technically it exists for floats but that's besides the point~~
13:27:46FromDiscord<⃟⃟> if i made a fraction type would it work with this
13:27:53FromDiscord<Rika> you would have to prove it was ordinal
13:28:03FromDiscord<Rika> or rather it would need to be included in waht nim considers ordinal
13:28:13FromDiscord<Rika> which is not a concept i believe
13:28:14FromDiscord<Rika> so no
13:28:32FromDiscord<hugogranstrom> In reply to @⃟⃟ "if i made a": Probably not, same thing there. There is no "next fraction" either
13:28:45FromDiscord<⃟⃟> there would be
13:29:01FromDiscord<⃟⃟> if the type is exact
13:29:14FromDiscord<hugogranstrom> Which is the next fraction after 234/13
13:29:41FromDiscord<⃟⃟> it depends on the step amount
13:29:54FromDiscord<⃟⃟> 19/1
13:30:00*nisstyre quit (Changing host)
13:30:00*nisstyre joined #nim
13:30:03FromDiscord<⃟⃟> if its a step by 1
13:30:31FromDiscord<arnetheduck> In reply to @dom96 "!eval import sequtils; echo(toSeq(countup(1,10))": this... allocates the entire thing in memory, zero-initializes it, writes the values of the iterator to the seq then walks the seq.
13:30:49FromDiscord<hugogranstrom> In reply to @⃟⃟ "it depends on the": No that's besides the point, if it is ordinal it doesn't matter what step we use. There should be an obvious before and after
13:30:56FromDiscord<hugogranstrom> 1, 2, 3, 4, 5, 6
13:31:01FromDiscord<hugogranstrom> a, b, c, d, e, f
13:31:26FromDiscord<⃟⃟> well i dont know what this thing means exactly
13:31:29FromDiscord<hugogranstrom> Once you have this list you can start taking steps, but you must know the list beforehand
13:31:32FromDiscord<⃟⃟> but why it has this restriction
13:33:32FromDiscord<hugogranstrom> I guess it's because `countup` doesn't just do a loop where it `+= 1`, it rather takes an ordinal and gives you every value between `start` and `stop`. For example if you defined an enum
13:35:13FromDiscord<hugogranstrom> sent a code paste, see https://play.nim-lang.org/#ix=3s2t
13:35:18FromDiscord<hugogranstrom> This will count up from `Left` to `Down`
13:35:44fn<ForumUpdaterBot99> New thread by LemongrabThree: Can a Heap Object Get GC'ed Even Though It's Pointed to??, see https://forum.nim-lang.org/t/8200
13:36:04FromDiscord<⃟⃟> are enum numbers?
13:36:12FromDiscord<Rika> no, theyre ordinals
13:37:08FromDiscord<⃟⃟> also
13:37:27FromDiscord<⃟⃟> the step amount is this "positive" type right
13:37:28FromDiscord<⃟⃟> what is that
13:38:08FromDiscord<hugogranstrom> https://nim-lang.org/docs/system.html#Positive
13:38:21FromDiscord<⃟⃟> wait
13:38:21FromDiscord<hugogranstrom> `Positive = range[1 .. high(int)]` it's just a range
13:38:36FromDiscord<⃟⃟> so the range is generic
13:38:47FromDiscord<⃟⃟> but the step amount is not?
13:39:47FromDiscord<hugogranstrom> Indeed, because we are dealing with ordinals which must have a first element, and one following it and so on.
13:40:19FromDiscord<⃟⃟> but wouldnt a big int also fit that?
13:40:54FromDiscord<hugogranstrom> A bigint would fit that, the problem is telling the compiler that a `bigint` is in fact ordinal
13:41:01FromDiscord<hugogranstrom> Not sure if it's possible
13:41:04*greyrat quit (Quit: Bye)
13:41:49FromDiscord<hugogranstrom> https://nim-lang.org/docs/system.html#Ordinal
13:41:52FromDiscord<⃟⃟> is there a range function that does not have this requirement
13:42:07FromDiscord<Rika> no
13:42:20FromDiscord<Rika> nim is a very "make your own" language pretty much
13:42:32FromDiscord<Rika> or look for it in a 3rd party lib
13:43:09FromDiscord<hugogranstrom> Here's my impl of `arange` if you want to look how it could look: https://github.com/HugoGranstrom/numericalnim/blob/43a1ea309e4b2508dbc62051f16ea9e078f656ff/src/numericalnim/utils.nim#L322
13:44:01*greyrat joined #nim
13:45:04*lucerne joined #nim
13:51:15FromDiscord<⃟⃟> what does the `` mean
13:51:26FromDiscord<⃟⃟> like after a function name
13:51:32FromDiscord<Rika> export
13:51:38FromDiscord<Rika> public access modifier
13:52:07FromDiscord<haxscramper> saem\: the numbers were a little (3x times actually), now I did proper analysis based on full manifests parsing
13:52:15FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s2H
13:52:40FromDiscord<haxscramper> So `bin = ` ('canonical') was specified 362 times
13:54:00FromDiscord<haxscramper> Though I'm still kind of suspicious of some numbers here
13:57:19FromDiscord<dom96> what are you looking for in your analysis?
13:58:39FromDiscord<haxscramper> how different metadata is specified
13:59:00FromDiscord<haxscramper> toplevel/nested in `task`, argument types
13:59:36FromDiscord<dom96> what does canon vs ident vs spec mean?
14:00:02FromDiscord<haxscramper> canonical means "canonical" as described in the RFC - `requires "string literal"`, or `author = "string literal"`
14:00:12FromDiscord<haxscramper> ident means that instead of a string literal identifier was used
14:00:20FromDiscord<haxscramper> `include common.nim`
14:00:29FromDiscord<haxscramper> `version = appVersion`
14:00:52FromDiscord<haxscramper> special means "special" - idk what exactly, just none of the above
14:01:16FromDiscord<haxscramper> for `bin` and other lists canonical means `@["string literal", "string literal"]`
14:01:33FromDiscord<haxscramper> I've seen `namedBin[] = ` in somec packages
14:01:50FromDiscord<haxscramper> Need to account for that one
14:02:18FromDiscord<dom96> cool, looks like there isn't much stopping us from making these values static
14:02:24FromDiscord<dom96> (edit) "values" => "fields"
14:02:35FromDiscord<haxscramper> yes
14:03:12FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s2M
14:03:17FromDiscord<haxscramper> Still does not exactly match with other `requires` metric
14:03:27FromDiscord<dom96> I wonder what the special there is
14:03:38FromDiscord<dom96> nested I'm guessing is `when defined(windows)`
14:03:57FromDiscord<haxscramper> any non-toplevel
14:04:04FromDiscord<haxscramper> but I need to differentialte between these cases
14:04:06FromDiscord<haxscramper> good idea
14:04:12FromDiscord<haxscramper> `when defined()` is a special case
14:18:50FromDiscord<haxscramper> Is it possible to really enforce compile-time evaluation of a procedure where all parameters are `static[]`?
14:19:41FromDiscord<Rika> only when pure
14:19:48*rockcavera joined #nim
14:19:48*rockcavera quit (Changing host)
14:19:48*rockcavera joined #nim
14:20:16FromDiscord<Rika> and if it's recursive, most likely not
14:20:40FromDiscord<Rika> (you can try but you might hit limits or whatsoever)
14:22:25FromDiscord<TennisBowling> does `httpclient` support `async`? I see that `puppy` won't
14:25:07FromDiscord<dom96> it disappoints me that I cannot do this: ``{.emit: staticRead("fonts/nim_compat.h").}``
14:26:19FromDiscord<arnetheduck> In reply to @TennisBowling "does `httpclient` support `async`?": https://forum.nim-lang.org/t/7964#52137 might be useful for that
14:26:47FromDiscord<TennisBowling> arne! thanks
14:28:30*xet7 quit (Remote host closed the connection)
14:29:59FromDiscord<dom96> In reply to @TennisBowling "does `httpclient` support `async`?": yep: https://nim-lang.org/docs/httpclient.html#retrieving-a-website
14:30:27FromDiscord<TennisBowling> and with `httpclient` you need to ship openssl right?
14:30:35FromDiscord<TennisBowling> I see that chronos you don't need to
14:37:06*blackbeard420_ quit (Quit: ZNC 1.8.2 - https://znc.in)
14:37:26*blackbeard420 joined #nim
14:41:40FromDiscord<dom96> In reply to @TennisBowling "and with `httpclient` you": yeah, you will need to unless you statically link openssl
14:42:55*arkanoid joined #nim
14:46:08*ox is now known as oz
14:47:53fn<ForumUpdaterBot99> New thread by NameUndefined: Unable to create a flowVar, see https://forum.nim-lang.org/t/8201
14:49:30FromDiscord<haxscramper> matrix -\> discord bridge sure have a lot of lag
14:49:37FromDiscord<Zoom> Eh, how can I specify an array of Natural? Is there a literal? Need this for tests.
14:49:39FromDiscord<haxscramper> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/861619808536756236): matrix -\> discord bridge sure has a lot of lag
14:50:03FromDiscord<haxscramper> `array[10, Natural]`
14:50:22FromDiscord<haxscramper> There is no `Natural` literal since `1` is already occupied by integer
14:50:24FromDiscord<dom96> Yep, that's why you should come back to Discord 🙂
14:50:35FromDiscord<haxscramper> it has message limit
14:50:51FromDiscord<haxscramper> and it seems like the message simply does not go through
14:51:27FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s2U
14:51:28FromDiscord<Zoom> I meant not only declare, but assign a value without looping
14:51:58FromDiscord<haxscramper> In reply to @dom96 "Yep, that's why you": and I just happened to like matrix
14:52:03FromDiscord<haxscramper> it allows monspaced ui
14:52:49FromDiscord<dom96> what's a "monospaced ui"?
14:53:03FromDiscord<haxscramper> `var ar: array[2, Natural] = [1.Natural, 2]`
14:53:07FromDiscord<haxscramper> monospaced text in UI↵(@dom96)
14:53:20FromDiscord<Zoom> Ah, dot! Thanks!
14:53:50FromDiscord<Zoom> Oops, missed the message to reply to.
14:53:59FromDiscord<haxscramper> and also has open API and several differnt clients↵(@dom96)
14:55:50FromDiscord<dom96> can't you change the font discord uses to a monospace one?
14:55:59FromDiscord<haxscramper> Anyway, I cut out `other` section for the table, but otherwise it seems like `requires` is almost always used on
14:56:17FromDiscord<haxscramper> on toplevel and, inside when it happened 44 times total,
14:56:58FromDiscord<haxscramper> Strangely enough all uses for requires in tasks happened using "special" syntax
14:57:14FromDiscord<haxscramper> But it is almost universally `requires: "pacakge >= 123"`
14:57:47FromDiscord<haxscramper> So I assume large portion of these packages are written by the same person
15:09:47FromDiscord<Rika> discord is only monospace when using code blocks/segments, otherwise no
15:11:44FromDiscord<System64 ~ Flandre Scarlet> Hello! Is SDL2 nice for sound output?
15:12:59FromDiscord<haxscramper> Updated the RFC. I also thought about making top-level completely static, something like a makefile. You write some variables, requires, then declare different tasks or hooks
15:13:16FromDiscord<haxscramper> And task/hook body is mapped to a nimscript code
15:13:55FromDiscord<haxscramper> Almost the same approach as we do now, though with interdependent tasks
15:14:22FromDiscord<haxscramper> Not on this iteration of nimble, but the idea looks nice
15:18:38FromDiscord<dom96> isn't making top-level completely static the real idea proposed? 🙂
15:21:37FromDiscord<haxscramper> Right now you can place some code at top-level and it would run each time package is parsed
15:22:03FromDiscord<haxscramper> And I didn't say anything in the RFC about completely removing this functionality
15:24:04FromDiscord<haxscramper> Also, there are some values, specifically for installation/build purposes that might be set up in the tasks, or collected through some code that iterates over project files
15:24:09FromDiscord<dom96> I see, reading what you wrote to me implied this was the idea
15:24:31FromDiscord<dom96> why not do it this way though?
15:24:38FromDiscord<dom96> is it because of `when defined(windows)`?
15:25:22FromDiscord<haxscramper> Ideally yes
15:25:23FromDiscord<haxscramper> No, that can be evaluated statically. I'm just not sure how much this would break now, I need to get more statis
15:25:24FromDiscord<haxscramper> Stats\
15:25:51FromDiscord<haxscramper> But ultimately, if I get numbers that say it is relatively safe to do so, nothing would really stop us
15:27:01FromDiscord<dom96> I was expecting cargo to have a nice syntax for this, but nah: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies
15:27:10FromDiscord<haxscramper> Saem and Arne might have stronger arguments in favor of fully purging imperative code from top-level, I personally just want to make sure we are not hang up in the intermediate state when something is guaranteed to be static and something is not
15:27:12FromDiscord<dom96> I very much prefer `when ...` even if it means we need to parse it
15:28:47FromDiscord<haxscramper> This is not really hard to implement, I can do a POC implementation when we finalize what we want
15:29:38FromDiscord<dom96> I've also been thinking about purging imperative code from the top-level for a while now
15:30:30FromDiscord<dom96> not needing to depend on the Nim compiler for this would be nice
15:31:22FromDiscord<dom96> (although it's important to note that with `when` the syntax will be complex enough that it won't be trivial for third-party tools to parse it and so in the end they will likely need to depend on Nimble or Nimble's parser anyway)
15:31:32FromDiscord<haxscramper> Yes. Most of the dependency resolution stuff can be done using only PNode parser (we would still have to import compiler/parser, but that is inevitable unless we redo format from scratch)
15:32:01FromDiscord<haxscramper> And when you need to execute code, there is nothing wrong (or nothing can be done really) with using compiler
15:32:42FromDiscord<haxscramper> Yes, this should be exposed in the nimble API↵(@dom96)
15:32:48FromDiscord<haxscramper> Nim library API from nimblepkg
15:33:27FromDiscord<haxscramper> The compiler package is quite good, and it would make sense to have something like this for nimble as well
15:34:40*stkrdknmibalz quit (Quit: WeeChat 3.0.1)
15:34:52FromDiscord<exelotl> In reply to @System64 "Hello! Is SDL2 nice": Yes, if you want to write your own mixer
15:35:11FromDiscord<exelotl> or synth or player or whatever
15:35:17FromDiscord<dom96> In reply to @haxscramper "The compiler package is": for what it's worth, this stuff is already exposed in likely a very similar manner as the compiler API
15:36:41FromDiscord<dom96> the API is pretty good IMO: https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/packageparser.nim#L424
15:41:17FromDiscord<haxscramper> It does not support logging redirection (compiler has structuredErrorHook) and I had to turn off messages twice so it wouldn't log things. Also version type is not semversion but a string which is kind of strange. Otherwise it is pretty usable↵(@dom96)
15:41:32FromDiscord<haxscramper> Had to rewrite resolution from scratch to use it in haxdoc
15:41:40FromDiscord<haxscramper> But I mention this in RFC
15:42:24FromDiscord<haxscramper> And package parser as well, for both types. Don't remember what was wrong with cfg, but for nims I used PNode scanner
15:42:26FromDiscord<System64 ~ Flandre Scarlet> In reply to @exelotl "Yes, if you want": I use the callback to play the music but I still don't have SFX
15:43:34FromDiscord<dom96> good point about logging. Why'd you need to rewrite resolution? also what does haxdoc use nimble's APIs for?
15:44:12FromDiscord<haxscramper> I need to get dependency list, and in nimble it is mixed with download/install stages
15:44:26FromDiscord<haxscramper> And this was not configurable even at code level
15:45:34FromDiscord<dom96> yeah, there isn't really another way to do it in Nimble unfortunately
15:45:50FromDiscord<haxscramper> There should be
15:45:59FromDiscord<haxscramper> With full package registry I mean
15:46:19FromDiscord<dom96> of course
15:51:29FromDiscord<exelotl> In reply to @System64 "I use the callback": if you want music and sfx at the same time you have to mix them yourself - for example introduce a "channel" type where each channel has a source (song or sound effect) and a procedure to mix samples from the source into the output buffer (`output[i] += source[j] channelVol`)
15:56:51FromDiscord<System64 ~ Flandre Scarlet> wow seems complex
15:59:48FromDiscord<System64 ~ Flandre Scarlet> isn't there a risk of clipping?
16:00:37*neceve quit (Ping timeout: 246 seconds)
16:01:07*Torro quit (Quit: leaving)
16:07:18FromDiscord<aleclarson> is there a way to print the entire tree of a `NimNode` for inspection?
16:07:56FromDiscord<aleclarson> oh nvm found it: `astGenRepr`
16:08:37FromDiscord<System64 ~ Flandre Scarlet> > output[i] += source[j] channelVol↵it's for nim right?
16:14:07FromDiscord<exelotl> just psuedocode to demonstrate the concept
16:17:18FromDiscord<exelotl> and yeah clipping is a risk, you're best off mixing into a floating point buffer then multiply my the master volume and apply limiting (clamp between -1.0 and 1.0) to the buffer once everything is mixed
16:17:49*pro joined #nim
16:20:51*stkrdknmibalz joined #nim
16:21:03FromDiscord<System64 ~ Flandre Scarlet> isn't it CPU heavy?
16:27:39FromDiscord<System64 ~ Flandre Scarlet> and the thing is the lib that generates the sound outputs 16-bits sound
16:28:22FromDiscord<leorize> you should use treeRepr as it has less visual clutter↵(@aleclarson)
16:32:16FromDiscord<aleclarson> nice \:)
16:35:51*pro quit (Quit: WeeChat 3.2)
16:37:12*pro joined #nim
16:42:23FromDiscord<exelotl> In reply to @System64 "and the thing is": ah I guess you can mix 16-bit samples into a 32-bit buffer and still be able to multiply and clamp the output when converting it back to 16-bits (assuming SDL is doing 16-bit output)
16:42:45FromDiscord<exelotl> basic mixing likely won't be too CPU heavy
16:43:46FromDiscord<exelotl> if you wanna do some fancy stuff like EQ and reverb, that's when things can start to get intensive
17:01:49FromDiscord<System64 ~ Flandre Scarlet> I'll try that
17:05:15*vicfred joined #nim
17:06:47*vicfred quit (Remote host closed the connection)
17:07:54*vicfred joined #nim
17:22:36*neceve joined #nim
17:26:15FromDiscord<aleclarson> how do i re-export?
17:27:00FromDiscord<aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3s3B
17:27:38FromDiscord<Rika> ? have you tried it?
17:28:09FromDiscord<aleclarson> r u saying my guess is correct? lol
17:28:42FromDiscord<Rika> yes
17:28:47FromDiscord<Rika> im pretty sure that is correct
17:29:44FromDiscord<aleclarson> well that's a nice surprise. intuitive syntax \:)
17:29:56FromDiscord<aleclarson> what about re-exporting an entire module?
17:30:07fn<Prestige99> works the same way
17:30:12fn<Prestige99> import foo export foo
17:30:54FromDiscord<aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3s3F
17:31:14FromDiscord<aleclarson> i get `cannot export ./foo`
17:31:16FromDiscord<Rika> can, just import with relative
17:31:17fn<Prestige99> export by name
17:31:20FromDiscord<Rika> then export without ./
17:31:30fn<Prestige99> import ../foo export foo for example
17:31:51FromDiscord<aleclarson> hmm ok thx!
17:34:59FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s3H
17:35:35FromDiscord<haxscramper> Idk whether it qualifies as "safe to use", but the numbers
17:35:55FromDiscord<haxscramper> Actually wait, I'm being dump with recursive walks again
17:41:35FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s3I
17:41:54FromDiscord<haxscramper> So people define helper procs and import different stuff in toplevel
17:42:24FromDiscord<haxscramper> Defining procs is totally fine, we can handle that easily. Importing things is also not a problem
17:43:35FromDiscord<haxscramper> This 9 procedure calls are `mkDir`
17:43:42FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s3J
17:43:57FromDiscord<haxscramper> That have no business being on toplevel in the first palce
17:44:20FromDiscord<haxscramper> since each time you try to get a package version it would happily make you a directory
17:44:21FromDiscord<haxscramper> somewhere
17:46:37FromDiscord<haxscramper> Seems like we are safe, I will consider updating RFC for completely static toplevel
18:02:58*max22- quit (Ping timeout: 240 seconds)
18:15:33*supakeen quit (Remote host closed the connection)
18:15:57*supakeen joined #nim
18:35:36*nisstyre quit (*.net *.split)
18:35:36*pjz quit (*.net *.split)
18:35:37*flynn quit (*.net *.split)
18:35:38*federico3 quit (*.net *.split)
18:35:38*mst quit (*.net *.split)
18:35:38*beshr quit (*.net *.split)
18:35:38*fn quit (*.net *.split)
18:39:59*nisstyre joined #nim
18:39:59*pjz joined #nim
18:39:59*mst joined #nim
18:39:59*beshr joined #nim
18:39:59*fn joined #nim
18:39:59*flynn joined #nim
18:39:59*federico3 joined #nim
18:40:33*flynn quit (Max SendQ exceeded)
18:41:44*flynn joined #nim
18:48:48FromDiscord<leorize> [haxscramper](https://matrix.to/#/@haxscramper:matrix.org)\: if you want an example of a static-ish language you can look at meson's build description
18:48:55FromDiscord<leorize> it's like python, but turing-incomplete
18:50:08FromDiscord<leorize> btw I noticed the MVS addition, excellent work [haxscramper](https://matrix.to/#/@haxscramper:matrix.org)
19:01:54*max22- joined #nim
19:02:38FromDiscord<haxscramper> Is there any specific feature that you like in meson, [leorize](https://matrix.to/#/@leorize:envs.net) ? I did a quick look, and it seems like it is python-like DSL and maybe some nice things for C build system
19:02:38FromDiscord<haxscramper> But it is a C build system, so it has a lot of complexity to deal with that
19:02:39FromDiscord<haxscramper> Also it has `foreach/if`, variables, function calls
19:02:39FromDiscord<leorize> I'm just thinking if we might want something similar, but for nim
19:06:43FromDiscord<haxscramper> Maybe, but this could be solved by a collection of helper procs
19:06:43FromDiscord<leorize> the meson system is declarative but still retain some expressiveness, which is why I think might be a good middle ground for making the current nimscript stuff safe to evaluate
19:08:05FromDiscord<haxscramper> so you mean replace inner content of the `task` with this?
19:08:05FromDiscord<leorize> no, task is fine the way its working
19:08:12FromDiscord<leorize> for the top-level that is
19:09:33FromDiscord<haxscramper> toplevel can simply be static
19:09:34FromDiscord<haxscramper> nobody needs anything more complex than that
19:09:34FromDiscord<haxscramper> but some values make sense only in runtime context like .. idk, `bin`? The only thing I've seen being set up with some complicated logic
19:09:35FromDiscord<leorize> those are build targets
19:09:46FromDiscord<leorize> they're a different breed
19:11:36FromDiscord<leorize> the only issue I can think of about the static top-level is OS-specific deps, but I believe you have that figured out
19:12:16FromDiscord<Double> can you write discord bots in your language?
19:12:20FromDiscord<haxscramper> yes, `when defined(windows)` is considered static part
19:12:21FromDiscord<leorize> and an annoying part of OS-specific deps is that you also have to know what is the target os, please don't forget that
19:12:40FromDiscord<leorize> for cross-compilation, from linux -\> windows for example
19:13:05FromDiscord<ElegantBeef> In reply to @Double "can you write discord": Are you asking if one can write discord bots in Nim? If so yes
19:14:03FromDiscord<Double> In reply to @ElegantBeef "Are you asking if": Yes
19:14:23FromDiscord<haxscramper> Since I literally not doing that
19:14:23FromDiscord<haxscramper> But right now I just don't have anything to input for cross-compilation dependencies
19:14:23FromDiscord<leorize> I think going all-in on DSL is better than trying to do a static-ish nim
19:14:24FromDiscord<haxscramper> I'm going to write RFC extension for static toplevel
19:14:24FromDiscord<haxscramper> I don't deal with that, so I would need someone's input on that topic
19:14:26FromDiscord<haxscramper> https://github.com/krisppurg/dimscord↵(@Double)
19:14:42FromDiscord<ElegantBeef> Damn matrix just lagged, got like 5 messages at once 😄
19:14:42FromDiscord<haxscramper> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/861686462025039883): Since I'm literally not doing that
19:14:48FromDiscord<leorize> but assuming that you're using the compiler's parser, maybe its not a problem
19:15:01FromDiscord<Double> artificial intelligence bot?
19:15:26FromDiscord<ElegantBeef> No it's a matrix bridge
19:15:45FromDiscord<Double> Interesting
19:15:51FromDiscord<haxscramper> Well, the idea is to have some toplevel static parts that we can reason about easily
19:15:51FromDiscord<leorize> I'm mostly worried about the flexibility of Nim syntax
19:15:51FromDiscord<haxscramper> But then we have to write another interpreter on top of manfiest file?
19:15:52FromDiscord<haxscramper> So far this hasn't been a problem
19:16:01FromDiscord<ElegantBeef> Though leorize would be a lot cooler if he was a AI bot
19:16:19FromDiscord<haxscramper> You mean it is overly flexible?
19:16:19FromDiscord<haxscramper> ...
19:16:20FromDiscord<haxscramper> Or not enough flexibility
19:16:20FromDiscord<leorize> if the top-level looks like nim, works like nim, then people will try to write it like nim
19:16:28FromDiscord<leorize> not an issue if you're importing the compiler to parse it
19:16:48FromDiscord<haxscramper> ah, yes, I use compiler
19:16:49FromDiscord<haxscramper> but on top of that
19:16:49FromDiscord<leorize> but might be an issue for non-compiler
19:16:50FromDiscord<haxscramper> nope
19:17:18FromDiscord<haxscramper> everyone writes `requires "string"`
19:17:21FromDiscord<haxscramper> But of course I will reuse compiler parser
19:17:21FromDiscord<haxscramper> But of course I will reuse `compiler/parser`
19:17:30FromDiscord<leorize> I mean, an issue for 3rd party interop that doesn't use the compiler's parser
19:17:41FromDiscord<leorize> but you can argue that everyone should use the compiler parser, right \:P
19:18:53FromDiscord<haxscramper> well, yes, I don't think we should optimize manifest format for some undefined external tooling that is not written in nim on top of that
19:19:27FromDiscord<haxscramper> if it is written in nim it can either use `compiler/parser` or `nimblepkg/manifestparser`
19:19:28FromDiscord<haxscramper> if you need you can grep for versions
19:19:28FromDiscord<haxscramper> and all that kind of stuff since it is very simple syntax
19:19:28FromDiscord<leorize> maybe that portion of nimble should be split into an external package
19:19:49FromDiscord<leorize> an issue with hybrid packages is that it will always install the binary as well
19:20:04FromDiscord<haxscramper> There certainly should be nimble-CLI and nimble-library, but I don't see any point in having two separate pacakges
19:20:37FromDiscord<leorize> `nimble install nimble` -\> `~/.nimble/bin/nimble` is now the preferred nimble
19:21:15FromDiscord<leorize> which is a slight concern that I have with nimble-cli + nimble-lib in the same package
19:21:24FromDiscord<haxscramper> isn't that `$PATH` ordering issues?
19:21:47FromDiscord<haxscramper> nimble packge is not installed by default, isnt it?
19:21:50FromDiscord<leorize> everyone would have `~/.nimble/bin` above everything else, right?
19:21:55FromDiscord<haxscramper> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/861688326220939267): nimble package is not installed by default, isn't it?
19:22:03FromDiscord<leorize> I'm talking about when you build tools that use nimble library
19:22:13FromDiscord<leorize> then the binary gets installed as well because hybrid packages
19:23:27FromDiscord<haxscramper> That is a problem that is not nimble-only, I don't always want to build/install binary for hybrid packages
19:23:38FromDiscord<haxscramper> So better solution would be to disable binary builds for a package
19:23:59FromDiscord<haxscramper> hmm, actually I was very vague on that part in RFC
19:23:59FromDiscord<leorize> but some hybrid packages depends on their binary got installed, prime example is nimterop
19:24:18FromDiscord<haxscramper> I do mention it, but it is a one-line "quality-of-life" feature
19:24:20FromDiscord<haxscramper> That's why I'm saying to make it optional
19:24:54FromDiscord<haxscramper> `requires "nimterop", binary = off`
19:24:54FromDiscord<haxscramper> but that is underexplained
19:24:55FromDiscord<leorize> I don't think the complexity should be moved to the user
19:26:06FromDiscord<haxscramper> and who will decide package should not be building binary then?
19:26:06FromDiscord<haxscramper> I require something
19:26:06FromDiscord<haxscramper> But not it's binary
19:26:07FromDiscord<haxscramper> therefore I'm saying `binary = off`
19:26:07FromDiscord<haxscramper> who else can make this decision for me?
19:26:31FromDiscord<leorize> what about the case where it doesn't matter, but it happened to be an issue because of global conflicts?
19:27:11FromDiscord<leorize> I'm building a tool that uses the nimble library, so I `requires "nimble"`, since it's what I want
19:27:23FromDiscord<leorize> now the binary got installed and messes the users system up
19:27:34FromDiscord<leorize> I have to dig the docs and use this `binary = off` flag
19:28:01FromDiscord<haxscramper> because you said nimble you want everything, while in reality you meant "everything but binary"
19:28:50FromDiscord<haxscramper> alright, if not `binary = off`, what is the alternative?
19:28:50FromDiscord<haxscramper> Push this to developer and make every hybrid package in two
19:29:14FromDiscord<leorize> make hybrids use a special requires string
19:29:15FromDiscord<SolitudeSF> hybrid packages were a mistake
19:29:31FromDiscord<leorize> they are a `lib` + `cmd` combo, separate them out
19:29:44FromDiscord<leorize> ie `requires "nimble/cmd"`
19:29:52FromDiscord<leorize> `requires "nimble/lib"`
19:30:10FromDiscord<leorize> and ban the `requires "nimble"` syntax
19:30:10FromDiscord<haxscramper> literally the same as binary off
19:30:23FromDiscord<leorize> no, it's different
19:30:42FromDiscord<leorize> communicating the intention is now explicit
19:31:05FromDiscord<haxscramper> and what if hybrid package provides multiple artifacts
19:31:24FromDiscord<haxscramper> I think we can generalize it to package features
19:31:25FromDiscord<haxscramper> again
19:31:42FromDiscord<leorize> I think we should get rid of hybrid
19:31:48FromDiscord<haxscramper> well, your solution is fine, but I don't really understand how `requires "nimble/lib"` is that much more explicit compared to `requires "nimble", binary = off`
19:31:57FromDiscord<haxscramper> But anyway
19:32:06FromDiscord<leorize> because you can't `requires "nimble"`
19:32:36FromDiscord<haxscramper> so there would be a differnt requires syntax for hybrid and non-hybrid packages
19:32:44FromDiscord<haxscramper> and what if I want both
19:32:49FromDiscord<haxscramper> library and binary part
19:32:49FromDiscord<leorize> yes, because hybrids are special
19:33:05FromDiscord<leorize> they are a combo of two packages that pretends to be one
19:33:32FromDiscord<haxscramper> actually `N >= 2` packages
19:33:39FromDiscord<leorize> you get the point
19:33:40FromDiscord<haxscramper> there might be more than one binary
19:34:34FromDiscord<haxscramper> We can generalize it to package features
19:35:29FromDiscord<leorize> I think we should look into what is being solved by hybrid and whether we can solve it in a more structured way
19:35:37FromDiscord<leorize> right, so what is packages features?
19:35:55FromDiscord<haxscramper> hybrid means, "post-install `build` for an artifact"
19:36:38FromDiscord<leorize> I mean, look at the problem that hybrid is trying to solve, not what it is
19:36:47FromDiscord<haxscramper> Way to provide more fine-grained communication between packages. Not just "I need all"
19:37:16FromDiscord<haxscramper> The hybrid trying to solve the problem "I want to build this binary when package is installed, and I also want to provide a library API"
19:37:21FromDiscord<haxscramper> I think
19:37:30FromDiscord<haxscramper> At least that's how I see it for the most part
19:37:43FromDiscord<haxscramper> So it is not really a feature itself
19:37:46FromDiscord<haxscramper> just a shortcut for `after install`
19:38:18FromDiscord<leorize> it's just "I have a binary package but I also want my API to be reusable"
19:38:54FromDiscord<haxscramper> yes, I meant mostly that
19:39:57FromDiscord<leorize> I think package features might create a too complicated matrix with its "default enabled/disabled" states
19:40:51FromDiscord<leorize> what if we think of hybrid as\: a library + one or more binary that is developed together with it?
19:42:21FromDiscord<leorize> so `requires "nimble"` become just the library, and you need `requires "nimble/nimble"` to get the nimble binary, similar to how nimble work with monorepos
19:43:33*rockcavera quit (Remote host closed the connection)
19:43:34*pro quit (Ping timeout: 246 seconds)
19:45:46FromDiscord<@bracketmaster-5a708063d73408ce4> sent a code paste, see https://play.nim-lang.org/#ix=3s4c
19:45:48*rockcavera joined #nim
19:45:48*rockcavera quit (Changing host)
19:45:48*rockcavera joined #nim
19:45:56FromDiscord<@bracketmaster-5a708063d73408ce4> maybe overloading `=` isn't allowed?
19:47:07FromDiscord<leorize> it's called `=copy` now, and its the function called when an object is copied
19:47:22FromDiscord<leorize> it might not be what you think it is
19:48:01FromDiscord<@bracketmaster-5a708063d73408ce4> I guess I can't really do what I was trying to do?
19:48:57FromDiscord<leorize> you can, just make sure `x` takes `var MyType` or `var T`
19:49:42FromDiscord<leorize> but it won't be triggered if a "move" is performed instead of a "copy"
19:50:10FromDiscord<leorize> if you want to hook into all `=`, then a term rewriting macro might do the magic, but they are very experimental
19:51:56FromDiscord<haxscramper> sent a long message, see http://ix.io/3s4e
19:52:49FromDiscord<haxscramper> But I heard you, and `nimble/lib` seems to be a smaller mental overhead compared to really introducing package features
19:53:52FromDiscord<haxscramper> There is a problem of multiple binaries, and [saem](https://matrix.to/#/@saem:matrix.org) mentioned he wants to have `bin: .. <build configuration>` instead of simple list
19:54:04*neceve quit (Ping timeout: 246 seconds)
19:54:39FromDiscord<leorize> the mental model is very important, since it will be what the user interacts with
19:55:07FromDiscord<leorize> I couldn't care less how this stuff would be implemented, but it has to let the user communicates what they truly wants
19:55:12FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s4g
19:55:42FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3s4h
19:56:56FromDiscord<haxscramper> if we would want to introduce package features (which I believe is also very nice feature. But we can postpone it for later) then mental model won't change if we start modeling it in terms of features
19:57:13FromDiscord<haxscramper> but that does not mean we should dump it all at once to the end user, I agree
19:57:22FromDiscord<haxscramper> So for now I will stop on `nimble/lib` part
19:58:20FromDiscord<leorize> I think clear and explicit communication with the tooling will result in the least friction to the user
19:59:14FromDiscord<leorize> the end goal should be\: using a package should not be harder than using the stdlib, and the tooling should not get in the way of the programmer
19:59:31FromDiscord<leorize> speaking about package types, there is one special type that we might want to add\: generated packages
19:59:43FromDiscord<leorize> https://github.com/StefanSalewski/gintro \<- prime example of one
19:59:45fn<R2D299> itHub: 7"High level GObject-Introspection based GTK3/GTK4 bindings for Nim language"
20:00:10FromDiscord<haxscramper> how generated package is different from regular one (except for amount of code maybe)
20:00:31FromDiscord<leorize> this package generates and inject `.nim` into its package folder, of which the content depends on the system state at the time of installation
20:01:03FromDiscord<leorize> I think the cargo equivalent to this is called a proc macro package
20:02:12FromDiscord<haxscramper> How generated package handling is different from regular one with complicated `after install` hook?
20:02:49FromDiscord<leorize> a generated package pins its state to its version + when it is installed
20:03:06FromDiscord<leorize> it's content is unknown to both the developer and the package manager until its installation is finished
20:04:25FromDiscord<haxscramper> I still don't understand how this can be useful
20:04:45FromDiscord<haxscramper> Can you provide an example of an issue this can solve?
20:05:02FromDiscord<leorize> I think I'm getting ahead of myself a bit
20:05:11FromDiscord<System64 ~ Flandre Scarlet> Is it normal my cast doesn't work? https://media.discordapp.net/attachments/371759389889003532/861699245504331847/unknown.png
20:05:40FromDiscord<leorize> we should solve the problem of gintro
20:05:55FromDiscord<haxscramper> In reply to @System64 "Is it normal my": nim cast is `cast[<target type>](<expression>)`
20:06:13FromDiscord<haxscramper> `(ptr cshort)` is unholy abomination
20:06:37FromDiscord<haxscramper> that resulted of a type conversion syntax mixed with UFCS
20:06:37FromDiscord<System64 ~ Flandre Scarlet> that's what the proc wants
20:07:33FromDiscord<haxscramper> It's state is undefined until installed?
20:07:34FromDiscord<haxscramper> I'm not familliar with the package, what problem exactly?
20:07:39FromDiscord<System64 ~ Flandre Scarlet> and can I do myVar.pointer MusicEmu?
20:08:05FromDiscord<haxscramper> https://nim-lang.org/docs/manual.html#statements-and-expressions-type-casts
20:08:17FromDiscord<haxscramper> And `addr`
20:08:35FromDiscord<haxscramper> Read these sections, you need to know them when working with pointers
20:08:35FromDiscord<leorize> the fact that it has to be installed to work, and that it has to inject files into its own package folder
20:10:07FromDiscord<haxscramper> Like, I don't understand the fundamental problem - is it that bad it has to create some additional files? It doesn't matter to `import`, and it doesn't matter to `requires`
20:11:04FromDiscord<leorize> the files its creating is what you are gonna import
20:11:29FromDiscord<haxscramper> yes, and when I `import` them they are prefectly fine
20:12:06FromDiscord<haxscramper> otherwise, if generation failed the installation should've failed as well
20:12:07FromDiscord<haxscramper> Like `{.error.` or raise
20:12:37FromDiscord<haxscramper> It seems like I just fundamentally lost trying to understand what is wrong with that
20:14:21FromDiscord<haxscramper> for `hcparse` I pre-generate code and commit it, but that's because codegen step is so complicated
20:18:29FromDiscord<haxscramper> And build step depends on 20+ packages, including compiler, haxdoc etc., while generated code does not have any dependencies besides some convenience helpers
20:19:31FromDiscord<leorize> in gintro case, its because of gobject introspection
20:19:55FromDiscord<leorize> he is trying to mimic the python's `gi` feeling
20:21:10FromDiscord<leorize> I'm just letting you know about this stuff because it might be an issue for locking, as the package modifies its stored state
20:21:19FromDiscord<leorize> I don't have a solution either
20:21:39FromDiscord<leorize> but the fact that it has to modify its installation state disturbs me
20:21:49FromDiscord<haxscramper> locking is not a problem I'm concerned with, we have this rewrite-the-world PR from status
20:21:51FromDiscord<haxscramper> that implements this
20:24:58FromDiscord<haxscramper> Anyway, I think that's it for me today. Tomorrow I will update RFC to include `nimble/lib` and static toplevel
20:26:56FromDiscord<leorize> alright, o/ [haxscramper](https://matrix.to/#/@haxscramper:matrix.org)
20:29:22*max22- quit (Ping timeout: 240 seconds)
20:29:35*max22- joined #nim
20:38:42fn<ForumUpdaterBot99> New thread by Lbart: How to return an object of a particular type following a value., see https://forum.nim-lang.org/t/8202
20:48:19*max22- quit (Ping timeout: 246 seconds)
20:51:17FromDiscord<System64 ~ Flandre Scarlet> Randoms crashes happens at any moments, but doesn't output a stacktrace, is it normal? https://media.discordapp.net/attachments/371759389889003532/861710847532859462/unknown.png
20:54:53*supakeen quit (Remote host closed the connection)
20:55:17*supakeen joined #nim
20:55:56FromDiscord<ElegantBeef> I wager it's an issue with your interop, are you making a debug build or release/danger?
20:58:09FromDiscord<System64 ~ Flandre Scarlet> just nim compile -r helloworld.nim
20:58:54FromDiscord<System64 ~ Flandre Scarlet> what I can try is running the program without Tilengine
21:08:14FromDiscord<ynfle (ynfle)> sent a code paste, see https://play.nim-lang.org/#ix=3s4F
21:09:42FromDiscord<waghanza (Marwan Rabbâa)> 👋,↵I'm having some issue with `httpbeast`↵`Address family not supported by protocol [OSError]` when running on container
21:10:17FromDiscord<waghanza (Marwan Rabbâa)> anyone has this kind of issue ?
21:10:42FromDiscord<ElegantBeef> ynfle hard to say without the entire code
21:11:07FromDiscord<ElegantBeef> sounds like you're using ipv4/6 with a protocol that doesnt support it, but idk anything about networking 😄
21:11:15FromDiscord<ynfle (ynfle)> sent a code paste, see https://play.nim-lang.org/#ix=3s4G
21:11:16FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/zgU
21:11:37FromDiscord<ElegantBeef> Ah it's saying the range of the descriminant must be `0..X`
21:11:51FromDiscord<waghanza (Marwan Rabbâa)> sent a long message, see http://ix.io/3s4H
21:12:03FromDiscord<ElegantBeef> positive is `1..int.high`
21:12:23FromDiscord<ynfle (ynfle)> So what?
21:12:47FromDiscord<ElegantBeef> It needs to be `case dim 0..4` or w/e
21:12:51FromDiscord<ynfle (ynfle)> I tried with int
21:13:14FromDiscord<ElegantBeef> Or use an enum, either works
21:13:58FromDiscord<ynfle (ynfle)> sent a code paste, see https://play.nim-lang.org/#ix=3s4I
21:14:07FromDiscord<ElegantBeef> you're starting at `2` now instead of `1`
21:14:13FromDiscord<ElegantBeef> the range has to start at 0
21:14:16FromDiscord<ElegantBeef> so `0.. 2`
21:14:18FromDiscord<ElegantBeef> (edit) "`0.. 2`" => "`0..2`"
21:14:28FromDiscord<ynfle (ynfle)> Why does it have to start at 0?
21:14:38FromDiscord<ElegantBeef> Cause it makes life easier i imagine
21:14:50FromDiscord<ElegantBeef> a tagged union that can start at an arbitrary tag is a bit more tedious
21:15:19FromDiscord<ElegantBeef> Not much more tedious but, a bit :d
21:16:10FromDiscord<ynfle (ynfle)> \:shrug\:
21:17:34FromDiscord<waghanza (Marwan Rabbâa)> @ElegantBeef)
21:17:50FromDiscord<waghanza (Marwan Rabbâa)> > ↵> with a protocol that doesnt support it↵> not understood
21:17:56FromDiscord<waghanza (Marwan Rabbâa)> > ↵> with a protocol that doesnt support it↵> not understood
21:17:58FromDiscord<ElegantBeef> Like i said just from the error, i'm speaking out my ass
21:18:36FromDiscord<ynfle (ynfle)> Nice!
21:21:09*max22- joined #nim
21:22:00FromDiscord<exelotl> sent a code paste, see https://paste.rs/Lc5
21:22:28FromDiscord<exelotl> I wouldn't recommend to use brackets like this though. It's not idiomatic Nim at all
21:23:11FromDiscord<System64 ~ Flandre Scarlet> oh alright
21:25:13FromDiscord<exelotl> sent a code paste, see https://paste.rs/0TM
21:25:37FromDiscord<exelotl> (edit) "https://play.nim-lang.org/#ix=3s4N" => "https://play.nim-lang.org/#ix=3s4M"
21:25:48FromDiscord<System64 ~ Flandre Scarlet> Oh I see
21:30:36FromDiscord<leorize> though that one-liner should be solved by `sugar.dup`
21:34:49FromDiscord<System64 ~ Flandre Scarlet> alright so I think the problem is related to Tilengine or due to a conflict between Tilengine and LibGME
21:40:50FromDiscord<dom96> In reply to @waghanza (Marwan Rabbâa) "👋, I'm having some": haven't seen this before, what's the OS? Also can you try just `nim c server.nim` and paste the stack trace?
21:43:09*max22- quit (Quit: Leaving)
21:44:05*Vladar quit (Quit: Leaving)
21:48:36FromDiscord<leorize> if its docker, remember to enable ipv6
21:50:37*Schnouki quit (Ping timeout: 246 seconds)
21:51:57FromDiscord<dom96> alternatively don't use Docker 😄
22:07:11FromDiscord<idf> podman is nice
22:08:17FromDiscord<leorize> +1 for podman
22:31:06FromDiscord<System64 ~ Flandre Scarlet> is it a good idea to execute 2 differents instances of SDL2?
23:53:19*riceman joined #nim
23:54:59ricemanHey all! I'm having some issues with threadpool for a project with a deadline tonight. Keep getting "SIGSEGV: Illegal storage access" crashes while using threadpool to start threads for each line of a file.
23:56:56ricemanI've tried a number of different structures of implementation, different GCs, and even tried sync() every 12 new threads, but it always hangs for ages, then crashes. Any ideas what I might be missing?