<< 04-07-2023 >>

00:01:08FromDiscord<voidwalker> Would nim be too hard to modify to accept curlies ? It looks like there's a ton of coders out there that refuse to touch it solely on this argument
00:01:37FromDiscord<Elegantbeef> It used to support both, but one style was chosen
00:01:55FromDiscord<Elegantbeef> Python is one of the most popular languages and doesnt use curlies, so it's hardly a point
00:02:03FromDiscord<Elegantbeef> The isssue is the language, the tooling, and the leader
00:02:22FromDiscord<voidwalker> I've learned our leader uses a mac, and windows mainly :\
00:02:38FromDiscord<Elegantbeef> I don't know if i'd say "our" leader
00:02:59FromDiscord<voidwalker> And sells expensive poor quality books instead of selling t-shirts and mugs
00:05:54FromDiscord<voidwalker> And hasn't been in #main for 9 months now :\ He's not a good king
00:06:14FromDiscord<Elegantbeef> I mean he is in #internals
00:06:33FromDiscord<voidwalker> that's the inner court. He should say hi to the commoners every once in a while
00:12:05systemdsuckssomeone who knows i'm learning nim sent me today a link to a forum thread where araq was pissed for the master/slave idiocy
00:12:35systemdsucksi like him better now, no need for hat waving from the throne
00:12:44FromDiscord<Elegantbeef> Ugh
00:16:32FromDiscord<voidwalker> he should try more to be a pre-cancelling Linus Torvalds
00:16:43FromDiscord<Elegantbeef> He really shouldnt
00:17:21FromDiscord<Elegantbeef> Linus atleast had tact, he's just an grumpy man screaming at clouds. All it does is detract people from using Nim
00:18:04FromDiscord<Elegantbeef> For each person that's like "Yea he called out the idiocy of the change from master to main" it detracts more cause he didnt even answer the question of "what happens if something happens"
00:23:22FromDiscord<spotlightkid> If you're publishing open source software you're bound to encounter entitled idiots. So you you better have a strategy to cope with this. And I agree that yelling at people or the heavens probably isn't the best one. 😉 IMHO it would be more fruitful to surround yourself with people, who keep those idiots away from you. But that would require people-skills too. 😁
00:23:44FromDiscord<Elegantbeef> I mean there wasnt even an entitled idiot in this conversation
00:24:00FromDiscord<Elegantbeef> Someone was interested in if there were any plans in the event something happened
00:24:07FromDiscord<spotlightkid> Thatswhy the yelling at the heavens.
00:24:46FromDiscord<voidwalker> something = Araq gets hit by a bus
00:25:00FromDiscord<Elegantbeef> The worst part is just the inane point brought up about lexicon changing
00:25:15FromDiscord<Elegantbeef> Oh noes master changed to main my world is ending
00:25:42FromDiscord<Elegantbeef> Like the fuck, I disagree that there was need to change it but I'm not sitting in the corner screaming about a clownworld if someone asks me what's my plan for lunch
00:28:01FromDiscord<spotlightkid> You're probably having (a) beef with someone, right?
00:28:41FromDiscord<Elegantbeef> Huh?
00:28:42FromDiscord<spotlightkid> For lunch
00:28:46FromDiscord<Elegantbeef> Ah
00:28:54FromDiscord<Elegantbeef> Woosh me there
00:29:19FromDiscord<spotlightkid> Sorry, I had two glashes of wine
00:29:36FromDiscord<voidwalker> oh lol, I was unaware of this bs, `GitHub renamed the master branch to main for any Git repository, as it addresses cultural change like so many organizations `
00:29:52FromDiscord<voidwalker> so this is why someone pointed out that I have my code in a `master` branch maybe
00:30:45FromDiscord<Elegantbeef> I always like the response that it's so crazy that lexicon changes
00:31:01FromDiscord<Elegantbeef> "Oh noes politics in my language... how new"
00:31:33FromDiscord<Elegantbeef> Meanwhile we stopped calling people with disabilities 'moron' or 'retard' and nothing of importance was lost
00:32:12FromDiscord<voidwalker> I didn't
00:32:43FromDiscord<michaelb.eth> I compromised and shortened my usage to "tard"
00:32:47FromDiscord<voidwalker> I guess I didn't get that newsletter
00:33:05FromDiscord<spotlightkid> While it's moot to complain about the fact that language changes, imho it is still valid to argue about the pace of and motivation for its change.
00:33:43FromDiscord<spotlightkid> Also, English isn't the only language in the world.
00:33:45FromDiscord<Elegantbeef> Language is an ever moving dynamic societal construct that does not ask permission to change
00:33:47FromDiscord<voidwalker> Well that's the thing, who are "they" to say it has changed. We are on a branch that hasn't commited those changes. Language should be democratic as well
00:34:11FromDiscord<michaelb.eth> > Language should be democratic as well↵but beware the mob
00:34:13FromDiscord<spotlightkid> So, before I have to name my branches "main", I will call them "meister" ;-)
00:34:53FromDiscord<Elegantbeef> Ah yes let's democratically define language when even the UK cannot determine what a roll of toilet paper is called
00:35:03FromDiscord<Elegantbeef> jordies call it bog roll, afterall
00:35:28FromDiscord<spotlightkid> isn't it "geordie"? \:)
00:35:42FromDiscord<Elegantbeef> Probably
00:36:14FromDiscord<Elegantbeef> Don't think I've ever seen it written out
00:37:01FromDiscord<spotlightkid> We call them latitudinal challenged persons now.
00:38:02FromDiscord<Elegantbeef> One could listen to carlin's take on soft language now
00:40:17FromDiscord<spotlightkid> who's carlin?
00:40:37FromDiscord<Elegantbeef> george carlin
00:44:39FromDiscord<spotlightkid> I must admit, I never heard of him (I'm from Germany and in my youth America was still a lot further away). I'll make a not of samplin his performces on YT
00:46:16FromDiscord<spotlightkid> Bleeping on TV or radio still isnÄt very common here.
00:48:52FromDiscord<Elegantbeef> This is more #offtopic but either way the US is funny
01:34:40FromDiscord<michaelb.eth> US is a powder keg, not quite ready to blow, but it could get there
01:35:02FromDiscord<michaelb.eth> but anyway, like you say, it's more of an offtopic discussion
01:38:37FromDiscord<voidwalker> can you construct a `const` seq, table etc by calling a function that adds elements to it ?
01:38:55FromDiscord<voidwalker> (edit) "function" => "proc"
01:38:57FromDiscord<Elegantbeef> Nope
01:39:17FromDiscord<Elegantbeef> You can just call a proc that returns it
01:39:18FromDiscord<voidwalker> trying to rewrite this js bit: https://github.com/webtorrent/bittorrent-peerid/blob/51a3f0d52a138ab67c1df34694ad4aa4d1ba0d92/index.js#L248
01:39:39FromDiscord<Elegantbeef> Make a proc that returns a tuple and unpack it
01:39:48FromDiscord<voidwalker> `addAzStyle('A~', 'Ares', VER_AZ_THREE_DIGITS`
01:40:15FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zHk
01:41:27FromDiscord<Elegantbeef> `const (tableA, tableB) = procThatReturnsBoth()`
01:43:17FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zHl
01:43:39FromDiscord<voidwalker> anonymous proc ?
01:43:49FromDiscord<Elegantbeef> yes
01:58:00NimEventerNew thread by alexeypetrushin: Suggestion to improve proc type infer, and some complains, see https://forum.nim-lang.org/t/10320
03:03:38*flouer quit (Ping timeout: 260 seconds)
04:07:54NimEventerNew thread by alexeypetrushin: Borrow pragma with multiple args?, see https://forum.nim-lang.org/t/10321
05:12:44*fallback quit (Ping timeout: 240 seconds)
06:14:08*fallback joined #nim
06:43:37*ovenpasta joined #nim
06:45:12*PMunch_ is now known as PMunch
06:48:35*ntat joined #nim
07:31:23*PMunch_ joined #nim
07:34:07*PMunch quit (Ping timeout: 250 seconds)
07:35:35*PMunch_ is now known as PMunch
07:36:12PMunchHmm, never thought about this, but short circuiting for `and` also works for combining a bool in a variable..
08:48:18*azimut quit (Ping timeout: 240 seconds)
08:59:08*ovenpasta quit (Ping timeout: 240 seconds)
09:00:20*ovenpasta joined #nim
10:17:09*flouer joined #nim
10:45:01FromDiscord<jeancareau> sent a code paste, see https://play.nim-lang.org/#ix=4zIP
10:45:22FromDiscord<jeancareau> (edit)
10:56:48*via quit (Server closed connection)
10:56:55*via joined #nim
10:57:23FromDiscord<System64 ~ Flandre Scarlet> Is it possible to do multithreaded compilation?
11:04:25FromDiscord<odexine> In reply to @jeancareau "I have this proc": nim cannot use openssl 3 right now iirc
11:04:26FromDiscord<odexine> use 1.1
11:04:58FromDiscord<odexine> In reply to @sys64 "Is it possible to": the current structure of the compiler does not allow for it iirc, or at least it would not benefit speed, i believe
11:05:13FromDiscord<System64 ~ Flandre Scarlet> Ah alright
11:05:45FromDiscord<System64 ~ Flandre Scarlet> The big problem with the compiler is it recompiles everything even for a small change
11:06:55FromDiscord<jeancareau> In reply to @odexine "nim cannot use openssl": Ah, thank you. I will try that.
11:10:10FromDiscord<odexine> In reply to @sys64 "The big problem with": IC is being worked on
11:14:26*kenran joined #nim
11:27:54FromDiscord<jeancareau> In reply to @jeancareau "I have this proc": The problem still persists, even with openssl 1.1. When I do not use newProxy it works, even with openssl 3.1
11:28:28FromDiscord<jeancareau> In reply to @odexine "nim cannot use openssl": Maybe the problem is with the proxy?
11:42:28*flouer quit (Ping timeout: 240 seconds)
11:42:32FromDiscord<odexine> is the error different with openssl1 .1
11:45:08*fallback quit (Ping timeout: 240 seconds)
11:50:59FromDiscord<jeancareau> In reply to @odexine "is the error different": The error is the same
12:11:23PMunchHuh, this is pretty cool: https://github.com/openpeeps/bro
12:25:50*fallback joined #nim
12:26:23FromDiscord<jeancareau> In reply to @odexine "is the error different": Now it works. The problem was that I did not prepend "http:" infront of the ip address
12:26:38FromDiscord<jeancareau> http://
12:36:42*oprypin quit (Quit: Bye)
12:37:04*oprypin joined #nim
12:54:08NimEventerNew question by amateur: Execution time of recursive Fibonacci function is slower in C than equivalent Nim and Pascal code, see https://stackoverflow.com/questions/76611371/execution-time-of-recursive-fibonacci-function-is-slower-in-c-than-equivalent-ni
13:26:02FromDiscord<mratsim> In reply to @sys64 "The big problem with": It recompiles the file changed and possible dependencies if there are generics
13:26:36FromDiscord<mratsim> The Nim compiler will indeed redo a pass over, but the C compiler won't need to recompile if nothing was changed.
13:39:29*kenran quit (Remote host closed the connection)
14:00:16FromDiscord<System64 ~ Flandre Scarlet> In reply to @mratsim "The Nim compiler will": Oh alright↵But why does it take so long when I do a very small change?
14:02:55FromDiscord<xrfez> sent a code paste, see https://paste.rs/3hqbd
14:12:18FromDiscord<mratsim> In reply to @sys64 "Oh alright But why": Bribe Nim with cookies
14:12:57FromDiscord<mratsim> I don't know but if you can run perf and create an issue with the bottleneck and how to rpeproduce that might help
14:16:06*PMunch quit (Quit: Leaving)
14:29:34NimEventerNew thread by phoenix27: Recursive Fibonacci function, see https://forum.nim-lang.org/t/10322
14:29:51FromDiscord<System64 ~ Flandre Scarlet> Is there a progress bar window library?
14:30:53FromDiscord<vindaar> well, but keep in mind that the Nim compiler only accepts these cookies↵(@mratsim)
14:31:10FromDiscord<vindaar> 2023-07-04\_16-29.png https://media.discordapp.net/attachments/371759389889003532/1125795946077372446/2023-07-04_16-29.png
14:31:20FromDiscord<System64 ~ Flandre Scarlet> Oh
14:31:36FromDiscord<System64 ~ Flandre Scarlet> I don't have those↵Is it possible to give it internet cookies?
14:33:08FromDiscord<vindaar> do your internet cookies have a crown?
14:33:41FromDiscord<System64 ~ Flandre Scarlet> Oh, I got it! lol
14:45:24*ox is now known as oz
15:05:48*NimBot quit (Server closed connection)
15:06:00*NimBot joined #nim
15:23:41*flouer joined #nim
16:45:40*azimut joined #nim
16:47:55NimEventerNew thread by mantielero: Linking, see https://forum.nim-lang.org/t/10323
19:01:18arkanoidIntel released a DSL and compiler for device modeling that compiles down to C source with simulator api calls. https://community.intel.com/t5/Blogs/Products-and-Solutions/Software/Opening-up-the-Device-Modeling-Language/post/1417739
19:36:17FromDiscord<JJ> @Phil i suppose you can think of adts/or types being an extra level of abstraction. so to mutate an `Option[Fruit[Banana, Pear, Apple]]` (fake syntax) you would have to match upon the Option, then the Fruit
19:36:38FromDiscord<JJ> adts/or types aren't really monads though because you don't map across them
19:36:59FromDiscord<Phil> adts = abstract data types
19:37:02FromDiscord<Phil> (edit) "adts = abstract data types ... " added "?"
19:45:47FromDiscord<Elegantbeef> I swear JJ uses "adt" just to troll me 😄
19:48:59FromDiscord<JJ> In reply to @isofruit "adts = abstract data": bluh no never mind algebraic data types
19:49:57FromDiscord<Phil> Right, those things where you basically stack transformation functions on top of them until you have what you need an execute that lazily as needed
19:50:21FromDiscord<JJ> no i don't believe so
19:50:52FromDiscord<JJ> that would be a (lazy) monad
19:51:47FromDiscord<odexine> In reply to @isofruit "Right, those things where": Oh hey you do get what a monad is
19:51:51FromDiscord<JJ> algebraic data types are variant objects without the restriction of the variants being structs. and with better syntax and forced pattern matching surrounding them for safety
19:52:05FromDiscord<elegantbeef> No they're not JJ
19:52:05FromDiscord<Elegantbeef> ADT is just a general term for most data types in reality, a tuple is an ADT
19:52:09FromDiscord<elegantbeef> Ah there it is
19:54:02FromDiscord<JJ> why must there be two terms referred to by "ADT" 😭
19:54:04FromDiscord<Elegantbeef> structs(nim objects) and tuples are by definition product types, and object variants/rust style enums are sumtypes
19:55:12FromDiscord<Elegantbeef> There's only the 1 term it's just people co-opted it for the rust enums
19:56:14FromDiscord<JJ> oh interesting
19:56:46FromDiscord<elegantbeef> Man the bridge is so slow today
19:56:57FromDiscord<jmgomez> yeah, they are types that you can algebraically operate on them as their name implies. Also inheritance is a "product operation"
19:57:00FromDiscord<elegantbeef> Anyway if you think about what the name ADT means it's talking about operations creating types
19:57:11FromDiscord<elegantbeef> hence "algebraic"
19:57:25FromDiscord<JJ> oh wow i have never seen haskell structs
19:57:36FromDiscord<JJ> funky
19:58:35FromDiscord<Phil> In reply to @odexine "Oh hey you do": Wait that's a monad?
19:59:30FromDiscord<odexine> Well
19:59:43FromDiscord<elegantbeef> Really when you talk about ADTs JJ you're talking about a high level wrapping over tagged unions and that's it
20:00:12FromDiscord<Phil> Just got to the part of the talk where they talk about monads and basically just list 3 criteria:↵1) A function that combines 2 types spits out the same type as a result↵2) Combining more than 2 instances of those types in any order delivers the same result↵3) There is an element that if you apply the function to it, the result will just be the other value you put in (Identity Element)
20:00:22FromDiscord<odexine> Not really I guess, it’s perhaps too loose to say
20:00:24FromDiscord<Phil> And if that's a Monad I get the side-effect thing even less
20:00:29FromDiscord<elegantbeef> Nim's object variants are just a low level abstraction slightly higher than C's
20:00:37FromDiscord<odexine> See my wall of text in #offtopic
20:00:58FromDiscord<JJ> In reply to @elegantbeef "Really when you talk": yeah i pretty much just want better sum types
20:01:09FromDiscord<odexine> You can say that IO/state monads are a kind of railroad (if talking in terms of railroad programming)
20:01:17FromDiscord<elegantbeef> Rust's 'enum'(god I hate that name) are even higher than Nim's where each branch is an existentential type(see fungus using distinct to represent branches)
20:01:32FromDiscord<odexine> Well, no, more of all monads are a certain kind of railroad
20:01:48FromDiscord<JJ> til algebraic data types encompasses product types too. i got some wires crossed and thought "abstract data types" described the both, which, no
20:02:02FromDiscord<elegantbeef> Personally I really like metagn's proposal
20:02:09FromDiscord<elegantbeef> It's the most existential solution demonstrated
20:02:31FromDiscord<elegantbeef> https://github.com/nim-lang/RFCs/issues/527 this one for context
20:03:00FromDiscord<JJ> In reply to @isofruit "Just got to the": this is Correct but a very category-theory way of describing it fwiw. you don't care about the identity function when programming
20:04:02FromDiscord<arkanoid> PMunch (Peter Munch-Ellingsen)\: would you please explain me what is the logic behind skipping generating procs when "inlined" is true? https://github.com/PMunch/futhark/blob/5a9eb595cc62c9d0530fae802ae0f5dac2606c9e/src/futhark.nim#L459
20:04:20FromDiscord<JJ> yeah i've read through it a couple of times. i really should put down my thoughts in a comment there
20:04:23FromDiscord<JJ> i like it a lot too
20:04:27FromDiscord<elegantbeef> If a proc is inlined it's not in a dll at the very least
20:04:36FromDiscord<elegantbeef> It's much more clear about type injection which is very nice
20:04:45FromDiscord<elegantbeef> Fungus has an issue of "where do these types come from"
20:05:22FromDiscord<elegantbeef> given that futhark is for static and dynamic libraries I atleast imagine that's the reason he skips inlined
20:05:50FromDiscord<elegantbeef> Though I've fixed a lot of the tooling issues around fungus and types go to the correct line it's still not a homogenous type declaration
20:06:00FromDiscord<JJ> i also didn't know how to deal with enums not being inspectable and entirely ignored it in my initial proposal but since we have separate enums it's kinda fine tbh
20:07:27FromDiscord<elegantbeef> "enums not being inspectable"?
20:08:44FromDiscord<JJ> yeah the associated underlying enum of a sum type isn't accessible with either of our current proposals
20:09:02FromDiscord<JJ> s enum tag
20:09:10FromDiscord<arkanoid> @elegantbeef\: I do understand that inlined proc disappears in assembly, what futhark does is generatic a wappers, and a wrapper should contain importc for inlined functions. If not, why not?
20:09:37FromDiscord<elegantbeef> It should have a flag to enable it, it's just an oversight
20:09:47FromDiscord<elegantbeef> for dynamic libraries you do not want `inlined` to appear
20:10:00FromDiscord<elegantbeef> Or if you do get `inlined` you need it ported to Nim
20:11:06FromDiscord<elegantbeef> Hmph good point JJ, I don't see a nice way to inject a name either
20:16:00FromDiscord<arkanoid> @elegantbeef\: given the fact that futhark generates wrappers starting from a list of .h files, how does dynamic libraries come into play here?
20:16:32FromDiscord<Elegantbeef> Hmm seems matrix is fine now. Say you're wrapping a `.h` file for a dynamic library, you do not want an `inline` proc to be there cause it's not callable at runtime
20:17:01FromDiscord<Elegantbeef> futhark allows you to wrap source, static, and dynamic libraries
20:17:22FromDiscord<Elegantbeef> Only in the first two(one?) does it make sense to have inline procs exposed
20:17:51*dza quit (Remote host closed the connection)
20:20:28*dza joined #nim
20:26:10FromDiscord<arkanoid> this does not apply if the inline function is static and declared in .h
20:26:28FromDiscord<arkanoid> I mean defined in the .h
20:26:49FromDiscord<Elegantbeef> Right it has to be converted to Nim
20:41:30FromDiscord<JeysonFlores> What is the usability of custom effects (tags)? Only provide contextual information about your abstraction (proc)?
20:47:28FromDiscord<arkanoid> @JeysonFlores\: they can be used to colorize your procs, and then control from higher layers if nested calls are allowed to use or not such colors
20:53:27FromDiscord<JeysonFlores> @arknoid thanks!
20:53:41FromDiscord<JeysonFlores> (edit) "@arknoid" => "@Arkanoid "
21:16:18*systemdsucks quit (Server closed connection)
21:16:27*systemdsucks joined #nim
21:50:29*ntat quit (Quit: Leaving)
21:56:48*NimEventer quit (Server closed connection)
21:57:00*NimEventer joined #nim
22:14:28FromDiscord<jmgomez> In reply to @isofruit "Just got to the": you are roughly defining a monoid phil. You can see them also as "foldables". There is a relation between monads and monoids
22:15:38FromDiscord<jmgomez> but it's famous last words "Monads are monoids in the category of endofunctors" 😛
22:17:08FromDiscord<Elegantbeef> I can make up words too you know!
22:17:11FromDiscord<jmgomez> just kiddings, but you would also notice from the joke that monoids are a higher level abstraction than mondas. Also, that stuff is kinda of fun, and has some applications but there is a treshold where it inst just practical IMHO
22:17:55FromDiscord<jmgomez> (edit) "kiddings," => "kidding," | "treshold" => "threshold"
22:18:28FromDiscord<jmgomez> (edit) "mondas." => "monads."
22:24:30*thomasross joined #nim
22:26:56FromDiscord<arkanoid> what's the standard Nim way to call a `static inline` C function defined in header?
22:32:22FromDiscord<Elegantbeef> port it to native Nim
22:34:01FromDiscord<demotomohiro> Or use header pragma
22:36:50FromDiscord<demotomohiro> `static` in C means that you can use a function or variable with `static` only in same .c file but cannot from other .c file.
22:43:29FromDiscord<arkanoid> that is not wrapping that function, you cheater!
22:43:30FromDiscord<Elegantbeef> Sure, but `inline` code can only be wrapped if you include the C
22:43:39FromDiscord<Elegantbeef> As such porting to Nim is the only 'right' way
22:43:41FromDiscord<arkanoid> talking about headers here, no .c files↵(@demotomohiro)
22:44:51FromDiscord<arkanoid> I know you are right, but my lazyness is much more powerful than that
22:45:07*m5zs7k quit (Ping timeout: 246 seconds)
22:45:50*m5zs7k joined #nim
22:50:47FromDiscord<demotomohiro> @Arkanoid static in header is same to static in .c files.↵Functions are defined in header so that they are inlined without LTO.↵And they have static so that they doesn't cause error "Multiple definition" error at link time.↵If you declare 2 functions with same name in different .c files, you get an error at link time.
22:52:34FromDiscord<demotomohiro> Anyway, you should be able to use `static inline` function with header pragma just like typical C functions declared in header file.
22:54:44arkanoidyou mean header + importc, or just header?
22:58:50FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zLR
22:59:07FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zLS
23:00:41FromDiscord<demotomohiro> @Arkanoid iirc, You don't need to importc unless you want to name different name in Nim code.
23:02:29arkanoidit is quite confusing to me the behavior of the header pragma. The manual says it enable the creation of sloppy wrappers, but it is required in other contexts too
23:02:42FromDiscord<Elegantbeef> `TCVersion(major: parseInt(..), minor: parseInt(...), ...)`
23:02:50FromDiscord<Elegantbeef> You really will write anything but sane code though 😄
23:04:22arkanoidthanks for all the answers, I need to read in detail whats behind static inline funcs in C, as demotomohiro got me thinking by saying LTO
23:04:24FromDiscord<Elegantbeef> Like what's `TCAZVersionData`
23:04:24FromDiscord<voidwalker> no functional/cast wizardry possible?
23:04:25FromDiscord<Elegantbeef> Why are you stringifying fields you already have
23:04:40FromDiscord<voidwalker> parseInt works on string, not on char
23:04:51FromDiscord<Elegantbeef> So...?
23:05:08FromDiscord<Elegantbeef> `ord(char - '0')`
23:05:09FromDiscord<voidwalker> so I need to stringify the char to call parseInt (or do char arithmetic
23:05:29FromDiscord<voidwalker> yeah I was probably going to do that at a later optimizing stage, now I wanted to cut the lines first 😛
23:06:16FromDiscord<Elegantbeef> I'll never understand your goal for unreadable code
23:06:31FromDiscord<voidwalker> I can explain what it does in the comments
23:06:50FromDiscord<Elegantbeef> That's not what comments are for
23:06:58FromDiscord<voidwalker> and if it's unreadable, it's not my fault, it's the language's fault : P
23:07:10FromDiscord<Elegantbeef> No it's your fault
23:07:23FromDiscord<Elegantbeef> Having the fewest lines possible is an inane goal that serves no one but an integer count
23:07:31*thomasross quit (Ping timeout: 250 seconds)
23:07:41FromDiscord<voidwalker> so basically. how to map a `array[4, char`] to a `object` with 4 `int8` fields, so that the numerical value of the char is parsed to int in the result
23:07:55*jmdaemon joined #nim
23:08:13FromDiscord<voidwalker> It saves on scrolling time
23:08:34FromDiscord<demotomohiro> @Arkanoid As far as I know, if you want to use functions defined in header files, you need to use header pragma so that Nim generated C code include it.↵Otherwide, you need to port that C code to Nim or rewrite C code.
23:10:46FromDiscord<xrfez> sent a code paste, see https://play.nim-lang.org/#ix=4zLV
23:12:16FromDiscord<Elegantbeef> Why would you be able to access a non existent field?
23:12:30FromDiscord<Elegantbeef> You want `object of Two`
23:17:28FromDiscord<xrfez> yeah but when I look at the definition of variant in the links and how he accesses the `result.raw.vt` field. I'm stumped.
23:18:07FromDiscord<Elegantbeef> They're unions
23:18:16FromDiscord<xrfez> not all of them
23:18:38FromDiscord<Elegantbeef> There's also likely a property somewhere
23:19:05FromDiscord<xrfez> vt is a property yes. its just behind a few fields
23:19:08FromDiscord<Elegantbeef> Yea there are
23:19:21FromDiscord<Elegantbeef> https://github.com/khchen/winim/blob/master/winim/inc/objbase.nim#L7521C2-L7822
23:19:57FromDiscord<Elegantbeef> No it's not behind any fields
23:20:00FromDiscord<Elegantbeef> It's a property on `Variant`
23:21:01FromDiscord<xrfez> beef saves the day.
23:21:22FromDiscord<xrfez> scratching my head for a minute on that.
23:21:49FromDiscord<Elegantbeef> Blame tooling 😄
23:22:06FromDiscord<xrfez> its the codes fault.
23:22:34FromDiscord<xrfez> languages
23:23:09FromDiscord<Elegantbeef> Nah it's tooling
23:23:21FromDiscord<Elegantbeef> You should've been able to click "goto definition"
23:38:13FromDiscord<voidwalker> Oh Beef, while you still here, need help figuring out how to put a function type in a table value
23:38:31FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zM2
23:38:58FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zM3
23:39:36FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zM4
23:39:52FromDiscord<voidwalker> am I doing it right ?
23:40:04FromDiscord<Elegantbeef> Seems fine
23:41:14FromDiscord<voidwalker> I am copying some javascript code I found. It's quite readable. There's also a c++ one doing exactly this, looks better engineered perhaps, but I can't read it
23:41:39FromDiscord<Elegantbeef> Rumour has it reading's for chumps
23:42:18FromDiscord<voidwalker> is it possible to have a void/null value instead of a function definition, in the table?
23:42:31FromDiscord<voidwalker> (edit) "definition," => "name,"
23:42:48FromDiscord<Elegantbeef> function pointers can be nil yes
23:43:08FromDiscord<voidwalker> hm indeed that seems to work
23:47:37FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zM5
23:48:23FromDiscord<voidwalker> the func definition above does not get matched with the function type I defined ?
23:48:26FromDiscord<Elegantbeef> Likely should do `VerParseFunc VerAzFourDigits` to convert it to the base type
23:48:47FromDiscord<Elegantbeef> Nim functions have a lot of mismatch areas
23:51:04FromDiscord<voidwalker> works! but looks unoptimal :\