00:11:28 | * | rez quit (Quit: much snoozes...) |
00:25:34 | * | tanami quit (Ping timeout: 252 seconds) |
00:42:54 | FromDiscord | <eyes> is it currently possible to do realtime 3D physics in nim |
00:43:09 | FromDiscord | <eyes> the only thing i can think of is like writing bindings for open dynamics engine myself |
00:43:11 | FromDiscord | <eyes> which is awful |
00:43:42 | FromDiscord | <Elegantbeef> You either bind a 3D physics engine or write your own |
00:43:59 | FromDiscord | <Elegantbeef> Do not know if there are any bullet bindings |
00:46:22 | FromDiscord | <eyes> Damn |
00:46:38 | FromDiscord | <eyes> might fuck around and try to bind one I guess |
00:47:03 | FromDiscord | <Elegantbeef> If you find one with a C-api you can use futhark or c2nim to make it easier |
00:48:27 | * | rockcavera quit (Ping timeout: 252 seconds) |
00:54:43 | FromDiscord | <eyes> yeah that’s where I’m going to start |
01:26:14 | * | rockcavera joined #nim |
02:07:27 | * | tanami joined #nim |
02:56:34 | FromDiscord | <ringabout> https://www.youtube.com/watch?v=rYDRCNFtRq0 |
03:15:10 | * | rez joined #nim |
03:35:17 | * | rez quit (Quit: l8r) |
03:41:40 | * | rockcavera quit (Remote host closed the connection) |
04:02:49 | FromDiscord | <etra> sent a code paste, see https://play.nim-lang.org/#ix=4pqx |
04:03:24 | FromDiscord | <etra> oh wait, `Foo` couldn't be a ref right? that breaks nim safety |
04:05:01 | FromDiscord | <etra> sent a code paste, see https://play.nim-lang.org/#ix=4pqA |
04:05:04 | FromDiscord | <etra> (edit) "https://play.nim-lang.org/#ix=4pqA" => "https://paste.rs/SjK" |
04:06:53 | FromDiscord | <amadan> sent a code paste, see https://play.nim-lang.org/#ix=4pqB |
04:07:03 | FromDiscord | <amadan> (edit) "https://play.nim-lang.org/#ix=4pqB" => "https://play.nim-lang.org/#ix=4pqC" |
04:09:16 | FromDiscord | <Elegantbeef> That should be cdecl |
04:18:37 | FromDiscord | <etra> In reply to @amadan "You could write it": this works! yay |
04:18:40 | FromDiscord | <etra> thanks! |
04:24:47 | * | arkurious quit (Quit: Leaving) |
04:29:00 | FromDiscord | <etra> is there a way to define a constant from nimble? like, to change the dynlib path depending on the OS |
04:29:37 | FromDiscord | <etra> oh wait, that doesn't needs to live in nimble now that I think of it |
04:33:21 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4pqH |
04:40:26 | FromDiscord | <etra> nice. I'm trying to write an arboard wrapper (<https://github.com/1Password/arboard>) because afaik is the only clipboard library that handles images in both windows and macOS. Here's a very rough WIP <https://github.com/etra0/pastenim> if anyone is interested in following the progress |
04:40:42 | FromDiscord | <etra> (edit) "macOS." => "macOS (and I think they now fixed linux?)." |
04:41:22 | FromDiscord | <etra> (I'm very new to nim as well) |
04:47:04 | FromDiscord | <ringabout> Nice work! |
05:12:09 | FromDiscord | <virdisn> I tried fidget demo.nim and nimlsp. However getting errors like root.box.w root not defined which is part of the template. So does nimlsp have issues with macros cause the code compiles just fine. |
05:17:37 | NimEventer | New thread by yalexr: Compilation error (type mismatch), see https://forum.nim-lang.org/t/9952 |
05:26:39 | NimEventer | New thread by mohan24: How to make web component to run Nim code inside a web page and by using some npm pakage only, see https://forum.nim-lang.org/t/9953 |
06:02:58 | FromDiscord | <I have 50GB of nothing on my PC> how do most people give their editor access to external packages and stdlib in the editor? just create symlinks, bro? |
06:03:22 | FromDiscord | <Elegantbeef> nimble |
06:03:49 | * | dv^_^ quit (Remote host closed the connection) |
06:04:17 | FromDiscord | <I have 50GB of nothing on my PC> and it just goes to the files for reference automatically when needed, etc? |
06:04:48 | FromDiscord | <Elegantbeef> It's a package manager so it makes it easy |
06:20:36 | FromDiscord | <I have 50GB of nothing on my PC> is `nim r` supposed to be faster? it doesn't feel any faster than `nim c` |
06:20:46 | FromDiscord | <Elegantbeef> Nope |
06:28:50 | * | azimut quit (Ping timeout: 255 seconds) |
07:01:54 | FromDiscord | <ieltan> Hello everyone, does someone knows if the `{.goto.}` pragma has been documented (I think not but I may have overlooked it) |
07:03:04 | FromDiscord | <ieltan> I kind of want to experiment with it, I have been thinking about how people use `goto` in C for error handling, I could try to replicate this and see how it works out (with no intent to replace exceptions with them of course) |
07:04:16 | FromDiscord | <ieltan> Seems like Araq likes this feature a lot based on this one comment in the post |
07:04:26 | FromDiscord | <ringabout> Nim uses `goto` to handle exceptions/ |
07:04:34 | * | advesperacit joined #nim |
07:05:01 | FromDiscord | <ieltan> Yes, I think you guys call them... goto-exceptions |
07:05:06 | FromDiscord | <ieltan> But it isn't what I am talking |
07:05:22 | FromDiscord | <ieltan> (edit) "But it isn't what I am talking ... " added "about" |
07:05:46 | FromDiscord | <ieltan> https://forum.nim-lang.org/t/8963#58594 |
07:07:06 | FromDiscord | <ieltan> Note: I don't intend to replace exceptions with them in my code |
07:07:14 | FromDiscord | <ieltan> I just want to experiment with it |
07:07:20 | FromDiscord | <ieltan> 🙂 |
07:07:30 | FromDiscord | <ringabout> `{.goto.}` sounds like a rarely used feature. I never see any documentation or code. |
07:07:56 | FromDiscord | <Elegantbeef> Yea it's not documented |
07:08:10 | FromDiscord | <ieltan> I see |
07:08:50 | FromDiscord | <Elegantbeef> If it's not in either of these it's has not been documented since 1.6.x↵https://nim-lang.github.io/Nim/manual.html↵https://nim-lang.github.io/Nim/manual_experimental.html |
07:13:54 | FromDiscord | <I have 50GB of nothing on my PC> how do I tell saem's vscod extension to not wrap my lines? |
07:40:06 | * | Notxor joined #nim |
07:44:05 | * | xet7 quit (Quit: Leaving) |
07:45:45 | * | cnx quit (Remote host closed the connection) |
07:46:33 | * | cnx joined #nim |
09:11:39 | FromDiscord | <Phil> That extension wraps your lines? |
09:13:09 | FromDiscord | <I have 50GB of nothing on my PC> the formatter does |
09:13:19 | FromDiscord | <I have 50GB of nothing on my PC> but im pretty sure the formatter is part of it |
09:14:29 | FromDiscord | <Phil> ... I have not once received such a thing, and I like formatting.↵Are you maybe just running nimpretty in the background?↵Or maybe nimsaem's extension is running nimpretty in the background, in which case you're out of luck, nimpretty doesn't provide many ways of configuration |
09:14:35 | FromDiscord | <pmunch> Oh fun\: `Error: expression 'drawcircle(canvas, 40, 40, 30, RED)' is of type 'void' and has to be used (or discarded)` |
09:14:54 | FromDiscord | <Phil> Ah yes, why void is not a good return type |
09:19:02 | FromDiscord | <ringabout> `void` type is buggy |
09:20:36 | NimEventer | New thread by nimnam: Anonymous records / subtyping ?, see https://forum.nim-lang.org/t/9955 |
10:22:29 | FromDiscord | <luteva> Hi! Is there a radix sorting algorithm in nim? I only saw a wrapper to the rax lib (which is wirtten in c). |
10:22:37 | FromDiscord | <luteva> (edit) "wirtten" => "written" |
10:47:49 | FromDiscord | <Hourglass [She/Her]> In Java, exceptions have a lot of overhead because of how they work, but Nim is a compiled language so do Nim exceptions have issues compared to just returning a `Result` type? |
10:48:04 | FromDiscord | <Hourglass [She/Her]> Also, is it better to use `Result`s for control flow handling? |
10:56:06 | FromDiscord | <Diogenes of Toronto> Coming from go where we don't have exceptions really I could not be happier without having them. I prefer to use option in nim. Whereever I can to get similar results. |
10:58:32 | FromDiscord | <Diogenes of Toronto> Or return a tuple with an error struct |
11:07:12 | FromDiscord | <Phil> In reply to @Hourglass, When the Hour Strikes "Also, is it better": In my personal opinion, having decent pattern matching syntax with Result-types (basically how Rust does it) is the way to go.↵But to me that is not quite the nim way because it doesn't express beautifully in nim's syntax.↵So I go with exceptions and use the `raises` pragma to ensure I know all the things my procs can raise. |
11:08:48 | FromDiscord | <Phil> Though I guess you could argue that you should not be capable to returning more than 3 different types of exceptions, which is a manageable amount and for that you could pre-define your necessary object-variant-result-types and that would make it workable again |
11:09:14 | FromDiscord | <Phil> Haven't tried that out yet |
11:10:20 | FromDiscord | <pmunch> Trying to wrap something without the declaration guards, I knew I had added them for a reason \:P |
11:10:21 | FromDiscord | <pmunch> Ah, it was actually because my Futhark wrapper had a `type void = distinct object` |
11:13:43 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "Though I guess you": Fair, may do that if I can ever get my system to work lol |
11:17:47 | * | xet7 joined #nim |
11:18:51 | * | azimut joined #nim |
12:31:40 | FromDiscord | <ezquerra> sent a code paste, see https://play.nim-lang.org/#ix=4ptg |
12:31:48 | FromDiscord | <ezquerra> (edit) "https://play.nim-lang.org/#ix=4ptg" => "https://play.nim-lang.org/#ix=4pth" |
12:34:37 | FromDiscord | <jtv> You can use _ to discard stuff in nim |
12:38:55 | FromDiscord | <Phil> In reply to @ezquerra "Is there an equivalent": `_` is only discouraged to use for names in your generics (as of nim 2.0 that's a compiler error).↵To name unimportant values it is perfectly fine |
12:41:03 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4ptj |
12:46:26 | FromDiscord | <ezquerra> Thanks a lot! I didn’t know that! |
12:47:31 | FromDiscord | <ezquerra> I’m converting some Python code to nim and it’s pretty amazing how little I need to change to get something working (performance is not super important for this particular case) |
12:48:37 | FromDiscord | <ezquerra> I mean, I’d still prefer to make the code efficient but I don’t need to squeeze every last drop of performance from it |
12:49:04 | NimEventer | New Nimble package! ants - ANT: statically typed configurations for Nim (and others), see https://github.com/elcritch/ants |
12:55:55 | * | ltriant quit (Ping timeout: 252 seconds) |
13:00:12 | * | xet7 quit (Remote host closed the connection) |
13:00:24 | FromDiscord | <pmunch> @ezquerra\: would be interesting to see how a Python -\> Nim 1\:1 conversion actually does performance wise |
13:07:23 | FromDiscord | <Hourglass [She/Her]> I wonder what syntax from Python is completely invalid in Nim (and can't be implemented via macros) |
13:07:52 | FromDiscord | <Hourglass [She/Her]> 'Native Python' code would be funny lol |
13:13:32 | * | kenran joined #nim |
13:17:59 | FromDiscord | <ShalokShalom> In reply to @pmunch "<@974046326088163438>\: would be interesting": that could attract a lot of people |
13:18:13 | FromDiscord | <ShalokShalom> I doubt it would loose much |
13:18:18 | FromDiscord | <ShalokShalom> compare to native Nim |
13:18:38 | FromDiscord | <Nerve> In reply to @pmunch "<@974046326088163438>\: would be interesting": I've done that in a professional engineering context at work. Roughly 10x across the board. |
13:19:13 | FromDiscord | <Nerve> And I haven't lost much other than easy access to absolutely bloated general-purpose scientific libraries. I was able to extract the algorithms I needed and keep those particular functions lean. |
13:19:53 | FromDiscord | <Nerve> People don't realize just how much switching and configuration is happening for their particular scenario and data type when they call a function in SciPy. |
13:23:03 | FromDiscord | <federico3> +1 it does not have to be beautiful and expressive code as long as it's correct and allows developers to incrementally cleanup and rewrite the generate code↵(@ShalokShalom) |
13:24:51 | FromDiscord | <Rika> In reply to @Hourglass, When the Hour Strikes "I wonder what syntax": Decorators (as is) may be difficult |
13:25:06 | FromDiscord | <Rika> Naturally there’s pragmas as a replacement but yeah |
13:28:03 | FromDiscord | <Hourglass [She/Her]> And `eval`/`exec` code could probably be done via NimScript and a custom API |
13:28:07 | FromDiscord | <Hourglass [She/Her]> In reply to @Rika "Decorators (as is) may": Hm |
13:29:23 | FromDiscord | <Hourglass [She/Her]> In reply to @Rika "Decorators (as is) may": Hm |
13:33:27 | FromDiscord | <federico3> you don't to translate everything including eval |
13:34:43 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4ptv |
13:34:46 | FromDiscord | <Hourglass [She/Her]> This works so shouldn't be much issue |
13:35:01 | FromDiscord | <Hourglass [She/Her]> In reply to @federico3 "you don't to translate": Yeah but would be cool for 'complete' parity |
13:35:06 | FromDiscord | <Hourglass [She/Her]> Wonder what would break though tbh |
13:35:13 | FromDiscord | <Hourglass [She/Her]> Probably async related stuff would be the most likely? |
13:35:21 | FromDiscord | <Hourglass [She/Her]> And the AST module probably |
13:36:30 | FromDiscord | <Phil> In reply to @Hourglass, When the Hour Strikes "I wonder what syntax": Nims version of list comprehensions is not as nice |
13:36:47 | FromDiscord | <Hourglass [She/Her]> Can always implement it via macros or something, right? |
13:36:59 | FromDiscord | <Hourglass [She/Her]> Since a lot would need to be parsed within a macro to be fair |
13:37:00 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4ptA |
13:37:09 | FromDiscord | <Dudugz> How would that work? |
13:37:43 | FromDiscord | <Phil> In reply to @Nerve "And I haven't lost": Not even that, you can still use those, it just turns the distribution of your program from being simple to requiring you to install python libs |
13:37:53 | FromDiscord | <Dudugz> python decorators allow you to replace a function or class entirely if you wish |
13:38:12 | FromDiscord | <Phil> (edit) "In reply to @Nerve "And I haven't lost": Not even that, you can still use those, it just turns the distribution of your program from being ... simple"here" added "a" | "asimple ... to" added ""here is the binary"" |
13:38:29 | FromDiscord | <ShalokShalom> In reply to @federico3 "you don't to translate": you could always use Nimpy |
13:38:36 | * | ltriant joined #nim |
13:38:36 | FromDiscord | <federico3> A translation has to be practically useful. What matters is correctness and the ability to review the code and improve it. Being 100% compatible by generating code that is extremely complex/unreadable/slow is not very useful - you have to rewrite it anyways. |
13:40:14 | FromDiscord | <ShalokShalom> Ah, PMunch wrote 1:1 conversation |
13:40:27 | FromDiscord | <ShalokShalom> I understood idiomatic |
13:40:46 | NimEventer | New thread by ringabout: My Nim Progress tracking everyday, see https://forum.nim-lang.org/t/9956 |
13:41:12 | FromDiscord | <ShalokShalom> But Python -> readable Nim + Nimpy for the edge cases solves the practical performance problem of many Python projects |
13:41:27 | FromDiscord | <ShalokShalom> I would immediately know a couple of projects, I would like to translate |
13:41:41 | FromDiscord | <ShalokShalom> I can imagine, that the Synapse guys might be interested |
13:42:19 | FromDiscord | <Nerve> In reply to @Isofruit "Not even that, you": In my scenario where my program will be run on workstations and invoked on servers, this is impractical, partly for reasons @federico3 brought up. Having interop is nice when it can be compiled with your own code, i.e. C/C++/Obj-C. But having to pull in and entire other runtime and toolchain i.e. Python is a recipe for nightmares when it comes to distribution. |
13:42:32 | FromDiscord | <Nerve> (edit) "and" => "an" |
13:43:18 | FromDiscord | <Nerve> It's part of why I ditched Python. I got the thing working and realized distributing it was going to be a colossal headache versus a compiled binary. Nim was the obvious choice, because I also needed some speedup. |
13:43:25 | FromDiscord | <Nerve> The translation was surprisingly painless. |
13:44:11 | FromDiscord | <Nerve> (edit) "The translation was surprisingly painless. ... " added "Nim really is quite close to just being native-compiled Python." |
13:44:35 | FromDiscord | <Rika> In reply to @Hourglass, When the Hour Strikes "This works so shouldn't": It wouldn’t capture the function below it |
13:47:00 | FromDiscord | <ShalokShalom> In reply to @Nerve "It's part of why": do you know Conda? |
13:47:24 | FromDiscord | <ShalokShalom> Sorry, not Conda. |
13:47:36 | FromDiscord | <ShalokShalom> There is a 'make a binary' implementation for Python |
13:47:44 | * | ltriant quit (Ping timeout: 248 seconds) |
13:48:47 | FromDiscord | <Phil> I did google that for a stint, I gave up on that rather quickly when all of the things I read about it were "Not all that easy to get going" |
13:49:02 | FromDiscord | <Phil> (edit) "stint," => "stint before I landed on nim," |
13:52:00 | FromDiscord | <ShalokShalom> https://github.com/exaloop/codon |
13:52:05 | FromDiscord | <ShalokShalom> Codon, Conda |
13:52:18 | FromDiscord | <ShalokShalom> Somebody should pay penalties for these names ✌🏻😅 |
13:53:30 | FromDiscord | <Rika> codoff |
13:54:09 | FromDiscord | <Rika> It’s not completely compatible with CPython |
13:54:19 | FromDiscord | <Rika> It’s essentially another python implementation so |
13:55:17 | FromDiscord | <Phil> ~~And in the end I want static typing because ducktyping isn't nice, to deal with~~ |
13:55:18 | FromDiscord | <Nerve> In reply to @ShalokShalom "do you know Conda?": I tried both Nuitka and pyinstaller. Both left a lot to be desired. I was surprised that Nuitka pretty much "just worked" but the binaries were huge and I saw speed regressions across the board from already slow-ish raw Python. |
13:55:42 | FromDiscord | <Phil> ... How is acompiled binary slower than interpreted python? |
13:55:58 | FromDiscord | <Phil> Wonders of technology |
13:56:05 | FromDiscord | <Rika> In reply to @Isofruit "... How is a**compiled**": What he said were packagers |
13:56:07 | FromDiscord | <Rika> Not compilers |
13:56:18 | FromDiscord | <Rika> So it is still CPython, packaged into a binary |
13:56:27 | FromDiscord | <ShalokShalom> In reply to @Nerve "I tried both Nuitka": i meant codon |
13:56:38 | FromDiscord | <ShalokShalom> I have not worked with anything of that |
13:57:13 | FromDiscord | <Phil> In reply to @Rika "So it is still": So basically it's still interpreted in a sense, but now in a binary? |
13:57:19 | FromDiscord | <frobnicate> How do I know if I'm getting `<` or `<`? |
13:57:24 | FromDiscord | <ShalokShalom> In reply to @Rika "What he said were": I think Nuika is both? https://github.com/Nuitka/Nuitka |
13:57:27 | FromDiscord | <Phil> I'm struggling to wrap my head around how that all works |
13:57:37 | FromDiscord | <Phil> (edit) "works" => "is supposed to work" |
13:57:41 | FromDiscord | <Phil> Oh well, either way not my beer. |
13:57:43 | FromDiscord | <ShalokShalom> In reply to @Isofruit "So basically it's still": Yes. They usually ship the runtime with it |
13:58:00 | FromDiscord | <ShalokShalom> I mean, there is a JS to Cpp compiler, that does it quite similar |
13:58:09 | FromDiscord | <ShalokShalom> dotnet ships the entire runtime in their wasm |
13:58:09 | FromDiscord | <Rika> In reply to @frobnicate "How do I know": What do you mean |
13:58:15 | FromDiscord | <ShalokShalom> that's not really a new thing |
13:58:25 | FromDiscord | <ShalokShalom> Graal does ship native images, who are JIT |
13:59:25 | FromDiscord | <ShalokShalom> sent a long message, see http://ix.io/4ptI |
13:59:35 | FromDiscord | <ShalokShalom> Ruby 1.8 was the last popular 'interpreted' language |
13:59:52 | FromDiscord | <Phil> In reply to @ShalokShalom "And nothing of that": Them is fighting words that half the internet would disagree with you on |
13:59:58 | FromDiscord | <Nerve> In reply to @ShalokShalom "i meant codon": Codon seemed too early for me to use, and wouldn't be able to compile some of the SciPy stuff I was making use of. The translation work to get the most out of Codon was probably close to the Nim translation already. And I've gained some very big architectural benefits from Nim's static typing. |
14:00:40 | FromDiscord | <ShalokShalom> I would love such a Nim conversation |
14:00:54 | FromDiscord | <ShalokShalom> I actually see a lot of benefits for the Nim community |
14:01:31 | FromDiscord | <ShalokShalom> And I wasn't meaning to drift you away from Nim, more interested in how the different tools work comparatively 🙂 |
14:01:41 | FromDiscord | <Rika> The “meaning” of interpreted to most people no longer agrees with the “real meaning” nowadays so |
14:02:02 | FromDiscord | <Nerve> In reply to @ShalokShalom "And nothing of that": Python may compile to bytecode but that bytecode is still interpreted |
14:02:27 | FromDiscord | <ShalokShalom> In reply to @Isofruit "Them is fighting words": Interpreted languages existed. Then VM languages came along. Implementing an interpreter is still someone else as transpiling a language into an intermediate language and then running it. |
14:02:45 | FromDiscord | <Rika> To most people, even if they don’t admit it, interpreted means you commonly run an extra “programming language binary” to then run the source code, regardless of what really happens behind the scenes |
14:02:47 | FromDiscord | <ShalokShalom> In reply to @Rika "The “meaning” of interpreted": Yeah, absolutely |
14:06:10 | FromDiscord | <ShalokShalom> In reply to @Nerve "Python may compile to": Yeah. I was more saying, the old meaning of the world is not really representative of what is going on, actually.↵↵Particularly since 'interpreted' is often used in a demeaning sense, imho |
14:06:33 | * | Notxor quit (Remote host closed the connection) |
14:06:36 | FromDiscord | <ShalokShalom> I read this mostly in communities of statically compiled languages |
14:07:04 | FromDiscord | <ShalokShalom> (edit) "world" => "word" |
14:07:25 | FromDiscord | <enthus1ast> my cpu interprets my c bytecode |
14:07:32 | FromDiscord | <ShalokShalom> (edit) "on, actually.↵↵Particularly" => "on ↵↵Particularly" |
14:07:44 | FromDiscord | <ShalokShalom> Yeah. I mean Java also translates to machine code |
14:08:00 | FromDiscord | <ShalokShalom> And Java is far more 'low level' interpreted than Python |
14:08:16 | FromDiscord | <ShalokShalom> Comparing Python and Java still shows vast differences. |
14:08:34 | FromDiscord | <ShalokShalom> The world is not so small, that we can put all languages into one of two boxes. 🙂 |
14:09:16 | FromDiscord | <enthus1ast> in the end it does not really matter, it mostly boils down to\: Good enough + i can work with it |
14:16:26 | FromDiscord | <Phil> I can't say I've read a lot of negative subconnotation behind the word "interpreted", then again I'm not active in C/C++ communities |
14:18:50 | FromDiscord | <Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4ptN |
14:19:45 | FromDiscord | <Hourglass [She/Her]> In reply to @Dudugz "python decorators allow you": Macros |
14:19:56 | FromDiscord | <Hourglass [She/Her]> Decorators are basically just macros when you think about it |
14:20:17 | FromDiscord | <Dudugz> Yes they are, but is Nim's macros powerful enough for this? |
14:20:23 | FromDiscord | <Hourglass [She/Her]> In reply to @ShalokShalom "you could always use": Point here is 'native Python' lol, would be interesting |
14:20:32 | FromDiscord | <Dudugz> The closest we have to decorators are pragmas |
14:22:09 | FromDiscord | <Hourglass [She/Her]> In reply to @Rika "It wouldn’t capture the": Could likely just check for the function below it? You'd have to read a string of python code, parse it and stuff then create a Nim AST from that probably |
14:23:12 | FromDiscord | <Hourglass [She/Her]> In reply to @ShalokShalom "https://github.com/exaloop/codon": Interesting |
14:26:01 | FromDiscord | <Hourglass [She/Her]> In reply to @Dudugz "Yes they are, but": Probably not with just implementing an `@` macro, you'd probably have to make a lexer and parser for Python in Nim and generate an AST from that |
14:27:13 | FromDiscord | <Hourglass [She/Her]> In reply to @Dudugz "The closest we have": Pragmas just use macros (or templates I believe?) which manipulate the AST so, I'd imagine just making decorators pass themselves to nim procs with pragmas) |
14:29:25 | FromDiscord | <Hourglass [She/Her]> Wonder what benefits you could even get with that besides speed benefits and the ability to distribute a binary |
14:32:45 | FromDiscord | <Rika> In reply to @Hourglass, When the Hour Strikes "Could likely just check": yes, but then that's just a transpiler |
14:38:12 | * | jmdaemon quit (Ping timeout: 252 seconds) |
14:52:29 | * | jmcantrell quit (Ping timeout: 256 seconds) |
14:52:46 | * | alice quit (Read error: Connection reset by peer) |
14:54:11 | * | alice joined #nim |
14:59:21 | FromDiscord | <Hourglass [She/Her]> You're not converting it to source code directly though, are you? |
14:59:31 | FromDiscord | <Hourglass [She/Her]> Well |
14:59:40 | FromDiscord | <Hourglass [She/Her]> Maybe this counts as a transpiler actually yeah |
14:59:46 | FromDiscord | <Hourglass [She/Her]> Similar high-level stuff |
15:06:39 | FromDiscord | <Hourglass [She/Her]> I don't think all of Python syntax is doable in Nim macros rip |
15:06:59 | FromDiscord | <Hourglass [She/Her]> Unless there's a parser for Python code and then we spit out Nim AST |
15:07:13 | FromDiscord | <Hourglass [She/Her]> Mainly because of the `@` symbol |
15:29:23 | FromDiscord | <jtv> I mean, you can do all kinds of dynamic stuff in Python that would take a lot of library work to support in Nim, even simple stuff like putting items of different kinds in a list. The "Any" type isn't really good enough for that. You'd have to carry around full run time type info |
15:36:20 | FromDiscord | <Nerve> I found that when converting from Python, if you're doing a lot of heterogenous data structure shenanigans (using dicts as records/structs/objects), the JsonNode type in Nim acts as a really good gradual typing tool for getting immediate compatibility so your stuff can run, and you can coalesce static types later. |
15:37:09 | FromDiscord | <frobnicate> In reply to @Rika "What do you mean": Sorry for late reply. Am parsing XML and sometimes it's an "<" and other times it's "<", same with "&". It seems to get converted to the char when I read it |
15:37:41 | FromDiscord | <Nerve> (edit) "I found that when converting from Python, if you're doing a lot of heterogenous data structure shenanigans (using dicts as records/structs/objects), the JsonNode type in Nim acts as a really good gradual typing tool for getting immediate compatibility so your stuff can run, and you can coalesce static types later. ... " added "This of course incurs the runtime risk of dereferencing keys improperly or which aren't there." |
15:37:59 | FromDiscord | <Rika> in what circumstances is it < or < |
15:38:05 | FromDiscord | <Nerve> (edit) "aren't there." => "are absent." |
15:45:49 | * | jmcantrell joined #nim |
15:48:45 | FromDiscord | <Hourglass [She/Her]> In reply to @jtv "I mean, you can": Custom `PyObject`s could probably fit |
15:58:01 | * | Notxor joined #nim |
16:01:41 | * | azimut quit (Ping timeout: 255 seconds) |
16:02:17 | * | azimut joined #nim |
16:08:47 | FromDiscord | <frobnicate> sent a code paste, see https://play.nim-lang.org/#ix=4pun |
16:10:08 | FromDiscord | <frobnicate> Or xmlparse. Whichever one is the manual one |
16:14:23 | NimEventer | New post on r/nim by nimuru_: Thoughts on compiling to Zig?, see https://reddit.com/r/nim/comments/11eckfp/thoughts_on_compiling_to_zig/ |
16:18:45 | * | arkurious joined #nim |
16:30:07 | * | Zevv_ joined #nim |
16:30:36 | * | def-- joined #nim |
16:30:37 | * | ltriant joined #nim |
16:35:32 | * | ltriant quit (Ping timeout: 252 seconds) |
16:36:25 | * | nyeaa49284230 quit (*.net *.split) |
16:36:25 | * | cornfeedhobo quit (*.net *.split) |
16:36:26 | * | attah quit (*.net *.split) |
16:36:26 | * | madprops quit (*.net *.split) |
16:36:26 | * | Ekho quit (*.net *.split) |
16:36:26 | * | Zevv quit (*.net *.split) |
16:36:26 | * | def- quit (*.net *.split) |
16:36:26 | * | krydos quit (*.net *.split) |
16:36:26 | * | def-- is now known as def- |
16:37:36 | * | nyeaa49284230 joined #nim |
16:37:36 | * | cornfeedhobo joined #nim |
16:37:36 | * | Ekho joined #nim |
16:37:36 | * | attah joined #nim |
16:37:36 | * | madprops joined #nim |
16:37:36 | * | krydos joined #nim |
16:51:31 | FromDiscord | <Hourglass [She/Her]> Still have no idea to how I'm supposed to pass anything to due with async networking to the shared library's proc rip |
16:51:58 | FromDiscord | <Hourglass [She/Her]> Maybe an object 'proxy' or something? But that's not exactly ideal |
17:04:44 | Amun-Ra | "Thoughts on compiling to Zig?" ← deleted |
17:16:38 | * | kenran quit (Remote host closed the connection) |
17:32:54 | * | Notxor quit (Remote host closed the connection) |
17:35:18 | FromDiscord | <Dudugz> < is a representation of the character ``<`` |
17:36:31 | FromDiscord | <Dudugz> I think you won't know after using the parser, as < will be converted to ``<`` after the xml is parsed |
17:36:49 | FromDiscord | <Dudugz> it's like a placeholder |
17:37:05 | * | jmdaemon joined #nim |
17:37:31 | FromDiscord | <Dudugz> In reply to @Hourglass, When the Hour Strikes "Still have no idea": Couldn't you have used a separate server and made the plugin connect to it to exchange data? |
17:50:51 | * | rockcavera joined #nim |
18:00:56 | FromDiscord | <Hourglass [She/Her]> In reply to @Dudugz "Couldn't you have used": So another socket but between the plugin and the main app? |
18:01:33 | FromDiscord | <Hourglass [She/Her]> When I already have to handle multiple connections to different clients? And the plugin is supposed to be processing the packets and stuff? |
18:01:58 | FromDiscord | <Hourglass [She/Her]> That just sounds like a recipe for code with horrible speed in the future and hard to change design |
18:02:17 | FromDiscord | <Hourglass [She/Her]> Plugins are supposed to be just that, plug-in |
18:08:06 | FromDiscord | <Dudugz> yea |
18:08:29 | FromDiscord | <enthus1ast> have you tried to pass async sockets to a plugin? |
18:08:31 | FromDiscord | <Dudugz> local net doesn't have that issue with speed if well done |
18:11:54 | FromDiscord | <Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4pv3 |
18:14:04 | FromDiscord | <etra> In reply to @Hourglass, When the Hour Strikes "Still have no idea": just ooc is that code open source? |
18:17:40 | FromDiscord | <Hourglass [She/Her]> In reply to @etra "just ooc is that": Yep it is https://github.com/Nimberite-Development/Nimberite |
18:18:03 | FromDiscord | <enthus1ast> i know i've done it once |
18:18:08 | FromDiscord | <Hourglass [She/Her]> In reply to @enthus1ast "have you tried to": Yeah, i get a segfault saying I'm accessing a null value even though `socket == nil` is false |
18:18:16 | FromDiscord | <enthus1ast> i've also build a plugin system |
18:18:23 | FromDiscord | <Hourglass [She/Her]> In reply to @Dudugz "local net doesn't have": It'd still introduce latency though? |
18:18:32 | FromDiscord | <Hourglass [She/Her]> In reply to @enthus1ast "i've also build a": I'm using shared libraries for Nim code specifically |
18:18:41 | FromDiscord | <enthus1ast> yes |
18:18:57 | FromDiscord | <Hourglass [She/Her]> Oh? You've done the same? |
18:19:16 | FromDiscord | <Hourglass [She/Her]> The actual plugin loading code is a non-issue, it's trying to pass certain objects rip |
18:19:20 | FromDiscord | <Hourglass [She/Her]> AsyncSockets are an example |
18:19:35 | FromDiscord | <enthus1ast> mh i don't kno for witch project i did it |
18:19:37 | FromDiscord | <enthus1ast> w |
18:19:46 | FromDiscord | <Hourglass [She/Her]> Passing `AsyncFD`s also segfault when I use those to read and write data or read from it directly |
18:21:33 | FromDiscord | <Hourglass [She/Her]> I think it's just an issue with how shared libraries works tbh |
18:21:39 | FromDiscord | <Hourglass [She/Her]> (edit) "works" => "work" |
18:27:43 | * | ltriant joined #nim |
18:30:32 | FromDiscord | <Hourglass [She/Her]> Ugh this is... Annoying as hell |
18:31:08 | FromDiscord | <Hourglass [She/Her]> I could probably have something for storing values within the core and then have procs to run actions in the core, but then that's just tedious and horribly annoying |
18:32:55 | * | ltriant quit (Ping timeout: 256 seconds) |
18:35:03 | FromDiscord | <djazz> Trying to call a C macro on the generated nim code, but emit adds newlines...↵This is the wanted codegen output: `bi_decl(bi_2pins_with_func(PICO_DEFAULT_I2C_SDA_PIN, PICO_DEFAULT_I2C_SCL_PIN, ((enum gpio_function) 3)));`↵I have tried this, but it crashes the nim compiler (SIGSEGV), guessing because it cant convert body to string?↵`template bi_decl(body: untyped) = {.emit: ["bi_decl(", body, ");"].}` |
18:35:25 | FromDiscord | <djazz> the C macro https://github.com/raspberrypi/pico-sdk/blob/426e46126b5a1efaea4544cdb71ab81b61983034/src/common/pico_binary_info/include/pico/binary_info/code.h#L31-L35 |
18:37:41 | FromDiscord | <djazz> atleast I think thats why it fails |
18:37:52 | FromDiscord | <djazz> (due to the newlines) |
18:43:57 | * | dv^_^ joined #nim |
18:45:45 | FromDiscord | <djazz> yep seems to be the newlines... https://github.com/raspberrypi/pico-sdk/issues/867 |
18:52:39 | * | Notxor joined #nim |
18:52:50 | FromDiscord | <djazz> sent a code paste, see https://play.nim-lang.org/#ix=4pve |
18:53:27 | FromDiscord | <djazz> i tried this with a void type for BiDecl, same result↵`proc bi_decl(decl: BiDecl) {.importc: "bi_decl", inline.}` |
18:55:23 | * | junaid_ joined #nim |
19:10:41 | FromDiscord | <djazz> uh, nvm, it still used the template, forgot to comment it out |
19:12:47 | FromDiscord | <djazz> and codegenDecl doesnt seem to work together with importc, it does nothing? |
19:17:06 | FromDiscord | <arkaroo> ah, darn, as usual explaining it makes it obvious. should be\:↵ """↵ sql.exec(sqlString, arg) |
19:17:16 | FromDiscord | <arkaroo> good rubber duck session everyone 🦆 |
19:19:04 | FromDiscord | <Phil> Happy to quack |
19:19:16 | FromDiscord | <djazz> ugh, might aswell convert the c macro stuff to nim |
19:40:14 | FromDiscord | <Hourglass [She/Her]> Ugh I'm in pain lmao |
19:42:23 | FromDiscord | <Hourglass [She/Her]> I could probably provide a way to call the procs within the core to get the data from my shared library's |
19:42:27 | FromDiscord | <Hourglass [She/Her]> Library |
19:42:42 | FromDiscord | <Hourglass [She/Her]> But also that's annoying and tedious, I shouldn't have to do this |
19:47:28 | FromDiscord | <etra> have you hooked a debugger just in case to check? |
19:49:08 | FromDiscord | <Hourglass [She/Her]> I... Haven't actually, idk how they work but I can try now |
19:55:01 | FromDiscord | <etra> also since you're dynamically loading shared libraries, how would the garbage collector know the boundaries? when to free stuff? that sounds like a hazard into itself |
19:56:08 | FromDiscord | <Hourglass [She/Her]> I'm using `arc` here for the memory management, most of what I'm using has been working fine before AsyncSocket was introduced |
19:58:10 | FromDiscord | <etra> I think if you have to deal with anything that's not POD you'll have issues in the boundary |
19:59:05 | FromDiscord | <etra> I can imagine some sort of message system or callback design, I don't think there's any ABI that good to pass more complex data when using shared libs but I could be wrong |
20:01:17 | FromDiscord | <Hourglass [She/Her]> I think the issue is with the allocator as you said |
20:01:23 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4pvA |
20:10:44 | FromDiscord | <etra> I guess the other option is to heap allocate manually? but I'm not sure you can do that with stuff like AsyncFD? |
20:11:17 | FromDiscord | <etra> (edit) "the other" => "another" |
20:11:27 | FromDiscord | <Hourglass [She/Her]> In reply to @etra "I guess another option": I'm not even sure how to do that either aha |
20:11:40 | FromDiscord | <Hourglass [She/Her]> Ig using a proxy or something is my only option |
20:12:26 | FromDiscord | <Hourglass [She/Her]> I wish there was a better way to do this though... |
20:12:50 | FromDiscord | <enthus1ast> @Hourglass [She/Her]\: I got it working \:) |
20:12:56 | FromDiscord | <enthus1ast> but it requires devel |
20:12:59 | FromDiscord | <Hourglass [She/Her]> Oh? |
20:13:08 | FromDiscord | <Hourglass [She/Her]> What changes do devel make to make it work? |
20:14:43 | FromDiscord | <enthus1ast> i'll clean up and test a little then i share |
20:16:15 | FromDiscord | <Hourglass [She/Her]> Alright ^^ |
20:16:29 | FromDiscord | <Hourglass [She/Her]> I am now on Matrix haha |
20:17:03 | FromDiscord | <enthus1ast> so this seems to work\: https://play.nim-lang.org/#ix=4pvB |
20:17:10 | FromDiscord | <enthus1ast> i register the global dispatcher in the dll |
20:17:15 | FromDiscord | <enthus1ast> but it was not working with 1.6.10 |
20:20:07 | FromDiscord | <enthus1ast> is this for your minecraft server? |
20:22:18 | FromDiscord | <enthus1ast> i also found my thread in the forum back then \:D |
20:22:18 | FromDiscord | <enthus1ast> https://forum.nim-lang.org/t/3382 |
20:22:19 | FromDiscord | <enthus1ast> basically the same error |
20:25:38 | * | junaid_ quit (Remote host closed the connection) |
20:27:18 | FromDiscord | <ranok (Jacob Torrey)> Any tips for accessing an object's fields in a macro? |
20:27:30 | FromDiscord | <ranok (Jacob Torrey)> https://forum.nim-lang.org/t/3928 looks like it would be useful but it's spinning forever |
20:29:41 | FromDiscord | <enthus1ast> Hourglass [She/Her]\: @Hourglass [She/Her] i also found one of my module systems |
20:29:43 | FromDiscord | <enthus1ast> (than i can share) |
20:29:43 | FromDiscord | <enthus1ast> mhh, the public code is quite to old, the code went proprietary |
20:30:28 | FromDiscord | <enthus1ast> https://github.com/enthus1ast/nimPepper/tree/master/src/nimPepper/modules |
20:36:14 | FromDiscord | <Hourglass [She/Her]> In reply to @enthus1ast "Hourglass [She/Her]\: <@909883978717204561> ": Oh cool! |
20:37:25 | FromDiscord | <Hourglass [She/Her]> In reply to @enthus1ast "i register the global": Issue is, I'll likely have different connections handled from different shared libraries, I doubt this would work well in that situation aha |
20:37:39 | FromDiscord | <Hourglass [She/Her]> In reply to @enthus1ast "is this for your": Yep! |
20:39:26 | FromDiscord | <Hourglass [She/Her]> @enthus1ast |
20:39:53 | FromDiscord | <Hourglass [She/Her]> Huh that's annoying, discord fills pings in even if i dont select ne |
20:42:40 | FromDiscord | <enthus1ast> i honestly don't know↵(@Hourglass [She/Her]) |
20:43:16 | FromDiscord | <Hourglass [She/Her]> Fair |
20:43:35 | FromDiscord | <Hourglass [She/Her]> I'll try it, but hopefully it'll be fine |
20:44:43 | FromDiscord | <enthus1ast> maybe, a sync server could be better |
20:44:44 | FromDiscord | <enthus1ast> then you could spawn a thread for each client |
20:44:44 | FromDiscord | <enthus1ast> i think you do some heavy lifting later |
20:44:45 | FromDiscord | <enthus1ast> but idk whats better |
20:47:49 | FromDiscord | <Hourglass [She/Her]> In reply to @enthus1ast "then you could spawn": Wouldn't a thread per client not work for if the server has more clients than (threads available on device)? |
20:49:19 | FromDiscord | <Hourglass [She/Her]> Oh wow that worked |
20:49:29 | FromDiscord | <Hourglass [She/Her]> Thanks enthus1ast! |
20:50:43 | FromDiscord | <Hourglass [She/Her]> Now I get a different error but at least it's my custom error xD |
20:58:24 | FromDiscord | <Hourglass [She/Her]> Seems like my code does not like `isClosed` hm |
20:59:33 | FromDiscord | <Hourglass [She/Her]> `isClosed` (from `AsyncSocket`) returns false even though trying to read more crashes the server |
21:00:53 | FromDiscord | <enthus1ast> is it a catchable error? |
21:01:57 | FromDiscord | <Hourglass [She/Her]> It's my own custom error, it's catchable yeah but I can't read any more from the stream for some odd reason |
21:02:05 | FromDiscord | <Hourglass [She/Her]> First packet seems to be read just fine but |
21:02:15 | FromDiscord | <enthus1ast> from the dll? |
21:02:55 | FromDiscord | <Hourglass [She/Her]> Yep |
21:04:32 | FromDiscord | <Hourglass [She/Her]> First packet - Main app, read fine↵Second packet - From plugin, read fine, write presumed fine since the future completes?↵Third packet - Never gets sent from the client despite socket not closing? |
21:17:24 | FromDiscord | <Dudugz> I still think you should use ``buffered=false`` at least on my server there was no packet loss, when this option was active I couldn't receive/send anything.↵↵Also do you have ``inheritable=true``? https://media.discordapp.net/attachments/371759389889003532/1080237305949847572/Screenshots_2023-02-28-17-17-09.png |
21:18:54 | FromDiscord | <Hourglass [She/Her]> Not sure how to set inheritable to be true |
21:19:19 | FromDiscord | <Dudugz> ``let socket = newAsyncSocket(inheritable=true)`` |
21:19:23 | FromDiscord | <Hourglass [She/Her]> In reply to @Dudugz "I still think you": Ig i can try turning the buffer off but idk what difference it'll make aha |
21:19:56 | FromDiscord | <Hourglass [She/Her]> In reply to @Dudugz "``let socket = newAsyncSocket(inheritable=true)``": I'm getting the connection from `await srv.socket.accept()` tho |
21:20:17 | FromDiscord | <Hourglass [She/Her]> Wait |
21:20:19 | FromDiscord | <Hourglass [She/Her]> Im stupid |
21:20:20 | FromDiscord | <Hourglass [She/Her]> Sorry |
21:20:21 | FromDiscord | <Dudugz> Your sending the client conn to the plugin? |
21:20:23 | FromDiscord | <Dudugz> lol |
21:20:53 | FromDiscord | <Hourglass [She/Her]> I'm so dumb at times :p |
21:22:03 | FromDiscord | <Dudugz> https://media.discordapp.net/attachments/371759389889003532/1080238479193157672/Screenshots_2023-02-28-17-21-53.png |
21:22:13 | FromDiscord | <Dudugz> That's fine, i'm also dumb sometimes |
21:22:16 | FromDiscord | <Hourglass [She/Her]> The buffer being false completely kills the code |
21:22:26 | FromDiscord | <Dudugz> Oh, so that's a no no for you |
21:22:40 | FromDiscord | <Hourglass [She/Her]> Wait |
21:22:46 | FromDiscord | <Hourglass [She/Her]> is that inheritable killing it? |
21:23:04 | FromDiscord | <Dudugz> Idk lol |
21:23:11 | FromDiscord | <Dudugz> Maybe it is, test one and then other |
21:23:16 | FromDiscord | <Dudugz> Try just buffered=false |
21:23:17 | FromDiscord | <Hourglass [She/Her]> Wait both do |
21:23:24 | FromDiscord | <Dudugz> Bruh |
21:23:45 | FromDiscord | <Hourglass [She/Her]> uh wait no |
21:23:48 | FromDiscord | <Dudugz> I like Nim but I don't like that the errors are not very clear |
21:23:56 | FromDiscord | <Hourglass [She/Her]> Now the code just dies no matter what?? |
21:24:02 | FromDiscord | <Dudugz> Wtf lol |
21:24:06 | FromDiscord | <Dudugz> Some issue with the code then |
21:24:25 | FromDiscord | <Dudugz> What's the error? |
21:24:38 | FromDiscord | <Hourglass [She/Her]> It just does nothing |
21:24:41 | FromDiscord | <Hourglass [She/Her]> I am so confused |
21:24:58 | FromDiscord | <Hourglass [She/Her]> Maybe it's my client |
21:25:03 | FromDiscord | <Dudugz> Maybe |
21:25:05 | FromDiscord | <Hourglass [She/Her]> Wait |
21:25:08 | FromDiscord | <Hourglass [She/Her]> god damn it |
21:25:13 | FromDiscord | <Hourglass [She/Her]> I am such an idiot |
21:25:16 | FromDiscord | <Dudugz> lol |
21:25:21 | FromDiscord | <Hourglass [She/Her]> Before I tried using a proxy |
21:25:26 | FromDiscord | <Hourglass [She/Her]> So I had to change the port |
21:25:30 | FromDiscord | <Dudugz> Ah... lol |
21:25:39 | FromDiscord | <Hourglass [She/Her]> and i forgot to change it back 🤦♀️ |
21:25:49 | FromDiscord | <Dudugz> Makes sense lol, diff ports would never work |
21:27:50 | FromDiscord | <Iliketwertles> im confused on how to use this https://nim-lang.org/docs/posix.html#Utsname |
21:28:11 | FromDiscord | <Iliketwertles> moreso this tho https://nim-lang.org/docs/posix.html#uname%2CUtsname |
21:28:23 | FromDiscord | <Iliketwertles> im trying to get kernel verison |
21:29:11 | FromDiscord | <Iliketwertles> i dont know what its asking for `a1: var Utsname` |
21:30:44 | FromDiscord | <Hourglass [She/Her]> Okay so turning the buffer off gives an indexdefect |
21:31:06 | FromDiscord | <Dudugz> Hmm |
21:31:15 | FromDiscord | <Hourglass [She/Her]> https://www.toptal.com/developers/hastebin |
21:32:14 | FromDiscord | <jtv> sent a code paste, see https://play.nim-lang.org/#ix=4pw4 |
21:33:12 | FromDiscord | <Iliketwertles> ok so what i was trying was way off lol |
21:37:01 | FromDiscord | <Hourglass [She/Her]> Wait I just realised it seems like my json data isn't getting sent? |
21:38:43 | FromDiscord | <Hourglass [She/Her]> This is so odd? |
21:45:46 | FromDiscord | <Hourglass [She/Her]> Yeah this isn't something I know the cause of... |
21:46:06 | FromDiscord | <Hourglass [She/Her]> `await socket.send` does not send anything, with the buffer on and off |
21:46:31 | FromDiscord | <Hourglass [She/Her]> (edit) "and" => "or" |
21:47:12 | FromDiscord | <Hourglass [She/Her]> Yep, I'm lost, no idea why this isn't working |
21:48:10 | FromDiscord | <Iliketwertles> with if |
21:48:10 | FromDiscord | <Iliketwertles> sent a code paste, see https://play.nim-lang.org/#ix=4pww |
21:48:54 | FromDiscord | <Iliketwertles> sent a code paste, see https://play.nim-lang.org/#ix=4pwx |
21:48:56 | FromDiscord | <Iliketwertles> but its not working |
21:49:11 | FromDiscord | <Iliketwertles> (edit) "https://play.nim-lang.org/#ix=4pwx" => "https://play.nim-lang.org/#ix=4pwz" |
21:49:23 | FromDiscord | <Iliketwertles> but if i make it single quotes it wont compile |
21:58:31 | FromDiscord | <jtv> Sure, |
21:58:52 | FromDiscord | <jtv> sent a code paste, see https://play.nim-lang.org/#ix=4pwC |
22:00:16 | * | ltriant joined #nim |
22:00:18 | FromDiscord | <jtv> stdlib just returns 255 byte arrays that are null-initialized; so in C it's basically a C string already, you just need to tell nim that, then $() will turn it into a proper string |
22:01:06 | FromDiscord | <Jessa> for whatever reason, `client.getContent(url)` is painfully slow↵↵to a webserver hosted on the same device, it takes 2 seconds to fetch the result |
22:01:10 | FromDiscord | <Jessa> what is going on? |
22:08:59 | * | advesperacit quit () |
22:10:11 | FromDiscord | <Jessa> sent a code paste, see https://play.nim-lang.org/#ix=4pwE |
22:13:59 | FromDiscord | <Elegantbeef> You are also benchmarking parsing |
22:15:40 | FromDiscord | <Jessa> Yes, but that should not take 2 seconds-↵it's like 15 lines of json to parse |
22:20:48 | FromDiscord | <Hourglass [She/Her]> Oh Beef, hello |
22:21:15 | FromDiscord | <Hourglass [She/Her]> Earlier the feasibility of making macros to allow for Python syntax to work nearly complete in Nim, thoughts? |
22:21:37 | FromDiscord | <Hourglass [She/Her]> (Then I went off on a tangent about an actual python parser and generating an AST from that but that's irrelevant) |
22:21:43 | FromDiscord | <Hourglass [She/Her]> In reply to @Hourglass, When the Hour Strikes "Earlier the feasibility of": Was discussed |
22:22:22 | FromDiscord | <Elegantbeef> yardanico has a library that does aid that |
22:22:23 | FromDiscord | <Elegantbeef> But just write Nim |
22:23:16 | FromDiscord | <Elegantbeef> https://github.com/Yardanico/nimpylib#usage |
22:29:39 | FromDiscord | <Hourglass [She/Her]> We were talking about 1:1 Python code compiling in Nim |
22:30:09 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "But just write Nim": It was mainly talked about because people would be interested in speed benefits of 1:1 ports and how it could attract newcomers (probably for gradual migration) |
22:30:48 | FromDiscord | <Elegantbeef> But you can just get performance using a different runtime |
22:30:48 | FromDiscord | <Elegantbeef> Make a python compiler |
22:39:59 | FromDiscord | <Jessa> ...why do i need to wait for an async proc to be called-??↵like, isn't the entire pointi of async, to not have to wait? |
22:40:41 | FromDiscord | <Jessa> sent a code paste, see https://paste.rs/5xI |
22:42:46 | FromDiscord | <huantian> no the point of async is to wait intelligently |
22:43:20 | FromDiscord | <Jessa> ugh |
22:44:20 | FromDiscord | <Yepoleb> there's a big pile of failed python compiler projects \:D |
22:44:58 | FromDiscord | <Dudugz> ``asyncCheck getParam()`` |
22:45:17 | FromDiscord | <Dudugz> would work but the process would exit before finishing processing |
22:45:29 | FromDiscord | <Elegantbeef> The entire point of async is to give up your cpu at specific points to do other operations |
22:45:36 | FromDiscord | <Dudugz> Yea |
22:46:26 | FromDiscord | <Dudugz> I use async for network operations too as they can be time consuming, for example requesting the content of a web page |
22:46:53 | FromDiscord | <Dudugz> If you need to wait for the page to respond with the information and then use that information you need async await |
22:47:05 | FromDiscord | <Jessa> In reply to @Dudugz "would work but the": so if i use this when it doesn't matter if it exits or not |
22:47:11 | FromDiscord | <Jessa> it'd be fine |
22:47:41 | FromDiscord | <huantian> generally, you should use `waitFor` when calling async code from non async code, kinda like an "entrypoint" |
22:47:57 | FromDiscord | <huantian> use `await` for calling async code inside other async code |
22:48:17 | FromDiscord | <Elegantbeef> Depending on the behaviour you're after of course 😄 |
22:48:22 | FromDiscord | <huantian> yeah |
22:48:30 | FromDiscord | <Dudugz> sent a code paste, see https://paste.rs/ddM |
22:48:57 | FromDiscord | <Jessa> i just want to call a line, and not have to wait for it |
22:49:06 | FromDiscord | <huantian> sent a code paste, see https://paste.rs/TnT |
22:49:23 | FromDiscord | <Dudugz> In reply to @huantian "I don't think that": Oh actually it would have to be await instead of asyncCheck |
22:49:25 | FromDiscord | <Jessa> idc if the process exits before it actually does something, just need to not wait for it |
22:49:28 | FromDiscord | <huantian> yeah |
22:49:54 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "But you can just": Obviously but that wasn't the main point here lol |
22:49:54 | FromDiscord | <Dudugz> Then do a synchronous function... |
22:50:09 | FromDiscord | <Jessa> In reply to @Dudugz "Then do a synchronous": that's the problem, i still need to call `waiitfor`?!?!! |
22:50:40 | FromDiscord | <Dudugz> For a synchronous function you don't need it, it would just ``discard getParam()`` |
22:50:52 | FromDiscord | <Jessa> but- |
22:50:53 | FromDiscord | <Jessa> then it blocks |
22:51:03 | FromDiscord | <Jessa> cus waiting for it |
22:51:07 | FromDiscord | <huantian> Can you describe the exact behavior you want |
22:51:09 | FromDiscord | <Dudugz> Something has to hold your program's thread, it won't magically run if it doesn't have something saying "hey wait, before you exit do this" |
22:51:31 | FromDiscord | <Jessa> omfg |
22:51:37 | FromDiscord | <Elegantbeef> People that write python want to write python, so I do not see how they'd migrate |
22:51:45 | FromDiscord | <Dudugz> That's how all programs work lol |
22:51:57 | FromDiscord | <huantian> I think we're just misunderstanding what you want |
22:51:57 | FromDiscord | <Elegantbeef> You're just after writing a new python backend |
22:51:57 | FromDiscord | <Elegantbeef> There is no benefit in doing that for adoption |
22:52:14 | FromDiscord | <Jessa> i'm running a bigger program, and in the middle of it, i want to run a line, like a post request, then have it not block, and just continiue |
22:52:27 | FromDiscord | <Hourglass [She/Her]> People who want to use Nim and gradually move their codebases over would be one ig? But I'm not actually interested in it myself so idk why I'm trying to sell the idea to you lmao |
22:52:28 | FromDiscord | <Dudugz> So just asyncCheck? |
22:52:35 | FromDiscord | <Elegantbeef> If python programmers cared about performance they wouldnt write python, they'd write julia or another alternative |
22:52:43 | FromDiscord | <Jessa> In reply to @Dudugz "So just asyncCheck?": No, because asyncCheck gets blatantly ignored |
22:52:54 | FromDiscord | <Jessa> The request does not go through |
22:53:15 | FromDiscord | <huantian> if you asyncCheck, you have to be polling the event loop sometime during your program |
22:53:15 | FromDiscord | <Dudugz> In reply to @Jessa "i'm running a bigger": asyncCheck will run an asynchronous operation without blocking the program |
22:53:22 | FromDiscord | <Elegantbeef> Nimpy exists, so they can just use python |
22:53:24 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4pwT |
22:53:27 | FromDiscord | <Dudugz> In reply to @Jessa "The request does not": Hmm |
22:53:30 | FromDiscord | <Jessa> In reply to @Hourglass, When the Hour Strikes "That's because you program": ...in the bigger program |
22:53:31 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "Nimpy exists, so they": Fair enough |
22:53:36 | FromDiscord | <Hourglass [She/Her]> In reply to @Jessa "...in the bigger program": Ah |
22:53:52 | FromDiscord | <huantian> in your bigger program, you'd want to call `poll` every so often to give tiem for the async loop to run |
22:53:52 | FromDiscord | <Hourglass [She/Her]> Not sure then |
22:54:10 | FromDiscord | <Jessa> so it'll block anyway? xD |
22:56:09 | FromDiscord | <Elegantbeef> I mean async is cpu sharing |
22:56:30 | FromDiscord | <Elegantbeef> You need to have a place to give up your cpu |
22:56:49 | FromDiscord | <Elegantbeef> If you want to have a non main thread blocking operation, you'd use threading |
22:56:56 | FromDiscord | <Dudugz> If you wanted to make the program make a request and then consume the information your entire handler would have to be asynchronous and called by asyncCheck |
22:57:13 | FromDiscord | <Dudugz> E.g a proc that makes the request and consumes the information as soon as it is ready |
22:57:19 | FromDiscord | <Elegantbeef> Use a channel to send the message to a secondary thread that then uses async to send the mesage |
22:57:22 | FromDiscord | <Jessa> welp |
22:57:28 | FromDiscord | <Jessa> In reply to @Dudugz "If you wanted to": guess i'm rewriting |
22:58:18 | FromDiscord | <Dudugz> You can also work with event emitters + async if you want but yeah... For this kind of thing it doesn't make sense |
22:58:28 | FromDiscord | <huantian> In reply to @Elegantbeef "Use a channel to": yeah having a separate download thread might be a good solution |
23:02:21 | FromDiscord | <Iliketwertles> sent a code paste, see https://play.nim-lang.org/#ix=4pwW |
23:06:45 | * | oprypin quit (Quit: Bye) |
23:06:56 | * | oprypin joined #nim |
23:20:41 | FromDiscord | <Hourglass [She/Her]> In reply to @Hourglass, When the Hour Strikes "Yep, I'm lost, no": Oh yeah I can't actually test anything now but anyone know why? |
23:20:49 | FromDiscord | <Hourglass [She/Her]> Let me get the exact code hold on |
23:23:13 | * | Notxor quit (Remote host closed the connection) |
23:25:27 | FromDiscord | <Hourglass [She/Her]> Relevant lines:↵https://github.com/Nimberite-Development/Nimberite/blob/develop/src/nimberite/plugins/networking/n1_19_3.nim#L121↵https://github.com/Nimberite-Development/Nimberite/blob/develop/src/nimberite/plugins/networking/n1_19_3/parsing.nim#L215-L220 |
23:25:54 | FromDiscord | <Hourglass [She/Her]> My issue is that `socket.send` doesn't seem to send any data to the Minecraft client which is very odd |
23:51:39 | * | jmdaemon quit (Ping timeout: 248 seconds) |
23:52:10 | * | jmdaemon joined #nim |
23:56:39 | * | jmdaemon quit (Ping timeout: 260 seconds) |