<< 14-03-2022 >>

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:26NimEventerNew 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:12FromDiscord<Equinox> hi
01:30:18FromDiscord<Elegantbeef> Hello
01:31:19FromDiscord<Equinox> I just started learning nim yesterday and I really like it so far
01:31:37FromDiscord<Equinox> I am more of a rust programmer
01:31:39FromDiscord<Elegantbeef> Nice, I assume there is a question coming up 😛
01:31:46FromDiscord<Equinox> nope
01:32:04FromDiscord<Elegantbeef> Damn, shame
01:32:42FromDiscord<Elegantbeef> Well anyway welcome, and have fun
01:32:44FromDiscord<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:55FromDiscord<Elegantbeef> It's vastyl more difficult
01:32:59FromDiscord<Elegantbeef> vastly\
01:33:18FromDiscord<Elegantbeef> You need to know how to leave to do it, so it's only an expert move
01:33:27FromDiscord<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:00FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Sap
01:35:01FromDiscord<Elegantbeef> It's very complicated and techincal
01:36:33FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/mwe
01:36:37FromDiscord<Elegantbeef> Cant win them all
01:38:21FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=3Saq
01:38:50FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Sar
01:39:11FromDiscord<Elegantbeef> As it should
01:39:28FromDiscord<Elegantbeef> @Equinox\: so what's your main focus?
01:39:29FromDiscord<Equinox> sent a code paste, see https://paste.rs/sHG
01:39:35FromDiscord<Elegantbeef> It echos then dereferences nil
01:39:38FromDiscord<Elegantbeef> So it errors
01:39:51FromDiscord<Equinox> In reply to @Elegantbeef "<@400159322333642752>\: so what's your": I don't have one
01:39:59FromDiscord<Equinox> I just do whatever sounds cool at the time
01:40:12FromDiscord<Equinox> recently I've been doing some graphics programming in rust and that's been pretty fun
01:40:16FromDiscord<Elegantbeef> `cast[ptr int](0)[]` is the C equivlent of `((int)(0))` or w/e
01:40:50FromDiscord<Elegantbeef> Exelotl will corrrect me on the dereferencing, I dont write C
01:40:55FromDiscord<Elegantbeef> Ah graphics programming is fun
01:41:07FromDiscord<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:18FromDiscord<Equinox> C looks like gibberish to me
01:41:19FromDiscord<Elegantbeef> Indeed
01:41:49FromDiscord<Elegantbeef> In Nim you also know you're doing something "unsafe" since you use `cast` and `ptr` which are not "safe"
01:42:26FromDiscord<Equinox> In reply to @Elegantbeef "In Nim you also": Yeah that's nice
01:42:38FromDiscord<Elegantbeef> Have you made any basic programs in Nim you want to get screamed at about, I love crushing developers dreams
01:43:06FromDiscord<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:11FromDiscord<Equinox> There is no error checking
01:43:15FromDiscord<Equinox> no dialog
01:43:17FromDiscord<Elegantbeef> Let's see it
01:43:39FromDiscord<Equinox> sent a code paste, see https://play.nim-lang.org/#ix=3Sau
01:43:49FromDiscord<Equinox> yes Board has a player and the win status
01:43:54FromDiscord<Elegantbeef> First mistake `method` is for dynamic dispatch
01:44:00FromDiscord<Elegantbeef> `proc` is what you want
01:44:10FromDiscord<Equinox> In reply to @Elegantbeef "`proc` is what you": wait does it work the same?
01:44:15FromDiscord<Elegantbeef> Yes
01:44:18FromDiscord<Equinox> oh
01:44:19FromDiscord<Equinox> that's cool
01:44:26FromDiscord<Elegantbeef> Nim has UFCS so a proc can be called `a.b()` or `b(a)`
01:44:38FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#procedures-method-call-syntax
01:44:42FromDiscord<Equinox> In reply to @Elegantbeef "Nim has UFCS so": yeah that's really cool
01:44:58FromDiscord<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:01FromDiscord<Elegantbeef> You also dont need to annotated `: void` for procs
01:45:28FromDiscord<Equinox> In reply to @Elegantbeef "You also dont need": ok
01:46:09FromDiscord<Elegantbeef> That check win is a funny proc
01:46:19FromDiscord<Equinox> In reply to @Elegantbeef "That check win is": it's beautiful
01:46:37FromDiscord<Equinox> solid block of else if statements
01:47:45FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Saw
01:48:25FromDiscord<Equinox> that does look nicer
01:50:35FromDiscord<Elegantbeef> @Rika\: do you use emacs i dont recall?
01:51:23FromDiscord<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:40FromDiscord<Elegantbeef> Which vscode extension did you use whee?
01:51:57FromDiscord<Equinox> I am just using the main nim extension and it works fine
01:52:11FromDiscord<Elegantbeef> NimSaem's is the best imo
01:52:22FromDiscord<Elegantbeef> It's the original ported to Nim and updated
01:52:36FromDiscord<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:57FromDiscord<Elegantbeef> You do need to set it up properly
01:53:01FromDiscord<Elegantbeef> https://github.com/saem/vscode-nim#code-completion
01:53:28FromDiscord<Elegantbeef> There is also `nim.project` which you can list thee "entry" files
01:53:37FromDiscord<Elegantbeef> This prevents nimsuggest from eating your CPU
01:54:51FromDiscord<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:44FromDiscord<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:11FromDiscord<Elegantbeef> @Equinox\: i couldnt help myself https://play.nim-lang.org/#ix=3Saz
02:01:12FromDiscord<Elegantbeef> Damn it i always include useless imports
02:01:13FromDiscord<Elegantbeef> `sequtils` isnt used
02:01:37FromDiscord<Elegantbeef> Personally i've been using kate + LSP recently and it's nice, though one downside is no error reporting
02:02:12FromDiscord<Elegantbeef> It might be enough, if it doesnt play nicely i generally give it an entry file and it then works
02:02:13FromDiscord<Elegantbeef> It depends on your file structure
02:02:23FromDiscord<Elegantbeef> It's hard to reason automatically what is the entry file at times
02:02:26FromDiscord<Equinox> In reply to @Elegantbeef "<@400159322333642752>\: i couldnt help": nice
02:02:36FromDiscord<Equinox> Thanks for the tips it helps a lot
02:03:08FromDiscord<Equinox> Should probably also add a checker to ensure the move is valid
02:05:36FromDiscord<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:46FromDiscord<Elegantbeef> \I messed up and didnt do `currentPlayer: Ecks..Ooos` To really make it complete 😛
02:06:46FromDiscord<Elegantbeef> Current player can never be `None` so any attempt at assigning it to None should error!
02:06:47FromDiscord<Elegantbeef> @whee\: the project isnt open is it? Can see how it behaveshere
02:08:18FromDiscord<Elegantbeef> Yea that's a simple `x in 0..8 and board[x] == None`
02:08:18FromDiscord<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:27FromDiscord<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:35FromDiscord<Elegantbeef> Nimlsp strictly adheres to the spec so kate might have something simple that needs fixed
02:10:27FromDiscord<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:02NimEventerNew Nimble package! naylib - Yet another raylib Nim wrapper, see https://github.com/planetis-m/naylib
02:46:19FromDiscord<michaelb.eth> sent a long message, see http://ix.io/3SaF
02:46:34FromDiscord<michaelb.eth> (edit) "http://ix.io/3SaF" => "http://ix.io/3SaG"
02:46:45FromDiscord<michaelb.eth> (edit) "http://ix.io/3SaG" => "http://ix.io/3SaH"
02:48:39FromDiscord<Elegantbeef> Are you only using that API and the `cAlloc`/`cFree`?
02:48:52FromDiscord<michaelb.eth> wdym?
02:49:16FromDiscord<Elegantbeef> You're not using anything that else that'd allocate?
02:50:16FromDiscord<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:08FromDiscord<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:13FromDiscord<Elegantbeef> you can always try `-d:usueMalloc`
02:51:20FromDiscord<Elegantbeef> `-d:useMalloc`\
02:51:51FromDiscord<Elegantbeef> That doesnt use Nim's custom allocator so it should return resources instead of hold onto them
02:54:52FromDiscord<michaelb.eth> `-d:useMalloc` doesn't make any difference afaict
02:54:59FromDiscord<michaelb.eth> same steady growth of mem consumption
02:59:54FromDiscord<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:24termerElegantbuuf 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:40termerI tested my server with 1k concurrent connections, and there were 0 issues
03:56:15FromDiscord<Elegantbeef> Nice!
04:23:40retronavhi, 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:53FromDiscord<Elegantbeef> Termer just realized the destruction of my name 😀
04:24:16FromDiscord<Elegantbeef> What's that timestamp look like?
04:24:54retronavEither 2022-03-11T13:15:25.320+00:00 or 2022-03-11T13:15:25+00:00
04:25:14retronavYou may refer to https://datatracker.ietf.org/doc/html/rfc3339#section-5.8 for examples
04:25:47FromDiscord<Elegantbeef> Looks like one would need to use the times.parse for each possible version
04:26:14retronavok
04:26:27retronavso a try except for each pattern?
04:26:35FromDiscord<Elegantbeef> Yea
04:26:46retronavmakes sense
04:29:17retronavElegantbeef I found a package that does what i want (https://nimble.directory/pkg/rfc3339) but looks like nimble says "Package not found"
04:29:42FromDiscord<Elegantbeef> It's still alive
04:30:27FromDiscord<Elegantbeef> Ugh i hate that package already ` ## Sets the month to a given amount, which must be within [1, 12]`
04:31:22retronav😅
04:31:26FromDiscord<Elegantbeef> Apparently `month: 1..12` is too hard
04:32:04FromDiscord<Elegantbeef> And they manually do bitsets
04:33:16*rockcavera quit (Remote host closed the connection)
04:35:04FromDiscord<Elegantbeef> Well i guess if the library works for you disregard my outrage 😛
04:36:10retronavElegantbeef if i manage to install it in the first place; i'm trying to configure nimble
04:36:22FromDiscord<Elegantbeef> `nimble -v`?
04:36:26retronavif you have any other solutions/libs in mind please let me know :)
04:36:35retronavnimble v0.13.1
04:36:46FromDiscord<Elegantbeef> Hmm that's modern
04:36:59FromDiscord<Elegantbeef> I just installed it so you have something wrong
04:37:31FromDiscord<Elegantbeef> I mean the library seems fine, just not very idiomatic and does some weird things
04:37:43retronavadded nimble.directory in the config but its not doing the job; maybe something wrong with my system
04:37:46FromDiscord<Elegantbeef> How are you trying to install it?
04:38:01FromDiscord<Elegantbeef> You dont need to add nimble.directory to the the config
04:38:51FromDiscord<Elegantbeef> `https://github.com/nim-lang/packages/raw/master/packages.json` is all you need
04:39:01retronavi'm trying by imble install rfc333999 it would say "Package not found"
04:39:18FromDiscord<Elegantbeef> your `.config/nimble/nimble.ini` looks like?
04:39:44retronavwait i'll check
04:41:59retronavah i don't have one lol
04:42:13FromDiscord<Elegantbeef> Well there you go
04:42:36FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3SaX here's mine
04:42:52FromDiscord<Elegantbeef> Dont know why it's' so polluted, but yea
04:43:08FromDiscord<Elegantbeef> Anyway i'm going to fork and PR this time library so thanks for that 😛
04:43:31retronav:)
04:45:47FromDiscord<Elegantbeef> Ah nevermind, really feel like the `times` module works just aswell
04:46:15FromDiscord<Elegantbeef> Was going to but realized i was just replicating `times`
04:49:37FromDiscord<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:50retronavi'll probably do that, package seems to have no documentation
04:51:04retronavcan't figure out what to use
04:51:10retronavbut thanks for sticking around :D
04:54:29FromDiscord<Elegantbeef> There is a parse function somewhere in it
04:55:02FromDiscord<Elegantbeef> `toDate`
04:59:11retronavah yes
04:59:13retronavgot that
05:04:33retronavnow converting its return type to `Time`
05:05:33retronavah nvm i don't need to that
05:08:40*slowButPresent quit (Quit: leaving)
05:10:05termer<Elegantbeef> Termer just realized the destruction of my name 😀
05:10:09termerahahaha I mistyped
05:10:26FromDiscord<Elegantbeef> I am buuf now
05:10:35termerI've been trying to fix my bad habits in typing accumulated over years so properly relearning has caused an uptick in typos
05:10:51FromDiscord<Elegantbeef> Oh trying to touch type properly?
05:11:12termerI could always touch type but my right fingers never were proper
05:11:18FromDiscord<Elegantbeef> I only properly type with my left hand, my right hand uses like the first two fingers
05:11:23FromDiscord<Elegantbeef> Aw shit, same!
05:11:30termeryeah I don't get why
05:11:40termerso I've been making a concerted effort to fix it
05:12:32termerNow that I've really gotten deep into Nim I keep wanting to rewrite all my little things in it lol
05:12:53termerparticularly all the things I've got around running on javascript
05:13:08termeranything dynamically typed is really easy to begin with but maintenance down the road becomes difficult
05:13:19termerand I've continuously seen that with JS
05:14:26FromDiscord<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:10FromDiscord<Elegantbeef> Ah, never really been one for dynamic languages
05:15:21FromDiscord<Elegantbeef> Especially now with my love of distinct and subrange types i doubt i ever will be
05:15:40FromDiscord<Generic> dynamic languages are just a hotfix for bad generics
05:16:09FromDiscord<Elegantbeef> I agree with that sentiment
05:17:01termerpretty apt for someone with the name "Generic" to say
05:17:03FromDiscord<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:11FromDiscord<Elegantbeef> I say they're a plant
05:17:14termerNim generics have been like nothing I've ever used before
05:17:17FromDiscord<Elegantbeef> for the generic corp
05:17:28termerthey feel like dynamic but are completely typesafe
05:17:41FromDiscord<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:52FromDiscord<Elegantbeef> Ideally you constrain generics with a concept imo
05:17:54termerI came from Java
05:17:59FromDiscord<Generic> the best thing are C++ies getting used to constexpr and auto etc.
05:18:00termerso similar situation
05:18:17FromDiscord<Generic> I find all those things super convoluted and limited in C++
05:18:32termerI never learned C++ cause everytime I started on it I found out the package system was shit
05:18:48FromDiscord<Generic> but they think they're inventing all that stuff
05:19:03termerC++ just sucks from every side I've looked at it
05:19:09termerC is ok but old
05:19:17termerI don't mind C for some limited scopes
05:19:24FromDiscord<Generic> C++ can be used pretty well as a better C
05:19:36termerwhenever I write C++ I write it like C
05:19:37FromDiscord<Elegantbeef> I'd rather use Odin or Zig over C
05:19:39FromDiscord<Generic> or C with namespaces if you will so
05:19:42termerand use as little C++ as possible
05:19:58FromDiscord<Generic> obviously if I have free choice I don't write C++ either
05:20:04FromDiscord<Generic> but this is not the world we live in
05:20:08termer:)
05:20:17termerI write JavaScript all day
05:20:19termerit sucks
05:20:24FromDiscord<Elegantbeef> It's the one i live in, oh wait i dont write code professionally
05:20:37FromDiscord<Generic> me neither
05:20:51termerI write code professionally and you don't get to choose your tools in the vast majority of cases
05:20:58FromDiscord<Generic> but there are some existing projects I contribute to which are written in C+b
05:21:13termerI did meet one dude who sponsored one of my nim projects though which was awesome
05:21:22FromDiscord<Generic> cool
05:21:27FromDiscord<Generic> what was it?
05:21:38termerI'm writing a realtime video server
05:21:43termera client and server
05:21:59FromDiscord<Generic> how much do you deal with video data yourself?
05:22:26termerWell 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:38termerI'd love to use ffmpeg libraries but the documentation is just horrible so I'm a little limited with that
05:22:45FromDiscord<Generic> ah
05:23:05FromDiscord<Generic> I never worked with video data, but I would like to some day
05:23:13termerVideo is really interesting
05:23:16FromDiscord<Generic> I'm just too stupid for all that signal theory stuff
05:23:30termerI've built several video sites like YT before but most of them just interface with ffmpeg
05:23:54FromDiscord<Elegantbeef> inb4 you didnt use libffmpeg but used the CLI application 😀
05:24:01termerthe worst task is dealing with people who upload RETARDED BROKEN VIDEOS ALL THE TIME
05:24:07termeryeah I did
05:24:13termeryou don't need to interface with the lib most of the time
05:24:31FromDiscord<Elegantbeef> Eh it's cleaner to not have to deal with a shell
05:24:39termerthe CLI is really good but people are stupid and don't specify which version
05:24:45termerso you'll get conflicts from versions
05:24:51termerand nobody seems to build their own ffmpeg
05:25:10termerso between deployments you'll have people using different versions and running into old bugs that were fixed with newer versions
05:25:31termerI recently dealt with this and had to backport fixes specifically for the version they were using
05:25:39FromDiscord<Elegantbeef> lol
05:26:33termersteam has a really successful realtime video streaming system built on FFmpeg
05:26:45termerbut it's all closed source so I can only guess what they're doing
05:26:59FromDiscord<Elegantbeef> I'd like to believe all streaming is based on ffmpepg
05:27:04termermost is
05:27:17termersometimes more rudimentary things are based on gstreamer
05:27:20termerespecially audio
05:28:11termergstreamer is simpler and better documented but not as many features and supported codecs
05:28:20termerffmpeg just supports everything basically if you compile with the right flags
05:57:07NimEventerNew thread by Kaushalmodi: Blog post: Binding Nim to C++ std::list, see https://forum.nim-lang.org/t/9007
06:05:29FromDiscord<Rika> In reply to @Elegantbeef "<@259277943275126785>\: do you use": i do not
06:05:35FromDiscord<Rika> i use neovimm
06:06:05FromDiscord<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:16NimEventerNew Nimble package! niprefs - A dynamic preferences-system with a table-like structure for Nim., see https://github.com/Patitotective/niprefs
06:48:06nrds<Prestige99> @Rika do you have issues with nimsuggest with neovim? If you're using nimlsp like me
06:48:29FromDiscord<Rika> thats the thing, i pretty much dont use it; the plugin restarts it for me if it crashes though
06:48:32FromDiscord<Rika> i dont use nimlsp
06:48:39FromDiscord<Rika> i dont care what i use as long as it works better
06:49:03nrds<Prestige99> Do you have any sort of error reporting while editing?
06:49:17FromDiscord<Rika> no
06:49:18*Jjp137 joined #nim
06:49:18FromDiscord<Rika> i dont use that
06:49:28FromDiscord<Rika> nimsuggest is shoddy wit hthat
06:49:30nrds<Prestige99> interesting
06:49:38nrds<Prestige99> Yeah I get a lot of false errors
06:50:09nrds<Prestige99> Well, since 1.6.0
06:50:17FromDiscord<Rika> nimsuggest is just a mess
06:50:24FromDiscord<Rika> dont use it at all i would really say
06:50:56nrds<Prestige99> What are you using with neovim?
06:50:57FromDiscord<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:00FromDiscord<Rika> just dont bother
06:51:03FromDiscord<Rika> nim.nvim
06:54:08nrds<Prestige99> I hear IC is supposed to greatly help editor support somehow, I pray that's the case
06:54:23nrds<Prestige99> so many people don't adopt nim because of bad editor support
07:00:34FromDiscord<Phil> Didn't stop me, though good intellisense would've been liked
07:00:54FromDiscord<Phil> Having red squiggly lines where the compiler screams at me as a bare fundamental is really nice though
07:01:25FromDiscord<Elegantbeef> Comically I've had more issues with compiler bugs than nimsuggest
07:01:30nrds<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:09FromDiscord<Equinox> Why is everyone here a bot?
07:33:44FromDiscord<Rika> because theyre bridged from another chat service by a bot
07:34:19FromDiscord<Equinox> Oh, I see, which one?
07:34:38FromDiscord<Rika> irc matrix gitter(not sure if this still exists)
07:34:45FromDiscord<Rika> the one from irc says irc
07:34:49FromDiscord<Rika> otherwise its matrix
07:35:55FromDiscord<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:24FromDiscord<elaykph> any tips on making smaller binaries :>
08:54:51FromDiscord<Elegantbeef> Didnt i already give all the flags?
08:55:06FromDiscord<elaykph> ooh, like the `-d` flags?
08:55:23FromDiscord<Elegantbeef> `-d:lto -d:danger --gc:arc --opt:size --passC:"-march=native"`
08:55:24FromDiscord<Rika> yeah "release" "lto" etc
08:55:28FromDiscord<Rika> opt size
08:55:29FromDiscord<elaykph> nice
08:55:30FromDiscord<Rika> arc yeah
08:55:32FromDiscord<elaykph> thx :)
08:55:32FromDiscord<Elegantbeef> those in theory should make the smallest possible binary
08:55:38FromDiscord<Rika> -d:strip
08:56:09FromDiscord<Elegantbeef> Was it you or someone else that was asking this earlier?
08:56:17FromDiscord<elaykph> In reply to @Elegantbeef "Was it you or": im sure that wasnt me
08:56:30FromDiscord<elaykph> smol world lmao
08:57:07FromDiscord<enthus1ast> nim binaries are quite small already, why you need smaller ones?
08:58:12FromDiscord<enthus1ast> another option is to pack them via upx
08:58:12FromDiscord<enthus1ast> to also pack them via upx
08:58:40FromDiscord<Elegantbeef> I feel like UPX is how you get even more malware detection
08:58:47FromDiscord<enthus1ast> sure \:)
08:58:57FromDiscord<Rika> upx is not reliable
08:59:16FromDiscord<Rika> In reply to @Elegantbeef "I feel like UPX": no, there is something to mitigate that
08:59:36FromDiscord<Rika> https://en.wikipedia.org/wiki/Software_taggant
08:59:39FromDiscord<elaykph> In reply to @enthus1ast "nim binaries are quite": smoller sounds better
08:59:45FromDiscord<Rika> not that upx uses it, im not sure
08:59:47FromDiscord<elaykph> so i can dm my discord frens without reaching 8mb
08:59:51FromDiscord<Rika> In reply to @elaykph "smoller sounds better": smaller can imply slower
08:59:59FromDiscord<elaykph> In reply to @Rika "smaller can imply slower": sadge
09:00:01FromDiscord<enthus1ast> you have an 8mb binary??
09:00:03FromDiscord<Elegantbeef> If your binary is 8MB you have a fucking problem
09:00:09FromDiscord<elaykph> In reply to @Elegantbeef "If your binary is": lmao
09:00:17FromDiscord<Rika> the hell did you put in your binary
09:00:18FromDiscord<elaykph> time to learn how to not write shitcode
09:00:20FromDiscord<Rika> image data?
09:00:27FromDiscord<elaykph> In reply to @Rika "image data?": 3d models :>
09:00:32FromDiscord<Elegantbeef> I have an entire game assets and sdl2 and it's not 8MB
09:00:48FromDiscord<elaykph> In reply to @elaykph "3d models :>": but like in json
09:00:53FromDiscord<enthus1ast> compress these models before you store them into the executable↵(@elaykph)
09:00:55FromDiscord<Elegantbeef> Well there's your problem, quit shipping shitty formats
09:01:03FromDiscord<Elegantbeef> use gltf2 like a normal person
09:01:14FromDiscord<elaykph> true true true
09:01:16FromDiscord<Elegantbeef> glb is a binary compact format
09:01:26FromDiscord<elaykph> In reply to @enthus1ast "compress these models before": 👌
09:01:46FromDiscord<elaykph> In reply to @Elegantbeef "glb is a binary": oh nice, i'll keep that in my notebook
09:01:54FromDiscord<enthus1ast> or put your binary into a zip folder \:)
09:02:12FromDiscord<elaykph> In reply to @enthus1ast "or put your binary": ✍️
09:02:53FromDiscord<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:08FromDiscord<Elegantbeef> Code is generally small so it's never going to be the reason you're binaries are large
09:03:16FromDiscord<Rika> your
09:03:23FromDiscord<Elegantbeef> Yes
09:04:51FromDiscord<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:35FromDiscord<Elegantbeef> Alternatively move your friends to matrix as elements' free server file limit is 100mb
09:05:36FromDiscord<enthus1ast> sent a long message, see http://ix.io/3Sbp
09:05:45FromDiscord<elaykph> woah
09:05:53FromDiscord<elaykph> sounds great
09:05:55FromDiscord<elaykph> thanks guys
09:06:54FromDiscord<Elegantbeef> Enthus any idea if there is a private message size limit, seems like probably a homeserver setting?
09:07:16FromDiscord<enthus1ast> mh, must check my homeserver config
09:07:20FromDiscord<Elegantbeef> I've not used private messages in element really so no clue if there even is one
09:08:21FromDiscord<enthus1ast> well there is\:↵#max\_upload\_size\: 50M
09:08:43FromDiscord<Elegantbeef> Ah so probably the same for the default matrix homeserver then
09:09:01FromDiscord<Elegantbeef> 100mb file for DM or free public server i guess
09:09:03FromDiscord<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:42FromDiscord<DevNugget> sent a code paste, see https://paste.rs/USy
12:42:09FromDiscord<Rika> `words[2..^1]`
12:42:38FromDiscord<Rika> it is required to specify the second index, but there is a shortcut for the last (or nth from last) index
12:42:44FromDiscord<Rika> ^1 is last, 2 is 2nd from last, etc
12:51:32FromDiscord<DevNugget> Ah I see thank you very much!
12:53:32FromDiscord<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:49FromDiscord<Phil> Question regarding unittesting and testament
13:15:45FromDiscord<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:20FromDiscord<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:23FromDiscord<enthus1ast> you can combine it
13:17:04FromDiscord<enthus1ast> https://github.com/enthus1ast/nimja/blob/master/tests/basic/test_if.nim
13:17:13FromDiscord<enthus1ast> i do it quite often in nimja
13:17:22FromDiscord<Phil> It's just that apparently testament creates "outputExpected" and "outputGotten"
13:17:38FromDiscord<enthus1ast> testament is the only way afaik to test macro errors
13:18:27FromDiscord<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:28FromDiscord<enthus1ast> " joinable\: false"↵let testament do not combine the test in the megatest.nim
13:19:28FromDiscord<Phil> Ohhh so the discard """ """ stuff contains testament instructions
13:19:36FromDiscord<enthus1ast> yes
13:22:16FromDiscord<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:22FromDiscord<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:57FromDiscord<Phil> So I specify the printed output of the tests in the "output" section in the discarded string
13:26:06FromDiscord<Phil> (edit) "So I specify the ... printed" added "expected"
13:26:49FromDiscord<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:02FromDiscord<Phil> Wait, you do that there
13:27:15FromDiscord<Phil> Gnaaaaa maybe I shouldn't be coding atm to distract myself when I can barely thing
13:27:16FromDiscord<Phil> (edit) "thing" => "think"
13:31:35FromDiscord<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:46FromDiscord<Phil> It's a bit odd to have to copy paste the terminal output into that discard-string
13:32:20FromDiscord<Phil> But I'll take it over just using "block" for tests. Suite + Test imo are a best practice to use
13:32:26FromDiscord<enthus1ast> you do not need to do this, a testament test is mark as failed when the return code is != 0
13:32:51FromDiscord<enthus1ast> i only must do it because i want to test for a macro error
13:32:55FromDiscord<Phil> If I don't then prologue running tests screams at me
13:34:53FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Scu
13:35:13FromDiscord<Phil> If I use this, it doesn't explode in my face:
13:35:26FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Scv
13:36:38FromDiscord<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:26NimEventerNew 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:07FromDiscord<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:52FromDiscord<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:37NimEventerNew 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:57FromDiscord<System64 ~ Flandre Scarlet> Why do I have this error? https://media.discordapp.net/attachments/371759389889003532/952961794840862740/unknown.png
16:19:12FromDiscord<Rika> `ptr` is a generic. if you want a void pointer you write `pointer`
16:19:16FromDiscord<Rika> (edit)
16:19:35FromDiscord<System64 ~ Flandre Scarlet> ah alright
16:45:46FromDiscord<tandy> is it possible to iterate over an OrderedTable for an index range like with a seq?
16:45:58FromDiscord<tandy> say i only want the first 5 values
16:54:08*jjido joined #nim
17:03:01nrds<Prestige99> I don't think so, but you could just do it manually by iterating and breaking after 5 elements
17:03:38nrds<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:11FromDiscord<ynfle> You can do table.pairs.toseq.pairs
17:09:36FromDiscord<untoreh> sent a code paste, see https://play.nim-lang.org/#ix=3SdU
17:21:59FromDiscord<retkid> is there like a pipreqs for nim
17:22:15FromDiscord<retkid> i can just go "magic ." and it spits out a dependency file
17:22:19FromDiscord<Rika> what is that
17:22:20FromDiscord<Rika> no
17:22:28FromDiscord<retkid> sad
17:22:39FromDiscord<Rika> packages can be named differently from the module names
17:22:50FromDiscord<retkid> i guess I'll have to put in the hours of time to write out the 4 packages
17:22:54FromDiscord<retkid> my handsss
17:23:04FromDiscord<retkid> 😭
17:23:20FromDiscord<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:35FromDiscord<spoon> sent a code paste, see https://paste.rs/onO
18:05:00FromDiscord<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:45FromDiscord<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:19FromDiscord<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:37FromDiscord<spoon> lines 2-12 also have a return statement in a different spot, the function calls itself
18:19:29FromDiscord<spoon> like if i called `recite(2,3)`, it will still reach a return statement on line 8 and continue just fine
18:22:24FromDiscord<spoon> ohhh
18:22:29FromDiscord<spoon> nvm, i see now
18:22:47FromDiscord<Rika> lol
18:22:54FromDiscord<spoon> got it ty
18:23:17Amun-Rathat indentation tho…
18:24:20FromDiscord<spoon> it's not that weird, is it?
18:25:25FromDiscord<spoon> it's always the stupid mistakes that get me lol
18:28:56FromDiscord<Rika> its not
18:29:00FromDiscord<Rika> indentation is completely fine
18:29:07FromDiscord<Rika> but your whitespace usage is kinda
18:29:40FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3Sem
18:30:24FromDiscord<spoon> it won't exit after the first result?
18:30:33FromDiscord<Rika> where
18:30:37FromDiscord<spoon> result is like a substitute for return, right?
18:31:10FromDiscord<Rika> yes but they are not the same
18:31:13FromDiscord<Rika> result is a variable
18:31:20FromDiscord<Rika> and when your function ends its whats returned
18:31:41FromDiscord<spoon> huh.
18:32:55FromDiscord<spoon> it does work, weird
18:34:20FromDiscord<spoon> i don't think i've seen an equivalent to that in any other language...?
18:34:43FromDiscord<Rika> thats because from what i know its very rare 😉
18:34:58FromDiscord<Rika> its prolly unique to nim
18:35:08FromDiscord<qb> and great ❤️
18:35:32FromDiscord<Rika> there are some issues though like returning a half-finished object
18:35:37FromDiscord<Rika> if you forget, for example
18:35:52FromDiscord<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:44FromDiscord<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:02FromDiscord<Rika> well now you know
18:39:01NimEventerNew thread by Shirleyquirk: Wrapping C++ iterators: {.nodecl.} for non-constructible iterators?, see https://forum.nim-lang.org/t/9011
18:41:49FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Ses
18:42:03FromDiscord<System64 ~ Flandre Scarlet> (edit) "https://play.nim-lang.org/#ix=3Ses" => "https://play.nim-lang.org/#ix=3Set"
18:43:48FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Seu
18:46:03FromDiscord<kiell> https://www.reddit.com/r/fsharp/comments/jo42yt/why_i_dont_choose_f/gbtoj09/
18:46:22FromDiscord<kiell> "nim docs look like they were written over the weekend in between partying." whyd they have to do nim like that 💀
18:56:50FromDiscord<Rika> `{}` is set
18:56:56FromDiscord<Rika> `[]` is array]
19:00:24FromDiscord<soda> When passing a string along, is it more efficient to do it by ref?
19:02:00FromDiscord<huantian> Nim will automatically pass by ref if the object is big enough
19:02:09FromDiscord<soda> cool
19:09:53FromDiscord<soda> is there a generic filesystem entry iterator?
19:10:09FromDiscord<soda> Basically a way to check if an entry exists whether or not it's a file or dir, etc.
19:10:33FromDiscord<soda> equivalent of std::filesystem::exists(path)
19:14:30FromDiscord<qb> https://nim-lang.org/docs/os.html#dirExists%2Cstring ?
19:15:44FromDiscord<soda> A more generic version of this that covers inode
19:15:56FromDiscord<soda> instead of caring whether it's a file or dir, etc.
19:18:00FromDiscord<soda> sent a code paste, see https://play.nim-lang.org/#ix=3SeI
19:19:47*daanb joined #nim
19:19:51daanbhello
19:22:04*daanb quit (Client Quit)
19:23:35FromDiscord<soda> nvm im dumb
19:23:40FromDiscord<soda> or blind
19:23:49FromDiscord<Daan Breur> I have a question about Threading in nim can anybody help?
19:24:26FromDiscord<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:10FromDiscord<Elegantbeef> `var threads = newSeq[Thread[ThreadArgType]](threadCount)`
19:25:24FromDiscord<Elegantbeef> `for thread in threads.mitems: createThread(thread, threadArg)`
19:27:35FromDiscord<Daan Breur> will try thanks
19:27:38FromDiscord<d4rckh> hank you
19:27:41FromDiscord<d4rckh> (edit) "hank you" => "thank you!"
19:27:51FromDiscord<Daan Breur> why is my boss here
19:27:52FromDiscord<Daan Breur> @d4rckh
19:27:55FromDiscord<Daan Breur> :kappa:
19:28:02FromDiscord<d4rckh> lol
19:28:15FromDiscord<d4rckh> get back to work!!
19:28:34FromDiscord<Daan Breur> im asking questions for you otherwise work aint getting done
19:29:08FromDiscord<d4rckh> i asked same question yesterday but no success 😦
19:29:53*daanb joined #nim
19:30:30daanbImma test it now, stay strong
19:32:54FromDiscord<Daan Breur> sent a code paste, see https://paste.rs/wgO
19:33:01daanbdoesnt work
19:34:34FromDiscord<System64 ~ Flandre Scarlet> In reply to @Rika "`{}` is set": Ah alright
19:37:57daanbElegantbeef, Thank you I got it working in the end!
19:39:00FromDiscord<System64 ~ Flandre Scarlet> And that? https://media.discordapp.net/attachments/371759389889003532/953014405698834482/unknown.png
19:39:59FromDiscord<Rika> should wor
19:40:00FromDiscord<Rika> k
19:40:36FromDiscord<auxym> i think you have to use `for i in wavetable.mitems`
19:40:57*[R] quit (Ping timeout: 240 seconds)
19:41:09FromDiscord<System64 ~ Flandre Scarlet> In reply to @auxym "i think you have": Doesn't work too
19:41:16FromDiscord<auxym> the default `items` iterator is not `var`, therefore immutable, even if the thing is var
19:41:35FromDiscord<System64 ~ Flandre Scarlet> aaah alright
19:42:21*[R] joined #nim
19:43:38FromDiscord<auxym> works in playground, with `mitems`, what error do you get?
20:07:31FromDiscord<System64 ~ Flandre Scarlet> It works with mitems
20:11:49FromDiscord<retkid> In reply to @System64 "is it normal when": spot the java programmer
20:16:17FromDiscord<System64 ~ Flandre Scarlet> In reply to @retkid "spot the java programmer": Yeah I admit
20:16:27FromDiscord<System64 ~ Flandre Scarlet> I did some Java (and I'm not a fan of java)
20:16:41FromDiscord<Phil> Hm? I actually do develop java and I don't see the point here
20:16:50*kenran joined #nim
20:17:12FromDiscord<Phil> Did you expect just being given a memory address?
20:17:18*kenran quit (Client Quit)
20:17:40FromDiscord<Phil> (edit) "Did you expect ... justbe" added "to" | "being" => "be"
20:18:10FromDiscord<System64 ~ Flandre Scarlet> no, the value of the index
20:18:24FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/Ts2
20:18:27*kenran joined #nim
20:18:52FromDiscord<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:57FromDiscord<Phil> Otherwise it just uses the default int type
20:19:07FromDiscord<retkid> the default type is 32
20:19:08FromDiscord<retkid> iirc
20:19:13FromDiscord<retkid> (right)
20:19:18FromDiscord<retkid> (edit) "(right)" => "(right?)"
20:19:20FromDiscord<Phil> Generally nim tries to hide away specific bit sizes behind a general int type
20:19:29FromDiscord<System64 ~ Flandre Scarlet> can I do ``.int8`` ?
20:19:47FromDiscord<retkid> wavetable.apply(x=>int8(x))
20:19:53FromDiscord<Phil> I'd just do `var wavetable: seq[int8] = "lala"`
20:20:16FromDiscord<retkid> mine is cooler
20:20:26FromDiscord<retkid> In reply to @retkid "wavetable.apply(x=>int8(x))": from sequtils
20:20:54FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/953024948526522438/unknown.png
20:20:59FromDiscord<Phil> Ehhhhhh I need to think more when you start applying because I need to comprehend why you're doing the conversion
20:21:19FromDiscord<Phil> I don't like having to think more than the absolute minimum required to comprehend the idea behind the code
20:21:35FromDiscord<retkid> it makes sense to me when i see it
20:21:36FromDiscord<Phil> I prescribe to the anti-thought school of programming. The dumber your code the better
20:22:01FromDiscord<retkid> but i com https://media.discordapp.net/attachments/371759389889003532/953025227858788423/unknown.png
20:22:04FromDiscord<retkid> is this hard for you
20:22:09FromDiscord<retkid> >:)
20:22:12FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "I prescribe to the": this is a wavetable, a short sample if you want
20:22:17FromDiscord<Rika> In reply to @Isofruit "I'd just do `var": i dont remember this working
20:22:21FromDiscord<Rika> !eval var wavetable: seq[int8] = "lala"
20:22:21FromDiscord<retkid> ^
20:22:23NimBotCompile failed: /usercode/in.nim(1, 28) Error: type mismatch: got 'string' for '"lala"' but expected 'seq[int8]'
20:22:37FromDiscord<Rika> this works
20:22:48FromDiscord<Phil> wait, right, that's a string, ugh my brain
20:22:50FromDiscord<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:52NimBotarray[0..31, int8]
20:23:10FromDiscord<Phil> In reply to @System64 "this is a wavetable,": fixed array or seq?
20:23:11FromDiscord<retkid> var wavetable: array[0 .. 2, int8] = [1,2,3]
20:23:17FromDiscord<retkid> fg;kmgh
20:23:19FromDiscord<Rika> In reply to @retkid "var wavetable: array[0 ..": will not work
20:23:20FromDiscord<retkid> not var
20:23:25FromDiscord<Rika> not that either
20:23:33FromDiscord<Rika> !eval let wavetable: array[0 .. 2, int8] = [1,2,3]
20:23:33FromDiscord<retkid> whats wrong with it?
20:23:35NimBotCompile 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:43FromDiscord<retkid> you gotta do the =
20:23:44FromDiscord<retkid> not the :
20:23:46FromDiscord<Rika> no
20:23:59FromDiscord<Rika> `[1,2,3]` should have the type in it somewhere in the first element
20:23:59FromDiscord<retkid> !eval let wavetable = array[0 .. 2, int8] [1,2,3]
20:24:01NimBotCompile 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:07FromDiscord<retkid> sad
20:24:10FromDiscord<Rika> that could work
20:24:16FromDiscord<Rika> !eval let wavetable = array[0 .. 2, int8]([1,2,3])
20:24:18NimBotCompile 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:26FromDiscord<retkid> 😭
20:24:28FromDiscord<Rika> i guess they cant be converted
20:24:32FromDiscord<Rika> use the one i wrote
20:24:48FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "fixed array or seq?": fixed
20:25:00FromDiscord<retkid> yea for a fixed length array use rikas
20:25:04FromDiscord<Phil> array it is then, makes more sense than seq
20:25:24FromDiscord<Phil> seq is specifically for variable length, think Array vs List interface
20:25:26FromDiscord<retkid> Rika always got the good solutions :)
20:25:50FromDiscord<retkid> can i make a set of non integers
20:25:52FromDiscord<System64 ~ Flandre Scarlet> it works
20:25:55FromDiscord<retkid> i would like an arbitrary type set
20:26:10FromDiscord<Phil> HashSets exist
20:26:45FromDiscord<Rika> hashset
20:26:46FromDiscord<Rika> yeah
20:26:59FromDiscord<Rika> requirement is that your type should be hashable ofc
20:28:05FromDiscord<retkid> now, what does hashable mean in this contxt
20:28:11FromDiscord<retkid> context
20:28:13FromDiscord<Rika> has a hash proc
20:28:23FromDiscord<retkid> so no complex types?
20:28:33FromDiscord<Rika> complex types work if you implement a hash proc
20:28:43FromDiscord<Rika> `hash(obj: T): Hash`
20:28:46FromDiscord<retkid> how annoying is that?
20:28:51FromDiscord<Rika> https://nim-lang.org/docs/hashes.html
20:29:07FromDiscord<Rika> you can make a macro for it if you just want to hash all fields and combine that
20:29:09FromDiscord<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:11FromDiscord<Rika> so not very i'd say
20:30:38FromDiscord<retkid> this seems pretty inefficient for skipping 1 line of code
20:30:39FromDiscord<Phil> https://nim-lang.org/docs/sets.html↵For docs on HashSets in general
20:30:48FromDiscord<retkid> I suppose it'll be faster for large datasets though
20:32:00FromDiscord<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:23FromDiscord<Phil> It's always sensible to turn the data you have into the data-types in which you think about your data
20:33:12FromDiscord<Daan Breur> Stupid question but are the `system/threads` actually parallel ?
20:33:21FromDiscord<Rika> yes?
20:33:22FromDiscord<retkid> yes :3
20:33:36FromDiscord<Daan Breur> @d4rckh you are stupid \<3
20:33:40FromDiscord<Rika> lol
20:34:03FromDiscord<retkid> im trying to think of a situation where it isn't true
20:34:11FromDiscord<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:54FromDiscord<d4rckh> In reply to @Daan Breur "<@!648552095531663361> you are stupid": From the logs they didn't seem much parallel lol
20:35:00FromDiscord<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:09FromDiscord<Rika> your task is probably too quick to "look parallel"
20:35:09FromDiscord<Daan Breur> sent a code paste, see https://paste.rs/euF
20:35:32FromDiscord<retkid> if exiting the thread is longer than each threads execution it wont look parallel
20:35:44FromDiscord<Rika> exiting/creating/etc
20:35:54FromDiscord<Rika> creating threads is slow fyi
20:35:58FromDiscord<retkid> it is
20:36:12FromDiscord<retkid> i will spawn 500 thread then just stare
20:36:16FromDiscord<retkid> then my cpu goes to 100
20:36:17FromDiscord<Phil> IIRC wasn't that why you typically also have thread-pools?
20:36:24FromDiscord<retkid> well
20:36:29FromDiscord<retkid> threadpools are cool howeveer
20:36:30FromDiscord<retkid> (edit) "howeveer" => "however"
20:36:34FromDiscord<retkid> nobody wants to maintain it
20:36:36FromDiscord<retkid> so its kinda bad
20:36:58FromDiscord<Daan Breur> its even a warning on the docs page.↵WARNING: UNSTABLE API
20:37:07FromDiscord<retkid> and it will forever be that way
20:37:59FromDiscord<Daan Breur> whats so bad about it?
20:38:17FromDiscord<retkid> making flowvars is annoying as shit
20:38:39FromDiscord<retkid> theres other reasons
20:38:42FromDiscord<retkid> (edit) "theres other reasons ... " added "too, i cant think of em"
20:38:52FromDiscord<retkid> its easier tbh to just use system/threads
20:39:01FromDiscord<retkid> and much less prone to random segfaults
20:39:04FromDiscord<Daan Breur> sounds resonable
20:39:16FromDiscord<Daan Breur> typiung is hard
20:39:45FromDiscord<Daan Breur> (edit) "resonable" => "reasonable"
20:40:06FromDiscord<enthus1ast> let wavetable = array[0 .. 2, int8](%5B1'i8,2,3%5D)
20:40:07FromDiscord<enthus1ast> it should be↵(@Rika)
20:40:12FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3Sf8
20:40:23FromDiscord<enthus1ast> the first elem must be of the type
20:40:30FromDiscord<retkid> sent a code paste, see https://paste.rs/1KA
20:40:40FromDiscord<retkid> var wavetable = [1'i8,2,3]
20:40:45FromDiscord<enthus1ast> idk just saw rikas post
20:52:51FromDiscord<Rika> I know
20:52:54FromDiscord<Rika> That’s what I said
21:19:52*jjido joined #nim
21:20:28FromDiscord<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:07FromDiscord<Elegantbeef> `isolated` for instance giving move semantics across thread barriers
21:26:07FromDiscord<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:28FromDiscord<retkid> anyone here familiar with nim
23:15:30FromDiscord<retkid> (edit) "nim" => "c"
23:15:37FromDiscord<mrgaturus> me
23:15:59FromDiscord<retkid> as someone who has only used modern languages I dont know how dependencies work
23:16:06FromDiscord<retkid> in C
23:16:14FromDiscord<retkid> I've built something from source
23:16:25FromDiscord<retkid> how do I use it in a separate repository
23:16:39FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/953069178431107122/unknown.png
23:16:40FromDiscord<mrgaturus> they work as static linking or dynamic linking
23:17:16FromDiscord<retkid> dynamic
23:17:27FromDiscord<retkid> the binaries are, that is
23:18:36FromDiscord<retkid> I put all the bins in my /usr/bin
23:18:58FromDiscord<mrgaturus> on c/c++ projects a build system helps to link libraries
23:19:10FromDiscord<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:25FromDiscord<retkid> i know this isn't nim i kinda just realized i was in main sorry
23:20:52FromDiscord<mrgaturus> on nim i use passL o dylib pragma to import c library symbols
23:20:57FromDiscord<mrgaturus> (edit) "o" => "or"
23:21:07FromDiscord<mrgaturus> (edit) "dylib" => "dynlib"
23:21:17FromDiscord<retkid> well this is for C code 😭
23:21:18FromDiscord<Elegantbeef> You either use a sub module or just force linking a dynamic module
23:21:18FromDiscord<Elegantbeef> dynamic library\
23:21:21FromDiscord<retkid> how do headers work
23:21:25FromDiscord<retkid> so like
23:21:37FromDiscord<retkid> alrighty im looking this up because i dontt wanna flood #main with c
23:21:45FromDiscord<retkid> sorry <3
23:23:09FromDiscord<mrgaturus> a sub module can be done using a build system like meson
23:24:26FromDiscord<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…)