<< 27-10-2022 >>

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:17FromDiscord<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:26FromDiscord<Elegantbeef> https://nim-lang.org/docs/osproc.html#execProcess,string,string,openArray[string],StringTableRef,set[ProcessOption]
01:15:26FromDiscord<slymilano> nice! `let (result, exitCode) = execCmdEx("ls -la")`
01:21:45FromDiscord<demotomohiro> !eval import osproc; echo execCmdEx("pwd")
01:21:48NimBotCompile failed: Unable to open output log
01:33:35FromDiscord<ChocolettePalette> !eval import osproc; echo execCmdEx("rm-rf sudo /")
01:33:44NimBotCompile failed: (output: "/bin/sh: rm-rf: not found\n", exitCode: 127)
01:36:16*arkurious quit (Quit: Leaving)
01:50:24FromDiscord<slymilano> progress 🔥 `var process = startProcess("./binaries/yt-dlp", args = [url])`
02:04:39FromDiscord<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:57FromDiscord<huantian> quick tip, you can import multiple things using `[]`, ie `import std/[osproc, strformat]`
02:07:36FromDiscord<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:53FromDiscord<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:04FromDiscord<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:25FromDiscord<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:39FromDiscord<Elegantbeef> typed vs untyped
05:44:11FromDiscord<Elegantbeef> Untyped is parsed code that isnt semantically analysed, typed code is parsed and semantically checked
05:48:49FromDiscord<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:59FromDiscord<dizzyliam> (edit) "proc" => "proc?"
05:51:15FromDiscord<Elegantbeef> make the macro take in untyped code
05:51:23FromDiscord<Elegantbeef> so instead of a type in the macro take `: untyped`
05:53:45FromDiscord<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:34FromDiscord<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:27FromDiscord<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:23FromDiscord<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:25FromDiscord<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:45FromDiscord<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:50FromDiscord<vindaar> that&#x27;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&#x27;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:49ehmrynim 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:33NimEventerNew 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:41NimEventerNew thread by minnim: Evolving the GUI definition, see https://forum.nim-lang.org/t/9554
14:41:32FromDiscord<Evissim> Does anyone have a vimrc with autocomplete I can reference? I can't seem to get nimlsp and asyncomplete to work
14:41:41NimEventerNew 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:53FromDiscord<Horizon [She/Her]> Does Nim have a tool to make it easier to make a Nim bindings for JNI?
15:14:02FromDiscord<Horizon [She/Her]> So i can use Nim code within Java for example
15:31:18FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4efu
15:31:32FromDiscord<sOkam!> (edit)
15:32:56FromDiscord<gibson> In reply to @vindaar "that&#x27;s an error from": Thanks, will do.
15:37:08FromDiscord<Clonkk> There is https://github.com/yglukhov/jnim
15:44:09NimEventerNew thread by olmikul: "Mastering Nim" - errata?, see https://forum.nim-lang.org/t/9556
15:44:13FromDiscord<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:41FromDiscord<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:57FromDiscord<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:52FromDiscord<enthus1ast> yeah std/times often is quite inkonvenient
15:49:25FromDiscord<Phil> enthus1ast uses KDE confirmed
15:49:48FromDiscord<Phil> k's replacing those c's everywhere
15:49:54FromDiscord<enthus1ast> ah 'k'
15:50:31FromDiscord<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:40FromDiscord<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:31FromDiscord<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:30FromDiscord<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:34FromDiscord<Phil> Question if I wanted to file an
15:54:41FromDiscord<Phil> Vindaar was faster than I could write my question
15:54:55FromDiscord<Phil> Just in the general lang? as an RFC? As a bugreport
15:54:57FromDiscord<Phil> (edit) "bugreport" => "bugreport?"
15:56:42FromDiscord<Phil> I'll take a guess and file it under feature request
15:57:35FromDiscord<vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4efJ
15:57:37FromDiscord<vindaar> time\_diff\_ct https://media.discordapp.net/attachments/371759389889003532/1035220734596882483/time_diff_ct.null
15:58:13FromDiscord<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:13FromDiscord<vindaar> imo with default being available it's now essentially a bug report 🤷‍♂️
16:00:23FromDiscord<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:33FromDiscord<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:00FromDiscord<ringabout> https://nim-lang.org/docs/importutils.html#privateAccess%2Ctypedesc
16:10:40FromDiscord<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:36FromDiscord<Phil> In reply to @vindaar "open an issue about": Bugreport has been filed
16:14:20FromDiscord<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:52FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4efO
16:15:21FromDiscord<ringabout> prints `10`
16:16:07FromDiscord<Phil> Wait that's how it works?↵So like something that enables private access in general, not accesses a specific field
16:16:34FromDiscord<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:02FromDiscord<Phil> Yep, alright, scoped as you'd expect
16:17:37FromDiscord<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:08FromDiscord<ShalokShalom> @Horizon [She/Her] do you know ↵↵https://github.com/yglukhov/jnim
16:23:13FromDiscord<ShalokShalom> Probably
16:23:38FromDiscord<Horizon [She/Her]> Yeah, didn't realise it had a way to export, took a bit of digging
16:24:16FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4efP
16:26:05FromDiscord<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:21FromDiscord<ringabout> In reply to @Isofruit "Aaaaaaaaaand stopped once more": It seems to be a bug. i will look into it.
16:27:38FromDiscord<Bung> I've created a PR fix that, borrow time's format proc right ?
16:28:42*kenran joined #nim
16:29:31FromDiscord<Bung> https://github.com/nim-lang/Nim/pull/20659/files PhilippMDoerner is Phil ?
16:29:33FromDiscord<Phil> Could you rephrase? I don't think I quite get that sentence
16:29:39FromDiscord<Phil> And yeah, that's me
16:30:35FromDiscord<Bung> I just remenber `DjangoDateTime`, maybe not related to the current problem.
16:31:21FromDiscord<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:51FromDiscord<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:25FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4efQ
16:37:31FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4efR
16:38:06FromDiscord<ringabout> It got to be another VM type bugs.
16:39:03FromDiscord<ringabout> Hooray, I have added so many bugs to that list 🙃
16:40:02*kenran quit (Remote host closed the connection)
16:41:45FromDiscord<Phil> In reply to @flywind "Hooray, I have added": Got to feed Lion King's timon and pumba
16:41:52FromDiscord<Phil> Eating bugs like no tomorrow
16:43:22FromDiscord<vindaar> but you've been defeating even more bugs 🚀🚀
16:46:32FromDiscord<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:27FromDiscord<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:19FromDiscord<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:55FromDiscord<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:11FromDiscord<auxym> Both are very unlikely scenarios btw.
18:07:07FromDiscord<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:09FromDiscord<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:40FromDiscord<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:28FromDiscord<exp1oit> In reply to @auxym "Or are you worried": yes does'nt nim compile to c and cpp?
18:09:48FromDiscord<auxym> yes, I see.
18:09:56FromDiscord<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:02FromDiscord<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:20FromDiscord<auxym> (though there is a rust frontend for gcc that is also reaching maturity)
18:11:28FromDiscord<Horizon [She/Her]> Hasn't C existed for a long, long time? :P
18:11:39FromDiscord<auxym> yes
18:11:43FromDiscord<auxym> that too
18:12:24FromDiscord<exp1oit> so basicaly if things start looking bad nim has the time to make necessary changes?
18:12:56FromDiscord<Horizon [She/Her]> If in some cataclysmic event, C and C++ die completely, I'd assume a Rust backend would be made
18:13:23FromDiscord<auxym> to me, the scenario where gcc development stops is so unlikely that it's not worth worrying about in any case
18:13:58FromDiscord<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:34FromDiscord<Generic> what kind of event would let to the death of C and C++ but Rust would continue to exist?
18:14:37FromDiscord<auxym> and like I said, such a thing actually already exists (nlvm is a nim compiler that emits LLVM IR)
18:14:41FromDiscord<Horizon [She/Her]> In reply to @auxym "it's probably easier to": True
18:14:50FromDiscord<Horizon [She/Her]> There is nlvm anyway
18:14:55FromDiscord<Horizon [She/Her]> In reply to @Generic "what kind of event": A fictional one lol
18:15:02FromDiscord<Horizon [She/Her]> In reply to @auxym "and like I said,": Oh you already said that
18:15:05FromDiscord<Generic> especially since Rust is built on C++ compiler infrastructure
18:15:31FromDiscord<exp1oit> In reply to @Event Horizon "There is nlvm anyway": oh nice i never heard of that
18:15:37FromDiscord<auxym> yeah, good point. llvm itself is coded in c++ haha
18:23:35FromDiscord<jessyjim> https://t.me/+PEc8FSRwFiFiYzc0
18:34:45FromDiscord<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:52FromDiscord<Elegantbeef> RIIR 😛↵(@Generic)
18:46:51FromDiscord<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:30FromDiscord<Elegantbeef> It's supposed to close to C++ by design
18:47:35FromDiscord<Elegantbeef> It's a C++ replacement for C++ programmers
18:48:01FromDiscord<bsdooby> I tell you, that Carbon thing goes nowhere
18:48:02FromDiscord<jmgomez> Most cpp programmers that I know that didnt switch to Rust are happy with Cpp
18:48:11FromDiscord<bsdooby> Exactly
18:55:32FromDiscord<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:08FromDiscord<planetis> (edit) removed "as" | "beginner to Cpp, it" => "beginner, Cpp" | "abeginner, Cppfeels alien and it's ... choicesand" added "design" | "seem" => "and syntax"
18:57:57FromDiscord<planetis> As for Rust I am coldly indifferent towards it. Wouldn't bother to learn it.
19:01:00FromDiscord<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:27FromDiscord<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:10arkanoidhello! What would you suggest to get a channel-like interface but between processes?
19:02:34arkanoidI just need a way to pass key:value from one nim process to another, and consume them in the orther they arrive
19:02:49FromDiscord<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:57arkanoidI could drop a redis in the middle, sure, but I'd prefer to have it 100% nim
19:05:31FromDiscord<planetis> yes sure java also. although I'd prefer to avoid it 🙂
19:05:52FromDiscord<planetis> (edit) "yes sure java also. although I'd prefer to avoid it ... 🙂" added "if possible"
19:07:35FromDiscord<Phil> Honestly, after nim I just want to only write in "immutable by default" languages
19:08:07FromDiscord<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:18FromDiscord<planetis> Yeah exactly, nim is awesome but we don't know if it'll ever catch up. Still worth it imo.
19:11:38FromDiscord<Horizon [She/Her]> How do i compile wasm without needing the html stuff for bootstrapping?
19:12:33FromDiscord<Horizon [She/Her]> Using emscripten
19:14:09FromDiscord<Phil> sent a long message, see http://ix.io/4egv
19:14:29FromDiscord<Phil> (edit) "http://ix.io/4egv" => "http://ix.io/4egw"
19:14:36*pro quit (Quit: pro)
19:23:10FromDiscord<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:51FromDiscord<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:16arkanoidvindaar, thanks!
19:24:31arkanoidI'm going the asynctools way right now, let's see if it is sufficient for the purpose
19:39:59FromDiscord<Horizon [She/Her]> How do i exclude the `-landroid-glob` flag in Termux?
19:40:10FromDiscord<Horizon [She/Her]> For the emcc project specifically
19:47:32FromDiscord<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:29FromDiscord<ShalokShalom> In reply to @jmgomez "Most cpp programmers that": Its like Typescript
20:21:37FromDiscord<ShalokShalom> For Rust, you learn a heckton new
20:21:48FromDiscord<ShalokShalom> With Carbon, you just rename the file ending.
20:23:46FromDiscord<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:18FromDiscord<Phil> In reply to @ShalokShalom "F# would be my": I mean, I already write typescript at work
20:26:23FromDiscord<Phil> But no compile time mechanisms
20:26:29FromDiscord<Phil> And the type system is more a suggestion than anything else
20:26:39FromDiscord<ShalokShalom> Yeah
20:26:45FromDiscord<Phil> You get no ensurance that its actually being followed at runtime, and that hurts
20:26:51FromDiscord<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:51FromDiscord<Phil> (edit) "ensurance" => "insurance"
20:27:13FromDiscord<jmgomez> Also F# and jobs are mutually exclusive, just like Nim 😛
20:27:30FromDiscord<ShalokShalom> Dotnet shops take fsharp devs as well
20:27:44FromDiscord<ShalokShalom> F# is leaps and bounds beyond Nim here
20:28:08FromDiscord<bulan2> 2
20:28:42FromDiscord<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:47FromDiscord<ShalokShalom> Transition was much easier
20:28:50FromDiscord<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:10FromDiscord<ShalokShalom> And calling C++ a fine language sounds very wrong 🫡
20:29:30FromDiscord<ShalokShalom> In reply to @jmgomez "Not as much as": Microsoft does very little to the FSharp community
20:29:39FromDiscord<ShalokShalom> Its very much a community based language
20:29:41FromDiscord<jmgomez> In reply to @ShalokShalom "Coffeescript existed long before": It was Microsoft and the lack of static checking in js
20:30:01FromDiscord<jmgomez> which coffee script didnt have neither
20:34:56*bruh joined #nim
20:36:15bruhhey 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:24FromDiscord<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:52FromDiscord<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:39FromDiscord<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:53FromDiscord<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:23arkanoidwhat are the main differences when handling a string and a seq of uint8/bytes?
21:25:27NimEventerNew 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:46FromDiscord<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:32FromDiscord<Elegantbeef> There is no difference unless you need to pass to a cstring
21:49:36FromDiscord<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:49arkanoidauxym: did you have any kind of type system working with it, or was just buffers flying around?
21:54:31FromDiscord<Bung> Elegantbeef\: in compiler how to catch staticExpr error come from vm ?
21:54:46FromDiscord<Elegantbeef> You want to know if something can compile?
21:55:05FromDiscord<Bung> https://github.com/nim-lang/Nim/issues/18823 like this one
21:55:39FromDiscord<Elegantbeef> Perhaps `trySemExpr` i dont know
21:56:29FromDiscord<Bung> the actually problem is it's hard to know `typeRel` in what context, so the `T` there maybe tyGenericparam
21:58:05arkanoidthe error "Error: cannot instantiate: 'T'" is always a show stopper to me. What does it mean, it's not saying why
21:58:20FromDiscord<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:02FromDiscord<auxym> In nim, I'd probably use flatty or frosty to serialize your data
21:59:14FromDiscord<Bung> there's `tryResolvingStaticExpr` but it doesn't really try, it just throw error when there comes
22:00:00arkanoidauxym, I need a serialization protocol that would let me pass around objects between different languages
22:05:24jjidoprotobuf? Arrow?
22:08:36FromDiscord<auxym> that, and also messagepack/cbor, capn proto, etc. Plain old json if you don't care too much about efficiency.
22:09:58arkanoidapart from json, which of those well knows binary solutions are supported in nim?
22:10:07jjidoCapn proto, right, that's the one i
22:10:13jjidowas looking for
22:12:17arkanoidwow, reading just now about capn proto
22:14:12FromDiscord<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:43arkanoidhttps://capnproto.org/otherlang.html
22:15:52arkanoidthere's some nim, but unmaintained and 5 years old
22:16:19arkanoiddidn't know that capn proto is from the same guy of protobuf 2
22:18:31FromDiscord<dizzyliam> @dom96 thanks for the tip on my packages PR :)
22:19:12jjidoyes I am not sure nim was the same language 5 years ago
22:23:47*jmdaemon joined #nim
22:23:57FromDiscord<demotomohiro> Pure nim message pack implementation: https://github.com/jangko/msgpack4nim
22:42:45FromDiscord<impbox [ftsf]> sent a code paste, see https://paste.rs/BiW
22:44:04FromDiscord<impbox [ftsf]> i'm not using `intVal` in my code anywhere
22:44:12FromDiscord<Elegantbeef> Internal compile error
22:44:41FromDiscord<impbox [ftsf]> woo!
22:44:50FromDiscord<Elegantbeef> What's the code?
22:45:34FromDiscord<impbox [ftsf]> big =\ but messing with that exprOffset stuff you posted the other day
22:45:41FromDiscord<impbox [ftsf]> but seems find in my small test cases
22:46:10FromDiscord<impbox [ftsf]> but breaks when i put it into my complex app, but not sure where
22:46:15FromDiscord<impbox [ftsf]> will try narrow it down
22:46:59FromDiscord<Elegantbeef> Can you send the new macro you have?
22:47:13FromDiscord<impbox [ftsf]> sure
22:47:30FromDiscord<Bung> it's a PNode n.intVal in compiler
22:47:38FromDiscord<impbox [ftsf]> https://play.nim-lang.org/#ix=4eh5
22:47:57FromDiscord<Bung> the compiler assuming it get a int literal node
22:47:58FromDiscord<Elegantbeef> Oh fuck off! 😛
22:48:09FromDiscord<Elegantbeef> I gave you a nice and clean macro and you give me this?!
22:48:26FromDiscord<impbox [ftsf]> heh, i didn't understand yours =p also it actually gave the wrong address
22:48:50FromDiscord<Elegantbeef> Really?
22:49:10FromDiscord<impbox [ftsf]> yeah, i was curious why things were behaving strangely, but it was giving an offset of 4 for a unit8
22:49:13FromDiscord<impbox [ftsf]> (edit) "unit8" => "uint8"
22:49:44FromDiscord<Elegantbeef> Did you use `{.packed.}`?
22:49:45FromDiscord<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:54FromDiscord<impbox [ftsf]> nope
22:50:19FromDiscord<Elegantbeef> Oh yea it's way off 😄
22:50:41FromDiscord<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:46FromDiscord<impbox [ftsf]> alright, cheers
22:53:06FromDiscord<Elegantbeef> Oh found the bug with mine
22:53:39FromDiscord<Elegantbeef> Forgot a pesky `[0]`
22:53:52FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4eh7 if you want to try this it might work fine
22:54:35FromDiscord<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:59FromDiscord<haywireSSC> Is there a good way to use macros in runtime in nim?
22:55:14FromDiscord<Elegantbeef> You can use the VM but you generally dont need macros at runtime
22:55:42FromDiscord<impbox [ftsf]> nice, gives the same results as mine now
22:55:54FromDiscord<Elegantbeef> Yea was a single `[0]` missing 😄
22:55:57FromDiscord<impbox [ftsf]> and presumably doesn't break the compiler
22:56:03FromDiscord<impbox [ftsf]> will try it out in my app
22:56:10FromDiscord<Elegantbeef> I didnt do the math and went "Hey 26 seems right"
22:56:20FromDiscord<haywireSSC> The reason I want to make something to generate another nim program, is it still a bad idea for that?
22:56:34FromDiscord<impbox [ftsf]> =)
22:56:39FromDiscord<Elegantbeef> I mean you can use the VM, if you want i cannot stop you 😛
22:56:49FromDiscord<haywireSSC> Hehe
22:56:55FromDiscord<impbox [ftsf]> well you could, but it's a lot of work
22:57:00FromDiscord<Elegantbeef> I do suggest looking at the resultant code imp just to understand it a bit more
22:57:11FromDiscord<haywireSSC> In reply to @impbox "well you could, but": Yeah
22:57:27FromDiscord<haywireSSC> I've been trying to ngl
22:57:33FromDiscord<impbox [ftsf]> (i mean it's a lot of work for beef to stop you)
22:57:43FromDiscord<haywireSSC> Oh
22:58:01FromDiscord<Elegantbeef> https://streamable.com/c6farb i did do something that used the VM for a toy macro debugger
22:58:24FromDiscord<Elegantbeef> It just watches a file and you can save code to it and it prints the macro
22:58:36FromDiscord<haywireSSC> In reply to @Elegantbeef "I do suggest looking": I don't even know what I mean by that xd
22:58:59FromDiscord<haywireSSC> In reply to @Elegantbeef "https://streamable.com/c6farb i did do": Ooh nice, I'll have a look
22:59:06FromDiscord<haywireSSC> (edit) "I" => "you"
22:59:12FromDiscord<Elegantbeef> The source is here https://github.com/beef331/nimscripter/tree/master/examples/macrorepl
22:59:18FromDiscord<haywireSSC> (edit) "xd" => "xd, sorry"
22:59:31FromDiscord<Elegantbeef> I dont have many practical applications for nimscripter
22:59:39FromDiscord<Elegantbeef> Especially since i'm on team wasm now
23:00:19FromDiscord<impbox [ftsf]> ooh yeah beef, that makes sense looking at the resulting code
23:00:29FromDiscord<Elegantbeef> Yay
23:01:04FromDiscord<Elegantbeef> I personally just walkaway from any macro that uses `astGenRepr`
23:01:25FromDiscord<Elegantbeef> I get that it makes life easier, but the generated macro is 100% unreadable and maintainable
23:01:45FromDiscord<Elegantbeef> Genast/quote do are just better
23:01:49FromDiscord<impbox [ftsf]> fair
23:02:14FromDiscord<impbox [ftsf]> i should figure out / remember how to use those
23:04:31FromDiscord<haywireSSC> In reply to @Elegantbeef "The source is here": Having a look rn
23:04:34FromDiscord<haywireSSC> Ty
23:09:19FromDiscord<impbox [ftsf]> ok, wow, genAst is much prettier
23:09:43FromDiscord<impbox [ftsf]> good call
23:15:32FromDiscord<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:31FromDiscord<impbox [ftsf]> debug compiler build breaks on not having enough arguments to _setjmp
23:16:34FromDiscord<Saint> Anyone why std/uri decodeQuery produces an iterator
23:16:43FromDiscord<Saint> Can't it produce like a Table[string,string]
23:16:49FromDiscord<Saint> That would be more logical to me
23:18:43FromDiscord<impbox [ftsf]> it's not a table since there can be multiple of the same key
23:19:15FromDiscord<impbox [ftsf]> in the example they use toSeq to convert it from an iterator to a seq
23:19:25FromDiscord<impbox [ftsf]> if you don't want it as an iterator
23:20:12FromDiscord<Saint> Oh okay I didn't know there could be multiples of the same key
23:20:45FromDiscord<Saint> Ty
23:21:53FromDiscord<Elegantbeef> Also iterators are less intensive than new collections
23:22:09FromDiscord<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:18FromDiscord<Saint> Makes sense
23:29:48arkanoidI'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:20FromDiscord<impbox [ftsf]> hmm i'm using it in "production"
23:31:12arkanoidwait, I might have just found that my event loop is not running ...
23:31:12FromDiscord<impbox [ftsf]> ahh but i'm not using async
23:31:19FromDiscord<impbox [ftsf]> that could do it
23:31:26arkanoidnot sure why, let me double check
23:34:43arkanoidyes, 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:11arkanoidit's await redisClient.quit() that is not sending QUIT
23:59:25arkanoidwhat happens to await executed in finally: block?