00:00:17 | * | tk quit (Quit: Well, this is unexpected.) |
00:00:42 | * | tk joined #nim |
00:12:36 | * | krux02 quit (Remote host closed the connection) |
01:00:26 | NimEventer | New thread by Exelotl: Using arc with C types?, see https://forum.nim-lang.org/t/9006 |
01:04:02 | * | ltriant joined #nim |
01:08:48 | * | ltriant quit (Ping timeout: 250 seconds) |
01:30:12 | FromDiscord | <Equinox> hi |
01:30:18 | FromDiscord | <Elegantbeef> Hello |
01:31:19 | FromDiscord | <Equinox> I just started learning nim yesterday and I really like it so far |
01:31:37 | FromDiscord | <Equinox> I am more of a rust programmer |
01:31:39 | FromDiscord | <Elegantbeef> Nice, I assume there is a question coming up 😛 |
01:31:46 | FromDiscord | <Equinox> nope |
01:32:04 | FromDiscord | <Elegantbeef> Damn, shame |
01:32:42 | FromDiscord | <Elegantbeef> Well anyway welcome, and have fun |
01:32:44 | FromDiscord | <Equinox> In reply to @Elegantbeef "Damn, shame": ok fine, how do I print goodbye world? I know how to print hello world but goodbye world seems far more difficult |
01:32:55 | FromDiscord | <Elegantbeef> It's vastyl more difficult |
01:32:59 | FromDiscord | <Elegantbeef> vastly\ |
01:33:18 | FromDiscord | <Elegantbeef> You need to know how to leave to do it, so it's only an expert move |
01:33:27 | FromDiscord | <Equinox> In reply to @Elegantbeef "It's vastyl more difficult": Yeah that's why I was hoping someone with more experience with such topics could explain it |
01:35:00 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Sap |
01:35:01 | FromDiscord | <Elegantbeef> It's very complicated and techincal |
01:36:33 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/mwe |
01:36:37 | FromDiscord | <Elegantbeef> Cant win them all |
01:38:21 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=3Saq |
01:38:50 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Sar |
01:39:11 | FromDiscord | <Elegantbeef> As it should |
01:39:28 | FromDiscord | <Elegantbeef> @Equinox\: so what's your main focus? |
01:39:29 | FromDiscord | <Equinox> sent a code paste, see https://paste.rs/sHG |
01:39:35 | FromDiscord | <Elegantbeef> It echos then dereferences nil |
01:39:38 | FromDiscord | <Elegantbeef> So it errors |
01:39:51 | FromDiscord | <Equinox> In reply to @Elegantbeef "<@400159322333642752>\: so what's your": I don't have one |
01:39:59 | FromDiscord | <Equinox> I just do whatever sounds cool at the time |
01:40:12 | FromDiscord | <Equinox> recently I've been doing some graphics programming in rust and that's been pretty fun |
01:40:16 | FromDiscord | <Elegantbeef> `cast[ptr int](0)[]` is the C equivlent of `((int)(0))` or w/e |
01:40:50 | FromDiscord | <Elegantbeef> Exelotl will corrrect me on the dereferencing, I dont write C |
01:40:55 | FromDiscord | <Elegantbeef> Ah graphics programming is fun |
01:41:07 | FromDiscord | <Equinox> In reply to @Elegantbeef "`cast[ptr int](0)[]` is the": at least with nim you can read it when you error out the program |
01:41:18 | FromDiscord | <Equinox> C looks like gibberish to me |
01:41:19 | FromDiscord | <Elegantbeef> Indeed |
01:41:49 | FromDiscord | <Elegantbeef> In Nim you also know you're doing something "unsafe" since you use `cast` and `ptr` which are not "safe" |
01:42:26 | FromDiscord | <Equinox> In reply to @Elegantbeef "In Nim you also": Yeah that's nice |
01:42:38 | FromDiscord | <Elegantbeef> Have you made any basic programs in Nim you want to get screamed at about, I love crushing developers dreams |
01:43:06 | FromDiscord | <Equinox> In reply to @Elegantbeef "Have you made any": Oh I have, I wrote a tic tac toe game, it's probably the worst one I have ever written |
01:43:11 | FromDiscord | <Equinox> There is no error checking |
01:43:15 | FromDiscord | <Equinox> no dialog |
01:43:17 | FromDiscord | <Elegantbeef> Let's see it |
01:43:39 | FromDiscord | <Equinox> sent a code paste, see https://play.nim-lang.org/#ix=3Sau |
01:43:49 | FromDiscord | <Equinox> yes Board has a player and the win status |
01:43:54 | FromDiscord | <Elegantbeef> First mistake `method` is for dynamic dispatch |
01:44:00 | FromDiscord | <Elegantbeef> `proc` is what you want |
01:44:10 | FromDiscord | <Equinox> In reply to @Elegantbeef "`proc` is what you": wait does it work the same? |
01:44:15 | FromDiscord | <Elegantbeef> Yes |
01:44:18 | FromDiscord | <Equinox> oh |
01:44:19 | FromDiscord | <Equinox> that's cool |
01:44:26 | FromDiscord | <Elegantbeef> Nim has UFCS so a proc can be called `a.b()` or `b(a)` |
01:44:38 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#procedures-method-call-syntax |
01:44:42 | FromDiscord | <Equinox> In reply to @Elegantbeef "Nim has UFCS so": yeah that's really cool |
01:44:58 | FromDiscord | <Eshoe> I'm also new to nim. I like it so far, but the IDE experience is really hurting my progress so far. I usually use emacs for all languages, but for some reason `nimsuggest` is broken under emacs for me. |
01:45:01 | FromDiscord | <Elegantbeef> You also dont need to annotated `: void` for procs |
01:45:28 | FromDiscord | <Equinox> In reply to @Elegantbeef "You also dont need": ok |
01:46:09 | FromDiscord | <Elegantbeef> That check win is a funny proc |
01:46:19 | FromDiscord | <Equinox> In reply to @Elegantbeef "That check win is": it's beautiful |
01:46:37 | FromDiscord | <Equinox> solid block of else if statements |
01:47:45 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Saw |
01:48:25 | FromDiscord | <Equinox> that does look nicer |
01:50:35 | FromDiscord | <Elegantbeef> @Rika\: do you use emacs i dont recall? |
01:51:23 | FromDiscord | <whee> In reply to @Eshoe "I'm also new to": I had problems with nimsuggest and VSCode/Windows. Ended up using nimlsp instead, which seems to be working pretty well. Might be worth a shot if Emacs has LSP support |
01:51:40 | FromDiscord | <Elegantbeef> Which vscode extension did you use whee? |
01:51:57 | FromDiscord | <Equinox> I am just using the main nim extension and it works fine |
01:52:11 | FromDiscord | <Elegantbeef> NimSaem's is the best imo |
01:52:22 | FromDiscord | <Elegantbeef> It's the original ported to Nim and updated |
01:52:36 | FromDiscord | <whee> In reply to @Elegantbeef "Which vscode extension did": https://marketplace.visualstudio.com/items?itemName=nimsaem.nimvscode↵↵It was spawning a new nimsuggest process for every keypress |
01:52:57 | FromDiscord | <Elegantbeef> You do need to set it up properly |
01:53:01 | FromDiscord | <Elegantbeef> https://github.com/saem/vscode-nim#code-completion |
01:53:28 | FromDiscord | <Elegantbeef> There is also `nim.project` which you can list thee "entry" files |
01:53:37 | FromDiscord | <Elegantbeef> This prevents nimsuggest from eating your CPU |
01:54:51 | FromDiscord | <Eshoe> There is `LSP`support, but not with `eglot` mode which I prefer.↵The problem I have with `nimsuggest`, under `flycheck-mode`, is that it sometimes just stops working, or gets stuck on older messages until I restart `flycheck`, which is pretty annoying. |
01:59:44 | FromDiscord | <whee> In reply to @Elegantbeef "There is also `nim.project`": Is a nimble package enough to get it to work? I created one of those, but maybe it was after I gave up on VSCode/nimsuggest |
02:01:11 | FromDiscord | <Elegantbeef> @Equinox\: i couldnt help myself https://play.nim-lang.org/#ix=3Saz |
02:01:12 | FromDiscord | <Elegantbeef> Damn it i always include useless imports |
02:01:13 | FromDiscord | <Elegantbeef> `sequtils` isnt used |
02:01:37 | FromDiscord | <Elegantbeef> Personally i've been using kate + LSP recently and it's nice, though one downside is no error reporting |
02:02:12 | FromDiscord | <Elegantbeef> It might be enough, if it doesnt play nicely i generally give it an entry file and it then works |
02:02:13 | FromDiscord | <Elegantbeef> It depends on your file structure |
02:02:23 | FromDiscord | <Elegantbeef> It's hard to reason automatically what is the entry file at times |
02:02:26 | FromDiscord | <Equinox> In reply to @Elegantbeef "<@400159322333642752>\: i couldnt help": nice |
02:02:36 | FromDiscord | <Equinox> Thanks for the tips it helps a lot |
02:03:08 | FromDiscord | <Equinox> Should probably also add a checker to ensure the move is valid |
02:05:36 | FromDiscord | <Eshoe> I have kate + LSP set up. It is pretty nice and responsive. But relying just on the compiler to warn me or give me errors is maybe too old school for me. |
02:06:46 | FromDiscord | <Elegantbeef> \I messed up and didnt do `currentPlayer: Ecks..Ooos` To really make it complete 😛 |
02:06:46 | FromDiscord | <Elegantbeef> Current player can never be `None` so any attempt at assigning it to None should error! |
02:06:47 | FromDiscord | <Elegantbeef> @whee\: the project isnt open is it? Can see how it behaveshere |
02:08:18 | FromDiscord | <Elegantbeef> Yea that's a simple `x in 0..8 and board[x] == None` |
02:08:18 | FromDiscord | <Elegantbeef> Oh i agree Eshoe, it's a bug somewhere either Kate or NimLsp, pmunch(nimlsp author) thinks the Kate LSP might be sending a bad request |
02:08:27 | FromDiscord | <Elegantbeef> I looked at it briefly but didnt get anywhere, do want to try to get proper diagnostics |
02:08:32 | * | vicfred quit (Quit: Leaving) |
02:09:35 | FromDiscord | <Elegantbeef> Nimlsp strictly adheres to the spec so kate might have something simple that needs fixed |
02:10:27 | FromDiscord | <Elegantbeef> you could always look into it aswell 😛 |
02:16:24 | * | xet7 quit (Ping timeout: 268 seconds) |
02:28:48 | * | xet7 joined #nim |
02:41:02 | NimEventer | New Nimble package! naylib - Yet another raylib Nim wrapper, see https://github.com/planetis-m/naylib |
02:46:19 | FromDiscord | <michaelb.eth> sent a long message, see http://ix.io/3SaF |
02:46:34 | FromDiscord | <michaelb.eth> (edit) "http://ix.io/3SaF" => "http://ix.io/3SaG" |
02:46:45 | FromDiscord | <michaelb.eth> (edit) "http://ix.io/3SaG" => "http://ix.io/3SaH" |
02:48:39 | FromDiscord | <Elegantbeef> Are you only using that API and the `cAlloc`/`cFree`? |
02:48:52 | FromDiscord | <michaelb.eth> wdym? |
02:49:16 | FromDiscord | <Elegantbeef> You're not using anything that else that'd allocate? |
02:50:16 | FromDiscord | <Elegantbeef> The behaviour you're describing sounds like you're using Nim native collections with the API and the allocations of those arent getting returned to the OS |
02:51:08 | FromDiscord | <michaelb.eth> In my Nim program using my wrapper, I do create a lot of data on the fly in terms of `seq[seq[byte]]`. However, if I disable the calls to the wrapped lib so I'm just doing Nim stuff, the memory consumption is small, relatively speaking. |
02:51:13 | FromDiscord | <Elegantbeef> you can always try `-d:usueMalloc` |
02:51:20 | FromDiscord | <Elegantbeef> `-d:useMalloc`\ |
02:51:51 | FromDiscord | <Elegantbeef> That doesnt use Nim's custom allocator so it should return resources instead of hold onto them |
02:54:52 | FromDiscord | <michaelb.eth> `-d:useMalloc` doesn't make any difference afaict |
02:54:59 | FromDiscord | <michaelb.eth> same steady growth of mem consumption |
02:59:54 | FromDiscord | <Elegantbeef> I can only imagine either the compiler has a bug or you didnt translate properly |
03:01:49 | * | Gustavo6046 quit (Ping timeout: 240 seconds) |
03:06:57 | * | ltriant joined #nim |
03:13:42 | * | ltriant quit (Ping timeout: 252 seconds) |
03:15:53 | * | rockcavera joined #nim |
03:15:53 | * | rockcavera quit (Changing host) |
03:15:53 | * | rockcavera joined #nim |
03:17:46 | * | Gustavo6046 joined #nim |
03:19:50 | * | Gustavo6046 quit (Remote host closed the connection) |
03:20:09 | * | Gustavo6046 joined #nim |
03:55:24 | termer | Elegantbuuf I wanna say thanks again for your advise the other day on using channels. It took me a long time, but I finally solved all of my threading issues and entirely eliminated transient Futures from threading code. I couldn't have done that without your advice so I'm very grateful |
03:55:40 | termer | I tested my server with 1k concurrent connections, and there were 0 issues |
03:56:15 | FromDiscord | <Elegantbeef> Nice! |
04:23:40 | retronav | hi, i'm trying to parse rfc3339 timestamps. how do i parse using multiple formats? is there a function for that or its trial-and-error? |
04:23:53 | FromDiscord | <Elegantbeef> Termer just realized the destruction of my name 😀 |
04:24:16 | FromDiscord | <Elegantbeef> What's that timestamp look like? |
04:24:54 | retronav | Either 2022-03-11T13:15:25.320+00:00 or 2022-03-11T13:15:25+00:00 |
04:25:14 | retronav | You may refer to https://datatracker.ietf.org/doc/html/rfc3339#section-5.8 for examples |
04:25:47 | FromDiscord | <Elegantbeef> Looks like one would need to use the times.parse for each possible version |
04:26:14 | retronav | ok |
04:26:27 | retronav | so a try except for each pattern? |
04:26:35 | FromDiscord | <Elegantbeef> Yea |
04:26:46 | retronav | makes sense |
04:29:17 | retronav | Elegantbeef I found a package that does what i want (https://nimble.directory/pkg/rfc3339) but looks like nimble says "Package not found" |
04:29:42 | FromDiscord | <Elegantbeef> It's still alive |
04:30:27 | FromDiscord | <Elegantbeef> Ugh i hate that package already ` ## Sets the month to a given amount, which must be within [1, 12]` |
04:31:22 | retronav | 😅 |
04:31:26 | FromDiscord | <Elegantbeef> Apparently `month: 1..12` is too hard |
04:32:04 | FromDiscord | <Elegantbeef> And they manually do bitsets |
04:33:16 | * | rockcavera quit (Remote host closed the connection) |
04:35:04 | FromDiscord | <Elegantbeef> Well i guess if the library works for you disregard my outrage 😛 |
04:36:10 | retronav | Elegantbeef if i manage to install it in the first place; i'm trying to configure nimble |
04:36:22 | FromDiscord | <Elegantbeef> `nimble -v`? |
04:36:26 | retronav | if you have any other solutions/libs in mind please let me know :) |
04:36:35 | retronav | nimble v0.13.1 |
04:36:46 | FromDiscord | <Elegantbeef> Hmm that's modern |
04:36:59 | FromDiscord | <Elegantbeef> I just installed it so you have something wrong |
04:37:31 | FromDiscord | <Elegantbeef> I mean the library seems fine, just not very idiomatic and does some weird things |
04:37:43 | retronav | added nimble.directory in the config but its not doing the job; maybe something wrong with my system |
04:37:46 | FromDiscord | <Elegantbeef> How are you trying to install it? |
04:38:01 | FromDiscord | <Elegantbeef> You dont need to add nimble.directory to the the config |
04:38:51 | FromDiscord | <Elegantbeef> `https://github.com/nim-lang/packages/raw/master/packages.json` is all you need |
04:39:01 | retronav | i'm trying by imble install rfc333999 it would say "Package not found" |
04:39:18 | FromDiscord | <Elegantbeef> your `.config/nimble/nimble.ini` looks like? |
04:39:44 | retronav | wait i'll check |
04:41:59 | retronav | ah i don't have one lol |
04:42:13 | FromDiscord | <Elegantbeef> Well there you go |
04:42:36 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3SaX here's mine |
04:42:52 | FromDiscord | <Elegantbeef> Dont know why it's' so polluted, but yea |
04:43:08 | FromDiscord | <Elegantbeef> Anyway i'm going to fork and PR this time library so thanks for that 😛 |
04:43:31 | retronav | :) |
04:45:47 | FromDiscord | <Elegantbeef> Ah nevermind, really feel like the `times` module works just aswell |
04:46:15 | FromDiscord | <Elegantbeef> Was going to but realized i was just replicating `times` |
04:49:37 | FromDiscord | <Elegantbeef> Like you can easily make your own parser then call `initDateTime` to prevent the try except method, seems more sane than making that package idiomatic to me |
04:50:50 | retronav | i'll probably do that, package seems to have no documentation |
04:51:04 | retronav | can't figure out what to use |
04:51:10 | retronav | but thanks for sticking around :D |
04:54:29 | FromDiscord | <Elegantbeef> There is a parse function somewhere in it |
04:55:02 | FromDiscord | <Elegantbeef> `toDate` |
04:59:11 | retronav | ah yes |
04:59:13 | retronav | got that |
05:04:33 | retronav | now converting its return type to `Time` |
05:05:33 | retronav | ah nvm i don't need to that |
05:08:40 | * | slowButPresent quit (Quit: leaving) |
05:10:05 | termer | <Elegantbeef> Termer just realized the destruction of my name 😀 |
05:10:09 | termer | ahahaha I mistyped |
05:10:26 | FromDiscord | <Elegantbeef> I am buuf now |
05:10:35 | termer | I've been trying to fix my bad habits in typing accumulated over years so properly relearning has caused an uptick in typos |
05:10:51 | FromDiscord | <Elegantbeef> Oh trying to touch type properly? |
05:11:12 | termer | I could always touch type but my right fingers never were proper |
05:11:18 | FromDiscord | <Elegantbeef> I only properly type with my left hand, my right hand uses like the first two fingers |
05:11:23 | FromDiscord | <Elegantbeef> Aw shit, same! |
05:11:30 | termer | yeah I don't get why |
05:11:40 | termer | so I've been making a concerted effort to fix it |
05:12:32 | termer | Now that I've really gotten deep into Nim I keep wanting to rewrite all my little things in it lol |
05:12:53 | termer | particularly all the things I've got around running on javascript |
05:13:08 | termer | anything dynamically typed is really easy to begin with but maintenance down the road becomes difficult |
05:13:19 | termer | and I've continuously seen that with JS |
05:14:26 | FromDiscord | <Elegantbeef> I know the reason I do, too much playing competitive games, in a hurry not having to situate all fingers is quicker |
05:15:10 | FromDiscord | <Elegantbeef> Ah, never really been one for dynamic languages |
05:15:21 | FromDiscord | <Elegantbeef> Especially now with my love of distinct and subrange types i doubt i ever will be |
05:15:40 | FromDiscord | <Generic> dynamic languages are just a hotfix for bad generics |
05:16:09 | FromDiscord | <Elegantbeef> I agree with that sentiment |
05:17:01 | termer | pretty apt for someone with the name "Generic" to say |
05:17:03 | FromDiscord | <Elegantbeef> And i mean i generally dont find myself slowed down with the typesystem, it's never the reason i'm writing code slowly |
05:17:11 | FromDiscord | <Elegantbeef> I say they're a plant |
05:17:14 | termer | Nim generics have been like nothing I've ever used before |
05:17:17 | FromDiscord | <Elegantbeef> for the generic corp |
05:17:28 | termer | they feel like dynamic but are completely typesafe |
05:17:41 | FromDiscord | <Elegantbeef> I wrote C# before Nim, so I'm partially used to them, but C#'s generics are only for classes so are shite |
05:17:52 | FromDiscord | <Elegantbeef> Ideally you constrain generics with a concept imo |
05:17:54 | termer | I came from Java |
05:17:59 | FromDiscord | <Generic> the best thing are C++ies getting used to constexpr and auto etc. |
05:18:00 | termer | so similar situation |
05:18:17 | FromDiscord | <Generic> I find all those things super convoluted and limited in C++ |
05:18:32 | termer | I never learned C++ cause everytime I started on it I found out the package system was shit |
05:18:48 | FromDiscord | <Generic> but they think they're inventing all that stuff |
05:19:03 | termer | C++ just sucks from every side I've looked at it |
05:19:09 | termer | C is ok but old |
05:19:17 | termer | I don't mind C for some limited scopes |
05:19:24 | FromDiscord | <Generic> C++ can be used pretty well as a better C |
05:19:36 | termer | whenever I write C++ I write it like C |
05:19:37 | FromDiscord | <Elegantbeef> I'd rather use Odin or Zig over C |
05:19:39 | FromDiscord | <Generic> or C with namespaces if you will so |
05:19:42 | termer | and use as little C++ as possible |
05:19:58 | FromDiscord | <Generic> obviously if I have free choice I don't write C++ either |
05:20:04 | FromDiscord | <Generic> but this is not the world we live in |
05:20:08 | termer | :) |
05:20:17 | termer | I write JavaScript all day |
05:20:19 | termer | it sucks |
05:20:24 | FromDiscord | <Elegantbeef> It's the one i live in, oh wait i dont write code professionally |
05:20:37 | FromDiscord | <Generic> me neither |
05:20:51 | termer | I write code professionally and you don't get to choose your tools in the vast majority of cases |
05:20:58 | FromDiscord | <Generic> but there are some existing projects I contribute to which are written in C+b |
05:21:13 | termer | I did meet one dude who sponsored one of my nim projects though which was awesome |
05:21:22 | FromDiscord | <Generic> cool |
05:21:27 | FromDiscord | <Generic> what was it? |
05:21:38 | termer | I'm writing a realtime video server |
05:21:43 | termer | a client and server |
05:21:59 | FromDiscord | <Generic> how much do you deal with video data yourself? |
05:22:26 | termer | Well I haven't gotten to handling the raw data yet but I'm going to need to parse MPEGTS segments myself most likely |
05:22:38 | termer | I'd love to use ffmpeg libraries but the documentation is just horrible so I'm a little limited with that |
05:22:45 | FromDiscord | <Generic> ah |
05:23:05 | FromDiscord | <Generic> I never worked with video data, but I would like to some day |
05:23:13 | termer | Video is really interesting |
05:23:16 | FromDiscord | <Generic> I'm just too stupid for all that signal theory stuff |
05:23:30 | termer | I've built several video sites like YT before but most of them just interface with ffmpeg |
05:23:54 | FromDiscord | <Elegantbeef> inb4 you didnt use libffmpeg but used the CLI application 😀 |
05:24:01 | termer | the worst task is dealing with people who upload RETARDED BROKEN VIDEOS ALL THE TIME |
05:24:07 | termer | yeah I did |
05:24:13 | termer | you don't need to interface with the lib most of the time |
05:24:31 | FromDiscord | <Elegantbeef> Eh it's cleaner to not have to deal with a shell |
05:24:39 | termer | the CLI is really good but people are stupid and don't specify which version |
05:24:45 | termer | so you'll get conflicts from versions |
05:24:51 | termer | and nobody seems to build their own ffmpeg |
05:25:10 | termer | so between deployments you'll have people using different versions and running into old bugs that were fixed with newer versions |
05:25:31 | termer | I recently dealt with this and had to backport fixes specifically for the version they were using |
05:25:39 | FromDiscord | <Elegantbeef> lol |
05:26:33 | termer | steam has a really successful realtime video streaming system built on FFmpeg |
05:26:45 | termer | but it's all closed source so I can only guess what they're doing |
05:26:59 | FromDiscord | <Elegantbeef> I'd like to believe all streaming is based on ffmpepg |
05:27:04 | termer | most is |
05:27:17 | termer | sometimes more rudimentary things are based on gstreamer |
05:27:20 | termer | especially audio |
05:28:11 | termer | gstreamer is simpler and better documented but not as many features and supported codecs |
05:28:20 | termer | ffmpeg just supports everything basically if you compile with the right flags |
05:57:07 | NimEventer | New thread by Kaushalmodi: Blog post: Binding Nim to C++ std::list, see https://forum.nim-lang.org/t/9007 |
06:05:29 | FromDiscord | <Rika> In reply to @Elegantbeef "<@259277943275126785>\: do you use": i do not |
06:05:35 | FromDiscord | <Rika> i use neovimm |
06:06:05 | FromDiscord | <Rika> i hope no one else pinged me so far up since im not reading all of that |
06:20:35 | * | vicfred joined #nim |
06:21:46 | * | vicfred_ joined #nim |
06:23:33 | * | vicfred_ quit (Client Quit) |
06:25:06 | * | vicfred quit (Ping timeout: 252 seconds) |
06:41:16 | NimEventer | New Nimble package! niprefs - A dynamic preferences-system with a table-like structure for Nim., see https://github.com/Patitotective/niprefs |
06:48:06 | nrds | <Prestige99> @Rika do you have issues with nimsuggest with neovim? If you're using nimlsp like me |
06:48:29 | FromDiscord | <Rika> thats the thing, i pretty much dont use it; the plugin restarts it for me if it crashes though |
06:48:32 | FromDiscord | <Rika> i dont use nimlsp |
06:48:39 | FromDiscord | <Rika> i dont care what i use as long as it works better |
06:49:03 | nrds | <Prestige99> Do you have any sort of error reporting while editing? |
06:49:17 | FromDiscord | <Rika> no |
06:49:18 | * | Jjp137 joined #nim |
06:49:18 | FromDiscord | <Rika> i dont use that |
06:49:28 | FromDiscord | <Rika> nimsuggest is shoddy wit hthat |
06:49:30 | nrds | <Prestige99> interesting |
06:49:38 | nrds | <Prestige99> Yeah I get a lot of false errors |
06:50:09 | nrds | <Prestige99> Well, since 1.6.0 |
06:50:17 | FromDiscord | <Rika> nimsuggest is just a mess |
06:50:24 | FromDiscord | <Rika> dont use it at all i would really say |
06:50:56 | nrds | <Prestige99> What are you using with neovim? |
06:50:57 | FromDiscord | <Rika> yall say "oh but if more people use it more bugs will be fixed" nah man the whole fuckin implementation is borked so unless some kind soul is willing to reimplement it |
06:51:00 | FromDiscord | <Rika> just dont bother |
06:51:03 | FromDiscord | <Rika> nim.nvim |
06:54:08 | nrds | <Prestige99> I hear IC is supposed to greatly help editor support somehow, I pray that's the case |
06:54:23 | nrds | <Prestige99> so many people don't adopt nim because of bad editor support |
07:00:34 | FromDiscord | <Phil> Didn't stop me, though good intellisense would've been liked |
07:00:54 | FromDiscord | <Phil> Having red squiggly lines where the compiler screams at me as a bare fundamental is really nice though |
07:01:25 | FromDiscord | <Elegantbeef> Comically I've had more issues with compiler bugs than nimsuggest |
07:01:30 | nrds | <Prestige99> I've had a lot of people try nim and not continue because editor support, unfortunately |
07:10:48 | * | ltriant joined #nim |
07:13:55 | * | jjido joined #nim |
07:15:42 | * | ltriant quit (Ping timeout: 252 seconds) |
07:33:09 | FromDiscord | <Equinox> Why is everyone here a bot? |
07:33:44 | FromDiscord | <Rika> because theyre bridged from another chat service by a bot |
07:34:19 | FromDiscord | <Equinox> Oh, I see, which one? |
07:34:38 | FromDiscord | <Rika> irc matrix gitter(not sure if this still exists) |
07:34:45 | FromDiscord | <Rika> the one from irc says irc |
07:34:49 | FromDiscord | <Rika> otherwise its matrix |
07:35:55 | FromDiscord | <Elegantbeef> gitter exists but is now matrix backed |
07:43:21 | * | toulene quit (Quit: Ping timeout (120 seconds)) |
07:45:15 | * | toulene joined #nim |
07:53:37 | * | toulene quit (Ping timeout: 272 seconds) |
07:56:12 | * | toulene joined #nim |
08:24:45 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:33:41 | * | toulene quit (Quit: The Lounge - https://thelounge.chat) |
08:44:35 | * | toulene joined #nim |
08:54:24 | FromDiscord | <elaykph> any tips on making smaller binaries :> |
08:54:51 | FromDiscord | <Elegantbeef> Didnt i already give all the flags? |
08:55:06 | FromDiscord | <elaykph> ooh, like the `-d` flags? |
08:55:23 | FromDiscord | <Elegantbeef> `-d:lto -d:danger --gc:arc --opt:size --passC:"-march=native"` |
08:55:24 | FromDiscord | <Rika> yeah "release" "lto" etc |
08:55:28 | FromDiscord | <Rika> opt size |
08:55:29 | FromDiscord | <elaykph> nice |
08:55:30 | FromDiscord | <Rika> arc yeah |
08:55:32 | FromDiscord | <elaykph> thx :) |
08:55:32 | FromDiscord | <Elegantbeef> those in theory should make the smallest possible binary |
08:55:38 | FromDiscord | <Rika> -d:strip |
08:56:09 | FromDiscord | <Elegantbeef> Was it you or someone else that was asking this earlier? |
08:56:17 | FromDiscord | <elaykph> In reply to @Elegantbeef "Was it you or": im sure that wasnt me |
08:56:30 | FromDiscord | <elaykph> smol world lmao |
08:57:07 | FromDiscord | <enthus1ast> nim binaries are quite small already, why you need smaller ones? |
08:58:12 | FromDiscord | <enthus1ast> another option is to pack them via upx |
08:58:12 | FromDiscord | <enthus1ast> to also pack them via upx |
08:58:40 | FromDiscord | <Elegantbeef> I feel like UPX is how you get even more malware detection |
08:58:47 | FromDiscord | <enthus1ast> sure \:) |
08:58:57 | FromDiscord | <Rika> upx is not reliable |
08:59:16 | FromDiscord | <Rika> In reply to @Elegantbeef "I feel like UPX": no, there is something to mitigate that |
08:59:36 | FromDiscord | <Rika> https://en.wikipedia.org/wiki/Software_taggant |
08:59:39 | FromDiscord | <elaykph> In reply to @enthus1ast "nim binaries are quite": smoller sounds better |
08:59:45 | FromDiscord | <Rika> not that upx uses it, im not sure |
08:59:47 | FromDiscord | <elaykph> so i can dm my discord frens without reaching 8mb |
08:59:51 | FromDiscord | <Rika> In reply to @elaykph "smoller sounds better": smaller can imply slower |
08:59:59 | FromDiscord | <elaykph> In reply to @Rika "smaller can imply slower": sadge |
09:00:01 | FromDiscord | <enthus1ast> you have an 8mb binary?? |
09:00:03 | FromDiscord | <Elegantbeef> If your binary is 8MB you have a fucking problem |
09:00:09 | FromDiscord | <elaykph> In reply to @Elegantbeef "If your binary is": lmao |
09:00:17 | FromDiscord | <Rika> the hell did you put in your binary |
09:00:18 | FromDiscord | <elaykph> time to learn how to not write shitcode |
09:00:20 | FromDiscord | <Rika> image data? |
09:00:27 | FromDiscord | <elaykph> In reply to @Rika "image data?": 3d models :> |
09:00:32 | FromDiscord | <Elegantbeef> I have an entire game assets and sdl2 and it's not 8MB |
09:00:48 | FromDiscord | <elaykph> In reply to @elaykph "3d models :>": but like in json |
09:00:53 | FromDiscord | <enthus1ast> compress these models before you store them into the executable↵(@elaykph) |
09:00:55 | FromDiscord | <Elegantbeef> Well there's your problem, quit shipping shitty formats |
09:01:03 | FromDiscord | <Elegantbeef> use gltf2 like a normal person |
09:01:14 | FromDiscord | <elaykph> true true true |
09:01:16 | FromDiscord | <Elegantbeef> glb is a binary compact format |
09:01:26 | FromDiscord | <elaykph> In reply to @enthus1ast "compress these models before": 👌 |
09:01:46 | FromDiscord | <elaykph> In reply to @Elegantbeef "glb is a binary": oh nice, i'll keep that in my notebook |
09:01:54 | FromDiscord | <enthus1ast> or put your binary into a zip folder \:) |
09:02:12 | FromDiscord | <elaykph> In reply to @enthus1ast "or put your binary": ✍️ |
09:02:53 | FromDiscord | <enthus1ast> OR in addition to use a better format like beef mentioned use an installer (like nsis), or do not pack all the sutff into the exe |
09:03:08 | FromDiscord | <Elegantbeef> Code is generally small so it's never going to be the reason you're binaries are large |
09:03:16 | FromDiscord | <Rika> your |
09:03:23 | FromDiscord | <Elegantbeef> Yes |
09:04:51 | FromDiscord | <enthus1ast> or maybe another option, if you already have nim types for the 3d models, maybe you can store these in a const (instead of the json) |
09:05:35 | FromDiscord | <Elegantbeef> Alternatively move your friends to matrix as elements' free server file limit is 100mb |
09:05:36 | FromDiscord | <enthus1ast> sent a long message, see http://ix.io/3Sbp |
09:05:45 | FromDiscord | <elaykph> woah |
09:05:53 | FromDiscord | <elaykph> sounds great |
09:05:55 | FromDiscord | <elaykph> thanks guys |
09:06:54 | FromDiscord | <Elegantbeef> Enthus any idea if there is a private message size limit, seems like probably a homeserver setting? |
09:07:16 | FromDiscord | <enthus1ast> mh, must check my homeserver config |
09:07:20 | FromDiscord | <Elegantbeef> I've not used private messages in element really so no clue if there even is one |
09:08:21 | FromDiscord | <enthus1ast> well there is\:↵#max\_upload\_size\: 50M |
09:08:43 | FromDiscord | <Elegantbeef> Ah so probably the same for the default matrix homeserver then |
09:09:01 | FromDiscord | <Elegantbeef> 100mb file for DM or free public server i guess |
09:09:03 | FromDiscord | <enthus1ast> yeah could be |
10:12:14 | * | jjido joined #nim |
10:20:57 | * | jmdaemon quit (Ping timeout: 240 seconds) |
10:27:13 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
11:09:27 | * | ltriant joined #nim |
11:14:27 | * | ltriant quit (Ping timeout: 256 seconds) |
11:28:42 | * | mahlon_ quit (Ping timeout: 252 seconds) |
12:37:42 | FromDiscord | <DevNugget> sent a code paste, see https://paste.rs/USy |
12:42:09 | FromDiscord | <Rika> `words[2..^1]` |
12:42:38 | FromDiscord | <Rika> it is required to specify the second index, but there is a shortcut for the last (or nth from last) index |
12:42:44 | FromDiscord | <Rika> ^1 is last, 2 is 2nd from last, etc |
12:51:32 | FromDiscord | <DevNugget> Ah I see thank you very much! |
12:53:32 | FromDiscord | <tandy> does anyone have a nice algorithm for diff updating seqs? |
13:02:27 | * | kayabaNerve_ joined #nim |
13:04:23 | * | kayabaNerve quit (Ping timeout: 256 seconds) |
13:14:36 | * | rockcavera joined #nim |
13:14:36 | * | rockcavera quit (Changing host) |
13:14:36 | * | rockcavera joined #nim |
13:14:49 | FromDiscord | <Phil> Question regarding unittesting and testament |
13:15:45 | FromDiscord | <Phil> How do I use both?↵Prologue uses testament to essentially throw all tests into a single file and compile + run that (as apparently that's super fast) through testament (which appears to be a package?) but that does very much not play nice with writing normal unittests with suite's containing tests etc. |
13:16:20 | FromDiscord | <Phil> Which is something I'd very much like to keep for I believe it to be a best practice, you can express in the suite which proc you're testing and whether it's an integration test, while the test description allows you to express "Given - When - Then" stuff |
13:16:23 | FromDiscord | <enthus1ast> you can combine it |
13:17:04 | FromDiscord | <enthus1ast> https://github.com/enthus1ast/nimja/blob/master/tests/basic/test_if.nim |
13:17:13 | FromDiscord | <enthus1ast> i do it quite often in nimja |
13:17:22 | FromDiscord | <Phil> It's just that apparently testament creates "outputExpected" and "outputGotten" |
13:17:38 | FromDiscord | <enthus1ast> testament is the only way afaik to test macro errors |
13:18:27 | FromDiscord | <Phil> and that starts not matching up once I write a test suite, I'll. xflywind wrote something about "Imo, you need to specify the output of stdout:"↵Not sure what that's about |
13:18:28 | FromDiscord | <enthus1ast> " joinable\: false"↵let testament do not combine the test in the megatest.nim |
13:19:28 | FromDiscord | <Phil> Ohhh so the discard """ """ stuff contains testament instructions |
13:19:36 | FromDiscord | <enthus1ast> yes |
13:22:16 | FromDiscord | <enthus1ast> and eg here\: https://github.com/enthus1ast/nimja/blob/master/tests/basic/test_tokens_before_extend_error.nim↵↵i test for a macro error |
13:22:22 | FromDiscord | <enthus1ast> only way to test them |
13:23:04 | * | toulene quit (Read error: Connection reset by peer) |
13:23:17 | * | toulene joined #nim |
13:25:57 | FromDiscord | <Phil> So I specify the printed output of the tests in the "output" section in the discarded string |
13:26:06 | FromDiscord | <Phil> (edit) "So I specify the ... printed" added "expected" |
13:26:49 | FromDiscord | <Phil> In reply to @enthus1ast "and eg here\: https://github.com/enthus1ast/nimja/b": Huh, I'd have solely checked with "compiles" proc |
13:27:02 | FromDiscord | <Phil> Wait, you do that there |
13:27:15 | FromDiscord | <Phil> Gnaaaaa maybe I shouldn't be coding atm to distract myself when I can barely thing |
13:27:16 | FromDiscord | <Phil> (edit) "thing" => "think" |
13:31:35 | FromDiscord | <Phil> Okay, after starting at your code examples and the example of that in the nim std and the docs I think I got it working |
13:31:46 | FromDiscord | <Phil> It's a bit odd to have to copy paste the terminal output into that discard-string |
13:32:20 | FromDiscord | <Phil> But I'll take it over just using "block" for tests. Suite + Test imo are a best practice to use |
13:32:26 | FromDiscord | <enthus1ast> you do not need to do this, a testament test is mark as failed when the return code is != 0 |
13:32:51 | FromDiscord | <enthus1ast> i only must do it because i want to test for a macro error |
13:32:55 | FromDiscord | <Phil> If I don't then prologue running tests screams at me |
13:34:53 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Scu |
13:35:13 | FromDiscord | <Phil> If I use this, it doesn't explode in my face: |
13:35:26 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Scv |
13:36:38 | FromDiscord | <Phil> I think the issue stems from the test somehow printing into the outputGotten file while not being considered in the outputExpected file ? |
13:37:50 | * | ltriant joined #nim |
13:38:09 | * | xet7 quit (Ping timeout: 256 seconds) |
13:38:34 | * | xet7 joined #nim |
13:42:42 | * | ltriant quit (Ping timeout: 260 seconds) |
14:00:26 | NimEventer | New thread by Mros: Return cstringArray from C functions in Nim, see https://forum.nim-lang.org/t/9009 |
14:38:52 | * | arkurious joined #nim |
15:04:07 | FromDiscord | <Tanguy> Is there something similar to https://nim-lang.org/docs/macros.html#sameType%2CNimNode%2CNimNode but that takes into account inheritance?↵eg, like `of` |
15:05:52 | FromDiscord | <Tanguy> (edit) "`of`" => "`is`" |
15:12:33 | * | oprypin quit (Remote host closed the connection) |
15:15:41 | * | oprypin joined #nim |
15:26:38 | * | jjido joined #nim |
15:33:15 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
15:34:03 | * | slowButPresent joined #nim |
15:34:37 | NimEventer | New thread by Mardiyah: Determine the last line of the template's insertion, see https://forum.nim-lang.org/t/9010 |
15:42:13 | * | Schnouki quit (Remote host closed the connection) |
15:42:13 | * | toothlessgear quit (Remote host closed the connection) |
15:42:33 | * | Schnouki joined #nim |
15:42:56 | * | toothlessgear joined #nim |
15:49:20 | * | mahlon joined #nim |
16:09:57 | FromDiscord | <System64 ~ Flandre Scarlet> Why do I have this error? https://media.discordapp.net/attachments/371759389889003532/952961794840862740/unknown.png |
16:19:12 | FromDiscord | <Rika> `ptr` is a generic. if you want a void pointer you write `pointer` |
16:19:16 | FromDiscord | <Rika> (edit) |
16:19:35 | FromDiscord | <System64 ~ Flandre Scarlet> ah alright |
16:45:46 | FromDiscord | <tandy> is it possible to iterate over an OrderedTable for an index range like with a seq? |
16:45:58 | FromDiscord | <tandy> say i only want the first 5 values |
16:54:08 | * | jjido joined #nim |
17:03:01 | nrds | <Prestige99> I don't think so, but you could just do it manually by iterating and breaking after 5 elements |
17:03:38 | nrds | <Prestige99> there's also the toSeq proc that converts an iterator to a seq, but it will convert all of the values which you probably don't want |
17:05:11 | FromDiscord | <ynfle> You can do table.pairs.toseq.pairs |
17:09:36 | FromDiscord | <untoreh> sent a code paste, see https://play.nim-lang.org/#ix=3SdU |
17:21:59 | FromDiscord | <retkid> is there like a pipreqs for nim |
17:22:15 | FromDiscord | <retkid> i can just go "magic ." and it spits out a dependency file |
17:22:19 | FromDiscord | <Rika> what is that |
17:22:20 | FromDiscord | <Rika> no |
17:22:28 | FromDiscord | <retkid> sad |
17:22:39 | FromDiscord | <Rika> packages can be named differently from the module names |
17:22:50 | FromDiscord | <retkid> i guess I'll have to put in the hours of time to write out the 4 packages |
17:22:54 | FromDiscord | <retkid> my handsss |
17:23:04 | FromDiscord | <retkid> 😭 |
17:23:20 | FromDiscord | <retkid> sorry the 2 |
17:39:05 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
17:39:25 | * | ltriant joined #nim |
17:43:02 | * | jjido joined #nim |
17:44:39 | * | ltriant quit (Ping timeout: 256 seconds) |
17:54:39 | * | Figworm joined #nim |
18:04:35 | FromDiscord | <spoon> sent a code paste, see https://paste.rs/onO |
18:05:00 | FromDiscord | <spoon> why does including 1 in the range make it to where it only prints the first line, but all other ranges it prints all the lines? |
18:05:45 | FromDiscord | <spoon> if i do `recite(1,12)` it only prints the first day of christmas, but if i do `recite(2,12)` it prints all the lines second through twelfth |
18:13:18 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
18:16:19 | FromDiscord | <Rika> `recite(1,12)` goes to `if versei == 1: return "On the first day of Christmas my true love gave to me: a Partridge in a Pear Tree."` and finishes because it returned |
18:17:37 | FromDiscord | <spoon> lines 2-12 also have a return statement in a different spot, the function calls itself |
18:19:29 | FromDiscord | <spoon> like if i called `recite(2,3)`, it will still reach a return statement on line 8 and continue just fine |
18:22:24 | FromDiscord | <spoon> ohhh |
18:22:29 | FromDiscord | <spoon> nvm, i see now |
18:22:47 | FromDiscord | <Rika> lol |
18:22:54 | FromDiscord | <spoon> got it ty |
18:23:17 | Amun-Ra | that indentation tho… |
18:24:20 | FromDiscord | <spoon> it's not that weird, is it? |
18:25:25 | FromDiscord | <spoon> it's always the stupid mistakes that get me lol |
18:28:56 | FromDiscord | <Rika> its not |
18:29:00 | FromDiscord | <Rika> indentation is completely fine |
18:29:07 | FromDiscord | <Rika> but your whitespace usage is kinda |
18:29:40 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3Sem |
18:30:24 | FromDiscord | <spoon> it won't exit after the first result? |
18:30:33 | FromDiscord | <Rika> where |
18:30:37 | FromDiscord | <spoon> result is like a substitute for return, right? |
18:31:10 | FromDiscord | <Rika> yes but they are not the same |
18:31:13 | FromDiscord | <Rika> result is a variable |
18:31:20 | FromDiscord | <Rika> and when your function ends its whats returned |
18:31:41 | FromDiscord | <spoon> huh. |
18:32:55 | FromDiscord | <spoon> it does work, weird |
18:34:20 | FromDiscord | <spoon> i don't think i've seen an equivalent to that in any other language...? |
18:34:43 | FromDiscord | <Rika> thats because from what i know its very rare 😉 |
18:34:58 | FromDiscord | <Rika> its prolly unique to nim |
18:35:08 | FromDiscord | <qb> and great ❤️ |
18:35:32 | FromDiscord | <Rika> there are some issues though like returning a half-finished object |
18:35:37 | FromDiscord | <Rika> if you forget, for example |
18:35:52 | FromDiscord | <Rika> but thats not inherent to result i guess |
18:36:29 | * | mjsir911 quit (Remote host closed the connection) |
18:36:44 | * | mjsir911 joined #nim |
18:36:44 | FromDiscord | <spoon> i've had a few cases where i tried to create a new variable called result to return but then i remembered it's a special thing, i almost called final result too |
18:37:02 | FromDiscord | <Rika> well now you know |
18:39:01 | NimEventer | New thread by Shirleyquirk: Wrapping C++ iterators: {.nodecl.} for non-constructible iterators?, see https://forum.nim-lang.org/t/9011 |
18:41:49 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Ses |
18:42:03 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "https://play.nim-lang.org/#ix=3Ses" => "https://play.nim-lang.org/#ix=3Set" |
18:43:48 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Seu |
18:46:03 | FromDiscord | <kiell> https://www.reddit.com/r/fsharp/comments/jo42yt/why_i_dont_choose_f/gbtoj09/ |
18:46:22 | FromDiscord | <kiell> "nim docs look like they were written over the weekend in between partying." whyd they have to do nim like that 💀 |
18:56:50 | FromDiscord | <Rika> `{}` is set |
18:56:56 | FromDiscord | <Rika> `[]` is array] |
19:00:24 | FromDiscord | <soda> When passing a string along, is it more efficient to do it by ref? |
19:02:00 | FromDiscord | <huantian> Nim will automatically pass by ref if the object is big enough |
19:02:09 | FromDiscord | <soda> cool |
19:09:53 | FromDiscord | <soda> is there a generic filesystem entry iterator? |
19:10:09 | FromDiscord | <soda> Basically a way to check if an entry exists whether or not it's a file or dir, etc. |
19:10:33 | FromDiscord | <soda> equivalent of std::filesystem::exists(path) |
19:14:30 | FromDiscord | <qb> https://nim-lang.org/docs/os.html#dirExists%2Cstring ? |
19:15:44 | FromDiscord | <soda> A more generic version of this that covers inode |
19:15:56 | FromDiscord | <soda> instead of caring whether it's a file or dir, etc. |
19:18:00 | FromDiscord | <soda> sent a code paste, see https://play.nim-lang.org/#ix=3SeI |
19:19:47 | * | daanb joined #nim |
19:19:51 | daanb | hello |
19:22:04 | * | daanb quit (Client Quit) |
19:23:35 | FromDiscord | <soda> nvm im dumb |
19:23:40 | FromDiscord | <soda> or blind |
19:23:49 | FromDiscord | <Daan Breur> I have a question about Threading in nim can anybody help? |
19:24:26 | FromDiscord | <Daan Breur> I would like to make n threads depending on some variable, but i cant seem to get it working to initialize threads to a sequence |
19:25:10 | FromDiscord | <Elegantbeef> `var threads = newSeq[Thread[ThreadArgType]](threadCount)` |
19:25:24 | FromDiscord | <Elegantbeef> `for thread in threads.mitems: createThread(thread, threadArg)` |
19:27:35 | FromDiscord | <Daan Breur> will try thanks |
19:27:38 | FromDiscord | <d4rckh> hank you |
19:27:41 | FromDiscord | <d4rckh> (edit) "hank you" => "thank you!" |
19:27:51 | FromDiscord | <Daan Breur> why is my boss here |
19:27:52 | FromDiscord | <Daan Breur> @d4rckh |
19:27:55 | FromDiscord | <Daan Breur> :kappa: |
19:28:02 | FromDiscord | <d4rckh> lol |
19:28:15 | FromDiscord | <d4rckh> get back to work!! |
19:28:34 | FromDiscord | <Daan Breur> im asking questions for you otherwise work aint getting done |
19:29:08 | FromDiscord | <d4rckh> i asked same question yesterday but no success 😦 |
19:29:53 | * | daanb joined #nim |
19:30:30 | daanb | Imma test it now, stay strong |
19:32:54 | FromDiscord | <Daan Breur> sent a code paste, see https://paste.rs/wgO |
19:33:01 | daanb | doesnt work |
19:34:34 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Rika "`{}` is set": Ah alright |
19:37:57 | daanb | Elegantbeef, Thank you I got it working in the end! |
19:39:00 | FromDiscord | <System64 ~ Flandre Scarlet> And that? https://media.discordapp.net/attachments/371759389889003532/953014405698834482/unknown.png |
19:39:59 | FromDiscord | <Rika> should wor |
19:40:00 | FromDiscord | <Rika> k |
19:40:36 | FromDiscord | <auxym> i think you have to use `for i in wavetable.mitems` |
19:40:57 | * | [R] quit (Ping timeout: 240 seconds) |
19:41:09 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @auxym "i think you have": Doesn't work too |
19:41:16 | FromDiscord | <auxym> the default `items` iterator is not `var`, therefore immutable, even if the thing is var |
19:41:35 | FromDiscord | <System64 ~ Flandre Scarlet> aaah alright |
19:42:21 | * | [R] joined #nim |
19:43:38 | FromDiscord | <auxym> works in playground, with `mitems`, what error do you get? |
20:07:31 | FromDiscord | <System64 ~ Flandre Scarlet> It works with mitems |
20:11:49 | FromDiscord | <retkid> In reply to @System64 "is it normal when": spot the java programmer |
20:16:17 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @retkid "spot the java programmer": Yeah I admit |
20:16:27 | FromDiscord | <System64 ~ Flandre Scarlet> I did some Java (and I'm not a fan of java) |
20:16:41 | FromDiscord | <Phil> Hm? I actually do develop java and I don't see the point here |
20:16:50 | * | kenran joined #nim |
20:17:12 | FromDiscord | <Phil> Did you expect just being given a memory address? |
20:17:18 | * | kenran quit (Client Quit) |
20:17:40 | FromDiscord | <Phil> (edit) "Did you expect ... justbe" added "to" | "being" => "be" |
20:18:10 | FromDiscord | <System64 ~ Flandre Scarlet> no, the value of the index |
20:18:24 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/Ts2 |
20:18:27 | * | kenran joined #nim |
20:18:52 | FromDiscord | <Phil> If you want them to be int 8 you just have to specify that in the type of the variable and nim will automatically ensure that it's that type for you |
20:18:57 | FromDiscord | <Phil> Otherwise it just uses the default int type |
20:19:07 | FromDiscord | <retkid> the default type is 32 |
20:19:08 | FromDiscord | <retkid> iirc |
20:19:13 | FromDiscord | <retkid> (right) |
20:19:18 | FromDiscord | <retkid> (edit) "(right)" => "(right?)" |
20:19:20 | FromDiscord | <Phil> Generally nim tries to hide away specific bit sizes behind a general int type |
20:19:29 | FromDiscord | <System64 ~ Flandre Scarlet> can I do ``.int8`` ? |
20:19:47 | FromDiscord | <retkid> wavetable.apply(x=>int8(x)) |
20:19:53 | FromDiscord | <Phil> I'd just do `var wavetable: seq[int8] = "lala"` |
20:20:16 | FromDiscord | <retkid> mine is cooler |
20:20:26 | FromDiscord | <retkid> In reply to @retkid "wavetable.apply(x=>int8(x))": from sequtils |
20:20:54 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/953024948526522438/unknown.png |
20:20:59 | FromDiscord | <Phil> Ehhhhhh I need to think more when you start applying because I need to comprehend why you're doing the conversion |
20:21:19 | FromDiscord | <Phil> I don't like having to think more than the absolute minimum required to comprehend the idea behind the code |
20:21:35 | FromDiscord | <retkid> it makes sense to me when i see it |
20:21:36 | FromDiscord | <Phil> I prescribe to the anti-thought school of programming. The dumber your code the better |
20:22:01 | FromDiscord | <retkid> but i com https://media.discordapp.net/attachments/371759389889003532/953025227858788423/unknown.png |
20:22:04 | FromDiscord | <retkid> is this hard for you |
20:22:09 | FromDiscord | <retkid> >:) |
20:22:12 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Isofruit "I prescribe to the": this is a wavetable, a short sample if you want |
20:22:17 | FromDiscord | <Rika> In reply to @Isofruit "I'd just do `var": i dont remember this working |
20:22:21 | FromDiscord | <Rika> !eval var wavetable: seq[int8] = "lala" |
20:22:21 | FromDiscord | <retkid> ^ |
20:22:23 | NimBot | Compile failed: /usercode/in.nim(1, 28) Error: type mismatch: got 'string' for '"lala"' but expected 'seq[int8]' |
20:22:37 | FromDiscord | <Rika> this works |
20:22:48 | FromDiscord | <Phil> wait, right, that's a string, ugh my brain |
20:22:50 | FromDiscord | <Rika> !eval var wavetable = [23'i8, 31, 31, 28, 27, 26, 19, 15, 19, 23, 17, 10, 9, 11, 8, 10, 20, 29, 28, 22, 19, 17, 9, 5, 8, 13, 8, 3, 2, 6, 5, 9 ]; echo typeof wavetable |
20:22:52 | NimBot | array[0..31, int8] |
20:23:10 | FromDiscord | <Phil> In reply to @System64 "this is a wavetable,": fixed array or seq? |
20:23:11 | FromDiscord | <retkid> var wavetable: array[0 .. 2, int8] = [1,2,3] |
20:23:17 | FromDiscord | <retkid> fg;kmgh |
20:23:19 | FromDiscord | <Rika> In reply to @retkid "var wavetable: array[0 ..": will not work |
20:23:20 | FromDiscord | <retkid> not var |
20:23:25 | FromDiscord | <Rika> not that either |
20:23:33 | FromDiscord | <Rika> !eval let wavetable: array[0 .. 2, int8] = [1,2,3] |
20:23:33 | FromDiscord | <retkid> whats wrong with it? |
20:23:35 | NimBot | Compile failed: /usercode/in.nim(1, 38) Error: type mismatch: got 'array[0..2, int]' for '[1, 2, 3]' but expected 'array[0..2, int8]' |
20:23:43 | FromDiscord | <retkid> you gotta do the = |
20:23:44 | FromDiscord | <retkid> not the : |
20:23:46 | FromDiscord | <Rika> no |
20:23:59 | FromDiscord | <Rika> `[1,2,3]` should have the type in it somewhere in the first element |
20:23:59 | FromDiscord | <retkid> !eval let wavetable = array[0 .. 2, int8] [1,2,3] |
20:24:01 | NimBot | Compile failed: /usercode/in.nim(1, 37) Error: type mismatch: got 'array[0..2, int]' for '[1, 2, 3]' but expected 'array[0..2, int8]' |
20:24:07 | FromDiscord | <retkid> sad |
20:24:10 | FromDiscord | <Rika> that could work |
20:24:16 | FromDiscord | <Rika> !eval let wavetable = array[0 .. 2, int8]([1,2,3]) |
20:24:18 | NimBot | Compile failed: /usercode/in.nim(1, 36) Error: type mismatch: got 'array[0..2, int]' for '[1, 2, 3]' but expected 'array[0..2, int8]' |
20:24:26 | FromDiscord | <retkid> 😭 |
20:24:28 | FromDiscord | <Rika> i guess they cant be converted |
20:24:32 | FromDiscord | <Rika> use the one i wrote |
20:24:48 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Isofruit "fixed array or seq?": fixed |
20:25:00 | FromDiscord | <retkid> yea for a fixed length array use rikas |
20:25:04 | FromDiscord | <Phil> array it is then, makes more sense than seq |
20:25:24 | FromDiscord | <Phil> seq is specifically for variable length, think Array vs List interface |
20:25:26 | FromDiscord | <retkid> Rika always got the good solutions :) |
20:25:50 | FromDiscord | <retkid> can i make a set of non integers |
20:25:52 | FromDiscord | <System64 ~ Flandre Scarlet> it works |
20:25:55 | FromDiscord | <retkid> i would like an arbitrary type set |
20:26:10 | FromDiscord | <Phil> HashSets exist |
20:26:45 | FromDiscord | <Rika> hashset |
20:26:46 | FromDiscord | <Rika> yeah |
20:26:59 | FromDiscord | <Rika> requirement is that your type should be hashable ofc |
20:28:05 | FromDiscord | <retkid> now, what does hashable mean in this contxt |
20:28:11 | FromDiscord | <retkid> context |
20:28:13 | FromDiscord | <Rika> has a hash proc |
20:28:23 | FromDiscord | <retkid> so no complex types? |
20:28:33 | FromDiscord | <Rika> complex types work if you implement a hash proc |
20:28:43 | FromDiscord | <Rika> `hash(obj: T): Hash` |
20:28:46 | FromDiscord | <retkid> how annoying is that? |
20:28:51 | FromDiscord | <Rika> https://nim-lang.org/docs/hashes.html |
20:29:07 | FromDiscord | <Rika> you can make a macro for it if you just want to hash all fields and combine that |
20:29:09 | FromDiscord | <Phil> You can always define a custom hash proc, it's not really difficult, you just got to be aware of when you specifically want a hash collision to happen (aka when you consider 2 objects equal) |
20:29:11 | FromDiscord | <Rika> so not very i'd say |
20:30:38 | FromDiscord | <retkid> this seems pretty inefficient for skipping 1 line of code |
20:30:39 | FromDiscord | <Phil> https://nim-lang.org/docs/sets.html↵For docs on HashSets in general |
20:30:48 | FromDiscord | <retkid> I suppose it'll be faster for large datasets though |
20:32:00 | FromDiscord | <Phil> I mean, make it a set if you absolutely positively want to be sure there's no repetition or absolutely do not care about the amount of times your value occurs or sth |
20:32:23 | FromDiscord | <Phil> It's always sensible to turn the data you have into the data-types in which you think about your data |
20:33:12 | FromDiscord | <Daan Breur> Stupid question but are the `system/threads` actually parallel ? |
20:33:21 | FromDiscord | <Rika> yes? |
20:33:22 | FromDiscord | <retkid> yes :3 |
20:33:36 | FromDiscord | <Daan Breur> @d4rckh you are stupid \<3 |
20:33:40 | FromDiscord | <Rika> lol |
20:34:03 | FromDiscord | <retkid> im trying to think of a situation where it isn't true |
20:34:11 | FromDiscord | <Phil> In reply to @Daan Breur "Stupid question but are": Assuming your CPU has more than 1 thread they should have the ability to run in parallel, yeh |
20:34:54 | FromDiscord | <d4rckh> In reply to @Daan Breur "<@!648552095531663361> you are stupid": From the logs they didn't seem much parallel lol |
20:35:00 | FromDiscord | <retkid> They wont run in parallel if you run more than 1 task on a single cpu core, technically they're switching between tasks as they go |
20:35:09 | FromDiscord | <Rika> your task is probably too quick to "look parallel" |
20:35:09 | FromDiscord | <Daan Breur> sent a code paste, see https://paste.rs/euF |
20:35:32 | FromDiscord | <retkid> if exiting the thread is longer than each threads execution it wont look parallel |
20:35:44 | FromDiscord | <Rika> exiting/creating/etc |
20:35:54 | FromDiscord | <Rika> creating threads is slow fyi |
20:35:58 | FromDiscord | <retkid> it is |
20:36:12 | FromDiscord | <retkid> i will spawn 500 thread then just stare |
20:36:16 | FromDiscord | <retkid> then my cpu goes to 100 |
20:36:17 | FromDiscord | <Phil> IIRC wasn't that why you typically also have thread-pools? |
20:36:24 | FromDiscord | <retkid> well |
20:36:29 | FromDiscord | <retkid> threadpools are cool howeveer |
20:36:30 | FromDiscord | <retkid> (edit) "howeveer" => "however" |
20:36:34 | FromDiscord | <retkid> nobody wants to maintain it |
20:36:36 | FromDiscord | <retkid> so its kinda bad |
20:36:58 | FromDiscord | <Daan Breur> its even a warning on the docs page.↵WARNING: UNSTABLE API |
20:37:07 | FromDiscord | <retkid> and it will forever be that way |
20:37:59 | FromDiscord | <Daan Breur> whats so bad about it? |
20:38:17 | FromDiscord | <retkid> making flowvars is annoying as shit |
20:38:39 | FromDiscord | <retkid> theres other reasons |
20:38:42 | FromDiscord | <retkid> (edit) "theres other reasons ... " added "too, i cant think of em" |
20:38:52 | FromDiscord | <retkid> its easier tbh to just use system/threads |
20:39:01 | FromDiscord | <retkid> and much less prone to random segfaults |
20:39:04 | FromDiscord | <Daan Breur> sounds resonable |
20:39:16 | FromDiscord | <Daan Breur> typiung is hard |
20:39:45 | FromDiscord | <Daan Breur> (edit) "resonable" => "reasonable" |
20:40:06 | FromDiscord | <enthus1ast> let wavetable = array[0 .. 2, int8](%5B1'i8,2,3%5D) |
20:40:07 | FromDiscord | <enthus1ast> it should be↵(@Rika) |
20:40:12 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3Sf8 |
20:40:23 | FromDiscord | <enthus1ast> the first elem must be of the type |
20:40:30 | FromDiscord | <retkid> sent a code paste, see https://paste.rs/1KA |
20:40:40 | FromDiscord | <retkid> var wavetable = [1'i8,2,3] |
20:40:45 | FromDiscord | <enthus1ast> idk just saw rikas post |
20:52:51 | FromDiscord | <Rika> I know |
20:52:54 | FromDiscord | <Rika> That’s what I said |
21:19:52 | * | jjido joined #nim |
21:20:28 | FromDiscord | <Elegantbeef> I'm fairly certain that threadpool is still wanted to be supported, it just needs more language features to make it sensible |
21:23:05 | * | daanb quit (Read error: Connection reset by peer) |
21:26:07 | FromDiscord | <Elegantbeef> `isolated` for instance giving move semantics across thread barriers |
21:26:07 | FromDiscord | <Elegantbeef> For instance https://github.com/nim-lang/RFCs/issues/347 |
21:40:58 | * | ltriant joined #nim |
21:42:35 | * | wyrd quit (Ping timeout: 240 seconds) |
21:44:54 | * | jmdaemon joined #nim |
21:49:48 | * | wyrd joined #nim |
22:01:22 | * | kenran quit (Quit: WeeChat info:version) |
22:07:01 | * | jmdaemon quit (Ping timeout: 245 seconds) |
22:20:51 | * | jmdaemon joined #nim |
22:34:31 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:38:19 | * | jjido joined #nim |
22:49:40 | * | rockcavera quit (Ping timeout: 250 seconds) |
23:15:28 | FromDiscord | <retkid> anyone here familiar with nim |
23:15:30 | FromDiscord | <retkid> (edit) "nim" => "c" |
23:15:37 | FromDiscord | <mrgaturus> me |
23:15:59 | FromDiscord | <retkid> as someone who has only used modern languages I dont know how dependencies work |
23:16:06 | FromDiscord | <retkid> in C |
23:16:14 | FromDiscord | <retkid> I've built something from source |
23:16:25 | FromDiscord | <retkid> how do I use it in a separate repository |
23:16:39 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/953069178431107122/unknown.png |
23:16:40 | FromDiscord | <mrgaturus> they work as static linking or dynamic linking |
23:17:16 | FromDiscord | <retkid> dynamic |
23:17:27 | FromDiscord | <retkid> the binaries are, that is |
23:18:36 | FromDiscord | <retkid> I put all the bins in my /usr/bin |
23:18:58 | FromDiscord | <mrgaturus> on c/c++ projects a build system helps to link libraries |
23:19:10 | FromDiscord | <retkid> because when i stack trace things I see that it looks in your PATH for binaries if they are not found in expected places |
23:19:25 | FromDiscord | <retkid> i know this isn't nim i kinda just realized i was in main sorry |
23:20:52 | FromDiscord | <mrgaturus> on nim i use passL o dylib pragma to import c library symbols |
23:20:57 | FromDiscord | <mrgaturus> (edit) "o" => "or" |
23:21:07 | FromDiscord | <mrgaturus> (edit) "dylib" => "dynlib" |
23:21:17 | FromDiscord | <retkid> well this is for C code 😭 |
23:21:18 | FromDiscord | <Elegantbeef> You either use a sub module or just force linking a dynamic module |
23:21:18 | FromDiscord | <Elegantbeef> dynamic library\ |
23:21:21 | FromDiscord | <retkid> how do headers work |
23:21:25 | FromDiscord | <retkid> so like |
23:21:37 | FromDiscord | <retkid> alrighty im looking this up because i dontt wanna flood #main with c |
23:21:45 | FromDiscord | <retkid> sorry <3 |
23:23:09 | FromDiscord | <mrgaturus> a sub module can be done using a build system like meson |
23:24:26 | FromDiscord | <congusbongus> first time I worked with C I wrote all my source code in .h files then included them all in main.c↵I think this is also how people unironically wrote C code in the 80s |
23:28:03 | * | jmdaemon quit (Ping timeout: 256 seconds) |
23:37:32 | * | jmdaemon joined #nim |
23:51:09 | * | rockcavera joined #nim |
23:51:09 | * | rockcavera quit (Changing host) |
23:51:09 | * | rockcavera joined #nim |
23:58:48 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |