<< 20-06-2021 >>

00:00:04FromDiscord<dom96> If you can beat httpbeast then that would be awesome, please put it into TechEmpower's framework benchmarks
00:00:11FromDiscord<dom96> so that we can get Nim to the top
00:00:31FromDiscord<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:05FromDiscord<leorize> try reading some of the examples
00:01:18FromDiscord<dom96> In reply to @Varriount "I guess my skepticism": yeah, I have the same skepticism. But this has been discussed a lot πŸ™‚
00:01:34FromDiscord<Varriount> (edit) "a conceptual" => "an ~~conceptual~~ implementation"
00:01:57FromDiscord<Varriount> Sorry, corrected my statement.
00:02:21FromDiscord<leorize> closure iterators uses a linear execution path, where in cps, that constraint doesn't exist
00:02:39FromDiscord<leorize> the goto example is one that demonstrates something you can't replicate with closure iterators
00:03:54FromDiscord<dom96> sent a long message, see http://ix.io/3quW
00:04:38FromDiscord<leorize> we are not comparing with closure iterators there,
00:04:50FromDiscord<Zachary Carter> so could you do something similar to fibers with CPS?
00:05:06FromDiscord<Zachary Carter> from what I've read so far it sounds like it
00:05:12FromDiscord<Zachary Carter> but maybe I'm missing something
00:05:19FromDiscord<leorize> yes, there's an example by zevv
00:05:19FromDiscord<Varriount> looks at Window's Fiber API
00:05:25FromDiscord<Zachary Carter> ooooo
00:05:29FromDiscord<Zachary Carter> I just wrote a fiber based job system
00:05:52FromDiscord<Zachary Carter> using a deboostified version of boost's context lib
00:06:01FromDiscord<Zachary Carter> maybe I will need to port it to use CPS
00:06:14FromDiscord<Zachary Carter> (edit) removed ""
00:06:17FromDiscord<leorize> hopefully by the end of month we have something to show off to y'all
00:06:28FromDiscord<Zachary Carter> I'm very excited
00:06:44FromDiscord<leorize> currently we are starting libraries with cps so we can see what doesn't work to patch it up
00:06:56FromDiscord<Zachary Carter> dogfooding, love it
00:06:57FromDiscord<dom96> Huh? Pretty sure you could say async/await is a form of fibers
00:07:31FromDiscord<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:39FromDiscord<Zachary Carter> I think you can implement async / await using something like fibers
00:07:57FromDiscord<Zachary Carter> but generally you use async/await in a single threaded context
00:08:02FromDiscord<Zachary Carter> fibers you can swap out between threads
00:08:12FromDiscord<Zachary Carter> and thus are better for CPU bound tasks
00:08:14FromDiscord<dom96> https://en.wikipedia.org/wiki/Fiber_(computer_science)
00:08:19FromDiscord<Zachary Carter> yeah it's a green thread I know
00:08:34FromDiscord<dom96> I'm reading this and it seems to fit the definition
00:08:40FromDiscord<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:54FromDiscord<dom96> wikipedia doesn't mention anything about the ability to swap out between system threads
00:09:03FromDiscord<Elegant Beef> I really just should make repo names at this point
00:09:04FromDiscord<Zachary Carter> you can pass fibers between threads
00:09:17FromDiscord<Zachary Carter> fibers don't get scheduled by the OS it's all in user land
00:09:18FromDiscord<dom96> Even says: "A disadvantage is that fibers cannot utilize multiprocessor machines without also using preemptive threads"
00:09:51FromDiscord<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:56FromDiscord<Varriount> (edit) "space." => "spicy."
00:10:00FromDiscord<dom96> I think fibers are strictly single thread/coroutines
00:10:24FromDiscord<dom96> In reply to @Varriount "Hm, I think it": Time to increase your tolerance, grab some Hot Ones sauces πŸ˜„
00:11:19FromDiscord<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:38FromDiscord<Varriount> Depending on the implementation.
00:11:42FromDiscord<Zachary Carter> well yes
00:12:04FromDiscord<Zachary Carter> I'm speaking specifically to the implementation I'm using
00:12:09FromDiscord<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:22FromDiscord<dom96> I think all these terms are quite fuzzy, but in general I try to go off what Wikipedia says πŸ™‚
00:12:23FromDiscord<Zachary Carter> thanks!
00:12:37FromDiscord<Zachary Carter> I mean Wikipedia is fine for explaining what a green thread or fiber is
00:12:52FromDiscord<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:57FromDiscord<leorize> if you're interested, come join us. testers are a high priority rn \:)
00:14:23FromDiscord<dom96> Green threads/Fibers don't enable multi-threading as far as I can tell
00:14:30FromDiscord<dom96> It's strictly single thread
00:14:33FromDiscord<Zachary Carter> no they don't
00:14:39FromDiscord<Zachary Carter> again they don't have anything to do with threads
00:14:43FromDiscord<Zachary Carter> they just run on a thread
00:14:51FromDiscord<Zachary Carter> so you can take a fiber that runs on thread a
00:14:52FromDiscord<Zachary Carter> stop it
00:14:55FromDiscord<Zachary Carter> and continue it on thread b
00:15:09FromDiscord<dom96> Is that a property of fibers?
00:15:18FromDiscord<dom96> I don't see it described on WP
00:15:21FromDiscord<Zachary Carter> https://github.com/zacharycarter/frag-experiments/blob/main/src/fragpkg/job.nim
00:15:25FromDiscord<Zachary Carter> if you want to see how it's implemented
00:15:34FromDiscord<Zachary Carter> https://github.com/zacharycarter/frag-experiments/blob/main/src/fragpkg/fiber.nim
00:15:38FromDiscord<Zachary Carter> https://github.com/zacharycarter/frag-experiments/tree/main/src/fragpkg/asm
00:15:55FromDiscord<Zachary Carter> https://www.boost.org/doc/libs/1_70_0/libs/context/doc/html/context/ff.html
00:18:04FromDiscord<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:28FromDiscord<dom96> But anyway, I don't see why resuming a closure iterator on another thread wouldn't be possible with ORC
00:18:55FromDiscord<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:14FromDiscord<dom96> but with ORC all memory can be shared, so why not just continue the iterator on another thread?
00:19:28FromDiscord<Zachary Carter> In reply to @dom96 "But anyway, I don't": it probably is possible
00:19:57FromDiscord<Zachary Carter> ORC wasn't really done when I started figuring out how to implement this type of job system
00:21:07FromDiscord<Zachary Carter> sounds like I have options now aplenty πŸ™‚
00:21:34FromDiscord<Zachary Carter> leorize: what matrix client do you use?
00:21:58FromDiscord<leorize> I use Element↡(@Zachary Carter)
00:22:20FromDiscord<Zachary Carter> thanks
00:22:30FromDiscord<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:22FromDiscord<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:25FromDiscord<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:47FromDiscord<Zachary Carter> I'm fine with using unsafe code
00:23:59FromDiscord<leorize> the idea is that you move your refs, or use smartptrs↡(@dom96Bot)
00:25:44FromDiscord<dom96> Looks like I need to play with ORC and quiz Araq
00:25:50FromDiscord<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:09FromDiscord<leorize> yea but we do have base non-ref types
00:26:33FromDiscord<Varriount> So you then get the fun of reimplementing all the procedures that require the ref types though.
00:26:41FromDiscord<dom96> what if your closure is accessing data that's been allocated somewhere outside the closure?
00:27:00FromDiscord<dom96> you need to share that memory somehow
00:27:11FromDiscord<leorize> and you will need a lock anyway if you access the same piece of data over multiple threads
00:27:14FromDiscord<dom96> but actually, since that memory is shared you'd lock it anyway
00:27:21FromDiscord<dom96> so non-atomic refcounts wouldn't be a problem
00:28:01FromDiscord<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:48FromDiscord<Zachary Carter> it can accept all of those
00:28:50FromDiscord<dom96> so I think closure iterators can be resumed on another thread just fine
00:28:55FromDiscord<Zachary Carter> you just need to cast them to `pointer`
00:29:00FromDiscord<Zachary Carter> πŸ™‚
00:29:17FromDiscord<Zachary Carter> and change `generic_ref Bar` to `pointer`
00:29:21FromDiscord<Zachary Carter> done
00:29:38FromDiscord<Varriount> Great. Now my code has `cast`'s everywhere.
00:30:09FromDiscord<Zachary Carter> who cares
00:30:11FromDiscord<Zachary Carter> write a template πŸ™‚
00:30:41FromDiscord<Varriount> This is all just punting a design flaw onto the user though.
00:31:16FromDiscord<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:41FromDiscord<Zachary Carter> and instead you have to do a bunch of other laborious things to ensure you're not doing anything unsafe
00:31:54FromDiscord<Zachary Carter> and then Rust itself has all sorts of design warts
00:32:15FromDiscord<Zachary Carter> Ultimately systems programming tends to require, to a degree, unsafe access and manipulation of memory
00:32:30FromDiscord<Zachary Carter> especially if you're interoping with C/C++
00:32:41FromDiscord<Zachary Carter> and want to do low level things like take advantage of multiple threads, etc...
00:36:18FromDiscord<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:50FromDiscord<Zachary Carter> and move semantics
00:36:58FromDiscord<Zachary Carter> which don't solve everything
00:44:15*AnyAny quit (Quit: Leaving)
00:44:26FromDiscord<Varriount> Though, in many ways, the best way to share memory between threads is to just... not.
00:45:05FromDiscord<Varriount> I guess `Isolated[T]` helps in that respect.
00:45:55FromDiscord<Zachary Carter> yeah but that's not always possible right
00:46:05FromDiscord<Zachary Carter> sometimes you need some shared mutable state
00:50:23FromDiscord<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:26FromDiscord<Zachary Carter> what do you mean?
00:52:14FromDiscord<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:48FromDiscord<Zachary Carter> the nim compiler supports C/C++/Objective-C and JS as it's forms of output
00:53:10FromDiscord<dan> whats the flag to output to a .c file?
00:53:17FromDiscord<Zachary Carter> you can use whatever compiler toolchain you want to compile the resulting code
00:53:31FromDiscord<Zachary Carter> you need to look in the nimcache directory for the generated C code
00:53:37FromDiscord<dan> ah yes thats what i meant
00:53:45FromDiscord<Zachary Carter> yes all the C the Nim compiler produces is there
00:53:52FromDiscord<Zachary Carter> (or C++ / Objective-C or JS
00:53:54FromDiscord<Zachary Carter> (edit) "JS" => "JS)"
00:54:01FromDiscord<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:10FromDiscord<dan> thats what i meant by "feels hacky"
00:54:10FromDiscord<Zachary Carter> well...
00:54:14FromDiscord<Zachary Carter> I mean it's not
00:54:24FromDiscord<Zachary Carter> Nim compiles your Nim code to C right, then stores it somewhere
00:54:27FromDiscord<Zachary Carter> "the nimcache"
00:54:36FromDiscord<Zachary Carter> then it invokes another compiler to compile the C code
00:55:00FromDiscord<Elegant Beef> Yea, hell it's what i do for the rpi pico stuff i was working on
00:55:13FromDiscord<Zachary Carter> you're saying you don't want to compile the C code?
00:55:23FromDiscord<dan> yes exactly
00:55:24FromDiscord<Elegant Beef> Through the C into the cmake directory so then i can can compile it using the rpi cmake
00:55:33FromDiscord<Elegant Beef> There is a `-c` flag for that
00:55:55FromDiscord<Zachary Carter> `-c, --compileOnly:on|off`
00:56:16FromDiscord<Zachary Carter> just FYI you can also override what compiler Nim uses
00:56:28FromDiscord<Zachary Carter> so for instance, on windows I use vcc.exe most of the time instead of mingw
00:56:33FromDiscord<Zachary Carter> although I need to get on clang
00:56:38FromDiscord<Zachary Carter> anyway, that's neither here nor there
00:57:13FromDiscord<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:36FromDiscord<Zachary Carter> it already does
00:57:47FromDiscord<Zachary Carter> use that flag `-c, --compileOnly:on|off`
00:57:50FromDiscord<Elegant Beef> Yea as we've demonstrated it does \:D
00:57:55FromDiscord<Zachary Carter> πŸ™‚
00:58:02FromDiscord<dan> i am confused now. you do still have to move around the nimcache directory dont you?
00:58:11FromDiscord<Zachary Carter> you don't have to move any directory around
00:58:18FromDiscord<Zachary Carter> you have to tell Nim where to put the resulting C code
00:58:22FromDiscord<Zachary Carter> that is what the nimcache is
00:58:32FromDiscord<Zachary Carter> by default it's in the user's home directory
00:58:37FromDiscord<Zachary Carter> so you just need to override this as a compiler option
00:59:11FromDiscord<dan> yes that is what i meant
00:59:15FromDiscord<Zachary Carter> what it sounds like you want is for this to be the default mode of compilation
00:59:19FromDiscord<Zachary Carter> which is never going to happen
00:59:32FromDiscord<dan> no of course not
00:59:45FromDiscord<Elegant Beef> Well then just make some config file to do it for you and live hapily
00:59:52FromDiscord<Zachary Carter> too much of Nim's tooling and stdlib requires this to be the way it is
01:00:04FromDiscord<Zachary Carter> yeah, if you need help writing the configuration file I'm happy to help πŸ™‚
01:00:18FromDiscord<Elegant Beef> Like it's a 3 second thing to setup and you can pretend it was always like that
01:00:51FromDiscord<Zachary Carter> https://nim-lang.org/docs/nimc.html#compiler-usage-generated-c-code-directory
01:02:10FromDiscord<Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=3qv4
01:02:11FromDiscord<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:48FromDiscord<dan> and just setting the cache directory somewhere else felt like a crutch
01:03:27FromDiscord<Zachary Carter> well Nim's C output isn't really mean to appease C developers
01:03:59FromDiscord<Zachary Carter> it sacrifices human readability and is composed for correctness and performance
01:04:55FromDiscord<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:58FromDiscord<dan> thank you anyways
01:05:15FromDiscord<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:50FromDiscord<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:22FromDiscord<dan> yeah true ... i would like to help, but no way i am competent enough to work on the compiler
01:07:34FromDiscord<Zachary Carter> most of us aren't πŸ™‚
01:07:56FromDiscord<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:27FromDiscord<dan> totally assuming that nim is requiring special flags here
01:08:31FromDiscord<Zachary Carter> Nim is only ever going to produce C code for your platform
01:08:47FromDiscord<Zachary Carter> but you can of course use a cross compile toolchain to target another platform
01:09:22FromDiscord<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:31FromDiscord<Zachary Carter> if you look in the generated C files, they will have the command and arguments passed to the compiler frontend
01:09:41FromDiscord<Zachary Carter> for instance I just opened one up
01:09:44FromDiscord<Zachary Carter> and at the top in comments it says
01:09:52FromDiscord<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:07FromDiscord<dan> ooooh very nice, i might be able to parse that!
01:10:41FromDiscord<dan> if i ever get somewhere, i will post about how i did it
01:10:53FromDiscord<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:59FromDiscord<leorize> there's a feature to generate json build descriptions for Nim
01:11:01FromDiscord<Zachary Carter> or just a guest blog post ing eneral
01:11:05FromDiscord<Zachary Carter> (edit) "ing eneral" => "in general"
01:11:22FromDiscord<Zachary Carter> In reply to @leorize "there's a feature to": even better
01:11:28FromDiscord<Zachary Carter> I need to run an errand but I'll be back in a few
01:12:21FromDiscord<dan> In reply to @leorize "there's a feature to": do you mean jsondoc?
01:12:26FromDiscord<leorize> so `--compileOnly --nimcache:/where/you/want/your/c/files`
01:12:42FromDiscord<leorize> then inside the nimcache there's a `.json` file describing how to build
01:13:25FromDiscord<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:33FromDiscord<dan> im am going to check that out right now
01:15:01FromDiscord<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:50FromDiscord<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:01FromDiscord<Zachary Carter> oh nice
02:51:06FromDiscord<exelotl> In reply to @Zachary Carter "what it sounds like": it used to work like that before Nim 0.19 right?
02:52:45FromDiscord<exelotl> but yeah global nimcache seems to be preferable for most projects, except those where you want access to the C code
03:06:17FromDiscord<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:52FromDiscord<Varriount> I wonder why?
03:11:05FromDiscord<leorize> maybe because they have threads as their atom
03:11:20FromDiscord<leorize> in haiku it works in the same way as well
04:04:45FromDiscord<Zachary Carter> In reply to @exelotl "it used to work": well Nimcache used to be stored in the local directory yeah
04:05:09FromDiscord<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:56FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3qvD
04:33:18FromDiscord<codic> but then if I run the arc version in gdb it works fine, like the default one
04:35:38FromDiscord<aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3qvE
04:36:10FromDiscord<Zafia Reco> i dont think so...
04:40:35*fputs joined #nim
04:46:34FromDiscord<Elegant Beef> sent a code paste, see https://paste.rs/45w
04:48:43FromDiscord<leorize> sent a code paste, see https://play.nim-lang.org/#ix=3qvH
04:48:47FromDiscord<leorize> the create template is pretty handy
04:48:58FromDiscord<aleclarson> oo nice. much appreciate \:)
04:50:31FromDiscord<leorize> [Elegant Beef](https://matrix.to/#/@beef331:matrix.org)\: that might be wrong
04:50:53FromDiscord<treeform> In reply to @Elegant Beef "You also can use": I think we need to add support for multipart...
04:51:29FromDiscord<leorize> in here what is allocated is storage space for a proc pointer, so it should be `ptr proc()`
04:52:08FromDiscord<leorize> (this is why you should always use the create template, it's more correct)
04:52:18FromDiscord<Elegant Beef> Yea also why you dont try to help when playing a game \:P
04:53:41FromDiscord<Elegant Beef> Create also is nicer
05:01:20FromDiscord<aleclarson> @leorize it's unclear how assignment to a `ptr proc` works still
05:03:02FromDiscord<Elegant Beef> sent a code paste, see https://play.nim-lang.org/#ix=3qvO
05:03:31FromDiscord<aleclarson> solid, thx Elegant
05:03:56FromDiscord<Elegant Beef> nimcall is required cause for type's `proc{.closure.}` is the default
05:05:01FromDiscord<aleclarson> i need a blog to detail this minutiae xD
05:05:53FromDiscord<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:37FromDiscord<aleclarson> Oh good, hard to find that in a google search for some reason \:P
05:17:20FromDiscord<Elegant Beef> Yea the manual's got a lot of information that isnt easily searachable from a search engine
05:28:00FromDiscord<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:47FromDiscord<Varriount> sent a code paste, see https://play.nim-lang.org/#ix=3qvS
05:34:22FromDiscord<leorize> not really↡(@Varriount)
05:34:51FromDiscord<leorize> you can always call close on an unopened file/socket
05:35:39FromDiscord<leorize> also I recommend destroy instead if you're building new apis
05:36:12FromDiscord<Varriount> So `close(FileHandle(-1))` won't return an error (`-1`)?
05:38:48FromDiscord<Varriount> (leorize ^)
05:44:23FromDiscord<Avahe> Is there no sort of 2 way dictionary built-in to the stdlib?
05:44:40FromDiscord<Avahe> dictionary/table
05:57:34FromDiscord<Varriount> In reply to @Avahe "Is there no sort": Two-way? Not really. You usually just use two tables.
06:00:19FromDiscord<Avahe> hm alright, thanks
06:01:09FromDiscord<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:02FromDiscord<leorize> yea↡(@Varriount)
06:02:19FromDiscord<leorize> if you just want pipes and some fd my nim-sys has them
06:02:27FromDiscord<leorize> properly async too if you need
06:33:26FromDiscord<dankey> those matrix guys talk a lot
06:33:35FromDiscord<Elegant Beef> Indeed
06:39:51FromDiscord<Elegant Beef> @treeform\: i assume you will officially announce nimdocs eventually eh? πŸ˜›
06:55:24*Vladar joined #nim
06:58:38FromDiscord<haxscramper> In reply to @dan "i think my main": https://zen.su/posts/amalgamating-nim-programs/
07:15:27FromDiscord<treeform> In reply to @Elegant Beef "<@107140179025735680>\: i assume you": It solved my problem... not sure if I want more.
07:15:28FromDiscord<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:51max22-hi
07:23:04*beshr joined #nim
07:25:06FromDiscord<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:42FromDiscord<WhyDee86> ok,thx
07:33:52*stkrdknmibalz joined #nim
08:05:19*mikess quit (Ping timeout: 265 seconds)
08:10:26max22-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:29max22-?
08:13:04FromDiscord<ηƒ­δ»–ηƒ­ηš„> Yes! It&#x27;s just insane! Maybe these channels should have never been bridged!? 1000 messages in a day, really?
08:13:27FromDiscord<Elegant Beef> If i understand what i briefly read, a C static variable is just `var a {.global.} = 100` for instance
08:14:15FromDiscord<Elegant Beef> the global pragma initializes it once, but any modifications persist
08:14:31FromDiscord<Elegant Beef> https://nim-lang.org/docs/manual.html#pragmas-global-pragma
08:16:00*neceve joined #nim
08:19:44max22-ok ! thank you Elegant Beef !!
08:20:39FromDiscord<Varriount> Yay, my shell finally works (again). And with my subprocess modifications too.
08:20:50FromDiscord<Elegant Beef> Nice
08:21:57FromDiscord<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:41FromDiscord<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:53FromDiscord<Rika> I see
09:48:55FromDiscord<Varriount> (edit) "It's" => ""It's" | "bash" => "bash""
09:49:28FromDiscord<Varriount> The idea was, "how far can you go using only command syntax"
09:50:19FromDiscord<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:53FromDiscord<Rika> Doesn’t fish basically do that
09:59:56FromDiscord<Rika> Almost
10:00:06FromDiscord<Rika> Not completely but it’s close
10:00:07*Epsilon quit (Ping timeout: 244 seconds)
10:00:42FromDiscord<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:15FromDiscord<deech> Besides the manual where can I get more info on the `{.cursor.}` pragma?
10:13:54*Epsilon joined #nim
10:21:48FromDiscord<planetis> reading the tests and searching github?
10:25:16FromDiscord<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:36FromDiscord<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:57FromDiscord<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:20FromDiscord<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:37FromDiscord<gogolxdong (liuxiaodong)> Is there any example of parallel computing with vulkan in Nim?
13:52:46*al1ranger joined #nim
13:52:52FromDiscord<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:33FromDiscord<mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3qyA
13:54:17FromDiscord<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:47FromDiscord<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:22FromDiscord<haxscramper> Or look for a command-line parsing library that can work with arbitrary strings
14:00:33FromDiscord<haxscramper> And use it
14:02:28FromDiscord<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:53FromDiscord<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:19FromDiscord<ITR> And also {.experimental: "strictFuncs".}
14:25:41FromDiscord<Rika> version of nim is?
14:27:16FromDiscord<ITR> Think I messed something up and that it wasn't weave after all
14:30:05FromDiscord<ITR> ah, I spelled it wrong, I wrote noSideEffects instead of noSideEffect
14:32:50FromDiscord<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:19FromDiscord<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:49federico3why I'm not showing up as a Nim backer on bountysource? D-:
14:55:02FromDiscord<ITR> I'll check if there's a similar one first later, after I finish this project
14:57:09FromDiscord<ITR> sent a code paste, see https://play.nim-lang.org/#ix=3qyZ
14:58:50*lucerne joined #nim
15:01:29FromDiscord<ITR> also happens when removing the echo, realized I forgot to do so in the one I pasted
15:08:18FromDiscord<vindaar> the side effect here is just the `echo`, no?
15:09:31FromDiscord<ITR> nope, also happens when echo is removed
15:09:43FromDiscord<ITR> still nim 1.4.4
15:11:41FromDiscord<vindaar> where does `iLoop` come from?
15:11:59FromDiscord<vindaar> ahh
15:12:10FromDiscord<vindaar> is that just `weave` syntax to name the loop?
15:12:20FromDiscord<vindaar> never used those things from `weave`
15:12:22FromDiscord<ITR> yeah, it's lifted straight from their readme
15:12:47FromDiscord<ITR> I also tried differently with a regular for loop, but figured it would be better with an example from there
15:13:10FromDiscord<Vindaar> @mratsim was around earlier
15:19:38FromDiscord<dom96> In reply to @federico3 "why I'm not showing": federico3: probably best to switch to opencollective by now
15:19:43FromDiscord<dom96> bountysource is sketchy
15:19:56FromDiscord<ITR> sent a code paste, see https://play.nim-lang.org/#ix=3qzk
15:20:13federico3thanks
15:23:44FromDiscord<ITR> ah, wait, maybe it's because it calls loadBalance on weave
15:42:54FromDiscord<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:50FromDiscord<aleclarson> is there a special pragma for circular calls between two `proc`s?
16:30:59FromDiscord<aleclarson> eg: `a` calls `b` and `b` calls `a`
16:33:22FromDiscord<Rika> You forward declare one of them
16:33:50FromDiscord<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:15FromDiscord<aleclarson> @Rika Of course, thank you!
16:38:04*stkrdknmibalz joined #nim
16:39:15FromDiscord<konsumlamm> In reply to @ITR "how do I fully": `concat(concat(s))` should work
16:44:10FromDiscord<aleclarson> is type narrowing possible with generics?
16:46:07FromDiscord<Rika> type narrowing?
16:46:47FromDiscord<Rika> oh you mean type restrictions?
16:46:53FromDiscord<Rika> yeah if im not misinterpreting
16:47:16FromDiscord<Rika> `proc someproc[T: int or float](a: T): T = ...`
16:47:18FromDiscord<ITR> In reply to @konsumlamm "`concat(concat(s))` should work": ty ^^
16:47:45FromDiscord<ITR> though it seems that my seq[char] get turned into seq[uint8] when I concat
16:48:03FromDiscord<aleclarson> In reply to @Rika "`proc someproc[T: int or": lovely, thx again \:)
16:48:45FromDiscord<codic> In reply to @konsumlamm "if it works as": one might already be open i should take a look maybe
17:18:16FromDiscord<ynfle (ynfle)> @\_discord\_271498588981297157\:t2bot.io https://nim-lang.org/docs/destructors.html#the-dotcursor-annotation
17:18:21FromDiscord<ynfle (ynfle)> @deech https://nim-lang.org/docs/destructors.html#the-dotcursor-annotation
17:21:39*mikess joined #nim
17:21:40FromDiscord<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:42FromDiscord<KJ> sent a code paste, see https://play.nim-lang.org/#ix=3qzX
17:40:03FromDiscord<Rika> import enumerate
17:40:33FromDiscord<KJ> `Error: cannot open file: enumerate`
17:40:49FromDiscord<Rika> nim version?
17:41:16FromDiscord<KJ> sent a code paste, see https://play.nim-lang.org/#ix=3qzY
17:41:44FromDiscord<Rika> ah, sorry
17:41:48FromDiscord<Rika> import std/enumerate
17:42:18FromDiscord<KJ> same error as before
17:42:25FromDiscord<Rika> update nim
17:42:33FromDiscord<Rika> your nim is over a year old
17:42:48FromDiscord<Rika> and is on an unsupported minor version
17:42:51FromDiscord<KJ> wow
17:43:00FromDiscord<pointystick> Do you even need enumerate there? https://play.nim-lang.org/#ix=3qzZ
17:43:22FromDiscord<Rika> not in this case
17:43:24FromDiscord<Rika> he doesnt
17:43:35FromDiscord<KJ> In reply to @pointystick "Do you even need": probably not
17:43:41FromDiscord<Rika> but in other cases (iterable with items() implemented but not pairs()) it would be needed
17:44:08FromDiscord<Rika> or items() impl'd and pairs() impl'd in a different way (like say an iterable table)
17:44:08FromDiscord<KJ> that just be coming from python think I need enumerate. Still really new to nim
17:46:49*SebastianM joined #nim
17:50:33FromDiscord<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:32FromDiscord<KJ> `pairs() can not iterate a JsonNode of kind JArray`, should I be converting this `JArray` to a sequence?
17:53:55FromDiscord<KJ> sent a code paste, see https://play.nim-lang.org/#ix=3qA3
17:54:07FromDiscord<KJ> (edit) "https://play.nim-lang.org/#ix=3qA3" => "https://play.nim-lang.org/#ix=3qA4"
17:54:53FromDiscord<randyr> Try: `data["near_earth_objects"].getElems()`
17:55:28FromDiscord<KJ> that worked, cheers
17:56:23FromDiscord<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:30FromDiscord<randyr> (edit) "now" => "no"
17:56:59FromDiscord<randyr> I kinda wished the `rawGet` function were just public
17:59:06*PMunch joined #nim
18:00:32FromDiscord<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:45FromDiscord<randyr> True.
18:01:08FromDiscord<treeform> In my mind exceptions are not... but that could be wrong.
18:01:10FromDiscord<randyr> It doesn't seem like critbrits can be compiled to a const tho
18:02:33FromDiscord<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:53PMunchOoh neat, the channel has moved over to Libera now?
18:09:23FromDiscord<planetis> i wonder if catching all is faster than except ValueError
18:09:44FromDiscord<planetis> oh there is PMunch were have you been?
18:10:02PMunchMandatory military training exercise :P
18:10:14PMunchSince last Monday
18:12:18FromDiscord<planetis> cool that sounds fun
18:12:38PMunchYeah it is pretty fun
18:12:52PMunchNice to do something completely different for a couple of days
18:15:17FromDiscord<@bracketmaster-5a708063d73408ce4> I know you can overload `[]`
18:15:38FromDiscord<@bracketmaster-5a708063d73408ce4> what if I'm trying to do `foo[4] = barr`
18:15:54FromDiscord<@bracketmaster-5a708063d73408ce4> how can I overload index and assign?
18:16:03FromDiscord<randyr> `[]=`
18:16:15*SebastianM quit (Quit: Bye)
18:16:20PMunchOh neat, irclogs is updated as well, and with my new colour scheme :)
18:16:42FromDiscord<@bracketmaster-5a708063d73408ce4> thanks @\_discord\_135818050027913216\:t2bot.io
18:17:06PMunchAnd the json output :D
18:20:59FromDiscord<hamidb80> hey
18:22:07FromDiscord<hamidb80> i think `hashSet` doesn't work
18:22:35FromDiscord<hamidb80> and also nim playground 😐
18:23:01FromDiscord<hamidb80> https://play.nim-lang.org/#ix=3qAf
18:23:20FromDiscord<hamidb80> shoudn't color of the `Bag` be unique?
18:23:37FromDiscord<hamidb80> i declared `hash` function for it
18:25:00FromDiscord<hamidb80> (edit) "shoudn't color of the `Bag` be unique? ... " added "and the output be just the first `Bag` ?"
18:28:11FromDiscord<dom96> In reply to @PMunch "Oh neat, irclogs is": Yeah. It looks awesome πŸ™‚
18:28:37FromDiscord<dom96> I posted a blog article on Nim’s website as well in case you haven’t seen it about the move
18:28:48PMunchThanks :) It's just based on the Dracula colour scheme that is used for the playground and the website for snippets
18:29:16PMunchOh the website has been updated as well
18:31:17PMunchOh and Telegram is now linked to he main channel?
18:32:37FromDiscord<hamidb80> In reply to @hamidb80 "shoudn't color of the": ?
18:35:00FromDiscord<Bung> https://play.nim-lang.org/#ix=3qAg
18:35:19FromDiscord<Bung> you should add duplicated item to see what happens
18:36:01PMunchBut he implemented a hash function for Bag that should only take into account the colour..
18:36:32FromDiscord<dom96> In reply to @PMunch "Oh and Telegram is": Yep
18:36:53PMunchAh right, you need on `==` proc as well for sets to behave like you expect
18:37:50PMunchHow's that going? The Telegram chat always felt a bit different from the other communities
18:37:53FromDiscord<Bung> that's werid, dont know the internal , the hash function dont right, but result looks right
18:39:04PMunchLike this: https://play.nim-lang.org/#ix=3qAi
18:39:49FromDiscord<hamidb80> In reply to @PMunch "Like this: https://play.nim-lang.org/#ix=3qAi": thanks
18:40:11FromDiscord<hamidb80> i think the `HashSet` should consider hashed value
18:40:16FromDiscord<hamidb80> (edit) "i think the `HashSet` should consider hashed value ... " added "only"
18:40:19FromDiscord<Bung> guess only hash func not right need implements `==`
18:41:48FromDiscord<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:18PMunchYeah I remember the Telegram chat was always a bit more meme heavy than the other channels
18:42:37PMunchDidn't know about the spam bots though :P
18:49:49FromDiscord<Matt Rusiniak> they get dealt with quickly \:)
18:51:45FromDiscord<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:21FromDiscord<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:04FromDiscord<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:52FromDiscord<niv> it works, im just impatient ;)
19:09:01FromDiscord<hamidb80> in order to use "devel" version, do i have to build the compiler manually or the precompiled version exists in somewhere?
19:09:14FromDiscord<hamidb80> (edit) removed "in"
19:10:02FromDiscord<π–π–†π–π–˜π–ˆπ–—π–†π–’π–•π–Šπ–—> choosenim devel
19:10:29FromDiscord<π–π–†π–π–˜π–ˆπ–—π–†π–’π–•π–Šπ–—> 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:30FromDiscord<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:53FromDiscord<niv> and they're very fast, nice
19:28:14FromDiscord<@bracketmaster-5a708063d73408ce4> how do you get the max value a type such as int32 can hold in nim?
19:33:26FromDiscord<randyr> `int32.high`
19:39:11*lucerne quit (Read error: Connection reset by peer)
19:48:26*lucerne joined #nim
19:53:35FromDiscord<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:16FromDiscord<@bracketmaster-5a708063d73408ce4> @\_discord\_135818050027913216\:t2bot.io , thx
19:59:21PMunch@ITR, that does indeed suck
20:04:39FromDiscord<dom96> yeah, we need an m1 choosenim πŸ™‚
20:07:47federico3dom96: switched to opencollective :)
20:08:09FromDiscord<dom96> awesome πŸ™‚
20:16:11FromDiscord<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:24FromDiscord<ITR> is there a hyperneat implementation in nim?
20:19:07FromDiscord<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:47FromDiscord<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:50PMunchDitto! I've been wanting to make a meta-programming course for a while
20:21:24FromDiscord<Elegant Beef> Damn pmunch we're in the same boat πŸ˜›
20:21:50FromDiscord<λ🐑> N
20:21:58*Guest37 joined #nim
20:22:01FromDiscord<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:16FromDiscord<Elegant Beef> lambda fish, interesting name
20:22:26FromDiscord<Elegant Beef> Is that turbofish's cousin?
20:22:34PMunch@Elegant, example?
20:22:37FromDiscord<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:23FromDiscord<Elegant Beef> Example of those repos?
20:23:29PMunchYeah
20:27:08FromDiscord<Sochika Basil> image.jpeg https://media.discordapp.net/attachments/371759389889003532/856268952991694909/image.jpeg
20:28:27FromDiscord<Victoria Guevara> Guise. How about making chat useable again ?
20:28:40FromDiscord<Elegant Beef> I cannot find it atm pmunch
20:28:59PMunchHmm, bummer
20:29:08PMunchAnd @Victoria, what do you mean by useable?
20:29:41FromDiscord<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:41FromDiscord<Elegant Beef> https://github.com/nim-lang/Nim/pull/18267#discussion_r651737117
20:30:49FromDiscord<Elegant Beef> Close enough πŸ˜›
20:30:52FromDiscord<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:14FromDiscord<Elegant Beef> "some" is an odd way to write "all"
20:32:16FromDiscord<dom96> ask them to learn it over the summer πŸ˜„
20:32:17PMunchAah, it's Ziatom teaching
20:33:24*Guest37 quit (Quit: Client closed)
20:33:40FromDiscord<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:24FromDiscord<Elegant Beef> Well good that they hate python, that's the first step
20:34:34FromDiscord<gerwy> noo why :<
20:35:03FromDiscord<Elegant Beef> Well I hate python but ended up here, so has to be relation right? πŸ˜›
20:35:30FromDiscord<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:52FromDiscord<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:16FromDiscord<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:17federico3making people hate Python is quite difficult
20:37:12FromDiscord<gerwy> Ooooh its too earlier for them to learn compiler stuff haha↡they learned OOP like month ago
20:37:59FromDiscord<Elegant Beef> See learning OOP they're a lost cause... maybe i'll eventually quit joking around today
20:37:59FromDiscord<Elegant Beef> Maybe it's just time before you see the light πŸ˜€
20:38:01FromDiscord<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:46FromDiscord<gerwy> also the teacher is fun of C# and thinks it should be first language, soo it can be even harder
20:39:46FromDiscord<gerwy> (edit) "fun" => "fan"
20:40:13FromDiscord<Elegant Beef> Hmmm is there a way to make a typedesc for only inherited objects, dont suppose a concept would work
20:40:21FromDiscord<gerwy> ugh im making so many typos today... its probably from the heat, it was 37C today
20:45:32FromDiscord<Elegant Beef> Hmm, dont know if that'd work will have to try
20:45:32FromDiscord<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:35FromDiscord<vindaar> I do that here\: https://github.com/SciNim/Unchained/blob/master/src/unchained/units.nim#L326-L346
20:45:45FromDiscord<Elegant Beef> Right now i'm using `ref object` for this oop library, so that's sweet
20:46:05FromDiscord<Elegant Beef> Well thanks for that, makes this more idiot proof
21:00:18FromDiscord<Hugo Ribeiro> From my perspective it&#x27;s flooded https://m.youtube.com/watch?v=gTv7rijY2Vg↡(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
21:05:36FromDiscord<dom96> I guess you preferred no bridge to Discord?
21:05:56FromDiscord<Bung> how to profile a web server ?
21:05:59FromDiscord<Dominik Picheta (dom96)> Is it not useable with the bridge?
21:10:29PMunchCertainly a lot more traffic with the IRC/Discord community added to the Telegram one
21:27:43FromDiscord<Varriount> Can anyone recommend a C library that is likely to have the most understandable source code?
21:28:01FromDiscord<Elegant Beef> Hello world
21:28:01FromDiscord<randyr> Maybe Redis?
21:28:05FromDiscord<Varriount> (C standard library)
21:28:15FromDiscord<randyr> musl?
21:29:36FromDiscord<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:52FromDiscord<Varriount> Anyone know what reasonable platforms might not have posix_spawn available?
21:32:19FromDiscord<Varriount> I'm trying to determine if it's worth re-implementing posix_spawn in Nim for this subprocess module.
21:33:23FromDiscord<Elegant Beef> I feel like that's gotta be a rather common implemented procedure, but speaking out my arse here
21:34:02FromDiscord<Varriount> Hm... I think I'll leave it up to whoever actually needs to use a platform without it first.
21:34:16FromDiscord<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:24FromDiscord<Varriount> What is it?
21:36:34FromDiscord<Elegant Beef> An oop helper library
21:36:42FromDiscord<Bung> looks cool
21:37:23FromDiscord<Bung> can copy use `=` instead?
21:37:25FromDiscord<Varriount> How does `inherits` work?
21:37:27FromDiscord<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:52FromDiscord<Elegant Beef> AST traversal of the typedef
21:38:21FromDiscord<Victoria Guevara> I will probably pass.
21:38:58FromDiscord<Varriount> In reply to @Elegant Beef "AST traversal of the": Sorry, I mean, how does one use it?
21:39:41FromDiscord<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:24FromDiscord<Elegant Beef> I suppose `when a.inherits` makes more sense
21:41:05FromDiscord<Elegant Beef> Although I could export the concept so it's `when a is Inherits`
21:41:35FromDiscord<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:59FromDiscord<Dominik Picheta (dom96)> Why?
21:44:42FromDiscord<Elegant Beef> I dont know if it can, overriding `=` has a strict set of rules afaik↡(@Bung)
21:45:47FromDiscord<Elegant Beef> `Error: signature for '=' must be proc[T: object](x: var T; y: T)`
21:46:32PMunchIt'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:09FromDiscord<Elegant Beef> Yea atleast forcefully, like i suggested prior to the merge probably best to make a bridge/unbridged channel
21:47:49FromDiscord<Elegant Beef> I can understand why they wouldnt want to be apart of this, afterall i'm here
21:48:33PMunchI thought about suggesting to merge them when Discord was added, but decided against it myself because they feel like separate communities
21:48:39FromDiscord<gavr> what???
21:48:40FromDiscord<gavr> image.jpeg https://media.discordapp.net/attachments/371759389889003532/856289475352854548/image.jpeg
21:48:52FromDiscord<gavr> sent a code paste, see https://play.nim-lang.org/#ix=3qB6
21:48:55FromDiscord<Elegant Beef> `flags`
21:49:00FromDiscord<gavr> ou, hmm
21:49:02FromDiscord<Elegant Beef> do {} around your flag
21:49:28FromDiscord<Elegant Beef> Atleast i assume it's a alias for `set[FileCopyFlag]`
21:49:28FromDiscord<gavr> thanks!
21:50:12FromDiscord<gavr> do u also code gtk apps on nim?
21:50:18FromDiscord<Elegant Beef> Nope
21:50:25FromDiscord<Elegant Beef> I make games and libraries no one touches
21:50:57FromDiscord<Elegant Beef> Sorry i lied, pmunch touches my game
21:51:17PMunchI touch them real good
21:51:55FromDiscord<Elegant Beef> Who else would, you're the only one here that can stand me πŸ˜›
21:52:05PMunch@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:19PMunchI am?
21:52:31FromDiscord<Elegant Beef> There is no luck involved!
21:52:50PMunchHaven't played Linerino in quite a while though, any new cool stuff I've missed?
21:52:55FromDiscord<Elegant Beef> I used my skills to paint a picture that assumed whoever made that library writes good code
21:53:29FromDiscord<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:43FromDiscord<Elegant Beef> But again havent worked on that new game for a while but it's another fun/cute puzzle game
21:53:44PMunchOh cool, what kind?
21:53:53PMunchAh right, neat
21:54:35FromDiscord<Elegant Beef> If you want to see a level being played https://streamable.com/xx0y93
21:54:45PMunchI 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:03FromDiscord<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:22PMunchAah, like a mix of Tetris and Linerino
21:56:50FromDiscord<Elegant Beef> military exercize... interesting
21:57:16FromDiscord<Elegant Beef> Shh dont mention tetris that's how a lawsuit appears
21:57:36PMunchI 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:43FromDiscord<Elegant Beef> They wouldnt get any money but it'd be cool, i'd have a poster from "the tetris company"
21:58:07FromDiscord<Elegant Beef> Yea linerinos procgen is deceptively intelligent
21:58:09*Vladar quit (Quit: Leaving)
21:58:23PMunchYeah 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:46FromDiscord<Elegant Beef> Interesting
21:59:31PMunchI mean SeiΓ°r is literally just create a random board and then remove pieces to create a puzzle :P
21:59:36FromDiscord<Elegant Beef> Had to check and yea the level generation itself is \~100 loc
21:59:38PMunchIt's really quite simple
22:00:17FromDiscord<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:40FromDiscord<Elegant Beef> I think one of my rules is like "Dont walk to any tile that has 2 neighjbours"
22:40:39FromDiscord<Bung> @ElegantBeef then copy is fine .
23:14:55*max22- quit (Remote host closed the connection)
23:18:18saem[m]anyone know how to get typed varargs working with a conversion proc? https://play.nim-lang.org/#ix=3qBq
23:19:41saem[m]d'oh, wrong one
23:19:49*PMunch quit (Quit: leaving)
23:31:16*vicfred quit (Quit: Leaving)