00:00:00 | FromDiscord | <Elegantbeef> As the page says RCU is actually really simple |
00:00:08 | FromDiscord | <Elegantbeef> The complexity is more about arranging your code to use iit |
00:00:25 | FromDiscord | <Elegantbeef> There are many cases where using an RCU would result in less than useful data |
00:01:18 | arkanoid | Elegantbeef, true, that paragraph is making me understand more than what I've read in the past 2 hours |
00:01:26 | FromDiscord | <Elegantbeef> So don't feel stupid, the whitepaper was just unnecessarily dry |
00:01:56 | FromDiscord | <Elegantbeef> Like look at the code, it's not complex |
00:02:08 | arkanoid | and yeah, I can confirm that RCU shines when you need concurrent reads, and a lot less writes |
00:02:28 | FromDiscord | <Elegantbeef> A few shared allocations, an atomic, a spin lock, you're done |
00:03:32 | arkanoid | maybe https://github.com/nim-lang/threading/blob/master/threading/waitgroups.nim can be added to synchronize when reclaiming can fire? |
00:03:38 | FromDiscord | <.elcritch> There's a few decent-ish youtube talks on RCU's as well: https://www.youtube.com/watch?v=rxQ5K9lo034 https://www.youtube.com/watch?v=K-4TI5gFsig |
00:04:15 | FromDiscord | <Elegantbeef> Sure anything to signal the thread, i just used the dumb solution cause I'm not writing production RCU here 😄 |
00:05:38 | FromDiscord | <Elegantbeef> Wonder what I'm missing that makes an hour long video |
00:06:47 | FromDiscord | <Elegantbeef> Guess it makes sense to store the toRemove on the RcuList and also making remove an operation on the list directly |
00:07:28 | FromDiscord | <Elegantbeef> Well if you wanted a pure Nim RCU it's a start arkanoid |
00:07:55 | * | dza quit (Remote host closed the connection) |
00:11:26 | arkanoid | Elegantbeef, just to get it right. The "spinlock" is not present in your quickly implemented yet impressive code? |
00:11:51 | FromDiscord | <Elegantbeef> Correct the present method of waiting for all to finish is very dumb |
00:12:25 | FromDiscord | <Elegantbeef> Unless you like to use up 1 thread on your pc just heating your room |
00:13:18 | arkanoid | well, it's kinda that time of the year for those kind of threads here |
00:13:26 | FromDiscord | <Elegantbeef> Same |
00:13:41 | FromDiscord | <Elegantbeef> Though it's still hot here |
00:14:01 | FromDiscord | <Elegantbeef> Something about climate change causing people to be triggered here |
00:14:50 | FromDiscord | <.elcritch> In reply to @Elegantbeef "Wonder what I'm missing": mostly just data usage patterns with RCU's - when's / why's |
00:15:18 | FromDiscord | <Elegantbeef> Ah thought that was fairly clear given the limitation that their design has |
00:15:36 | FromDiscord | <Elegantbeef> "Read only adding/insertions" |
00:17:58 | FromDiscord | <Elegantbeef> I say that though I literally have 0 idea where I'd ever use it 😄 |
00:18:07 | FromDiscord | <Elegantbeef> But now I know that it exists and that's half the battle |
00:19:34 | arkanoid | .elcritch: thanks for the videos |
00:21:39 | arkanoid | the synchronization of the readers to release empty the thrashbin seems the most complex part of it |
00:23:09 | FromDiscord | <.elcritch> In reply to @arkanoid "the synchronization of the": yah I think the linux kernel has like 5 variations of RCU's that all handle that part differently (IIRC) |
00:24:04 | FromDiscord | <Elegantbeef> They do seem very simple, wonder if a generic interface could be thrown together.... |
00:25:23 | arkanoid | this lib shows different strategies in homepage https://liburcu.org/ |
00:26:32 | FromDiscord | <.elcritch> yah they are pretty simple, so it'd probably be pretty easy to make generics for them |
00:26:47 | arkanoid | I'm somehow convinced that it cannot be as easy as that, but I'm that kind of person that easily turns an hill into a mountain |
00:28:10 | * | rockcavera quit (Remote host closed the connection) |
00:30:16 | FromDiscord | <.elcritch> Yah it depends if you want to support every variant of it, or just one probably |
00:30:28 | FromDiscord | <.elcritch> But yah in Nim it should be much simpler. Still if you wanted to provide say an iterator interface, use SharedPtr's, etc I bet it could ballon out a bit |
00:30:55 | FromDiscord | <Elegantbeef> You don't even need `SharedPtrs` though |
00:31:00 | FromDiscord | <Elegantbeef> They're explicitly read only 😄 |
00:31:10 | FromDiscord | <Elegantbeef> Not that you have to use them that way |
00:34:53 | arkanoid | what is explicitly read only? I've lost the thread of the argument here |
00:35:11 | FromDiscord | <Elegantbeef> From my understanding RCUs are generally meant for read only collections |
00:35:23 | FromDiscord | <Elegantbeef> You can insert/add to the collection, but you should not write to the data in the list |
00:36:14 | FromDiscord | <.elcritch> You can do deletes to the RCU collections too - that's where the SharedPtr's can come in handy |
00:36:31 | FromDiscord | <Elegantbeef> Why does sharedptr matter? |
00:36:59 | FromDiscord | <Elegantbeef> I did removals just fine without sharedptr |
00:37:37 | FromDiscord | <Elegantbeef> From my reading the entire way RCUs work rely on that it's a single cycle to replace a pointer so there is no issue with removing/inserting/adding |
00:38:16 | FromDiscord | <Elegantbeef> The list is always safe as the pointer either points to the to be reclaimed or the next element |
00:38:51 | arkanoid | problem is if you need to delete or add an element to the list |
00:39:54 | FromDiscord | <Elegantbeef> Do you mean to a field or to the list? |
00:40:26 | FromDiscord | <Elegantbeef> Deleting an element from the list is just storing to an array, then changing the parent/next and carrying on in my list arrangment |
00:40:36 | FromDiscord | <Elegantbeef> In fact it's what I demonstrated in my example |
00:41:14 | FromDiscord | <Elegantbeef> Elcritch are you talking about using a shared pointer for automatic memory management? |
00:41:17 | * | lumo_e quit (Ping timeout: 258 seconds) |
00:41:32 | FromDiscord | <Elegantbeef> If so yes that makes sense |
00:42:10 | FromDiscord | <Elegantbeef> It makes it much simpler by just adding the shared ptr to a list and then clearing the list after the read is done |
00:43:19 | FromDiscord | <Elegantbeef> Though those atomic costs add up 😄 |
00:44:32 | FromDiscord | <.elcritch> Yah actually the first video mentions that and apparently using the atomic-counts it's not RCU 😆 Similar but different: https://youtu.be/rxQ5K9lo034?si=OHkEUFSCFL_YZ6Ma&t=1488 |
00:48:41 | FromDiscord | <Elegantbeef> Reading what I have read did seem to indicated that RCU has no synchronisation primitives or atomics, so mostly semantics |
00:48:55 | FromDiscord | <Elegantbeef> I don't see much reason for RAII on node pointers with RCU anyway |
00:49:03 | FromDiscord | <Elegantbeef> `reclaim` is an explicit step in the design, and a destructor can clear the list after anyway |
00:49:44 | FromDiscord | <Elegantbeef> In fact to me a pointer that explicitly disables `=copy` and `=dup` makes the most sense to me with RCU |
00:50:42 | FromDiscord | <.elcritch> Yah, that's right. It's been a while since I did RCU's. It becomes a different system if you use atomics |
00:50:56 | FromDiscord | <Elegantbeef> Since the entire API around RCU seems to be "The writing side manages memory" there should be no copies of pointers made, only aliases |
00:51:30 | FromDiscord | <.elcritch> Disabling `=copy` and `=dup` would probably make sense |
00:52:29 | FromDiscord | <Elegantbeef> `RcuList[T, {Reading}]` goes brr 😄 |
00:53:03 | FromDiscord | <Elegantbeef> Only `RcuList[T, {Reclaimable}]` returns `ptr T` rest return `ReadOnly[T]` 😄 |
00:53:12 | * | oisota quit (Quit: The Lounge - https://thelounge.chat) |
00:53:15 | arkanoid | I don't quite get if I should consider RCU a lock-free container, or not. It does not use atomics, but use signalling |
00:53:32 | * | oisota joined #nim |
00:53:42 | FromDiscord | <Elegantbeef> There is no reason you cannot reclaim periodically and not use signalling |
00:54:37 | arkanoid | look mum, a weird garbage collector! |
00:54:47 | FromDiscord | <Elegantbeef> Correct |
00:55:07 | FromDiscord | <Elegantbeef> Aslong as you ensure you reclaim only when no one is reading it's fair gamae |
00:55:20 | arkanoid | reading or writing |
00:55:31 | FromDiscord | <Elegantbeef> Reading |
00:55:52 | FromDiscord | <Elegantbeef> Writing is done with replacing/adding/removing nodes |
00:56:04 | FromDiscord | <Elegantbeef> Readers are all you have to worry about |
00:56:48 | FromDiscord | <Elegantbeef> Since the design of the data type is that you leave old nodes active and writing stores any dead nodes |
00:58:22 | arkanoid | right. I was confused by my previous tough, that was kinda realising that this looks like a consumer producer, where a lock handles the readers only, and a lock handles the producers only |
00:59:12 | FromDiscord | <Elegantbeef> Like the docs said it's really the usage that is confusing less than the actual data layout |
01:00:44 | arkanoid | I'm listening to the video in the meanwhile. It seems that the hard part is making it work considering that all readers stopping in never ever happening |
01:02:34 | FromDiscord | <.elcritch> That's when you need the signaling I think - otherwise it's easy to know when to free I guess |
01:04:53 | arkanoid | .elcritch you mean that signaling can be avoided by relying on nim reference counting machinery? |
01:05:45 | FromDiscord | <.elcritch> well sorta, but in the first video he mentions you can use the publish-update "protocol" piece with atomics but then it's not actually RCU then |
01:06:34 | FromDiscord | <Elegantbeef> By using shared pointers you no longer need to manually reclaim, as such you get auto freeing, and all the benefits of RCU |
01:06:39 | FromDiscord | <Elegantbeef> But you also have atomic operations inbetween |
01:07:11 | FromDiscord | <Elegantbeef> If that's what you want use `SharedPtr[RcuNodeImpl]` |
01:07:30 | FromDiscord | <.elcritch> Yah which would have scaling issues - but you're probably talking about lots of cores or lots of data |
01:09:52 | FromDiscord | <Elegantbeef> To be fair on modern CPUs atomic ops arent too bad |
01:10:21 | arkanoid | so you would replace rcu_read_lock and rcu_read_unlock with SharedPtr, and synchronize_rcu with inner reference counting? https://youtu.be/rxQ5K9lo034?feature=shared&t=2120 |
01:10:44 | FromDiscord | <Elegantbeef> Right |
01:11:02 | FromDiscord | <Elegantbeef> Remove the manual reclaim step in my Rcu |
01:11:19 | FromDiscord | <Elegantbeef> Add in `SharedPtr[RcuNodeImpl[T]]` instead of `ptr RcuNodeImpl[T]` |
01:11:23 | FromDiscord | <.elcritch> side note, huh, seems the main use case of librcu is for DNS servers 😆 |
01:11:24 | FromDiscord | <Elegantbeef> There you go you're done |
01:11:38 | FromDiscord | <Elegantbeef> Makes sense |
01:12:03 | FromDiscord | <Elegantbeef> it's a place where order is less than important |
01:12:18 | FromDiscord | <Elegantbeef> And having a bad path is fine |
01:12:53 | arkanoid | I'm quite surprised that kernel can be full of RCUs |
01:12:56 | FromDiscord | <Elegantbeef> Given my more game oriented mind, I'm confused how to sensibly interface RCU anywhere 😛 |
01:13:10 | FromDiscord | <Elegantbeef> Hey they're simple and have many performance curves/behaviours |
01:15:50 | FromDiscord | <.elcritch> In reply to @arkanoid "I'm quite surprised that": Think things like PID / Thread lists. They're read a lot but updated less often. When you run `ps` or something you get a "mostly correct" view of the threads. I'm not sure they actually use RCU's for that, but I think that's the type of use cases |
01:16:44 | FromDiscord | <Elegantbeef> It's quite a weird paradigm |
01:17:24 | arkanoid | Elegantbeef, now you can have multithreaded actors inside the game logic! |
01:17:42 | FromDiscord | <Elegantbeef> Cause it's accepting that some of your threads will get different data for whatever they're doing |
01:18:23 | arkanoid | sure, it's ok when threads are meant to "update very often" their current view on the data stored in RCU |
01:18:50 | * | azimut joined #nim |
01:19:07 | arkanoid | physics engine comes to my mind |
01:19:30 | arkanoid | mostly reads, rigidbody writes |
01:20:02 | FromDiscord | <Elegantbeef> I just thought about the cursed idea of using a pascal list instead of a linked list |
01:20:04 | FromDiscord | <Elegantbeef> So much memory being used 😄 |
01:20:11 | FromDiscord | <Elegantbeef> Who needs physics |
01:20:13 | FromDiscord | <Elegantbeef> `import truss3D/easings` I've got my physics right here 😄 |
01:22:21 | arkanoid | fake physics ahead! |
01:22:50 | arkanoid | actually, easings are much harder to use than just add physics to objects |
01:23:44 | arkanoid | what is truss3D? sdl/gl based engine? |
01:23:50 | FromDiscord | <Elegantbeef> Easings are super easy to use |
01:23:51 | FromDiscord | <Elegantbeef> I make mostly grid based games |
01:23:59 | FromDiscord | <Elegantbeef> less of an engine, more of a 'framework' but yea |
01:24:09 | FromDiscord | <Elegantbeef> It's what I use to make 3D games in Nim |
01:24:43 | FromDiscord | <Elegantbeef> I try to make things as agnostic as I can, like my rect packer, but some things do rely on pixie |
01:26:10 | FromDiscord | <Elegantbeef> I havent worked on it for a couple of months but https://streamable.com/fcf86t is the biggest thing I've worked on using it |
01:26:10 | FromDiscord | <Elegantbeef> https://streamable.com/6bsimk is the most recent toy I made using it |
01:27:07 | arkanoid | damn, pixie, I use vmath quite a lot in my projects, but pixie itself is confusing me how it handles reference space |
01:27:22 | FromDiscord | <Elegantbeef> "reference space"? |
01:28:56 | arkanoid | I mean coordinate system and stack of transformations. I'm used with opengl old static pipeline one, and somehow pixes fails when I apply that idea there |
01:29:16 | FromDiscord | <Elegantbeef> Oh I use pixie just to load data |
01:29:22 | FromDiscord | <Elegantbeef> Oh and fonts |
01:29:32 | FromDiscord | <Elegantbeef> Aside from that I do not touch pixie inside truss |
01:29:33 | arkanoid | is that lock logic meant to be used with haptic feedback? |
01:30:18 | FromDiscord | <Elegantbeef> That was the idea, but my steam controller's haptics are pretty lackluster |
01:30:29 | arkanoid | I quite miss when I was doing videogames, many years ago. When unity was a new thing, and cocos2d was the alternative |
01:33:48 | * | _________ quit (Ping timeout: 258 seconds) |
01:35:23 | arkanoid | have to go. Thanks for the chat. Goodnight |
01:36:13 | FromDiscord | <Elegantbeef> Buh bye |
01:39:46 | arkanoid | actually, seems that RCU has already been discussed here https://forum.nim-lang.org/t/9321#61293 |
02:19:48 | FromDiscord | <pcarrier> any reason `-` isn't defined on `char`? |
02:20:33 | FromDiscord | <odexine> Why should it? |
02:21:09 | FromDiscord | <pcarrier> because `x - '0'` is a cheap way to convert `'0'..'9'` to its numeric value, for example? |
02:21:23 | FromDiscord | <odexine> Not in Nim, types matter here |
02:21:47 | FromDiscord | <odexine> Convert them into numbers int(‘0’) etc then back |
02:21:50 | FromDiscord | <pcarrier> doesn't quite feel like a reason it's not implemented |
02:22:06 | FromDiscord | <pcarrier> I mean sure I can convert, but why do I need to? what would make `-` on `char` bad? |
02:24:09 | FromDiscord | <Elegantbeef> In Nim `-` is only defined for numeric types `'a' - 'b'` does not really make much sense if you think about a char as a symbol not a ascii ordinal |
02:24:48 | FromDiscord | <pcarrier> right, but why would I? I mean I clearly think about it as an ordinal when I do `case '0'..'9'` |
02:24:59 | FromDiscord | <pcarrier> (edit) "right, but why would I? I mean I clearly think about it as an ordinal when I do `case '0'..'9'` ... " added "right?" |
02:25:15 | FromDiscord | <pcarrier> (edit) "'0'..'9'`" => "'A'..'Z'`" |
02:31:08 | FromDiscord | <jviega> sent a long message, see http://ix.io/4JxK |
02:32:16 | FromDiscord | <Elegantbeef> If you want a `-` define it |
02:32:18 | FromDiscord | <Elegantbeef> Simple as |
02:33:36 | FromDiscord | <jviega> Yeah, I mean, what if some reader assumes EBCDIC??!! |
02:34:55 | FromDiscord | <odexine> tbf iirc `char` is defined to be ascii already |
02:34:57 | FromDiscord | <jviega> Frankly I would have preferred `'n'` to give you a Rune not a char by default. |
02:35:19 | FromDiscord | <jviega> I do get tired of typing Rune('n') all over the place 🙂 |
02:36:15 | FromDiscord | <jviega> I also probably would have called the current strings 'buffers' and have strings be UTF32 if it had been me 🙂 |
02:36:22 | FromDiscord | <odexine> wonder if char literals have a similar concept to string literals with the prefix thing |
02:36:34 | FromDiscord | <odexine> prolly could make a `u'n'` to make a rune but ok ig that looks pretty confusing |
02:36:40 | FromDiscord | <jviega> Well yes, that's what I'd want, but the default should be codepoint |
02:37:19 | FromDiscord | <jviega> I should be able to do `'£'` |
02:38:11 | FromDiscord | <Elegantbeef> so make a `proc rune(s: static string): Rune = s.runeAt(0)` 😛 |
02:38:12 | FromDiscord | <Elegantbeef> I kid of course that's still not ideal |
02:38:38 | FromDiscord | <jviega> Lol I'm not complaining, just saying what I would have done differently 🙂 |
02:39:15 | FromDiscord | <Elegantbeef> meh `rune"£"` is fine by me |
02:39:20 | FromDiscord | <Elegantbeef> Sound a lot like complaining! |
02:39:20 | FromDiscord | <Elegantbeef> Get the pitchforks! |
02:39:30 | FromDiscord | <jviega> Also love the error I get: |
02:39:38 | FromDiscord | <jviega> sent a code paste, see https://play.nim-lang.org/#ix=4JxM |
02:39:38 | FromDiscord | <jviega> "But it's right there??" |
02:40:36 | FromDiscord | <jviega> The source is utf8, you can distinush that from 'foo' 🙂 |
02:42:00 | FromDiscord | <Elegantbeef> Hey it's a hard compiler constraint |
02:42:07 | * | dza joined #nim |
02:42:59 | FromDiscord | <jviega> What is?? |
02:43:20 | FromDiscord | <Elegantbeef> That a character literal cannot contain unicode |
02:44:00 | FromDiscord | <jviega> Ah yeah, seems very 1980's of the language but yeah, I could tell 🙂 |
02:44:46 | FromDiscord | <Elegantbeef> System would require a new `UnicodeChar` or similar |
02:45:14 | FromDiscord | <jviega> Yeah it's one of those things you have to nail on day 1 |
02:46:53 | FromDiscord | <Elegantbeef> Still not ideal but `proc u(s: static string)` would allow `u"£"` |
02:47:36 | FromDiscord | <jviega> Yeah, but that would get me utf8; space is cheap, give me utf32 strings that I can constant-time index, etc |
02:47:44 | FromDiscord | <Elegantbeef> Bleh |
02:47:53 | FromDiscord | <Elegantbeef> Make your own utf32 proc then |
02:48:01 | FromDiscord | <jviega> Actually I did a language once where strings could be either |
02:48:13 | FromDiscord | <Elegantbeef> Sounds awful |
02:48:28 | FromDiscord | <Elegantbeef> How would you do non uncode chars in your world anyway? |
02:48:32 | FromDiscord | <jviega> Nah, it was like f strings in Python |
02:48:38 | FromDiscord | <Elegantbeef> `'\aa'` |
02:48:54 | FromDiscord | <jviega> What's a "non-unicode character" EBCDIC? |
02:48:57 | FromDiscord | <Elegantbeef> Saying it was like fstrings means less than nothing to me |
02:49:20 | FromDiscord | <Elegantbeef> A non unicode character is a character that is 8 bytes |
02:49:41 | FromDiscord | <jviega> I think it was "string"u32 to not get u8, it's been a long time |
02:49:46 | FromDiscord | <jviega> Ascii is a subset of unicode |
02:49:47 | FromDiscord | <Elegantbeef> In your perfect world character literals return a Rune |
02:49:56 | FromDiscord | <Elegantbeef> I don't care about that |
02:50:09 | FromDiscord | <Elegantbeef> You want `'a'` but you get `Rune` instead of `char` |
02:50:40 | FromDiscord | <jviega> Right, and the question is how would you get 8 bit chars? |
02:51:02 | FromDiscord | <Elegantbeef> What would you suggest as the syntax for a literal that returns a `char` instead of a `Rune` |
02:51:05 | FromDiscord | <Elegantbeef> Is the question |
02:51:38 | FromDiscord | <jviega> Oh, if you've got type info, there are plenty of places where automatic casting makes some sense, and that's one of them. |
02:52:00 | FromDiscord | <jviega> It's not really casting in that world, it's just a type rule for ' ' |
02:52:15 | FromDiscord | <Elegantbeef> `let a = 'a'` there is no type information 😄 |
02:52:17 | FromDiscord | <odexine> or maybe optimise a rune for ascii |
02:53:03 | FromDiscord | <jviega> If it's a fully type inferenced language, you just infer charU8 | charU32 if there's no other info |
02:53:21 | FromDiscord | <Elegantbeef> Right but we're not talking about that |
02:53:26 | FromDiscord | <bostonboston> sent a code paste, see https://play.nim-lang.org/#ix=4JxT |
02:53:30 | FromDiscord | <Elegantbeef> We're talking about a hypothetical syntax added to Nim |
02:53:50 | FromDiscord | <jviega> Oh that I didn't know |
02:54:10 | FromDiscord | <odexine> yay miscommunication :baqua: |
02:55:49 | FromDiscord | <jviega> I'd potentially do «c» 🙂 |
02:56:07 | FromDiscord | <Elegantbeef> One time patterns actually help |
02:56:10 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JxU |
02:56:11 | FromDiscord | <Elegantbeef> Or constraints rather |
02:56:13 | FromDiscord | <Elegantbeef> Lol |
02:56:20 | FromDiscord | <Elegantbeef> Using unicode to write single chars |
02:56:29 | FromDiscord | <jviega> If you know how, it's not hard to type, at least on the mac, and if you care about unicode, then you can live with it 🙂 |
02:56:51 | FromDiscord | <Elegantbeef> It's ctrl + shift + u on X, then the decimal code |
02:57:06 | FromDiscord | <Elegantbeef> No clue about wayland |
02:57:12 | FromDiscord | <Elegantbeef> Safe to say it's not overly ergonomic |
02:57:20 | FromDiscord | <jviega> Not option-backslash and shift-that for the right? |
02:57:24 | FromDiscord | <Elegantbeef> Actually sorry hex code |
02:58:03 | FromDiscord | <Elegantbeef> I don't know anyway to enter unicode aside from the hex code |
02:58:13 | FromDiscord | <jviega> On linux it's AltGr+z and x |
02:58:15 | FromDiscord | <Elegantbeef> any way\ |
02:58:30 | FromDiscord | <Elegantbeef> Let me find my altgr key |
02:58:52 | FromDiscord | <Elegantbeef> Nope it aint there |
02:59:01 | FromDiscord | <pcarrier> how should I import `src/example.nim` from `tests/example.nim`? |
02:59:45 | FromDiscord | <jviega> That's what several sources including wikipedia say anyway 🙂 |
02:59:56 | FromDiscord | <Elegantbeef> `config.nims` with `switch("path", "$projectDir/../src")` |
03:00:04 | FromDiscord | <Elegantbeef> Yea I don't have an altgr key on this keyboard |
03:00:08 | FromDiscord | <Elegantbeef> So i guess "skill issue" |
03:00:38 | FromDiscord | <Elegantbeef> With the config.nims you just then do `import example` |
03:00:50 | FromDiscord | <Elegantbeef> Of course if your modules have the same name that'll explode |
03:00:55 | FromDiscord | <Elegantbeef> So do not have the same module name |
03:01:06 | FromDiscord | <Elegantbeef> alternatively you can do the horrid `../src/example` |
03:01:07 | FromDiscord | <bostonboston> Altgr is allegedly the first key to the right of the spacebar, normal that's what I'd call right alt |
03:03:12 | FromDiscord | <jviega> Good to know, thx |
03:03:16 | FromDiscord | <Elegantbeef> Think that's down to the keyboard to make it a special key |
03:04:23 | FromDiscord | <bostonboston> I'd believe that |
03:04:55 | FromDiscord | <jviega> Can't tell for sure but I think the linux keyboard drivers are all going to respect it as to right of space bar from what I'm seeing |
03:05:21 | FromDiscord | <jviega> Ah, are you on Ubuntu? |
03:05:37 | FromDiscord | <jviega> They turn off the feature by default for some reason |
03:05:56 | FromDiscord | <pcarrier> hmmm how do I compile my prod code with emcc and co, but my tests normally? right now I hardcode all my flags in config.nim but testament ends up compiling to wasm which doesn't execute |
03:06:21 | FromDiscord | <pcarrier> (edit) "config.nim" => "nim.cfg" |
03:07:06 | FromDiscord | <pcarrier> (edit) "wasm" => "wasm+JS" |
03:07:15 | FromDiscord | <Elegantbeef> I'm using awesomewm so certainly on me |
03:07:34 | FromDiscord | <Elegantbeef> make a `config.nims` next to your `src` |
03:07:39 | FromDiscord | <Elegantbeef> well in your src |
03:09:22 | FromDiscord | <jviega> Well anyway, it's often easy to type those chars if you know about it; I think it's reasonable to use high codepoints in optional syntax |
03:09:50 | FromDiscord | <jviega> and those are quite common quote marks outside north america |
03:10:43 | FromDiscord | <Elegantbeef> Yea my NA centric view is always no unicode 😄 |
03:11:03 | FromDiscord | <jviega> Wow, what are you, my age?? |
03:11:15 | FromDiscord | <jviega> That's the kind of thing we old farts say |
03:11:16 | FromDiscord | <Elegantbeef> I hope not |
03:11:41 | FromDiscord | <jviega> Same. You need to get with your age group |
03:13:11 | FromDiscord | <jviega> I'm just trying to feel young again 😉 |
03:13:33 | FromDiscord | <pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4JxY |
03:16:16 | * | rez joined #nim |
03:16:48 | FromDiscord | <Elegantbeef> Hey I just like easy to write code, and using unicode is not easy on my keyboard |
03:16:51 | FromDiscord | <Elegantbeef> Sorry, I'll go scream some inanity outside for tiktok views |
03:16:52 | FromDiscord | <Elegantbeef> Be back in 20 |
03:17:59 | FromDiscord | <Elegantbeef> How did you import it? |
03:18:04 | FromDiscord | <Elegantbeef> It'd just be `import sss` |
03:20:11 | FromDiscord | <pcarrier> yup. turns out $projectDir was unnecessary and broke it for me |
03:20:30 | FromDiscord | <pcarrier> is there a "nice" assert, such that `assert a = b` would pretty-print the values of a and b when they differ? |
03:20:50 | FromDiscord | <Elegantbeef> `check` in `std/unittest` |
03:21:56 | FromDiscord | <Elegantbeef> No clue if testament has |
03:22:00 | FromDiscord | <Elegantbeef> it |
03:26:18 | FromDiscord | <pcarrier> thanks, awesome |
03:26:50 | FromDiscord | <pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4Jy1 |
03:26:59 | FromDiscord | <pcarrier> kinda feels like it should be able to infer here, but whatever, how do I specify the type explicitly? |
03:27:16 | FromDiscord | <pcarrier> (edit) "https://play.nim-lang.org/#ix=4Jy1" => "https://play.nim-lang.org/#ix=4Jy2" |
03:27:34 | FromDiscord | <Elegantbeef> It should infer it there |
03:27:41 | FromDiscord | <Elegantbeef> You also can do `.len == 0` |
03:28:02 | FromDiscord | <Elegantbeef> Or do `default(seq[Token])` |
03:29:11 | FromDiscord | <pcarrier> love the `.len` approach, thanks |
03:30:11 | FromDiscord | <Elegantbeef> Ah actually it's an issue with check `var b = @[]` is a compile time error |
03:30:17 | FromDiscord | <Elegantbeef> Well 'issue' |
04:39:13 | * | forest quit (Quit: Gone for now) |
04:48:39 | * | lumo_e joined #nim |
04:50:43 | * | _________ joined #nim |
05:05:54 | * | rez quit (Quit: much snoozes...) |
05:09:55 | * | lumo_e quit (Ping timeout: 255 seconds) |
05:38:47 | FromDiscord | <pcarrier> Missing float16 |
05:51:38 | FromDiscord | <odexine> float16s are uncommon for general purpose computing |
05:51:56 | FromDiscord | <odexine> i'd expect an ML toolkit to have an implementation |
06:01:35 | * | derpydoo joined #nim |
06:29:23 | * | xet7 joined #nim |
07:41:42 | FromDiscord | <pcarrier> is there a way to return a view into a seq? an openArray with different bounds inside the seq? |
08:17:05 | * | Lord_Nightmare quit (Remote host closed the connection) |
08:17:24 | * | Lord_Nightmare joined #nim |
08:29:03 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4Jz1 |
08:59:59 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4Jz5 |
09:13:31 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4Jz8 |
09:13:57 | FromDiscord | <sOkam! 🫐> (edit) "https://play.nim-lang.org/#ix=4Jz8" => "https://play.nim-lang.org/#ix=4Jz9" |
09:15:12 | NimEventer | New Nimble package! clim - Yet another CLI option parser generator for Nim., see https://github.com/xjzh123/clim |
09:21:30 | FromDiscord | <pmunch> sent a code paste, see https://play.nim-lang.org/#ix=4Jza |
09:23:34 | FromDiscord | <odexine> nimlsp? |
09:37:59 | FromDiscord | <pmunch> Maybe 🤔 |
10:19:25 | FromDiscord | <sOkam! 🫐> In reply to @pmunch "Nimls?": nimlsp yeah, typo |
10:19:29 | FromDiscord | <sOkam! 🫐> the language server |
10:19:34 | FromDiscord | <sOkam! 🫐> wasn't you who made it? |
10:33:30 | FromDiscord | <pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4Jzl |
10:34:45 | FromDiscord | <pcarrier> really no idea what's wrong, I've defined equals and hash for my object type and my ref type? |
10:35:27 | FromDiscord | <pcarrier> (edit) "object" => "Obj" | "ref" => "Ref" | "type and myReftype? ... " added "(Obj can contain a `Table<Ref, Ref>`)" |
10:40:45 | FromDiscord | <pcarrier> ha, `d:nimPreviewHashRef` let me get rid of the hash stuff for refs and everything is happy |
10:43:22 | FromDiscord | <pmunch> In reply to @heysokam "nimlsp yeah, typo": Yeah I'm the one who wrote NimLSP, nimlangserver is someone else. Quite confusing 😋 I guess it would be possible to just prepend that, but then line numbers and such would be wonky. I think the proper solution would be to instruct the compiler to treat it as NimScript. Does nimsuggest work with NimScript? |
10:45:18 | FromDiscord | <pmunch> In reply to @pcarrier "ha, `d:nimPreviewHashRef` let me": You appear to really like noSideEffects, maybe have a look at replacing proc with func |
10:47:18 | FromDiscord | <sOkam! 🫐> In reply to @pmunch "Yeah I'm the one": idk. i guess not, if you call for `nim thefile.nims` 🤔 |
10:51:33 | FromDiscord | <pcarrier> @pmunch thanks, will do |
10:52:38 | * | junaid_ joined #nim |
10:54:07 | FromDiscord | <pcarrier> much better indeed. I'm a complete noob... |
10:54:14 | FromDiscord | <pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4Jzo |
10:54:18 | FromDiscord | <pcarrier> any easy way to look into those maps to understand why they're different? |
10:57:41 | FromDiscord | <pcarrier> ah, I actually don't want nimPreviewHashRef, I want to use value equality to hash values |
10:59:04 | FromDiscord | <pcarrier> (edit) "use" => "hash its" | removed "equality to hash values" |
11:02:40 | * | junaid_ quit (Remote host closed the connection) |
11:03:36 | FromDiscord | <pmunch> In reply to @heysokam "idk. i guess not,": I meant if you called the nimsuggest binary manually, would you still get the same errors? |
11:04:12 | FromDiscord | <pmunch> If it handles them somehow, or has a switch for handling them, then it should be trivial to set up for nimlsp. |
11:06:19 | FromDiscord | <pmunch> In reply to @pcarrier "ah, I actually don't": Could you try moving line 81 to 53? |
11:06:55 | FromDiscord | <pmunch> And don't worry about being a newcomer, we where all there once, and thats what this channel is for (amongst other things) |
11:07:46 | FromDiscord | <segfault007> Hi. nim n00b here. Please see [this](https://play.nim-lang.org/#ix=4Jzs) |
11:08:18 | FromDiscord | <segfault007> I'm getting `Error: unhandled exception: ccgtypes.nim(210, 17) `false` mapType: tyBuiltInTypeClass [AssertionDefect]` which I can't root cause. |
11:08:26 | FromDiscord | <segfault007> Any help appreciated. |
11:08:48 | FromDiscord | <segfault007> Nim Compiler Version 2.1.1 [Linux: arm64] |
11:10:00 | FromDiscord | <segfault007> git hash: 26f183043f9e58eb4954d50a5d130d8684909936 |
11:11:45 | FromDiscord | <odexine> `s: ptr, c...` -> `s: pointer, c...` |
11:11:52 | FromDiscord | <odexine> same with the other one |
11:12:34 | FromDiscord | <pcarrier> @pmunch noice! |
11:12:41 | FromDiscord | <pcarrier> (edit) "@pmunch noice! ... " added "solved!" |
11:13:35 | FromDiscord | <segfault007> @odexine: That worked! 🙂 Thanks. |
11:16:02 | FromDiscord | <_nenc> @pmunch Hey! Now that you are online, do you have time to check one issue of your library macroutils? because it is severe. https://github.com/PMunch/macroutils/issues/5 |
11:20:26 | FromDiscord | <pmunch> Yeah that bug has been there since the beginning. Super annoying.. I'm not actually proper online now unfortunately, just on my phone while doing the dishes. I have looked into it in the past and seem to remember that it was hard to solve in a good way. But I'll have another look soon if I remember to. Maybe I missed something previously |
11:20:55 | FromDiscord | <_nenc> oh, i see. thank you for replying! |
11:35:39 | FromDiscord | <jmgomez> In reply to @segfault007 "I'm getting `Error: unhandled": Sounds like a bug in the compiler. Fill an issue |
11:55:26 | FromDiscord | <segfault007> @jmgomez: Thanks. @rika's suggestion seems to have fixed the problem but I am not sure. |
11:58:11 | FromDiscord | <jmgomez> ah right, I missed it and missread that `ptr` |
11:58:56 | FromDiscord | <jmgomez> still a proper error message could be shown even if it comes from the cgen |
11:59:31 | FromDiscord | <segfault007> A question: I'm playing with nim in a bare-metal environment `--os:any --mm:arc --exceptions:goto` etc. I want to support exceptions. I assume this means that I need to implement `raiseExceptionEx`. Is that a reasonable assumption ? |
11:59:32 | FromDiscord | <jmgomez> althouhg `ptr` next to nothing shouldnt pass sem anyways |
12:00:23 | FromDiscord | <segfault007> @jmgomez: Ok, I'll file an issue all the same. |
12:01:44 | FromDiscord | <jmgomez> the fact that you use `exceptions:goto` (which is default for the `c` target btw) should be enough |
12:02:44 | FromDiscord | <segfault007> I see, thanks. (Also for the nugget about it being a default for the c target!) |
12:13:41 | * | junaid_ joined #nim |
12:53:35 | * | junaid_ quit (Remote host closed the connection) |
12:55:37 | FromDiscord | <pcarrier> dang Nim is so productive |
12:56:19 | FromDiscord | <pcarrier> (edit) "dang Nim is so productive ... " added "and looks so maintainable" |
13:06:39 | * | alphacentauri joined #nim |
13:11:52 | FromDiscord | <Chronos [She/Her]> I wonder if there's any point to using a WASM-compiled JSON lib in the browser |
13:12:05 | FromDiscord | <Chronos [She/Her]> Probably not due to the delay in communicating data with JS |
13:14:53 | FromDiscord | <nnsee> if it's something JS engines like V8 are very good at, it's parsing json |
13:15:03 | FromDiscord | <nnsee> but raw numbers would be the only source of truth |
13:15:09 | FromDiscord | <nnsee> https://github.com/GoogleChromeLabs/json-parse-benchmark if you're interested in testing |
13:16:43 | FromDiscord | <ravinder387> wasm only benefit on graphics... other than that javascript's speed is fine |
13:16:52 | * | lumo_e joined #nim |
13:25:06 | FromDiscord | <nnsee> that's a bit of a hot take |
13:34:41 | FromDiscord | <yetiwizard> sent a code paste, see https://play.nim-lang.org/#ix=4JA3 |
13:35:24 | FromDiscord | <yetiwizard> Instead, I only want `luaLib.string` to mean the enum value |
13:41:29 | FromDiscord | <demotomohiro> In reply to @yetiwizard "how do I force": i think you can use this:↵https://nim-lang.org/docs/manual.html#lexical-analysis-keywords-as-identifiers |
13:42:26 | FromDiscord | <demotomohiro> In reply to @yetiwizard "how do I force": I dont think you needs to use `nodecl` pragma when using header pragma. |
13:43:03 | FromDiscord | <_nenc> I have tested that although `{.pure.}` doesn't prevent accessing enum values like `A` from elsewhere, it prevents `string` to be ambiguous. |
13:43:45 | * | derpydoo quit (Read error: Connection reset by peer) |
13:44:42 | FromDiscord | <yetiwizard> {.pure.} seems to work, thanks! |
13:44:57 | FromDiscord | <yetiwizard> In reply to @demotomohiro "I dont think you": k, I'll remove it, thx! |
14:26:04 | FromDiscord | <pixel_nerd_linux> Hi everyone, I have a question about nimble: is it possible to specify a local package as dependency ?↵I can do requires "foo >= 1.0" and requires "https://github.com/user/pkg" but what I need is something like requires "file://local/path/bar/" |
14:30:01 | FromDiscord | <Phil> In reply to @pixel_nerd_linux "Hi everyone, I have": I would just compile with the --path flag↵I don't think you can have a local package as a dependency and I don't know how nimble reacts if you compile via nimble and the path flag |
14:33:26 | FromDiscord | <pixel_nerd_linux> In reply to @isofruit "I would just compile": Thanks Phil, will try that! |
14:43:00 | FromDiscord | <Phil> In reply to @pixel_nerd_linux "Thanks Phil, will try": If you want an example you can look at the repository of owlkettle and it's nimble tasks.↵Several of them use the path flag |
15:30:52 | FromDiscord | <pcarrier> sent a code paste, see https://paste.rs/SuWvl |
15:31:33 | FromDiscord | <pcarrier> (edit) "https://play.nim-lang.org/#ix=4JAt" => "https://play.nim-lang.org/#ix=4JAs" |
15:31:52 | FromDiscord | <pcarrier> (edit) "https://play.nim-lang.org/#ix=4JAs" => "https://play.nim-lang.org/#ix=4JAu" |
15:31:56 | FromDiscord | <Chronos [She/Her]> It'd be faster to call JSON.parse tho, no? |
15:32:14 | FromDiscord | <pcarrier> well yeah, if the only goal is to extract data from JSON sorry |
15:32:21 | FromDiscord | <pcarrier> but as soon as you want to do transforms... questionable |
15:32:43 | FromDiscord | <pcarrier> JSON.parse is already native code, wasm won't be as fast |
15:33:17 | FromDiscord | <pcarrier> say you get the JSON on the wasm side and parse it. what do you pass to the JS how? |
15:34:57 | FromDiscord | <pcarrier> even if you could beat JSON.parse, which you cannot, you'd have to deal with the fact that reading strings requires JS iterating over the wasm memory to get bytes out, then parse UTF-8 to make a JS-native (a kind of UTF16)... slow. |
15:35:32 | FromDiscord | <pcarrier> (edit) "even if you could beat JSON.parse, which you cannot, you'd have to deal with the fact that reading strings requires JS iterating over the wasm memory to get bytes out, then parse UTF-8 to make a JS-native (a kind of UTF16)... slow. ... " added "there's no really fast way to construct a JS string from wasm Memory AFAICT." |
15:39:20 | FromDiscord | <Chronos [She/Her]> Yeaaah |
16:09:32 | * | azimut quit (Ping timeout: 256 seconds) |
16:24:56 | FromDiscord | <pcarrier> speaking of passing strings back and forth, I'm getting hell from the string 😅 at https://formic.id/ |
16:26:35 | FromDiscord | <pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4JAP |
16:26:53 | FromDiscord | <taperfade> Heyy |
16:27:34 | FromDiscord | <taperfade> How do i get the location of where the nim exe is |
16:27:40 | FromDiscord | <pcarrier> `which nim` |
16:29:57 | FromDiscord | <odexine> In reply to @pcarrier "I don't feel great": sounds like use a parser? |
16:30:14 | FromDiscord | <pcarrier> how would that help? this is a printer? |
16:31:47 | FromDiscord | <anuke> In reply to @isofruit "I would just compile": I have a similar problem with local packages, but in my case --path is not a solution, because the package being depended on has its own dependencies that need to be installed first. It's a submodule of the main project, but I specifically want to depend on my local version.↵↵There's the workaround of copying all its dependencies into the main project, or expecting people to `cd [name] & |
16:32:01 | FromDiscord | <anuke> (edit) "In reply to @isofruit "I would just compile": I have" => "sent" | "similar problem with local packages, but in my case --path is not a solution, because the package being depended on has its own dependencies that need to be installed first. It's a submodule of the main project, but I specifically want to depend on my local version.↵↵There's the workaround of copying all its dependencies into the main project, or expecting p |
16:32:51 | FromDiscord | <Phil> In reply to @anuke "I have a similar": You could experiment with nimbledeps and entering a symbolic link in there to the local package. |
16:33:01 | FromDiscord | <anuke> nimbledeps? |
16:33:43 | FromDiscord | <Phil> If you add a nimbledeps folder to your project, nimble will try to install all dependencies it needs into there assuming they aren't in there already.↵Maybe making one and adding a symlink to your local project will help get desired behaviour(?) |
16:34:00 | FromDiscord | <Phil> (edit) "already.↵Maybe" => "already. It will also try to pull dependencies only from there.↵Maybe" |
16:34:09 | FromDiscord | <anuke> Does git track symlinks? |
16:34:12 | FromDiscord | <odexine> In reply to @pcarrier "how would that help?": misread |
16:34:14 | FromDiscord | <pcarrier> yes it does |
16:34:30 | FromDiscord | <pcarrier> (edit) "does" => "does. it doesn't follow them but records their value." |
16:34:52 | FromDiscord | <pcarrier> (edit) "yes it does. it doesn't follow them but records their value. ... " added "it won't clone on Windows without admin work nobody does." |
16:35:11 | FromDiscord | <Phil> I mean, you shouldn't commit your nimbledeps folder, otherwise I'm unsure why you're referencing git |
16:36:40 | FromDiscord | <pcarrier> ah, IC. `U+1F605`. |
16:36:50 | FromDiscord | <pcarrier> doesn't fit in 4 characters. |
16:38:37 | FromDiscord | <pcarrier> so JS must be doing some madness somewhere hu |
16:41:40 | FromDiscord | <anuke> sent a long message, see http://ix.io/4JAW |
16:44:59 | FromDiscord | <anuke> It's not a huge deal, because I can do either of these things:↵↵- Copy-paste all the require lines from `subpackage.nimble` into `project.nimble`, which works, but is annoying (I have to keep them in sync)↵- Run `nimble install` every time as noted above |
16:45:12 | FromDiscord | <anuke> But I wish there were a better solution |
16:47:43 | FromDiscord | <anuke> (edit) "sync)↵-" => "sync) and has a caveat (Subpackage has a binary that must be placed in .nimble/bin, so you need to install it anyway)↵-" |
17:18:44 | * | lumo_e quit (Quit: Quit) |
17:21:14 | * | azimut joined #nim |
17:59:33 | FromDiscord | <jaar23> I've created a message queue server with Nim, https://github.com/jaar23/octoque↵Feel free to visit my repo, and giving some feedback on it. I'm working it as a side project outside of my work. The project is initially implemented in V, but it's not really mature and I try out Nim. It's truly enjoyable language and very productive. :nim1: :nim1: I love the Nim a lot now 😎 |
18:13:26 | * | azimut quit (Remote host closed the connection) |
18:13:47 | * | azimut joined #nim |
18:24:50 | FromDiscord | <.aingel.> In reply to @jaar23 "I've created a message": That's cool! And glad you're enjoying nim |
19:06:34 | FromDiscord | <pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4JBt |
19:30:53 | FromDiscord | <roupi.rb> nim errors messages are really no helpful some times |
19:31:54 | FromDiscord | <roupi.rb> anyone knows how to get euwren working ? https://media.discordapp.net/attachments/371759389889003532/1165371906376073306/image.png?ex=65469c2a&is=6534272a&hm=4c317ec05b8d7dc028cb31ddf1d76cf3b792b3b9af4b7ba2a1bda46176eb0547& |
19:40:35 | FromDiscord | <roupi.rb> i guess the package is just broken |
19:45:43 | FromDiscord | <Chronos [She/Her]> Sadly no |
19:46:03 | FromDiscord | <Chronos [She/Her]> If you want to use Wren though, maybe you'd have better luck with wrapping it with Futhark |
19:46:46 | FromDiscord | <roupi.rb> well apparently this huge command works the --prefix flag https://media.discordapp.net/attachments/371759389889003532/1165375647565222020/image.png?ex=65469fa6&is=65342aa6&hm=cd43d147a583fc746985f187c713501ef26df9694d872722b9b60d48ab08b4eb& |
19:47:55 | FromDiscord | <roupi.rb> now how do i force this toast flag at compilation |
20:05:01 | FromDiscord | <roupi.rb> it doest work with even the work around https://media.discordapp.net/attachments/371759389889003532/1165380241238261952/image.png?ex=6546a3ed&is=65342eed&hm=f5c7d5fe4019c16d12167a9b6ebec612003d76bfa01cdb4e522a48c00fe55e74& |
20:05:13 | FromDiscord | <patz3r.eth> Is it possible to do tuple unpacking to assign variables link in Python? E.g., something like `command, units = line.split(" ")`? Or do I need to use a `seq` and just index in? |
20:05:36 | FromDiscord | <patz3r.eth> (edit) "link" => "like" |
20:10:02 | FromDiscord | <Phil> TIL any instance of a range-type is capable of spitting out that types max and min values! |
20:11:52 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4JBQ |
20:12:34 | FromDiscord | <patz3r.eth> OK, I think split() yields a seq |
20:12:37 | FromDiscord | <patz3r.eth> ? |
20:12:41 | FromDiscord | <Phil> That is correct |
20:12:52 | FromDiscord | <Phil> Note though that you could define yourself 2 procs: `first` and `following` or however you'd want it |
20:13:15 | FromDiscord | <Phil> (edit) "`first`" => "`command`" | "`following`" => "`units" |
20:13:18 | FromDiscord | <Phil> (edit) "`units" => "`units`" |
20:13:44 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4JBR |
20:14:32 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4JBS |
20:15:36 | FromDiscord | <patz3r.eth> OK cool, thanks. Still working through little snags from Python muscle memory. Sometimes my small issues aren't in the (excellent) Nim for Python Programmers page. |
20:16:43 | FromDiscord | <Phil> sent a long message, see http://ix.io/4JBT |
20:17:24 | FromDiscord | <Phil> In reply to @patz3r.eth "OK cool, thanks. Still": As someone who started nim with basically only python/JS/TS and some groovy under my belt, I can relate 😄 |
20:18:42 | FromDiscord | <patz3r.eth> It's so close (which is great) but just different enough to trip on! |
20:19:46 | FromDiscord | <Phil> In reply to @patz3r.eth "It's so close (which": Yeh, I really started appreciating nim's type system though.↵Like, you can do a lot of stuff at e.g. compiletime or just avoid issues fundamentally by using the type-sytem |
20:20:31 | FromDiscord | <Phil> Like "This number shall only ever have a value between 5 and 10", you can have the compiler check that for you and throw errors even at runtime if that is violated while e.g. parsing a file into that nim-type with the value that must be between 5 and 10 |
20:20:54 | FromDiscord | <Phil> I keep underappreciating range types |
20:22:03 | FromDiscord | <Elegantbeef> Eh range types sadly are poorly implemented |
20:22:19 | FromDiscord | <Elegantbeef> Implicit conversions and no way to know where defects will raise |
20:27:32 | FromDiscord | <Phil> On the one hand, yes, on the other you previously had nothing and they are a hell of a lot better than nothing |
20:28:40 | FromDiscord | <Elegantbeef> `type Range[TheRange: static Slice[auto]] = distinct typeof TheRange.a` or whatever compiles |
20:29:05 | FromDiscord | <Phil> I mean, sure, but also doesn't change my argument 😄 |
20:30:30 | FromDiscord | <Elegantbeef> I use ranges a fair bit, it's just a shame that they're wholly dangerous to use |
20:42:27 | FromDiscord | <patz3r.eth> Is it good style to indent the `of` in a `case/of` block, or is it just personal preference/readability of that particular code segment? |
20:44:48 | FromDiscord | <Elegantbeef> Between you and your god |
20:48:20 | * | azimut quit (Ping timeout: 256 seconds) |
21:01:19 | * | alphacentauri quit (Quit: WeeChat 4.1.0) |
21:02:32 | * | alphacentauri joined #nim |
21:06:06 | * | alphacen1 joined #nim |
21:07:58 | * | alphacentauri quit (Ping timeout: 272 seconds) |
21:08:14 | * | alphacen1 quit (Client Quit) |
21:09:14 | FromDiscord | <Chronos [She/Her]> @roupi.rb does https://github.com/geotre/wren work for you? |
21:09:23 | FromDiscord | <Chronos [She/Her]> It's a diff package so maybe it will? |
21:25:57 | FromDiscord | <Chronos [She/Her]> Is it expensive to create new http clients per thread made? |
21:32:13 | FromDiscord | <Chronos [She/Her]> No impact I can see at least |
21:40:56 | FromDiscord | <roupi.rb> no it doest even install |
21:44:24 | FromDiscord | <roupi.rb> oh |
21:44:34 | FromDiscord | <roupi.rb> its bc it is trying to pull master |
21:44:40 | FromDiscord | <roupi.rb> and they renamed it to main |
21:46:05 | FromDiscord | <roupi.rb> lets see if i works after 5 years without updates |
21:47:02 | FromDiscord | <Chronos [She/Her]> Lol |
21:47:17 | FromDiscord | <Chronos [She/Her]> Maybe wrapping Wren myself would be a good project hm... |
21:50:10 | FromDiscord | <Elegantbeef> `inc chronos.projectCount` |
21:53:56 | * | alphacentauri joined #nim |
21:56:34 | FromDiscord | <roupi.rb> In reply to @chronos.vitaqua "Maybe wrapping Wren myself": if i dont get wren to work with nim i will build my own language in crystal |
21:56:45 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "`inc chronos.projectCount`": Heh |
21:56:50 | FromDiscord | <Chronos [She/Her]> In reply to @roupi.rb "if i dont get": Fair |
21:58:17 | FromDiscord | <Chronos [She/Her]> Wren doesn't seem to hard to wrap? |
22:00:18 | FromDiscord | <roupi.rb> idunno i never wrapped anything xD |
22:05:19 | FromDiscord | <Chronos [She/Her]> Fair enugh |
22:36:04 | FromDiscord | <Chronos [She/Her]> Can you not `importc` consts from C? :/ |
22:36:30 | FromDiscord | <Chronos [She/Her]> You can do it with a `var` and with a `let` but not `const` |
22:36:38 | FromDiscord | <Chronos [She/Her]> Ig it makes sense tho if it changes at runtime |
22:40:55 | FromDiscord | <Chronos [She/Her]> Does `importc` handle conversions to Nim types for things like `strings`? |
22:41:29 | * | TheLink joined #nim |
22:42:11 | FromDiscord | <Elegantbeef> No you cannot import `const` |
22:42:26 | FromDiscord | <Elegantbeef> That would require Nim to parse the C code and extract the data stored there |
22:42:37 | FromDiscord | <Chronos [She/Her]> Yeah I figured |
22:42:53 | FromDiscord | <demotomohiro> In order to read const values in header file and use it at compile time in Nim, Nim need to read the header file before running compile time code. |
23:14:25 | arkanoid | hey Elegantbeef, yesterday you showed me how to use Type system to encode runtime data. It's cool, and I've been thinking about it while offline. Does it have a name? do you know where I can read more about this? |
23:19:43 | FromDiscord | <Elegantbeef> Type states |
23:21:07 | FromDiscord | <Elegantbeef> I have been thinking about cleaning up that RCU impl for fun |