<< 28-11-2024 >>

00:04:39FromDiscord<Elegantbeef> https://github.com/ansiwave/nimwave is an interesting TUI library, but don't think it's declarative
00:08:38*xet7 quit (Remote host closed the connection)
00:10:06*xet7 joined #nim
00:19:23FromDiscord<.bobbbob> seems cool
00:26:04*SchweinDeBurg joined #nim
00:46:06FromDiscord<thearthurm> In reply to @.bobbbob "seems cool": Im writing one for my language because I have to make an interpreter and parser in the cli
00:56:44FromDiscord<Elegantbeef> Command line arguments are not what they mean by a TUI
01:08:05*kk joined #nim
01:27:15*SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev)
01:48:47madpropshttps://lucumr.pocoo.org/2024/11/18/threads-beat-async-await/
01:48:59madpropswonder how nim implemented async await
01:49:06madpropsthis guy thinks it should be pure threads
01:55:08FromDiscord<heysokam> how did one write to a file that does not exist yet?↵I feel like I knew this, but can't seem to remember
01:59:53FromDiscord<heysokam> oh, it wasn't the file. it was the folder that was missing
02:06:32*rockcavera quit (Remote host closed the connection)
02:31:06*kk quit (Quit: Quit)
02:33:59*_________ quit (Ping timeout: 260 seconds)
03:06:43FromDiscord<bostonboston> In reply to @madprops "wonder how nim implemented": I async pragma turns your functions into iterators that yield on `await` and the dispatcher is an event loop, I think
03:47:26FromDiscord<thearthurm> In reply to @Elegantbeef "Command line arguments are": Ik
03:47:33FromDiscord<thearthurm> It's not what I mean either
03:47:59FromDiscord<thearthurm> I need to be able to build an ipython style repl, and I want it to be more like a tui app than a cli app
03:48:09FromDiscord<thearthurm> Do we have access to cursed in nim?
03:48:36FromDiscord<Elegantbeef> Of course it's a C-lib
03:48:39FromDiscord<Elegantbeef> Though there is illwill
03:56:07*krux02 quit (Remote host closed the connection)
03:59:10*SchweinDeBurg joined #nim
05:45:46FromDiscord<demotomohiro> In reply to @heysokam "how did one write": Use `writeFile` proc or open file with `fmWrite`.↵https://nim-lang.org/docs/syncio.html
06:15:22*ntat joined #nim
06:21:11*_________ joined #nim
07:08:11FromDiscord<gogolxdong666> sent a code paste, see https://play.nim-lang.org/#pasty=RMjzTXZk
07:26:20*PMunch joined #nim
08:05:05Amun-Rathe easiest way to fix that is to remove repo dir and repopulate all the packages
08:36:35FromDiscord<heysokam> In reply to @thearthurm "Do we have access": illwill is arguably better/nicer than ncurses. its really well made
08:37:10FromDiscord<thearthurm> In reply to @heysokam "illwill is arguably better/nicer": Noted, I might use that
09:02:07FromDiscord<ichigo7799> _googles `illwill`_
09:02:16FromDiscord<ichigo7799> woah that looks kinda nice
09:47:29FromDiscord<heysokam> has `/` from `std/os` been removed or something?
09:47:58FromDiscord<heysokam> (edit) "`/`" => "`/ (string,string)`"
09:49:02FromDiscord<heysokam> used to be able to do `"some"/"path"/"to"/"file.ext"`.. but it complains that the function doesn't exist when I'm doing `import std/os` 🧩
09:49:09PMunchI think it got moved into std/paths
09:49:24FromDiscord<Elegantbeef> Nah it's still in `std/os`
09:49:57PMunchReally? I can't see it in the docs
09:50:09FromDiscord<Elegantbeef> ospaths2 which is used by `std/os`
09:50:18PMunchYeah, just realized :P
09:50:19FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=tYplsSBw
09:50:29FromDiscord<Elegantbeef> `os` was broken up to reduce redundant code when the typed code was moved into it's own modules
09:50:42FromDiscord<Elegantbeef> But it is backwards compatible so if you import `std/os` it should work
09:50:52PMunch@heysokam, works on the playground
09:50:55FromDiscord<heysokam> "should", but doesn't
09:51:09FromDiscord<Elegantbeef> Works on my machine
09:51:12FromDiscord<heysokam> 🧩 well I'm conchtmfused then
09:51:18FromDiscord<Elegantbeef> `nim -v`?
09:51:41FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=ZYNxoJFt
09:52:15PMunchWhat's the error you get exactly?
09:52:21PMunchWhen running the snippet you sent
09:52:26FromDiscord<Elegantbeef> This is not in a module named vk or src is it?↵(@heysokam)
09:52:45FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=OVXqKJEO
09:53:15FromDiscord<heysokam> oh.. it might be one of those "blind sokam" issues
09:53:30FromDiscord<heysokam> I swear I have to be officially diagnosed blind, man
09:53:40PMunchHuh?
09:54:23FromDiscord<heysokam> tl;dr: Its happening on `types.nim`, but I was debugging on `dirs.nim`
09:54:52PMunchAh :P
10:13:29FromDiscord<heysokam> are there functions similar to `startsWith`, `endsWith`, but like `replaceFromStart`, `replaceFromEnd` instead?
10:13:59FromDiscord<heysokam> I'm doing `val[0..^N]`, but its awkward af
10:18:30madpropshow's the morale of nimrod
10:18:40madpropsare we all eating and cooking
10:25:42PMunchEating and cooking?
10:33:04madpropsfresh recipes
12:08:02FromDiscord<heysokam> can anybody think of a reason why running a command with `execCmd( cmd )` or `execShellCmd( cmd )` would truncate the output file that the command is modifying? 🧩
12:08:37Amun-Rawhat's the command?
12:09:51FromDiscord<nnsee> In reply to @heysokam "can anybody think of": impossible to say without know what the command is
12:10:20FromDiscord<heysokam> `zig fmt path/to/my/file.zig`
12:11:06Amun-Raand the file is written partially?
12:11:12FromDiscord<heysokam> if I run the command directly it runs fine, but it is not truncated
12:11:30FromDiscord<heysokam> In reply to @Amun-Ra "and the file is": wdym? 🤔
12:11:43Amun-RaI'd strace and log both commands and check for differences
12:12:41FromDiscord<heysokam> the file is written/generated by my nim code with a `FileStream`↵could that make a difference?
12:13:11FromDiscord<heysokam> never used streams before, so might be doing something dummy
12:13:51Amun-Rais that file closed before you run execcmd?
12:14:07FromDiscord<nnsee> yes, my guess is that the file isn't flushed before fmt runs on it
12:14:17Amun-Rasame
12:14:55FromDiscord<heysokam> ah, running `file.flush` fixed the issue
12:20:43FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=TpfPVqbr
12:43:14FromDiscord<odexine> No
14:15:35FromDiscord<solarvortex_ae> Is there a way in nim to do something like this:↵Declare a proc variable as a placeholder,let another library edit that placeholder and then be able to use that process somewhere else ↵I know this sounds weird
14:15:35FromDiscord<bostonboston> sent a code paste, see https://play.nim-lang.org/#pasty=TeJvAfya
14:15:56FromDiscord<odexine> In reply to @bostonboston "I don't recommend this": Oh yeah how the hell did I forget about this
14:16:05FromDiscord<odexine> Me when I’m washed
14:16:17FromDiscord<odexine> I honestly do recommend it
14:16:35FromDiscord<nnsee> In reply to @solarvortex_ae "Is there a way": can you give an example of what you're trying to solve?
14:17:02FromDiscord<bostonboston> You could also probably turn what I didn't into a macro that declares the object and then rewrites any procs in the macro to take the typedesc as an arg, but I'm not good enough to do that
14:17:39FromDiscord<bostonboston> Did into
14:18:03FromDiscord<solarvortex_ae> In reply to @nnsee "can you give an": If you're talking about me trying to solve an issue on my code by using this then i just do it so it looks more readable wnd can be better documented.↵↵↵If you instead are asking for the current issue im facing,then its recursive import
14:18:20FromDiscord<solarvortex_ae> (edit) "import" => "importing"
14:19:03FromDiscord<solarvortex_ae> Because to edit variable in file x and get the result from file a means a declares something x imports that something edits it then a imports the edited something
14:20:44FromDiscord<nnsee> I meant like code-wise, how it's supposed to look like
14:21:01FromDiscord<nnsee> I'm having a hard time figuring out what you're trying to do is all
14:25:00FromDiscord<solarvortex_ae> sent a long message, see https://pasty.ee/zYhwxPqh
14:25:47FromDiscord<solarvortex_ae> (edit) "https://pasty.ee/pzRvFMmz" => "https://pasty.ee/qdUdRFpH"
14:26:06FromDiscord<solarvortex_ae> (edit) "long message," => "code paste," | "https://pasty.ee/YedEdQQA" => "https://play.nim-lang.org/#pasty=FLZaXyMy"
14:26:22FromDiscord<solarvortex_ae> (edit) "https://play.nim-lang.org/#pasty=SgaIdgVP" => "https://play.nim-lang.org/#pasty=fqoMLxOA"
14:26:43FromDiscord<solarvortex_ae> (edit) "https://paste.rs/o7byP" => "https://paste.rs/Qoqjk"
14:29:31FromDiscord<solarvortex_ae> In this case calling addFunc inside of file a doesn't make alot of sense this is supposed to be used for libraries
14:32:11FromDiscord<solarvortex_ae> and this won't work since the proc is not stored as a variable
14:32:31FromDiscord<ieltan> idk what this is but it aint nim lol
14:33:06FromDiscord<solarvortex_ae> Its pseudocode
14:34:30FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#pasty=zIFgeKRA
14:35:11FromDiscord<ieltan> you dont need macros for this, it is a basic nim feature
14:35:32FromDiscord<nnsee> 1. you seem to be importing X from A which imports X... that's a recursive import↵2. what exactly is _calling_ `addFunc`? Where are you wanting to do the "overriding"? Because if you redefine `addFunc` in a file X after importing it from file A, file X will use the redefined variant for everything defined in file X. You have to explicitly use `A.addFunc()` to use the one defined in A
14:35:42FromDiscord<ieltan> but i am not sure if it works across modules
14:35:56FromDiscord<Robyn [She/Her]> In reply to @bostonboston "I don't recommend this": okay but `One.init` (and `Three.new` for ref objects) is so nice
14:36:30FromDiscord<bostonboston> In reply to @chronos.vitaqua "okay but `One.init` (and": Yes that's fine, I do that, I was talking specifically about the name pacing use case
14:36:43FromDiscord<solarvortex_ae> In reply to @nnsee "1. you seem to": yes read those 2 notes here https://discord.com/channels/371759389889003530/371759389889003532/1311700503348117544
14:37:07FromDiscord<Robyn [She/Her]> ah fair
14:37:29FromDiscord<ieltan> oh i noticed you're using recursive imports
14:37:34FromDiscord<ieltan> how would this even work lol
14:37:53FromDiscord<solarvortex_ae> I already mentioned the issue of recursive
14:40:06FromDiscord<solarvortex_ae> In reply to @ieltan "but i am not": I just tried it doesn't ``{.foward.}``
14:40:18FromDiscord<solarvortex_ae> (edit) "``{.foward.}``" => "``{.forward.}``"
14:42:18FromDiscord<ieltan> well Nim doesn't really cope well with recursive imports, u have to create a third module to define your `addFunc` and import it from the two others modules
14:43:07FromDiscord<solarvortex_ae> im used to kotlin where you can just unit whatever you want
14:43:25FromDiscord<solarvortex_ae> Thats pretty sad
14:43:35FromDiscord<nnsee> I'm not following. Do you want users to be able to provide their own `addFunc()` to your function without _you_ defining them? Because if that's the case, you can have them pass the `adder` proc as a closure to your function. Ie:↵↵https://play.nim-lang.org/#pasty=OZpgcKJk
14:43:38FromDiscord<ieltan> :shrug:
14:43:44FromDiscord<ieltan> nim isnt kotlin
14:43:59FromDiscord<ieltan> you gotta do with what you're provided with unfortunately
14:44:12FromDiscord<nnsee> well, not a closure, but a procedural type
15:04:05*PMunch quit (Quit: Leaving)
15:09:44FromDiscord<demotomohiro> In reply to @solarvortex_ae "Is there a way": I'm not following but if you want your library call procedures defined by the user, you can define generic procedures with mixin: https://play.nim-lang.org/#pasty=CdlVdSXw
15:30:13*xet7 quit (Remote host closed the connection)
15:43:55*pbsds3 quit (Quit: Ping timeout (120 seconds))
15:44:09*GnuYawk quit (Quit: Ping timeout (120 seconds))
15:44:25*pbsds3 joined #nim
15:44:28*GnuYawk joined #nim
15:44:41*gshumway quit (Quit: .)
15:45:11*end quit (Quit: end)
15:45:11*Ekho quit (Quit: CORE ERROR, SYSTEM HALTED.)
15:47:56*end joined #nim
15:53:01*Ekho joined #nim
15:53:56*gshumway joined #nim
16:08:21FromDiscord<double_spiral> Is nim just a C framework?
16:10:08FromDiscord<demotomohiro> Nim is programming language: https://nim-lang.org/docs/tut1.html
16:12:48FromDiscord<odexine> Do you consider rust an LLVM framework
16:13:07Amun-Raand C an asm framework?
16:17:41ehmryasm is a calculator framework
16:18:17FromDiscord<double_spiral> A little bit yeah
16:19:40FromDiscord<double_spiral> But I get the vibe more so from nim cause you're supposed to be directly interacting with C, unlike llvm and asm
16:20:43Amun-Rayou can interact, but you're not obligated to do that
16:21:40ehmrythere is a lot of value in C interoperability
16:22:32FromDiscord<double_spiral> Not saying there isn't
16:34:49FromDiscord<odexine> C 200% has a lot of manipulation for what instructions the compiler will generate
16:35:01FromDiscord<odexine> So I don’t think it’s unlike
17:03:57*kk joined #nim
17:13:28*kk quit (Quit: Quit)
17:16:58*krux02 joined #nim
17:17:45*SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev)
17:56:04FromDiscord<michaelb.eth> In reply to @double_spiral "Is nim just a": if you’re okay with stretching terminology a little bit, it’s arguable that when compiling to C (the default) then Nim is a sophisticated preprocessor
17:57:18FromDiscord<michaelb.eth> but that starts splitting hairs about preprocessor, transpiler, compiler
18:17:06FromDiscord<nnsee> In reply to @double_spiral "But I get the": but nim also compiles to other languages, like js
18:17:28FromDiscord<double_spiral> Its a js framework too but we already have a lot of those so I don't care as much
18:19:11Amun-RaI do care
18:22:22ehmryllvm isn't as portable as C so its not worth the effort
18:22:38FromDiscord<nnsee> is rust an llvm framework?
18:23:12Amun-RaI have four different llvm version installed, every one for a different project
18:23:16Amun-Raversions*
18:23:34Amun-Raand each* ;)
18:42:27FromDiscord<enthus1ast.> In reply to @michaelb.eth "if you’re okay with": The thing is: who cares?
18:43:13FromDiscord<enthus1ast.> If one call nim a c preprocessor, I would still rather write nim instead of c
18:43:33FromDiscord<michaelb.eth> me too
18:44:34FromDiscord<michaelb.eth> I was suggesting it as an alternative to understanding Nim as a “C framework”
18:44:49FromDiscord<enthus1ast.> Most of the time I write other langs I miss nim functionality. Nim basically has tainted all (or at least most) other langs for me
18:48:36FromDiscord<enthus1ast.> But then on the other hand other langs are sometimes more polished, I wish nim would get more adoption, maybe even companies that contribute, that would be a dream 😁
18:49:54FromDiscord<enthus1ast.> But since the 7+ years I write nim, it got alooot more polished
18:51:47FromDiscord<double_spiral> In reply to @enthus1ast. "Most of the time": I love universal call syntax, it's just so convenient
18:52:05FromDiscord<double_spiral> I don't have to know if something is a function or method
19:09:51FromDiscord<bostonboston> The only language I like as much has Nim is C#, but I like the language, I don't like .net or clr
19:19:10*krux02_ joined #nim
19:22:04*krux02 quit (Ping timeout: 245 seconds)
19:27:51*xet7 joined #nim
20:08:20*coldfeet joined #nim
21:00:50*coldfeet quit (Remote host closed the connection)
21:09:55*dv^_^ quit (Quit: Ping timeout (120 seconds))
21:10:25*dv^_^ joined #nim
21:16:16*mal`` quit (Quit: Leaving)
21:22:27*mal`` joined #nim
21:23:40*rockcavera joined #nim
21:32:11*ntat quit (Quit: Leaving)
21:47:00*rockcavera quit (Remote host closed the connection)
23:09:06*zgasma quit (Ping timeout: 276 seconds)
23:36:10*cm quit (Quit: Bye.)
23:45:12*cm joined #nim
23:49:58*xaltsc quit (Ping timeout: 272 seconds)