00:13:41 | * | cnx quit (Ping timeout: 246 seconds) |
00:14:15 | * | cnx joined #nim |
00:25:40 | * | beholders_eye quit (Ping timeout: 260 seconds) |
00:30:39 | * | antranigv quit (Ping timeout: 255 seconds) |
00:34:28 | FromDiscord | <Sun「無用」> where can I ask questions? |
00:35:39 | FromDiscord | <Elegantbeef> That's a question so you best be in the right here |
00:36:45 | FromDiscord | <Sun「無用」> `Error: unhandled exception: index 3 not in 0 .. 2 [IndexDefect]` wth is this error? |
00:36:56 | FromDiscord | <Sun「無用」> I'm not even using a collection |
00:37:07 | FromDiscord | <Elegantbeef> What's the full stack trace? |
00:37:51 | FromDiscord | <Elegantbeef> Also is this during compiling or runtime? |
00:38:17 | FromDiscord | <Sun「無用」> sent a code paste, see https://play.nim-lang.org/#ix=4u2e |
00:38:18 | FromDiscord | <Sun「無用」> compilation, I think |
00:38:41 | FromDiscord | <Elegantbeef> Use nim directly |
00:38:58 | FromDiscord | <Elegantbeef> `nim c ./yourMain.nim` |
00:39:23 | FromDiscord | <Sun「無用」> it's a nimble project |
00:39:37 | FromDiscord | <Elegantbeef> Sure but nimble likes hiding errors |
00:39:51 | FromDiscord | <Sun「無用」> I'm already using `--verbose` |
00:40:41 | FromDiscord | <Sun「無用」> And it's the same thing |
00:40:44 | FromDiscord | <Elegantbeef> Is the source open? |
00:40:55 | FromDiscord | <Sun「無用」> ? |
00:41:05 | FromDiscord | <Elegantbeef> Is the source code open |
00:41:37 | FromDiscord | <Sun「無用」> it's my code |
00:41:53 | FromDiscord | <Sun「無用」> dunno what you're talking abt |
00:42:01 | FromDiscord | <Elegantbeef> ... |
00:42:02 | FromDiscord | <Elegantbeef> Do you have a repo that i could clone and compile it |
00:42:15 | FromDiscord | <Sun「無用」> no |
00:43:18 | FromDiscord | <Elegantbeef> Well then comment out the code until it stops erroring |
00:43:26 | FromDiscord | <Elegantbeef> Seems it's a compiler error |
00:43:38 | FromDiscord | <Sun「無用」> what... |
00:44:13 | FromDiscord | <Elegantbeef> Either comment out the code and recompile until it stops erroring or use a debug compiler to find where the bug is |
00:45:31 | FromDiscord | <Sun「無用」> It's not even compiling, though. |
00:45:34 | FromDiscord | <Sun「無用」> I can't debug |
00:45:38 | FromDiscord | <Elegantbeef> That's my point |
00:45:41 | FromDiscord | <Elegantbeef> Use a debug compiler |
00:45:45 | FromDiscord | <Elegantbeef> The compiler is crashing |
00:45:58 | FromDiscord | <Elegantbeef> Using a debug compiler will give you stack traces to see where the code is erroring |
00:46:21 | FromDiscord | <Elegantbeef> You then can either PR a fix or work around the bug |
00:47:33 | FromDiscord | <Sun「無用」> I don't understand what you're saying |
00:47:56 | FromDiscord | <Elegantbeef> Build a debug compiler, use said debug compiler to compile your code, get more informative stack trace so you can debug the cause of the code |
00:48:17 | FromDiscord | <Elegantbeef> cause of the error |
00:50:54 | FromDiscord | <Sun「無用」> `> nim c --debugger:on -r .\src\my_option.nim` like this? what |
00:50:59 | FromDiscord | <Elegantbeef> No |
00:51:22 | FromDiscord | <Elegantbeef> What version of Nim are you using? |
00:51:56 | FromDiscord | <Sun「無用」> 1.6.12 |
00:52:33 | FromDiscord | <Elegantbeef> If you are using 1.6.x get a devel version of the compiler and try to compile your code, if it still fails, follow the build instructions on the nim git repo, then run `./koch temp c ./yournim.nim` |
00:53:12 | FromDiscord | <Sun「無用」> koch doesn't exist. |
00:53:22 | FromDiscord | <Elegantbeef> "follow the build instructions" |
00:53:35 | * | azimut joined #nim |
00:53:44 | FromDiscord | <Sun「無用」> (edit) "exist." => "exist as a command" |
01:02:40 | FromDiscord | <Sun「無用」> but the same code works if I just use a string too, forgot to say that |
01:02:52 | FromDiscord | <Sun「無用」> and I don't know where to get those |
01:02:57 | FromDiscord | <Elegantbeef> What? |
01:03:29 | FromDiscord | <Sun「無用」> what? |
01:03:35 | FromDiscord | <Elegantbeef> Yes |
01:05:18 | FromDiscord | <Sun「無用」> sent a code paste, see https://play.nim-lang.org/#ix=4u2i |
01:05:59 | FromDiscord | <Elegantbeef> Well it's a compiler bug, so either `initPerson` causes it or something else does |
01:06:28 | FromDiscord | <Sun「無用」> sent a code paste, see https://play.nim-lang.org/#ix=4u2j |
01:06:44 | FromDiscord | <Elegantbeef> Then it's probably the `=>` operator |
01:06:50 | FromDiscord | <Elegantbeef> replace that for a normal proc |
01:07:19 | FromDiscord | <Sun「無用」> but why does it work with a string then? and why would it cause an error? |
01:07:35 | FromDiscord | <Elegantbeef> It's a compiler bug.... so it's a bug that's why |
01:08:04 | FromDiscord | <Sun「無用」> no, it doesn't change anything |
01:08:08 | FromDiscord | <Elegantbeef> Use a devel compiler to see if it's been fixed, if not minimise it and make an issue |
01:08:21 | FromDiscord | <Sun「無用」> again what even is that. |
01:08:40 | FromDiscord | <Elegantbeef> the nightly build of the compiler |
01:08:47 | FromDiscord | <Elegantbeef> `choosenim devel` if you installed using choosenim |
01:12:30 | FromDiscord | <demotomohiro> People sometimes encounter Nim compiler bug. I also have encountered Nim compiler bug recently and reported it. https://github.com/nim-lang/Nim/issues/21708 |
01:13:46 | FromDiscord | <Dudugz> In reply to @Dudugz "Because it makes sense,": Anyone? |
01:18:33 | FromDiscord | <Dudugz> I configured Github actions to run on ubuntu-latest and set it to install Nim 1.6.12 and run ``nimble test`` but for some reason the socket test doesn't pass at all. I configured the server to use host 127.0.0.1 and port 1028, and the client to connect to it. The client gives connection refused error. |
01:18:55 | FromDiscord | <Elegantbeef> Does github have some sort of permission system |
01:19:22 | FromDiscord | <Dudugz> I think not, is it necessary to use chmod? |
01:19:38 | FromDiscord | <Dudugz> I didn't use chmod because I didn't know it was necessary or not |
01:19:39 | FromDiscord | <Elegantbeef> Not a clue i've never used github actions |
01:19:56 | FromDiscord | <Elegantbeef> I'm not talking about OS permissions as much as container permissions |
01:20:30 | FromDiscord | <Dudugz> Hmm, I was trying to set up an automatic test for my project, everything passed the test except the socket that passes on my computer but gives a connection refused on GA |
01:20:49 | FromDiscord | <Dudugz> There is no permission setting so I don't think so |
01:21:24 | FromDiscord | <demotomohiro> Maybe try other port?↵Or Google "socket github action permission" |
01:25:51 | * | Jjp137 joined #nim |
01:48:56 | * | antranigv joined #nim |
01:51:56 | FromDiscord | <Dudugz> sent a long message, see http://ix.io/4u2w |
01:52:01 | FromDiscord | <Dudugz> I'll try to find something related |
01:53:48 | * | Jjp137 quit (Ping timeout: 250 seconds) |
02:11:02 | * | Jjp137 joined #nim |
02:20:57 | * | arkurious quit (Quit: Leaving) |
02:22:52 | FromDiscord | <michaelb.eth> In reply to @Dudugz "I've tried other ports": is the port being opened and listened on by the same process that's trying to connect to it? |
02:53:44 | FromDiscord | <Dudugz> Yup |
03:25:52 | * | Jjp137 quit (Ping timeout: 265 seconds) |
03:26:11 | * | Jjp137 joined #nim |
03:34:32 | FromDiscord | <Dudugz> I managed to fix |
03:36:02 | * | lucasta quit (Read error: Connection reset by peer) |
03:36:27 | * | TakinOver quit (Remote host closed the connection) |
03:36:43 | * | TakinOver joined #nim |
06:12:39 | * | antranigv quit (Ping timeout: 255 seconds) |
06:23:15 | FromDiscord | <nwb^3> hi everyone |
06:23:41 | FromDiscord | <nwb^3> this seems like it should be fairly straight forward but im not sure what the issue is |
06:23:55 | FromDiscord | <nwb^3> sent a code paste, see https://play.nim-lang.org/#ix=4u3q |
06:24:19 | FromDiscord | <nwb^3> failing with |
06:24:35 | FromDiscord | <nwb^3> sent a code paste, see https://play.nim-lang.org/#ix=4u3r |
06:25:21 | FromDiscord | <Elegantbeef> I assume a type mismatch error |
06:25:22 | FromDiscord | <Elegantbeef> you want `socketTable.del(x)` |
06:26:00 | FromDiscord | <Elegantbeef> Yea there is no `del` for `AsyncSocket` |
06:26:33 | FromDiscord | <nwb^3> ah thanks |
06:26:53 | FromDiscord | <nwb^3> still trying to get my head around it |
06:27:04 | FromDiscord | <nwb^3> and believe me chatgpt isnt helping 😉 |
06:33:12 | FromDiscord | <Elegantbeef> I'd feign disappointment, but i'm still quite concerned about learning using LLMs |
06:34:04 | FromDiscord | <Ras> sent a code paste, see https://play.nim-lang.org/#ix=4u3u |
06:34:35 | * | junaid_ joined #nim |
06:35:01 | FromDiscord | <Elegantbeef> Isnt 0 fallthrough, I do not recall |
06:35:01 | FromDiscord | <Ras> actually, i can just do what the stdlib does? create an asyncNativeSocket and call newAsyncSocket on it manually? i think this would work? |
06:35:16 | FromDiscord | <Ras> strace defines it as `ETH_P_???` |
06:36:19 | FromDiscord | <Elegantbeef> There is the `newAsyncSocket` that takes cint it seems |
06:37:38 | FromDiscord | <Ras> sent a code paste, see https://play.nim-lang.org/#ix=4u3v |
06:37:49 | FromDiscord | <Ras> so i can just copy-paste that and remove the.. uh... enumerization? |
06:37:52 | FromDiscord | <Ras> i don't know what to call it |
06:38:43 | FromDiscord | <Ras> oh wait, i see the issue here |
06:39:09 | FromDiscord | <Elegantbeef> I'm a bit confused why you need to do anything, can't you just use the cint overload? |
06:39:17 | FromDiscord | <Ras> can you elaborate? |
06:39:50 | FromDiscord | <Elegantbeef> Why doesnt `var mySocket = newAsyncSocket(cint yourDomain, cint yourSockType, 0,...)` work? |
06:41:05 | FromDiscord | <Ras> because that calls the proc i pasted above, which does `Protocol(0)` before calling the inner `newAsyncSocket`, which fails on runtime |
06:41:38 | FromDiscord | <Elegantbeef> Oh i missed that |
06:44:19 | NimEventer | New thread by cmc: Pass generic proc object different sub-types, see https://forum.nim-lang.org/t/10125 |
06:44:21 | FromDiscord | <Ras> sent a code paste, see https://play.nim-lang.org/#ix=4u3w |
06:44:49 | FromDiscord | <Elegantbeef> That just means the internal hint/warning is from an expansion |
06:45:27 | FromDiscord | <Ras> oh i see |
06:45:28 | FromDiscord | <Ras> ohhhh |
06:45:29 | FromDiscord | <Ras> okay |
06:45:50 | FromDiscord | <Ras> sent a code paste, see https://play.nim-lang.org/#ix=4u3x |
07:03:01 | FromDiscord | <Ras> sent a code paste, see https://play.nim-lang.org/#ix=4u3B |
07:03:28 | FromDiscord | <Elegantbeef> `std/importutils` |
07:04:07 | FromDiscord | <Ras> oh wow |
07:04:13 | FromDiscord | <Ras> that feels like cheating |
07:04:14 | FromDiscord | <Ras> i like it |
07:04:15 | FromDiscord | <Ras> thanks |
07:07:06 | FromDiscord | <Ras> actually, the root of my problem is still the same. `result.protocol = protocol` - this expects a `Protocol` type, which is an enum where 0 isn't defined |
07:07:34 | FromDiscord | <Ras> is there any way to retroactively define 0 as a protocol? |
07:07:47 | FromDiscord | <Ras> i feel way out of my depth here |
07:10:10 | FromDiscord | <faldor20> sent a long message, see http://ix.io/4u3D |
07:12:12 | FromDiscord | <faldor20> PS:↵I did have to install it with devel nim because it just seemed broken when installed using 1.6.12↵And I'm using this extension in vscode: https://marketplace.visualstudio.com/items?itemName=bung87.vscode-nim-lsp |
07:49:02 | FromDiscord | <xTrayambak> This is really weird, nimble.directory works fine on my phone (Firefox) but not on my PC (Brave). On the phone it works as normal but on my PC it shows a default nginx page. |
07:49:26 | FromDiscord | <xTrayambak> It shows the default nginx page even when using curl. |
07:55:40 | FromDiscord | <Ras> ipv4 vs ipv6? |
07:56:03 | FromDiscord | <Ras> maybe they forgot to listen on [::]:443 or whatever |
07:56:26 | FromDiscord | <Ras> and your PC doesn't do ipv6, but your phone does? |
07:56:28 | FromDiscord | <Ras> wild guess |
08:06:14 | FromDiscord | <Ras> oh, nope, it's http vs https |
08:06:34 | FromDiscord | <Ras> http://nimble.directory - default nginx page↵https://nimble.directory - nimble directory |
08:22:05 | FromDiscord | <xTrayambak> Yep. It seems Firefox updates connections to HTTPS but Brave does not. |
08:59:30 | FromDiscord | <firasuke> should you use optional values from std/options or try/except? |
09:03:54 | * | derpydoo quit (Remote host closed the connection) |
09:11:13 | FromDiscord | <faldor20> I would say that depends on whether your error is truly exceptional? |
09:12:02 | FromDiscord | <faldor20> @firasuke There is also this repo https://github.com/arnetheduck/nim-result which complicates things further.↵I would say generally with optionals it's fairly easy to say what should and shouldn |
09:12:36 | FromDiscord | <faldor20> (edit) "shouldn" => "shouldn't be an option. ↵Choosing between a result type and exceptions is a much more complicated decision" |
09:12:54 | FromDiscord | <firasuke> hmmm |
09:24:25 | FromDiscord | <firasuke> sent a code paste, see https://play.nim-lang.org/#ix=4u49 |
10:21:19 | FromDiscord | <sigmasd> why don't you wrap the inside with try except , instead of that recursion ? |
10:36:52 | * | xet7 quit (Read error: Connection reset by peer) |
10:40:22 | FromDiscord | <firasuke> Oh sorry it's not meant to be a recursion |
10:45:31 | * | derpydoo joined #nim |
10:53:07 | * | beholders_eye joined #nim |
11:06:26 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4u4z |
11:07:12 | FromDiscord | <Oscour> Hi everyone, just a quick question. I created a tuple type in which I would like to put sensor readings. In python it is simply done like `my_named_tuple(array)` by unpacking the array into the named tuple. I would like to know if there is a similar way to populate my named tuple with an array of values ? |
11:09:29 | FromDiscord | <Rika> In reply to @sOkam! "How would you map": looks fine? |
11:09:42 | FromDiscord | <Rika> In reply to @Oscour "Hi everyone, just a": no |
11:09:49 | FromDiscord | <Rika> well, not without external packages |
11:10:39 | FromDiscord | <Oscour> In reply to @Rika "well, not without external": Arf :/ |
11:11:14 | FromDiscord | <Oscour> I there a way to do it with a for loop? I've been trying for a while but cannot figure out a way to parse the fields and assign them a value |
11:11:47 | FromDiscord | <sOkam!> In reply to @Rika "looks fine?": does an `object` have anything in it, other than the fields? just like seq do? |
11:12:24 | FromDiscord | <Rika> In reply to @sOkam! "does an `object` have": no |
11:12:28 | FromDiscord | <sOkam!> the `RequiredLimits` struct has a ton of `uint32_t` in it... so maybe its the alignment of those? |
11:14:13 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=4u4D |
11:14:19 | FromDiscord | <sOkam!> @Gumbercules had these `uint32` mapped as `uint`. what's the difference between uint and uint32 in nim? |
11:14:20 | FromDiscord | <Rika> In reply to @sOkam! "the `RequiredLimits` struct has": maybe yes |
11:14:53 | FromDiscord | <Rika> In reply to @sOkam! "<@204328759715692544> had these": uint is mapped to pointer size iirc? |
11:15:19 | FromDiscord | <Rika> so its wrong if you're on 64 bit |
11:15:44 | FromDiscord | <sOkam!> This is the original: https://github.com/webgpu-native/webgpu-headers/blob/048341380f41c0d67e66998b3def7b5868380080/webgpu.h#L750-L782↵And this is what I mapped: https://github.com/heysokam/wgpu/blob/c56bc29bf2f006ec270dc6170d2209ebb3ade911/src/wgpu/types.nim#L314-L344 |
11:15:52 | FromDiscord | <Rika> im dumb |
11:15:58 | FromDiscord | <sOkam!> In reply to @Rika "so its wrong if": oh.... |
11:16:01 | FromDiscord | <Rika> i forgot |
11:16:02 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=4u4E |
11:16:16 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=4u4F |
11:16:46 | FromDiscord | <Rika> ofc you can just say var tup: tuple[x: int, y: int] but im rushed so lo |
11:17:22 | FromDiscord | <sOkam!> In reply to @sOkam! "This is the original:": shouldn't all of this be mapped to `uint32` and `uint64`, since they types are explicit size in C? 🤔 |
11:17:33 | FromDiscord | <sOkam!> (edit) "they" => "the" |
11:17:41 | FromDiscord | <Rika> yes |
11:18:27 | FromDiscord | <sOkam!> then im super lost |
11:19:27 | FromDiscord | <Oscour> sent a code paste, see https://play.nim-lang.org/#ix=4u4G |
11:19:35 | FromDiscord | <Rika> that works too |
11:19:56 | FromDiscord | <Rika> i was worried about the compat of the faux iterators and enumerate |
11:20:09 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4u4I |
11:20:10 | FromDiscord | <Yardanico> or maybe you can even use tuples in this case, not sure |
11:20:47 | FromDiscord | <Yardanico> ah it's already a tuple, I meant creating another tuples specifically for acc and gyro :) |
11:20:50 | FromDiscord | <Yardanico> (edit) "tuples" => "other" |
11:20:53 | * | FromDiscord quit (Remote host closed the connection) |
11:21:06 | * | FromDiscord joined #nim |
11:21:23 | FromDiscord | <Oscour> Yup, I understood |
11:21:25 | FromDiscord | <Yardanico> yes it applies everywhere, in new variable definitions too |
11:21:25 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4u4J |
11:22:10 | FromDiscord | <Oscour> Btw, is there a way to create an array with values in a specific range without having to loop over it? I've been looking for a while but didn't found an answer to that |
11:22:29 | FromDiscord | <Oscour> In reply to @Yardanico "yes it applies everywhere,": I love nim haha |
11:23:02 | FromDiscord | <Rika> i dont understand the question |
11:23:18 | FromDiscord | <Yardanico> In reply to @Rika "i dont understand the": fill array values right when initializing |
11:23:36 | FromDiscord | <Yardanico> In reply to @Oscour "Btw, is there a": if you want a range, one is https://nim-lang.org/docs/algorithm.html#fill%2CopenArray%5BT%5D%2CNatural%2CNatural%2CT |
11:23:43 | FromDiscord | <Yardanico> but iirc there was another proc too |
11:24:32 | FromDiscord | <Yardanico> ah right it was about newSeqWith https://nim-lang.org/docs/sequtils.html#newSeqWith.t%2Cint%2Cuntyped |
11:25:03 | FromDiscord | <Oscour> Well, I have been looking for a while but couldn't found anything. Probably because I was using the wrong keywords... :/ Thank you! |
11:25:21 | FromDiscord | <Yardanico> generally std/algorithm has some useful procs for working with containers |
11:25:31 | FromDiscord | <Yardanico> std/sequtils does too, quite some stuff there also works with arrays |
11:25:42 | FromDiscord | <Oscour> In reply to @Rika "i dont understand the": I wanted to know if they is a way to mimic python's `arr = np.arange(10)` in Nim |
11:26:54 | FromDiscord | <Oscour> I think I found the one for sequences but not for arrays. i'll think about std/algorithm next time I want to do something like this |
11:27:27 | FromDiscord | <faldor20> Hey, is there a string formatter for nim that prints a number with a minimum number of leading zeros?↵eg ↵1->001↵100->100 |
11:28:03 | FromDiscord | <Yardanico> yes, multiple |
11:28:13 | FromDiscord | <Yardanico> strformat is generally preferred as it has a lot of features |
11:29:40 | FromDiscord | <Yardanico> https://nim-lang.org/docs/strutils.html#intToStr%2Cint%2CPositive is the other way if you don't want strformat |
11:30:41 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4u4O |
11:30:44 | FromDiscord | <Yardanico> 0 means zero-padding, is the char page |
11:30:53 | FromDiscord | <Yardanico> (edit) "0 means zero-padding, ... iscount" added "6" | "page" => "count" |
11:31:07 | FromDiscord | <faldor20> ahh, thankyou. |
11:31:52 | FromDiscord | <faldor20> I was looking at the right page but not quite the right place. 🤦♂️ |
11:37:18 | FromDiscord | <faldor20> while I'm here asking stupid questions.↵Is there a way to run a .nims file directly?↵I can find no reference to that being possible but it seems weird that it wouldn't work |
11:38:01 | FromDiscord | <faldor20> oh wait... you just run it with nim. Okay |
11:38:48 | FromDiscord | <Oscour> sent a code paste, see https://paste.rs/GVi |
11:42:18 | FromDiscord | <Oscour> if it's not possible to use enumerate I'll just use your solution @Rika 😄 |
11:42:47 | FromDiscord | <Rika> that is not the error |
11:42:53 | FromDiscord | <Rika> that is just a hint pointing to the real error |
11:42:58 | FromDiscord | <Rika> show the whole message |
11:46:40 | FromDiscord | <Oscour> sent a code paste, see https://play.nim-lang.org/#ix=4u4Q |
11:47:43 | FromDiscord | <Oscour> (edit) "https://play.nim-lang.org/#ix=4u4Q" => "https://play.nim-lang.org/#ix=4u4R" |
11:50:28 | FromDiscord | <Rika> ah im blind |
11:50:33 | FromDiscord | <Rika> `r: var MPU6050Readings` |
11:50:44 | FromDiscord | <Rika> or `bigEndian16(unsafeAddr field,` |
11:50:45 | FromDiscord | <Oscour> ohhhhh |
11:50:56 | FromDiscord | <Rika> well |
11:51:00 | FromDiscord | <Rika> the first one it seems |
11:51:06 | FromDiscord | <Rika> unsafeaddr is inappropriate here |
11:51:08 | FromDiscord | <Rika> didnt realise |
11:51:38 | FromDiscord | <Oscour> I'm really not used to the var keyword and logic in functions yet |
11:51:54 | FromDiscord | <Oscour> I could've been stuck there for a while haha |
11:52:39 | FromDiscord | <Rika> when it's an "expression has no address" error its commonly a "you forgot var somewhere" isse |
11:52:41 | FromDiscord | <Rika> (edit) "isse" => "issue" |
11:53:59 | FromDiscord | <Oscour> The linter seems to be happier but I still have the same error :/ |
11:55:04 | FromDiscord | <Oscour> I also had to write b: var array[16, byte] |
11:55:17 | FromDiscord | <Oscour> (edit) "b:" => "`b:" | "byte]" => "byte]`" |
12:12:13 | FromDiscord | <Rika> i forgot how the big endian function works |
12:12:18 | FromDiscord | <Rika> i dont often use it so |
12:20:26 | FromDiscord | <sOkam!> @Rika seems like the values cannot be initialized to 0, that's what was causing the error 🤦♂️ |
12:20:49 | FromDiscord | <sOkam!> is there a way to work with default values in `stable`, before devel becomes the standard? |
12:23:03 | FromDiscord | <Yardanico> the only way for stable is to have procs that have default arguments |
12:23:14 | FromDiscord | <Yardanico> if you want to use 2.0 features, use devel? :P |
12:23:22 | FromDiscord | <Yardanico> then your code is also more likely to not have weird issues with 2.0 |
12:30:49 | * | jmdaemon quit (Ping timeout: 276 seconds) |
12:42:39 | FromDiscord | <sOkam!> wasn't using devel so far because i found weird bugs that made me lose time that got fixed when switching to stable. and since im already doing something weird (wrapping a C library, when i've never wrapped anything and I tend to get lost in the dum-level details) i figured using devel would be just too much |
12:43:05 | FromDiscord | <sOkam!> (edit) "wasn't using devel so far because i found weird bugs that made me lose time that got fixed when switching to stable. and since im already doing something weird (wrapping a C library, when i've never wrapped anything and I tend to get lost in the dum-level details) i figured using devel would be just too much ... " added "to debug all at once" |
12:47:03 | FromDiscord | <Yardanico> fair enough, but chances are you'll have to do all that when you migrate to 2.0 anyway :P |
12:47:13 | FromDiscord | <Yardanico> and if you have weird bugs, it's better to report them |
12:51:17 | FromDiscord | <sOkam!> it is. but its not great to lose 15-20h chasing a mistake and feeling lost, when the issue didn't come from my code, when im already gigalost in debugging my own code |
12:51:49 | FromDiscord | <sOkam!> if i was doing nim standard things, i wouldn't be afraid to use devle |
12:51:56 | FromDiscord | <sOkam!> (edit) "devle" => "devel" |
12:58:00 | FromDiscord | <Oscour> Is there a simple way to convert a tuple into a sequence? Didn't found anything on the subject |
13:05:03 | FromDiscord | <Rika> you cant generally convert tuples into sequences because tuples can contain differing types while sequences cannot |
13:05:08 | FromDiscord | <sOkam!> In reply to @Oscour "Is there a simple": a tuple is a key+value or any amount of values really, and each of them is a contiguous unique thing↵a seq is a dynamic array |
13:05:23 | FromDiscord | <sOkam!> so it only has one single value per item, not multiple like tuples |
13:06:42 | FromDiscord | <sOkam!> (edit) "array" => "array, which means it just has a single typed value" |
13:07:14 | FromDiscord | <sOkam!> from the look of the question, feels like you are thinking too much in python variant types |
13:07:32 | FromDiscord | <sOkam!> (edit) "from the look of the question, feels like you are thinking too much in python variant types ... " added "mindset" |
13:08:24 | FromDiscord | <Oscour> In reply to @Rika "you cant generally convert": ah yes mb, but I thought it would be possible as all my fields have the same type... I just wanted to convert my readings tuple to a sequence containing its values. I'm gonna write a procedure that does that for me. |
13:09:13 | FromDiscord | <Oscour> In reply to @sOkam! "from the look of": That's exactly what's happening. Also because I'm porting a driver written in micropython and that's my first Nim project haha |
13:13:15 | FromDiscord | <Oscour> In reply to @Oscour "ah yes mb, but": Maybe It would've made more sense to use a table |
13:26:17 | * | antranigv joined #nim |
13:37:59 | * | m5zs7k quit (Ping timeout: 264 seconds) |
13:43:46 | * | m5zs7k joined #nim |
13:46:51 | * | beholders_eye quit (Ping timeout: 248 seconds) |
13:47:58 | * | beholders_eye joined #nim |
14:04:17 | FromDiscord | <Nlits (Ping on reply)> sent a code paste, see https://play.nim-lang.org/#ix=4u5i |
14:04:38 | FromDiscord | <Nlits (Ping on reply)> (edit) "https://play.nim-lang.org/#ix=4u5i" => "https://play.nim-lang.org/#ix=4u5j" |
14:12:00 | FromDiscord | <sOkam!> In reply to @Oscour "Maybe It would've made": do you know that enums can be converted to string with just `$`?↵so `type Thing = enum One, Two, Three` with `echo Thing.One` converts to `echo "One"` |
14:12:54 | FromDiscord | <sOkam!> enums are really powerful in nim. unless you require some weird string-based key+value pairs... you won't need that dictionary-style data format that python uses literally everywhere |
14:35:36 | FromDiscord | <michaelb.eth> In reply to @faldor20 "I've just been doing": fwiw, nimlangserver has been working great for me in the context of Emacs + lsp-mode↵↵But I was having major stability issues with nimlsp |
14:35:51 | FromDiscord | <michaelb.eth> (edit) "In reply to @faldor20 "I've just been doing": fwiw, nimlangserver has been working great for me in the context of Emacs + lsp-mode↵↵But I was having major stability issues with nimlsp ... " added "in the same setup" |
14:38:29 | * | azimut quit (Remote host closed the connection) |
14:38:55 | * | azimut joined #nim |
14:43:56 | FromDiscord | <Oscour> In reply to @sOkam! "do you know that": I don't really get how I could use Enums in this case as I need key/value pairs to nicely package the data? |
14:44:43 | FromDiscord | <sOkam!> In reply to @Oscour "I don't really get": i dont understand your data. just saying that enums cover 99% of the cases, and tables cover the other 1% |
14:44:58 | FromDiscord | <sOkam!> in python, dictionaries are 90% of the cases |
15:27:52 | FromDiscord | <Nlits (Ping on reply)> In reply to @not logged in "Jester not returning 404": No 404 on not described routes |
15:28:02 | FromDiscord | <Nlits (Ping on reply)> just 200 on any route |
15:42:19 | * | arkurious joined #nim |
15:42:20 | * | arkurious quit (Remote host closed the connection) |
16:02:56 | * | Notxor joined #nim |
16:57:09 | FromDiscord | <sOkam!> sent a long message, see http://ix.io/4u61 |
17:51:51 | * | lucasta joined #nim |
18:17:01 | * | krux02 joined #nim |
18:44:18 | FromDiscord | <Require Support> sorry new coder/programmer and nim is my first experience/lang.. what is a good way of randomizing function names so that their function isnt easily determined from a decompiler/debugger. Ex: I have an `encryptString` proc.. Maybe there are compiler flags that I can use? |
18:44:26 | FromDiscord | <Require Support> (edit) "proc.." => "proc." |
18:47:37 | FromDiscord | <Yardanico> In reply to @Require Support "sorry new coder/programmer and": you should just strip all debug info |
18:47:55 | FromDiscord | <Yardanico> then no one will see any function names except if they're imported from external libraries (like kernel functions etc) |
18:48:24 | FromDiscord | <Require Support> In reply to @Yardanico "you should just strip": `-d:release` should do it? |
18:48:26 | FromDiscord | <Yardanico> also, half a joke, but please don't make malware in Nim :P |
18:48:35 | FromDiscord | <Yardanico> In reply to @Require Support "`-d:release` should do it?": no, you should use external stripping tools to be 100% sure |
18:49:47 | FromDiscord | <Require Support> In reply to @Yardanico "also, half a joke,": LOL, tfw nim installation gets detected by AVs coz of this 😦 |
18:50:56 | FromDiscord | <Yardanico> yes it does |
19:19:25 | FromDiscord | <michaelb.eth> @Require Support UPX might be of use to you, just depends on what you are trying to accomplish:↵https://upx.github.io/ |
19:20:33 | FromDiscord | <Dudugz> 🤦 I didn't know we could create tasks in the .nimble file, I thought it was just a configuration file |
19:21:35 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4u6u |
19:22:12 | FromDiscord | <Yardanico> In reply to @michaelb.eth "<@710108871724761128> UPX *might* be": upx won't really work for that usecase as it can be easily decompressed back, and doesn't actually remove symbols |
19:22:25 | FromDiscord | <Yardanico> i think they want to make their program harder to reverse-engineer for whatever purpose |
19:22:29 | FromDiscord | <Yardanico> upx is not going to help with that |
19:22:41 | FromDiscord | <Yardanico> but yeah, function names can just be stripped |
19:22:59 | FromDiscord | <michaelb.eth> I know, I just thought he might take a look at what it does and then think a bit more about what it is he's trying to accomplish |
19:23:34 | FromDiscord | <michaelb.eth> also, fwiw, not that I'm praising it for this purpose, but upx is used by some .. ahem.. software devs who want to slip past malware detectors |
19:24:13 | FromDiscord | <Yardanico> In reply to @michaelb.eth "also, fwiw, not that": i doubt that'd work nowadays |
19:24:31 | FromDiscord | <michaelb.eth> `echo`'ing what your earlier sentiment, though, I would also like to discourage anyone from writing malware in Nim or any other lang |
19:24:38 | FromDiscord | <michaelb.eth> (edit) "what" => "" |
19:24:59 | FromDiscord | <michaelb.eth> (edit) "ahem.." => "ahem .." |
19:25:49 | FromDiscord | <Yardanico> :) https://media.discordapp.net/attachments/371759389889003532/1099778171370479696/image.png |
19:25:59 | FromDiscord | <Yardanico> https://forum.nim-lang.org/t/8440#54468 |
19:26:50 | FromDiscord | <michaelb.eth> lolz, hadn't seen that one |
19:28:07 | FromDiscord | <Elegantbeef> Personally i'm fine if people write malware in holyc to distribute on templeos |
19:30:01 | * | junaid_ quit (Remote host closed the connection) |
19:40:14 | * | jmdaemon joined #nim |
19:40:51 | FromDiscord | <michaelb.eth> poor Terry |
19:41:50 | FromDiscord | <michaelb.eth> hmm, can't seem to build `nimlangserver` with `#devel` |
19:43:35 | FromDiscord | <Elegantbeef> Yep seems it hasnt been fixed |
19:46:51 | NimEventer | New thread by JohnAD: Viability of a website generator using nim., see https://forum.nim-lang.org/t/10127 |
20:10:50 | FromDiscord | <michaelb.eth> anyone tried doing a miniKanren impl in Nim?↵http://minikanren.org/ |
20:10:55 | FromDiscord | <michaelb.eth> might be a fun project |
20:11:25 | FromDiscord | <Yardanico> never heard of anyone mentioning it, so probably no |
20:11:31 | FromDiscord | <Yardanico> but there's a lisp interpreter in nim |
20:12:20 | FromDiscord | <Yardanico> and of course i bet you can implement it as a DSL in Nim itself (with Nim syntax of course) |
20:15:09 | FromDiscord | <michaelb.eth> it has its roots in scheme because of minikanren's originators (Friedman and Byrd – have met them both, great people) but it can be implemented in just about any lang, it seems |
20:15:31 | FromDiscord | <michaelb.eth> I never played with the ideas much, just saw a cool presentation about them (by Friendman and Byrd) |
20:15:35 | FromDiscord | <Yardanico> i mean, obviously you can implement any language in any (turing complete) language |
20:15:46 | FromDiscord | <Yardanico> if you make a interpreter, and not integrate directly in the host language |
20:19:06 | FromDiscord | <michaelb.eth> sure, makes sense |
20:20:17 | FromDiscord | <Yardanico> In reply to @michaelb.eth "sure, makes sense": for langdev we have #langdev actually |
20:20:23 | FromDiscord | <Yardanico> also see <https://gist.github.com/haxscramper/3562fa8fee4726d7a30a013a37977df6> although it's a bit outdated by now |
20:20:25 | FromDiscord | <michaelb.eth> ah cool |
20:22:31 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4u6E |
20:23:01 | FromDiscord | <Yardanico> In reply to @Dudugz "Is it possible to": you can just use foo (module) itself as a namespace |
20:23:10 | FromDiscord | <Yardanico> with `from foo import nil` the compiler will require you to qualify all symbols from foo, always |
20:23:12 | FromDiscord | <Dudugz> It's basically an enumerator but dynamic, I don't want to create loose variables in the global scope because it makes it more difficult to find them with autocomplete. |
20:23:18 | FromDiscord | <Yardanico> (which doesn't work well with somethings like overloading) |
20:23:27 | FromDiscord | <Dudugz> In reply to @Yardanico "with `from foo import": ooh, that's nice, thx |
20:23:54 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4u6G |
20:23:55 | FromDiscord | <Elegantbeef> But i'd do what Yard did cause it makes more sense |
20:24:07 | FromDiscord | <Dudugz> yea, i'll do ``from foo import nil`` |
20:24:15 | FromDiscord | <Dudugz> makes more sense, thx both of u |
20:24:38 | FromDiscord | <Elegantbeef> Well mine represents what you wanted more 😄 |
20:24:54 | FromDiscord | <Elegantbeef> Type base namespace with type attached procedures! |
20:25:02 | FromDiscord | <Yardanico> yes beef's answer is more cool |
20:25:05 | FromDiscord | <Yardanico> cooler |
20:25:07 | FromDiscord | <Yardanico> wow |
20:25:12 | FromDiscord | <Elegantbeef> I dislike mine though |
20:25:15 | FromDiscord | <Elegantbeef> Cause it forces you to use a type |
20:25:26 | FromDiscord | <Elegantbeef> I know status' toml does this inanity |
20:25:39 | FromDiscord | <Elegantbeef> In a world i have to do `Toml.parse` is a terrible one |
20:25:43 | FromDiscord | <Dudugz> In reality all I want is a namespace, it doesn't matter if it's a type or not, I used type as an example only because in other languages allowing static types it makes sense. |
20:25:55 | FromDiscord | <Dudugz> In reply to @Yardanico "yes beef's answer is": i do this with ``new`` proc :v |
20:26:12 | FromDiscord | <Elegantbeef> Well the `distinct void` here means it cannot be instantiated, so it really is a compile time only type |
20:26:13 | FromDiscord | <Dudugz> so you can Type.new(values) or new Type if have no params |
20:26:37 | FromDiscord | <Dudugz> (edit) "Type.new(values)" => "``Type.new(values)``" | "new Type" => "``new Type``" |
20:26:41 | FromDiscord | <Elegantbeef> For types there already is a `new` defined btw |
20:26:51 | FromDiscord | <Elegantbeef> so you do not need to define anything if you're defaulting |
20:26:54 | FromDiscord | <Elegantbeef> Plus you can just do `Type()` |
20:27:08 | FromDiscord | <Dudugz> yea but params... and private fields |
20:27:19 | FromDiscord | <Dudugz> you can't use Type() on private fields |
20:27:30 | FromDiscord | <Elegantbeef> You technically can, but i digress |
20:27:45 | FromDiscord | <Elegantbeef> No one should use `std/importutils` unless they're hacking |
20:27:48 | FromDiscord | <Yardanico> yeah |
20:27:50 | FromDiscord | <Dudugz> yea |
20:27:58 | FromDiscord | <Yardanico> with {.all.} and that you can import all private symbols of a module and all fields of a type |
20:28:04 | FromDiscord | <Yardanico> lemme bring up that cursed thing |
20:28:07 | FromDiscord | <Elegantbeef> all doesnt import fields |
20:28:09 | FromDiscord | <Dudugz> you can, but shouldn't |
20:28:13 | FromDiscord | <michaelb.eth> In reply to @Dudugz "you can't use Type()": so generally for that you create a `.init` or `.new` proc |
20:28:18 | FromDiscord | <Yardanico> magic |
20:28:22 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4rHv |
20:28:27 | FromDiscord | <Yardanico> https://discord.com/channels/371759389889003530/371759607934353448/1088837568256282706 |
20:28:30 | FromDiscord | <Elegantbeef> michael they already mentioned that |
20:28:37 | FromDiscord | <Dudugz> In reply to @michaelb.eth "so generally for that": already did, but allowing both new Type or Type.new using typedesc |
20:28:41 | FromDiscord | <Elegantbeef> You're worse at reading than I, that's a feat! |
20:29:24 | FromDiscord | <Elegantbeef> Who would've thought the most annoying part about a toy basic inspired language was indentation |
20:31:27 | FromDiscord | <michaelb.eth> In reply to @Dudugz "already did, but allowing": I see, sorry, I probably misread or missed something; what came to mind was this:↵https://status-im.github.io/nim-style-guide/language.objconstr.html |
20:34:50 | * | azimut quit (Ping timeout: 255 seconds) |
20:37:41 | FromDiscord | <michaelb.eth> In reply to @Elegantbeef "michael they already mentioned": I see, sorry, I probably misread or missed something; what came to mind was this:↵https://status-im.github.io/nim-style-guide/language.objconstr.html |
20:38:45 | FromDiscord | <Elegantbeef> Hey the world isnt ending due to misreading something so simple |
20:38:56 | FromDiscord | <Elegantbeef> No need to apologise |
20:45:59 | * | xet7 joined #nim |
20:51:46 | * | xet7 quit (Remote host closed the connection) |
21:13:40 | * | lucasta quit (Remote host closed the connection) |
21:30:39 | FromDiscord | <faldor20> sent a long message, see https://paste.rs/k7a |
21:31:39 | FromDiscord | <faldor20> I think they would be very similar if ninlangserver could get it's nimsuggest processes under control |
21:32:34 | FromDiscord | <Elegantbeef> Funny cause that's one place nls is supposed to be better |
21:39:07 | FromDiscord | <Dudugz> In reply to @Elegantbeef "Who would've thought the": lol I hadn't read this before, I agree, the only disappointing thing about Nim is using python's block mechanism (identation) |
21:39:29 | FromDiscord | <Dudugz> I prefer to use { and } to delimit blocks as it makes it clear where a block of code begins and ends. |
21:39:32 | FromDiscord | <Elegantbeef> I was jokingly talking about my implementation in my toy language exploding |
21:39:39 | FromDiscord | <Dudugz> oh lol |
21:39:44 | FromDiscord | <Elegantbeef> I do not see the benefit in `{}` aside from parsin |
21:40:00 | FromDiscord | <Dudugz> :v readability |
21:40:14 | FromDiscord | <Elegantbeef> The code is identical with `{}` or not |
21:40:29 | FromDiscord | <Elegantbeef> If you do not write white space significant compatible code, you're purposely being a dick 😄 |
21:40:30 | FromDiscord | <Dudugz> so you don't have to compare if something is more spaced or not to find which block it was defined in, it's already clear where everything is. |
21:40:43 | FromDiscord | <Elegantbeef> This is why editors have indent colours/lines |
21:40:49 | FromDiscord | <Dudugz> lol i always use 2 spaces |
21:41:09 | FromDiscord | <Elegantbeef> I can also argue that nested `{}` does not make it any easier |
21:41:16 | FromDiscord | <Dudugz> In reply to @Elegantbeef "This is why editors": 🤡 Does it exist? I've never seen it on VSCode, I'll see it later |
21:41:40 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1099812359423397888/image.png |
21:43:36 | FromDiscord | <Elegantbeef> If you want to get even crazier blockman exists https://raw.githubusercontent.com/leodevbro/vscode-blockman/main/demo-media/still-image/infograph/intro-before-after---png.png |
21:43:57 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4u6T |
21:44:27 | FromDiscord | <Dudugz> In reply to @Elegantbeef "If you want to": Nah, I'm not going to modify a natural behavior of the language just because I'm not a big fan. |
21:44:50 | FromDiscord | <Elegantbeef> Blockman doesnt modify the behaviour of the language 😄 |
21:44:51 | FromDiscord | <Elegantbeef> It just renders code differently |
21:45:13 | FromDiscord | <Dudugz> :v nah, I'll stick with what the language offers |
21:45:42 | FromDiscord | <Elegantbeef> The bug with callbacks is not due to lacking `{}` |
21:45:48 | FromDiscord | <Elegantbeef> Consider a lambda in another language `doStuff( (a) => a, true)` |
21:45:59 | FromDiscord | <Elegantbeef> That doesnt have `{}` and it's still distinguishable |
21:46:12 | FromDiscord | <Dudugz> yeah i'm saying it's a bug |
21:46:24 | FromDiscord | <Elegantbeef> But it's not caused by lacking `{}` |
21:47:01 | FromDiscord | <Dudugz> Arrow functions in JS have their behavior well defined, tho procs in Nim cannot be expressed as arrow fns without sugar |
21:47:13 | FromDiscord | <Elegantbeef> That's not the point |
21:47:18 | FromDiscord | <Elegantbeef> The point is that it proves that `{}` does not disambiguate |
21:47:22 | FromDiscord | <Elegantbeef> It does not solve the problem |
21:47:44 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/8Ou |
21:47:49 | FromDiscord | <Dudugz> Well, from the parser's point of view, I think so. |
21:47:55 | FromDiscord | <Yardanico> In reply to @Elegantbeef "If you want to": i think blockman doesn't support nim |
21:47:57 | FromDiscord | <Yardanico> or does it? |
21:48:02 | FromDiscord | <Elegantbeef> I do not know |
21:48:13 | FromDiscord | <Elegantbeef> I just bring it up when people complain about `{}` |
21:48:48 | FromDiscord | <Dudugz> sent a code paste, see https://paste.rs/Tpb |
21:48:51 | FromDiscord | <Elegantbeef> What? |
21:49:00 | FromDiscord | <Elegantbeef> I just showed a place where your example is the expected behaviour 😄 |
21:49:20 | FromDiscord | <Elegantbeef> You want `echo "bleh", true` inside of the proc |
21:49:28 | FromDiscord | <Dudugz> sent a code paste, see https://paste.rs/rLD |
21:49:34 | FromDiscord | <Elegantbeef> Exactly |
21:49:37 | FromDiscord | <Dudugz> But in this case it is not |
21:49:42 | FromDiscord | <Elegantbeef> This isnt a bug, this is design |
21:49:51 | FromDiscord | <Elegantbeef> If you want to disambiguate wrap the proc into a stmt list |
21:50:17 | FromDiscord | <Dudugz> '-' then it will give an error because doStuff is not receiving true, where should I go why did the proc end up echoing "Hello"? This is the whole point of {} |
21:50:32 | FromDiscord | <Elegantbeef> `doStuff((proc() = echo "Hello"), true)` |
21:50:33 | FromDiscord | <Yardanico> @beef yeah it doesn't work for nim |
21:50:36 | FromDiscord | <Dudugz> (edit) "go why did" => "put that" |
21:50:36 | * | xet7 joined #nim |
21:50:56 | FromDiscord | <Dudugz> (edit) "echoing" => "on echo" |
21:50:57 | FromDiscord | <Yardanico> https://github.com/leodevbro/vscode-blockman/issues/73 |
21:50:57 | FromDiscord | <Elegantbeef> This is the whole point of `()` |
21:51:04 | FromDiscord | <Yardanico> you need a tokenizer for nim for this extension |
21:52:24 | * | Notxor quit (Quit: Leaving) |
21:53:31 | FromDiscord | <Elegantbeef> Worth being clear this 'bug' is not even apart of whitespace, it's due to an unrelated design feature |
21:53:45 | FromDiscord | <Elegantbeef> If command syntax didnt exist the above would likely compile just fine |
21:54:06 | FromDiscord | <Elegantbeef> Since a `,` would terminate a line aswell as `;` would so it'd go "Ok this proc body is done, go to the next argument" |
21:54:27 | FromDiscord | <Elegantbeef> So if anything you should complain about command syntax existing |
21:55:18 | FromDiscord | <Elegantbeef> And then i'd slap you for just complaining about everything 😛 |
21:55:36 | FromDiscord | <Dudugz> Well, from my point of view I consider it a bug, since ``,`` shouldn't be a valid syntax in a function body. |
21:55:50 | FromDiscord | <Elegantbeef> Except it is cause it's command syntax |
21:55:59 | FromDiscord | <Elegantbeef> A feature is not a bug |
21:56:26 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4u6X |
21:57:28 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4u6Z |
21:57:39 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4u70 |
21:59:04 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4u71 |
22:00:08 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4u72 |
22:00:12 | FromDiscord | <Elegantbeef> So what are we arguing about? |
22:01:30 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4u74 |
22:02:08 | FromDiscord | <Dudugz> In reply to @Elegantbeef "So what are we": 🤷♂️ Apparently about nothing, I have one point of view of how programming languages should work and you have another and even discussing it isn't going to change how the language works. If the parser it works that way intentionally or not so there's nothing to do until they clearly decide how it should interpret ambiguities like these. |
22:03:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4u75 |
22:03:50 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4u76 |
22:04:10 | FromDiscord | <Elegantbeef> `echo"hello"` |
22:04:38 | FromDiscord | <Elegantbeef> Shit that doesnt work |
22:04:49 | FromDiscord | <Elegantbeef> It's command syntax and it's valid |
22:04:59 | FromDiscord | <Elegantbeef> There is no way of making this work without making dispatch very very complicated |
22:05:07 | FromDiscord | <Dudugz> Hmm |
22:05:41 | FromDiscord | <Elegantbeef> Like you're implying the compiler should sem a proc, attempt to call `doStuff` go "Shit this doesnt compile, see if the last thing is a command syntax and the last argument(s) is the same as the next arguments, if so move them around" |
22:06:44 | FromDiscord | <Dudugz> Yeah, probably not, what happens in JS is that ArrowFunction is a whole new type in the syntax tree, when it finds a comma after an expression it evaluates whether it's used as a callback or not and whether this comma is valid in the arrow function expression before determining whether this comma is used as a parameter delimiter or is part of the syntax. |
22:06:59 | FromDiscord | <Elegantbeef> I mean i know the Nim ast |
22:07:06 | FromDiscord | <Elegantbeef> It's a `nkLambda` |
22:07:19 | FromDiscord | <Elegantbeef> It's body is a `nkCall(echo, "hello", true)` |
22:07:39 | FromDiscord | <Elegantbeef> When do stuff is semantically checked and fails to compile due to a `nkLambda` you're implying that we should unpack the lambda and try again |
22:08:24 | FromDiscord | <Elegantbeef> This also is a recursive process |
22:08:40 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4u7c |
22:08:47 | FromDiscord | <Elegantbeef> cause imagine you have a \`proc(p\: proc(), b\: bool, i\: int) |
22:09:06 | FromDiscord | <Dudugz> In reply to @Elegantbeef "When do stuff is": Got it |
22:09:07 | FromDiscord | <Elegantbeef> you do `myProc(proc() = echo "hello", true, int)` |
22:09:51 | FromDiscord | <Elegantbeef> You have to chip off the int first to see if it matches a `myProc(proc(), int)` then chip off the bool to see if it matches a `myProc(proc(), bool, int)` |
22:10:16 | FromDiscord | <Dudugz> Hmm |
22:10:21 | FromDiscord | <Elegantbeef> I pretty much proved it's the command syntax that causes this 'ambiguity' |
22:10:33 | FromDiscord | <Elegantbeef> `echo("hello"), true` compiles |
22:11:10 | FromDiscord | <Dudugz> Well yes, in part it is but you said that with echo("Hello") it works so part of the blame goes to the high flexibility of the language that allows functions to be called without () |
22:11:17 | FromDiscord | <Elegantbeef> As soon as we told the compiler "Here are all the arguments you concern yourself with" it no longer jumped to the `,` |
22:11:48 | FromDiscord | <Dudugz> Because () also plays an important role in delimiting where the parameters of a function begin and end |
22:12:02 | FromDiscord | <Elegantbeef> Yea my point is you are not blaming lack of `{}` cause even in languages with lambda they work, it's the command syntax |
22:12:43 | FromDiscord | <Dudugz> Hm yeah that makes sense, it's just that from my point of view with brackets the parser would know exactly where the function body ended up |
22:12:57 | FromDiscord | <Elegantbeef> Sure and we have `()` if you want to use them |
22:13:07 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4u7e |
22:13:26 | FromDiscord | <Elegantbeef> `doStuff(proc = (echo "hello"), true)` 😛 |
22:14:09 | FromDiscord | <Dudugz> Ugly :v ``(proc = echo "Hello")`` looks better, or just ``echo("Hello")`` to avoid ambiguity |
22:14:22 | FromDiscord | <Elegantbeef> Lol |
22:14:32 | FromDiscord | <Elegantbeef> So clearly you dislike `{}` as you find `()` ugly in their place |
22:14:37 | FromDiscord | <Elegantbeef> Checkmate libtard! |
22:14:45 | FromDiscord | <Dudugz> lol |
22:15:22 | FromDiscord | <Dudugz> It's just that it makes it look like I took the parentheses that were supposed to be in the function call and wrapped the function with them, it looks more confusing than it should be |
22:15:48 | FromDiscord | <Dudugz> like instead of ``echo("Hello")`` you do ``(echo "Hello")`` |
22:16:56 | FromDiscord | <Elegantbeef> Yea yea i still stand `{}` only solves parsing woes |
22:17:05 | FromDiscord | <Dudugz> Yup |
22:17:24 | FromDiscord | <Elegantbeef> If you write code that is not valid significant whitespace i hope your socks are always wet |
22:17:44 | FromDiscord | <Dudugz> lmao, no, that I make sure to do. |
22:17:46 | FromDiscord | <Elegantbeef> I hope microwave food is always cold in the centre, I hope your pencil lead always breaks |
22:18:12 | FromDiscord | <Dudugz> Even with {} I do this to make the code readable |
22:18:53 | FromDiscord | <Dudugz> The difference between having {} and not having is just having a visual hint of where a block starts and ends, you don't have to waste time trying to understand where a block started and where it ended |
22:20:54 | FromDiscord | <Elegantbeef> Sure but that's what indention lines/rainbows are good for |
22:21:03 | FromDiscord | <Elegantbeef> Or blockman if you're living in 2077 |
22:21:24 | FromDiscord | <Dudugz> I had never heard of this feature until today lol, I'll look it up and see if there's any extensions for vscode |
22:21:39 | FromDiscord | <Elegantbeef> Indention lines are built in |
22:21:57 | FromDiscord | <Dudugz> I speak of the colors, the lines yes |
22:28:17 | FromDiscord | <Gumbercules> In reply to @sOkam! "<@204328759715692544> had these": A uint in C is not the same as a uint in Nim |
22:29:52 | FromDiscord | <Gumbercules> A unsigned long in C would be 32 or 64 bytes and an unsigned integer would be 16 or 32 |
22:29:58 | FromDiscord | <Gumbercules> (edit) "A" => "An" |
22:48:31 | FromDiscord | <Dudugz> Well another problem I have is this, I'm clearly not using try..except but Nim insists on giving me this warning and points to an internal file (asyncmacro.nim) which indeed does. It happens with every file that I declare an async proc. https://media.discordapp.net/attachments/371759389889003532/1099829178452426784/image.png |
22:48:39 | FromDiscord | <Dudugz> btw Nim 1.6.12 |
22:49:23 | FromDiscord | <Dudugz> https://media.discordapp.net/attachments/371759389889003532/1099829398942781550/image.png |
22:51:15 | FromDiscord | <Elegantbeef> Well that's what happens when features are added in a patch |
22:51:18 | FromDiscord | <Yardanico> yes, this is known |
22:51:30 | FromDiscord | <Yardanico> <https://github.com/nim-lang/Nim/issues/21537> |
22:51:36 | FromDiscord | <Elegantbeef> `switch("warning[BareExcept]", "off")` |
22:53:07 | FromDiscord | <Dudugz> sure, thx |
23:00:11 | FromDiscord | <Dudugz> In reply to @Elegantbeef "`switch("warning[BareExcept]", "off")`": This is invalid, with ``switch("warning", "BareExcept:off")`` it worked |
23:04:09 | FromDiscord | <Yardanico> or just |
23:04:13 | FromDiscord | <Yardanico> warning("BareExcept", off) |
23:04:18 | FromDiscord | <Yardanico> https://nim-lang.org/docs/nimscript.html#warning%2Cstring%2Cbool |
23:04:40 | FromDiscord | <Yardanico> fyi, on/off are the same as true/false, you can use them anywhere you've used true/false |
23:04:49 | FromDiscord | <Yardanico> I mean in Nim itself generally |
23:08:05 | FromDiscord | <Dudugz> Hmm, sure, thx |
23:08:31 | FromDiscord | <Dudugz> I forget that .nims files are basically Nim |
23:09:15 | FromDiscord | <Dudugz> At first I saw .nimble and .nims files as configuration files like JSON, YAML, INI |