<< 11-07-2023 >>

00:59:21FromDiscord<sl0vak_> does nim has a `file` python equivalent?
01:00:18FromDiscord<Elegantbeef> `currentSourcePath`
01:07:09NimEventerNew Nimble package! gtrends - Google Trends RSS, see https://git.ozzuu.com/thisago/gtrends
01:12:19*azimut joined #nim
02:05:20FromDiscord<codic> does anyone know a way to do bcrypt hashing in Nim?
02:06:17FromDiscord<Elegantbeef> https://nimble.directory/search?query=bcrypt
02:06:21FromDiscord<codic> all i can find is this https://github.com/runvnc/bcryptnim/blob/master/bcrypt.nim which seems to be unmaintained but is what nimforum uses
02:06:52FromDiscord<codic> yea seems thats all there is
02:07:13FromDiscord<codic> i guess i can fork it to fix a bug (doesnt compile under netbsd for me
02:07:36FromDiscord<arathanis> use the power of learning on the internet to write your own bcrypt library!
02:07:44FromDiscord<arathanis> then open source it for the rest of us 😇
02:08:12FromDiscord<Elegantbeef> Writing crypto from scratch, always will end well
02:08:38FromDiscord<arathanis> how could it not?
02:08:58FromDiscord<Elegantbeef> This is atleast relatively simple algo
02:09:46FromDiscord<Elegantbeef> https://en.wikipedia.org/wiki/Bcrypt#Algorithm how hard could it be!
02:14:45FromDiscord<arathanis> looks like you just need to implement blowfish and its good to go!
02:24:59FromDiscord<spotlightkid> https://cheatfate.github.io/nimcrypto/nimcrypto/blowfish.html
02:33:34FromDiscord<michaelb.eth> In reply to @.john.f.kennedy. "does anyone know a": how about the new-ish `nim-lang/checksums`?↵https://github.com/nim-lang/checksums↵https://nim-lang.github.io/checksums/src/checksums/bcrypt.html#%24%2CHash
02:36:09FromDiscord<michaelb.eth> https://github.com/nim-lang/checksums/blob/master/src/checksums/bcrypt.nim
02:49:39FromDiscord<codic> wonderful
02:49:41FromDiscord<codic> thank you
03:07:15FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=4AjP
03:07:51FromDiscord<codic> not Option[T], thats too mess
03:07:53FromDiscord<codic> (edit) "mess" => "messy"
03:08:01FromDiscord<Elegantbeef> `echo (try: to(parseJson(str), A) except: """)`
03:08:13FromDiscord<Elegantbeef> Whoops `except: A()`
03:08:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4AjQ
03:09:17FromDiscord<codic> yes but that's throwing an exception
03:09:26FromDiscord<codic> i dont want to do that for every request to an api endpoint that is malformed
03:09:44FromDiscord<Elegantbeef> You cannot convert Nim's exception code into anything else, no
03:10:46FromDiscord<Elegantbeef> Yes there is `nim-results` and friends but those just wrap exceptions into results
03:10:52FromDiscord<michaelb.eth> you can wrap it with nim-results
03:10:56FromDiscord<michaelb.eth> ha! beat me to it
03:11:07FromDiscord<codic> no i dont hate exceptions
03:11:13FromDiscord<codic> my concern is that throwing an exception would be slow
03:11:23FromDiscord<Elegantbeef> It can be
03:11:24FromDiscord<codic> when it comes to an often hit endpoint
03:11:33FromDiscord<codic> since it's not an application error, its an user error
03:12:03FromDiscord<codic> so i want to default the fields to blank and then i can just check if x.y == ""
03:12:11FromDiscord<Elegantbeef> There is the `std/parsejson` module
03:13:25FromDiscord<Elegantbeef> The nim stdlib is generally designed for exceptions in mind which can be a shame
03:17:01FromDiscord<codic> is there another json library that would allow me to do this? otherwise Ig exceptions work for now
03:17:15FromDiscord<michaelb.eth> @codic maybe take a look at the `json_serialization` lib. I'm not sure atm if it will be better or worse re: your concerns, but it does take a different approach: https://github.com/status-im/nim-json-serialization/
03:17:19FromDiscord<michaelb.eth> (edit) "https://github.com/status-im/nim-json-serialization/" => "https://github.com/status-im/nim-json-serialization"
03:17:49FromDiscord<huantian> jsony might work better too
03:18:03FromDiscord<huantian> it handles missing keys by simply keeping the default value
03:18:12FromDiscord<michaelb.eth> also, though I don't have experience with it (yet), maybe `jsony`: https://github.com/treeform/jsony
03:18:40FromDiscord<codic> In reply to @huantian "it handles missing keys": yes this is what I need
03:18:45FromDiscord<codic> thank you I’ll take a look
03:21:51FromDiscord<Elegantbeef> Well jsonutils also exists
03:22:08FromDiscord<Elegantbeef> Can write your own hook that doesnt error on keys missing
03:49:56FromDiscord<arathanis> In reply to @huantian "it handles missing keys": is there a way to cause it to have an error if the value is missing?
03:50:11FromDiscord<arathanis> if that functionality is desired, of course
04:03:29FromDiscord<Elegantbeef> https://nim-lang.org/docs/jsonutils.html#Joptions
04:03:47FromDiscord<arathanis> ah that is cool
04:03:53FromDiscord<arathanis> i wonder if something similar exists for jsony
04:04:08FromDiscord<arathanis> how does jsonutils interact with json?
04:04:15FromDiscord<arathanis> (edit) "jsonutils" => "std/jsonutils" | "json?" => "std/json?"
04:04:24FromDiscord<Elegantbeef> It uses JsonNodes and default hooks
04:04:32FromDiscord<Elegantbeef> You can override the hooks to do whatever you want though
04:04:39FromDiscord<arathanis> but is otherwise separate from std/json?
04:04:46FromDiscord<arathanis> oh no it imports std/json
04:04:51FromDiscord<arathanis> so its built on top of it
04:07:54FromDiscord<Elegantbeef> Well yea it uses JsonNode and the default deserialisation
05:09:11*azimut_ joined #nim
05:11:38*azimut quit (Ping timeout: 240 seconds)
05:15:39*ntat joined #nim
06:07:38*azimut_ quit (Ping timeout: 240 seconds)
06:09:20*azimut joined #nim
06:18:14NimEventerNew post on r/nim by h234sd: Keep, Note Taking App in Nim, see https://reddit.com/r/nim/comments/14witww/keep_note_taking_app_in_nim/
06:44:55*PMunch joined #nim
06:45:19PMunchHmm, does the async runtime leak descriptors?
06:46:38PMunchI have some code which gets data from one server, calculates something, and publishes the result over MQTT to another server. The MQTT and HTTP (stdlib) implementations are both async, but I just use waitFor at the moment for testing purposes
06:47:09PMunchToday I came back to a crashed script with the error: Exception message: Maximum number of descriptors is exhausted! [IOSelectorsException]
07:08:36*ovenpasta joined #nim
07:16:19FromDiscord<huantian> Maybe you have too many unclosed http clients?
07:16:24FromDiscord<huantian> Random guess tho
07:18:56PMunchHmm, I guess there is a small possibility that would happen in certain error scenarios
07:19:22FromDiscord<arathanis> certain errors leave clients open?
07:19:30FromDiscord<arathanis> can you make a jira ticket for that bug? 😎
07:19:39NimEventerNew thread by alexeypetrushin: Keep, Note Taking App in Nim, see https://forum.nim-lang.org/t/10331
07:20:43PMunchWell I have some helper procedures which create a HttpClient, tries to get some data, and then closes the HttpClient. If one of these errors out it would raise the exception before the client got closed
07:21:04PMunchJira ticket? Since when does Nim have a Jira?
07:21:16FromDiscord<arathanis> you dont use JIRA for your personal projects?
07:21:33FromDiscord<arathanis> would `defer` help solve it?
07:24:37PMunchWell, this is a work project, not a personal project. And since I'm the only programmer on this project I don't think adding a bug in Jira would help me..
07:24:58PMunchAnd I definitely don't use that crap for personal projects, even trying my best to phase it out at work..
07:25:09PMunchI think a `try: finally:` would work well
08:14:03*user__ joined #nim
08:17:55*ovenpasta quit (Ping timeout: 240 seconds)
08:19:39PMunchHmm, is `from` a keyword only so that `import x from y` works? Or is it used for anything else?
08:20:01PMunchIt's a bit annoying not being able to create a procedure with to/from arguments..
08:27:24*xet7 quit (Ping timeout: 246 seconds)
08:34:35FromDiscord<odexine> src dest
08:34:42FromDiscord<odexine> I often use that instead
08:35:17PMunchDoesn't make much sense when I'm passing in a DateTime :P
08:36:11FromDiscord<odexine> Start stop
08:36:21PMunchYeah that's what I ended up with
08:36:51PMunchBut since I'm wrapping a web-API which uses to/from it feels a bit awkward to have to switch to start/stop in my code..
08:46:43*xet7 joined #nim
09:05:18*Batzy quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
09:05:47*Batzy joined #nim
09:08:29PMunchHmm, have anyone created a natural language timestamp thing for Nim?
09:08:49PMunchSo you could say something like `yesterday` or `two weeks ago` and it would understand it?
09:14:32*Batzy quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
09:15:47*Batzy joined #nim
09:22:52PMunchSomething like chronic
09:37:27FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4AkF
09:41:08FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4AkH
09:52:48FromDiscord<jmgomez> In reply to @heysokam "oh, it was the": It was discussed recently in #internals https://discord.com/channels/371759389889003530/768367394547957761/1123655395517419552
09:55:56FromDiscord<heysokam> In reply to @jmgomez "It was discussed recently": ah i see. ty for the link, didn't know about those concepts at all ✍️
10:12:06*jmdaemon quit (Ping timeout: 245 seconds)
10:18:06FromDiscord<pietroppeter> In reply to @PMunch "Something like chronic": TIL https://github.com/alexherbo2/chronic interesting!
10:19:31PMunchOh, I was actually talking about this: https://github.com/mojombo/chronic
10:44:30PMunchHmm, all the setters like `year=` are deprecated since 1.3.1, what am I supposed to replace them with?
10:48:19FromDiscord<intellij_gamer> iirc you recreate the `DateTime`
10:49:03PMunchWell that's cumbersome..
10:56:10FromDiscord<pietroppeter> In reply to @PMunch "Oh, I was actually": Ha, I Guess that might be the original, the Crystal one is the first I found…
10:57:52FromDiscord<pietroppeter> It would also make sense for a Nim-like chronic (a chronim?) to be able to serialize time stamp to natural language (to be used in JS backend..)
10:58:39PMunchHuh?
10:58:43PMunchFor display purposes?
10:58:54PMunchThe problem there is that you have multiple valid representations
10:59:59FromDiscord<Andreas> sent a long message, see http://ix.io/4Al0
11:00:24PMunch"First Monday of the month", "2023-07-03", "July 3rd", and "one week after June 26th" are all the same date
11:01:11PMunchUhm..
11:01:32*nils` quit (Ping timeout: 240 seconds)
11:01:34PMunchAndreas, I believe the PNode is more or less the exact same structure as a NimNode.
11:01:43FromDiscord<Andreas> (edit) "http://ix.io/4Al0" => "http://ix.io/4Al2"
11:02:02FromDiscord<Andreas> In reply to @PMunch "<@754284517316886598>, I believe the": yep, thats my impression, too.
11:02:37PMunchWhy not just use nimsuggest?
11:03:37FromDiscord<Andreas> In reply to @PMunch "Why not just use": can nimsuggest deliver proc-signatures ? i want to put the structure/outline into a editor-view..
11:04:12PMunchHmm, don't quite remember
11:04:27PMunchLSP does all of this stuff automatically
11:05:07PMunchI don't quite remember how it pulls this information, but if NimLSP is able to do it then nimsuggest should be able to
11:09:05FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4Al4
11:09:21FromDiscord<heysokam> (edit) "https://play.nim-lang.org/#ix=4Al4" => "https://play.nim-lang.org/#ix=4Al5"
11:13:34FromDiscord<Andreas> In reply to @PMunch "LSP does all of": hmm, maybe i'm looking at the wrong place, but neither nimLime nor nimPlus regard type-definitions as symbols - so they won't show up in the editor.
11:15:14PMunchHmm, not 100% sure what you mean Andreas
11:18:48FromDiscord<Andreas> In reply to @PMunch "Hmm, not 100% sure": would you agree that `type MyType = object ... ` defines a `symbol` ? Or does symbol only include `proc/iterator/func/method/converter` ?
11:25:26PMunchYeah I'd say "MyType" is a symbol
11:26:42FromDiscord<Andreas> In reply to @PMunch "Yeah I'd say "MyType"": me too. In SublimeText they are not. So the UI-Menue."Goto Symbol" does not include user-defined types/enums etc..
11:45:26*m5zs7k quit (Ping timeout: 245 seconds)
11:47:08*m5zs7k joined #nim
12:15:06FromDiscord<pietroppeter> In reply to @PMunch "For display purposes?": Yep, for display purposes and you should have a default representation and options to change formatting (1d vs yesterday, 1w vs one week ago). This is anyway something that is done everywhere (on Nim forum too you translate timestamps to 1h, 1w, …) and it is probably something very simple and the complexity lies in parsing. Still, it seems something useful to have as a library
12:17:06PMunchHmm, I guess that would be handy
12:17:21PMunchShould be pretty simply to rip that part out of the forums though
12:17:32PMunchThe natural parsing of dates is a bit trickier
12:18:59PMunchBonus points if you can do something like "every 1st Monday" and get a closure iterator you can use to get the first Monday of every month.
12:27:27ntatI am looking for the correct name of these two data structures. Are these the correct names? ↓
12:27:39ntathttps://play.nim-lang.org/#ix=4Alv
12:28:44FromDiscord<mratsim> sent a code paste, see https://play.nim-lang.org/#ix=4Alx
12:45:24PMunchntat, which data structures?
12:45:31PMunchThat's just an object with some fields..
13:00:38ntatPMunch, I mean, what is p1 in this code? In Python p1 would be an object.
13:02:11PMunchntat, well in Nim p1 is also an object, of type Person
13:08:47ntatPMunch, So I have two objects: Person and p1? Person looks like a class in Python.
13:09:01FromDiscord<michaelb.eth> In reply to @ntat "<@696333749570371585>, So I have": `type Person` is a type
13:09:18FromDiscord<michaelb.eth> `p1` is an instance of that type
13:09:29PMunchWell no, you have one type which is called Person and which is an object definition. Then p1 is an instance of this object type
13:10:45PMunchClasses as such don't really exist in Nim. A class is basically an object + some functions. In Nim we just have objects and functions which take the object as an argument. The distinction is minor though
13:13:47ntatPMunch, michaelb.eth, OK, that's a little different from Python, though. Thanks for the explanation :)
13:14:06FromDiscord<michaelb.eth> note: Nim is quite different from Python
13:14:08PMunchYou'll find a lot of things are different from Python in Nim.
13:14:35PMunchIt's basically just vaguely familiar in syntax, but apart from that it works almost completely different
13:15:04PMunchIt's like comparing C and Java, sure they look kinda similar with braces and such, but they behave completely differently
13:15:06*PMunch quit (Quit: Leaving)
14:21:41*rockcavera joined #nim
14:35:48FromDiscord<ambient3332> How do I set the compilation root for gcc when creating libraries with {.compile.} pragme?
14:36:33FromDiscord<ambient3332> it uses the current directory where I run Nim from, but it should use the library root
14:40:57FromDiscord<bostonboston> Are you looking for --outdir: or something else
14:41:24FromDiscord<ambient3332> @Boston https://github.com/amb/nim_audiobook/blob/no-arraymancer/otfft-simple/otfft.nim
14:41:34FromDiscord<ambient3332> I want to import that from anywhere
14:46:34FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4Am2
14:59:12FromDiscord<ambient3332> Thanks, bu that seems hack-ish. I might have to look into creating an actual library with Nimble
15:03:23FromDiscord<jmgomez> Im not sure what you attempt to do but you could also just pass the search path as absolute instead of `.`
15:04:08FromDiscord<jmgomez> making it like that as nimble will make it fragile anyways
15:04:53FromDiscord<ambient3332> I'm aiming to create a Nim library that compiles the included c and cpp files, something like https://github.com/treeform/staticglfw probably
15:06:04FromDiscord<ambient3332> Although the C++ compilation takes forever, so it has absolutely has to be cached after the first run
15:08:01FromDiscord<demotomohiro> How about to compile it as a static or dynamic library and link it with `--passL` pragma?↵https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-passl-pragma
15:08:25FromDiscord<ambient3332> Is it something I can do automatically through Nim?
15:10:25FromDiscord<jmgomez> In reply to @ambient3332 "Although the C++ compilation": how long is forever? It will be cached automatically
15:10:29FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Amg
15:12:35FromDiscord<demotomohiro> sent a long message, see http://ix.io/4Amh
15:12:51FromDiscord<ambient3332> Not everyone is on Linux
15:13:02FromDiscord<ambient3332> plus I think I fixed it just by removing the "-I." from .compile pragma
15:13:44FromDiscord<ambient3332> @jmgomez about 15 minutes
15:13:45FromDiscord<demotomohiro> Windows have package manager like msys2 or conan.
15:17:01FromDiscord<jmgomez> In reply to @ambient3332 "plus I think I": that's crazy, only once or every time you recompile?
15:17:15FromDiscord<ambient3332> In reply to @jmgomez "that's crazy, only once": Every time I have to recompile the C++ files
15:17:36FromDiscord<ambient3332> gcc uses very little CPU while doing it, vcc seems to be more than order of magnitude faster
15:24:44FromDiscord<demotomohiro> Doesn't that C++ library use make, cmake or meson?↵If it uses make, you need to add -j option so that it compile multiple .cpp file at parallel.
15:24:59FromDiscord<ambient3332> It's just a single file C++ that chokes gcc
15:25:22FromDiscord<michaelb.eth> In reply to @ambient3332 "It's just a single": what about clang, similar choke?
15:25:40FromDiscord<ambient3332> I only tried vcc, and it utilizes all cores
15:34:54FromDiscord<System64 ~ Flandre Scarlet> Is there a better Multithread thing than Spawn?
15:58:09FromDiscord<ezquerra> malebolgia? https://github.com/Araq/malebolgia↵I think other options are weave, nim taskpools and another one called chronos (I think?) from @mratsim
16:01:18*azimut quit (Ping timeout: 240 seconds)
16:05:04FromDiscord<System64 ~ Flandre Scarlet> In reply to @ezquerra "malebolgia? https://github.com/Araq/malebolgia I th": Sounds interesting! And are performances better?
16:26:36FromDiscord<ezquerra> In reply to @sys64 "Sounds interesting! And are": I haven’t used them myself but I believe that they have different performance trade offs
16:30:01FromDiscord<System64 ~ Flandre Scarlet> In reply to @ezquerra "I haven’t used them": Why do I have errors? https://media.discordapp.net/attachments/371759389889003532/1128362570093445180/message.txt
16:31:40FromDiscord<spotlightkid> It sounds like you're making an audio application? Then I don't think any async solution will meet the realtime requirements.↵I would use normal Nim threads and use channels to send wave data between the realtime and disk threads.
16:31:50FromDiscord<ezquerra> In reply to @sys64 "Why do I have": I’m not the right person to answer but first thing is check is whether you are using the right version of nim. Malévolos might need the current development version
16:32:00FromDiscord<System64 ~ Flandre Scarlet> In reply to @spotlightkid "It sounds like you're": It's for wav export
16:32:17FromDiscord<System64 ~ Flandre Scarlet> In reply to @ezquerra "I’m not the right": I use Nim 1.9
16:32:27FromDiscord<spotlightkid> While playback is going on or "offline"?
16:33:01FromDiscord<ezquerra> In reply to @sys64 "I use Nim 1.9": Then probably your best bet is to ping @_araq or write a post on the nim forum
16:33:03FromDiscord<System64 ~ Flandre Scarlet> In reply to @spotlightkid "While playback is going": The entire synth context is copied
16:36:41FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4AmS
16:37:07FromDiscord<System64 ~ Flandre Scarlet> oh it's a runtime error
16:46:07FromDiscord<_araq> look at me, do I look like I appreciate highlighting.
16:51:30FromDiscord<System64 ~ Flandre Scarlet> In reply to @_araq "look at me, do": Wdym?
16:53:10FromDiscord<odexine> highlighting -> pings
16:55:21FromDiscord<heysokam> you probably want to mark the channel notifications as `@nothing` if you don't want to be pinged, Araq↵I feel like you are a person important enough to attract pings, so it makes perfect sense that people do that and its probably just simpler if you disable the feature and ignore them, since it will definitely happen again (people are not mind-readers, basically, since pings are a normal thing in discord, hence why the feature to disab
16:56:08FromDiscord<graveflo> but then he doesn't get to scold them. I imagine there is some fun in that at least
17:00:00*deadmarshal_ quit (Remote host closed the connection)
17:09:17FromDiscord<xtrayambak> Are there any plans to replace std/random with a pure solution?
17:10:06FromDiscord<xtrayambak> Actually, when I think about it, a semver parser in the stdlib would be nice too.
17:15:55NimEventerNew thread by TKD: Table lookup problem, see https://forum.nim-lang.org/t/10332
17:43:53*jmdaemon joined #nim
17:57:12NimEventerNew thread by mantielero: Crosscompiling - SSL, see https://forum.nim-lang.org/t/10333
18:15:32*deadmarshal_ joined #nim
18:21:28FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4Ang
18:22:47FromDiscord<heysokam> (edit) "https://play.nim-lang.org/#ix=4Ang" => "https://play.nim-lang.org/#ix=4Anh"
18:27:13FromDiscord<heysokam> `attr` vs `atrr` 🤦‍♂️
18:56:05FromDiscord<odexine> hey at least you now know you're blind haha
19:10:31FromDiscord<System64 ~ Flandre Scarlet> Is it possible to profile performances of a Nim program?
19:11:02FromDiscord<ambient3332> Yep, just attach it to a sampling profiler and add debug info
19:11:24FromDiscord<System64 ~ Flandre Scarlet> sampling profiler?
19:11:55FromDiscord<ambient3332> for example: https://github.com/VerySleepy/verysleepy
19:19:40FromDiscord<System64 ~ Flandre Scarlet> In reply to @ambient3332 "for example: https://github.com/VerySleepy/veryslee": I don't see the Nim functions
19:21:33FromDiscord<ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=4Anr
19:24:25FromDiscord<System64 ~ Flandre Scarlet> why compiling in Release?
19:24:53FromDiscord<ambient3332> to get accurate picture of where the time is spent. debug removes ton of optimizations and will report all kinds of nonsense, that I don't presonally need
19:25:45FromDiscord<ambient3332> although inlining can also confuse things, I usually try to find a good balance where I can get the idea where the hot loops are
19:26:24FromDiscord<System64 ~ Flandre Scarlet> In reply to @ambient3332 "although inlining can also": Oh, I use a lot of inlines
19:26:57FromDiscord<ambient3332> it just mean you have to figure out yourself which part of the code it is, as inlining changes the end result from your actual code
19:27:03FromDiscord<System64 ~ Flandre Scarlet> Thanks to ImGUI that throws compiler errors when I not Inline
19:27:25FromDiscord<System64 ~ Flandre Scarlet> I used NimProf, I have that https://media.discordapp.net/attachments/371759389889003532/1128407217117339829/message.txt
19:27:29FromDiscord<ambient3332> imgui should be popular enough to have lot of info about profiling
19:33:30FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Anv
19:36:42FromDiscord<ambient3332> Well it should give you an overview of where the time is spent in your code. It does not do that?
19:38:23FromDiscord<System64 ~ Flandre Scarlet> Not really
19:38:56FromDiscord<System64 ~ Flandre Scarlet> Like, only that for Kurumi-X https://media.discordapp.net/attachments/371759389889003532/1128410113967923322/image.png
19:39:21FromDiscord<ambient3332> You can sort and navigate the project in the different panes
19:39:35FromDiscord<ambient3332> And it should also show how much time is spent in each line of code
19:45:38FromDiscord<System64 ~ Flandre Scarlet> I think this module is the bottleneck https://media.discordapp.net/attachments/371759389889003532/1128411798962450543/image.png
19:47:12FromDiscord<ambient3332> You could add processing time text over each node. That's super useful in most node based real-time systems
19:47:34FromDiscord<System64 ~ Flandre Scarlet> Ah yeah can help a lot
19:49:13FromDiscord<System64 ~ Flandre Scarlet> Btw are that kind of loops unrolled on Release? (LENGTH is a constant) https://media.discordapp.net/attachments/371759389889003532/1128412700955922442/image.png
19:50:03FromDiscord<ambient3332> I think loop unrolling is based on loop length in most compilers, but you can always force it if you want with flags
19:51:18FromDiscord<ambient3332> Probably not correct but just off the top of my head: --passc:"--funroll-loops" (for gcc)
19:51:55FromDiscord<System64 ~ Flandre Scarlet> gotta try this
19:55:36FromDiscord<System64 ~ Flandre Scarlet> Humm seems it doesn't change a lot of things
19:58:14FromDiscord<ambient3332> Try -d:lto
19:59:09FromDiscord<ambient3332> (if you're creating -d:danger or -d:release builds that is)
20:00:10FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Any
20:00:39FromDiscord<ambient3332> also depending on what Nim version you're using --mm:arc and -d:useMalloc might change things a bit
20:02:53FromDiscord<ambient3332> on Windows using mimalloc can give significant performance boost depending on what your'e doing
20:03:02FromDiscord<ambient3332> but that's not a simple compiler flag...
20:03:20FromDiscord<System64 ~ Flandre Scarlet> In reply to @ambient3332 "but that's not a": manual memory management?
20:03:27FromDiscord<ambient3332> https://github.com/microsoft/mimalloc
20:04:31FromDiscord<ambient3332> also does -o3 register as -O3 (it's -O3 everywhere I've seen it)
20:05:08FromDiscord<ambient3332> also -O3 implies -funroll-loops and a lot of other stuff IIRC
20:05:52FromDiscord<System64 ~ Flandre Scarlet> In reply to @ambient3332 "also does -o3 register": Ah maybe I should try this↵Also Mimalloc sounds interesting!↵Is it easy to put this in place?
20:06:17FromDiscord<ambient3332> I haven't tried it much with Nim but in Rust it was just adding a few lines in cargo.toml
20:06:38FromDiscord<System64 ~ Flandre Scarlet> It needs a module for Nim
20:07:19FromDiscord<ambient3332> well there's this but haven't tried it https://github.com/Yardanico/mimalloc_nim
20:10:24FromDiscord<System64 ~ Flandre Scarlet> I should try it
20:13:34*LyndsySimon quit (Quit: Connection closed for inactivity)
20:14:04FromDiscord<System64 ~ Flandre Scarlet> Does it really modify the file? https://media.discordapp.net/attachments/371759389889003532/1128418952356298905/image.png
20:15:42FromDiscord<ambient3332> It seems mimalloc might be in devel https://github.com/nim-lang/Nim/pull/20359#issuecomment-1253880181
20:16:10om3ga required type for self: Widget. but expression 'uiWidget[]' is of type: Widget
20:16:29om3gaawesome
20:20:47FromDiscord<ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=4AnG
20:21:13FromDiscord<System64 ~ Flandre Scarlet> In reply to @ambient3332 "<@380360389377916939> in Nim devel": so Nim 1.9?
20:21:43FromDiscord<ambient3332> 1.9.5 2023-07-11
20:22:04FromDiscord<System64 ~ Flandre Scarlet> sent a long message, see https://paste.rs/5mFWO
20:22:39FromDiscord<ambient3332> although might be faulty benchmarking on my end. someone actually knowing this should chime in
20:24:26*LyndsySimon joined #nim
20:24:30FromDiscord<System64 ~ Flandre Scarlet> In reply to @ambient3332 "although might be faulty": Well, I checked in Nim files, no any mention to Mimalloc
20:28:09FromDiscord<michaelb.eth> In reply to @sys64 "Well, I checked in": What compiler are you using on Windows?
20:45:00FromDiscord<michaelb.eth> the reason I ask is that back when Araq was asking for people to benchmark some code related to malebolgia, it was found that mingw gcc was producing an executable for the multithreaded program that performed much slower than executables produced by clang and microsoft's compilers
20:45:20FromDiscord<System64 ~ Flandre Scarlet> In reply to @michaelb.eth "What compiler are you": gcc
20:45:29FromDiscord<michaelb.eth> finding the discussion, just a sec
20:45:43FromDiscord<System64 ~ Flandre Scarlet> well↵g++ since I compile to C++
20:46:29FromDiscord<michaelb.eth> https://discord.com/channels/371759389889003530/768367394547957761/1105201319154831420
20:47:22FromDiscord<michaelb.eth> if I understood correctly from the discussion above, you're doing something multithreaded, so if you're having perf issues, might be a good idea to give clang a try
20:47:39FromDiscord<System64 ~ Flandre Scarlet> So I need to do -cc:clang?
20:47:43FromDiscord<System64 ~ Flandre Scarlet> (edit) "-cc:clang?" => "--cc:clang?"
20:48:24FromDiscord<michaelb.eth> not sure, I was compiling in an MSYS2 CLANG64 environment, where the default compiler is clang, so I didn't need to twiddle compiler flags
20:48:29FromDiscord<System64 ~ Flandre Scarlet> Btw I only use multithread for file export, otherwise it's single thread
20:49:01FromDiscord<michaelb.eth> I see, well then maybe it won't make a difference, just something to be aware of re: mingw gcc
20:51:47FromDiscord<System64 ~ Flandre Scarlet> I have errors under clang https://media.discordapp.net/attachments/371759389889003532/1128428447308447917/message.txt
21:06:38FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4AnQ
21:08:12FromDiscord<System64 ~ Flandre Scarlet> Is it possible to get rid of all those DLLs? The exe requires them to work https://media.discordapp.net/attachments/371759389889003532/1128432578110705674/image.png
21:09:03FromDiscord<ambient3332> well if you include a gcc environment, the dll's need to be somewhere. using MS compilers has the advantage that the dll's are often already in system path
21:09:06FromDiscord<heysokam> In reply to @sys64 "Is it possible to": link statically
21:16:10FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "link statically": How can I do that?
21:19:14FromDiscord<heysokam> In reply to @sys64 "How can I do": you need to compile the libraries into an `.a` file (each library might have its own way, or not have the option at all) and then you `{.link: "theFile.a".}` in some of your files
21:20:42FromDiscord<heysokam> @System64 ~ Flandre Scarlet https://github.com/heysokam/wgpu/blob/4af685fae23d7eaa38c41deab52081b7d5e73b7d/src/wgpu/compile.nim#L81-L83
21:21:17FromDiscord<heysokam> similar to that, but depends on each of the libraries you want to link statically. will need to google for those you have there
21:21:52FromDiscord<System64 ~ Flandre Scarlet> Oh alright↵But aren't they already compiled into a .a?
21:22:21FromDiscord<heysokam> glib is usually linked dynamically, so probably not
21:22:32FromDiscord<heysokam> unless you get some binaries already prebuilt somewhere
21:22:55FromDiscord<heysokam> (edit) "glib" => "libc"
21:24:57FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "libc is usually linked": Ah alright
21:25:10FromDiscord<System64 ~ Flandre Scarlet> I can use clang but I have errors with clangs
21:25:18FromDiscord<System64 ~ Flandre Scarlet> In reply to @sys64 "I have errors under": Those ones
21:26:28FromDiscord<heysokam> i know nothing about those myself, sry
21:34:20*ntat quit (Quit: Leaving)
21:43:51*azimut joined #nim
22:03:55*user__ quit (Ping timeout: 240 seconds)
22:12:32*azimut quit (Remote host closed the connection)
22:12:43*azimut_ joined #nim
22:22:58FromDiscord<liathekitten> Is there an easy way to only get the first 2 lines in a file
22:26:31*disso_pch quit (Quit: Leaving)
22:29:43FromDiscord<heysokam> In reply to @liathekitten "Is there an easy": https://nim-lang.org/docs/io.html#readLines%2Cstring%2CNatural
22:29:47FromDiscord<michaelb.eth> In reply to @liathekitten "Is there an easy": `readLines`?↵https://nim-lang.org/docs/io.html#readLines%2Cstring%2CNatural
22:30:04FromDiscord<liathekitten> Ok
22:42:17*jmdaemon quit (Ping timeout: 245 seconds)
23:02:31*jmd_ joined #nim
23:55:17*cm_ joined #nim
23:56:03*cm quit (Ping timeout: 258 seconds)
23:56:03*cm_ is now known as cm