00:00:40 | FromDiscord | <ambient> so overwrite =copy and add a .clone() func and I would have pretty much what I need I think. explicit copy |
00:07:40 | FromDiscord | <demotomohiro> Object types are not always copied on function call: https://internet-of-tomohiro.netlify.app/nim/faq.en.html#type-can-i-passslashreturn-object-types-toslashfrom-procedures-if-copying-is-disabledqmark |
00:08:15 | FromDiscord | <Yardanico> In reply to @demotomohiro "Object types are not": yes, but that wasn't really the point of ambient's question |
00:08:31 | FromDiscord | <Yardanico> he wants to _be sure_ copies are only done when he wants to, and not when the compiler wants to |
00:09:08 | FromDiscord | <ambient> It's just I have traumas on trying to optimize complex C++ inner loops with a lot of heap memory |
00:09:48 | FromDiscord | <ambient> With Rust it's super easy |
01:11:31 | * | TakinOver quit (Ping timeout: 258 seconds) |
01:20:29 | * | TakinOver joined #nim |
01:32:19 | FromDiscord | <br4n_d0n> sent a code paste, see https://play.nim-lang.org/#ix=3ZpK |
01:32:28 | FromDiscord | <Elegantbeef> If you dont use `sink` and annotate the type with `{.byref.}` you'll be golden, if you use `sink` then you'll need to error copy or enable the performance warning and error for that function↵(@ambient) |
01:32:53 | FromDiscord | <Elegantbeef> Yea you can call things very funky with Nim but it's to a point that it makes life sooooo much better |
01:35:11 | FromDiscord | <br4n_d0n> Yeah, when I came to this realization I also understood that now I could call all of these proc/func in the style I prefer |
01:35:40 | FromDiscord | <Elegantbeef> Yea it really comes in handy for things like async where you can use `waitFor`/`await` like keywords instead of `await(...)` |
01:36:37 | FromDiscord | <br4n_d0n> That's similar to how something like ``div`` is used |
01:37:25 | FromDiscord | <Elegantbeef> No `div` is an operator |
01:37:46 | FromDiscord | <br4n_d0n> Oh, I was guessing that it was a func |
01:37:49 | FromDiscord | <br4n_d0n> My bad |
01:37:52 | FromDiscord | <Elegantbeef> It is |
01:37:54 | FromDiscord | <Elegantbeef> But it's an operator |
01:38:49 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/FB3 |
01:39:16 | FromDiscord | <br4n_d0n> sent a code paste, see https://paste.rs/2jt |
01:39:34 | FromDiscord | <br4n_d0n> Lol, I was too slow on my response/question |
01:41:26 | FromDiscord | <Elegantbeef> The first is only cause it's an operator though |
01:41:35 | FromDiscord | <Elegantbeef> You cannot do the same with random words |
01:44:54 | FromDiscord | <br4n_d0n> This is such a cool feature of the language, but I can see it getting out of control if you work with others and don't set some rules/guidelines |
01:45:49 | FromDiscord | <br4n_d0n> The more I'm learning and actually understanding Nim, the more I like it |
01:47:00 | FromDiscord | <br4n_d0n> Though, the documentation could use some work and I would probably help if I understood the language enough |
02:07:07 | * | arkurious quit (Quit: Leaving) |
02:10:01 | FromDiscord | <whee> the "Function application" section of https://nim-lang.org/blog/2021/11/15/zen-of-nim.html is my favorite summary of UFCS. I find I end up writing what "reads" the best and don't really think about the sugar↵(@👾 br4n_d0n) |
02:32:19 | NimEventer | New post on r/nim by jasonprogrammer: Classes in Nim, see https://reddit.com/r/nim/comments/v53y6f/classes_in_nim/ |
03:14:30 | NimEventer | New post on r/nim by jasfi: Nexus Development Framework, see https://reddit.com/r/nim/comments/v54m96/nexus_development_framework/ |
03:46:41 | FromDiscord | <Stuffe> not entirely a nim question I guess, but I get an access error on windows trying `moveFile()`. First I `open()`, `writeBytes()` and then `close()` this file. THEN I try move it and I get an access error (on windows only) |
03:47:38 | FromDiscord | <Stuffe> isn't windows supposed to close the file immediately when `close()` is called? I am wrecking my brain trying to figure out a workaround |
03:51:26 | FromDiscord | <Stuffe> https://play.nim-lang.org/#ix=3ZpV here is a poc in the playground (although of course file io wont work there) |
03:55:08 | FromDiscord | <ajusa> Is there a way to force a template to be within a new scope? |
03:55:29 | FromDiscord | <Stuffe> you can export it? |
03:55:49 | FromDiscord | <Stuffe> Maybe this is what you are looking for↵https://nim-lang.org/docs/manual.html#procedures-export-marker |
03:57:41 | FromDiscord | <Elegantbeef> What are you after ajusa? |
03:58:46 | FromDiscord | <ajusa> Trying to get "locals" to work within a template |
03:59:18 | FromDiscord | <Stuffe> sounds like you need a macro |
03:59:58 | FromDiscord | <ajusa> but I believe it fails because the template substitution makes all the variables declared within the template global, so it doesn't work |
04:00:09 | FromDiscord | <Elegantbeef> Code example? |
04:01:03 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3ZpX |
04:01:10 | FromDiscord | <ajusa> changing template to proc works, because the proc declares a new scope |
04:01:42 | FromDiscord | <Elegantbeef> You cant do `block:` or `if true:` |
04:02:37 | FromDiscord | <ajusa> yes, I tried those |
04:06:07 | FromDiscord | <Elegantbeef> What's the issue though? |
04:06:20 | FromDiscord | <Elegantbeef> The issue isnt really scope now is it? |
04:06:28 | FromDiscord | <Elegantbeef> Also hello stuffe 😄 |
04:06:42 | FromDiscord | <Stuffe> hello 🙂 |
04:09:36 | FromDiscord | <ajusa> > The issue isnt really scope now is it?↵I hate that you realize this 🙂 |
04:10:26 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Zq0 |
04:10:51 | FromDiscord | <ajusa> so I'm trying to figure out some sort of code that would result in myRoute(1) being called in this scenario. The input query string is dynamic though |
04:12:28 | FromDiscord | <Elegantbeef> So `"a=1"` calls `myRoute(a = 1)`? |
04:12:29 | FromDiscord | <Elegantbeef> If so you need yourself a macro |
04:13:09 | FromDiscord | <ajusa> Pretty much yeah, and seems like I will need that |
04:13:16 | FromDiscord | <Elegantbeef> You're going to need to store all parameters and then reason at runtime which proc makes sense to call, so you're also going to need to cache all procs that you could call |
04:13:37 | FromDiscord | <ajusa> and "a=1&b=beef" would call myRoute(1, "beef") |
04:40:21 | * | ltriant quit (Ping timeout: 276 seconds) |
05:19:00 | FromDiscord | <treeform> In reply to @huantian "treeform print is awesome": I am glad you like it. |
05:35:15 | FromDiscord | <Korven> Can Nim do systemcalls and such? |
05:35:26 | FromDiscord | <Korven> I'd like to do the Operating System Three Easy Pieces Book but in Nim |
05:35:29 | FromDiscord | <Korven> if it's at all possible |
05:35:32 | FromDiscord | <Korven> :thonk: |
05:37:43 | FromDiscord | <Elegantbeef> Can you do it in C? 😄 |
05:38:25 | FromDiscord | <Korven> Yeah the book's primary languages are C and Python |
05:38:36 | FromDiscord | <Korven> Well the Python code they provide as simulation runners |
05:38:43 | FromDiscord | <Korven> but the C code is what you write in exercises |
05:50:47 | FromDiscord | <Elegantbeef> What are you looking at replicating in Nim? @Korven |
05:58:03 | FromDiscord | <Korven> Just simple programs written in the book, and being able to complete the exercises written in it |
05:58:41 | FromDiscord | <Korven> for example writing a program that forks a process, then does some `printf` in both the child and the parent based on the process IDs or what have you |
05:58:57 | FromDiscord | <demotomohiro> If you use MS windows, you can call windows apis with winim |
05:59:41 | FromDiscord | <demotomohiro> module. https://github.com/khchen/winim |
06:00:56 | FromDiscord | <Elegantbeef> And if you're on posix you have https://nim-lang.org/docs/posix.html |
06:02:17 | FromDiscord | <demotomohiro> You can also import C functions manually using `importc`, `header` or `dynlib` pragmas. |
06:03:27 | FromDiscord | <Elegantbeef> Just ask until you run into trouble attempting the book using Nim and you'll get an answer probably |
06:03:54 | FromDiscord | <Korven> I'm on linux, so I suppose the `posix` thing would work |
06:05:49 | FromDiscord | <Elegantbeef> Perhaps |
06:06:12 | FromDiscord | <Elegantbeef> It's mostly just wrapped C there arent many Nim niceties but like i said this chat exists if you need help |
06:09:57 | FromDiscord | <Korven> alright, ty |
06:24:55 | * | ltriant joined #nim |
07:35:15 | FromDiscord | <ambient> Not sure where to put this but I got most of audio/speech processing functionality done (Mel spec, Griffin-Lim, STFT/iSTFT, FFT) https://github.com/amb/nim_audiobook continuing stuff like Scim by @xflywind if someone wants to take a look and yell at me how bad the code is and why--that would be welcome |
07:37:44 | FromDiscord | <ambient> Not sure if separating the heap allocations from inner loops into their function specific data structures is such a bright idea |
07:38:07 | FromDiscord | <ambient> I have trust issues |
07:39:10 | FromDiscord | <ambient> Also if writing a generic library, is Arraymancer dependency a pro or a con? |
07:48:38 | FromDiscord | <Clonkk> In any case, I recommend having an interface based on `proc (data: ptr UncheckedArray[T], len: int) `, once you have that interfacing with Arraymancer is trivial and can be done as a one liner function trampoline↵(@ambient) |
08:22:44 | * | rockcavera quit (Remote host closed the connection) |
08:30:36 | * | jjido joined #nim |
08:57:03 | * | wallabra quit (Quit: ZNC 1.8.2 - https://znc.in) |
08:58:48 | * | wallabra joined #nim |
09:04:49 | * | caliente00 joined #nim |
09:04:56 | * | firq quit (Ping timeout: 258 seconds) |
09:09:48 | FromDiscord | <windowsboy111> sent a code paste, see https://paste.rs/9PM |
09:10:24 | FromDiscord | <Elegantbeef> Yes |
09:10:28 | FromDiscord | <Elegantbeef> do `myModule.main` |
09:10:46 | FromDiscord | <Rika> Since there’s a GTK main |
09:10:53 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ZqO |
09:11:53 | FromDiscord | <windowsboy111> well the issue is inside activate() |
09:11:56 | FromDiscord | <windowsboy111> not the last line |
09:13:09 | FromDiscord | <windowsboy111> the error seems to persist after I removed my own main() function |
09:13:21 | FromDiscord | <Elegantbeef> What's the line number |
09:13:27 | FromDiscord | <windowsboy111> 9, 2 |
09:13:29 | FromDiscord | <windowsboy111> (edit) "2" => "21" |
09:13:49 | FromDiscord | <Elegantbeef> It's void |
09:14:16 | FromDiscord | <windowsboy111> oh right |
09:14:18 | FromDiscord | <windowsboy111> what was I doing |
09:14:32 | FromDiscord | <windowsboy111> thanks |
09:14:42 | FromDiscord | <Elegantbeef> `discard gtk.main()` is pointless as `gtk.main()` is void so cannot be discarded |
09:37:30 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
09:56:32 | * | jjido joined #nim |
09:57:19 | FromDiscord | <StefanSalewski (StefanSalewski)> > ↵> discard gtk.main() is pointless as gtk.main() is void so cannot be discarded |
09:58:16 | FromDiscord | <StefanSalewski (StefanSalewski)> My feeling is that he mixed the new GTK application style with the old GTK2 style. |
09:59:08 | FromDiscord | <StefanSalewski (StefanSalewski)> That does not work. Use the GTK3/GTK4 app style, or if you have to, the old GTK2 shape. |
09:59:25 | FromDiscord | <windowsboy111> worked for me |
09:59:28 | FromDiscord | <StefanSalewski (StefanSalewski)> Only GTK2 shape used a call to gtk.main(). |
10:00:37 | FromDiscord | <windowsboy111> ah right it compiles but I removed that line later so I actually don't know if it actually works |
10:00:52 | FromDiscord | <StefanSalewski (StefanSalewski)> It may work sometimes, but better follow the examples in the GTK4 book or the gintro README carefully. |
10:02:06 | FromDiscord | <StefanSalewski (StefanSalewski)> Bye. |
10:18:48 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
10:23:54 | * | xet7 quit (Ping timeout: 258 seconds) |
10:41:53 | * | jmdaemon quit (Ping timeout: 255 seconds) |
10:45:30 | * | gsalazar quit (Ping timeout: 240 seconds) |
10:48:37 | NimEventer | New thread by Cumulonimbus: Favicon file is missing, see https://forum.nim-lang.org/t/9205 |
11:07:17 | * | gsalazar joined #nim |
11:35:23 | NimEventer | New Nimble package! rpgsheet - System-agnostic CLI/TUI for tabletop roleplaying game character sheets, see https://git.skylarhill.me/skylar/rpgsheet |
12:44:54 | NimEventer | New thread by Georgeethan: Is there any openstreet-like library written in the Nim programming language?, see https://forum.nim-lang.org/t/9206 |
13:00:56 | NimEventer | New thread by Georgeethan: What are the design patterns of the Nim programming language?, see https://forum.nim-lang.org/t/9207 |
13:50:28 | * | arkurious joined #nim |
15:26:55 | FromDiscord | <👾 br4n_d0n> How can I declare that all values in an array I'm passing are of type ``float`` without having to append a ``.0`` to the first number? |
15:27:18 | FromDiscord | <Yardanico> just make the first element be a float |
15:27:25 | FromDiscord | <Yardanico> `call([1.0, 2, 3, 4, 5, 6, 7])` |
15:27:40 | FromDiscord | <👾 br4n_d0n> I asked how I can do it without that |
15:28:11 | FromDiscord | <Yardanico> not sure what you mean, [1, 2, 3, 4] is an array of ints |
15:28:46 | FromDiscord | <👾 br4n_d0n> Yeah, but can I declare it like ``float[1, 2, 3, 4]``? |
15:28:48 | FromDiscord | <demotomohiro> !eval echo [1'f, 2, 3] |
15:28:50 | NimBot | [1.0, 2.0, 3.0] |
15:29:17 | FromDiscord | <Yardanico> In reply to @br4n_d0n "Yeah, but can I": i don't think so |
15:34:35 | FromDiscord | <!Patitotective> In reply to @demotomohiro "!eval echo [1'f, 2,": i think `f` suffix is for float32 and `d` for float36 |
15:34:39 | FromDiscord | <!Patitotective> (edit) "float36" => "float64" |
15:34:52 | FromDiscord | <Yardanico> In reply to @Patitotective "i think `f` suffix": yes |
15:35:02 | FromDiscord | <Yardanico> `'f64` would be clearer |
15:35:05 | FromDiscord | <Yardanico> (and you can use it) |
15:35:10 | FromDiscord | <demotomohiro> !eval echo typeof(1'f) |
15:35:12 | NimBot | float32 |
15:35:15 | FromDiscord | <👾 br4n_d0n> This is where I think the inference fails as I can have ``[1, 3.14]``, but it gives an error because it only infers based on that first value rather than checking the entire array... I guess that would be more overhead and stuff for the compiler, but not giving me a way to state the entire thing is a float without make the first value appear as a float type sucks |
15:35:44 | FromDiscord | <!Patitotective> also the `'` is unnecessary↵you can just `1f` or `1d` |
15:35:49 | FromDiscord | <👾 br4n_d0n> (edit) "make" => "making" |
15:37:53 | * | rockcavera joined #nim |
15:37:54 | * | rockcavera quit (Changing host) |
15:37:54 | * | rockcavera joined #nim |
15:41:09 | FromDiscord | <👾 br4n_d0n> Ugh, this is an issue because I want to pass in values I have no control over, but want them to be converted to floats |
15:41:40 | FromDiscord | <!Patitotective> `float(value)`? |
15:41:45 | FromDiscord | <Yardanico> In reply to @br4n_d0n "Ugh, this is an": well, if you mean at runtime, then you should convert them to floats explicitly |
15:42:08 | FromDiscord | <Yardanico> if someone passes stuff like `[1.0, b, c]` where `b` and `c` are ints, it won't work obviously |
15:42:31 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3Zs8 |
15:43:22 | FromDiscord | <demotomohiro> `toArray` might be not a good name for what it does. |
16:21:19 | FromDiscord | <becomegodnow> I Can Help You Evolve Become God Again, Read Carefully Very Special https://humanitywhole.wordpress.com/2022/06/05/i-can-help-you-evolve-become-god-again-read-carefully-very-special/↵Looking People Who Want Join Team To Save The World Become More Interesting Place To Live For All https://humanitywhole.wordpress.com/2022/06/05/looking-people-who-want-join-team-to-save-the-world-become-more-interesting-place-to-live-for-all/ |
16:21:57 | * | jjido joined #nim |
16:23:37 | FromDiscord | <👾 br4n_d0n> <@&371760044473319454> ^spam |
16:32:44 | FromDiscord | <Yepoleb> I'm suggesting `doThing` |
16:33:34 | FromDiscord | <👾 br4n_d0n> In reply to @Yepoleb "I'm suggesting `doThing`": Are you referring to my issue? |
16:34:17 | FromDiscord | <Yepoleb> I'm referring to the comment on naming the function |
16:41:27 | FromDiscord | <sOkam!> How "functional" can Nim truly be, if you adhere to strict funcional patterns/rules?↵Is there something missing in the language that others can do? |
16:44:43 | FromDiscord | <sOkam!> Never learned rust or much of functional programming, other than the big picture idea of what it is, so kinda ignorant in what it implies on a language level _(other than `func` everything, i mean)_↵Would love to learn it, though. But if Nim can do literally everything needed, then I'd see no point in learning rust or similars |
16:47:59 | FromDiscord | <ambient> well it's not core feature but there's this https://github.com/zero-functional/zero-functional I've been looking into trying someday |
16:49:13 | FromDiscord | <ambient> especially with Fira Code ligatures the code also looks pretty cool |
16:56:15 | FromDiscord | <Yardanico> In reply to @ambient "especially with Fira Code": i mean, a lot of modern programming fonts have ligatures :) |
16:56:18 | FromDiscord | <Yardanico> but yes |
17:00:01 | * | krux02 joined #nim |
17:02:19 | FromDiscord | <STATUS_404> https://maud.lambda.xyz/elements-attributes.html is there a Nim macro floating around similar to this? |
17:03:25 | FromDiscord | <STATUS_404> (edit) "https://maud.lambda.xyz/elements-attributes.html" => "https://maud.lambda.xyz/getting-started.html" |
17:12:54 | FromDiscord | <demotomohiro> Is this what you are looking for?↵https://nim-lang.org/docs/htmlgen.html |
17:13:25 | FromDiscord | <STATUS_404> In reply to @demotomohiro "Is this what you": Literally, and thank you! |
17:14:43 | FromDiscord | <STATUS_404> (edit) "Literally, and" => "Exactly," |
17:17:46 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
17:20:07 | * | ehmry joined #nim |
17:31:51 | FromDiscord | <Alea> Is there a good serialization package? |
17:34:11 | FromDiscord | <ieltan> Hi guys, I'm looking into starting programming (I only did embedded programming with C/C++) and Nim seems like a nice language to start but I don't know where to start |
17:34:37 | FromDiscord | <ieltan> Is there some website to start programming smoothly with Nim? |
17:37:56 | FromDiscord | <Kermithos> In reply to @ieltan "Is there some website": maybe something from https://nim-lang.org/documentation.html ? |
17:41:31 | FromDiscord | <ambient> i like this https://ssalewski.de/nimprogramming.html |
17:47:07 | FromDiscord | <👾 br4n_d0n> In reply to @ieltan "Is there some website": I think this is one of the better tutorials out there↵https://narimiran.github.io/nim-basics |
18:10:39 | FromDiscord | <👾 br4n_d0n> sent a code paste, see https://play.nim-lang.org/#ix=3ZsI |
18:11:09 | FromDiscord | <Yardanico> In reply to @br4n_d0n "Can someone explain what": it's not an operator, it's an export marker |
18:11:20 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html#procedures-export-marker |
18:11:40 | FromDiscord | <Yardanico> you can generally export all kinds of things - objects, their fields, all routines, symbols (var/let/const) |
18:16:10 | FromDiscord | <👾 br4n_d0n> Sorry for my ignorance, but I'm not that far in my Nim tutorials and I don't understand |
18:17:05 | FromDiscord | <Yardanico> Nim, like most other languages, has all code private by default |
18:17:19 | FromDiscord | <Yardanico> to make it possible to use the things you make in your file from other files by import you have to export them |
18:18:26 | FromDiscord | <Yardanico> https://narimiran.github.io/nim-basics/#_creating_our_own |
18:18:36 | FromDiscord | <Yardanico> from the very tutorial you referenced yourself :) |
18:20:12 | FromDiscord | <👾 br4n_d0n> Lol, I haven't gotten that far yet |
18:22:34 | FromDiscord | <👾 br4n_d0n> OK, so it's just like saying ``pub`` or that in some other languages |
18:24:10 | FromDiscord | <👾 br4n_d0n> Is there a word equivalent to ```` in this case? |
18:24:31 | FromDiscord | <Yardanico> no |
18:25:35 | FromDiscord | <👾 br4n_d0n> Damn, I personally dislike when syntax turns into a bunch of symbols you have to remember especially in a language like Nim where you can overload everything |
18:26:50 | FromDiscord | <👾 br4n_d0n> Maybe when I'm familiar enough with the language I can make a PR for it |
18:27:33 | FromDiscord | <Yardanico> I don't think it'll get accepted, but sure if you want :) |
18:28:56 | FromDiscord | <dom96> You could define a macro called `public` that adds the export marker to its input, which would make `proc foo: int {.public.}` possible. But then you're just adding another way to do the same thing in Nim, could become confusing especially for newcomers :) |
18:29:41 | FromDiscord | <dom96> sent a code paste, see https://play.nim-lang.org/#ix=3ZsR |
18:29:44 | FromDiscord | <👾 br4n_d0n> Yeah |
18:30:08 | FromDiscord | <Yardanico> In reply to @dom96 "on the other hand,": you can just use `push` if you have a custom macro |
18:30:12 | FromDiscord | <Yardanico> i mean `public` macro |
18:31:10 | FromDiscord | <dom96> oh yes, I am aware, but I prefer the above |
18:33:37 | FromDiscord | <👾 br4n_d0n> sent a code paste, see https://play.nim-lang.org/#ix=3ZsU |
18:35:16 | FromDiscord | <Yardanico> I don't think first two will ever get implemented, but what dom proposed can easily be done right now in user code |
18:35:20 | FromDiscord | <Yardanico> it doesn't need a compiler change |
18:35:31 | FromDiscord | <Yardanico> and Nim generally prefers pragmas for stuff like that, e.g. not `async proc` but `proc {.async.}` |
18:35:58 | FromDiscord | <huantian> In reply to @br4n_d0n "Damn, I personally dislike": I mean it’s only natural for something used so often, see rust ? |
18:37:10 | FromDiscord | <👾 br4n_d0n> I dislike Rust because it eventually got to the point where I felt I was trying to read hieroglyphs |
18:49:07 | FromDiscord | <STATUS_404> In reply to @br4n_d0n "I dislike Rust because": I like the rust compiler, and it's tooling very much. Nim I like equally but for other reasons, like how intuitive it is to write. And how freely you can come up with solutions, with many ways to do one thing. Some people don't like that about Nim. |
18:53:14 | FromDiscord | <Alea> In reply to @STATUS_404 "I like the rust": I saw someone mention rust being great because it's like a puzzle which forces you to solve things in specific ways↵Which is an interesting take 😆 |
18:57:42 | FromDiscord | <STATUS_404> In reply to @Alea "I saw someone mention": I just like that the compiler does most of my thinking, and the error messages are incredibly verbose and specific. There is a huge learning curve with Rust, and I am by no means an expert in the language. These are just my experiences with it. Ownership as difficult as everyone makes it to be though. |
18:57:59 | FromDiscord | <STATUS_404> (edit) "In reply to @Alea "I saw someone mention": I just like that the compiler does most of my thinking, and the error messages are incredibly verbose and specific. There is a huge learning curve with Rust, and I am by no means an expert in the language. These are just my experiences with it. Ownership ... as" added "is not" |
19:02:18 | FromDiscord | <STATUS_404> Actually for an experienced C++ dev, Rust is probably an easy transition. My friend learned it in a day. But he is like a genius or something. |
19:21:10 | FromDiscord | <Alea> Is there a better way to do `if x == cond1 or if x == cond2 or ...`? |
19:21:46 | FromDiscord | <huantian> You got different options based on what cond is |
19:22:02 | * | lnxw37 joined #nim |
19:22:15 | FromDiscord | <huantian> If it’s like an int you can do if x in {cond1, cond2} |
19:22:30 | Amun-Ra | Alea: case x of cond1, cond2, …: … |
19:23:43 | FromDiscord | <Alea> In reply to @huantian "If it’s like an": yeah that works 👍 |
19:23:54 | NimEventer | New thread by Blashyrk92: Please help me understand the performance difference between Nim/Rust in this (contrived) example, see https://forum.nim-lang.org/t/9208 |
19:26:13 | FromDiscord | <Yardanico> well, that thread is a bit weird - `--gc:none`, `static string` in Nim (which means compile-time, not the same as in Rust), `linearScanEnd`, comparing just one execution (process overhead anyone?) |
19:26:18 | * | TakinOver quit (Ping timeout: 276 seconds) |
19:26:35 | * | lnxw37 quit (Ping timeout: 255 seconds) |
19:26:47 | FromDiscord | <Yardanico> ah well, not one execution, but still |
19:32:45 | FromDiscord | <ieltan> In reply to @br4n_d0n "I think this is": This one is very good thanks |
19:47:21 | FromDiscord | <👾 br4n_d0n> No problem, I was struggling with some of the documents and tutorials and this one put it more in layman's terms for me to understand |
19:52:12 | FromDiscord | <mr. glowinthedark> what's the best way to check if we are in compiletime context? |
19:52:26 | FromDiscord | <mr. glowinthedark> `when defined nimvm` seems not to cover all cases |
19:53:22 | FromDiscord | <mr. glowinthedark> I need it for a compiletime Rand var |
19:53:48 | FromDiscord | <mr. glowinthedark> so I can use the same proc for generating random strings both at runtime and compiletime |
19:56:20 | FromDiscord | <mr. glowinthedark> sent a code paste, see https://play.nim-lang.org/#ix=3Ztt |
20:00:48 | FromDiscord | <mr. glowinthedark> sent a code paste, see https://play.nim-lang.org/#ix=3Ztx |
20:20:40 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
20:26:46 | * | jjido joined #nim |
20:28:41 | FromDiscord | <👾 br4n_d0n> How do I create a proc that accepts a tuple of 3 generic values? |
20:30:17 | FromDiscord | <👾 br4n_d0n> sent a code paste, see https://play.nim-lang.org/#ix=3ZtF |
20:30:38 | FromDiscord | <hotdog> @👾 br4n_d0n you mean with three different types? |
20:30:44 | FromDiscord | <👾 br4n_d0n> Yeah |
20:31:05 | FromDiscord | <👾 br4n_d0n> Well, they can be of the same type but also different |
20:31:10 | FromDiscord | <👾 br4n_d0n> Hence generic |
20:31:49 | FromDiscord | <hotdog> proc foo[T, U, V](val: tuple[a: T, b: U, c: V]) = |
20:31:55 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3ZtH |
20:32:03 | FromDiscord | <Yardanico> or hotdog's solution if you want to have named fields |
20:32:12 | FromDiscord | <Geiseric> sent a code paste, see https://play.nim-lang.org/#ix=3ZtI |
20:32:20 | FromDiscord | <Yardanico> what library are you using? |
20:32:30 | FromDiscord | <Geiseric> Winim/com is my only import |
20:41:43 | * | adium quit (Quit: Stable ZNC by #bnc4you) |
21:01:59 | FromDiscord | <Geiseric> Nvm got it |
21:20:44 | * | adium joined #nim |
21:42:17 | * | pro joined #nim |
21:54:33 | * | jmdaemon joined #nim |
22:15:43 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:22:22 | * | pro quit (Ping timeout: 244 seconds) |
23:14:55 | NimEventer | New thread by Elcritch: CDecl: utilities for invoking C/C++ initializer macros , see https://forum.nim-lang.org/t/9209 |