00:00:19 | * | krux02 quit (Remote host closed the connection) |
00:01:43 | * | def- quit (Quit: -) |
00:21:50 | * | def- joined #nim |
01:22:59 | * | def- quit (Quit: -) |
01:25:02 | * | def- joined #nim |
02:05:48 | * | def- quit (Quit: -) |
02:06:10 | * | def- joined #nim |
02:10:45 | * | SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev) |
02:38:50 | * | xet7 quit (Remote host closed the connection) |
03:12:25 | FromDiscord | <aryzen> does anyone know `rb3` on the forum? He did something similar to what I want to do but I want to ask him how he did it |
03:31:16 | * | def- quit (Quit: -) |
03:32:11 | * | def- joined #nim |
03:51:08 | * | SchweinDeBurg joined #nim |
03:54:12 | * | def- quit (Quit: -) |
04:27:35 | * | jkl quit (Remote host closed the connection) |
04:28:36 | * | jkl joined #nim |
04:30:54 | * | def- joined #nim |
04:36:34 | FromDiscord | <xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=LOiNkLmXKCLu |
04:36:36 | FromDiscord | <the_real_hypno> In reply to @saint.___. "Needs more documentation though": Totally agree. Such a waste of potential. I did fight my way through and generate bindings but its not fun. It could be exceptional if the creator would have provided more than not really explained guidelines. |
04:38:15 | * | def- quit (Quit: -) |
04:38:32 | * | def- joined #nim |
04:38:52 | FromDiscord | <Elegantbeef> @xkonti you derive from a common error |
04:39:22 | FromDiscord | <Elegantbeef> As you've done, there is nothing else you can do if you're doing exception based exceptions |
04:41:15 | FromDiscord | <the_real_hypno> I would say that converting plain Nim thats not THAT complex is rather self explanatory. ↵But dont you to use ptr or a non `string` string. |
04:42:28 | FromDiscord | <the_real_hypno> (edit) "I would say that converting plain Nim thats not THAT complex is rather self explanatory. ↵But dont you ... to" added "dare" |
04:42:40 | FromDiscord | <Elegantbeef> You annotate the base raise for all the root exceptions your base should raise |
04:42:40 | FromDiscord | <Elegantbeef> This forces all your children to be a subset of those raises |
04:56:13 | FromDiscord | <xkonti> In reply to @Elegantbeef "As you've done, there": @ElegantBeef Ok. I see. It acually works that way. Thank you. The NimSuggest confuses the hell out of me 🙃 |
04:57:19 | FromDiscord | <Elegantbeef> Nim does not require annotating exceptions it intuits them based off the body, when you do annotate it it prevents any other exceptions from being raised |
05:12:04 | FromDiscord | <xkonti> That's exactly my use case. The methods of the FileSystem need to specify the only allowed exceptions so that different implementations (OsFs, InMemoryFs, S3Fs, SftpFs, etc) can be used interchangeably. |
05:12:55 | FromDiscord | <xkonti> Thank you for your swift help on a livestream 🎖️ |
05:13:20 | FromDiscord | <Elegantbeef> Right you should do `type MyFileSystemError = object of CatchableError` then you can do `except MyFileSystemError` if you do not care but if you do more specific `InMemoryFsError` if you want |
05:16:52 | FromDiscord | <xkonti> Yeah I'm thinking of somewhat generic ones that could be utilized by various backend implementations: `FileSystemError`, `AccessDeniedError`, `FileNotFoundError`, `DirectoryNotEmptyError`, etc. |
05:17:58 | FromDiscord | <xkonti> Where the `FileSystemError` is the most generic one that could caused by things like missing partition, SFTP connection failure... |
05:19:17 | FromDiscord | <Elegantbeef> Yea that seems fine, you can always extend them for specific implementations if you wish. A child exception is caught by a parent handler, but not vice versa of course. |
05:20:15 | FromDiscord | <Elegantbeef> So with a tree of `A -> B -> C` `except B` catches `B`, `C`, but not `A`. Meaning for specific usages you can care about the extra information, otherwise you can disregard it |
05:21:28 | FromDiscord | <Elegantbeef> Or you can handle errors in any other way that does not tie in with Nim's exceptions 😄 |
05:22:50 | FromDiscord | <xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=KIBbDrxnhVue |
05:23:17 | FromDiscord | <Elegantbeef> You could always use tuples like golang 😄 |
05:23:24 | FromDiscord | <xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=XvYqwFsVZSwW |
05:23:36 | FromDiscord | <Elegantbeef> `tuple[exists: bool, errorMessage: string]` for instance |
05:24:00 | FromDiscord | <xkonti> In reply to @Elegantbeef "You could always use": Thought about it, but again, not aligned with Nim std lib 😦 |
05:24:01 | FromDiscord | <Elegantbeef> Also do not follow the stdlib's convention of `newT` |
05:24:18 | FromDiscord | <Elegantbeef> Please for all thing good and holy do `proc new( _: typedesc[T], ...): T` |
05:24:55 | FromDiscord | <Elegantbeef> The stdlib makes it impossible to do anything nice and generic |
05:25:14 | FromDiscord | <xkonti> Oh! Thanks! That's a good idea. Although in my case it would be `proc new(_: typedesc[T], ...): FileSystem` |
05:25:31 | FromDiscord | <Elegantbeef> Well it'd be replace `T` with the type |
05:27:09 | FromDiscord | <xkonti> Oh no... That requires the `OsFs` to be exported 😦 |
05:27:16 | FromDiscord | <Elegantbeef> Good |
05:27:53 | FromDiscord | <Elegantbeef> Mark it `{.final.}` and there you go there's no worry in it being exported |
05:29:14 | FromDiscord | <Elegantbeef> I'd argue the return type should be `OsFs` anyway |
05:29:14 | FromDiscord | <Elegantbeef> As you know child objects implicitly convert to parents anyway so losing type information is a net loss |
05:31:38 | FromDiscord | <xkonti> Yeah... But that increases the risk of somebody misusing the implementation. If the implementation by some means exports additional procs or methods, they'd be available to utilize on that implementation's type. The user of the libary would need to manually specify that the `fs` is of type `FileSystem` to make sure their code can swap various implementations... |
05:32:16 | FromDiscord | <Elegantbeef> Right which they should |
05:32:37 | FromDiscord | <Elegantbeef> Statically dispatching where possible is always nicer |
05:33:39 | FromDiscord | <xkonti> Considering this deals with files and directories, the overhead of dynamic dispatching is practically non-exsitent 😄 |
05:35:07 | FromDiscord | <xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=ruZNCSiaRQli |
05:36:08 | FromDiscord | <Elegantbeef> Well yea |
05:36:13 | FromDiscord | <Elegantbeef> `system.new(OsFs)` |
05:36:49 | FromDiscord | <xkonti> Another thing learned. Thanks! |
05:37:52 | FromDiscord | <xkonti> Are you aware if NimSuggest is super-bad just in VsCode or is it the same in all the editors? |
05:38:19 | FromDiscord | <Elegantbeef> The nim tooling is subpar, you are using the official extension though right? |
05:38:38 | FromDiscord | <xkonti> Yes. The official one. |
05:39:24 | FromDiscord | <xkonti> The moment I split things into multiple files it totally falls apart. |
05:40:11 | FromDiscord | <Elegantbeef> It does need to be told all the entry files manually |
05:40:32 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/vscode-nim?tab=readme-ov-file#options mentioned here |
05:41:16 | FromDiscord | <xkonti> Ooooh. I see. I'll try that out tomorrow. Thank you for your help again. |
05:45:22 | FromDiscord | <xkonti> By the way I took a look at your `traitor` package (27:35): https://www.youtube.com/live/KI2f0xpIJIQ?si=q-_ZUvMzbSBa6BTp&t=1655 |
05:45:51 | FromDiscord | <Elegantbeef> Mom i'm on TV! |
05:49:19 | FromDiscord | <Elegantbeef> Watching that you do misunderstand |
05:50:04 | FromDiscord | <Elegantbeef> You would only need to make your own `FileSystem = distinct tuple[...]` and `implTrait FileSystem`, then the end users can just define the required procedures and call `toTrait FileSystem` |
05:51:22 | FromDiscord | <Elegantbeef> https://github.com/beef331/traitor/blob/master/traitor/streams.nim#L132-L151 is an example stream(not too disimilar to what you're doing) |
05:51:49 | FromDiscord | <Elegantbeef> It does not even need to know about traitor any type that matches that `Stream` signature can be converted |
05:52:20 | FromDiscord | <Elegantbeef> Just going to @xkonti just cause I assume you've gone offline 😄 |
06:05:08 | * | ntat joined #nim |
06:08:45 | FromDiscord | <xkonti> I see. Maybe as I learn Nim I'll find it easier to understand and decide do switch 😉 |
06:18:52 | * | rockcavera quit (Remote host closed the connection) |
06:38:26 | * | PMunch joined #nim |
07:10:10 | PMunch | I think I'm in a love-hate relationship with blocks and implicit return |
07:10:55 | PMunch | Like, this feels wrong https://pasty.ee/xTXraqBkqmhf, but from a technical point of view it's pretty great |
07:11:55 | PMunch | It stores everything in a `let` assignment, it ensures on compile-time that every branch either sets `fcontent` or returns, it saves me from typing `fcontent =` all over the place |
07:12:04 | PMunch | But still it just feels so wrong |
07:32:10 | FromDiscord | <the_real_hypno> What type is getting infered there? |
07:32:29 | FromDiscord | <the_real_hypno> Or is year a string? |
07:33:11 | FromDiscord | <the_real_hypno> Ah I see, questions answered, thank 😛 |
07:34:50 | FromDiscord | <pmunch> Yeah `fcontent` ends up being a string here |
07:36:50 | FromDiscord | <sOkam! 🫐> In reply to @PMunch "Like, this feels wrong": why wrong? 🤔 |
07:37:22 | FromDiscord | <Robyn [She/Her]> In reply to @PMunch "Like, this feels wrong": I've gotten pretty used to this syntax and I honestly love it |
07:37:24 | FromDiscord | <sOkam! 🫐> I have like a LOT of those in my lang compiler, lol 🙈↵... _runs-away-to-hide-in-a-corner_ |
07:37:50 | PMunch | I mean it's a 20-line long let assignment :P |
07:38:20 | PMunch | But yeah, I tend to use these a lot |
07:38:56 | FromDiscord | <sOkam! 🫐> In reply to @chronos.vitaqua "I've gotten pretty used": a ton better than `(condition) ? trueVal : falseVal;`, for sure |
07:38:57 | PMunch | Just now it also saved me from missing a return value :) I would've overlooked that if it wasn't for this construct, and that would've led to a bug in my program |
07:39:05 | FromDiscord | <nocturn9x> is there a way to get the current time in milliseconds? |
07:39:11 | PMunch | Yes |
07:39:20 | FromDiscord | <sOkam! 🫐> In reply to @nocturn9x "is there a way": depends on usecase, but yes in two different ways |
07:39:20 | FromDiscord | <nocturn9x> Nim's documentation isn't terribly helpful and googling only brings up old examples that are broken |
07:39:27 | FromDiscord | <nocturn9x> I need an integer, by the way |
07:39:35 | FromDiscord | <sOkam! 🫐> yes to that too |
07:39:35 | FromDiscord | <Elegantbeef> Just need to make a proc return `(typeof(ENonet), string)` then make a `returnUnpack(yourProc(...) ENoErrr)` |
07:39:35 | FromDiscord | <nocturn9x> it doesn't have to be the current time either |
07:39:40 | FromDiscord | <nocturn9x> as long as it's a monotonic clock |
07:39:49 | FromDiscord | <nocturn9x> that ticks every millisecond |
07:39:52 | FromDiscord | <sOkam! 🫐> In reply to @nocturn9x "as long as it's": yes, sec let me link something handy |
07:39:57 | FromDiscord | <nocturn9x> thx :D |
07:40:11 | FromDiscord | <nocturn9x> need it for keeping track of search time in my chess engine |
07:40:20 | FromDiscord | <sOkam! 🫐> In reply to @nocturn9x "as long as it's": https://github.com/heysokam/nstd/blob/master/src/nstd/time.nim |
07:40:38 | PMunch | Ah, if you're using it to time things you're probably better of with monotimes |
07:40:55 | FromDiscord | <nocturn9x> In reply to @PMunch "Ah, if you're using": ah, thanks |
07:40:57 | FromDiscord | <sOkam! 🫐> its a simple wrapper around handy things that you do with monotonic clock↵use it, or just copy/paste the code (MIT, just need to attribute) |
07:41:12 | FromDiscord | <Elegantbeef> That is where one would get a monotonic clock 😛 |
07:42:23 | PMunch | @nocturn9x, subtract two monotimes, and use https://nim-lang.org/docs/times.html#inMilliseconds%2CDuration on the resulting Duration |
07:42:28 | FromDiscord | <nocturn9x> so do I just do `getMonoTime().tick() 1_000_000` |
07:42:32 | PMunch | No |
07:42:38 | FromDiscord | <nocturn9x> In reply to @PMunch "<@523555920265871380>, subtract two monotimes,": oke |
07:42:42 | FromDiscord | <nocturn9x> that makes a lot more sense |
07:42:51 | FromDiscord | <nocturn9x> thanks! |
07:42:54 | FromDiscord | <Elegantbeef> You pretty much always want to do`import std/[times, monotimes]` |
07:42:58 | FromDiscord | <sOkam! 🫐> In reply to @nocturn9x "so do I just": you get a Duration object from two monotimes, and then access the value inside it |
07:43:27 | Amun-Ra | Elegantbeef: alphabetical order please! ;) |
07:43:27 | FromDiscord | <nocturn9x> ye, makes sense |
07:43:49 | FromDiscord | <Elegantbeef> Do you actually sort import alphabetically? |
07:43:56 | PMunch | Amun-Ra, shit, do I need to learn the alphabet? |
07:43:58 | FromDiscord | <Elegantbeef> If so I'm scared of you |
07:44:16 | FromDiscord | <nocturn9x> `self.remainingTime -= (getMonoTime() - startTime).inMilliseconds()` |
07:44:20 | FromDiscord | <nocturn9x> is that right? |
07:44:25 | FromDiscord | <nocturn9x> `startTime` is another mono time ofc |
07:44:36 | PMunch | Sure, looks good |
07:44:40 | FromDiscord | <nocturn9x> okie |
07:44:42 | FromDiscord | <nocturn9x> thanks a lot :) |
07:44:44 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "a ton better than": That looks a bit ugly oof |
07:44:47 | Amun-Ra | Elegantbeef: of course I do; I even made a script to report unsorted imports :P |
07:44:53 | PMunch | Assuming of course that remainingTime is the remaining time in milliseconds |
07:45:06 | FromDiscord | <Elegantbeef> Wow what a waste of time |
07:45:06 | Amun-Ra | PMunch: unfortunately… ;) |
07:45:08 | FromDiscord | <sOkam! 🫐> is my time file really that confusing to understand? 😔↵like I'm doing exactly what you are going to do in there, so i wonder why not take inspiration from it |
07:45:19 | Amun-Ra | Elegantbeef: thanks ;) |
07:45:23 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Do you actually sort": I usually sort it into 3 sections (stdlib, external deps, local deps) and sort those in order of size from biggest to smallest xD |
07:45:24 | PMunch | @Elegantbeef, what did you mean by that return typeof ENOENT thing? |
07:45:35 | FromDiscord | <Elegantbeef> Sokam it's cause your formatting is unreadable |
07:45:35 | FromDiscord | <sOkam! 🫐> In reply to @chronos.vitaqua "That looks a bit": yeah, its the C way |
07:45:58 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "yeah, its the C": Painful |
07:46:04 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "Sokam it's cause your": i guess |
07:46:07 | PMunch | @Robyn_[She/Her], I do something similar, but I always to stdin, local, external |
07:46:12 | PMunch | stdlib* |
07:46:44 | FromDiscord | <Elegantbeef> I mean of course you sort those |
07:46:57 | FromDiscord | <Elegantbeef> You want to use `pkg/` `std/` and then nothing |
07:47:12 | FromDiscord | <Elegantbeef> But to sort alphabetically |
07:47:21 | FromDiscord | <Elegantbeef> It seems so absurd |
07:47:47 | PMunch | Wait, pkg? |
07:47:49 | Amun-Ra | I divide imports into separate groups: std, pkg, non-local (but in path), local; all sorted independently |
07:48:00 | FromDiscord | <Elegantbeef> Yes pmunch |
07:48:08 | PMunch | What's pkg? |
07:48:12 | FromDiscord | <Elegantbeef> `pkg` is a prefix you should use to ensure you get a specific package file and not something local |
07:48:20 | PMunch | Huh |
07:48:24 | Amun-Ra | pkg is the prefix for imports nimble-installed |
07:48:30 | PMunch | So it's like `std` but for Nimble dependencies? |
07:48:31 | FromDiscord | <Elegantbeef> well `nimblepath` |
07:48:38 | FromDiscord | <Elegantbeef> Yes |
07:48:40 | Amun-Ra | PMunch: right |
07:48:47 | PMunch | Right |
07:48:50 | FromDiscord | <Elegantbeef> You should use it and never have an issue with local vs. package |
07:48:59 | PMunch | I saw that in one of my files yesterday and was very confused by what that meant |
07:49:02 | PMunch | But this makes sense |
07:49:15 | PMunch | I haven't really faced that issue before TBH.. |
07:49:41 | FromDiscord | <Elegantbeef> Amun I feel like this will hurt you https://play.nim-lang.org/#pasty=PVHiINzCIAFT |
07:50:29 | FromDiscord | <Elegantbeef> Many import statments, not grouped by source, not sorted |
07:52:45 | FromDiscord | <sOkam! 🫐> important, `pkg/thing` also works for paths added with `--path` manually |
07:57:27 | * | marcus quit (Remote host closed the connection) |
07:59:14 | * | marcus joined #nim |
08:01:52 | Amun-Ra | Elegantbeef: oh "my dicky ticker"… |
08:02:49 | Amun-Ra | (C) Monsieur Alfonse from Allo Allo |
08:03:41 | * | ntat quit (Quit: Leaving) |
08:03:51 | FromDiscord | <Robyn [She/Her]> In reply to @PMunch "@Robyn_[She/Her], I do something": Makes sense |
08:03:58 | Amun-Ra | I also put "from … import" after "import …" |
08:05:35 | Amun-Ra | Elegantbeef: https://play.nim-lang.org/#pasty=eUsGBOfMDFfg |
08:11:06 | * | def- quit (Quit: -) |
08:12:14 | * | def- joined #nim |
08:17:18 | * | def- quit (Quit: -) |
08:35:32 | * | def- joined #nim |
08:37:02 | * | gooba quit (Remote host closed the connection) |
08:41:32 | * | gooba joined #nim |
08:41:36 | * | gooba quit (Remote host closed the connection) |
08:51:51 | FromDiscord | <dolfy0191> sent a code paste, see https://play.nim-lang.org/#pasty=tPqHFTopHEiI |
08:52:49 | FromDiscord | <Elegantbeef> your proc is not `gcsafe` |
08:53:20 | Amun-Ra | you beat me to it :/ |
08:54:21 | FromDiscord | <dolfy0191> In reply to @Elegantbeef "your proc is not": How can I make it safe? I pass an objectref as param:↵proc serve(ledger: LedgerRef) {.async.} = |
08:54:43 | FromDiscord | <dolfy0191> as I need its values to serve the clients |
08:55:42 | FromDiscord | <dolfy0191> btw what does `owned()` mean? |
08:56:11 | FromDiscord | <Elegantbeef> You can disregard `owned` it does nothing |
08:56:41 | FromDiscord | <Elegantbeef> You can do `{.cast(gcSafe).}: #code here` where you access global variables or around the entire body |
09:00:40 | FromDiscord | <dolfy0191> sent a code paste, see https://play.nim-lang.org/#pasty=YjfvOYdXMcgy |
09:00:56 | FromDiscord | <dolfy0191> I tried it for the callback but async does not allow that either |
09:01:28 | FromDiscord | <Elegantbeef> Inside the `cb` |
09:01:37 | FromDiscord | <Elegantbeef> Around the access of the global variable |
09:03:05 | FromDiscord | <dolfy0191> I think I found a solution: I made ledger a let instead of a var |
09:03:40 | FromDiscord | <dolfy0191> sent a code paste, see https://play.nim-lang.org/#pasty=rBQvuWFGVYHi |
09:03:44 | FromDiscord | <dolfy0191> this works apparently |
09:04:09 | FromDiscord | <dolfy0191> Hopefully I can update the object inside the callback |
09:04:22 | FromDiscord | <dolfy0191> I mean the inside variables |
09:07:35 | FromDiscord | <dolfy0191> I was wrong. Still errors out. 😦 Probably because ledger is in a global scope? |
09:16:36 | FromDiscord | <dolfy0191> Yes, this was it. I made it local and now works fine |
09:16:39 | FromDiscord | <dolfy0191> thanks! |
09:19:51 | * | def- quit (Quit: -) |
09:38:34 | * | def- joined #nim |
09:56:51 | * | def- quit (Quit: -) |
09:57:58 | * | def- joined #nim |
10:05:01 | * | def- quit (Quit: -) |
10:06:25 | * | def- joined #nim |
10:23:26 | * | def- quit (Quit: -) |
10:32:16 | * | strogon14 joined #nim |
10:40:02 | * | def- joined #nim |
10:44:36 | strogon14 | I'm looking at https://nim-lang.org/docs/filters.html |
10:44:36 | strogon14 | What is the 'standard' filter used in the generateHTMLPage example? |
10:44:36 | strogon14 | Also, the '# result= ""' in the examples isn't really needed, is it? result is initialized to the return type default value anyway. |
10:56:04 | PMunch | strogon14, I think source code filters are deprecated |
11:05:05 | strogon14 | hmm, does that mean they will be removed? they seem handy to generate non-executable files during the build process, for example. Also, I like that they work in nimscripts. |
11:13:09 | PMunch | I think that's the plan, but not 100% sure. To generate non-executable files? Isn't their whole purpose to generate executables with embedded files? |
11:25:53 | strogon14 | For example, generating meta-data files from objects in your nim code. So you don't have to have a third-party template engine installed for the build process. |
11:28:49 | strogon14 | E.g. my use case would be generating LV2 audio plugin bundle "*.ttl" files, which go along-side the plugin shared library in a LV2 bundle (which is a directory containing said .ttl files and the shared lib). |
11:31:12 | strogon14 | Thes ttl files basically duplicate information, which is already defined in my Nim code (so it can read without loading the plugin shared library), so it makes sense to generate them from the objects my Nim code defines. |
11:32:56 | FromDiscord | <nocturn9x> what would be the simplest way of sending a function off to a worker thread so that it can modify some shared state? |
11:32:56 | strogon14 | I could also use 'nimja' or another template library for this, but why require a third-party lib, when it could be done with standard Nim features? |
11:33:18 | FromDiscord | <nocturn9x> I need to handle the `UCI` stop command and set an `Atomic[bool]` inside a `UCISession.currentSearch` object |
11:33:34 | FromDiscord | <nocturn9x> (edit) "`UCI` stop" => "UCI `stop`" |
11:34:20 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=OaZjzbEzPbXX |
11:34:39 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=KatApIDzGZDB |
11:35:03 | FromDiscord | <nocturn9x> I want to send this off to a worker thread so the main thread can process the stop command and call `self.currentSearch.stopFlag.store(true)` |
11:35:44 | FromDiscord | <nocturn9x> note that moving the ownership of `session` isn't an option: the command loop needs to access it as well, possibly during a search |
11:36:12 | FromDiscord | <nocturn9x> (it won't touch `currentSearch` while `searching` is `true`, though) |
11:39:24 | FromDiscord | <nocturn9x> do I just need to pass a `ptr UCISession`? |
12:31:24 | * | def- quit (Quit: -) |
12:31:53 | * | def- joined #nim |
12:34:58 | * | def- quit (Client Quit) |
12:35:10 | * | def- joined #nim |
12:41:03 | * | ntat joined #nim |
12:47:06 | * | Guest46 joined #nim |
12:47:43 | * | Guest46 quit (Client Quit) |
13:18:04 | * | mahlon quit (Ping timeout: 260 seconds) |
13:28:00 | * | krux02 joined #nim |
13:34:51 | FromDiscord | <goerge_lsd> https://media.discordapp.net/attachments/371759389889003532/1233048579392667720/image.png?ex=662bad7a&is=662a5bfa&hm=0282f72bd0e720fde1ecd685bfdd5f8e8fb85193992f65c80e5f2ddc21584b1f& |
13:35:15 | FromDiscord | <goerge_lsd> why does this say noSideEffect, when I get an exception if there's no such stirng associated with an enum ? |
13:37:57 | PMunch | Because exceptions aren't a side effect but rather a part of the calling convention |
13:38:39 | PMunch | To make the compiler reject exceptions you must use `raises: []` |
13:38:44 | FromDiscord | <goerge_lsd> Oh I think I asked this before, some long time ago |
13:39:12 | FromDiscord | <goerge_lsd> reject exceptions ? |
13:39:32 | PMunch | Yes, a proc with `raises: []` can't raise exceptions |
13:39:46 | PMunch | So if you call something which raises an exception it must be caught and dealt with inside the procedure |
13:40:57 | FromDiscord | <goerge_lsd> oh, that means `raises nothing` |
13:41:03 | PMunch | Yes |
13:41:20 | PMunch | If you had `raises: [IOError]` that means that it will only raise IOErrors |
13:41:39 | FromDiscord | <goerge_lsd> I wonder if there's any discussions to convert the std to use option/result instead of exceptions, a la rust ? : D |
13:42:04 | Amun-Ra | I'd prefer zig way than rust one |
13:42:06 | FromDiscord | <odexine> IIRC rejected, Araq doesn’t like it |
13:42:13 | PMunch | No discussion, it has already been decided against it |
13:42:29 | FromDiscord | <odexine> In reply to @Amun-Ra "I'd prefer zig way": ? Which is |
13:42:58 | PMunch | Of course you could write a small macro to catch exceptions and rewrite the return type to some kind of either type |
13:43:04 | Amun-Ra | odexine: return value or error enum |
13:43:17 | NimEventer | New thread by bajith: When's NimConf 2024?, see https://forum.nim-lang.org/t/11489 |
13:43:31 | Amun-Ra | odexine: it's pretty close to Result |
13:43:39 | FromDiscord | <odexine> So, basically results |
13:44:00 | Amun-Ra | except you have to catch an error |
13:44:17 | Amun-Ra | odexine: https://www.aolium.com/karlseguin/4013ac14-2457-479b-e59b-e603c04673c8 |
13:45:00 | FromDiscord | <odexine> Sounds like an Exception monad? I think? |
13:45:06 | Amun-Ra | hmm |
13:45:51 | FromDiscord | <odexine> And I don’t know. It sounds too forced and I’d say I like how Nim does it more |
13:45:59 | FromDiscord | <odexine> You can choose to in our case |
13:46:08 | FromDiscord | <odexine> The overhead is a problem though yes |
13:46:16 | FromDiscord | <odexine> In reply to @odexine "You can choose to": Choose to enforce |
13:46:41 | * | rockcavera joined #nim |
13:52:20 | FromDiscord | <goerge_lsd> Well I didn't mean necessarily in the official nim std, but would it be feasable to make a port of it to use option/result ? So one could opt in to use it |
13:53:19 | FromDiscord | <goerge_lsd> I don't know much about the technicalities, only that exceptions have some overhead and "are bad" (so they say). Personally, the rust way feels more natural after trying it. |
13:55:32 | FromDiscord | <goerge_lsd> that's why I asked about if there's a discussion (even concluded), I wanted to read on the topic a bit |
13:55:48 | * | mahlon joined #nim |
13:56:37 | FromDiscord | <odexine> In reply to @goerge_lsd "Well I didn't mean": Sure I guess but the problem is that you can’t un-import the system module so |
14:04:43 | * | def- quit (Quit: -) |
14:04:55 | * | def- joined #nim |
14:20:50 | PMunch | @odexine, well you can, but it's a bit convoluted |
14:21:24 | PMunch | Is there even anything in the auto-imported system module which throws exceptions? |
14:22:44 | * | rockcavera quit (Remote host closed the connection) |
14:26:33 | * | rockcavera joined #nim |
14:33:24 | * | PMunch quit (Quit: Leaving) |
14:40:12 | * | def- quit (Quit: -) |
14:41:00 | * | def- joined #nim |
14:51:06 | strogon14 | I'm using nimscript, i.e. custom nimble tasks, for my build procedure, which involves moving files around. Since the std/pathmodule (and all the modules that rely on it) does not work with nimscript, is there another way to create symlinks in a x-platform way (except using exec to call ln/mklink)? |
14:54:09 | * | def- quit (Quit: -) |
14:55:00 | * | def- joined #nim |
14:56:58 | FromDiscord | <the_real_hypno> I guess Pwsh doesn't count either? |
14:57:41 | FromDiscord | <the_real_hypno> So you basically don't want to use tools external to Nim? |
14:58:17 | * | def- quit (Client Quit) |
14:58:49 | * | def- joined #nim |
14:59:22 | FromDiscord | <the_real_hypno> But os is available in Nimscript? |
14:59:41 | FromDiscord | <the_real_hypno> At least the following standard library modules are available:↵↵macros↵os |
15:00:37 | FromDiscord | <the_real_hypno> With CreateSymlink |
15:02:16 | * | ntat quit (Ping timeout: 255 seconds) |
15:03:27 | * | ntat joined #nim |
15:10:35 | * | xutaxkamay quit (Read error: Connection reset by peer) |
15:10:44 | * | xutaxkamay_ joined #nim |
15:11:29 | * | xutaxkamay_ is now known as xutaxkamay |
15:22:56 | strogon14 | If I try to use any module that uses std/paths, I get: Error: undeclared identifier: 'getCurrentDir' |
15:22:56 | strogon14 | https://cpaste.org/?09060f9e1b80e84b#ATSVQ4JvNfU7yj3eEirrSWwCpBVn25B6JR9dtXqaJWAD |
15:24:33 | strogon14 | Which is because of: https://github.com/nim-lang/Nim/blob/4601bb0255335e2c1dfc78ebc33312933215ee95/lib/std/private/ospaths2.nim#L843 |
15:28:49 | strogon14 | I would prefer a solution, where I don't have to care about the availability or syntax of platform-specific tools or quoting paths correctly for the shell etc. |
15:29:38 | FromDiscord | <the_real_hypno> Im still confused |
15:29:45 | FromDiscord | <the_real_hypno> Nimscript can access os |
15:30:00 | FromDiscord | <the_real_hypno> Os imports and exports CreateSymlink |
15:30:11 | FromDiscord | <the_real_hypno> From https://nim-lang.org/docs/ossymlinks.html#createSymlink,string,string |
15:33:13 | FromDiscord | <solitudesf> In reply to @the_real_hypno "Os imports and exports": surely↵`Error: this proc is not available on the NimScript/js target;` |
15:33:30 | strogon14 | Exactly: https://cpaste.org/?32ea36714ffa6fe2#74HdyeJ23qqdHXCaxZtdJLRQNMHpnQnTScb7BkY3Zoga |
15:33:43 | FromDiscord | <the_real_hypno> Oh boy |
15:33:59 | FromDiscord | <the_real_hypno> Did skipped that you told me? |
15:34:11 | FromDiscord | <the_real_hypno> Wait what |
15:34:18 | FromDiscord | <the_real_hypno> Nimscript aswell? |
15:34:52 | FromDiscord | <nikolay_a_k> Sorry for interrupting your conversation. Just want to share some good news. As was already mentioned Nim hasn't binding/wrapper/port for llama.cpp. It happened probably due to complicity of porting from C++. But recently i found simplified llama.dll. It has easy api and it makes possible to use it in any programming language: https://github.com/tinyBigGAMES/Dllama |
15:34:53 | FromDiscord | <the_real_hypno> https://media.discordapp.net/attachments/371759389889003532/1233078784924717128/image0.jpg?ex=662bc99b&is=662a781b&hm=c0b22778a8cc31dae6e35c465dc92ee56ea5f818475c16e0c0187988573b16c6& |
15:35:16 | FromDiscord | <nikolay_a_k> (edit) "binding/wrapper/port" => "bindings/wrapper/port" |
15:37:02 | strogon14 | the_real_hypno: admin rights are ok, as long I can use it in a VM, I'd be happy. |
15:37:04 | FromDiscord | <the_real_hypno> sent a code paste, see https://play.nim-lang.org/#pasty=RCnVJNmiPBVS |
15:37:10 | FromDiscord | <solitudesf> In reply to @strogon14 "I'm using nimscript, i.e.": a workaround is to put tasks code into separate nim file and `selfExec "c -r task.nim"`, or `"r task.nim"`, but then you need to specify paths relative to thesource. |
15:37:21 | FromDiscord | <the_real_hypno> The hell os weirdtargets supposed to be |
15:37:46 | FromDiscord | <solitudesf> In reply to @the_real_hypno "The hell os weirdtargets": nimscript or js |
15:37:57 | FromDiscord | <the_real_hypno> But i already used both commands |
15:38:25 | FromDiscord | <the_real_hypno> Inside a .nims file by compiling the same-name-nim file |
15:38:51 | FromDiscord | <solitudesf> what is that supposed to mean? |
15:39:26 | FromDiscord | <the_real_hypno> Abc.nim + Abc.nims - > same folder. ↵↵nim c Abc.nim |
15:39:40 | FromDiscord | <the_real_hypno> Invokes everything in .nims file |
15:39:51 | FromDiscord | <the_real_hypno> Testable with echo for example |
15:40:26 | FromDiscord | <solitudesf> and? |
15:40:38 | strogon14 | Then is's not really nimscript anymore. |
15:40:44 | strogon14 | *it's |
15:40:55 | FromDiscord | <the_real_hypno> You dont even need to have things in the nim file |
15:41:38 | FromDiscord | <solitudesf> strogon needs to do createSymlink from nimscript. createSymlink isnt implemented for nimscript. |
15:42:20 | FromDiscord | <the_real_hypno> But it is by "ab"using it as a cfg. File |
15:43:14 | FromDiscord | <the_real_hypno> Well, doesn't matter, apparently i can't help. |
15:43:17 | FromDiscord | <solitudesf> okay, man, whatever you say. i'll let you figure it out yourself. |
15:43:35 | FromDiscord | <the_real_hypno> Manly |
15:43:57 | strogon14 | I think at least std/paths should throw a better error when import in a nimscript :) |
15:45:06 | strogon14 | I guess I'll just have to write my own createSymlinks that works on the targets I'm interested in. |
15:54:30 | FromDiscord | <jaar23> hi, i'm happily to share my `tui_widget` repo has finally reach alpha version. https://github.com/jaar23/tui_widget/tree/main↵it is build on top of illwill, feel free to check it out. ↵it's not push to nimble yet as i would like to build something with it to test out the stability first. |
15:55:15 | FromDiscord | <nikolay_a_k> So if someone wants to chat with AI LLM-s from Nim code, join Dllama Discord to create Nim bindings: https://discord.gg/tPWjMwK |
15:55:15 | FromDiscord | <jaar23> (edit) "https://github.com/jaar23/tui_widget/tree/main↵it" => "https://github.com/jaar23/tui_widget↵it" |
15:55:44 | FromDiscord | <Robyn [She/Her]> In reply to @nikolay_a_k "So if someone wants": Out of curiosity, is there a C header for it? |
15:56:08 | FromDiscord | <Robyn [She/Her]> If there is, Futhark would likely be perfect for this |
15:56:29 | FromDiscord | <nikolay_a_k> Yes, there is (as soon as i get it being a newbie). |
15:56:44 | FromDiscord | <Robyn [She/Her]> Fair |
16:27:47 | * | xutaxkamay quit (*.net *.split) |
16:27:47 | * | marcus quit (*.net *.split) |
16:27:47 | * | jkl quit (*.net *.split) |
16:27:48 | * | perr_ quit (*.net *.split) |
16:27:49 | * | lain quit (*.net *.split) |
16:27:51 | * | SEP quit (*.net *.split) |
16:27:52 | * | nazgulsenpai quit (*.net *.split) |
16:27:52 | * | ttkap quit (*.net *.split) |
16:27:54 | * | GreaseMonkey quit (*.net *.split) |
16:27:55 | * | dv^_^ quit (*.net *.split) |
16:27:56 | * | tanami quit (*.net *.split) |
16:27:57 | * | Amun-Ra quit (*.net *.split) |
16:28:01 | * | oddish quit (*.net *.split) |
16:28:05 | * | anddam quit (*.net *.split) |
16:28:05 | * | hexeme quit (*.net *.split) |
16:28:05 | * | mahlon quit (*.net *.split) |
16:28:07 | * | Mister_Magister quit (*.net *.split) |
16:28:08 | * | pbsds quit (*.net *.split) |
16:28:09 | * | krux02 quit (*.net *.split) |
16:28:09 | * | Jjp137 quit (*.net *.split) |
16:28:09 | * | KhazAkar quit (*.net *.split) |
16:28:10 | * | oprypin quit (*.net *.split) |
16:28:10 | * | lumidify quit (*.net *.split) |
16:28:10 | * | mal`` quit (*.net *.split) |
16:28:10 | * | FromDiscord quit (*.net *.split) |
16:28:11 | * | hernan quit (*.net *.split) |
16:28:11 | * | attah quit (*.net *.split) |
16:28:11 | * | Goodbye_Vincent quit (*.net *.split) |
16:28:13 | * | deadmarshal_ quit (*.net *.split) |
16:28:13 | * | johuck quit (*.net *.split) |
16:28:16 | * | acidsys quit (*.net *.split) |
16:28:16 | * | ntat quit (*.net *.split) |
16:28:16 | * | def- quit (*.net *.split) |
16:28:16 | * | pmp-p quit (*.net *.split) |
16:28:17 | * | nyeaa49284230101 quit (*.net *.split) |
16:28:17 | * | cnx quit (*.net *.split) |
16:28:17 | * | casaca quit (*.net *.split) |
16:28:17 | * | gshumway_ quit (*.net *.split) |
16:28:19 | * | oisota quit (*.net *.split) |
16:28:19 | * | void09 quit (*.net *.split) |
16:28:20 | * | dtomato quit (*.net *.split) |
16:28:20 | * | ursa-major quit (*.net *.split) |
16:28:20 | * | noeontheend quit (*.net *.split) |
16:28:21 | * | syl quit (*.net *.split) |
16:28:21 | * | m5zs7k quit (*.net *.split) |
16:28:23 | * | _________ quit (*.net *.split) |
16:28:25 | * | computerquip quit (*.net *.split) |
16:28:26 | * | blackbeard420 quit (*.net *.split) |
16:28:26 | * | dza quit (*.net *.split) |
16:28:27 | * | lucerne quit (*.net *.split) |
16:28:27 | * | fallback quit (*.net *.split) |
16:28:28 | * | ehmry quit (*.net *.split) |
16:28:28 | * | strogon14 quit (*.net *.split) |
16:28:28 | * | Batzy quit (*.net *.split) |
16:28:29 | * | termer quit (*.net *.split) |
16:28:29 | * | alice quit (*.net *.split) |
16:28:29 | * | notchris quit (*.net *.split) |
16:28:30 | * | tk quit (*.net *.split) |
16:28:31 | * | robertmeta quit (*.net *.split) |
16:28:31 | * | mronetwo quit (*.net *.split) |
16:28:31 | * | Jhonny2x4 quit (*.net *.split) |
16:28:31 | * | nisstyre quit (*.net *.split) |
16:28:32 | * | eery quit (*.net *.split) |
16:28:32 | * | oz quit (*.net *.split) |
16:28:33 | * | ormiret quit (*.net *.split) |
16:28:33 | * | ChanServ quit (*.net *.split) |
16:28:34 | * | systemdsucks quit (*.net *.split) |
16:28:35 | * | Lord_Nightmare quit (*.net *.split) |
16:28:35 | * | cornfeedhobo quit (*.net *.split) |
16:28:36 | * | Ekho quit (*.net *.split) |
16:28:36 | * | NimEventer quit (*.net *.split) |
16:28:37 | * | adigitoleo quit (*.net *.split) |
16:28:37 | * | bcksl quit (*.net *.split) |
16:28:39 | * | cm quit (*.net *.split) |
16:28:39 | * | Onionhammer quit (*.net *.split) |
16:28:40 | * | LyndsySimon quit (*.net *.split) |
16:33:58 | * | tk joined #nim |
16:33:58 | * | notchris joined #nim |
16:33:58 | * | ormiret joined #nim |
16:33:58 | * | lucerne joined #nim |
16:33:58 | * | void09 joined #nim |
16:33:58 | * | acidsys joined #nim |
16:33:58 | * | oddish joined #nim |
16:33:58 | * | Goodbye_Vincent joined #nim |
16:33:58 | * | oz joined #nim |
16:33:58 | * | oisota joined #nim |
16:33:58 | * | alice joined #nim |
16:33:58 | * | attah joined #nim |
16:33:58 | * | hernan joined #nim |
16:33:58 | * | Amun-Ra joined #nim |
16:33:58 | * | hexeme joined #nim |
16:33:58 | * | anddam joined #nim |
16:33:58 | * | m5zs7k joined #nim |
16:33:58 | * | syl joined #nim |
16:33:58 | * | eery joined #nim |
16:33:58 | * | FromDiscord joined #nim |
16:33:58 | * | dza joined #nim |
16:33:58 | * | tanami joined #nim |
16:33:58 | * | mal`` joined #nim |
16:33:58 | * | blackbeard420 joined #nim |
16:33:58 | * | nisstyre joined #nim |
16:33:58 | * | computerquip joined #nim |
16:33:58 | * | termer joined #nim |
16:33:58 | * | lumidify joined #nim |
16:33:58 | * | Jhonny2x4 joined #nim |
16:33:58 | * | Batzy joined #nim |
16:33:58 | * | gshumway_ joined #nim |
16:33:58 | * | oprypin joined #nim |
16:33:58 | * | mronetwo joined #nim |
16:33:58 | * | ursa-major joined #nim |
16:33:58 | * | noeontheend joined #nim |
16:33:58 | * | johuck joined #nim |
16:33:58 | * | robertmeta joined #nim |
16:33:58 | * | casaca joined #nim |
16:33:58 | * | pbsds joined #nim |
16:33:58 | * | dv^_^ joined #nim |
16:33:58 | * | deadmarshal_ joined #nim |
16:33:58 | * | ttkap joined #nim |
16:33:58 | * | dtomato joined #nim |
16:33:58 | * | nazgulsenpai joined #nim |
16:33:58 | * | cnx joined #nim |
16:33:58 | * | Mister_Magister joined #nim |
16:33:58 | * | KhazAkar joined #nim |
16:33:58 | * | nyeaa49284230101 joined #nim |
16:33:58 | * | GreaseMonkey joined #nim |
16:33:58 | * | ehmry joined #nim |
16:33:58 | * | Jjp137 joined #nim |
16:33:58 | * | fallback joined #nim |
16:33:58 | * | _________ joined #nim |
16:33:58 | * | pmp-p joined #nim |
16:33:58 | * | SEP joined #nim |
16:33:58 | * | strogon14 joined #nim |
16:33:58 | * | krux02 joined #nim |
16:33:58 | * | mahlon joined #nim |
16:33:58 | * | def- joined #nim |
16:33:58 | * | ntat joined #nim |
16:33:58 | * | LyndsySimon joined #nim |
16:33:58 | * | Onionhammer joined #nim |
16:33:58 | * | cm joined #nim |
16:33:58 | * | bcksl joined #nim |
16:33:58 | * | xutaxkamay joined #nim |
16:33:58 | * | marcus joined #nim |
16:33:58 | * | jkl joined #nim |
16:33:58 | * | perr_ joined #nim |
16:33:58 | * | lain joined #nim |
16:33:58 | * | systemdsucks joined #nim |
16:33:58 | * | Lord_Nightmare joined #nim |
16:33:58 | * | cornfeedhobo joined #nim |
16:33:58 | * | Ekho joined #nim |
16:33:58 | * | NimEventer joined #nim |
16:34:58 | * | adigitoleo joined #nim |
16:54:14 | * | xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1 - https://znc.in) |
16:55:11 | * | xutaxkamay joined #nim |
16:57:53 | * | SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev) |
17:27:18 | * | KhazAkar quit (Remote host closed the connection) |
17:50:30 | FromDiscord | <ezquerra> How comes that `OrderedSet` does not support many operations supported by `HashSet`, such as intersection, difference, etc...? |
18:12:52 | NimEventer | New thread by Nlits: Nim “free(): invalid pointer” segfault (dynlib), see https://forum.nim-lang.org/t/11493 |
18:19:58 | Amun-Ra | I like non reproducible code sample |
18:28:37 | FromDiscord | <.bobbbob> Would it be possible to embed nimscript in a binary and have a sort of eval function? |
18:31:30 | strogon14 | yes, https://github.com/beef331/nimscripter |
18:31:51 | strogon14 | and see pmunch's blog articles. |
18:32:13 | Amun-Ra | beef mentioned |
18:40:25 | * | ntat quit (Quit: Leaving) |
18:47:21 | FromDiscord | <xkonti> In reply to @strogon14 "yes, https://github.com/beef331/nimscripter": Looks like fun! |
18:50:34 | FromDiscord | <.bobbbob> Oh cool |
19:07:59 | FromDiscord | <nervecenter> In reply to @strogon14 "yes, https://github.com/beef331/nimscripter": Kinda want to see something like this for Janet. A Janet <-> Nim FFI layer would be excellent. |