<< 27-07-2023 >>

00:04:52*jkl joined #nim
02:55:18*azimut quit (Ping timeout: 240 seconds)
02:57:31*Guest6443 joined #nim
03:12:34FromDiscord<.matrixagent> In reply to @.matrixagent "im building an order": a little update, been using nim ever since and its such an amazing language
03:12:53FromDiscord<.matrixagent> it feels like the python that i've always wanted
03:12:59FromDiscord<.matrixagent> fast,elegant,easy to use
03:15:28FromDiscord<.matrixagent> In reply to @_gumbercules "If you were building": im not going for the web i am going for react native
03:15:35FromDiscord<.matrixagent> which is partly web
03:16:49*Guest6443 quit (Ping timeout: 260 seconds)
04:06:59FromDiscord<gogolxdong666> https://media.discordapp.net/attachments/371759389889003532/1133973786501324841/image.png
04:08:24FromDiscord<that_dude.> Is everything properly imported and exported where needed?
04:12:47FromDiscord<gogolxdong666> https://media.discordapp.net/attachments/371759389889003532/1133975245364146217/image.png
04:15:13FromDiscord<odexine> Check branch
04:15:13FromDiscord<that_dude.> No idea sorry
04:15:20FromDiscord<odexine> Is it the same tag as your installed version
04:20:32FromDiscord<gogolxdong666> install new version fixed.
04:20:37FromDiscord<spacescooter> What do Nim users call themselves?
04:20:44FromDiscord<spacescooter> Nim'ers?
04:35:39FromDiscord<odexine> Lots of opinions here, some say Nimions
04:35:48FromDiscord<odexine> There’s a forum post discussing this iirc
05:07:35FromDiscord<xtrayambak> can `std/httpclient` not connect to `localhost` ports?
05:37:04FromDiscord<Elegantbeef> It should be able to, it should be down to the OS to resolve that
06:26:41*ntat joined #nim
06:42:40FromDiscord<伊弉冉の恵み> In reply to @spacescooter "What do Nim users": nimidians is my suggestion
06:43:50Amun-Ramy proposition is: Knights Who Say "Nim!"
06:45:18FromDiscord<spacescooter> Nim-knights.↵lol people would think nim users are neckbeards.
06:46:05FromDiscord<odexine> Are they not?
06:46:24FromDiscord<Daniel Belmes> “Nims”
06:46:53NimEventerNew thread by ingo: 0 copy transfer of strings and blobs to SQLite?, see https://forum.nim-lang.org/t/10360
06:50:22FromDiscord<spacescooter> In reply to @odexine "Are they not?": Since syntax is similar to python. I would have thought not.
06:54:07FromDiscord<odexine> True
06:57:18*rockcavera quit (Remote host closed the connection)
06:57:53Amun-Rawe'd just be little bit more socially awkward… https://www.syfy.com/sites/syfy/files/2020/04/terry-jones-monty-python-and-the-holy-grail.jpg
07:11:42*arkanoid quit (*.net *.split)
07:11:42*jmdaemon quit (*.net *.split)
07:11:42*cnx quit (*.net *.split)
07:11:42*def- quit (*.net *.split)
07:11:43*cyraxjoe quit (*.net *.split)
07:11:43*henrytill quit (*.net *.split)
07:11:43*hexeme_ quit (*.net *.split)
07:11:43*oisota quit (*.net *.split)
07:11:43*alice quit (*.net *.split)
07:11:43*gshumway quit (*.net *.split)
07:11:43*Lord_Nightmare quit (*.net *.split)
07:11:44*fallback quit (*.net *.split)
07:11:44*ormiret quit (*.net *.split)
07:11:44*anddam quit (*.net *.split)
07:11:44*Ekho quit (*.net *.split)
07:11:44*LyndsySimon quit (*.net *.split)
07:11:44*Batzy quit (*.net *.split)
07:11:44*dv^_^ quit (*.net *.split)
07:11:44*nyeaa492842301 quit (*.net *.split)
07:11:44*systemdsucks quit (*.net *.split)
07:11:45*Jjp137 quit (*.net *.split)
07:11:45*pbsds quit (*.net *.split)
07:11:45*syl quit (*.net *.split)
07:11:46*oddish quit (*.net *.split)
07:11:46*deadmarshal_ quit (*.net *.split)
07:11:46*noeontheend quit (*.net *.split)
07:11:46*via quit (*.net *.split)
07:11:46*Arthur quit (*.net *.split)
07:11:46*tinystoat quit (*.net *.split)
07:11:46*madprops quit (*.net *.split)
07:11:46*blackbeard420 quit (*.net *.split)
07:11:46*_________ quit (*.net *.split)
07:11:46*lumidify quit (*.net *.split)
07:11:46*mahlon quit (*.net *.split)
07:11:47*adium quit (*.net *.split)
07:11:47*attah quit (*.net *.split)
07:11:47*hernan quit (*.net *.split)
07:11:47*lain quit (*.net *.split)
07:11:47*om3ga quit (*.net *.split)
07:11:47*oprypin quit (*.net *.split)
07:11:47*ehmry quit (*.net *.split)
07:11:47*termer quit (*.net *.split)
07:11:47*euantorano_ quit (*.net *.split)
07:11:47*acidsys quit (*.net *.split)
07:11:47*adigitoleo quit (*.net *.split)
07:11:47*Mister_Magister quit (*.net *.split)
07:11:47*notchris quit (*.net *.split)
07:11:47*cm quit (*.net *.split)
07:11:47*oz quit (*.net *.split)
07:11:47*GreaseMonkey quit (*.net *.split)
07:11:47*nisstyre quit (*.net *.split)
07:11:47*bmp quit (*.net *.split)
07:11:47*casaca quit (*.net *.split)
07:11:47*mronetwo quit (*.net *.split)
07:11:47*void09 quit (*.net *.split)
07:11:47*cedb quit (*.net *.split)
07:11:48*m5zs7k quit (*.net *.split)
07:11:48*FromDiscord quit (*.net *.split)
07:11:48*dza quit (*.net *.split)
07:11:48*Onionhammer quit (*.net *.split)
07:11:48*calebjohn quit (*.net *.split)
07:11:48*marcus quit (*.net *.split)
07:11:48*tanami quit (*.net *.split)
07:11:48*tk quit (*.net *.split)
07:11:48*koltrast_ quit (*.net *.split)
07:11:48*robertmeta quit (*.net *.split)
07:11:48*frenchboy[m] quit (*.net *.split)
07:11:48*psydruid quit (*.net *.split)
07:11:48*Amun-Ra quit (*.net *.split)
07:11:48*mal``` quit (*.net *.split)
07:11:48*jkl quit (Max SendQ exceeded)
07:17:45*tanami joined #nim
07:17:45*marcus joined #nim
07:17:45*calebjohn joined #nim
07:17:45*Onionhammer joined #nim
07:17:45*dza joined #nim
07:17:45*FromDiscord joined #nim
07:17:45*m5zs7k joined #nim
07:17:45*cedb joined #nim
07:17:45*void09 joined #nim
07:17:45*mal``` joined #nim
07:17:45*Amun-Ra joined #nim
07:17:45*systemdsucks joined #nim
07:17:45*nyeaa492842301 joined #nim
07:17:45*dv^_^ joined #nim
07:17:45*robertmeta joined #nim
07:17:45*koltrast_ joined #nim
07:17:45*tk joined #nim
07:17:45*cnx joined #nim
07:17:45*jmdaemon joined #nim
07:17:45*arkanoid joined #nim
07:17:54*alice joined #nim
07:17:54*gshumway joined #nim
07:17:58*fallback joined #nim
07:17:58*ormiret joined #nim
07:17:58*anddam joined #nim
07:17:58*LyndsySimon joined #nim
07:17:58*Batzy joined #nim
07:18:09*def- joined #nim
07:18:09*cyraxjoe joined #nim
07:18:09*hexeme_ joined #nim
07:18:09*oisota joined #nim
07:19:01*adigitoleo joined #nim
07:19:01*mronetwo joined #nim
07:19:01*oddish joined #nim
07:19:01*noeontheend joined #nim
07:19:01*casaca joined #nim
07:19:01*bmp joined #nim
07:19:01*henrytill joined #nim
07:19:01*Jjp137 joined #nim
07:19:01*blackbeard420 joined #nim
07:19:01*_________ joined #nim
07:19:01*pbsds joined #nim
07:19:01*syl joined #nim
07:19:01*om3ga joined #nim
07:19:01*lumidify joined #nim
07:19:01*oprypin joined #nim
07:19:01*mahlon joined #nim
07:19:01*deadmarshal_ joined #nim
07:19:01*ehmry joined #nim
07:19:01*via joined #nim
07:19:01*Arthur joined #nim
07:19:01*tinystoat joined #nim
07:19:01*termer joined #nim
07:19:01*euantorano_ joined #nim
07:19:01*madprops joined #nim
07:19:01*lain joined #nim
07:19:01*hernan joined #nim
07:19:01*attah joined #nim
07:19:01*adium joined #nim
07:21:17*nisstyre joined #nim
07:21:17*GreaseMonkey joined #nim
07:21:17*oz joined #nim
07:21:17*cm joined #nim
07:21:17*notchris joined #nim
07:21:17*Mister_Magister joined #nim
07:21:36*Mister_Magister quit (Max SendQ exceeded)
07:21:50*Lord_Nightmare joined #nim
07:21:54*jkl joined #nim
07:22:00*Mister_Magister joined #nim
07:22:45*Ekho joined #nim
07:24:12*acidsys joined #nim
07:25:03*frenchboy[m] joined #nim
07:32:34FromDiscord<ieltan> In reply to @spacescooter "Nim-knights. lol people would": We're just a bunch of little nimlings
07:32:57FromDiscord<ieltan> :p
08:18:51*m5zs7k quit (Ping timeout: 250 seconds)
08:21:00*m5zs7k joined #nim
08:28:09*ntat quit (Quit: leaving)
08:35:21*disso-peach joined #nim
10:21:57*xet7 joined #nim
10:36:00FromDiscord<segfault007> sent a code paste, see https://play.nim-lang.org/#ix=4BBi
10:36:03*psydruid joined #nim
10:36:11FromDiscord<segfault007> `end` is a liner defined symbol.
10:36:35FromDiscord<segfault007> sent a code paste, see https://play.nim-lang.org/#ix=
10:37:11FromDiscord<segfault007> (edit) "liner" => "linker"
10:43:43FromDiscord<djazz> How would you access it in C?
10:44:13FromDiscord<djazz> Maybe similar to what I do on embedded to get the stack size https://github.com/daniel-j/nim-picosdk/blob/master/src/picostdlib/memoryinfo.nim
10:44:21FromDiscord<djazz> First few lines
10:48:01FromDiscord<segfault007> Thank @djazz. In C I would basically declare something like `extern unsigned long end`.
10:48:14FromDiscord<segfault007> The linker would resolve that extern reference correctly.
10:49:24FromDiscord<segfault007> I'll have a look at your code, thanks for sharing.
11:01:11*jmdaemon quit (Ping timeout: 260 seconds)
11:01:16FromDiscord<segfault007> j
11:02:53FromDiscord<segfault007> Turns out that I shouldn't have used the `nodecl` pragma! I can access the linker defined symbol after all. 🙂
11:02:55FromDiscord<segfault007> Thanks!
11:03:21FromDiscord<djazz> Hmm yea, ive never used nodecl with importc
11:03:47FromDiscord<segfault007> I probably did a hasty cut and paste job from some reference code I saw.
11:55:28*dv^_^ quit (Quit: Ping timeout (120 seconds))
11:55:56*dv^_^ joined #nim
12:26:03*azimut joined #nim
12:27:26*lucasta joined #nim
13:19:25FromDiscord<xtrayambak> It seems `nim-wlroots` is too old to compile with the newer releases, but it seems that it uses dynamic linking at the same time... weird.
14:03:06*rockcavera joined #nim
14:11:29*xet7 quit (Remote host closed the connection)
14:21:41*lucasta quit (Quit: Leaving)
14:41:34FromDiscord<Phil> What was the syntax for annotating a type with a pragma with 2 parameters again?
14:44:14FromDiscord<Phil> Ahhh found it `{.map(sourceName="name", targetName="otherName").}`
16:01:42FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4BCu
16:07:17FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4BCy
16:08:16FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4BCz
16:10:56FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4BCD
16:11:02FromDiscord<ieltan> In reply to @michaelb.eth "and add below those": Doesn't echo anything either
16:13:47FromDiscord<Phil> sent a long message, see http://ix.io/4BCG
16:15:53FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4BCJ
16:20:32FromDiscord<ieltan> In reply to @demotomohiro "It seems a macro": Would be a shame I really need to have the macro introspect the variable at declaration, I've been told it could work so it might be a bug?
16:22:18FromDiscord<ieltan> (edit) "bug?" => "regression?"
16:23:20FromDiscord<ieltan> In reply to @Elegantbeef "but it'd be `let": Like this
16:23:26FromDiscord<michaelb.eth> maybe take a look at the implementation of the `{.threadvar.}` macro
16:23:44FromDiscord<michaelb.eth> just guessing here, but as you say seems like there must be a way to do it
16:36:44FromDiscord<Chronos [She/Her]> Hey so I have an image that's just white, and it's meant for skin colours in a game for assets, but I'm trying to figure out how to apply the colour I want onto it with Pixie, what type of blend mode do I need exactly?
16:56:46*junaid_ joined #nim
17:07:06*Jjp137 quit (Read error: Connection reset by peer)
17:07:49*ntat joined #nim
17:11:09*Jjp137 joined #nim
17:17:29FromDiscord<Phil> Doing dynamic programming within the nim typesystem: Harsh, but surprisingly doable. Albeit with rather arbitrary restrictions sometimes
17:17:44FromDiscord<Phil> (edit) "Doing ... dynamic" added "somewhat"
17:17:59FromDiscord<Phil> (edit) "Doing somewhat dynamic programming within the nim typesystem: Harsh, but surprisingly doable. Albeit with rather arbitrary ... restrictions" added "syntax"
17:22:36arkanoidhow can I create a variable (path to .C file) that exists only at compile time and doesn't end up into executable?
17:23:26arkanoidI need to {.compile: ... .} some files, and I would like to remove some boilerplate
17:28:59*jmdaemon joined #nim
17:34:08FromDiscord<demotomohiro> How about to use const?
17:35:36FromDiscord<demotomohiro> And add `--passL:-s` to remove symbols
17:42:00FromDiscord<Daniel Belmes> sent a code paste, see https://play.nim-lang.org/#ix=4BD4
17:43:43FromDiscord<Daniel Belmes> So this works but try adding something like echo lhs and it will fail the same way. I'm assuming since I am no expert that lhs is a NimNode of foo and the macro calls it before it is defined.
17:50:08FromDiscord<Daniel Belmes> nvm was playing around with printing the type and `echo lhs` works just fine. I believe it's only if you do `result = lhs`
17:55:15*jmdaemon quit (Ping timeout: 246 seconds)
18:06:20FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4BDg
18:07:00FromDiscord<ieltan> Also didn't know you could omit the `: untyped`
18:08:48*jmdaemon joined #nim
18:09:27FromDiscord<Daniel Belmes> In reply to @ieltan "Alright, thanks I will": I think the macro in this case just erases the whole decleration. So when you make your macro you're gonna want to build out a new declaration statement with what you want. you can use `dumpTree:` macro to see how to build things out.
18:10:08*junaid_ quit (Remote host closed the connection)
18:15:59*jmdaemon quit (Ping timeout: 250 seconds)
18:18:59*jmd_ joined #nim
18:25:11FromDiscord<Chronos [She/Her]> In reply to @yu.vitaqua.fer.chronos "Hey so I have": Managed to figure this out finally
19:09:55*ntat quit (Ping timeout: 240 seconds)
19:11:59*ntat joined #nim
19:12:13NimEventerNew post on r/nim by Robert_Bobbinson: [Noob questions] Creating a type of type Table with custom object as an index, see https://reddit.com/r/nim/comments/15bajnh/noob_questions_creating_a_type_of_type_table_with/
19:14:14NimEventerNew post on r/nim by Robert_Bobbinson: [Noob question] Creating a type of type Table with custom object as a key, see https://reddit.com/r/nim/comments/15bal4n/noob_question_creating_a_type_of_type_table_with/
19:25:54*droidrage joined #nim
19:27:21FromDiscord<Phil> Awwww I can't make a proc into a func if I do `cast`within it
19:29:33FromDiscord<odexine> well it kinda makes sense no
19:29:41FromDiscord<odexine> well does it, i wonder
19:30:11FromDiscord<odexine> i dont think casts can make "side effects" (at least the definition that funcs use) perhaps
19:33:07*jmd_ quit (Ping timeout: 246 seconds)
19:36:24*qwestion joined #nim
19:37:05FromDiscord<that_dude.> In reply to @isofruit "Awwww I can't make": I thought there was a thing where you can swallow effects and say it's a no side effect op
19:37:43FromDiscord<Phil> In reply to @odexine "i dont think casts": They kind of are a side-effect in the sense that you're reinterpreting memory that in this proc context you only know as pointer
19:38:27FromDiscord<Phil> It's sort of not a safe operation because you do not know all the things ahead of time based on what types give you, you're assuming that some piece of memory that you get handed as a pointer is a certain type, but that is not the compiler giving you any guarantees about it and thus it can all blow up
19:38:45FromDiscord<that_dude.> https://forum.nim-lang.org/t/3318 I thought I remember seeing things like this
19:38:55FromDiscord<Phil> You can cast, but that kind of takes the fun out of it
19:39:15FromDiscord<Phil> I have not larger requirements to make this a func other than giving users guarantees about certain things
19:39:23FromDiscord<Phil> (edit) "I have not larger requirements to make this a func other than giving users guarantees about certain things ... " added "(such as no side-effect)"
19:39:26FromDiscord<that_dude.> Ah Gl
19:39:39FromDiscord<odexine> In reply to @isofruit "They kind of are": yes but is taht in line with the definition of side effect for funcs
19:41:11FromDiscord<Phil> Hmmm on an intuitive level I'd say so, but that is not backed by me reading up on nim's exact definition of func
19:41:59FromDiscord<egomind> That seems like an interesting topic
19:42:15FromDiscord<egomind> If any of you find a post explaining the decision, please let me know
19:42:26FromDiscord<egomind> (I'll look it for later, but I'm busy right now)
19:47:37FromDiscord<Phil> First of, can ref types not be instantaited at compiletime? Am I missing something?
19:48:10FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4BDE
19:49:10FromDiscord<that_dude.> https://nim-lang.org/docs/manual.html#restrictions-on-compileminustime-execution
19:49:37FromDiscord<Phil> noooooooooooooooooooo
19:50:54FromDiscord<Phil> So you straight up can not have a macro that generates `x.name` for you if x is a ref-type?
19:51:01FromDiscord<that_dude.> I was thinking, it would be cool if there were something similar to `static:` but like `subcompile:` where it would generate a whole nim program and evaluate it in both comp time and run time to calculate the info to generate the main static data
19:51:40FromDiscord<that_dude.> I think I read something similar to that used for a grammer parser that's in the compiler/std
19:51:47FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4BDF
19:52:25FromDiscord<that_dude.> Sorry I'm not well versed in ref objects or macros
19:53:23FromDiscord<Phil> I'm basically writing a way to generate simple-ish mapping functions on the fly, blatantly copied from the java MapStruct package.↵So far it's been pretty easy while focussing on value objects
19:53:46FromDiscord<Phil> Pretty concise code too if you think about it
19:57:36FromDiscord<egomind> Mapping functions? :o
19:58:07*ntat quit (Quit: leaving)
19:58:28FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4BDI
19:59:05FromDiscord<Phil> Imagine every type with 4 more fields and defining your own `proc(x: A): C` becomes tedious
19:59:34FromDiscord<Phil> At least that's the usecase, I'm doing it because it's interesting and quick-ish to implement comparatively
20:05:48FromDiscord<Phil> ...How do you check if a type is a ref type ?
20:07:08FromDiscord<Phil> Huh, you can, is ref object apparently
20:11:48FromDiscord<Phil> In reply to @that_dude. "Sorry I'm not well": Turns out I was wrong, you can do all that with ref types at compiletime, just have to keep the procs a bit more generic
20:12:33FromDiscord<Phil> Simple mapping function generator in roughly 100 lines of code
20:12:56FromDiscord<.matrixagent> In reply to @isofruit "...How do you check": what even is the difference between `ref` and `var`
20:13:56FromDiscord<that_dude.> var -> current variable is mutable↵ref -> this variable is pointing to a value
20:14:21FromDiscord<Phil> Practically they tend to both mean ref types and stuff in heap memory afaik so either you can mutate as you want, but semantically what you express with those is different.↵Semantically var explicitly means that you want to be able to mutate this.↵ref just means this is a ref-type which will also be heap allocated and that just so happens to make it always mutable.
20:14:50FromDiscord<.matrixagent> does nim automagicly allocate memory for me? or how would i tell it i want this object on the heap
20:15:06FromDiscord<Phil> ref types are automagically allocated in heap, that's why they're ref types
20:15:28FromDiscord<.matrixagent> hm so ref types are like `new` in C++?
20:15:28FromDiscord<Phil> That's also why only ref types can be nil while value types always have default values
20:15:50FromDiscord<odexine> In reply to @isofruit "Practically they tend to": ??
20:15:55FromDiscord<odexine> var doesnt mean heap allocated
20:16:10FromDiscord<Phil> In reply to @odexine "var doesnt mean heap": Does it not immediately lead to heap allocation?
20:16:14FromDiscord<odexine> no
20:16:15FromDiscord<odexine> no
20:16:21FromDiscord<odexine> discordp lease dont double send like that
20:16:35FromDiscord<.matrixagent> In reply to @isofruit "Does it not immediately": i mean i use var when passing around seq's
20:16:38FromDiscord<Phil> It may not express that but I was under the impression that factually under the hood it did that
20:16:53FromDiscord<Phil> Seqs are always heap allocated as they're not arrays so same difference
20:16:56FromDiscord<odexine> var for variables is just a mutable let, no difference in typing
20:17:04FromDiscord<odexine> or i mean no difference under the hood
20:17:11FromDiscord<.matrixagent> basicly how do i heap allocate something
20:17:21FromDiscord<Phil> new(T)
20:17:26FromDiscord<odexine> var for function parameters mean pointer passing but that pointer could be to stack memory
20:17:38FromDiscord<.matrixagent> i just wrote some simple mummy websocket server around 3k lines and i didnt really allocate any memory manually
20:17:45FromDiscord<Phil> Ah, that's where I got the mixup, I tend to strongly associate pointer with heap
20:17:55FromDiscord<odexine> pointers are not always heap xd
20:18:07FromDiscord<.matrixagent> it should be
20:18:07FromDiscord<Phil> Practically when I write code they very, very rarely aren't
20:18:20FromDiscord<Phil> So sometimes the line gets blurry
20:18:22FromDiscord<.matrixagent> its meaningless if you use pointers to numbers
20:18:31FromDiscord<.matrixagent> copying is better
20:18:41FromDiscord<.matrixagent> unless you make 300 copies
20:18:46FromDiscord<odexine> that's a very bold claim
20:19:00FromDiscord<odexine> and i dont feel like taking the time to refute it, maybe someone else would
20:19:22FromDiscord<.matrixagent> in my 10 years of programming in high performance computing i never really needed to make a pointer to a stack lived object
20:19:34FromDiscord<.matrixagent> simply since stack objects should be small in size
20:19:41FromDiscord<.matrixagent> if its large it goes on the heap
20:20:20FromDiscord<Phil> I mean, depends. If I wanted to make some number into shared mutable state across my application (which is a terrible idea, I know, but there are usecases even if I literally never stumble into them) that seems valid
20:20:46FromDiscord<odexine> i kinda dont think youre wrong anyway
20:21:32FromDiscord<odexine> eh whatever this is besides the point
20:22:14FromDiscord<.matrixagent> In reply to @isofruit "I mean, depends. If": shared mutable state is what gets me fired from my job
20:22:15FromDiscord<Phil> Anyway, @.matrixagent honestly you very rarely need to manually allocate stuff into the heap.↵Somtimes you might want to e.g. throw an Array into heap or a type that otherwise would be a value type (and thus default stack allocated), in those cases you can just use `new`
20:22:42FromDiscord<Phil> Generally ref-types will get heap allocated and the syntax to construct them is identical to constructing value types
20:23:00FromDiscord<.matrixagent> In reply to @isofruit "Anyway, <@664973718325428237> honestly": can you show me an example using new?
20:24:16FromDiscord<.matrixagent> so is it normal to right large programs without heap allocating in nim? since most of not all gc languages just allocate objects on the heap automatically
20:24:27FromDiscord<.matrixagent> or allocate everything on the heap like java and python
20:24:35FromDiscord<.matrixagent> (edit) "right" => "write"
20:24:46FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4BDP
20:25:09FromDiscord<.matrixagent> `echo x is ref`? what does this do
20:26:12FromDiscord<Phil> You got the value type `MyArr`which gets heap allocated via new, you can see that via the echo which checks if it's a "ref" and the x.repr will show as well that it's a ref↵↵ref = reference
20:26:24FromDiscord<Phil> I may have completely forgotten how to actually get the memory address from that thing
20:26:36FromDiscord<Phil> (edit) "I may have completely forgotten how to actually get the memory address from that thing ... " added "if you wanted to check your memory layout"
20:27:50*jjido joined #nim
20:28:03FromDiscord<Phil> > Built-in generic traced pointer type. Source Edit ↵↵That is what a ref is
20:28:47FromDiscord<Phil> (edit) "> Built-in generic traced pointer type. Source Edit ↵↵That is what a ref is ... " added "(https://nim-lang.org/docs/system.html#ref)"
20:30:14FromDiscord<odexine> In reply to @.matrixagent "so is it normal": sequences (similar to python list) and strings are auto-heap
20:30:23FromDiscord<odexine> ref objects are kinda-auto-heap
20:30:25FromDiscord<Phil> How do I get the memory address echo'd out
20:30:33FromDiscord<odexine> of a ref?
20:30:39FromDiscord<Phil> Yep
20:30:41FromDiscord<.matrixagent> man is this confusing
20:31:20FromDiscord<Phil> Nim is kind of trying to make you forget to think about ref and value types and sort of leading you towards mostly using value types all the time
20:31:46FromDiscord<Phil> And when you do need to use ref types it's trying to make it as seamlessly interact with value types to the point you think less about it
20:31:49FromDiscord<odexine> In reply to @.matrixagent "man is this confusing": what are you confused by? maybe we can clarify
20:32:05FromDiscord<odexine> also i swear repr used to print the address
20:32:11FromDiscord<odexine> doesnt seem to anymore
20:32:22FromDiscord<odexine> prolly have to use addr+cast[int] now
20:32:23FromDiscord<that_dude.> In reply to @isofruit "How do I get": I think I used to use something like `cast[int](ref_obj)`
20:32:29FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4BDT
20:32:35FromDiscord<odexine> it prolly does on 1.4
20:32:45FromDiscord<odexine> not sure on 1.6
20:33:08FromDiscord<Phil> Does not on 1.6.10 either
20:33:42FromDiscord<Phil> 1.4 - Binary build unavailable, building from source - Aboooooort miisiiiioooooooon
20:34:09FromDiscord<Phil> Ah, it just required 1.4.0, phew
20:34:21FromDiscord<Phil> Also 1.4. doesn't print the memory address either
20:34:39FromDiscord<.matrixagent> wait repr is like repr in python?
20:34:44FromDiscord<that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4BDU
20:35:07FromDiscord<odexine> i tried even 1.0.10
20:35:10FromDiscord<odexine> no address on repr
20:35:11FromDiscord<odexine> weird
20:35:13FromDiscord<odexine> i dont remember then
20:37:15FromDiscord<Phil> Hmm it's a starting point, though int as opposed to hex representation is something to get used to
20:37:25*tiorock joined #nim
20:37:25*tiorock quit (Changing host)
20:37:25*tiorock joined #nim
20:37:25*rockcavera is now known as Guest576
20:37:25*Guest576 quit (Killed (molybdenum.libera.chat (Nickname regained by services)))
20:37:25*tiorock is now known as rockcavera
20:38:11FromDiscord<Phil> In reply to @.matrixagent "wait repr is like": It's a close equivalent.↵Basically string representation of object data for debugging purposes, same usecase as repr in python
20:38:22FromDiscord<Phil> (edit) "repr" => "\_\_repr\_\_"
20:38:48FromDiscord<odexine> oh
20:38:50FromDiscord<odexine> 1.0.10 does
20:38:51FromDiscord<Phil> The implementation is a bit different because repr here is a generic proc that just works with any of your types afaik
20:38:52FromDiscord<odexine> im dumb
20:39:15FromDiscord<odexine> 1.6.14 does too\
20:39:19FromDiscord<Phil> https://nim-lang.org/docs/system.html#repr%2CT
20:39:23FromDiscord<Phil> Wait what?
20:39:37FromDiscord<odexine> im dumb and forgot that you have to set it to a variable
20:39:38FromDiscord<odexine> lol
20:39:51FromDiscord<odexine> if you dont then its just not stored, compile time eval i assume
20:40:14FromDiscord<.matrixagent> In reply to @isofruit "It's a close equivalent.": thanks!
20:40:17FromDiscord<Phil> It's late over here, I'm not parsing
20:40:44FromDiscord<odexine> echo @[5].repr -> no work↵let a = @[5]; echo repr a -> work
20:41:11FromDiscord<odexine> devel doesnt tho
20:41:26FromDiscord<odexine> might have to do with orc/arc
20:42:07FromDiscord<Phil> >_> ↵<_>
20:42:11FromDiscord<Phil> (edit) ">_> ↵<_>" => ">\_> ↵<\_>"
20:42:11FromDiscord<odexine> <<
20:42:19FromDiscord<odexine> (edit) "<<" => "<-<"
20:42:54FromDiscord<Phil> It just straight up does not allocate memory for @[]↵Which makes perfect sense, but is kinda annoying when you wanted to demonstrate how to look for a memory address using it and forgot about that fact
20:43:08FromDiscord<odexine> oh for an empty seq
20:43:10FromDiscord<odexine> ig so yeah
20:43:27FromDiscord<Phil> I was so confused why all my examples where not giving me memory addresses
20:46:23FromDiscord<Phil> sent a long message, see http://ix.io/4BDW
20:47:09FromDiscord<Phil> (edit) "http://ix.io/4BDW" => "http://ix.io/4BDX"
20:47:38FromDiscord<Phil> Iterating over the fields of an object for example is something that doesn't really work with ref-types, got to unref them first
20:47:52FromDiscord<Phil> so there it's `a[].fieldPairs` rather than `a.fieldPairs`
20:54:46*jmdaemon joined #nim
20:57:00FromDiscord<.matrixagent> In reply to @isofruit "Ah, so again in": unref?
20:57:04FromDiscord<.matrixagent> what do you mean?
20:58:46FromDiscord<Phil> Go from pointer to actual value.↵I think other words would be dereferencing? ↵I really don't deal with languages that much that actually have the concept of pointers/traced references
20:58:54FromDiscord<Phil> (edit) "Go from pointer to actual value.↵I think other words would be dereferencing? ↵I really don't deal with languages that much that actually have the concept of pointers/traced references ... " added "outside of nim"
21:02:21FromDiscord<egomind> Yeah, dereferencing is the term I think
21:02:42FromDiscord<Phil> sent a long message, see http://ix.io/4BE1
21:03:46FromDiscord<Phil> The last paragraph is the reason why a pretty large amount of times you actually don't even notice that you're using a ref-type.↵Personally I really only ever stumble over it when I actually need to iterate over all fields of an object type
21:04:54*xet7 joined #nim
21:05:52FromDiscord<Phil> I feel like nim as a language really prefers stack allocation and working with the stack rather than the heap
21:20:26*tiorock joined #nim
21:20:26*tiorock quit (Changing host)
21:20:26*tiorock joined #nim
21:20:26*rockcavera quit (Killed (platinum.libera.chat (Nickname regained by services)))
21:20:26*tiorock is now known as rockcavera
21:25:48*tiorock joined #nim
21:25:49*tiorock quit (Changing host)
21:25:49*tiorock joined #nim
21:25:49*rockcavera quit (Killed (mercury.libera.chat (Nickname regained by services)))
21:25:49*tiorock is now known as rockcavera
21:34:31*rockcavera quit (Remote host closed the connection)
21:43:58*xaltsc joined #nim
21:44:37*rockcavera joined #nim
21:58:27*xet7 quit (Quit: Leaving)
22:18:28*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
22:34:09*jjido joined #nim
22:42:32FromDiscord<that_dude.> Isn't the stack way faster or smth?
22:47:34*azimut quit (Remote host closed the connection)
22:48:03*azimut joined #nim
22:50:49FromDiscord<Elegantbeef> Depends on what you're doing
22:51:08FromDiscord<Elegantbeef> If you're making a new data type not having to heap allocate is faster yes, but no memory in the stack is not magically faster than memory in the heap
23:00:12FromDiscord<Dale Y Pearlman> Do you know that you can earn $5,000 or more weekly from crypto Trading? With Just $500… 100% Inbox Admin on Telegram for more details 👇👇👇👇👇👇 https://t.me/PROFITSWITHSTEVE
23:01:44FromDiscord<nichrosia> found a potential bug? nim seems to think a ref type can't be captured, and reccomends making it a ref ref type on my device↵https://play.nim-lang.org/#ix=4BEn
23:01:52FromDiscord<nichrosia> wiki gave my the impression making it a ref type would solve it
23:02:41FromDiscord<Elegantbeef> result is a `var T` technically
23:03:12FromDiscord<nichrosia> oh, how does that change things?
23:03:17FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4BEp
23:03:25FromDiscord<Elegantbeef> `var T` cannot be captured cause `var` can point to the stack
23:04:57FromDiscord<nichrosia> ah, I see
23:05:17FromDiscord<nichrosia> wish there was a better error message
23:08:25*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
23:08:29FromDiscord<nichrosia> uh, that causes a segmentation fault
23:08:43FromDiscord<nichrosia> https://play.nim-lang.org/#ix=4BEq
23:12:52FromDiscord<nichrosia> nevermind; I'm dumb - I forgot to initialize `result`, as you have to do when returning a ref object
23:12:59FromDiscord<nichrosia> it works perfectly, thank you!
23:17:05FromDiscord<geekrelief> Where did the docs on Channels go?
23:17:25FromDiscord<Elegantbeef> channels\_builtin
23:18:29FromDiscord<geekrelief> beef where is that? I'm looking at the index here https://nim-lang.github.io/Nim/theindex.html
23:19:08FromDiscord<Elegantbeef> No clue about devel
23:19:28FromDiscord<geekrelief> ok
23:36:51*jmdaemon quit (Ping timeout: 246 seconds)
23:52:42FromDiscord<that_dude.> In reply to @Dale Y Pearlman "Do you know that": <@&371760044473319454>
23:53:06FromDiscord<that_dude.> Thanks
23:54:04FromDiscord<turtlebasket> Do the std/\ SQL clients support async?