00:00:30 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
00:32:13 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:58:17 | FromDiscord | <slymilano> Is it possible to capture the result of `std/os.execShellCmd`? I'm trying to invoke ffmpeg from Nim code and capture results. |
01:08:26 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/osproc.html#execProcess,string,string,openArray[string],StringTableRef,set[ProcessOption] |
01:15:26 | FromDiscord | <slymilano> nice! `let (result, exitCode) = execCmdEx("ls -la")` |
01:21:45 | FromDiscord | <demotomohiro> !eval import osproc; echo execCmdEx("pwd") |
01:21:48 | NimBot | Compile failed: Unable to open output log |
01:33:35 | FromDiscord | <ChocolettePalette> !eval import osproc; echo execCmdEx("rm-rf sudo /") |
01:33:44 | NimBot | Compile failed: (output: "/bin/sh: rm-rf: not found\n", exitCode: 127) |
01:36:16 | * | arkurious quit (Quit: Leaving) |
01:50:24 | FromDiscord | <slymilano> progress 🔥 `var process = startProcess("./binaries/yt-dlp", args = [url])` |
02:04:39 | FromDiscord | <slymilano> got my little POC going to download a youtube video using yt-dlp from Nim. https://play.nim-lang.org/#ix=4edd ↵↵Going to convert said video to x265 720p for archival next. A lot less code than my Elixir solution POC. interesting |
02:06:57 | FromDiscord | <huantian> quick tip, you can import multiple things using `[]`, ie `import std/[osproc, strformat]` |
02:07:36 | FromDiscord | <slymilano> nice tip, thanks! |
02:20:09 | * | m5zs7k quit (*.net *.split) |
02:20:09 | * | genpaku quit (*.net *.split) |
02:20:10 | * | GreaseMonkey quit (*.net *.split) |
02:20:10 | * | nisstyre quit (*.net *.split) |
02:20:10 | * | Yardanico quit (*.net *.split) |
02:20:18 | * | madprog quit (*.net *.split) |
02:20:18 | * | Onionhammer quit (*.net *.split) |
02:20:22 | * | madprog joined #nim |
02:20:27 | * | Onionhammer joined #nim |
02:20:32 | * | greaser|q joined #nim |
02:20:51 | * | genpaku joined #nim |
02:21:07 | * | nisstyre joined #nim |
02:21:22 | * | Yardanico joined #nim |
02:21:39 | * | Yardanico quit (Changing host) |
02:21:39 | * | Yardanico joined #nim |
02:21:56 | * | greaser|q quit (Changing host) |
02:21:56 | * | greaser|q joined #nim |
02:22:23 | * | m5zs7k joined #nim |
02:22:23 | * | greaser|q is now known as GreaseMonkey |
03:55:53 | FromDiscord | <slymilano> ayy I got youtube and tiktok working (https://github.com/sergiotapia/ekeko) now the hard part, figuring out how to get "liked" content 😂 |
04:33:17 | * | wallabra quit (Ping timeout: 240 seconds) |
04:34:37 | * | wallabra joined #nim |
04:38:41 | * | kenran joined #nim |
05:24:04 | FromDiscord | <dizzyliam> Because you can't have optional arguments before required arguments in a macro, I'm moving the functionality of a macro I wrote into a proc that accepts and returns `NimNode` types, then calling that proc from different macros with different accepted arguments. Weirdly, the syntax tree the proc gets from the macro is different from what the macro gets in the first place? For example, `Ident` nodes have become `Sym` |
05:24:25 | FromDiscord | <dizzyliam> Keen to hear from anyone who knows what's going on here :) |
05:31:09 | * | rockcavera quit (Remote host closed the connection) |
05:43:39 | FromDiscord | <Elegantbeef> typed vs untyped |
05:44:11 | FromDiscord | <Elegantbeef> Untyped is parsed code that isnt semantically analysed, typed code is parsed and semantically checked |
05:48:49 | FromDiscord | <dizzyliam> ah, so the conversion from `untyped` to `NimNode` did some extra steps behind the scenes? Is there a way to pass the untyped code to the proc |
05:48:59 | FromDiscord | <dizzyliam> (edit) "proc" => "proc?" |
05:51:15 | FromDiscord | <Elegantbeef> make the macro take in untyped code |
05:51:23 | FromDiscord | <Elegantbeef> so instead of a type in the macro take `: untyped` |
05:53:45 | FromDiscord | <civbag> hi, so i configured `nimlsp` with `nvim-lspconfig`, but this code doesn't gives any error or warning. Is this nimlsp behavior or my config is wrong? it doesn't compile tho https://media.discordapp.net/attachments/371759389889003532/1035068765798420520/unknown.png |
06:00:34 | FromDiscord | <dizzyliam> In reply to @Elegantbeef "so instead of a": Yeah lol looks like I mindlessly changed the type of the macro argument instead of the proc :/ |
06:23:55 | * | PMunch joined #nim |
07:24:57 | * | m5zs7k quit (Ping timeout: 240 seconds) |
07:25:59 | * | m5zs7k joined #nim |
09:49:45 | * | kenran quit (Quit: ERC 5.4.1 (IRC client for GNU Emacs 29.0.50)) |
10:04:16 | * | dnh joined #nim |
10:31:09 | * | romzx quit (Quit: Leaving) |
10:41:21 | * | romzx joined #nim |
10:54:06 | * | jjido joined #nim |
11:00:05 | * | genpaku quit (Remote host closed the connection) |
11:00:46 | * | genpaku joined #nim |
11:05:08 | * | xet7 joined #nim |
11:11:52 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
11:34:49 | * | jjido joined #nim |
11:36:47 | * | jjido quit (Client Quit) |
11:57:27 | FromDiscord | <gibson> Trying to use the somewhat new `capture` syntax in sugar for capturing local variables for closures, but I can't understand this error: `node lacks field: strVal` it's complaining about the variable I'm trying to capture, which is a var object passed into the enclosing proc. |
12:02:23 | FromDiscord | <gibson> solved by making a read-only view of my variable `let mdlRO {.byaddr.} = mdl` now it doesn't complain about captures without using explicit `capture`. |
12:38:19 | * | derpydoo joined #nim |
12:49:07 | * | arkurious joined #nim |
12:55:25 | FromDiscord | <sOkam!> how do you append a string to a file?↵I know how to writeFile(), but it seems to write everything instead of append |
13:03:45 | FromDiscord | <hotdog> In reply to @sOkam! "how do you append": Open file in append mode and then write to it https://nim-lang.org/docs/io.html#FileMode |
13:21:50 | FromDiscord | <vindaar> that's an error from the `capture` macro as it (apparently) assumes the argument is an ident or a symbol (so not anything more complex). Either way, that's not an error message you should see as a user. If you have a reproducible example that you can report it should be an easy fix (to at least give a proper error message at CT)↵(@gibson) |
14:03:49 | ehmry | nim closure procs are great, I'm gluing some nim and c++ together and now I see that if I didn't have closure capture I'd be doing obnoxious c++ class member bookkeeping |
14:07:09 | * | PMunch quit (Quit: Leaving) |
14:09:09 | * | jmdaemon quit (Ping timeout: 255 seconds) |
14:13:33 | NimEventer | New thread by choltreppe: Smtp problems, see https://forum.nim-lang.org/t/9553 |
14:14:11 | * | oddish quit (Quit: oddish) |
14:14:34 | * | oddish joined #nim |
14:37:41 | NimEventer | New thread by minnim: Evolving the GUI definition, see https://forum.nim-lang.org/t/9554 |
14:41:32 | FromDiscord | <Evissim> Does anyone have a vimrc with autocomplete I can reference? I can't seem to get nimlsp and asyncomplete to work |
14:41:41 | NimEventer | New thread by templatedperson: Is it possible to allocate ref objects in a specific region of memory?, see https://forum.nim-lang.org/t/9555 |
14:51:55 | * | romzx left #nim (Leaving) |
15:13:53 | FromDiscord | <Horizon [She/Her]> Does Nim have a tool to make it easier to make a Nim bindings for JNI? |
15:14:02 | FromDiscord | <Horizon [She/Her]> So i can use Nim code within Java for example |
15:31:18 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4efu |
15:31:32 | FromDiscord | <sOkam!> (edit) |
15:32:56 | FromDiscord | <gibson> In reply to @vindaar "that's an error from": Thanks, will do. |
15:37:08 | FromDiscord | <Clonkk> There is https://github.com/yglukhov/jnim |
15:44:09 | NimEventer | New thread by olmikul: "Mastering Nim" - errata?, see https://forum.nim-lang.org/t/9556 |
15:44:13 | FromDiscord | <Phil> Alright, gave it another try. Still don't get how the heck one is supposed to instantiate a Datetime object at compile-time given that you need to be able to do that if you want default implementations for objects with DateTime fields |
15:47:41 | FromDiscord | <Phil> Like, I can't do `DateTime(<Set all the various fields>)` since the fields on the DateTime type are private, I can't use any of the procs made available by `std/times` since none of them are capable of working at compile time, I'm pretty much running out of ideas |
15:47:57 | FromDiscord | <Phil> (edit) "Like, I can't do `DateTime(<Set all the various fields>)` since the fields on the DateTime type are private, I can't use any of the procs made available by `std/times` ... since" added "to construct them" |
15:48:52 | FromDiscord | <enthus1ast> yeah std/times often is quite inkonvenient |
15:49:25 | FromDiscord | <Phil> enthus1ast uses KDE confirmed |
15:49:48 | FromDiscord | <Phil> k's replacing those c's everywhere |
15:49:54 | FromDiscord | <enthus1ast> ah 'k' |
15:50:31 | FromDiscord | <Phil> But yeah, I'm lucky Beef went with the paradigm of having construction procs that act at runtime because otherwise I'd have nothing |
15:50:40 | FromDiscord | <Phil> (edit) "But yeah, I'm lucky Beef went with the paradigm of having construction procs that act at runtime because otherwise I'd have nothing ... " added "but tons of boilerplate construction procs" |
15:52:31 | FromDiscord | <Horizon [She/Her]> In reply to @Clonkk "There is https://github.com/yglukhov/jnim": Are there any docs on exposing Nim functions to Java though? |
15:54:30 | FromDiscord | <vindaar> open an issue about it. imo that's pretty important now if default fields are supposed to work well. I tried hacking around to make it work for a few minutes right now, but stumble over a few things↵(@Phil) |
15:54:34 | FromDiscord | <Phil> Question if I wanted to file an |
15:54:41 | FromDiscord | <Phil> Vindaar was faster than I could write my question |
15:54:55 | FromDiscord | <Phil> Just in the general lang? as an RFC? As a bugreport |
15:54:57 | FromDiscord | <Phil> (edit) "bugreport" => "bugreport?" |
15:56:42 | FromDiscord | <Phil> I'll take a guess and file it under feature request |
15:57:35 | FromDiscord | <vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4efJ |
15:57:37 | FromDiscord | <vindaar> time\_diff\_ct https://media.discordapp.net/attachments/371759389889003532/1035220734596882483/time_diff_ct.null |
15:58:13 | FromDiscord | <vindaar> but of course, there will be a reason that time zones are `ref objects` and `DateTime` is `object of RootObj` (the latter I don't get especially) |
15:59:13 | FromDiscord | <vindaar> imo with default being available it's now essentially a bug report 🤷♂️ |
16:00:23 | FromDiscord | <vindaar> (the git diff there likely is pretty problematic once you attempt to cross the CT ⇔ RT barrier though, as the RT objects would be initialized with the `{.compileTime.}` version of the timezone. Who knows what that implies) |
16:09:33 | FromDiscord | <ringabout> In reply to @Isofruit "Like, I can't do": There is a `std/importutils` module to give you access to private fields/ |
16:10:00 | FromDiscord | <ringabout> https://nim-lang.org/docs/importutils.html#privateAccess%2Ctypedesc |
16:10:40 | FromDiscord | <Horizon [She/Her]> @beef why did you archive https://github.com/beef331/wasmer ? Was there any issues that came with the wasmer bindings? |
16:12:36 | FromDiscord | <Phil> In reply to @vindaar "open an issue about": Bugreport has been filed |
16:14:20 | FromDiscord | <Phil> In reply to @flywind "There is a `std/importutils`": Yeh but I'd need to have an instance whose private field I want to access, correct?↵Right now I don't even have that, I can't instantiate anything exactly because the fields are private |
16:14:52 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4efO |
16:15:21 | FromDiscord | <ringabout> prints `10` |
16:16:07 | FromDiscord | <Phil> Wait that's how it works?↵So like something that enables private access in general, not accesses a specific field |
16:16:34 | FromDiscord | <Phil> In which scope is DateTime's field then non-private? If you put the "privateAccess" call in a block, would you only be able to do so within that block? |
16:17:02 | FromDiscord | <Phil> Yep, alright, scoped as you'd expect |
16:17:37 | FromDiscord | <Phil> Thanks fly! I'll see how far I can get with that in particular, though I'll keep the issue open still because that feels like there should still be a solution for this |
16:23:08 | FromDiscord | <ShalokShalom> @Horizon [She/Her] do you know ↵↵https://github.com/yglukhov/jnim |
16:23:13 | FromDiscord | <ShalokShalom> Probably |
16:23:38 | FromDiscord | <Horizon [She/Her]> Yeah, didn't realise it had a way to export, took a bit of digging |
16:24:16 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4efP |
16:26:05 | FromDiscord | <ringabout> In reply to @Isofruit "Thanks fly! I'll see": Under the current umbrella of the default fields RFC, it is designed to be pure Data fields and shall have no side effects. |
16:26:21 | FromDiscord | <ringabout> In reply to @Isofruit "Aaaaaaaaaand stopped once more": It seems to be a bug. i will look into it. |
16:27:38 | FromDiscord | <Bung> I've created a PR fix that, borrow time's format proc right ? |
16:28:42 | * | kenran joined #nim |
16:29:31 | FromDiscord | <Bung> https://github.com/nim-lang/Nim/pull/20659/files PhilippMDoerner is Phil ? |
16:29:33 | FromDiscord | <Phil> Could you rephrase? I don't think I quite get that sentence |
16:29:39 | FromDiscord | <Phil> And yeah, that's me |
16:30:35 | FromDiscord | <Bung> I just remenber `DjangoDateTime`, maybe not related to the current problem. |
16:31:21 | FromDiscord | <Phil> They're both unrelated, the current issue is about default instantiation, format is more about how the borrow mechanics are kinda wonky |
16:31:51 | FromDiscord | <Phil> Well, they might be related due to some weird circumstances under the hood, but for now the mechanisms that are creaking look to me like different ones |
16:37:25 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4efQ |
16:37:31 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4efR |
16:38:06 | FromDiscord | <ringabout> It got to be another VM type bugs. |
16:39:03 | FromDiscord | <ringabout> Hooray, I have added so many bugs to that list 🙃 |
16:40:02 | * | kenran quit (Remote host closed the connection) |
16:41:45 | FromDiscord | <Phil> In reply to @flywind "Hooray, I have added": Got to feed Lion King's timon and pumba |
16:41:52 | FromDiscord | <Phil> Eating bugs like no tomorrow |
16:43:22 | FromDiscord | <vindaar> but you've been defeating even more bugs 🚀🚀 |
16:46:32 | FromDiscord | <ShalokShalom> @Phil Hakuna Matata |
17:13:01 | * | rockcavera joined #nim |
17:13:01 | * | rockcavera quit (Changing host) |
17:13:01 | * | rockcavera joined #nim |
17:31:42 | * | derpydoo quit (Quit: derpydoo) |
17:35:11 | * | pro joined #nim |
17:51:27 | FromDiscord | <sOkam!> In reply to @sOkam! "The compiler is giving": I know the question is kinda cryptic, but that's actually all the information the compiler gave me 😔↵How can I make the compiler output a more extensive answer than just this one line, which doesn't even have information related to my code? |
17:52:02 | * | jjido joined #nim |
18:02:19 | FromDiscord | <exp1oit> guys im new to nim btw so don't bully me for this quetion pls: what will happen to nim if people decide to move on from c and cpp |
18:05:55 | FromDiscord | <auxym> no bullies here 🙂 But I'm not sure I understand the question. Do you mean if current C/C++ users all decide at once to move on to a new language? Or if the nim developers move on from C and C++ as a compiler backend? |
18:06:11 | FromDiscord | <auxym> Both are very unlikely scenarios btw. |
18:07:07 | FromDiscord | <exp1oit> In reply to @auxym "no bullies here 🙂": let me refrormulate my quetion : if c and c++ stop bieng supported and people migrate to rust and go for example |
18:08:09 | FromDiscord | <auxym> OK I see. I wouldn't see how nim is affected however. C/C++ users move on to rust or whatnot, maybe a small proportion picks up Nim, current Nim users keep on using nim? |
18:08:40 | FromDiscord | <auxym> Or are you worried that C compiler development (gcc/clang) will stop and Nim can't use C as a backend anymore? |
18:09:28 | FromDiscord | <exp1oit> In reply to @auxym "Or are you worried": yes does'nt nim compile to c and cpp? |
18:09:48 | FromDiscord | <auxym> yes, I see. |
18:09:56 | FromDiscord | <auxym> fwiw I don't see that happening for decades. For starters the entirely linux kernel would have to be rewritten in Rust, which is thousands of man-years of work. gcc will keep on being supported until then. |
18:11:02 | FromDiscord | <auxym> Hypothetically, if it happens, Nim could be ported to LLVM backend. In fact nlvm already exists. I don't know LLVM very well, but I assume that would also also interop with rust (?) which also uses LLVM as a backend. |
18:11:20 | FromDiscord | <auxym> (though there is a rust frontend for gcc that is also reaching maturity) |
18:11:28 | FromDiscord | <Horizon [She/Her]> Hasn't C existed for a long, long time? :P |
18:11:39 | FromDiscord | <auxym> yes |
18:11:43 | FromDiscord | <auxym> that too |
18:12:24 | FromDiscord | <exp1oit> so basicaly if things start looking bad nim has the time to make necessary changes? |
18:12:56 | FromDiscord | <Horizon [She/Her]> If in some cataclysmic event, C and C++ die completely, I'd assume a Rust backend would be made |
18:13:23 | FromDiscord | <auxym> to me, the scenario where gcc development stops is so unlikely that it's not worth worrying about in any case |
18:13:58 | FromDiscord | <auxym> In reply to @Event Horizon "If in some cataclysmic": it's probably easier to go straight to LLVM IR rather than make a compiler backend that passes Rust borrow checks etc. |
18:14:34 | FromDiscord | <Generic> what kind of event would let to the death of C and C++ but Rust would continue to exist? |
18:14:37 | FromDiscord | <auxym> and like I said, such a thing actually already exists (nlvm is a nim compiler that emits LLVM IR) |
18:14:41 | FromDiscord | <Horizon [She/Her]> In reply to @auxym "it's probably easier to": True |
18:14:50 | FromDiscord | <Horizon [She/Her]> There is nlvm anyway |
18:14:55 | FromDiscord | <Horizon [She/Her]> In reply to @Generic "what kind of event": A fictional one lol |
18:15:02 | FromDiscord | <Horizon [She/Her]> In reply to @auxym "and like I said,": Oh you already said that |
18:15:05 | FromDiscord | <Generic> especially since Rust is built on C++ compiler infrastructure |
18:15:31 | FromDiscord | <exp1oit> In reply to @Event Horizon "There is nlvm anyway": oh nice i never heard of that |
18:15:37 | FromDiscord | <auxym> yeah, good point. llvm itself is coded in c++ haha |
18:23:35 | FromDiscord | <jessyjim> https://t.me/+PEc8FSRwFiFiYzc0 |
18:34:45 | FromDiscord | <planetis> I read that phoronix thread that neckbeards were complaining about nim transpiling to C. And real languages according to them should transpile directly to machine language. And I really don't get it. it's been much easier to interop bidirectionally with C than those languages. However for C++ I think Carbon could be a better choice in the future. |
18:34:52 | FromDiscord | <Elegantbeef> RIIR 😛↵(@Generic) |
18:46:51 | FromDiscord | <jmgomez> In reply to @planetis "I read that phoronix": Not sure why anyone would use Carbon, it seems quite similar to C++. I think javascript and typescript were in an entirely different situation |
18:47:30 | FromDiscord | <Elegantbeef> It's supposed to close to C++ by design |
18:47:35 | FromDiscord | <Elegantbeef> It's a C++ replacement for C++ programmers |
18:48:01 | FromDiscord | <bsdooby> I tell you, that Carbon thing goes nowhere |
18:48:02 | FromDiscord | <jmgomez> Most cpp programmers that I know that didnt switch to Rust are happy with Cpp |
18:48:11 | FromDiscord | <bsdooby> Exactly |
18:55:32 | FromDiscord | <planetis> For me as a beginner to Cpp, it feels alien and it's choices seem outdated, I thought having a transitional language that's backed by FAANG sounded like a good choice to learn and have in my CV. thats all. |
18:56:08 | FromDiscord | <planetis> (edit) removed "as" | "beginner to Cpp, it" => "beginner, Cpp" | "abeginner, Cppfeels alien and it's ... choicesand" added "design" | "seem" => "and syntax" |
18:57:57 | FromDiscord | <planetis> As for Rust I am coldly indifferent towards it. Wouldn't bother to learn it. |
19:01:00 | FromDiscord | <planetis> Because at the end of the day I am not planning to get a job in a big international company but a local one. And most likely they would have existing C++ codebases. And I doubt they feel okay with RIIR syndrome. Correct me if my thinking is wrong. |
19:01:11 | * | arkanoid joined #nim |
19:01:27 | FromDiscord | <Phil> In reply to @jmgomez "Most cpp programmers that": From what I heard the recent iterations of CPP (like if you only allow the most recent featureset) is supposedly even tolerable to use |
19:02:10 | arkanoid | hello! What would you suggest to get a channel-like interface but between processes? |
19:02:34 | arkanoid | I just need a way to pass key:value from one nim process to another, and consume them in the orther they arrive |
19:02:49 | FromDiscord | <Phil> In reply to @planetis "Because at the end": I'd be curious to learn CPP eventually, but then again that might actually need more brainpower than my current Java job and I rely on my daily job not taxing me enough to prevent further coding in my spare time |
19:02:57 | arkanoid | I could drop a redis in the middle, sure, but I'd prefer to have it 100% nim |
19:05:31 | FromDiscord | <planetis> yes sure java also. although I'd prefer to avoid it 🙂 |
19:05:52 | FromDiscord | <planetis> (edit) "yes sure java also. although I'd prefer to avoid it ... 🙂" added "if possible" |
19:07:35 | FromDiscord | <Phil> Honestly, after nim I just want to only write in "immutable by default" languages |
19:08:07 | FromDiscord | <Phil> Not sure I'll stick with java long term, but I'm not sure what would actually be a "fun" language that is commercially nicely viable |
19:11:18 | FromDiscord | <planetis> Yeah exactly, nim is awesome but we don't know if it'll ever catch up. Still worth it imo. |
19:11:38 | FromDiscord | <Horizon [She/Her]> How do i compile wasm without needing the html stuff for bootstrapping? |
19:12:33 | FromDiscord | <Horizon [She/Her]> Using emscripten |
19:14:09 | FromDiscord | <Phil> sent a long message, see http://ix.io/4egv |
19:14:29 | FromDiscord | <Phil> (edit) "http://ix.io/4egv" => "http://ix.io/4egw" |
19:14:36 | * | pro quit (Quit: pro) |
19:23:10 | FromDiscord | <planetis> me too I've learned a ton of stuff that applies to programming in general with Nim. I don't think I could have the same opportunity with python as it's mostly written in C or Rust and C++, too complicated for a beginner to understand. Also the lack of libraries in Nim is kinda important because I learned to design and implement stuff from scratch. |
19:23:51 | FromDiscord | <vindaar> arkanoid\: depending on your exact use case you could maybe use https://github.com/c-blake/cligen/blob/master/cligen/procpool.nim or at least you can look at the implementation to see how it does the communication between processes |
19:24:16 | arkanoid | vindaar, thanks! |
19:24:31 | arkanoid | I'm going the asynctools way right now, let's see if it is sufficient for the purpose |
19:39:59 | FromDiscord | <Horizon [She/Her]> How do i exclude the `-landroid-glob` flag in Termux? |
19:40:10 | FromDiscord | <Horizon [She/Her]> For the emcc project specifically |
19:47:32 | FromDiscord | <Horizon [She/Her]> I've tried to make a `when not defined(excludeGlob):` rule in my global config.nims but it still gets included anyway |
20:17:59 | * | krux02 joined #nim |
20:21:29 | FromDiscord | <ShalokShalom> In reply to @jmgomez "Most cpp programmers that": Its like Typescript |
20:21:37 | FromDiscord | <ShalokShalom> For Rust, you learn a heckton new |
20:21:48 | FromDiscord | <ShalokShalom> With Carbon, you just rename the file ending. |
20:23:46 | FromDiscord | <ShalokShalom> In reply to @Isofruit "Not sure I'll stick": F# would be my bet. ↵↵If you want more 'commercially nice' then you could look to Typescript, which is pretty nice, when it comes to modern features. |
20:26:18 | FromDiscord | <Phil> In reply to @ShalokShalom "F# would be my": I mean, I already write typescript at work |
20:26:23 | FromDiscord | <Phil> But no compile time mechanisms |
20:26:29 | FromDiscord | <Phil> And the type system is more a suggestion than anything else |
20:26:39 | FromDiscord | <ShalokShalom> Yeah |
20:26:45 | FromDiscord | <Phil> You get no ensurance that its actually being followed at runtime, and that hurts |
20:26:51 | FromDiscord | <jmgomez> In reply to @ShalokShalom "Its like Typescript": it isnt. typescript provides a decent typesystem for a dynamically checked lang. The user base of js is huge, back when it started SPA started to where a thing so enterprise people were looking for a replacement, Microsoft already had a huge community.↵C++ is a fine language, with a smaller community and more importantly, it already has an alternative |
20:26:51 | FromDiscord | <Phil> (edit) "ensurance" => "insurance" |
20:27:13 | FromDiscord | <jmgomez> Also F# and jobs are mutually exclusive, just like Nim 😛 |
20:27:30 | FromDiscord | <ShalokShalom> Dotnet shops take fsharp devs as well |
20:27:44 | FromDiscord | <ShalokShalom> F# is leaps and bounds beyond Nim here |
20:28:08 | FromDiscord | <bulan2> 2 |
20:28:42 | FromDiscord | <ShalokShalom> In reply to @jmgomez "it isnt. typescript provides": Coffeescript existed long before TS. ↵↵The reason why TS succeeded, was largely because you could succeed with the very same syntax |
20:28:47 | FromDiscord | <ShalokShalom> Transition was much easier |
20:28:50 | FromDiscord | <jmgomez> Not as much as you think, I was in the F# community back in the Xamarin days. And from the people that I meet there, I can tell you that Microsoft doesnt really care about it. Don and a few other do, but thats it |
20:29:10 | FromDiscord | <ShalokShalom> And calling C++ a fine language sounds very wrong 🫡 |
20:29:30 | FromDiscord | <ShalokShalom> In reply to @jmgomez "Not as much as": Microsoft does very little to the FSharp community |
20:29:39 | FromDiscord | <ShalokShalom> Its very much a community based language |
20:29:41 | FromDiscord | <jmgomez> In reply to @ShalokShalom "Coffeescript existed long before": It was Microsoft and the lack of static checking in js |
20:30:01 | FromDiscord | <jmgomez> which coffee script didnt have neither |
20:34:56 | * | bruh joined #nim |
20:36:15 | bruh | hey guys i'm new to this community and want to know how things work around here? |
20:39:10 | * | bruh quit (Client Quit) |
20:40:24 | FromDiscord | <Phil> In reply to @bruh "hey guys i'm new": Heya bruh, in what sense?↵For general etiquette, check out the rules under "Information" (should be visible on IRC as well I hope, it is on Discord).↵Other than that, this channel is mostly intended for questions about syntax, troubleshooting and the like of the nim language in general, offtopic for strictly speaking what we've been chatting about the last 15 minutes |
20:40:52 | FromDiscord | <Phil> (edit) "In reply to @bruh "hey guys i'm new": Heya bruh, in what sense?↵For general etiquette, check out the rules under "Information" (should be visible on IRC as well I hope, it is on Discord).↵Other than that, this channel is mostly intended for questions about syntax, troubleshooting and the like of the nim language in general, offtopic for strictly speaking what we've been chatting about the last 15 minutes ... " added "- Basi |
20:41:39 | FromDiscord | <Phil> There's also a specific channel about the package manager (nimble), one for the development of the nim compiler in general and a bunch of channels for specific areas of programming (webdev, gaming, appdev, embedded, security etc.) |
20:41:53 | FromDiscord | <Phil> (edit) "There's also a specific channel about the package manager (nimble), one for the development of the nim compiler in general and a bunch of channels for specific areas of programming ... (webdev," added "that you might be using the nim language for" |
20:51:16 | * | LuxuryMode quit (Quit: Connection closed for inactivity) |
21:04:12 | * | jjido quit (Quit: Textual IRC Client: www.textualapp.com) |
21:14:33 | * | jjido joined #nim |
21:24:23 | arkanoid | what are the main differences when handling a string and a seq of uint8/bytes? |
21:25:27 | NimEventer | New Nimble package! pigeon - Define procedures on the server, call them from the browser., see https://github.com/dizzyliam/pigeon |
21:25:37 | * | jjido quit (Quit: Textual IRC Client: www.textualapp.com) |
21:26:27 | * | krux02 quit (Remote host closed the connection) |
21:27:16 | * | krux02 joined #nim |
21:29:46 | FromDiscord | <demotomohiro> If I remember correctly, string is zero terminated but seq is not. |
21:33:50 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:40:05 | * | jjido joined #nim |
21:44:37 | * | jjido quit (Quit: Textual IRC Client: www.textualapp.com) |
21:48:32 | FromDiscord | <Elegantbeef> There is no difference unless you need to pass to a cstring |
21:49:36 | FromDiscord | <auxym> In reply to @arkanoid "I could drop a": fwiw I've used zmq for that in the past and mostly like it. Not pure nim though, it's bindings to a C lib. |
21:49:41 | * | jjido joined #nim |
21:53:49 | arkanoid | auxym: did you have any kind of type system working with it, or was just buffers flying around? |
21:54:31 | FromDiscord | <Bung> Elegantbeef\: in compiler how to catch staticExpr error come from vm ? |
21:54:46 | FromDiscord | <Elegantbeef> You want to know if something can compile? |
21:55:05 | FromDiscord | <Bung> https://github.com/nim-lang/Nim/issues/18823 like this one |
21:55:39 | FromDiscord | <Elegantbeef> Perhaps `trySemExpr` i dont know |
21:56:29 | FromDiscord | <Bung> the actually problem is it's hard to know `typeRel` in what context, so the `T` there maybe tyGenericparam |
21:58:05 | arkanoid | the error "Error: cannot instantiate: 'T'" is always a show stopper to me. What does it mean, it's not saying why |
21:58:20 | FromDiscord | <auxym> In reply to @arkanoid "<@882793909246369864>: did you have": I had a very ad hoc "protocol". A byte for "message type", single byte for "commands", then I was passing around numpy arrays (ie in python) serialized to npy format. |
21:59:02 | FromDiscord | <auxym> In nim, I'd probably use flatty or frosty to serialize your data |
21:59:14 | FromDiscord | <Bung> there's `tryResolvingStaticExpr` but it doesn't really try, it just throw error when there comes |
22:00:00 | arkanoid | auxym, I need a serialization protocol that would let me pass around objects between different languages |
22:05:24 | jjido | protobuf? Arrow? |
22:08:36 | FromDiscord | <auxym> that, and also messagepack/cbor, capn proto, etc. Plain old json if you don't care too much about efficiency. |
22:09:58 | arkanoid | apart from json, which of those well knows binary solutions are supported in nim? |
22:10:07 | jjido | Capn proto, right, that's the one i |
22:10:13 | jjido | was looking for |
22:12:17 | arkanoid | wow, reading just now about capn proto |
22:14:12 | FromDiscord | <auxym> IIRC there are nim implementations (or at least C wrappers) for messagepack and cbor. Which are sort of "binary json" in concept. |
22:15:43 | arkanoid | https://capnproto.org/otherlang.html |
22:15:52 | arkanoid | there's some nim, but unmaintained and 5 years old |
22:16:19 | arkanoid | didn't know that capn proto is from the same guy of protobuf 2 |
22:18:31 | FromDiscord | <dizzyliam> @dom96 thanks for the tip on my packages PR :) |
22:19:12 | jjido | yes I am not sure nim was the same language 5 years ago |
22:23:47 | * | jmdaemon joined #nim |
22:23:57 | FromDiscord | <demotomohiro> Pure nim message pack implementation: https://github.com/jangko/msgpack4nim |
22:42:45 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://paste.rs/BiW |
22:44:04 | FromDiscord | <impbox [ftsf]> i'm not using `intVal` in my code anywhere |
22:44:12 | FromDiscord | <Elegantbeef> Internal compile error |
22:44:41 | FromDiscord | <impbox [ftsf]> woo! |
22:44:50 | FromDiscord | <Elegantbeef> What's the code? |
22:45:34 | FromDiscord | <impbox [ftsf]> big =\ but messing with that exprOffset stuff you posted the other day |
22:45:41 | FromDiscord | <impbox [ftsf]> but seems find in my small test cases |
22:46:10 | FromDiscord | <impbox [ftsf]> but breaks when i put it into my complex app, but not sure where |
22:46:15 | FromDiscord | <impbox [ftsf]> will try narrow it down |
22:46:59 | FromDiscord | <Elegantbeef> Can you send the new macro you have? |
22:47:13 | FromDiscord | <impbox [ftsf]> sure |
22:47:30 | FromDiscord | <Bung> it's a PNode n.intVal in compiler |
22:47:38 | FromDiscord | <impbox [ftsf]> https://play.nim-lang.org/#ix=4eh5 |
22:47:57 | FromDiscord | <Bung> the compiler assuming it get a int literal node |
22:47:58 | FromDiscord | <Elegantbeef> Oh fuck off! 😛 |
22:48:09 | FromDiscord | <Elegantbeef> I gave you a nice and clean macro and you give me this?! |
22:48:26 | FromDiscord | <impbox [ftsf]> heh, i didn't understand yours =p also it actually gave the wrong address |
22:48:50 | FromDiscord | <Elegantbeef> Really? |
22:49:10 | FromDiscord | <impbox [ftsf]> yeah, i was curious why things were behaving strangely, but it was giving an offset of 4 for a unit8 |
22:49:13 | FromDiscord | <impbox [ftsf]> (edit) "unit8" => "uint8" |
22:49:44 | FromDiscord | <Elegantbeef> Did you use `{.packed.}`? |
22:49:45 | FromDiscord | <impbox [ftsf]> so i went to my idea of just trying to just return the difference of the addresses of the base and the full one |
22:49:54 | FromDiscord | <impbox [ftsf]> nope |
22:50:19 | FromDiscord | <Elegantbeef> Oh yea it's way off 😄 |
22:50:41 | FromDiscord | <Elegantbeef> Best thing to find what's causing your issue is to run your code with a debug compiler and insert a `echo n` before the erroring line |
22:51:14 | * | krux02 quit (Quit: Leaving) |
22:52:46 | FromDiscord | <impbox [ftsf]> alright, cheers |
22:53:06 | FromDiscord | <Elegantbeef> Oh found the bug with mine |
22:53:39 | FromDiscord | <Elegantbeef> Forgot a pesky `[0]` |
22:53:52 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4eh7 if you want to try this it might work fine |
22:54:35 | FromDiscord | <Elegantbeef> Basically all my macro does is walk the expression so first it gets the offset of `blop` then `bars[3]` and so fourth |
22:54:59 | FromDiscord | <haywireSSC> Is there a good way to use macros in runtime in nim? |
22:55:14 | FromDiscord | <Elegantbeef> You can use the VM but you generally dont need macros at runtime |
22:55:42 | FromDiscord | <impbox [ftsf]> nice, gives the same results as mine now |
22:55:54 | FromDiscord | <Elegantbeef> Yea was a single `[0]` missing 😄 |
22:55:57 | FromDiscord | <impbox [ftsf]> and presumably doesn't break the compiler |
22:56:03 | FromDiscord | <impbox [ftsf]> will try it out in my app |
22:56:10 | FromDiscord | <Elegantbeef> I didnt do the math and went "Hey 26 seems right" |
22:56:20 | FromDiscord | <haywireSSC> The reason I want to make something to generate another nim program, is it still a bad idea for that? |
22:56:34 | FromDiscord | <impbox [ftsf]> =) |
22:56:39 | FromDiscord | <Elegantbeef> I mean you can use the VM, if you want i cannot stop you 😛 |
22:56:49 | FromDiscord | <haywireSSC> Hehe |
22:56:55 | FromDiscord | <impbox [ftsf]> well you could, but it's a lot of work |
22:57:00 | FromDiscord | <Elegantbeef> I do suggest looking at the resultant code imp just to understand it a bit more |
22:57:11 | FromDiscord | <haywireSSC> In reply to @impbox "well you could, but": Yeah |
22:57:27 | FromDiscord | <haywireSSC> I've been trying to ngl |
22:57:33 | FromDiscord | <impbox [ftsf]> (i mean it's a lot of work for beef to stop you) |
22:57:43 | FromDiscord | <haywireSSC> Oh |
22:58:01 | FromDiscord | <Elegantbeef> https://streamable.com/c6farb i did do something that used the VM for a toy macro debugger |
22:58:24 | FromDiscord | <Elegantbeef> It just watches a file and you can save code to it and it prints the macro |
22:58:36 | FromDiscord | <haywireSSC> In reply to @Elegantbeef "I do suggest looking": I don't even know what I mean by that xd |
22:58:59 | FromDiscord | <haywireSSC> In reply to @Elegantbeef "https://streamable.com/c6farb i did do": Ooh nice, I'll have a look |
22:59:06 | FromDiscord | <haywireSSC> (edit) "I" => "you" |
22:59:12 | FromDiscord | <Elegantbeef> The source is here https://github.com/beef331/nimscripter/tree/master/examples/macrorepl |
22:59:18 | FromDiscord | <haywireSSC> (edit) "xd" => "xd, sorry" |
22:59:31 | FromDiscord | <Elegantbeef> I dont have many practical applications for nimscripter |
22:59:39 | FromDiscord | <Elegantbeef> Especially since i'm on team wasm now |
23:00:19 | FromDiscord | <impbox [ftsf]> ooh yeah beef, that makes sense looking at the resulting code |
23:00:29 | FromDiscord | <Elegantbeef> Yay |
23:01:04 | FromDiscord | <Elegantbeef> I personally just walkaway from any macro that uses `astGenRepr` |
23:01:25 | FromDiscord | <Elegantbeef> I get that it makes life easier, but the generated macro is 100% unreadable and maintainable |
23:01:45 | FromDiscord | <Elegantbeef> Genast/quote do are just better |
23:01:49 | FromDiscord | <impbox [ftsf]> fair |
23:02:14 | FromDiscord | <impbox [ftsf]> i should figure out / remember how to use those |
23:04:31 | FromDiscord | <haywireSSC> In reply to @Elegantbeef "The source is here": Having a look rn |
23:04:34 | FromDiscord | <haywireSSC> Ty |
23:09:19 | FromDiscord | <impbox [ftsf]> ok, wow, genAst is much prettier |
23:09:43 | FromDiscord | <impbox [ftsf]> good call |
23:15:32 | FromDiscord | <impbox [ftsf]> fixed mine to use genAst, but it still breaks the compiler and yours doesn't, so I guess i'll use yours =) |
23:16:31 | FromDiscord | <impbox [ftsf]> debug compiler build breaks on not having enough arguments to _setjmp |
23:16:34 | FromDiscord | <Saint> Anyone why std/uri decodeQuery produces an iterator |
23:16:43 | FromDiscord | <Saint> Can't it produce like a Table[string,string] |
23:16:49 | FromDiscord | <Saint> That would be more logical to me |
23:18:43 | FromDiscord | <impbox [ftsf]> it's not a table since there can be multiple of the same key |
23:19:15 | FromDiscord | <impbox [ftsf]> in the example they use toSeq to convert it from an iterator to a seq |
23:19:25 | FromDiscord | <impbox [ftsf]> if you don't want it as an iterator |
23:20:12 | FromDiscord | <Saint> Oh okay I didn't know there could be multiples of the same key |
23:20:45 | FromDiscord | <Saint> Ty |
23:21:53 | FromDiscord | <Elegantbeef> Also iterators are less intensive than new collections |
23:22:09 | FromDiscord | <impbox [ftsf]> since anything could be in the query string there's nothing to enforce only one of each key eg. `?q=123&q=456&q=587` |
23:28:18 | FromDiscord | <Saint> Makes sense |
23:29:48 | arkanoid | I'm testing "the redis "offial" nim library, it hangs on "await openAsync" even if wireshark confirms that socket is opened correctly on localhost |
23:30:20 | FromDiscord | <impbox [ftsf]> hmm i'm using it in "production" |
23:31:12 | arkanoid | wait, I might have just found that my event loop is not running ... |
23:31:12 | FromDiscord | <impbox [ftsf]> ahh but i'm not using async |
23:31:19 | FromDiscord | <impbox [ftsf]> that could do it |
23:31:26 | arkanoid | not sure why, let me double check |
23:34:43 | arkanoid | yes, it works |
23:36:07 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
23:53:50 | * | neceve_ joined #nim |
23:55:03 | * | neceve quit (Ping timeout: 255 seconds) |
23:56:11 | arkanoid | it's await redisClient.quit() that is not sending QUIT |
23:59:25 | arkanoid | what happens to await executed in finally: block? |