00:04:39 | FromDiscord | <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:23 | FromDiscord | <.bobbbob> seems cool |
00:26:04 | * | SchweinDeBurg joined #nim |
00:46:06 | FromDiscord | <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:44 | FromDiscord | <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:47 | madprops | https://lucumr.pocoo.org/2024/11/18/threads-beat-async-await/ |
01:48:59 | madprops | wonder how nim implemented async await |
01:49:06 | madprops | this guy thinks it should be pure threads |
01:55:08 | FromDiscord | <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:53 | FromDiscord | <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:43 | FromDiscord | <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:26 | FromDiscord | <thearthurm> In reply to @Elegantbeef "Command line arguments are": Ik |
03:47:33 | FromDiscord | <thearthurm> It's not what I mean either |
03:47:59 | FromDiscord | <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:09 | FromDiscord | <thearthurm> Do we have access to cursed in nim? |
03:48:36 | FromDiscord | <Elegantbeef> Of course it's a C-lib |
03:48:39 | FromDiscord | <Elegantbeef> Though there is illwill |
03:56:07 | * | krux02 quit (Remote host closed the connection) |
03:59:10 | * | SchweinDeBurg joined #nim |
05:45:46 | FromDiscord | <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:11 | FromDiscord | <gogolxdong666> sent a code paste, see https://play.nim-lang.org/#pasty=RMjzTXZk |
07:26:20 | * | PMunch joined #nim |
08:05:05 | Amun-Ra | the easiest way to fix that is to remove repo dir and repopulate all the packages |
08:36:35 | FromDiscord | <heysokam> In reply to @thearthurm "Do we have access": illwill is arguably better/nicer than ncurses. its really well made |
08:37:10 | FromDiscord | <thearthurm> In reply to @heysokam "illwill is arguably better/nicer": Noted, I might use that |
09:02:07 | FromDiscord | <ichigo7799> _googles `illwill`_ |
09:02:16 | FromDiscord | <ichigo7799> woah that looks kinda nice |
09:47:29 | FromDiscord | <heysokam> has `/` from `std/os` been removed or something? |
09:47:58 | FromDiscord | <heysokam> (edit) "`/`" => "`/ (string,string)`" |
09:49:02 | FromDiscord | <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:09 | PMunch | I think it got moved into std/paths |
09:49:24 | FromDiscord | <Elegantbeef> Nah it's still in `std/os` |
09:49:57 | PMunch | Really? I can't see it in the docs |
09:50:09 | FromDiscord | <Elegantbeef> ospaths2 which is used by `std/os` |
09:50:18 | PMunch | Yeah, just realized :P |
09:50:19 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=tYplsSBw |
09:50:29 | FromDiscord | <Elegantbeef> `os` was broken up to reduce redundant code when the typed code was moved into it's own modules |
09:50:42 | FromDiscord | <Elegantbeef> But it is backwards compatible so if you import `std/os` it should work |
09:50:52 | PMunch | @heysokam, works on the playground |
09:50:55 | FromDiscord | <heysokam> "should", but doesn't |
09:51:09 | FromDiscord | <Elegantbeef> Works on my machine |
09:51:12 | FromDiscord | <heysokam> 🧩 well I'm conchtmfused then |
09:51:18 | FromDiscord | <Elegantbeef> `nim -v`? |
09:51:41 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=ZYNxoJFt |
09:52:15 | PMunch | What's the error you get exactly? |
09:52:21 | PMunch | When running the snippet you sent |
09:52:26 | FromDiscord | <Elegantbeef> This is not in a module named vk or src is it?↵(@heysokam) |
09:52:45 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=OVXqKJEO |
09:53:15 | FromDiscord | <heysokam> oh.. it might be one of those "blind sokam" issues |
09:53:30 | FromDiscord | <heysokam> I swear I have to be officially diagnosed blind, man |
09:53:40 | PMunch | Huh? |
09:54:23 | FromDiscord | <heysokam> tl;dr: Its happening on `types.nim`, but I was debugging on `dirs.nim` |
09:54:52 | PMunch | Ah :P |
10:13:29 | FromDiscord | <heysokam> are there functions similar to `startsWith`, `endsWith`, but like `replaceFromStart`, `replaceFromEnd` instead? |
10:13:59 | FromDiscord | <heysokam> I'm doing `val[0..^N]`, but its awkward af |
10:18:30 | madprops | how's the morale of nimrod |
10:18:40 | madprops | are we all eating and cooking |
10:25:42 | PMunch | Eating and cooking? |
10:33:04 | madprops | fresh recipes |
12:08:02 | FromDiscord | <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:37 | Amun-Ra | what's the command? |
12:09:51 | FromDiscord | <nnsee> In reply to @heysokam "can anybody think of": impossible to say without know what the command is |
12:10:20 | FromDiscord | <heysokam> `zig fmt path/to/my/file.zig` |
12:11:06 | Amun-Ra | and the file is written partially? |
12:11:12 | FromDiscord | <heysokam> if I run the command directly it runs fine, but it is not truncated |
12:11:30 | FromDiscord | <heysokam> In reply to @Amun-Ra "and the file is": wdym? 🤔 |
12:11:43 | Amun-Ra | I'd strace and log both commands and check for differences |
12:12:41 | FromDiscord | <heysokam> the file is written/generated by my nim code with a `FileStream`↵could that make a difference? |
12:13:11 | FromDiscord | <heysokam> never used streams before, so might be doing something dummy |
12:13:51 | Amun-Ra | is that file closed before you run execcmd? |
12:14:07 | FromDiscord | <nnsee> yes, my guess is that the file isn't flushed before fmt runs on it |
12:14:17 | Amun-Ra | same |
12:14:55 | FromDiscord | <heysokam> ah, running `file.flush` fixed the issue |
12:20:43 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=TpfPVqbr |
12:43:14 | FromDiscord | <odexine> No |
14:15:35 | FromDiscord | <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:35 | FromDiscord | <bostonboston> sent a code paste, see https://play.nim-lang.org/#pasty=TeJvAfya |
14:15:56 | FromDiscord | <odexine> In reply to @bostonboston "I don't recommend this": Oh yeah how the hell did I forget about this |
14:16:05 | FromDiscord | <odexine> Me when I’m washed |
14:16:17 | FromDiscord | <odexine> I honestly do recommend it |
14:16:35 | FromDiscord | <nnsee> In reply to @solarvortex_ae "Is there a way": can you give an example of what you're trying to solve? |
14:17:02 | FromDiscord | <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:39 | FromDiscord | <bostonboston> Did into |
14:18:03 | FromDiscord | <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:20 | FromDiscord | <solarvortex_ae> (edit) "import" => "importing" |
14:19:03 | FromDiscord | <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:44 | FromDiscord | <nnsee> I meant like code-wise, how it's supposed to look like |
14:21:01 | FromDiscord | <nnsee> I'm having a hard time figuring out what you're trying to do is all |
14:25:00 | FromDiscord | <solarvortex_ae> sent a long message, see https://pasty.ee/zYhwxPqh |
14:25:47 | FromDiscord | <solarvortex_ae> (edit) "https://pasty.ee/pzRvFMmz" => "https://pasty.ee/qdUdRFpH" |
14:26:06 | FromDiscord | <solarvortex_ae> (edit) "long message," => "code paste," | "https://pasty.ee/YedEdQQA" => "https://play.nim-lang.org/#pasty=FLZaXyMy" |
14:26:22 | FromDiscord | <solarvortex_ae> (edit) "https://play.nim-lang.org/#pasty=SgaIdgVP" => "https://play.nim-lang.org/#pasty=fqoMLxOA" |
14:26:43 | FromDiscord | <solarvortex_ae> (edit) "https://paste.rs/o7byP" => "https://paste.rs/Qoqjk" |
14:29:31 | FromDiscord | <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:11 | FromDiscord | <solarvortex_ae> and this won't work since the proc is not stored as a variable |
14:32:31 | FromDiscord | <ieltan> idk what this is but it aint nim lol |
14:33:06 | FromDiscord | <solarvortex_ae> Its pseudocode |
14:34:30 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#pasty=zIFgeKRA |
14:35:11 | FromDiscord | <ieltan> you dont need macros for this, it is a basic nim feature |
14:35:32 | FromDiscord | <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:42 | FromDiscord | <ieltan> but i am not sure if it works across modules |
14:35:56 | FromDiscord | <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:30 | FromDiscord | <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:43 | FromDiscord | <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:07 | FromDiscord | <Robyn [She/Her]> ah fair |
14:37:29 | FromDiscord | <ieltan> oh i noticed you're using recursive imports |
14:37:34 | FromDiscord | <ieltan> how would this even work lol |
14:37:53 | FromDiscord | <solarvortex_ae> I already mentioned the issue of recursive |
14:40:06 | FromDiscord | <solarvortex_ae> In reply to @ieltan "but i am not": I just tried it doesn't ``{.foward.}`` |
14:40:18 | FromDiscord | <solarvortex_ae> (edit) "``{.foward.}``" => "``{.forward.}``" |
14:42:18 | FromDiscord | <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:07 | FromDiscord | <solarvortex_ae> im used to kotlin where you can just unit whatever you want |
14:43:25 | FromDiscord | <solarvortex_ae> Thats pretty sad |
14:43:35 | FromDiscord | <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:38 | FromDiscord | <ieltan> :shrug: |
14:43:44 | FromDiscord | <ieltan> nim isnt kotlin |
14:43:59 | FromDiscord | <ieltan> you gotta do with what you're provided with unfortunately |
14:44:12 | FromDiscord | <nnsee> well, not a closure, but a procedural type |
15:04:05 | * | PMunch quit (Quit: Leaving) |
15:09:44 | FromDiscord | <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:21 | FromDiscord | <double_spiral> Is nim just a C framework? |
16:10:08 | FromDiscord | <demotomohiro> Nim is programming language: https://nim-lang.org/docs/tut1.html |
16:12:48 | FromDiscord | <odexine> Do you consider rust an LLVM framework |
16:13:07 | Amun-Ra | and C an asm framework? |
16:17:41 | ehmry | asm is a calculator framework |
16:18:17 | FromDiscord | <double_spiral> A little bit yeah |
16:19:40 | FromDiscord | <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:43 | Amun-Ra | you can interact, but you're not obligated to do that |
16:21:40 | ehmry | there is a lot of value in C interoperability |
16:22:32 | FromDiscord | <double_spiral> Not saying there isn't |
16:34:49 | FromDiscord | <odexine> C 200% has a lot of manipulation for what instructions the compiler will generate |
16:35:01 | FromDiscord | <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:04 | FromDiscord | <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:18 | FromDiscord | <michaelb.eth> but that starts splitting hairs about preprocessor, transpiler, compiler |
18:17:06 | FromDiscord | <nnsee> In reply to @double_spiral "But I get the": but nim also compiles to other languages, like js |
18:17:28 | FromDiscord | <double_spiral> Its a js framework too but we already have a lot of those so I don't care as much |
18:19:11 | Amun-Ra | I do care |
18:22:22 | ehmry | llvm isn't as portable as C so its not worth the effort |
18:22:38 | FromDiscord | <nnsee> is rust an llvm framework? |
18:23:12 | Amun-Ra | I have four different llvm version installed, every one for a different project |
18:23:16 | Amun-Ra | versions* |
18:23:34 | Amun-Ra | and each* ;) |
18:42:27 | FromDiscord | <enthus1ast.> In reply to @michaelb.eth "if you’re okay with": The thing is: who cares? |
18:43:13 | FromDiscord | <enthus1ast.> If one call nim a c preprocessor, I would still rather write nim instead of c |
18:43:33 | FromDiscord | <michaelb.eth> me too |
18:44:34 | FromDiscord | <michaelb.eth> I was suggesting it as an alternative to understanding Nim as a “C framework” |
18:44:49 | FromDiscord | <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:36 | FromDiscord | <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:54 | FromDiscord | <enthus1ast.> But since the 7+ years I write nim, it got alooot more polished |
18:51:47 | FromDiscord | <double_spiral> In reply to @enthus1ast. "Most of the time": I love universal call syntax, it's just so convenient |
18:52:05 | FromDiscord | <double_spiral> I don't have to know if something is a function or method |
19:09:51 | FromDiscord | <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) |