00:21:46 | FromDiscord | <Elegantbeef> One could technically implement `is` for `a, b: bool` but it's just wrong |
00:41:58 | * | azimut quit (Ping timeout: 240 seconds) |
01:00:02 | * | zaher quit (Ping timeout: 244 seconds) |
01:15:05 | FromDiscord | <bostonboston> amazing idea |
02:34:48 | * | rockcavera quit (Remote host closed the connection) |
04:09:52 | FromDiscord | <wannabelokesh> I really don't know anything about binding libraries. Is it like using C code inside Nim, V, D or any other language? what is interoperability in this regards?↵(@xtrayambak) |
04:18:37 | FromDiscord | <Elegantbeef> It's technically not using C code inside Nim, C is just the language used to describe ABIs(sadly) |
04:18:40 | FromDiscord | <Elegantbeef> But yes you can think of it that way |
04:26:11 | FromDiscord | <bung8954> how to wrap constant NSString |
04:27:27 | FromDiscord | <takemichihanagaki3129> sent a long message, see http://ix.io/4Baq |
04:28:30 | FromDiscord | <takemichihanagaki3129> (edit) "http://ix.io/4Baq" => "http://ix.io/4Bar" |
04:33:26 | FromDiscord | <takemichihanagaki3129> Example: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-header-pragma |
04:34:32 | FromDiscord | <Elegantbeef> The reason this process exists is that not all languages have the same semantics as the implementation language, so a bridge has to exist. This bridge is documented using C as it's a language with very few abstractions and popular. Technically though it could be written in any language |
04:34:40 | FromDiscord | <Elegantbeef> It's all about code reuse in the end |
04:35:15 | FromDiscord | <Elegantbeef> I will die on the hill that C was a mistake to use for ABI |
04:38:08 | FromDiscord | <takemichihanagaki3129> sent a long message, see https://paste.rs/7SFut |
04:38:49 | FromDiscord | <takemichihanagaki3129> (edit) "http://ix.io/4Baw" => "http://ix.io/4Bav" |
04:39:41 | FromDiscord | <takemichihanagaki3129> (edit) "http://ix.io/4Bav" => "https://paste.rs/A0fcy" |
04:40:09 | FromDiscord | <takemichihanagaki3129> (edit) "http://ix.io/4Bay" => "http://ix.io/4Baz" |
04:46:03 | FromDiscord | <Elegantbeef> > That's why we can write GUI applications in scripting languages, for example.↵Shit, I liked libraries, but you've swayed me I now despise them. |
05:41:20 | * | junaid_ joined #nim |
06:05:39 | * | ntat joined #nim |
06:22:07 | FromDiscord | <uninnocent> sent a code paste, see https://play.nim-lang.org/#ix=4BaN |
06:22:28 | FromDiscord | <uninnocent> sent a code paste, see https://play.nim-lang.org/#ix=4BaO |
06:22:39 | FromDiscord | <uninnocent> (edit) |
06:22:45 | FromDiscord | <uninnocent> (edit) |
06:23:06 | FromDiscord | <terrygillis> Can the resizing factor of seq be overwritten? |
06:23:38 | FromDiscord | <Elegantbeef> No it's statically written |
06:24:25 | FromDiscord | <uninnocent> In reply to @terrygillis "Can the resizing factor": no |
06:25:24 | FromDiscord | <terrygillis> Just toying around a bit nothing important, but it seems the only way to write your own DIY resizing array is to write unsafe nim code, right? |
06:25:24 | FromDiscord | <Elegantbeef> Or use `seq` with `setLen` |
06:25:30 | FromDiscord | <Elegantbeef> Unless you mean from scratch, then yes |
06:32:40 | FromDiscord | <terrygillis> I wonder what is it about resizing arrays that both Rust (low-level) and Nim (high-level) have to resort to unsafe code to implement while it’s pretty easy in Java. |
06:33:07 | FromDiscord | <Elegantbeef> Well Nim hardcodes it |
06:33:14 | FromDiscord | <Elegantbeef> You can just do `setLen` |
06:36:19 | FromDiscord | <Elegantbeef> The thing is though if you could set a custom growth rate on a sequence that's another integer that has to stored and copied, it's not much but it's something to be concerned of |
06:36:20 | FromDiscord | <terrygillis> I read somewhere that it has something tricky that vec in rust have to unsafe code to do it |
06:36:34 | FromDiscord | <terrygillis> interesting things |
06:36:52 | FromDiscord | <terrygillis> i just take it as given in higher languages like java or python |
06:37:16 | FromDiscord | <Elegantbeef> Technically you could fork this to access a procedure that returns a resizes it https://github.com/nim-lang/Nim/blob/devel/lib/system/cellseqs_v2.nim#L19-L25 |
06:37:42 | FromDiscord | <Elegantbeef> But now you have a pointer proc call for all your sequence growths |
06:38:33 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4BaS |
06:45:17 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4BaU |
06:56:26 | FromDiscord | <wannabelokesh> sent a long message, see http://ix.io/4BaW |
06:57:48 | FromDiscord | <Elegantbeef> > bare minimum mathematics I should be good at for programming (especially systems programming)↵I only have pre-calculus and I do fine 😛 |
06:59:48 | FromDiscord | <odexine> you dont really need that much math to do systems programming |
07:00:01 | FromDiscord | <odexine> it depends on what exactly youre doing ig |
07:12:01 | FromDiscord | <demotomohiro> If you want to learn how computer works deeply, books about assembly language or how to make OS would be a good start. |
07:18:58 | FromDiscord | <demotomohiro> In reply to @wannabelokesh "Elegantbeef\: One of the": I just put that link because that code contains the windows API and microsoft's web site is a official document about windows API. |
07:30:20 | * | wgetch left #nim (WeeChat 3.6) |
08:06:34 | * | zaher joined #nim |
08:57:12 | * | jmdaemon quit (Ping timeout: 240 seconds) |
09:16:33 | FromDiscord | <terrygillis> By the way, does “latest” on the Nim playground indicate the devel branch compiler or just 1.6? |
09:18:21 | FromDiscord | <bung8954> latest stable |
09:35:01 | * | azimut joined #nim |
09:44:32 | NimEventer | New question by epilif3sotnas: Problem inherit procs from another Type in Nim, see https://stackoverflow.com/questions/76743196/problem-inherit-procs-from-another-type-in-nim |
10:02:02 | * | azimut quit (Remote host closed the connection) |
10:02:29 | * | azimut joined #nim |
12:54:14 | * | zaher quit (Ping timeout: 260 seconds) |
13:17:45 | FromDiscord | <terrygillis> what is the difference between type conversion `int(8.5)` vs type casting `cast[int](8.5)`? |
13:21:48 | FromDiscord | <odexine> human conceptual value conversion vs raw bit value conversion |
13:22:55 | FromDiscord | <graveflo> I mean... We are talking about a high level vs low level conversion here |
13:23:11 | FromDiscord | <graveflo> the binary for 8.5 as an IEEE float is different from converting it to an integer |
13:23:27 | FromDiscord | <terrygillis> in the code I'm playing with using `cast[int]` causes weird errors while `int()` works |
13:23:31 | FromDiscord | <odexine> yes |
13:23:44 | FromDiscord | <odexine> because youre trying to interpret the bits of a float into an int |
13:23:50 | FromDiscord | <odexine> with cast |
13:24:00 | FromDiscord | <odexine> that usually never makes sense to do |
13:24:03 | FromDiscord | <graveflo> you almost never want to cast it. If you are reading code that is doing that they almost certainly goofed |
13:25:35 | FromDiscord | <terrygillis> interesting. before this I always thought type cast and conversion are synonymous |
13:28:20 | NimEventer | New thread by TKD: Concepts in Nim v2, see https://forum.nim-lang.org/t/10347 |
13:34:05 | FromDiscord | <graveflo> casting tells the compiler to treat a memory address as if it were a different type and conversion implies some kind of logic that is going to actually make sure the data is represented as the type. These are very loose definitions but that is better then thinking they are the same |
14:48:11 | FromDiscord | <wick3dr0se> Does Nim have a built-in lexer generator? |
15:03:07 | FromDiscord | <that_dude.> In reply to @wick3dr0se "Does Nim have a": Something like this? https://nim-lang.org/docs/compiler/lexer.html |
15:10:07 | FromDiscord | <ieltan> That's not it, use this or that :↵https://github.com/choltreppe/parlexgen↵https://github.com/Araq/lexim |
15:14:41 | FromDiscord | <ieltan> In reply to @Elegantbeef "I will die on": Curious what you would use instead of C (not a jab, just genuine curiosity) |
15:15:19 | FromDiscord | <wick3dr0se> chatgpt refers to it as NimLex |
15:15:41 | FromDiscord | <wick3dr0se> I beleive it's just talking about the lexer module dude linked |
15:16:07 | FromDiscord | <ieltan> In reply to @wick3dr0se "chatgpt refers to it": ? That module doesn't exist tmk |
15:16:16 | FromDiscord | <ieltan> ChatGPT is on crack for the 9268th time |
15:16:21 | FromDiscord | <wick3dr0se> No lie |
15:16:43 | FromDiscord | <wick3dr0se> I was asking it things about lexical analyzers and it says btw Nim has a built-in lexer generator called NimLex |
15:16:52 | FromDiscord | <ieltan> Use what I linked please |
15:17:50 | FromDiscord | <wick3dr0se> Ok, I'll check them out, thank you! |
15:18:23 | FromDiscord | <ieltan> Np 🙂 |
15:20:04 | FromDiscord | <terrygillis> sent a code paste, see https://paste.rs/3LDBd |
15:20:52 | FromDiscord | <terrygillis> changing dest, source to x,y respectively doesn't work |
15:21:36 | FromDiscord | <ieltan> You don't need the genetic syntax for this, you can drop the `[T]` and use your type directly. |
15:21:44 | FromDiscord | <ieltan> (edit) "genetic" => "generic" |
15:22:19 | FromDiscord | <ieltan> (since your `DemoType` itself is not generic) |
15:24:55 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4Bd2 |
15:25:49 | FromDiscord | <ieltan> Ah, darn bridge |
15:26:29 | FromDiscord | <ieltan> (edit) "https://play.nim-lang.org/#ix=4Bd2" => "https://paste.rs/daRYe" |
15:26:40 | FromDiscord | <terrygillis> sent a code paste, see https://paste.rs/egeCv |
15:31:24 | FromDiscord | <ieltan> Well, maybe reading the compiler error would help, it says the type signature of `copy=` must be `[T: object]`, what about giving this a try? |
15:34:34 | FromDiscord | <terrygillis> `proc `=copy`[T: object](dest: var MaxPQ[T], source: MaxPQ[T]) ` still doesn't compiled and the only error message the compiler gives is still `Error: signature for '=copy' must be proc[T: object](x: var T; y: T)`. |
15:37:35 | * | junaid_ quit (Remote host closed the connection) |
15:39:26 | FromDiscord | <terrygillis> idk or is `=copy` unsupported in my version of the compiler (1.6.8)? |
15:39:26 | FromDiscord | <terrygillis> also not working on Nim playground "latest" |
16:10:06 | FromDiscord | <ieltan> Sorry I have no clue 😦 |
16:11:30 | FromDiscord | <griffith1deadly> In reply to @terrygillis "`proc `=copy`*[T: object](dest: var": maybe because your object is ref? |
16:13:29 | FromDiscord | <griffith1deadly> sent a code paste, see https://paste.rs/FELTI |
16:15:02 | * | zaher joined #nim |
16:17:02 | FromDiscord | <terrygillis> is it possible to write copy constructor (assignment `=`) for ref object at all? |
16:21:09 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/destructors.html#lifetimeminustracking-hooks↵> There are 3 different hooks for each (generic or concrete) object type T (T can also be a distinct type) that are called implicitly by the compiler. |
16:22:06 | FromDiscord | <terrygillis> sent a code paste, see https://paste.rs/9pUHB |
16:23:38 | FromDiscord | <terrygillis> sent a code paste, see https://paste.rs/G3N00 |
16:24:33 | FromDiscord | <demotomohiro> ref types are references type. `x = y` supposed to set var x so that it refer to what y refer to. |
16:25:24 | FromDiscord | <terrygillis> it's not possible to override that behaviour, right? |
16:25:53 | FromDiscord | <terrygillis> override to copy `y` over to `x` instead of copying pointers |
16:26:21 | FromDiscord | <terrygillis> \the content of |
16:27:46 | FromDiscord | <terrygillis> sent a code paste, see https://play.nim-lang.org/#ix=4Bdt |
16:27:51 | FromDiscord | <demotomohiro> If you want copy the content, you need to write `x[] = y[]`.↵And you can override such copy. |
16:30:33 | FromDiscord | <demotomohiro> `proc `=copy`[T](dest: var typeof(MaxPQ[T]()[]); source: typeof(MaxPQ[T]()[]))` |
16:33:13 | FromDiscord | <terrygillis> sent a code paste, see https://paste.rs/uIugH |
16:33:22 | NimEventer | New Nimble package! debby - Database ORM layer, see https://github.com/treeform/debby |
16:33:32 | FromDiscord | <terrygillis> sent a code paste, see https://paste.rs/Q2sJa |
16:34:27 | FromDiscord | <terrygillis> and it resulted in SIGSEGV |
16:35:01 | FromDiscord | <anon123.> why is that? |
16:36:16 | FromDiscord | <terrygillis> why is that? |
16:37:03 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4Bdv |
16:38:01 | FromDiscord | <terrygillis> thanks that's neat |
16:38:49 | FromDiscord | <terrygillis> and the matrix bridge seems really slow, like 30 seconds at least, sometimes even not transferring edits over |
16:39:27 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4Bdw |
16:52:42 | FromDiscord | <terrygillis> From reading this https://forum.nim-lang.org/t/5539#34582 it seems there was supposed to be `send` which does the deepCopy for the ref types, but it's not implemented yet. |
17:39:49 | FromDiscord | <ambient3332> you're still trying to do the var thing? |
17:41:39 | FromDiscord | <ambient3332> @terrygillis I wrote an example how you can do it with macro because I was interested https://gist.github.com/amb/97b0366d733786bf5168dea9ff02e5a0 |
18:11:19 | * | jmdaemon joined #nim |
18:18:01 | * | zaher quit (Ping timeout: 244 seconds) |
19:11:16 | FromDiscord | <detalion> Hello everyone, I'm new in nim programming and I was wondering if there was a standard or third-party imap lib (supporting oauth2) in nim? |
19:17:27 | ehmry | detalion: imap is complicated and sucks |
19:17:39 | * | Guest54 joined #nim |
19:17:48 | ehmry | I wrote a library long ago and haven't bothered to maintain it https://git.sr.ht/~ehmry/nim_imap |
19:20:09 | FromDiscord | <detalion> In reply to @ehmry "<@297708726981230592>: imap is complicated": maybe but I need to use imap with oauth2 to retrive mail messages from gmail / hotmail / yahoo |
19:21:24 | FromDiscord | <detalion> In reply to @ehmry "I wrote a library": Thanks, yes I see 2 imap libs in nim |
19:22:19 | * | Guest54 quit (Client Quit) |
19:37:27 | FromDiscord | <detalion> In reply to @ehmry "I wrote a library": but your lib support TLS? |
19:50:48 | FromDiscord | <spotlightkid> @detalion\: Be aware that imap support for gmail mail boxes must be specifically enabled. |
19:51:56 | FromDiscord | <detalion> In reply to @spotlightkid "<@297708726981230592>\: Be aware that": what you mean by "must be specifically enabled"? |
19:52:16 | FromDiscord | <detalion> (edit) "In reply to @spotlightkid "<@297708726981230592>\: Be aware that": what you mean by "must be specifically enabled"? ... " added "from Google interface? yes" |
19:52:50 | FromDiscord | <detalion> (edit) removed "what you mean by "must be specifically enabled"?" | "yes" => "yes, I know by default is disabled" |
19:54:13 | * | zaher joined #nim |
19:54:39 | ehmry | detalion: i wouldn't bother trying to get messages from google |
19:55:09 | ehmry | use their webmail and don't be a weirdo |
19:55:51 | FromDiscord | <detalion> In reply to @ehmry "<@297708726981230592>: i wouldn't bother": Well I need to make app to connect to gmail, what's a problem? |
19:56:20 | ehmry | detalion: google will make the apps for you, you don't get to make the apps for them |
19:59:41 | FromDiscord | <detalion> In reply to @ehmry "<@297708726981230592>: google will make": I don't think we understand, so I'll explain my need again, Google make a juste webmail client, I don't need a webmail client. I need to connect to gmail or other mail supplier in imap to make some operation via my app |
20:00:56 | ehmry | detalion: what I mean is I really don't think google supports imap at all |
20:01:55 | FromDiscord | <detalion> In reply to @ehmry "<@297708726981230592>: what I mean": Yes, it's supporting of course, but it's disable by default, you need to activate via web interface |
20:02:09 | ehmry | have you actually enabled it though? |
20:02:38 | ehmry | because they could just be lying |
20:03:34 | FromDiscord | <detalion> In reply to @ehmry "have you actually enabled": ok I make an app in freepascal lazarus, using Indy component with IMAP4, freepascal is slow for some operations, I would like to see if I can optimize speed using nim |
20:06:37 | FromDiscord | <detalion> In reply to @ehmry "have you actually enabled": https://www.lifewire.com/thmb/16ZNmEETbSeGvTcRYtVGojKnc48=/750x0/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)/001-gmail-access-thunderbird-1173150-80fdab9339ec4fb9a6c58965db3b8b7b.jpg |
20:12:26 | ehmry | I tried to backup a gmail account recently and the option was there but you can't actually enable it now |
20:24:58 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @NimEventer "New Nimble package! debby": @treeform Thanks for that! Might be useful for my school work! |
20:25:43 | FromDiscord | <treeform> In reply to @sys64 "<@107140179025735680> Thanks for that!": Thanks! Let me know how it goes. |
20:46:14 | * | rockcavera joined #nim |
20:46:35 | * | ntat quit (Quit: leaving) |
21:08:01 | * | zaher_ joined #nim |
21:11:14 | * | zaher quit (Ping timeout: 260 seconds) |
22:15:35 | FromDiscord | <sirolaf> In reply to @sirolaf "Is there some special": Turns out this really is trivial to support, finally actually looked at it |
22:17:31 | FromDiscord | <Elegantbeef> Well araq isnt really for return type inference 😄 |
22:17:49 | FromDiscord | <sirolaf> Really hope he changed his mind since last time someone asked |
22:17:55 | FromDiscord | <sirolaf> Main thing I was missing with generics |
22:18:28 | FromDiscord | <Elegantbeef> Eh that's not that bad |
22:18:34 | FromDiscord | <griffith1deadly> In reply to @treeform "Thanks! Let me know": are you planning to add something like JoinColumn, ManyToOne, OneToMany as it is done in HibernateORM for Java? |
22:18:41 | FromDiscord | <Elegantbeef> Given that it's not much more effort to just do `var x = Option[string]()` 😛 |
22:19:01 | FromDiscord | <sirolaf> Yeah for that simple type it's fine, but quickly gets annoying |
22:20:58 | FromDiscord | <sirolaf> I once made this Result[T] type and to work around this limitation I had to pass the result variable into a template, much cleaner to just assign with inference |
22:22:24 | FromDiscord | <Elegantbeef> How do you properly infer this though? |
22:22:32 | FromDiscord | <Elegantbeef> I'm curious at your solution |
22:23:29 | FromDiscord | <sirolaf> <https://github.com/nim-lang/Nim/pull/22317> well the compiler already has expectedTypes in a lot of sem stages, just passed it a bit further down the line and bind them to their counterparts |
22:24:24 | FromDiscord | <Elegantbeef> What happens if you do `let x: Option[auto, auto] = none()`? |
22:24:38 | FromDiscord | <sirolaf> Probably dies, generics don't get along well with auto |
22:25:28 | FromDiscord | <sirolaf> sent a code paste, see https://play.nim-lang.org/#ix=4BeG |
22:25:30 | FromDiscord | <sirolaf> That seems fine to me |
22:25:57 | FromDiscord | <Elegantbeef> Yea just making sure it didnt bypass a check |
22:26:29 | FromDiscord | <sirolaf> Actually this error, was using std/options before `Error: expression 'none()' has no type (or is ambiguous)` |
22:26:50 | FromDiscord | <sirolaf> Not optimal but also no bypass |
22:27:22 | FromDiscord | <Elegantbeef> The thing I want for generics is object constructor generic inference 😄 |
22:27:36 | FromDiscord | <Elegantbeef> Too lazy to implement it myself apparently |
22:27:55 | FromDiscord | <sirolaf> No idea what that means 😼 |
22:28:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/ul4NL |
22:28:43 | FromDiscord | <sirolaf> That would be cool, but could see that being problematic with void |
22:28:49 | FromDiscord | <sirolaf> Does not mentioning it imply void or not |
22:29:19 | FromDiscord | <Elegantbeef> What? |
22:29:32 | FromDiscord | <sirolaf> MyObject[void] would get rid of the field |
22:29:42 | FromDiscord | <sirolaf> Completely disappears |
22:29:51 | FromDiscord | <Elegantbeef> Oh right people use void fields cause they're silly 😛 |
22:30:02 | FromDiscord | <sirolaf> Yeah it sucks |
22:40:20 | FromDiscord | <treeform> In reply to @griffith1deadly "are you planning to": Not really, I think that overcomplicates things. I’ll add things as I need them. |
22:52:00 | FromDiscord | <monark.chan> How can I compile a Nim library to a .so |
22:52:15 | FromDiscord | <monark.chan> I want to be able to use the jsony library as a .so |
22:53:28 | FromDiscord | <Andreas> try `--app:lib` |
22:53:56 | FromDiscord | <Andreas> (edit) "try `--app:lib` ... " added "or `--app:staticlib`" |
22:54:01 | FromDiscord | <monark.chan> Ohk |
22:54:11 | FromDiscord | <monark.chan> And would that .so work in c? |
22:54:24 | FromDiscord | <Andreas> In reply to @monark.chan "Ohk": `nim --fullhelp | more` |
22:54:42 | FromDiscord | <monark.chan> In reply to @Andreas "`nim --fullhelp | more`": Didn't know about that flag |
22:54:59 | FromDiscord | <Andreas> In reply to @monark.chan "Didn't know about that": there are many... |
22:55:29 | FromDiscord | <Andreas> In reply to @monark.chan "And would that .so": should word... |
22:55:36 | FromDiscord | <Andreas> (edit) "word..." => "work..." |
22:55:42 | FromDiscord | <monark.chan> In reply to @Andreas "should work...": Ok thx! |
22:58:51 | FromDiscord | <jmgomez> In reply to @sirolaf "<https://github.com/nim-lang/Nim/pull/22317> well t": good work! |
23:00:11 | * | lucasta joined #nim |
23:01:01 | FromDiscord | <Andreas> In reply to @monark.chan "Ok thx!": this https://github.com/nim-lang/Nim/wiki/Nim-for-C-programmers is for C-dudes in case of probs try to ping Mr. Beef |
23:08:25 | FromDiscord | <sirolaf> In reply to @jmgomez "good work!": Thanks, just hoping it’s not too much inference for araq 😛 |
23:32:09 | NimEventer | New thread by morturo: Converter not working unless I explicitly use it, see https://forum.nim-lang.org/t/10348 |
23:53:29 | * | zaher_ quit (Quit: Leaving) |