<< 23-08-2021 >>

00:25:59nrds<Prestige99> What's the best way to conditionally append to a const string?
00:26:27FromDiscord<Elegantbeef> What do you mean?
00:26:58nrds<Prestige99> like I want my const string to be "foo" but if an env var exists I want to append " - {myvar}"
00:29:41FromDiscord<Elegantbeef> Also conditionally at runtime or CT?
00:29:45FromDiscord<Elegantbeef> could have a `getVar` which does it internally
00:30:44nrds<Prestige99> ct
00:30:58nrds<Prestige99> getVar?
00:31:58FromDiscord<Elegantbeef> so in your example instead of doing `fooConst` you do `getFoo`
00:34:22FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3wHA
00:34:36FromDiscord<Elegantbeef> Oh at CT then you can just do that in a block
00:37:23FromDiscord<Elegantbeef> Something like this https://play.nim-lang.org/#ix=3wHC
00:37:36FromDiscord<Elegantbeef> For documentation on that strdefine https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compileminustime-define-pragmas
00:40:45FromDiscord<Elegantbeef> Lol i used when \:D
00:40:54FromDiscord<Elegantbeef> I'm a numpty that amazes myself sometimes
01:07:17*redj quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:07:58*redj joined #nim
01:21:08*auxym_ joined #nim
01:21:51NimEventerNew Nimble package! oolib - A nimble package which provides user-defined types, procedures, etc..., see https://github.com/Glasses-Neo/OOlib
01:21:53nrds<R2D299> itHub: 7"A nimble package which provides user-defined types, procedures, etc..."
01:52:22FromDiscord<JSONBash> is there a way I can filter a seq of objects by whether a field exists?
01:52:36FromDiscord<impbox [ftsf]> a seq will be of all the same kind of object
01:52:40FromDiscord<impbox [ftsf]> so the fields would be the same
01:52:43FromDiscord<Elegantbeef> "exists"?
01:52:56FromDiscord<impbox [ftsf]> a seq of ref objects to different child types?
01:53:59FromDiscord<JSONBash> ^ exactly sorry
01:54:08FromDiscord<JSONBash> ref object of _
01:54:22FromDiscord<impbox [ftsf]> that would be a runtime type info thing, not sure if that's possible
01:54:32FromDiscord<impbox [ftsf]> you could filter on if it's a subtype of X
01:54:55FromDiscord<Elegantbeef> Well you'd need to store the information of what types have X field
01:55:15FromDiscord<Elegantbeef> Then you could check if the object is of one of those
01:56:22FromDiscord<JSONBash> In reply to @impbox "you could filter on": how would I do that?
01:56:44FromDiscord<Elegantbeef> Well you'd have to make a macro that does it or manually do it
01:58:02FromDiscord<impbox [ftsf]> https://play.nim-lang.org/#ix=3wHS
01:58:53FromDiscord<impbox [ftsf]> but I don't think you could do `filterIt(it.hasField("fieldA"))` for example
01:59:16FromDiscord<impbox [ftsf]> unless you made your own proc that returned whether that was true or not
01:59:18FromDiscord<Elegantbeef> Without making that RTTI nope
01:59:56FromDiscord<Elegantbeef> I dont think there is a mechanism in nim to get all objects that inherit from one
02:01:03FromDiscord<impbox [ftsf]> https://play.nim-lang.org/#ix=3wHW not a nice solution, but you can do this
02:01:26FromDiscord<impbox [ftsf]> i'd suggest rethink what you're trying to do =)
02:01:33FromDiscord<impbox [ftsf]> what are you trying to do?
02:01:37FromDiscord<Elegantbeef> I concur
02:03:01FromDiscord<JSONBash> I tried the examples you provided but tried to access the fieldX of the found items and got an error
02:03:30FromDiscord<Elegantbeef> Well the list is still a liist of `Base`
02:03:36FromDiscord<impbox [ftsf]> what is the error you got?
02:03:38FromDiscord<Elegantbeef> So you'd need to then mapit
02:04:15FromDiscord<Elegantbeef> Filterit removes all that dont fulfil the example, you now need to convert to the type you want
02:04:19FromDiscord<JSONBash> I am using the logging library and trying to filter getHandlers() by type of RollingFileLogger so i can access the file field
02:05:46FromDiscord<JSONBash> https://play.nim-lang.org/#ix=3wHX
02:06:25FromDiscord<Elegantbeef> Is how you'd do it https://play.nim-lang.org/#ix=3wHY
02:06:48FromDiscord<Elegantbeef> filterit doesnt convert the type, it just removes any object that doesnt match the filter
02:07:10FromDiscord<JSONBash> ooooh shit yeah i get that
02:07:34FromDiscord<impbox [ftsf]> baseName isn't exported though
02:07:59FromDiscord<impbox [ftsf]> so you can't access it from outside the logging module
02:08:09FromDiscord<JSONBash> meaning tog e tfile
02:08:13FromDiscord<JSONBash> meaning to get file
02:08:39FromDiscord<JSONBash> but it is still seq[Logger]
02:08:43FromDiscord<JSONBash> which doesn't have file
02:09:00FromDiscord<JSONBash> i need the extra step to convert to seq of FileLogger
02:09:09FromDiscord<impbox [ftsf]> yep, but even then you won't be able to read baseName
02:09:13FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/dn3
02:09:38FromDiscord<Elegantbeef> Oh there is no accessor for the logger file name
02:10:53FromDiscord<JSONBash> In reply to @impbox "yep, but even then": yeah it was a bad example by me, i want to be reading file which is external. Don't want baseName at all
02:11:09FromDiscord<JSONBash> i want the File
02:11:20FromDiscord<Elegantbeef> Anywho same example for inheritance
02:11:37FromDiscord<JSONBash> sent a code paste, see https://play.nim-lang.org/#ix=3wHZ
02:12:05FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3wI0
02:12:23FromDiscord<Elegantbeef> There you go even with RSI have a better answer \:P
02:13:16FromDiscord<impbox [ftsf]> would be nice to have a template that does the conversion if it is of the type
02:14:16FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3wI1
02:14:21FromDiscord<Elegantbeef> Hey it's a few seconds to do, though a case statement macro would be nicer 😛
02:16:14FromDiscord<JSONBash> sent a code paste, see https://play.nim-lang.org/#ix=3wI2
02:16:23FromDiscord<JSONBash> or `onlyIf`
02:17:00FromDiscord<JSONBash> (edit)
02:17:20FromDiscord<JSONBash> same same though
02:18:05FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3wI3
02:18:47FromDiscord<Elegantbeef> Oh oopsie has a case statement macro like that impbox \:D
02:19:02FromDiscord<impbox [ftsf]> oopsie?
02:19:09FromDiscord<Elegantbeef> My OOP library
02:19:51FromDiscord<impbox [ftsf]> cool
02:19:56FromDiscord<Elegantbeef> https://github.com/beef331/oopsie
02:19:58nrds<R2D299> itHub: 7"Nim oop helper module"
02:21:18FromDiscord<JSONBash> is that really OOP though? wouldn't that be more functional and more like lenses?
02:21:29FromDiscord<JSONBash> nah nvm it's an inheritance object
02:21:40FromDiscord<Elegantbeef> Yea it's OOP based \:D
02:21:48*auxym_ quit (Quit: Konversation terminated!)
02:22:06*auxym_ joined #nim
02:22:57FromDiscord<JSONBash> lenses are too academic anyways
02:23:18FromDiscord<JSONBash> (edit) "academic" => "~~academic~~ complicated "
02:29:31*auxym_ quit (Ping timeout: 252 seconds)
02:29:51*arkurious quit (Quit: Leaving)
02:33:12FromDiscord<hamidb80> hey
02:34:23FromDiscord<hamidb80> how can i stream a http request in nim?
02:40:04FromDiscord<Elegantbeef> What do you mean stream it?
02:41:41FromDiscord<impbox [ftsf]> read it as the data comes in before it's fully transferred i'm guessing
02:42:10FromDiscord<impbox [ftsf]> i'm not sure if httpclient supports that
02:42:34FromDiscord<hamidb80> i wanna implement something like `EventSource` in nim
02:43:16FromDiscord<impbox [ftsf]> via client.bodyStream perhaps
02:44:07FromDiscord<impbox [ftsf]> https://github.com/nim-lang/Nim/issues/13856
02:44:41FromDiscord<Elegantbeef> So it's possible just you'd have to do it \:D
02:44:43FromDiscord<impbox [ftsf]> ahh that issue is for sending via streaming not receiving
02:46:36FromDiscord<Elegantbeef> Well event source is server -\> client so if you just want that logic https://forum.nim-lang.org/t/6103#39804 might help
02:46:38FromDiscord<impbox [ftsf]> https://github.com/nim-lang/Nim/issues/7126
02:48:07FromDiscord<impbox [ftsf]> https://forum.nim-lang.org/t/4260 someone's attempt at streaming http
02:51:55FromDiscord<hamidb80> thanks
02:54:33madpropsis it possible to have an enum that can't be nil, that it defaults to one value?
02:55:01madpropsto avoid parameters like: nm: NumMode = NumMode.number
02:58:14FromDiscord<impbox [ftsf]> enums cannot be nil
02:58:23FromDiscord<impbox [ftsf]> and they default to the value at 0
03:05:03madpropsoh
03:09:12FromDiscord<Elegantbeef> The only things that are nilable are `ref T` and pointers
03:09:45madpropsso was {.pure.} removed or not?
03:10:02FromDiscord<Elegantbeef> No it's still here
03:10:39madpropshttps://forum.nim-lang.org/t/4190
03:10:45madpropsi guess that's not relevant then
03:10:52FromDiscord<hamidb80> i dont see `offtopic` channel
03:11:55FromDiscord<Elegantbeef> Pure now is needed for overlap but a pure enum doesnt force it into a namespace
03:12:13FromDiscord<Elegantbeef> If there is no overlap you can use the enum field as is
03:12:20FromDiscord<Elegantbeef> I say overlap but mean ambiguity
03:18:11madpropsI see
03:25:24madpropsif enums default to 0, how can I use them as optional parameters?
03:25:30madpropswith a default value
03:25:41madpropsI think it's failing after I removed the = optional
03:25:47madprops= default *
03:26:08madpropsi think it treats the signature of the proc differently
03:26:54FromDiscord<Elegantbeef> Just like anything else https://play.nim-lang.org/#ix=3wI9
03:27:44madpropsoh huh didn't have to specify it's a Color
03:28:21FromDiscord<Elegantbeef> Well optionals have type inference
03:28:51madpropsnice
04:06:02*supakeen quit (Quit: WeeChat 3.2)
04:06:31*supakeen joined #nim
04:13:32*stkrdknmibalz joined #nim
04:43:59FromDiscord<ordinate> greetings, i come from the land of haskell
04:45:12FromDiscord<Rika> whyd ya move 😛
04:45:30FromDiscord<ordinate> i havent left fully! i just felt the need to learn a 2nd language
04:45:45FromDiscord<ordinate> and am scoping out the field for one with just the right vibe
04:46:06FromDiscord<Rika> ok
04:46:08FromDiscord<Rika> well
04:46:12FromDiscord<Rika> what made you choose nim
04:47:18FromDiscord<ordinate> looked neat, has anonymous functions, very good logo/name combo
04:48:50*federico3 quit (*.net *.split)
04:48:50*def- quit (*.net *.split)
04:48:50*dom96 quit (*.net *.split)
04:48:58*def-- joined #nim
04:49:03FromDiscord<Rika> o ic
04:49:17*federico3 joined #nim
04:49:22*def-- is now known as def-
04:51:04FromDiscord<impbox [ftsf]> Name length to feature ratio is great
04:51:28FromDiscord<Elegantbeef> Wonder if C or D wins that though
04:51:34*dom96 joined #nim
04:51:49FromDiscord<Elegantbeef> Nim needs 3 times as many features as those two
04:52:02FromDiscord<ordinate> thats why c++ is like that
04:54:50madpropsnim is in the one syllable gang tho
04:55:19FromDiscord<Rika> c and d are also one syllable
05:00:49FromDiscord<JSONBash> ZIg is one syllable
05:00:55FromDiscord<JSONBash> and V
05:00:58FromDiscord<ordinate> same with Jot
05:09:53FromDiscord<JSONBash> sequtils provide some functional patterns
05:10:04FromDiscord<JSONBash> same with fusion patternamthcing
05:27:25NimEventerNew thread by Puruneko: The correct way to use 'collect' as a function argument, see https://forum.nim-lang.org/t/8354
06:02:32madpropsweird, why is title() to capitalize every word part of unicode and not strutils?
06:03:54FromDiscord<Elegantbeef> Probably so it's unicode aware
06:04:16FromDiscord<impbox [ftsf]> my guess is that no one uses it, and if you were gonna use it, you'd probably want to be unicode aware
06:05:05FromDiscord<Elegantbeef> You're a bit more active as of late eh? 😀
06:05:21FromDiscord<impbox [ftsf]> aye
06:05:45FromDiscord<Rika> That’s good isn’t it
06:05:59FromDiscord<Elegantbeef> Well depends on how much you like impbox 😛
06:06:15FromDiscord<Rika> If it were you it would be bad
06:06:37FromDiscord<Elegantbeef> Well if i was even more active i'd have a sleeping problem
06:06:49FromDiscord<Rika> Don’t you already have one
06:06:50FromDiscord<impbox [ftsf]> left my job to have more time for my nim stuff, but ended up picking up some extra work, now i'm busier than before
06:06:51FromDiscord<Rika> I sure do
06:07:03FromDiscord<Rika> You LEFT YOUR JOB???
06:07:24FromDiscord<Elegantbeef> Nope i sleep fine 3am - 1pm like a nor... ok i have schedule issue
06:07:27FromDiscord<impbox [ftsf]> yea
06:08:10FromDiscord<Rika> Haha me with the even crazier 3 am to 9 am
06:08:26FromDiscord<impbox [ftsf]> i've picked up an almost normal sleeping schedule these days =\
06:08:51FromDiscord<impbox [ftsf]> what have i become??
06:08:56FromDiscord<Rika> Healthy
06:08:59FromDiscord<Elegantbeef> Was the intent to make a self published game will all that spare time?
06:10:52*PMunch joined #nim
06:14:46FromDiscord<impbox [ftsf]> nah
06:14:53FromDiscord<impbox [ftsf]> done enough of that
06:15:05FromDiscord<impbox [ftsf]> at least commercial games
06:15:08FromDiscord<impbox [ftsf]> just for fun now
06:16:45FromDiscord<impbox [ftsf]> will do a bunch of work on nico and nico+
06:17:12PMunchNico+
06:22:11NimEventerNew Nimble package! bs - A good alternative to Makefile., see https://github.com/maubg-debug/build-sys
06:22:13nrds<R2D299> itHub: 7"A recreation from Makefile made in nim!"
06:23:33FromDiscord<Elegantbeef> Nico++
06:23:34FromDiscord<Elegantbeef> What's nico+ ? 😀
06:23:41FromDiscord<Yardanico> Nim++
06:23:53FromDiscord<treeform> Nim#
06:24:12FromDiscord<impbox [ftsf]> close to nico API but hardware accelerated drawing
06:24:13*sagax quit (Remote host closed the connection)
06:24:23FromDiscord<Elegantbeef> object nim
06:24:23PMunchObjectiveNim
06:24:37FromDiscord<Yardanico> current Nim is SubjectiveNim
06:24:39FromDiscord<Elegantbeef> Ah that's what i figured
06:24:46FromDiscord<treeform> Nimtran 1977
06:25:29PMunchPre-ANSI Nim
06:25:45FromDiscord<Elegantbeef> This is where i jokingly suggest you use truss for it to encourage me to expand it 😛
06:25:58PMunchtruss?
06:26:15FromDiscord<Elegantbeef> My very inprogress start of a framework
06:26:28FromDiscord<impbox [ftsf]> I don't truss myself with it
06:26:35FromDiscord<Rika> Haha
06:26:43FromDiscord<Rika> 😐
06:29:39FromDiscord<Yardanico> rika and morty
06:29:42FromDiscord<Yardanico> I'll see my way out
06:29:43FromDiscord<treeform> In reply to @Elegantbeef "Let's look at treeforms": I am very surprised that array of two floats is slower then object with x, y members which is slower then object of array of two floats. I mainly keep the other representations around to see if other compilers like them better.
06:30:12FromDiscord<treeform> I make sure that all 3 representations keep working and pass the tests
06:30:21*Vladar joined #nim
06:31:41FromDiscord<impbox [ftsf]> by how much?
06:31:59FromDiscord<treeform> like 10-20% based on operations
06:32:10FromDiscord<impbox [ftsf]> interesting
06:35:07FromDiscord<treeform> To see for yourself clone vmath repo and bench_raytracer with the different compile flags.
06:35:30FromDiscord<treeform> See timings here: https://github.com/treeform/vmath#vector-and-matrix-representation-and-benchmarks
06:35:32nrds<R2D299> itHub: 7"Math vector library for graphical things."
06:35:52FromDiscord<treeform> vmathObjArrayBased beats vmathObjBased
06:35:58FromDiscord<treeform> which really beats vmathArrayBased
06:38:04FromDiscord<treeform> I was benching glm vs vmath and glm was faster and I traced it to using object arrays: https://github.com/stavenko/nim-glm/blob/master/glm/vec.nim#L22
06:38:11FromDiscord<treeform> Now we are about the same speed
06:40:03FromDiscord<Elegantbeef> Have you checked with C to see if it also has speed differences on struct vs. array?
06:42:02FromDiscord<treeform> No. I am just lazy. Its very hard to check this kind of stuff small benchmarks.
06:42:15FromDiscord<impbox [ftsf]> yeah wow
06:42:18FromDiscord<treeform> Adding a million floats together just does not cut it.
06:42:33FromDiscord<treeform> You got to run it through a real program like a ray tracer
06:42:42FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3wIr
06:42:50FromDiscord<treeform> yep
06:42:51FromDiscord<impbox [ftsf]> what is your problem arrays
06:43:15FromDiscord<treeform> they can't be copied by the compiler and require memcpy
06:43:44FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=3wIs
06:44:14FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=3wIt
06:45:19FromDiscord<impbox [ftsf]> `raytracer ......................... 84.732 ms 86.204 ms ±1.042 x100`
06:45:36FromDiscord<treeform> In theory vmathObjBased should be same as vmathObjArrayBased, but they are not
06:45:52FromDiscord<treeform> Strange ah?
06:46:40FromDiscord<impbox [ftsf]> very odd indeed
06:47:21FromDiscord<impbox [ftsf]> with a 2 element array you think the compiler would just do what it does with a struct
06:47:41FromDiscord<treeform> well C does not allow =
06:47:45FromDiscord<treeform> struct = struct
06:47:52FromDiscord<treeform> but array = array does not work
06:47:59FromDiscord<treeform> and needs memcpy(array, array)
06:48:05FromDiscord<treeform> so that is why its slower
06:48:13FromDiscord<impbox [ftsf]> yeah but array[0] = array[0]; array[1] = array[1]
06:48:17FromDiscord<treeform> even if array is 8 bytes
06:48:49FromDiscord<treeform> I don't fully understand it though
06:48:56FromDiscord<impbox [ftsf]> i guess you could override the copy operator to just do it elementwise
06:49:20FromDiscord<treeform> see if that makes it faster?
06:49:32FromDiscord<treeform> modify the array branch in vmath
06:50:25FromDiscord<treeform> if obj of array is faster
06:50:42FromDiscord<treeform> that means all nim's objects that have members of one type would be faster when "arrayed"
06:51:21FromDiscord<treeform> can nim compiler just do that then?
07:13:32madprops.toTable([: string, tuple[uint8, uint8, uint8]])
07:13:46madpropsam I supposed to add 'uint8 to every int in this big table?
07:15:02FromDiscord<Elegantbeef> or `u8` yes
07:15:17madpropsany way around it?
07:16:19madpropsmaybe I'll try making the tuples an object
07:16:44FromDiscord<Elegantbeef> Well the table constructor needs better inference
07:16:53FromDiscord<Elegantbeef> But that requires someone smart enough to add it in
07:19:10*max22- joined #nim
07:51:46*sagax joined #nim
08:04:17NimEventerNew Nimble package! commandant - Commandant is a simple to use library for parsing command line arguments. Commandant is ideal for writing terminal applications, with support for flags, options, subcommands, and custom exit options., see https://github.com/casey-SK/commandant
08:04:18NimEventerNew Nimble package! algebraicdatas - This module provides the feature of algebraic data type and its associated method, see https://github.com/chocobo333/AlgebraicDataTypes
08:04:18NimEventerNew Nimble package! numToWord - Convert numbers to words, see https://github.com/thisago/numToWord
08:04:20nrds<R2D299> itHub: 7"Take command of your command line in Nim"
08:04:20nrds<R2D299> itHub: 7"<No Description>"
08:04:21nrds<R2D299> itHub: 7"Convert numbers to words"
08:04:25FromDiscord<Yardanico> triple kill
08:19:26arkanoidI need some help to get unstuck in my nim project about building xml schema data binding
08:20:12arkanoidI think I'm not applying the right parsing pattern here and I'm getting graph loops and things like that
08:20:15FromDiscord<haxscramper> In reply to @NimEventer "New Nimble package! algebraicdatas": I guess having pattern matching in fusion won't stop people from making own libraries with nearly identical functionality
08:20:19arkanoidI need a smarter way
08:20:33emeryXML and smart don't mix
08:20:38arkanoid:-/
08:20:59arkanoidyeah, it sucks. I didn't know about how messy xml schemas was before beginning
08:21:09emeryi regret how much time I've spent fight with xml
08:21:17FromDiscord<haxscramper> Though I can relate to the "internal implementation" todo in this package
08:22:07arkanoidemery: I fear I'm on same path. I feel like not up-to-the-task
08:23:29FromDiscord<Rika> Is anyone, really
08:23:59arkanoidbut even if I've been following the official schema documentation, it's the parsing part that's weird
08:25:24arkanoidI'm thinking about using existing xml processors, but there's just xml->java and xml->C#. There's also a xml->c data binder but it's gpl and I prefer mit
09:17:25*xet7 quit (Remote host closed the connection)
09:18:22*xet7 joined #nim
09:54:09FromDiscord<dom96> In reply to @haxscramper "I guess having pattern": things in the stdlib also don't stop people making their own versions of things
10:08:08NimEventerNew thread by FabienPRI: WriteLine end the line by \n Why not by \p (platform specific), see https://forum.nim-lang.org/t/8355
10:51:52FromDiscord<haxscramper> In reply to @dom96 "things in the stdlib": It really just means "official" realization is bad enough that someone is willing to reimplement it from scratch
10:52:01FromDiscord<haxscramper> Or they didn't know about official one
11:14:33*jjido joined #nim
11:14:51FromDiscord<Yardanico> In reply to @haxscramper "Or they didn't know": in case of your pattern matching it's this one most probably :P
11:16:15*audiophile_ joined #nim
11:33:50FromDiscord<linux user> why is resolving a array index and overloading gc unsafe
11:34:08FromDiscord<linux user> do(a[1])
11:34:32FromDiscord<Rika> ?
11:34:35FromDiscord<Rika> needs more details
11:35:55FromDiscord<linux user> a is a seq[string]
11:36:06FromDiscord<linux user> do is a typical generic proc
11:36:19FromDiscord<linux user> and i use verbosity:3 to compile
11:36:30FromDiscord<linux user> it said GcUnsafe
11:44:51*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
12:06:02*supakeen quit (Quit: WeeChat 3.2)
12:06:30*supakeen joined #nim
12:12:21FromDiscord<konsumlamm> just show the code, this is not enough information
12:20:40*stkrdknmibalz quit (Ping timeout: 240 seconds)
12:32:47*max22- quit (Ping timeout: 240 seconds)
12:48:17*max22- joined #nim
12:57:43arkanoidError: recursion is not supported in iterators: 'walkTree' :..-(
13:01:35*arkurious joined #nim
13:02:10*kayabaNerve_ joined #nim
13:04:13*kayabaNerve quit (Ping timeout: 252 seconds)
13:08:41FromDiscord<konsumlamm> i think the issues is that recursion is not supported in iterators
13:08:49FromDiscord<konsumlamm> (edit) "issues" => "issue"
13:09:15FromDiscord<konsumlamm> maybe using closure iterators (i.e. adding a `{.closure.}` pragma) works
13:17:32FromDiscord<xflywind> Is the deprecation rule not recommended to use? I cannot find its docs
13:17:42FromDiscord<xflywind> Like {.deprecated: [fooA: fooX].}
13:19:19FromDiscord<xflywind> Its usage can be found in `std/mysql` and `libffi.nim`
13:19:38*flynn quit (Read error: Connection reset by peer)
13:20:45*flynn joined #nim
13:33:34arkanoidwithout recursive iterator, how would you walk a tree bottom up (leaf to root?)
13:36:54arkanoidwait, got nice answer https://forum.nim-lang.org/t/5697
13:37:34FromDiscord<Unaimend> sent a code paste, see https://play.nim-lang.org/#ix=3wK2
13:37:48FromDiscord<Unaimend> (edit) "https://play.nim-lang.org/#ix=3wK2" => "https://paste.rs/j4r"
13:38:31FromDiscord<Rika> `for x in seq.mitems`
13:39:02FromDiscord<Unaimend> ahh omg, thank you
13:39:03FromDiscord<Rika> m in mitems means mutable
13:39:10FromDiscord<Unaimend> totally forgot about that one
13:39:15FromDiscord<Rika> be careful on naming your thing `seq` btw
13:39:27FromDiscord<Unaimend> was just for exemplary purpose
13:39:30FromDiscord<Rika> okay
13:40:15FromDiscord<Rika> im not really a fan of the `items` iterator being implicit but not the others but oh well, it is a limitation of inference i assume
13:40:42FromDiscord<Rika> others -> mutables
13:43:32FromDiscord<Unaimend> I have trouble finding the doc entry for mitem?
13:43:51FromDiscord<Unaimend> nvm
13:44:05FromDiscord<Recruit_main707> its in the iterators page isnt it?
13:44:28FromDiscord<Unaimend> yes
13:44:37FromDiscord<Unaimend> I was looking at sequtils
13:45:17FromDiscord<Unaimend> I saw that list has its one ↵and assumed it would be the same for seq https://media.discordapp.net/attachments/371759389889003532/879360646234382389/unknown.png
13:45:23FromDiscord<Unaimend> (edit) removed "was looking at sequtils"
13:45:35FromDiscord<Unaimend> (edit) "one" => "own"
13:46:31FromDiscord<Rika> its part of openarray i would assume
13:47:40FromDiscord<Unaimend> Seems I "broke" the nim compiler 😂 https://media.discordapp.net/attachments/371759389889003532/879361245873053696/unknown.png
13:48:19FromDiscord<Unaimend> My own string view works like a dream ... not 😭
13:48:35FromDiscord<Rika> that doesnt look like a nim compiler issue
13:48:56FromDiscord<Rika> the error reads like "expected -> but got ->"
13:49:37FromDiscord<Unaimend> yes yes, but I wrote could which should not pass nim code gen
13:49:45FromDiscord<Unaimend> (edit) removed "yes"
13:50:39FromDiscord<Unaimend> I am sure when the c compiler emits a error there is a missing check in the nim compiler
14:16:01*PMunch quit (Quit: Leaving)
14:16:24*auxym_ joined #nim
14:40:19FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3wKg
14:41:07FromDiscord<nekotohondana (nekotohondana)> @sn0re\:matrix.code0.xyz yes
14:42:07FromDiscord<enthus1ast> it should make sure that it does not get stuck in a loop, though
14:43:04FromDiscord<enthus1ast> so an artificial break condition should be applied
14:47:37FromDiscord<nekotohondana (nekotohondana)> @sn0re\:matrix.code0.xyz nice!
14:52:01*auxym_ quit (Ping timeout: 252 seconds)
14:53:27*NeoCron joined #nim
14:57:14FromDiscord<nekotohondana (nekotohondana)> @sn0re\:matrix.code0.xyz than you.
14:59:43*audiophile_ quit (Quit: Default Quit Message)
15:17:52*auxym_ joined #nim
15:20:35FromDiscord<nekotohondana (nekotohondana)> @sn0re\:matrix.code0.xyz thank you, that code must-have in http-request.mybe I always use it
15:31:59arkanoidI have "let myseq = @[Foo(bar: true)]". How can I pass myseq[0] to "proc myproc(arg: var Foo) = arg.bar = false" without making a copy so that the resulting value of myseq.foo is false?
15:34:40FromDiscord<Rika> simply `[]` should work
15:35:28*beshr quit (Ping timeout: 252 seconds)
15:36:28FromDiscord<leorize> then `myseq[0]`
15:37:01FromDiscord<leorize> `var T` never copies
15:40:31arkanoidthanks, I was just confused by iteraring the seq with "for x in myseq"
15:40:45arkanoidthe items iterator actually forces immutable
15:40:57arkanoiditerating using [] works
15:41:23arkanoidwell, also mitems
15:41:25FromDiscord<Rika> `mitems`
15:45:09*auxym_ quit (Ping timeout: 250 seconds)
15:46:48NimEventerNew thread by Alexeypetrushin: How can I export module by name?, see https://forum.nim-lang.org/t/8356
15:52:49FromDiscord<dankrad> Does anyone know if this is possible?
15:53:26FromDiscord<leorize> can you link your PR?
15:53:40FromDiscord<leorize> the standard practice is to close then reopen the PR
15:56:53FromDiscord<dankrad> https://github.com/nim-lang/Nim/pull/18732
15:58:12FromDiscord<dankrad> it failed with a timeout while processing this test\: tests/vm/tslow\_tables.nim c
16:00:05*auxym_ joined #nim
16:07:10*stkrdknmibalz joined #nim
16:10:24*xet7 quit (Remote host closed the connection)
16:11:28*xet7 joined #nim
16:13:25*auxym_ quit (Ping timeout: 252 seconds)
16:14:35FromDiscord<leorize> I triggered a re-run for you
16:18:17*NeoCron quit (Remote host closed the connection)
16:23:59*auxym_ joined #nim
16:26:02FromDiscord<dankrad> thank you!
16:45:47FromDiscord<trenta3> Hi! I just got started with Nim. What is the nim/nimble command to create a C source file of my binary?
16:47:11FromDiscord<undersquire> you just compile it normall and check your nim cache folder for the C files
16:49:58FromDiscord<Rika> please note that the c file emitted is not meant to be human readable
16:50:13FromDiscord<trenta3> In reply to @undersquire "you just compile it": I want to generate C source files for another OS and later compile those under the other OS where header files are there
16:50:46FromDiscord<trenta3> So obviously I cannot compile it normally since it wouldn't build under my OS
16:50:46FromDiscord<undersquire> In reply to @Rika "please note that the": will they ever improve its readability?
16:50:54FromDiscord<undersquire> or is that not a concern
16:51:08FromDiscord<undersquire> In reply to @trenta3 "I want to generate": you should be able to just compile those C sources anywhere
16:51:55FromDiscord<konsumlamm> In reply to @undersquire "or is that not": it's not really a concern, since they're not supposed to be readable in the first place
16:52:46FromDiscord<undersquire> yeah makes sense, as long as you were just working with the nim portion and didnt care about modifying the generated C sources
16:53:48FromDiscord<Rika> which is a majority of the users
16:54:22FromDiscord<undersquire> yeah
16:54:27FromDiscord<trenta3> In reply to @undersquire "you should be able": Thanks. I will try
16:54:47FromDiscord<undersquire> u will need nim installed on those systems since the C sources are using the nim headers
17:02:00FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3wL6
17:02:17*auxym_ quit (Ping timeout: 250 seconds)
17:04:35FromDiscord<dankrad> It failed at the same test again. Did I miss something? Or is this a new added test which currently always fails?
17:07:55FromDiscord<dankrad> Looks like this test isn't newly added. But I don't get why it's failing.
17:08:15FromDiscord<leorize> it's a Nim VM test that's very sensitive to performance changes
17:08:46FromDiscord<leorize> this includes the CI instance that runs the test, if it's a VM and the CPU is borrowed by an another VM for awhile, then that test can fail
17:08:50FromDiscord<leorize> it's pretty annoying tbh
17:09:24FromDiscord<Rika> is there any way to fix that issue
17:09:34FromDiscord<dankrad> means in my case that it just failed again? that it doesn't have anything to do with my pr?
17:10:18FromDiscord<leorize> yea, usually it has little to do with your PR, unless you modified the compiler vm
17:11:55FromDiscord<dankrad> well, i didn't. I just modified in `macros` the `customPragmaNode` function.
17:14:08*rockcavera joined #nim
17:14:08*rockcavera quit (Changing host)
17:14:08*rockcavera joined #nim
17:14:50FromDiscord<dankrad> Can we run it again, or do we need to wait until all other pr's are done?
17:15:19FromDiscord<leorize> sure, but let me review this first
17:15:34FromDiscord<dankrad> alright
17:16:40FromDiscord<leorize> damn, this function is a handful
17:19:35FromDiscord<cnerd> sent a code paste, see https://paste.rs/Mr6
17:21:33FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3wLc
17:21:50FromDiscord<Rika> not for c interop
17:22:05FromDiscord<Rika> needs some pragmas for c interop (which i dont remember)
17:25:41FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3wLd
17:26:07FromDiscord<leorize> please add `{.cdecl.}` or `{.nodecl.}` into that proc type detinition
17:26:12FromDiscord<leorize> definition\
17:34:28FromDiscord<retkid> do you think jnr-ffi will work with jnim for full interopability
17:34:30FromDiscord<retkid> (edit) "interopability" => "interoperability"
17:34:35FromDiscord<Rika> you can try]
17:34:42FromDiscord<Rika> unless youre asking because its hard to try
17:34:50FromDiscord<retkid> its not hard to try
17:34:55FromDiscord<retkid> in my head it should work
17:35:01FromDiscord<retkid> im just imagining the compile errors
17:35:03FromDiscord<retkid> :\
17:37:25FromDiscord<cnerd> sent a code paste, see https://play.nim-lang.org/#ix=3wLj
17:38:01FromDiscord<no name fits> What's the "normal" way to have different code in a debug and a release build with Nim?
17:39:48FromDiscord<dankrad> sent a code paste, see https://play.nim-lang.org/#ix=3wLk
17:41:40FromDiscord<leorize> [dankrad](https://matrix.to/#/@dankrad:matrix.code0.xyz)\: posted a review
17:57:03*auxym_ joined #nim
18:00:03FromDiscord<dankrad> ah, ok. I'll check it out.
18:00:12FromDiscord<PizzaOfYeet> can discord bots be wrote in nim?
18:00:16FromDiscord<PizzaOfYeet> that could be cool
18:00:31FromDiscord<Rika> why not
18:00:32FromDiscord<Rika> yes
18:00:48FromDiscord<PizzaOfYeet> does it have a library for it or would i have to write my own 😢
18:00:53FromDiscord<Rika> dimscord
18:01:14FromDiscord<PizzaOfYeet> ty
18:02:24FromDiscord<PizzaOfYeet> i want to learn nim is there and good yt vids youd recomend?
18:02:54FromDiscord<Rika> i dont use youtube to learn programming languages
18:03:15FromDiscord<PizzaOfYeet> how do you learn?
18:05:05nrds<Prestige99> @PizzaOfYeet https://www.youtube.com/user/kiloneie has good videos
18:05:20nrds<Prestige99> But I mostly just look at https://nim-lang.org/documentation.html to learn
18:05:32FromDiscord<Rika> In reply to @PizzaOfYeet "how do you learn?": i port a project or read the documentation
18:05:40FromDiscord<PizzaOfYeet> ok
18:13:38arkanoidI've just met this weird compilation error "error: ‘colonenv_’ undeclared (first use in this function); did you mean ‘colonenv__2’? asgnRef((void**) (&(*colonenv_).resultSeq1), newSeq__Mf0PyLnsweB88symbTEJMQ(((NI) 0)));"
18:14:05arkanoidis this a compiler bug worth posting on github?
18:18:25FromDiscord<haxscramper> C codegen errors are always compiler bugs unless you do .emit.
18:21:17arkanoidlet's see if it happens with dev, otherwise I'll bake a minimal version
18:22:02arkanoidyeah it happens in devel too
18:24:31*audiophile_ joined #nim
18:31:15NimEventerNew thread by Apardes: Nested macro expansion order, see https://forum.nim-lang.org/t/8357
18:36:38*auxym_ quit (Ping timeout: 250 seconds)
18:47:46arkanoidhaxscramper: https://github.com/nim-lang/Nim/issues/18739
18:52:08FromDiscord<Yardanico> @arkanoid isn't it a duplicate of https://github.com/nim-lang/Nim/issues/18536 ?
18:52:23FromDiscord<Yardanico> actually even https://github.com/nim-lang/Nim/issues/14165
18:53:13FromDiscord<haxscramper> https://wandbox.org/permlink/IEPr1Tk86U1xp5wR
18:53:21FromDiscord<haxscramper> and try to minimize code in issues
18:54:02FromDiscord<Yardanico> @haxscramper it's even simpler than that, see the linked issues
18:54:12FromDiscord<haxscramper> I just randomly deleted code
18:54:19FromDiscord<Yardanico> :P
18:55:18FromDiscord<haxscramper> although this
18:55:24FromDiscord<haxscramper> does not trigger it
18:55:25FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wLy
18:55:50arkanoidYardanico: you're right, my fault. I searched 'colonenv__' but nothing resulted, but now fear I did something wrong
18:55:57FromDiscord<Yardanico> colonenv with one underscore :)
18:56:03FromDiscord<haxscramper> but it is a "inline iterator with innner proc called twice"
18:56:22FromDiscord<haxscramper> (edit) "but" => "But" | "a" => "an"
18:56:54*audiophile joined #nim
18:57:25arkanoidhaxscramper, are you sure that limiting code in working example is a good thing for an issue? I've been told more than once that giving context is better as it points to the intended direction of the programmer and helps devs to focus on what users are trying to do
18:57:52FromDiscord<Yardanico> well, it's good to minimize the code as long as you get the same crash/c compiler error
18:58:06FromDiscord<Yardanico> because in virtually every case it's some small part of the code triggering the issue
18:58:30arkanoidYardanico: when I do that, I generally get "but what was you trying to achieve?"
18:58:31FromDiscord<haxscramper> if you have large piece of code it makes harder to pinpoint what causes it exactly
18:58:48FromDiscord<Yardanico> In reply to @arkanoid "<@177365113899057152>: when I do": weird, haven't seen that response in Nim issues
18:59:10FromDiscord<haxscramper> Smaller piece of code is also easier to understand
18:59:14FromDiscord<Yardanico> when asking in real time chats - yes, you might get that response, but the smaller the code to reproduce the issue is, the better for issues
18:59:16arkanoidyeah but I've already minimized. It's an extrapolation from a 700loc file
18:59:35FromDiscord<haxscramper> I cut it down twice by randomly deleting code so ...
18:59:48FromDiscord<Yardanico> yeah, that's what I was doing last year when testing random libs with ARC :P
18:59:50arkanoidI'll try to reduce even more than when posting on github, sorry for the verbosity and thanks for the hints
18:59:54FromDiscord<haxscramper> Hit it until it works and go back two steps
19:00:35*audiophile_ quit (Ping timeout: 250 seconds)
19:00:36*audiophile is now known as audiophile_
19:01:05arkanoidyeah I know to reduce to barebone. I just left it in "working as intended" condition to expose intended purpose. Well, got it
19:02:39FromDiscord<leorize> reduce if you can but don't stress yourself too much on it
19:21:25*supakeen quit (Remote host closed the connection)
19:21:49*supakeen joined #nim
19:29:08FromDiscord<haxscramper> [enthus1ast](https://matrix.to/#/@sn0re:matrix.code0.xyz)\: I finally managed to test nimja - everything works just as I expected, and it looks it would be the thing I use for haxdoc and all my projects that require any sort of file templating.
19:35:35FromDiscord<enthus1ast> Nice! I was also working on the runtime evaluation (dynamicAgain branch), which kinda works, but it cannot yet put values into the vm. And I'm unsure if both models can work the same, I don't know if I can (and should) feed all visible variables and procs into the vm.
19:37:03FromDiscord<haxscramper> I think it would be better to allow explicitly listing "captured" variables, for basic interop support
19:37:12FromDiscord<enthus1ast> Yes
19:37:14FromDiscord<haxscramper> But not necessarily all.
19:37:31FromDiscord<haxscramper> Although I don't know what would be the best approach for that either
19:38:02FromDiscord<haxscramper> Need more use cases& requirements and then expected behavior can be formulated
19:38:21FromDiscord<enthus1ast> Then maybe, I should look for alternatives to make the development workflow more pleasant, maybe automatic shared object compilation/loading/binding
19:39:28FromDiscord<RattleyCooper> Anybody know what compile times are like on a raspberry pi 4? My computer totally died Saturday night 😢 I can't afford to fix it atm so I might fallback to using the rpi 4 and am curious as to what I can expect
19:39:43FromDiscord<enthus1ast> At least the "I design my site, an play with values" usecase would be more pleasant
19:44:20FromDiscord<enthus1ast> But I'll play with different possibilities
19:45:02*auxym_ joined #nim
19:45:40FromDiscord<sheerluck> May I `import fusion/matching` or is it forbidden for me? 😦 ↵`Error: cannot open file: fusion/matching`
19:48:38FromDiscord<haxscramper> do you have it installed?
19:48:58FromDiscord<haxscramper> fusion has to be installed like a separate package, it is not bundle with nim
19:55:58FromDiscord<sheerluck> Thank you
20:04:02FromDiscord<unsafe> is this a bug or I'm doing something wrong? windows 10, fresh install, nim works fine but nimble doesn't https://media.discordapp.net/attachments/371759389889003532/879455960681287740/unknown.png
20:06:04FromDiscord<5271> helo
20:06:22FromDiscord<5271> i have one quite dumb question↵how do i update nim to a never version? <w>
20:06:58FromDiscord<unsafe> nimble update stable, i guess
20:07:05FromDiscord<unsafe> or no choosenim update stable
20:09:42FromDiscord<5271> uhh↵when i type nimble update stable it tells me `Error: Package list with the specified name not found.`
20:10:55FromDiscord<unsafe> choosenim should be right
20:11:03FromDiscord<unsafe> nimble was my mistake ;-D
20:11:10FromDiscord<5271> hmm↵okay
20:18:07*auxym_ quit (Ping timeout: 240 seconds)
20:34:05*rockcavera quit (Remote host closed the connection)
20:37:09FromDiscord<unsafe> In reply to @unsafe "is this a bug": ok, that was default windows antivirus, he doesn't really like nim
20:37:11*Vladar quit (Quit: Leaving)
21:02:06*audiophile_ quit (Quit: Default Quit Message)
21:06:04FromDiscord<gerwy> well so basically i think that module i use for my little script use something that is for x86 and not arm↵is there any hope for me to compile it on arm?
21:10:53FromDiscord<gerwy> or it is something wrong with my linker hmm
21:17:53*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
21:18:26FromDiscord<gerwy> ugh so basically arm-gcc cannot find -lz i have no idea why
21:26:27FromDiscord<5271> In reply to @unsafe "choosenim should be right": i did what u said and some other linux stuff and now it works
21:26:33FromDiscord<5271> so thank u :3
21:37:03*jjido joined #nim
21:56:51FromDiscord<Canelhas> hey folks, how to deal with this? https://media.discordapp.net/attachments/371759389889003532/879484359340589166/unknown.png
21:56:57FromDiscord<Canelhas> this is the error https://media.discordapp.net/attachments/371759389889003532/879484382220537856/unknown.png
21:58:53FromDiscord<Canelhas> this seems to be caused by the fact that i'm mutating the reference inside parsePrefixExpression, which conflicts with the returning type. ↵↵However, the return is of type Nud, which is declared as a var type https://media.discordapp.net/attachments/371759389889003532/879484866054475806/unknown.png
22:29:01*max22- quit (Quit: Leaving)
23:04:58*Freneticks quit (Ping timeout: 240 seconds)
23:19:41*flynn quit (Read error: Connection reset by peer)
23:20:48*flynn joined #nim
23:26:07arkanoidis it possible to use template "body" arg to replace only the "of" cases of case statement that lives between the "case XXX" and "else: foo" ?
23:28:24FromDiscord<Elegantbeef> Without a more elaborate code example i'm going to say no
23:28:46arkanoidI think I've found an old forum post about same question https://forum.nim-lang.org/t/2142
23:29:05arkanoidI see op used compile time proc to inject "of" cases
23:31:01*Freneticks joined #nim
23:31:10arkanoidany news on this? I've been using nim for less than 6 months, can't look back in time looking for differences
23:34:25*auxym_ joined #nim
23:36:04*def- quit (Quit: -)
23:36:15*def- joined #nim
23:56:06FromDiscord<⃟⃟> is there an official gui lib?
23:57:35*auxym_ quit (Read error: No route to host)
23:57:56*auxym_ joined #nim
23:58:49FromDiscord<Elegantbeef> Nope there are bindings for most of the gui libraries and a few pure nim implementations but no "official"