00:04:27 | * | jmdaemon quit (Ping timeout: 255 seconds) |
00:16:05 | * | jmdaemon joined #nim |
00:27:23 | * | forest joined #nim |
00:45:02 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=4nq5 |
00:45:10 | FromDiscord | <Girvo> What am I missing? Tried `.cfloat` on them but it doesn't like that |
00:45:32 | FromDiscord | <Elegantbeef> `0d` |
00:45:41 | FromDiscord | <Elegantbeef> or `0.0` |
00:45:42 | FromDiscord | <Elegantbeef> something to say float |
00:46:42 | FromDiscord | <Girvo> 👍 |
00:46:48 | FromDiscord | <Girvo> I ripped out cfloat as well, that was from c2nim itself |
00:46:54 | FromDiscord | <Girvo> just used regular float |
00:47:03 | FromDiscord | <Girvo> Also it seems this code has unintialised array values lol |
00:47:11 | FromDiscord | <Girvo> Which is also causing an issue |
00:48:27 | FromDiscord | <Phil> In reply to @Saint "<@180601887916163073> Hey! I was": No, I have one docker-compose file for everything |
00:49:24 | FromDiscord | <Phil> In reply to @Saint "Also should I make": Is your test-data so large that you can't just copy it into the container itself? |
00:55:32 | FromDiscord | <Elegantbeef> @Girvo\: i assume thumbs up means it worked? 😄 |
01:45:01 | * | jmdaemon quit (Ping timeout: 268 seconds) |
01:54:57 | * | dropkick joined #nim |
02:15:38 | FromDiscord | <Saint> In reply to @Isofruit "Is your test-data so": Nah it's not test data, so I want my tests to run against a separate test search index for example, without interfering with the main/production index that you would normally launch with docker-compose |
02:19:06 | FromDiscord | <Saint> The way I can see it so far is that I can have a separate test index service, but it will always start up when I do docker compose up? |
02:28:09 | * | jmdaemon joined #nim |
02:39:41 | * | ehmry quit (Ping timeout: 255 seconds) |
02:48:14 | * | azimut joined #nim |
03:04:32 | * | azimut quit (Ping timeout: 255 seconds) |
03:05:55 | * | azimut joined #nim |
03:31:44 | * | jmdaemon quit (Ping timeout: 248 seconds) |
04:13:40 | * | arkurious quit (Quit: Leaving) |
04:19:10 | * | dropkick quit (Ping timeout: 260 seconds) |
04:52:39 | * | jmdaemon joined #nim |
05:51:29 | * | azimut quit (Ping timeout: 255 seconds) |
05:54:07 | * | azimut joined #nim |
05:59:08 | * | azimut quit (Ping timeout: 255 seconds) |
06:02:01 | * | azimut joined #nim |
06:14:26 | * | azimut quit (Ping timeout: 255 seconds) |
06:15:41 | * | azimut joined #nim |
06:24:49 | * | forest left #nim (Wandered off) |
06:31:01 | * | rockcavera quit (Remote host closed the connection) |
06:41:23 | FromDiscord | <Hamid_Bluri> hey beef, how are you doing?↵↵can you label this issue in github?↵https://github.com/nim-lang/Nim/issues/21302 |
06:41:43 | FromDiscord | <Elegantbeef> Nope i dont have any administrative powers |
06:45:53 | FromDiscord | <ringabout> Hi beef, I was wondering would you like to help with the labelling stuff? |
06:46:30 | FromDiscord | <Elegantbeef> I guess i could |
06:46:58 | FromDiscord | <Elegantbeef> Just dont give me any actual control, cause i'm a klutz and am bound to mess it up |
06:49:36 | FromDiscord | <ringabout> Lol, sure. I have invited you, you should be able to label and close issues/PRs. |
07:02:12 | * | kenran joined #nim |
07:14:28 | FromDiscord | <Elegantbeef> I'm not even sure if the present state is a bug 😄↵(@Hamid_Bluri) |
07:14:49 | FromDiscord | <Elegantbeef> Unrelated to labelling |
07:16:36 | FromDiscord | <Elegantbeef> Ah nevermind misread the issue 😄 |
07:17:08 | FromDiscord | <Elegantbeef> Thought you were saying that two constants shouldnt point to the same proc cause you used `wrap` |
07:36:29 | * | kenran quit (Remote host closed the connection) |
07:51:42 | FromDiscord | <BobBBob> sent a code paste, see https://play.nim-lang.org/#ix=4nr0 |
07:51:56 | FromDiscord | <BobBBob> (edit) "https://play.nim-lang.org/#ix=4nr0" => "https://play.nim-lang.org/#ix=4nr1" |
07:54:18 | FromDiscord | <BobBBob> (and I know I can just use countup and put that in the index, but I wanna know if you cant do it with iterators since it's cleaner) |
07:56:03 | FromDiscord | <Elegantbeef> You want it to yield 1, 4, 7, 2, 5, 8, 3, 6, 9? |
07:56:06 | FromDiscord | <Elegantbeef> Well you can always write your own iterator |
07:57:42 | FromDiscord | <BobBBob> okay I was just wondering if there was some built in way to do it |
07:58:20 | FromDiscord | <Elegantbeef> I do not even know what you're asking to confirm or deny it's existence, but i'm going to say it likely doesnt exist |
07:58:42 | FromDiscord | <BobBBob> yeah it was what you said, 1, 4, 7, 2, 5, 8, 3, 6, 9 |
07:59:08 | FromDiscord | <Elegantbeef> ah then yep there is nothing in the stdlib that i know of |
08:04:34 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4nr3 |
08:04:40 | FromDiscord | <Elegantbeef> Couldnt help myself from the little challenge 😄 |
08:05:09 | FromDiscord | <BobBBob> hey awesome, thanks |
08:05:12 | FromDiscord | <Elegantbeef> Well that works for a single depth nested array |
08:06:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4nr4 |
08:25:25 | * | mal``` quit (Quit: Leaving) |
08:33:46 | * | mal`` joined #nim |
08:33:47 | * | jkl quit (Quit: Gone.) |
08:34:09 | * | jkl joined #nim |
08:54:19 | FromDiscord | <BobBBob> btw is there any reason not to use func over proc if a function has no side effects? |
08:55:10 | FromDiscord | <Elegantbeef> It's more pure so not really |
09:07:42 | FromDiscord | <ShalokShalom> sent a long message, see http://ix.io/4nri |
09:07:57 | FromDiscord | <ShalokShalom> Other than that, top. 👌🏻 |
09:09:14 | FromDiscord | <Elegantbeef> Need better tooling |
09:09:17 | FromDiscord | <ShalokShalom> Just to be precise: I suggest to do all possible functions as such↵↵Since I think about it: It's a nice compiler feature, to look up the code and change all pure procs into funcs. |
09:09:31 | FromDiscord | <ShalokShalom> In reply to @Elegantbeef "*Need better tooling*": Exactly.↵↵You read my mind. |
09:09:35 | FromDiscord | <ShalokShalom> Good boy |
09:09:36 | FromDiscord | <Elegantbeef> > You didn't mark this one as func, so now I can't rely on that explicit information, mentally.↵Hover a proc symbol, and it shows it if it's pure, magic one day |
09:09:52 | FromDiscord | <ShalokShalom> Yeah, but I like to convert entire code bases |
09:10:04 | FromDiscord | <Elegantbeef> Cool but there is no point really |
09:10:12 | FromDiscord | <ShalokShalom> That would be an easy change, and a good contribution |
09:10:14 | FromDiscord | <Elegantbeef> Nim makes a pure proc pure implicitly |
09:10:28 | FromDiscord | <ShalokShalom> In reply to @Elegantbeef "Cool but there is": Well, did you read my comment above 😂 |
09:10:55 | FromDiscord | <ShalokShalom> Sure, you can hover over the proc. ↵In the IDE, and not in GitHub |
09:11:07 | FromDiscord | <ShalokShalom> And its also tiring, to hover over every single entry |
09:11:16 | FromDiscord | <Phil> Basically the same reason why you should use `Set` when your task fundamentally is to check if X is part of some group of values:↵It communicates intent.↵Func communicates "This does not have side-effects, this is safe"↵Proc communicates "This might have side-effects" |
09:11:19 | FromDiscord | <Elegantbeef> Well good thin you do not need to |
09:11:34 | FromDiscord | <Elegantbeef> The amount of times i care whether something is a proc or a func is near 0 |
09:11:49 | FromDiscord | <ShalokShalom> And, most important↵↵Once all humans disappear from the planet, and other civilizations form, we might provide them more information about our left code. |
09:11:53 | FromDiscord | <Elegantbeef> It really doesnt matter when writing or reading code outside of the procedure |
09:12:06 | FromDiscord | <Elegantbeef> Well if they have the code hopefully they have a Nim compiler |
09:12:17 | FromDiscord | <ShalokShalom> And I mean, who would argue against pleasing aliens with property assigned Nim code |
09:12:24 | FromDiscord | <Phil> I mean, it's similar for me, but that's mostly because when I deal with DB It's always a side-effect that I can't avoid and that's at the root of the main code-path my code follows |
09:12:37 | FromDiscord | <ShalokShalom> In reply to @Isofruit "Basically the same reason": Ab-so-lutely |
09:12:44 | FromDiscord | <Elegantbeef> Plus new strict funcs make the idea of a func even more minute |
09:12:50 | FromDiscord | <ShalokShalom> One of the core building blocks |
09:13:02 | FromDiscord | <ShalokShalom> Communicated Intention |
09:13:08 | FromDiscord | <ShalokShalom> Is programming anything else? |
09:13:31 | FromDiscord | <ShalokShalom> In reply to @Elegantbeef "Plus new strict funcs": Yeah, and it seems like they could have to be reworked again |
09:13:37 | FromDiscord | <Phil> Like, I can make my `$` stuff funcs and I do, but I can't make `addCreature` or `updateCreature` or `deleteCreature` a func, that's inherently side-effecty |
09:13:40 | FromDiscord | <ShalokShalom> Did you see the issue? |
09:13:55 | FromDiscord | <ShalokShalom> In reply to @Isofruit "Like, I can make": Well, in most languages |
09:13:58 | FromDiscord | <ShalokShalom> In Nim |
09:14:55 | FromDiscord | <ShalokShalom> In reply to @Isofruit "I mean, it's similar": One more aspect: It shows, where your code is supposed to be placed at. ↵↵If you have lots of your procs in the main part, you could probably ask why. |
09:15:08 | FromDiscord | <Elegantbeef> What issue? |
09:15:17 | FromDiscord | <ShalokShalom> Either you developing an OS, for embedded systems or do probably do stupid design |
09:15:28 | FromDiscord | <ShalokShalom> In reply to @Elegantbeef "What issue?": the strict func one |
09:15:35 | FromDiscord | <Phil> In reply to @ShalokShalom "One more aspect: It": If a core of your application is procs in webdev that just means you use a database 😛 |
09:15:39 | FromDiscord | <Elegantbeef> What? |
09:16:07 | FromDiscord | <ShalokShalom> https://github.com/nim-lang/Nim/pull/21066#issuecomment-1416845926 |
09:16:09 | FromDiscord | <ShalokShalom> Sorry |
09:16:12 | FromDiscord | <ShalokShalom> Its the PR |
09:16:14 | FromDiscord | <ShalokShalom> My fault |
09:16:34 | FromDiscord | <ShalokShalom> In reply to @Isofruit "If a core of": No, it means you use a database centric desigm |
09:16:36 | FromDiscord | <Elegantbeef> Yes I talked with leorise about that problem |
09:16:45 | FromDiscord | <ShalokShalom> And yeah, most likely it means what you said |
09:16:50 | FromDiscord | <ShalokShalom> (edit) "desigm" => "design" |
09:16:58 | FromDiscord | <ShalokShalom> And sometimes, that is a design issue |
09:19:07 | FromDiscord | <jmgomez> Hey Beef, I think I read you write that you prefer to script in something targeting webassembly rather than NimVM? I was thinking as next step for after vfuncs, NUE to integrate the VM. But I also was thinking that it can benefit for allowing a layer of top with webassembly where any other lang can target. Any particular reason of why you discarded the vm approach? |
09:19:20 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4nrl |
09:20:14 | FromDiscord | <Elegantbeef> Of course it is phil |
09:20:15 | FromDiscord | <Elegantbeef> That's valid procedure calling syntax |
09:20:19 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4nrn |
09:20:22 | FromDiscord | <Elegantbeef> I mean i only briefly considered the NimVm for scripting a game |
09:20:33 | FromDiscord | <ShalokShalom> In reply to @jmgomez "Hey Beef, I think": I prefer wasm as plugin mechanism, and think it's the future (possibly) |
09:20:34 | FromDiscord | <Elegantbeef> The issue with the NimVM is it's slow, not really meant for being embedded and isnt overly portable |
09:20:46 | FromDiscord | <Elegantbeef> Shalok changed their name to beef |
09:20:48 | FromDiscord | <Elegantbeef> Interesting |
09:21:08 | FromDiscord | <Elegantbeef> The reason wasm for scripting is so enticing is the fact it's language agnostic, sandboxed and cross platform |
09:21:15 | FromDiscord | <Phil> In reply to @Elegantbeef "That's valid procedure calling": It's valid procedure calling syntax to call a proc with only some of its parameters and define there rest after a colon in a newline? |
09:21:16 | FromDiscord | <ShalokShalom> ShalBeef |
09:21:41 | FromDiscord | <Elegantbeef> You can compiler a wasm module on a PC running templeos then transfer it to a iphone 32 and it'll work |
09:21:45 | FromDiscord | <Elegantbeef> compile\ |
09:21:58 | FromDiscord | <Elegantbeef> Yes phil it's block calling |
09:22:02 | FromDiscord | <jmgomez> In reply to @Elegantbeef "The issue with the": It's like python slow? I just wanted to integrate it for an improved dev experience rather than for shipping code |
09:22:03 | FromDiscord | <ShalokShalom> 🌈 |
09:22:11 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#templates-passing-a-code-block-to-a-template |
09:22:12 | FromDiscord | <ShalokShalom> All rainbows and sunshine |
09:22:28 | FromDiscord | <Elegantbeef> It's slower than python now iirc |
09:22:29 | FromDiscord | <jmgomez> In reply to @ShalokShalom "I prefer wasm as": What attracts me about the idea is that it can really sky rocket the plugin |
09:22:41 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4nro |
09:22:47 | FromDiscord | <ShalokShalom> In reply to @jmgomez "What attracts me about": This is true! |
09:23:15 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=4nrp |
09:23:16 | FromDiscord | <ShalokShalom> You could go advertising the plugin also in other communities |
09:23:18 | FromDiscord | <Elegantbeef> Nimscript is a nice easy way to get runtime scripting to a program |
09:23:26 | FromDiscord | <ShalokShalom> GHC just got native wasm support |
09:23:42 | FromDiscord | <Phil> That explains why constructing widgets in Owlkettle can use the syntax it does |
09:23:58 | FromDiscord | <Elegantbeef> But it's very much not the most ideal way of scripting programs if you want to have long lasting environment |
09:24:01 | FromDiscord | <Phil> I thought the fact I can do resize = false inside the constructor as well as the block following the widget was some kind of owlkettle macro magic |
09:24:11 | FromDiscord | <Phil> (edit) "I thought the fact I can do resize = false inside the constructor ... as" added "of a Paned Widget" |
09:24:22 | FromDiscord | <jmgomez> In reply to @Elegantbeef "Nimscript is a nice": any limitations in terms of interoping with cpp? Is it correct to assume that as long as you pass over the nim symbols, funcs should be available? |
09:24:27 | FromDiscord | <Elegantbeef> Yep Nim parses it just fine |
09:24:34 | FromDiscord | <Elegantbeef> That was to phil 😄 |
09:24:56 | FromDiscord | <Elegantbeef> If you send the hooks across the VM it will work fine |
09:25:05 | FromDiscord | <Elegantbeef> You need nimcall thunks though |
09:25:26 | FromDiscord | <Phil> God damn nim supports a wide-range of syntax |
09:25:49 | FromDiscord | <jmgomez> cool, thanks for the info! |
09:28:42 | FromDiscord | <Rika> In reply to @Isofruit "God damn nim supports": I sure hope you know about `do` then |
09:29:10 | FromDiscord | <Elegantbeef> Wait until they learn that macros can use user defined `else` |
09:29:26 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimtrest/blob/master/staticcases.nim#L59-L79 |
09:32:50 | FromDiscord | <Phil> In reply to @Rika "I sure hope you": I know of its existence and maybe used it like once or twice in passing, or rather started using code-pieces that contain it that I copy-pasted from beef |
09:33:08 | FromDiscord | <Elegantbeef> Do is doo doo |
09:33:22 | FromDiscord | <ringabout> `git reset --soft $(git merge-base devel HEAD)` is handy, I use it to get a clean commit message https://github.com/nim-lang/Nim/pull/21342 |
09:33:23 | FromDiscord | <Phil> voo: doo |
09:33:49 | FromDiscord | <Elegantbeef> I just rebase like a neanderthal i am |
09:34:02 | FromDiscord | <Elegantbeef> `git rebase -i HEAD~x` is too simple |
09:34:19 | FromDiscord | <Elegantbeef> I guess `git amend` also could work for single commits |
09:34:26 | FromDiscord | <Phil> In reply to @ringabout "`git reset --soft $(git": That looks fast |
09:34:39 | FromDiscord | <Phil> And yeah, I do git amend |
09:34:59 | FromDiscord | <ringabout> Yeah, though I have too many silly commit message from https://github.com/nim-lang/Nim/pull/20897, so I would rather discard them all at once. |
09:35:17 | FromDiscord | <ringabout> (edit) "I have" => "it has" | "message" => "messages" |
09:35:30 | FromDiscord | <Elegantbeef> Yea i'd squash and edit it cause like i said i bash rock with rock to make other rock not rock |
09:39:37 | FromDiscord | <Elegantbeef> Hmph when it uses vtables that makes interfaces easier |
09:40:37 | FromDiscord | <Elegantbeef> Actually one still i guess needs to make it do a method call |
09:40:54 | FromDiscord | <Elegantbeef> Hard to do from user code but not too crazy from compiler |
09:41:02 | FromDiscord | <Elegantbeef> the opposite of `procCall` could exist |
09:41:52 | FromDiscord | <ringabout> I agree. I'm testing whether it is worth storing the vtables to a global static array of function pointers instead of fields of objects. |
09:42:00 | FromDiscord | <Elegantbeef> \Idea being that you could do like `methodCall(methodName, someTypeErasedReference, ...)` |
09:42:37 | FromDiscord | <Elegantbeef> I'd say having it global makes the most sense |
09:43:19 | FromDiscord | <Elegantbeef> Now just if we could get the actual type name at a upcasted pointer 😄 |
09:43:23 | FromDiscord | <ringabout> Yeah, it is feasible. |
09:44:40 | FromDiscord | <Elegantbeef> Damn using a vtable makes life so much better in many regards |
09:45:24 | FromDiscord | <Elegantbeef> Thinking about somehow attaching things like `$` in the vtable |
09:45:27 | FromDiscord | <Elegantbeef> Though that requires new language features |
09:50:01 | FromDiscord | <⚶ Zeno> whats difference between .nim and .nimscript ? |
10:03:55 | FromDiscord | <Phil> In reply to @⚶ Zeno "whats difference between .nim": .nim is an actual nim file that has full access to all libs and nim syntax |
10:04:01 | * | uics joined #nim |
10:04:42 | FromDiscord | <Phil> nimscript is a subset of nim that gets evaluated by nims "vm" that it uses at compiletime.↵It has an additional module for easy OS interaction (copying files, moving files, etc., the basic system operation stuff) |
10:05:08 | FromDiscord | <Phil> But nimscript can not use some libraries because their code cannot be evaluated solely by the VM |
10:05:22 | FromDiscord | <Phil> Nimscript also doesn't get compiled to a binary |
10:05:39 | FromDiscord | <Phil> To play around with nimscript, just use nim secret, that's the VM I'm talking abuot |
10:05:41 | FromDiscord | <Phil> (edit) "abuot" => "about" |
10:06:16 | FromDiscord | <Phil> (edit) "nimscript is a subset of nim that gets evaluated by nims "vm" that it uses at compiletime.↵It has an additional module for easy OS interaction (copying files, moving files, etc., the basic system operation stuff) ... " added "that normally you'd use std/os for but nimscript can't use a lot of std/os so that works as a replacement" |
10:06:31 | FromDiscord | <Phil> (edit) "But nimscript" => "Nimscript" |
10:07:18 | FromDiscord | <Phil> Nimscript basically is the thing you're mostly using for build-scripts etc.↵For your actual application you'll just use nim and compile that to a binary |
10:07:33 | FromDiscord | <⚶ Zeno> i see |
10:07:36 | FromDiscord | <⚶ Zeno> alright thanks |
10:10:42 | FromDiscord | <Phil> sent a long message, see https://paste.rs/Qth |
10:10:45 | FromDiscord | <Phil> All with just the command `nimble local_deploy` |
10:10:58 | FromDiscord | <Phil> No complicated bash script needed, all just nim syntax |
10:11:12 | * | jmdaemon quit (Ping timeout: 248 seconds) |
10:11:50 | FromDiscord | <Phil> (edit) "http://ix.io/4nrA" => "http://ix.io/4nrD" |
10:11:54 | FromDiscord | <Phil> (edit) "http://ix.io/4nrD" => "https://paste.rs/tag" |
10:20:45 | * | oddish quit (Remote host closed the connection) |
10:26:28 | * | uics quit (Remote host closed the connection) |
10:26:48 | * | uics joined #nim |
10:27:26 | * | uics quit (Remote host closed the connection) |
10:47:01 | * | uics joined #nim |
11:14:55 | * | ltriant quit (Ping timeout: 252 seconds) |
11:50:37 | * | xet7 quit (Quit: Leaving) |
11:55:35 | FromDiscord | <kaddkaka> Nimscript sounds practical. Is it a novel idea for nim or are there other languages that have similar subsets? |
12:00:40 | * | ltriant joined #nim |
12:01:26 | FromDiscord | <auxym> rust macros, recent c++ has constexpr. But personally I'm not aware of any language which gives you basically full access to an identical language for compile time evaluation of constants (and AST macros). |
12:06:37 | * | ltriant quit (Ping timeout: 268 seconds) |
12:15:47 | FromDiscord | <konsumlamm> most lisps have that |
12:21:55 | FromDiscord | <Rika> Long time no see |
12:22:08 | FromDiscord | <Rika> Or maybe I’m just too inactive nowadays |
12:34:44 | FromDiscord | <jmgomez> The thing that still blows my mind with Nim is that’s statically checked. If one day we have the proper tooling to really showcase that it can be a game changer |
12:42:20 | * | xet7 joined #nim |
12:44:01 | FromDiscord | <Phil> In reply to @jmgomez "The thing that still": That what is statically checked? Nimscript itself? |
12:45:34 | FromDiscord | <Phil> In reply to @kaddkaka "Nimscript sounds practical. Is": I'll say it like that:↵I'm not familiar with any similar concept for java, groovy, JS/TS or python. So I think it's a more niche-y concept (?) |
12:46:22 | FromDiscord | <Phil> Actually nevermind, I'm an idiot, such a language only makes sense for compiled languages |
12:46:31 | FromDiscord | <Phil> (edit) "Actually nevermind, I'm an idiot, such a ... language" added "scripting" |
12:46:41 | FromDiscord | <Phil> (edit) "Actually nevermind, I'm an idiot, such a scripting language only makes sense for compiled languages ... " added "and c++/rust have it as auxym pointed out" |
12:46:55 | FromDiscord | <Phil> (edit) "c++/rust" => "c++/rust/lisp-langs" | "c++/rust/lisp-langshave it as auxym ... pointed" added "and konsumlamm" |
13:00:21 | FromDiscord | <jmgomez> In reply to @Isofruit "That what is statically": I mean the combination of heavy AST modification + static checking. I think Zig and Rust (?) share that trait but not sure as I didnt look into Zig neither Rust macros |
13:07:28 | FromDiscord | <Rika> Rust macros are token based IIRC |
13:12:32 | * | dropkick joined #nim |
13:34:50 | * | uics quit (Remote host closed the connection) |
13:40:27 | FromDiscord | <Nerve> Since we're on scripting languages, I'm just curious, who here has checked out Janet? It's a Lispy scripting language, aesthetically resembles Clojure (with data structure literals and all), and is designed to fit niches Python and Lua do, with a bit of an emphasis towards Lua. Case in point: Much like Nim, the Janet build tool can actually bundle your scripts with the interpreter and runtime into a single dependency-free executable. Built |
13:41:07 | FromDiscord | <Nerve> (edit) "Since we're on scripting languages, I'm just curious, who here has checked out Janet? It's" => "sent" | "Lispy scripting language, aesthetically resembles Clojure (with data structure literals and all), and is designed to fit niches Python and Lua do, with a bit of an emphasis towards Lua. Case in point: Much like Nim, the Janet build tool can actually bundle your scripts with the interpreter and runtime into a single dependency-fr |
13:42:00 | FromDiscord | <Nerve> In my testing it also quite nicely tends to be roughly twice as fast as Python for the same tasks. Not crazy, but to get the flexibility of Lisp and a speedup is pretty nice. |
13:50:56 | * | oddish joined #nim |
13:51:30 | FromDiscord | <jmgomez> Never heard of it, it looks cool. But why would you prefer it over NimScript (assuming the use case that you have already a Nim app and you want to script it) |
13:54:42 | * | uics joined #nim |
13:58:17 | * | uics left #nim (#nim) |
14:01:21 | * | ltriant joined #nim |
14:04:28 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4nsB |
14:07:13 | * | ltriant quit (Ping timeout: 252 seconds) |
14:14:12 | * | rockcavera joined #nim |
14:17:37 | FromDiscord | <pyolyokh> <https://nim-lang.org/docs/manual.html#statements-and-expressions-when-nimvm-statement>↵first branch: compile time↵second branch: runtime↵and the runtime branch can't be compiled because it refers to procs that aren't available in the target that you're compiling to |
14:20:22 | FromDiscord | <pyolyokh> at a glance, stdlib uses `when defined(nimscript)` for what you're trying to do here |
14:23:39 | FromDiscord | <sOkam!> @pyolyokh that worked, tysm. was really stuck with this 🙏↵what i don't quite follow is that using `when nimvm` in a nimscript file forks into the true version, but this other situation didnt↵i guess its because it will run the nimvm option, but tries to interpret both? 🤔 |
14:25:04 | FromDiscord | <pyolyokh> I'd explain it as, it compiles two functions and runs one at runtime and one at compile time. So both functions need to be valid |
15:04:15 | * | arkurious joined #nim |
15:26:57 | FromDiscord | <Nerve> In reply to @jmgomez "Never heard of it,": Not addressing that use case, just curious if anyone's used it for any other purpose |
15:31:50 | * | ehmry joined #nim |
15:43:25 | FromDiscord | <eyes> hey quick question- how do people go about using a single logger throughout a large project |
15:43:38 | FromDiscord | <eyes> without passing in a reference to the logger object into every proc |
15:44:24 | FromDiscord | <eyes> i tried declaring a logger in one file, exporting it with , and importing it in many places, but that didnt seem to work as I expected |
15:44:44 | * | jmdaemon joined #nim |
15:45:57 | FromDiscord | <Rika> it should |
15:46:00 | FromDiscord | <Rika> what was the problem |
15:46:33 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4nt3 |
15:46:54 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4nt3" => "https://play.nim-lang.org/#ix=4nt4" |
15:49:46 | FromDiscord | <eyes> sent a code paste, see https://play.nim-lang.org/#ix=4nt5 |
15:50:03 | FromDiscord | <eyes> i get a undeclared identifier error for ``log`` |
15:50:17 | FromDiscord | <eyes> which is odd, i thought that was defined withing ``std/logging`` |
15:50:34 | FromDiscord | <Rika> your file should not be the same name as the variable |
15:50:53 | FromDiscord | <Rika> otherwise you would need to do `log(logger.logger, ...)` |
15:51:04 | FromDiscord | <Rika> i dont even think that would work |
15:51:28 | FromDiscord | <Rika> the issue is basically the import name and the variable name yeah |
15:51:30 | FromDiscord | <eyes> ahhh |
15:53:03 | FromDiscord | <eyes> yeah that fixed it thank you |
15:54:35 | FromDiscord | <Rika> 👌 |
15:56:00 | FromDiscord | <ShalokShalom> In reply to @jmgomez "I mean the combination": Julia can do the static checking |
15:56:27 | FromDiscord | <ShalokShalom> It does not by default, and has a quite interesting type system |
15:56:35 | FromDiscord | <ShalokShalom> And it's macro's are very good |
15:57:28 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
15:57:47 | * | jmdaemon joined #nim |
15:58:30 | FromDiscord | <jmgomez> Didnt know Julia allows you to modify the AST. That's good to know! |
16:08:30 | * | jmdaemon quit (Ping timeout: 260 seconds) |
16:10:50 | * | jmdaemon joined #nim |
16:28:58 | FromDiscord | <deech> The last I tried them, Rust's macros are just a token stream, so you're not really modifying the ast, but transforming tokens to ast (I think), it's probably closer to basic Nim templates than macros. Zig expressly does not have macros. |
16:30:24 | FromDiscord | <deech> And unlike Nim you have no type information available at macro expansion time. It's just a syntactic transform. |
16:35:24 | FromDiscord | <ShalokShalom> In reply to @jmgomez "Didnt know Julia allows": it's probably the closest to Nim, outside of Lisps, that I know about. ↵↵Julia looks like a really cool language↵It's ecosystem is hardly anything other than for science, is my feeling 😅 |
16:35:34 | FromDiscord | <I have 50GB of gay porn on my PC> 👉👈 nim 2.0 and nimsuggest impovements when? |
16:36:00 | FromDiscord | <I have 50GB of gay porn on my PC> appereantly all 2.0 tasks are "complete" on github |
16:37:51 | FromDiscord | <jmgomez> In reply to @deech "The last I tried": ah thanks, never really looked at it. I just knew that it allows you to do compile time stuff and I assumed it may be similar to Nim |
16:39:11 | FromDiscord | <jmgomez> In reply to @I have 50GB of gay porn on my PC "👉👈 nim 2.0 and": AFAIK that will happen after 2.0 with IC |
16:40:32 | FromDiscord | <deech> One thing I really like about working with token streams instead of the ast is that you don't have to generate syntactically valid code. Nim macros are a real pain to debug when you can't even macroexpand due to a syntax problem which is very easy to do when working with NimNode's. |
16:41:51 | FromDiscord | <deech> (edit) "a" => "bad" | removed "problem" |
16:46:00 | FromDiscord | <jmgomez> But then do you have to parse the tokens? Or how do you know what's going on? Can you introspect them? |
16:46:23 | FromDiscord | <deech> Lots and lots of `echo blah.repr`. 😦 |
16:46:46 | FromDiscord | <jmgomez> I mean on the token streams based \ |
16:46:53 | FromDiscord | <jmgomez> (edit) removed "\" |
16:47:21 | FromDiscord | <deech> Oh you mean in Rust? You just splice them in place, it's like passing `untyped` arguments to a template. |
16:48:08 | FromDiscord | <jmgomez> In reply to @deech "Lots and lots of": yeah, but it isnt that bad. I usually setup the env so it compiles fast and it's almost like a repl |
16:48:58 | FromDiscord | <jmgomez> In reply to @deech "Oh you mean in": then there is no equivalent to getImpl() |
16:49:00 | FromDiscord | <jmgomez> right? |
16:49:11 | FromDiscord | <deech> It's not insurmountable but not great either. A "tokenExpand" or something would save me heaps of time. |
16:49:20 | FromDiscord | <I have 50GB of gay porn on my PC> In reply to @deech "One thing I really": it's easy enough to use static string to get a token stream |
16:50:04 | FromDiscord | <I have 50GB of gay porn on my PC> but then there's no obvious way to error out on a specific line and column, unlike when you have a node |
16:50:57 | FromDiscord | <deech> In reply to @jmgomez "then there is no": There's a third party lib (https://crates.io/crates/syn) that basically re-parses everything so you can get a crippled version of it and then only for types you own. |
16:55:23 | FromDiscord | <deech> Nim really needs built in pattern matching and exhaustiveness checking over a dedicated sum/product type construct. Object variants are too flexible for static analysis. |
16:56:59 | FromDiscord | <jmgomez> agree, I would be happy for the time being if at least fusion/matching worked |
16:58:04 | FromDiscord | <ShalokShalom> One user reported, that patty seems to be broken, with overloadable enums since it hasn't been updated |
16:58:52 | FromDiscord | <ShalokShalom> https://github.com/haxscramper/hmatching |
16:58:59 | FromDiscord | <ShalokShalom> This seems like the most up to date |
16:59:12 | FromDiscord | <deech> In reply to @jmgomez "agree, I would be": IMO it has too many features, but yes, something officially supported would be better than the current state. |
16:59:19 | FromDiscord | <ShalokShalom> And was also in discussion to become the build in solution |
17:35:05 | FromDiscord | <haxscramper> Some subset of features can be added into official solution |
17:59:33 | FromDiscord | <4zv4l> can I create a proc inside a proc ? |
18:04:37 | FromDiscord | <huantian> Yes |
18:04:58 | * | ltriant joined #nim |
18:08:40 | FromDiscord | <rakgew> sent a long message, see http://ix.io/4ntK |
18:11:00 | * | ltriant quit (Ping timeout: 260 seconds) |
18:32:14 | * | jmdaemon quit (Ping timeout: 260 seconds) |
18:35:56 | FromDiscord | <BobBBob> Does try/except not have an else statement? |
18:38:02 | FromDiscord | <Nerve> In reply to @rakgew "https://play.nim-lang.org/#ix=4ntJ trying to": Hm, I've done this exact thing and had no issues without using any pragmas. Just a const table associating string names to procs, and I dereference the table with parameters to call. |
18:40:40 | FromDiscord | <Phil> In reply to @BobBBob "Does try/except not have": You mean a "finally" that runs every time regardless of success or failure? |
18:41:43 | FromDiscord | <jtv> No, one that runs only if no exception is thrown |
18:41:52 | FromDiscord | <BobBBob> sent a code paste, see https://play.nim-lang.org/#ix=4ntY |
18:42:42 | FromDiscord | <Phil> I don't think there is one |
18:43:26 | FromDiscord | <Phil> Shouldn't be super hard to to implement via templates |
18:43:39 | FromDiscord | <Phil> (edit) "templates" => "templates, so I think there might be a lib for it" |
18:44:26 | FromDiscord | <BobBBob> well how does everyone else do what I tried |
18:46:09 | FromDiscord | <Phil> Haven't had the scenario happen to me yet.↵At a first glance I think I'd just keep that code inside the try statement or return in the except statement (assuming it isn't supposed to re-raise) |
18:46:26 | FromDiscord | <Phil> (edit) "re-raise)" => "re-raise a different exception)" |
18:46:31 | FromDiscord | <rakgew> sent a code paste, see https://play.nim-lang.org/#ix=4ntZ |
18:47:33 | FromDiscord | <Phil> Yeah, roughly like that, though imo the returns could have explicit bools attached to not rely on nim's implicit instantiation, but that's a super subjective thing on my end |
18:48:24 | FromDiscord | <rakgew> agreed an explicit return would be nicer. |
18:49:51 | * | derpydoo joined #nim |
18:55:42 | FromDiscord | <BobBBob> I could just put a continue in each except then put a break at the end of the while but I just thought that was kinda ugly |
18:58:02 | FromDiscord | <BobBBob> Also why do I have to use newException to raise custom exceptions? if I just use raise it gives "Error: only a 'ref object' can be raised" even if the exception type is a ref object |
18:59:07 | * | jmdaemon joined #nim |
18:59:17 | FromDiscord | <jtv> Error messages in nim suck. If it's a ref object that has the right base class you don't need newException |
18:59:44 | FromDiscord | <BobBBob> Oh so I cant just use of Exception |
19:01:08 | FromDiscord | <BobBBob> it says that in the manual 🙄 |
19:01:21 | FromDiscord | <BobBBob> (edit) "it says ... that" added "you can do" |
19:01:57 | FromDiscord | <BobBBob> or actually it says to do of Exception then use raise newException |
19:03:18 | FromDiscord | <BobBBob> no changing them to "ref object of ValueError" still doesnt work |
19:06:38 | FromDiscord | <Elegantbeef> you do `raise (ref MyException)(msg: "", otherStuff: ...)` |
19:07:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4nu6 |
19:20:22 | FromDiscord | <Hourglass [She/Her]> Anyone know a decent UI/GUI library in Nim that can be compiled to WASM? |
19:33:00 | FromDiscord | <rakgew> thx Nerve - very good to know, that it should actully work. is your version somewhere in a public repo/snippet by any chance?↵(@Nerve) |
19:40:38 | FromDiscord | <Hourglass [She/Her]> In reply to @Hourglass, When the Hour Strikes "Anyone know a decent": Alternatively, anything wrapping the canvas API to make it more bearable in Nim? |
19:43:59 | * | azimut quit (Ping timeout: 255 seconds) |
19:48:34 | Amun-Ra | SDL2? |
19:48:42 | Amun-Ra | works ootb |
20:22:34 | FromDiscord | <Phil> Do we have docs on choosenim? Other than the redme? |
20:23:22 | FromDiscord | <Phil> (edit) "redme?" => "readme?" |
20:23:26 | FromDiscord | <Elegantbeef> There's the greenme aswell |
20:23:43 | FromDiscord | <Elegantbeef> The answer is no there are no other docs that i know of |
20:30:13 | FromDiscord | <Hourglass [She/Her]> Greenme? |
20:33:55 | FromDiscord | <Phil> I wrote "redme" initially |
20:33:58 | FromDiscord | <Phil> Was a joke |
20:34:41 | * | ltriant joined #nim |
20:36:51 | FromDiscord | <Phil> sent a long message, see http://ix.io/4nuy |
20:37:29 | FromDiscord | <Phil> (edit) "http://ix.io/4nuy" => "https://paste.rs/kcl" |
20:38:16 | FromDiscord | <Elegantbeef> Likely should either publish a fork, or subsume the fork into norm |
20:38:51 | FromDiscord | <Phil> by subsume you mean have the fork as a separate sibling repository to norm under moigagoo's user (he's the creator of norm) ? |
20:39:09 | FromDiscord | <Elegantbeef> I mean put the code directly in Norm if it makes sense to be the only consumer of it |
20:39:10 | * | uics joined #nim |
20:39:28 | * | ltriant quit (Ping timeout: 248 seconds) |
20:39:58 | FromDiscord | <Phil> Ah, check.↵I think for now I'll go for publishing the fork. Imo ndb is generally a decent base to build an ORM off of because it properly represents NULL instead of returning it as empty string |
20:40:25 | FromDiscord | <Phil> I wouldn't want to make that unavailable for folks wanting to build something on top of it in nim 2.0 and future |
20:41:19 | FromDiscord | <amadan> Publish fork is good idea↵I use your fork anyways in one of my projects lol |
20:41:40 | FromDiscord | <Phil> TFW people actually use forks of mine |
20:41:45 | FromDiscord | <Elegantbeef> Nimble directory schmible directory |
20:46:56 | FromDiscord | <Saint> So I was just browsing some python repo on github, and I could easily see that some function was located in a library and I was able to look up that library |
20:47:05 | FromDiscord | <Saint> This would be impossible in nim - is that okay? Is that a limitation? |
20:47:17 | FromDiscord | <Saint> I know this convo has been done to death but just wondering if there's a way around that or not |
20:48:05 | FromDiscord | <Phil> It's not that it's impossible in nim, like 50% of the time in VSCode I can actually follow a proc to the package that implements it and stare at the source-code, it's just that the tooling isn't quite there |
20:48:14 | FromDiscord | <Phil> (edit) "It's not that it's impossible in nim, like 50% of the time in VSCode I can actually follow a proc to the package that implements it and stare at the source-code, it's just that the tooling isn't quite there ... " added "to do it perfectly consistently" |
20:48:41 | FromDiscord | <Phil> (edit) "It's not that it's impossible in nim, like 50% of the time in VSCode I can actually follow a proc ... to" added "(by CTRL + Click on proc name)" |
20:48:54 | FromDiscord | <Phil> Why that is I couldn't tell you |
20:49:02 | FromDiscord | <Phil> (edit) "you" => "you, I assume nimsuggest issues" |
20:49:27 | FromDiscord | <deech> In reply to @Saint "So I was just": GH has special code navigation tooling for Python (https://github.blog/2021-12-09-precise-code-navigation-python-code-navigation-pull-requests/). |
20:49:27 | FromDiscord | <Saint> It's not just about the ide/lsp, I mean that I could just tell by looking at the raw text in github on a project |
20:49:35 | FromDiscord | <Elegantbeef> It's not impossible in Nim you can do `myModule.proc(...)` all day long |
20:50:00 | FromDiscord | <Saint> Yeah but that's not the convention and no one really does it |
20:50:38 | FromDiscord | <Elegantbeef> By why would you want to |
20:51:08 | FromDiscord | <Saint> In reply to @deech "GH has special code": Interesting! |
20:51:14 | FromDiscord | <deech> The short answer is not really. Small community, funding, niche language, tooling isn't fun to work on etc. etc. |
20:51:23 | FromDiscord | <Saint> In reply to @Elegantbeef "By why would you": Just so you know where methods are coming from |
20:51:37 | FromDiscord | <Saint> If I see a function call in nim I have no idea where it is defined |
20:51:44 | FromDiscord | <Phil> Ah, you meant GH features, my bad I missunderstood |
20:51:54 | FromDiscord | <Saint> In reply to @Isofruit "Ah, you meant GH": No I didn't mean GH features |
20:52:07 | FromDiscord | <Elegantbeef> It makes your code less expressive and harder to read |
20:52:27 | FromDiscord | <Phil> Was this not about following symbols to their point of definition, but via a github user interface? |
20:52:33 | FromDiscord | <Saint> I just meant that if I'm reading some code on GH, and it's in python I can tell where code is comign from but with nim I will have no idea and would have to git clone it first |
20:52:58 | FromDiscord | <Saint> I mean that would be cool too, it's more just like having to rely on external tools vs not |
20:53:03 | FromDiscord | <Phil> Ohhhh now I get it, the fact you have to guess at which of the modules imports a given proc |
20:53:10 | FromDiscord | <Saint> Yeah exactly |
20:53:15 | FromDiscord | <Phil> (edit) "Ohhhh now I get it, the fact you have to guess at which of the modules imports ... a" added "provides" |
20:53:21 | FromDiscord | <Elegantbeef> instead of something like `{'a'..'z'} in myString` you do `strutils.contains(myString, {'a'..'z'.}))` |
20:53:22 | FromDiscord | <Elegantbeef> Is this a benefit to readabillity? Who knows |
20:53:22 | FromDiscord | <Elegantbeef> Yes then also types |
20:53:23 | FromDiscord | <rakgew> or easier to read, in case you want to know where the proc is from.. |
20:53:23 | FromDiscord | <Elegantbeef> I personally do not think where a procedure comes from matters, but I also only write Nim now |
20:53:23 | FromDiscord | <Elegantbeef> You should do `var a: mymodule.type` like it's C++/Rust 😄 |
20:53:24 | FromDiscord | <rakgew> but on the other hand one would loose a part of the nice ucs |
20:53:52 | FromDiscord | <rakgew> I remember when I started with nim coming from py, I was quite annoyed I would not know where things are from. |
20:54:10 | FromDiscord | <Phil> You may also just do a lot of qualified imports `from X import lots of things` |
20:54:12 | FromDiscord | <Elegantbeef> I mean that's the point of the import statements |
20:54:45 | FromDiscord | <Phil> But that will break your neck for all the places where some generated proc is trying to bind another proc provided by another module and it's not immediately visible in the source |
20:54:55 | FromDiscord | <Phil> (edit) "proc" => "code" |
20:54:59 | FromDiscord | <Phil> (edit) "proc" => "symbol" |
20:54:59 | FromDiscord | <Elegantbeef> Ostensibly if I have `Url` and I import `webby` i'm using webby's Url |
20:55:09 | FromDiscord | <rakgew> right, one could do more qualified imports. |
20:55:40 | FromDiscord | <Phil> I mean, it is a fair point beef. There's a very clear tradeoff. Like, I've found myself questioning where the implementation of the proc that's getting used there was coming from more than once |
20:55:50 | FromDiscord | <rakgew> but if it is not qualified, it is not clear just from the source where things might be from. |
20:56:13 | FromDiscord | <Phil> And in case you've got overloads from different modules (because the setup for extendability was chosen that way) that isn't actually all that easy to figure out |
20:56:16 | FromDiscord | <Elegantbeef> If you're reading a statically compiled language without tooling, what are you doing is always what it comes to me |
20:57:00 | FromDiscord | <Elegantbeef> I cannot think of any instance except referring to code in browser that it makes sense to have no tooling |
20:57:29 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4nuH |
20:57:43 | FromDiscord | <Phil> assuming both myproc variations have different signatures |
20:57:51 | FromDiscord | <rakgew> well I read source in a book like "mastering nim" I have no tooling. |
20:58:50 | FromDiscord | <rakgew> @Phil right, then one would probably start with aliasing things..? |
20:59:15 | FromDiscord | <Elegantbeef> Given i dont have that book I cannot comment on the content |
20:59:31 | FromDiscord | <rakgew> (-\: |
20:59:58 | FromDiscord | <Phil> In reply to @rakgew "<@180601887916163073> right, then one": That might cause problems if some of your code relies on overloads, think of json'y `parseHook` that works by overloading that proc a bunch of times |
21:00:06 | FromDiscord | <Phil> (edit) "json'y" => "jsony's" |
21:00:30 | FromDiscord | <Elegantbeef> Yea you need that `myProc` named properly so mixins work |
21:00:31 | FromDiscord | <rakgew> hm, true. |
21:01:07 | FromDiscord | <Elegantbeef> I just think the cases that most people bring up where this causes reading issues is always like "Imagine you're reading a PR on the toilet with a phone that has 3 lines that are 3 columns wide" |
21:02:13 | FromDiscord | <Phil> A solution that works for everything is either go for `module.proc`, abandon UCS and any case in your code where you don't prefix with `module` it immediately becomes clear that you're doing a play with overloads |
21:02:37 | FromDiscord | <Phil> OR you live with having to search a bit to figure out where a proc comes from |
21:02:47 | FromDiscord | <Elegantbeef> And now we have `if strutils.contains(myString, {'a'..'z'})` instead of `{'a'..'z'} in myString` |
21:03:28 | FromDiscord | <Phil> In reply to @Elegantbeef "And now we have": Yeah, that's the price you'd be paying: Less precise expression of what applies to what else in exchange for knowing at a glance the location that provided the proc |
21:03:29 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4nuK |
21:03:42 | FromDiscord | <Phil> And more convoluted code generally |
21:03:54 | FromDiscord | <Phil> There's a reason not even java asks that of you |
21:04:18 | FromDiscord | <Phil> Actually never mind, they do since everything's a class and classes do 1:1 correspond to files |
21:04:26 | FromDiscord | <Phil> I abandon my case, java does it, that's still a bad idea |
21:05:37 | FromDiscord | <Elegantbeef> I just think that the cases where there is ambiguity where a procedure comes from appear cause there is static ambiguity |
21:06:01 | FromDiscord | <Elegantbeef> If you `import std/strutils` one can assume that any non system string operations are coming from there |
21:07:00 | FromDiscord | <Elegantbeef> If it's unclear in a specific case you can always alias those procedures, or selectively import what you're using |
21:07:10 | FromDiscord | <Elegantbeef> It's more likely to be clear than unclear in my experience |
21:15:10 | FromDiscord | <kaddkaka> nim uses this syntax `import std/[strutils, sequtils]` to import several modules that share a parent. DO you have any opinions on this syntax? good? bad?↵I'm thinking of doing some hierarchical categorisation of a test suite, and I'm thinking if I should use something similar |
21:15:23 | FromDiscord | <Elegantbeef> It's idiomatic |
21:15:51 | FromDiscord | <Elegantbeef> Though due to parsing i think you need to do `"." / [moduleA, moduleB]` |
21:15:58 | FromDiscord | <Elegantbeef> Or is that for `".."` |
21:16:00 | FromDiscord | <Elegantbeef> I forget |
21:17:56 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4nuO |
21:18:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4nuP |
21:19:20 | FromDiscord | <kaddkaka> In reply to @Elegantbeef "Though due to parsing": due to parsing? Hmm, what do you mean? |
21:19:57 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4nuQ |
21:20:09 | FromDiscord | <Elegantbeef> Fuck element correcting my codeblocks due to three backticks followed by an emoji! |
21:20:13 | FromDiscord | <rakgew> well @Phil 's non-indented import is source code friendlier I guess. |
21:20:52 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4nuR |
21:21:02 | FromDiscord | <kaddkaka> In reply to @rakgew "well <@180601887916163073> 's non-indented": friendlier in what sense? `git diff`? `git diff --word-diff`? |
21:21:06 | FromDiscord | <rakgew> I mean the not allowed trailing comma in indented imports.↵they read nicer though.. |
21:21:11 | FromDiscord | <Elegantbeef> I believe `../` or `./` is parsed/processed incorrectly to not be relative or parent |
21:21:11 | FromDiscord | <Elegantbeef> I forget which |
21:21:11 | FromDiscord | <Elegantbeef> I think it's `./` |
21:21:12 | FromDiscord | <Elegantbeef> I am phil |
21:21:12 | FromDiscord | <Elegantbeef> I dislike a shit load of `let`s |
21:21:53 | FromDiscord | <Phil> Shit load of lets are superior over forcing my eyes to scan when the declaration block ends! |
21:22:57 | FromDiscord | <Phil> I also don't like how it sort of promotes the habit of having all your declarations in one block as opposed to closest to the place where they're needed contextually |
21:23:53 | FromDiscord | <Elegantbeef> It doesnt though phil |
21:23:56 | FromDiscord | <rakgew> @kaddkaka in the non indented one can easily remove the last import and have a single line change in git diff, whereas removing last import from indeted import one gets 2 line changes.. (-; |
21:25:25 | FromDiscord | <rakgew> good point.↵(@Phil) |
21:25:29 | FromDiscord | <kaddkaka> that's what word-diff is for 🙂 |
21:26:25 | FromDiscord | <kaddkaka> (or canonicalizing (aka black/go-formatting) before diffing 😉 ) |
21:26:36 | FromDiscord | <kaddkaka> (edit) "(or canonicalizing (aka black/go-formatting) before diffing 😉 ) ... " added "(Why isn't this a thing yet?)" |
21:26:45 | FromDiscord | <kaddkaka> (edit) "yet?)" => "(yet)?)" |
21:27:34 | FromDiscord | <kaddkaka> In reply to @rakgew "<@185793553539137537> in the non": see reply above ^ |
21:31:12 | * | ltriant joined #nim |
21:31:38 | FromDiscord | <Phil> In reply to @Elegantbeef "I believe `../` or": IIRC you can't do ./[multiple, imports] nor can you do ../[multiple, imports]↵I think I remember doing ../othermodule/[multiple, imports] though |
21:32:11 | FromDiscord | <kaddkaka> Is ` ../othermodule/[multiple, imports]/basic` possible? |
21:32:54 | FromDiscord | <Phil> No idea |
21:33:04 | FromDiscord | <Phil> Never ever even tried that one |
21:33:16 | FromDiscord | <Phil> I wouldn't even know what it'd want to express |
21:34:31 | FromDiscord | <Elegantbeef> No that is not |
21:36:26 | FromDiscord | <eyes> quick how do i do logical AND |
21:36:38 | FromDiscord | <Elegantbeef> `and` |
21:36:42 | FromDiscord | <eyes> bruh |
21:36:45 | FromDiscord | <Elegantbeef> Quck give me $300 |
21:36:53 | FromDiscord | <eyes> dies\ |
21:37:10 | FromDiscord | <Phil> In reply to @Elegantbeef "Quck give me $300": `not` |
21:37:38 | FromDiscord | <eyes> the reason i didnt think it was ``and`` is because it didnt get highlighted when i wrote it in vim |
21:37:46 | FromDiscord | <eyes> whereas ``not`` and ``notin`` do |
21:37:48 | FromDiscord | <eyes> cringe |
21:42:21 | FromDiscord | <kaddkaka> I have highlighted `and`, but it might be because of `Plug 'alaviss/nim.nvim'` |
21:42:39 | FromDiscord | <kaddkaka> (edit) |
21:50:33 | FromDiscord | <antonio_michelle> Enjoy profitable forex/cryptocurrency income and earn up to $30,000.00 within 5 days, not only interested people should ask me how↵https://t.me/+BQlhudqWXGk1MWY0 |
21:55:20 | FromDiscord | <Phil> In reply to @antonio_michelle "Enjoy profitable forex/cryptocurrency income": <@&371760044473319454> Crypto scam scum |
22:12:48 | * | arkurious quit (Ping timeout: 248 seconds) |
22:16:47 | * | arkurious joined #nim |
22:18:06 | FromDiscord | <jmgomez> if you have a nim file that produced a obj file via a c/cpp and to produce it used an external header (with the header pragma). If the header changes, Nim doesnt recompile the affected files because the hash is based on the cpp (not sure about this). Is this the expected behaviour? If so, any way to force it? |
22:25:45 | * | uics quit (Remote host closed the connection) |
22:26:20 | * | uics joined #nim |
22:28:58 | * | Batzy quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
22:30:12 | * | Batzy joined #nim |
22:33:03 | * | dropkick quit (Quit: Leaving) |
22:42:11 | FromDiscord | <Elegantbeef> you can provide `-f` or `--forceBuild:on` |
22:44:26 | FromDiscord | <jmgomez> In reply to @Elegantbeef "you can provide `-f`": but that will end up building everything, even for those files that dont use the header |
22:45:52 | FromDiscord | <jmgomez> I guess I will need to keep track of them manually. My issue is that I get a linker issue when recompiling and deleting a virtual function if the user deletes the virtual function implementation |
23:03:10 | * | beholders_eye joined #nim |
23:03:39 | * | derpydoo quit (Ping timeout: 248 seconds) |
23:08:47 | FromDiscord | <Elegantbeef> I do have to say making this MR for wine, Nim is much nicer for PRs no one argues how to format an if statement 😄 |
23:10:37 | FromDiscord | <leorize> does wine not use clang-format? |
23:11:21 | FromDiscord | <I have 50GB of nothing on my PC> which library should I use for a http server? |
23:12:13 | FromDiscord | <Elegantbeef> I do not know leo |
23:12:24 | FromDiscord | <Elegantbeef> I do not write C ever |
23:12:31 | FromDiscord | <Elegantbeef> This is really the first time i've written C |
23:12:51 | FromDiscord | <leorize> well, `clang-format` and `clang-tidy` is just magic |
23:13:27 | FromDiscord | <Elegantbeef> Uh oh bos joining |
23:13:29 | FromDiscord | <Elegantbeef> bots |
23:13:38 | FromDiscord | <Elegantbeef> SOmeone get a mtrix mod |
23:14:10 | FromDiscord | <Elegantbeef> Wait this might be gitter migration? |
23:16:58 | FromDiscord | <Elegantbeef> Could they have made this any less intrusive |
23:16:59 | FromDiscord | <leorize> how many were in our gitter instance damn it |
23:17:00 | FromDiscord | <leorize> it's gitter users |
23:17:00 | FromDiscord | <Elegantbeef> I think this is matrix culling off gitter so now they're real matrix users |
23:17:01 | FromDiscord | <leorize> what? |
23:17:02 | FromDiscord | <Elegantbeef> For context we're seeing a shitload of people joining on matrix |
23:20:04 | FromDiscord | <Elegantbeef> A couple |
23:20:04 | FromDiscord | <Elegantbeef> What were we talking about.... right C |
23:20:04 | FromDiscord | <leorize> they're done ig |
23:20:05 | FromDiscord | <Elegantbeef> C is not fun |
23:20:05 | FromDiscord | <Yepoleb> the bridge is still very slow |
23:20:06 | FromDiscord | <Yepoleb> rip |
23:20:06 | FromDiscord | <Yepoleb> why do you dislike C? |
23:20:07 | FromDiscord | <Elegantbeef> Doesnt help that matrix just ddos'd their home server |
23:21:04 | FromDiscord | <Elegantbeef> It's just so horrid to write and debug(yes debuggers exist, but i just need to print out X value) 😄 |
23:21:10 | FromDiscord | <Yepoleb> do you always use print debugging? |
23:21:24 | FromDiscord | <Elegantbeef> I often use print debugging so going into C is just horrid |
23:21:29 | FromDiscord | <Yepoleb> yes |
23:21:41 | FromDiscord | <Elegantbeef> Plus it uses untyped ints for like 90% of things |
23:21:41 | FromDiscord | <Yepoleb> what debugger do you use for nim? |
23:21:43 | FromDiscord | <Elegantbeef> ah yes the protocol is `2` |
23:21:51 | FromDiscord | <Elegantbeef> 2 is a protocol yes! |
23:22:12 | FromDiscord | <Elegantbeef> When i rarely need to do break point debugging i use gdb |
23:22:19 | FromDiscord | <Yepoleb> the meaning of 2 is behind 3 layers of #define |
23:22:22 | FromDiscord | <Elegantbeef> But i hardly ever reach for a debugger in Nim |
23:22:44 | FromDiscord | <Elegantbeef> Since i can just `echo x` and get a majestic formatted version of the type |
23:23:43 | FromDiscord | <Yepoleb> i use gdb for both and it's more horrible for nim because of mangled names |
23:24:58 | FromDiscord | <Elegantbeef> Sure, but you also never really need to reach for a debugger with Nim ime |
23:25:15 | FromDiscord | <Elegantbeef> I write compiler code without a debugger cause a simple `echo node.kind` suffices 😄 |
23:25:30 | FromDiscord | <Yepoleb> i do for crashes |
23:25:38 | FromDiscord | <Elegantbeef> I dont write code that crashes so checkmate |
23:25:39 | FromDiscord | <Yepoleb> segfaults and exceptions in release mode |
23:25:39 | FromDiscord | <Elegantbeef> 😛 |
23:25:52 | FromDiscord | <Yepoleb> damn owned |
23:26:14 | FromDiscord | <Elegantbeef> I do one day intend on making nim capable of emitting debug procedures for the types |
23:26:46 | FromDiscord | <Elegantbeef> So that gdb uses something like `$` instead of how it presently works |
23:27:01 | FromDiscord | <Yepoleb> there is nim-gdb.py which was supposed to have that i think |
23:27:10 | FromDiscord | <Yepoleb> but it does not work anymore |
23:27:16 | FromDiscord | <Elegantbeef> I mean it does work |
23:27:21 | FromDiscord | <Elegantbeef> It just doesnt do it properly |
23:27:41 | FromDiscord | <Yepoleb> i get a lot of exceptions when using it |
23:27:50 | FromDiscord | <Yepoleb> python exceptions |
23:27:50 | FromDiscord | <Elegantbeef> The compiler just needs to emit a procedure per type and skip all the attempting to reason the type inside the python script |
23:28:57 | FromDiscord | <Elegantbeef> If instead of those pretty printers written in python the script called the Nim code for debugging the types, we'd be in a much better place with gdb |
23:29:49 | FromDiscord | <Yepoleb> would you do this with a compiler flag? |
23:30:24 | FromDiscord | <Elegantbeef> If you supply `--debugger:native` the Nim compiler should emit some extern `debug` procedures |
23:31:37 | FromDiscord | <Elegantbeef> Atleast in my happier world |
23:31:38 | FromDiscord | <Elegantbeef> This allows the pretty printers to be braindead, they grab the type then find the procedure of that type and call it |
23:31:38 | FromDiscord | <Elegantbeef> This would allow complex types and sets to just work |
23:32:44 | FromDiscord | <Yepoleb> sounds good |
23:32:50 | FromDiscord | <Yepoleb> i support your idea |
23:33:12 | FromDiscord | <Elegantbeef> Now if only someone implemented it |
23:33:28 | FromDiscord | <Yepoleb> we could kidnap someone |
23:35:31 | FromDiscord | <Yepoleb> i don't really know what nim debugging needs |
23:35:57 | FromDiscord | <Yepoleb> i also like print debugging whenever possible |
23:36:13 | FromDiscord | <Elegantbeef> Nim debugging really just needs to be able to print the actual Nim data |
23:36:23 | FromDiscord | <Elegantbeef> Which can be got when you use `extern` generated procedures in theory |
23:36:47 | FromDiscord | <Yepoleb> i think it also needs demangling that just works |
23:36:48 | FromDiscord | <Elegantbeef> All Nim types need to emit a `debug` procedure with that flag so you can debug specific values |
23:36:56 | FromDiscord | <Elegantbeef> You do not need demangling in my world |
23:37:05 | FromDiscord | <Elegantbeef> Cause the Nim compiler emits the debug logic |
23:37:18 | FromDiscord | <Elegantbeef> Which means it is statically known information |
23:37:26 | FromDiscord | <Elegantbeef> It's very much akin to if `$` actually existed for all types |
23:37:29 | FromDiscord | <Yepoleb> but printing values is not everything |
23:37:43 | FromDiscord | <Yepoleb> i also sometimes need backtraces |
23:38:06 | FromDiscord | <Yepoleb> and proc names and line numbers are very nice |
23:38:41 | FromDiscord | <Elegantbeef> Yea given i dont really use a debugger i do not know what that adds 😄 |
23:38:51 | FromDiscord | <Elegantbeef> `writeStackTrace` works enough for me 😄 |
23:39:21 | FromDiscord | <Yepoleb> release builds are also hard to debug |
23:40:16 | FromDiscord | <Yepoleb> which i know sounds a bit dumb, but some problems only show up with optimization |
23:41:33 | FromDiscord | <Yepoleb> didn't we want to shit on C though? |
23:42:58 | FromDiscord | <Elegantbeef> I already shit on C |
23:42:59 | FromDiscord | <leorize> but then the debug procs would mutate the program state \:p |
23:43:11 | FromDiscord | <Elegantbeef> Oh noes |
23:44:26 | FromDiscord | <Elegantbeef> Debuggable programs vs. worrying about enabling UB |
23:45:14 | FromDiscord | <Yepoleb> i think implementation or platform defined behavior is worse than UB |
23:46:17 | FromDiscord | <Yepoleb> oh, this is about the debugger |
23:47:09 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1073027233435885588/image.png |
23:47:11 | FromDiscord | <Elegantbeef> Here we go C shit talking |
23:47:16 | FromDiscord | <Elegantbeef> Imagine if generics existed |
23:47:42 | FromDiscord | <leorize> this is more of\: imagine if template existed |
23:47:52 | FromDiscord | <Elegantbeef> It's a bit of both |
23:48:12 | FromDiscord | <Elegantbeef> Could be a generic that takes a pointer proc |
23:50:08 | FromDiscord | <Yepoleb> that's really awful |
23:50:29 | FromDiscord | <Elegantbeef> You're telling me, i'm just trying to get the protocol of a request in a cross platform way |
23:51:12 | FromDiscord | <Elegantbeef> Sadly only Linux implemented SO\_PROTOCOL for getsockopt |
23:52:25 | FromDiscord | <Yepoleb> i am confused |
23:52:33 | FromDiscord | <Yepoleb> the protocol of what request? |
23:52:48 | FromDiscord | <Elegantbeef> The protocol of a in process request on an opened socket |
23:53:07 | FromDiscord | <Elegantbeef> Windows apparently doesnt error when you send to port 0 with udp(and tcp?) |
23:53:17 | FromDiscord | <Elegantbeef> Linux errors, cause that's fucking dumb |
23:53:37 | FromDiscord | <Elegantbeef> No clue if any other posix systems that implement `sendmsg` error |
23:53:57 | FromDiscord | <Elegantbeef> Anyway point is one needs to see if it's a udp packet going to port 0 and skip over that data |
23:54:17 | FromDiscord | <Elegantbeef> In a cross platform way that works on all platforms wine supports |
23:54:21 | FromDiscord | <Yepoleb> why not reject it for all protocols? |
23:54:30 | FromDiscord | <Elegantbeef> Cause it's valid for some protocols |
23:54:58 | FromDiscord | <antonio_michelle> Enjoy profitable forex/cryptocurrency income and earn up to $30,000.00 within 5 days, not only interested people should ask me how↵https://t.me/+BQlhudqWXGk1MWY0 |
23:55:10 | FromDiscord | <Yepoleb> fuck off |
23:55:14 | FromDiscord | <leorize> I though we have this nimbot thing with is mjolnir? |
23:55:23 | FromDiscord | <leorize> does no one operates it? |
23:55:24 | FromDiscord | <Elegantbeef> It's apparently missing |
23:55:41 | FromDiscord | <Yepoleb> is it valid for any IP protocols? |
23:56:04 | FromDiscord | <Elegantbeef> Seems icmp is fine with it |
23:56:33 | FromDiscord | <leorize> icmp doesn't do ports, right? |
23:56:43 | FromDiscord | <Elegantbeef> Do i look like i know what i'm doing? 😄 |
23:56:50 | FromDiscord | <Yepoleb> yes |
23:57:01 | FromDiscord | <Yepoleb> you are my expert |
23:57:04 | FromDiscord | <Elegantbeef> I'm throwing darts at a problem that i found a fix for trying to get something that is accepted into wine |
23:57:20 | FromDiscord | <Elegantbeef> It's not going well cause i know next to nothing about network protocols |
23:57:25 | FromDiscord | <Elegantbeef> And i know less about C |