<< 26-10-2022 >>

01:26:42*xet7 joined #nim
01:27:39*xet7 quit (Remote host closed the connection)
01:36:46FromDiscord<Bung> oh , never seen it, seems like a orphan page
01:44:39FromDiscord<Girvo> @exelotl Hah whereas I personally really _like_ having a scheduler for coroutines -- though being able to have both having it scheduled and not having it scheduled is ideal
01:45:22FromDiscord<Girvo> And agreed re. closure iterators being a bad fit on embedded. Caused me some pain. I just stopped fighting the language and systems and accepted threaded life 😭
01:45:38FromDiscord<Girvo> (well, technically Tasks rather than threads, but shrugs)
01:59:33*arkurious quit (Quit: Leaving)
02:03:26*romzx joined #nim
02:33:58FromDiscord<Tuatarian> In reply to @Elegantbeef "Code? (<@284835054633353226>)": the forward decl is
02:34:07FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=4e97
02:35:03FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=4e98
02:35:11FromDiscord<Tuatarian> the line throwing the error is
02:35:19FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=4e9a
02:35:26FromDiscord<Tuatarian> the error itself is
02:35:35FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=
02:36:44FromDiscord<Girvo> Is the second func supposed to be returning void?
02:37:18FromDiscord<Girvo> Ah wait I see what you're doing
02:38:34FromDiscord<Girvo> Does adding the `: seq[ASTNode]` to the definition's signature help? I guess not?
02:41:59FromDiscord<huantian> I feel like that's the issue?
02:43:02FromDiscord<Tuatarian> Ok I see the issue
02:43:06FromDiscord<Tuatarian> I'm printing void right
02:43:13FromDiscord<Tuatarian> Wait no
02:43:31FromDiscord<Tuatarian> Ok parseExpr shouldn't be returning anything
02:43:39FromDiscord<Tuatarian> That's the problem
02:43:49FromDiscord<huantian> a function that doesn't return anything? what's the point then lmao
02:44:12FromDiscord<Tuatarian> It used to return
02:44:26FromDiscord<huantian> oh yeah it has a var arg
02:44:30FromDiscord<huantian> that makes more sense
02:44:44FromDiscord<Tuatarian> Yeah that's a very silly mistake lmao
02:44:49FromDiscord<Tuatarian> Thanks
02:44:59FromDiscord<huantian> I wonder why that twas the error you got though, I can't seem to reproduce it
02:47:20FromDiscord<Tuatarian> Yeah it was a very odd error
03:11:16FromDiscord<ringabout> Debugging macros makes me sick. Hacks after hacks. Hard to change the compiler without break macros.
03:11:24FromDiscord<ringabout> https://media.discordapp.net/attachments/371759389889003532/1034665525160202302/unknown.png
03:14:12FromDiscord<huantian> yeah ig even if you move the burden of features from the lang to the users, you still have to carry that burden in some sense
03:21:13*kenran joined #nim
03:26:30FromDiscord<ringabout> In reply to @flywind "": Nice, my patch for this macro don't work for the current branch. I'm going to claim I fix this problem.
03:26:42FromDiscord<ringabout> (edit) "In reply to @flywind "": Nice, my patch for this macro don't work for the current ... branch." added "devel"
03:51:30*kenran quit (Remote host closed the connection)
04:07:22NimEventerNew thread by phantomcraft: Questions about Nim and its extensibility, see https://forum.nim-lang.org/t/9551
04:14:10FromDiscord<Girvo> In reply to @huantian "I wonder why that": Yeah very weird, I can't cause it either
04:15:16FromDiscord<huantian> wonder if it's a nim version issue?
04:15:38FromDiscord<Girvo> Quite possibly -- I know some of the stuff I see is because I'm on 1.6.4 still
05:08:19*rockcavera quit (Remote host closed the connection)
06:40:36*PMunch joined #nim
06:59:25FromDiscord<Girvo> Dumb question: can I "spread" one seq (thats a variable) into another seq (that's a @[] literal)?
07:00:00FromDiscord<Elegantbeef> `@[10, 20 30] & mySeq` is the best you can do
07:01:47*LuxuryMode quit (Quit: Connection closed for inactivity)
07:11:38*m5zs7k quit (Ping timeout: 250 seconds)
07:14:34*jjido joined #nim
07:20:19*m5zs7k joined #nim
07:24:28FromDiscord<vindaar> @flywind\: well, while I can't speak for everyone, I'm more than happy to see macros break, if that means the hacks "we" use are then unnecessary and can be replaced by some cleaner version. Especially if it's about a library I'm somewhat involved with, just ping me and I'll try to help
07:25:39*PMunch quit (Quit: leaving)
07:27:02FromDiscord<ringabout> Thank you! I appreciate your help.
07:27:42FromDiscord<Elegantbeef> What type of breakages are we talking about?
07:29:08FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4e9P
07:29:32FromDiscord<Elegantbeef> That's a bug
07:29:51FromDiscord<ringabout> Yeah, and somebody's code
07:29:55FromDiscord<Elegantbeef> With modern Nim thanks to the PRs i added `static openarray[int]` is the correct method
07:30:50FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4e9Q
07:31:11FromDiscord<ringabout> I'm going to make this work instead of the former one.
07:31:32FromDiscord<ringabout> (edit) "I'm going to make this work instead of the former ... one." added "array"
07:34:35FromDiscord<Elegantbeef> Yea this is the right path imo, but not overly great for backwards compatibillity
07:34:56FromDiscord<Elegantbeef> Only correct code should work, if incorrect code works and you rely on it, it's not great
07:49:39*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz
)
08:27:13*dnh joined #nim
10:10:32FromDiscord<Tanguy> Do we have any idea what's the nim community size? Trying to compare to rust etc
10:13:26madpropswell the reddit has 5.7k subscribers
10:13:49madpropsthe rust one has 204k
10:17:13FromDiscord<Tanguy> Thanks, also found this https://api.github.com/search/repositories?q=language:Nim↔So between reddit & github, it seems it's about ~40 times smaller than rust
10:17:40FromDiscord<Tanguy> And ~150 times smaller than g
10:17:41FromDiscord<Tanguy> (edit) "g" => "go"
10:19:40FromDiscord<dom96> Community size is tough to gauge, language use/popularity might be better but also tough to gauge
10:19:52FromDiscord<dom96> I personally like Wikipedia pageview stats https://pageviews.wmcloud.org/?project=en.wikipedia.org&platform=all-access&agent=user&redirects=0&start=2015-07&end=2022-09&pages=Nim_(programming_language)|Rust_(programming_language)
10:21:31FromDiscord<dom96> Repo counts are definitely interesting too. Zig has half as many as Nim
10:21:45FromDiscord<dom96> (with the amount of time Zig has been around I'd say it's doing better)
10:43:25NimEventerNew thread by drkameleon: Change ref object variant in-place - drawbacks?, see https://forum.nim-lang.org/t/9552
10:53:20FromDiscord<Ekopalypse> Is this something that is still valid and I need to take care of?↔https://nim-lang.org/docs/nimc.html#dll-generation↔Because I have created two dlls for a cpp app and both are loaded, running and allocating memory all the time but I haven't seen any signs yet that GC is not doing its job.
11:49:16*PMunch joined #nim
11:52:25*jjido joined #nim
11:53:27*arkanoid quit (Ping timeout: 260 seconds)
12:13:01*vicecea quit (Remote host closed the connection)
12:13:37*jmdaemon quit (Ping timeout: 240 seconds)
12:17:28FromDiscord<Saint> if I have a seq[JsonNode] is there an easy way to turn that into a JsonNode so I can pretty() print it?
12:19:32PMunch@Saint, maybe you can use `%` on it?
12:23:51*vicecea joined #nim
12:24:32FromDiscord<Saint> @PMunch worked thanks!
12:24:46PMunchNo problem :)
12:27:18*arkurious joined #nim
12:38:06FromDiscord<haxscramper> In reply to @Tanguy "Do we have any": search `language:nim` on github
12:38:49FromDiscord<ringabout> And https://plausible.io/nim-lang.org
12:39:00FromDiscord<haxscramper> https://api.github.com/search/repositories?q=language:nim
12:39:09FromDiscord<haxscramper> this shows direct count,
12:39:42FromDiscord<haxscramper> for reference, at [8/25/21 2:37 PM] it as at 6.5k
12:40:07FromDiscord<Tanguy> Also found it, see my last message 🙂 8k repos for nim, 380k for rust & 1.123m for go
12:40:28*derpydoo joined #nim
12:41:35FromDiscord<haxscramper> proper metric of the community size would probably involve something like
12:41:47FromDiscord<haxscramper> number if unique users that contributed to all the projects marked in this language
12:42:16FromDiscord<haxscramper> depends on how exactly you define "community"
12:42:25FromDiscord<haxscramper> In reply to @haxscramper "https://api.github.com/search/repositories?q=langua": that uses "community == contributors"
12:42:38FromDiscord<haxscramper> In reply to @flywind "And https://plausible.io/nim-lang.org": "communty == onlookers"
12:42:47FromDiscord<haxscramper> In reply to @dom96 "I personally like Wikipedia": "== unlookers"
12:43:15FromDiscord<haxscramper> In reply to @madprops "well the reddit has": this one I'm not sure, but I guess it is mostly onlookers, sometimes contributors
12:43:27FromDiscord<haxscramper> It's well known that most people only read, don't post and don't comment
12:44:37FromDiscord<haxscramper> In reply to @flywind "And https://plausible.io/nim-lang.org": there is a large number of people who just saw a link on HN/reddit and decided to investigate https://media.discordapp.net/attachments/371759389889003532/1034809777072648192/unknown.png
12:48:30*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz
)
12:52:47FromDiscord<ringabout> Yeah
13:03:54FromDiscord<ShalokShalom> Nims online community is surprisingly large
13:04:04FromDiscord<ShalokShalom> Considering its size, financial support, PR: It's almost huge, compared to other languages who are about as well known
13:04:30FromDiscord<ShalokShalom> And even larger than more widely known languages.
13:24:21*rockcavera joined #nim
13:24:21*rockcavera quit (Changing host)
13:24:21*rockcavera joined #nim
13:25:37PMunchHmm, anyone know how to merge a date and a time in Nim?
13:26:15PMunchI have a bunch of files in folders. The name of each folder is a day in the format yyyy-MM-dd, and each line in the file contains a hh:mm timestamp along with a value
13:26:46PMunchI have parsed the date as a DateTime object with the times module, and now I want to set the time in it
13:31:36FromDiscord<Saint> Is it possible to change a variable type?
13:31:50FromDiscord<Saint> Like if I want to reassign something to a variable and change that variables type
13:31:52PMunchWhat do you mean?
13:32:04FromDiscord<Saint> like var a used to be a list but now I want to assign a map to a
13:32:07PMunchAh, no that's not possible
13:32:08FromDiscord<Saint> If that makes sense
13:32:11FromDiscord<Saint> Oh okay thanks
13:32:16PMunchWell, you can shadow a variable
13:32:37FromDiscord<Saint> What's that?
13:32:37PMunchSo if you have a global variable a which is a sequence you can have a local variable a which is a map
13:33:38FromDiscord<Bung> cast or use a convertor
13:34:27PMunchHuh?
13:34:56FromDiscord<Saint> In reply to @PMunch "So if you have": Oh okay
13:35:53FromDiscord<Bung> why talk about variable scope now..
13:36:06PMunchOf course you could also have an object variant @Saint
13:36:23PMunch@Bung, because they asked if they could change the type of a variable
13:38:20FromDiscord<Bung> hmm, change type doesn't sound same as refer to other scope variable..
13:39:11FromDiscord<Rika> It’s a way to simulate it
13:39:15PMunchYes of course, I was just trying to explain all the intricacies
13:39:22FromDiscord<Saint> Another question, I don't get a line number error for an exception
13:39:32FromDiscord<Saint> Uncaught exceptions, is there a way to get that in my stack trace
13:41:14PMunchNot sure what you mean
13:44:11*derpydoo quit (Ping timeout: 276 seconds)
13:45:02FromDiscord<Saint> sent a code paste, see https://play.nim-lang.org/#ix=4eb1
13:45:26FromDiscord<Saint> Won't tell me where it actually fails in my program, but in some library
13:53:18PMunchAh, that can sometimes happen when things are expanded on compile-time unfortunately
13:53:50PMunchBut the error seems to be that you try to do `for x in y` where y is a JsonNode but not a Json array
13:59:18FromDiscord<Saint> In this case yeah I know where the error is coming from, just wondering what would happen in a more complex case where I don't really know where the error is coming from
13:59:43FromDiscord<Saint> Is there an easy way to filter a table based on which keys I want? Like python's dict comprehension, or pandas?
14:06:26PMunchNot a oneliner afaik
14:15:59PMunchWell, I guess you could do something like this: `myTable = myTable.pairs.toSeq.filterIt(it[0] in 'a'..'z').toTable`
14:16:14PMunchSomething like this: https://play.nim-lang.org/#ix=4ebb
14:17:59*Goodbye_Vincent quit (Quit: Ping timeout (120 seconds))
14:32:35FromDiscord<Saint> In reply to @PMunch "Well, I guess you": Exactly what I was looking for, the toTable, thank you!
14:37:17*Goodbye_Vincent joined #nim
14:59:10FromDiscord<slymilano> Has anyone used nim-schedules (https://github.com/soasme/nim-schedules) with some sort of database backing to track jobs if they completed or not with retries, etc? In Elixir land I would reach for Oban, does Nim have something similar?
15:04:24*PMunch quit (Quit: leaving)
15:10:55FromDiscord<Rika> Don’t think there’s a job management library like Oban, no
15:23:59*PMunch joined #nim
16:03:25FromDiscord<ajusa> In reply to @slymilano "Has anyone used nim-schedules": Maybe https://github.com/capocasa/at
16:04:42FromDiscord<slymilano> thanks will check it out
16:26:54*derpydoo joined #nim
16:37:37FromDiscord<albassort> In reply to @Girvo "And agreed re. closure": What do I do when a microprocessor has one core
16:37:45FromDiscord<albassort> And coroutines are cool because they just work
16:38:00FromDiscord<albassort> You don't need to mess with memory
16:40:18FromDiscord<Rika> Single core microcontrollers can still be threaded
16:40:44FromDiscord<Rika> Just not parallelised so it’s closer to a mix of async and threads
16:43:08*derpydoo quit (Ping timeout: 272 seconds)
16:45:21*derpydoo joined #nim
16:50:46FromDiscord<auxym> yeah, all RTOSs for MCUs come with a "thread" or "task" mechanism, which is either pre-emptive (uses interrupts to stop your code at an arbitrary point, saves the stack for a later resume, etc) or non-preemptive, which is like async/coroutines (you decide when to "yield", at which point the os/scheduler runs another coroutine until it yields, etc)
16:52:15FromDiscord<auxym> I still have some idea for a very lightweight coop scheduler based on actors/message passing. The new Tasks in the stdlib would be a good fit for that I think. Need to play around witht that idea sometime.
16:52:21FromDiscord<Rika> “Non preemptive” is called cooperative just an FYI ;P
16:53:00FromDiscord<auxym> is also called cooperative 😉 non-preemptive is definitely a term I've seen in many places
16:53:59FromDiscord<Rika> Really, huh
16:54:03FromDiscord<Rika> Good to know lol
16:57:32FromDiscord<albassort> In reply to @Rika "Single core microcontrollers can": But isn't the only reason why threads are cool Is operating in parallel, wouldn't coroutines just be far superior if not parallel
16:58:14FromDiscord<albassort> Why are dreads threads threads
16:58:21FromDiscord<albassort> (edit) "dreads" => "" | "threads ... threads" added "called"
16:58:36FromDiscord<albassort> This isn't string theory
16:58:38FromDiscord<albassort> Time to Google
16:58:44FromDiscord<Rika> Because that just is how it is
16:58:59FromDiscord<albassort> You sound like every teach I've ever met
16:59:03FromDiscord<albassort> (edit) "teach" => "teacher"
16:59:57FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1034874030936817664/Screenshot_20221026-125921.png
17:00:02FromDiscord<albassort> Google can hear my speech impediment better than people usually can
17:25:57*pro joined #nim
17:46:46*derpydooo joined #nim
17:47:41FromDiscord<4zv4l> is there a library for Nim similar to this one https://github.com/charmbracelet/bubbletea ?
17:49:14*derpydoo quit (Ping timeout: 276 seconds)
18:21:57FromDiscord<deeuu> Not exactly, you can check out https://github.com/ansiwave/nimwave which I believe uses https://github.com/johnnovak/illwill for TUI
18:30:35*pro quit (Quit: pro)
18:32:33FromDiscord<Saint> @deeuu Does nimwave support displaying images?
18:34:25FromDiscord<deeuu> Haven't used it, check the repo out
18:34:31FromDiscord<Saint> I tried but didn't see it
18:42:10*derpydooo quit (Quit: derpydooo)
18:58:18*jjido joined #nim
19:01:35*LuxuryMode joined #nim
19:40:32*xet7 joined #nim
20:03:37*xet7 quit (Remote host closed the connection)
20:21:38FromDiscord<Saint> Is there an easy way to use fmt string and access a table
20:21:48FromDiscord<Saint> (edit) "table" => "table's values? seems like I would have to escape the double quotes?"
20:21:55*jmdaemon joined #nim
20:24:18FromDiscord<Saint> Oh triple quotes
20:41:06*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz
)
20:49:53*jjido joined #nim
20:50:15FromDiscord<Saint> It is possible to call toString ($) without using brackets before the statement, like a method call after the statement?
20:50:36FromDiscord<Saint> soo like foo.$() or foo.$ instead of $(foo)
20:51:00FromDiscord<konsumlamm> yes, by using backticks
20:53:55FromDiscord<Phil> In reply to @Saint "It is possible to": I generally only make use of the `$foo` Syntax
20:55:37FromDiscord<Saint> Thank you @konsumlamm
20:55:39FromDiscord<Saint> @Phil gotcha
21:27:33*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz
)
21:40:00*jjido joined #nim
22:00:00*exp1oit joined #nim
22:03:04*exp1oit quit (Client Quit)
22:09:14*romzx quit (Ping timeout: 276 seconds)
22:24:47*romzx joined #nim
22:48:23*PMunch quit (Quit: leaving)
23:36:26FromDiscord<Girvo> In reply to @Rika "Because that just is": They don't think it be like it is, but it do