00:13:56 | * | xet7 quit (Ping timeout: 260 seconds) |
00:22:05 | * | xet7 joined #nim |
02:11:47 | NimEventer | New thread by alexeypetrushin: Why not use AI to create momentum in Nim?, see https://forum.nim-lang.org/t/11601 |
02:51:40 | * | beholders_eye quit (Ping timeout: 260 seconds) |
03:05:15 | FromDiscord | <.bobbbob> using norm with sqlite, what's the RIght Way™️ to retry inserting something when DbError: database is locked ie something is concurrently being inserted? |
03:25:40 | * | xet7 quit (Remote host closed the connection) |
05:01:49 | * | xet7 joined #nim |
05:05:02 | * | xet7 quit (Remote host closed the connection) |
05:05:32 | * | xet7 joined #nim |
05:26:12 | FromDiscord | <.bobbbob> sent a code paste, see https://play.nim-lang.org/#pasty=guIUJsUu |
05:28:53 | FromDiscord | <Phil> In reply to @.bobbbob "is this a remotely": No because you can crash your server like that or let your user wait forever for a response. Write yourself a template that does a couple retries and give up after that. ↵If this does not suffice you should solve the underlying problem that causes your dB to be locked all the time |
05:30:49 | FromDiscord | <.bobbbob> In reply to @isofruit "No because you can": Sounds good, should I maybe put a teensy pause between retries? It's not all the time, it just very occasionally loses stuff when two things are inserted at the same time. |
05:33:15 | FromDiscord | <Phil> In reply to @.bobbbob "Sounds good, should I": That's up to you. If you do that I'd try to do that with sleep async to not block the thread (if your underlying Webserver can process multiple requests on the same thread via async). |
05:35:18 | FromDiscord | <Phil> If you do that with sleep keep in mind that sleep will block the thread and make the request take longer than it usually would. ↵For reference, for simple insertions the time spent on your server (given an sqlite dB) is roughly 1-10ms.↵If you sleep for 10ms that means you now need double the threads for the same amount of requests. ↵Could be fine in low request load scenarios, could be bad |
05:36:21 | FromDiscord | <.bobbbob> I guess the right way is to check if the database is locked and insert it once it's not but I don't see a way to do that with norm |
05:36:43 | FromDiscord | <Phil> You can use raw SQL assuming that can be queried |
05:38:11 | FromDiscord | <Phil> Actually, how many connections do you use? |
05:44:05 | FromDiscord | <.bobbbob> I think one per thread? |
05:48:57 | * | rockcavera quit (Remote host closed the connection) |
06:03:41 | * | SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev) |
06:04:04 | * | SchweinDeBurg joined #nim |
06:20:12 | * | def- quit (Quit: -) |
06:20:28 | * | def- joined #nim |
06:38:05 | FromDiscord | <.bobbbob> I think Im gonna have to rework a lot of my code to use transactions too |
06:45:41 | * | ntat joined #nim |
06:59:00 | * | xet7 quit (Ping timeout: 260 seconds) |
07:10:52 | * | xet7 joined #nim |
07:12:25 | FromDiscord | <Phil> In reply to @.bobbbob "I think Im gonna": Wait, do you have multiple queries that depend on one another and you aren't putting them in transactions? |
07:13:00 | FromDiscord | <Phil> Then that's definitely the point to start on.↵Transactions are the absolute baseline you must be using (when you need them) to ensure correctness. |
07:13:50 | FromDiscord | <Phil> Generally I'd recommend writing a template that starts and ends the transaction within a scope automatically so you can't possibly forget to close it |
07:19:53 | * | ntat quit (Quit: Leaving) |
07:30:47 | FromDiscord | <.bobbbob> who would've thought concurrent database programming was tricky |
07:45:27 | FromDiscord | <Phil> Me, I would've thought that ↵PTSD flashes in the background |
07:55:25 | FromDiscord | <thatben> sent a code paste, see https://play.nim-lang.org/#pasty=ohQHBiOX |
08:29:31 | FromDiscord | <demotomohiro> At compile time, write C code that uses the symbols you want to check then compile it by calling C compiler with `gorgeEx`.↵If it compiles without errors, you have the symbols. |
08:30:40 | FromDiscord | <demotomohiro> In reply to @thatben "Hi! I'm trying to": I forgot to reply. |
08:36:26 | FromDiscord | <thatben> Thanks, I'll give that a try rightaway |
08:49:23 | FromDiscord | <pusewicz> sent a code paste, see https://play.nim-lang.org/#pasty=LyirlfQu |
08:54:37 | FromDiscord | <Elegantbeef> You made a cyclical data type and hit an orc bug. On an off chance try `--d:useMalloc` |
08:58:07 | FromDiscord | <Elegantbeef> Seems it's fixed in devel |
08:58:16 | FromDiscord | <Elegantbeef> Just an orc issue and unrelated to the allocator |
08:58:51 | FromDiscord | <Elegantbeef> Though refc is lame you could also just do `--mm:refc` and avoid that cyclical issue |
08:59:50 | FromDiscord | <Elegantbeef> The cool stylish solution is to avoid cyclical data types but using an a `seq` and storing indexes into that instead of referencces |
08:59:58 | FromDiscord | <Elegantbeef> But yea orc does work with devel and this is a bug |
09:04:00 | FromDiscord | <demotomohiro> In reply to @pusewicz "https://github.com/pusewicz/wave-function-collapse-": https://github.com/pusewicz/wave-function-collapse-nim/blob/main/src/model.nim#L182↵This code looks wrong as `index` can equal to `lowestEntropyCells.len`.↵I think `sample` proc is better: https://nim-lang.org/docs/random.html#sample%2CopenArray%5BT%5D |
09:14:27 | FromDiscord | <pusewicz> Oooh, there is sample, nice! |
09:18:35 | FromDiscord | <pusewicz> In reply to @demotomohiro "https://github.com/pusewicz/wave-function-collapse-": This solved the issue, thanks! |
09:19:03 | FromDiscord | <pusewicz> In reply to @Elegantbeef "The cool stylish solution": Yeah, I'm trying to get this whole thing to work, and then figure out ways to improve it. I'll definitely will be asking for some code reviews! 😄 |
09:20:34 | FromDiscord | <ringabout> How I can configure a new gcc compiler for Nim compiler.?I want to switch to `/usr/bin/gcc-14` |
09:23:47 | FromDiscord | <ringabout> It seems that I need to change gcc.exe in `congig/nim.cfg` |
09:26:02 | FromDiscord | <bandithedoge> use the `--cc` option↵(@ringabout) |
09:26:15 | FromDiscord | <bandithedoge> https://nim-lang.org/docs/nimc.html#compiler-usage-commandminusline-switches it's here under advanced options |
09:26:23 | * | krux02 joined #nim |
09:30:27 | FromDiscord | <ringabout> I don't think this will work |
09:30:41 | FromDiscord | <ringabout> Anyway I changed `compilerExe: "gcc-14"` which works for me |
10:00:13 | * | def- quit (Quit: -) |
10:00:40 | * | def- joined #nim |
10:03:35 | * | def- quit (Client Quit) |
10:03:56 | * | def- joined #nim |
10:15:55 | * | gst joined #nim |
11:25:22 | * | ntat joined #nim |
12:02:19 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=bMXmGYmO |
12:02:46 | * | beholders_eye joined #nim |
12:03:01 | FromDiscord | <System64 ~ Flandre Scarlet> So it can either return a Tilemap or a Bitmap? |
12:12:17 | * | krux02 quit (Remote host closed the connection) |
12:12:33 | FromDiscord | <demotomohiro> When return type is `or` type class, return type must be determined at compile time. |
12:13:44 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=XgdvEaui |
12:17:31 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=wXfKIOel |
12:18:01 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @demotomohiro "In your case, unless": My code still compiles 🤔 |
12:20:33 | FromDiscord | <System64 ~ Flandre Scarlet> What can I do if a function can return either a Tilemap or a Bitmap on runtime? |
12:21:37 | FromDiscord | <odexine> In reply to @sys64 "What can I do": Object variant |
12:23:40 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "Object variant": https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants↵This? |
12:24:20 | FromDiscord | <odexine> Yes |
12:25:09 | FromDiscord | <System64 ~ Flandre Scarlet> So I can basically do a LayerItem object and depending of the type, I can set the right field? |
12:27:15 | FromDiscord | <odexine> I think you got the right thinking yes |
12:27:40 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "I think you got": Oh alright, and does it have to be a ref object? |
12:27:46 | FromDiscord | <odexine> No |
12:28:13 | FromDiscord | <odexine> References only needed when the object stores itself |
12:31:27 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright↵Nim is quite neat, you can replicate some kind of dynamic typing |
12:37:36 | * | def- quit (Quit: -) |
12:38:08 | * | def- joined #nim |
12:40:22 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=yqnStYvN |
12:45:27 | FromDiscord | <System64 ~ Flandre Scarlet> Now can I access the Kind parameter? |
12:45:39 | FromDiscord | <System64 ~ Flandre Scarlet> like myLayerItem.kind? |
12:58:41 | FromDiscord | <odexine> Yeah, its just another field |
12:58:51 | FromDiscord | <odexine> But you can’t assign after construction |
13:01:04 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "But you can’t assign": Is it for all the fields? |
13:01:26 | FromDiscord | <System64 ~ Flandre Scarlet> Or only the kind field? |
13:02:19 | FromDiscord | <odexine> In reply to @sys64 "Or only the kind": This |
13:02:35 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright↵Makes sense |
13:17:59 | * | rockcavera joined #nim |
13:31:11 | * | beholders_eye quit (Ping timeout: 264 seconds) |
13:39:18 | * | beholders_eye joined #nim |
13:41:50 | * | disso-peach joined #nim |
13:49:39 | * | def- quit (Quit: -) |
13:49:51 | * | def- joined #nim |
13:50:59 | FromDiscord | <bung8954> `is not GC-safe as it performs an indirect call` is this certain or just possible ? |
14:02:25 | * | gst quit (Quit: Client closed) |
14:05:50 | FromDiscord | <threefour> When I had that, I had to add the `{.gcsafe.}` pragma to the caller function to reveal what the actual issue was with indirectly-called function. |
14:09:16 | FromDiscord | <bung8954> my dependent lib cause this, it use json key store function name, seems safe, but am not sure safe to use cast forced mark it safe or not |
14:11:02 | * | def- quit (Quit: -) |
14:11:27 | * | def- joined #nim |
14:53:35 | * | beholders_eye quit (Ping timeout: 256 seconds) |
15:00:54 | * | def- quit (Quit: -) |
15:01:44 | NimEventer | New thread by Hobbyman: Conversion-to-string-function is hard to find, see https://forum.nim-lang.org/t/11605 |
15:04:25 | * | def- joined #nim |
15:14:52 | FromDiscord | <grumblygibson> In reply to @odexine "But you can’t assign": @System64 ~ Flandre Scarlet ↵In C++ you can assign variants after construction, which is very powerful. Nim is "safe by default" and does not let you modify after construction to change the type, but always lets you trade brevity for power if you really want to do that.↵https://nim-lang.org/docs/manual.html#types-cast-uncheckedassign |
15:32:31 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @grumblygibson "<@380360389377916939> In C++": Quite interesting |
15:32:43 | FromDiscord | <System64 ~ Flandre Scarlet> And C++ has variants too? |
15:37:00 | * | beholders_eye joined #nim |
15:46:39 | FromDiscord | <System64 ~ Flandre Scarlet> Didn't even knew that↵Well, C++ is (VERY) complex |
15:53:52 | FromDiscord | <grumblygibson> Just FYI because it's interesting, c++ also has views, iterators (generators), and slices (spans). It's pretty great, but still unsafe by default, and quite verbose. cpp2 pushes cpp closer to nim-like with the safe by default and laconic syntax philosophy. |
15:55:37 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @grumblygibson "Just FYI because it's": Wait CPP2 exists? |
15:56:40 | FromDiscord | <grumblygibson> cpp2 is an experimental front end for c++ exploring what the syntax could be like. it generates c++ and compiles for you in the back end, a lot like nim and C. It's being actively developed. |
15:57:54 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @grumblygibson "cpp2 is an experimental": https://github.com/hsutter/cppfront↵Is it that? |
15:59:16 | FromDiscord | <System64 ~ Flandre Scarlet> And can we already use CPP2? |
16:00:26 | FromDiscord | <grumblygibson> As I understand it, it lacks some of the fancier c++ stuff, but most things are already implemented. |
16:01:07 | FromDiscord | <grumblygibson> just look at the commit history timestamps. the energy is impressive |
16:01:14 | * | xet7 quit (Ping timeout: 268 seconds) |
16:05:33 | FromDiscord | <System64 ~ Flandre Scarlet> What about the build system and library management? |
16:05:35 | FromDiscord | <grumblygibson> one thing cpp2 has I wish nim had, which is a better gradual workflow for how to migrate to the new language from existing code. cpp2 is a modular seamless drop-in, allowing heterogeneous code in c++ and cpp2, even within the same file. I'd love nim tooling to get to a point allowing something like this. |
16:06:15 | FromDiscord | <grumblygibson> In reply to @sys64 "What about the build": I don't think they touch that, existing tools will keep working for those needs. |
16:08:52 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright↵I don't really like the build and library workflow of C++ |
16:12:59 | * | xet7 joined #nim |
16:22:21 | FromDiscord | <System64 ~ Flandre Scarlet> nimble does its job quite well |
16:25:50 | * | coldfeet joined #nim |
16:34:15 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=EwemoerA |
16:37:30 | FromDiscord | <System64 ~ Flandre Scarlet> Imo it just complexifies the API |
16:55:05 | * | disso-peach quit (Quit: Leaving) |
17:13:23 | * | def- quit (Quit: -) |
17:13:39 | * | def- joined #nim |
17:28:24 | * | coldfeet quit (Remote host closed the connection) |
18:06:08 | * | def- quit (Quit: -) |
18:23:51 | * | def- joined #nim |
18:46:52 | * | krux02 joined #nim |
18:58:27 | * | xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1 - https://znc.in) |
18:59:20 | * | xutaxkamay joined #nim |
19:18:54 | FromDiscord | <xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=trykJJjr |
19:29:11 | FromDiscord | <rakgew> @xkonti \: thx for the new nim stream/videos (-\: |
19:34:54 | FromDiscord | <xkonti> In reply to @rakgew "<@244832576215318528> \: thx for": ♥️ I'm happy to hear some find them useful! |
19:36:06 | FromDiscord | <solitudesf> In reply to @xkonti "Has anybody used the": `export dir except getPath, setPath` |
19:36:15 | FromDiscord | <solitudesf> In reply to @xkonti "Has anybody used the": the same as import |
19:36:49 | FromDiscord | <xkonti> Aaaah... I thought it'd be `export dir except [getPath, setPath]`. Silly me 🤪 |
19:37:30 | FromDiscord | <xkonti> @solitudesf What if I have 2 overloads of `getPath` and I want to exclude only a specific one? I know I'm pushing it... |
19:38:38 | FromDiscord | <solitudesf> In reply to @xkonti "<@104136074569211904> What if I": cant be bothered to test it, but i think if your provide the argument list it should work |
19:38:53 | FromDiscord | <xkonti> Ok. I'll try it 🙂 |
19:41:03 | FromDiscord | <xkonti> Instantly turning into errors. I guess that functionality would be a stretch. |
19:41:19 | FromDiscord | <rakgew> for sure. went through the short ones already, now I am looking into the longer stream recordings.↵(@xkonti) |
19:42:18 | * | krux02 quit (Quit: Leaving) |
19:45:39 | FromDiscord | <xkonti> In reply to @rakgew "for sure. went through": That's great to hear! Tonight will be another stream focusing on the `commonFs` and `osFs`. I'm doing some organizing in the project now so that it's easier to follow.↵I plan to make more short videos (10-20min), where I focus on a single topic and cover EVERYTHING about it (unlike the usual tutorials). Also I hope to make some videos that cover some smaller specific projects. But that will |
19:52:49 | FromDiscord | <rakgew> very nice - looking forward!↵really happy to see a stream where a nim project gets built from scratch. |
19:54:37 | FromDiscord | <xkonti> I hope it's obvious that I have no idea what I'm doing 😅 |
19:55:00 | FromDiscord | <.lisuwu_> In reply to @xkonti "I hope it's obvious": hey you'll get over it eventually |
19:55:33 | FromDiscord | <.lisuwu_> just have some self confidence :P |
19:56:01 | FromDiscord | <xkonti> In reply to @.lisuwu_ "hey you'll get over": That's why I decided to live-stream. Forces me to try explain things I don't understand instead of rage-quitting 😂 |
19:56:16 | FromDiscord | <.lisuwu_> creative idea actually |
19:56:29 | FromDiscord | <.lisuwu_> you have no choice but to go through the pain |
19:56:45 | FromDiscord | <xkonti> Yup... |
20:00:43 | FromDiscord | <rakgew> well you bring experience from other languages, which is vecry interesting to see.↵(@xkonti) |
20:01:03 | * | ntat quit (Quit: Leaving) |
20:02:07 | FromDiscord | <rakgew> dong a good job, as far as I seen. (-\:↵(@xkonti) |
20:04:34 | FromDiscord | <xkonti> That's what's fun about learning new programming languages. You notice similarities, differences, and what consequences those changes bring. Gives you a different perspective on what you already know. |
20:05:29 | FromDiscord | <xkonti> Currently I'm upset that Primeagen is learning Zig instead of Nim 😠 |
20:07:53 | FromDiscord | <rakgew> sad to hear that. his "review" of nim 2.0 release I found a little strange. |
20:08:41 | FromDiscord | <rakgew> right on.↵(@xkonti) |
20:27:57 | FromDiscord | <pmunch> @rakgew if you want more Nim stream content you might enjoy mine: https://youtube.com/@peterme |
20:33:13 | FromDiscord | <rakgew> @pmunch thank you - I did already, quite enjoyed your streams and videos! \:-D |
20:36:03 | FromDiscord | <rakgew> ..also\: every advent of code I hope for pmunch content. (-; |
21:38:44 | * | def- quit (Quit: -) |
21:39:06 | * | def- joined #nim |
22:01:09 | * | def- quit (Quit: -) |
22:02:23 | * | def- joined #nim |
22:05:13 | FromDiscord | <System64 ~ Flandre Scarlet> Is it normal I always have this? https://media.discordapp.net/attachments/371759389889003532/1240424776695156757/image.png?ex=66468318&is=66453198&hm=94f3230be04300c7cd46276bcfe0aff60a7159ece872c00529ccf0834eab35ed& |
22:25:04 | FromDiscord | <jmgomez> In reply to @sys64 "Is it normal I": Nope, fill an issue with a small repro pls |
22:30:23 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @jmgomez "Nope, fill an issue": I just open VS Code |
22:30:27 | FromDiscord | <System64 ~ Flandre Scarlet> and I'm on Linux |
22:33:27 | * | def- quit (Quit: -) |
22:34:09 | * | def- joined #nim |
22:54:53 | * | xet7 quit (Remote host closed the connection) |
22:56:22 | FromDiscord | <System64 ~ Flandre Scarlet> Btw↵Do you think there is something missing in the Math library? |
22:57:58 | FromDiscord | <bulletxbt> Any good books for nim? |
22:58:15 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @bulletxbt "Any good books for": Nim in Action and Mastering Nim |
23:41:54 | FromDiscord | <bulletxbt> Is there a nim equivalent for python's `if name == "main"`? |
23:44:51 | FromDiscord | <that_dude.> Something along the lines of 'If ismainmodule' |
23:44:57 | FromDiscord | <polylokh_39446> `when isMainModule:` |
23:52:58 | FromDiscord | <that_dude.> When for compile time, if for run time |
23:59:25 | FromDiscord | <__nycto__> Is there a way to enable allocation logging in Nim such that I can see the types that are being created and destroyed? I’m fighting a memory overwrite issue in a large-ish Nim app, and setting a breakpoint in the underlying allocator means I only have visibility into the raw pointer |