<< 25-04-2024 >>

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:25FromDiscord<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:34FromDiscord<xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=LOiNkLmXKCLu
04:36:36FromDiscord<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:52FromDiscord<Elegantbeef> @xkonti you derive from a common error
04:39:22FromDiscord<Elegantbeef> As you've done, there is nothing else you can do if you're doing exception based exceptions
04:41:15FromDiscord<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:28FromDiscord<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:40FromDiscord<Elegantbeef> You annotate the base raise for all the root exceptions your base should raise
04:42:40FromDiscord<Elegantbeef> This forces all your children to be a subset of those raises
04:56:13FromDiscord<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:19FromDiscord<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:04FromDiscord<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:55FromDiscord<xkonti> Thank you for your swift help on a livestream 🎖️
05:13:20FromDiscord<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:52FromDiscord<xkonti> Yeah I'm thinking of somewhat generic ones that could be utilized by various backend implementations: `FileSystemError`, `AccessDeniedError`, `FileNotFoundError`, `DirectoryNotEmptyError`, etc.
05:17:58FromDiscord<xkonti> Where the `FileSystemError` is the most generic one that could caused by things like missing partition, SFTP connection failure...
05:19:17FromDiscord<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:15FromDiscord<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:28FromDiscord<Elegantbeef> Or you can handle errors in any other way that does not tie in with Nim's exceptions 😄
05:22:50FromDiscord<xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=KIBbDrxnhVue
05:23:17FromDiscord<Elegantbeef> You could always use tuples like golang 😄
05:23:24FromDiscord<xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=XvYqwFsVZSwW
05:23:36FromDiscord<Elegantbeef> `tuple[exists: bool, errorMessage: string]` for instance
05:24:00FromDiscord<xkonti> In reply to @Elegantbeef "You could always use": Thought about it, but again, not aligned with Nim std lib 😦
05:24:01FromDiscord<Elegantbeef> Also do not follow the stdlib's convention of `newT`
05:24:18FromDiscord<Elegantbeef> Please for all thing good and holy do `proc new( _: typedesc[T], ...): T`
05:24:55FromDiscord<Elegantbeef> The stdlib makes it impossible to do anything nice and generic
05:25:14FromDiscord<xkonti> Oh! Thanks! That's a good idea. Although in my case it would be `proc new(_: typedesc[T], ...): FileSystem`
05:25:31FromDiscord<Elegantbeef> Well it'd be replace `T` with the type
05:27:09FromDiscord<xkonti> Oh no... That requires the `OsFs` to be exported 😦
05:27:16FromDiscord<Elegantbeef> Good
05:27:53FromDiscord<Elegantbeef> Mark it `{.final.}` and there you go there's no worry in it being exported
05:29:14FromDiscord<Elegantbeef> I'd argue the return type should be `OsFs` anyway
05:29:14FromDiscord<Elegantbeef> As you know child objects implicitly convert to parents anyway so losing type information is a net loss
05:31:38FromDiscord<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:16FromDiscord<Elegantbeef> Right which they should
05:32:37FromDiscord<Elegantbeef> Statically dispatching where possible is always nicer
05:33:39FromDiscord<xkonti> Considering this deals with files and directories, the overhead of dynamic dispatching is practically non-exsitent 😄
05:35:07FromDiscord<xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=ruZNCSiaRQli
05:36:08FromDiscord<Elegantbeef> Well yea
05:36:13FromDiscord<Elegantbeef> `system.new(OsFs)`
05:36:49FromDiscord<xkonti> Another thing learned. Thanks!
05:37:52FromDiscord<xkonti> Are you aware if NimSuggest is super-bad just in VsCode or is it the same in all the editors?
05:38:19FromDiscord<Elegantbeef> The nim tooling is subpar, you are using the official extension though right?
05:38:38FromDiscord<xkonti> Yes. The official one.
05:39:24FromDiscord<xkonti> The moment I split things into multiple files it totally falls apart.
05:40:11FromDiscord<Elegantbeef> It does need to be told all the entry files manually
05:40:32FromDiscord<Elegantbeef> https://github.com/nim-lang/vscode-nim?tab=readme-ov-file#options mentioned here
05:41:16FromDiscord<xkonti> Ooooh. I see. I'll try that out tomorrow. Thank you for your help again.
05:45:22FromDiscord<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:51FromDiscord<Elegantbeef> Mom i'm on TV!
05:49:19FromDiscord<Elegantbeef> Watching that you do misunderstand
05:50:04FromDiscord<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:22FromDiscord<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:49FromDiscord<Elegantbeef> It does not even need to know about traitor any type that matches that `Stream` signature can be converted
05:52:20FromDiscord<Elegantbeef> Just going to @xkonti just cause I assume you've gone offline 😄
06:05:08*ntat joined #nim
06:08:45FromDiscord<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:10PMunchI think I'm in a love-hate relationship with blocks and implicit return
07:10:55PMunchLike, this feels wrong https://pasty.ee/xTXraqBkqmhf, but from a technical point of view it's pretty great
07:11:55PMunchIt 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:04PMunchBut still it just feels so wrong
07:32:10FromDiscord<the_real_hypno> What type is getting infered there?
07:32:29FromDiscord<the_real_hypno> Or is year a string?
07:33:11FromDiscord<the_real_hypno> Ah I see, questions answered, thank 😛
07:34:50FromDiscord<pmunch> Yeah `fcontent` ends up being a string here
07:36:50FromDiscord<sOkam! 🫐> In reply to @PMunch "Like, this feels wrong": why wrong? 🤔
07:37:22FromDiscord<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:24FromDiscord<sOkam! 🫐> I have like a LOT of those in my lang compiler, lol 🙈↵... _runs-away-to-hide-in-a-corner_
07:37:50PMunchI mean it's a 20-line long let assignment :P
07:38:20PMunchBut yeah, I tend to use these a lot
07:38:56FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "I've gotten pretty used": a ton better than `(condition) ? trueVal : falseVal;`, for sure
07:38:57PMunchJust 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:05FromDiscord<nocturn9x> is there a way to get the current time in milliseconds?
07:39:11PMunchYes
07:39:20FromDiscord<sOkam! 🫐> In reply to @nocturn9x "is there a way": depends on usecase, but yes in two different ways
07:39:20FromDiscord<nocturn9x> Nim's documentation isn't terribly helpful and googling only brings up old examples that are broken
07:39:27FromDiscord<nocturn9x> I need an integer, by the way
07:39:35FromDiscord<sOkam! 🫐> yes to that too
07:39:35FromDiscord<Elegantbeef> Just need to make a proc return `(typeof(ENonet), string)` then make a `returnUnpack(yourProc(...) ENoErrr)`
07:39:35FromDiscord<nocturn9x> it doesn't have to be the current time either
07:39:40FromDiscord<nocturn9x> as long as it's a monotonic clock
07:39:49FromDiscord<nocturn9x> that ticks every millisecond
07:39:52FromDiscord<sOkam! 🫐> In reply to @nocturn9x "as long as it's": yes, sec let me link something handy
07:39:57FromDiscord<nocturn9x> thx :D
07:40:11FromDiscord<nocturn9x> need it for keeping track of search time in my chess engine
07:40:20FromDiscord<sOkam! 🫐> In reply to @nocturn9x "as long as it's": https://github.com/heysokam/nstd/blob/master/src/nstd/time.nim
07:40:38PMunchAh, if you're using it to time things you're probably better of with monotimes
07:40:55FromDiscord<nocturn9x> In reply to @PMunch "Ah, if you're using": ah, thanks
07:40:57FromDiscord<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:12FromDiscord<Elegantbeef> That is where one would get a monotonic clock 😛
07:42:23PMunch@nocturn9x, subtract two monotimes, and use https://nim-lang.org/docs/times.html#inMilliseconds%2CDuration on the resulting Duration
07:42:28FromDiscord<nocturn9x> so do I just do `getMonoTime().tick() 1_000_000`
07:42:32PMunchNo
07:42:38FromDiscord<nocturn9x> In reply to @PMunch "<@523555920265871380>, subtract two monotimes,": oke
07:42:42FromDiscord<nocturn9x> that makes a lot more sense
07:42:51FromDiscord<nocturn9x> thanks!
07:42:54FromDiscord<Elegantbeef> You pretty much always want to do`import std/[times, monotimes]`
07:42:58FromDiscord<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:27Amun-RaElegantbeef: alphabetical order please! ;)
07:43:27FromDiscord<nocturn9x> ye, makes sense
07:43:49FromDiscord<Elegantbeef> Do you actually sort import alphabetically?
07:43:56PMunchAmun-Ra, shit, do I need to learn the alphabet?
07:43:58FromDiscord<Elegantbeef> If so I'm scared of you
07:44:16FromDiscord<nocturn9x> `self.remainingTime -= (getMonoTime() - startTime).inMilliseconds()`
07:44:20FromDiscord<nocturn9x> is that right?
07:44:25FromDiscord<nocturn9x> `startTime` is another mono time ofc
07:44:36PMunchSure, looks good
07:44:40FromDiscord<nocturn9x> okie
07:44:42FromDiscord<nocturn9x> thanks a lot :)
07:44:44FromDiscord<Robyn [She/Her]> In reply to @heysokam "a ton better than": That looks a bit ugly oof
07:44:47Amun-RaElegantbeef: of course I do; I even made a script to report unsorted imports :P
07:44:53PMunchAssuming of course that remainingTime is the remaining time in milliseconds
07:45:06FromDiscord<Elegantbeef> Wow what a waste of time
07:45:06Amun-RaPMunch: unfortunately… ;)
07:45:08FromDiscord<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:19Amun-RaElegantbeef: thanks ;)
07:45:23FromDiscord<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:24PMunch@Elegantbeef, what did you mean by that return typeof ENOENT thing?
07:45:35FromDiscord<Elegantbeef> Sokam it's cause your formatting is unreadable
07:45:35FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "That looks a bit": yeah, its the C way
07:45:58FromDiscord<Robyn [She/Her]> In reply to @heysokam "yeah, its the C": Painful
07:46:04FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "Sokam it's cause your": i guess
07:46:07PMunch@Robyn_[She/Her], I do something similar, but I always to stdin, local, external
07:46:12PMunchstdlib*
07:46:44FromDiscord<Elegantbeef> I mean of course you sort those
07:46:57FromDiscord<Elegantbeef> You want to use `pkg/` `std/` and then nothing
07:47:12FromDiscord<Elegantbeef> But to sort alphabetically
07:47:21FromDiscord<Elegantbeef> It seems so absurd
07:47:47PMunchWait, pkg?
07:47:49Amun-RaI divide imports into separate groups: std, pkg, non-local (but in path), local; all sorted independently
07:48:00FromDiscord<Elegantbeef> Yes pmunch
07:48:08PMunchWhat's pkg?
07:48:12FromDiscord<Elegantbeef> `pkg` is a prefix you should use to ensure you get a specific package file and not something local
07:48:20PMunchHuh
07:48:24Amun-Rapkg is the prefix for imports nimble-installed
07:48:30PMunchSo it's like `std` but for Nimble dependencies?
07:48:31FromDiscord<Elegantbeef> well `nimblepath`
07:48:38FromDiscord<Elegantbeef> Yes
07:48:40Amun-RaPMunch: right
07:48:47PMunchRight
07:48:50FromDiscord<Elegantbeef> You should use it and never have an issue with local vs. package
07:48:59PMunchI saw that in one of my files yesterday and was very confused by what that meant
07:49:02PMunchBut this makes sense
07:49:15PMunchI haven't really faced that issue before TBH..
07:49:41FromDiscord<Elegantbeef> Amun I feel like this will hurt you https://play.nim-lang.org/#pasty=PVHiINzCIAFT
07:50:29FromDiscord<Elegantbeef> Many import statments, not grouped by source, not sorted
07:52:45FromDiscord<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:52Amun-RaElegantbeef: oh "my dicky ticker"…
08:02:49Amun-Ra(C) Monsieur Alfonse from Allo Allo
08:03:41*ntat quit (Quit: Leaving)
08:03:51FromDiscord<Robyn [She/Her]> In reply to @PMunch "@Robyn_[She/Her], I do something": Makes sense
08:03:58Amun-RaI also put "from … import" after "import …"
08:05:35Amun-RaElegantbeef: 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:51FromDiscord<dolfy0191> sent a code paste, see https://play.nim-lang.org/#pasty=tPqHFTopHEiI
08:52:49FromDiscord<Elegantbeef> your proc is not `gcsafe`
08:53:20Amun-Rayou beat me to it :/
08:54:21FromDiscord<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:43FromDiscord<dolfy0191> as I need its values to serve the clients
08:55:42FromDiscord<dolfy0191> btw what does `owned()` mean?
08:56:11FromDiscord<Elegantbeef> You can disregard `owned` it does nothing
08:56:41FromDiscord<Elegantbeef> You can do `{.cast(gcSafe).}: #code here` where you access global variables or around the entire body
09:00:40FromDiscord<dolfy0191> sent a code paste, see https://play.nim-lang.org/#pasty=YjfvOYdXMcgy
09:00:56FromDiscord<dolfy0191> I tried it for the callback but async does not allow that either
09:01:28FromDiscord<Elegantbeef> Inside the `cb`
09:01:37FromDiscord<Elegantbeef> Around the access of the global variable
09:03:05FromDiscord<dolfy0191> I think I found a solution: I made ledger a let instead of a var
09:03:40FromDiscord<dolfy0191> sent a code paste, see https://play.nim-lang.org/#pasty=rBQvuWFGVYHi
09:03:44FromDiscord<dolfy0191> this works apparently
09:04:09FromDiscord<dolfy0191> Hopefully I can update the object inside the callback
09:04:22FromDiscord<dolfy0191> I mean the inside variables
09:07:35FromDiscord<dolfy0191> I was wrong. Still errors out. 😦 Probably because ledger is in a global scope?
09:16:36FromDiscord<dolfy0191> Yes, this was it. I made it local and now works fine
09:16:39FromDiscord<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:36strogon14I'm looking at https://nim-lang.org/docs/filters.html
10:44:36strogon14What is the 'standard' filter used in the generateHTMLPage example?
10:44:36strogon14Also, the '# result= ""' in the examples isn't really needed, is it? result is initialized to the return type default value anyway.
10:56:04PMunchstrogon14, I think source code filters are deprecated
11:05:05strogon14hmm, 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:09PMunchI 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:53strogon14For 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:49strogon14E.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:12strogon14Thes 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:56FromDiscord<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:56strogon14I 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:18FromDiscord<nocturn9x> I need to handle the `UCI` stop command and set an `Atomic[bool]` inside a `UCISession.currentSearch` object
11:33:34FromDiscord<nocturn9x> (edit) "`UCI` stop" => "UCI `stop`"
11:34:20FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=OaZjzbEzPbXX
11:34:39FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=KatApIDzGZDB
11:35:03FromDiscord<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:44FromDiscord<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:12FromDiscord<nocturn9x> (it won't touch `currentSearch` while `searching` is `true`, though)
11:39:24FromDiscord<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:51FromDiscord<goerge_lsd> https://media.discordapp.net/attachments/371759389889003532/1233048579392667720/image.png?ex=662bad7a&is=662a5bfa&hm=0282f72bd0e720fde1ecd685bfdd5f8e8fb85193992f65c80e5f2ddc21584b1f&
13:35:15FromDiscord<goerge_lsd> why does this say noSideEffect, when I get an exception if there's no such stirng associated with an enum ?
13:37:57PMunchBecause exceptions aren't a side effect but rather a part of the calling convention
13:38:39PMunchTo make the compiler reject exceptions you must use `raises: []`
13:38:44FromDiscord<goerge_lsd> Oh I think I asked this before, some long time ago
13:39:12FromDiscord<goerge_lsd> reject exceptions ?
13:39:32PMunchYes, a proc with `raises: []` can't raise exceptions
13:39:46PMunchSo if you call something which raises an exception it must be caught and dealt with inside the procedure
13:40:57FromDiscord<goerge_lsd> oh, that means `raises nothing`
13:41:03PMunchYes
13:41:20PMunchIf you had `raises: [IOError]` that means that it will only raise IOErrors
13:41:39FromDiscord<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:04Amun-RaI'd prefer zig way than rust one
13:42:06FromDiscord<odexine> IIRC rejected, Araq doesn’t like it
13:42:13PMunchNo discussion, it has already been decided against it
13:42:29FromDiscord<odexine> In reply to @Amun-Ra "I'd prefer zig way": ? Which is
13:42:58PMunchOf course you could write a small macro to catch exceptions and rewrite the return type to some kind of either type
13:43:04Amun-Raodexine: return value or error enum
13:43:17NimEventerNew thread by bajith: When's NimConf 2024?, see https://forum.nim-lang.org/t/11489
13:43:31Amun-Raodexine: it's pretty close to Result
13:43:39FromDiscord<odexine> So, basically results
13:44:00Amun-Raexcept you have to catch an error
13:44:17Amun-Raodexine: https://www.aolium.com/karlseguin/4013ac14-2457-479b-e59b-e603c04673c8
13:45:00FromDiscord<odexine> Sounds like an Exception monad? I think?
13:45:06Amun-Rahmm
13:45:51FromDiscord<odexine> And I don’t know. It sounds too forced and I’d say I like how Nim does it more
13:45:59FromDiscord<odexine> You can choose to in our case
13:46:08FromDiscord<odexine> The overhead is a problem though yes
13:46:16FromDiscord<odexine> In reply to @odexine "You can choose to": Choose to enforce
13:46:41*rockcavera joined #nim
13:52:20FromDiscord<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:19FromDiscord<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:32FromDiscord<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:37FromDiscord<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:50PMunch@odexine, well you can, but it's a bit convoluted
14:21:24PMunchIs 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:06strogon14I'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:58FromDiscord<the_real_hypno> I guess Pwsh doesn't count either?
14:57:41FromDiscord<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:22FromDiscord<the_real_hypno> But os is available in Nimscript?
14:59:41FromDiscord<the_real_hypno> At least the following standard library modules are available:↵↵macros↵os
15:00:37FromDiscord<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:56strogon14If I try to use any module that uses std/paths, I get: Error: undeclared identifier: 'getCurrentDir'
15:22:56strogon14https://cpaste.org/?09060f9e1b80e84b#ATSVQ4JvNfU7yj3eEirrSWwCpBVn25B6JR9dtXqaJWAD
15:24:33strogon14Which is because of: https://github.com/nim-lang/Nim/blob/4601bb0255335e2c1dfc78ebc33312933215ee95/lib/std/private/ospaths2.nim#L843
15:28:49strogon14I 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:38FromDiscord<the_real_hypno> Im still confused
15:29:45FromDiscord<the_real_hypno> Nimscript can access os
15:30:00FromDiscord<the_real_hypno> Os imports and exports CreateSymlink
15:30:11FromDiscord<the_real_hypno> From https://nim-lang.org/docs/ossymlinks.html#createSymlink,string,string
15:33:13FromDiscord<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:30strogon14Exactly: https://cpaste.org/?32ea36714ffa6fe2#74HdyeJ23qqdHXCaxZtdJLRQNMHpnQnTScb7BkY3Zoga
15:33:43FromDiscord<the_real_hypno> Oh boy
15:33:59FromDiscord<the_real_hypno> Did skipped that you told me?
15:34:11FromDiscord<the_real_hypno> Wait what
15:34:18FromDiscord<the_real_hypno> Nimscript aswell?
15:34:52FromDiscord<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:53FromDiscord<the_real_hypno> https://media.discordapp.net/attachments/371759389889003532/1233078784924717128/image0.jpg?ex=662bc99b&is=662a781b&hm=c0b22778a8cc31dae6e35c465dc92ee56ea5f818475c16e0c0187988573b16c6&
15:35:16FromDiscord<nikolay_a_k> (edit) "binding/wrapper/port" => "bindings/wrapper/port"
15:37:02strogon14the_real_hypno: admin rights are ok, as long I can use it in a VM, I'd be happy.
15:37:04FromDiscord<the_real_hypno> sent a code paste, see https://play.nim-lang.org/#pasty=RCnVJNmiPBVS
15:37:10FromDiscord<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:21FromDiscord<the_real_hypno> The hell os weirdtargets supposed to be
15:37:46FromDiscord<solitudesf> In reply to @the_real_hypno "The hell os weirdtargets": nimscript or js
15:37:57FromDiscord<the_real_hypno> But i already used both commands
15:38:25FromDiscord<the_real_hypno> Inside a .nims file by compiling the same-name-nim file
15:38:51FromDiscord<solitudesf> what is that supposed to mean?
15:39:26FromDiscord<the_real_hypno> Abc.nim + Abc.nims - > same folder. ↵↵nim c Abc.nim
15:39:40FromDiscord<the_real_hypno> Invokes everything in .nims file
15:39:51FromDiscord<the_real_hypno> Testable with echo for example
15:40:26FromDiscord<solitudesf> and?
15:40:38strogon14Then is's not really nimscript anymore.
15:40:44strogon14*it's
15:40:55FromDiscord<the_real_hypno> You dont even need to have things in the nim file
15:41:38FromDiscord<solitudesf> strogon needs to do createSymlink from nimscript. createSymlink isnt implemented for nimscript.
15:42:20FromDiscord<the_real_hypno> But it is by "ab"using it as a cfg. File
15:43:14FromDiscord<the_real_hypno> Well, doesn't matter, apparently i can't help.
15:43:17FromDiscord<solitudesf> okay, man, whatever you say. i'll let you figure it out yourself.
15:43:35FromDiscord<the_real_hypno> Manly
15:43:57strogon14I think at least std/paths should throw a better error when import in a nimscript :)
15:45:06strogon14I guess I'll just have to write my own createSymlinks that works on the targets I'm interested in.
15:54:30FromDiscord<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:15FromDiscord<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:15FromDiscord<jaar23> (edit) "https://github.com/jaar23/tui_widget/tree/main↵it" => "https://github.com/jaar23/tui_widget↵it"
15:55:44FromDiscord<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:08FromDiscord<Robyn [She/Her]> If there is, Futhark would likely be perfect for this
15:56:29FromDiscord<nikolay_a_k> Yes, there is (as soon as i get it being a newbie).
15:56:44FromDiscord<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:30FromDiscord<ezquerra> How comes that `OrderedSet` does not support many operations supported by `HashSet`, such as intersection, difference, etc...?
18:12:52NimEventerNew thread by Nlits: Nim “free(): invalid pointer” segfault (dynlib), see https://forum.nim-lang.org/t/11493
18:19:58Amun-RaI like non reproducible code sample
18:28:37FromDiscord<.bobbbob> Would it be possible to embed nimscript in a binary and have a sort of eval function?
18:31:30strogon14yes, https://github.com/beef331/nimscripter
18:31:51strogon14and see pmunch's blog articles.
18:32:13Amun-Rabeef mentioned
18:40:25*ntat quit (Quit: Leaving)
18:47:21FromDiscord<xkonti> In reply to @strogon14 "yes, https://github.com/beef331/nimscripter": Looks like fun!
18:50:34FromDiscord<.bobbbob> Oh cool
19:07:59FromDiscord<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.