00:00:00 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
00:01:08 | * | njoseph joined #nim |
00:04:49 | * | luis_ joined #nim |
00:21:05 | * | luis_ quit (Quit: luis_) |
00:21:19 | * | luis_ joined #nim |
00:24:24 | FromDiscord | <eli> :petthechampius: |
00:24:49 | * | lbart quit (Read error: Connection reset by peer) |
00:25:04 | * | lbart joined #nim |
00:25:05 | * | lbart quit (Changing host) |
00:25:05 | * | lbart joined #nim |
00:26:40 | * | beanie joined #nim |
00:26:55 | beanie | heyo |
00:35:23 | * | lbart quit (Read error: No route to host) |
00:36:20 | * | lbart joined #nim |
00:36:20 | * | lbart quit (Changing host) |
00:36:20 | * | lbart joined #nim |
00:37:29 | * | user0 joined #nim |
00:44:11 | * | TomDotTom joined #nim |
00:55:07 | * | NimBot joined #nim |
00:57:27 | * | mipri joined #nim |
01:02:04 | * | beanie quit (Quit: Quit) |
01:08:08 | disruptek | i'm not sure about you. |
01:12:31 | * | Tanger joined #nim |
01:22:33 | leorize[m] | Prestige: you forgot the echo :P |
01:23:05 | Prestige | I did, saw it and was like: fuck. I give up |
01:23:20 | Prestige | !eval echo "!eval echo \"echo\"" |
01:23:23 | NimBot | !eval echo "echo" |
01:23:32 | leorize[m] | !eval echo "!eval echo \"echo\"" |
01:23:34 | NimBot | !eval echo "echo" |
01:23:48 | leorize[m] | yea nimbot is set to ignore itself :P |
01:23:59 | Prestige | now someone make the bot eval its own text so I can break it :P |
01:29:55 | * | apahl quit (Ping timeout: 240 seconds) |
01:30:57 | * | Jesin quit (Ping timeout: 265 seconds) |
01:32:11 | * | apahl joined #nim |
01:48:20 | * | Onionhammer quit (Quit: The Lounge - https://thelounge.chat) |
01:49:12 | FromDiscord | <Rika> lol @Yardanico it matched and pinged "someone" |
01:52:16 | * | Onionhammer joined #nim |
01:53:16 | Prestige | oh no |
01:53:30 | Prestige | is it because my :P |
01:57:51 | disruptek | pretty sure this time it's not the fault of your tongue. |
01:58:31 | Prestige | disruptek: it always is. |
01:58:45 | Prestige | but real talk, it's because of the trailing colon I'm pretty sure |
02:01:11 | disruptek | so you're saying it's the fault of your tongue trailing your colon? |
02:01:43 | * | TomDotTom quit (Ping timeout: 246 seconds) |
02:04:07 | Prestige | seems like it. Need to open a bug report |
02:14:24 | * | krux02 quit (Remote host closed the connection) |
02:18:46 | FromDiscord | <iWonderAboutTuatara> !eval import sequtils↵let m = (1..72).toSeq↵for i in m:↵ echo i |
02:18:48 | NimBot | Compile failed: /usercode/in.nim(1, 23) Error: invalid module name: 'sequtils↵let m' |
02:19:06 | FromDiscord | <iWonderAboutTuatara> (edit) "sequtils↵let" => "sequtils;↵let" | "(1..72).toSeq↵for" => "(1..72).toSeq;↵for" |
02:19:11 | FromDiscord | <iWonderAboutTuatara> !eval import sequtils;↵let m = (1..72).toSeq;↵for i in m:↵ echo i |
02:19:13 | NimBot | Compile failed: /usercode/in.nim(1, 17) Error: undeclared identifier: '↵let' |
02:19:39 | FromDiscord | <iWonderAboutTuatara> (edit) "!eval import sequtils;↵let" => "!eval↵let" |
02:19:44 | FromDiscord | <iWonderAboutTuatara> !eval↵let m = (1..72).toSeq;↵for i in m:↵ echo i |
02:20:11 | FromDiscord | <iWonderAboutTuatara> !eval for I in 0..15: echo I |
02:20:14 | NimBot | 0↵1↵2↵3↵4↵5↵6↵7↵8↵9↵10↵11↵12↵13↵14↵15 |
02:20:33 | FromDiscord | <iWonderAboutTuatara> !eval for I in 0..150: echo I |
02:20:35 | NimBot | 0↵1↵2↵3↵4↵5↵6↵7↵8↵9↵10↵11↵12↵13↵14↵15↵16↵17↵18↵19↵20↵21↵22↵23↵24↵25↵26↵27↵28↵29↵30↵31↵32↵33↵34↵35↵36↵37↵38↵39↵40↵41↵42↵43↵44↵45↵46↵47↵48↵49↵50↵51↵52↵53↵54↵55↵56↵57↵58↵59↵60↵61↵62↵63↵64↵65↵66↵67↵68↵69↵70↵71↵72↵73↵74↵75↵76↵77↵78↵79↵80↵81↵82↵83↵84↵85↵86↵87↵88↵89↵90↵91↵9... |
02:20:44 | FromDiscord | <iWonderAboutTuatara> So there is a cutoff |
02:22:32 | Prestige | @iwonder inim is great, if you haven't tried it |
02:30:42 | * | a_chou joined #nim |
02:32:11 | * | a_chou quit (Remote host closed the connection) |
02:37:00 | * | user0 quit (Remote host closed the connection) |
02:38:32 | * | muffindrake quit (Ping timeout: 260 seconds) |
02:40:22 | * | muffindrake joined #nim |
03:26:13 | * | luis_ quit (Quit: luis_) |
03:28:06 | * | Jesin joined #nim |
04:02:44 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:44 | * | supakeen joined #nim |
04:16:41 | * | xioren joined #nim |
04:17:19 | * | vicfred_ joined #nim |
04:20:28 | * | vicfred quit (Ping timeout: 272 seconds) |
04:28:12 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
04:28:20 | * | njoseph joined #nim |
05:11:20 | * | mwbrown quit (Ping timeout: 260 seconds) |
05:16:03 | FromDiscord | <scott> is there any way to statically ensure a proc won't raise? |
05:16:04 | FromGitter | <deech> How do I recover a `typedesc` from a `NimNode`? eg. I have converted a number of typedesc's in NimNodes with `getTypeInst` so they may be in a compile time sequence `seq[NimNode]`. I would like to then recover ( at compile time ) one of the elements and create a default `var`, eg. `var x : nimNodes[i]` and iterate over the `fieldPairs`. |
05:17:00 | FromDiscord | <scott> like I see the {.raises.} pragma but it doesn't look like leaving it off will do anything? or am i missing something? |
05:17:53 | FromDiscord | <Rika> {.raises: [].} before the = of the proc name |
05:17:58 | FromDiscord | <Rika> i mean signature |
05:18:05 | leorize[m] | @scott use it like this: `{.raises: [].}` |
05:18:14 | FromDiscord | <scott> nice |
05:18:26 | leorize[m] | by default Nim will infer and populate `{.raises.}` for you |
05:18:36 | leorize[m] | by specifying it you restrict the set |
05:18:56 | leorize[m] | a nice package to use in conjunction with `{.raises: [].}` is nim-result |
05:18:57 | FromDiscord | <scott> yes, that's great. Very intuitive. |
05:18:59 | leorize[m] | !repo result |
05:18:59 | disbot | https://github.com/arnetheduck/nim-result -- 9nim-result: 11Friendly, exception-free value-or-error returns, similar to Option[T] 15 35⭐ 5🍴 7& 8 more... |
05:19:53 | FromDiscord | <Rika> i still dont know why dis.rup.tek doesnt like this package |
05:20:27 | leorize[m] | just diff it against his badresults |
05:22:34 | FromDiscord | <scott> idk result type and exceptions both have their places IMO |
05:23:05 | FromDiscord | <scott> sometimes it's better to return `None` (or whatever you guys's equivalent of that is), sometimes it's fine to just throw it. |
05:23:25 | leorize[m] | yea, the result type thingy has convenience macros for you to package a exception into Result[T] |
05:23:37 | leorize[m] | and we do have None, it's in the options module |
05:24:03 | leorize[m] | I just refer to the package because it helps a lot since many things can throw |
05:24:11 | * | solitudesf joined #nim |
05:24:24 | FromDiscord | <scott> I've been kinda scared to ask...is Nim compile-time nil-safe? |
05:24:30 | leorize[m] | nope |
05:24:32 | leorize[m] | not yet |
05:24:35 | FromDiscord | <scott> 😦 |
05:24:43 | leorize[m] | it's WIP |
05:24:45 | leorize[m] | !pull nil checking |
05:24:47 | disbot | https://github.com/nim-lang/Nim/pull/13163 -- 3add error-checked version of walkDir 7& 27 more... |
05:24:50 | FromDiscord | <scott> oh well as long as it's not ruled out because legacy |
05:25:01 | leorize[m] | oops not that |
05:25:10 | FromDiscord | <scott> Java/C++ optional just makes me throw up my hands in frustration haha |
05:25:31 | leorize[m] | #15287 |
05:25:32 | disbot | https://github.com/nim-lang/Nim/pull/15287 -- 3Nil type check implementation |
05:26:09 | leorize[m] | legacy isn't a problem in Nim :P we have `not nil`, but it predates the current tracking technology in the compiler and has a ton of false positives |
05:26:20 | leorize[m] | and it's not really that ergonomic |
05:26:25 | FromDiscord | <scott> holy crap that's a lot of commits haha |
05:26:30 | leorize[m] | the upcoming implementation should solve all that |
05:27:06 | FromDiscord | <scott> won't that break a lot of libraries to suddenly enable that? Or will it be some kinda opt-in scenario? |
05:27:57 | leorize[m] | you should read the RFC behind it: https://github.com/nim-lang/RFCs/issues/250 |
05:27:58 | disbot | ➥ Type checking for nil dereference: nilable and not-nilable types ; snippet at 12https://play.nim-lang.org/#ix=2w7D |
05:28:06 | * | narimiran joined #nim |
05:32:37 | leorize[m] | ergonomics is a big priority in Nim so every new feature/restrictions has to be designed with that in mind |
05:32:55 | leorize[m] | it seems to me that the nil check impl will be pretty easy to use |
05:38:41 | FromDiscord | <Elegant Beef> Lol refactored nimscripter to soley use json for the interop then forgot about proc overload, so that was a waste of time |
05:40:12 | FromDiscord | <Avatarfighter> rip |
05:41:24 | FromDiscord | <Elegant Beef> Well it made the macro nicer to work in but no overloads so i guess i'll go back to the previous method 😄 |
05:45:01 | * | arecacea1 quit (Remote host closed the connection) |
05:45:52 | * | arecacea1 joined #nim |
05:54:02 | * | xioren quit (Quit: leaving) |
06:25:55 | FromDiscord | <19> hello, how can i run the generated c code in visual studio for debugging |
06:30:03 | * | user0 joined #nim |
06:31:04 | FromDiscord | <19> `nim cpp --cc:vcc --debugger:native source/main.nim` |
06:38:14 | * | PMunch joined #nim |
06:44:09 | * | Vladar joined #nim |
06:47:16 | FromDiscord | <scott> it should be in ~/.cache/nim |
06:53:34 | * | mwbrown joined #nim |
07:03:49 | FromDiscord | <Yardanico> @19 you don't need to "run" the C code itself |
07:04:06 | FromDiscord | <Yardanico> You can set breakpoints in Nim code just fine with debugger native |
07:04:39 | FromDiscord | <Yardanico> @Rika their fault :) |
07:05:05 | FromDiscord | <Rika> lmao |
07:10:12 | * | hyiltiz quit (Ping timeout: 272 seconds) |
07:13:49 | FromDiscord | <scott> is there a way to iterate over the lines of a string without creating an intermediate array of strings? |
07:15:52 | FromDiscord | <Rika> `for i in str.split():` afaik will not make an intermediate array |
07:17:19 | FromDiscord | <scott> oh, yes, I see now. Split is an iterator |
07:21:58 | FromDiscord | <19> @Yardanico i would like to use visual studio's debugger |
07:22:10 | FromDiscord | <scott> I just fixed this |
07:22:23 | FromDiscord | <19> and step through the C code and see the memory etc... |
07:23:00 | FromDiscord | <scott> It's not been released/published yet, but if you build the VSCode extension from master you can debug the Nim code directly (including looking at stack and pointer values) |
07:23:46 | FromDiscord | <scott> literally just merged to master between when you asked about this and now https://github.com/saem/vscode-nim |
07:24:10 | * | newUser joined #nim |
07:24:22 | FromGitter | <jrfondren> https://play.nim-lang.org/#ix=2Be7 - am I testing this wrong? I get false for both uses of .split() |
07:25:29 | FromDiscord | <Rika> i dont understand why you are using unsafeaddr and casting |
07:25:49 | FromDiscord | <scott> @19 you can also just open the generated C code and debug that but I don't find doing that as helpful as walking through what I wrote |
07:25:52 | FromDiscord | <19> @scott very cool thanks for sharing, i will look into it |
07:26:09 | FromDiscord | <19> @scott wow that's awesome |
07:26:32 | FromGitter | <jrfondren> Rika: I'm trying to test whether the pointer to the first character of x is between the pointers to the first character of s |
07:26:54 | FromDiscord | <19> @scott the only reason i wanted to do that was to be able to debug in visual studio |
07:27:05 | FromDiscord | <scott> ah ok |
07:27:16 | FromGitter | <jrfondren> i.e., I am trying to test whether x is a slice of s or if the string was copied. |
07:27:16 | FromDiscord | <Rika> @jrfondrem the new strings are distinct from the original |
07:27:18 | FromDiscord | <Rika> this will not work |
07:27:34 | FromDiscord | <Rika> we do not currently do slicing' |
07:27:37 | FromGitter | <jrfondren> Rika: OK, but this is the opposite of what you just told scott |
07:27:43 | FromDiscord | <Rika> no it is not |
07:27:50 | FromDiscord | <Rika> we allocate new strings, but not a whole array of them |
07:28:03 | FromGitter | <jrfondren> ah, I see. |
07:28:15 | newUser | hi, I have installed the Nim extension for VS Code and can easily with F6 compile and run nim files via WSL 2 console. How can I achieve the same behaviour with C++, any hints? I don't want the task terminal after ctrl+shift+b. |
07:28:23 | FromDiscord | <scott> would be nice if it did D-style slicing tho |
07:28:28 | FromDiscord | <Rika> we're working on it yes |
07:28:47 | FromDiscord | <Rika> afaik 1.6 will have it? im not sure, i dont even remmeber if it was planned for 1.4 |
07:28:54 | FromDiscord | <scott> wow that's awesome |
07:29:06 | FromDiscord | <Rika> no guarantees on the version number |
07:29:12 | FromDiscord | <Rika> but i distinctly remember it being worked on |
07:29:40 | FromDiscord | <scott> no worries, I understand that these things take time. it's nice to see a steady development pace though |
07:30:07 | Araq | scott: Plus we cannot simply copy D's way as it's flawed |
07:30:22 | FromDiscord | <Rika> ill be honest, i'm somewhat worried because its very hard to entertain both the "we want to see these features" crowd and the "we want all these bugs fixed" crowd |
07:30:40 | FromDiscord | <Rika> oh hey it is our lord ar/q |
07:30:51 | FromDiscord | <scott> newUser, there are extensions for that. Code runner or something |
07:32:10 | FromDiscord | <scott> @Rika personally I lean towards the latter, especially with how impressive the language is so far. I don't mind waiting for fanciness |
07:32:32 | FromDiscord | <scott> Araq, this is the first I've heard of that, how is it broken? |
07:32:37 | FromDiscord | <Rika> yeah but not everyone leans that way |
07:33:03 | newUser | <scott> thx |
07:35:44 | FromGitter | <jrfondren> D slices certainly have a lot of weird corner cases that come in once you start resizing them. |
07:36:52 | FromDiscord | <Elegant Beef> The only feature i want now is some method of sending the nimscript interop as a bytestream instead of a json file 😛 |
07:36:54 | FromGitter | <jrfondren> for something like .split() I'd refer Rust's &str vs. String distinction |
07:38:07 | FromDiscord | <scott> that's pretty disappointing. I found the way D's slices map to memory regions super intuitive |
07:44:33 | FromDiscord | <scott> is there a straightforward way to find out why a proc may have side effects? It looks like a pure function to me |
07:45:20 | FromDiscord | <Rika> not that i know of, for now can you just show us? |
07:45:31 | FromDiscord | <scott> sure, just a sec |
07:46:17 | FromDiscord | <19> @scott thank you so much! the extension ROCKS |
07:46:21 | Araq | scott: there is no distinction between owning and non-owning slices |
07:46:48 | FromDiscord | <scott> @Rika https://play.nim-lang.org/#ix=2Be8 |
07:46:49 | Araq | so you'd be left with a tracing GC to make it performant |
07:47:12 | FromDiscord | <scott> ah, yes, I see what you mean now |
07:48:05 | FromGitter | <jrfondren> scott: that refers to substitutions. I had the same problem just a moment ago with references to start/stop in an in_s proc that I tried to make a func |
07:48:25 | FromDiscord | <scott> @19 thanks! It was really cool to be able to make a small contribution like that with such a big impact. I only had to change like 2 lines of code and modify some docs from somewhere else |
07:49:30 | FromGitter | <jrfondren> scott: if substitutions is const instead of let, it looks like you get past side effects into another problem. |
07:49:37 | FromDiscord | <Rika> @scott you can use const instead of let for substitutions i assume |
07:49:42 | FromDiscord | <scott> oh ok |
07:50:02 | FromDiscord | <Rika> ah no nv |
07:50:03 | FromDiscord | <Rika> m |
07:50:20 | FromDiscord | <scott> no it says it's an undeclared identifier now |
07:50:25 | FromDiscord | <Rika> yeah made a mistake |
07:50:48 | FromDiscord | <scott> I don't really care that much about it being a proper func I was just curious why this was happening |
07:51:48 | FromGitter | <jrfondren> that 'let' at toplevel is immutable, but it still has to happen at runtime before the func can be valid. I guess that's the reason func is rejected. |
07:52:06 | FromDiscord | <Rika> yes, sorry, was busy with something else |
07:52:10 | FromDiscord | <scott> ah |
07:52:27 | FromDiscord | <Rika> if it were a const it would work, but `re` doesnt work in VM afaik so it cannot be |
07:53:13 | FromGitter | <jrfondren> I've heard nim-regex works at compile-time, if you need that. |
07:53:50 | FromDiscord | <Rika> its also nicer to use afaik, and prolly faster? dont quote me on that |
07:54:24 | FromDiscord | <Rika> also no pcre dependency if that matters to you |
07:54:24 | FromDiscord | <scott> not important in this case but that's good to know thanks |
07:54:34 | FromGitter | <jrfondren> I've heard it's faster on a?a?a?a?aaaa type tests. It was enormously slower than pcre on a practical "run a regex against this giant log" that I ran, but that was last year. |
07:54:56 | FromDiscord | <Rika> a year is a long time |
07:56:37 | * | solitudesf quit (Read error: Connection reset by peer) |
08:02:55 | * | solitudesf joined #nim |
08:07:20 | FromDiscord | <Yardanico> @19 yes, exactly, you can do that from Nim code itself |
08:07:51 | FromDiscord | <Yardanico> If you set breakpoints in the Nim code and compile it with debugger native, it should work in VS debugger |
08:07:54 | Araq | jrfondren: pcre also uses a JIT these days, can be hard to beat |
08:07:58 | FromDiscord | <Yardanico> You don't need to open the C code |
08:08:52 | newUser | How can I start a NimScript from VS Code (tasks.json?)? |
08:09:32 | FromDiscord | <19> @Yardanico im not sure i'm doing what you are suggesting but i did run the nim with --debugger:native and opened the executable in VS and i did get access to the nim code. |
08:09:46 | FromDiscord | <19> is this what you are suggesting? sorry if i missunderstood |
08:10:15 | FromDiscord | <Yardanico> well, I meant that with debugger native you will be able to step through Nim source lines in the debugger |
08:10:28 | FromDiscord | <19> in visual studio? |
08:10:45 | FromDiscord | <Yardanico> it should work in any editor/ide with normal debugging support, yes |
08:12:52 | FromDiscord | <19> @Yardanico maybe i'm doing it wrong but it takes me to system.nim is VS |
08:13:31 | * | kenran joined #nim |
08:13:48 | FromDiscord | <19> nim cpp --cc:vcc --debugger:native source/main.nim↵devnenv main.exe |
08:13:54 | FromDiscord | <scott> Did you set a breakpoint in the editor? (Red dot to the left of the line) |
08:13:56 | FromDiscord | <19> (edit) "source/main.nim↵devnenv" => "source/main.nim↵devenv" |
08:14:15 | FromDiscord | <19> im using visual studio not vs code |
08:14:25 | FromDiscord | <scott> Oh |
08:14:26 | FromDiscord | <Yardanico> You can do that in it as well |
08:14:46 | FromDiscord | <Yardanico> VS supports breakpoints as well obviously |
08:14:59 | FromDiscord | <Yardanico> But I've never used it with Nim personally, so I can't help much |
08:15:13 | FromDiscord | <Yardanico> But "opening the C code" for debugging is not the way |
08:15:32 | FromDiscord | <19> yeah i don't care about the C code if i can just debug the nim |
08:15:48 | FromDiscord | <19> if anyone has experience using VS with Nim please let me know :) |
08:16:12 | FromDiscord | <19> i can load the executable but i dont know how to invoke the nim source into VS |
08:17:09 | Araq | I did it successfully, but the major problem was that debuggers don't help me in debugging |
08:17:54 | Araq | for a start, "step into" vs "step over" decisions eat up all my brain power |
08:18:15 | Araq | leaving none for debugging. |
08:18:19 | FromDiscord | <19> lol! |
08:18:28 | FromDiscord | <19> how do you go about it |
08:20:03 | FromDiscord | <19> i guess the vscode is good enough for now. was it too tedious to launch the nim source in VS? |
08:21:11 | FromDiscord | <19> the echo repr stuff in nim is really cool |
08:21:33 | FromDiscord | <Elegant Beef> I'm totally not abusing it for macros in the nimscript stuff i've been working on 😄 |
08:22:59 | FromDiscord | <Elegant Beef> I'm building an ast just to stringify it and discard it, honestly feels a little mean doing it, that code doesnt get compiled ever, it just gets discarded! |
08:26:31 | * | newUser quit (Remote host closed the connection) |
08:27:31 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
08:27:56 | Yardanico | !status |
08:27:58 | FromDiscord | Uptime - 15 hours and 51 minutes |
08:29:08 | FromDiscord | <Yardanico> @Elegant Beef Btw, I'd recommend you to replace space in your nickname with _ so you can be pinged :) |
08:29:25 | FromDiscord | <Elegant Beef> Does it use nicknames now? |
08:29:35 | FromDiscord | <Yardanico> i meant handle or whatever |
08:29:40 | FromDiscord | <Yardanico> But it does full match now |
08:29:51 | Araq | 19: adding 'if condition: echo' statements to my code |
08:30:03 | FromDiscord | <Yardanico> @19 ^ |
08:30:26 | FromDiscord | <ElegantBeef> There magic! |
08:30:33 | Araq | and the conditions can be pretty complex because I need heavy filtering, cannot wade through logs with thousands of lines |
08:30:47 | FromDiscord | <Yardanico> I do full match on 4 characters minimum, because there are people in our discord server with names like "you" |
08:30:48 | Araq | I mean, ok, I can. but it sucks |
08:31:32 | Araq | also I have a set of debugging rules, the most important is, "the error is elsewhere" |
08:31:34 | FromDiscord | <Rika> and "someone" but lol theyre just asking for it |
08:31:46 | FromDiscord | <scott> @Araq ↵↵Structured logging + jq are amazing for this |
08:32:45 | Araq | scott: hmm yeah, sounds good. I don't use 'jq', I sometimes dump into an SQLite DB and run queries |
08:32:48 | FromDiscord | <scott> @Yardanico would filtering out dictionary words maybe work better? |
08:32:59 | FromDiscord | <19> nice! so you echo out all your data! i did that for a while and it wasn't too bad at all. i intend to use VS only to use things like memory view and stuff for learning purposes to see how the data sits in memory but it's fine without it. |
08:33:02 | FromDiscord | <Yardanico> @scott we decided to make it simpler |
08:33:07 | FromDiscord | <Yardanico> Not more complex |
08:33:14 | FromDiscord | <scott> Fair enough |
08:33:48 | FromDiscord | <Rika> yardanico what happened to that small experiment with the json thing regards some sorta debugger |
08:34:10 | FromDiscord | <Yardanico> Well, you can extend it if you want |
08:34:16 | FromDiscord | <Yardanico> Just output more json |
08:34:27 | FromDiscord | <Yardanico> I made one example which sits in their repo |
08:37:03 | FromDiscord | <Yardanico> https://github.com/hediet/vscode-debug-visualizer/blob/master/demos/nim/main.nim |
08:37:10 | FromDiscord | <Yardanico> https://github.com/hediet/vscode-debug-visualizer/tree/master/demos/nim |
08:39:13 | FromDiscord | <Yardanico> It just reads json data from the debugger and uses that |
08:40:24 | Araq | <19> a former collegue of mine used MS's debugger to display results. he would put a breakpoint at the end of the program and then inspect the variables. was less work than to write custom toString methods in C# |
08:41:06 | Araq | (and back then C#'s dictionaries had no good toString implementation) |
08:41:19 | Araq | was pretty smart but also a tool abuse :-) |
08:47:04 | FromDiscord | <Rika> lmao someone's also called "smart" in the discord |
08:50:04 | FromDiscord | <Yardanico> their fault |
08:50:13 | FromDiscord | <Yardanico> :)) |
08:50:28 | FromDiscord | <Yardanico> most people in our discord channel don't even visit it after joining |
08:50:32 | FromDiscord | <malfong> I want to use a keyword for the member variable name of an object. It looks like it can be done, but is this a bad idea? |
08:50:38 | FromDiscord | <Yardanico> We have 20-30% one week retention |
08:51:03 | FromDiscord | <malfong> sent a code paste, see https://play.nim-lang.org/#ix=2Bem |
08:51:14 | FromDiscord | <Yardanico> @malfong it's pointless to remove messages because they're relayed to irc |
08:51:36 | FromDiscord | <ElegantBeef> Stropping is a supported feature |
08:51:42 | FromDiscord | <Yardanico> Yes this isn't a good idea, you should only do it when you need it for FFI or field names in serialization |
08:51:45 | Araq | malfong: it's common, 'kind' is usually a better name than 'type' though |
08:51:47 | FromDiscord | <Yardanico> It's just harder to type and stuff |
08:52:01 | Araq | but in wrappers `type` really is common |
08:52:26 | FromDiscord | <ElegantBeef> The stdlib doesnt strop much though i've only seen it for `div` |
08:52:26 | FromDiscord | <malfong> oh, I see! thx!! |
08:53:14 | FromDiscord | <ElegantBeef> So i just made a variable for mangling proc names entitled "disrupteksAnger", am i doing this right? |
08:53:56 | FromDiscord | <Rika> disrupteksAnger is way too volatile for mangling |
08:54:01 | FromDiscord | <Yardanico> :nimAngry: |
08:59:50 | FromDiscord | <ElegantBeef> Lol implementing the mangling ruined the interop |
09:22:24 | Oddmonger | i'm reading the Stefan Salewski book, and something was puzzling me in the ref objects sample, so i tried to execute it myself. But it doesn't compile : https://play.nim-lang.org/#ix=2Bew |
09:22:40 | Yardanico | Oddmonger: it compiles |
09:22:53 | Yardanico | it fails at runtime because playground doesn't support input (stdin) |
09:23:00 | Yardanico | also you're writing to stdin |
09:23:04 | Yardanico | you should write to stdout |
09:23:08 | Oddmonger | yes it compiles, but fails |
09:23:15 | Yardanico | because you're writing to stdin |
09:23:35 | Oddmonger | but i tried on my computer, and i get an error too (bad file descriptor) |
09:23:46 | Yardanico | because you're writing to stdin :) |
09:23:48 | Yardanico | you can't do that |
09:23:50 | Oddmonger | ah yes, sorry |
09:23:55 | Yardanico | https://play.nim-lang.org/#ix=2Bex |
09:24:00 | Yardanico | this works on my computer just fine |
09:25:46 | Oddmonger | hum i don't understant the allocation of nxt.next, with the current object |
09:26:22 | Yardanico | wdym "allocation" |
09:27:15 | Oddmonger | you see the line: nxt.next = f |
09:27:33 | FromGitter | <jrfondren> you're creating Friends with `new`. your very first assignment to .next is nil, from var f: Friend. after that you're assigning non-nil Friends |
09:27:42 | Oddmonger | f contains previous value |
09:28:03 | Oddmonger | the next is not existing at this step |
09:28:14 | Yardanico | but no one stops you from assinging nil |
09:28:25 | Yardanico | and then making it something which is not nil |
09:28:37 | Oddmonger | shouldn't be called «previous» ? |
09:28:37 | FromGitter | <jrfondren> nxt.next exists as soon as you new(nxt). you're never assigning to a nil .next |
09:28:56 | Yardanico | well it doesn't really |
09:29:02 | Yardanico | I mean the field exists but it's a nil reference |
09:29:37 | FromGitter | <jrfondren> also cool, I didn't know there was another Nim book |
09:29:45 | Yardanico | well it's not a full-blown "book" yet, but yes |
09:29:59 | Yardanico | should add it to https://nim-lang.org/learn.html I guess |
09:30:35 | Oddmonger | yes it's a good book with basic explainations |
09:31:22 | FromDiscord | <ElegantBeef> Turns out it helps if you actually tell the code the proper proc name |
09:32:07 | FromDiscord | <ElegantBeef> `circfillCompcxcyrrPt` i'm sure this mangling will suffice and not bite me in the ass |
09:32:46 | Oddmonger | if i had written it myself, i would have initialize next to nil, and then assigned when the next value exists |
10:00:37 | * | solitudesf- joined #nim |
10:01:10 | * | Tanger quit (Quit: Leaving) |
10:02:28 | * | ForumUpdaterBot quit (Remote host closed the connection) |
10:02:35 | * | ForumUpdaterBot joined #nim |
10:02:54 | * | Pisuke joined #nim |
10:03:00 | * | solitudesf quit (Ping timeout: 258 seconds) |
10:03:00 | * | MyMind quit (Ping timeout: 258 seconds) |
10:06:40 | * | abm joined #nim |
10:07:02 | * | FromDiscord quit (Remote host closed the connection) |
10:07:18 | * | FromDiscord joined #nim |
10:09:23 | FromDiscord | <Yardanico> For those who didn't see yet - we have more emojis available on the Nim server now :P https://media.discordapp.net/attachments/371759389889003532/767690841497534495/unknown.png |
10:10:34 | FromDiscord | <Vindaar> :disruptek: damn |
10:10:50 | FromDiscord | <Yardanico> you know you ping him with this emoji? :) |
10:11:21 | FromDiscord | <Vindaar> haha, no I did not think about that. I think he'll survive 😉 |
10:22:21 | FromDiscord | <neow> I'll change my nickname to an |
10:22:42 | FromDiscord | <neow> I don't mind getting pinged, I enjoy reading every single message here though |
10:22:53 | FromDiscord | <Rika> @neow @neow @neow @neow @neow @neow |
10:23:08 | FromDiscord | <neow> I- thanks |
10:23:42 | FromDiscord | <Yardanico> @neow you won't get pinged then |
10:23:58 | FromDiscord | <Yardanico> and the bridge uses handles and not display names rn anyway |
10:24:39 | FromDiscord | <neow> hmm, gtk |
10:24:43 | FromDiscord | <neow> (good to know) |
10:24:59 | FromDiscord | <neow> (not GNU is not unix toolkit) |
10:25:20 | Yardanico | what |
10:25:22 | FromDiscord | <neow> (edit) "(not GNU is not unix ... toolkit)" added "image manipulation program" |
10:25:34 | Yardanico | GTK = GIMP toolkit |
10:25:35 | FromDiscord | <Rika> oh oh oh |
10:25:43 | FromDiscord | <Rika> make your nick "what" |
10:25:44 | Yardanico | also my edit diffing worked here correctly apparently |
10:25:45 | FromDiscord | <Rika> 200 iq |
10:25:51 | FromDiscord | <Yardanico> not nick |
10:25:51 | FromDiscord | <Yardanico> handle |
10:25:53 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/767695007720538132/unknown.png |
10:25:56 | FromDiscord | <Yardanico> see this |
10:31:01 | FromDiscord | <dom96> maybe you should include a dictionary lookup in the Discord bridge for nick mentions? 😛 |
10:32:29 | FromDiscord | <Yardanico> that would be stupid :) |
10:33:23 | FromDiscord | <dom96> how so? |
10:33:39 | FromDiscord | <dom96> it would avoid mentions on common words |
10:34:11 | FromDiscord | <Yardanico> but you said yourself that we want to make it less complex |
10:34:40 | FromDiscord | <Vindaar> I missed why it's a bad idea to only ping if explicitly done via `@`? |
10:35:38 | FromDiscord | <Yardanico> I really just want to revert to old way of doing "Nick: hello" (only singular form) or @nick or "ping nick" |
10:35:54 | FromDiscord | <dom96> so do that |
10:36:28 | FromDiscord | <dom96> just don't use `startsWith` lol |
10:36:33 | FromDiscord | <Yardanico> I'm not? |
10:36:36 | FromDiscord | <Yardanico> I changed it already |
10:36:43 | FromDiscord | <dom96> ... you said you're reverting |
10:37:03 | FromDiscord | <Yardanico> reverting to old way of nick pinging with "Nick: hello" or "ping nick", not old nickname matching :) |
10:37:03 | FromDiscord | <dom96> Revert it but reapply the change to not use startsWith |
10:38:06 | FromDiscord | <Vindaar> just avoid any and all complexity, no? `if condition for match (name): createAtString(name)`? |
10:38:27 | FromDiscord | <Vindaar> if the user can't type persons name? or is the whole problem the discord naming with `#`? |
10:38:58 | FromDiscord | <Rika> some people ping without appending @s |
10:39:05 | FromDiscord | <Yardanico> well it's okay |
10:39:06 | FromDiscord | <Rika> or after char 0 |
10:39:08 | FromDiscord | <Yardanico> "Nick: hello" |
10:39:13 | FromDiscord | <dom96> that's how it works on IRC |
10:39:24 | FromDiscord | <dom96> You don't need the [at] on IRC |
10:39:38 | FromDiscord | <Yardanico> 🤔 https://media.discordapp.net/attachments/371759389889003532/767698465002094622/unknown.png |
10:39:49 | FromDiscord | <Yardanico> do we want this color and discord logo or not :) to the readme |
10:39:52 | FromDiscord | <Yardanico> I want to add discord link to it |
10:39:56 | FromDiscord | <Yardanico> with the badge |
10:40:00 | FromDiscord | <dom96> sure |
10:40:05 | FromDiscord | <Yardanico> ok |
10:40:09 | FromDiscord | <Vindaar> yes, but people on IRC will be pinged like normal on IRC. If someone wants to ping someone on the discord side it only makes sense to have them use the syntax there (and maybe add sugar like `ping <name>, <name>: ...`) |
10:40:19 | FromDiscord | <shashlick> That'd be nice - now that I don't use slack, I only get pinged if people are specific |
10:40:32 | FromDiscord | <Vindaar> exactly that's imo a feature |
10:41:22 | FromDiscord | <Yardanico> @Vindaar well yeah, but this sugar will complicate stuff so IMO it's better to just allow explicit @, singular "ping nick and "Nick: hello" at the start of the string |
10:41:25 | FromDiscord | <Yardanico> with @ you can ping all you want |
10:41:58 | FromDiscord | <Vindaar> that's what I'm saying, isn't it? |
10:42:03 | FromDiscord | <Vindaar> (hint: it is) |
10:42:06 | FromDiscord | <dom96> in that case you shouldn't even need to check whether the nick actually exists |
10:42:17 | FromDiscord | <Yardanico> well you still do |
10:42:18 | FromDiscord | <dom96> just replace `nick: Hello` with `@nick: hello` |
10:42:22 | FromDiscord | <dom96> no matter what |
10:42:23 | FromDiscord | <Yardanico> nah it doesn't work like that |
10:42:29 | FromDiscord | <Vindaar> because of `#`? |
10:42:31 | FromDiscord | <dom96> oh, silly discord |
10:42:37 | FromDiscord | <Yardanico> to ping on discord you must replace the nickname with the ID |
10:42:40 | FromDiscord | <Yardanico> like <@!id> |
10:42:48 | FromDiscord | <Vindaar> ok, now it makes more sense |
10:42:52 | FromDiscord | <Yardanico> yeah because display names or handles aren't unique |
10:42:54 | FromDiscord | <dom96> @Yardanico test |
10:43:02 | FromDiscord | <Vindaar> so you perform a lookup on all users on the server? |
10:43:03 | FromDiscord | <dom96> hm, I guess Discord still replaces it |
10:43:17 | FromDiscord | <Yardanico> @Vindaar yeah, but it's cached locally since I request all members at ircord startup |
10:43:25 | FromDiscord | <Vindaar> I see |
10:43:26 | FromDiscord | <Yardanico> so it doesn't do a network lookup each time |
10:43:36 | FromDiscord | <Yardanico> and when new users join dimscord updates that local cache |
10:45:12 | FromDiscord | <Yardanico> can't think of something better for a discord description :P repeating "discuss Nim in real-time" third time doesn't sound that good https://media.discordapp.net/attachments/371759389889003532/767699862253862912/unknown.png |
10:45:47 | FromDiscord | <Vindaar> sent a code paste, see https://play.nim-lang.org/#ix=2BeZ |
10:46:17 | FromDiscord | <Yardanico> that's what I'm doing kind of |
10:46:23 | FromDiscord | <Yardanico> and always has been doing |
10:46:28 | FromDiscord | <Vindaar> ok 🙂 |
10:46:33 | FromDiscord | <Yardanico> extract possible mentions, check if they exist and then replace in the string |
10:49:18 | FromDiscord | <shashlick> How about letting folks register additional strings that will mention them 😄 |
10:49:49 | FromDiscord | <Yardanico> you want to get pinged on nimterop? :) |
10:49:57 | FromDiscord | <shashlick> Yep |
10:51:53 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/pull/15634 |
10:51:54 | disbot | ➥ Add discord to the README |
10:52:00 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/767701574217629716/unknown.png |
10:52:08 | FromDiscord | <Yardanico> also apparently shields.io has the Nim logo available |
10:52:14 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/767701634682847232/unknown.png |
10:56:54 | * | luis_ joined #nim |
10:57:35 | luis_ | Anyone here using nimdow? I am trying to run it on clearlinux, but I get: |
10:57:37 | luis_ | luis@clr-dc8d41e6dcab4a0da7ffe90d4e0e59ab~ $ nimdow |
10:57:39 | luis_ | could not load: libXinerama.so |
10:57:41 | luis_ | (compile with -d:nimDebugDlOpen for more information) |
10:57:46 | FromDiscord | <Yardanico> you need xinerama installed |
10:57:50 | FromDiscord | <Yardanico> what's your distro? |
10:57:56 | luis_ | and devpkg-libXinerama |
10:58:01 | luis_ | is installed |
10:58:03 | luis_ | Clearlinux |
10:58:09 | FromDiscord | <Yardanico> @Avahe ^ |
10:58:20 | FromDiscord | <Yardanico> well maybe clearlinux doesn't install neccesary xorg packages or something? |
10:58:35 | FromDiscord | <Yardanico> try installing devpkg-xorg-server |
10:59:25 | luis_ | ok... let me try |
11:00:08 | luis_ | it's already installed |
11:00:35 | FromDiscord | <Yardanico> well then I don't know, never really tried clear linux since it's not really a desktop-focused distro ;) |
11:00:55 | luis_ | https://paste.gnome.org/p4jorobze |
11:01:13 | luis_ | Thank, will try to find the problem... will report back... |
11:02:55 | * | lritter joined #nim |
11:04:46 | FromDiscord | <Vindaar> PMunch around on IRC? |
11:04:54 | PMunch | Yup |
11:07:03 | FromDiscord | <Vindaar> ah, nice. Have you looked at the CI failure of the docopt PR? Seems it's just a `nimpretty` thing? |
11:11:53 | * | luis_ quit (Read error: Connection reset by peer) |
11:20:38 | * | skelett quit (Quit: WeeChat 2.8) |
11:23:52 | * | filcuc joined #nim |
11:27:21 | * | TomDotTom joined #nim |
11:28:16 | * | Kiloneie joined #nim |
11:46:45 | * | FromDiscord quit (Remote host closed the connection) |
11:46:59 | * | FromDiscord joined #nim |
11:48:37 | FromDiscord | <ache of head> okay, so the guy that said templates are like abstract functions asked a good question |
11:48:45 | FromDiscord | <ache of head> what's the difference between `quote` and `quote do:`? |
11:49:16 | FromDiscord | <Rika> tfw deleted message |
11:49:26 | FromDiscord | <ache of head> why is `quote` written as `quote do: x` instead of just `quote: x`? |
11:49:32 | FromDiscord | <ache of head> > tfw deleted message↵i misread the message |
11:50:30 | * | kenran quit (Ping timeout: 256 seconds) |
11:50:47 | FromDiscord | <ache of head> i think it's because `do` denotes a code block |
11:50:52 | FromDiscord | <ache of head> and `quote` accepts a code block |
11:50:53 | FromDiscord | <ache of head> right? |
11:55:43 | FromDiscord | <ache of head> no wait |
11:55:47 | FromDiscord | <ache of head> it's because the other argument |
11:55:48 | FromDiscord | <ache of head> `op` |
11:55:50 | FromDiscord | <ache of head> right? |
11:57:22 | * | beanie joined #nim |
11:57:58 | * | beanie quit (Client Quit) |
11:59:37 | FromDiscord | <Yardanico> why are you spamming |
11:59:57 | PMunch | @Vindaar, sorry I completely forgot you pinged me :P |
12:00:13 | FromDiscord | <Vindaar> no worries, haha. will be gone for a bit now though |
12:01:11 | PMunch | Ah, seems like a nimpretty issue indeed |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:38 | * | supakeen joined #nim |
12:13:31 | * | Kaivo quit (Ping timeout: 246 seconds) |
12:16:03 | * | Kaivo joined #nim |
12:21:38 | Araq | <ache of head> the reason is mostly parsing precedence rules |
12:21:56 | Araq | 'quote' does work without the 'do' too but has different grouping rules |
12:22:05 | * | arecacea1 quit (Remote host closed the connection) |
12:24:01 | * | arecacea1 joined #nim |
12:25:13 | * | lbart quit (Ping timeout: 258 seconds) |
12:27:30 | * | TomDotTom quit (Ping timeout: 272 seconds) |
12:31:21 | * | lbart joined #nim |
12:35:28 | leorize[m] | PMunch: can you remove Zevv's with from nim >= 1.2 from the playground? |
12:36:17 | Zevv | wait what why |
12:36:18 | Zevv | my with! |
12:36:35 | PMunch | leorize[m], PR's welcome |
12:36:48 | FromDiscord | <ache of head> > why are you spamming↵i wasn't trying to spam, sorry if it looked like that |
12:37:29 | leorize[m] | PMunch also in 1.4 I fixed nimsuggest problem of "only showing jumping to the forward declaration" by making nimsuggest report the position of both the forward declaration and the implementation. I think your nimlsp might need an update to handle that. |
12:38:25 | PMunch | Ooh, indeed that is something I might have to look into |
12:38:37 | PMunch | Well, PRs welcome there as well of course :P |
12:38:51 | PMunch | nimlsp is a hacktoberfest repo if anyone wants a t-shirt :) |
12:39:11 | leorize[m] | sorry I don't have time to play w nimlsp atm :p |
12:41:34 | * | TomDotTom joined #nim |
12:51:18 | * | narimiran quit (Ping timeout: 256 seconds) |
12:58:24 | FromGitter | <jrfondren> can't compile Nim without SCL on CentOS 7 either :| that's not EOL on 2024 |
12:59:48 | FromDiscord | <dom96> SCL? |
13:00:06 | FromDiscord | <19> @Araq ↵thanks for the great advice |
13:00:11 | FromDiscord | <dom96> @Yardanico that's not spamming |
13:00:18 | FromDiscord | <Yardanico> that was half-joke |
13:00:26 | FromGitter | <jrfondren> https://wiki.centos.org/AdditionalResources/Repositories/SCL , it's a way to import gcc from the future, among other things. |
13:00:44 | FromDiscord | <dom96> ahh, so the gcc is too old |
13:01:09 | FromDiscord | <Yardanico> yeah we need to change the readme if nim no longer works with gcc 3.x |
13:01:14 | FromDiscord | <Yardanico> "A C compiler such as gcc 3.x/later or an alternative such as clang, Visual C++ or Intel C++. It is recommended to use gcc 3.x or later." |
13:01:15 | * | jxy quit (Ping timeout: 258 seconds) |
13:01:17 | FromGitter | <jrfondren> on CentOS7 gcc can actually compile Nim until the final step where it doesn't have __builtin_saaddll_overflow stuff |
13:01:27 | FromDiscord | <Yardanico> you can fix that |
13:01:31 | FromDiscord | <Yardanico> by -d:nimEmulateOverflowChecks |
13:01:38 | FromDiscord | <Yardanico> try to add it in config/nim.cfg |
13:01:49 | FromDiscord | <dom96> hm, I ran into this too for embedded |
13:02:06 | FromDiscord | <dom96> Can we maybe generate a check for the existence of this in the C code? |
13:02:17 | FromGitter | <jrfondren> gcc 4.8.5 on CentOS7, and 4.4.7 on CentOS 6. so "3.x or later" isn't true anymore |
13:02:28 | FromDiscord | <Yardanico> the issue is that then we need to run the C compiler to check that before actually compiling the code |
13:02:37 | Zevv | hmm so nim now has its own with. Should I rename zevv/with to something different? |
13:02:41 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/blob/devel/lib/nimbase.h#L571 |
13:02:45 | FromDiscord | <Yardanico> @Zevv no |
13:02:52 | FromDiscord | <Yardanico> you can only import it as "import std/with" |
13:02:57 | FromDiscord | <Yardanico> i mean stdlib version |
13:03:10 | Zevv | hm fair enough |
13:03:16 | FromDiscord | <Yardanico> IIRC that overflow checks situation was discussed before |
13:03:19 | FromDiscord | <Yardanico> don't remember where exactly |
13:06:05 | FromDiscord | <Clyybber> We can provide an error that points to -d:nimEmulateOverflowChecks |
13:06:09 | FromDiscord | <Clyybber> via C macros |
13:06:15 | FromDiscord | <19> @Yardanico ↵oh lol, well it definitely worked in my case xD |
13:07:08 | FromGitter | <jrfondren> -d: flags don't help on the initial compilation of Nim itself, from C sources |
13:07:53 | FromDiscord | <Clyybber> But you don't get that error on building Csources do you? |
13:08:40 | * | natrys joined #nim |
13:08:40 | FromDiscord | <Clyybber> Csources doesn't use builtin_saaddll_overflow I'm pretty sure |
13:09:19 | FromGitter | <jrfondren> they absolutely do. |
13:10:02 | FromDiscord | <Yardanico> they don't |
13:10:06 | FromDiscord | <Yardanico> they are 0.20 |
13:10:29 | FromGitter | <jrfondren> download 1.4.0 tarball, extract, sh build.sh, it fails due to not having those. There are a bunch of different copies of the C sources so you may be familiar with a version that lacks it, but you are entirely wrong about the C sources not requiring those. |
13:10:51 | FromDiscord | <Yardanico> we're talking about different things |
13:10:58 | FromDiscord | <Yardanico> we're talking about the fact that csources repo is 0.20 |
13:11:03 | FromDiscord | <Yardanico> the one you downloaded isn't "csources" |
13:11:16 | FromDiscord | <Yardanico> it's just nim's compiled c code for easier bootstrap |
13:11:24 | FromDiscord | <Yardanico> we're talking about https://github.com/nim-lang/csources |
13:11:44 | FromGitter | <jrfondren> huh, OK. |
13:13:11 | * | skelett joined #nim |
13:13:25 | FromGitter | <jrfondren> so 1.4.0 c_code/nimbase.h has these __builtin_xxx_overflow symbols, but csources is another bootstrap option? |
13:14:25 | FromDiscord | <Yardanico> yes |
13:17:58 | FromGitter | <jrfondren> hmm for my purposes it might be moot anyway. csources on CentOS6 would get me a Nim compiler that still requires a newer version of gcc to compile nim programs. on CentOS7, although the source tarball doesn't work, choosenim *does* work and gets a functional-seeming Nim. Maybe I'll need that -d: flag for it later. |
13:23:25 | * | nc-x joined #nim |
13:27:50 | * | grorkster joined #nim |
13:28:15 | leorize[m] | @jrfondren choosenim likely fetched the prebuilts that we posted on the website |
13:29:56 | leorize[m] | hmm, we might have to consider rolling -d:nimEmulateOverflowChecks in csources generation |
13:30:04 | leorize[m] | probably will be done for the next version |
13:35:22 | * | qeeg joined #nim |
13:35:43 | * | solitudesf- quit (Remote host closed the connection) |
13:36:28 | * | TomDotTom quit (Ping timeout: 256 seconds) |
13:36:49 | * | newUser joined #nim |
13:38:14 | * | solitudesf joined #nim |
13:39:19 | * | nc-x quit (Remote host closed the connection) |
13:42:12 | * | krux02 joined #nim |
13:42:46 | newUser | hi, I want to make a small example with NimScript, please have a look at https://play.nim-lang.org/#ix=2BfI |
13:46:56 | * | kenran joined #nim |
13:50:04 | leorize[m] | https://play.nim-lang.org/#ix=2BfK <- there you go |
13:50:14 | leorize[m] | just add that before setCommand |
13:52:19 | * | kenran quit (Ping timeout: 260 seconds) |
13:55:47 | newUser | leorize[m]: https://play.nim-lang.org/#ix=2BfN |
13:56:23 | leorize[m] | yep, that works too |
13:56:51 | leorize[m] | use --define:danger if you want to make the binary as small as possible |
13:56:54 | leorize[m] | not recommended though |
13:57:00 | newUser | oh, you mean I can put it direct ? |
13:57:07 | leorize[m] | --define:release is better |
13:57:12 | newUser | without switch |
13:57:21 | leorize[m] | yea, the nimscript module define a `--` template |
13:57:53 | newUser | and where to put the main.nim |
13:58:02 | * | TomDotTom joined #nim |
13:58:08 | FromDiscord | <Clyybber> -d:release and -d:danger don't work in config or main.nim |
13:58:18 | Yardanico | ^^^ |
13:58:50 | newUser | no my example file is main.nim and out iss Weather.exe |
13:58:58 | leorize[m] | setCommand take an optional argument that's the file |
14:04:16 | newUser | don't understand |
14:04:33 | newUser | setCommand "c main.nim" |
14:09:47 | newUser | --passC:-flto is not allowed: Error: undeclared identifier: ':-' |
14:09:55 | Yardanico | quote -flto |
14:09:57 | Yardanico | --passC:"-flto" |
14:11:32 | newUser | task build, "builds an example": echo "task" setCommand "c" setCommand "hello.nim" |
14:12:09 | * | narimiran joined #nim |
14:12:14 | newUser | another small example, the echo is not printed |
14:19:08 | newUser | thx, I use .sh. Description is not enough for me. Documentation should be for beginners too. |
14:20:00 | newUser | bye |
14:20:04 | Yardanico | lol |
14:20:05 | * | newUser quit (Remote host closed the connection) |
14:20:15 | Yardanico | i don't think using .sh over nimscript is a good idea :) |
14:20:19 | Yardanico | have you looked at nimble build tasks? |
14:29:32 | ForumUpdaterBot | New thread by ElAfalw: Passing X to a sink parameter introduces an implicit copy, see https://forum.nim-lang.org/t/6956 |
14:30:27 | * | grorkster quit (Quit: WeeChat 2.9) |
14:31:00 | * | grorkster joined #nim |
14:40:47 | leorize[m] | https://nim-lang.org/docs/nimscript.html#setCommand%2Cstring%2Cstring <- well setCommand can be used like this: setCommand("c", "hello.nim") :P |
14:40:54 | leorize[m] | but they're gone now :P |
14:48:10 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
14:49:07 | * | pbb joined #nim |
14:51:03 | FromDiscord | <Yardanico> @Clyybber found an interesting bug :P https://github.com/nim-lang/Nim/issues/15637 |
14:51:05 | disbot | ➥ C compiler error when using statement list expression with a template ; snippet at 12https://play.nim-lang.org/#ix=2Bg2 |
14:52:19 | FromDiscord | <Clyybber> huh |
14:52:34 | FromDiscord | <Yardanico> it was initially with strformat's &, but & just does roughly the same thing |
14:52:38 | FromDiscord | <Yardanico> and indeed the error is the same |
14:52:47 | FromDiscord | <Yardanico> i modified it to use ints |
14:53:16 | FromDiscord | <Yardanico> I guess the identifier in a template is being reused when it shouldn't |
14:53:39 | FromDiscord | <Clyybber> no, it should |
14:53:46 | FromDiscord | <Yardanico> intval? |
14:53:48 | FromDiscord | <Clyybber> it should get an error message tho |
14:53:55 | FromDiscord | <Yardanico> oh, so this is invalid code actually? |
14:54:21 | FromDiscord | <Clyybber> yeah, because the code will get semmed since the param it gets passed to is typed |
14:54:33 | FromDiscord | <Clyybber> this is a case of illegal sym sharing |
14:54:45 | FromDiscord | <Clyybber> but perhaps we can introduce some rules to allow it in this case |
14:54:56 | FromDiscord | <Clyybber> but first I need to finish the fix for the other symshare issue |
14:55:41 | FromDiscord | <Yardanico> ok thanks |
14:56:47 | * | hnOsmium0001 joined #nim |
15:09:31 | * | arecacea1 quit (Remote host closed the connection) |
15:10:04 | * | arecacea1 joined #nim |
15:12:54 | * | vicfred_ quit (Quit: Leaving) |
15:13:13 | * | Kiloneie quit (Quit: Leaving) |
15:20:09 | * | hyiltiz joined #nim |
15:20:09 | * | hyiltiz quit (Changing host) |
15:20:09 | * | hyiltiz joined #nim |
15:20:35 | * | lander joined #nim |
15:23:27 | * | gangstacat quit (Ping timeout: 272 seconds) |
15:27:23 | * | TomDotTom quit (Ping timeout: 260 seconds) |
15:34:22 | * | bung joined #nim |
15:34:46 | bung | can I destruct future of tuple to variable ? |
15:41:25 | FromDiscord | <Yardanico> After you await it sure |
15:43:28 | Yardanico | bung: there are no issues with that |
15:43:41 | Yardanico | does "let (x, y, whatever other vars) = await mytulpefut" not work? |
15:46:16 | bung | var r:tuple[payload: string, payloadLen: int] (payload,_) = await conn.receivePacket() |
15:46:40 | Yardanico | that's not how you deconstruct a tuple |
15:46:57 | Yardanico | ahh you want to assign to a tuple field or what? |
15:47:04 | Yardanico | then you should do something like |
15:47:10 | Yardanico | (r.payload, _) = await .. |
15:47:48 | * | kenran joined #nim |
15:48:07 | bung | I want to do `(payload,_)` but it doen't work , so I add a variable declaration |
15:49:48 | Yardanico | you can't do that |
15:49:51 | Yardanico | payload is in a tuple |
15:49:54 | Yardanico | you need "r.payload" |
15:49:58 | Yardanico | or maybe I didn't understand |
15:50:11 | Yardanico | does conn.receivePacket return that tuple? |
15:50:57 | bung | oh it works, misreading error message |
15:51:47 | bung | I remenber there's issue with tuple that need to declare tuple varible first |
15:52:59 | * | kenran quit (Ping timeout: 258 seconds) |
15:54:32 | bung | new problem, (pkt, _) = await conn.receivePacket() if pkt declared, it will throw Error: undeclared identifier: '_' |
15:54:51 | * | TomDotTom joined #nim |
15:55:26 | Yardanico | is pkt declared? |
15:55:34 | Yardanico | if not, add "var" or "let" before |
15:55:38 | Yardanico | let (pkt, _) = ... |
15:55:58 | bung | var pkt = pkt, code before |
15:58:49 | bung | I decalre the tuple second element to avoiding this. |
16:04:47 | * | PMunch quit (Quit: leaving) |
16:10:56 | * | rockcavera joined #nim |
16:15:27 | * | narimiran quit (Ping timeout: 265 seconds) |
16:19:13 | * | Mat5 joined #nim |
16:22:46 | * | tane joined #nim |
16:33:29 | disruptek | disruptek drinks because you deref nil. |
16:34:09 | Yardanico | :disruptek: |
16:34:31 | FromDiscord | <Avatarfighter> :disruptek: |
16:36:39 | * | gangstacat joined #nim |
16:37:13 | disruptek | dafuq |
16:40:14 | FromDiscord | <haxscramper> This code - https://play.nim-lang.org/#ix=2Bh9 works for `1.2.6` and `1.2.0` versions but not for `1.2.8` and `1.4.0` |
16:40:27 | FromDiscord | <haxscramper> This is an intentional change or bug in new version? |
16:40:33 | FromDiscord | <Yardanico> intentional |
16:40:38 | FromDiscord | <haxscramper> FFS why? |
16:40:39 | FromDiscord | <Yardanico> lemme link the issue/rfc |
16:41:01 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/issues/15280 |
16:41:02 | disbot | ➥ Mixing 'return' with expressions is allowed in 1.2 ; snippet at 12https://play.nim-lang.org/#ix=2ydZ |
16:41:13 | * | waleee-cl joined #nim |
16:41:27 | FromDiscord | <Clyybber> @haxscramper Please vote on https://github.com/nim-lang/RFCs/issues/251 |
16:41:28 | disbot | ➥ Allow return in expressions again ; snippet at 12https://play.nim-lang.org/#ix=2B2K |
16:46:05 | Mat5 | I'm in search for some information regarding programming with disabled garbarge collection, as my last approach in using Nim was some years ago. Does there exist some documentation about this topic? |
16:47:49 | FromDiscord | <Yardanico> well, what is your reason for disabling the GC? |
16:48:04 | FromDiscord | <Yardanico> but I don't think that there exists much documentation about that, but you can always just --gc:none and manually allocate |
16:48:06 | FromDiscord | <Yardanico> just like in C |
16:48:09 | FromDiscord | <Clyybber> Mat5: You can use gc:arc, its akin to RAII |
16:48:25 | FromDiscord | <Clyybber> with move semantics |
16:48:26 | FromDiscord | <Yardanico> you have tons of books about C, and they all don't talk about a GC :) |
16:48:49 | FromGitter | <deech> What does `static type` mean in this case? https://github.com/nim-lang/Nim/blob/devel/lib/pure/typetraits.nim#L93 |
16:49:42 | Mat5 | Yardanico, that's mainly bare-metal programming |
16:50:07 | FromDiscord | <Yardanico> but is arc not what you want? if you don't make refs and use ptrs with destructors instead you will have pure raii |
16:51:16 | FromDiscord | <Rika> well if not bare metal programming, what are you doing? |
16:51:18 | FromDiscord | <Yardanico> @deech compile-time expression https://nim-lang.org/docs/manual.html#special-types-static-t |
16:51:31 | FromDiscord | <Clyybber> deech: In this case the same thing as typedesc except that its treated like a value and never like a type |
16:51:38 | FromDiscord | <Clyybber> I think |
16:52:55 | FromDiscord | <Clyybber> @Yardanico No, arc is what they want |
16:53:10 | FromGitter | <deech> Yardanico: I understand the `static` keyword but not what `static type` means. |
16:53:41 | FromDiscord | <Clyybber> deech: yeah, its not something that was ever anticipated to exist |
16:53:47 | FromGitter | <deech> I thought it might be polymorphic over types but this doesn't work: `@[StaticParam["hello"],StaticParam[1]]` |
16:53:59 | FromDiscord | <Clyybber> you might ask the author of that code timothee |
16:54:23 | FromDiscord | <Clyybber> no, its not a typeclass |
16:54:42 | FromDiscord | <Clyybber> its static[type] so while type itself is already a compile thing |
16:54:50 | FromDiscord | <Clyybber> (edit) "compile" => "compiletime" |
16:54:59 | FromDiscord | <Clyybber> it makes it hard to say what exactly static[type] is |
16:55:51 | FromGitter | <deech> Yeah, not sure of it's use except in this specific use case of iterating over concrete `static` values in a type definition. |
16:56:05 | FromDiscord | <Clyybber> yeah |
16:56:27 | * | sealmove joined #nim |
16:57:26 | * | NimBot joined #nim |
16:57:38 | FromGitter | <deech> Would be nice if typedesc was 1st class at compile time. |
16:57:56 | * | TomDotTom quit (Ping timeout: 272 seconds) |
16:57:58 | FromDiscord | <Clyybber> yeah, theres an RFC for that, whatever it might entail |
16:59:02 | FromGitter | <deech> I tried converting the typedesc to a `NimNode` with `getTypeInst` and passing that around but recovering the type from it doesn't seem possible |
16:59:32 | * | TomDotTom joined #nim |
17:00:02 | FromDiscord | <Clyybber> The RFC is still lacking a concrete design |
17:00:38 | * | user0 quit (Remote host closed the connection) |
17:00:43 | FromDiscord | <Clyybber> might be worth it to collect the various requirements there |
17:01:27 | FromGitter | <deech> Have a link? |
17:01:44 | FromDiscord | <Clyybber> https://github.com/nim-lang/RFCs/issues/44 |
17:01:44 | disbot | ➥ [RFC] Working with types in macro is difficult. |
17:08:32 | * | Mat5 quit (Quit: Leaving) |
17:28:48 | disruptek | clyybber: CFile -> FILE |
17:29:00 | FromDiscord | <Clyybber> what |
17:29:13 | disruptek | different signatures, different identities, same name. |
17:29:48 | FromDiscord | <Clyybber> what has the same name |
17:30:12 | disruptek | two apparently different types. |
17:30:25 | FromDiscord | <Clyybber> ah, we talked about the solution |
17:30:30 | FromDiscord | <Clyybber> its easy |
17:30:34 | disruptek | yes, assume it's fine. |
17:31:04 | FromDiscord | <Clyybber> oh, I thought you were pinging me because its not fine |
17:31:21 | disruptek | i'm just sharing the latest bullshit. |
17:31:38 | disruptek | i didn't know it'd ping you. |
17:31:45 | FromDiscord | <Clyybber> its fine |
17:31:49 | FromDiscord | <Clyybber> I like being pinged |
17:32:10 | disruptek | people should just fucking block me because i cannot be arsed to guess as to whether you care about being pinged. |
17:32:10 | FromDiscord | <Clyybber> bullshit as in "look what I have to deal with"↵or bullshit as in "look what I got working \o/" |
17:32:19 | FromDiscord | <Clyybber> :disruptek: |
17:32:31 | disruptek | it's only the megatest that demonstrates defects like this. |
17:32:45 | FromDiscord | <Clyybber> so the former |
17:32:50 | disruptek | yes. |
17:32:59 | FromDiscord | <Clyybber> get to the latter |
17:33:02 | FromDiscord | <Clyybber> now |
17:33:07 | disruptek | packages and bootstrap pass, so now i'm refactoring. |
17:33:15 | sealmove | what's the common way to convert enum to string? |
17:33:52 | FromDiscord | <Clyybber> disruptek: Nice |
17:34:01 | FromDiscord | <Clyybber> sealmove: $ |
17:36:09 | bung | result.payload.substr(4),decompressed[4 .. ^1] ,do I better change it to ptr? |
17:39:17 | * | lritter quit (Quit: Leaving) |
17:47:55 | leorize[m] | I'm not sure what you want to do with that? |
17:48:28 | bung | just substring but I worry about the performance |
17:48:44 | * | kenran joined #nim |
17:49:51 | leorize[m] | well toOpenArray exists for creating views |
17:53:25 | * | kenran quit (Ping timeout: 240 seconds) |
17:54:17 | bung | then result.payload declare as what type? |
17:54:40 | leorize[m] | ? |
17:54:49 | leorize[m] | I don't think I understand your code |
17:55:32 | bung | oh, currently I use this varible as string |
17:56:16 | bung | it will assign to result as part of tuple |
17:59:02 | bung | hold on , I'll provide the source link, sorry for my poor english |
17:59:48 | Prestige | What language(s) do you speak natively? |
18:00:01 | Yardanico | Prestige: I think chinese |
18:00:06 | FromDiscord | <Rika> i think they know chinese, but thats only from what i remembe r |
18:00:14 | Prestige | Ah, nvm then |
18:01:22 | bung | https://github.com/bung87/amysql/blob/2a19b6365e179b03d3a54493ff0c0660b15be799/src/amysql/private/protocol.nim#L465-L468 |
18:02:43 | bung | check this piece of code , any improvement suggetion appreciate |
18:03:47 | leorize[m] | why are payload and payloadLen two different entities? |
18:04:16 | leorize[m] | it also appears to me that you're passing binary around as a string? that's not the best way to do it |
18:04:34 | bung | result could be just string, I impelement it while reading mysql document, when I complete I fount I dont need payloadLen |
18:05:48 | bung | so in this case, choose openarray[char] or ptr char with offset ? |
18:07:59 | bung | the initial version dont support protocol compression, so there's some differiences, compression packets could contains multiple packets |
18:08:17 | leorize[m] | just use a seq[char] |
18:09:11 | bung | ok. thanks! |
18:10:13 | leorize[m] | or a seq[byte] depending on the type of data you're handling |
18:10:30 | Yardanico | btw, are there any plans for adding destructors to stdlib types (like files, etc), or the plan is to make arc/orc default first and only then start doing that? |
18:11:39 | leorize[m] | bung: you can use sequtils.delete() to trim the beginning of a seq |
18:11:51 | leorize[m] | it's in-place so it's fast |
18:12:11 | leorize[m] | Yardanico: I believe so. ARC/ORC working reliably means that destructors work reliably |
18:12:44 | disruptek | kinda important that the stdlib works even when the mm doesn't. 😁 |
18:13:43 | Yardanico | well but if we start adding destructors, then for example we'll have to change the File type |
18:14:07 | Yardanico | add FileRef at least for if you want to have a file descriptor referenced from multiple locations |
18:14:22 | disruptek | wut |
18:14:31 | Yardanico | ? |
18:14:44 | bung | leorize string doesn't have such a method right ? |
18:15:04 | leorize[m] | if you want `io` to gain destructors we will have to rework the module itself |
18:15:07 | leorize[m] | bung: yea, it should be simple to add to strutils though |
18:15:16 | Yardanico | leorize[m]: exactly |
18:15:33 | leorize[m] | adding destructors to io means breaking backward compat |
18:15:41 | Yardanico | --useVersion :PPPP |
18:15:50 | leorize[m] | currently Nim's `File` is C's `FILE*` |
18:15:55 | Yardanico | yeah I know |
18:16:44 | bung | ok, I better change to seq[char] and only return this one, change following calls arg I think. |
18:17:22 | leorize[m] | I know how to rework io and Status already make one, so it's not too hard |
18:17:28 | leorize[m] | just have to find the time for it |
18:17:30 | leorize[m] | if you're slinging bytes around then `seq[byte]` is better |
18:22:42 | bung | anyway , thanks, I finally finish the mysql compression part |
18:23:39 | disruptek | bung: nice, i know that was a chore. |
18:27:45 | bung | yeah , that's right, basically I just get words by reading document, before finished it I really not sure my understanding is right or not. |
18:47:00 | * | solitudesf quit (Remote host closed the connection) |
18:49:04 | * | solitudesf joined #nim |
18:57:00 | * | TomDotTom quit (Ping timeout: 272 seconds) |
19:22:03 | * | TomDotTom joined #nim |
19:22:06 | FromGitter | <deech> The macros tutorial that ships with Nim is really nice. https://github.com/nim-lang/Nim/blob/devel/doc/tut3.rst#L1 Are there any advanced ones you would recommend? |
19:22:20 | * | gmaggior joined #nim |
19:27:45 | * | bung quit (Quit: Lost terminal) |
19:29:30 | * | xace quit (Ping timeout: 256 seconds) |
19:30:56 | leorize[m] | that tutorial is the best one we have atm |
19:31:22 | leorize[m] | once you got the macros basics, "advanced" macros are actually really simple |
19:31:25 | * | xace joined #nim |
19:32:07 | leorize[m] | 70% of the time would be spent on `dumpTree` of the tree you want to work with and `dumpTree` of the tree you want to generate :P |
19:49:33 | * | kenran joined #nim |
19:53:08 | FromDiscord | <nikki> i really like the nim manual |
19:53:55 | FromDiscord | <nikki> i made a pdf render of it that fits nicely on an ipad mini; if anyone was interested in that ... |
19:54:11 | FromDiscord | <nikki> just hacked up the latex output lol |
19:54:31 | disruptek | what a pita. |
19:54:34 | * | kenran quit (Ping timeout: 260 seconds) |
19:54:44 | disruptek | do you mean the page size matches the aspect ratio of the mini? |
19:55:21 | FromDiscord | <nikki> yeah. it does have a large margin but my pdf reader on the mini can auto crop margins so i didn't fix that part |
19:55:36 | disruptek | huh. |
19:55:57 | FromDiscord | <nikki> i use "pdf expert" which has an auto crop feature |
19:56:28 | disruptek | is it me or are the later chromes worse by universal metrics like glitches, bugs, crashes? |
19:56:44 | FromDiscord | <nikki> i've seen that too |
19:56:52 | FromDiscord | <nikki> i'm mostly on firefox these days tho |
19:57:07 | FromDiscord | <lqdev> welcome to The Web™️ |
19:57:57 | FromDiscord | <Avatarfighter> I can never figure out why Google Chrome makes my mac suffer more than other chromium browsers |
19:58:25 | disruptek | you run multiple chromium browsers? |
19:58:39 | FromDiscord | <Avatarfighter> Yeah |
19:58:47 | disruptek | is that fun for you? |
19:58:51 | FromDiscord | <Avatarfighter> no |
19:59:07 | disruptek | then why do you do it? for work? |
19:59:27 | FromDiscord | <Avatarfighter> Google Chrome for school and Brave for everything else |
19:59:41 | disruptek | because hacker? |
19:59:45 | FromDiscord | <Avatarfighter> no bro |
19:59:48 | FromDiscord | <scott> don't use Brave...it's sketchy af |
20:00:02 | FromDiscord | <scott> ah, this is OT, I'll go over there |
20:00:02 | supakeen | could just use chrome with 2 profiles as well they have a handy switcher nowadays :) |
20:00:13 | FromDiscord | <Avatarfighter> the referal injection controversy was blown out of proportion @scott |
20:00:21 | FromDiscord | <Avatarfighter> ill move to #offtopic to defend brave |
20:00:39 | disruptek | jesus. did i hit a nerve or what? |
20:00:46 | supakeen | when do you not! |
20:01:13 | disruptek | i don't know, but i'm not in offtopic and not planning on visiting, so... |
20:01:22 | * | natrys quit (Quit: natrys) |
20:01:42 | Prestige | firefox and qutebrowser do it for me. Still OT though |
20:01:47 | Prestige | woops |
20:02:01 | disruptek | hey man, whatever blows your skirt up. |
20:02:24 | disruptek | whatever peels the prestigious banana, i mean. |
20:02:32 | FromDiscord | <Yardanico> @scott totally agree with you |
20:02:38 | Prestige | I'm glad you're here disruptek |
20:03:58 | FromDiscord | <Avatarfighter> Disruptek: i use brave because of the possibility of earning BAT |
20:05:12 | FromDiscord | <dk> Can you `nimble develop` but only for a local dependency instead of system-wide? |
20:05:24 | FromDiscord | <dk> Or should I just clone the dependency |
20:09:42 | * | lander quit (Remote host closed the connection) |
20:12:24 | TomDotTom | deech: Alongside 'dumpTree' there's I've recently discovered 'treeRepr' which is a bit more useful if you wish to test your macros https://play.nim-lang.org/#ix=2Bip |
20:12:52 | TomDotTom | FFS, that was awfully written. But you get the gist. |
20:12:58 | * | jxy joined #nim |
20:13:10 | FromDiscord | <Yardanico> Well treeRepr is like dumpTree, but for NimNodes in macros instead of normal code blocks |
20:13:37 | TomDotTom | It also returns a string instead of echoing to console |
20:13:57 | TomDotTom | You can just us `quote do:` to send the ast into `treeRepr` |
20:19:11 | FromDiscord | <ElegantBeef> We are also missing `nimNode.repr` which dumps readable nimcode |
20:19:58 | FromDiscord | <ElegantBeef> Although the AST may be incorrect so the readable code, but not compileable |
20:20:09 | FromDiscord | <Yardanico> why missing |
20:20:15 | FromDiscord | <Yardanico> I know about it :) |
20:20:25 | FromDiscord | <ElegantBeef> I mean we're talking about reprs and not talking about the nice one 😛 |
20:20:38 | FromDiscord | <Yardanico> lispRepr is the nicest of them all |
20:21:02 | disruptek | what is bat? vietnamese currency? |
20:21:04 | FromDiscord | <ElegantBeef> Does that just convert it to polish notation? |
20:21:38 | FromDiscord | <Yardanico> @disruptek one of those zoomer "cryptocurrencies" |
20:21:38 | disruptek | i don't like parsing ast. i would rather just do it from scratch. |
20:21:55 | disruptek | the api seems to work pretty well to me. |
20:21:56 | FromDiscord | <ElegantBeef> You'd rather use MIT's scratch? |
20:22:10 | FromDiscord | <Yardanico> Brave blocks all website ads, and if you enable in settings, it'll start giving you ads in notifications instead, and "pay" with BAT |
20:22:24 | FromDiscord | <Yardanico> It's own ads in notifications i mean |
20:22:29 | disruptek | what is bat? vietnamese currency? |
20:22:45 | FromDiscord | <Yardanico> batsoup |
20:22:52 | FromDiscord | <ElegantBeef> Nah the main ingredient in coronavirus soup |
20:22:55 | disruptek | oh, vietnamese culinary? |
20:22:59 | FromDiscord | <scott> BAT is a joke of a Cryptocurrency |
20:23:08 | FromDiscord | <ElegantBeef> So it's cryptocurrency? 😛 |
20:23:14 | FromDiscord | <scott> Exactly! |
20:23:53 | FromDiscord | <ElegantBeef> Disruptek did you see what i named my name mangling variable? |
20:24:04 | disruptek | your what? |
20:24:24 | FromDiscord | <Innokentiy Sokolov> instead of being just a normal browser Brave tries to invent a thing no one asked for |
20:24:26 | FromDiscord | <ElegantBeef> I'm mangling proc names for nimscript since i'm now using strings as the only method of interop |
20:24:40 | FromDiscord | <ElegantBeef> So i've got a variable entitled "disrupteksAnger" which stores the mangling |
20:25:00 | disruptek | sounds about right, but be aware: disrupteksAnger usually leaks. |
20:25:09 | FromDiscord | <ElegantBeef> Nah you're thinking of his nappy |
20:25:18 | disruptek | disrupteksPampers |
20:26:34 | FromDiscord | <ElegantBeef> I really should see if the body of an VM implemented routine's written body is called, cause that'd make my mangling redundant, but i didnt think of that until after i implemented the mangling |
20:26:40 | FromDiscord | <scott> is `float` an alias for `float32`, `float64`, or architecture-dependent? |
20:26:50 | FromDiscord | <ElegantBeef> same as int depends on the arch |
20:27:02 | FromDiscord | <scott> perfect that's great |
20:27:07 | FromDiscord | <Clyybber> disruptek: suck my vietnamese currency |
20:27:25 | FromDiscord | <ElegantBeef> Hah get it cause it's dong |
20:27:46 | disruptek | oh, it's thailand i'm thinking of. |
20:27:55 | disruptek | jesus. you'd think i wasn't a rare coin dealer. |
20:28:02 | FromDiscord | <Yardanico> @ElegantBeef no you're wrong :) |
20:28:08 | FromDiscord | <Yardanico> @scott it's always 64 bit |
20:28:17 | FromDiscord | <Yardanico> float is the same as float64 |
20:28:20 | disruptek | yeah. |
20:28:40 | FromDiscord | <ElegantBeef> well that's a useless description https://media.discordapp.net/attachments/371759389889003532/767846688898547752/unknown.png |
20:28:43 | FromDiscord | <scott> why's that? |
20:29:36 | FromDiscord | <scott> at least it's not as bad as Crystal's "let's use `Int32` for indexes and pointer sizes because why not?" |
20:30:00 | disruptek | heh |
20:30:03 | disruptek | that's awesome. |
20:30:11 | FromDiscord | <Rika> Lol |
20:30:12 | FromDiscord | <Clyybber> @Yardanico No, float is 32 bit on 32bit systems |
20:30:20 | FromDiscord | <Yardanico> @Clyybber ?? |
20:30:28 | FromDiscord | <Yardanico> Wat |
20:30:34 | FromDiscord | <ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/767847177782951936/unknown.png |
20:30:35 | disruptek | i think you're wrong. |
20:30:43 | disruptek | iirc it's always 64bit. |
20:30:46 | FromDiscord | <Yardanico> ^^ |
20:30:47 | FromDiscord | <Clyybber> oh, yeah. Sorry |
20:30:52 | FromDiscord | <Rika> Why? |
20:30:59 | FromDiscord | <ElegantBeef> It's inconsistant, that's why! |
20:31:12 | disruptek | i don't know why. or, maybe i did but i forget. |
20:31:36 | FromDiscord | <ElegantBeef> What library do i attempt to use nimscript on now, fidget? 😄 |
20:32:25 | FromDiscord | <Clyybber> semtypes:1990 seems to suggest its size can still vary |
20:32:25 | FromDiscord | <scott> TBF using different sizes per architecture is more complicated to code, and leaves a lot more edge cases than just making less common architectures slower |
20:32:47 | FromDiscord | <ElegantBeef> Less common, please if you're running a 32bit cpu, you can just leave 😛 |
20:32:48 | FromDiscord | <Avatarfighter> fidget for sure Beef |
20:33:01 | * | Kaivo quit (Ping timeout: 260 seconds) |
20:33:02 | FromDiscord | <Clyybber> yeah, I'm pretty sure its still arch dependent |
20:33:03 | FromDiscord | <Avatarfighter> Rip my 16bit cpu |
20:33:14 | FromDiscord | <scott> I was more thinking of ARMv7 and embedded (even 16-bit) examples |
20:33:15 | FromDiscord | <Clyybber> its just that floatSize is set to 64 bit for most archs |
20:33:15 | FromDiscord | <ElegantBeef> we dont even have halfs in nim |
20:33:16 | * | TomDotTom quit (Quit: leaving) |
20:33:21 | FromDiscord | <Clyybber> but try it on avr, it will be 32bit |
20:33:30 | FromDiscord | <scott> Nim compiles to AVR?? |
20:33:32 | FromDiscord | <scott> NICE |
20:33:48 | disruptek | oh it's 64bit on common 32bit arch? |
20:33:55 | FromDiscord | <Clyybber> yeah |
20:34:00 | disruptek | that makes more sense. |
20:34:26 | FromDiscord | <Clyybber> whats a bit crazy is that float64 is also 32bit on avr, I think |
20:34:27 | disruptek | cool feature, actually. |
20:34:34 | FromDiscord | <Clyybber> don't believe me though, I didn't test that |
20:35:26 | * | Kaivo joined #nim |
20:36:21 | FromDiscord | <Clyybber> welp, looks like I'm right |
20:36:29 | FromDiscord | <Clyybber> thats, ugh, is that intended |
20:39:23 | disruptek | dom96 will let us know. |
20:50:14 | FromDiscord | <ElegantBeef> @Avatarfighter hey it works https://media.discordapp.net/attachments/371759389889003532/767852128345260042/unknown.png |
20:50:24 | FromDiscord | <ElegantBeef> No templates though, but ehhh |
20:50:32 | FromDiscord | <Avatarfighter> im so excited |
20:50:58 | FromDiscord | <ElegantBeef> Need to get the vm to boot up quicker though |
20:51:10 | FromDiscord | <Avatarfighter> threaten to make it run on 16bits |
20:51:14 | FromDiscord | <ElegantBeef> It's quicker to compile this program then run revaluate |
20:51:19 | FromDiscord | <scott> what is the "vm"? |
20:51:28 | FromDiscord | <Avatarfighter> nim has a vm that runs nimscript |
20:51:31 | FromDiscord | <ElegantBeef> Nim has a virtual machine for interpreting code at runtime |
20:51:35 | FromDiscord | <Avatarfighter> ^ |
20:51:40 | FromDiscord | <ElegantBeef> I mean compile |
20:51:46 | FromDiscord | <Avatarfighter> ^ |
20:51:59 | FromDiscord | <scott> oh ok so that doesn't have an effect on runtime, right? |
20:52:05 | FromDiscord | <ElegantBeef> But it can also be used as a standalone interpreted subset of nim |
20:52:17 | FromDiscord | <ElegantBeef> Nope unless you make an interop between the two like i've been working on |
20:52:20 | FromDiscord | <scott> ooh, interesting |
20:52:50 | FromDiscord | <ElegantBeef> The past few days i've been making the nim <-> nimscript interop very easy so you can just annotate procs then call them from nimscript |
20:53:14 | FromDiscord | <ElegantBeef> So you can have scriptable behaviour in your programs, for configuration or what have you |
20:53:53 | FromDiscord | <Avatarfighter> I forget if you told me no to this just im assuming i cant feed nimvm code to execute on the fly right? |
20:54:04 | FromDiscord | <ElegantBeef> What do you mean? |
20:54:22 | * | nature joined #nim |
20:54:41 | disruptek | frosty really would be an improvement here. but even better would be a way to share pointers. |
20:54:45 | FromDiscord | <Avatarfighter> I need to think of how to phrase this |
20:55:00 | FromDiscord | <ElegantBeef> Yea disruptek using json makes me sad |
20:55:14 | FromDiscord | <Clyybber> disruptek: The issue is that the VM represents objects as PNodes |
20:55:17 | FromDiscord | <ElegantBeef> plus cant use tuples |
20:55:27 | FromDiscord | <ElegantBeef> Since the json cannot serialize tuples |
20:55:33 | FromDiscord | <Clyybber> patch json? |
20:55:34 | * | arecacea1 quit (Remote host closed the connection) |
20:55:40 | disruptek | stop. i can only get so hard. |
20:56:15 | FromDiscord | <ElegantBeef> Right now the most annoying thing is the 4-5 second interpreter startup time |
20:56:38 | disruptek | bentley is looking at me funny. |
20:56:38 | disruptek | he gets the same look before his 45 minute ball-licking sessions. |
20:56:39 | disruptek | pffbt, it takes like 100ms to start the vm. |
20:56:42 | * | arecacea1 joined #nim |
20:56:50 | FromDiscord | <Avatarfighter> Can the interpreter interpret code during runtime? |
20:56:56 | disruptek | when else? |
20:56:59 | FromDiscord | <Avatarfighter> interpret new code specifically |
20:57:06 | FromDiscord | <ElegantBeef> Well you have to revaluate the script |
20:57:07 | FromDiscord | <ElegantBeef> So yes |
20:57:11 | FromDiscord | <Avatarfighter> 😮 |
20:57:16 | FromDiscord | <ElegantBeef> That's the entire point of this |
20:57:18 | FromDiscord | <Avatarfighter> yeah |
20:57:20 | disruptek | jesus. |
20:57:35 | FromDiscord | <ElegantBeef> But you cant just add code and it run new code without any hiccups |
20:57:40 | FromDiscord | <Avatarfighter> yeah ofc |
20:57:41 | disruptek | i picked the wrong week to give up drinking. |
20:57:46 | FromDiscord | <Avatarfighter> wowwww |
20:58:04 | FromDiscord | <ElegantBeef> This would be pointless if you couldnt reload the nimscript at runtime 😄 |
20:58:24 | FromDiscord | <ElegantBeef> You even seen the video where i reloaded nimscript! |
20:58:29 | FromDiscord | <Avatarfighter> yeah true |
20:58:30 | FromDiscord | <Avatarfighter> lol |
20:58:38 | FromDiscord | <Avatarfighter> I'm going to see if i can stream a program to nimvm then |
20:58:49 | FromDiscord | <Avatarfighter> you've encouraged me beef |
20:58:53 | disruptek | i swear my face got larger overnight. |
20:59:08 | disruptek | i have more face than ever before, is what i'm saying. |
20:59:21 | FromDiscord | <Avatarfighter> just cut the excess off disruptek |
20:59:23 | FromDiscord | <Clyybber> face your demons |
20:59:30 | nature | What are the goto frontend libs/frameworks ? I just finished building my own ssg with Nim and now I want to build a more frontendy project |
20:59:33 | disruptek | why? |
20:59:38 | disruptek | why wouldn't i want more of me? |
20:59:48 | disruptek | what is a ssg? |
20:59:51 | FromDiscord | <Avatarfighter> Beef: I assumed that it would be like Python's interpreter where you can't exactly reload the main module lol |
20:59:59 | nature | static site generator :) |
21:00:04 | disruptek | oh right. |
21:00:24 | disruptek | i think people use prologue. |
21:00:27 | disruptek | !repo prologue |
21:00:27 | disbot | https://github.com/planety/prologue -- 9prologue: 11Prologue is an elegant web framework written in Nim. 15 458⭐ 19🍴 7& 5 more... |
21:00:34 | nature | It's really simple but does what I need |
21:00:41 | disruptek | good. |
21:00:47 | disruptek | that sounds like a good product. |
21:00:54 | FromDiscord | <Avatarfighter> Karax is a good frontend framework |
21:01:00 | FromDiscord | <Avatarfighter> Prologue is more backend imo |
21:01:48 | FromDiscord | <ElegantBeef> I forgot fidget efficiently drawed where it doesnt update unless active(atleast iirc), so it's not as bad as i thought |
21:02:01 | FromDiscord | <ElegantBeef> Also built it in danger |
21:02:04 | FromDiscord | <ElegantBeef> https://streamable.com/tbqekw |
21:02:17 | FromDiscord | <Avatarfighter> https://giphy.com/gifs/funny-spongebob-im-ugly-and-proud-11FkKmUdZxxlJu |
21:02:20 | FromDiscord | <Avatarfighter> ^ my code |
21:02:26 | nature | Thanks disruptek I like that philosophy, yeah I was checking out karax, seems interesting |
21:03:03 | FromDiscord | <ElegantBeef> Who needs figma now? 😄 |
21:03:09 | disruptek | that looks good. |
21:03:51 | FromDiscord | <Avatarfighter> nature: karax is great. I prefer ReactJS over it though just because components are broken in Karax |
21:03:56 | Prestige | @Ele nice |
21:04:10 | FromDiscord | <ElegantBeef> You need the entire name iirc now 😛 |
21:04:19 | Prestige | nooooooooooooooooooooo fuck |
21:04:31 | * | tane quit (Quit: Leaving) |
21:04:34 | FromDiscord | <Avatarfighter> did Yard fix the edge case with someone with spaces in their tag? |
21:04:41 | FromDiscord | <ElegantBeef> Yea by making it dumber |
21:04:45 | Prestige | ElegantBeef: Come be an irc user :P |
21:04:48 | FromDiscord | <ElegantBeef> But it makes it less error prone |
21:05:13 | * | ElegantBeef joined #nim |
21:05:18 | ElegantBeef | Ew how did i get here |
21:05:23 | FromDiscord | <Avatarfighter> ew |
21:05:25 | FromDiscord | <Avatarfighter> come back |
21:05:33 | ElegantBeef | I want help, i'm begging for help, this is not a dance |
21:05:37 | FromDiscord | <Clyybber> ew split yourself |
21:05:42 | Prestige | Side note ElegantBeef I like your WM theme |
21:05:51 | FromDiscord | <ElegantBeef> Thanks it's stock regolith |
21:06:02 | FromDiscord | <tomck> You can do single page apps in nim @Avatarfighter ? |
21:06:07 | FromDiscord | <tomck> Have you tried? |
21:06:15 | FromDiscord | <Avatarfighter> Yeah you can |
21:06:16 | FromDiscord | <ElegantBeef> And cause of regolith it applies to all gtk applications so consistant ayu-mirage https://media.discordapp.net/attachments/371759389889003532/767856159645237278/unknown.png |
21:06:22 | FromDiscord | <Avatarfighter> @tomck |
21:06:24 | FromDiscord | <Avatarfighter> !repo karax |
21:06:25 | disbot | https://github.com/pragmagic/karax -- 9karax: 11Karax. Single page applications for Nim. 15 608⭐ 50🍴 7& 14 more... |
21:07:03 | FromDiscord | <Avatarfighter> Its a great framework, really easy to work with once you're used to how it works though components have been broken for what seems like a year. |
21:08:29 | FromDiscord | <ElegantBeef> Hmm wonder how to work around templates |
21:08:48 | FromDiscord | <ElegantBeef> Dont think it's really possible |
21:09:08 | FromDiscord | <Avatarfighter> just write inefficient code to do the same thing as the templates |
21:09:13 | FromDiscord | <Avatarfighter> easy /s |
21:09:16 | FromDiscord | <ElegantBeef> Well that's not automated |
21:09:27 | FromDiscord | <Avatarfighter> What are you trying to do? |
21:09:34 | FromDiscord | <ElegantBeef> Use fidget |
21:09:38 | FromDiscord | <ElegantBeef> It heavily uses templates |
21:09:43 | FromDiscord | <Avatarfighter> ah |
21:09:52 | nature | I recently checked out svelte, anybody tried to do something like that in Nim ? It seems Nim is kind of adapted to this kind of application |
21:10:15 | FromDiscord | <Avatarfighter> this ? |
21:10:17 | FromDiscord | <Avatarfighter> https://svelte.dev/ |
21:10:21 | nature | yeah |
21:10:31 | nature | compiling to js is a thing in Nim |
21:10:42 | FromDiscord | <ElegantBeef> Fidget is an interesting method of doing webdev |
21:10:53 | nature | I was wondering if anybody tried this |
21:10:57 | FromDiscord | <ElegantBeef> Doesnt use dom objects though uses webgl rendering |
21:11:11 | FromDiscord | <Avatarfighter> I haven't but I don't see why that would be difficult in nim |
21:11:59 | nature | Isn't webgl a bit heavy if you want to do simple web stuff ? |
21:12:17 | FromDiscord | <Recruit_main707> nimprof does not rely on the gc and can work with gc:none right? |
21:12:35 | nature | @Avatarfighter me neither, I just saw a french girl apparently attempted something based off of Svelte 2 |
21:12:55 | FromDiscord | <Avatarfighter> ooo |
21:14:12 | nature | http://mildred.fr/en/quick-posts/2020-04-30-svelte-with-nim/ |
21:16:26 | FromDiscord | <Avatarfighter> thanks for the link |
21:40:49 | * | filcuc quit (Ping timeout: 272 seconds) |
21:44:33 | * | shinzo left #nim (#nim) |
21:45:43 | FromGitter | <ynfle> Is there a way to initialize an `array` with a value other than a loop and `sequtils`? |
21:46:19 | disruptek | yep. |
21:46:31 | Prestige | see https://nim-by-example.github.io/arrays/ |
21:46:44 | Prestige | or https://nim-by-example.github.io/arrays/ |
21:46:51 | Prestige | woops. https://nim-lang.org/docs/tut1.html#advanced-types-arrays |
21:46:53 | FromDiscord | <Rika> Isn't that the same link |
21:47:05 | Prestige | copy didn't go off |
21:48:26 | FromGitter | <ynfle> Without explicitly writing out each element like initialize all the values to 5? |
21:50:23 | * | kenran joined #nim |
21:50:26 | FromGitter | <ynfle> Something like `newSeqWith` |
21:52:46 | FromDiscord | <Yardanico> https://nim-lang.org/docs/algorithm.html#fill%2CopenArray%5BT%5D%2CT |
21:52:50 | FromGitter | <ynfle> `fill` (https://nim-lang.org/docs/algorithm.html#fill%2CopenArray%5BT%5D%2CT) 👍 |
21:52:57 | FromDiscord | <Yardanico> Heh |
21:53:01 | FromGitter | <ynfle> Just got it thanks |
21:55:36 | * | kenran quit (Ping timeout: 272 seconds) |
21:58:32 | fowl | ynfle: https://nim-lang.org/docs/sequtils.html#repeat%2CT%2CNatural |
22:01:16 | * | abm quit (Read error: Connection reset by peer) |
22:02:13 | * | solitudesf quit (Ping timeout: 246 seconds) |
22:02:19 | FromDiscord | <Yardanico> That was already linked :) and it's not for arrays |
22:03:25 | * | nature quit (Ping timeout: 240 seconds) |
22:05:45 | * | lbart quit (Read error: Connection reset by peer) |
22:06:16 | * | lbart joined #nim |
22:06:16 | * | lbart quit (Changing host) |
22:06:16 | * | lbart joined #nim |
22:24:00 | FromDiscord | <Yardanico> First message in the discord server is someone's curious (although IRC logs go much older) https://discord.com/channels/371759389889003530/371759389889003532/371762716940959755 |
22:35:22 | ForumUpdaterBot | New thread by Doofenstein: Views of a non thread local var, see https://forum.nim-lang.org/t/6957 |
22:37:02 | * | Vladar quit (Quit: Leaving) |
22:39:30 | FromDiscord | <neow> any way to uninstall a nim version in choosenim? |
22:41:22 | ForumUpdaterBot | New thread by Jackhftang: How to avoid deprecation notice for libraies supporting multi-version of Nim?, see https://forum.nim-lang.org/t/6958 |
22:41:57 | FromDiscord | <neow> nevermind, I can just delete them in ~/.choosenim |
22:54:42 | FromGitter | <ynfle> is there a way to concatenate a string with an if expression? like `"a" & if 2 == 2: $1 else: $5`? |
22:56:38 | Prestige | https://play.nim-lang.org/#ix=2Bjf |
22:56:43 | Prestige | @ynfle |
22:57:31 | FromGitter | <ynfle> Thanks |
22:57:36 | Prestige | or you can use &= to make it shorter |
22:57:38 | FromGitter | <ynfle> Why does it need to wrapped? |
22:57:38 | Prestige | Np |
22:57:51 | FromGitter | <ynfle> I tried `&=` but didn't work |
22:58:12 | Prestige | https://play.nim-lang.org/#ix=2Bjg |
22:58:29 | FromGitter | <ynfle> Nvm I meant I tried it without the brackets |
22:58:38 | FromGitter | <ynfle> > Why does it need to wrapped? ⏎ ⏎ ☝️ |
22:59:07 | FromDiscord | <Yardanico> because otherwise it can be ambiguous |
22:59:11 | Prestige | I think ambiguity? Not sure |
22:59:14 | FromDiscord | <Yardanico> With indentation you clearly separate stuff |
22:59:21 | FromDiscord | <Yardanico> but without it you have to use parens |
23:00:07 | FromGitter | <ynfle> I guess `elif` with nested `if` exprs |
23:00:09 | FromGitter | <ynfle> Makes sense |
23:07:07 | FromDiscord | <neow> I don't see the ambiguity either tbh |
23:13:07 | federico3 | https://thenewstack.io/which-programming-languages-use-the-least-electricity/ |
23:13:31 | federico3 | this should be updated with Nim |
23:17:00 | FromDiscord | <Yardanico> Computer language benchmarks game is honestly not a good pick for a comparison like that |
23:17:21 | FromDiscord | <Yardanico> Well maybe it is, but you're testing the performance of the language AND speed of the implementation |
23:17:41 | disruptek | how else? |
23:17:47 | FromDiscord | <Yardanico> Some are single threaded, some utilize all cores, some do vectorization, etc |
23:17:58 | FromDiscord | <tomck> we need large benchmarks, like whole programs |
23:18:00 | FromGitter | <gogolxdong> will it be lower than C |
23:18:13 | FromDiscord | <tomck> the problem is that you can hyper optimise benchmarks to not reflect the 'default' usage of the language |
23:18:18 | FromDiscord | <Yardanico> Yeah |
23:18:29 | FromDiscord | <tomck> i'm sure you could get java to run within 2x of c++, but your 'normal java' is going through 80 stack frames with 40 virtual calls |
23:18:33 | FromDiscord | <Yardanico> Did you ever look at Rust code in CLBG? |
23:18:39 | FromDiscord | <Yardanico> it's unreadable mess |
23:18:45 | disruptek | we took one of these benchmarks and rewrote it idiomatically and it was faster. |
23:18:57 | FromDiscord | <Yardanico> Havlak? |
23:19:03 | disruptek | i forget which one it was. i did it more than a year ago. |
23:19:07 | FromDiscord | <tomck> Yeah i can imagine, you have to dive into unsafe & weird rust to get it to run on par w/ c |
23:19:14 | disruptek | but it was around 3x faster idiomatic nim. |
23:19:30 | federico3 | of course, all benchmarks need to be taken with a big pinch of salt |
23:19:48 | disruptek | sure. but idiomatic nim is generally pretty quick. |
23:20:01 | FromDiscord | <shashlick> @neow there's a new remove command in the latest version |
23:23:41 | FromDiscord | <leorize> disruptek: unless you use sequtils, ofc |
23:23:48 | FromDiscord | <leorize> also matrix is acting weird again |
23:24:34 | FromDiscord | <tomck> is sequtils slow? |
23:24:44 | FromDiscord | <tomck> I use that all the time, does it copy all the time? I was suspecting it did |
23:25:04 | FromDiscord | <leorize> yes it does, that's the price of functional programming |
23:25:12 | disruptek | lol |
23:25:18 | FromDiscord | <tomck> Only found out about zero_functional after i'd put a load of chained mapIt in |
23:25:25 | FromDiscord | <tomck> rust seems to handle it alright |
23:25:38 | disruptek | i think it's sarcasm. |
23:25:49 | FromDiscord | <tomck> oh |
23:26:10 | FromDiscord | <leorize> with `dup` and `with` the next strutils will be faster |
23:26:18 | FromDiscord | <leorize> sequtils is fast if you just use the mutating procs |
23:26:56 | disruptek | allocs are expensive, not gonna lie. |
23:28:13 | FromDiscord | <leorize> at least in Nim they're predictable though |
23:28:33 | disruptek | and relative to many other languages, they are cheap. |
23:28:45 | FromDiscord | <leorize> one of the small perks of having an O(1) allocator |
23:29:01 | FromDiscord | <leorize> I've never actually benchmarked the throughput, I expect us to trail behind others actually |
23:29:35 | FromDiscord | <leorize> you rarely have both "consistent" and "fast". |
23:29:46 | FromDiscord | <tomck> can you chain the mutating procs? |
23:29:55 | disruptek | yeah. |
23:30:04 | FromDiscord | <tomck> I don't really understand when copies happen, if i chain two mapIt does that allocate twice? |
23:30:14 | FromDiscord | <Yardanico> mapIt creates a new seq |
23:30:19 | FromDiscord | <Yardanico> Out of the old one |
23:30:24 | FromDiscord | <Yardanico> Second one will do that again |
23:30:29 | FromDiscord | <leorize> `import std/with` and chaining mutating proc is possible 🙂 |
23:30:48 | FromDiscord | <leorize> `with` is like one of the best features of 1.2 |
23:31:27 | leorize[m] | at least in Nim they're predictable though |
23:31:29 | FromDiscord | <Yardanico> And yet it's not in lib.html on 1.4 :) |
23:31:29 | disruptek | eh. |
23:31:41 | disruptek | i think arc was the killer feature of 1.2. 😁 |
23:31:44 | Prestige | I like `with` quite a bit |
23:32:07 | FromDiscord | <leorize> arc is fine but `with` and `dup` brought some serious ergonomics to the table 😛 |
23:32:14 | disruptek | it's pretty rare that i have code that i don't want to run on 1.0. |
23:33:00 | FromDiscord | <Yardanico> I really think we should extend the docs for it https://nim-lang.org/docs/with.html |
23:33:12 | disruptek | i should make a `future` library. |
23:33:17 | FromDiscord | <Yardanico> It's almost impossible to discover too |
23:33:22 | FromDiscord | <Yardanico> unless you know what you're searching for |
23:33:50 | Prestige | `using` is also nice to have |
23:33:59 | disruptek | see, i don't like using. |
23:34:04 | FromDiscord | <Yardanico> well it existed since long time |
23:34:10 | disruptek | not my problem. |
23:34:30 | FromDiscord | <Yardanico> I wasn't replying to you |
23:34:35 | disruptek | i don't care. |
23:34:58 | FromDiscord | <Clyybber> I like it |
23:35:04 | FromDiscord | <Clyybber> not my problem :p |
23:35:14 | FromDiscord | <tomck> ohhhhhh `with` is super cool |
23:35:22 | disruptek | clyybber: does cps work? |
23:35:28 | FromDiscord | <Clyybber> shush |
23:35:33 | FromDiscord | <Clyybber> probably not |
23:36:19 | Yardanico | also some people might like enumerate |
23:36:22 | Yardanico | which now exists in stdlib |
23:37:00 | Yardanico | it's just kind of hard to have 3 modules for with/dup/enumerate |
23:37:10 | Yardanico | (i know dup is in sugar) |
23:37:18 | Yardanico | any reason why with and/or enumerate aren't in sugar btw? |
23:37:47 | FromDiscord | <leorize> no idea but when did we gain enumerate? I didn't know about that one 😛 |
23:37:59 | Yardanico | https://nim-lang.org/docs/enumerate.html |
23:38:24 | Yardanico | it wasn't added to the changelog |
23:38:26 | Yardanico | but in 1.4 |
23:38:29 | Yardanico | https://github.com/nim-lang/Nim/pull/15297 |
23:38:30 | disbot | ➥ add `enumerate` macro |
23:38:39 | FromDiscord | <leorize> we need better changelogs 😛 |
23:39:17 | Yardanico | IMO different modules make it a bit harder to discover and use these macros |
23:39:24 | disruptek | should just generate them in gh action. |
23:39:41 | FromDiscord | <leorize> ask Araq, it seems that narimiran moved it on his request |
23:40:07 | leorize[m] | disruptek: we need to get the API diff thingy working if you want that to work |
23:40:27 | disruptek | why? i don't mind a detail section with all the PRs at least. |
23:41:20 | leorize[m] | actually Yardanico, nimfind can map a Nim project API into an SQLite database. Do you wanna try figuring out if those are diff-able? |
23:42:24 | FromDiscord | <Clyybber> I think with can be moved into sugar now, it wasn't before because Araq doubted its usefulness AFAIR |
23:42:46 | FromDiscord | <Clyybber> You can then replace the original with module with `from sugar import with; export with` |
23:51:15 | FromDiscord | <exelotl> I always wondered why it wasn't in `sugar` lol |
23:51:16 | * | kenran joined #nim |
23:56:28 | * | kenran quit (Ping timeout: 260 seconds) |