<< 23-08-2023 >>

01:31:52*azimut quit (Remote host closed the connection)
01:32:16*azimut joined #nim
01:48:26FromDiscord<ravinder387> sent a code paste, see https://play.nim-lang.org/#ix=4Ehj
01:48:53FromDiscord<ravinder387> how to wrap context.font = "30px Arial"
01:51:27FromDiscord<ravinder387> sent a code paste, see https://play.nim-lang.org/#ix=
01:51:35FromDiscord<ravinder387> it didn't work
01:54:14FromDiscord<Elegantbeef> \`\`font =
01:54:18FromDiscord<Elegantbeef> `font = ` whoops
01:56:20FromDiscord<ravinder387> I wrote this code 1 year ago.. now I wanna extend it
01:57:53FromDiscord<ravinder387> how to wrap canvas javascript api in nim
03:27:08*fallback quit (Ping timeout: 246 seconds)
03:27:37*fallback joined #nim
04:28:11FromDiscord<k0ts> https://github.com/juancarlospaco/nodejs/blob/dbe6ac311abeda18b0b75ff3d20bcb27320b9f7b/src/nodejs/jscanvas.nim
04:28:15FromDiscord<k0ts> Might be worth a look
04:53:43FromDiscord<Phil> I dunno why but that kinda reminds me that I really should be using block more to isolate individual blocks of code that are just for figuring out the value of 1 variable
05:01:39*azimut quit (Ping timeout: 246 seconds)
05:06:40*advesperacit joined #nim
05:25:43FromDiscord<graveflo> If I make a table like `newTable[string, seq[string]]()` how do I get a reference to a seq without making a copy, as in `var s = table["something"]`. I tried `newTable[string, var seq[string]]()`. I know that `table["something"].something` will work, as in passing it into a proc or just doing the operation without defining another variable, but this is cumbersome and annoying, especially when using the built in iterators. Anyone know ho
05:58:01FromDiscord<demotomohiro> @graveflo↵Wait for view types: https://nim-lang.org/docs/manual_experimental.html#view-types↵Or pass `table["abc"]` to a proc parameter `x: seq[string]` or `x: openArray[string]`.
06:04:58FromDiscord<Phil> Is every function in JS basically an async function?
06:05:30FromDiscord<Phil> And you just don't notice it/ it gets hidden from you because JS doesn't let you interact with resources outside of the context of an event-loop?
06:06:10FromDiscord<Phil> (edit) "function?" => "function / a function on an event-loop queue (or a function that gets called by a function on an event-loop queue)?"
06:07:26FromDiscord<Phil> That question came up to me as I started realizing that `await` is kind of nim's equivalent to JS `await` , but JS basically has no equivalent to `waitFor` because in JS your functions basically are never in a synchronous context.↵It's all event-loop. Whatever code calls an equivalent to waitFor is running the JS runtime, right?
06:08:00FromDiscord<Phil> (edit) "event-loop." => "event-loop/tasks in a dispatcher-queue."
06:08:27FromDiscord<Phil> (edit) "That question came up to me as I started realizing that `await` is kind of nim's equivalent to JS `await` , but JS basically has no equivalent to `waitFor` because in JS your functions basically are never in a synchronous context.↵It's all event-loop/tasks in a dispatcher-queue. Whatever code calls an equivalent to waitFor is ... running" added "what's"
06:17:37FromDiscord<Phil> Self answered async SO question incoming
06:19:34NimEventerNew question by Philipp Doerner: How do I execute a proc with a delay in nim?, see https://stackoverflow.com/questions/76958747/how-do-i-execute-a-proc-with-a-delay-in-nim
06:25:12*PMunch joined #nim
06:34:30*hernan_ joined #nim
06:35:36*blackbeard420_ joined #nim
06:36:25*Mister_Magister_ joined #nim
06:38:14*lumidify_ joined #nim
06:38:22*adium_ joined #nim
06:38:33*laintree joined #nim
06:39:18*Mister_Magister quit (*.net *.split)
06:39:18*cornfeedhobo quit (*.net *.split)
06:39:18*blackbeard420 quit (*.net *.split)
06:39:18*lumidify quit (*.net *.split)
06:39:18*adium quit (*.net *.split)
06:39:18*hernan quit (*.net *.split)
06:39:18*lain quit (*.net *.split)
06:40:03*Mister_Magister_ is now known as Mister_Magister
06:43:39*cornfeedhobo joined #nim
06:50:31*rockcavera quit (Remote host closed the connection)
08:09:06*laintree is now known as lain
08:16:42*azimut joined #nim
08:29:05FromDiscord<mratsim> In reply to @Andreas "found it yesterday, and": pick a domain and create primitives that use SIMD for it.↵↵Just the vector class isn't really that useful unless it's the backend of a compiler/DSL because now you need to teach the users how to use your class, and they might need to learn SIMD as well.
08:29:42FromDiscord<mratsim> something like this for example: https://github.com/ermig1979/Simd
09:32:52NimEventerNew thread by leeooox: Nim2.0 how to build dll without dependency of libgcc_s_seh-1.dll, see https://forum.nim-lang.org/t/10431
09:40:42*lucasta_ joined #nim
10:09:55PMunchHmm, more of a general code style question, but how do people handle procedures which takes a lot of parameters?
10:10:26PMunchI have a set of procedures which all simulate some stuff based on an initial state with a bunch of parameters
10:11:21PMunchThe way I've done it is to split up the parameters in objects and pass those in. But now I'm left in a scenario where some procs require certain parameters to be set, while other don't
10:21:51*def- quit (Quit: -)
10:22:04*def- joined #nim
10:22:46FromDiscord<nnsee> I'm not sure if I'm understanding you correctly, but can't you just ignore the parameters that aren't required to be set (and also just not set them in the object in the firs place)?
10:27:08FromDiscord<Phil> In reply to @PMunch "I have a set": Sounds like that's state and you have a state object in disguise
10:27:43FromDiscord<Phil> Oh wait, you have a bunch of parameters for different procs, hmm
10:29:39PMunchYeah basically I want to be able to define some initial state of the system, then call various procedures to simulate stuff based on this state
10:29:57FromDiscord<Phil> In reply to @PMunch "The way I've done": Generally my strategies are depending on the situation:↵- 1 x State object parameter↵- Default Parameter↵- Overloads - this one mostly if a proc may be called with different sets of parameters, then I basically overload that proc as various "frontends" for the main proc
10:30:30FromDiscord<Phil> In reply to @PMunch "Yeah basically I want": So all parameter-subsets are derived from the initial state?
10:30:46PMunchHmm, I guess I could make the basic parts of the calculation just take numbers, then have unpacking templates which takes the values from the state object..
10:31:02FromDiscord<Phil> In that case I think it'd be valid to have a state object for each parameter-set and write mappers to convert from state-object A to B
10:31:39PMunchHmm, I think I might just need some verifiers
10:31:46FromDiscord<Phil> Particularly since that also forces you to centralize thinking about scenarios of "Where does a parameter value come from when A has it but B doesn't"
10:32:30FromDiscord<Phil> Also valid, I can't say I've found "the" strategy yet. In Webdev the solution is obvious:↵You have your 3 layer architecture and you pass well-defined data-containers back and forth
10:34:09FromDiscord<Phil> A controller will always build a controller-based-object whatever you want to call it, which accumulates all relevant data from the HTTP request (be it from the URL path, the headers, the body, cookies or tokens) and passes that on to a service, which does what it needs to with that data and returns the desired data-object that can be JSON-serialized (or turned into HTML) and sent to the world.
10:34:34FromDiscord<Phil> (edit) "data-object that" => "data-object, which the Controller then" | "data-object, which the Controller thencan ... befor" added "transform into whatever shape it wants it to" | "JSON-serialized" => "for JSON-serialization" | "turned" => "turn"
10:35:45FromDiscord<Phil> The service layer for its job calls the repository layer, which contains DB representations of your data and transforms that into the actual business-obejcts you wants
10:35:54FromDiscord<Phil> (edit) "business-obejcts" => "business-objects" | "wants" => "want in your services"
10:57:28FromDiscord<xeamek> Is it just me, or is play.nim-lang.org down?
10:58:02PMunchIt is indeed
10:58:11PMunch@Phil, do you want to give it a go?
10:58:28FromDiscord<Phil> on it
11:00:09PMunchHmm, I think there might actually be a log file which grows too big
11:01:03FromDiscord<Phil> Reboot it was
11:01:17PMunchYeah that clears the log file
11:01:34FromDiscord<Phil> Ah shit, should've checked that first
11:02:43PMunchI snuck in before you and did ;)
11:03:00PMunchThe /tmp/nim_playground.log grows unbounded, filling up the disk
11:03:30PMunchReboot deletes everything in /tmp (even though it's not mounted as a tmpfs on this machine)
11:04:50FromDiscord<Phil> Wait we haven't set up a rule for that
11:04:55FromDiscord<Phil> (edit) "that" => "that?"
11:05:13FromDiscord<Phil> Oh wait, nim_playground.log, not journalctl
11:09:24PMunchYeah, we should probably just move all those file logging statements to simple echo statements and let journalctl deal with it
11:34:11*jmdaemon quit (Ping timeout: 245 seconds)
11:52:02FromDiscord<xeamek> Could You help me understand why this type of iteration doesn't compile (but the commented out does)?↵https://play.nim-lang.org/#ix=4EiK
12:00:36FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EiM
12:00:45PMunchSame..
12:06:31FromDiscord<xeamek> #for i in 0..<next.len:
12:06:34FromDiscord<xeamek> (edit) "#for" => "for"
12:07:03PMunchThat would work as well
12:07:11PMunchSame with `for i in 0..next.high`
12:07:37PMunchThose `var State` elements in your object is not allowed though
12:08:03PMunch`var` is only used to declare variables, and pass editable arguments to functions
12:10:26FromDiscord<xeamek> ah, I see now
12:11:03FromDiscord<xeamek> thx
12:12:56PMunchIt should have told you this in the compilation error by the way. Didn't you get something like "unexpected var in object declaration"?
12:15:26*blackbeard420_ quit (Quit: ZNC 1.8.2 - https://znc.in)
12:15:40*blackbeard420 joined #nim
12:19:35FromDiscord<burnysc2> sent a code paste, see https://play.nim-lang.org/#ix=4EiR
12:21:47PMunchburnysc2, unfortunately `case` is not able to work like a `when` statement.
12:22:33PMunchThe compiler is of course different, because your code and types are all runtime values to it, so it would be using an `if` if it weren't for the case.
12:23:31PMunchOf course in this case you could just do a simple overload
12:24:43PMunchhttps://play.nim-lang.org/#ix=4EiU
12:30:45FromDiscord<burnysc2> thank you, i haven't thought about trying to use overloading like this for this case
12:58:36PMunchThe easiest solution is sometimes the best
13:15:30*rockcavera joined #nim
14:08:04*PMunch quit (Remote host closed the connection)
14:08:24*PMunch joined #nim
14:25:37*PMunch quit (Quit: Leaving)
14:37:17FromDiscord<heysokam> @pmunch I take the Vulkan approach, with temporary objects that take options and are named depending on their usecase↵That way I can set default values for the objects in the objects themselves, without poluting the functions with 10mill parameters
14:52:35FromDiscord<xeamek> sent a code paste, see https://play.nim-lang.org/#ix=4Ejq
14:55:59FromDiscord<Prestige> Previously I was able to cast a string to a Pcuchar, now it's a compiler error. How can I provide a `Pcuchar` to a function now (that's pointing at a string)?
15:10:39FromDiscord<duskhorn> sent a code paste, see https://play.nim-lang.org/#ix=4Ejy
15:14:34*lucasta_ quit (Ping timeout: 246 seconds)
15:31:20FromDiscord<odexine> Because it’s gated behind a statement that checks if you’re not on windows?
15:38:23FromDiscord<duskhorn> In reply to @odexine "Because it’s gated behind": I'm so stupid LOL
15:38:44FromDiscord<odexine> We all got them moments don’t worry lol
15:39:05FromDiscord<duskhorn> So how am I supposed to create a new X509_STORE?
15:39:57FromDiscord<duskhorn> Like, I can't use that on windows at all from Nim? Do I create my own wrapper?
15:40:43FromDiscord<jviega> I pointed you to the answer to this a couple of days ago
15:41:06FromDiscord<duskhorn> In reply to @jviega "I pointed you to": yeah, I'm following that answer
15:41:39FromDiscord<jviega> Here's some C you can adapt it into something you {.emit.} and wrap:
15:41:39FromDiscord<duskhorn> my problem is another one right now. I just discovered I can't use some of nim's openssl module lol
15:41:45FromDiscord<jviega> sent a code paste, see https://play.nim-lang.org/#ix=4EjG
15:42:37FromDiscord<jviega> That code creates an X509 store, populating it from the Windows store. You just need it to return you a reference in Nim
15:43:24FromDiscord<duskhorn> sent a code paste, see https://play.nim-lang.org/#ix=4EjH
15:44:06FromDiscord<duskhorn> https://github.com/nim-lang/Nim/blob/ef63d47ecd10b4f1cd96da7a491a85fee6ab5965/lib/wrappers/openssl.nim#L833
15:44:57FromDiscord<jviega> I don't understand your issue, you just importc them yourself
15:45:41FromDiscord<jviega> For this:
15:45:46FromDiscord<odexine> The library probably needs updating anyway, maybe open an issue
15:45:47FromDiscord<jviega> sent a code paste, see https://play.nim-lang.org/#ix=4EjI
15:46:00FromDiscord<duskhorn> In reply to @jviega "I don't understand your": yeah I can't do much more
15:47:30FromDiscord<jviega> Worst case, just edit your local version of the openssl wrapper
15:47:47FromDiscord<duskhorn> sent a code paste, see https://play.nim-lang.org/#ix=4EjJ
15:48:35FromDiscord<jviega> That importc is nim declaring that the function it names available in C. You will need to call it. It does NOT populate the cert store
15:48:46FromDiscord<jviega> The C code above populates the cert store
15:48:50FromDiscord<duskhorn> of course, I understand how importc works
15:48:55FromDiscord<duskhorn> ah alright
15:49:16FromDiscord<duskhorn> so instead of creating a new one like in the snippet, you get the cert store one
15:51:17FromDiscord<jviega> Once you've told OpenSSL where the cert store is, you will only need to do something like: let context = newContext(verifyMode = CVerifyPeer)
15:51:19FromDiscord<jviega> client = newHttpClient(sslContext=context, timeout=timeout)
15:51:38FromDiscord<jviega> Hit enter before formatting sorry
15:51:42FromDiscord<jviega> You get the idea
15:51:53FromDiscord<jviega> Timeout is in ms, so 5000 is a decent number
15:52:54FromDiscord<duskhorn> In reply to @jviega "Once you've told OpenSSL": ok! That's what I figured \:D↵the problem was the whole snippet above. Thanls
15:52:56FromDiscord<duskhorn> (edit) "Thanls" => "Thanks"
15:55:05FromDiscord<jviega> Yeah, obviouly rename it from main(), but then you'll need to take the X509 store you've just copied from Windows and tell OpenSSL to use it
15:55:15FromDiscord<jviega> That's easy though: https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set1_cert_store.html
15:56:11FromDiscord<jviega> The version of the function with the '1' transfers memory ownership, so you shouldn't then free
15:57:52FromDiscord<jviega> Oh whoops, opposite, 1 doesn't transfer
15:58:07FromDiscord<jviega> The 0's transfer
16:01:10FromDiscord<duskhorn> In reply to @jviega "Yeah, obviouly rename it": alr, is there an easy way to test if this works?
16:01:26FromDiscord<Chronos [She/Her]> Ngl I wonder how difficult it'd be to reimplement Nim's parser from scratch
16:01:34FromDiscord<Chronos [She/Her]> For no other reason other than curiosity
16:01:47FromDiscord<Chronos [She/Her]> Macros would probably break but oh well
16:02:10FromDiscord<jviega> Use it to hit a big web site like google and check the return value
16:08:13NimEventerNew post on r/nim by angel__-__-: nvim treesitter for nim on macOS?, see https://reddit.com/r/nim/comments/15z86zj/nvim_treesitter_for_nim_on_macos/
16:15:12NimEventerNew thread by Allin: GuildenStern web server 6.0.0 is here, see https://forum.nim-lang.org/t/10433
16:19:13NimEventerNew thread by Allin: SQLiteral db driver 4.0.0 is here, see https://forum.nim-lang.org/t/10434
16:27:00FromDiscord<jviega> @duskhorn if you have it working, definitely is worth a PR
16:56:56FromDiscord<duskhorn> In reply to @jviega "<@786958459878637589> if you have": nah it's not working
16:58:08FromDiscord<duskhorn> I give up
17:05:53FromDiscord<jviega> Lol if I were a windows person in the slightest I'd help you out, but I haven't done any windows dev since 3.1
17:11:34*def- quit (Quit: -)
17:11:46*def- joined #nim
17:19:33FromDiscord<saint._._.> https://nim-lang.org/docs/sets.html#HashSet
17:20:03FromDiscord<saint._._.> Etc?
17:20:06FromDiscord<saint._._.> sent a code paste, see https://play.nim-lang.org/#ix=4Ek7
17:20:15FromDiscord<saint._._.> It seems kinda confusing to figure out how to use a set just from the docs here
17:20:24FromDiscord<saint._._.> Wondering if people think that sort of example is unnecessary
17:40:06*azimut quit (Ping timeout: 246 seconds)
17:43:36FromDiscord<jviega> sent a long message, see http://ix.io/4Eki
17:52:44FromDiscord<pmunch> Give me a minute, I just have to pack some tools away
17:52:55FromDiscord<jviega> No hurry, thanks very much
18:08:29FromDiscord<pmunch> sent a long message, see http://ix.io/4Eko
18:10:48FromDiscord<jviega> No the int n is a pointer to the length. I am pretty sure when I tried ptr UncheckedArray[fooT] I was getting an error, hmm. And then how about a destructor for such a thing? Obviously I just need it to proxy to free but I couldn't figure out the syntax.
18:11:05FromDiscord<jviega> And retype was telling me I could only retype fields, not the parameters
18:11:18FromDiscord<saint._._.> How do you do optional parameters in a proc in nim? Do I have to do Option[type] ?
18:11:33FromDiscord<jviega> Meaning the caller can optionally provide them?
18:11:53FromDiscord<jviega> Because if so, you can just provide a default value
18:24:02FromDiscord<saint._._.> I wanted to check if it was used or not
18:24:12FromDiscord<saint._._.> But I think I figured it out, I have to use Option[]
18:24:16FromDiscord<saint._._.> And then check isSome
18:24:16FromDiscord<jviega> Then Option is your best bet
18:24:22FromDiscord<saint._._.> Is that right?
18:24:26FromDiscord<jviega> Yes
18:24:37FromDiscord<jviega> It's a bit clunky/verbose but it's the way to do it
18:30:03FromDiscord<saint._._.> @jviega If I put a parameter as Option and don't include it it says missing parameter
18:30:54FromDiscord<jviega> `proc x(x: Option[SomeType] = none(SomeType)) = ...`
18:30:59FromDiscord<jviega> That sets a default value.
18:31:39FromDiscord<jviega> You can do the same thing w/o option if there's a canonical value that is "empty", but then you're not forced to check it. Still, I'll still do it with strings:
18:32:38FromDiscord<jviega> sent a code paste, see https://play.nim-lang.org/#ix=4Ekw
18:34:44FromDiscord<jviega> For objects, `none(ObjType)` should generally work, and if it's a ref object, soft cast of nil will def work (eg, `x: RefType = RefType(nil)`)
18:35:38FromDiscord<jviega> The later would be if you're willing to not have the force to do the nil check; I personally still wrap that in an Option[]
18:42:07FromDiscord<pmunch> Hmm, for destructors you'll have to use some tricks with distinct I believe. I would have to look at some of my old code to figure it out. If @ElegantBeouf is around he might remember how to do it
18:43:14FromDiscord<saint._._.> Oh okay thanks @jviega
18:44:51FromDiscord<Elegantbeef> `type MyObject = distinct MyRef`
18:45:08FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EkA
18:45:14FromDiscord<jviega> Okay, at some point when I have some real time, it'd be good to produce more docs on this kind of stuff to help people put more high level interfaces on top of the output
18:45:26FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4EkA" => "https://play.nim-lang.org/#ix=4EkB"
18:46:17FromDiscord<Elegantbeef> Phil it means memory was used before it was initialised
18:46:54FromDiscord<Elegantbeef> Which means you practically did `var i = createU(int); i[] += 1`
18:47:02FromDiscord<Phil> But that seems like the kind of thing that should've super blown up in my face
18:48:09FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EkD
18:48:59FromDiscord<Phil> It should be noted that all types of x are ref-types
18:49:24FromDiscord<Phil> (edit) "ref-types" => "ref-types, so the first part is me figuring out the memory location for debugging purposes, which that dollar proc is for"
18:51:58FromDiscord<Phil> Basically every single use of `fmt` is showing up as a valgrind error
18:52:02FromDiscord<Phil> Which I'm not sure what to think of
18:56:18FromDiscord<jviega> I've not bothered in the slightest to run valgrind on my nim because I've continued to use refc, which, as long as it's not dropping roots in the std library somewhere, should be fine. Could easily imagine false positives too.
18:57:03FromDiscord<Phil> Aaaand this is the kind of reason I was asking because I wasn't even sure if valgrind does false positives / what the general "vibes" around it are.
18:57:35FromDiscord<Phil> Because I do not have the expertise to test the validity of this stuff myself, so I have to trust the tools that I use are good at what they do.
18:59:09FromDiscord<Phil> What massively confuses me though is that apparently I don't get memory leaks even if I do not unsubscribe
18:59:10FromDiscord<sirolaf> Try with `-d:useMalloc`
18:59:12FromDiscord<Phil> Which is like... what?
18:59:46FromDiscord<Phil> Note that I'm writing a lib there, so I'm mostly trying to make sure I don't screw anyone over with memory leaks
19:00:01FromDiscord<Phil> I can't really assume that every user will use `-d:useMalloc`
19:00:27FromDiscord<sirolaf> They won't but valgrind doesn't work without malloc because nim does some stuff it doesn't understand afaik
19:00:49FromDiscord<Phil> Ohhhhhhhh
19:01:36FromDiscord<Phil> Oh hey that almost halved the error count, down to ~300
19:02:04FromDiscord<Phil> And some of the errors come from code that is not mine...?
19:03:34FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EkH
19:04:38FromDiscord<Phil> But apparently those make up at least a third of the errors (around 100)
19:04:52FromDiscord<Phil> (edit) "at least" => "around"
19:05:58FromDiscord<sirolaf> Use arc/orc, assume this is refc
19:06:40FromDiscord<Phil> It is in fact orc
19:07:04FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EkI
19:07:28FromDiscord<jviega> Oh last n times I've run orc, it's leaked like a sieve. I'm sure it's better now, but I won't be moving over anytime soon.
19:08:46FromDiscord<Phil> Amount of errors between orc and refc is pretty much unchanged
19:09:20FromDiscord<Phil> So the vibes I'm getting is that valgrind is a bit overeager in its reporting to the point of not being useful?
19:17:38FromDiscord<Phil> In reply to @jviega "Oh last n times": Out of curiosity, how did you notice that?↵Just practical tests ala letting the code run over and over again and watching your memory useage?↵Valgrind?
19:17:53FromDiscord<Phil> (edit) "useage?↵Valgrind?" => "useage?↵Valgrind?↵Basically, what are the things to look at?"
19:22:10FromDiscord<sirolaf> <https://github.com/nim-lang/Nim/issues/22510> there is also this issue, so if there is a leak it might not be your fault
19:23:24FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EkL
19:40:56FromDiscord<Andreas> sent a long message, see http://ix.io/4EkP
19:44:12*advesperacit quit (Ping timeout: 248 seconds)
19:49:10*advesperacit joined #nim
20:01:40FromDiscord<saint._._.> Anyone know how to get the "innerHTML" of an xml node in nim?
20:01:52FromDiscord<saint._._.> So the content without the main tag
20:04:05FromDiscord<saint._._.> I think innertext doesnt work cause it doesn't include nested tags
20:08:09FromDiscord<Elegantbeef> @heysokam\: https://play.nim-lang.org/#ix=4EkZ works fine
20:15:08FromDiscord<jviega> @Phil can tell when memory is growing over time much faster that it is when it's using the gc, etc.
20:16:02FromDiscord<jviega> That post SirOlaf posted would represent the best experience I had.
20:20:48FromDiscord<.maverk> does nim have interface like golang ?
20:21:14FromDiscord<Elegantbeef> Not in the language but people have made libraries like iface to add it
20:21:35FromDiscord<Elegantbeef> You can get a lot of development done using generic interfaces that are statically dispatched
20:22:02FromDiscord<.maverk> In reply to @Elegantbeef "Not in the language": i am not a fan of interfaces
20:22:11FromDiscord<.maverk> i hate them hhhh
20:22:16FromDiscord<Elegantbeef> So then why did you ask
20:22:30FromDiscord<.maverk> just because of ai
20:22:37FromDiscord<.maverk> i asked it and said yes
20:22:42FromDiscord<.maverk> so i had to make sure
20:23:50FromDiscord<Andreas> well, so thats how AI improves human communications - welcome to the future
20:36:50*jmdaemon joined #nim
21:08:21*advesperacit quit ()
21:10:06FromDiscord<BanannaMan> sent a long message, see http://ix.io/4Elb
21:10:17FromDiscord<BanannaMan> (edit) "http://ix.io/4Elb" => "http://ix.io/4Elc"
21:14:02FromDiscord<heysokam> In reply to @BanannaMan "Hey guys, what's the": RootObj has inheritance capabilities
21:14:08FromDiscord<juan_carlos> In reply to @BanannaMan "Hey guys, what's the": Add asterisk to things that need to be public only.
21:15:48FromDiscord<heysokam> as for the public/private, you will know as soon as you start to develop an specific application with specific needs↵but basically its a way to stop parts of the object from being accessed when they should not be accessed from other modules↵In short, make things private by default (aka dont add the ) and then add it when you need things from that object in another module
21:15:48FromDiscord<BanannaMan> In reply to @juan_carlos "Add asterisk to things": I know but if I add the asterisk to the type object, will that also make the fields public?
21:15:59FromDiscord<heysokam> In reply to @BanannaMan "I know but if": no, only the object itself
21:16:05FromDiscord<heysokam> even if its the type
21:16:19FromDiscord<juan_carlos> In reply to @BanannaMan "I know but if": Nope.
21:16:28FromDiscord<heysokam> you can have an exported/public type, that has multiple fields internally and you didnt make any of them public
21:17:17FromDiscord<BanannaMan> Oh okay
21:17:37FromDiscord<BanannaMan> In reply to @heysokam "as for the public/private,": What is the point of making things private be default?
21:17:56FromDiscord<BanannaMan> (edit) "be" => "by"
21:18:31FromDiscord<heysokam> In reply to @BanannaMan "What is the point": safety by default↵the compiler will scream at you by default, which is a really good thing
21:18:51FromDiscord<heysokam> if it was public by default, but you didn't want it public, and that is bug-inducing, then you would be in trouble
21:19:01FromDiscord<BanannaMan> I thought that it was to prevent reverse engineering lol
21:19:29FromDiscord<heysokam> nah, its just so the compiler screams at you when you forget it
21:19:44FromDiscord<BanannaMan> In reply to @heysokam "if it was public": Ah okay. So make my type objects private and then depending on field usage, selectively make those public for use in other modules?
21:19:58FromDiscord<heysokam> In reply to @BanannaMan "Ah okay. So make": yeah, as a general rule that's the mindset
21:20:17FromDiscord<BanannaMan> Alright thanks. Wish me luck on my complicated ass project
21:28:02FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4Elj
21:29:59FromDiscord<heysokam> is there a way to assert that a function instance of a generic does-not exist? 🤔
21:31:56FromDiscord<heysokam> i know i can just call it and make the compiler crash on missing function, but wonder if I can assert that it doesn't exist and still compile normally, and pass the `check doesntExist` in the unittests
21:34:09FromDiscord<Phil> In reply to @jviega "<@180601887916163073> can tell when": So basically you were running your binary and monitoring your system's memory consumpion with htop or similar?
21:34:53FromDiscord<jviega> Yeah and generally it was obvious stuff was wrong fast. It was leaking badly enough you'd get performance issues or even crashes
21:38:22FromDiscord<Phil> sent a long message, see http://ix.io/4Ell
21:39:16FromDiscord<jviega> Well, you are well served to do some load testing / performance testing
21:40:29FromDiscord<Phil> Eh, fair, might as well write a small test-suite that fires against the production server to see if it keels over
22:05:08*azimut joined #nim
22:31:57FromDiscord<.maverk> is there a yield keyword like python in nim ?
22:32:19FromDiscord<.maverk> i want to keep returning from a function
22:38:24FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4Elx
22:38:42FromDiscord<heysokam> iterator are a specific type of template for this usecase
22:39:58FromDiscord<.maverk> sent a code paste, see https://play.nim-lang.org/#ix=4Ely
22:40:10FromDiscord<heysokam> In reply to @.maverk "what is iterator ?": a template that keeps returning
22:41:29FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4ElC
22:42:33FromDiscord<.maverk> sent a code paste, see https://play.nim-lang.org/#ix=4ElD
22:42:47FromDiscord<.maverk> sent a code paste, see https://paste.rs/oBnJ5
22:42:57FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4ElF
22:43:03FromDiscord<heysokam> you need to call it in a for loop
22:43:44FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4ElG
22:44:29FromDiscord<.maverk> it works
22:45:12FromDiscord<.maverk> thanks brother