<< 24-04-2024 >>

00:01:05*def- quit (Client Quit)
00:01:37*def- joined #nim
00:01:57FromDiscord<the_real_hypno> well
00:02:02FromDiscord<the_real_hypno> no idea why but it works now
00:02:34FromDiscord<the_real_hypno> Atleast it doesnt die. Its also relatively fast in getting the document ready
00:04:50FromDiscord<the_real_hypno> sits at 600 mb. Cant really believe that the RAM increase did something ¯\_(ツ)_/¯
00:05:14FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Well when you get": I will heh
00:05:28FromDiscord<Robyn [She/Her]> In reply to @the_real_hypno "sits at 600 mb.": Hm, odd
00:06:05FromDiscord<the_real_hypno> Well, usually im coding though. Maybe it is allergic to weird code 😦
01:27:16FromDiscord<maria_0516> sent a long message, see https://pasty.ee/pdoHtVEUCxgK
02:03:26*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
02:11:43*def- quit (Quit: -)
02:11:56*def- joined #nim
02:12:18*bcksl quit (Quit: \)
02:12:24*end quit (Quit: end)
02:12:35*mahlon quit (Read error: Connection reset by peer)
02:13:13*mahlon joined #nim
02:14:05*_________ quit (Ping timeout: 245 seconds)
02:14:59*_________ joined #nim
02:20:28*bcksl joined #nim
02:24:54*end joined #nim
02:29:33*krux02_ quit (Quit: Leaving)
03:14:52*xet7 quit (Remote host closed the connection)
03:23:07*pmp-p quit (Quit: No Ping reply in 180 seconds.)
03:24:11*def- quit (Quit: -)
03:24:33*pmp-p joined #nim
03:25:35*def- joined #nim
03:31:46*pmp-p quit (Quit: No Ping reply in 180 seconds.)
03:32:57*pmp-p joined #nim
03:34:47*def- quit (Quit: -)
03:35:23*def- joined #nim
03:49:15FromDiscord<drunkenalcoholic> Noob question incoming: is it frowned apon to use return and result in the same line? or its ok because "result" is just variable anyway?
03:49:41FromDiscord<Elegantbeef> you can just do `return`
03:49:42FromDiscord<Elegantbeef> If result is set
03:49:54FromDiscord<Elegantbeef> It's best to use expressions if possible
03:50:04FromDiscord<drunkenalcoholic> sent a code paste, see https://play.nim-lang.org/#pasty=HpTnaoVNklDc
03:50:27FromDiscord<Elegantbeef> Why even return
03:50:32FromDiscord<Elegantbeef> That's an expression
03:51:12FromDiscord<drunkenalcoholic> ohh thats right nim uses the last line of code as the return value anyway?
03:51:26FromDiscord<odexine> Last expression
03:51:27FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=rYFgiGKnZFJJ
03:51:49FromDiscord<Elegantbeef> Nim is 'expressionful' so every statement can be an expression
03:52:56FromDiscord<Elegantbeef> actually I think `result` disables expressions so that should be `let vol = ...` then `prefix & " " vol`
03:52:57FromDiscord<drunkenalcoholic> Understood, thanks for the info, as hobbyist coming from Delphi/Pascal Nim is very similar but yet different as the case here
03:54:02FromDiscord<drunkenalcoholic> mind you the first code I posted did actually work, but then seeing return and result in the same line had me questioning myself
03:54:28FromDiscord<Elegantbeef> Expressions are best as they ensure all code paths return a value
03:54:48FromDiscord<Elegantbeef> Then it's between explicit return and result, that's between you and your god
03:54:57FromDiscord<drunkenalcoholic> 🙂
03:58:29*SchweinDeBurg joined #nim
04:03:13FromDiscord<drunkenalcoholic> sent a code paste, see https://play.nim-lang.org/#pasty=KcbAVBNplrEG
04:05:41FromDiscord<Elegantbeef> Ew
04:05:47FromDiscord<drunkenalcoholic> lol
04:06:01FromDiscord<Elegantbeef> What's the point in doing `result = ...` if it's the last expression
04:06:28FromDiscord<drunkenalcoholic> because the compiler hasda cry
04:06:43FromDiscord<drunkenalcoholic> icon & " " & result <--- error
04:07:08FromDiscord<Elegantbeef> Right cause you used `result` earlier
04:07:17FromDiscord<Elegantbeef> `let vol = ...` then you no longer have that issue 😄
04:07:37FromDiscord<drunkenalcoholic> I see, i'll go and test it now
04:08:59FromDiscord<drunkenalcoholic> sent a code paste, see https://play.nim-lang.org/#pasty=ZYewoDEJwalv
04:09:44FromDiscord<drunkenalcoholic> That woked, now that it not use result first as you said
04:09:48FromDiscord<nnsee> sent a code paste, see https://play.nim-lang.org/#pasty=EuPtfzHTdSLR
04:10:09FromDiscord<nnsee> or something that outputs machine-parseable output
04:10:44FromDiscord<drunkenalcoholic> im only a young padwa in the coding realm, so I am not aware on the use of dbus to get that info
04:11:16FromDiscord<nnsee> oh yeah dbus is annoying to use
04:11:28FromDiscord<nnsee> but it's pretty useful specifically for things like these
04:11:39FromDiscord<nnsee> since you can subscribe to volume change/mute events etc
04:11:49FromDiscord<drunkenalcoholic> any examples how that may look like?
04:27:41*def- quit (Quit: -)
04:30:09*def- joined #nim
04:36:37*def- quit (Quit: -)
04:57:53*def- joined #nim
05:28:32*ntat joined #nim
06:10:36*def- quit (Quit: -)
06:11:17*def- joined #nim
06:37:50*def- quit (Quit: -)
06:39:25*rockcavera quit (Remote host closed the connection)
06:39:50*def- joined #nim
06:54:57*PMunch joined #nim
07:06:07*ntat quit (Quit: Leaving)
07:11:11*def- quit (Quit: -)
07:11:23*def- joined #nim
07:23:00FromDiscord<whisperecean> is there a way to add nimble a package with a certain branch / pr?
08:10:38FromDiscord<odexine> After the link, @#branch-name, I believe
08:41:04*def- quit (Quit: -)
08:41:20*def- joined #nim
08:49:45*om3ga joined #nim
09:36:58*def- quit (Quit: -)
09:37:21*def- joined #nim
09:45:07*def- quit (Quit: -)
09:46:20*def- joined #nim
09:49:09*krux02 joined #nim
09:52:32FromDiscord<thatdevnerd> sent a code paste, see https://play.nim-lang.org/#pasty=FRZNoYhdOmCW
09:53:44FromDiscord<thatdevnerd> sent a code paste, see https://play.nim-lang.org/#pasty=cUMFnDNnxXkK
10:21:38FromDiscord<_ot> same
10:23:57FromDiscord<zidsal> Does anyone know if the mastering nim book formats well on the kindle edition? Or is paper back the way to go for readability
10:24:13FromDiscord<zidsal> (edit) "Does anyone know if the mastering nim book formats ... well" added "code snippets"
10:25:03*xet7 joined #nim
11:14:35FromDiscord<saint.___.> What's a current good html templating library? Is nimja still good?
11:26:31FromDiscord<zumi.dxy> I do wish nimja had opt-in raw strings
11:30:30FromDiscord<saint.___.> In reply to @zumi.dxy "I do wish nimja": Wdym? What does it have right now
11:31:36FromDiscord<zumi.dxy> I mean, escaped-by-default like Karax has↵I think Nimja doesn't mess with strings by default, it just plops the result in there
11:32:19FromDiscord<zumi.dxy> Yeah I basically solved it by copying the escaper proc from Karax and passing the string through it like a normal function but like
11:32:23FromDiscord<zumi.dxy> eh
11:34:19FromDiscord<zumi.dxy> Nimja is still really handy however
11:34:39FromDiscord<zumi.dxy> Can instantly transfer my HTML mockups over to implementation
11:37:49*def- quit (Quit: -)
11:38:00*def- joined #nim
11:45:52*PMunch_ joined #nim
11:46:28*ntat joined #nim
11:47:12FromDiscord<saint.___.> In reply to @zumi.dxy "I mean, escaped-by-default like": Oh gotcha
11:47:44FromDiscord<saint.___.> In reply to @zumi.dxy "Yeah I basically solved": Interesting, there are no other standard html string escaper libraries?
11:49:47*PMunch quit (Ping timeout: 264 seconds)
12:24:50*krux02 quit (Remote host closed the connection)
12:28:48*om3ga quit (Ping timeout: 255 seconds)
13:01:00FromDiscord<zumi.dxy> There are probably others but I haven't checked
13:02:35FromDiscord<zumi.dxy> sent a code paste, see https://play.nim-lang.org/#pasty=EAoPOlbeIIMo
13:11:05*rockcavera joined #nim
13:17:43NimEventerNew thread by timelems: Resources for Learning Nim, see https://forum.nim-lang.org/t/11481
13:53:35*ntat_ joined #nim
13:54:06*ntat quit (Ping timeout: 268 seconds)
14:10:43*PMunch_ quit (Quit: Leaving)
14:16:10FromDiscord<queebee> sent a code paste, see https://play.nim-lang.org/#pasty=ARQZQELNwxJy
14:16:35FromDiscord<queebee> (edit) "https://play.nim-lang.org/#pasty=KwKMwvnUcqQL" => "https://play.nim-lang.org/#pasty=lzHDuOGPyzrn"
14:19:30FromDiscord<the_real_hypno> I'd seperate. Makes code a lot more readable. Commons can then be defined as first layer
14:20:27FromDiscord<queebee> Hypno. Please. I'm asking the nim nerds
14:20:34FromDiscord<queebee> 😄
14:20:50FromDiscord<the_real_hypno> :kekw:
14:26:52FromDiscord<odexine> Depends on the size of the module
14:31:03FromDiscord<queebee> Okay
14:35:50FromDiscord<demotomohiro> If there are a few difference between windows and linux code, `when defined(windows) xyz else: abc` in one module will be fine.
15:29:40FromDiscord<Phil> In reply to @queebee "What is the recommended": One approach I wouldn't mind. ↵If the platform specific code is only in one or two places though, you'd more likely find me having a module somemodule.nim with a directory of the same name with somemodule_linux.nim etc
15:30:14FromDiscord<Phil> Though chances are I'd use that pattern even if there were 10+modules that required platform specific code
15:31:09FromDiscord<Phil> (edit) "One" => "That" | "↵If" => "↵↵However, If"
15:32:23FromDiscord<Phil> That's also particularly nice because you can have somemodule_interface.nim inside of which you do a bunch of forward declarations and which you include in each module variation
15:34:01FromDiscord<Phil> Somemodule.nim would be implementing whatever platform agnostic stuff belongs in there and import the platform specific module via compiler flag
15:36:10FromDiscord<Phil> And you can even annotate the forward declarations with doc comments so that the platform specific modules don't have to be commented
15:36:23FromDiscord<Phil> (edit) "And you can even annotate the forward declarations ... with" added "in the interface module"
15:38:38FromDiscord<saint.___.> In reply to @zumi.dxy "fwiw Karax's one looks": Gotcha that's simple enough!
15:39:35FromDiscord<queebee> @Phil thanks!
16:40:38FromDiscord<Phil> In reply to @bosinski2023 "yea, better have a": I'm asking the folks from RXJS now how the heck they managed
16:41:25FromDiscord<Phil> Because I'm highly intimidated from staring at their codebase. With some luck, somebody on their discussions/community page is willing to give me some resources, fingers crossed
16:44:26*def- quit (Quit: -)
16:52:08*def- joined #nim
16:57:41*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
17:08:59*def- quit (Quit: -)
17:10:31*def- joined #nim
17:27:43*mahlon quit (Ping timeout: 272 seconds)
17:36:53*def- quit (Quit: -)
17:39:16*def- joined #nim
18:00:44*def- quit (Quit: -)
18:01:51*def- joined #nim
18:01:55*mahlon joined #nim
18:06:06FromDiscord<threefour> How do I get a `return` to be returned as-is from a template?
18:13:03FromDiscord<nnsee> can you provide an example of what you mean
18:18:38FromDiscord<the_real_hypno> Am i just blind or is it not possible to set Nim compile options from within a Nim-file? Without a .nims or .cfg?
18:18:43FromDiscord<the_real_hypno> I see only query options
18:22:30Amun-Rawhat compile options?
18:22:42FromDiscord<marioboi3112> hey huys, where are nim libraries found, i wanted to move nim with the libraries i had installed to a usb to copy it to my school's computer, i cant use nimble to install the packages there cause they dont allow us to use the internet right now, anyone got any suggestions?
18:23:05FromDiscord<the_real_hypno> -d:stuff defines, etc. basically all things nim provides
18:23:14FromDiscord<nnsee> In reply to @the_real_hypno "Am i just blind": how would that work? by the time you start the compiler it already needs to know the flags it was called with, no?
18:23:29FromDiscord<nnsee> you can use the define pragma for simple defines
18:23:35Amun-Raconfig.nims: switch "define", "name=val"
18:23:49FromDiscord<nnsee> passL and passC for the linker and c flags
18:23:59FromDiscord<the_real_hypno> Im not aware how it works. I guess one could do partical reads to get that going ¯\_(ツ)_/¯
18:24:01Amun-Ranim.cfg: define = name=val
18:24:06FromDiscord<the_real_hypno> yes guys
18:24:07FromDiscord<the_real_hypno> im aware
18:24:15FromDiscord<the_real_hypno> but i wanted them INSIDE my nim file 😛
18:24:29Amun-Raso… put… them… inside… ;)
18:24:32FromDiscord<the_real_hypno> so i dont always have a .nims file flying around
18:24:42FromDiscord<the_real_hypno> but ye, it is what it is
18:24:45FromDiscord<the_real_hypno> cheers
18:24:49Amun-Raah, without nims/cfg
18:26:11FromDiscord<the_real_hypno> Yes, that was what i was searching. But what Ras said makes sense. Probably still could do something like a firstlineoption reinvoke
18:26:33FromDiscord<the_real_hypno> but in the end its just another file 😛
18:29:56FromDiscord<nnsee> In reply to @the_real_hypno "-d:stuff defines, etc. basically": for defines, are these what you're looking for? https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compileminustime-define-pragmas
18:30:38FromDiscord<the_real_hypno> I tried those but they dont seem to get catches immidiately
18:30:39FromDiscord<nnsee> lol @ the url, "compileminustime"
18:31:13FromDiscord<the_real_hypno> I guess its more something thats there to check against it
18:31:18FromDiscord<the_real_hypno> with when defined(
18:31:20FromDiscord<the_real_hypno> (edit) "defined(" => "defined()"
18:35:36*krux02 joined #nim
18:38:38*PMunch joined #nim
18:39:06PMunchAnyone knows how to stop nim.vim from calling `nim check`?
18:39:35PMunchIt craps out on my project and just hangs forever, which in turns hang Vim and I need to kill the `nim check` process manually..
18:40:35PMunchBy the way, I've been wondering how Nim doc can work so well while nimsuggest keeps crashing or hanging. Anyone got any thoughts?
18:40:36FromDiscord<Phil> In reply to @the_real_hypno "-d:stuff defines, etc. basically": You can, owlkettle does it to define linked libraries
18:41:26FromDiscord<Phil> `{.passl: strutils.strip(gorge("pkg-config --libs gtk4")).}`↵This passes flags to the linker, which would be among the compiler-flags you'd be settings
18:42:20FromDiscord<Phil> Which I guess isn't quite compiler options but close enough
18:44:14*def- quit (Quit: -)
18:44:41FromDiscord<the_real_hypno> In reply to @isofruit "`{.passl: strutils.strip(gorge("pkg-config --libs g": haha, that kind of shenanigans what was i expected 😛
18:45:37*def- joined #nim
18:46:18FromDiscord<the_real_hypno> But that doesnt help me with defined meant for Nim, right?
18:46:35FromDiscord<the_real_hypno> (not that i cant make use of the above)
18:46:41FromDiscord<the_real_hypno> (edit) "above)" => "above, thanks)"
18:47:22FromDiscord<the_real_hypno> (edit) "thanks)" => "thanks(that actually solved an issue i had before))"
18:47:22FromDiscord<threefour> sent a code paste, see https://play.nim-lang.org/#pasty=WOFsEAAdDwpH
18:50:36FromDiscord<Elegantbeef> What is the return type of your proc that you call `respond` in?
18:53:23FromDiscord<threefour> `void`, but technically `Future[void]` since it's async.
18:53:49FromDiscord<Elegantbeef> Right so if you do not set the result `return` will return nil
19:01:16FromDiscord<threefour> sent a code paste, see https://play.nim-lang.org/#pasty=yVtUASUUpiGo
19:01:25FromDiscord<threefour> (edit) "https://play.nim-lang.org/#pasty=ygLSgeQjsTrM" => "https://play.nim-lang.org/#pasty=phZAWIoseysx"
19:01:46FromDiscord<Elegantbeef> It should have the same behaviour
19:14:12FromDiscord<threefour> sent a code paste, see https://play.nim-lang.org/#pasty=BkJbyRnBVRVp
19:19:00FromDiscord<Elegantbeef> Oh right the async macro transforms the `return` statement
19:19:15FromDiscord<Elegantbeef> And since it works on untyped ast it does not expand the template until after the async is applied
19:46:00FromDiscord<wileycoleman> Is there an command line REPL that works with the latest version of Nim? I see there is an "inim" but it looks old.
19:46:35FromDiscord<kots> inim works for me on latest nim
19:46:38FromDiscord<kots> what problem are you facing?
19:48:48FromDiscord<wileycoleman> In reply to @k0ts "what problem are you": I haven't tried it yet, just saw that its releases were really old.
19:50:00FromDiscord<Elegantbeef> If open source software wasnt updated tomorrow inevitably someone will say it's dead
19:50:11FromDiscord<rakgew> inim works well for me on latest nim
19:50:33PMunchFor what its worth there's also `nim secret`, but it seems like inim works well for people :)
19:50:47FromDiscord<kots> to reiterate, inim works well
19:51:25FromDiscord<wileycoleman> ok thanks! I will explore it. I am interested in doing introspection on objects as well as learning how the nim language works.
19:51:48FromDiscord<kots> one also hears talk of nlvm's repl, but i've yet to try it myself
19:51:55*def- quit (Quit: -)
19:52:45*def- joined #nim
19:56:19*ntat_ quit (Quit: Leaving)
19:59:59*SEP quit (Ping timeout: 260 seconds)
20:01:44FromDiscord<ieltan> Is there a macro that can list every procs/templates implemented for a type ?
20:03:13*def- quit (Quit: -)
20:03:28*def- joined #nim
20:04:45FromDiscord<mustacheman> hey everyone, it's been awhile since i've done much with nim but i have a question: can Nim make use of libraries from other ecosystems? Java? C? Python? Is it trivial or involved?
20:06:47*SEP joined #nim
20:06:50*def- quit (Client Quit)
20:09:21FromDiscord<threefour> I don't know about Java interop, but Nim has a really good FFI for C, and thus by extension Python. Triviality depends on what you're trying to pull in.
20:10:09FromDiscord<mustacheman> Machine learning libs, for example Pandas, numpy
20:10:11FromDiscord<threefour> Well, you can use Nim code from Python, but I'm not sure about Python from Nim
20:10:33FromDiscord<threefour> In reply to @mustacheman "Machine learning libs, for": Check out Arraymancer
20:10:36FromDiscord<kots> nimpy exists
20:14:33FromDiscord<Clonkk> We wrote some stuff on doing scientific computing in Nim https://scinim.github.io/getting-started/
20:14:42FromDiscord<Clonkk> We also have Julia interop
20:14:50FromDiscord<norax.2> me streaming till i fall asleep coding stuff:
20:15:04FromDiscord<norax.2> is like always the best feeling
20:15:06FromDiscord<nnsee> In reply to @Clonkk "We wrote some stuff": nice!
20:16:36FromDiscord<Clonkk> Most important repo \: https://github.com/mratsim/Arraymancer https://github.com/SciNim/nimjl https://github.com/yglukhov/nimpy
20:16:36FromDiscord<Clonkk> We have experimental bindings to torch too
20:16:39FromDiscord<Clonkk> https://github.com/SciNim/flambeau
20:17:19FromDiscord<Clonkk> It mostly works, but we lack time to further develop it so PR are welcome if that's something you are interested in
20:24:32FromDiscord<Elegantbeef> @ieltan nope macros can only inspect what they're given they cannot get arbitrary information
20:25:54*def- joined #nim
20:25:58FromDiscord<nervecenter> In reply to @mustacheman "Machine learning libs, for": Datamancer is a very good dataframe library
20:27:43PMunch@Elegantbeef, unless you get real freaky with it
20:27:56FromDiscord<nervecenter> Just keep in mind:↵1) Nim is statically typed, so dereferencing data in Datamancer involves accounting for type.↵2) Datamancer is backed by Arraymancer tensors, and there is just a bit of mismatch between them and Nim seqs.↵None of these end up being a big deal and you get some mind-boggling speed from it.
20:28:19FromDiscord<Elegantbeef> Right pmunch you can `parseExpr` or `parseStmt` a file but that does not give you symbols so it's mostly moot
20:29:16PMunchWell you can resolve the names to symbols in a second pass
20:30:07FromDiscord<Elegantbeef> This is a hellscape of compile times and macros
20:30:11NimEventerNew thread by DMisener: Nim implementation of Ruby tap() method, see https://forum.nim-lang.org/t/11485
20:32:55FromDiscord<Elegantbeef> Excuse me whilst I scream about reliance on LLMs
20:37:17PMunchHmm, metatag only support id3v2.3.0 :(
20:41:17NimEventerNew thread by Nlits: Can’t wrap my head around this TypeError, see https://forum.nim-lang.org/t/11486
20:41:59*perr_ quit (Ping timeout: 264 seconds)
20:44:51*perr_ joined #nim
20:52:05FromDiscord<mustacheman> In reply to @k0ts "nimpy exists": How is nimpy in practice?
20:55:56FromDiscord<mustacheman> It seems it executes Python via cpython thus being at least as slow as Python. Still, if it can run anything cpython can run, it's useful. I wonder what other gotchyas there are.
20:56:08FromDiscord<saint.___.> In reply to @mustacheman "How is nimpy in": I've used it a bit seems good!
20:56:23FromDiscord<saint.___.> Yeah it's not for performance more like just for compatibility
20:56:33FromDiscord<saint.___.> Needs more documentation though
20:56:40FromDiscord<saint.___.> Like everything in nim
21:11:54*disso-peach quit (Quit: Leaving)
21:25:24*PMunch quit (Quit: Leaving)
22:08:55FromDiscord<ieltan> In reply to @Elegantbeef "<@256520101015060480> nope macros can": ah bummer, thanks for the response 🙂
22:53:48*def- quit (Quit: -)
22:54:06*def- joined #nim
23:05:22*def- quit (Quit: -)
23:05:37*def- joined #nim
23:09:25*def- quit (Client Quit)
23:10:17*def- joined #nim
23:19:41*SchweinDeBurg joined #nim
23:24:55*def- quit (Quit: -)
23:45:28*def- joined #nim