<< 23-01-2024 >>

00:05:34*_________ quit (Ping timeout: 268 seconds)
00:07:14*_________ joined #nim
00:16:40*LuxuryMode_ joined #nim
00:18:55*azimut quit (Ping timeout: 240 seconds)
00:30:22*azimut joined #nim
00:34:31FromDiscord<piman_discriminator_1010> In reply to @Elegantbeef "You can also use": what's wrong with named tuples?
00:35:16FromDiscord<Elegantbeef> They're not distinctly typed and are structurally typed so offer very little type safety
00:36:02FromDiscord<piman_discriminator_1010> hmm, you mean named tuples in general are bad?
00:36:40FromDiscord<Elegantbeef> In the place of any serious type yes
00:36:49FromDiscord<Elegantbeef> As a return type or temporary type they're mostly fine
00:37:14FromDiscord<Elegantbeef> As a return type you generally unpack them directly off the hop
00:38:24FromDiscord<Elegantbeef> It's only my view but if you write any procedure that operates on a specific tuple with fields you're too far gone 😄
01:20:07FromDiscord<piman_discriminator_1010> what does this mean? https://media.discordapp.net/attachments/371759389889003532/1199161606538526780/image.png?ex=65c18946&is=65af1446&hm=68c7db6a0e2cd7117afa9206e5bcd2ffab478ee4a3f5b913389363e3a28ada95&
01:20:50FromDiscord<piman_discriminator_1010> sent a code paste, see https://play.nim-lang.org/#pasty=dJJjkuTjAkeo
01:20:55FromDiscord<Elegantbeef> Yes
01:20:59FromDiscord<piman_discriminator_1010> :sopFeicREEEEEEE:
01:21:23FromDiscord<Elegantbeef> It is a weird limitation, but enums are supposed to be ordinal
01:22:07FromDiscord<piman_discriminator_1010> but enums are the only native types that treat numbers as strings :mood:
01:22:13FromDiscord<piman_discriminator_1010> (edit) "but enums are the only native types ... that" added "(afaik)"
01:22:22FromDiscord<Elegantbeef> They don't treat numbers as strings
01:22:33FromDiscord<piman_discriminator_1010> like `echo Foo` prints `Foo` not `1`
01:22:54FromDiscord<Elegantbeef> Right cause it's a distinctly typed Ordinal
01:24:34FromDiscord<piman_discriminator_1010> so either I make a type that takes a string and an int, prints the string and implicitly converts to and from int, or I have to save state in my C program and sort the enums before emitting them :mood:
01:25:01FromDiscord<Elegantbeef> Thirdly you can stop whatever thing you're doing that requires 5000000000 enums
01:25:40FromDiscord<piman_discriminator_1010> In reply to @Elegantbeef "Thirdly you can stop": sadly that's not really an option if I want to keep my sanity
01:27:33*azimut quit (Remote host closed the connection)
01:28:00*azimut joined #nim
01:29:02FromDiscord<piman_discriminator_1010> can I make cyclic imports?
01:29:14FromDiscord<Elegantbeef> Yesn't
01:29:27FromDiscord<Elegantbeef> Well I'm still lost what you're trying to used that needs this many enums
01:29:34FromDiscord<piman_discriminator_1010> file A defines a type↵file B defines instances of the type↵file A uses instances in file B
01:30:04FromDiscord<piman_discriminator_1010> In reply to @Elegantbeef "Well I'm still lost": reading a file that uses them (in nmeric form only)
01:30:05FromDiscord<Elegantbeef> https://github.com/beef331/nimtrest/wiki/Code-snippets#delayed-imports
01:34:12FromDiscord<Elegantbeef> Why do you need the enum values then?
01:34:30FromDiscord<Elegantbeef> Doesn't a runtime table suffice to convert them to strings for whatever you need
01:35:32FromDiscord<piman_discriminator_1010> In reply to @Elegantbeef "Doesn't a runtime table": that works for integer to string, but now interacting with that file through keys which are enums would require magic numbers
01:35:36FromDiscord<Elegantbeef> I just do not see a world with 50000 enums where they do not just care about a subset of them
01:35:59FromDiscord<piman_discriminator_1010> In reply to @Elegantbeef "I just do not": I don't know what subsets I need or not
01:38:07FromDiscord<Elegantbeef> Yea i'll live in ignorance
01:45:04*SchweinDeBurg joined #nim
02:09:10FromDiscord<piman_discriminator_1010> In reply to @piman_discriminator_1010 "I don't know what": I mean, I supposed I could sift through all 1700 enum sets and filter out ones I for sure won't need like chiller error codes, but that's kind of a lot of manual labor
02:09:39FromDiscord<piman_discriminator_1010> (edit) "1700" => "1773"
02:17:56*rockcavera quit (Read error: Connection reset by peer)
02:20:00*rockcavera joined #nim
02:20:00*rockcavera quit (Changing host)
02:20:00*rockcavera joined #nim
02:26:05*LuxuryMode_ quit (Quit: Connection closed for inactivity)
02:27:29*rockcavera quit (Read error: Connection reset by peer)
02:30:30*rockcavera joined #nim
02:30:30*rockcavera quit (Changing host)
02:30:30*rockcavera joined #nim
02:31:39*rockcavera quit (Remote host closed the connection)
02:39:48*krux02 quit (Remote host closed the connection)
02:53:12*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
03:25:08FromDiscord<piman_discriminator_1010> rip, apparently nim stores line numbers in uin16
03:25:16FromDiscord<piman_discriminator_1010> (edit) "in" => "as"
03:27:05*xet7 joined #nim
03:32:00FromDiscord<Elegantbeef> Any well written program never hits that 😄
03:32:17FromDiscord<Elegantbeef> It's bindings for things that do, I know the panda3D bindings hit that
04:05:23*rockcavera joined #nim
04:08:42FromDiscord<slymilano> sent a code paste, see https://play.nim-lang.org/#pasty=OYcXJYHZFlIc
04:11:12FromDiscord<slymilano> fmt works 😄
04:11:16FromDiscord<jaar23> How can I run nim script at runtime?↵Let's say running it like java script `eval()`
04:11:18FromDiscord<slymilano> `fmt """`
04:11:23FromDiscord<slymilano> (edit) "`fmt """`" => "`fmt"""`"
04:17:23FromDiscord<Elegantbeef> There is no direct equivlent
04:17:37FromDiscord<Elegantbeef> You can use the nimvm relatively easy through nimscripter
04:17:40FromDiscord<Elegantbeef> But Nim is compiled
04:25:46FromDiscord<jaar23> Nimscripter seems like able to read nimscript from string.↵Will try it out
04:35:32*rockcavera quit (Remote host closed the connection)
04:39:24*SchweinDeBurg joined #nim
04:47:04FromDiscord<slymilano> does Nim have a map with index function or similar?
04:47:42FromDiscord<arathanis> In reply to @slymilano "does Nim have a": `std/tables`?
04:50:20FromDiscord<slymilano> what function are you referring to? i can't find a map function of sorts there
04:50:58FromDiscord<Elegantbeef> They thought you meant a map type with indexing procedures
04:51:13FromDiscord<Elegantbeef> `std/sequtils` has maps
04:51:51FromDiscord<slymilano> yes I found this https://nim-lang.org/docs/sequtils.html#map%2CopenArray%5BT%5D%2Cproc%28T%29 - but i can't find a way to get the index with it as well. i guess I can use a regular for loop?
04:51:54FromDiscord<Elegantbeef> `myStuff.pairs.mapIt(...)` will give you map with pairs
04:52:03FromDiscord<slymilano> oh nice let me find that
04:52:17FromDiscord<Elegantbeef> Wait nvm you need that pesky `toSeq` so a for loop is just better
04:52:45FromDiscord<slymilano> yeah sounds good
04:52:45FromDiscord<slymilano> ty
04:52:54FromDiscord<arathanis> Oh you want to map over a seq but also get indexes?
05:03:40FromDiscord<ichigo> lookin' at futhark rn
05:04:12FromDiscord<ichigo> was thinking about trying to bind to C++ libraries using nim's cpp backend, but it seems like it's still necessary to write all the header wrappers yourself
05:05:18FromDiscord<Elegantbeef> Futhark presently does not have C++ support, so to save pmunch the words "PRs welcome" 😄
05:06:10FromDiscord<ichigo> yup - I'm still learning nim tho
05:07:14FromDiscord<ichigo> might just use the old fltk wrapper for now? Just trying to smash together a gui
05:08:33FromDiscord<slymilano> `for page, text in text_pages.pairs:` the pairs iterator was the ticket.
05:08:35FromDiscord<slymilano> gnarly
05:08:53FromDiscord<Elegantbeef> You do not technically need `pairs` but it's good form for generics 😄
05:09:17FromDiscord<Elegantbeef> pairs is implicitly invoked for `for x, y in z`
05:09:47FromDiscord<slymilano> great good to know that trick
05:10:41FromDiscord<ichigo> lua flashbacks
05:11:10FromDiscord<arathanis> In reply to @ichigo "lua flashbacks": You will be happy to know that Nim is 0 indexed :)
05:11:35FromDiscord<slymilano> bruh
05:11:42FromDiscord<Elegantbeef> Only if you want it to
05:11:49FromDiscord<Elegantbeef> `array[1..10, int]` enters the chat
05:12:02FromDiscord<arathanis> Yeah but you are being explicit.
05:12:19FromDiscord<Elegantbeef> I didn't even swear
05:12:30FromDiscord<ichigo> tbh I have no problems with indices starting at 1
05:12:57FromDiscord<ichigo> it makes more sense anyways, it's just not convenient for programming
05:13:06FromDiscord<slymilano> my new nim project is shaping up nicely. i enjoy working with nim even though elixir is my primary workhorse. https://github.com/sergiotapia/kryten
05:13:07FromDiscord<ichigo> where offsets are more convenient
05:13:30FromDiscord<Elegantbeef> I appreciate the name
05:13:34FromDiscord<ichigo> the `1`st element is `0` away from the base pointer
05:13:59FromDiscord<slymilano> krytes is the best
05:14:19FromDiscord<slymilano> https://tenor.com/view/boys-from-the-dwarf-red-gif-20745613
05:14:35FromDiscord<ichigo> (edit) "the `1`st element is ... `0`" added "offset" | removed "away"
05:14:49FromDiscord<Elegantbeef> Something about the grassy knoll
05:17:17FromDiscord<Elegantbeef> What's this chatpgt that's required? 😄
05:38:45FromDiscord<ichigo> I think indices starting at one made my life easier when I was writing a simple ray tracer in lua actually
05:39:17FromDiscord<ichigo> otherwise I would've had to offset everything by 1 anyway.
05:39:52FromDiscord<ichigo> (I forget exactly why, but it almost certainly had to do with multiplying/dividing by 0 being a bad thing for the first column of pixels)
05:39:59FromDiscord<ichigo> (edit) "tracer" => "caster"
05:40:09FromDiscord<ichigo> (edit) "I think indices starting at one made my life easier when I was writing a simple ... ray" added "doom-style"
05:41:22NimEventerNew thread by aiac: How to define a zero capacity HashSet with let ?, see https://forum.nim-lang.org/t/10902
05:47:02FromDiscord<nilesh_finding_wisdom> Can Nim be used for Data Analysis or Data Engineering?
05:56:54FromDiscord<nnsee> In reply to @nilesh_finding_wisdom "Can Nim be used": yes.
05:57:13FromDiscord<nilesh_finding_wisdom> Can you share any relevant documentation?
05:57:29FromDiscord<nilesh_finding_wisdom> Or an Article and blog?
06:10:33NimEventerNew thread by aiac: Undeclared identifier: 'HashSet' error occured in macro , see https://forum.nim-lang.org/t/10903
06:49:09FromDiscord<ichigo> `..\..\nimcache\opir_r\@mopir.nim.c(11): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory` well that's not good
06:49:20FromDiscord<ichigo> why is it even trying to open `unistd.h`
06:49:38FromDiscord<ichigo> this is msvc
06:50:30FromDiscord<ichigo> oh man opir imports posix
06:50:40FromDiscord<ichigo> does futhark just straight up not work on windows
06:52:52FromDiscord<Robyn [She/Her]> In reply to @ichigo "does futhark just straight": No idea, but one solution is to probably run futhark on Linux and then use the generated futhark wrapper on Windows
06:55:45FromDiscord<ichigo> worth a shot, however some of the libraries I'm interested are absolutely riddled with compiler-dependent macros so who knows what'll happen
06:55:52FromDiscord<ichigo> gotta love proprietary game engine libs
06:56:16FromDiscord<ichigo> (why I'm using msvc instead of llvm or gcc on windows anyways)
06:56:36FromDiscord<ichigo> (I tried, but the libraries absolutely explode when trying to compile with anything other than msvc)
07:03:19FromDiscord<nnsee> In reply to @nilesh_finding_wisdom "Can you share any": what do you want to know about? data analysis is quite a broad term. what sort of data are you analyzing?
07:03:30FromDiscord<nnsee> also see #science channel
07:09:30FromDiscord<Robyn [She/Her]> In reply to @ichigo "(why I'm using msvc": Aah, unfortunate
07:36:35*advesperacit joined #nim
07:41:43*azimut quit (Ping timeout: 240 seconds)
08:29:46FromDiscord<khazakar> In reply to @nilesh_finding_wisdom "Can you share any": Standard library math libs, arraymancer, nim pandas equivalent
08:29:56FromDiscord<khazakar> (edit) "In reply to @nilesh_finding_wisdom "Can you share any": Standard library math libs, arraymancer, nim pandas equivalent ... " added "and other libs"
09:07:31FromDiscord<arnetheduck> sent a long message, see https://paste.rs/MXUNh
10:59:04NimEventerNew thread by aiac: How to genernate ast from a input string?, see https://forum.nim-lang.org/t/10904
11:11:49*jmdaemon quit (Ping timeout: 264 seconds)
11:18:13NimEventerNew thread by aiac: How to use parseExpr in runtime ?, see https://forum.nim-lang.org/t/10905
12:28:17*PMunch joined #nim
13:06:44advesperacitanyone seen this nimble error before? https://paste.ee/r/dHv2J
13:26:56PMunchWhat does your Nimble file look like?
13:27:14PMunchIt could be a Nimble error, but it could also be an error from your Nimble script
13:34:40NimEventerNew thread by aiac: Howt to embed NimNode in template?, see https://forum.nim-lang.org/t/10906
13:40:02*mirari joined #nim
13:48:50*mirari quit (Quit: WeeChat 4.1.1)
14:09:18*antranigv quit (Quit: ZNC 1.8.2 - https://znc.in)
14:26:33*antranigv joined #nim
14:57:22FromDiscord<luteva> sent a code paste, see https://paste.rs/21TAY
15:05:42advesperacit@pmunch I think an earlier adventure with nimph must have done some damage to something nimble related on the host
15:13:47FromDiscord<mratsim> In reply to @luteva "Hi! I have a": use genericParams from std/typetraits https://nim-lang.org/docs/typetraits.html#genericParams.t%2Ctypedesc
15:14:28FromDiscord<luteva> In reply to @mratsim "use genericParams from std/typetraits": thx! I'll have a look at that!
15:14:29FromDiscord<mratsim> or `get`
15:14:39FromDiscord<luteva> get?
15:14:40FromDiscord<mratsim> tuple have a special `get` + intex
15:15:04FromDiscord<mratsim> In reply to @luteva "get?": https://media.discordapp.net/attachments/371759389889003532/1199371729152245831/image.png?ex=65c24cf7&is=65afd7f7&hm=165a7354ff2d77c741c00bca2c084b0d6ec848ee912f437800fad598bf5ce266&
15:40:18arkanoidpasty.ee seems to return error 500 to play.nim-lang.org
15:42:53arkanoidI've just spotted a compiler issue valid for 2.0.2, 2.0.0, 1.6.14 and possibly previous versions
15:46:56FromDiscord<Arkanoid> An alternative to play.nim-lang.org to share nim code? it seems not working today
15:49:33FromDiscord<Arkanoid> sent a code paste, see https://paste.rs/B0WoL
15:52:44*azimut joined #nim
16:03:37*madprops_ joined #nim
16:08:36*xet7 quit (Ping timeout: 264 seconds)
16:08:37*madprops quit (Ping timeout: 264 seconds)
16:09:00*xet7 joined #nim
16:37:07NimEventerNew thread by aiac: Macro pragma: param's default value not support?, see https://forum.nim-lang.org/t/10907
17:04:27*rockcavera joined #nim
17:24:28*jmdaemon joined #nim
17:33:13FromDiscord<nnsee> In reply to @arkanoid "pasty.ee seems to return": on it
17:35:03*rockcavera quit (Remote host closed the connection)
17:40:01*rockcavera joined #nim
19:05:20*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
19:15:40*LuxuryMode_ joined #nim
19:28:17*krux02 joined #nim
19:30:33FromDiscord<nnsee> In reply to @Arkanoid "An alternative to play.nim-lang.org": sorry for the delay, it's back up again
19:31:04FromDiscord<nnsee> postgres once again somehow stopped listening on the docker interface
19:33:32FromDiscord<nnsee> i've made it listen on 0.0.0.0 now, so it shouldn't error out in the future
19:41:38NimEventerNew Nimble package! templater - HTML Template Engine, see https://github.com/Wraith29/templater
20:17:51FromDiscord<nervecenter> In reply to @NimEventer "New Nimble package! templater": Can the author command on intended features and semantics for this? Currently using Nimja in production.
20:17:57FromDiscord<nervecenter> (edit) "command" => "comment"
20:18:05FromDiscord<nervecenter> (edit) "this?" => "this package?"
20:20:49FromDiscord<user2m> In reply to @NimEventer "New Nimble package! templater": I always respect / look forward to new pkgs, but man I hate that handle bar syntax. Very fitting for a lang like python, but this form of templating doesn't take advantage of nim's DSL capabilities
20:24:06FromDiscord<Robyn [She/Her]> Could someone explain why concepts aren't interfaces? :p
20:24:22FromDiscord<Robyn [She/Her]> Beef, if you could explain why interfaces ain't concepts, that'd be cool
20:24:28FromDiscord<Robyn [She/Her]> Because I forgot again
20:31:39FromDiscord<Phil> Because interfaces (at least in java) can't ensure that you have specific fields
20:31:45FromDiscord<Phil> Concepts can
20:32:05FromDiscord<Phil> Or rather they can ensure you have something that can be called as a field
20:32:11FromDiscord<Phil> (edit) "called" => "called/treated"
20:36:09FromDiscord<Robyn [She/Her]> Huh, really?
20:36:15FromDiscord<Robyn [She/Her]> I thought it couldn't do that
20:36:17FromDiscord<Robyn [She/Her]> But fun
20:36:26FromDiscord<Robyn [She/Her]> Any reason why I can't treat it as a concept?
20:40:05*SchweinDeBurg joined #nim
20:49:16FromDiscord<Phil> In reply to @chronos.vitaqua "Any reason why I": Could you rephrase that question? The way that is written currently makes no sense to me 😅
20:51:09FromDiscord<Robyn [She/Her]> Ah-
20:51:13FromDiscord<Robyn [She/Her]> As an interface
20:55:01FromDiscord<Phil> Expand upon that, what do you mean by "treat as an interface" ?
20:55:24FromDiscord<Robyn [She/Her]> It's a pretty vague thing :p
20:55:49FromDiscord<Robyn [She/Her]> Just that some people, like Araq, just say it isn't meant to be a replacement for interfaces
20:56:07FromDiscord<Arkanoid> In reply to @nnsee "postgres once again somehow": thanks! I though it was maintained by @PMunch
20:56:36FromDiscord<Phil> In reply to @chronos.vitaqua "Just that some people,": It's kind of its own thing in a sense. It fulfills many of the same tasks but also is more than that
20:56:45FromDiscord<Phil> You can kind of regard it as an interface for generics
20:57:21FromDiscord<Phil> In the sense that a generic has its own interface that defines its requirements to the thing it uses.↵It is not needed for the other thing to explicitly "implement" that interface, it just needs to have the capacility provable at compile-time
20:58:11FromDiscord<Phil> In that sense it is different from interfaces since you don't have some kind of mechanism that forces you to explicitly implement X for your type, not unless you use a generic with a concept that forces you to.
20:58:39FromDiscord<Phil> Concepts are also more powerful than interfaces in the amount of arbitrary things they can validate at compile-time, interfaces are far more limited there
20:59:12FromDiscord<Phil> So the statement of "it's not a replacement for interfaces" makes sense to me - you can not use them in the same way, they just remotely are in the same problem domain
21:02:25FromDiscord<Robyn [She/Her]> Fair
21:17:23FromDiscord<nnsee> In reply to @Arkanoid "thanks! I though it": the playground is maintained by him, pasty is maintained by me
21:20:19FromDiscord<Arkanoid> @nnsee oh! I though it was a third party service. Very cool. Thanks for that
21:24:35*LuxuryMode_ quit (Quit: Connection closed for inactivity)
21:30:12NimEventerNew thread by DMisener: Subclassed Iterator dispatch question, see https://forum.nim-lang.org/t/10909
21:47:05*rockcavera quit (Remote host closed the connection)
21:53:06FromDiscord<Elegantbeef> @Robyn [She/Her] Nim's concepts offer no ability to do runtime dispatch they're strictly compile time constraints
22:01:02*xet7_ joined #nim
22:03:49*xet7 quit (Ping timeout: 246 seconds)
22:38:31FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "<@524288464422830095> Nim's concepts offer": Ah okay that makes sense
22:39:33FromDiscord<Robyn [She/Her]> So a better way to describe them is generic constraints
22:40:38FromDiscord<Elegantbeef> That is all they are really
22:40:53FromDiscord<Elegantbeef> They're non existential types that allow users to define the shape of the type to match
22:42:19FromDiscord<Elegantbeef> They also allow you to express things that interfaces in Go, C#, Java,.... just do not allow https://github.com/beef331/traitor/blob/master/traitor.nim#L14-L24
22:54:21*oisota quit (Quit: Ping timeout (120 seconds))
22:54:40*oisota joined #nim
22:55:15*def- quit (Quit: -)
22:55:29*def- joined #nim
22:57:01*advesperacit quit ()
23:35:14FromDiscord<piman_discriminator_1010> huh? what is nimsuggest? https://media.discordapp.net/attachments/371759389889003532/1199497601171599360/image.png?ex=65c2c231&is=65b04d31&hm=b6a757d4697758cfe40eff3954ec775f120623f65242c00c8975c9f2892f8c5b&
23:39:20FromDiscord<Elegantbeef> Nim tooling
23:39:26FromDiscord<Elegantbeef> a 5mb .nim file
23:39:30FromDiscord<Elegantbeef> Jeeesus