<< 13-11-2022 >>

00:03:18FromDiscord<Bung> "the generic signed integer type; its size is platform-dependent and has the same size as a pointer. This type should be used in general. An integer literal that has no type suffix is of this type if it is in the range low(int32)..high(int32) otherwise the literal's type is int64."
00:04:06FromDiscord<Bung> I guess this need to be fixed as well
00:56:39FromDiscord<hmmm> yo broskis! long time no see! check this : https://play.nim-lang.org/#ix=4fLg
00:56:51*arkurious quit (Quit: Leaving)
00:57:10FromDiscord<hmmm> now explain to me why it doesn't work like I expect to, very slowly and with pictures ๐Ÿ˜ƒ
00:59:10FromDiscord<tangonov> Ugh this language sucks, I don't want to write with anything else.
01:05:36FromDiscord<Elegantbeef> Lol what a problem to have
01:06:25FromDiscord<Rika> In reply to @hmmm "yo broskis! long time": it parses correctly (because the bounds checking is not part of the parsing)
01:06:29FromDiscord<Elegantbeef> The issue hmmm is that the `parse` proc doesnt sanitise the values before converting to the range so you get a range defect
01:06:42FromDiscord<Rika> "correctly"
01:07:03FromDiscord<Rika> https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/times.nim#L1349โ†ตthis is where you get the bounds error
01:07:12FromDiscord<Rika> sorry, the line below that
01:07:30FromDiscord<Elegantbeef> This is an issue with Nim range types nothing tells you to properly handle them
01:07:33FromDiscord<Rika> tries to write 61 to a 0..59 type
01:07:48FromDiscord<Elegantbeef> `range = int` should raise a warning
01:09:18FromDiscord<hmmm> rika and beefy my faves broskies! can chuck in some kind of except RangeDefectError or smth?
01:09:24FromDiscord<Elegantbeef> Nope
01:09:36FromDiscord<Elegantbeef> I mean you can but defects are not meant to be caught
01:10:08FromDiscord<Rika> how delightful innit
01:10:09FromDiscord<Elegantbeef> Given your simple scheme i'd use simple parsing to handle this
01:11:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fLi
01:11:52FromDiscord<Elegantbeef> Atleast for this simple case
01:12:10FromDiscord<Elegantbeef> I love scantuple for this shit
01:12:17FromDiscord<Elegantbeef> 10/10 idea from me ๐Ÿ˜›
01:13:17FromDiscord<hmmm> 7/10 because you used scantuple I had no idea existed before 10 seconds ago. I bet there is an easier version with tools I've seen in my life before and you are just scamming me like usual beefy ๐Ÿ˜ƒ
01:13:46FromDiscord<Elegantbeef> As much as i like range types i'm starting to think `type Range[T: static Slice[auto]] = distinct typeof(T.a)`
01:13:51FromDiscord<Elegantbeef> Is jusut better
01:13:55FromDiscord<Elegantbeef> just even ๐Ÿ˜„
02:03:00FromDiscord<.tochka> is there some thing to convert signed integer type to its unsigned counterpart
02:03:17FromDiscord<Elegantbeef> Bitwise or value?
02:03:34FromDiscord<.tochka> type itself
02:03:47FromDiscord<.tochka> want to cast based on size, generically
02:03:51FromDiscord<Elegantbeef> `cast[uint](myInt)` to do bitwise conversion `uint(myInt)` for value
02:03:51FromDiscord<amadan> https://nim-lang.github.io/Nim/typetraits.html#toUnsigned.t%2Ctypedesc%5B%5Dโ†ตMaybe this?
02:04:08FromDiscord<Elegantbeef> Yea that'd do it
02:04:15FromDiscord<Elegantbeef> Also spot the #devel user ๐Ÿ˜›
02:04:26FromDiscord<.tochka> In reply to @amadan "https://nim-lang.github.io/Nim/typetraits.html#toUn": thank you
02:04:53FromDiscord<amadan> In reply to @Elegantbeef "Also spot the #devel": lol, I like life on the edge ๐Ÿ˜Ž
02:29:43FromDiscord<scarf> weird, it gets installed normally in choosenim `stable` but crashes on locally built `devel` https://media.discordapp.net/attachments/371759389889003532/1041178013129252914/err.log
02:31:57FromDiscord<Rika> stable and devel are very different....
02:32:28FromDiscord<Elegantbeef> Ugh that might be on me ๐Ÿ˜„
02:33:41FromDiscord<Elegantbeef> Ansiwave cannot install on devel due to Error\: 'recvAction' is not GC-safe as it calls 'search'
02:34:15FromDiscord<Elegantbeef> No clue how you get that mSlice error, but if you can compile it with Nim and show the code it errors on that'd be great
02:37:13FromDiscord<scarf> In reply to @Elegantbeef "No clue how you": alright, you mean cloning nimwave and compiling it locally, right?
02:41:40FromDiscord<Elegantbeef> I just install `nimwave` through nimble
02:41:45FromDiscord<Elegantbeef> I thought that was ansiwave i cannot read
02:41:49FromDiscord<Elegantbeef> Update your devel
02:41:53FromDiscord<Elegantbeef> `choosenim update devel`
02:47:39FromDiscord<scarf> is it different from `choosenim ~/repo/nim`?
02:48:09*wallabra joined #nim
02:50:10FromDiscord<Elegantbeef> It
02:50:12FromDiscord<Elegantbeef> 's a nighly build
02:50:23FromDiscord<Elegantbeef> It worked here with `8e1181bde593ba3ab4409f1454a7b7280b659cd0`
03:04:27*wallabra_ joined #nim
03:05:47*wallabra quit (Ping timeout: 256 seconds)
03:05:50*wallabra_ is now known as wallabra
03:47:24*jjido joined #nim
03:51:53*jjido quit (Client Quit)
04:00:11FromDiscord<!&luke> In reply to @amadan "lol, I like life": Same
04:29:24FromDiscord<scarf> In reply to @Elegantbeef "It worked here with": heck, weird but recompiling from latest commit worked
04:29:26NimEventerNew post on r/nim by bouffy_hairdo: Idiomatic, standard Nim codebase for beginner to look at, see https://reddit.com/r/nim/comments/ytrqq3/idiomatic_standard_nim_codebase_for_beginner_to/
04:40:38FromDiscord<Elegantbeef> Might've been on a weird commit inbetween my PRs?
04:41:12FromDiscord<scarf> In reply to @Elegantbeef "Might've been on a": not sure, on commit `1410243d3bd5a5898bea2130e2f3534bd23f5c04` which is latest
04:41:43FromDiscord<Rika> bisect time?
04:42:30FromDiscord<Elegantbeef> They said it worked on latest
04:42:33FromDiscord<Elegantbeef> So is it really an issue?
04:42:41FromDiscord<scarf> i guess not?
04:42:55FromDiscord<scarf> (edit) "not?" => "not?โ†ตit works on upstream/devel HEAD and I'"
04:43:06FromDiscord<scarf> (edit) "upstream/devel" => "`upstream/devel`" | "I'" => "I'm happy with it"
04:44:40FromDiscord<scarf> now back to finally implementing <https://www.youtube.com/watch?v=55iwMYv8tGI> on nim...
04:45:18*rockcavera quit (Remote host closed the connection)
04:46:31FromDiscord<ringabout> Make sure you clean up the nimcache of the compiler and pre-built binary, which can have surprising side effects,
04:46:43FromDiscord<scarf> oh, that might be the case, thank you.
05:07:59*wallabra quit (Ping timeout: 260 seconds)
05:12:28FromDiscord<Mr.Ender> what hashing algorithm does std/hashes use
05:13:59FromDiscord<ringabout> In reply to @Mr.Ender "what hashing algorithm does": https://github.com/wangyi-fudan/wyhash
05:14:19*jjido joined #nim
05:17:59FromDiscord<ringabout> Though, the Nim port can be updated to v4.
05:18:09FromDiscord<Mr.Ender> ok
05:18:10*wallabra joined #nim
05:18:13FromDiscord<Mr.Ender> thanks
05:19:14*jjido quit (Quit: My laptop has gone to sleep. ZZZzzzโ€ฆ)
05:19:29FromDiscord<ChocolettePalette> You're welcome
05:51:56FromDiscord<.tochka> std memory allocation functions are supposed to raise defects on error right? so there's no way to catch allocation errors or im missing something
05:52:43FromDiscord<Rika> should be so
06:07:36FromDiscord<scarf> sent a code paste, see https://play.nim-lang.org/#ix=4fM5
06:11:47FromDiscord<.tochka> unpack package might work
06:12:24FromDiscord<.tochka> gotta do some macro magic otherwise
06:13:31FromDiscord<Elegantbeef> What's `data`?
06:14:22FromDiscord<.tochka> string, i imagine
06:20:48FromDiscord<Elegantbeef> Meh doesnt matter there isnt much of a better way
06:24:41FromDiscord<Elegantbeef> There is a tinge better way for if you dont mind not supporting JS
06:28:16FromDiscord<Elegantbeef> Actually never mind
06:29:13FromDiscord<scarf> In reply to @Elegantbeef "What's `data`?": nimpng raw data
06:29:33FromDiscord<Elegantbeef> So bytes
06:31:00FromDiscord<scarf> sent a code paste, see https://play.nim-lang.org/#ix=4fM8
06:31:40FromDiscord<Rika> const
06:31:43FromDiscord<Rika> use let
06:31:51FromDiscord<.tochka> or static begin ;p
06:32:12FromDiscord<Rika> requires effort lol
06:32:21FromDiscord<Rika> id be too lazy
06:33:10FromDiscord<scarf> alright, so parameter wasn't comptimeโ†ตI'm not sure if this is idiomatic nim code tho
06:33:45FromDiscord<.tochka> HSlice could be nicer than tuple probably
06:38:41FromDiscord<scarf> sent a code paste, see https://play.nim-lang.org/#ix=4fM9
06:39:19FromDiscord<Elegantbeef> `let foo = 0..100`
06:42:05FromDiscord<scarf> sent a code paste, see https://paste.rs/j3C
06:44:27FromDiscord<.tochka> nice
06:52:56FromDiscord<Elegantbeef> `func normalize[T](num: T, begin, to: static Slice[T]): T` write less ๐Ÿ˜›
06:53:24FromDiscord<scarf> that's nicer. can a func be conditionally consteval?
06:54:54FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/lt3
06:55:03FromDiscord<Elegantbeef> Also not called consteval here it's just 'static' ๐Ÿ˜„
06:55:35FromDiscord<scarf> thx, are there any difference with `or` or `|`? ` begin, to: Slice[T] | static Slice[T]`
06:55:56FromDiscord<Elegantbeef> I prefer `or` they're identical
06:59:06*Guest30 joined #nim
06:59:08FromDiscord<scarf> thanks for all the help, here's an ugly script that prints ascii stuff https://media.discordapp.net/attachments/371759389889003532/1041245810945445888/image.png https://media.discordapp.net/attachments/371759389889003532/1041245811301945384/nimapple.nim
06:59:29FromDiscord<Elegantbeef> It's not a script ๐Ÿ˜›
06:59:50FromDiscord<scarf> In reply to @Elegantbeef "*It's not a script*": it is! <https://nim-lang.org/docs/nims.html>
07:00:54*Guest30 quit (Client Quit)
07:00:55FromDiscord<Yardanico> In reply to @scarf "thanks for all the": finally, bad apple with Nim
07:01:01FromDiscord<Yardanico> In reply to @scarf "it is! <https://nim-lang.org/docs/nims.html>": surprised nimpng works with nimscript
07:02:34FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4fMf
07:02:40FromDiscord<ringabout> What does `return 1` mean?
07:03:01FromDiscord<ringabout> Shouldn't it use exit 1?
07:03:22FromDiscord<Elegantbeef> Wow it's yardanico
07:03:37FromDiscord<Yardanico> wow
07:03:52FromDiscord<Yardanico> beef is still beef
07:04:00FromDiscord<Elegantbeef> Fuck dont tell beef
07:05:39FromDiscord<Elegantbeef> Yard you can see the discord join statistics right?
07:06:11FromDiscord<Elegantbeef> if so what's the spike from that popular youtube video
07:06:29FromDiscord<Yardanico> yeah there was a spike, not a big one though
07:06:43FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1041247726341459988/image.png
07:06:50FromDiscord<Yardanico> I mean it is big compared to usual joins, like 4x
07:06:57FromDiscord<Yardanico> this is daily stats
07:07:03FromDiscord<Elegantbeef> Yea not as substantiate as one would imagine
07:08:34FromDiscord<Yardanico> I'm surprised people still use the invite, I wonder which one
07:48:34*dnh joined #nim
08:02:18FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4fMq
08:03:04FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4fMq" => "https://paste.rs/ckg"
08:04:04FromDiscord<FetchBot> whats the right channel for just asking general questions that don't really fall into a specific category
08:04:22FromDiscord<Phil> is it about nim syntax? Here
08:04:41FromDiscord<Phil> Is it about other programming languages or non coding topics? offtopic
08:05:04FromDiscord<Yardanico> In reply to @Isofruit "hmmm nimqml seems to": Try with `--mm:refc` on devel, since ARC/ORC is the new default
08:05:24FromDiscord<Yardanico> But the issue here usually is the object destructor being generated before the constructor proc was written
08:05:28FromDiscord<spoon> oh nim 2 is devel branch?
08:05:33FromDiscord<Yardanico> In reply to @spoon "oh nim 2 is": yes
08:05:40FromDiscord<Yardanico> nim devel always has the newest in-development Nim
08:05:42FromDiscord<Phil> Aye, I tend to compile everything with devel nowadays
08:05:55FromDiscord<Phil> Mostly because there are a couple library fixes that I refuse to do without
08:07:46FromDiscord<FetchBot> sent a code paste, see https://play.nim-lang.org/#ix=4fMu
08:08:04FromDiscord<Phil> In reply to @Yardanico "Try with `--mm:refc` on": Ohhh yeah that is the issue, I tend to compile everything ever always with ORC so I didn't even think it could be memory management related
08:09:11FromDiscord<Yardanico> In reply to @FetchBot "I'm hoping someone can": Interesting, going to look a bit, never seen such an error
08:09:46FromDiscord<Elegantbeef> I'll blame it on using `const` for ref objects
08:09:48FromDiscord<Yardanico> maybe it's https://github.com/nim-lang/Nim/issues/11268
08:10:12FromDiscord<Yardanico> "const objects are not allowed to inherit and are not allowed to have case in them, the compiler's error message should say so, but doesn't."
08:10:32FromDiscord<Yardanico> In reply to @FetchBot "I'm hoping someone can": If you change it to `let` it'll work, do you require this code to work at compile-time ?
08:10:43FromDiscord<Yardanico> `const` in Nim means computed at compile-time, it's not related to scope as in some other languages
08:12:14FromDiscord<FetchBot> ye, that seems to be it. thank you ๐Ÿ™‚
08:13:03FromDiscord<Yardanico> Basically `const` means immutable, computed at compile-time, `let` is immutable (unless it's a ref object, then you can mutate its fields) but computed at runtime
08:13:06FromDiscord<Yardanico> And `var` is runtime and mutable
08:13:32FromDiscord<Yardanico> There are also some separate things, like you can have a compile-time `var` to be able to mutate it at compile-time (useful for metaprogramming and the like)
08:14:57FromDiscord<FetchBot> ye, i just defaulted to const coming from typescript, swapped it to let
08:17:17FromDiscord<Phil> In reply to @FetchBot "ye, i just defaulted": If that's the case please note that there is no equivalent to const from TS.โ†ตThe closest one is `let` but it is imo more similar to Object.freeze than anything else
08:17:39FromDiscord<Phil> (edit) "TS.โ†ตThe" => "TS, due to const being merely "can not re-assign but can mutate".โ†ตThe"
08:17:59FromDiscord<Elegantbeef> `let a = someRef` is the same
08:18:20FromDiscord<Phil> (edit) "else" => "elseโ†ตunless ref object, god I keep forgetting that ref objects screw everything up"
08:18:32FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fMw
08:18:45FromDiscord<Yardanico> Also the new methods for ORC do seem fast and compact
08:19:00FromDiscord<Yardanico> I was trying to compile older NimES commit where it had methods, and the ORC binary is 3x smaller after stripping
08:19:08FromDiscord<Yardanico> since no type names by default
08:19:15FromDiscord<Yardanico> or only very compact ones
08:19:21FromDiscord<Elegantbeef> Yea it's as fast as refc's iirc
08:19:25FromDiscord<Elegantbeef> Or faster
08:19:29FromDiscord<Elegantbeef> Dont recall the benchmarks
08:21:05FromDiscord<FetchBot> In reply to @Isofruit "If that's the case": for sure ๐Ÿ™‚ I think the main reason for my confusion was due to where the error was pointing to, its something i will be keeping in mind moving forwords
08:21:28FromDiscord<Yardanico> yeah that error is not really descriptive
08:21:51FromDiscord<Elegantbeef> The error is oddly bubbling from the wrong place
08:23:03FromDiscord<Yardanico> btw @beef https://github.com/nim-lang/Nim/issues/20820 still doesn't seem to work
08:23:14FromDiscord<Yardanico> I edited the line to ` texts.map((proc(s: string): int)(runeLen)).max` but it still fails
08:23:21FromDiscord<Yardanico> with ambiguous runeLen
08:23:29FromDiscord<Elegantbeef> Uhh
08:23:33FromDiscord<Yardanico> it still thinks it's ambiguous between string and openArray[char]
08:23:40FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1041267087970160710/image.png
08:23:57FromDiscord<Yardanico> compiler bug? :P
08:24:13FromDiscord<Elegantbeef> Seems like it equates the two
08:24:22FromDiscord<Yardanico> yeah
08:24:23FromDiscord<Elegantbeef> If you want a PR to Pakku do it properly
08:24:33FromDiscord<Yardanico> so this isn't really a compiler bug?
08:24:35FromDiscord<Elegantbeef> Dont use map then max like this is haskell ๐Ÿ˜„
08:24:39FromDiscord<Yardanico> I mean I don't use Pakku myself, just got curious
08:24:43FromDiscord<Yardanico> It seems to be abandoned anyway
08:24:47FromDiscord<Elegantbeef> Yea it's likely a compiler bug
08:24:56FromDiscord<Yardanico> Ah nvm https://github.com/zqqw/pakku is a maintained fork
08:26:06FromDiscord<Yardanico> also ` texts.mapIt(runeLen(it)).max` will work here too and it's shorter
08:26:09FromDiscord<Yardanico> Wonder why the original used map
08:26:19FromDiscord<Elegantbeef> Ugh
08:26:35FromDiscord<Yardanico> yeah yeah for loop better :P
08:26:44FromDiscord<Yardanico> I know
08:26:45FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fMx
08:27:03FromDiscord<Elegantbeef> Oh i know you know
08:27:25FromDiscord<Elegantbeef> you could do `text.applyit(max(it, result))`
08:27:30FromDiscord<Elegantbeef> If you want to be silly ๐Ÿ˜›
08:27:39FromDiscord<Elegantbeef> Actually dont recall if it has to return a value
08:27:41FromDiscord<Yardanico> btw weirdly enough https://github.com/zqqw/pakku seems to compile without changes on devel
08:27:51FromDiscord<Yardanico> wonder why are they trying the original, and not the fork
08:28:09FromDiscord<Elegantbeef> It's so weird that it errors
08:28:40FromDiscord<Elegantbeef> https://wandbox.org/permlink/iImERr2hHmmEntfL
08:29:10FromDiscord<Yardanico> ah nvm it worked because I didn't clone properly
08:29:18FromDiscord<Elegantbeef> lol
08:29:47FromDiscord<Elegantbeef> Maybe `const myRuneLen = (proc(s: string): int)(runeLen)` works?
08:30:05FromDiscord<Elegantbeef> It might be that proc dispatch looks at the symbol instead of the more specific symbol?
08:30:11FromDiscord<Yardanico> nope, doesn' work
08:30:37FromDiscord<Yardanico> it errors at the const line saying it's ambiguous, same error
08:30:46FromDiscord<Elegantbeef> what the hell
08:31:33FromDiscord<Elegantbeef> I wonder if it's the `extern` and `rtl` stuff
08:32:34FromDiscord<Yardanico> Anyway https://github.com/zqqw/pakku/pull/28
08:32:40FromDiscord<Phil> Another self answered SO question incoming with the recent enlightenment about how "cannot bind another =destroy" means "use --mm:refc", no real need to answer that one.
08:32:56FromDiscord<Yardanico> well --mm:refc isn't a "proper" fix
08:33:01FromDiscord<Yardanico> since then you're missing on ORC
08:33:04FromDiscord<Yardanico> a proper fix is reordering code
08:33:05NimEventerNew question by Philipp Doerner: `cannot bind another &amp;#39;=destroy&amp;#39;` when compiling nimqml project with nim devel compiler, see https://stackoverflow.com/questions/74419532/cannot-bind-another-39-destroy39-when-compiling-nimqml-project-with-nim
08:33:13FromDiscord<Yardanico> wow that was fast
08:33:23FromDiscord<Yardanico> glad to see at least nimeventer is stable to run unattended on the vps
08:33:44FromDiscord<Phil> In reply to @Yardanico "a proper fix is": I mean yeah, but from what I'm seeing that means updating nimqml to work with ORC
08:33:49FromDiscord<Elegantbeef> The issue with nimqml is that it's across like 10 included files and they use finalizers so it's a bitch to mvoe to destructors
08:34:00FromDiscord<Yardanico> In reply to @Isofruit "I mean yeah, but": yes, just make sure the SO answer says it's specific to NimQML
08:34:00FromDiscord<Phil> Which is beyond my area of expertise
08:34:14FromDiscord<Yardanico> otherwise people might see that error in their projects, google, find the SO answer and just change to refc
08:34:16FromDiscord<Phil> Wait... motherfuck it deleted the answeer
08:34:19FromDiscord<Phil> (edit) "answeer" => "answer"
08:34:22FromDiscord<Yardanico> lopl
08:34:26FromDiscord<Phil> grrr retyping, one minute
08:34:32FromDiscord<Elegantbeef> I tried to make Nimqml use import a while ago, but damn it's cyclical
08:35:00FromDiscord<Yardanico> @beef guess since I'm a bit bored now I'll try to run pakku with orc and useMalloc and see how much unneeded allocations it does
08:35:07FromDiscord<Yardanico> seems like it likes functional style stuff
08:35:13FromDiscord<Elegantbeef> lol
08:35:19FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1041270019612483645/image.png
08:35:21FromDiscord<Yardanico> ๐Ÿ˜ฉ
08:35:29FromDiscord<Yardanico> this works btw
08:35:32FromDiscord<Yardanico> wonder why the other one didn't
08:35:45FromDiscord<Elegantbeef> dispatch works but getting the name doesnt
08:35:47FromDiscord<Yardanico> yeah
08:35:55FromDiscord<Yardanico> since this is a normal lambda, not just passing the proc
08:36:40FromDiscord<Yardanico> what no strformat does to someone https://media.discordapp.net/attachments/371759389889003532/1041270357614673930/image.png
08:37:00FromDiscord<Elegantbeef> there is some code i've seen that's just like "jesus who hurt you" some times
08:37:44FromDiscord<Elegantbeef> It's mostly whenever phil here posts code ๐Ÿ˜›
08:37:55FromDiscord<Yardanico> ruude
08:38:08FromDiscord<Elegantbeef> He knows it's in jest, atleast he better
08:38:33madpropssweetie we have a CoC for that
08:38:37FromDiscord<Yardanico> those poor wasted sequences https://media.discordapp.net/attachments/371759389889003532/1041270849451339786/image.png
08:38:58FromDiscord<Yardanico> they live to be deleted just a few moments later
08:39:14FromDiscord<Elegantbeef> Yea people see `sequtils` and go "why not"
08:39:47FromDiscord<Elegantbeef> Sadly my `chain` macro doesnt make me happy enough to say anything
08:40:29FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fMB
08:40:33FromDiscord<Yardanico> I mean it might be not really evident that it's inefficient if you're new to the language
08:40:57FromDiscord<Elegantbeef> Atleast iirc
08:40:59FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fMC
08:41:38FromDiscord<Elegantbeef> actually one might need to do `x` instead of discard, my memory is shotty here
08:41:52FromDiscord<Phil> In reply to @Elegantbeef "*It's mostly whenever phil": This is because I plan on dropping constructor as a dependency the second nim-devel supports default-constructor-procs for fields with `distinct DateTime` types ๐Ÿ˜›
08:42:01FromDiscord<Phil> (edit) "This" => "I bet this heckling"
08:42:02FromDiscord<Elegantbeef> Good
08:44:12FromDiscord<Elegantbeef> On the plus side yard the runelen issue is reproducible outside of their code
08:45:22FromDiscord<Phil> In reply to @Yardanico "those poor wasted sequences": Isn't that the case in any functional style stuff, you do tons of copying with sequences in order to not mutate them?
08:45:34FromDiscord<Yardanico> functional languages have special optimizations regarding that
08:45:41FromDiscord<Elegantbeef> In Nim yes
08:45:42FromDiscord<Elegantbeef> In other languages it's not done in the same way
08:45:44FromDiscord<Yardanico> so it can be as efficient as imperative code I think
08:45:50FromDiscord<Yardanico> or at least close
08:46:09FromDiscord<Elegantbeef> The thing with FP is that you "rebuild the world"
08:46:18*krux02 joined #nim
08:48:15FromDiscord<Elegantbeef> Interesting it's getting `convNotLegal`
08:50:42FromDiscord<Elegantbeef> Oh god yard we're dumb
08:51:26FromDiscord<Elegantbeef> It's an inline proc
08:51:38FromDiscord<Elegantbeef> so it's `(proc(s: string): int {.inline.})(runeLen)`
08:51:42FromDiscord<Yardanico> that didn't work for me
08:51:44FromDiscord<Yardanico> I tried :P
08:51:49FromDiscord<Yardanico> does it work for you?
08:51:49FromDiscord<Elegantbeef> It works here
08:52:02FromDiscord<Yardanico> not here
08:52:14FromDiscord<Yardanico> ah wait it's indeed weird
08:52:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fMD
08:52:24FromDiscord<Yardanico> ` Calling convention mismatch: got '{.inline.}', but expected '{.closure.}'.`
08:52:27FromDiscord<Yardanico> for `map`
08:52:31FromDiscord<Elegantbeef> Yea
08:52:40FromDiscord<Yardanico> but how did it work before then
08:52:51FromDiscord<Elegantbeef> Before my PR it wasnt inlined
08:53:01FromDiscord<Yardanico> oh
08:53:04FromDiscord<Yardanico> so you broke it :PP
08:53:11FromDiscord<Elegantbeef> With my PR all str ops are inlined and call their `openArray[char]` now
08:53:12FromDiscord<Yardanico> but yeah that's fine for nim 2
08:53:22FromDiscord<Yardanico> so it's not a bug but just a breaking change, fair enough
08:53:36FromDiscord<Elegantbeef> Well I mean we're not going to change back to the previous version of only having unicode for string
08:53:40FromDiscord<Elegantbeef> Or parseutils for string
08:53:41FromDiscord<Yardanico> of course
08:54:00FromDiscord<Elegantbeef> I'm quite chuffed with that change cause no one will notice it but i will know it's there
08:54:21FromDiscord<Elegantbeef> want to read unicode on a cstring, you can without converting.... want to parse from a cstring, you can
08:54:49FromDiscord<Elegantbeef> Plus `toOpenArray` now works on the VM which is equally as fun
08:55:39FromDiscord<Elegantbeef> Plus this is only breaking cause they wrote the code the way they did
08:55:54FromDiscord<Elegantbeef> if they wrote it in the calling form it's a 0 issue, so this makes better code
08:56:00FromDiscord<Elegantbeef> You wouldnt be looking at pakku if it wasnt for this! ๐Ÿ˜›
08:57:03FromDiscord<Elegantbeef> Now that i think about it it's kinda odd that all calling conventions dont implicitly convert to closure
08:57:45FromDiscord<Elegantbeef> Like it's just "emit an anonymous procedure that pass the arguments if we need to convert"
08:59:10FromDiscord<Elegantbeef> Aw shit here i am rambling again
09:00:56FromDiscord<Yardanico> Also was thinking of setting up a reddit monitor to watch programming subreddits for Nim mentions, won't hook it up to nimeventer as it'd be too noisy, just for myself
09:01:05FromDiscord<Yardanico> But I wrote the PoC in python with the reddit lib :P
09:01:06FromDiscord<Yardanico> not nim :((
09:01:17FromDiscord<Elegantbeef> Nim is infact a toy language
09:02:13FromDiscord<Elegantbeef> You like distinct types as much as the next programmer right?
09:02:44FromDiscord<Yardanico> แตข ๐’นโ‚’โ‚™'โ‚œ แตคโ‚›โ‚‘ โ‚œโ‚•โ‚‘โ‚˜
09:02:52FromDiscord<Elegantbeef> I'm debating about yet another macro package, and need atleast another view on this https://github.com/beef331/nimtrest/blob/master/lender.nim#L224-L261
09:02:54FromDiscord<Elegantbeef> Damn
09:03:03FromDiscord<Elegantbeef> Not using distincts, blocked
09:03:10FromDiscord<Yardanico> yes sad, but my code is usually just very plain and simple
09:03:13FromDiscord<Yardanico> procs and objects
09:03:24FromDiscord<Elegantbeef> I like my distincts
09:03:35FromDiscord<Elegantbeef> Micros is lovely, makes things like this a breeze
09:03:41FromDiscord<Elegantbeef> That is if i can ever remember the fucking api i made ๐Ÿ˜›
09:04:58FromDiscord<Yardanico> also if you want more stats about that nim video
09:05:00FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1041277491488243722/image.png
09:05:03FromDiscord<Yardanico> github repo visitors
09:06:18FromDiscord<Yardanico> git clones are weird though, too many bots?
09:06:20FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1041277825447112724/image.png
09:06:53FromDiscord<Yardanico> green is total clones, blue unique cloners
09:09:47FromDiscord<ShalokShalom> In reply to @Yardanico "since no type names": How can type names take up so much space?โ†ตโ†ตI mean its obviously not the space for the name itself.
09:10:06FromDiscord<Yardanico> In reply to @ShalokShalom "How can type names": nim with refc does always include runtime type information
09:10:06FromDiscord<Elegantbeef> It's a pointer and the heap allocated name
09:10:22FromDiscord<Yardanico> or maybe you can disable it, I forgot
09:10:32FromDiscord<Elegantbeef> Plus the entire type structure
09:10:32FromDiscord<Elegantbeef> You could disable names
09:10:36FromDiscord<Elegantbeef> But that's it afaik
09:10:40FromDiscord<ShalokShalom> In reply to @Yardanico "green is total clones,": It seems almost double the clones as the unique ones
09:10:57FromDiscord<Yardanico> not double, the graphs aren't on same scale
09:11:04FromDiscord<ShalokShalom> In reply to @Elegantbeef "Plus the entire type": That sounds like the most expensive?
09:11:06FromDiscord<Yardanico> left is clones, right is unique cloners
09:11:21FromDiscord<ShalokShalom> And the heap is part of the binary?
09:11:33FromDiscord<Yardanico> @ShalokShalom https://media.discordapp.net/attachments/371759389889003532/1041279139342188544/image.png
09:11:37FromDiscord<ShalokShalom> I thought that is basically allocated in memory, on runtime
09:11:45FromDiscord<Elegantbeef> Actually it's not heap allocated it's likely statically allocated
09:11:46FromDiscord<Yardanico> green on the left shows scale for the green graph, blue on the right shows the scale for the blue graph
09:12:18FromDiscord<Yardanico> most of these clones are probably just CI services and other bots
09:12:35FromDiscord<Elegantbeef> Yard is devel just using an int for type information?
09:12:39FromDiscord<ShalokShalom> @Yardanico so those numbers in the middle of the screen show the total numbers over that time?
09:12:41FromDiscord<Elegantbeef> Or is ptype still complex?
09:12:56FromDiscord<ShalokShalom> In reply to @Yardanico "most of these clones": Yeah, probably.
09:12:59FromDiscord<Yardanico> In reply to @ShalokShalom "<@177365113899057152> so those numbers": It's just two graphs with different scale overlayed on each other
09:13:02FromDiscord<Elegantbeef> I'm amazed a dual y axis graph is causing this must confusion
09:13:12FromDiscord<ShalokShalom> Does the heap become part of the binary?
09:13:15FromDiscord<Elegantbeef> Green is left scale, blue is right
09:13:20*jjido joined #nim
09:13:21FromDiscord<Elegantbeef> The heap is your ram so no
09:13:28FromDiscord<ShalokShalom> Yes, I thought so
09:13:31FromDiscord<ShalokShalom> Thanks
09:13:35FromDiscord<Elegantbeef> You have heap, stack, and static generally
09:13:39FromDiscord<Elegantbeef> There is more but those are the 3
09:13:55FromDiscord<ShalokShalom> In reply to @Elegantbeef "It's a pointer and": I understood that so
09:14:43FromDiscord<Yardanico> regarding binary size of ORC - if we exclude the type information, ARC/ORC binaries should actually take more space than the refc ones
09:14:52FromDiscord<Yardanico> because of all the generated copy/sink/destroy procs
09:15:12FromDiscord<Elegantbeef> But Refc also has the GC
09:15:19FromDiscord<Elegantbeef> And orc/arc binaries are generally smaller
09:15:19FromDiscord<Yardanico> true ๐Ÿค”
09:15:31FromDiscord<Yardanico> they are smaller, because of no runtime information I guess
09:16:06FromDiscord<Elegantbeef> With stable the still have RTTI
09:16:13FromDiscord<Elegantbeef> they\
09:16:45FromDiscord<Yardanico> i'm talking devel refc vs orc
09:16:50FromDiscord<Elegantbeef> Ah
09:16:55FromDiscord<Yardanico> like for nimes with danger clang lto it's 96KB with orc, 376KB with refc
09:17:05FromDiscord<Yardanico> the commit where it was with methods
09:17:14FromDiscord<Yardanico> let's compare the newer commit where I replaced method by "interfaces"
09:17:47FromDiscord<Yardanico> still 376KB refc vs 104KB ORC
09:17:47FromDiscord<Elegantbeef> I think you're going to be hardpressed to make orc larger than refc, but who knows
09:18:03FromDiscord<Yardanico> so apparently those interfaces I made take more space for orc than new orc methods :D
09:18:18FromDiscord<ShalokShalom> In reply to @Yardanico "like for nimes with": You compiled the older with current compilers, yes?
09:18:22FromDiscord<Elegantbeef> Most types arent going to have overly complex destructors i imagine
09:18:34FromDiscord<ShalokShalom> Or just compared them to todays gcc or clang?
09:18:35FromDiscord<Yardanico> In reply to @ShalokShalom "You compiled the older": no
09:18:42FromDiscord<Yardanico> Both with newest nim devel with clang
09:18:46FromDiscord<Yardanico> refc vs orc
09:18:50FromDiscord<Yardanico> clang 14.0.6
09:18:50FromDiscord<ShalokShalom> Ok
09:19:01FromDiscord<Yardanico> gcc is similar but the binaries are a bit bigger for both
09:19:12FromDiscord<Elegantbeef> Static musl time ๐Ÿ˜›
09:19:17FromDiscord<Yardanico> zigcc
09:19:29FromDiscord<Yardanico> I don't want to try to build this statically, since it also links sdl2 :P
09:19:43FromDiscord<Elegantbeef> You're on linux you should have the .a
09:20:02FromDiscord<Elegantbeef> inb4 "I'm on windows"
09:20:11FromDiscord<Yardanico> nonono
09:20:44FromDiscord<Elegantbeef> I'd jokingly say "nlvm 2 when" but i dont want arne to come swat me
09:20:49FromDiscord<Yardanico> lol
09:21:36FromDiscord<Yardanico> 100KB orc vs 384KB refc, a bit bigger than clang
09:21:40FromDiscord<Yardanico> gcc I mean
09:21:56FromDiscord<Yardanico> is the compiler on devel built with orc nowadays, or still refc?
09:22:03FromDiscord<Elegantbeef> Orc
09:22:24FromDiscord<Elegantbeef> Araq wanted to drink his own flavour aid finally
09:22:40FromDiscord<Elegantbeef> Still causes some memory/performance issues where cursor inference fails
09:22:52FromDiscord<Yardanico> yeah I know there are still some arc/orc bugs left
09:23:28FromDiscord<Elegantbeef> I've never really ran into any of them myself which makes me happy ๐Ÿ˜„
09:23:53FromDiscord<Elegantbeef> I guess i've likely had cursor inference fail, but that's a silent bug
09:24:18FromDiscord<Elegantbeef> The interesting thing is that the bug i was talking about was due to a refc 'bug'
09:24:44FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fMG
09:24:53FromDiscord<Elegantbeef> Apparently in refc `let b = string or seq` doesnt copy
09:24:53FromDiscord<Yardanico> argh did new github search break sorting by date
09:25:59FromDiscord<Yardanico> AH okay github search is not broken, it just shows wrong dates
09:27:59FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1041283273860579419/image.png
09:28:05FromDiscord<Yardanico> funny name :P (it's actually updated a few hours ago)
09:28:38FromDiscord<Elegantbeef> Hey i did nimtrest, so is stealing my schtick
09:29:00FromDiscord<Elegantbeef> I take it back they're doing malware related stuff
09:29:07FromDiscord<Yardanico> yes
09:29:12FromDiscord<Elegantbeef> But they use `openarray` so they're alright in my books
09:29:13FromDiscord<Yardanico> but yeah it's surely ethical research
09:29:36FromDiscord<Elegantbeef> Anyone that uses openarray gets a gold star from me
09:29:38FromDiscord<Elegantbeef> I'm a simple man
09:30:05FromDiscord<Elegantbeef> Not a github star, but a imaginary gold start
09:30:20FromDiscord<scarf> how do i test `runnableExamples`?
09:30:28FromDiscord<Yardanico> nim doc
09:30:34FromDiscord<Elegantbeef> `nim doc` runs it
09:31:11FromDiscord<scarf> sent a code paste, see https://play.nim-lang.org/#ix=4fMJ
09:31:27FromDiscord<Yardanico> Yes, those examples are meant for documentation, so they're tested when you build docs
09:31:30FromDiscord<Elegantbeef> `runnableExamples` is to show how it workss
09:31:44FromDiscord<Yardanico> if you want to write tests, just write them separately
09:32:00FromDiscord<scarf> alright, i guess so
09:39:43FromDiscord<Phil> ~~Or make `nim docs` part of your CI pipeline~~
09:39:58FromDiscord<Elegantbeef> I mean it likely should be
09:40:05FromDiscord<Elegantbeef> But not as unit testing
09:40:19FromDiscord<Elegantbeef> But also who uses a CI
09:40:39FromDiscord<Elegantbeef> Guy who has 0 CIs for any of his repos
09:41:32FromDiscord<Phil> In reply to @Elegantbeef "But also who uses": Mystery people
09:41:58FromDiscord<Elegantbeef> see i've considered setting up a CI but i also concede there isnt much reason to
09:47:09FromDiscord<scarf> wdym you don't host your docs on github pages
09:47:16FromDiscord<scarf> savages smh
09:48:15FromDiscord<Elegantbeef> I just added myself to treeform's nimdoc and when it's not down it gives my docs
09:48:27FromDiscord<scarf> oh, that'd work
09:51:16FromDiscord<Elegantbeef> Plus no one uses my code so it's fine!
10:10:54FromDiscord<Slazaa> Hi, how does error handling work in Nim, I saw there is a Result type but how does it work ?
10:11:12FromDiscord<Yardanico> Default Nim error handling is via exceptions, similar to how Python does it
10:11:31FromDiscord<Yardanico> There are libraries that allow you to use different ways, like nim-result
10:11:37FromDiscord<Elegantbeef> Seems there is more talk/want of results, it's going to make me sad
10:11:52FromDiscord<Slazaa> So I should use exceptions ? :o
10:11:58FromDiscord<Elegantbeef> Yes you should
10:12:03FromDiscord<Slazaa> Alright x)
10:12:08FromDiscord<Slazaa> Exceptions it is
10:12:24FromDiscord<Slazaa> Thank for you responding :D
10:12:29FromDiscord<ieltan> In reply to @Elegantbeef "Seems there is more": I think it's because of rust
10:12:37FromDiscord<Elegantbeef> Exceptions are what Nim uses, you can use results if you want the explicitly and mild performance benefits
10:12:53FromDiscord<Elegantbeef> I really prefer the semantics of exceptions it's just nicer imo, but sadly the performance isnt there
10:13:15FromDiscord<Slazaa> I don't know, Result makes more sense to me
10:13:38FromDiscord<ieltan> Maybe it makes more sense for Rust
10:13:45FromDiscord<Elegantbeef> Results force unpacking on the user even if they really dont care
10:14:06FromDiscord<Slazaa> Yeah, I know Nim is meat to be less annoying than Rust
10:14:11FromDiscord<Elegantbeef> I can already hear "but you can use the `?` operator"
10:14:12FromDiscord<Yardanico> yeah, it's a bit similar to Go but with better syntax since Nim has overloading, metaprogramming, and a lot of other goodies
10:14:29FromDiscord<Yardanico> I mean using stuff like result
10:14:33FromDiscord<Yardanico> or Zig if you're into that
10:15:13FromDiscord<ieltan> Zig has no overloading and metaprogramming tho
10:15:13FromDiscord<Slazaa> Exceptions inherite from Exception right ? :o
10:15:29FromDiscord<Yardanico> In reply to @ieltan "Zig has no overloading": I mean the way it does errors
10:15:36FromDiscord<ieltan> Ah yes
10:15:53FromDiscord<Elegantbeef> `CatchableError` iirc
10:15:59FromDiscord<Yardanico> yeah
10:16:25FromDiscord<Yardanico> and Defect if your exception is supposed to be non-recoverable
10:16:45FromDiscord<Slazaa> Uhh, alright :o
10:16:59FromDiscord<Slazaa> Thank you
10:17:13FromDiscord<Phil> In reply to @Elegantbeef "Plus no one uses": Fucking lying to me to my face when I'm in the same channel and can read that message
10:18:38FromDiscord<Elegantbeef> image.pngโ†ต(@Phil) https://media.discordapp.net/attachments/371759389889003532/1041296022510501918/image.png
10:18:40FromDiscord<ieltan> What's the state of `not nil` anyways? Is it shipping for v2?
10:19:10FromDiscord<ieltan> By Default I mean
10:19:18FromDiscord<Phil> In reply to @Elegantbeef "image.png (<@180601887916163073>)": I still have my local copy, you will never take that from me!!
10:19:20FromDiscord<Elegantbeef> Nope
10:19:37FromDiscord<Yardanico> In reply to @Elegantbeef "image.png (<@180601887916163073>)": why
10:19:43FromDiscord<Yardanico> it's nice
10:20:05FromDiscord<Elegantbeef> That's what i'm told, but i rarely use it
10:20:22FromDiscord<Yardanico> just archive it then
10:20:28FromDiscord<Yardanico> like <https://github.com/Yardanico/nim-strenc>
10:22:13FromDiscord<Elegantbeef> Nah it's actually supported
10:22:16FromDiscord<Elegantbeef> yard read the context
10:23:09FromDiscord<Elegantbeef> I said no one used my code, Phil said he does, i threatened deleting it
10:23:54FromDiscord<Phil> Funnily enough even in a nimv2 world I think constructor has a pretty important usecase due to it allowing values to be generated at runtime
10:24:49FromDiscord<Elegantbeef> It's funny cause i think defaults is the less fun version
10:25:03FromDiscord<Elegantbeef> The constructor macro is what i gravitate to
10:26:32FromDiscord<Phil> The main reason I believe is mostly because I actually do not care about instantiation one single bit. Norm does, I don't. Norm just needs empty instances, so I give norm empty instances
10:27:00FromDiscord<Phil> If norm managed to instantiate model types itself I wouldn't need to write construction procs
10:29:21FromDiscord<Elegantbeef> Funnily enough iirc the last time i went to use constructor i found a bug, so clearly no one else uses it
10:29:33*jjido quit (Quit: My laptop has gone to sleep. ZZZzzzโ€ฆ)
10:32:04*jjido joined #nim
10:39:36FromDiscord<aq47> Will these be stabilized in v2? https://nim-lang.org/docs/manual_experimental.html#view-types
10:40:40FromDiscord<aq47> and `compiletimeFFI`?
10:41:04*jjido quit (Quit: My laptop has gone to sleep. ZZZzzzโ€ฆ)
10:47:52FromDiscord<scarf> sent a code paste, see https://play.nim-lang.org/#ix=4fMS
10:48:35FromDiscord<Yardanico> an object :D
10:48:40FromDiscord<Yardanico> but really, just x, y
10:48:41FromDiscord<Yardanico> why yx?
10:49:07FromDiscord<scarf> since for y , for x is used a lot when iterating over pixels?
10:49:57FromDiscord<Phil> Do the obvious one (x, y) unless you performance concerns
10:50:29FromDiscord<Phil> Which... I'm not sure how there would be any but I'm also not doing high performance stuff
10:50:50FromDiscord<scarf> on other thoughts, since nim tuples are named x,y seems better
10:51:31FromDiscord<Yardanico> In reply to @Isofruit "Which... I'm not sure": It can be different, but unless you're doing some really really high performance stuff it's not going to be noticeable
10:53:40FromDiscord<aq47> In reply to @scarf "since for y ,": You want a struct of arrays then, try making a row of xs an object
10:54:13FromDiscord<scarf> sent a code paste, see https://play.nim-lang.org/#ix=4fMT
10:54:25FromDiscord<Yardanico> seq[bool] ๐Ÿค”
10:54:42FromDiscord<Yardanico> data can be different length?
10:54:55FromDiscord<Yardanico> Is it just a few predefined values, or arbtirary length?
10:55:16FromDiscord<scarf> their size is always `term.w term.h`, but can arrays be dynamically allocated?
10:56:02FromDiscord<Yardanico> ah, fair enough, you can just preallocate the seq then
10:56:15FromDiscord<Yardanico> I wonder if seq[bool] will use 8 bytes for each bool or not
10:56:51FromDiscord<scarf> tho it's simple png to ascii program so maybe performance won't hurt much
10:57:55FromDiscord<Yardanico> okay just checked, it's all fine
10:58:02FromDiscord<Yardanico> ` result.x = newSeq[bool](10)` allocates 18 bytes
10:58:06FromDiscord<Yardanico> so the compiler can optimize it
10:58:10FromDiscord<Yardanico> the C compiler I mean
10:58:58FromDiscord<Yardanico> 18 because 10 data + 8 for the capacity
10:59:02FromDiscord<Yardanico> 8 being int64
10:59:40FromDiscord<scarf> so `int64_t` for capacity, 10 `int8_t` for each array element
10:59:54FromDiscord<Yardanico> yeah, capacity is actually just `int`, but `int` in Nim is `int64` on 64-bit platforms
11:00:12FromDiscord<Yardanico> on 32-bit it would be 4 bytes
11:00:26FromDiscord<scarf> interesting, tho i kind of wish nim used i32 or i64 everywhere to be explicit
11:25:09*jmdaemon quit (Ping timeout: 268 seconds)
11:50:20FromDiscord<aq47> In reply to @scarf "yeah kinda made similar": you can use a bitset instead of `seq[bool]`
11:50:57*pro joined #nim
11:54:24FromDiscord<aq47> Ah, I thought [bitfields](https://nim-lang.org/docs/manual.html#set-type-bit-fields) supported doing that, looks like it doesn't
11:56:09FromDiscord<auxym> https://github.com/treeform/bitty
12:00:01FromDiscord<auxym> or https://github.com/YesDrX/bitarray, https://github.com/onecodex/nim-bitarray
12:09:39FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=4fNh
12:10:03FromDiscord<Bung> what's the theory here?
12:30:51*pro quit (Ping timeout: 260 seconds)
12:42:33FromDiscord<scarf> would there be a library to split an mp4 to png frames?
12:42:39FromDiscord<scarf> (edit) "split" => "process"
12:51:09FromDiscord<Slazaa> Hey, I'm working with OpenGL and I have this type `ptr GLubyte` and I need to make it a string, how can I do that ?
13:16:54FromDiscord<Yardanico> In reply to @Slazaa "Hey, I'm working with": If it's in fact a string and is null-terminated you can do `$cast[cstring](yourptr)`
13:22:19FromDiscord<Slazaa> In reply to @Yardanico "If it's in fact": Awsome thank you :3
13:23:21FromDiscord<Slazaa> Can I ignore warnings in a specific file ?
13:27:27FromDiscord<scarf> any video processing library with nim bindings? opencv lacks `cv::VideoCapture`, nimpy fails to find modules, `futhark` fails to build
13:30:33*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
13:30:57NimEventerNew thread by sls1005: Memory strategies with OpenMP, see https://forum.nim-lang.org/t/9601
13:32:33FromDiscord<Yardanico> In reply to @scarf "any video processing library": about Futhark - are you on Windows?
13:32:41FromDiscord<scarf> In reply to @Yardanico "about Futhark - are": ubuntu 22.04
13:32:44FromDiscord<Yardanico> Futhark requires you to have Clang installed, since it uses libclang to generate bindings
13:33:37FromDiscord<scarf> and dom's `opencv/highgui` won't work because `could not import: cvCreateFileCapture` but `libopencv-highgui-dev is already at the latest version 4.5.4+dfsg-9ubuntu4`
13:33:48FromDiscord<Yardanico> yeah it was written for a very old opencv version and isn't maintained anymore
13:34:32FromDiscord<scarf> then i thought, let's use nimpy but it couldn't find installed modules
13:34:46FromDiscord<Yardanico> In reply to @scarf "then i thought, let's": can you show your nimpy code?
13:35:07FromDiscord<Yardanico> but generally I'd recommend trying to use some C lib through Futhark, for example ffmpeg
13:35:12FromDiscord<Yardanico> And generally you can just call ffmpeg from cmdline
13:35:43FromDiscord<scarf> also nimpy doesn't support 3.10 and 3.11
13:35:51FromDiscord<scarf> (edit) "3.11" => "3.11, had to mess with source code"
13:37:18*krux02 quit (Quit: Leaving)
13:39:24*nyeaa49284 quit (Quit: Ping timeout (120 seconds))
13:40:10*nyeaa49284 joined #nim
13:40:48FromDiscord<hmmm> broskis what was the shorthand way of making something like this : var myseq = @[1,1,1,1,1,1,1,1,1,1,1]
13:40:58FromDiscord<hmmm> 1 x 200 works lol?
13:41:51FromDiscord<hmmm> I think there is something like repeat in strutils?
13:42:33FromDiscord<scarf> you can use `repeat(1, 200)` from `std/sequtils`โ†ต<https://nim-lang.org/docs/sequtils.html#repeat%2CT%2CNatural>
13:42:50FromDiscord<hmmm> ty bro! ๐Ÿ˜ƒ
13:43:16FromDiscord<scarf> hecc but what is nim type for numpy.NDArray, those documentations are non-exisistent
13:46:10FromDiscord<scarf> sent a code paste, see https://play.nim-lang.org/#ix=4fNC
13:46:36FromDiscord<scarf> (edit) "https://play.nim-lang.org/#ix=4fNC" => "https://play.nim-lang.org/#ix=4fND"
13:47:29FromDiscord<Yardanico> To use numpy you need to do stuff like <https://github.com/yglukhov/nimpy/blob/master/tests/numpytest.nim>
13:47:47FromDiscord<albassort> i can write fucked up C code and its fine because nim gcc will save me right?
13:47:53FromDiscord<Yardanico> ?
13:48:00FromDiscord<albassort> gc
13:48:02FromDiscord<albassort> extra c
13:48:10FromDiscord<Yardanico> no, Nim GC only works for Nim code
13:48:17FromDiscord<Yardanico> if you emit C code in Nim, it's untouched
13:48:29FromDiscord<albassort> fuck
13:48:47FromDiscord<Yardanico> if you want a GC for C code, maybe use stuff like Boehm (not the boehm in Nim, but Boehm directly with C)?
13:49:07FromDiscord<Yardanico> Also what's your use-case for emitting C code?
13:49:53FromDiscord<scarf> In reply to @Yardanico "To use numpy you": but cap.read() returns a tuple or bool, NDArray, and it seems that i have to cast it using `to` on assignment, so I really need the NDArray type
13:50:34FromDiscord<albassort> In reply to @Yardanico "Also what's your use-case": I had to use C libraries and I didn't wanna deal with the ugly nim wrapping code
13:50:37FromDiscord<albassort> so i just wrote C
13:50:43FromDiscord<albassort> and im gonna wrap my prettier functions
13:50:46FromDiscord<Yardanico> well, you chose this path yourself then
13:51:01FromDiscord<Yardanico> If you want proper Nim handling etc, do proper C FFI :P
13:51:18FromDiscord<albassort> theres no difference
13:51:21FromDiscord<aq47> In reply to @albassort "fuck": Write an allocator in Nim and allocate in C using that? Should be doable in theory
13:51:23FromDiscord<albassort> apart from the fact im not a cp rogrammer
13:51:27FromDiscord<albassort> (edit) "cp rogrammer" => "c programmer"
13:51:31FromDiscord<albassort> and i suck at c
13:51:33FromDiscord<Yardanico> In reply to @aq47 "Write an allocator in": there is, you can then use automatic Nim GC stuff like destructors
13:51:43FromDiscord<Yardanico> well destructors aren't GC since they're inserted at compile-time, but still
13:51:51FromDiscord<albassort> ^
13:51:59FromDiscord<albassort> it seems like it would just become chaotic as hell
13:52:02FromDiscord<Yardanico> you can use Nim as a "better C" if you want to
13:52:36FromDiscord<albassort> i have the stupidest idea for a language that is "better C"
13:52:52FromDiscord<aq47> In reply to @albassort "it seems like it": You can also try writing inline C in Nim and minimize the C
13:52:54FromDiscord<albassort> i will work on that one day
13:53:07FromDiscord<albassort> > inline c in Nim
13:53:13FromDiscord<albassort> i haven't... heard of this
13:53:18FromDiscord<albassort> is there like a C macro
13:53:19FromDiscord<albassort> lol
13:53:31FromDiscord<Yardanico> In reply to @albassort "i haven't... heard of": he's talking about emit
13:53:37FromDiscord<Yardanico> which I assume is what you're already using
13:53:43FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-emit-pragma
13:53:55FromDiscord<albassort> no its all in its own file
13:53:58FromDiscord<albassort> importC
13:54:25FromDiscord<albassort> im doing it the same way i usually do python interop
13:59:05FromDiscord<scarf> sent a code paste, see https://play.nim-lang.org/#ix=4fNH
13:59:11FromDiscord<scarf> (edit) "https://play.nim-lang.org/#ix=4fNH" => "https://play.nim-lang.org/#ix=4fNI"
14:08:19FromDiscord<albassort> huh nim hcv
14:08:24FromDiscord<albassort> (edit) "hcv" => "has c"
14:08:25FromDiscord<albassort> (edit) "c" => "cv"
14:08:27*pro joined #nim
14:08:38FromDiscord<albassort> oh its a pywrapper
14:09:04NimEventerNew thread by linwaytin: Yet another c compiler (under development), see https://forum.nim-lang.org/t/9602
14:47:37FromDiscord<fwsgonzo> is there a way to avoid libnss on embedded and still get working HTTP client/server?
14:49:00FromDiscord<fwsgonzo> basically no getaddrinfo
15:05:43*carce joined #nim
15:09:59*carce quit (Ping timeout: 256 seconds)
15:11:13FromDiscord<@thatrandomperson5-6310e3b26da03> How would i go about making my own nodetree in nim. With my own node types but ways of walking through the tree and basic tree stuff.
15:12:40FromDiscord<auxym> sent a code paste, see https://play.nim-lang.org/#ix=4fNW
15:13:18FromDiscord<auxym> I'm sure you can figure out DFS/BFS from there
15:13:47FromDiscord<pietroppeter> ok, we have imported Google Analytics Data (since March 2014) in plausible! (no details on pages and sources is available for the google data) https://media.discordapp.net/attachments/371759389889003532/1041370296000708760/image.png
15:17:48*carce joined #nim
15:20:03FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4fNY
15:22:56FromDiscord<auxym> mm good point. indirection is needed for a recursive structure, but the seq might take care of that?
15:26:58FromDiscord<Rika> yes
15:35:09*carce quit (Remote host closed the connection)
15:35:41*carce joined #nim
15:39:22FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4fO6
15:40:01*carce quit (Ping timeout: 256 seconds)
15:40:46FromDiscord<Phil> I get that defer is try finally but like... this calls all of the following code and when that code ends/fails it calls `app.delete` ?
15:41:12FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4fO6" => "https://play.nim-lang.org/#ix=4fO7"
15:41:56FromDiscord<Phil> How many layers of try-finally can I go deep before things start becoming problematic I wonder
15:45:17FromDiscord<Rika> i dont understand your question
15:46:00FromDiscord<Phil> I think while asking the question I kinda realized the answer myself, now I'm wondering if too many defer statements are problematic
15:47:36FromDiscord<Rika> it could be
15:48:42FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4fOc
15:48:50FromDiscord<ringabout> (edit) "https://play.nim-lang.org/#ix=4fOc" => "https://play.nim-lang.org/#ix=4fOd"
15:54:51FromDiscord<ringabout> In reply to @Isofruit "I get that defer": `defer` is just transforming the code into `try-finally` pairs. When the program leaves its block (like procs); the final part will clean up the resource,.
16:01:31*carce joined #nim
16:02:26*carce quit (Read error: Connection reset by peer)
16:02:38*carce joined #nim
16:04:40*Guest1473 is now known as om3ga
16:07:46FromDiscord<.tochka> how can you check if some type is subrange one
16:12:07FromDiscord<Slazaa> sent a code paste, see https://play.nim-lang.org/#ix=4fOs
16:29:43FromDiscord<jmgomez> In reply to @Slazaa "Given a seq of": not sure if there something else but cast should work
16:29:52FromDiscord<jmgomez> (edit) "In reply to @Slazaa "Given a seq of": not sure if there ... something" added "is"
16:30:05FromDiscord<Slazaa> In reply to @jmgomez "not sure if there": So what do I need to change ?
16:30:40*jjido joined #nim
16:31:04FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4fOC
16:31:06FromDiscord<Phil> sent a code paste, see https://paste.rs/hqH
16:31:24FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4fOE" => "https://play.nim-lang.org/#ix=4fOD"
16:31:40FromDiscord<jmgomez> In reply to @Isofruit "Hmm you're running into": didnt know about of, this is better
16:32:08FromDiscord<Slazaa> Oh I can do filter too :o
16:32:10FromDiscord<Phil> `item of B` will be true if item is an instance of B and false if item is an instance of A.
16:33:05FromDiscord<Phil> However, if you want all base object (so all pure A's, not its children) you'll need to be slightly clever about it.โ†ต`item of A` will always be true for the selection above.โ†ตSo you'll have to check for `not item of B` if you want all pure A's
16:33:15FromDiscord<Yardanico> https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-labs is interesting
16:33:32FromDiscord<Yardanico> apparently like all other language models Copilot understands prompts, and this extension wraps some prompts into functions, or you can make custom prompts
16:34:10FromDiscord<Slazaa> Thank you :D
16:34:37FromDiscord<Slazaa> What's std/sugar though ?
16:35:21FromDiscord<Phil> In reply to @Slazaa "Thank you :D": Here the docs for it btw: https://nim-lang.org/docs/system.html#of%2CT%2Ctypedesc%5BS%5D
16:35:41FromDiscord<Phil> In reply to @Slazaa "What's std/sugar though ?": std/sugar is for allowing java/javascript style definition of procs
16:35:56FromDiscord<Slazaa> What would be the Nim way ?
16:36:17FromDiscord<Phil> So you can do `item => item of B` instead of `proc(item: A): bool = item of B`
16:36:29FromDiscord<Slazaa> I feel like Nim's doc is kinda hard to find
16:36:39FromDiscord<Phil> Generously use the search function
16:37:09FromDiscord<Rika> or be me and just read every module's docs wholly
16:37:13FromDiscord<Phil> But yeah, some things aren't immediately obviously (like std/sugar)
16:37:19FromDiscord<Phil> (edit) "obviously" => "obvious"
16:37:46FromDiscord<Slazaa> Maybe I fell into advanced stuff too quickly
16:38:15FromDiscord<Phil> In reply to @Slazaa "Maybe I fell into": You're just doing OO, advanced stuff is when you jump into templates and macros ๐Ÿ˜‰
16:38:52FromDiscord<Slazaa> That's true x)
16:39:20FromDiscord<Phil> On that note, you'll be amazed by how far just generics, templates and compile-time procs can get you
16:40:07FromDiscord<Slazaa> Maybe I should dive into metaprogramming someday
16:41:14FromDiscord<Phil> In reply to @Slazaa "Maybe I should dive": If you have a usecase I can recommend. I don't have one and that's kinda prevented me from mustering the motivation to jump into it
16:41:30FromDiscord<Phil> The stuff you can do with it is kinda insane though and can be very useful
16:41:44FromDiscord<Phil> Though I'd recommend first getting a solid grasp on the general stuff
16:41:57FromDiscord<Phil> (edit) "usecase" => "usecase," | "recommend." => "recommend learning it."
16:42:45FromDiscord<Slazaa> I've worked with C and Rust, and I've never found myself in trouble not using metaprogramming
16:43:56*def- quit (Quit: -)
16:44:07*def- joined #nim
16:44:58FromDiscord<Rika> well of course there isnt risk in not doing it
16:45:43FromDiscord<Slazaa> I meant having the need to use it x)
16:45:49FromDiscord<Phil> sent a long message, see http://ix.io/4fOK
16:46:27FromDiscord<Slazaa> :o
16:46:52FromDiscord<Phil> But it's the kind of thing where at least I would need to be able to use it before I start seeing where in my own stuff I could beneficially apply it
16:47:26*carce quit (Remote host closed the connection)
16:47:34FromDiscord<Phil> constructor is from beef, nimja from enthus1ast, nimqml from... I forgot the author, and jester from dom
16:47:58*carce joined #nim
16:48:23FromDiscord<Phil> Filippo Cucchetto and Will Szumski
16:48:30FromDiscord<Phil> (edit) "Filippo Cucchetto and Will Szumski ... " added "are the authors of nimqml"
16:48:46FromDiscord<Phil> Okay the fact that Filippo's name is the spanish equivalent of my own is kinda weird
16:52:33*carce quit (Ping timeout: 256 seconds)
16:53:20FromDiscord<Slazaa> Omg my first OpenGL triangle in Nim ! :D
16:53:21FromDiscord<Slazaa> Yay
17:05:49FromDiscord<deech> Is there a way to make a decrementing loop eg. for i in 10..<0: ...
17:05:57FromDiscord<Yardanico> `countdown`
17:06:07FromDiscord<Yardanico> https://nim-lang.org/docs/system.html#countdown.i%2CT%2CT%2CPositive
17:20:52FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4fOP
17:24:08*pro quit (Quit: pro)
17:28:47*arkurious joined #nim
17:36:58*carce joined #nim
18:22:57FromDiscord<aq47> In reply to @Isofruit "Syntax question: Anybody have": That `delete` probably should go into `QApplication`'s destructor
18:30:15Amun-Ralet's say I have array[8, byte]; I can check the type via varname.typedef is array; how can I check the array element type?
18:30:33Amun-Ragot it, varname[0].typeof
18:32:48FromDiscord<Horizon [She/Her]> What's a small thing I should make in Nim, i need a project but also want to actually complete it
18:34:44Amun-Rawrite someting you already wrote in a different language
18:35:27FromDiscord<Horizon [She/Her]> I don't have anything i could rewrite :p
18:35:48FromDiscord<Horizon [She/Her]> ADHD is too bad for trying to complete a project
18:46:56Amun-Ragoogle for project ideas for beginners
18:49:15FromDiscord<spoon> is `nim e` best for evaluating nimscript with `time`? tried comparing lua vs nims eval speed
18:50:35FromDiscord<spoon> and i mean are there no flags that will help performance like release flag
18:51:23Amun-Rais release flag for eval makes sense?
18:52:03FromDiscord<spoon> no not really, just wondering if it may work more favorably when using the vm alongside importing compiler/nimeval really
18:52:47FromDiscord<albassort> how do I like libraries when using {.compile: "".} + {.importc.}
18:52:47Amun-RaI haven't played nimscript much
18:52:55FromDiscord<albassort> (edit) "like" => "link"
18:53:26FromDiscord<spoon> made three tests comparing eval speed with time, each one made a for loop print "test <number>" 100 times, nimscript did it in 0.185s, lua did it in 0.004s and python did it in 0.019s
18:53:32FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4fP4
18:53:39FromDiscord<albassort> (which is what i use to compile it in gcc)
18:54:11Amun-Raalbassort: you have to pass that information to the linker (passl)
18:54:21FromDiscord<albassort> ah im braindead
18:54:57FromDiscord<spoon> so nim eval speed is 46x slower than lua and 9.7 times slower than python from my very unscientific test
18:55:39Amun-Rahow have you measured eval speed?
18:56:04Amun-Ratime measures startup + eval
18:56:10FromDiscord<spoon> i ran it with the `time` command on linux terminal
18:56:13FromDiscord<spoon> hm true
18:56:29FromDiscord<spoon> but also python and lua have to start up their own environments, right?
18:57:03Amun-Rayes
18:58:55FromDiscord<spoon> well there is a nim library that measures runtime without external programs, whatever it is. i could run it with that
18:59:47Amun-Rayou can print cpuTime() diff or sth like that
19:00:13Amun-Ralet start = cpuTime(); dostuff(); echo cpuTime() - start
19:01:26*carce quit (Remote host closed the connection)
19:01:59*carce joined #nim
19:02:06*carce quit (Remote host closed the connection)
19:02:38*carce joined #nim
19:02:42FromDiscord<spoon> well then i'd also have to look into lua and python equivalent functions
19:03:21*carce quit (Remote host closed the connection)
19:03:54*carce joined #nim
19:04:36Amun-Rahmm, maybe printing difference of seconds (as float) from the epoch?
19:04:43Amun-Rapython has time.time()
19:04:57Amun-Ranim has times.epochTime()
19:05:01*def- quit (Quit: -)
19:05:22*def- joined #nim
19:05:29Amun-Raand luaโ€ฆ no clue
19:06:16FromDiscord<spoon> also just realized running `lua filename` doesn't convert it to jit, so effective performance is probably higher
19:07:13Amun-RaI think python's version of cpuTime is time.process_time() and lua's is os.clock()
19:08:28*carce quit (Remote host closed the connection)
19:09:00*carce joined #nim
19:11:54Zevvperformance measuring in Lua is done with os.clock()
19:12:07Zevvthat's the total CPU time taken by the lua vm since started
19:12:24FromDiscord<emanresu3> Hi, do you know if there something like the \`\`\`once\`\`\` template, but executes only the last time the block is reached?
19:12:27Zevvthere is no high-res timer in lua by default, only epoch seconds
19:13:18Zevvemanresu3: interesting idea, but how should it know it is the running last time?
19:15:15FromDiscord<emanresu3> I wouldnt know, but I know the Raku language implemented it with the \`END\` block, and the \`BEGIN\` block is the analogous of \`once\` in Nim
19:15:36FromDiscord<emanresu3> Maybe with a macro?
19:16:13Amun-Rais that an equivalent of awk's BEGIN and END?
19:16:44Amun-Rahmm, I guess you could use defer:
19:17:54Amun-Rabut that wouldn't work in a different function scope
19:18:21FromDiscord<emanresu3> Oh, sorry, yeah, they are. Instead I was referring to the ENTER and LEAVE blocks in Rakuโ†ต(<@709044657232936960_=41mun-=52a=5b=49=52=43=5d>)
19:20:14FromDiscord<lfanew> Is there a way to, say using `when`, to conditionally remove debugging code if the file is being compiled with `-d:release`?
19:20:31FromDiscord<lfanew> Currently I'm just using some constants, i.e. `const debug = true` and setting that manually
19:21:28Amun-Rawhen not defined release:
19:22:17Amun-Rayou can also use custom defined variables, ie: const doThat {.booldefine.} = false
19:22:26Zevv`LAEVE` "Runs at every block exit time (even stack unwinds from exceptions), except when the program exits abruptly (e.g. with exit)."
19:22:42Amun-Racompile with -d=doThat to set that constant to true
19:23:15Amun-RaZevv: given that description LEAVE looks just like defer:
19:23:16Zevvemanresu3: https://nim-lang.org/docs/manual.html#exception-handling-defer-statement
19:23:31Zevvexactly
19:23:33FromDiscord<lfanew> Oh both of those will work perfectly. Thank you Amun-Ra
19:24:08Amun-Ralfanew: you can also have intdefine for ints and strdefine for strings
19:24:26Amun-Ra-d=intDefine=2 etc.
19:25:18Amun-Ralfanew: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compileminustime-define-pragmas
19:25:38FromDiscord<lfanew> Looking at those pragmas now too. The comptime options here are exactly what I needed
19:25:53Amun-Ralfanew: although if you just want to turn debugging code on/off checking release define is preferred
19:27:01FromDiscord<Phil> Aye, you want to check for -d:release instead of adding another flag that indicates if you compile debug builds or actual builds
19:27:32FromDiscord<Phil> -d:release should be the single source of truth for the question "am I compiling a releaseable binary?"
19:28:17FromDiscord<lfanew> I agree. There's no need to complicate that portion. The other pragmas though will give me some tuning though on some of the verbosity if the time comes I think
19:29:07FromDiscord<Phil> Given that you want to play around with compiler flags, how are you running those commands so far? Typing in yourself? vscode tasks? Or are you using nimble tasks / nim config ?
19:29:58FromDiscord<lfanew> I'm still very green to Nim. I'm typing them in currently/creating shell scripts
19:30:39FromDiscord<Phil> Ahh check, if you want I can give you a quick run down on how you can do the same in nimble and then instead of `bash compileScript.sh` you can do `nimble compile`or `nimble brewMyProject` or whatever you want to call it
19:30:52*krux02 joined #nim
19:31:00FromDiscord<Phil> though sadly nimble tasks do not tab autocomplete in the terminal, at least not for me v.v.
19:31:01FromDiscord<Phil> (edit) "v.v." => "v.v"
19:31:29FromDiscord<Phil> Though naturally that is something you can always keep for later
19:31:35FromDiscord<Phil> (edit) "keep for" => "learn"
19:31:45FromDiscord<lfanew> I'll definitely get to that point. Could I think of nimble as a system comparable to cargo for Rust?
19:31:56FromDiscord<Phil> Pretty much, it's a package manager
19:32:34FromDiscord<Phil> You install via `nimble install <package`, you find packages via `nimble search <search string>` and can do a whole lot more with custom defined tasks
19:32:42FromDiscord<Phil> (edit) "<package`," => "<package>`,"
19:34:11FromDiscord<Phil> There's also a ton more functionality which is documented on the nimble github page (from package publishing to doc generation to cooking you pancakes etc.)
19:34:51FromDiscord<lfanew> Okay that sounds really useful. I'll probably hold off just a few more days since I'm still really fresh and mostly trying to soak in the language still and learning all ways to work with the compiler
19:35:10FromDiscord<lfanew> Definitely on my list though because shell scripts and typing is not a fun task for long ๐Ÿ˜†
19:35:15FromDiscord<Phil> All good, we're not here all day, but typically always sometime during the day ๐Ÿ˜›
19:36:06FromDiscord<Phil> In reply to @lfanew "Definitely on my list": I can relate, my webapp-backend had like... 10 different bash scripts to build it in various ways until I figured out how to do the same thing with nimble
19:38:05FromDiscord<lfanew> I know the pain... lol
19:43:29*krux02 quit (Remote host closed the connection)
19:44:09*krux02 joined #nim
20:40:30FromDiscord<! Nilts> Im planning on installing nim on my main machine, how large is it, im very sensitive about things with large mem.
20:42:22FromDiscord<! Nilts> (edit) "machine," => "machine."
20:45:24FromDiscord<Generic> excluding temporary folders my Nim installation (build from git) is around 73 MB
20:45:40FromDiscord<Generic> though keep in mind that you'll also need a C compiler
20:45:51FromDiscord<Generic> if you haven't gotten one already
20:48:28FromDiscord<! Nilts> In reply to @Generic "though keep in mind": i have g++
20:49:19FromDiscord<Generic> ok then you're good to go
20:49:45FromDiscord<! Nilts> In reply to @Generic "excluding temporary folders my": thats alot, is there any way to make it smaller? It is not too much to install id just prefer a smaller version
20:51:52FromDiscord<Generic> well apparently half of what I measured are compiler sources
20:52:00FromDiscord<Generic> which you won't have with a binary installation
20:52:05FromDiscord<Generic> so I guess that's better
20:52:31FromDiscord<Generic> ah there're are still temporary binaries lurking around
20:52:33FromDiscord<Generic> in that folder
20:52:56FromDiscord<Generic> idk how they go there
20:52:59FromDiscord<! Nilts> well, ill try and see how much it takes
20:54:07FromDiscord<Phil> Are you sure you're talking about the same things?โ†ตNilts seemed to have asked about memory footprint and from what I gathered from you generic you talked about the size of files etc.
20:54:23FromDiscord<Phil> At least I'd interpret mem as memory footprint
20:54:29FromDiscord<Generic> oh
20:55:05FromDiscord<Generic> idk about memory usage of the compiler
20:55:15FromDiscord<Generic> but don't use nimsuggest if you care about ram usage hehe
20:55:27arkanoidis it possible to make a range type from a distinct float? I would like "type Percent = range[UnitLess(0)..UnitLess(100)]" where "type UnitLess = distinct float"
20:56:20FromDiscord<Phil> I'm not even sure how that would look conceptually. Like, how many members does that range have?
20:56:28arkanoidI'm getting Error: ordinal or float type expected
20:56:30FromDiscord<Phil> or rather is it supposed to have
20:57:12FromDiscord<Generic> In reply to @Isofruit "I'm not even sure": I mean technically floats are discrete haha
20:57:58arkanoidrange type works with float type, but not distinct float type. Maybe there's something I need to borrow?
20:57:59FromDiscord<Elegantbeef> It should be possible to make a subrange type of a distinct
20:58:02FromDiscord<Elegantbeef> I swear i bugfixed that
20:58:05FromDiscord<Phil> Yeh but that's the technical limitation of how far the float can resolve decimal numbers no?
20:58:33FromDiscord<Generic> yeah, though for a range type it shouldn't matter
20:59:02FromDiscord<Elegantbeef> I swore i fix this, shame
20:59:08FromDiscord<Generic> a range can also be defined for a continous value
20:59:18FromDiscord<Generic> yeah I actually remember that PR
20:59:52arkanoidI mean: https://play.nim-lang.org/#ix=4fPv
21:00:59arkanoidI'm receiving same error from all previous versions of nim
21:01:09*wallabra joined #nim
21:01:49FromDiscord<Generic> ah hm though
21:02:04FromDiscord<Generic> it kind of makes sense for the range of distinct float to be not defined
21:02:24FromDiscord<Generic> unless comparison operators for it are reintroduced
21:02:39FromDiscord<Elegantbeef> I fixed it for enums i know cause it was an error with httpresponses
21:02:39FromDiscord<Elegantbeef> So it still exists here
21:02:42arkanoidkinda of yes, that's why I asked if there's something I need to borrow
21:03:19arkanoidthe error is not something like "you need `<` and `==`"
21:03:56FromDiscord<Elegantbeef> No
21:04:08FromDiscord<Elegantbeef> The error is someone doesnt skip `tyDistinct`
21:04:26FromDiscord<Elegantbeef> I just made it compile right now by adding a single enum value
21:04:43FromDiscord<Generic> but conceptually it would make more sense if it would require < and == to be defined
21:04:45FromDiscord<Elegantbeef> semtypes.nim line 270 is the issue
21:04:49FromDiscord<Elegantbeef> It only skips static types
21:04:52FromDiscord<Generic> and then the range type would use those custom operators
21:04:53FromDiscord<Elegantbeef> Indeed
21:06:12FromDiscord<Elegantbeef> Jeez this error message from this change is funny `Error: conversion from MyDistinct to MyRange is invalid`
21:07:34*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
21:07:43arkanoidis it worth opening an issue?
21:07:48FromDiscord<Elegantbeef> Given one cannot define the comparison operators for this it seems a bit odd to support though
21:08:02arkanoidok
21:08:35FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fPz
21:08:40FromDiscord<Elegantbeef> Doesnt run for semi obvious reasons
21:08:53*wallabra joined #nim
21:09:06FromDiscord<Generic> ideally you should be eable to create ranges of any type which can be ordered
21:09:23FromDiscord<Elegantbeef> Eh Nim's range types are nice but have the wrong semantics
21:09:41FromDiscord<Generic> yeah I don't really use them for anything but enums either
21:11:02arkanoidI've faced this problem while working with a scientific library that deals with unit of measures. There's the UnitLess types that is a distinct float, and a distinct type that limits the range to 0.0..100.0 would make my code safer
21:11:04*wallabra quit (Client Quit)
21:12:16arkanoidI know that UnitLess type can be ordered, would be happy to borrow
21:15:08FromDiscord<! Nilts> I installed nim on windows given the instructions and it is in path yet when i run in cmd it says can't find nim
21:15:24FromDiscord<Elegantbeef> Personally i find this API better than the Nim range types https://play.nim-lang.org/#ix=4fPA
21:15:40FromDiscord<Elegantbeef> It doesnt cause an annoying hidden range defect
21:15:54FromDiscord<Elegantbeef> Ranges have to be converted to so there is no hidden logic you know when there can be a range defect
21:15:59FromDiscord<Elegantbeef> Did you restart windows?
21:16:04FromDiscord<Elegantbeef> I know window's path is funny
21:16:30FromDiscord<! Nilts> In reply to @Elegantbeef "Did you restart windows?": no...
21:17:14FromDiscord<Elegantbeef> Then there is the issue that Nim range types use the base types operators
21:17:27FromDiscord<Elegantbeef> So like `a + b` returns float instead of `MyDistinct` and it's unchecked
21:18:39*wallabra joined #nim
21:19:23FromDiscord<pietroppeter> In reply to @pietroppeter "Btw <@800432830605819906> I": @rlipsc here is the issue with polymorph not working with js backend https://github.com/rlipsc/polymorph/issues/21
21:22:39FromDiscord<! Nilts> In reply to @Elegantbeef "Did you restart windows?": works after restart
21:22:47FromDiscord<Elegantbeef> Blame winblows
21:23:09arkanoidElegantbeef, with "So like `a + b` returns float instead of `MyDistinct` and it's unchecked" are you still talking about Nim range types, or your witty implementation you've just shared?
21:23:36FromDiscord<Elegantbeef> Both cause i have a converter ๐Ÿ˜›
21:23:47*derpydoo quit (Ping timeout: 260 seconds)
21:25:55*carce quit (Remote host closed the connection)
21:26:27*carce joined #nim
21:26:37FromDiscord<Elegantbeef> There is still the issue that i'm using defects and defects are a great idea but are bad cause they're untracked
21:27:28arkanoidjust use RangeError! :P
21:27:40FromDiscord<Elegantbeef> No
21:27:44*carce quit (Remote host closed the connection)
21:27:46arkanoidit was a joke
21:27:53FromDiscord<Elegantbeef> I know
21:27:56*carce joined #nim
21:28:25FromDiscord<Elegantbeef> The issue with range defects is that the programmer doesnt know about them, so in reality i'd probably never actually have `toBase` for my range types
21:28:25arkanoidbtw, my brain is not powerful enough to follow here, I think too many Nim internals are tangled here. I need a brain upgrade, or possibly a coffee
21:28:34FromDiscord<pietroppeter> btw polymorph is at 99 stars, who wants to be #100? https://github.com/rlipsc/polymorph
21:28:51FromDiscord<Elegantbeef> Wait i have more stars on nimscripter than rlispc has on polymorph
21:29:02FromDiscord<Elegantbeef> That's unconscionable
21:29:20FromDiscord<Elegantbeef> Too bad i dont star repos
21:31:34FromDiscord<Elegantbeef> Nimscripter has 106 stars so you people need to click with more feeling
21:31:36arkanoidpietroppeter, only if compared with https://github.com/paranim/pararules !
21:31:56FromDiscord<Elegantbeef> I mean they're two different systems
21:32:07arkanoidwhat's the use case for Nimscripter?
21:32:31FromDiscord<Elegantbeef> Embeding nimscript in a program and crying about the NimVm's speed
21:32:52arkanoidECS and rule-based shares a lot, the first is much newer than the second
21:33:09FromDiscord<Elegantbeef> It was mostly just done cause i liked Pmunch's idea of using NimVm for configuration and the like
21:33:26FromDiscord<Elegantbeef> But now i'm a wasm fan, so shucks ๐Ÿ˜„
21:33:40arkanoidok, but why I want to embed nimscript and it's VM in a nim program? Is it more convenient than lua/python/whatever?
21:33:44FromDiscord<pietroppeter> In reply to @Elegantbeef "Too bad i dont": well at some point you did ๐Ÿ˜› https://github.com/beef331?tab=stars
21:33:53FromDiscord<Elegantbeef> Yea it is
21:34:25*fallback quit (Ping timeout: 260 seconds)
21:34:43FromDiscord<Elegantbeef> Meh i use stars for bookmarks more than anything
21:35:10arkanoidcould you make me an example why NimVM is more convenient than other made-for-runtime scripting languages?
21:35:15FromDiscord<pietroppeter> yeah yeah fair enough just busting b... stars....
21:35:26FromDiscord<albassort> i have a pointer to an array of integers in C
21:35:34FromDiscord<albassort> how do i case it in C
21:35:45FromDiscord<albassort> How do i cast it in Nim
21:35:52FromDiscord<Elegantbeef> Nimscript is Nim, so you can export all your code to the backend and use it the same as you'd use there
21:35:57FromDiscord<alice.> so when is nim going to actually let me define duplicate items in `case` ADT type syntax
21:36:01FromDiscord<Elegantbeef> https://github.com/beef331/nimscripter#getting-global-variables-from-nimscript
21:36:16FromDiscord<alice.> kinda insane this isnt a feature yet every other FP language has it
21:36:20FromDiscord<Elegantbeef> `cast[T](y)`
21:36:24FromDiscord<Elegantbeef> Nim isnt a FP language
21:36:26FromDiscord<albassort> i tried ptr seq[cint] but im getting nothing
21:36:41FromDiscord<Elegantbeef> You cannot cast a pointer to a sequence
21:36:46FromDiscord<alice.> sure but its unions cant be that shit that u need to tag every item
21:36:49FromDiscord<albassort> hmmmmmm
21:36:54FromDiscord<albassort> then what do i use for this function
21:36:59FromDiscord<alice.> (edit) "shit" => "bad"
21:37:12FromDiscord<alice.> this is the one feature stopping it from being my favorite language
21:37:36FromDiscord<albassort> if you want it to be a feature
21:37:41FromDiscord<albassort> you can probably macro your way into i t
21:37:48FromDiscord<albassort> macros are pretty neat
21:38:23FromDiscord<Elegantbeef> Declaring duplicate items in branches is a complexity on the unpacking end
21:38:24FromDiscord<Elegantbeef> Especially if you have a complex union
21:38:24FromDiscord<Elegantbeef> Or if you allow them to have different types
21:38:25FromDiscord<Elegantbeef> `cast[ptr UncheckedArray[int])(myPtrInt)`?
21:38:40FromDiscord<auxym> In reply to @albassort "**How do i cast": `cast[ptr UncheckedArray[SomeType]](yourPointer)
21:38:45FromDiscord<Generic> I'm still not sure how that would even be implemented
21:38:48FromDiscord<Elegantbeef> Well there is an RFC and it's planned to be implemented
21:38:54FromDiscord<auxym> also consider `toOpenArray`
21:39:05FromDiscord<Generic> either there would be separate unions for those shared fields
21:39:05FromDiscord<Elegantbeef> Araq's rfc seems to indicate reusing the case
21:39:10FromDiscord<alice.> In reply to @Generic "I'm still not sure": every FP language does it
21:39:27arkanoidElegantbeef, I'm wrapping my head around this, and I start to see where I would apply NimVM in my projects. Next natural question is: why wasm would compete in same arena?
21:39:35FromDiscord<Generic> In reply to @alice. "every FP language does": yes, but they work differently than Nim
21:39:39FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fPH
21:39:46FromDiscord<Generic> I'm talking about the internal representation
21:39:53FromDiscord<Elegantbeef> Cause wasm is an embedable VM that is language agnostic
21:39:58FromDiscord<alice.> the nim source code is really confusing
21:40:03FromDiscord<Elegantbeef> Yea i started writing the message before that was clear
21:40:05FromDiscord<Generic> with FP language you pretty much always unpack the whole case object
21:40:14FromDiscord<alice.> then do that?
21:40:33Amun-Raand as for me: wasm can handle 64-bit uints and js doesn't
21:40:38FromDiscord<Elegantbeef> PR's welcome\ ๐Ÿ˜„
21:40:48FromDiscord<Elegantbeef> Amun we're talking about embedding wasm
21:40:53FromDiscord<Elegantbeef> So like embeding JS is doable it's dumb
21:40:55FromDiscord<Generic> In reply to @alice. "then do that?": that would require disallowing something which is currently allowed in Nim
21:41:11FromDiscord<Generic> which is that you can access individual members of case objects
21:41:22FromDiscord<Generic> like normal members
21:41:35FromDiscord<alice.> then disallow it
21:41:39FromDiscord<Elegantbeef> It also makes the checks on objects more costly ๐Ÿ˜„
21:41:45FromDiscord<alice.> if it means case objects can be actually good
21:41:51FromDiscord<alice.> not some win32 prefix level bs
21:41:54FromDiscord<Generic> it would break tons of code
21:42:06arkanoidI think I need a good read about wasm and how it can be used. I only know wasm as "faster JS but not always" to replace frontend.js
21:42:17FromDiscord<Generic> and also would just not fit idiomatically with Nim
21:42:25FromDiscord<Generic> there are ways around it
21:42:27FromDiscord<Elegantbeef> Wasm has embeddable runtimes just like other scripting languages
21:42:32FromDiscord<Elegantbeef> So it's a fantastic idea to use it for scripting
21:42:42FromDiscord<albassort> /``
21:42:59FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4fPJ
21:43:24FromDiscord<Elegantbeef> Look at this module https://github.com/beef331/wasm3/blob/master/wasmsources/maths.nim i load it here and call the procedures https://github.com/beef331/wasm3/blob/master/tests/test1.nim#L82-L87
21:44:09FromDiscord<alice.> sent a code paste, see https://play.nim-lang.org/#ix=4fPK
21:44:22FromDiscord<Elegantbeef> I mean you're making your AST complex and slow
21:44:25FromDiscord<Elegantbeef> ๐Ÿ˜„
21:44:25FromDiscord<Generic> I know what the issue is, I don't like it either
21:44:28FromDiscord<alice.> (edit) "https://play.nim-lang.org/#ix=4fPK" => "https://play.nim-lang.org/#ix=4fPL"
21:44:39FromDiscord<alice.> yeah its stopping me from liking this language
21:44:48FromDiscord<alice.> everythign else is pretty modern
21:44:52FromDiscord<alice.> this screams 1990s windows
21:45:22arkanoidElegantbeef ok but for *scripting* you usually mean something human readable and hackable out of the box, like a py or lua file. If you drop a "compile to wasm" step in the middle, isn't it the same of compiling myscript.dll, reload it at runtime, execute it?
21:45:32FromDiscord<Generic> I mean if you're coming from fp you can just make the members of the case branches tuples
21:45:36FromDiscord<Elegantbeef> Wasm is sandboxed
21:45:39FromDiscord<Elegantbeef> It's vastly more safe
21:45:43FromDiscord<Generic> and then you always pack and unpack those
21:45:48FromDiscord<alice.> In reply to @Generic "I mean if you're": isnt that less efficient
21:45:57FromDiscord<alice.> for a giant AST
21:46:23FromDiscord<! Nilts> Is there anything in nim like eval or exec in python?
21:46:23FromDiscord<Generic> if you're putting giant value types in there yes
21:46:24arkanoidElegantbeef, that's a very good point. Gamechanger actually. Yeah
21:46:28FromDiscord<alice.> rust did ADTs good
21:46:28FromDiscord<Generic> otherwise no
21:46:36arkanoidthanks
21:47:18FromDiscord<Generic> though what I wanted to say the whole time is that the issue is that every struct member has to have a fixed memory offset
21:47:25FromDiscord<Elegantbeef> Aslong as you dont use a JIT'd wasm runtime that is
21:47:28FromDiscord<Generic> if you have a case object like this:
21:47:43FromDiscord<Elegantbeef> Making a giant AST object variant is a bad idea for memory allocations and likely speed ๐Ÿ˜„
21:48:04FromDiscord<Generic> sent a code paste, see https://play.nim-lang.org/#ix=4fPM
21:48:32FromDiscord<Generic> what is `offsetof(someValueofX, x)`?
21:48:42FromDiscord<alice.> sent a code paste, see https://paste.rs/nyF
21:48:46FromDiscord<alice.> if rust can do it
21:48:48FromDiscord<alice.> nim can
21:48:50FromDiscord<alice.> no excuses
21:48:54FromDiscord<Generic> yes, because you always unpack it
21:49:00FromDiscord<Generic> I've said this before
21:49:01FromDiscord<alice.> then do that too
21:49:12FromDiscord<Generic> no, because it would break the language
21:49:17FromDiscord<alice.> seems weird that they would pick the worse way
21:49:26FromDiscord<! Nilts> In reply to @not logged in "Is there anything in": like execute a chuck of nim and get the result. Like `eval("1+2")` would result in the int 3
21:49:30FromDiscord<alice.> why would u ever inspect an element that may not be there??
21:49:56FromDiscord<alice.> without first unpacking
21:50:25FromDiscord<Generic> e.g. if you're calling a function which assumes that the case objects are of a certain kind
21:52:13FromDiscord<auxym> In reply to @not logged in "like execute a chuck": the reason you can do that in python or js is that they are interpreted. Nim is compiled ahead of time, so no, you can't do that. Unless you include a parser/interpreter in your program, which is possible (nimscripter)
21:52:51FromDiscord<alice.> also what is up w/ the hungarian notation for enums?
21:52:59FromDiscord<alice.> we ditched that with C++
21:53:06FromDiscord<! Nilts> In reply to @auxym "the reason you can": i kinda got that, just making sure.
21:53:28FromDiscord<Generic> In reply to @alice. "also what is up": it's not hungarian notation
21:53:40FromDiscord<Generic> it's just a short form prefix identifying the type
21:53:49FromDiscord<Generic> it's getting phased out though with overloadable enums
21:54:32FromDiscord<Generic> and imho it's was better than always having to type out the full typename with EnumName.enumValue
21:55:09FromDiscord<Elegantbeef> You're likely to make a much larger object than you need which will make allocations slower and slow down smaller object branches
21:55:17FromDiscord<Elegantbeef> Anyway arkanoid I am mostly looking at wasm for game plugins so it's much safer for distributing wasm files, they're also language/platform agnostic so one written and compiled on a linux machine runs everywhere the VM does
21:55:17FromDiscord<Elegantbeef> System libraries are both platform specific and suspect as all hell
21:55:18FromDiscord<Elegantbeef> Anyway alice https://github.com/nim-lang/RFCs/issues/368
21:55:51FromDiscord<Elegantbeef> Offset of `x` is an error ๐Ÿ˜›
21:56:01FromDiscord<alice.> the accepted proposal is shit
21:56:07FromDiscord<alice.> i cant just recreate the rust example using that
21:56:08FromDiscord<alice.> because
21:56:33FromDiscord<Elegantbeef> Matrix had a stroke, i'm back bitches!
21:56:43FromDiscord<auxym> In reply to @alice. "also what is up": v2 will have OverloadableEnums, which eliminates the need to the "hungarian" stuff. Personally I just use pure enums (almost) everywhere
21:56:43FromDiscord<alice.> sent a code paste, see https://play.nim-lang.org/#ix=4fPS
21:57:06FromDiscord<alice.> sent a code paste, see https://play.nim-lang.org/#ix=4fPU
21:57:11FromDiscord<Generic> In reply to @Elegantbeef "Offset of `x` is": how so, it would make sense
21:57:23FromDiscord<Generic> ah I see the accepted RFC makes sense
21:57:27FromDiscord<alice.> anyway its a gripe
21:57:33FromDiscord<alice.> its just annoying when the rest of the language is modern
21:57:42FromDiscord<Elegantbeef> It requires runtime logic to figure out the offset as such there isnt a way to figure it out statically and isnt `offsetOf` static
21:57:50FromDiscord<Generic> no it doesn't
21:57:53FromDiscord<alice.> and its enums are basically C enums w/ "syntax sugar"
21:57:57FromDiscord<Generic> that's the whole beauty of it
21:58:04FromDiscord<Generic> each case is a different tagged union
21:58:17FromDiscord<Generic> I see now
21:58:56FromDiscord<alice.> sent a code paste, see https://play.nim-lang.org/#ix=4fPX
21:59:07FromDiscord<alice.> under the hood
21:59:18FromDiscord<Generic> no
21:59:22FromDiscord<Elegantbeef> I like that you call them `enum NimEnum`
21:59:27FromDiscord<Generic> it's a union type
21:59:35FromDiscord<Elegantbeef> Each branch is a Union
21:59:38FromDiscord<Generic> that's the issue, they share memory
21:59:53FromDiscord<Generic> In reply to @Elegantbeef "Each branch is a": no it's a union of structs this way around
22:00:06FromDiscord<alice.> In reply to @Elegantbeef "I like that you": i was giving an example
22:00:11FromDiscord<alice.> of how its probably structured
22:00:19FromDiscord<alice.> seeing as it allows u to directly access members
22:00:29FromDiscord<alice.> it wouldnt be a enum of pointers to structs
22:00:31FromDiscord<Elegantbeef> I'd say that's each branch is a union but i'll say i'm wrong
22:00:59FromDiscord<Generic> in the generated C code there's one union per case and each case branch is a struct within that union
22:01:19FromDiscord<Elegantbeef> \I still say that's
22:01:25FromDiscord<Elegantbeef> each branch is a union\ ๐Ÿ˜›
22:01:40FromDiscord<alice.> sent a code paste, see https://play.nim-lang.org/#ix=4fQ0
22:01:44arkanoidElegantbeef, yes I see the picture now. Wasm is the answer to many problems: performance, security, obfuscation, compactness
22:01:48FromDiscord<alice.> ofc in a union
22:02:05FromDiscord<alice.> (edit) "https://play.nim-lang.org/#ix=4fQ0" => "https://paste.rs/Y4j"
22:02:30FromDiscord<alice.> so i think nim enums would need to be significantly changed to fix this
22:02:42FromDiscord<Generic> Nim enums are completely fine
22:02:48FromDiscord<Generic> and in memory the Nim version (where the different idents have different prefixes) and the Rust version have the exact same representation
22:02:50FromDiscord<alice.> theyre not
22:02:55FromDiscord<alice.> they suck for my use cases
22:03:04FromDiscord<alice.> im not gonna prefix variable names like a caveman
22:03:08FromDiscord<Generic> overloadable enums
22:03:13FromDiscord<alice.> i mean
22:03:16FromDiscord<Generic> I've said it before
22:03:16FromDiscord<alice.> the `case of`
22:03:22FromDiscord<alice.> overloadable enums wont fix that
22:03:25FromDiscord<Generic> yes say tagged enums or variant objects
22:03:27FromDiscord<Elegantbeef> Generic they mean like `bVal` and `strVal`
22:03:29FromDiscord<Generic> if you mean those
22:03:33FromDiscord<Generic> not enums
22:03:35FromDiscord<alice.> sent a code paste, see https://play.nim-lang.org/#ix=4fQ1
22:03:40FromDiscord<alice.> In reply to @Elegantbeef "Generic they mean like": yeah this
22:03:44FromDiscord<Generic> use the right term
22:03:45FromDiscord<alice.> ADTs then
22:03:54FromDiscord<Elegantbeef> ADTs mean so much
22:04:00FromDiscord<alice.> when i mean enums i mean rust style enums
22:04:01FromDiscord<alice.> or ADTs
22:04:06FromDiscord<alice.> whatever they are called
22:04:53FromDiscord<Generic> well you could probably write a macro which would allow you to do things like in Rust
22:05:07FromDiscord<Generic> where you could share names across branches
22:05:16FromDiscord<Generic> but you would loose the ability to just freely access fields
22:05:19FromDiscord<.tochka> In reply to @alice. "and its enums are": never knew C enums are sum types, pretty cool pretty cool :D
22:06:38FromDiscord<alice.> i mean
22:06:41FromDiscord<alice.> theyre just unions
22:06:52FromDiscord<.tochka> In reply to @alice. "rust enums (would look": thats invalid C ;p
22:06:54FromDiscord<Elegantbeef> You used `enum` instead of `struct`
22:07:05FromDiscord<alice.> In reply to @.tochka "thats invalid C ;p": is it?
22:07:05FromDiscord<Elegantbeef> Cause rust enums rot the brain
22:07:14FromDiscord<Generic> to be fair, Java did it first
22:07:17FromDiscord<alice.> rust enums are nice :(
22:07:22FromDiscord<alice.> granted enum is a bad name for them
22:07:43FromDiscord<Elegantbeef> Rust doesnt even have enum indexed arrays it's literally unusable
22:07:58FromDiscord<Generic> ^
22:08:15FromDiscord<Elegantbeef> It also doesnt have bitsets
22:08:20FromDiscord<Elegantbeef> It's a language made as a toy!
22:08:22FromDiscord<Elegantbeef> ๐Ÿ˜›
22:08:40FromDiscord<Generic> strong ordinal support ftw
22:08:52FromDiscord<alice.> In reply to @Elegantbeef "Rust doesnt even have": TIL
22:09:07FromDiscord<alice.> what are ur thoughts on D?
22:09:19FromDiscord<Elegantbeef> It's C++ but slightly less cursed
22:09:19FromDiscord<Generic> it's ok I guess
22:09:30FromDiscord<Generic> to me it feels a bit like too little, too late
22:09:36FromDiscord<.tochka> sent a code paste, see https://play.nim-lang.org/#ix=4fQ4
22:10:10FromDiscord<Elegantbeef> All that pointer indirection is not good for your health
22:10:43arkanoidhaha
22:10:52FromDiscord<Elegantbeef> It stack allocates though right? ๐Ÿ˜„
22:11:50FromDiscord<.tochka> In reply to @Elegantbeef "It also doesnt have": rust be like: use external crate, we like our std smol
22:12:03FromDiscord<Elegantbeef> The crate doesnt even work though
22:12:18FromDiscord<alice.> sent a code paste, see https://play.nim-lang.org/#ix=4fQ5
22:12:18FromDiscord<Elegantbeef> You cannot use it on arbitrary enums
22:12:40FromDiscord<Generic> well we'll just pretend you wrote C++
22:12:42FromDiscord<Generic> then it's ok
22:12:43FromDiscord<.tochka> nim bad cos no pattern matching builtin
22:13:03FromDiscord<alice.> i wonder if nim could let u pattern match on objects and then have the ability to have duplicate members too
22:13:15FromDiscord<alice.> or some mix
22:13:33FromDiscord<alice.> maybe have `case` for traditional, and `match` where it matches the whole object?
22:13:37FromDiscord<.tochka> duplicate members?
22:13:53FromDiscord<alice.> sent a code paste, see https://play.nim-lang.org/#ix=4fQ6
22:13:56FromDiscord<Elegantbeef> Object variants with repeated names
22:13:59FromDiscord<alice.> yep
22:14:04FromDiscord<.tochka> ahh
22:14:07FromDiscord<Elegantbeef> Runtime checks get fucking funky there
22:14:24*jmdaemon joined #nim
22:14:55FromDiscord<.tochka> it should be able if you match for variant, so, names are local to particular variant then
22:15:06FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fQ7
22:15:56FromDiscord<.tochka> lol
22:16:56FromDiscord<Elegantbeef> Say what you will but atleast with OOP it's less complex for field access ๐Ÿ˜„
22:20:23FromDiscord<Generic> well if you force unpacking, it's relatively simple again
22:20:53FromDiscord<Generic> also alice, I've just noticed there's a much more often and practical advantage to Nim's design of tagged unions
22:21:13FromDiscord<Elegantbeef> You can have nested complex trees is my one major benefit
22:21:19FromDiscord<Elegantbeef> Without having to make 3 different types
22:23:38FromDiscord<Generic> sent a code paste, see https://play.nim-lang.org/#ix=4fQa
22:26:14FromDiscord<.tochka> kind gets sanity checked on access of field?
22:26:40FromDiscord<Generic> yes
22:26:57FromDiscord<.tochka> rust with its forcing of unpacking to get access kinda makes it more secure, at least semantically
22:29:00FromDiscord<Elegantbeef> Nim can have definitive reasoning, just not implemented
22:29:39FromDiscord<Generic> it would eliminate the first advantage of the advantages of it's case objects I mentioned
22:29:47FromDiscord<Generic> but the second one would still remain
22:30:06FromDiscord<Elegantbeef> The first being?
22:30:45FromDiscord<Generic> that you could for example have a function which gets case objects passed and it assumes that they have a certain type
22:30:55FromDiscord<Generic> well now that I'm thinking about it, you could also just add an assertion
22:31:01FromDiscord<Generic> and if the analysis is good enough
22:31:22FromDiscord<Elegantbeef> Yep
22:31:53FromDiscord<Elegantbeef> Value/range narrowing is something I'd like to see
22:32:00FromDiscord<Generic> yeah me to
22:32:02FromDiscord<Elegantbeef> I dont know if it has a proper name, but meh
22:32:10FromDiscord<Generic> I even made the RFC for that
22:32:32FromDiscord<Generic> https://github.com/nim-lang/RFCs/issues/429
22:32:45FromDiscord<Elegantbeef> Oh right i commented on that
22:32:55FromDiscord<Elegantbeef> I forgot which duck wrote that ๐Ÿ˜„
22:33:26FromDiscord<Generic> ducks are cool
22:33:34FromDiscord<Generic> I don't blame anyone else for have a duck username as well
22:42:06*carce quit (Remote host closed the connection)
22:42:39*carce joined #nim
22:47:17*carce quit (Ping timeout: 256 seconds)
22:53:23*adium quit (Ping timeout: 252 seconds)
23:34:58*fallback joined #nim
23:38:37*krux02 quit (Remote host closed the connection)
23:49:01*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzzโ€ฆ)
23:57:53*dnh joined #nim