00:04:52 | * | jkl joined #nim |
02:55:18 | * | azimut quit (Ping timeout: 240 seconds) |
02:57:31 | * | Guest6443 joined #nim |
03:12:34 | FromDiscord | <.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:53 | FromDiscord | <.matrixagent> it feels like the python that i've always wanted |
03:12:59 | FromDiscord | <.matrixagent> fast,elegant,easy to use |
03:15:28 | FromDiscord | <.matrixagent> In reply to @_gumbercules "If you were building": im not going for the web i am going for react native |
03:15:35 | FromDiscord | <.matrixagent> which is partly web |
03:16:49 | * | Guest6443 quit (Ping timeout: 260 seconds) |
04:06:59 | FromDiscord | <gogolxdong666> https://media.discordapp.net/attachments/371759389889003532/1133973786501324841/image.png |
04:08:24 | FromDiscord | <that_dude.> Is everything properly imported and exported where needed? |
04:12:47 | FromDiscord | <gogolxdong666> https://media.discordapp.net/attachments/371759389889003532/1133975245364146217/image.png |
04:15:13 | FromDiscord | <odexine> Check branch |
04:15:13 | FromDiscord | <that_dude.> No idea sorry |
04:15:20 | FromDiscord | <odexine> Is it the same tag as your installed version |
04:20:32 | FromDiscord | <gogolxdong666> install new version fixed. |
04:20:37 | FromDiscord | <spacescooter> What do Nim users call themselves? |
04:20:44 | FromDiscord | <spacescooter> Nim'ers? |
04:35:39 | FromDiscord | <odexine> Lots of opinions here, some say Nimions |
04:35:48 | FromDiscord | <odexine> There’s a forum post discussing this iirc |
05:07:35 | FromDiscord | <xtrayambak> can `std/httpclient` not connect to `localhost` ports? |
05:37:04 | FromDiscord | <Elegantbeef> It should be able to, it should be down to the OS to resolve that |
06:26:41 | * | ntat joined #nim |
06:42:40 | FromDiscord | <伊弉冉の恵み> In reply to @spacescooter "What do Nim users": nimidians is my suggestion |
06:43:50 | Amun-Ra | my proposition is: Knights Who Say "Nim!" |
06:45:18 | FromDiscord | <spacescooter> Nim-knights.↵lol people would think nim users are neckbeards. |
06:46:05 | FromDiscord | <odexine> Are they not? |
06:46:24 | FromDiscord | <Daniel Belmes> “Nims” |
06:46:53 | NimEventer | New thread by ingo: 0 copy transfer of strings and blobs to SQLite?, see https://forum.nim-lang.org/t/10360 |
06:50:22 | FromDiscord | <spacescooter> In reply to @odexine "Are they not?": Since syntax is similar to python. I would have thought not. |
06:54:07 | FromDiscord | <odexine> True |
06:57:18 | * | rockcavera quit (Remote host closed the connection) |
06:57:53 | Amun-Ra | we'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:34 | FromDiscord | <ieltan> In reply to @spacescooter "Nim-knights. lol people would": We're just a bunch of little nimlings |
07:32:57 | FromDiscord | <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:00 | FromDiscord | <segfault007> sent a code paste, see https://play.nim-lang.org/#ix=4BBi |
10:36:03 | * | psydruid joined #nim |
10:36:11 | FromDiscord | <segfault007> `end` is a liner defined symbol. |
10:36:35 | FromDiscord | <segfault007> sent a code paste, see https://play.nim-lang.org/#ix= |
10:37:11 | FromDiscord | <segfault007> (edit) "liner" => "linker" |
10:43:43 | FromDiscord | <djazz> How would you access it in C? |
10:44:13 | FromDiscord | <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:21 | FromDiscord | <djazz> First few lines |
10:48:01 | FromDiscord | <segfault007> Thank @djazz. In C I would basically declare something like `extern unsigned long end`. |
10:48:14 | FromDiscord | <segfault007> The linker would resolve that extern reference correctly. |
10:49:24 | FromDiscord | <segfault007> I'll have a look at your code, thanks for sharing. |
11:01:11 | * | jmdaemon quit (Ping timeout: 260 seconds) |
11:01:16 | FromDiscord | <segfault007> j |
11:02:53 | FromDiscord | <segfault007> Turns out that I shouldn't have used the `nodecl` pragma! I can access the linker defined symbol after all. 🙂 |
11:02:55 | FromDiscord | <segfault007> Thanks! |
11:03:21 | FromDiscord | <djazz> Hmm yea, ive never used nodecl with importc |
11:03:47 | FromDiscord | <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:25 | FromDiscord | <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:34 | FromDiscord | <Phil> What was the syntax for annotating a type with a pragma with 2 parameters again? |
14:44:14 | FromDiscord | <Phil> Ahhh found it `{.map(sourceName="name", targetName="otherName").}` |
16:01:42 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4BCu |
16:07:17 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4BCy |
16:08:16 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4BCz |
16:10:56 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4BCD |
16:11:02 | FromDiscord | <ieltan> In reply to @michaelb.eth "and add below those": Doesn't echo anything either |
16:13:47 | FromDiscord | <Phil> sent a long message, see http://ix.io/4BCG |
16:15:53 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4BCJ |
16:20:32 | FromDiscord | <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:18 | FromDiscord | <ieltan> (edit) "bug?" => "regression?" |
16:23:20 | FromDiscord | <ieltan> In reply to @Elegantbeef "but it'd be `let": Like this |
16:23:26 | FromDiscord | <michaelb.eth> maybe take a look at the implementation of the `{.threadvar.}` macro |
16:23:44 | FromDiscord | <michaelb.eth> just guessing here, but as you say seems like there must be a way to do it |
16:36:44 | FromDiscord | <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:29 | FromDiscord | <Phil> Doing dynamic programming within the nim typesystem: Harsh, but surprisingly doable. Albeit with rather arbitrary restrictions sometimes |
17:17:44 | FromDiscord | <Phil> (edit) "Doing ... dynamic" added "somewhat" |
17:17:59 | FromDiscord | <Phil> (edit) "Doing somewhat dynamic programming within the nim typesystem: Harsh, but surprisingly doable. Albeit with rather arbitrary ... restrictions" added "syntax" |
17:22:36 | arkanoid | how can I create a variable (path to .C file) that exists only at compile time and doesn't end up into executable? |
17:23:26 | arkanoid | I need to {.compile: ... .} some files, and I would like to remove some boilerplate |
17:28:59 | * | jmdaemon joined #nim |
17:34:08 | FromDiscord | <demotomohiro> How about to use const? |
17:35:36 | FromDiscord | <demotomohiro> And add `--passL:-s` to remove symbols |
17:42:00 | FromDiscord | <Daniel Belmes> sent a code paste, see https://play.nim-lang.org/#ix=4BD4 |
17:43:43 | FromDiscord | <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:08 | FromDiscord | <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:20 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4BDg |
18:07:00 | FromDiscord | <ieltan> Also didn't know you could omit the `: untyped` |
18:08:48 | * | jmdaemon joined #nim |
18:09:27 | FromDiscord | <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:11 | FromDiscord | <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:13 | NimEventer | New 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:14 | NimEventer | New 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:21 | FromDiscord | <Phil> Awwww I can't make a proc into a func if I do `cast`within it |
19:29:33 | FromDiscord | <odexine> well it kinda makes sense no |
19:29:41 | FromDiscord | <odexine> well does it, i wonder |
19:30:11 | FromDiscord | <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:05 | FromDiscord | <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:43 | FromDiscord | <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:27 | FromDiscord | <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:45 | FromDiscord | <that_dude.> https://forum.nim-lang.org/t/3318 I thought I remember seeing things like this |
19:38:55 | FromDiscord | <Phil> You can cast, but that kind of takes the fun out of it |
19:39:15 | FromDiscord | <Phil> I have not larger requirements to make this a func other than giving users guarantees about certain things |
19:39:23 | FromDiscord | <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:26 | FromDiscord | <that_dude.> Ah Gl |
19:39:39 | FromDiscord | <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:11 | FromDiscord | <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:59 | FromDiscord | <egomind> That seems like an interesting topic |
19:42:15 | FromDiscord | <egomind> If any of you find a post explaining the decision, please let me know |
19:42:26 | FromDiscord | <egomind> (I'll look it for later, but I'm busy right now) |
19:47:37 | FromDiscord | <Phil> First of, can ref types not be instantaited at compiletime? Am I missing something? |
19:48:10 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4BDE |
19:49:10 | FromDiscord | <that_dude.> https://nim-lang.org/docs/manual.html#restrictions-on-compileminustime-execution |
19:49:37 | FromDiscord | <Phil> noooooooooooooooooooo |
19:50:54 | FromDiscord | <Phil> So you straight up can not have a macro that generates `x.name` for you if x is a ref-type? |
19:51:01 | FromDiscord | <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:40 | FromDiscord | <that_dude.> I think I read something similar to that used for a grammer parser that's in the compiler/std |
19:51:47 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4BDF |
19:52:25 | FromDiscord | <that_dude.> Sorry I'm not well versed in ref objects or macros |
19:53:23 | FromDiscord | <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:46 | FromDiscord | <Phil> Pretty concise code too if you think about it |
19:57:36 | FromDiscord | <egomind> Mapping functions? :o |
19:58:07 | * | ntat quit (Quit: leaving) |
19:58:28 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4BDI |
19:59:05 | FromDiscord | <Phil> Imagine every type with 4 more fields and defining your own `proc(x: A): C` becomes tedious |
19:59:34 | FromDiscord | <Phil> At least that's the usecase, I'm doing it because it's interesting and quick-ish to implement comparatively |
20:05:48 | FromDiscord | <Phil> ...How do you check if a type is a ref type ? |
20:07:08 | FromDiscord | <Phil> Huh, you can, is ref object apparently |
20:11:48 | FromDiscord | <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:33 | FromDiscord | <Phil> Simple mapping function generator in roughly 100 lines of code |
20:12:56 | FromDiscord | <.matrixagent> In reply to @isofruit "...How do you check": what even is the difference between `ref` and `var` |
20:13:56 | FromDiscord | <that_dude.> var -> current variable is mutable↵ref -> this variable is pointing to a value |
20:14:21 | FromDiscord | <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:50 | FromDiscord | <.matrixagent> does nim automagicly allocate memory for me? or how would i tell it i want this object on the heap |
20:15:06 | FromDiscord | <Phil> ref types are automagically allocated in heap, that's why they're ref types |
20:15:28 | FromDiscord | <.matrixagent> hm so ref types are like `new` in C++? |
20:15:28 | FromDiscord | <Phil> That's also why only ref types can be nil while value types always have default values |
20:15:50 | FromDiscord | <odexine> In reply to @isofruit "Practically they tend to": ?? |
20:15:55 | FromDiscord | <odexine> var doesnt mean heap allocated |
20:16:10 | FromDiscord | <Phil> In reply to @odexine "var doesnt mean heap": Does it not immediately lead to heap allocation? |
20:16:14 | FromDiscord | <odexine> no |
20:16:15 | FromDiscord | <odexine> no |
20:16:21 | FromDiscord | <odexine> discordp lease dont double send like that |
20:16:35 | FromDiscord | <.matrixagent> In reply to @isofruit "Does it not immediately": i mean i use var when passing around seq's |
20:16:38 | FromDiscord | <Phil> It may not express that but I was under the impression that factually under the hood it did that |
20:16:53 | FromDiscord | <Phil> Seqs are always heap allocated as they're not arrays so same difference |
20:16:56 | FromDiscord | <odexine> var for variables is just a mutable let, no difference in typing |
20:17:04 | FromDiscord | <odexine> or i mean no difference under the hood |
20:17:11 | FromDiscord | <.matrixagent> basicly how do i heap allocate something |
20:17:21 | FromDiscord | <Phil> new(T) |
20:17:26 | FromDiscord | <odexine> var for function parameters mean pointer passing but that pointer could be to stack memory |
20:17:38 | FromDiscord | <.matrixagent> i just wrote some simple mummy websocket server around 3k lines and i didnt really allocate any memory manually |
20:17:45 | FromDiscord | <Phil> Ah, that's where I got the mixup, I tend to strongly associate pointer with heap |
20:17:55 | FromDiscord | <odexine> pointers are not always heap xd |
20:18:07 | FromDiscord | <.matrixagent> it should be |
20:18:07 | FromDiscord | <Phil> Practically when I write code they very, very rarely aren't |
20:18:20 | FromDiscord | <Phil> So sometimes the line gets blurry |
20:18:22 | FromDiscord | <.matrixagent> its meaningless if you use pointers to numbers |
20:18:31 | FromDiscord | <.matrixagent> copying is better |
20:18:41 | FromDiscord | <.matrixagent> unless you make 300 copies |
20:18:46 | FromDiscord | <odexine> that's a very bold claim |
20:19:00 | FromDiscord | <odexine> and i dont feel like taking the time to refute it, maybe someone else would |
20:19:22 | FromDiscord | <.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:34 | FromDiscord | <.matrixagent> simply since stack objects should be small in size |
20:19:41 | FromDiscord | <.matrixagent> if its large it goes on the heap |
20:20:20 | FromDiscord | <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:46 | FromDiscord | <odexine> i kinda dont think youre wrong anyway |
20:21:32 | FromDiscord | <odexine> eh whatever this is besides the point |
20:22:14 | FromDiscord | <.matrixagent> In reply to @isofruit "I mean, depends. If": shared mutable state is what gets me fired from my job |
20:22:15 | FromDiscord | <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:42 | FromDiscord | <Phil> Generally ref-types will get heap allocated and the syntax to construct them is identical to constructing value types |
20:23:00 | FromDiscord | <.matrixagent> In reply to @isofruit "Anyway, <@664973718325428237> honestly": can you show me an example using new? |
20:24:16 | FromDiscord | <.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:27 | FromDiscord | <.matrixagent> or allocate everything on the heap like java and python |
20:24:35 | FromDiscord | <.matrixagent> (edit) "right" => "write" |
20:24:46 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4BDP |
20:25:09 | FromDiscord | <.matrixagent> `echo x is ref`? what does this do |
20:26:12 | FromDiscord | <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:24 | FromDiscord | <Phil> I may have completely forgotten how to actually get the memory address from that thing |
20:26:36 | FromDiscord | <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:03 | FromDiscord | <Phil> > Built-in generic traced pointer type. Source Edit ↵↵That is what a ref is |
20:28:47 | FromDiscord | <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:14 | FromDiscord | <odexine> In reply to @.matrixagent "so is it normal": sequences (similar to python list) and strings are auto-heap |
20:30:23 | FromDiscord | <odexine> ref objects are kinda-auto-heap |
20:30:25 | FromDiscord | <Phil> How do I get the memory address echo'd out |
20:30:33 | FromDiscord | <odexine> of a ref? |
20:30:39 | FromDiscord | <Phil> Yep |
20:30:41 | FromDiscord | <.matrixagent> man is this confusing |
20:31:20 | FromDiscord | <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:46 | FromDiscord | <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:49 | FromDiscord | <odexine> In reply to @.matrixagent "man is this confusing": what are you confused by? maybe we can clarify |
20:32:05 | FromDiscord | <odexine> also i swear repr used to print the address |
20:32:11 | FromDiscord | <odexine> doesnt seem to anymore |
20:32:22 | FromDiscord | <odexine> prolly have to use addr+cast[int] now |
20:32:23 | FromDiscord | <that_dude.> In reply to @isofruit "How do I get": I think I used to use something like `cast[int](ref_obj)` |
20:32:29 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4BDT |
20:32:35 | FromDiscord | <odexine> it prolly does on 1.4 |
20:32:45 | FromDiscord | <odexine> not sure on 1.6 |
20:33:08 | FromDiscord | <Phil> Does not on 1.6.10 either |
20:33:42 | FromDiscord | <Phil> 1.4 - Binary build unavailable, building from source - Aboooooort miisiiiioooooooon |
20:34:09 | FromDiscord | <Phil> Ah, it just required 1.4.0, phew |
20:34:21 | FromDiscord | <Phil> Also 1.4. doesn't print the memory address either |
20:34:39 | FromDiscord | <.matrixagent> wait repr is like repr in python? |
20:34:44 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4BDU |
20:35:07 | FromDiscord | <odexine> i tried even 1.0.10 |
20:35:10 | FromDiscord | <odexine> no address on repr |
20:35:11 | FromDiscord | <odexine> weird |
20:35:13 | FromDiscord | <odexine> i dont remember then |
20:37:15 | FromDiscord | <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:11 | FromDiscord | <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:22 | FromDiscord | <Phil> (edit) "repr" => "\_\_repr\_\_" |
20:38:48 | FromDiscord | <odexine> oh |
20:38:50 | FromDiscord | <odexine> 1.0.10 does |
20:38:51 | FromDiscord | <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:52 | FromDiscord | <odexine> im dumb |
20:39:15 | FromDiscord | <odexine> 1.6.14 does too\ |
20:39:19 | FromDiscord | <Phil> https://nim-lang.org/docs/system.html#repr%2CT |
20:39:23 | FromDiscord | <Phil> Wait what? |
20:39:37 | FromDiscord | <odexine> im dumb and forgot that you have to set it to a variable |
20:39:38 | FromDiscord | <odexine> lol |
20:39:51 | FromDiscord | <odexine> if you dont then its just not stored, compile time eval i assume |
20:40:14 | FromDiscord | <.matrixagent> In reply to @isofruit "It's a close equivalent.": thanks! |
20:40:17 | FromDiscord | <Phil> It's late over here, I'm not parsing |
20:40:44 | FromDiscord | <odexine> echo @[5].repr -> no work↵let a = @[5]; echo repr a -> work |
20:41:11 | FromDiscord | <odexine> devel doesnt tho |
20:41:26 | FromDiscord | <odexine> might have to do with orc/arc |
20:42:07 | FromDiscord | <Phil> >_> ↵<_> |
20:42:11 | FromDiscord | <Phil> (edit) ">_> ↵<_>" => ">\_> ↵<\_>" |
20:42:11 | FromDiscord | <odexine> << |
20:42:19 | FromDiscord | <odexine> (edit) "<<" => "<-<" |
20:42:54 | FromDiscord | <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:08 | FromDiscord | <odexine> oh for an empty seq |
20:43:10 | FromDiscord | <odexine> ig so yeah |
20:43:27 | FromDiscord | <Phil> I was so confused why all my examples where not giving me memory addresses |
20:46:23 | FromDiscord | <Phil> sent a long message, see http://ix.io/4BDW |
20:47:09 | FromDiscord | <Phil> (edit) "http://ix.io/4BDW" => "http://ix.io/4BDX" |
20:47:38 | FromDiscord | <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:52 | FromDiscord | <Phil> so there it's `a[].fieldPairs` rather than `a.fieldPairs` |
20:54:46 | * | jmdaemon joined #nim |
20:57:00 | FromDiscord | <.matrixagent> In reply to @isofruit "Ah, so again in": unref? |
20:57:04 | FromDiscord | <.matrixagent> what do you mean? |
20:58:46 | FromDiscord | <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:54 | FromDiscord | <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:21 | FromDiscord | <egomind> Yeah, dereferencing is the term I think |
21:02:42 | FromDiscord | <Phil> sent a long message, see http://ix.io/4BE1 |
21:03:46 | FromDiscord | <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:52 | FromDiscord | <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:32 | FromDiscord | <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:49 | FromDiscord | <Elegantbeef> Depends on what you're doing |
22:51:08 | FromDiscord | <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:12 | FromDiscord | <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:44 | FromDiscord | <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:52 | FromDiscord | <nichrosia> wiki gave my the impression making it a ref type would solve it |
23:02:41 | FromDiscord | <Elegantbeef> result is a `var T` technically |
23:03:12 | FromDiscord | <nichrosia> oh, how does that change things? |
23:03:17 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4BEp |
23:03:25 | FromDiscord | <Elegantbeef> `var T` cannot be captured cause `var` can point to the stack |
23:04:57 | FromDiscord | <nichrosia> ah, I see |
23:05:17 | FromDiscord | <nichrosia> wish there was a better error message |
23:08:25 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
23:08:29 | FromDiscord | <nichrosia> uh, that causes a segmentation fault |
23:08:43 | FromDiscord | <nichrosia> https://play.nim-lang.org/#ix=4BEq |
23:12:52 | FromDiscord | <nichrosia> nevermind; I'm dumb - I forgot to initialize `result`, as you have to do when returning a ref object |
23:12:59 | FromDiscord | <nichrosia> it works perfectly, thank you! |
23:17:05 | FromDiscord | <geekrelief> Where did the docs on Channels go? |
23:17:25 | FromDiscord | <Elegantbeef> channels\_builtin |
23:18:29 | FromDiscord | <geekrelief> beef where is that? I'm looking at the index here https://nim-lang.github.io/Nim/theindex.html |
23:19:08 | FromDiscord | <Elegantbeef> No clue about devel |
23:19:28 | FromDiscord | <geekrelief> ok |
23:36:51 | * | jmdaemon quit (Ping timeout: 246 seconds) |
23:52:42 | FromDiscord | <that_dude.> In reply to @Dale Y Pearlman "Do you know that": <@&371760044473319454> |
23:53:06 | FromDiscord | <that_dude.> Thanks |
23:54:04 | FromDiscord | <turtlebasket> Do the std/\ SQL clients support async? |