00:02:02 | disruptek | balls. |
00:05:01 | * | krux02_ quit (Remote host closed the connection) |
00:08:50 | disruptek | leorize: nimsuggest crashes on my testes. |
00:08:53 | disruptek | my cps testes. |
00:09:20 | disruptek | probably because this code makes no sense. |
00:12:19 | * | Kaivo quit (Quit: thunderstorm!) |
00:13:58 | * | tiorock joined #nim |
00:13:58 | * | tiorock quit (Changing host) |
00:13:58 | * | tiorock joined #nim |
00:13:58 | * | rockcavera is now known as Guest76266 |
00:13:58 | * | tiorock is now known as rockcavera |
00:17:24 | * | Guest76266 quit (Ping timeout: 256 seconds) |
00:30:51 | FromDiscord | <--HA--> Can I give a .c file to compile as a compiler argument instead of the compile pragma in a .nim file? |
00:33:59 | * | audiophile joined #nim |
00:34:30 | FromDiscord | <Elegant Beef> Why/how would that benefit you? |
00:35:23 | * | arecacea1 quit (Remote host closed the connection) |
00:36:17 | FromDiscord | <--HA--> Then I can remove the pragma from the file and only call it in my nimble task when I need it. |
00:36:42 | * | arecacea1 joined #nim |
00:37:25 | * | audiofile quit (Ping timeout: 264 seconds) |
00:37:32 | * | audiophile is now known as audiofile |
00:37:50 | FromDiscord | <Elegant Beef> But where would the proc point to then? I mean i really should just shush cause idk what im talking about, but this doesnt seem like it makes much sense to me |
00:39:51 | FromDiscord | <Rika> youre making sense |
00:39:57 | FromDiscord | <--HA--> It is not linked to any proc. I just have it at the top to compile sqlite.c for static linking. But I also don't know enough about what I'm doing 😉 |
00:40:15 | FromDiscord | <--HA--> Anyway it works behind a when defined clause so I can live with that |
00:41:04 | FromDiscord | <Elegant Beef> If you dont have any reference to the c file, why do you have it? |
00:41:17 | FromDiscord | <Elegant Beef> like you have to have a cimport or something like that to use it in nim, no? |
00:42:10 | FromDiscord | <Elegant Beef> Thanks rika for confirming im occasionally sensible btw 😄 |
00:42:59 | * | audiofile quit (Ping timeout: 240 seconds) |
00:43:23 | FromDiscord | <--HA--> No, it is only being compiled. The code I wrote does not use it directly. The db_sqlite module somehow does I guess... It is for static linking as mentioned. |
01:16:12 | * | gangstacat quit (Ping timeout: 260 seconds) |
01:58:07 | * | apahl quit (Ping timeout: 240 seconds) |
02:00:14 | * | apahl joined #nim |
02:14:17 | leorize | disruptek: do you have reproducible snippets? |
02:16:32 | * | gangstacat joined #nim |
02:23:29 | * | theelous3 quit (Read error: Connection reset by peer) |
02:25:05 | * | ForumUpdaterBot quit (Remote host closed the connection) |
02:25:12 | * | ForumUpdaterBot joined #nim |
02:40:32 | * | muffindrake quit (Ping timeout: 260 seconds) |
02:42:40 | * | muffindrake joined #nim |
03:25:57 | Yardanico | Will {.nodestroy.} be available in the foreseeable future? |
03:26:10 | Yardanico | I'm asking because right now I'm thinking of abusing it for Sciter bindings |
03:27:00 | Yardanico | basically Sciter provides a VALUE type, and I wrote a custom destructor for it so it deallocates the VALUE properly. However, if a procedure returns a VALUE (which is passed to the Sciter side), Nim side shouldn't destroy the value |
03:27:09 | Yardanico | because (as far as I know) it'll be freed by Sciter's own GC |
03:31:03 | leorize | so just add a flag in the object to not destroy it? |
03:31:12 | Yardanico | but I want to destroy it in most cases |
03:31:42 | leorize | but you also have to deal with this gc-managed pointer |
03:31:56 | Yardanico | well actually I don't know if it's GC'd |
03:31:57 | Yardanico | maybe not |
03:32:09 | Yardanico | maybe yes :D |
03:32:23 | leorize | how does that pointer thing even work? |
03:32:34 | leorize | gc doesn't just magically work without any sort of callbacks |
03:33:18 | Yardanico | right now I just use destructors |
03:33:22 | Yardanico | sciter has a ValueClear function |
03:33:32 | Yardanico | which clears the value |
03:33:41 | Yardanico | but anyway, I asked on the sciter forum already, so I can understand it more ;) |
03:34:47 | Yardanico | I tried to understand how the Rust binding does it, but didn't get it yet :P |
03:35:09 | Yardanico | https://github.com/sciter-sdk/rust-sciter |
03:35:50 | leorize | rust isn't the only RAII thing out there |
03:36:09 | Yardanico | well they have official C++ wrapping but I'm not sure if it does destruction automatically |
03:36:25 | leorize | have you looked at go? |
03:36:31 | Yardanico | no :D time to |
03:36:42 | Yardanico | https://github.com/sciter-sdk/go-sciter |
03:36:55 | Yardanico | it's apparently the most popular Sciter binding |
03:37:07 | Yardanico | by stars count (which isn't the best thing for measuring, I know) |
03:37:24 | Yardanico | https://github.com/sciter-sdk/go-sciter/blob/master/value.go |
03:37:40 | Yardanico | "runtime.SetFinalizer(v, (*Value).finalize)" |
03:38:00 | Yardanico | which calls clear which calls ValueClear |
03:38:10 | leorize | afaict the rust one doesn't do automatic destruction |
03:38:19 | leorize | similar to the go bindings |
03:38:28 | Yardanico | wdym? |
03:38:30 | Yardanico | I think they both do |
03:38:46 | leorize | for go you have to call Release(), no? |
03:38:52 | leorize | and for rust they export the `clear()` |
03:39:06 | Yardanico | but no example uses it |
03:39:14 | Yardanico | only tests |
03:39:24 | Yardanico | wait actually |
03:39:33 | Yardanico | what's the canonical Rust name for a "destruction" function? |
03:39:38 | Yardanico | and in Go, as I said, they set a finalizer |
03:39:52 | Yardanico | https://github.com/sciter-sdk/go-sciter/blob/master/value.go#L47 |
03:40:41 | leorize[m] | https://github.com/sciter-sdk/Sciter-Dport/blob/master/source/sciter/sciter_value.d#L89 |
03:40:50 | leorize[m] | here's what D does, just call ValueClear |
03:41:21 | Yardanico | yes, but does D or Go call a finalizer for return values? |
03:41:21 | leorize | I think ValueClear also take care of GC and stuff that you might be wary off |
03:41:23 | Yardanico | nim does |
03:41:31 | leorize | D does RAII |
03:41:44 | leorize | Go use Nim-like finalizers |
03:42:30 | Yardanico | ah wait I'm just stupid I think |
03:42:34 | Yardanico | really stupid |
03:42:41 | Yardanico | well kinda |
03:43:04 | leorize[m] | this is rust: https://github.com/sciter-sdk/rust-sciter/blob/master/src/value.rs#L794 |
03:43:07 | Yardanico | so because I didn't yet wrap native callbacks for Sciter I use the raw VALUE type as a return type, right? |
03:43:15 | leorize[m] | so yea, you really just have to ValueClear() |
03:43:19 | Yardanico | but |
03:43:27 | Yardanico | I already have a high-level SciterVal wrapping |
03:43:44 | Yardanico | so I do stuff like "let res = newValue(); result = res.impl" |
03:43:49 | Yardanico | where res.impl is the actual raw pointer |
03:44:11 | leorize[m] | why would you casually break the abstraction like that :P |
03:44:13 | Yardanico | well but still wonder how rust/go handle these callback thingies |
03:44:29 | Yardanico | leorize[m]: I'm not breaking it, I just don't have high-level stuff for that yet :P |
03:44:34 | leorize[m] | https://github.com/sciter-sdk/rust-sciter/blob/master/src/value.rs#L812 |
03:44:36 | leorize[m] | ValueCopy() |
03:44:46 | * | rockcavera quit (Remote host closed the connection) |
03:45:12 | leorize[m] | it appears that all Value* stuff work directly on the built-in ref counter |
03:45:15 | * | rockcavera joined #nim |
03:45:24 | leorize[m] | so you don't need to bother too much |
03:45:40 | Yardanico | oh I think I understood |
03:45:47 | Yardanico | I might just do "discard ValueCopy(addr result, res.impl)" then? |
03:46:04 | leorize | seems to be it |
03:47:39 | Yardanico | ok now it seems to work, although I'm not sure if it's 100% correct |
03:47:58 | leorize | do you have sciter own documentation on these APIs? |
03:48:06 | Yardanico | it' pretty scarse, I'll try to find it :) |
03:48:45 | Yardanico | but at least my calculator example (which defines a nim-side callback which returns a sciter VALUE) doesn't seem to leak |
03:50:01 | leorize[m] | https://sciter.com/sdk/doc.api/html/value_8h.html |
03:50:07 | leorize[m] | good ol' doxygen have it all |
03:50:29 | Yardanico | there's no documentation there :P |
03:51:08 | leorize | what are you talking about? it's all in there :P |
03:51:24 | Yardanico | also apparently my sciter example crashes with ARC |
03:51:27 | Yardanico | it didn't before.. |
03:51:42 | leorize[m] | https://sciter.com/sdk/doc.api/html/value_8hpp_source.html |
03:51:48 | Yardanico | and doesn't seem to related to destructors at all |
03:51:51 | leorize[m] | there you go, the canonical CPP source |
03:52:13 | Yardanico | yeah I know about that one |
03:52:46 | leorize | as long as you follow that you should be fine |
03:53:02 | Yardanico | I mean I can technically don't have a nim object |
03:53:07 | Yardanico | but a direct alias for "VALUE" |
03:53:19 | Yardanico | but i think that it'd be unsafer |
03:53:23 | leorize | just use the object for the encapsulation |
03:53:39 | Yardanico | yeah it's literally SciterValObj* = object impl: ptr SCITER_VALUE |
03:54:07 | leorize | you may now call it `Value` :P |
03:54:16 | Yardanico | I also have = and =sink |
03:54:35 | Yardanico | =sink is just destroing the old one and copying new pointer into old one |
03:54:43 | Yardanico | leorize[m]: well I can't :D |
03:54:56 | leorize | why? |
03:55:04 | Yardanico | well maybe I can actually |
03:55:12 | Yardanico | Sciter API for some reason defines SCITER_VALUE* = Value |
03:55:13 | Yardanico | just an alias |
03:55:33 | Yardanico | "typedef VALUE SCITER_VALUE" |
03:55:34 | ForumUpdaterBot | New thread by Salient: How to pass multiple parameters into proc - not varargs, see https://forum.nim-lang.org/t/6668 |
03:55:36 | leorize | don't you control the wrapper? |
03:55:41 | Yardanico | I do, yeah |
03:55:41 | leorize | you can just control where everything goes |
03:55:43 | Yardanico | I just didn't notice it before |
03:56:00 | Yardanico | but "Value" name might conflict with some other stuff, or it's fine? |
03:56:07 | leorize | it's fine |
03:56:16 | leorize | we have qualifiers if conflicting is ever a problem |
03:57:20 | Yardanico | well at this point I get conflicts because I import everything from the low-level interface |
03:57:23 | Yardanico | ah right I can just rename VALUE |
03:57:52 | leorize | or you can just separate the low-level stuff to a separated file |
03:57:59 | Yardanico | yes, I plan to do that |
03:57:59 | * | dadada joined #nim |
03:58:23 | * | dadada is now known as Guest72535 |
03:58:50 | Yardanico | leorize[m]: lol |
03:59:00 | Yardanico | Andrew ( the creator of Sciter) replied almost like you about the ValueCopy |
03:59:01 | Yardanico | https://sciter.com/forums/topic/a-question-about-sciters-value-type/#post-66848 |
04:03:35 | leorize | the API is pretty straightforward for that one |
04:03:37 | leorize | unlike gtk :P |
04:03:42 | Yardanico | hehe |
04:04:11 | Yardanico | Sciter provides both ways of doing things - wrapping _everything_ natively, or just the logical side of things |
04:04:19 | Yardanico | keeping the UI (with events) to TiScript which is much more natural there |
04:04:28 | Yardanico | than in native sequential code |
04:04:50 | Yardanico | I mean things like handling OnKeyPress, etc |
04:05:58 | leorize | do the native thing |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:14 | Yardanico | well I'll try to :) |
04:06:26 | Yardanico | Sciter seems nice, and the author said he had plans for open-sourcing it |
04:06:37 | * | supakeen joined #nim |
04:06:45 | Yardanico | although it's not easy since there's quite a big codebase already |
04:06:49 | Yardanico | but at least it's self contained |
04:06:57 | leorize | then you slap a nice DSL on top and bam you have a cool Nim thing |
04:07:05 | Yardanico | to flex on those electron kids /s |
04:07:18 | leorize | I'll use sciter once it's actually open sourced :P |
04:07:37 | leorize | (I use musl libc and, uh, proprietary thing just doesn't work here) |
04:07:44 | Yardanico | oh right |
04:07:53 | Yardanico | Sciter uses GTK for the native windows on Linux |
04:08:00 | Yardanico | but it also has a windowless mode |
04:10:23 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
04:20:26 | * | unai_ joined #nim |
04:21:34 | FromDiscord | <drsensor👹> Hi, is it okay to use `distinct string` type as a key on `Table`?↵do I need ot extend it so it can be hashed? |
04:22:01 | leorize | yes, you can use distinct string as a key |
04:22:13 | leorize | however you'd need to implement your own hashing |
04:22:31 | leorize | well you don't have to, just import hashes and write a wrapper for the regular hash :P |
04:22:44 | * | unai_ quit (Client Quit) |
04:23:01 | * | unihernandez22 joined #nim |
04:23:32 | leorize | basically: `proc hash(s: YourString) = hash(s.string)` |
04:23:35 | leorize | then it will just work |
04:25:39 | FromDiscord | <Rika> cant you do `proc hash(s: YourString) {.borrow.}` |
04:25:48 | leorize | oh yea, that too |
04:27:42 | * | unihernandez22 quit (Client Quit) |
04:27:51 | FromDiscord | <drsensor👹> nice, thanks |
04:28:25 | leorize[m] | anyone feeling like writing better wikipedia pages? :P https://en.wikipedia.org/wiki/Nim_(programming_language) |
04:33:22 | * | D_ quit (Ping timeout: 260 seconds) |
04:34:39 | * | D_ joined #nim |
04:35:29 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
04:35:42 | * | njoseph joined #nim |
04:36:38 | * | njoseph quit (Client Quit) |
04:36:39 | FromDiscord | <drsensor👹> what's wrong with the wiki? |
04:36:46 | * | njoseph joined #nim |
04:36:54 | Yardanico | that page is quite incomplete |
04:45:57 | FromDiscord | <drsensor👹> sent a code paste, see https://play.nim-lang.org/#ix=2tX1 |
04:47:27 | leorize | you need to borrow the `==` operator too |
04:47:54 | leorize | so ```proc `==`(x, y: Event): bool {.borrow.}``` |
04:50:17 | * | rockcavera quit (Remote host closed the connection) |
04:50:41 | FromDiscord | <drsensor👹> thanks, it works |
04:51:40 | * | mbuchel quit (Ping timeout: 256 seconds) |
04:53:07 | voltist | Vindaar: My FITS image reader is now up |
04:53:16 | voltist | !disbot dizzyliam/astroNimy |
04:53:26 | leorize | it's !repo |
04:53:41 | voltist | Whoops |
04:53:57 | voltist | !repo dizzyliam/astroNimy |
04:53:58 | disbot | https://github.com/dizzyliam/astroNimy -- 9astroNimy: 11A Nim library for astronomical image processing 15 3⭐ 0🍴 |
04:54:01 | voltist | Whey! |
04:55:34 | FromDiscord | <drsensor👹> ah yes, how do I print `distinct` type? |
04:56:13 | leorize | borrow the `$` :) |
04:56:33 | leorize | ```proc `$`(e: Event): string {.borrow.}``` |
04:56:54 | FromDiscord | <drsensor👹> right forgot there is a dollar symbol 😂 |
04:57:54 | leorize | that symbol have a history of triggering PTSD for bash users :P |
05:00:53 | voltist | Fish user represent! |
05:01:04 | voltist | users* |
05:02:07 | FromDiscord | <drsensor👹> anyone use nushell as their daily driver? |
05:02:31 | FromDiscord | <Rika> fish users still need to use $ symbol tho :ThonkDumb: |
05:04:53 | voltist | @Rika Do we? |
05:05:27 | FromDiscord | <Rika> yeah i dont remember not using the $ symbol in fish |
05:05:36 | Yardanico | uh wat |
05:06:21 | Yardanico | ah well |
05:06:30 | Yardanico | you need it for the variable substitution, yes |
05:06:36 | Yardanico | but not for evaluation of commands like in bash |
05:07:54 | FromDiscord | <Rika> ah yes |
05:15:50 | * | vicfred quit (Quit: Leaving) |
05:39:35 | Zevv | disruptek: so, typed is not going to work, right? |
05:43:36 | Yardanico | is LPCWSTR the same as ptr UncheckedArray[uint16] ? |
05:45:33 | leorize | yes, or WideCString in Nim |
05:45:49 | leorize | well maybe not WideCString in old runtime |
05:48:33 | * | solitudesf joined #nim |
05:58:54 | Zevv | leorize: you once told me how to do quote do with a custom escape char |
06:00:19 | Yardanico | hrm |
06:00:23 | Zevv | quote do: <block> do: "quoting op" |
06:00:29 | Zevv | but can't get the syntax right it seems |
06:00:35 | Yardanico | so I'm fighting some strange arc-only widecstring thing |
06:00:58 | Yardanico | if I do "var ws: WideCString" and then pass it to a function which expects a ptr LPCWSTR as cast[ptr LPCWSTR](addr ws) - it works in refc |
06:00:59 | Yardanico | but doesn't in arc |
06:01:24 | Yardanico | well I mean that function returns stuff |
06:01:33 | Yardanico | (sets stuff I mean, via the pointer) |
06:01:40 | Yardanico | but $ for WideCString for arc does something weird |
06:02:03 | Zevv | Yardanico: if you are brave enough, minimize your example, compile with -d:danger --gc:arc and look at the C source |
06:02:14 | * | apahl quit (Ping timeout: 246 seconds) |
06:02:29 | Yardanico | hrm it's really weird indeed |
06:02:48 | Yardanico | even in $ for WideCString itself (when echoing separate string eentities) it prints valid stuff |
06:03:26 | Yardanico | another arc bug? XD |
06:03:27 | * | apahl joined #nim |
06:03:32 | Zevv | sure why not |
06:08:42 | * | snowolf quit (Remote host closed the connection) |
06:10:30 | * | snowolf joined #nim |
06:11:12 | FromDiscord | <tomck> sent a code paste, see https://play.nim-lang.org/#ix=2tXg |
06:11:29 | Yardanico | var T is not a first-class type |
06:11:35 | Yardanico | it's used in routine arguments |
06:11:52 | Yardanico | when you want to mutate the passed argument (so it would be visible) |
06:11:54 | FromDiscord | <tomck> i see, so is `ref T` always a pointer to a mutable T? I can't have a const T ptr? |
06:11:59 | Yardanico | no |
06:12:16 | Yardanico | but strictFuncs was introduced recently, which introduces deep immutability for refs in funcs |
06:12:19 | FromDiscord | <tomck> interesting, ok |
06:12:56 | FromDiscord | <tomck> So if i have a non-var `T` which is an object that contains a `ref Foo` , can I mutate that Foo despite the `T` being immut? |
06:13:29 | Yardanico | no |
06:13:53 | Yardanico | if you have "let myvar = T(...)" and then try to mutate "myvar.val = 3" it won't work |
06:13:58 | Yardanico | or I misunderstood you |
06:14:21 | leorize | Zevv: didn't we end up with a template in the end? |
06:14:23 | Yardanico | if T is an object type of course |
06:14:26 | Yardanico | not a ref object |
06:14:41 | FromDiscord | <tomck> Yes, but what if `T.val` is a ref object |
06:14:48 | Yardanico | but T is not a ref object |
06:15:00 | Yardanico | immutability works just as you would expect for "object" types |
06:15:40 | FromDiscord | <tomck> sent a code paste, see https://play.nim-lang.org/#ix=2tXh |
06:15:49 | Yardanico | no, as I said |
06:15:51 | FromDiscord | <tomck> but, it WOULD be valid if the top-level T was a ref? |
06:15:55 | Yardanico | yes |
06:16:03 | FromDiscord | <Rika> huh? really? |
06:16:06 | FromDiscord | <tomck> what? |
06:16:11 | Yardanico | ? |
06:16:16 | Yardanico | "object" is a value type |
06:16:26 | Yardanico | if it's declared with "let", it's immutable |
06:16:41 | FromDiscord | <tomck> sent a code paste, see https://play.nim-lang.org/#ix=2tXi |
06:16:49 | Yardanico | no |
06:16:52 | Yardanico | you misunderstand me |
06:16:57 | Yardanico | well actually |
06:17:19 | Yardanico | yes you can do that |
06:17:20 | FromDiscord | <Rika> yardanico: objects only are immutable at the first level, refs in objects can still be mutated |
06:17:24 | Yardanico | yes |
06:17:27 | Yardanico | I was confused :P |
06:17:29 | FromDiscord | <tomck> okay i see |
06:17:37 | FromDiscord | <tomck> alright ta |
06:26:01 | Zevv | leorize: yes, but I also can't get *that* to work anymore :) |
06:26:33 | Zevv | just that it came up on the forum: https://forum.nim-lang.org/t/6663 |
06:32:03 | * | snowolf quit (Remote host closed the connection) |
06:34:10 | * | snowolf joined #nim |
06:39:39 | * | Vladar joined #nim |
06:41:31 | * | abm joined #nim |
06:49:51 | * | abm quit (Quit: Leaving) |
06:53:53 | * | PMunch joined #nim |
07:09:24 | * | abm joined #nim |
07:18:03 | * | aenesidemus_ quit (Read error: Connection reset by peer) |
08:02:53 | * | krux02 joined #nim |
08:15:16 | PMunch | krux02, found a little issue with the negative stack thing |
08:15:45 | PMunch | Just something that might seem a bit unintuitive |
08:15:49 | krux02 | no overloading |
08:15:58 | PMunch | 200 100 - |
08:16:04 | PMunch | Returns 100 |
08:16:08 | PMunch | 200 - 100 |
08:16:12 | PMunch | Returns -100 |
08:16:44 | PMunch | Well my implementation can have overloading |
08:16:50 | krux02 | ok |
08:17:01 | alehander92 | hey |
08:17:11 | PMunch | They're implemented as coroutines that just gets blocked waiting for more stack elements to appear |
08:17:47 | PMunch | So in the 200 - 100 example it first pops the 200, then the 100. Which would be equivalent to a stack like 100 200 - |
08:20:53 | FromDiscord | <Doongjohn> I'm trying to make a "try nim online" feature in my hobby website. Is nim-playground open to send request? |
08:21:10 | PMunch | Yup |
08:21:18 | PMunch | Just look at how NimBot does it |
08:21:39 | FromDiscord | <Doongjohn> what's NimBot? |
08:21:52 | FromDiscord | <lqdev> !eval echo "this is nimbot" |
08:21:52 | NimBot | Compile failed: <no output> |
08:21:52 | PMunch | !eval echo "Hello, I'm NimBot!" |
08:21:52 | NimBot | Compile failed: <no output> |
08:22:01 | PMunch | Hmm, that's not good |
08:22:06 | FromDiscord | <lqdev> wut |
08:22:06 | FromDiscord | <Doongjohn> oh |
08:22:13 | FromDiscord | <lqdev> seems like it's broken |
08:22:42 | FromDiscord | <lqdev> playground returns a 502 bad gateway |
08:22:47 | FromDiscord | <lqdev> via cloudflare |
08:22:52 | PMunch | Yeah I can see that |
08:22:58 | PMunch | The server appears to be running though.. |
08:23:30 | FromDiscord | <lqdev> hmm the main website works just fine |
08:23:41 | PMunch | Oh |
08:23:46 | PMunch | It's out of disk again.. |
08:24:27 | FromDiscord | <lqdev> are you storing all programs people input? |
08:24:39 | PMunch | I'm trying my best to delete them.. |
08:24:43 | PMunch | But Docker is a mess |
08:24:49 | FromDiscord | <lqdev> well docker™️ |
08:24:59 | FromGitter | <gogolxdong> How to get the nanosecond presentation in Nim? |
08:25:06 | FromDiscord | <lqdev> i wonder what went wrong |
08:25:16 | PMunch | What do you mean? |
08:25:24 | PMunch | It just doesn't properly clean up after itself |
08:25:47 | PMunch | I guess I should just create a cron job to run `docker system prune -a` or something |
08:26:07 | FromDiscord | <lqdev> @gogolxdong std/monotimes has getMonoTime(). you can get two of them and subtract one from the other and get a Duration which has nanosecond precision |
08:26:49 | FromGitter | <gogolxdong> something like time.time_ns() in python. |
08:30:08 | * | Vladar quit (Remote host closed the connection) |
08:31:16 | * | JustASlacker joined #nim |
08:31:57 | * | Vladar joined #nim |
08:34:55 | PMunch | Well shit.. |
08:35:08 | PMunch | I cleared some space from the drive, updated the machine, and rebooted |
08:35:14 | PMunch | But it doesn't seem to come up.. |
08:35:33 | PMunch | dom96, do you have a moment to check out the playground server? |
08:49:54 | Zevv | < PMunch> But Docker is a mess. See, now you agree with me |
08:50:08 | Zevv | wasn't that _my_ point |
08:50:14 | PMunch | Haha, fair enough |
08:50:23 | PMunch | I guess I like what docker offers, but not docker itself |
08:50:47 | Zevv | suure, could't agree more. |
08:50:56 | FromDiscord | <Varriount> PMunch: How is docker a mess? |
08:51:24 | FromDiscord | <Varriount> Also, how's your NPeg grammar going? |
08:52:40 | PMunch | Well it just filled up the playground server hard-drive despite my best efforts of getting it to not do that, and now it won't start up again.. |
08:52:51 | PMunch | Oh I completed that the other day |
08:53:01 | Zevv | My docker experience can be described as "bleeding to death by a thousand paper cuts" |
08:53:15 | PMunch | I really only wanted to add support for " delimited strings to what is essentially splitWhitespace |
08:55:23 | FromDiscord | <Varriount> PMunch: "docker system prune -v" didn't work? |
08:57:38 | PMunch | -v? |
08:58:10 | FromDiscord | <Varriount> Removes volumes |
08:58:17 | PMunch | I did a -a now, but I don't want to run a prune every time someone enters code. That could end up with one person deleting a container of someone else before it was done.. |
08:58:45 | FromDiscord | <tomck> can i get the nth element of an inline iterator? |
08:58:46 | FromDiscord | <Varriount> prune doesn't remove running containers, afaik |
08:59:05 | PMunch | I guess I should just set up a prune as a cron job, I mean it's about half a year or something since the last issue like this |
08:59:08 | FromDiscord | <tomck> (without iterating over it and 'searching' for the index i want, which is a bit silly) |
08:59:25 | PMunch | tomck, that isn't possible unfortunately |
08:59:51 | FromDiscord | <Varriount> tomk: Not really. An iterator works on the concept that it is called repeatedly |
08:59:52 | PMunch | Since iterators are just a procedure that you can call over and over and it will give you different values every time (not quite, but close enough) |
09:00:41 | * | Zambyte[m] quit (Quit: Idle for 30+ days) |
09:01:05 | FromDiscord | <lqdev> @gogolxdong there's times.getTime() |
09:01:36 | FromDiscord | <tomck> alright, shame |
09:05:39 | * | BitPuffin quit (Quit: killed) |
09:05:39 | * | GitterIntegratio quit (Quit: killed) |
09:05:39 | * | codic quit (Quit: killed) |
09:05:41 | * | reversem3 quit (Quit: killed) |
09:05:46 | * | planetis[m] quit (Quit: killed) |
09:05:46 | * | lnxw37d4 quit (Quit: killed) |
09:05:46 | * | hnOsmium0001[m] quit (Quit: killed) |
09:05:46 | * | leorize[m] quit (Quit: killed) |
09:05:53 | * | skrylar[m] quit (Quit: killed) |
09:05:53 | * | Zoom[m] quit (Quit: killed) |
09:05:53 | * | silvernode[m] quit (Quit: killed) |
09:05:54 | * | ee7[m] quit (Quit: killed) |
09:05:55 | * | unclechu quit (Quit: killed) |
09:05:56 | * | rridley[m] quit (Quit: killed) |
09:05:56 | * | jklhyd[m] quit (Quit: killed) |
09:05:57 | * | swamptest1[m] quit (Quit: killed) |
09:06:00 | * | darrion_oakenbow quit (Quit: killed) |
09:06:03 | * | j4nvkvc quit (Quit: killed) |
09:06:03 | * | guelosk[m] quit (Quit: killed) |
09:06:03 | * | einichi quit (Quit: killed) |
09:06:03 | * | MTRNord[m] quit (Quit: killed) |
09:14:31 | * | skrylar[m] joined #nim |
09:15:20 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:45:57 | * | planetis[m] joined #nim |
09:45:57 | * | unclechu joined #nim |
09:45:57 | * | BitPuffin joined #nim |
09:45:57 | * | guelosk[m] joined #nim |
09:45:57 | * | leorize[m] joined #nim |
09:45:57 | * | lnxw37d4 joined #nim |
09:45:57 | * | darrion_oakenbow joined #nim |
09:45:57 | * | MTRNord[m] joined #nim |
09:45:57 | * | hnOsmium0001[m] joined #nim |
09:45:58 | * | einichi joined #nim |
09:45:58 | * | GitterIntegratio joined #nim |
09:45:58 | * | j4nvkvc joined #nim |
09:45:58 | * | codic joined #nim |
09:45:58 | * | reversem3 joined #nim |
09:45:58 | * | Zambyte[m] joined #nim |
09:46:03 | * | Zoom[m] joined #nim |
09:46:03 | * | jklhyd[m] joined #nim |
09:46:04 | * | silvernode[m] joined #nim |
09:46:04 | * | ee7[m] joined #nim |
09:46:04 | * | rridley[m] joined #nim |
09:46:04 | * | swamptest1[m] joined #nim |
09:51:35 | ForumUpdaterBot | New thread by Lum: HTTPS requests in Nim, see https://forum.nim-lang.org/t/6670 |
10:13:15 | FromDiscord | <tomck> Hmmm, any way I can get the element type of an iterator? |
10:14:04 | FromDiscord | <tomck> sent a code paste, see https://play.nim-lang.org/#ix=2tY0 |
10:14:21 | FromDiscord | <tomck> (edit) 'https://play.nim-lang.org/#ix=2tY0' => 'https://play.nim-lang.org/#ix=2tY1' |
10:14:37 | FromDiscord | <tomck> (can't get the type of 'default' because default might be `nil`) |
10:15:43 | FromDiscord | <tomck> or i guess i can't because `iter` is untyped |
10:16:01 | FromDiscord | <tomck> how can i get the 'last' element in the iterator otherwise then? |
10:19:49 | FromDiscord | <Vindaar> is `iter` an actual iterator or just something that defines an `items` iterator, e.g. a collection? |
10:20:02 | FromDiscord | <tomck> it's an inline iterator |
10:21:43 | FromDiscord | <Vindaar> how do you want to handle `var x = default` for a `nil` case? |
10:22:22 | FromDiscord | <Vindaar> is `x` supposed to be some `ref` object in that case? |
10:25:05 | FromDiscord | <lqdev> typeof(iter) is a thing |
10:25:11 | FromDiscord | <flywind> `testament all` will only test something like `tests/*/t1.nim`, but `tests/t1.nim` won't be tested. Is it intended behaviour? |
10:25:55 | FromDiscord | <Recruit_main707> is `--newRuntime` stable? |
10:26:10 | FromDiscord | <lqdev> it was superseded by --gc:arc |
10:31:09 | FromDiscord | <tomck> that's why you have the option of a `default` @Vindaar , for when nil isn't an option |
10:31:22 | FromDiscord | <tomck> @lqdev does typeof(iter) return the type of the iterator element, or another type? |
10:31:41 | FromDiscord | <lqdev> yeah, it returns the iterator's yield type |
10:31:46 | FromDiscord | <tomck> col! |
10:31:49 | FromDiscord | <tomck> (edit) 'col!' => 'cool!' |
10:31:56 | FromDiscord | <lqdev> see this https://nim-lang.org/docs/manual.html#special-types-typeof-operator |
10:31:59 | FromDiscord | <Vindaar> sent a code paste, see https://play.nim-lang.org/#ix=2tY8 |
10:32:08 | FromDiscord | <tomck> oh |
10:32:21 | FromDiscord | <tomck> confusion |
10:32:25 | FromDiscord | <tomck> let me just try it |
10:33:15 | FromDiscord | <tomck> typeof(iter) seems to return the yield type, rather than the 'container' type, so we're all good |
10:33:37 | FromDiscord | <Vindaar> weird, it does not for me? |
10:34:06 | FromDiscord | <Vindaar> sent a code paste, see https://play.nim-lang.org/#ix=2tY9 |
10:34:32 | FromDiscord | <tomck> yes |
10:35:32 | FromDiscord | <lqdev> @Vindaar pretty sure that is because you're passing in a *closure* iterator |
10:35:37 | FromDiscord | <lqdev> and not an inline iterator |
10:35:43 | FromDiscord | <Vindaar> oh |
10:35:56 | FromDiscord | <lqdev> so it's getting the type of variable a |
10:36:02 | FromDiscord | <lqdev> which is `iterator (): float {.closure.}` |
10:36:06 | FromDiscord | <Vindaar> that makes sense yeah |
10:38:54 | FromDiscord | <Vindaar> for some reason I thought that was what tomck wanted, hah |
10:41:56 | * | arecacea1 quit (Remote host closed the connection) |
10:43:59 | * | arecacea1 joined #nim |
10:50:46 | PMunch | Really annoying that the playground is down.. |
10:50:59 | PMunch | Especially since I'm not able to do anything about it |
10:53:54 | * | Northstrider[m] quit (Quit: killed) |
10:56:20 | * | Northstrider[m] joined #nim |
11:05:29 | Zevv | who can? |
11:08:41 | * | lritter joined #nim |
11:10:47 | * | slackytude[m] joined #nim |
11:17:46 | * | solitudesf quit (Ping timeout: 265 seconds) |
11:20:13 | * | solitudesf joined #nim |
11:24:33 | * | solitudesf quit (Remote host closed the connection) |
11:41:14 | * | mbuchel joined #nim |
11:59:42 | * | solitudesf joined #nim |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:38 | * | supakeen joined #nim |
12:09:36 | * | theelous3 joined #nim |
12:14:50 | * | rockcavera joined #nim |
12:27:29 | * | dulsi_ joined #nim |
12:30:19 | * | dulsi quit (Ping timeout: 256 seconds) |
12:37:20 | * | rockcavera quit (Killed (kornbluth.freenode.net (Nickname regained by services))) |
12:37:20 | * | rockcavera joined #nim |
12:40:52 | * | kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in) |
12:41:09 | * | kitech1 joined #nim |
12:42:00 | PMunch | Zevv, dom96 |
12:44:50 | Zevv | PMunch |
12:45:13 | PMunch | Zevv+ |
12:45:16 | PMunch | ?* |
12:45:50 | Zevv | >+PMunch |
12:46:02 | PMunch | You asked me who could fix the playground :P |
12:46:15 | Zevv | ooh |
12:46:29 | PMunch | Almost two hours ago I just realised.. |
12:47:37 | * | solitudesf quit (Ping timeout: 264 seconds) |
12:51:11 | * | solitudesf joined #nim |
12:58:59 | * | dulsi__ joined #nim |
13:01:23 | * | dulsi_ quit (Ping timeout: 240 seconds) |
13:18:41 | Zevv | #nim has stalled because of the heat wave I guess |
13:20:11 | * | Jesin quit (Ping timeout: 240 seconds) |
13:21:29 | * | apahl quit (Ping timeout: 244 seconds) |
13:23:41 | * | apahl joined #nim |
13:24:20 | PMunch | Heat wave? |
13:26:30 | Zevv | dude |
13:26:48 | FromDiscord | <haxscramper> If code passed as argument to macro raises exception traceback shows position of `quote do` and not original macro. How can I correct this? |
13:27:37 | PMunch | Zevv, I keep saying this, move to Norway :P |
13:27:39 | FromDiscord | <haxscramper> E.g if I have `quote do: somecode` I get part of traceback pointing to `quote do:` and not `somecode` |
13:27:51 | PMunch | Here it's sunny, but nice and cool |
13:28:33 | FromDiscord | <haxscramper> I tried creating new nim node using `newNimNode` with `lineInfoFrom` set to argument node but it didn't work |
13:29:01 | Zevv | guess I'm 20 years too old to get a higly skilled migrant permit :) |
13:29:15 | Zevv | and I'm not highly skilled enought, of course |
13:33:25 | * | Kaivo joined #nim |
13:36:51 | PMunch | I don't think it's that hard to move here :P |
13:37:01 | PMunch | You're even in the EU, so it's probably even easier |
13:37:06 | PMunch | http://ix.io/2tYy/nim |
13:37:11 | PMunch | What am I doing wrong here? |
13:37:27 | PMunch | I want to have two parsers, one that ignores whitespace, and one that includes it |
13:38:05 | PMunch | So that "100 200 +" would be parsed as either "100", "200", "+" or "100", " ", "200", " ", "+" |
13:38:15 | PMunch | But the second one stops if I have more than one space.. |
13:38:35 | PMunch | Oh.. |
13:38:36 | PMunch | Durr |
13:38:39 | PMunch | ?' ' |
13:47:58 | * | JustASlacker quit (Ping timeout: 260 seconds) |
13:57:43 | FromDiscord | <Kiloneie> > Is there some kind of application that Nim's singular inheritance cannot solve, but a multi one can ? |
13:59:23 | PMunch | I mean, considering you can solve any application without inheritance at all I'd say no |
13:59:28 | PMunch | But some things might be more ergonomic |
14:00:33 | * | PMunch quit (Quit: Leaving) |
14:02:56 | * | JustASlacker joined #nim |
14:06:45 | FromDiscord | <Kiloneie> I know that for games inheritance is very nice(probably why Nim even has oop), but i haven't come across a reason why to use multi inheritance. I did think of it, in game design terms for enemies and such, but it's not really needed, like you said. |
14:08:22 | * | JustASlacker quit (Ping timeout: 256 seconds) |
14:12:15 | FromDiscord | <lqdev> i personally prefer composition over inheritance in gamedev |
14:12:22 | FromDiscord | <lqdev> inheritance causes a few problems in the long run |
14:12:35 | * | gogoprog joined #nim |
14:14:54 | FromDiscord | <Kiloneie> i've read a bit on that, will have to cover that after im done with my current plan for object videos. |
14:17:18 | FromDiscord | <Kiloneie> And when i mean i read a bit, i can't even remember what i read xD...↵I did find online(especially reddit) that most people say to use composition over multiple inheritance like you said |
14:19:19 | Zevv | PMunch: you need help still? |
14:21:10 | FromDiscord | <Kiloneie> Where can i find details on composition in Nim ? Manual has 0 results for that word and nim tut part 2 has 2 mentions with no real explanation or examples(maybe dom's book has it... brb) |
14:22:34 | FromDiscord | <lqdev> you don't need special language features to have composition |
14:22:46 | FromDiscord | <lqdev> it's literally just putting objects inside of other objects |
14:22:52 | FromDiscord | <lqdev> rather than inheriting objects from objects |
14:23:21 | FromDiscord | <lqdev> a good example of composition is the component pattern: https://gameprogrammingpatterns.com/component.html |
14:23:40 | FromDiscord | <lqdev> maybe this can illustrate it better |
14:25:28 | FromDiscord | <Kiloneie> it's painful to read c++ code O,O |
14:25:58 | FromDiscord | <Kiloneie> i can't understand why i prefered this curly bracket spagheti for so long |
14:26:59 | * | theelous3 quit (Ping timeout: 240 seconds) |
14:28:10 | FromDiscord | <Kiloneie> Spaghetti https://media.discordapp.net/attachments/371759389889003532/743113600150929488/spagheti_code.PNG |
14:32:37 | * | Guest72535 quit (Ping timeout: 264 seconds) |
14:34:07 | * | dadada joined #nim |
14:34:31 | * | dadada is now known as Guest32962 |
14:36:48 | * | bung joined #nim |
14:40:59 | FromDiscord | <Kiloneie> Yeah, this is all logical design, i've actually done this in Game Maker(however you can in Game Maker lol), by making different kinds of controller objects for different system parts to be able to just plug and play idk debug info, audio, etc. |
14:41:09 | FromDiscord | <Kiloneie> Good read though. |
14:50:08 | * | def- quit (Quit: -) |
15:00:02 | * | arecacea1 quit (Remote host closed the connection) |
15:00:37 | * | arecacea1 joined #nim |
15:01:47 | Oddmonger | why cannot do include values in a set with a loop ? |
15:01:49 | Oddmonger | i can do: |
15:01:59 | Oddmonger | mySet:set[int16] |
15:02:07 | Oddmonger | mySet.incl( 1) |
15:02:10 | Oddmonger | but cannot |
15:02:17 | Oddmonger | for i in 1..10: |
15:02:23 | Oddmonger | mySet.incl( 1) |
15:02:26 | Oddmonger | wait a minute |
15:02:33 | Oddmonger | ah because of int vs int16 i bet |
15:05:46 | * | vicfred joined #nim |
15:07:15 | disruptek | Zevv: i saved that identifier bug for ya. |
15:08:29 | FromDiscord | <benash> sent a long message, see http://ix.io/2tYY |
15:09:06 | * | dulsi__ is now known as dulsi |
15:09:30 | * | JustASlacker joined #nim |
15:11:19 | FromDiscord | <lqdev> sent a long message, see http://ix.io/2tZ1 |
15:11:58 | FromDiscord | <Kiloneie> You don't need any language as a pre requisite for Nim |
15:12:06 | FromDiscord | <Kiloneie> only a little bit of C for FFI |
15:12:20 | FromDiscord | <Kiloneie> (interfacing with C libraries) |
15:13:21 | FromDiscord | <benash> That's what I figured, but then I looked at the source for some package that wrapped a C library and was rather taken aback |
15:13:45 | FromDiscord | <Kiloneie> https://nim-lang.org/learn.html here is a ton of learning material in case you missed it(i've got some video tuts on Nim on my channel as well if you aren't that advanced) |
15:14:30 | FromDiscord | <kodkuce> why nim suggest keeps crashing for me all time in vscode |
15:14:56 | FromDiscord | <Kiloneie> @kodkuce you mean no suggestions popping up ? |
15:15:50 | FromDiscord | <benash> @lqdev got it, I'm looking forward to trying macros out. Seems like such a cool idea. Helpful to know there might be a learning curve. |
15:16:21 | FromDiscord | <Kiloneie> there is also Nim in Action book if you are interested(costs about 30 dollars or so) it's really good. |
15:16:28 | FromDiscord | <lqdev> @benash macros are easy if you're only *constructing* AST but *introspecting* AST from symbols can be a bit of a pain |
15:16:29 | FromDiscord | <Kiloneie> it covers macros too |
15:16:41 | FromDiscord | <lqdev> so it depends on your needs |
15:18:25 | * | lbart quit (Ping timeout: 240 seconds) |
15:18:57 | FromDiscord | <kodkuce> sent a code paste, see https://play.nim-lang.org/#ix=2tZ2 |
15:19:25 | * | JustASlacker quit (Ping timeout: 240 seconds) |
15:19:25 | FromDiscord | <Kiloneie> No clue D: |
15:19:31 | FromDiscord | <Kiloneie> never happened to me |
15:19:43 | * | lbart joined #nim |
15:19:43 | * | lbart quit (Changing host) |
15:19:43 | * | lbart joined #nim |
15:19:46 | FromDiscord | <benash> @lqdev So e.g. syntax sugar would fall into the easier category? |
15:19:53 | FromDiscord | <lqdev> yeah |
15:19:55 | FromDiscord | <kodkuce> meybe cuz i am using vscodium |
15:19:58 | FromDiscord | <benash> got it |
15:20:13 | FromDiscord | <Kiloneie> maybe, it just might be the ide |
15:20:35 | FromDiscord | <Kiloneie> idk VS code even runs on my dual core 10 year old laptop lol, give it a try |
15:20:55 | FromDiscord | <Kiloneie> wait |
15:21:04 | FromDiscord | <kodkuce> i have realativly good pc its not about that its about this extension |
15:21:13 | FromDiscord | <kodkuce> i think i tryed all 4 and all crash |
15:21:20 | FromDiscord | <Kiloneie> hmm i've never heard of this fork of vs code, interesting |
15:21:21 | FromDiscord | <kodkuce> nim, nim alt, nim lsp |
15:21:30 | FromDiscord | <haxscramper> If I wrap macro body in `block` statement (named or unnamed) all unnamed `break`s inside jump to it. Is it possible to somehow detect `break` triggering inside macro body, or break two scopes at a time (or explicitly break out of `while/for`)? It is possible to just rewrite body to set some kind of `breakHappened` flag, but that's just annoying to implement. |
15:21:33 | FromDiscord | <kodkuce> its just vscode whiout microsoft boat |
15:21:35 | FromDiscord | <kodkuce> (edit) 'boat' => 'bloat' |
15:21:46 | FromDiscord | <Kiloneie> idk try plain microsoft vs code or some other IDE |
15:22:06 | * | fredrikhr quit (Read error: Connection reset by peer) |
15:22:40 | FromDiscord | <Kiloneie> allthought im not sure why this would have problems based on it's description it's just vs code without tracking stuff |
15:24:18 | FromDiscord | <Kiloneie> it might be some dependency problem though |
15:25:20 | Zevv | disruptek: so whats the status |
15:27:58 | FromDiscord | <kodkuce> ok got it working i think, at least no more crash |
15:28:12 | FromDiscord | <kodkuce> head to manuly install vscode c++ extension |
15:28:34 | FromDiscord | <kodkuce> to run offical nim plug |
15:28:52 | FromDiscord | <kodkuce> for lsp one i did not sow it need this dep |
15:28:57 | FromDiscord | <kodkuce> anyway now no error |
15:31:27 | FromDiscord | <Kiloneie> huh, is c++ extension required by Nim ? I don't think it is... |
15:34:09 | FromGitter | <tim-st> Should the following output `1,2,3` or `3,2,1`? |
15:34:11 | FromGitter | <tim-st> proc main() = ⏎ for i in 1..3: ⏎ ⏎ ```defer: ⏎ echo i``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=5f340bf24a53c832173554c4] |
15:34:47 | FromDiscord | <Kiloneie> default iterator is from low to high... |
15:34:59 | FromDiscord | <lqdev> 1, 2, 3 |
15:35:08 | FromGitter | <tim-st> defer has no effect here? |
15:35:35 | FromGitter | <tim-st> https://play.golang.org/p/Pauo8iHAZK3 |
15:35:40 | FromDiscord | <Kiloneie> not like that no... |
15:35:54 | FromGitter | <tim-st> ok, thanks |
15:36:00 | disruptek | defer is a try/finally under the hood. |
15:36:17 | FromGitter | <tim-st> ok |
15:36:19 | FromDiscord | <Kiloneie> i don't know Go, but that defer is something completely different |
15:36:22 | disruptek | but, try not to use defer. |
15:36:34 | disruptek | it's something with very limited, albeit valid, use-cases. |
15:36:41 | disruptek | it's code smell, generally. |
15:36:50 | FromGitter | <tim-st> just wondered if something was broken |
15:37:09 | disruptek | not in that example. (i didn't look at the example.) 😉 |
15:37:43 | FromDiscord | <Kiloneie> sometimes same named stuff in one language is completely different in another... |
15:38:15 | FromGitter | <tim-st> but not often, I think |
15:38:39 | disruptek | !rfc author:disruptek try |
15:38:40 | disbot | https://github.com/nim-lang/RFCs/issues/218 -- 3try/except scope -- should it be a thing? |
15:43:26 | FromDiscord | <Kiloneie> I prefer try with finally syntax, defer makes my head freeze |
15:46:32 | FromDiscord | <Danny Hpy> uh how can I compile something for an another architecture? |
15:46:42 | FromDiscord | <Danny Hpy> x86_64 -> powerpc for instance? |
15:47:33 | FromDiscord | <Kiloneie> this should help you: https://nim-lang.org/docs/nimc.html |
15:48:00 | disruptek | put a little sugar in my bowl. |
15:49:41 | FromDiscord | <Danny Hpy> I tried but https://media.discordapp.net/attachments/371759389889003532/743134113652801546/unknown.png |
15:50:14 | FromDiscord | <Danny Hpy> it doesn't seem to be supported at all |
15:51:24 | FromDiscord | <lqdev> you also need to have a separate C compiler for powerpc |
15:51:32 | FromDiscord | <lqdev> and specify that in nim.cfg |
15:52:00 | disruptek | looks like you are specifying -march=x86-64 |
15:52:15 | FromDiscord | <Danny Hpy> oh thanks, i'll take a look lqdev |
15:56:02 | FromDiscord | <XxDiCaprioxX> What do I have to write into my nim.cfg file if I want -d:ssl done automatically? |
15:56:07 | * | sepples quit (Quit: Bye) |
15:56:36 | disruptek | Zevv: i'm picturing tubes as forming a rendezvous between a continuation representing a producer and a continuation representing a consumer. |
15:56:44 | disruptek | dicaprio: try -d:ssl |
15:57:05 | FromDiscord | <XxDiCaprioxX> is that all I have to put in the file? |
15:57:09 | FromDiscord | <lqdev> yup |
15:57:24 | disruptek | personally, i prefer --define:ssl |
15:58:26 | disruptek | Zevv: iteration simply sucks values from the producer until the trampoline fails. |
15:59:37 | FromDiscord | <XxDiCaprioxX> And for a bot, what do I have to do with the .exe? |
15:59:45 | disruptek | invoke it. |
15:59:55 | FromDiscord | <XxDiCaprioxX> what does that mean? |
16:00:07 | disruptek | execute it. |
16:00:15 | FromDiscord | <XxDiCaprioxX> but a discord bot |
16:00:18 | FromDiscord | <XxDiCaprioxX> I meant that |
16:00:35 | disruptek | i don't know. |
16:00:55 | FromDiscord | <XxDiCaprioxX> Okay thanks regardless |
16:03:30 | FromDiscord | <Danny Hpy> @XxDiCaprioxX Execute it? |
16:03:47 | FromDiscord | <XxDiCaprioxX> For a discord bot? |
16:03:53 | FromDiscord | <Danny Hpy> yes |
16:04:07 | FromDiscord | <Danny Hpy> bots are like any other software after all |
16:04:19 | FromDiscord | <XxDiCaprioxX> okay |
16:04:49 | FromDiscord | <Varriount> Helloooo Nimland |
16:05:13 | FromDiscord | <XxDiCaprioxX> It did nothing |
16:05:29 | FromDiscord | <XxDiCaprioxX> The bot is offline |
16:05:41 | FromDiscord | <Danny Hpy> Did you have a token? |
16:05:48 | FromDiscord | <Danny Hpy> execute it from the command line to have an output |
16:05:55 | FromDiscord | <XxDiCaprioxX> okay |
16:05:59 | FromDiscord | <XxDiCaprioxX> and yes it does |
16:11:56 | disruptek | clyybber: i'm an idiot. my mangling tests were only testing stdlib. 🤦 |
16:19:51 | * | endragor quit (Read error: Connection reset by peer) |
16:20:17 | * | endragor joined #nim |
16:26:37 | * | endragor quit (Ping timeout: 264 seconds) |
16:31:45 | * | gogoprog quit (Read error: Connection reset by peer) |
16:32:34 | * | gogoprog joined #nim |
16:34:50 | * | rockcavera quit (Remote host closed the connection) |
16:40:59 | Zevv | disruptek: think of it as you like. for me it's just putting the stack on the heap :) |
16:42:00 | ForumUpdaterBot | New thread by Gabbhack: Play.nim-lang.org has been down for several hours, see https://forum.nim-lang.org/t/6671 |
16:43:48 | * | fredrikhr joined #nim |
16:44:32 | * | rockcavera joined #nim |
16:51:15 | * | JustASlacker joined #nim |
16:51:47 | Oddmonger | why only 8192 values in a set[int16] ? |
16:52:00 | Oddmonger | isn't 2^16 ? |
16:53:34 | disruptek | Zevv: we're way beyond that. |
16:53:44 | disruptek | when are you going to fix typed, anyway? |
16:55:52 | Zevv | no no you got it wrong |
16:56:03 | Zevv | I did my part yesterday because you were so called "blocked" |
16:56:05 | Zevv | you are unblocked now |
16:56:07 | Zevv | your turn |
16:56:10 | Zevv | it takes two to salsa |
16:57:15 | * | superbia2 joined #nim |
16:57:26 | Zevv | this clyybberization, did it make things better? |
16:58:45 | * | JustASlacker quit (Ping timeout: 240 seconds) |
16:59:45 | * | superbia1 quit (Ping timeout: 240 seconds) |
17:01:20 | * | waleee-cl joined #nim |
17:02:22 | * | Trustable joined #nim |
17:04:57 | * | liblq-dev joined #nim |
17:09:13 | Zevv | didn't we decide not to let the trampoline run the continuation? |
17:12:45 | * | vicfred quit (Quit: Leaving) |
17:13:36 | * | natrys joined #nim |
17:20:32 | disruptek | what? |
17:20:35 | Zevv | man typed macros are nasty |
17:20:48 | disruptek | clyybberization is a solution to only part of the problem. |
17:21:18 | disruptek | there doesn't have to be only one trampoline. |
17:21:33 | disruptek | and, yes, typed macros are a clusterfuck. |
17:21:45 | Zevv | everything I try gets barfed on |
17:22:11 | disruptek | i just deleted my first effort on dust. |
17:22:41 | Zevv | the number of typed macros in the stdlib is discourigingly low |
17:22:47 | disruptek | pretty rare that i delete anything, no matter how terrible. usually i just publish it and then try to get other people to use it. 😁 |
17:23:27 | Zevv | you know what mr A will say when we complain, right |
17:23:34 | Zevv | "make a compiler plugin" |
17:23:47 | disruptek | well, ima shelve mangling until i can talk to the boss. |
17:24:00 | * | tane joined #nim |
17:24:11 | disruptek | i don't know if i want to tackle csp before cps. |
17:24:33 | Zevv | ok, so, typed is a hurdle we probably don't want to spend time on |
17:24:40 | Zevv | so either we go into the compiler |
17:24:41 | disruptek | he wants it in the compiler so it's more of a technical moat. |
17:24:53 | Zevv | or further mold the untyped version until it is all we can make of it |
17:25:55 | disruptek | i wouldn't rule out typed. |
17:26:10 | * | liblq-dev quit (Quit: WeeChat 2.9) |
17:27:54 | Zevv | well, i can't even seem to figure out how to assign something to 'result', because hwatever I do it tells me that I'm trying to redefine the symbol |
17:28:32 | disruptek | is this head? |
17:28:39 | disruptek | typed? |
17:28:51 | Zevv | no, I'm just fiddling in that |
17:29:03 | Zevv | and makeing some t.nims |
17:29:13 | disruptek | taste test says undeclared identifier: continuation. |
17:30:05 | disruptek | ah, the ast is bad. |
17:30:27 | disruptek | who wrote this crap? |
17:30:36 | disruptek | absolute 💩 |
17:30:50 | Zevv | oh I |
17:30:54 | Zevv | wasn't even looking at that yet |
17:32:23 | Zevv | oh wait |
17:32:28 | Zevv | so I just learned something |
17:32:35 | Zevv | in a typed macro, you get typed ast |
17:32:43 | disruptek | you're kidding. |
17:32:45 | Zevv | but the ast you need to generate in there, must be of the untyped kind |
17:32:50 | Zevv | which I did not realize |
17:32:50 | disruptek | okay, pull my fix. |
17:33:16 | Zevv | is that right ^^ |
17:33:19 | Zevv | what I typed there? |
17:33:23 | Zevv | or am I 2 years behind again? |
17:33:31 | disruptek | well, you won't create symbols but you can create idents that have the same strVal. |
17:33:48 | FromDiscord | <Recruit_main707> so essentially, yes |
17:33:55 | Zevv | yeah but stuff like "nnkHiddenSubConv.newTree" |
17:33:57 | disruptek | you can reuse symbols, though. |
17:33:57 | Zevv | what is that? |
17:34:00 | * | JustASlacker joined #nim |
17:34:13 | disruptek | show me? |
17:34:50 | * | kungtotte quit (Read error: Connection reset by peer) |
17:35:03 | Zevv | this is a typed proc doing `result = env0(fn: t)` |
17:35:07 | Zevv | http://ix.io/2tZK |
17:35:41 | disruptek | you wrote this? |
17:35:51 | Zevv | no this comes out of a macro doing a astGenRepr |
17:35:51 | disruptek | or are you dumping it somehow? |
17:35:55 | Zevv | yeah |
17:36:02 | * | kungtotte joined #nim |
17:36:05 | Zevv | anyway, nevermind, this new info might help |
17:36:06 | disruptek | well, i don't do that. |
17:36:27 | disruptek | i mean, i don't use it because i don't understand it. |
17:36:35 | Zevv | right |
17:36:38 | * | Trustable quit (Remote host closed the connection) |
17:36:44 | Zevv | ok, so what test do you run now with your recent fix? |
17:37:04 | disruptek | nothing yet. |
17:37:04 | Zevv | like in, what file |
17:37:07 | Zevv | ok |
17:37:18 | disruptek | i am taste testing. |
17:37:56 | disruptek | treeRepr is really the only way to fly. |
17:38:27 | Zevv | eah |
17:38:41 | Zevv | ok, so what happens now it seems, is that the 'fn' we want to set in the env picks up the wrong one of the two |
17:38:47 | Zevv | it gets the bootstrap |
17:38:51 | disruptek | right. |
17:38:59 | disruptek | because we're not calling it with an argument. |
17:40:22 | Zevv | it's not about calling - it's about assigning it to 'fn' |
17:40:25 | Zevv | which is proc(c: C): C |
17:40:39 | Zevv | there *is* a proc with that signature |
17:41:00 | Zevv | oh no it's assigning t() not t_clyybber() |
17:41:04 | disruptek | oh, but it's not foo. |
17:41:04 | Zevv | sure |
17:41:05 | disruptek | yeah. |
17:41:14 | disruptek | damn clyybber. |
17:42:54 | disruptek | yay, i did the first test. |
17:44:18 | Zevv | and it failed |
17:44:28 | disruptek | why? |
17:44:33 | Zevv | just a guess? |
17:44:36 | Zevv | did it pass? |
17:44:39 | disruptek | sure. |
17:44:44 | Zevv | push that shizzle |
17:44:54 | Zevv | I was still searching for the ObjConstr |
17:45:03 | disruptek | oh, it's the rootResult call. |
17:45:21 | disruptek | but now we get to deal with deprecated cpsMagic. |
17:46:24 | disruptek | i forget how we were gonna solve this. |
17:47:08 | Zevv | what was the problem |
17:47:28 | disruptek | jield() is not valid input for the typed macro. |
17:47:49 | Zevv | right |
17:48:00 | Zevv | again, what test file are you running |
17:48:03 | Zevv | so we look at the same stuff |
17:48:12 | disruptek | taste.nim |
17:48:20 | Zevv | dude |
17:48:22 | Zevv | I can't run that |
17:48:22 | Zevv | why |
17:48:28 | disruptek | pull now. |
17:48:33 | disruptek | why? |
17:48:43 | Zevv | because of dpendency hell the other day |
17:48:59 | disruptek | i mean... |
17:49:07 | Zevv | trying agan |
17:49:25 | Zevv | Error: Cannot satisfy the dependency on cligen 1.1.0 and cligen 0.9.41 |
17:49:36 | disruptek | oh this is a nimble thing? |
17:49:40 | Zevv | really, I'm too stupid to use *any* kind of package manager |
17:49:53 | Zevv | I don't know, I do 'bootsrtap.sh' |
17:49:57 | disruptek | just put testes and cutelog and bump in a directory. |
17:50:08 | disruptek | then --path="/some/where/testes/" |
17:50:16 | Zevv | sigh |
17:50:16 | Zevv | ok |
17:50:18 | disruptek | then --path="/some/where/bump/" |
17:50:24 | disruptek | then --path="/some/where/cutelog/" |
17:50:40 | disruptek | pm is stupid anyway. |
17:52:11 | Zevv | now you've done it |
17:52:11 | Zevv | SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
17:52:13 | Zevv | on the compiler |
17:52:21 | disruptek | yeah, that's a feature. |
17:52:37 | disruptek | some call it, "Clyybber's Revenge" |
17:52:45 | disruptek | use cpp |
17:53:03 | Zevv | no luck |
17:53:23 | disruptek | are you trying to use arc? |
17:53:27 | Zevv | nope |
17:53:31 | Zevv | I don't dare |
17:53:38 | disruptek | oh, use --define:release too. |
17:53:53 | disruptek | you have to because of my testes. |
17:54:02 | Zevv | yay |
17:54:09 | disruptek | my testes crash the compiler. |
17:54:16 | Zevv | when you are not looking I will rip out all of that stuff from this repo |
17:54:18 | Zevv | and your event queue |
17:54:22 | disruptek | i know. |
17:54:39 | Zevv | \o/ jield complaints |
17:54:40 | Zevv | soo |
17:54:43 | Zevv | let us ponder |
17:55:05 | disruptek | we can reintroduce cpsMagic untyped. then compose the differing procs with the same names. |
17:55:16 | disruptek | but i just hate to do this. |
17:56:44 | disruptek | what does your puzzler say? |
17:56:59 | Zevv | Cannot predict now. |
18:00:07 | * | JustASlacker quit (Ping timeout: 256 seconds) |
18:00:54 | Oddmonger | for profiling , should i do something more than: «import profiler» , and compiling with «--stacktrace:on --profiler:on» ? |
18:01:22 | disruptek | is that all the docs say to do? |
18:01:24 | Oddmonger | profile_results.txt is empty |
18:01:39 | Oddmonger | disruptek: i have read https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html |
18:02:01 | FromDiscord | <lqdev> it's `import nimprof` not `import profiler` |
18:02:55 | FromDiscord | <lqdev> and --stacktrace:on is default |
18:03:13 | Oddmonger | yes import nimprof (it was correct in the source) |
18:03:16 | Zevv | fwiw: if you are on linux, you might want to do your profiling with `perf` instead - that usually gives me better results then the nim profiler |
18:03:19 | Zevv | ymmv |
18:03:39 | disruptek | perf is tried-and-true. |
18:04:29 | Oddmonger | well it was just quick test between set[int16] and IntSet |
18:05:27 | Oddmonger | http://ix.io/2tZR |
18:05:36 | disruptek | https://github.com/disruptek/criterion |
18:06:07 | Oddmonger | well anyway i guess the cast will spoil the generic set incl |
18:07:11 | Oddmonger | ok disruptek , i will try it |
18:08:22 | disruptek | Zevv: so. |
18:08:25 | Zevv | disruptek: we make a macro "whatever" that does nothing |
18:08:32 | Zevv | and we do "whatever jield()" |
18:08:40 | Zevv | then it's valid enough to get through the first pass |
18:09:00 | * | hnOsmium0001 joined #nim |
18:09:02 | disruptek | but whatever will have to produced typed ast. |
18:09:24 | Zevv | would it |
18:09:37 | disruptek | it will if it's inside .cps. |
18:10:15 | disruptek | we just put magic back in for now. |
18:10:47 | Zevv | bah but sure |
18:11:35 | * | krux02_ joined #nim |
18:12:05 | * | skelett1 joined #nim |
18:12:16 | disruptek | hmm, i forget how to handle sleep's many forms. |
18:12:35 | Zevv | so explain to me again, because I am again stupid |
18:12:45 | * | zielmicha___ joined #nim |
18:12:58 | Zevv | yield() needs to do continuation.yield() |
18:13:04 | Zevv | but continuation does not yet exist |
18:13:08 | disruptek | right. |
18:13:23 | disruptek | and yield() also has a return value... |
18:13:32 | Zevv | right |
18:14:08 | disruptek | okay, i patched it. pull. |
18:15:25 | * | vicfred joined #nim |
18:15:56 | disruptek | removed the cps prefix from taste calls. you can pull this, too. |
18:16:12 | disruptek | now we get a more interesting defect. |
18:16:53 | disruptek | kinda ridiculous that my testes crashes the compiler. |
18:17:36 | disruptek | bentley is on a hunger strike to protest youth in asia. |
18:18:01 | disruptek | i don't understand it, either. |
18:20:31 | * | Northstrider[m] quit (*.net *.split) |
18:20:32 | * | darrion_oakenbow quit (*.net *.split) |
18:20:32 | * | guelosk[m] quit (*.net *.split) |
18:20:33 | * | skrylar[m] quit (*.net *.split) |
18:20:34 | * | krux02 quit (*.net *.split) |
18:20:34 | * | zielmicha__ quit (*.net *.split) |
18:20:34 | * | skelett quit (*.net *.split) |
18:20:34 | * | FromGitter quit (*.net *.split) |
18:20:35 | * | zielmicha___ is now known as zielmicha__ |
18:20:53 | Zevv | he has problems with youth in asia? |
18:20:56 | * | FromGitter joined #nim |
18:21:16 | disruptek | i think that's what he said. |
18:21:28 | disruptek | his accent is kinda thick when he's been drinking. |
18:21:29 | * | leorize[m] quit (Remote host closed the connection) |
18:21:29 | * | hnOsmium0001[m] quit (Remote host closed the connection) |
18:21:29 | * | codic quit (Remote host closed the connection) |
18:21:30 | * | BitPuffin quit (Read error: Connection reset by peer) |
18:21:31 | * | ee7[m] quit (Read error: Connection reset by peer) |
18:21:33 | Zevv | well, free country and all that, right |
18:21:33 | * | planetis[m] quit (Remote host closed the connection) |
18:21:33 | * | MTRNord[m] quit (Remote host closed the connection) |
18:21:35 | * | unclechu quit (Read error: Connection reset by peer) |
18:21:36 | * | silvernode[m] quit (Read error: Connection reset by peer) |
18:21:39 | * | Zambyte[m] quit (Write error: Connection reset by peer) |
18:21:40 | * | lnxw37d4 quit (Remote host closed the connection) |
18:21:43 | * | j4nvkvc quit (Remote host closed the connection) |
18:21:43 | * | GitterIntegratio quit (Read error: Connection reset by peer) |
18:21:45 | * | slackytude[m] quit (Remote host closed the connection) |
18:21:45 | * | jklhyd[m] quit (Remote host closed the connection) |
18:21:45 | * | swamptest1[m] quit (Remote host closed the connection) |
18:21:47 | * | Zoom[m] quit (Read error: Connection reset by peer) |
18:21:47 | * | rridley[m] quit (Remote host closed the connection) |
18:21:47 | * | einichi quit (Write error: Connection reset by peer) |
18:21:47 | * | reversem3 quit (Read error: Connection reset by peer) |
18:21:47 | disruptek | i guess. fuck'im. |
18:22:32 | * | Northstrider[m] joined #nim |
18:22:50 | Zevv | so, up to sleep_magic things run |
18:22:55 | Zevv | which is already pretty impressive |
18:23:37 | disruptek | sleep_magic? |
18:23:54 | disruptek | oh, well these trampolines shouldn't exist, right? |
18:25:21 | disruptek | lol look at that error. |
18:25:43 | FromDiscord | <Kiloneie> sent a long message, see http://ix.io/2tZZ |
18:26:56 | disruptek | oh, i think we are ready to remove untyped hacks. |
18:28:28 | * | OMGOMG quit (Ping timeout: 256 seconds) |
18:29:18 | * | ee7[m] joined #nim |
18:29:51 | disruptek | yay, it works. |
18:30:01 | * | OMGOMG joined #nim |
18:38:08 | Zevv | no man |
18:38:12 | Zevv | cant be |
18:38:14 | Zevv | too easy |
18:38:22 | Zevv | oh suns down, imma outside! |
18:43:27 | Yardanico | btw, playground is down for a few hours already |
18:46:54 | jken | Do you guys typically have one types.nim file you import around your codebase, or do you have types spread throughout your modules/ |
18:47:14 | Yardanico | well it always depends |
18:47:25 | Zevv | so disruptek now how does the Cont get into the magic procs? because you throw that argument out, right |
18:47:35 | Yardanico | if you have loosely coupled parts of your program you might not need a single types.nim but rather types in different parts |
18:48:12 | Zevv | jken: you cant make mutualle recursive types out of one type block |
18:48:27 | Zevv | its a thing i hated since day 1, but its a deliberate choice |
18:48:38 | * | def- joined #nim |
18:50:18 | jken | I am not sure what mutualle recursive types are, so probably don't need to worry about that for now |
18:50:29 | Yardanico | type A = ref object field: B |
18:50:33 | jken | I ask because I put all my types in one file at one point and dont recall exactly why |
18:50:34 | Yardanico | type B = ref object field: A |
18:50:39 | jken | ah |
18:51:00 | Zevv | mutuallY |
18:51:01 | Zevv | typo |
18:53:48 | * | lritter quit (Ping timeout: 256 seconds) |
18:55:17 | mbuchel | is there a way to see if a number is a proper enumeration? |
18:57:17 | Yardanico | wdym? |
18:57:23 | Yardanico | numbers and enum mebers are different things |
18:57:59 | mbuchel | so i have an enum that can hold various values like 2 4 5 6 8 |
18:58:18 | mbuchel | i want to have a variable x which i can easily check if it is an enumeration or not |
18:58:26 | Yardanico | are you by any chance doing bitflags? |
18:58:32 | Yardanico | like when interfacing with C |
18:58:33 | mbuchel | nope |
18:58:39 | mbuchel | not bitflags |
18:58:41 | Yardanico | is the enum with holes or not? |
18:58:57 | mbuchel | yes it has holes |
18:59:04 | mbuchel | well it is supposed to |
19:00:20 | mbuchel | https://0x0.st/iYPO.nim |
19:00:25 | mbuchel | here is an example code |
19:00:35 | FromDiscord | <drsensor👹> Hi, anyone know a pretty print versions of `echo`?↵kinda hard squeeze my eyes for inspecting data structure in one line 😂 |
19:00:44 | mbuchel | the issue is a value that should not exist is being treated as such an enumeration |
19:01:04 | Yardanico | @drsensor for what data structure exactly? |
19:01:13 | Yardanico | you can always define your own $ for your own datastructure |
19:01:17 | Yardanico | and do all the prettyp rinting you want |
19:01:18 | mbuchel | drsensor: do you mean $? |
19:02:06 | Yardanico | mbuchel: well one simple way is to just define a set of all enum members (even as a constant) |
19:02:20 | Yardanico | and then check like "CombustibleLemon(23) in myset" |
19:02:45 | mbuchel | yep i know that way, and tried that way before but i want to know if there is a better way of doing it |
19:02:55 | FromDiscord | <drsensor👹> sent a code paste, see https://play.nim-lang.org/#ix=2u0d |
19:02:56 | Yardanico | well, I'm not sure for the enum with holes |
19:03:09 | mbuchel | what if the enum does not have holes? |
19:03:10 | Yardanico | e.g. you can't iterate over it safely |
19:03:19 | Yardanico | but you can over normal enums |
19:03:43 | Yardanico | @drsensor (http://ix.io/2u0d) and what's your problem there? |
19:04:03 | Yardanico | did you import the tables module in this module? |
19:04:18 | * | superbia2 is now known as superbia |
19:04:19 | Yardanico | you can always do custom traversal if you want pretty-printing |
19:05:13 | Yardanico | It's really not simple to make a generic solution which will pretty-print all different data structures |
19:05:20 | Yardanico | because they can be very different, contain cycles, etc |
19:06:15 | FromDiscord | <drsensor👹> I mean if there is something similiar to `dbg` macro in nimlang. (it does do pretty printing)↵https://doc.rust-lang.org/std/macro.dbg.html |
19:06:45 | Yardanico | how does it to pretty-printing for types like hashmaps? |
19:07:14 | Yardanico | a thing like that was added to strformat in devel, but it does not do "pretty-printing", it just shows a human-readable output |
19:07:24 | Yardanico | you can always make your own dbg easily in nim |
19:08:45 | mbuchel | also is there a way to fill an array using the Haskell format? |
19:08:50 | Yardanico | what haskell format? :P |
19:09:01 | Yardanico | there's https://nim-lang.org/docs/algorithm.html#fill%2CopenArray%5BT%5D%2CT |
19:09:05 | Yardanico | and https://nim-lang.org/docs/algorithm.html#fill%2CopenArray%5BT%5D%2CNatural%2CNatural%2CT |
19:10:07 | * | reversem3 joined #nim |
19:10:07 | * | MTRNord[m] joined #nim |
19:10:07 | * | j4nvkvc joined #nim |
19:10:07 | * | Zambyte[m] joined #nim |
19:10:07 | * | hnOsmium0001[m] joined #nim |
19:10:07 | * | codic joined #nim |
19:10:07 | * | unclechu joined #nim |
19:10:07 | * | guelosk[m] joined #nim |
19:10:07 | * | GitterIntegratio joined #nim |
19:10:08 | * | planetis[m] joined #nim |
19:10:08 | * | einichi joined #nim |
19:10:08 | * | darrion_oakenbow joined #nim |
19:10:08 | * | rridley[m] joined #nim |
19:10:08 | * | BitPuffin joined #nim |
19:10:08 | * | lnxw37d4 joined #nim |
19:10:08 | * | leorize[m] joined #nim |
19:10:13 | * | swamptest1[m] joined #nim |
19:10:13 | * | Zoom[m] joined #nim |
19:10:14 | * | slackytude[m] joined #nim |
19:10:14 | * | silvernode[m] joined #nim |
19:10:14 | * | skrylar[m] joined #nim |
19:10:16 | * | jklhyd[m] joined #nim |
19:11:28 | FromDiscord | <lqdev> @drsensor👹 https://nim-lang.org/docs/sugar.html#dump.m%2Ctyped |
19:11:38 | Yardanico | it doesn't return the value itself |
19:11:43 | Yardanico | like that rust dbg macro |
19:11:49 | Yardanico | but it's easy to reimplement |
19:11:54 | Yardanico | with just nim templates |
19:12:35 | mbuchel | [[p * p, p * p + 2 * p..] | p <- tail primes] |
19:12:38 | mbuchel | something like this |
19:13:00 | Yardanico | not sure that's what supposed to mean :P |
19:13:08 | Yardanico | maybe you just want the fill from algorithm >? |
19:13:14 | Yardanico | I linked it already |
19:13:40 | mbuchel | yep i saw it and that is not what i want, i want to have a formula i can use |
19:13:59 | Yardanico | @drsensor https://tio.run/##PY6xDoMwDET3fMWpSiVoq0rQTkh8QOd2QwwBTBspJIiYoV9PHYYuvrPPera307bZaQ4LI/KysnVRKaZpdoYJQ/fO@jBQhdXzd6Yh/zvUUEAffGTYVOpdjGdr2Ab/8GPIcllxxFgoSp5IMqD@E3BodFHpsoW@SaLvBxzRJMB1tI68megCvffOevEm8is8ednfySUTZCswEaXSCSOYcneduPS4wQlljjOKbfsB |
19:14:06 | Yardanico | you can easily reimplement that rust macro with a nim template |
19:14:24 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2u0f |
19:14:33 | mbuchel | so what that format says is create a list with the elements following formula a, where the local variables are given on the right hand side of the | |
19:14:49 | mbuchel | formula a is on the left hand side of the | |
19:14:52 | Yardanico | I think you can just use a simple for loop. no? :P |
19:14:58 | Yardanico | I'm not aware of anything like this |
19:15:03 | Yardanico | maybe you can do it with mapIt |
19:15:14 | mbuchel | you could, but i would like to have it during the compilation time |
19:15:23 | Yardanico | have what exactly? |
19:15:29 | Yardanico | most of nim code works at compile-time just fine |
19:15:35 | mbuchel | creating the array |
19:15:41 | Yardanico | yes, you can do it at compile-time |
19:16:27 | FromDiscord | <Rika> wrap it in a static block |
19:16:59 | mbuchel | ya i know about static blocks here but i am just curious if there was any sugar syntax that was made to do the same thing |
19:17:04 | mbuchel | so it is more readable |
19:17:06 | Yardanico | I don't think so |
19:17:09 | Yardanico | you can always make one :P |
19:17:22 | FromDiscord | <Rika> it would probably be less readable if you omit the static block |
19:18:09 | mbuchel | const x = [x | x <- zip([0..10], [10..20])] |
19:18:18 | mbuchel | this seems a bit more readable if you ask me |
19:18:27 | Yardanico | we have a collect macro |
19:18:36 | Yardanico | https://nim-lang.org/docs/sugar.html#collect.m%2Cuntyped%2Cuntyped |
19:18:41 | FromDiscord | <Rika> looks horrible to me; anyway, this is opinionated so |
19:18:43 | Yardanico | it's the nim alternative to python list comprehensions :) |
19:19:35 | Yardanico | where was the lc macro but it worked worse and was deprecated and removed |
19:20:08 | mbuchel | yes the lc macro was what i was thinking of |
19:20:18 | Yardanico | why not collect? |
19:20:21 | mbuchel | that was from earlier nim like 0.18? |
19:20:27 | Yardanico | it's much more readable |
19:21:01 | Yardanico | mbuchel: you can find it in https://github.com/nim-lang/graveyard/blob/master/lc/src/lc.nim |
19:21:17 | FromDiscord | <Rika> basically, we dont have the same standard of "readability" as you so |
19:21:21 | mbuchel | like i will use collect for this, but it seems to be focused on only sequences |
19:21:28 | FromDiscord | <Rika> not saying anyone's is better but its just not the same |
19:21:31 | mbuchel | SHHHHHH i am not autistic |
19:21:35 | Yardanico | mbuchel: well, you want an array? |
19:21:41 | FromDiscord | <Rika> hey i didnt say that 😦 |
19:21:43 | Yardanico | you can always just do a little bit of work to make it an array |
19:22:04 | FromDiscord | <Rika> yardanico: cant you use an array with collect? |
19:22:18 | Yardanico | but you wouldn't really easily know the length of an array |
19:22:23 | Yardanico | and idk if you can |
19:22:25 | mbuchel | ya i will eventually, i been busy at my work once i am finished with some things i likely will work on updating some tools that i am already using |
19:22:51 | disruptek | Zevv: how does Cont get into magic? you write your magical procs to take Cont as an argument. |
19:23:05 | FromDiscord | <Rika> it should be possible, just make a dummy proc that returns an array and you're golden, no? |
19:23:29 | disruptek | all my procs are dummies. |
19:24:58 | ForumUpdaterBot | New thread by Kiloneie: Improving Nim for Beginners video series's AUDIO, see https://forum.nim-lang.org/t/6672 |
19:26:08 | Zevv | disruptek: then I again dont understand stuff |
19:26:19 | disruptek | which stuff? |
19:26:21 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2u0k |
19:26:23 | Zevv | but Im not behind my computer now so will look into it later |
19:26:26 | disruptek | kk |
19:26:32 | Zevv | you call yield(). without the cont. |
19:27:57 | disruptek | it should get rewritten to yield(continuation). |
19:30:43 | * | Jesin joined #nim |
19:32:14 | * | JustASlacker joined #nim |
19:35:21 | Zevv | ok, but continuation does not exist at the time the macro runs |
19:36:43 | disruptek | i guess i'm confused. |
19:37:07 | disruptek | we're talking about code in the .cps. body which gets added to a new proc which is called by the bootstrap, which creates the continuation, right? |
19:38:28 | disruptek | i pushed some more. |
19:40:18 | * | Vladar quit (Quit: Leaving) |
19:41:19 | * | sky70 joined #nim |
19:44:30 | disruptek | hmm, the bootstrap is missing the locals now. did i just never impl this? |
19:45:42 | * | sky70 quit (Remote host closed the connection) |
19:46:33 | disruptek | it's tricky because we have to handle accepting arguments inside and outside of .cps. we're developing a real Clyybber matrix, here. |
19:55:14 | Zevv | we should rename the project to "clyybber" |
19:56:14 | * | vicfred quit (Quit: Leaving) |
19:56:31 | disruptek | i have three other projects with that name. |
19:57:32 | disruptek | i think we just make a tweener that merges arguments into the env. |
19:59:20 | disruptek | seems like we had this functionality already sorted out, though. |
20:00:24 | disruptek | yeah, the preamble. |
20:06:06 | shashlick | https://typing-is-hard.ch |
20:06:57 | Yardanico | Rust uses a variant of HM though |
20:07:48 | Yardanico | "undecidable, since evaluation of recursive functions at compile time is possible, thus requiring the compiler to solve the halting problem." for Zig |
20:07:53 | Yardanico | so same for Nim? |
20:07:55 | Yardanico | what about sound/unsound |
20:09:01 | Zevv | I think it's undecidable indeed, for exact that reason |
20:09:28 | Zevv | "A type checker is sound if it only accepts correctly typed programs." |
20:11:49 | * | abm quit (Quit: Leaving) |
20:12:54 | * | skelett1 quit (Quit: WeeChat 2.8) |
20:13:08 | * | NimBot joined #nim |
20:13:23 | * | skelett joined #nim |
20:13:33 | FromDiscord | <dom96> PMunch: you around? https://forum.nim-lang.org/t/6671 |
20:13:45 | Yardanico | he's not in IRC :( |
20:13:50 | Yardanico | I checked a few hours ago already |
20:20:02 | leorize | !seen PMunch |
20:20:02 | disbot | PMunch quit 76 hours ago and last spoke 6 hours ago |
20:20:59 | Zevv | quitter |
20:40:31 | * | gogoprog quit (Read error: Connection reset by peer) |
20:41:05 | Zevv | ah cpsMagic is still untyped of course |
20:41:45 | * | gogoprog joined #nim |
20:49:19 | FromDiscord | <drsensor👹> Thanks @lqdev, `dump` is what I'm looking for 🙏 |
20:49:50 | Yardanico | did you see the dbg template I sent? :) |
20:51:29 | * | JustASlacker quit (Ping timeout: 265 seconds) |
20:53:16 | FromDiscord | <drsensor👹> yes, but I think `dump` is more practical 🙂 |
20:53:29 | Yardanico | why? :) |
20:53:41 | Yardanico | you wanted a rust-like macro, I gave it to you :P |
20:53:57 | FromDiscord | <drsensor👹> just want to avoid creating a macro in my code base 😄 |
20:54:00 | Yardanico | ehm |
20:54:03 | Yardanico | I posted a template, not a macro |
20:54:15 | Yardanico | these are different things in Nim |
20:54:22 | FromDiscord | <drsensor👹> ah right, didn't notice that |
20:54:26 | Yardanico | and the dump macro itself is 3 lines of code btw |
20:55:53 | Zevv | disruptek: if we make a `proc cps(c: Continuation) = discard`, we could still use the "cps jield()" notation so isCpsCall can tell what's happening |
20:56:01 | Zevv | only problem is that "cps" clashes with the "cps" macro |
20:56:30 | disruptek | but why? |
20:57:22 | Zevv | how else do we tell a cps call |
20:57:34 | disruptek | the call is typed, remember? |
20:58:05 | Zevv | yeah, but I still don't see how the 'c' gets back in there :/ |
20:58:24 | Zevv | you probly got it working already, right |
20:58:39 | disruptek | i have no idea what you mean by `c`. |
20:58:43 | Zevv | continuation |
20:58:44 | disruptek | a continuation? |
20:58:55 | Zevv | because now `jield()` calls the stripped warning-variant of the proc |
20:59:00 | disruptek | what happens when you run the testes? |
20:59:02 | Zevv | not the jield(c: Cont): Cont |
20:59:50 | disruptek | i just pushed my current stuff. |
21:00:33 | Zevv | Error: internal error: environment misses: i |
21:01:03 | Zevv | but am I wrong? jield() calls the warning stub variant, right? |
21:02:30 | disruptek | maybe. |
21:02:42 | disruptek | isCpsCall is probably false, right? |
21:02:53 | Zevv | yes it has no clue |
21:03:07 | disruptek | hm, maybe this is why the env isn't getting built. |
21:03:21 | Zevv | I don't see how it can know, even typed |
21:04:01 | disruptek | hmm. fair point. 😁 |
21:04:11 | Zevv | oh well, it's past sesame street already |
21:04:35 | disruptek | i will look at it in a bit. |
21:04:38 | Zevv | so anyway, I was gettign that part to work by putting in "await jield()" |
21:04:43 | Zevv | and let isCpsCall check for "await" |
21:04:49 | disruptek | blech. |
21:04:57 | Zevv | yeah, or use `!>` instead |
21:05:09 | Zevv | but I never understood how this can ever work |
21:05:16 | Zevv | how we can tell a cps call from a normal call |
21:05:27 | Zevv | without being explicit |
21:05:40 | disruptek | or, should we. |
21:05:48 | disruptek | we had planned to noop(result) or whatever. |
21:05:58 | Zevv | well, it would be cool. But I don't think you can get the type of the thing you're calling, can you? |
21:05:59 | disruptek | but this clyybber matrix... oof. |
21:06:21 | Zevv | or if the thing your calling has a certain pragma |
21:06:23 | disruptek | we could also see if has any magical marks on it. |
21:06:35 | Zevv | not sure if we can. |
21:06:42 | disruptek | why not? |
21:06:50 | disruptek | nim has to sem cpsMagic first. |
21:06:54 | Zevv | And then still still still I do not understand how we are going to put the continuation argument in |
21:07:06 | Zevv | anyway, dogs must poop, men must sleep |
21:07:07 | * | lritter joined #nim |
21:07:13 | disruptek | i am confident. |
21:07:17 | Zevv | little boys must cry in the night |
21:07:23 | disruptek | hey, that's me! |
21:07:43 | Zevv | it fills me with dertemination |
21:10:28 | * | jeko quit (Quit: Leaving) |
21:16:27 | * | liblq-dev joined #nim |
21:30:22 | FromDiscord | <Recruit_main707> i might have asked this before, but can you set a compilation setting (for example: inside `module.nims`, `switch("d", "release"`))↵so that when you import `module` in your main file, release is set when compiling? |
21:34:32 | leorize | you can't |
21:36:26 | * | solitudesf quit (Ping timeout: 256 seconds) |
21:37:22 | FromDiscord | <Recruit_main707> well, thats pretty shite... |
21:40:25 | Yardanico | you can't set release in any configs currently FWIW |
21:40:28 | Yardanico | FYI* |
21:41:24 | FromDiscord | <Recruit_main707> ? |
21:41:29 | FromDiscord | <Recruit_main707> why not? |
21:41:35 | Yardanico | because of the order of evaluation |
21:41:39 | Yardanico | user configs are evaluated the last |
21:41:51 | Yardanico | release and danger are defined in the main nim config in config/nim.cfg in nim distribution |
21:42:22 | Yardanico | and checks like "@if release" won't trigger in the main config file |
21:43:08 | FromDiscord | <Recruit_main707> you are not talking about the same thing as me i think |
21:43:22 | Yardanico | yes, I'm talking about defining release or danger in configs in general |
21:43:30 | Yardanico | I know you're talking about module-specific config files when importing them |
21:44:18 | FromDiscord | <Recruit_main707> NimRL.nim↵NimRL.nims -> switch("d", "release")↵nim c NimRL |
21:44:30 | FromDiscord | <Recruit_main707> ... Release build; ... |
21:44:32 | Yardanico | yes that won't work |
21:44:37 | Yardanico | even if it says release build |
21:44:40 | Yardanico | it's a debug build :) |
21:45:07 | Yardanico | https://github.com/nim-lang/Nim/issues/14272 |
21:45:09 | disbot | ➥ -d:release -d:danger don't work as expected in user configs ; snippet at 12https://play.nim-lang.org/#ix=2u0V |
21:45:13 | FromDiscord | <Recruit_main707> is that on devel? or in stable? |
21:45:16 | Yardanico | everywhere |
21:45:18 | FromDiscord | <Recruit_main707> or in both? |
21:45:21 | FromDiscord | <Recruit_main707> lol |
21:45:25 | Yardanico | it's been like this since nim was created |
21:45:33 | Yardanico | well, not really like that, but for a long time |
21:45:38 | Yardanico | since configs were added I guess :P |
21:45:45 | disruptek | #12349 |
21:45:46 | disbot | https://github.com/nim-lang/Nim/issues/12349 -- 3nim.cfg danger/release flags honored inconsistently |
21:46:02 | FromDiscord | <Recruit_main707> but programs do run faster when using release |
21:46:19 | Yardanico | maybe because you're using some modules which do different things depending on the release switch |
21:46:22 | Yardanico | --opt:speed won't be activated |
21:46:28 | Yardanico | disruptek: but your issue is about the different thing |
21:46:32 | Yardanico | "The issue is that the compiler shouldn't report that it created a danger build when it hasn't." |
21:46:43 | Yardanico | @Recruit try -d:release on cmdline and with the config file and compare |
21:47:16 | Yardanico | also compare binary size |
21:47:20 | Yardanico | or even simplest thing - stack traces |
21:47:25 | Yardanico | with properly set -d:release you won't see them |
21:47:43 | FromDiscord | <Recruit_main707> wtf, this is such a weird error, how is this not fixed yet. 🥴 |
21:48:13 | Yardanico | because it's working as intended :) |
21:48:19 | Yardanico | almost |
21:49:04 | FromDiscord | <Recruit_main707> but that only happens with define (?) |
21:49:15 | Yardanico | well yes, it won't happen with real compiler flags |
21:49:21 | Yardanico | because they're evaluated by the compiler |
21:49:33 | Yardanico | so one of the proposed solutions is to make --release and --danger proper compiler switches |
21:49:38 | Yardanico | instead of defines |
21:50:03 | FromDiscord | <Recruit_main707> id say defining things in the config file should be possible still |
21:50:22 | Yardanico | well with that solution it will be possible |
21:51:12 | FromDiscord | <Recruit_main707> why would it change anything related to definitions to have release or danger flags? |
21:51:23 | Yardanico | because then they'll become REAL compiler switches |
21:51:28 | Yardanico | and will be evaluated by the compiler |
21:51:31 | Yardanico | not in the config files |
21:52:03 | FromDiscord | <Recruit_main707> i am talking about other definitions |
21:52:06 | Yardanico | right now the problem is that main nim.cfg has stuff like "@if danger", but since user configs are evaluated after main configs, that condition will never be true |
21:52:13 | Yardanico | definitions work just fine |
21:52:30 | Yardanico | it's just about when you check for definitions in a higher (in the "hierarchy") config file |
21:52:39 | Yardanico | and define that definition later in the user config file |
21:52:50 | Yardanico | you can use -d:myUserDefine in your normal config files just fine |
21:52:53 | Yardanico | and check for them in your code |
21:53:01 | FromDiscord | <Recruit_main707> aaaahhh, thanks |
21:53:58 | FromDiscord | <Recruit_main707> now everything makes sense :p |
21:59:16 | * | natrys quit (Quit: natrys) |
22:12:48 | * | lritter quit (Quit: Leaving) |
22:23:27 | * | Sembei joined #nim |
22:25:59 | * | liblq-dev quit (Quit: WeeChat 2.9) |
22:41:00 | * | tane quit (Quit: Leaving) |
22:47:56 | * | krux02_ quit (Remote host closed the connection) |
23:24:09 | disruptek | doubtful. |
23:26:03 | * | endragor joined #nim |
23:26:31 | * | theelous3 joined #nim |
23:29:34 | disruptek | well, i don't think it's a tick, but without a mirror i can't be sure if it's going in or coming out. |
23:29:45 | disruptek | oops. |
23:35:03 | mbuchel | that sounds very out of context |
23:38:45 | FromDiscord | <Rika> he's like that |
23:40:07 | * | endragor quit (Ping timeout: 256 seconds) |
23:40:44 | FromDiscord | <Elegant Beef> disruptek is a synonym for lacking of context |
23:46:17 | * | JustASlacker joined #nim |
23:46:47 | ForumUpdaterBot | New thread by JPLRouge: Question new symbole after compilation ??, see https://forum.nim-lang.org/t/6673 |
23:47:09 | Yardanico | ok this one even I can't decipher :( |