<< 28-01-2025 >>

00:19:30FromDiscord<carrocho> @demotomohiro How can I get the time in milliseconds as an int value?
00:39:08FromDiscord<demotomohiro> In reply to @carrocho "<@288750616510201856> How can I": https://nim-lang.org/docs/times.html↵https://nim-lang.org/docs/monotimes.html
00:42:44*beholders_eye quit (Quit: WeeChat 4.1.2)
01:31:07FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#pasty=TZSuFRcb
01:32:10FromDiscord<Elegantbeef> Remove return and it'll suddenly work
01:32:54FromDiscord<user2m> In reply to @Elegantbeef "Remove return and it'll": genius
01:52:19FromDiscord<carrocho> In reply to @demotomohiro "https://nim-lang.org/docs/times.html https://nim-la": ty bro
02:08:04FromDiscord<carrocho> @demotomohiro We managed to finish the code, thank you for the support. Are you a Nim dev?
02:09:53FromDiscord<haniel.> acabamos
02:14:42FromDiscord<haniel.> ty @demotomohiro we got it
02:31:41*rockcavera quit (Remote host closed the connection)
02:55:32FromDiscord<elykpha> is there currently some cross-platform wrapper of system apis for gui?
03:32:12ehmryxtrayambak: I think you a right, it may be mostly a matter of the libc aligning properly
03:46:16*ensyde joined #nim
04:17:21FromDiscord<demotomohiro> In reply to @carrocho "<@288750616510201856> We managed to": No, I'm Nim user.
04:19:05FromDiscord<carrocho> In reply to @demotomohiro "No, I'm Nim user.": The best nim user 🙏
04:19:50FromDiscord<demotomohiro> In reply to @carrocho "The best nim user": There are many Nim users better than me.
04:21:13FromDiscord<carrocho> In reply to @demotomohiro "There are many Nim": For me, you're the best
04:21:20FromDiscord<carrocho> Where are you from?
04:22:08FromDiscord<demotomohiro> In reply to @carrocho "For me, you're the": Thank you! Im from Japan.
04:22:34*ensyde quit (Ping timeout: 252 seconds)
04:24:57FromDiscord<carrocho> In reply to @demotomohiro "Thank you! Im from": I like Japan, I would like to go on a trip there
04:25:13FromDiscord<carrocho> Did you built this website? https://internet-of-tomohiro.pages.dev/nim/faq.en#community-how-to-post-nim-code-with-syntax-highlight-on-discordqmark
04:26:08FromDiscord<demotomohiro> In reply to @carrocho "I like Japan, I": Yes
04:27:01FromDiscord<carrocho> In reply to @demotomohiro "Yes": Wrong message I guess, haha
04:27:32FromDiscord<carrocho> But that's insane
04:28:00FromDiscord<carrocho> You're the goat
04:34:31*SchweinDeBurg quit (Quit: WeeChat 4.6.0-dev)
04:38:58*SchweinDeBurg joined #nim
04:45:38*mal`` quit (Quit: Leaving)
05:06:45*mal`` joined #nim
05:38:19*xet7 quit (Quit: Leaving)
05:56:05*xutaxkamay quit (Ping timeout: 248 seconds)
05:57:42*xutaxkamay joined #nim
07:26:41FromDiscord<michael.lenz.> Vscode says nimlangserver version 1.8.1 available, but reinstall does not help. 1.8.0 been installed again
07:26:57FromDiscord<michael.lenz.> Do you have the same?
10:17:52*beholders_eye joined #nim
13:14:51FromDiscord<spotlightkid> @michael.lenz.\: `nimble install nimlangserver` install version 1.8.1 here (Manjaro Linux, Nim 2.2.0 from choosenim)
13:14:58FromDiscord<spotlightkid> @michael.lenz.\: `nimble install nimlangserver` installs version 1.8.1 here (Manjaro Linux, Nim 2.2.0 from choosenim)
13:56:14*Guest41 joined #nim
13:57:33*Guest41 quit (Client Quit)
14:14:07FromDiscord<Techy> I was wondering what you all are using to develop Nim. I have been running into an issue where it seems like the LSP doesn't acknowledge imported libraries. I will admit that I have been using NeoVim with `nim_langserver` so that could easily be the issue.
14:15:54FromDiscord<nnsee> I've had that issue too, both with nvim and vscode. Generally, a restart of the LSP has fixed it
14:16:35FromDiscord<Techy> Thank you, I will give that a shot and see where that gets me.
14:21:08FromDiscord<Techy> It seems like once I edit the file I have the restart the LSP each time, otherwise it marks a bunch of lines with errors, even though it compiles and runs file; is that the case for you too?
14:21:46FromDiscord<nnsee> just for regular edits? No, that doesn't happen for me, it's mostly been an issue with imports specifically
14:22:58FromDiscord<nnsee> to be clear, you're using https://github.com/nim-lang/langserver, right?
14:23:01FromDiscord<Techy> I think it stems from the imports for me too - I am trying to import either `balls` or `unittest` so that I can write some tests using something simpler than `testament`.
14:23:07FromDiscord<nnsee> and you've updated the langserver recently?
14:23:38FromDiscord<nnsee> it's worth filing a bug report in that repo if so, they're currently working on improving the tooling specifically and bug reports like these help
14:25:10FromDiscord<Techy> Yes, that is what I am using, but I just checked for an update and there is one, so I will see if that helps me.
14:25:31FromDiscord<Techy> If not I will gather what info I can and pass it over to them.
14:25:39FromDiscord<Techy> Thank you
14:30:06FromDiscord<firasuke> sent a code paste, see https://play.nim-lang.org/#pasty=TUCMFrGN
14:32:57FromDiscord<firasuke> sent a code paste, see https://play.nim-lang.org/#pasty=SjJUudJx
14:35:00FromDiscord<Techy> When I first open the file it looks fine, but if add a blank line, then delete, and then exit insert mode it it goes crazy.
14:35:06FromDiscord<Techy> After Edit.png https://media.discordapp.net/attachments/371759389889003532/1333807569738666066/After_Edit.png?ex=679a3c99&is=6798eb19&hm=ec06764282301f9a6418223d4fe70ad8732d2d9f9f9774dbff247de42916b448&
14:35:07FromDiscord<Techy> Initially.png https://media.discordapp.net/attachments/371759389889003532/1333807575845568593/Initially.png?ex=679a3c9b&is=6798eb1b&hm=28307e4b9b0a9735296b3c35a4e00a4a491045902642062dd110d8914a594740&
14:35:27FromDiscord<Techy> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1333807544522768485): When I first open the file it looks fine, but if I add a blank line, then delete the blank line, and then exit insert mode it it goes crazy.
14:35:50FromDiscord<Techy> The same thing happens when I import unittest.
14:36:06FromDiscord<Techy> But when I look at my logs I can see the LSP is crashing or something, so I need to look at my config.
14:38:21FromDiscord<Techy> image.png https://media.discordapp.net/attachments/371759389889003532/1333808388429185044/image.png?ex=679a3d5c&is=6798ebdc&hm=1ebad7e725b87932de7747f0b328e89d1de11a866a4a7973f89f97b1e68758b1&
14:49:38FromDiscord<lainlaylie> sent a code paste, see https://play.nim-lang.org/#pasty=FcTlogKq
14:50:11FromDiscord<lainlaylie> sent a code paste, see https://play.nim-lang.org/#pasty=gtpoFCiK
14:50:46FromDiscord<firasuke> In reply to @lainlaylie "for reference, the error:": yup this is the error
14:51:19FromDiscord<firasuke> I know this is asking too much from the parser, but is this an issue?
14:52:41FromDiscord<lainlaylie> i guess technically not, since↵> Within a curly expression, however, {, }, must be escaped with a backslash.
14:53:06FromDiscord<lainlaylie> sent a code paste, see https://play.nim-lang.org/#pasty=BfJYiCDw
14:59:02FromDiscord<Techy> Yeah, I don't really have anything special in my config. When digging through the logs with debugging turned on I saw that I am getting a `SIGSEGV: Illegal storage access.` error, so I moved the files to my local drive to see if that was the problem, but it wasn't. This sounds like a bug of sorts.
14:59:18FromDiscord<Techy> Thank you for the help
15:00:11FromDiscord<nnsee> for future reference, SIGSEGV generally means memory access issues, not anything to do with hard disks
15:01:07FromDiscord<nnsee> (and this is definitely something that shouldn't happen & a bug in the langserver)
15:02:30FromDiscord<tauruuuuuus> Quick style question
15:06:49FromDiscord<tauruuuuuus> sent a code paste, see https://play.nim-lang.org/#pasty=VWnmpdTL
15:07:39FromDiscord<tauruuuuuus> (edit) "https://play.nim-lang.org/#pasty=AjEZaiUb" => "https://play.nim-lang.org/#pasty=eabESyEk"
15:07:50FromDiscord<tauruuuuuus> (edit) "https://play.nim-lang.org/#pasty=hlZMEilC" => "https://play.nim-lang.org/#pasty=QQUSEnWw"
15:10:25FromDiscord<nnsee> maybe not the most "common" approach, but i would personally take a look at https://github.com/arnetheduck/nim-results - maybe this is what you're looking for
15:10:35FromDiscord<nnsee> out of curiosity, why are you unable to use exceptions?
15:11:33FromDiscord<tauruuuuuus> I'm on an 8bit MCU, I need to keep it as lean as possible, and I would have to implement a bit of infrastructure for exceptions
15:11:45FromDiscord<tauruuuuuus> In reply to @nnsee "maybe not the most": I'll take a look, ty!
15:11:56FromDiscord<nnsee> then I would personally use the C pattern as you described
15:12:22FromDiscord<nnsee> `nim-results` should also be relatively lean, but the C pattern is certainly more lean
15:17:32FromDiscord<tauruuuuuus> sent a code paste, see https://play.nim-lang.org/#pasty=UShoEDjK
15:17:41FromDiscord<tauruuuuuus> I never got `var` vs `out` here
15:19:39FromDiscord<nnsee> either that, or return a tuple (ret, err), where err could be an enum indicating the type of error (or a bitset for multiple errors)
15:20:07FromDiscord<nnsee> i don't rightly know what the best practice here is, or if there even is one and if it just isn't a case of "use whatever you're comfortable with, but at least be consistent"
15:25:07FromDiscord<lainlaylie> i think it should be var not out here, because in the error case your proc returns without having written to `ret`
15:28:54FromDiscord<firasuke> In reply to @lainlaylie "i guess technically not,": oh ok cool, thanks
16:00:48FromDiscord<michael.lenz.> In reply to @spotlightkid "<@812260016890576936>\: `nimble install nimlangserv": Weird, I still get 1.8.0
16:03:32FromDiscord<michael.lenz.> Guys, httpClient has timeout parameter, but! It doesn’t have connect timeout option. At least I can’t find anything in manual. Is there any possibility to set connect timeout?
16:04:49FromDiscord<michael.lenz.> Second what I wasn’t able to find, is how to have status code when performing postContent
16:05:23FromDiscord<michael.lenz.> Where it could store the respons code?
16:06:35FromDiscord<lainlaylie> https://nim-lang.org/docs/httpclient.html#post%2CHttpClient%2C%2Cstring%2CMultipartData
16:07:27FromDiscord<michael.lenz.> In reply to @lainlaylie "https://nim-lang.org/docs/httpclient.html#post%2CHt": Post returns object, then it’s not possible to have content
16:08:14FromDiscord<michael.lenz.> Response does not have the actual content the server returns, and I need to have it
16:08:22FromDiscord<lainlaylie> https://nim-lang.org/docs/httpclient.html#body%2CResponse
16:08:35FromDiscord<lainlaylie> this is what postContent does anyway
16:08:59FromDiscord<michael.lenz.> Hmm
16:09:03FromDiscord<michael.lenz.> Let me try
16:09:54FromDiscord<michael.lenz.> And how to read from that stream? Using network stream procs from std/net?
16:10:31FromDiscord<lainlaylie> its just a regular Stream, you can readAll it, which is what the postContent and body procs do for you
16:10:53FromDiscord<michael.lenz.> Thanks I will try
16:11:36FromDiscord<michael.lenz.> Connect timeout actually is a thing. Probably there’s no such option
16:24:31FromDiscord<michael.lenz.> In reply to @lainlaylie "https://nim-lang.org/docs/httpclient.html#post%2CHt": Awesome, this not needs readAll(), body already is a string. Thanks
16:35:07FromDiscord<michael.lenz.> Yes, no connet timeout anywhere in the source
17:17:21*coldfeet joined #nim
17:51:12*end quit (Ping timeout: 246 seconds)
17:52:37*bcksl quit (Ping timeout: 265 seconds)
18:13:53*bcksl joined #nim
18:16:21*end joined #nim
18:23:59FromDiscord<tauruuuuuus> In reply to @lainlaylie "i think it should": thanks for the clarification!
19:01:04*khazakar quit (Ping timeout: 260 seconds)
19:01:39*kasimir_ quit (Ping timeout: 260 seconds)
19:02:15*GreaseMonkey quit (Ping timeout: 260 seconds)
19:02:35*greaser|q joined #nim
19:03:37*kasimir_ joined #nim
19:03:51*khazakar joined #nim
19:04:48*greaser|q quit (Changing host)
19:04:48*greaser|q joined #nim
19:04:55*greaser|q is now known as GreaseMonkey
19:14:53FromDiscord<demotomohiro> In reply to @tauruuuuuus "I'm on an 8bit": Using exceptions might make code size smaller than using return value: https://forum.nim-lang.org/t/12549↵But it doesn't seem make code smaller for small code as using cpp exception adds some runtime code.
19:21:55FromDiscord<spotlightkid> sent a long message, see https://pasty.ee/wxWbaqhO
19:33:36FromDiscord<Elegantbeef> Would a rest api work aswell? Would be less tedious
19:45:36strogon14no, the server will sent updates often.
19:46:51FromDiscord<spotlightkid> also, there may be several web interfaces being used at the same time.
19:47:09FromDiscord<michael.lenz.> Web audio player?
19:48:49FromDiscord<spotlightkid> no, the audio will be played by the server app. it's supposed to be a kind of backing track player for musicians.
19:52:23FromDiscord<tauruuuuuus> In reply to @demotomohiro "Using exceptions might make": But I do have to implement something else I think (maybe via `panicoverride.nim`?), and also I would like to not allocate if possible
19:54:34FromDiscord<michael.lenz.> In reply to @spotlightkid "no, the audio will": Ah, ok! Then you can have just regular html with buttons that post the commands to the server
19:56:42FromDiscord<spotlightkid> Yeah, and a few event handlers to receive updates (title, play counter, etc.) from the server and insert the data into the DOM.
19:58:21FromDiscord<michael.lenz.> Something like that. Depends on how many commands and parameters you need.
19:59:34FromDiscord<michael.lenz.> I would just use the cgi for this, a lot simpler than dealing with json
20:01:00FromDiscord<michael.lenz.> Cgi app will interact with the audio server and pass the commands sent from the browser
20:04:35FromDiscord<michael.lenz.> Passing commands may be done using mmaped ram for example, and if there’s not a lot parameters, with use of a signals, like next track, previous track
20:04:47FromDiscord<spotlightkid> Cgi? You mean like 1990's Perl scripts?
20:06:01FromDiscord<spotlightkid> implementing two kinds of IPC seems redundant to me. Why not use websockets as the IPC mechanism in the first place?
20:06:41FromDiscord<michael.lenz.> I never used web sockets previously, dunno how difficult it is
20:07:12FromDiscord<nnsee> i think websockets is a perfect fit for this
20:08:20FromDiscord<nnsee> i've used the status-im websocket library with great success before
20:08:29FromDiscord<nnsee> wasn't very difficult at all
20:08:53FromDiscord<spotlightkid> Would that mean using chronos?
20:09:04FromDiscord<nnsee> yup
20:10:53FromDiscord<nnsee> i would probably use chronos over asyncdispatch regardless, after having been burnt by the latter
20:42:45*coldfeet quit (Quit: Lost terminal)
21:17:25*rockcavera joined #nim
21:49:54FromDiscord<demotomohiro> sent a long message, see https://pasty.ee/YrGAIWzG
22:51:46*pqflx3 joined #nim
23:25:10*beholders_eye quit (Ping timeout: 252 seconds)