00:00:25 | FromDiscord | <Elegantbeef> and `{.compile "nanovg.c".}` fails? |
00:01:24 | FromDiscord | <Ayy Lmao> No I can compile the c file. I just can't use the c header |
00:01:44 | FromDiscord | <Elegantbeef> But if you're compiling the C file you do not need to use the C header |
00:02:14 | FromDiscord | <Elegantbeef> Ah i guess gl and utils both include nanovg.h |
00:02:19 | FromDiscord | <Elegantbeef> Thought it was the other way around |
00:02:24 | FromDiscord | <Ayy Lmao> The c headers have all this crazy platform specific define nonsense that I was suspecting is maybe causing my problems with webassembly |
00:02:33 | FromDiscord | <Ayy Lmao> So I figured I would be better off trying to use them |
00:03:18 | qpls1908 | @demotomohiro thanks :) |
00:03:22 | qpls1908 | just what I was looking for |
00:03:42 | qpls1908 | I still wish {} was just syntactic sugar for a hash table though |
00:03:58 | qpls1908 | {}.newTable feels a bit clunky |
00:04:27 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4sGe |
00:04:34 | FromDiscord | <Ayy Lmao> Yeah that only works if you do it from the user side |
00:04:39 | FromDiscord | <Ayy Lmao> You can't do that in the module itself |
00:04:39 | FromDiscord | <Elegantbeef> You say you wish it was just syntax sugar but using the same syntax we have 3 different tables |
00:04:49 | FromDiscord | <Elegantbeef> Right i think i had a similar issue for my wasm stuff |
00:05:07 | FromDiscord | <Elegantbeef> Plus the syntax makes things like `newHeaders` much cleaner |
00:05:52 | FromDiscord | <Elegantbeef> And since nim is a system language you can use the syntax on your own hash tables without any overhead of allocating a 'builtin' hash table |
00:05:54 | FromDiscord | <Elegantbeef> So all in all it's actually a good idea for a system language imo |
00:06:58 | FromDiscord | <Ayy Lmao> The problem I was having with webassembly was weird, I could get nanovg to run, but if I tried to wrap the library in another nicer module, it wouldn't work. |
00:07:21 | FromDiscord | <Ayy Lmao> I couldn't wrap my head around it. |
00:07:29 | FromDiscord | <Elegantbeef> And you made your own `myHeader.h` which imported the files and used it inside a `{.importc:..., header:....}`? |
00:07:52 | FromDiscord | <Ayy Lmao> Yeah, but I am somehow getting issues with multiple definitions doing that |
00:08:07 | FromDiscord | <Ayy Lmao> All of the headers have include guards so I don't know how that's happening |
00:10:44 | FromDiscord | <Ayy Lmao> I'll try it again and see if I can get it to break again |
00:14:43 | FromDiscord | <Ayy Lmao> Ok so it works, but if I try to make a function inside the module that initializes glad I get spammed with `multiple definition of nvgCreateGL3` etc |
00:14:51 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=4sGg |
00:15:18 | FromDiscord | <Ayy Lmao> If I make that function a template it works |
00:16:48 | FromDiscord | <Elegantbeef> Hmm i do see `#define NANOVG_GL3_IMPLEMENTATION` |
00:17:04 | FromDiscord | <Ayy Lmao> I'm doing {.passC: "-DNANOVG_GL3_IMPLEMENTATION".} in the module |
00:17:21 | FromDiscord | <Ayy Lmao> Oh wait do I need to do that in the include file? |
00:17:35 | FromDiscord | <Elegantbeef> That's perhaps a problem |
00:17:36 | FromDiscord | <Elegantbeef> https://github.com/memononen/nanovg/blob/7544c114e83db7cf67bd1c9e012349b70caacc2f/example/example_gl3.c#L27-L30 |
00:18:00 | FromDiscord | <Ayy Lmao> So do you need to only define that once? |
00:18:22 | FromDiscord | <Elegantbeef> You should need it once after your `#include <nanovg.h>` apparently |
00:19:19 | FromDiscord | <Ayy Lmao> Hmm, not sure how to go about doing that with the header file approach that I'm doing |
00:19:57 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4sGi |
00:20:25 | FromDiscord | <Ayy Lmao> but then #define NANOVG_GL3_IMPLEMENTATION would be defined in every module that it gets included in right? |
00:20:37 | FromDiscord | <Elegantbeef> After `nanovg` yes |
00:20:48 | FromDiscord | <Elegantbeef> I'm copying this code from their examples so it certainly works in C land |
00:23:42 | FromDiscord | <Ayy Lmao> For some reason it's telling me `undefined reference to nvgCreateGL3` when I do that and I'm trying to figure out why. |
00:26:03 | FromDiscord | <Ayy Lmao> And then I commented out some code, built it, and then uncommented the code and it's magically working. Not sure what to think about that |
00:26:16 | FromDiscord | <Elegantbeef> Might have had an old cache |
00:26:24 | FromDiscord | <Ayy Lmao> Yeah possibly a nimcache issue |
00:26:25 | FromDiscord | <Elegantbeef> `nim c -f ./yourCode.nim` |
00:26:30 | * | xet7 joined #nim |
00:26:40 | FromDiscord | <Ayy Lmao> does -f clear the nimcache or something? |
00:26:49 | FromDiscord | <Elegantbeef> It forces recompilation |
00:26:56 | FromDiscord | <Ayy Lmao> Good to know |
00:28:23 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=4sGl |
00:29:32 | FromDiscord | <Elegantbeef> Hmph, I'd change the `.h` files to `.c` then use `compile` |
00:30:03 | FromDiscord | <Elegantbeef> Only give the implementation define to the `nanovg.h` |
00:30:10 | FromDiscord | <Ayy Lmao> Specifically nanovg_gl.h and nanovg_gl_utils.h? |
00:30:15 | FromDiscord | <Elegantbeef> That way you should only have a single symbol |
00:30:21 | FromDiscord | <Elegantbeef> Yea |
00:31:03 | FromDiscord | <Ayy Lmao> The implementation define only affects nanovg_gl.h it looks like |
00:31:28 | FromDiscord | <Ayy Lmao> So maybe passing it to the compiler with passC would work if I compile it or something |
00:39:11 | FromDiscord | <Ayy Lmao> Ugh nanovg_gl and nanovg_gl_utils both need to know about the openGl types |
00:39:36 | * | arkurious quit (Quit: Leaving) |
00:39:50 | FromDiscord | <Ayy Lmao> And I remember that was different on webassembly |
00:57:27 | qpls1908 | @Elegantbeef: It seems like it would make more sense to make {} a normal hash table and then just use constructors for ordered tables when you really need them |
00:57:36 | qpls1908 | that's what most other languages do (e.g python) |
00:57:57 | qpls1908 | 99% you don't care about ordering anyway |
00:58:00 | FromDiscord | <Elegantbeef> Except that now has a builtin hashtable in the language and has overhead for other types for the nice syntax |
00:58:33 | qpls1908 | I assume you could do this using macros |
00:58:39 | qpls1908 | though I'm not familiar enough with nim |
00:59:05 | qpls1908 | also, I'm not necessarily opposed to baking hash tables into the language (like Go), since they are ubiquitous |
01:01:06 | FromDiscord | <Elegantbeef> Well Go isnt a system language |
01:01:59 | FromDiscord | <Elegantbeef> But the point is that you might want another table implementation depending on target, and having something that is not really a primitive in the language isnt the smartest imo |
01:02:56 | qpls1908 | I don't see how go not being a 'systems language' is relevant |
01:02:57 | FromDiscord | <Elegantbeef> I very much like a small core language that can be extended in userspace |
01:03:10 | qpls1908 | {} is already syntactic sugar |
01:03:25 | qpls1908 | you could just modify it to correspond to the vanilla hashtable implementation |
01:03:31 | qpls1908 | which makes the most sense in the majority of cases |
01:03:44 | FromDiscord | <Elegantbeef> I do not care about the syntax sugar 😄 |
01:03:45 | qpls1908 | the user can still use other hash tables by using constructors (the two are not mutually exclusive) |
01:03:49 | FromDiscord | <Elegantbeef> The thing is having it be the default table is not too wise imo |
01:03:50 | qpls1908 | lol |
01:03:51 | qpls1908 | ok |
01:04:05 | qpls1908 | in that case, you might as well use rust |
01:04:16 | qpls1908 | nim's main appeal is that it has the ergononics of python |
01:04:17 | FromDiscord | <Elegantbeef> Nope |
01:04:35 | FromDiscord | <Elegantbeef> I love that you're telling me it's appeal |
01:04:54 | qpls1908 | 🙄 |
01:05:15 | FromDiscord | <Elegantbeef> I really just think that having a default table implementation isnt needed given that it can be done ergonomically in userspace code |
01:05:59 | qpls1908 | yes, but it would be even more 'ergonomic' not to require it to be explicitly specified imo |
01:06:11 | FromDiscord | <Elegantbeef> Sure, but we're splitting hairs |
01:06:26 | FromDiscord | <Elegantbeef> Which is a better table `TableRef` or ` Table` |
01:06:39 | qpls1908 | that is utterly irrelevant |
01:06:52 | qpls1908 | if we are talking about a syntax feature, then discussion about said feature is germane |
01:06:53 | FromDiscord | <Elegantbeef> It very much is relavant |
01:07:01 | qpls1908 | to suggest it is 'splitting hairs' is tautological |
01:07:07 | FromDiscord | <Elegantbeef> If it's a builtin hashtable should it be a ref or a value |
01:07:23 | FromDiscord | <Elegantbeef> In python it'd be a ref afaik |
01:07:27 | FromDiscord | <Elegantbeef> In JS it's a ref |
01:07:48 | FromDiscord | <Elegantbeef> I realise i'm being an asshat so i'll apologise and shush |
01:11:07 | FromDiscord | <Ayy Lmao> How can you tell if you're using emscripten from c? |
01:11:15 | FromDiscord | <Ayy Lmao> Having trouble finding info on this for some reason. |
01:11:23 | FromDiscord | <Elegantbeef> It probably sets a define |
01:13:20 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4sGw |
01:14:13 | FromDiscord | <Ayy Lmao> Cool I'll give it a try, thanks! |
01:18:22 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=4sGx |
01:18:24 | * | nanxiao joined #nim |
01:39:35 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=4sGB |
01:40:36 | FromDiscord | <Elegantbeef> That's not a closure |
01:41:02 | FromDiscord | <Ayy Lmao> I guess I'm confused what a closure is then |
01:41:10 | * | noxp joined #nim |
01:41:31 | FromDiscord | <Elegantbeef> `gfx` is a top level variable so no capture is required |
01:41:39 | FromDiscord | <Elegantbeef> it's just a normal pointer procedure |
01:41:45 | FromDiscord | <Elegantbeef> you can do `GcRef(gfx)` |
01:42:54 | FromDiscord | <Ayy Lmao> I was under the impression this whole time that if you have access to a ref it hasn't been freed yet. |
01:43:27 | FromDiscord | <Ayy Lmao> I guess this is a weird niche case |
01:43:36 | FromDiscord | <Elegantbeef> Well you are creating a procedure that is going out to FFI |
01:44:34 | FromDiscord | <Ayy Lmao> I'd like to not have to worry about that sort of thing on the user side and take care of it in the module. Is this a dumb way to do an interface to an os window? |
01:44:46 | FromDiscord | <Ayy Lmao> I was trying to maintain the glfw style way of doing things but have it work on emscripten |
01:45:13 | FromDiscord | <Elegantbeef> No clue |
01:45:39 | FromDiscord | <Ayy Lmao> Where exactly do I do GcRef(gfx)? |
01:45:57 | FromDiscord | <Elegantbeef> Before the proc declaration |
01:46:00 | FromDiscord | <Elegantbeef> Or after i guess |
01:46:04 | FromDiscord | <Elegantbeef> Anywhere before it goes back to C |
01:46:10 | FromDiscord | <Elegantbeef> That way the ref isnt cleared at the bottom |
01:47:06 | FromDiscord | <Ayy Lmao> Yeah that works. My goodness though that was insidious not knowing that |
01:48:08 | FromDiscord | <Arathanis> is that the same as `GC_ref` in system? |
01:48:16 | FromDiscord | <Ayy Lmao> I think so |
01:48:18 | FromDiscord | <Arathanis> oh wait, nim lets you ignore the "_" |
01:48:22 | FromDiscord | <Arathanis> so it is the same lol |
01:48:26 | FromDiscord | <Ayy Lmao> Yeah it's just a different way of writing it |
01:48:28 | * | noxp quit (Quit: Leaving) |
01:48:46 | FromDiscord | <Arathanis> pretty sure when your program terminates you want to `GcUnref` |
01:48:56 | FromDiscord | <Arathanis> or technically `GC_unref` |
01:48:58 | * | noxp joined #nim |
01:49:23 | * | noxp quit (Remote host closed the connection) |
01:50:14 | FromDiscord | <Ayy Lmao> What's the point of unreffing at the top level out of curiosity? Like if the program terminates aren't the resources freed anyway? |
01:50:23 | * | noxp joined #nim |
01:50:55 | * | noxp quit (Client Quit) |
01:52:17 | FromDiscord | <Arathanis> well one your program is done I believe you should do that. |
01:52:36 | FromDiscord | <Arathanis> first you are saying "this variable is referenced, I promise. you just cant see it" |
01:52:40 | FromDiscord | <Arathanis> then you are telling it the reference is gone |
01:53:05 | FromDiscord | <Elegantbeef> It doesnt matter too much but your destructor wont run so if that has a side effect that wont happen |
01:53:08 | FromDiscord | <Arathanis> but beef probably knows better than me how required it is, my understanding is they should always be paired |
01:53:39 | * | noxp joined #nim |
01:53:41 | FromDiscord | <Ayy Lmao> So if my program is based on an FFI loop like in emscripten, I am doomed to GcRef any refs I use at top level? |
01:53:43 | FromDiscord | <Elegantbeef> It should be unrefed eventually but it's likely not a big deal in your case |
01:53:57 | FromDiscord | <Elegantbeef> You're doomed to use GCRef across the FFI bridge |
01:54:01 | FromDiscord | <Arathanis> also keep in mind that you must unref something as many times as you ref it |
01:54:07 | FromDiscord | <Arathanis> its basically incrementing the reference count |
01:54:48 | FromDiscord | <Ayy Lmao> I don't think I can unref it then if there's no way to hold the execution |
01:54:50 | FromDiscord | <czgchsz> It's like C though, in main() why free if the allocated char \ will get freed anyway upon termination? That said I always free what I allocate no matter what, used to it. |
01:55:04 | * | jmdaemon quit (Ping timeout: 276 seconds) |
01:55:10 | FromDiscord | <Elegantbeef> This is just par for the course for FFI + Refs since they're really just fancy allocators |
01:56:40 | FromDiscord | <Ayy Lmao> I guess I could unref it if there's an event to close the window or something |
01:57:05 | FromDiscord | <Arathanis> sent a long message, see http://ix.io/4sGD |
01:58:15 | FromDiscord | <Ayy Lmao> I'll keep that in mind, although I think I need to figure out how to abstract this away from the user in my interface. |
01:58:25 | FromDiscord | <Ayy Lmao> Because that was a very hard bug to find |
01:58:43 | FromDiscord | <Arathanis> maybe with your own destructor? |
01:59:17 | FromDiscord | <Ayy Lmao> The problem is my destructor being called early, I want the user to never have to worry about that |
01:59:43 | FromDiscord | <Arathanis> you could make some nice templates to simulate a context manager that handles it for you |
02:00:01 | FromDiscord | <Arathanis> have them GC_ref on opening -> body -> GC_unref |
02:00:05 | FromDiscord | <Elegantbeef> You basically need a `OnEnd` procedure that is called by the program |
02:00:14 | FromDiscord | <Arathanis> or that, exactly |
02:00:17 | FromDiscord | <Arathanis> some kind of cleanup step |
02:00:52 | FromDiscord | <Ayy Lmao> I want to abstract the OnRef call away too. I'll have to do some thinking about how I want to structure it. |
02:00:59 | FromDiscord | <Ayy Lmao> GcRef |
02:01:54 | FromDiscord | <Ayy Lmao> I dont think GC_ref on opening -> body -> GC_unref works because I can't halt the code execution |
02:02:04 | * | grimlavik joined #nim |
02:02:27 | FromDiscord | <Ayy Lmao> It just plows through to the end and goes into the ffi loop |
02:02:29 | FromDiscord | <Elegantbeef> Whoops |
02:02:30 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4sGF |
02:02:57 | FromDiscord | <Elegantbeef> Point is store the `myObj` and `init`/`deinit` proc then call them when the program closes |
02:04:02 | FromDiscord | <Ayy Lmao> I'll play around with that approach |
02:20:50 | * | jmdaemon joined #nim |
02:22:31 | * | nanxiao quit (Quit: Client closed) |
02:46:14 | * | nanxiao joined #nim |
02:51:26 | * | droidrage joined #nim |
03:03:50 | FromDiscord | <michaelb.eth> In reply to @qpls1908 "nim's main appeal is": wat? |
03:53:40 | FromDiscord | <0xrh0d4m1n> does nims support comments? |
03:54:11 | FromDiscord | <Elegantbeef> Yes |
04:18:53 | FromDiscord | <sOkam!> is it possible to write a `.nim` file from an ast in some way? |
04:20:50 | FromDiscord | <Elegantbeef> `writeFile(myNimNode.repr)` |
04:23:23 | FromDiscord | <Rika> filename where |
04:23:26 | FromDiscord | <Rika> smh |
04:23:57 | FromDiscord | <Elegantbeef> I'm probably as wrong as chatgpt |
04:26:29 | FromDiscord | <0xrh0d4m1n> is there any linter to disable `XDeclaredButNotUsed` ? |
04:27:10 | FromDiscord | <0xrh0d4m1n> (edit) "is there any linter ... to" added "cfg" |
04:27:14 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/nimc.html#compiler-usage-list-of-hints |
04:27:31 | FromDiscord | <0xrh0d4m1n> thx ❤️ |
04:31:06 | * | nanxiao quit (Quit: Client closed) |
04:45:38 | * | noxp quit (Quit: Leaving) |
05:03:48 | * | rockcavera quit (Remote host closed the connection) |
05:27:13 | * | nanxiao joined #nim |
05:32:48 | * | advesperacit joined #nim |
06:08:35 | * | azimut_ quit (Ping timeout: 255 seconds) |
06:32:47 | * | kenran joined #nim |
06:34:57 | * | kenran quit (Remote host closed the connection) |
06:38:03 | FromDiscord | <ShalokShalom> In reply to @0xrh0d4m1n "does nims support comments?": was just merged, is just highly experimental and will break your computer |
06:46:54 | * | PMunch joined #nim |
06:50:22 | * | nanxiao quit (Quit: Client closed) |
06:59:25 | * | Notxor joined #nim |
07:02:20 | FromDiscord | <HitBlast> Is there a good library for formatting Nim code? |
07:04:59 | * | nanxiao joined #nim |
07:14:42 | PMunch | @HitBlast, formatting? |
07:14:50 | PMunch | I guess NimPretty might be what you're looking for |
07:14:55 | Amun-Ra | nimpretty |
07:35:27 | * | ltriant quit (Ping timeout: 255 seconds) |
07:35:34 | * | arkurious joined #nim |
07:54:30 | FromDiscord | <Marcus> downgrade nim until they release the fix↵(@sOkam!) |
08:03:35 | FromDiscord | <Marcus> pMunch\: btw, did you consider integrating nimpretty into nimslp for formatting support? |
08:05:38 | FromDiscord | <Marcus> Oh, I see there's a wip PR. I'm struggling to parse the reasons it stopped tho https://github.com/PMunch/nimlsp/pull/59#issuecomment-1151200100 |
08:07:23 | PMunch | Not sure why really |
08:07:52 | PMunch | It would be nice to have it integrated indeed |
08:08:12 | FromDiscord | <Marcus> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1093083502297239563): pMunch\: btw, did you consider integrating nimpretty into nimlsp for formatting support? |
08:08:30 | FromDiscord | <huantian> one day nimpretty will be good enough for me to actually use 😛 |
08:08:37 | FromDiscord | <Elegantbeef> Here's huan to say "Beed we should make nimpretty better" |
08:08:40 | FromDiscord | <Elegantbeef> beef\ |
08:09:27 | FromDiscord | <huantian> lol beef you know me so well |
08:09:40 | * | kenran joined #nim |
08:09:50 | FromDiscord | <Elegantbeef> All the initiative of a wet paper bag |
08:10:10 | FromDiscord | <hellerbarde> Is there a version of nimlsp/nim/nim\ that did work? because I started with nim 2 days ago and I had to blacklist nimlsp from my neovim lsp autoconfig because it kept crashing. I just assumed it wasn't ready yet. |
08:10:37 | FromDiscord | <Elegantbeef> 1.6.10 and below should |
08:10:48 | FromDiscord | <Elegantbeef> Nim tooling is really subpar |
08:11:23 | FromDiscord | <huantian> not sure if it's initiative or just motivation |
08:11:26 | FromDiscord | <huantian> or unlazyness? |
08:11:40 | FromDiscord | <huantian> I will do something eventually one day |
08:11:42 | FromDiscord | <hellerbarde> Downgrade nim, and then re-compile nimlsp, yes? |
08:11:53 | FromDiscord | <Elegantbeef> Yea |
08:12:29 | FromDiscord | <hellerbarde> excellent. thanks! (Out of curiosity, is/was there a notice about this somewhere that I missed and is there a feed of that where I could follow?) |
08:12:35 | FromDiscord | <Marcus> Yeah, I'm on 1.6.10 now and lsp works. |
08:13:15 | FromDiscord | <Elegantbeef> Nope |
08:13:54 | FromDiscord | <huantian> Is nimlangserver dead on .12 as well? |
08:14:05 | FromDiscord | <hellerbarde> ok. |
08:14:20 | FromDiscord | <Elegantbeef> I think so huan |
08:14:35 | FromDiscord | <Elegantbeef> Seems to have fucked up the user settings |
08:14:36 | FromDiscord | <Elegantbeef> Kate that is |
08:16:37 | FromDiscord | <Elegantbeef> The lsp also seems to work with devel |
08:16:41 | FromDiscord | <Elegantbeef> Though no clue how reliable |
08:16:42 | FromDiscord | <Marcus> There's a link to the fix in nimlsp github issues nim-lang/Nim#21555 |
08:17:03 | FromDiscord | <Marcus> Elegantbeef\: yeah because it was fixed, and we're just waiting for a new release of 1.6 |
08:17:19 | FromDiscord | <Elegantbeef> Just use devel like a normal person 😛 |
08:17:47 | FromDiscord | <hellerbarde> I installed Nim via nixpkgs \:) I shall switch to choosenim now. |
08:19:28 | FromDiscord | <huantian> Huh there’s so many nix users here |
08:20:12 | FromDiscord | <huantian> If you’re on NixOS choosenim probably won’t work, if you’re using nix on another distro then go ahead |
08:20:46 | FromDiscord | <hellerbarde> nix gained in popularity recently. I am using it because I was griping to a friend that my work laptop (Ubuntu) was lacking some newer version of something, so he showed me `home-manager` and I'm never going back. |
08:21:00 | FromDiscord | <hellerbarde> I'm on Ubuntu on this machine, so that should be good. |
08:21:36 | FromDiscord | <hellerbarde> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1093087824594608158): nix gained in popularity recently. I am using it because I was griping to a friend that my work laptop (Ubuntu) was lacking some newer version of something, so he showed me `home-manager` and I'm never going back (until I find a new toy ;) ) |
08:21:47 | FromDiscord | <Elegantbeef> The more impressive thing is the matrix users! 😄 |
08:22:10 | FromDiscord | <huantian> Yeah there’s like 4 of us here |
08:22:52 | FromDiscord | <hellerbarde> huh. So on Discord, you can see which are Matrix users? I don't think I can see (from Matrix) which of you are Discord users... |
08:23:03 | FromDiscord | <huantian> Wonder if it’d be worth to get a nix devel flake going… |
08:23:08 | FromDiscord | <Marcus> I'm also on nix \:) |
08:23:09 | FromDiscord | <Elegantbeef> Yea on discord we show up as bots |
08:23:16 | FromDiscord | <Elegantbeef> Discord users show up as `t2bot` users |
08:23:30 | FromDiscord | <Elegantbeef> @huantian notice the smelly huan's name |
08:23:44 | FromDiscord | <hellerbarde> I might or might not be planning to do that. So feel free to ping me if you think about doing it, and you might be lucky already. |
08:23:49 | FromDiscord | <Elegantbeef> `@_discordSnowflakeHere:t2bot.io` |
08:24:38 | FromDiscord | <huantian> Yeah it’s kinda weird that it seems to prioritize mh discord bridge account, and shows my full matrix url thing next to my name in chat |
08:25:00 | FromDiscord | <huantian> Also beef you’re the only one not on Nix in this convo maybe you should switch 🙃 |
08:25:26 | FromDiscord | <Elegantbeef> Let me waste a shit load of time configuring my system for like -10 benefit |
08:25:29 | FromDiscord | <Elegantbeef> I use a total of like 3 programs |
08:25:36 | FromDiscord | <hellerbarde> indeed. But I kinda have to really want to see it. There seem to be pretty decent tools/methods to make my client just show the "pretty" usernames |
08:26:08 | FromDiscord | <Elegantbeef> IMmMutaBle DisTro |
08:26:12 | FromDiscord | <hellerbarde> 😂 |
08:26:51 | FromDiscord | <Elegantbeef> Not to mention all the struggles it seems to cause |
08:27:39 | FromDiscord | <huantian> Nahhhhhhhhhhh I’ve experienced zero difficulties at all and definitely haven’t spent excessive amounts of time packaging some things |
08:27:42 | * | nanxiao quit (Quit: Client closed) |
08:28:03 | FromDiscord | <hellerbarde> tHaT wOuLd NeVeR hApPeN... |
08:28:09 | FromDiscord | <Elegantbeef> When i install an OS i just want to be able to install my software and use it |
08:28:12 | FromDiscord | <huantian> I’ll just keep an eye out for now, I don’t have anything rn that really needs to use devel so I’ll just stick with stable |
08:28:21 | FromDiscord | <Elegantbeef> I should be able to use my PC from scratch in like 30 minutes |
08:28:47 | FromDiscord | <huantian> Hey I mean I can use my PC immediately if I just use my preexisting config \:p |
08:28:59 | FromDiscord | <Elegantbeef> I almost never keep my home file alive |
08:29:21 | FromDiscord | <Elegantbeef> I purge that thing like 80% of the time |
08:29:59 | FromDiscord | <hellerbarde> is this really a discussion worth having? I think everyone should use what they want and feel like works for them. |
08:30:27 | FromDiscord | <huantian> Probably not I’m mostly just antagonizing beef |
08:30:37 | FromDiscord | <hellerbarde> Elegantbeef\: I find yours an evidently sensible position to have.↵I just like tinkering \:) |
08:30:47 | FromDiscord | <Elegantbeef> This is the meandering conversation room |
08:31:48 | FromDiscord | <huantian> Especially at this time of day |
08:31:51 | FromDiscord | <huantian> Or rather night |
08:33:21 | FromDiscord | <Rika> E |
08:33:28 | FromDiscord | <Elegantbeef> h |
08:33:41 | FromDiscord | <Rika> I like Nix the manager but not the language |
08:35:26 | FromDiscord | <huantian> I wish the language was more statically typed |
08:35:32 | FromDiscord | <hellerbarde> That's interesting. I actually really enjoy the language. I like that you can set properties both with nested Maps `foo = { bar = { baz =true }}}` or with a "path" like `foo.bar.baz = true` |
08:35:47 | FromDiscord | <hellerbarde> honestly, yes, me too. \:D |
08:36:55 | FromDiscord | <hellerbarde> actually, do you mean more explicitly statically typed? or how do you mean it? |
08:37:32 | FromDiscord | <huantian> I think something like that yeah |
08:38:09 | FromDiscord | <huantian> For general configuration I think the language is great, except for the lack of autocompletion and comforts like that |
08:38:15 | * | kenran quit (Remote host closed the connection) |
08:38:38 | * | kenran joined #nim |
08:39:19 | FromDiscord | <huantian> I have to actually try and build my system to see if I used a parameter wrong instead of having it show up in my editor for example |
08:39:23 | * | nanxiao joined #nim |
08:39:50 | FromDiscord | <Marcus> I don't like the nix stdlibs, always throwing some unparsable stack trace when you do something wrong. But the base language is mostly ok to work with. |
08:41:29 | FromDiscord | <huantian> I also don’t do much functional programming in general and I also never go super deep with the functional stuff of the language, at most just doing basic packaging |
08:44:42 | FromDiscord | <Rika> In reply to @hellerbarde "That's interesting. I actually": That’s nice of course but going further than that the syntax is awkward if you don’t use or like Haskell |
08:45:31 | FromDiscord | <huantian> Also docs need to be improved, but it seems that work on that is starting |
08:51:22 | FromDiscord | <hellerbarde> I guess. I don't know much Haskell, so I guess I can't speak on that. The syntax is quite different from C-like languages, but that's ok, isn't it? As long as it's consistent.↵(@Rika) |
08:55:47 | FromDiscord | <Elegantbeef> Consistent syntax does not mean good syntax |
08:56:43 | FromDiscord | <hellerbarde> Good is a matter of taste. |
08:56:53 | FromDiscord | <hellerbarde> within reason. |
08:58:52 | FromDiscord | <Marcus> I don't use haskell and I think nix syntax is pretty familiar. Also the parser does a good job of telling you how you fucked up when you forget quotes or semicolons and similar. |
09:00:06 | FromDiscord | <Elegantbeef> Meanwhile i'm writing a parser that doesnt even presently track line numbering |
09:06:49 | FromDiscord | <Rika> Maybe I’ve gone off the deep end and have a crazy complex config |
09:06:54 | FromDiscord | <faldor20> Hey. I'm looking to dos own unit testing in nim with mocks. I'm looking to test some code for nesper and want to mock the gpio pin interface. I've read some stuff in the forums about using patchfile but haven't found any examples and I'm struggling to get it working. Wondering if anyone has any advice? |
09:07:03 | FromDiscord | <faldor20> (edit) "dos own" => "do some" |
09:13:22 | FromDiscord | <Elegantbeef> make a config.nims, use the patchfile procedure to replace your module with one of the same API but different implementations |
09:13:51 | FromDiscord | <Elegantbeef> https://github.com/Yardanico/mimalloc_nim/tree/master/src |
09:14:10 | FromDiscord | <Elegantbeef> Whoops https://github.com/Yardanico/mimalloc_nim/blob/master/src/main.nims#L32 |
09:51:38 | NimEventer | New thread by nimnam: Future of typing ?, see https://forum.nim-lang.org/t/10072 |
09:53:11 | * | PMunch quit (Quit: Leaving) |
09:58:19 | * | nanxiao quit (Quit: Client closed) |
10:05:22 | FromDiscord | <ricky> In reply to @hellerbarde "tHaT wOuLd NeVeR hApPeN...": 😅 ... |
10:05:34 | FromDiscord | <ricky> that used to be me until I moved 2 Nix |
10:05:42 | FromDiscord | <ricky> now life is ez |
10:28:44 | FromDiscord | <ieltan> In reply to @Elegantbeef "Let me waste a": I use NixOS, it is pretty tough but I can't go back |
10:29:22 | * | ltriant joined #nim |
10:30:37 | FromDiscord | <ieltan> In reply to @Rika "I like Nix the": Right, the language's lack of a static type system has me crying tears of blood. |
10:31:15 | FromDiscord | <ieltan> Error messages are not obvious across the board |
10:32:00 | FromDiscord | <ieltan> And you need to learn how everything works to not fall into recursive pitfalls |
10:35:08 | FromDiscord | <ieltan> One of my frustrations with Nix has been "declarative secrets", see this for example https://github.com/NixOS/nixpkgs/issues/24288 |
10:35:55 | * | qpls1908 quit (Ping timeout: 248 seconds) |
10:40:03 | FromDiscord | <Rika> Oh this |
10:40:10 | FromDiscord | <Rika> I’ve still been trying to figure that out |
10:42:25 | * | jmdaemon quit (Ping timeout: 260 seconds) |
10:44:27 | FromDiscord | <ieltan> In reply to @Rika "I’ve still been trying": Well, it's just my opinion but I think Nix is just ill-suited for secrets for multiple reasons, that's why I gave up using Nix for 'em |
10:45:15 | FromDiscord | <ieltan> Like i have a `pass` password-manager |
10:45:52 | FromDiscord | <ieltan> It's in its own private git repo that i just pull on my NixOS system |
10:46:56 | FromDiscord | <ieltan> And it just works, now maybe for things like VMs or a farm it'll be better to have something a bit more automatic |
10:47:15 | * | jmdaemon joined #nim |
10:53:30 | FromDiscord | <lluar> sent a code paste, see https://play.nim-lang.org/#ix=4sIv |
11:14:26 | FromDiscord | <S3cur3Th1sSh1t> sent a code paste, see https://play.nim-lang.org/#ix=4sIE |
11:19:14 | FromDiscord | <S3cur3Th1sSh1t> Nevermind, found out its possible with compiler flags. |
11:21:53 | * | jmdaemon quit (Ping timeout: 268 seconds) |
11:42:53 | * | xet7 quit (Remote host closed the connection) |
11:45:44 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4sIS |
12:21:13 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4sJ8 |
12:23:10 | FromDiscord | <sOkam!> write that source code to a file |
12:23:20 | FromDiscord | <sOkam!> or print it to console or something |
12:23:24 | FromDiscord | <Rika> That’s not how you do it |
12:23:36 | FromDiscord | <Rika> The repr echo part goes inside the macro |
12:23:38 | * | rockcavera joined #nim |
12:24:34 | FromDiscord | <jmgomez> Or inside a compile time func called from a macro. Maybe static: works too. Not sure |
12:24:37 | FromDiscord | <sOkam!> how do you generate a file over multiple orders then? struggling to understand how to build it, since the return from the macro is just untyped |
12:24:58 | FromDiscord | <sOkam!> this is just making one single line, but the goal is to write more at once, without overwriting the file every time |
12:25:25 | FromDiscord | <sOkam!> (edit) "it," => "the string," |
12:25:32 | FromDiscord | <jmgomez> Think of the macro as the last thing that triggers everything else. I generate the bindings for NimForUE just like that |
12:26:21 | FromDiscord | <Rika> You can’t get the node a macro returns from outside a macro iirc |
12:26:24 | FromDiscord | <sOkam!> yeah, i got everything inserted into an object. but still, don't know how to iterate over all the things without having to overwrite the file every call |
12:27:43 | FromDiscord | <sOkam!> i have a single object that contains some representation of what the code will look like (coming from a json file)... but don't know how to convert all of it into code, since it contains a lot of it |
12:28:20 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4sJb |
12:29:02 | FromDiscord | <sOkam!> how do you add more lines to it? |
12:29:08 | FromDiscord | <jmgomez> @sOkam! you want to gather all the code using functions and then foldl all the nodes togetether and print them where you want |
12:29:15 | FromDiscord | <jmgomez> what do you mean? |
12:29:23 | FromDiscord | <sOkam!> i mean that the example is doing one single line |
12:29:26 | * | Notxor quit (Read error: Connection reset by peer) |
12:29:45 | FromDiscord | <jmgomez> I dont follow. What the number of line has to do? |
12:30:00 | FromDiscord | <sOkam!> that i don't know how to add more lines to that |
12:30:11 | FromDiscord | <jmgomez> You compose the NimNodes via nnkStmList |
12:30:56 | * | Notxor joined #nim |
12:32:34 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4sJc |
12:32:53 | FromDiscord | <sOkam!> i don't have the code |
12:33:01 | FromDiscord | <sOkam!> im trying to create it |
12:33:10 | FromDiscord | <jmgomez> It doesnt matter |
12:33:14 | FromDiscord | <sOkam!> does that accept the macro i linked? |
12:34:02 | FromDiscord | <jmgomez> yes, but remember you cant call macros from macros that's why I used procs |
12:34:13 | FromDiscord | <sOkam!> i don't remember, i just don't know |
12:34:23 | FromDiscord | <sOkam!> i can't remember |
12:39:51 | FromDiscord | <sOkam!> calling the macro doesn't work there |
12:40:20 | FromDiscord | <sOkam!> it just takes the macro name itself instead of expanding its result |
12:44:21 | FromDiscord | <jmgomez> Dont follow |
12:44:47 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4sJf |
12:45:05 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4sJg |
12:45:21 | FromDiscord | <sOkam!> testgen is a macro that returns a proc |
12:46:03 | FromDiscord | <jmgomez> Told you before, use procs if you want to compose multiple calls |
12:46:11 | FromDiscord | <sOkam!> those are procs |
12:46:34 | FromDiscord | <jmgomez> In reply to @sOkam! "testgen is a macro": 👆 |
12:46:38 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4sJh |
12:46:55 | FromDiscord | <sOkam!> yeah but how do you even generate from an object that contains strings, if you cannot use a macro |
12:48:18 | FromDiscord | <jmgomez> I dont understand what you just said |
12:48:36 | FromDiscord | <jmgomez> generete from an object that contains a string? |
12:49:05 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4sJi |
12:50:02 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4sJk |
12:50:55 | FromDiscord | <jmgomez> What's the problem? |
12:51:34 | FromDiscord | <sOkam!> that i just tried to generate multiple with something that is meant to generate code, but i get the call itself converted instead of its contents |
12:52:36 | FromDiscord | <sOkam!> if that doesn't work, i literally cannot grasp how to convert from the object that contains strings defining the code itself, because there are a lot of them |
12:53:27 | FromDiscord | <jmgomez> oh you mean that it converts the code for you into NimNodes? |
12:53:43 | FromDiscord | <sOkam!> i mean that your examples already have the code |
12:53:50 | FromDiscord | <sOkam!> i don't have it, its represented as strings |
12:53:58 | FromDiscord | <jmgomez> That doesnt matter |
12:54:01 | FromDiscord | <sOkam!> i need to generate it, and the shapes are wildly different |
12:54:13 | FromDiscord | <sOkam!> well it does, when i tried right there and it failed. so asking what i did wrong |
12:59:11 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4sJn |
13:00:12 | FromDiscord | <sOkam!> that is still generating the code from existing nim code |
13:00:39 | FromDiscord | <jmgomez> No, it's generating parametric code based on a parameter which is to some extend what you said you want to do |
13:01:18 | FromDiscord | <jmgomez> I dont see what's your issue, is maybe with genAst? |
13:01:59 | FromDiscord | <sOkam!> my issues is that i asked genAst, and it resolved to the call itself, and not to the generated code that comes from that call |
13:02:34 | FromDiscord | <jmgomez> I use it because it's more readable but genAst does "generate" code |
13:03:25 | FromDiscord | <jmgomez> you can replace the it with nnkProc or what you need. The principle it's the same |
13:04:04 | FromDiscord | <sOkam!> i don't understand that line at all, not sure what its doing or how to replace it |
13:05:40 | FromDiscord | <jmgomez> sent a code paste, see https://paste.rs/PWs |
13:06:19 | FromDiscord | <jmgomez> and you will see how it generates the tree. You can try to recreate it yourself if that makes you understand it better |
13:09:47 | FromDiscord | <sOkam!> i think im too tired today to get it. i saved it and will read it tomorrow |
13:09:59 | FromDiscord | <sOkam!> (edit) "read" => "try" |
13:26:47 | FromDiscord | <Ayy Lmao> How do I wrap `pthread_t` in nim? I'm not on Linux and I can't seem to find the header anywhere. |
13:28:45 | Amun-Ra | type pthread_t* {.incompletestruct.} = object |
13:30:02 | FromDiscord | <HitBlast> Does anybody here have experience with nimwave here? I'd like to render a simple text box with a few elements inside but seems like I'm doing something wrong. https://media.discordapp.net/attachments/371759389889003532/1093165651432067213/Screenshot_2023-04-05_at_7.15.47_PM.png |
13:30:12 | FromDiscord | <HitBlast> I've imported nimwave using `from nimwave as nw import nil` |
13:30:12 | Amun-Ra | you only operate on pointer to pthread_t either way; I found that to be the best type equivalent |
13:30:33 | FromDiscord | <Ayy Lmao> In reply to @Amun-Ra "type pthread_t* {.incompletestruct.} =": Cool, didn't know about that pragma. What is the difference between using ptr object? |
13:30:46 | FromDiscord | <Ayy Lmao> `type pthread_t = ptr object` for instance |
13:31:45 | Amun-Ra | that works too; it really depends whether you want to implement API 1:1 or not |
13:32:17 | Amun-Ra | it 'ptr object' example you have to remember that your pthread_t is C's pthread_t* |
13:32:31 | Amun-Ra | s/it/in/ |
13:33:24 | FromDiscord | <Ayy Lmao> Is pthread_t not a pointer itself? |
13:33:33 | Amun-Ra | I sometimes do: type FooObj {.incompletestruct.} = object; type Foo* = ptr FooObj to be more explicit |
13:34:17 | Amun-Ra | hmm, iirc it's an integer of some length |
13:34:38 | Amun-Ra | so… disregard what I was writing |
13:35:04 | Amun-Ra | I mistook thread_t for something else |
13:36:02 | Amun-Ra | my example described opaque type in C |
13:37:46 | FromDiscord | <Ayy Lmao> Would it be safe to treat it as a void pointer maybe? |
13:44:44 | Amun-Ra | I don't think so |
13:50:06 | * | jmdaemon joined #nim |
13:54:09 | FromDiscord | <turbo> Is there a std function or nim library to humanize time spans? So a few seconds -> "x seconds", 1440 min -> "1 day", etc. |
13:55:09 | FromDiscord | <Nerve> sent a code paste, see https://play.nim-lang.org/#ix=4sJz |
13:56:02 | FromDiscord | <Nerve> (edit) "https://play.nim-lang.org/#ix=4sJz" => "https://play.nim-lang.org/#ix=4sJA" |
13:57:21 | FromDiscord | <Nerve> Oh the `=>` parameters are not destructuring the tuple |
13:57:23 | FromDiscord | <Nerve> hmmmm |
13:58:30 | * | jmdaemon quit (Ping timeout: 250 seconds) |
13:58:55 | FromDiscord | <Nerve> So I have to do `zip(a_seq, b_seq).map(ab => (ab[0] ab[1]) / 3.14159)`? |
13:59:04 | FromDiscord | <Nerve> Is there no cleaner way to destructure the tuple? |
14:01:34 | * | jmdaemon joined #nim |
14:05:52 | * | jmdaemon quit (Ping timeout: 250 seconds) |
14:31:09 | * | kenran quit (Remote host closed the connection) |
14:45:53 | * | jmdaemon joined #nim |
15:02:08 | FromDiscord | <Ayy Lmao> sent a code paste, see https://paste.rs/NH1 |
15:14:21 | * | jmdaemon quit (Ping timeout: 268 seconds) |
15:18:33 | * | azimut joined #nim |
15:29:34 | FromDiscord | <demotomohiro> @Ayy Lmao You might need to wrap `const EmscriptenUiEvent` type like this: https://internet-of-tomohiro.netlify.app/nim/faq.en.html#use-nim-with-other-language-how-to-wrap-const-charstar-type-in-cqmark |
15:31:18 | FromDiscord | <Ayy Lmao> I'll try that if I have more problems, I might have figured out a way to get it working. |
15:54:56 | FromDiscord | <sOkam!> how would you run Nim code from inside a cpp project 🤔↵I figure you would build it into a `.a` file, and link with it? is that correct?↵also, how would you access the procs. would the other project require some custom-made header file to declare the exportc nim procs or something? |
16:05:01 | FromDiscord | <Arathanis> In reply to @sOkam! "how would you run": ive done this before, compiled the nim code using the cpp backend to a static library, provided a header file and then imported it directly into a cpp projecg. |
16:05:03 | FromDiscord | <Arathanis> (edit) "projecg." => "project." |
16:05:20 | FromDiscord | <Arathanis> (edit) "project." => "project and linked the static lib." |
16:07:50 | FromDiscord | <Arathanis> `nim cpp --noMain:on --gc:orc -d:useMalloc --app:staticlib ...` |
16:08:54 | * | grimlavik quit (Quit: Client closed) |
16:10:23 | FromDiscord | <sOkam!> ✍️ |
16:13:22 | FromDiscord | <Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4sKc |
16:13:44 | FromDiscord | <sOkam!> kk |
16:14:11 | FromDiscord | <Arathanis> (edit) "https://play.nim-lang.org/#ix=4sKc" => "https://play.nim-lang.org/#ix=4sKd" |
16:14:42 | FromDiscord | <Arathanis> i usually put the once-wrapped call to `NimMain` in a function called `initialize` or similar. |
16:15:20 | * | jmdaemon joined #nim |
16:21:22 | * | kenran joined #nim |
16:37:55 | * | kenran quit (Remote host closed the connection) |
16:57:14 | * | lucasta joined #nim |
17:29:02 | * | redj quit (Ping timeout: 246 seconds) |
17:31:23 | FromDiscord | <jmgomez> @ShalokShalom you can also generate a dll or even embed the cpp code directly in the project (we do both in NUE) |
17:31:43 | FromDiscord | <jmgomez> In reply to @jmgomez "<@208199869301522432> you can also": ups wrong tag @sOkam! |
18:08:42 | * | arkurious quit (Quit: Leaving) |
18:34:28 | FromDiscord | <morgan> nimble.directory's cert seems to have expired yesterday |
18:35:53 | * | junaid_ joined #nim |
18:36:01 | FromDiscord | <Gumbercules> now if only nimble would expire |
18:36:11 | FromDiscord | <morgan> hm? |
18:36:15 | * | junaid_ quit (Client Quit) |
18:37:03 | FromDiscord | <Gumbercules> I'm kidding in the sense that I know it won't happen, but I wish it would go the way of the dodo bird. |
18:37:06 | * | junaid_ joined #nim |
18:37:09 | FromDiscord | <morgan> why? |
18:37:15 | FromDiscord | <Gumbercules> Because it's hot garbage. |
18:38:25 | FromDiscord | <Gumbercules> it's overly complex, poorly documented, tries to do too many things and ends up not doing anything well |
18:40:23 | FromDiscord | <Gumbercules> I want a package manager to manage packages - that's pretty much it... |
18:46:36 | NimEventer | New Nimble package! hyper - Binding for hyper an HTTP library, see https://github.com/thechampagne/hyper-nim |
19:02:45 | FromDiscord | <ieltan> In reply to @Gumbercules "now if only nimble": |
19:03:48 | FromDiscord | <ieltan> In reply to @Gumbercules "I want a package": What's the name of the package manager made by "the one who shall not be named" again? |
19:04:07 | FromDiscord | <Gumbercules> nimph I think? |
19:04:21 | FromDiscord | <ieltan> Yeah, think it's a proper one or not? |
19:04:31 | FromDiscord | <Gumbercules> https://github.com/disruptek/nimph |
19:04:51 | * | qpls1908 joined #nim |
19:05:29 | FromDiscord | <Gumbercules> I've never used it but I've heard good things - I tend to just rely on git submodules and Nim tasks for building my project (I'm not writing libraries for anyone atm). It's terrible, but works out better than using nimble. |
19:05:57 | FromDiscord | <ieltan> Wow, crazy lol. |
19:06:19 | FromDiscord | <ieltan> I'll try nimph later too |
19:06:38 | NimEventer | New Nimble package! rure - Binding for rust regex library, see https://github.com/thechampagne/rure-nim |
19:06:38 | NimEventer | New Nimble package! rustls - Binding for rustls a TLS library, see https://github.com/thechampagne/rustls-nim |
19:09:31 | FromDiscord | <Phil> Man, I just ran into one of those "Oh my god how am I this dumb" errors |
19:10:10 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4sKM |
19:10:25 | FromDiscord | <Phil> Sidenote, this code is 8 months old, so this function can never ever have worked properly |
19:11:38 | NimEventer | New Nimble package! whisky - A blocking WebSocket client, see https://github.com/guzba/whisky |
19:12:05 | FromDiscord | <Yepoleb> It's raining packages again |
19:12:19 | FromDiscord | <Phil> Halleluja? |
19:12:55 | FromDiscord | <Yepoleb> doing some merging on vacation |
19:17:48 | FromDiscord | <morgan> i think im gonna start working on a library to turn desmos graphs into functions |
19:18:49 | FromDiscord | <Nerve> what is the preferred method to pop/delete the first element in a seq? |
19:21:30 | FromDiscord | <Phil> I don't think there's a default method outside of the `delete` |
19:21:42 | FromDiscord | <Phil> If we had a pop method I'd use that, but I think you'll need to define that yourself |
19:22:30 | FromDiscord | <guzba> pop exists but removes last iirc. del vs delete and the ordering question with seqs and the cost of moving in th order-preserving case↵consider using https://nim-lang.org/docs/deques.html if you have the choice? has popFirst and all that ready to roll |
19:22:46 | FromDiscord | <guzba> (edit) "th" => "the" | "case↵consider" => "case, bleh↵consider" |
19:23:15 | FromDiscord | <Phil> I stand corrected, couldn't find it in sequtils thus assumed it didn't exist, but yeah pop is a thing |
19:23:27 | FromDiscord | <Nerve> yeah deque is probably the way to go if ti has a popfront |
19:23:38 | FromDiscord | <Nerve> (edit) "ti" => "it" |
19:23:59 | FromDiscord | <guzba> ive found std/deques to be a super useful little thing, big fan |
19:26:31 | * | qpls1908 quit (Quit: leaving) |
19:40:50 | FromDiscord | <Phil> I kind of sort of regret not using a linked-list to denote the order of "scenes" in a "diaryentry" table now |
19:44:35 | FromDiscord | <Elegantbeef> Is the performance that bad? |
19:54:06 | FromDiscord | <Phil> No, but my alternative approach (have a column called "order_index") is proving cumbersome as fuck |
19:54:50 | FromDiscord | <Elegantbeef> Time for a rewrite |
19:55:36 | * | lucasta quit (Quit: Leaving) |
20:01:53 | * | Notxor quit (Quit: Leaving) |
20:01:57 | FromDiscord | <Phil> Nevaaaaaa |
20:02:01 | FromDiscord | <Phil> Not if it means also having to touch the underlying datastructure as well as frontend |
20:04:16 | FromDiscord | <Elegantbeef> Hi it's clippy, it seems you exposed implementation details to the users.... have you tried not? |
20:07:06 | * | xet7 joined #nim |
20:26:42 | * | junaid_ quit (Remote host closed the connection) |
20:29:35 | FromDiscord | <Phil> If I start linked listing I expose the doubly linked list datastructure that the frontend needs to be aware of anyway |
20:29:44 | FromDiscord | <Phil> (edit) "If I start linked listing I expose the doubly linked list datastructure that the frontend needs to be aware of anyway ... " added "if it's supposed to keep things in order" |
20:31:31 | * | advesperacit quit () |
20:51:32 | FromDiscord | <Arathanis> sent a long message, see http://ix.io/4sL5 |
20:51:56 | FromDiscord | <Arathanis> mangled, but im to lazy to edit it more 😎 |
20:52:01 | FromDiscord | <Elegantbeef> That just seems toxic now! |
20:52:19 | FromDiscord | <Arathanis> maybe true lol |
20:52:22 | FromDiscord | <Arathanis> i can just delete it lol |
20:52:30 | FromDiscord | <Elegantbeef> Nah it's fine |
22:41:06 | FromDiscord | <faldor20> Thankyou! I used your example and was finally able to get it working. The docs for the function are pretty useless 😅 |
23:24:00 | * | Jjp137 quit (Ping timeout: 250 seconds) |
23:24:00 | * | LyndsySimon quit (Ping timeout: 250 seconds) |
23:24:49 | * | Jjp137 joined #nim |
23:25:51 | * | LyndsySimon joined #nim |