00:00:04 | FromDiscord | <dom96> If you can beat httpbeast then that would be awesome, please put it into TechEmpower's framework benchmarks |
00:00:11 | FromDiscord | <dom96> so that we can get Nim to the top |
00:00:31 | FromDiscord | <Varriount> In reply to @leorize "it mentions being 5-15%": I guess my skepticism comes from the fact that I don't see any real difference, on a conceptual level, from closure iterators. |
00:01:05 | FromDiscord | <leorize> try reading some of the examples |
00:01:18 | FromDiscord | <dom96> In reply to @Varriount "I guess my skepticism": yeah, I have the same skepticism. But this has been discussed a lot π |
00:01:34 | FromDiscord | <Varriount> (edit) "a conceptual" => "an ~~conceptual~~ implementation" |
00:01:57 | FromDiscord | <Varriount> Sorry, corrected my statement. |
00:02:21 | FromDiscord | <leorize> closure iterators uses a linear execution path, where in cps, that constraint doesn't exist |
00:02:39 | FromDiscord | <leorize> the goto example is one that demonstrates something you can't replicate with closure iterators |
00:03:54 | FromDiscord | <dom96> sent a long message, see http://ix.io/3quW |
00:04:38 | FromDiscord | <leorize> we are not comparing with closure iterators there, |
00:04:50 | FromDiscord | <Zachary Carter> so could you do something similar to fibers with CPS? |
00:05:06 | FromDiscord | <Zachary Carter> from what I've read so far it sounds like it |
00:05:12 | FromDiscord | <Zachary Carter> but maybe I'm missing something |
00:05:19 | FromDiscord | <leorize> yes, there's an example by zevv |
00:05:19 | FromDiscord | <Varriount> looks at Window's Fiber API |
00:05:25 | FromDiscord | <Zachary Carter> ooooo |
00:05:29 | FromDiscord | <Zachary Carter> I just wrote a fiber based job system |
00:05:52 | FromDiscord | <Zachary Carter> using a deboostified version of boost's context lib |
00:06:01 | FromDiscord | <Zachary Carter> maybe I will need to port it to use CPS |
00:06:14 | FromDiscord | <Zachary Carter> (edit) removed "" |
00:06:17 | FromDiscord | <leorize> hopefully by the end of month we have something to show off to y'all |
00:06:28 | FromDiscord | <Zachary Carter> I'm very excited |
00:06:44 | FromDiscord | <leorize> currently we are starting libraries with cps so we can see what doesn't work to patch it up |
00:06:56 | FromDiscord | <Zachary Carter> dogfooding, love it |
00:06:57 | FromDiscord | <dom96> Huh? Pretty sure you could say async/await is a form of fibers |
00:07:31 | FromDiscord | <leorize> if you're very interested and patient, please go over our chat at [#cps\:matrix.org](https://matrix.to/#/#cps:matrix.org) or #cps on libera.chat |
00:07:39 | FromDiscord | <Zachary Carter> I think you can implement async / await using something like fibers |
00:07:57 | FromDiscord | <Zachary Carter> but generally you use async/await in a single threaded context |
00:08:02 | FromDiscord | <Zachary Carter> fibers you can swap out between threads |
00:08:12 | FromDiscord | <Zachary Carter> and thus are better for CPU bound tasks |
00:08:14 | FromDiscord | <dom96> https://en.wikipedia.org/wiki/Fiber_(computer_science) |
00:08:19 | FromDiscord | <Zachary Carter> yeah it's a green thread I know |
00:08:34 | FromDiscord | <dom96> I'm reading this and it seems to fit the definition |
00:08:40 | FromDiscord | <Elegant Beef> @kashaulmodi well as I want to make a more collection of them OOP macros i did start this repo π https://github.com/beef331/oopsie |
00:08:54 | FromDiscord | <dom96> wikipedia doesn't mention anything about the ability to swap out between system threads |
00:09:03 | FromDiscord | <Elegant Beef> I really just should make repo names at this point |
00:09:04 | FromDiscord | <Zachary Carter> you can pass fibers between threads |
00:09:17 | FromDiscord | <Zachary Carter> fibers don't get scheduled by the OS it's all in user land |
00:09:18 | FromDiscord | <dom96> Even says: "A disadvantage is that fibers cannot utilize multiprocessor machines without also using preemptive threads" |
00:09:51 | FromDiscord | <Varriount> Hm, I think it was a mistake to put both red pepper flakes and ground peppercorn on these potatoes... They are quite space. |
00:09:56 | FromDiscord | <Varriount> (edit) "space." => "spicy." |
00:10:00 | FromDiscord | <dom96> I think fibers are strictly single thread/coroutines |
00:10:24 | FromDiscord | <dom96> In reply to @Varriount "Hm, I think it": Time to increase your tolerance, grab some Hot Ones sauces π |
00:11:19 | FromDiscord | <Zachary Carter> fibers don't really have anything to do with a thread, they just run in the context of one, they have their own stack and environment |
00:11:38 | FromDiscord | <Varriount> Depending on the implementation. |
00:11:42 | FromDiscord | <Zachary Carter> well yes |
00:12:04 | FromDiscord | <Zachary Carter> I'm speaking specifically to the implementation I'm using |
00:12:09 | FromDiscord | <leorize> @Zachary Carter\: https://github.com/disruptek/cps/blob/master/examples/threadpool.nim this sample shows how cps continuations can be moved between threads |
00:12:22 | FromDiscord | <dom96> I think all these terms are quite fuzzy, but in general I try to go off what Wikipedia says π |
00:12:23 | FromDiscord | <Zachary Carter> thanks! |
00:12:37 | FromDiscord | <Zachary Carter> I mean Wikipedia is fine for explaining what a green thread or fiber is |
00:12:52 | FromDiscord | <Zachary Carter> I still don't see how coroutines or async / await would allow you to achieve something similar |
00:13:33 | * | jkl quit (Ping timeout: 265 seconds) |
00:13:57 | FromDiscord | <leorize> if you're interested, come join us. testers are a high priority rn \:) |
00:14:23 | FromDiscord | <dom96> Green threads/Fibers don't enable multi-threading as far as I can tell |
00:14:30 | FromDiscord | <dom96> It's strictly single thread |
00:14:33 | FromDiscord | <Zachary Carter> no they don't |
00:14:39 | FromDiscord | <Zachary Carter> again they don't have anything to do with threads |
00:14:43 | FromDiscord | <Zachary Carter> they just run on a thread |
00:14:51 | FromDiscord | <Zachary Carter> so you can take a fiber that runs on thread a |
00:14:52 | FromDiscord | <Zachary Carter> stop it |
00:14:55 | FromDiscord | <Zachary Carter> and continue it on thread b |
00:15:09 | FromDiscord | <dom96> Is that a property of fibers? |
00:15:18 | FromDiscord | <dom96> I don't see it described on WP |
00:15:21 | FromDiscord | <Zachary Carter> https://github.com/zacharycarter/frag-experiments/blob/main/src/fragpkg/job.nim |
00:15:25 | FromDiscord | <Zachary Carter> if you want to see how it's implemented |
00:15:34 | FromDiscord | <Zachary Carter> https://github.com/zacharycarter/frag-experiments/blob/main/src/fragpkg/fiber.nim |
00:15:38 | FromDiscord | <Zachary Carter> https://github.com/zacharycarter/frag-experiments/tree/main/src/fragpkg/asm |
00:15:55 | FromDiscord | <Zachary Carter> https://www.boost.org/doc/libs/1_70_0/libs/context/doc/html/context/ff.html |
00:18:04 | FromDiscord | <dom96> Looks like the Fibers in the WinAPI does enable the feature, but there doesn't appear to be any authoritative info to say "Fibers must support this to be considered fibers" |
00:18:28 | FromDiscord | <dom96> But anyway, I don't see why resuming a closure iterator on another thread wouldn't be possible with ORC |
00:18:55 | FromDiscord | <dom96> The only limitation with the default GC is that each thread has its own heap, so you'd need to copy memory between threads which would be shit |
00:19:14 | FromDiscord | <dom96> but with ORC all memory can be shared, so why not just continue the iterator on another thread? |
00:19:28 | FromDiscord | <Zachary Carter> In reply to @dom96 "But anyway, I don't": it probably is possible |
00:19:57 | FromDiscord | <Zachary Carter> ORC wasn't really done when I started figuring out how to implement this type of job system |
00:21:07 | FromDiscord | <Zachary Carter> sounds like I have options now aplenty π |
00:21:34 | FromDiscord | <Zachary Carter> leorize: what matrix client do you use? |
00:21:58 | FromDiscord | <leorize> I use Elementβ΅(@Zachary Carter) |
00:22:20 | FromDiscord | <Zachary Carter> thanks |
00:22:30 | FromDiscord | <Varriount> In reply to @dom96 "but with ORC all": Not quite. While there are no more separate heaps, refcount operations aren't atomic. |
00:23:22 | FromDiscord | <dom96> In reply to @Varriount "Not quite. While there": really? Isn't that just a bug though? Otherwise how can we utilise this memory management solution with multiple threads? |
00:23:25 | FromDiscord | <Varriount> So you either need to use the `Isolated[T]` stuff (which hasn't had a thorough real-world test yet, I think), or use unsafe contructs. |
00:23:47 | FromDiscord | <Zachary Carter> I'm fine with using unsafe code |
00:23:59 | FromDiscord | <leorize> the idea is that you move your refs, or use smartptrsβ΅(@dom96Bot) |
00:25:44 | FromDiscord | <dom96> Looks like I need to play with ORC and quiz Araq |
00:25:50 | FromDiscord | <Varriount> In reply to @leorize "the idea is that": You quickly run into a situation similar to the separate-heap stuff though: None of the standard library operations that act on `ref SomeBaseObject` will act on `smartptr[SomeBaseObject]`. |
00:26:09 | FromDiscord | <leorize> yea but we do have base non-ref types |
00:26:33 | FromDiscord | <Varriount> So you then get the fun of reimplementing all the procedures that require the ref types though. |
00:26:41 | FromDiscord | <dom96> what if your closure is accessing data that's been allocated somewhere outside the closure? |
00:27:00 | FromDiscord | <dom96> you need to share that memory somehow |
00:27:11 | FromDiscord | <leorize> and you will need a lock anyway if you access the same piece of data over multiple threads |
00:27:14 | FromDiscord | <dom96> but actually, since that memory is shared you'd lock it anyway |
00:27:21 | FromDiscord | <dom96> so non-atomic refcounts wouldn't be a problem |
00:28:01 | FromDiscord | <Varriount> Really, Nim just needs a standard "pointer" concept. Then `proc foo(x: generic_ref Bar)` could accept `var Bar`, `ref Bar`, `smartptr Bar`, etc. |
00:28:48 | FromDiscord | <Zachary Carter> it can accept all of those |
00:28:50 | FromDiscord | <dom96> so I think closure iterators can be resumed on another thread just fine |
00:28:55 | FromDiscord | <Zachary Carter> you just need to cast them to `pointer` |
00:29:00 | FromDiscord | <Zachary Carter> π |
00:29:17 | FromDiscord | <Zachary Carter> and change `generic_ref Bar` to `pointer` |
00:29:21 | FromDiscord | <Zachary Carter> done |
00:29:38 | FromDiscord | <Varriount> Great. Now my code has `cast`'s everywhere. |
00:30:09 | FromDiscord | <Zachary Carter> who cares |
00:30:11 | FromDiscord | <Zachary Carter> write a template π |
00:30:41 | FromDiscord | <Varriount> This is all just punting a design flaw onto the user though. |
00:31:16 | FromDiscord | <Zachary Carter> I don't really see it as that - I guess the only language where you don't have to rely on unsafe constructs to do systems programming is Rust |
00:31:41 | FromDiscord | <Zachary Carter> and instead you have to do a bunch of other laborious things to ensure you're not doing anything unsafe |
00:31:54 | FromDiscord | <Zachary Carter> and then Rust itself has all sorts of design warts |
00:32:15 | FromDiscord | <Zachary Carter> Ultimately systems programming tends to require, to a degree, unsafe access and manipulation of memory |
00:32:30 | FromDiscord | <Zachary Carter> especially if you're interoping with C/C++ |
00:32:41 | FromDiscord | <Zachary Carter> and want to do low level things like take advantage of multiple threads, etc... |
00:36:18 | FromDiscord | <Zachary Carter> I mean hopefully one day araq and team can make writing multi threaded applications stupid simple, but until then we have opaque pointers, atomics, concurrency primitives and a shared heap π |
00:36:50 | FromDiscord | <Zachary Carter> and move semantics |
00:36:58 | FromDiscord | <Zachary Carter> which don't solve everything |
00:44:15 | * | AnyAny quit (Quit: Leaving) |
00:44:26 | FromDiscord | <Varriount> Though, in many ways, the best way to share memory between threads is to just... not. |
00:45:05 | FromDiscord | <Varriount> I guess `Isolated[T]` helps in that respect. |
00:45:55 | FromDiscord | <Zachary Carter> yeah but that's not always possible right |
00:46:05 | FromDiscord | <Zachary Carter> sometimes you need some shared mutable state |
00:50:23 | FromDiscord | <dan> has anybody ever thought of making the .c file output of the nim compiler a true feature? i feel very hacky when i'm setting the cache directory to the build directory |
00:51:26 | FromDiscord | <Zachary Carter> what do you mean? |
00:52:14 | FromDiscord | <dan> as far as i can tell, the nim compiler supports 2 different forms of output. that is object and linked binary (shared static exe) |
00:52:48 | FromDiscord | <Zachary Carter> the nim compiler supports C/C++/Objective-C and JS as it's forms of output |
00:53:10 | FromDiscord | <dan> whats the flag to output to a .c file? |
00:53:17 | FromDiscord | <Zachary Carter> you can use whatever compiler toolchain you want to compile the resulting code |
00:53:31 | FromDiscord | <Zachary Carter> you need to look in the nimcache directory for the generated C code |
00:53:37 | FromDiscord | <dan> ah yes thats what i meant |
00:53:45 | FromDiscord | <Zachary Carter> yes all the C the Nim compiler produces is there |
00:53:52 | FromDiscord | <Zachary Carter> (or C++ / Objective-C or JS |
00:53:54 | FromDiscord | <Zachary Carter> (edit) "JS" => "JS)" |
00:54:01 | FromDiscord | <dan> so if i want to output that into my build directory, i need to set the cache directory to the build directory |
00:54:10 | FromDiscord | <dan> thats what i meant by "feels hacky" |
00:54:10 | FromDiscord | <Zachary Carter> well... |
00:54:14 | FromDiscord | <Zachary Carter> I mean it's not |
00:54:24 | FromDiscord | <Zachary Carter> Nim compiles your Nim code to C right, then stores it somewhere |
00:54:27 | FromDiscord | <Zachary Carter> "the nimcache" |
00:54:36 | FromDiscord | <Zachary Carter> then it invokes another compiler to compile the C code |
00:55:00 | FromDiscord | <Elegant Beef> Yea, hell it's what i do for the rpi pico stuff i was working on |
00:55:13 | FromDiscord | <Zachary Carter> you're saying you don't want to compile the C code? |
00:55:23 | FromDiscord | <dan> yes exactly |
00:55:24 | FromDiscord | <Elegant Beef> Through the C into the cmake directory so then i can can compile it using the rpi cmake |
00:55:33 | FromDiscord | <Elegant Beef> There is a `-c` flag for that |
00:55:55 | FromDiscord | <Zachary Carter> `-c, --compileOnly:on|off` |
00:56:16 | FromDiscord | <Zachary Carter> just FYI you can also override what compiler Nim uses |
00:56:28 | FromDiscord | <Zachary Carter> so for instance, on windows I use vcc.exe most of the time instead of mingw |
00:56:33 | FromDiscord | <Zachary Carter> although I need to get on clang |
00:56:38 | FromDiscord | <Zachary Carter> anyway, that's neither here nor there |
00:57:13 | FromDiscord | <dan> thats true. i do think there is an argument to be made though, for nim to support c output as a first class feature |
00:57:36 | FromDiscord | <Zachary Carter> it already does |
00:57:47 | FromDiscord | <Zachary Carter> use that flag `-c, --compileOnly:on|off` |
00:57:50 | FromDiscord | <Elegant Beef> Yea as we've demonstrated it does \:D |
00:57:55 | FromDiscord | <Zachary Carter> π |
00:58:02 | FromDiscord | <dan> i am confused now. you do still have to move around the nimcache directory dont you? |
00:58:11 | FromDiscord | <Zachary Carter> you don't have to move any directory around |
00:58:18 | FromDiscord | <Zachary Carter> you have to tell Nim where to put the resulting C code |
00:58:22 | FromDiscord | <Zachary Carter> that is what the nimcache is |
00:58:32 | FromDiscord | <Zachary Carter> by default it's in the user's home directory |
00:58:37 | FromDiscord | <Zachary Carter> so you just need to override this as a compiler option |
00:59:11 | FromDiscord | <dan> yes that is what i meant |
00:59:15 | FromDiscord | <Zachary Carter> what it sounds like you want is for this to be the default mode of compilation |
00:59:19 | FromDiscord | <Zachary Carter> which is never going to happen |
00:59:32 | FromDiscord | <dan> no of course not |
00:59:45 | FromDiscord | <Elegant Beef> Well then just make some config file to do it for you and live hapily |
00:59:52 | FromDiscord | <Zachary Carter> too much of Nim's tooling and stdlib requires this to be the way it is |
01:00:04 | FromDiscord | <Zachary Carter> yeah, if you need help writing the configuration file I'm happy to help π |
01:00:18 | FromDiscord | <Elegant Beef> Like it's a 3 second thing to setup and you can pretend it was always like that |
01:00:51 | FromDiscord | <Zachary Carter> https://nim-lang.org/docs/nimc.html#compiler-usage-generated-c-code-directory |
01:02:10 | FromDiscord | <Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=3qv4 |
01:02:11 | FromDiscord | <dan> i think my main concern is, that nim does not generate a monolithic .c file, like you would specify an object file to the compiler |
01:02:48 | FromDiscord | <dan> and just setting the cache directory somewhere else felt like a crutch |
01:03:27 | FromDiscord | <Zachary Carter> well Nim's C output isn't really mean to appease C developers |
01:03:59 | FromDiscord | <Zachary Carter> it sacrifices human readability and is composed for correctness and performance |
01:04:55 | FromDiscord | <dan> i am no c developer myself ... just a guy with project and build system restrictions who tries to work around all the kinks and stuff π |
01:04:58 | FromDiscord | <dan> thank you anyways |
01:05:15 | FromDiscord | <Zachary Carter> yeah no problem - I know it can be frustrating to work with external build systems with Nim but folks do it, as @ElegantBeef described |
01:05:50 | FromDiscord | <Zachary Carter> I just don't think it's super high priority, but it probably falls under that area of Nim's tooling needs to improve and we don't have enough people to improve it π |
01:06:22 | FromDiscord | <dan> yeah true ... i would like to help, but no way i am competent enough to work on the compiler |
01:07:34 | FromDiscord | <Zachary Carter> most of us aren't π |
01:07:56 | FromDiscord | <dan> just out of interest: if i do happen to go down the route of using the nimcache directory, is there a crossplatform way to get c compiler and linker flags from the nim compiler in a cross platform way? |
01:08:27 | FromDiscord | <dan> totally assuming that nim is requiring special flags here |
01:08:31 | FromDiscord | <Zachary Carter> Nim is only ever going to produce C code for your platform |
01:08:47 | FromDiscord | <Zachary Carter> but you can of course use a cross compile toolchain to target another platform |
01:09:22 | FromDiscord | <dan> i think i phrased that badly. if i compile the c code myself, how would i know which flags nim requires to be passed to the c compiler? |
01:09:31 | FromDiscord | <Zachary Carter> if you look in the generated C files, they will have the command and arguments passed to the compiler frontend |
01:09:41 | FromDiscord | <Zachary Carter> for instance I just opened one up |
01:09:44 | FromDiscord | <Zachary Carter> and at the top in comments it says |
01:09:52 | FromDiscord | <Zachary Carter> / Command for C compiler:β΅ vccexe.exe /c --platform:amd64 /nologo /Zi /I H:\Projects\frag\thirdparty\getopt\include -DWIN32_LEAN_AND_MEAN /I H:\Projects\frag\thirdparty\stb /Zi /FS /Od /IH:\Projects\nim-1.4.8\lib /IH:\Projects\frag\src /nologo /FoC:\Users\carte\nimcache\frag_d\@mfrag.nim.c.obj C:\Users\carte\nimcache\frag_d\@mfrag.nim.c / |
01:10:03 | * | Torr joined #nim |
01:10:07 | FromDiscord | <dan> ooooh very nice, i might be able to parse that! |
01:10:41 | FromDiscord | <dan> if i ever get somewhere, i will post about how i did it |
01:10:53 | FromDiscord | <Zachary Carter> it would be a cool blog post for the "this month with nim" series |
01:10:59 | * | Torr left #nim (#nim) |
01:10:59 | FromDiscord | <leorize> there's a feature to generate json build descriptions for Nim |
01:11:01 | FromDiscord | <Zachary Carter> or just a guest blog post ing eneral |
01:11:05 | FromDiscord | <Zachary Carter> (edit) "ing eneral" => "in general" |
01:11:22 | FromDiscord | <Zachary Carter> In reply to @leorize "there's a feature to": even better |
01:11:28 | FromDiscord | <Zachary Carter> I need to run an errand but I'll be back in a few |
01:12:21 | FromDiscord | <dan> In reply to @leorize "there's a feature to": do you mean jsondoc? |
01:12:26 | FromDiscord | <leorize> so `--compileOnly --nimcache:/where/you/want/your/c/files` |
01:12:42 | FromDiscord | <leorize> then inside the nimcache there's a `.json` file describing how to build |
01:13:25 | FromDiscord | <leorize> it's not advertised but that's what Nim uses internally to bootstrap\: https://github.com/nim-lang/Nim/blob/devel/koch.nim#L320-L326 |
01:13:33 | FromDiscord | <dan> im am going to check that out right now |
01:15:01 | FromDiscord | <Zachary Carter> oh yeah I forgot about that |
01:20:26 | * | dbohdan quit (Read error: Connection reset by peer) |
01:21:13 | * | dbohdan joined #nim |
01:26:28 | * | notzmv joined #nim |
01:28:50 | FromDiscord | <clyybber> and `--genScript` to generate a shell/batch script that invokes gcc and the linker as the nim compiler would |
01:30:04 | * | arkurious quit (Quit: Leaving) |
01:37:48 | * | notzmv quit (Ping timeout: 258 seconds) |
02:05:01 | FromDiscord | <Zachary Carter> oh nice |
02:51:06 | FromDiscord | <exelotl> In reply to @Zachary Carter "what it sounds like": it used to work like that before Nim 0.19 right? |
02:52:45 | FromDiscord | <exelotl> but yeah global nimcache seems to be preferable for most projects, except those where you want access to the C code |
03:06:17 | FromDiscord | <Varriount> Huh, this is interesting. From a book on Windows troubleshooting:β΅> Process IDs and thread IDs are generated from the same namespace, so they never overlap. |
03:06:52 | FromDiscord | <Varriount> I wonder why? |
03:11:05 | FromDiscord | <leorize> maybe because they have threads as their atom |
03:11:20 | FromDiscord | <leorize> in haiku it works in the same way as well |
04:04:45 | FromDiscord | <Zachary Carter> In reply to @exelotl "it used to work": well Nimcache used to be stored in the local directory yeah |
04:05:09 | FromDiscord | <Zachary Carter> but I think what dan wanted was for the C files to be outputted and easily consumed by cmake or some other build tool |
04:32:56 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3qvD |
04:33:18 | FromDiscord | <codic> but then if I run the arc version in gdb it works fine, like the default one |
04:35:38 | FromDiscord | <aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3qvE |
04:36:10 | FromDiscord | <Zafia Reco> i dont think so... |
04:40:35 | * | fputs joined #nim |
04:46:34 | FromDiscord | <Elegant Beef> sent a code paste, see https://paste.rs/45w |
04:48:43 | FromDiscord | <leorize> sent a code paste, see https://play.nim-lang.org/#ix=3qvH |
04:48:47 | FromDiscord | <leorize> the create template is pretty handy |
04:48:58 | FromDiscord | <aleclarson> oo nice. much appreciate \:) |
04:50:31 | FromDiscord | <leorize> [Elegant Beef](https://matrix.to/#/@beef331:matrix.org)\: that might be wrong |
04:50:53 | FromDiscord | <treeform> In reply to @Elegant Beef "You also can use": I think we need to add support for multipart... |
04:51:29 | FromDiscord | <leorize> in here what is allocated is storage space for a proc pointer, so it should be `ptr proc()` |
04:52:08 | FromDiscord | <leorize> (this is why you should always use the create template, it's more correct) |
04:52:18 | FromDiscord | <Elegant Beef> Yea also why you dont try to help when playing a game \:P |
04:53:41 | FromDiscord | <Elegant Beef> Create also is nicer |
05:01:20 | FromDiscord | <aleclarson> @leorize it's unclear how assignment to a `ptr proc` works still |
05:03:02 | FromDiscord | <Elegant Beef> sent a code paste, see https://play.nim-lang.org/#ix=3qvO |
05:03:31 | FromDiscord | <aleclarson> solid, thx Elegant |
05:03:56 | FromDiscord | <Elegant Beef> nimcall is required cause for type's `proc{.closure.}` is the default |
05:05:01 | FromDiscord | <aleclarson> i need a blog to detail this minutiae xD |
05:05:53 | FromDiscord | <Elegant Beef> It's documented here https://nim-lang.org/docs/manual.html#types-procedural-type "A subtle issue..." |
05:10:58 | * | xbello joined #nim |
05:16:37 | FromDiscord | <aleclarson> Oh good, hard to find that in a google search for some reason \:P |
05:17:20 | FromDiscord | <Elegant Beef> Yea the manual's got a lot of information that isnt easily searachable from a search engine |
05:28:00 | FromDiscord | <Varriount> Hm. Anyone feel like this behavior regarding `defer` is... less than useful?β΅> Any statements following the defer in the current block will be considered to be in an implicit try blockβ΅Speaking from experience, Go's `defer` is bit better, as the deferred behavior always occurs at the end of the current routine, not the current block. |
05:30:47 | FromDiscord | <Varriount> sent a code paste, see https://play.nim-lang.org/#ix=3qvS |
05:34:22 | FromDiscord | <leorize> not reallyβ΅(@Varriount) |
05:34:51 | FromDiscord | <leorize> you can always call close on an unopened file/socket |
05:35:39 | FromDiscord | <leorize> also I recommend destroy instead if you're building new apis |
05:36:12 | FromDiscord | <Varriount> So `close(FileHandle(-1))` won't return an error (`-1`)? |
05:38:48 | FromDiscord | <Varriount> (leorize ^) |
05:44:23 | FromDiscord | <Avahe> Is there no sort of 2 way dictionary built-in to the stdlib? |
05:44:40 | FromDiscord | <Avahe> dictionary/table |
05:57:34 | FromDiscord | <Varriount> In reply to @Avahe "Is there no sort": Two-way? Not really. You usually just use two tables. |
06:00:19 | FromDiscord | <Avahe> hm alright, thanks |
06:01:09 | FromDiscord | <Varriount> In reply to @Avahe "hm alright, thanks": For what it's worth, using two regular maps/tables/dictionaries is what all the other two-way implementations I've seen do. |
06:02:02 | FromDiscord | <leorize> yeaβ΅(@Varriount) |
06:02:19 | FromDiscord | <leorize> if you just want pipes and some fd my nim-sys has them |
06:02:27 | FromDiscord | <leorize> properly async too if you need |
06:33:26 | FromDiscord | <dankey> those matrix guys talk a lot |
06:33:35 | FromDiscord | <Elegant Beef> Indeed |
06:39:51 | FromDiscord | <Elegant Beef> @treeform\: i assume you will officially announce nimdocs eventually eh? π |
06:55:24 | * | Vladar joined #nim |
06:58:38 | FromDiscord | <haxscramper> In reply to @dan "i think my main": https://zen.su/posts/amalgamating-nim-programs/ |
07:15:27 | FromDiscord | <treeform> In reply to @Elegant Beef "<@107140179025735680>\: i assume you": It solved my problem... not sure if I want more. |
07:15:28 | FromDiscord | <WhyDee86> Hey,I need help in nimpy. β΅how can I import from\: for example\:from [censys.search](http://censys.search) import CensysHosts in nimpyβ΅let censys = pyImport("from [censys.search](http://censys.search) import CensysHosts")? |
07:17:25 | * | max22- joined #nim |
07:17:51 | max22- | hi |
07:23:04 | * | beshr joined #nim |
07:25:06 | FromDiscord | <haxscramper> I don't think nimpy wraps anything besides `import`, so I would assume you need to first import `censys.search` and then get a class from it |
07:25:42 | FromDiscord | <WhyDee86> ok,thx |
07:33:52 | * | stkrdknmibalz joined #nim |
08:05:19 | * | mikess quit (Ping timeout: 265 seconds) |
08:10:26 | max22- | i have a little question : do local static variables (like in c) exist in nim ? i can't find it in the documentation. i have found the nim static keyword, but it has a different meaning than in c |
08:10:29 | max22- | ? |
08:13:04 | FromDiscord | <ηδ»ηη> Yes! It's just insane! Maybe these channels should have never been bridged!? 1000 messages in a day, really? |
08:13:27 | FromDiscord | <Elegant Beef> If i understand what i briefly read, a C static variable is just `var a {.global.} = 100` for instance |
08:14:15 | FromDiscord | <Elegant Beef> the global pragma initializes it once, but any modifications persist |
08:14:31 | FromDiscord | <Elegant Beef> https://nim-lang.org/docs/manual.html#pragmas-global-pragma |
08:16:00 | * | neceve joined #nim |
08:19:44 | max22- | ok ! thank you Elegant Beef !! |
08:20:39 | FromDiscord | <Varriount> Yay, my shell finally works (again). And with my subprocess modifications too. |
08:20:50 | FromDiscord | <Elegant Beef> Nice |
08:21:57 | FromDiscord | <Rika> whats the selling point of your shell π i wanna know |
09:14:23 | * | jkl joined #nim |
09:22:48 | * | elph joined #nim |
09:34:05 | * | lucerne quit (Remote host closed the connection) |
09:48:41 | FromDiscord | <Varriount> In reply to @Rika "whats the selling point": It's not bash is really the only one.β΅It was the project I chose for an independent study course when I was at university. |
09:48:53 | FromDiscord | <Rika> I see |
09:48:55 | FromDiscord | <Varriount> (edit) "It's" => ""It's" | "bash" => "bash"" |
09:49:28 | FromDiscord | <Varriount> The idea was, "how far can you go using only command syntax" |
09:50:19 | FromDiscord | <Varriount> So assignments, conditional statements, etc. are all commands. |
09:52:21 | * | Epsilon quit (*.net *.split) |
09:53:08 | * | Epsilon joined #nim |
09:56:17 | * | lucerne joined #nim |
09:59:53 | FromDiscord | <Rika> Doesnβt fish basically do that |
09:59:56 | FromDiscord | <Rika> Almost |
10:00:06 | FromDiscord | <Rika> Not completely but itβs close |
10:00:07 | * | Epsilon quit (Ping timeout: 244 seconds) |
10:00:42 | FromDiscord | <Vindaar> In reply to @Varriount "The idea was, "how": doesn't the existence of lisp prove that you don't need fancy syntax? π |
10:10:15 | FromDiscord | <deech> Besides the manual where can I get more info on the `{.cursor.}` pragma? |
10:13:54 | * | Epsilon joined #nim |
10:21:48 | FromDiscord | <planetis> reading the tests and searching github? |
10:25:16 | FromDiscord | <konsumlamm> In reply to @codic "https://hastebin.com/zojokonuwi.php this code works": if it works as expected on default gc, but gives a segfault on arc, it's definitely a bug |
10:32:36 | FromDiscord | <planetis> @deech here https://github.com/planetis-m/dumpster/blob/master/graphs/bfs.nim |
10:35:15 | * | Epsilon quit (Ping timeout: 244 seconds) |
10:35:46 | * | Epsilon joined #nim |
10:43:43 | * | Guest40 joined #nim |
10:45:10 | * | Guest40 left #nim (#nim) |
10:52:52 | * | lucerne quit (Remote host closed the connection) |
10:53:59 | * | lucerne joined #nim |
10:54:03 | * | Epsilon quit (Quit: Quit) |
10:54:18 | * | Epsilon joined #nim |
10:54:55 | * | jkl quit (Ping timeout: 268 seconds) |
11:28:30 | * | arkurious joined #nim |
11:31:12 | * | xbello quit (Ping timeout: 268 seconds) |
11:55:50 | * | max22- quit (Ping timeout: 265 seconds) |
12:01:59 | * | lucerne quit (Remote host closed the connection) |
12:02:58 | * | lucerne joined #nim |
12:19:26 | * | PMunch joined #nim |
12:32:37 | * | fputs quit (Quit: WeeChat 3.2) |
12:33:47 | * | lucerne quit (Remote host closed the connection) |
12:34:50 | * | lucerne joined #nim |
12:39:41 | * | SebastianM joined #nim |
12:48:02 | * | SebastianM quit (Quit: Bye) |
12:51:49 | * | fputs joined #nim |
12:57:40 | * | PMunch quit (Quit: leaving) |
13:13:39 | * | max22- joined #nim |
13:21:51 | * | mikess joined #nim |
13:24:57 | FromDiscord | <dan> In reply to @haxscramper "https://zen.su/posts/amalgamating-nim-programs/": Thats a nice resource. Dragging CIL along as a dependency is hardly practical but I do see the point. Maybe i can do without a monolithic c file as long as i get clear instructions from the nim compiler which flags i need to pass to the c compiler. |
13:27:20 | FromDiscord | <haxscramper> nimcache directory has a `.json` file with all the necessary commands |
13:31:04 | * | neceve quit (Remote host closed the connection) |
13:43:00 | * | Guest5749 joined #nim |
13:44:50 | * | kots joined #nim |
13:46:59 | * | kots quit (Client Quit) |
13:47:16 | * | kots joined #nim |
13:48:37 | FromDiscord | <gogolxdong (liuxiaodong)> Is there any example of parallel computing with vulkan in Nim? |
13:52:46 | * | al1ranger joined #nim |
13:52:52 | FromDiscord | <dan> In reply to @haxscramper "nimcache directory has a": indeed, @leorize pointed me to it. i am working on parsing them right now. unfortunately the json contains only the entire command to pass to the compiler, so im struggling a bit to extract the individual filenames and the flags within the build system |
13:53:33 | FromDiscord | <mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3qyA |
13:54:17 | FromDiscord | <mlokis> (edit) "https://play.nim-lang.org/#ix=3qyA" => "https://play.nim-lang.org/#ix=3qyB" |
13:55:57 | * | al1ranger quit (Client Quit) |
13:57:38 | * | al1ranger joined #nim |
13:58:57 | * | al1ranger quit (Client Quit) |
13:59:47 | FromDiscord | <haxscramper> In reply to @dan "indeed, <@!695851404832538684> pointed me": You can split on spaces or use https://nim-lang.org/docs/parseutils.html#parseUntil%2Cstring%2Cstring%2Cset%5Bchar%5D%2Cint to handle quotes in commands as well (if there any) |
14:00:22 | FromDiscord | <haxscramper> Or look for a command-line parsing library that can work with arbitrary strings |
14:00:33 | FromDiscord | <haxscramper> And use it |
14:02:28 | FromDiscord | <dan> i think splitting by spaces and analyzing the flags is the way to go here. just have to check if my build system puts something in there afterwards that shouldnt be and tedious stuff like that |
14:14:34 | * | Guest5749 quit (Ping timeout: 246 seconds) |
14:16:28 | * | lucerne quit (Read error: Connection reset by peer) |
14:23:53 | FromDiscord | <ITR> trying to use weave with {.noSideEffects}, but getting "invalid pragma: noSideEffects" when I compile it, anybody know how I can get around this? |
14:24:19 | FromDiscord | <ITR> And also {.experimental: "strictFuncs".} |
14:25:41 | FromDiscord | <Rika> version of nim is? |
14:27:16 | FromDiscord | <ITR> Think I messed something up and that it wasn't weave after all |
14:30:05 | FromDiscord | <ITR> ah, I spelled it wrong, I wrote noSideEffects instead of noSideEffect |
14:32:50 | FromDiscord | <ITR> version 1.4.4, I guess "invalid pragma" doesn't really sound like "pragma doesn't exist", maybe a better wording could be in place? A quick search for similar sounding pragmas could be good too, to prevent common misspellings |
14:47:19 | FromDiscord | <konsumlamm> feel free to open an issue: https://github.com/nim-lang/Nim/issues |
14:53:49 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
14:54:49 | federico3 | why I'm not showing up as a Nim backer on bountysource? D-: |
14:55:02 | FromDiscord | <ITR> I'll check if there's a similar one first later, after I finish this project |
14:57:09 | FromDiscord | <ITR> sent a code paste, see https://play.nim-lang.org/#ix=3qyZ |
14:58:50 | * | lucerne joined #nim |
15:01:29 | FromDiscord | <ITR> also happens when removing the echo, realized I forgot to do so in the one I pasted |
15:08:18 | FromDiscord | <vindaar> the side effect here is just the `echo`, no? |
15:09:31 | FromDiscord | <ITR> nope, also happens when echo is removed |
15:09:43 | FromDiscord | <ITR> still nim 1.4.4 |
15:11:41 | FromDiscord | <vindaar> where does `iLoop` come from? |
15:11:59 | FromDiscord | <vindaar> ahh |
15:12:10 | FromDiscord | <vindaar> is that just `weave` syntax to name the loop? |
15:12:20 | FromDiscord | <vindaar> never used those things from `weave` |
15:12:22 | FromDiscord | <ITR> yeah, it's lifted straight from their readme |
15:12:47 | FromDiscord | <ITR> I also tried differently with a regular for loop, but figured it would be better with an example from there |
15:13:10 | FromDiscord | <Vindaar> @mratsim was around earlier |
15:19:38 | FromDiscord | <dom96> In reply to @federico3 "why I'm not showing": federico3: probably best to switch to opencollective by now |
15:19:43 | FromDiscord | <dom96> bountysource is sketchy |
15:19:56 | FromDiscord | <ITR> sent a code paste, see https://play.nim-lang.org/#ix=3qzk |
15:20:13 | federico3 | thanks |
15:23:44 | FromDiscord | <ITR> ah, wait, maybe it's because it calls loadBalance on weave |
15:42:54 | FromDiscord | <deech> How does `{.cursor.}` differ from `{.acyclic.}`? |
15:52:08 | * | Vladar quit (Quit: Leaving) |
15:59:55 | * | mikess quit (Ping timeout: 258 seconds) |
16:30:50 | FromDiscord | <aleclarson> is there a special pragma for circular calls between two `proc`s? |
16:30:59 | FromDiscord | <aleclarson> eg: `a` calls `b` and `b` calls `a` |
16:33:22 | FromDiscord | <Rika> You forward declare one of them |
16:33:50 | FromDiscord | <ITR> how do I fully flatten a seq[seq[seq[T]]], getting an issue when I try concat with seq[seq[T]] & seq[seq[T]]? |
16:36:15 | FromDiscord | <aleclarson> @Rika Of course, thank you! |
16:38:04 | * | stkrdknmibalz joined #nim |
16:39:15 | FromDiscord | <konsumlamm> In reply to @ITR "how do I fully": `concat(concat(s))` should work |
16:44:10 | FromDiscord | <aleclarson> is type narrowing possible with generics? |
16:46:07 | FromDiscord | <Rika> type narrowing? |
16:46:47 | FromDiscord | <Rika> oh you mean type restrictions? |
16:46:53 | FromDiscord | <Rika> yeah if im not misinterpreting |
16:47:16 | FromDiscord | <Rika> `proc someproc[T: int or float](a: T): T = ...` |
16:47:18 | FromDiscord | <ITR> In reply to @konsumlamm "`concat(concat(s))` should work": ty ^^ |
16:47:45 | FromDiscord | <ITR> though it seems that my seq[char] get turned into seq[uint8] when I concat |
16:48:03 | FromDiscord | <aleclarson> In reply to @Rika "`proc someproc[T: int or": lovely, thx again \:) |
16:48:45 | FromDiscord | <codic> In reply to @konsumlamm "if it works as": one might already be open i should take a look maybe |
17:18:16 | FromDiscord | <ynfle (ynfle)> @\_discord\_271498588981297157\:t2bot.io https://nim-lang.org/docs/destructors.html#the-dotcursor-annotation |
17:18:21 | FromDiscord | <ynfle (ynfle)> @deech https://nim-lang.org/docs/destructors.html#the-dotcursor-annotation |
17:21:39 | * | mikess joined #nim |
17:21:40 | FromDiscord | <ynfle (ynfle)> `{.cursor.}` means that this `ref` isn't mine (ie. owned). That means that it an already created object and the shouldn't count as a reference to the object.β΅`{.acyclic.}` means that cyclic check aren't needed because they won't exist.β΅β΅This is understanding |
17:36:52 | * | Vladar joined #nim |
17:39:42 | FromDiscord | <KJ> sent a code paste, see https://play.nim-lang.org/#ix=3qzX |
17:40:03 | FromDiscord | <Rika> import enumerate |
17:40:33 | FromDiscord | <KJ> `Error: cannot open file: enumerate` |
17:40:49 | FromDiscord | <Rika> nim version? |
17:41:16 | FromDiscord | <KJ> sent a code paste, see https://play.nim-lang.org/#ix=3qzY |
17:41:44 | FromDiscord | <Rika> ah, sorry |
17:41:48 | FromDiscord | <Rika> import std/enumerate |
17:42:18 | FromDiscord | <KJ> same error as before |
17:42:25 | FromDiscord | <Rika> update nim |
17:42:33 | FromDiscord | <Rika> your nim is over a year old |
17:42:48 | FromDiscord | <Rika> and is on an unsupported minor version |
17:42:51 | FromDiscord | <KJ> wow |
17:43:00 | FromDiscord | <pointystick> Do you even need enumerate there? https://play.nim-lang.org/#ix=3qzZ |
17:43:22 | FromDiscord | <Rika> not in this case |
17:43:24 | FromDiscord | <Rika> he doesnt |
17:43:35 | FromDiscord | <KJ> In reply to @pointystick "Do you even need": probably not |
17:43:41 | FromDiscord | <Rika> but in other cases (iterable with items() implemented but not pairs()) it would be needed |
17:44:08 | FromDiscord | <Rika> or items() impl'd and pairs() impl'd in a different way (like say an iterable table) |
17:44:08 | FromDiscord | <KJ> that just be coming from python think I need enumerate. Still really new to nim |
17:46:49 | * | SebastianM joined #nim |
17:50:33 | FromDiscord | <Varriount> In reply to @KJ "that just be coming": Enumerate is built-in for most types. `for i, item in sequence:` will work. |
17:52:32 | FromDiscord | <KJ> `pairs() can not iterate a JsonNode of kind JArray`, should I be converting this `JArray` to a sequence? |
17:53:55 | FromDiscord | <KJ> sent a code paste, see https://play.nim-lang.org/#ix=3qA3 |
17:54:07 | FromDiscord | <KJ> (edit) "https://play.nim-lang.org/#ix=3qA3" => "https://play.nim-lang.org/#ix=3qA4" |
17:54:53 | FromDiscord | <randyr> Try: `data["near_earth_objects"].getElems()` |
17:55:28 | FromDiscord | <KJ> that worked, cheers |
17:56:23 | FromDiscord | <randyr> Are exceptions expensive? I'm looking at `std/critbits` right now and there seems to be now way to get some value by key without knowing it exists. `tree["key"]` will throw an exception (and I need to perform this multiple times). I could use `contains`, e.g `if key in tree: tree[key]` but this requires two lookups |
17:56:30 | FromDiscord | <randyr> (edit) "now" => "no" |
17:56:59 | FromDiscord | <randyr> I kinda wished the `rawGet` function were just public |
17:59:06 | * | PMunch joined #nim |
18:00:32 | FromDiscord | <treeform> In reply to @Randall "Are exceptions expensive? I'm": I would recommend timing it yourself if you want to know whats expensive and whats not. |
18:00:45 | FromDiscord | <randyr> True. |
18:01:08 | FromDiscord | <treeform> In my mind exceptions are not... but that could be wrong. |
18:01:10 | FromDiscord | <randyr> It doesn't seem like critbrits can be compiled to a const tho |
18:02:33 | FromDiscord | <randyr> A bit more context: I'm trying to parse HTML entities, which is a map of ~2200 strings to strings. I'm looking for an efficient way to find the longest matching string (not longest prefix, it has to actually match one the entities). I figured critbits would be a decent solution to this, but I'm not sure yet |
18:02:54 | * | mikess left #nim (#nim) |
18:04:17 | * | lucerne quit (Read error: Connection reset by peer) |
18:08:53 | PMunch | Ooh neat, the channel has moved over to Libera now? |
18:09:23 | FromDiscord | <planetis> i wonder if catching all is faster than except ValueError |
18:09:44 | FromDiscord | <planetis> oh there is PMunch were have you been? |
18:10:02 | PMunch | Mandatory military training exercise :P |
18:10:14 | PMunch | Since last Monday |
18:12:18 | FromDiscord | <planetis> cool that sounds fun |
18:12:38 | PMunch | Yeah it is pretty fun |
18:12:52 | PMunch | Nice to do something completely different for a couple of days |
18:15:17 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I know you can overload `[]` |
18:15:38 | FromDiscord | <@bracketmaster-5a708063d73408ce4> what if I'm trying to do `foo[4] = barr` |
18:15:54 | FromDiscord | <@bracketmaster-5a708063d73408ce4> how can I overload index and assign? |
18:16:03 | FromDiscord | <randyr> `[]=` |
18:16:15 | * | SebastianM quit (Quit: Bye) |
18:16:20 | PMunch | Oh neat, irclogs is updated as well, and with my new colour scheme :) |
18:16:42 | FromDiscord | <@bracketmaster-5a708063d73408ce4> thanks @\_discord\_135818050027913216\:t2bot.io |
18:17:06 | PMunch | And the json output :D |
18:20:59 | FromDiscord | <hamidb80> hey |
18:22:07 | FromDiscord | <hamidb80> i think `hashSet` doesn't work |
18:22:35 | FromDiscord | <hamidb80> and also nim playground π |
18:23:01 | FromDiscord | <hamidb80> https://play.nim-lang.org/#ix=3qAf |
18:23:20 | FromDiscord | <hamidb80> shoudn't color of the `Bag` be unique? |
18:23:37 | FromDiscord | <hamidb80> i declared `hash` function for it |
18:25:00 | FromDiscord | <hamidb80> (edit) "shoudn't color of the `Bag` be unique? ... " added "and the output be just the first `Bag` ?" |
18:28:11 | FromDiscord | <dom96> In reply to @PMunch "Oh neat, irclogs is": Yeah. It looks awesome π |
18:28:37 | FromDiscord | <dom96> I posted a blog article on Nimβs website as well in case you havenβt seen it about the move |
18:28:48 | PMunch | Thanks :) It's just based on the Dracula colour scheme that is used for the playground and the website for snippets |
18:29:16 | PMunch | Oh the website has been updated as well |
18:31:17 | PMunch | Oh and Telegram is now linked to he main channel? |
18:32:37 | FromDiscord | <hamidb80> In reply to @hamidb80 "shoudn't color of the": ? |
18:35:00 | FromDiscord | <Bung> https://play.nim-lang.org/#ix=3qAg |
18:35:19 | FromDiscord | <Bung> you should add duplicated item to see what happens |
18:36:01 | PMunch | But he implemented a hash function for Bag that should only take into account the colour.. |
18:36:32 | FromDiscord | <dom96> In reply to @PMunch "Oh and Telegram is": Yep |
18:36:53 | PMunch | Ah right, you need on `==` proc as well for sets to behave like you expect |
18:37:50 | PMunch | How's that going? The Telegram chat always felt a bit different from the other communities |
18:37:53 | FromDiscord | <Bung> that's werid, dont know the internal , the hash function dont right, but result looks right |
18:39:04 | PMunch | Like this: https://play.nim-lang.org/#ix=3qAi |
18:39:49 | FromDiscord | <hamidb80> In reply to @PMunch "Like this: https://play.nim-lang.org/#ix=3qAi": thanks |
18:40:11 | FromDiscord | <hamidb80> i think the `HashSet` should consider hashed value |
18:40:16 | FromDiscord | <hamidb80> (edit) "i think the `HashSet` should consider hashed value ... " added "only" |
18:40:19 | FromDiscord | <Bung> guess only hash func not right need implements `==` |
18:41:48 | FromDiscord | <Matt Rusiniak> hello from telegram. it is weird here now. we used to get spam bots and the odd question and the cat memes. no memes coming from discord it seems. |
18:42:18 | PMunch | Yeah I remember the Telegram chat was always a bit more meme heavy than the other channels |
18:42:37 | PMunch | Didn't know about the spam bots though :P |
18:49:49 | FromDiscord | <Matt Rusiniak> they get dealt with quickly \:) |
18:51:45 | FromDiscord | <niv> hello. is there a timeline on when the next nim build releases? specifically looking for native apple m1 support, which the forum promised will be part of that |
18:55:21 | FromDiscord | <zetashift> In reply to @niv "hello. is there": https://nim-lang.org/blog/2021/05/25/version-148-released.html you should be able to use 1.4.8 already on m1 |
18:56:04 | FromDiscord | <niv> i am, but it runs in rosetta mode and that is more painful than it needs to be since im linking a bunch of native code |
18:56:12 | * | clemens3 left #nim (WeeChat 2.7) |
18:56:42 | * | lucerne joined #nim |
18:56:52 | FromDiscord | <niv> it works, im just impatient ;) |
19:09:01 | FromDiscord | <hamidb80> in order to use "devel" version, do i have to build the compiler manually or the precompiled version exists in somewhere? |
19:09:14 | FromDiscord | <hamidb80> (edit) removed "in" |
19:10:02 | FromDiscord | <πππππππππππ> choosenim devel |
19:10:29 | FromDiscord | <πππππππππππ> That would download and select devel version of the compiler/toolchain |
19:20:46 | * | lucerne quit (Remote host closed the connection) |
19:21:51 | * | lucerne joined #nim |
19:26:30 | FromDiscord | <niv> In reply to @zetashift "https://nim-lang.org/blog/2021/05/25/version-148-re": thanks, figured it out. i was installing it via choosenim, which forced x64. compiling 1.4.8 manually gives me native binaries |
19:26:53 | FromDiscord | <niv> and they're very fast, nice |
19:28:14 | FromDiscord | <@bracketmaster-5a708063d73408ce4> how do you get the max value a type such as int32 can hold in nim? |
19:33:26 | FromDiscord | <randyr> `int32.high` |
19:39:11 | * | lucerne quit (Read error: Connection reset by peer) |
19:48:26 | * | lucerne joined #nim |
19:53:35 | FromDiscord | <ITR> I hate when libraries go, like, "This string needs to be which algorithm you want to use" then don't list which algorithms are available :| |
19:55:16 | FromDiscord | <@bracketmaster-5a708063d73408ce4> @\_discord\_135818050027913216\:t2bot.io , thx |
19:59:21 | PMunch | @ITR, that does indeed suck |
20:04:39 | FromDiscord | <dom96> yeah, we need an m1 choosenim π |
20:07:47 | federico3 | dom96: switched to opencollective :) |
20:08:09 | FromDiscord | <dom96> awesome π |
20:16:11 | FromDiscord | <gerwy> dom96, i will try to make my teacher make us learn about nim, or at least make a lesson about it (as a metaprogramming topic for example) |
20:17:24 | FromDiscord | <ITR> is there a hyperneat implementation in nim? |
20:19:07 | FromDiscord | <dom96> In reply to @Life Sucks "dom96, i will try": brilliant, happy to help any way I can, feel free to put me in touch with your teacher |
20:20:47 | FromDiscord | <gerwy> well if he agrees, he is pretty strict about our learning material (he teached us github only recently because we didn't get time for that, after 2 years of learning coding)β΅and also its the end of the school for me, so need to wait for it after holidays |
20:20:50 | PMunch | Ditto! I've been wanting to make a meta-programming course for a while |
20:21:24 | FromDiscord | <Elegant Beef> Damn pmunch we're in the same boat π |
20:21:50 | FromDiscord | <Ξ»π‘> N |
20:21:58 | * | Guest37 joined #nim |
20:22:01 | FromDiscord | <Elegant Beef> I do think a teacher is actually teaching Nim to their class considering the amount of Nim repo's with similar code/logic |
20:22:16 | FromDiscord | <Elegant Beef> lambda fish, interesting name |
20:22:26 | FromDiscord | <Elegant Beef> Is that turbofish's cousin? |
20:22:34 | PMunch | @Elegant, example? |
20:22:37 | FromDiscord | <gerwy> We have Python in our learning plan, so i guess after we learn it (i already know it) we could make some lessons about Nim, because of the similarities and try to use C++ libraries we already know with it |
20:23:23 | FromDiscord | <Elegant Beef> Example of those repos? |
20:23:29 | PMunch | Yeah |
20:27:08 | FromDiscord | <Sochika Basil> image.jpeg https://media.discordapp.net/attachments/371759389889003532/856268952991694909/image.jpeg |
20:28:27 | FromDiscord | <Victoria Guevara> Guise. How about making chat useable again ? |
20:28:40 | FromDiscord | <Elegant Beef> I cannot find it atm pmunch |
20:28:59 | PMunch | Hmm, bummer |
20:29:08 | PMunch | And @Victoria, what do you mean by useable? |
20:29:41 | FromDiscord | <Elegant Beef> There were a few repo's with very similar code so then i read the forum that someone was teaching Nim, so assumed they were related |
20:30:41 | FromDiscord | <Elegant Beef> https://github.com/nim-lang/Nim/pull/18267#discussion_r651737117 |
20:30:49 | FromDiscord | <Elegant Beef> Close enough π |
20:30:52 | FromDiscord | <gerwy> i mean, the problem is that teacher doesn't know Nim ,so its harder to teach it if you don't know itβ΅but i can help hehe, i don't know it that well but i can learn along with classmates and i have some projects i want to make in Nim |
20:32:14 | FromDiscord | <Elegant Beef> "some" is an odd way to write "all" |
20:32:16 | FromDiscord | <dom96> ask them to learn it over the summer π |
20:32:17 | PMunch | Aah, it's Ziatom teaching |
20:33:24 | * | Guest37 quit (Quit: Client closed) |
20:33:40 | FromDiscord | <gerwy> In reply to @dom96 "ask them to learn": i can try to make one friend learn it, but the problem is... that we had horrible teacher which made everyone in class hate python and they can kinda associate it with it |
20:34:24 | FromDiscord | <Elegant Beef> Well good that they hate python, that's the first step |
20:34:34 | FromDiscord | <gerwy> noo why :< |
20:35:03 | FromDiscord | <Elegant Beef> Well I hate python but ended up here, so has to be relation right? π |
20:35:30 | FromDiscord | <gerwy> i could try to explain to teacher that using nim could make learning algorithms easier β΅But unfortunately we need to learn those languages that we will have on the final exam |
20:35:52 | FromDiscord | <gerwy> In reply to @Elegant Beef "Well I hate python": well... i love python and i ended up here, so it probably has no relation |
20:36:16 | FromDiscord | <dom96> Tell the teacher it's a great way to teach some compiler concepts, i.e. with metaprogramming you learn about the AST which is the building block of all compilers |
20:36:17 | federico3 | making people hate Python is quite difficult |
20:37:12 | FromDiscord | <gerwy> Ooooh its too earlier for them to learn compiler stuff hahaβ΅they learned OOP like month ago |
20:37:59 | FromDiscord | <Elegant Beef> See learning OOP they're a lost cause... maybe i'll eventually quit joking around today |
20:37:59 | FromDiscord | <Elegant Beef> Maybe it's just time before you see the light π |
20:38:01 | FromDiscord | <gerwy> In reply to @federico3 "making people hate Python": yeah exactly, but that guy was horrible and he doesn't teach us anymore, but that left a bad taste to python for them |
20:38:46 | FromDiscord | <gerwy> also the teacher is fun of C# and thinks it should be first language, soo it can be even harder |
20:39:46 | FromDiscord | <gerwy> (edit) "fun" => "fan" |
20:40:13 | FromDiscord | <Elegant Beef> Hmmm is there a way to make a typedesc for only inherited objects, dont suppose a concept would work |
20:40:21 | FromDiscord | <gerwy> ugh im making so many typos today... its probably from the heat, it was 37C today |
20:45:32 | FromDiscord | <Elegant Beef> Hmm, dont know if that'd work will have to try |
20:45:32 | FromDiscord | <vindaar> you can make a concept that calls a macro that performs checks on the type. Maybe that way you can check for that |
20:45:35 | FromDiscord | <vindaar> I do that here\: https://github.com/SciNim/Unchained/blob/master/src/unchained/units.nim#L326-L346 |
20:45:45 | FromDiscord | <Elegant Beef> Right now i'm using `ref object` for this oop library, so that's sweet |
20:46:05 | FromDiscord | <Elegant Beef> Well thanks for that, makes this more idiot proof |
21:00:18 | FromDiscord | <Hugo Ribeiro> From my perspective it's flooded https://m.youtube.com/watch?v=gTv7rijY2Vgβ΅(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
21:05:36 | FromDiscord | <dom96> I guess you preferred no bridge to Discord? |
21:05:56 | FromDiscord | <Bung> how to profile a web server ? |
21:05:59 | FromDiscord | <Dominik Picheta (dom96)> Is it not useable with the bridge? |
21:10:29 | PMunch | Certainly a lot more traffic with the IRC/Discord community added to the Telegram one |
21:27:43 | FromDiscord | <Varriount> Can anyone recommend a C library that is likely to have the most understandable source code? |
21:28:01 | FromDiscord | <Elegant Beef> Hello world |
21:28:01 | FromDiscord | <randyr> Maybe Redis? |
21:28:05 | FromDiscord | <Varriount> (C standard library) |
21:28:15 | FromDiscord | <randyr> musl? |
21:29:36 | FromDiscord | <Varriount> In reply to @Randall "musl?": Thanks! This is actually quite understandable: https://github.com/bminor/musl/blob/cfdfd5ea3ce14c6abf7fb22a531f3d99518b5a1b/src/process/posix_spawn.c |
21:31:52 | FromDiscord | <Varriount> Anyone know what reasonable platforms might not have posix_spawn available? |
21:32:19 | FromDiscord | <Varriount> I'm trying to determine if it's worth re-implementing posix_spawn in Nim for this subprocess module. |
21:33:23 | FromDiscord | <Elegant Beef> I feel like that's gotta be a rather common implemented procedure, but speaking out my arse here |
21:34:02 | FromDiscord | <Varriount> Hm... I think I'll leave it up to whoever actually needs to use a platform without it first. |
21:34:16 | FromDiscord | <Elegant Beef> Anyone got any more bright ideas to add to oopsie? https://nimdocs.com/beef331/oopsie/oopsie.html |
21:35:07 | * | lucerne quit (Remote host closed the connection) |
21:36:18 | * | lucerne joined #nim |
21:36:24 | FromDiscord | <Varriount> What is it? |
21:36:34 | FromDiscord | <Elegant Beef> An oop helper library |
21:36:42 | FromDiscord | <Bung> looks cool |
21:37:23 | FromDiscord | <Bung> can copy use `=` instead? |
21:37:25 | FromDiscord | <Varriount> How does `inherits` work? |
21:37:27 | FromDiscord | <Elegant Beef> I did want to add a `base` or similar which would convert it to the underlying type from a parent type, but that was prohibitively ugly to solve |
21:37:52 | FromDiscord | <Elegant Beef> AST traversal of the typedef |
21:38:21 | FromDiscord | <Victoria Guevara> I will probably pass. |
21:38:58 | FromDiscord | <Varriount> In reply to @Elegant Beef "AST traversal of the": Sorry, I mean, how does one use it? |
21:39:41 | FromDiscord | <Elegant Beef> `if a.inherits: echo "This object inherits"` it's mostly just for the concept but it seemed like it could help being exported |
21:40:24 | FromDiscord | <Elegant Beef> I suppose `when a.inherits` makes more sense |
21:41:05 | FromDiscord | <Elegant Beef> Although I could export the concept so it's `when a is Inherits` |
21:41:35 | FromDiscord | <Elegant Beef> So ya dom, better cutoff the telegram people and maybe make a secondary "bridged nim" channel they can opt into if they want π |
21:43:59 | FromDiscord | <Dominik Picheta (dom96)> Why? |
21:44:42 | FromDiscord | <Elegant Beef> I dont know if it can, overriding `=` has a strict set of rules afaikβ΅(@Bung) |
21:45:47 | FromDiscord | <Elegant Beef> `Error: signature for '=' must be proc[T: object](x: var T; y: T)` |
21:46:32 | PMunch | It's been a different community for what, 2-3 years now? Feels a bit weird to just suddenly merge them with this channel |
21:47:09 | FromDiscord | <Elegant Beef> Yea atleast forcefully, like i suggested prior to the merge probably best to make a bridge/unbridged channel |
21:47:49 | FromDiscord | <Elegant Beef> I can understand why they wouldnt want to be apart of this, afterall i'm here |
21:48:33 | PMunch | I thought about suggesting to merge them when Discord was added, but decided against it myself because they feel like separate communities |
21:48:39 | FromDiscord | <gavr> what??? |
21:48:40 | FromDiscord | <gavr> image.jpeg https://media.discordapp.net/attachments/371759389889003532/856289475352854548/image.jpeg |
21:48:52 | FromDiscord | <gavr> sent a code paste, see https://play.nim-lang.org/#ix=3qB6 |
21:48:55 | FromDiscord | <Elegant Beef> `flags` |
21:49:00 | FromDiscord | <gavr> ou, hmm |
21:49:02 | FromDiscord | <Elegant Beef> do {} around your flag |
21:49:28 | FromDiscord | <Elegant Beef> Atleast i assume it's a alias for `set[FileCopyFlag]` |
21:49:28 | FromDiscord | <gavr> thanks! |
21:50:12 | FromDiscord | <gavr> do u also code gtk apps on nim? |
21:50:18 | FromDiscord | <Elegant Beef> Nope |
21:50:25 | FromDiscord | <Elegant Beef> I make games and libraries no one touches |
21:50:57 | FromDiscord | <Elegant Beef> Sorry i lied, pmunch touches my game |
21:51:17 | PMunch | I touch them real good |
21:51:55 | FromDiscord | <Elegant Beef> Who else would, you're the only one here that can stand me π |
21:52:05 | PMunch | @gavr, I guess that was just a lucky guess from Elegant, flags are typically represented by sets, so for Flag vs. Flags it was a good guess |
21:52:19 | PMunch | I am? |
21:52:31 | FromDiscord | <Elegant Beef> There is no luck involved! |
21:52:50 | PMunch | Haven't played Linerino in quite a while though, any new cool stuff I've missed? |
21:52:55 | FromDiscord | <Elegant Beef> I used my skills to paint a picture that assumed whoever made that library writes good code |
21:53:29 | FromDiscord | <Elegant Beef> Uhh it's mostly "done" so havent done much but added a few more handcrafted levels in a while, was unmotivated for a while, but started on a new game recently |
21:53:43 | FromDiscord | <Elegant Beef> But again havent worked on that new game for a while but it's another fun/cute puzzle game |
21:53:44 | PMunch | Oh cool, what kind? |
21:53:53 | PMunch | Ah right, neat |
21:54:35 | FromDiscord | <Elegant Beef> If you want to see a level being played https://streamable.com/xx0y93 |
21:54:45 | PMunch | I was actually thinking about doing a small game/simulation as a teaching aid for military maneuvers after the exercise I took part of last week |
21:56:03 | FromDiscord | <Elegant Beef> The biggest worry i have with this new project is that the puzzles arent difficult enough, but i havent made many levels cause it takes time and hell i spent like 30mins to an hour on the first "complex" level |
21:56:22 | PMunch | Aah, like a mix of Tetris and Linerino |
21:56:50 | FromDiscord | <Elegant Beef> military exercize... interesting |
21:57:16 | FromDiscord | <Elegant Beef> Shh dont mention tetris that's how a lawsuit appears |
21:57:36 | PMunch | I mean that's the great thing about Linerino which was a huge inspiration for my SeiΓ°r game, just create an algorithm that can easily create a challenge and then find complex patterns through playing those |
21:57:43 | FromDiscord | <Elegant Beef> They wouldnt get any money but it'd be cool, i'd have a poster from "the tetris company" |
21:58:07 | FromDiscord | <Elegant Beef> Yea linerinos procgen is deceptively intelligent |
21:58:09 | * | Vladar quit (Quit: Leaving) |
21:58:23 | PMunch | Yeah we have a system of mandatory military training, which starts with a full year, then yearly exercises until you're something like 43 |
21:58:46 | FromDiscord | <Elegant Beef> Interesting |
21:59:31 | PMunch | I mean SeiΓ°r is literally just create a random board and then remove pieces to create a puzzle :P |
21:59:36 | FromDiscord | <Elegant Beef> Had to check and yea the level generation itself is \~100 loc |
21:59:38 | PMunch | It's really quite simple |
22:00:17 | FromDiscord | <Elegant Beef> Yea i mean i just drunken walk with linerino, always starting in the center with some rules for special tiles and where you should walk |
22:00:40 | FromDiscord | <Elegant Beef> I think one of my rules is like "Dont walk to any tile that has 2 neighjbours" |
22:40:39 | FromDiscord | <Bung> @ElegantBeef then copy is fine . |
23:14:55 | * | max22- quit (Remote host closed the connection) |
23:18:18 | saem[m] | anyone know how to get typed varargs working with a conversion proc? https://play.nim-lang.org/#ix=3qBq |
23:19:41 | saem[m] | d'oh, wrong one |
23:19:49 | * | PMunch quit (Quit: leaving) |
23:31:16 | * | vicfred quit (Quit: Leaving) |