00:01:08 | FromDiscord | <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:37 | FromDiscord | <Elegantbeef> It used to support both, but one style was chosen |
00:01:55 | FromDiscord | <Elegantbeef> Python is one of the most popular languages and doesnt use curlies, so it's hardly a point |
00:02:03 | FromDiscord | <Elegantbeef> The isssue is the language, the tooling, and the leader |
00:02:22 | FromDiscord | <voidwalker> I've learned our leader uses a mac, and windows mainly :\ |
00:02:38 | FromDiscord | <Elegantbeef> I don't know if i'd say "our" leader |
00:02:59 | FromDiscord | <voidwalker> And sells expensive poor quality books instead of selling t-shirts and mugs |
00:05:54 | FromDiscord | <voidwalker> And hasn't been in #main for 9 months now :\ He's not a good king |
00:06:14 | FromDiscord | <Elegantbeef> I mean he is in #internals |
00:06:33 | FromDiscord | <voidwalker> that's the inner court. He should say hi to the commoners every once in a while |
00:12:05 | systemdsucks | someone 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:35 | systemdsucks | i like him better now, no need for hat waving from the throne |
00:12:44 | FromDiscord | <Elegantbeef> Ugh |
00:16:32 | FromDiscord | <voidwalker> he should try more to be a pre-cancelling Linus Torvalds |
00:16:43 | FromDiscord | <Elegantbeef> He really shouldnt |
00:17:21 | FromDiscord | <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:04 | FromDiscord | <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:22 | FromDiscord | <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:44 | FromDiscord | <Elegantbeef> I mean there wasnt even an entitled idiot in this conversation |
00:24:00 | FromDiscord | <Elegantbeef> Someone was interested in if there were any plans in the event something happened |
00:24:07 | FromDiscord | <spotlightkid> Thatswhy the yelling at the heavens. |
00:24:46 | FromDiscord | <voidwalker> something = Araq gets hit by a bus |
00:25:00 | FromDiscord | <Elegantbeef> The worst part is just the inane point brought up about lexicon changing |
00:25:15 | FromDiscord | <Elegantbeef> Oh noes master changed to main my world is ending |
00:25:42 | FromDiscord | <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:01 | FromDiscord | <spotlightkid> You're probably having (a) beef with someone, right? |
00:28:41 | FromDiscord | <Elegantbeef> Huh? |
00:28:42 | FromDiscord | <spotlightkid> For lunch |
00:28:46 | FromDiscord | <Elegantbeef> Ah |
00:28:54 | FromDiscord | <Elegantbeef> Woosh me there |
00:29:19 | FromDiscord | <spotlightkid> Sorry, I had two glashes of wine |
00:29:36 | FromDiscord | <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:52 | FromDiscord | <voidwalker> so this is why someone pointed out that I have my code in a `master` branch maybe |
00:30:45 | FromDiscord | <Elegantbeef> I always like the response that it's so crazy that lexicon changes |
00:31:01 | FromDiscord | <Elegantbeef> "Oh noes politics in my language... how new" |
00:31:33 | FromDiscord | <Elegantbeef> Meanwhile we stopped calling people with disabilities 'moron' or 'retard' and nothing of importance was lost |
00:32:12 | FromDiscord | <voidwalker> I didn't |
00:32:43 | FromDiscord | <michaelb.eth> I compromised and shortened my usage to "tard" |
00:32:47 | FromDiscord | <voidwalker> I guess I didn't get that newsletter |
00:33:05 | FromDiscord | <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:43 | FromDiscord | <spotlightkid> Also, English isn't the only language in the world. |
00:33:45 | FromDiscord | <Elegantbeef> Language is an ever moving dynamic societal construct that does not ask permission to change |
00:33:47 | FromDiscord | <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:11 | FromDiscord | <michaelb.eth> > Language should be democratic as well↵but beware the mob |
00:34:13 | FromDiscord | <spotlightkid> So, before I have to name my branches "main", I will call them "meister" ;-) |
00:34:53 | FromDiscord | <Elegantbeef> Ah yes let's democratically define language when even the UK cannot determine what a roll of toilet paper is called |
00:35:03 | FromDiscord | <Elegantbeef> jordies call it bog roll, afterall |
00:35:28 | FromDiscord | <spotlightkid> isn't it "geordie"? \:) |
00:35:42 | FromDiscord | <Elegantbeef> Probably |
00:36:14 | FromDiscord | <Elegantbeef> Don't think I've ever seen it written out |
00:37:01 | FromDiscord | <spotlightkid> We call them latitudinal challenged persons now. |
00:38:02 | FromDiscord | <Elegantbeef> One could listen to carlin's take on soft language now |
00:40:17 | FromDiscord | <spotlightkid> who's carlin? |
00:40:37 | FromDiscord | <Elegantbeef> george carlin |
00:44:39 | FromDiscord | <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:16 | FromDiscord | <spotlightkid> Bleeping on TV or radio still isnÄt very common here. |
00:48:52 | FromDiscord | <Elegantbeef> This is more #offtopic but either way the US is funny |
01:34:40 | FromDiscord | <michaelb.eth> US is a powder keg, not quite ready to blow, but it could get there |
01:35:02 | FromDiscord | <michaelb.eth> but anyway, like you say, it's more of an offtopic discussion |
01:38:37 | FromDiscord | <voidwalker> can you construct a `const` seq, table etc by calling a function that adds elements to it ? |
01:38:55 | FromDiscord | <voidwalker> (edit) "function" => "proc" |
01:38:57 | FromDiscord | <Elegantbeef> Nope |
01:39:17 | FromDiscord | <Elegantbeef> You can just call a proc that returns it |
01:39:18 | FromDiscord | <voidwalker> trying to rewrite this js bit: https://github.com/webtorrent/bittorrent-peerid/blob/51a3f0d52a138ab67c1df34694ad4aa4d1ba0d92/index.js#L248 |
01:39:39 | FromDiscord | <Elegantbeef> Make a proc that returns a tuple and unpack it |
01:39:48 | FromDiscord | <voidwalker> `addAzStyle('A~', 'Ares', VER_AZ_THREE_DIGITS` |
01:40:15 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zHk |
01:41:27 | FromDiscord | <Elegantbeef> `const (tableA, tableB) = procThatReturnsBoth()` |
01:43:17 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zHl |
01:43:39 | FromDiscord | <voidwalker> anonymous proc ? |
01:43:49 | FromDiscord | <Elegantbeef> yes |
01:58:00 | NimEventer | New 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:54 | NimEventer | New 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:12 | PMunch | Hmm, 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:01 | FromDiscord | <jeancareau> sent a code paste, see https://play.nim-lang.org/#ix=4zIP |
10:45:22 | FromDiscord | <jeancareau> (edit) |
10:56:48 | * | via quit (Server closed connection) |
10:56:55 | * | via joined #nim |
10:57:23 | FromDiscord | <System64 ~ Flandre Scarlet> Is it possible to do multithreaded compilation? |
11:04:25 | FromDiscord | <odexine> In reply to @jeancareau "I have this proc": nim cannot use openssl 3 right now iirc |
11:04:26 | FromDiscord | <odexine> use 1.1 |
11:04:58 | FromDiscord | <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:13 | FromDiscord | <System64 ~ Flandre Scarlet> Ah alright |
11:05:45 | FromDiscord | <System64 ~ Flandre Scarlet> The big problem with the compiler is it recompiles everything even for a small change |
11:06:55 | FromDiscord | <jeancareau> In reply to @odexine "nim cannot use openssl": Ah, thank you. I will try that. |
11:10:10 | FromDiscord | <odexine> In reply to @sys64 "The big problem with": IC is being worked on |
11:14:26 | * | kenran joined #nim |
11:27:54 | FromDiscord | <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:28 | FromDiscord | <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:32 | FromDiscord | <odexine> is the error different with openssl1 .1 |
11:45:08 | * | fallback quit (Ping timeout: 240 seconds) |
11:50:59 | FromDiscord | <jeancareau> In reply to @odexine "is the error different": The error is the same |
12:11:23 | PMunch | Huh, this is pretty cool: https://github.com/openpeeps/bro |
12:25:50 | * | fallback joined #nim |
12:26:23 | FromDiscord | <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:38 | FromDiscord | <jeancareau> http:// |
12:36:42 | * | oprypin quit (Quit: Bye) |
12:37:04 | * | oprypin joined #nim |
12:54:08 | NimEventer | New 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:02 | FromDiscord | <mratsim> In reply to @sys64 "The big problem with": It recompiles the file changed and possible dependencies if there are generics |
13:26:36 | FromDiscord | <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:16 | FromDiscord | <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:55 | FromDiscord | <xrfez> sent a code paste, see https://paste.rs/3hqbd |
14:12:18 | FromDiscord | <mratsim> In reply to @sys64 "Oh alright But why": Bribe Nim with cookies |
14:12:57 | FromDiscord | <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:34 | NimEventer | New thread by phoenix27: Recursive Fibonacci function, see https://forum.nim-lang.org/t/10322 |
14:29:51 | FromDiscord | <System64 ~ Flandre Scarlet> Is there a progress bar window library? |
14:30:53 | FromDiscord | <vindaar> well, but keep in mind that the Nim compiler only accepts these cookies↵(@mratsim) |
14:31:10 | FromDiscord | <vindaar> 2023-07-04\_16-29.png https://media.discordapp.net/attachments/371759389889003532/1125795946077372446/2023-07-04_16-29.png |
14:31:20 | FromDiscord | <System64 ~ Flandre Scarlet> Oh |
14:31:36 | FromDiscord | <System64 ~ Flandre Scarlet> I don't have those↵Is it possible to give it internet cookies? |
14:33:08 | FromDiscord | <vindaar> do your internet cookies have a crown? |
14:33:41 | FromDiscord | <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:55 | NimEventer | New thread by mantielero: Linking, see https://forum.nim-lang.org/t/10323 |
19:01:18 | arkanoid | Intel 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:17 | FromDiscord | <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:38 | FromDiscord | <JJ> adts/or types aren't really monads though because you don't map across them |
19:36:59 | FromDiscord | <Phil> adts = abstract data types |
19:37:02 | FromDiscord | <Phil> (edit) "adts = abstract data types ... " added "?" |
19:45:47 | FromDiscord | <Elegantbeef> I swear JJ uses "adt" just to troll me 😄 |
19:48:59 | FromDiscord | <JJ> In reply to @isofruit "adts = abstract data": bluh no never mind algebraic data types |
19:49:57 | FromDiscord | <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:21 | FromDiscord | <JJ> no i don't believe so |
19:50:52 | FromDiscord | <JJ> that would be a (lazy) monad |
19:51:47 | FromDiscord | <odexine> In reply to @isofruit "Right, those things where": Oh hey you do get what a monad is |
19:51:51 | FromDiscord | <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:05 | FromDiscord | <elegantbeef> No they're not JJ |
19:52:05 | FromDiscord | <Elegantbeef> ADT is just a general term for most data types in reality, a tuple is an ADT |
19:52:09 | FromDiscord | <elegantbeef> Ah there it is |
19:54:02 | FromDiscord | <JJ> why must there be two terms referred to by "ADT" 😭 |
19:54:04 | FromDiscord | <Elegantbeef> structs(nim objects) and tuples are by definition product types, and object variants/rust style enums are sumtypes |
19:55:12 | FromDiscord | <Elegantbeef> There's only the 1 term it's just people co-opted it for the rust enums |
19:56:14 | FromDiscord | <JJ> oh interesting |
19:56:46 | FromDiscord | <elegantbeef> Man the bridge is so slow today |
19:56:57 | FromDiscord | <jmgomez> yeah, they are types that you can algebraically operate on them as their name implies. Also inheritance is a "product operation" |
19:57:00 | FromDiscord | <elegantbeef> Anyway if you think about what the name ADT means it's talking about operations creating types |
19:57:11 | FromDiscord | <elegantbeef> hence "algebraic" |
19:57:25 | FromDiscord | <JJ> oh wow i have never seen haskell structs |
19:57:36 | FromDiscord | <JJ> funky |
19:58:35 | FromDiscord | <Phil> In reply to @odexine "Oh hey you do": Wait that's a monad? |
19:59:30 | FromDiscord | <odexine> Well |
19:59:43 | FromDiscord | <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:12 | FromDiscord | <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:22 | FromDiscord | <odexine> Not really I guess, it’s perhaps too loose to say |
20:00:24 | FromDiscord | <Phil> And if that's a Monad I get the side-effect thing even less |
20:00:29 | FromDiscord | <elegantbeef> Nim's object variants are just a low level abstraction slightly higher than C's |
20:00:37 | FromDiscord | <odexine> See my wall of text in #offtopic |
20:00:58 | FromDiscord | <JJ> In reply to @elegantbeef "Really when you talk": yeah i pretty much just want better sum types |
20:01:09 | FromDiscord | <odexine> You can say that IO/state monads are a kind of railroad (if talking in terms of railroad programming) |
20:01:17 | FromDiscord | <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:32 | FromDiscord | <odexine> Well, no, more of all monads are a certain kind of railroad |
20:01:48 | FromDiscord | <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:02 | FromDiscord | <elegantbeef> Personally I really like metagn's proposal |
20:02:09 | FromDiscord | <elegantbeef> It's the most existential solution demonstrated |
20:02:31 | FromDiscord | <elegantbeef> https://github.com/nim-lang/RFCs/issues/527 this one for context |
20:03:00 | FromDiscord | <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:02 | FromDiscord | <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:20 | FromDiscord | <JJ> yeah i've read through it a couple of times. i really should put down my thoughts in a comment there |
20:04:23 | FromDiscord | <JJ> i like it a lot too |
20:04:27 | FromDiscord | <elegantbeef> If a proc is inlined it's not in a dll at the very least |
20:04:36 | FromDiscord | <elegantbeef> It's much more clear about type injection which is very nice |
20:04:45 | FromDiscord | <elegantbeef> Fungus has an issue of "where do these types come from" |
20:05:22 | FromDiscord | <elegantbeef> given that futhark is for static and dynamic libraries I atleast imagine that's the reason he skips inlined |
20:05:50 | FromDiscord | <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:00 | FromDiscord | <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:27 | FromDiscord | <elegantbeef> "enums not being inspectable"? |
20:08:44 | FromDiscord | <JJ> yeah the associated underlying enum of a sum type isn't accessible with either of our current proposals |
20:09:02 | FromDiscord | <JJ> s enum tag |
20:09:10 | FromDiscord | <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:37 | FromDiscord | <elegantbeef> It should have a flag to enable it, it's just an oversight |
20:09:47 | FromDiscord | <elegantbeef> for dynamic libraries you do not want `inlined` to appear |
20:10:00 | FromDiscord | <elegantbeef> Or if you do get `inlined` you need it ported to Nim |
20:11:06 | FromDiscord | <elegantbeef> Hmph good point JJ, I don't see a nice way to inject a name either |
20:16:00 | FromDiscord | <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:32 | FromDiscord | <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:01 | FromDiscord | <Elegantbeef> futhark allows you to wrap source, static, and dynamic libraries |
20:17:22 | FromDiscord | <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:10 | FromDiscord | <arkanoid> this does not apply if the inline function is static and declared in .h |
20:26:28 | FromDiscord | <arkanoid> I mean defined in the .h |
20:26:49 | FromDiscord | <Elegantbeef> Right it has to be converted to Nim |
20:41:30 | FromDiscord | <JeysonFlores> What is the usability of custom effects (tags)? Only provide contextual information about your abstraction (proc)? |
20:47:28 | FromDiscord | <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:27 | FromDiscord | <JeysonFlores> @arknoid thanks! |
20:53:41 | FromDiscord | <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:28 | FromDiscord | <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:38 | FromDiscord | <jmgomez> but it's famous last words "Monads are monoids in the category of endofunctors" 😛 |
22:17:08 | FromDiscord | <Elegantbeef> I can make up words too you know! |
22:17:11 | FromDiscord | <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:55 | FromDiscord | <jmgomez> (edit) "kiddings," => "kidding," | "treshold" => "threshold" |
22:18:28 | FromDiscord | <jmgomez> (edit) "mondas." => "monads." |
22:24:30 | * | thomasross joined #nim |
22:26:56 | FromDiscord | <arkanoid> what's the standard Nim way to call a `static inline` C function defined in header? |
22:32:22 | FromDiscord | <Elegantbeef> port it to native Nim |
22:34:01 | FromDiscord | <demotomohiro> Or use header pragma |
22:36:50 | FromDiscord | <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:29 | FromDiscord | <arkanoid> that is not wrapping that function, you cheater! |
22:43:30 | FromDiscord | <Elegantbeef> Sure, but `inline` code can only be wrapped if you include the C |
22:43:39 | FromDiscord | <Elegantbeef> As such porting to Nim is the only 'right' way |
22:43:41 | FromDiscord | <arkanoid> talking about headers here, no .c files↵(@demotomohiro) |
22:44:51 | FromDiscord | <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:47 | FromDiscord | <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:34 | FromDiscord | <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:44 | arkanoid | you mean header + importc, or just header? |
22:58:50 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zLR |
22:59:07 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zLS |
23:00:41 | FromDiscord | <demotomohiro> @Arkanoid iirc, You don't need to importc unless you want to name different name in Nim code. |
23:02:29 | arkanoid | it 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:42 | FromDiscord | <Elegantbeef> `TCVersion(major: parseInt(..), minor: parseInt(...), ...)` |
23:02:50 | FromDiscord | <Elegantbeef> You really will write anything but sane code though 😄 |
23:04:22 | arkanoid | thanks 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:24 | FromDiscord | <Elegantbeef> Like what's `TCAZVersionData` |
23:04:24 | FromDiscord | <voidwalker> no functional/cast wizardry possible? |
23:04:25 | FromDiscord | <Elegantbeef> Why are you stringifying fields you already have |
23:04:40 | FromDiscord | <voidwalker> parseInt works on string, not on char |
23:04:51 | FromDiscord | <Elegantbeef> So...? |
23:05:08 | FromDiscord | <Elegantbeef> `ord(char - '0')` |
23:05:09 | FromDiscord | <voidwalker> so I need to stringify the char to call parseInt (or do char arithmetic |
23:05:29 | FromDiscord | <voidwalker> yeah I was probably going to do that at a later optimizing stage, now I wanted to cut the lines first 😛 |
23:06:16 | FromDiscord | <Elegantbeef> I'll never understand your goal for unreadable code |
23:06:31 | FromDiscord | <voidwalker> I can explain what it does in the comments |
23:06:50 | FromDiscord | <Elegantbeef> That's not what comments are for |
23:06:58 | FromDiscord | <voidwalker> and if it's unreadable, it's not my fault, it's the language's fault : P |
23:07:10 | FromDiscord | <Elegantbeef> No it's your fault |
23:07:23 | FromDiscord | <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:41 | FromDiscord | <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:13 | FromDiscord | <voidwalker> It saves on scrolling time |
23:08:34 | FromDiscord | <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:46 | FromDiscord | <xrfez> sent a code paste, see https://play.nim-lang.org/#ix=4zLV |
23:12:16 | FromDiscord | <Elegantbeef> Why would you be able to access a non existent field? |
23:12:30 | FromDiscord | <Elegantbeef> You want `object of Two` |
23:17:28 | FromDiscord | <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:07 | FromDiscord | <Elegantbeef> They're unions |
23:18:16 | FromDiscord | <xrfez> not all of them |
23:18:38 | FromDiscord | <Elegantbeef> There's also likely a property somewhere |
23:19:05 | FromDiscord | <xrfez> vt is a property yes. its just behind a few fields |
23:19:08 | FromDiscord | <Elegantbeef> Yea there are |
23:19:21 | FromDiscord | <Elegantbeef> https://github.com/khchen/winim/blob/master/winim/inc/objbase.nim#L7521C2-L7822 |
23:19:57 | FromDiscord | <Elegantbeef> No it's not behind any fields |
23:20:00 | FromDiscord | <Elegantbeef> It's a property on `Variant` |
23:21:01 | FromDiscord | <xrfez> beef saves the day. |
23:21:22 | FromDiscord | <xrfez> scratching my head for a minute on that. |
23:21:49 | FromDiscord | <Elegantbeef> Blame tooling 😄 |
23:22:06 | FromDiscord | <xrfez> its the codes fault. |
23:22:34 | FromDiscord | <xrfez> languages |
23:23:09 | FromDiscord | <Elegantbeef> Nah it's tooling |
23:23:21 | FromDiscord | <Elegantbeef> You should've been able to click "goto definition" |
23:38:13 | FromDiscord | <voidwalker> Oh Beef, while you still here, need help figuring out how to put a function type in a table value |
23:38:31 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zM2 |
23:38:58 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zM3 |
23:39:36 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zM4 |
23:39:52 | FromDiscord | <voidwalker> am I doing it right ? |
23:40:04 | FromDiscord | <Elegantbeef> Seems fine |
23:41:14 | FromDiscord | <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:39 | FromDiscord | <Elegantbeef> Rumour has it reading's for chumps |
23:42:18 | FromDiscord | <voidwalker> is it possible to have a void/null value instead of a function definition, in the table? |
23:42:31 | FromDiscord | <voidwalker> (edit) "definition," => "name," |
23:42:48 | FromDiscord | <Elegantbeef> function pointers can be nil yes |
23:43:08 | FromDiscord | <voidwalker> hm indeed that seems to work |
23:47:37 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zM5 |
23:48:23 | FromDiscord | <voidwalker> the func definition above does not get matched with the function type I defined ? |
23:48:26 | FromDiscord | <Elegantbeef> Likely should do `VerParseFunc VerAzFourDigits` to convert it to the base type |
23:48:47 | FromDiscord | <Elegantbeef> Nim functions have a lot of mismatch areas |
23:51:04 | FromDiscord | <voidwalker> works! but looks unoptimal :\ |