<< 19-10-2020 >>

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:24FromDiscord<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:55beanieheyo
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:08disrupteki'm not sure about you.
01:12:31*Tanger joined #nim
01:22:33leorize[m]Prestige: you forgot the echo :P
01:23:05PrestigeI did, saw it and was like: fuck. I give up
01:23:20Prestige!eval echo "!eval echo \"echo\""
01:23:23NimBot!eval echo "echo"
01:23:32leorize[m]!eval echo "!eval echo \"echo\""
01:23:34NimBot!eval echo "echo"
01:23:48leorize[m]yea nimbot is set to ignore itself :P
01:23:59Prestigenow 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:12FromDiscord<Rika> lol @Yardanico it matched and pinged "someone"
01:52:16*Onionhammer joined #nim
01:53:16Prestigeoh no
01:53:30Prestigeis it because my :P
01:57:51disruptekpretty sure this time it's not the fault of your tongue.
01:58:31Prestigedisruptek: it always is.
01:58:45Prestigebut real talk, it's because of the trailing colon I'm pretty sure
02:01:11disruptekso you're saying it's the fault of your tongue trailing your colon?
02:01:43*TomDotTom quit (Ping timeout: 246 seconds)
02:04:07Prestigeseems like it. Need to open a bug report
02:14:24*krux02 quit (Remote host closed the connection)
02:18:46FromDiscord<iWonderAboutTuatara> !eval import sequtils↵let m = (1..72).toSeq↵for i in m:↵ echo i
02:18:48NimBotCompile failed: /usercode/in.nim(1, 23) Error: invalid module name: 'sequtils↵let m'
02:19:06FromDiscord<iWonderAboutTuatara> (edit) "sequtils↵let" => "sequtils;↵let" | "(1..72).toSeq↵for" => "(1..72).toSeq;↵for"
02:19:11FromDiscord<iWonderAboutTuatara> !eval import sequtils;↵let m = (1..72).toSeq;↵for i in m:↵ echo i
02:19:13NimBotCompile failed: /usercode/in.nim(1, 17) Error: undeclared identifier: '↵let'
02:19:39FromDiscord<iWonderAboutTuatara> (edit) "!eval import sequtils;↵let" => "!eval↵let"
02:19:44FromDiscord<iWonderAboutTuatara> !eval↵let m = (1..72).toSeq;↵for i in m:↵ echo i
02:20:11FromDiscord<iWonderAboutTuatara> !eval for I in 0..15: echo I
02:20:14NimBot0↵1↵2↵3↵4↵5↵6↵7↵8↵9↵10↵11↵12↵13↵14↵15
02:20:33FromDiscord<iWonderAboutTuatara> !eval for I in 0..150: echo I
02:20:35NimBot0↵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:44FromDiscord<iWonderAboutTuatara> So there is a cutoff
02:22:32Prestige@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:03FromDiscord<scott> is there any way to statically ensure a proc won't raise?
05:16:04FromGitter<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:00FromDiscord<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:53FromDiscord<Rika> {.raises: [].} before the = of the proc name
05:17:58FromDiscord<Rika> i mean signature
05:18:05leorize[m]@scott use it like this: `{.raises: [].}`
05:18:14FromDiscord<scott> nice
05:18:26leorize[m]by default Nim will infer and populate `{.raises.}` for you
05:18:36leorize[m]by specifying it you restrict the set
05:18:56leorize[m]a nice package to use in conjunction with `{.raises: [].}` is nim-result
05:18:57FromDiscord<scott> yes, that's great. Very intuitive.
05:18:59leorize[m]!repo result
05:18:59disbothttps://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:53FromDiscord<Rika> i still dont know why dis.rup.tek doesnt like this package
05:20:27leorize[m]just diff it against his badresults
05:22:34FromDiscord<scott> idk result type and exceptions both have their places IMO
05:23:05FromDiscord<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:25leorize[m]yea, the result type thingy has convenience macros for you to package a exception into Result[T]
05:23:37leorize[m]and we do have None, it's in the options module
05:24:03leorize[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:24FromDiscord<scott> I've been kinda scared to ask...is Nim compile-time nil-safe?
05:24:30leorize[m]nope
05:24:32leorize[m]not yet
05:24:35FromDiscord<scott> 😦
05:24:43leorize[m]it's WIP
05:24:45leorize[m]!pull nil checking
05:24:47disbothttps://github.com/nim-lang/Nim/pull/13163 -- 3add error-checked version of walkDir 7& 27 more...
05:24:50FromDiscord<scott> oh well as long as it's not ruled out because legacy
05:25:01leorize[m]oops not that
05:25:10FromDiscord<scott> Java/C++ optional just makes me throw up my hands in frustration haha
05:25:31leorize[m]#15287
05:25:32disbothttps://github.com/nim-lang/Nim/pull/15287 -- 3Nil type check implementation
05:26:09leorize[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:20leorize[m]and it's not really that ergonomic
05:26:25FromDiscord<scott> holy crap that's a lot of commits haha
05:26:30leorize[m]the upcoming implementation should solve all that
05:27:06FromDiscord<scott> won't that break a lot of libraries to suddenly enable that? Or will it be some kinda opt-in scenario?
05:27:57leorize[m]you should read the RFC behind it: https://github.com/nim-lang/RFCs/issues/250
05:27:58disbotType 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:37leorize[m]ergonomics is a big priority in Nim so every new feature/restrictions has to be designed with that in mind
05:32:55leorize[m]it seems to me that the nil check impl will be pretty easy to use
05:38:41FromDiscord<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:12FromDiscord<Avatarfighter> rip
05:41:24FromDiscord<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:55FromDiscord<19> hello, how can i run the generated c code in visual studio for debugging
06:30:03*user0 joined #nim
06:31:04FromDiscord<19> `nim cpp --cc:vcc --debugger:native source/main.nim`
06:38:14*PMunch joined #nim
06:44:09*Vladar joined #nim
06:47:16FromDiscord<scott> it should be in ~/.cache/nim
06:53:34*mwbrown joined #nim
07:03:49FromDiscord<Yardanico> @19 you don't need to "run" the C code itself
07:04:06FromDiscord<Yardanico> You can set breakpoints in Nim code just fine with debugger native
07:04:39FromDiscord<Yardanico> @Rika their fault :)
07:05:05FromDiscord<Rika> lmao
07:10:12*hyiltiz quit (Ping timeout: 272 seconds)
07:13:49FromDiscord<scott> is there a way to iterate over the lines of a string without creating an intermediate array of strings?
07:15:52FromDiscord<Rika> `for i in str.split():` afaik will not make an intermediate array
07:17:19FromDiscord<scott> oh, yes, I see now. Split is an iterator
07:21:58FromDiscord<19> @Yardanico i would like to use visual studio's debugger
07:22:10FromDiscord<scott> I just fixed this
07:22:23FromDiscord<19> and step through the C code and see the memory etc...
07:23:00FromDiscord<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:46FromDiscord<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:22FromGitter<jrfondren> https://play.nim-lang.org/#ix=2Be7 - am I testing this wrong? I get false for both uses of .split()
07:25:29FromDiscord<Rika> i dont understand why you are using unsafeaddr and casting
07:25:49FromDiscord<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:52FromDiscord<19> @scott very cool thanks for sharing, i will look into it
07:26:09FromDiscord<19> @scott wow that's awesome
07:26:32FromGitter<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:54FromDiscord<19> @scott the only reason i wanted to do that was to be able to debug in visual studio
07:27:05FromDiscord<scott> ah ok
07:27:16FromGitter<jrfondren> i.e., I am trying to test whether x is a slice of s or if the string was copied.
07:27:16FromDiscord<Rika> @jrfondrem the new strings are distinct from the original
07:27:18FromDiscord<Rika> this will not work
07:27:34FromDiscord<Rika> we do not currently do slicing'
07:27:37FromGitter<jrfondren> Rika: OK, but this is the opposite of what you just told scott
07:27:43FromDiscord<Rika> no it is not
07:27:50FromDiscord<Rika> we allocate new strings, but not a whole array of them
07:28:03FromGitter<jrfondren> ah, I see.
07:28:15newUserhi, 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:23FromDiscord<scott> would be nice if it did D-style slicing tho
07:28:28FromDiscord<Rika> we're working on it yes
07:28:47FromDiscord<Rika> afaik 1.6 will have it? im not sure, i dont even remmeber if it was planned for 1.4
07:28:54FromDiscord<scott> wow that's awesome
07:29:06FromDiscord<Rika> no guarantees on the version number
07:29:12FromDiscord<Rika> but i distinctly remember it being worked on
07:29:40FromDiscord<scott> no worries, I understand that these things take time. it's nice to see a steady development pace though
07:30:07Araqscott: Plus we cannot simply copy D's way as it's flawed
07:30:22FromDiscord<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:40FromDiscord<Rika> oh hey it is our lord ar/q
07:30:51FromDiscord<scott> newUser, there are extensions for that. Code runner or something
07:32:10FromDiscord<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:32FromDiscord<scott> Araq, this is the first I've heard of that, how is it broken?
07:32:37FromDiscord<Rika> yeah but not everyone leans that way
07:33:03newUser<scott> thx
07:35:44FromGitter<jrfondren> D slices certainly have a lot of weird corner cases that come in once you start resizing them.
07:36:52FromDiscord<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:54FromGitter<jrfondren> for something like .split() I'd refer Rust's &str vs. String distinction
07:38:07FromDiscord<scott> that's pretty disappointing. I found the way D's slices map to memory regions super intuitive
07:44:33FromDiscord<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:20FromDiscord<Rika> not that i know of, for now can you just show us?
07:45:31FromDiscord<scott> sure, just a sec
07:46:17FromDiscord<19> @scott thank you so much! the extension ROCKS
07:46:21Araqscott: there is no distinction between owning and non-owning slices
07:46:48FromDiscord<scott> @Rika https://play.nim-lang.org/#ix=2Be8
07:46:49Araqso you'd be left with a tracing GC to make it performant
07:47:12FromDiscord<scott> ah, yes, I see what you mean now
07:48:05FromGitter<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:25FromDiscord<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:30FromGitter<jrfondren> scott: if substitutions is const instead of let, it looks like you get past side effects into another problem.
07:49:37FromDiscord<Rika> @scott you can use const instead of let for substitutions i assume
07:49:42FromDiscord<scott> oh ok
07:50:02FromDiscord<Rika> ah no nv
07:50:03FromDiscord<Rika> m
07:50:20FromDiscord<scott> no it says it's an undeclared identifier now
07:50:25FromDiscord<Rika> yeah made a mistake
07:50:48FromDiscord<scott> I don't really care that much about it being a proper func I was just curious why this was happening
07:51:48FromGitter<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:06FromDiscord<Rika> yes, sorry, was busy with something else
07:52:10FromDiscord<scott> ah
07:52:27FromDiscord<Rika> if it were a const it would work, but `re` doesnt work in VM afaik so it cannot be
07:53:13FromGitter<jrfondren> I've heard nim-regex works at compile-time, if you need that.
07:53:50FromDiscord<Rika> its also nicer to use afaik, and prolly faster? dont quote me on that
07:54:24FromDiscord<Rika> also no pcre dependency if that matters to you
07:54:24FromDiscord<scott> not important in this case but that's good to know thanks
07:54:34FromGitter<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:56FromDiscord<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:20FromDiscord<Yardanico> @19 yes, exactly, you can do that from Nim code itself
08:07:51FromDiscord<Yardanico> If you set breakpoints in the Nim code and compile it with debugger native, it should work in VS debugger
08:07:54Araqjrfondren: pcre also uses a JIT these days, can be hard to beat
08:07:58FromDiscord<Yardanico> You don't need to open the C code
08:08:52newUserHow can I start a NimScript from VS Code (tasks.json?)?
08:09:32FromDiscord<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:46FromDiscord<19> is this what you are suggesting? sorry if i missunderstood
08:10:15FromDiscord<Yardanico> well, I meant that with debugger native you will be able to step through Nim source lines in the debugger
08:10:28FromDiscord<19> in visual studio?
08:10:45FromDiscord<Yardanico> it should work in any editor/ide with normal debugging support, yes
08:12:52FromDiscord<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:48FromDiscord<19> nim cpp --cc:vcc --debugger:native source/main.nim↵devnenv main.exe
08:13:54FromDiscord<scott> Did you set a breakpoint in the editor? (Red dot to the left of the line)
08:13:56FromDiscord<19> (edit) "source/main.nim↵devnenv" => "source/main.nim↵devenv"
08:14:15FromDiscord<19> im using visual studio not vs code
08:14:25FromDiscord<scott> Oh
08:14:26FromDiscord<Yardanico> You can do that in it as well
08:14:46FromDiscord<Yardanico> VS supports breakpoints as well obviously
08:14:59FromDiscord<Yardanico> But I've never used it with Nim personally, so I can't help much
08:15:13FromDiscord<Yardanico> But "opening the C code" for debugging is not the way
08:15:32FromDiscord<19> yeah i don't care about the C code if i can just debug the nim
08:15:48FromDiscord<19> if anyone has experience using VS with Nim please let me know :)
08:16:12FromDiscord<19> i can load the executable but i dont know how to invoke the nim source into VS
08:17:09AraqI did it successfully, but the major problem was that debuggers don't help me in debugging
08:17:54Araqfor a start, "step into" vs "step over" decisions eat up all my brain power
08:18:15Araqleaving none for debugging.
08:18:19FromDiscord<19> lol!
08:18:28FromDiscord<19> how do you go about it
08:20:03FromDiscord<19> i guess the vscode is good enough for now. was it too tedious to launch the nim source in VS?
08:21:11FromDiscord<19> the echo repr stuff in nim is really cool
08:21:33FromDiscord<Elegant Beef> I'm totally not abusing it for macros in the nimscript stuff i've been working on 😄
08:22:59FromDiscord<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:56Yardanico!status
08:27:58FromDiscordUptime - 15 hours and 51 minutes
08:29:08FromDiscord<Yardanico> @Elegant Beef Btw, I'd recommend you to replace space in your nickname with _ so you can be pinged :)
08:29:25FromDiscord<Elegant Beef> Does it use nicknames now?
08:29:35FromDiscord<Yardanico> i meant handle or whatever
08:29:40FromDiscord<Yardanico> But it does full match now
08:29:51Araq19: adding 'if condition: echo' statements to my code
08:30:03FromDiscord<Yardanico> @19 ^
08:30:26FromDiscord<ElegantBeef> There magic!
08:30:33Araqand the conditions can be pretty complex because I need heavy filtering, cannot wade through logs with thousands of lines
08:30:47FromDiscord<Yardanico> I do full match on 4 characters minimum, because there are people in our discord server with names like "you"
08:30:48AraqI mean, ok, I can. but it sucks
08:31:32Araqalso I have a set of debugging rules, the most important is, "the error is elsewhere"
08:31:34FromDiscord<Rika> and "someone" but lol theyre just asking for it
08:31:46FromDiscord<scott> @Araq ↵↵Structured logging + jq are amazing for this
08:32:45Araqscott: hmm yeah, sounds good. I don't use 'jq', I sometimes dump into an SQLite DB and run queries
08:32:48FromDiscord<scott> @Yardanico would filtering out dictionary words maybe work better?
08:32:59FromDiscord<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:02FromDiscord<Yardanico> @scott we decided to make it simpler
08:33:07FromDiscord<Yardanico> Not more complex
08:33:14FromDiscord<scott> Fair enough
08:33:48FromDiscord<Rika> yardanico what happened to that small experiment with the json thing regards some sorta debugger
08:34:10FromDiscord<Yardanico> Well, you can extend it if you want
08:34:16FromDiscord<Yardanico> Just output more json
08:34:27FromDiscord<Yardanico> I made one example which sits in their repo
08:37:03FromDiscord<Yardanico> https://github.com/hediet/vscode-debug-visualizer/blob/master/demos/nim/main.nim
08:37:10FromDiscord<Yardanico> https://github.com/hediet/vscode-debug-visualizer/tree/master/demos/nim
08:39:13FromDiscord<Yardanico> It just reads json data from the debugger and uses that
08:40:24Araq<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:06Araq(and back then C#'s dictionaries had no good toString implementation)
08:41:19Araqwas pretty smart but also a tool abuse :-)
08:47:04FromDiscord<Rika> lmao someone's also called "smart" in the discord
08:50:04FromDiscord<Yardanico> their fault
08:50:13FromDiscord<Yardanico> :))
08:50:28FromDiscord<Yardanico> most people in our discord channel don't even visit it after joining
08:50:32FromDiscord<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:38FromDiscord<Yardanico> We have 20-30% one week retention
08:51:03FromDiscord<malfong> sent a code paste, see https://play.nim-lang.org/#ix=2Bem
08:51:14FromDiscord<Yardanico> @malfong it's pointless to remove messages because they're relayed to irc
08:51:36FromDiscord<ElegantBeef> Stropping is a supported feature
08:51:42FromDiscord<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:45Araqmalfong: it's common, 'kind' is usually a better name than 'type' though
08:51:47FromDiscord<Yardanico> It's just harder to type and stuff
08:52:01Araqbut in wrappers `type` really is common
08:52:26FromDiscord<ElegantBeef> The stdlib doesnt strop much though i've only seen it for `div`
08:52:26FromDiscord<malfong> oh, I see! thx!!
08:53:14FromDiscord<ElegantBeef> So i just made a variable for mangling proc names entitled "disrupteksAnger", am i doing this right?
08:53:56FromDiscord<Rika> disrupteksAnger is way too volatile for mangling
08:54:01FromDiscord<Yardanico> :nimAngry:
08:59:50FromDiscord<ElegantBeef> Lol implementing the mangling ruined the interop
09:22:24Oddmongeri'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:40YardanicoOddmonger: it compiles
09:22:53Yardanicoit fails at runtime because playground doesn't support input (stdin)
09:23:00Yardanicoalso you're writing to stdin
09:23:04Yardanicoyou should write to stdout
09:23:08Oddmongeryes it compiles, but fails
09:23:15Yardanicobecause you're writing to stdin
09:23:35Oddmongerbut i tried on my computer, and i get an error too (bad file descriptor)
09:23:46Yardanicobecause you're writing to stdin :)
09:23:48Yardanicoyou can't do that
09:23:50Oddmongerah yes, sorry
09:23:55Yardanicohttps://play.nim-lang.org/#ix=2Bex
09:24:00Yardanicothis works on my computer just fine
09:25:46Oddmongerhum i don't understant the allocation of nxt.next, with the current object
09:26:22Yardanicowdym "allocation"
09:27:15Oddmongeryou see the line: nxt.next = f
09:27:33FromGitter<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:42Oddmongerf contains previous value
09:28:03Oddmongerthe next is not existing at this step
09:28:14Yardanicobut no one stops you from assinging nil
09:28:25Yardanicoand then making it something which is not nil
09:28:37Oddmongershouldn't be called «previous» ?
09:28:37FromGitter<jrfondren> nxt.next exists as soon as you new(nxt). you're never assigning to a nil .next
09:28:56Yardanicowell it doesn't really
09:29:02YardanicoI mean the field exists but it's a nil reference
09:29:37FromGitter<jrfondren> also cool, I didn't know there was another Nim book
09:29:45Yardanicowell it's not a full-blown "book" yet, but yes
09:29:59Yardanicoshould add it to https://nim-lang.org/learn.html I guess
09:30:35Oddmongeryes it's a good book with basic explainations
09:31:22FromDiscord<ElegantBeef> Turns out it helps if you actually tell the code the proper proc name
09:32:07FromDiscord<ElegantBeef> `circfillCompcxcyrrPt` i'm sure this mangling will suffice and not bite me in the ass
09:32:46Oddmongerif 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:23FromDiscord<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:34FromDiscord<Vindaar> :disruptek: damn
10:10:50FromDiscord<Yardanico> you know you ping him with this emoji? :)
10:11:21FromDiscord<Vindaar> haha, no I did not think about that. I think he'll survive 😉
10:22:21FromDiscord<neow> I'll change my nickname to an
10:22:42FromDiscord<neow> I don't mind getting pinged, I enjoy reading every single message here though
10:22:53FromDiscord<Rika> @neow @neow @neow @neow @neow @neow
10:23:08FromDiscord<neow> I- thanks
10:23:42FromDiscord<Yardanico> @neow you won't get pinged then
10:23:58FromDiscord<Yardanico> and the bridge uses handles and not display names rn anyway
10:24:39FromDiscord<neow> hmm, gtk
10:24:43FromDiscord<neow> (good to know)
10:24:59FromDiscord<neow> (not GNU is not unix toolkit)
10:25:20Yardanicowhat
10:25:22FromDiscord<neow> (edit) "(not GNU is not unix ... toolkit)" added "image manipulation program"
10:25:34YardanicoGTK = GIMP toolkit
10:25:35FromDiscord<Rika> oh oh oh
10:25:43FromDiscord<Rika> make your nick "what"
10:25:44Yardanicoalso my edit diffing worked here correctly apparently
10:25:45FromDiscord<Rika> 200 iq
10:25:51FromDiscord<Yardanico> not nick
10:25:51FromDiscord<Yardanico> handle
10:25:53FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/767695007720538132/unknown.png
10:25:56FromDiscord<Yardanico> see this
10:31:01FromDiscord<dom96> maybe you should include a dictionary lookup in the Discord bridge for nick mentions? 😛
10:32:29FromDiscord<Yardanico> that would be stupid :)
10:33:23FromDiscord<dom96> how so?
10:33:39FromDiscord<dom96> it would avoid mentions on common words
10:34:11FromDiscord<Yardanico> but you said yourself that we want to make it less complex
10:34:40FromDiscord<Vindaar> I missed why it's a bad idea to only ping if explicitly done via `@`?
10:35:38FromDiscord<Yardanico> I really just want to revert to old way of doing "Nick: hello" (only singular form) or @nick or "ping nick"
10:35:54FromDiscord<dom96> so do that
10:36:28FromDiscord<dom96> just don't use `startsWith` lol
10:36:33FromDiscord<Yardanico> I'm not?
10:36:36FromDiscord<Yardanico> I changed it already
10:36:43FromDiscord<dom96> ... you said you're reverting
10:37:03FromDiscord<Yardanico> reverting to old way of nick pinging with "Nick: hello" or "ping nick", not old nickname matching :)
10:37:03FromDiscord<dom96> Revert it but reapply the change to not use startsWith
10:38:06FromDiscord<Vindaar> just avoid any and all complexity, no? `if condition for match (name): createAtString(name)`?
10:38:27FromDiscord<Vindaar> if the user can't type persons name? or is the whole problem the discord naming with `#`?
10:38:58FromDiscord<Rika> some people ping without appending @s
10:39:05FromDiscord<Yardanico> well it's okay
10:39:06FromDiscord<Rika> or after char 0
10:39:08FromDiscord<Yardanico> "Nick: hello"
10:39:13FromDiscord<dom96> that's how it works on IRC
10:39:24FromDiscord<dom96> You don't need the [at] on IRC
10:39:38FromDiscord<Yardanico> 🤔 https://media.discordapp.net/attachments/371759389889003532/767698465002094622/unknown.png
10:39:49FromDiscord<Yardanico> do we want this color and discord logo or not :) to the readme
10:39:52FromDiscord<Yardanico> I want to add discord link to it
10:39:56FromDiscord<Yardanico> with the badge
10:40:00FromDiscord<dom96> sure
10:40:05FromDiscord<Yardanico> ok
10:40:09FromDiscord<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:19FromDiscord<shashlick> That'd be nice - now that I don't use slack, I only get pinged if people are specific
10:40:32FromDiscord<Vindaar> exactly that's imo a feature
10:41:22FromDiscord<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:25FromDiscord<Yardanico> with @ you can ping all you want
10:41:58FromDiscord<Vindaar> that's what I'm saying, isn't it?
10:42:03FromDiscord<Vindaar> (hint: it is)
10:42:06FromDiscord<dom96> in that case you shouldn't even need to check whether the nick actually exists
10:42:17FromDiscord<Yardanico> well you still do
10:42:18FromDiscord<dom96> just replace `nick: Hello` with `@nick: hello`
10:42:22FromDiscord<dom96> no matter what
10:42:23FromDiscord<Yardanico> nah it doesn't work like that
10:42:29FromDiscord<Vindaar> because of `#`?
10:42:31FromDiscord<dom96> oh, silly discord
10:42:37FromDiscord<Yardanico> to ping on discord you must replace the nickname with the ID
10:42:40FromDiscord<Yardanico> like <@!id>
10:42:48FromDiscord<Vindaar> ok, now it makes more sense
10:42:52FromDiscord<Yardanico> yeah because display names or handles aren't unique
10:42:54FromDiscord<dom96> @Yardanico test
10:43:02FromDiscord<Vindaar> so you perform a lookup on all users on the server?
10:43:03FromDiscord<dom96> hm, I guess Discord still replaces it
10:43:17FromDiscord<Yardanico> @Vindaar yeah, but it's cached locally since I request all members at ircord startup
10:43:25FromDiscord<Vindaar> I see
10:43:26FromDiscord<Yardanico> so it doesn't do a network lookup each time
10:43:36FromDiscord<Yardanico> and when new users join dimscord updates that local cache
10:45:12FromDiscord<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:47FromDiscord<Vindaar> sent a code paste, see https://play.nim-lang.org/#ix=2BeZ
10:46:17FromDiscord<Yardanico> that's what I'm doing kind of
10:46:23FromDiscord<Yardanico> and always has been doing
10:46:28FromDiscord<Vindaar> ok 🙂
10:46:33FromDiscord<Yardanico> extract possible mentions, check if they exist and then replace in the string
10:49:18FromDiscord<shashlick> How about letting folks register additional strings that will mention them 😄
10:49:49FromDiscord<Yardanico> you want to get pinged on nimterop? :)
10:49:57FromDiscord<shashlick> Yep
10:51:53FromDiscord<Yardanico> https://github.com/nim-lang/Nim/pull/15634
10:51:54disbotAdd discord to the README
10:52:00FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/767701574217629716/unknown.png
10:52:08FromDiscord<Yardanico> also apparently shields.io has the Nim logo available
10:52:14FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/767701634682847232/unknown.png
10:56:54*luis_ joined #nim
10:57:35luis_Anyone here using nimdow? I am trying to run it on clearlinux, but I get:
10:57:37luis_[email protected]lr-dc8d41e6dcab4a0da7ffe90d4e0e59ab~ $ nimdow
10:57:39luis_could not load: libXinerama.so
10:57:41luis_(compile with -d:nimDebugDlOpen for more information)
10:57:46FromDiscord<Yardanico> you need xinerama installed
10:57:50FromDiscord<Yardanico> what's your distro?
10:57:56luis_and devpkg-libXinerama
10:58:01luis_is installed
10:58:03luis_Clearlinux
10:58:09FromDiscord<Yardanico> @Avahe ^
10:58:20FromDiscord<Yardanico> well maybe clearlinux doesn't install neccesary xorg packages or something?
10:58:35FromDiscord<Yardanico> try installing devpkg-xorg-server
10:59:25luis_ok... let me try
11:00:08luis_it's already installed
11:00:35FromDiscord<Yardanico> well then I don't know, never really tried clear linux since it's not really a desktop-focused distro ;)
11:00:55luis_https://paste.gnome.org/p4jorobze
11:01:13luis_Thank, will try to find the problem... will report back...
11:02:55*lritter joined #nim
11:04:46FromDiscord<Vindaar> PMunch around on IRC?
11:04:54PMunchYup
11:07:03FromDiscord<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:37FromDiscord<ache of head> okay, so the guy that said templates are like abstract functions asked a good question
11:48:45FromDiscord<ache of head> what's the difference between `quote` and `quote do:`?
11:49:16FromDiscord<Rika> tfw deleted message
11:49:26FromDiscord<ache of head> why is `quote` written as `quote do: x` instead of just `quote: x`?
11:49:32FromDiscord<ache of head> > tfw deleted message↵i misread the message
11:50:30*kenran quit (Ping timeout: 256 seconds)
11:50:47FromDiscord<ache of head> i think it's because `do` denotes a code block
11:50:52FromDiscord<ache of head> and `quote` accepts a code block
11:50:53FromDiscord<ache of head> right?
11:55:43FromDiscord<ache of head> no wait
11:55:47FromDiscord<ache of head> it's because the other argument
11:55:48FromDiscord<ache of head> `op`
11:55:50FromDiscord<ache of head> right?
11:57:22*beanie joined #nim
11:57:58*beanie quit (Client Quit)
11:59:37FromDiscord<Yardanico> why are you spamming
11:59:57PMunch@Vindaar, sorry I completely forgot you pinged me :P
12:00:13FromDiscord<Vindaar> no worries, haha. will be gone for a bit now though
12:01:11PMunchAh, 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:38Araq<ache of head> the reason is mostly parsing precedence rules
12:21:56Araq'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:28leorize[m]PMunch: can you remove Zevv's with from nim >= 1.2 from the playground?
12:36:17Zevvwait what why
12:36:18Zevvmy with!
12:36:35PMunchleorize[m], PR's welcome
12:36:48FromDiscord<ache of head> > why are you spamming↵i wasn't trying to spam, sorry if it looked like that
12:37:29leorize[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:25PMunchOoh, indeed that is something I might have to look into
12:38:37PMunchWell, PRs welcome there as well of course :P
12:38:51PMunchnimlsp is a hacktoberfest repo if anyone wants a t-shirt :)
12:39:11leorize[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:24FromGitter<jrfondren> can't compile Nim without SCL on CentOS 7 either :| that's not EOL on 2024
12:59:48FromDiscord<dom96> SCL?
13:00:06FromDiscord<19> @Araq ↵thanks for the great advice
13:00:11FromDiscord<dom96> @Yardanico that's not spamming
13:00:18FromDiscord<Yardanico> that was half-joke
13:00:26FromGitter<jrfondren> https://wiki.centos.org/AdditionalResources/Repositories/SCL , it's a way to import gcc from the future, among other things.
13:00:44FromDiscord<dom96> ahh, so the gcc is too old
13:01:09FromDiscord<Yardanico> yeah we need to change the readme if nim no longer works with gcc 3.x
13:01:14FromDiscord<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:17FromGitter<jrfondren> on CentOS7 gcc can actually compile Nim until the final step where it doesn't have __builtin_saaddll_overflow stuff
13:01:27FromDiscord<Yardanico> you can fix that
13:01:31FromDiscord<Yardanico> by -d:nimEmulateOverflowChecks
13:01:38FromDiscord<Yardanico> try to add it in config/nim.cfg
13:01:49FromDiscord<dom96> hm, I ran into this too for embedded
13:02:06FromDiscord<dom96> Can we maybe generate a check for the existence of this in the C code?
13:02:17FromGitter<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:28FromDiscord<Yardanico> the issue is that then we need to run the C compiler to check that before actually compiling the code
13:02:37Zevvhmm so nim now has its own with. Should I rename zevv/with to something different?
13:02:41FromDiscord<Yardanico> https://github.com/nim-lang/Nim/blob/devel/lib/nimbase.h#L571
13:02:45FromDiscord<Yardanico> @Zevv no
13:02:52FromDiscord<Yardanico> you can only import it as "import std/with"
13:02:57FromDiscord<Yardanico> i mean stdlib version
13:03:10Zevvhm fair enough
13:03:16FromDiscord<Yardanico> IIRC that overflow checks situation was discussed before
13:03:19FromDiscord<Yardanico> don't remember where exactly
13:06:05FromDiscord<Clyybber> We can provide an error that points to -d:nimEmulateOverflowChecks
13:06:09FromDiscord<Clyybber> via C macros
13:06:15FromDiscord<19> @Yardanico ↵oh lol, well it definitely worked in my case xD
13:07:08FromGitter<jrfondren> -d: flags don't help on the initial compilation of Nim itself, from C sources
13:07:53FromDiscord<Clyybber> But you don't get that error on building Csources do you?
13:08:40*natrys joined #nim
13:08:40FromDiscord<Clyybber> Csources doesn't use builtin_saaddll_overflow I'm pretty sure
13:09:19FromGitter<jrfondren> they absolutely do.
13:10:02FromDiscord<Yardanico> they don't
13:10:06FromDiscord<Yardanico> they are 0.20
13:10:29FromGitter<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:51FromDiscord<Yardanico> we're talking about different things
13:10:58FromDiscord<Yardanico> we're talking about the fact that csources repo is 0.20
13:11:03FromDiscord<Yardanico> the one you downloaded isn't "csources"
13:11:16FromDiscord<Yardanico> it's just nim's compiled c code for easier bootstrap
13:11:24FromDiscord<Yardanico> we're talking about https://github.com/nim-lang/csources
13:11:44FromGitter<jrfondren> huh, OK.
13:13:11*skelett joined #nim
13:13:25FromGitter<jrfondren> so 1.4.0 c_code/nimbase.h has these __builtin_xxx_overflow symbols, but csources is another bootstrap option?
13:14:25FromDiscord<Yardanico> yes
13:17:58FromGitter<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:15leorize[m]@jrfondren choosenim likely fetched the prebuilts that we posted on the website
13:29:56leorize[m]hmm, we might have to consider rolling -d:nimEmulateOverflowChecks in csources generation
13:30:04leorize[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:46newUserhi, 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:04leorize[m]https://play.nim-lang.org/#ix=2BfK <- there you go
13:50:14leorize[m]just add that before setCommand
13:52:19*kenran quit (Ping timeout: 260 seconds)
13:55:47newUserleorize[m]: https://play.nim-lang.org/#ix=2BfN
13:56:23leorize[m]yep, that works too
13:56:51leorize[m]use --define:danger if you want to make the binary as small as possible
13:56:54leorize[m]not recommended though
13:57:00newUseroh, you mean I can put it direct ?
13:57:07leorize[m]--define:release is better
13:57:12newUserwithout switch
13:57:21leorize[m]yea, the nimscript module define a `--` template
13:57:53newUserand where to put the main.nim
13:58:02*TomDotTom joined #nim
13:58:08FromDiscord<Clyybber> -d:release and -d:danger don't work in config or main.nim
13:58:18Yardanico^^^
13:58:50newUserno my example file is main.nim and out iss Weather.exe
13:58:58leorize[m]setCommand take an optional argument that's the file
14:04:16newUserdon't understand
14:04:33newUsersetCommand "c main.nim"
14:09:47newUser--passC:-flto is not allowed: Error: undeclared identifier: ':-'
14:09:55Yardanicoquote -flto
14:09:57Yardanico--passC:"-flto"
14:11:32newUsertask build, "builds an example": echo "task" setCommand "c" setCommand "hello.nim"
14:12:09*narimiran joined #nim
14:12:14newUseranother small example, the echo is not printed
14:19:08newUserthx, I use .sh. Description is not enough for me. Documentation should be for beginners too.
14:20:00newUserbye
14:20:04Yardanicolol
14:20:05*newUser quit (Remote host closed the connection)
14:20:15Yardanicoi don't think using .sh over nimscript is a good idea :)
14:20:19Yardanicohave you looked at nimble build tasks?
14:29:32ForumUpdaterBotNew 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:47leorize[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:54leorize[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:03FromDiscord<Yardanico> @Clyybber found an interesting bug :P https://github.com/nim-lang/Nim/issues/15637
14:51:05disbotC compiler error when using statement list expression with a template ; snippet at 12https://play.nim-lang.org/#ix=2Bg2
14:52:19FromDiscord<Clyybber> huh
14:52:34FromDiscord<Yardanico> it was initially with strformat's &, but & just does roughly the same thing
14:52:38FromDiscord<Yardanico> and indeed the error is the same
14:52:47FromDiscord<Yardanico> i modified it to use ints
14:53:16FromDiscord<Yardanico> I guess the identifier in a template is being reused when it shouldn't
14:53:39FromDiscord<Clyybber> no, it should
14:53:46FromDiscord<Yardanico> intval?
14:53:48FromDiscord<Clyybber> it should get an error message tho
14:53:55FromDiscord<Yardanico> oh, so this is invalid code actually?
14:54:21FromDiscord<Clyybber> yeah, because the code will get semmed since the param it gets passed to is typed
14:54:33FromDiscord<Clyybber> this is a case of illegal sym sharing
14:54:45FromDiscord<Clyybber> but perhaps we can introduce some rules to allow it in this case
14:54:56FromDiscord<Clyybber> but first I need to finish the fix for the other symshare issue
14:55:41FromDiscord<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:46bungcan I destruct future of tuple to variable ?
15:41:25FromDiscord<Yardanico> After you await it sure
15:43:28Yardanicobung: there are no issues with that
15:43:41Yardanicodoes "let (x, y, whatever other vars) = await mytulpefut" not work?
15:46:16bungvar r:tuple[payload: string, payloadLen: int] (payload,_) = await conn.receivePacket()
15:46:40Yardanicothat's not how you deconstruct a tuple
15:46:57Yardanicoahh you want to assign to a tuple field or what?
15:47:04Yardanicothen you should do something like
15:47:10Yardanico(r.payload, _) = await ..
15:47:48*kenran joined #nim
15:48:07bungI want to do `(payload,_)` but it doen't work , so I add a variable declaration
15:49:48Yardanicoyou can't do that
15:49:51Yardanicopayload is in a tuple
15:49:54Yardanicoyou need "r.payload"
15:49:58Yardanicoor maybe I didn't understand
15:50:11Yardanicodoes conn.receivePacket return that tuple?
15:50:57bungoh it works, misreading error message
15:51:47bungI remenber there's issue with tuple that need to declare tuple varible first
15:52:59*kenran quit (Ping timeout: 258 seconds)
15:54:32bungnew problem, (pkt, _) = await conn.receivePacket() if pkt declared, it will throw Error: undeclared identifier: '_'
15:54:51*TomDotTom joined #nim
15:55:26Yardanicois pkt declared?
15:55:34Yardanicoif not, add "var" or "let" before
15:55:38Yardanicolet (pkt, _) = ...
15:55:58bungvar pkt = pkt, code before
15:58:49bungI 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:29disruptekdisruptek drinks because you deref nil.
16:34:09Yardanico:disruptek:
16:34:31FromDiscord<Avatarfighter> :disruptek:
16:36:39*gangstacat joined #nim
16:37:13disruptekdafuq
16:40:14FromDiscord<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:27FromDiscord<haxscramper> This is an intentional change or bug in new version?
16:40:33FromDiscord<Yardanico> intentional
16:40:38FromDiscord<haxscramper> FFS why?
16:40:39FromDiscord<Yardanico> lemme link the issue/rfc
16:41:01FromDiscord<Yardanico> https://github.com/nim-lang/Nim/issues/15280
16:41:02disbotMixing '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:27FromDiscord<Clyybber> @haxscramper Please vote on https://github.com/nim-lang/RFCs/issues/251
16:41:28disbotAllow return in expressions again ; snippet at 12https://play.nim-lang.org/#ix=2B2K
16:46:05Mat5I'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:49FromDiscord<Yardanico> well, what is your reason for disabling the GC?
16:48:04FromDiscord<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:06FromDiscord<Yardanico> just like in C
16:48:09FromDiscord<Clyybber> Mat5: You can use gc:arc, its akin to RAII
16:48:25FromDiscord<Clyybber> with move semantics
16:48:26FromDiscord<Yardanico> you have tons of books about C, and they all don't talk about a GC :)
16:48:49FromGitter<deech> What does `static type` mean in this case? https://github.com/nim-lang/Nim/blob/devel/lib/pure/typetraits.nim#L93
16:49:42Mat5Yardanico, that's mainly bare-metal programming
16:50:07FromDiscord<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:16FromDiscord<Rika> well if not bare metal programming, what are you doing?
16:51:18FromDiscord<Yardanico> @deech compile-time expression https://nim-lang.org/docs/manual.html#special-types-static-t
16:51:31FromDiscord<Clyybber> deech: In this case the same thing as typedesc except that its treated like a value and never like a type
16:51:38FromDiscord<Clyybber> I think
16:52:55FromDiscord<Clyybber> @Yardanico No, arc is what they want
16:53:10FromGitter<deech> Yardanico: I understand the `static` keyword but not what `static type` means.
16:53:41FromDiscord<Clyybber> deech: yeah, its not something that was ever anticipated to exist
16:53:47FromGitter<deech> I thought it might be polymorphic over types but this doesn't work: `@[StaticParam["hello"],StaticParam[1]]`
16:53:59FromDiscord<Clyybber> you might ask the author of that code timothee
16:54:23FromDiscord<Clyybber> no, its not a typeclass
16:54:42FromDiscord<Clyybber> its static[type] so while type itself is already a compile thing
16:54:50FromDiscord<Clyybber> (edit) "compile" => "compiletime"
16:54:59FromDiscord<Clyybber> it makes it hard to say what exactly static[type] is
16:55:51FromGitter<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:05FromDiscord<Clyybber> yeah
16:56:27*sealmove joined #nim
16:57:26*NimBot joined #nim
16:57:38FromGitter<deech> Would be nice if typedesc was 1st class at compile time.
16:57:56*TomDotTom quit (Ping timeout: 272 seconds)
16:57:58FromDiscord<Clyybber> yeah, theres an RFC for that, whatever it might entail
16:59:02FromGitter<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:02FromDiscord<Clyybber> The RFC is still lacking a concrete design
17:00:38*user0 quit (Remote host closed the connection)
17:00:43FromDiscord<Clyybber> might be worth it to collect the various requirements there
17:01:27FromGitter<deech> Have a link?
17:01:44FromDiscord<Clyybber> https://github.com/nim-lang/RFCs/issues/44
17:01:44disbot[RFC] Working with types in macro is difficult.
17:08:32*Mat5 quit (Quit: Leaving)
17:28:48disruptekclyybber: CFile -> FILE
17:29:00FromDiscord<Clyybber> what
17:29:13disruptekdifferent signatures, different identities, same name.
17:29:48FromDiscord<Clyybber> what has the same name
17:30:12disruptektwo apparently different types.
17:30:25FromDiscord<Clyybber> ah, we talked about the solution
17:30:30FromDiscord<Clyybber> its easy
17:30:34disruptekyes, assume it's fine.
17:31:04FromDiscord<Clyybber> oh, I thought you were pinging me because its not fine
17:31:21disrupteki'm just sharing the latest bullshit.
17:31:38disrupteki didn't know it'd ping you.
17:31:45FromDiscord<Clyybber> its fine
17:31:49FromDiscord<Clyybber> I like being pinged
17:32:10disruptekpeople should just fucking block me because i cannot be arsed to guess as to whether you care about being pinged.
17:32:10FromDiscord<Clyybber> bullshit as in "look what I have to deal with"↵or bullshit as in "look what I got working \o/"
17:32:19FromDiscord<Clyybber> :disruptek:
17:32:31disruptekit's only the megatest that demonstrates defects like this.
17:32:45FromDiscord<Clyybber> so the former
17:32:50disruptekyes.
17:32:59FromDiscord<Clyybber> get to the latter
17:33:02FromDiscord<Clyybber> now
17:33:07disruptekpackages and bootstrap pass, so now i'm refactoring.
17:33:15sealmovewhat's the common way to convert enum to string?
17:33:52FromDiscord<Clyybber> disruptek: Nice
17:34:01FromDiscord<Clyybber> sealmove: $
17:36:09bungresult.payload.substr(4),decompressed[4 .. ^1] ,do I better change it to ptr?
17:39:17*lritter quit (Quit: Leaving)
17:47:55leorize[m]I'm not sure what you want to do with that?
17:48:28bungjust substring but I worry about the performance
17:48:44*kenran joined #nim
17:49:51leorize[m]well toOpenArray exists for creating views
17:53:25*kenran quit (Ping timeout: 240 seconds)
17:54:17bungthen result.payload declare as what type?
17:54:40leorize[m]?
17:54:49leorize[m]I don't think I understand your code
17:55:32bungoh, currently I use this varible as string
17:56:16bungit will assign to result as part of tuple
17:59:02bunghold on , I'll provide the source link, sorry for my poor english
17:59:48PrestigeWhat language(s) do you speak natively?
18:00:01YardanicoPrestige: I think chinese
18:00:06FromDiscord<Rika> i think they know chinese, but thats only from what i remembe r
18:00:14PrestigeAh, nvm then
18:01:22bunghttps://github.com/bung87/amysql/blob/2a19b6365e179b03d3a54493ff0c0660b15be799/src/amysql/private/protocol.nim#L465-L468
18:02:43bungcheck this piece of code , any improvement suggetion appreciate
18:03:47leorize[m]why are payload and payloadLen two different entities?
18:04:16leorize[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:34bungresult could be just string, I impelement it while reading mysql document, when I complete I fount I dont need payloadLen
18:05:48bungso in this case, choose openarray[char] or ptr char with offset ?
18:07:59bungthe initial version dont support protocol compression, so there's some differiences, compression packets could contains multiple packets
18:08:17leorize[m]just use a seq[char]
18:09:11bungok. thanks!
18:10:13leorize[m]or a seq[byte] depending on the type of data you're handling
18:10:30Yardanicobtw, 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:39leorize[m]bung: you can use sequtils.delete() to trim the beginning of a seq
18:11:51leorize[m]it's in-place so it's fast
18:12:11leorize[m]Yardanico: I believe so. ARC/ORC working reliably means that destructors work reliably
18:12:44disruptekkinda important that the stdlib works even when the mm doesn't. 😁
18:13:43Yardanicowell but if we start adding destructors, then for example we'll have to change the File type
18:14:07Yardanicoadd FileRef at least for if you want to have a file descriptor referenced from multiple locations
18:14:22disruptekwut
18:14:31Yardanico?
18:14:44bungleorize string doesn't have such a method right ?
18:15:04leorize[m]if you want `io` to gain destructors we will have to rework the module itself
18:15:07leorize[m]bung: yea, it should be simple to add to strutils though
18:15:16Yardanicoleorize[m]: exactly
18:15:33leorize[m]adding destructors to io means breaking backward compat
18:15:41Yardanico--useVersion :PPPP
18:15:50leorize[m]currently Nim's `File` is C's `FILE*`
18:15:55Yardanicoyeah I know
18:16:44bungok, I better change to seq[char] and only return this one, change following calls arg I think.
18:17:22leorize[m]I know how to rework io and Status already make one, so it's not too hard
18:17:28leorize[m]just have to find the time for it
18:17:30leorize[m]if you're slinging bytes around then `seq[byte]` is better
18:22:42bunganyway , thanks, I finally finish the mysql compression part
18:23:39disruptekbung: nice, i know that was a chore.
18:27:45bungyeah , 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:06FromGitter<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:56leorize[m]that tutorial is the best one we have atm
19:31:22leorize[m]once you got the macros basics, "advanced" macros are actually really simple
19:31:25*xace joined #nim
19:32:07leorize[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:08FromDiscord<nikki> i really like the nim manual
19:53:55FromDiscord<nikki> i made a pdf render of it that fits nicely on an ipad mini; if anyone was interested in that ...
19:54:11FromDiscord<nikki> just hacked up the latex output lol
19:54:31disruptekwhat a pita.
19:54:34*kenran quit (Ping timeout: 260 seconds)
19:54:44disruptekdo you mean the page size matches the aspect ratio of the mini?
19:55:21FromDiscord<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:36disruptekhuh.
19:55:57FromDiscord<nikki> i use "pdf expert" which has an auto crop feature
19:56:28disruptekis it me or are the later chromes worse by universal metrics like glitches, bugs, crashes?
19:56:44FromDiscord<nikki> i've seen that too
19:56:52FromDiscord<nikki> i'm mostly on firefox these days tho
19:57:07FromDiscord<lqdev> welcome to The Web™️
19:57:57FromDiscord<Avatarfighter> I can never figure out why Google Chrome makes my mac suffer more than other chromium browsers
19:58:25disruptekyou run multiple chromium browsers?
19:58:39FromDiscord<Avatarfighter> Yeah
19:58:47disruptekis that fun for you?
19:58:51FromDiscord<Avatarfighter> no
19:59:07disruptekthen why do you do it? for work?
19:59:27FromDiscord<Avatarfighter> Google Chrome for school and Brave for everything else
19:59:41disruptekbecause hacker?
19:59:45FromDiscord<Avatarfighter> no bro
19:59:48FromDiscord<scott> don't use Brave...it's sketchy af
20:00:02FromDiscord<scott> ah, this is OT, I'll go over there
20:00:02supakeencould just use chrome with 2 profiles as well they have a handy switcher nowadays :)
20:00:13FromDiscord<Avatarfighter> the referal injection controversy was blown out of proportion @scott
20:00:21FromDiscord<Avatarfighter> ill move to #offtopic to defend brave
20:00:39disruptekjesus. did i hit a nerve or what?
20:00:46supakeenwhen do you not!
20:01:13disrupteki don't know, but i'm not in offtopic and not planning on visiting, so...
20:01:22*natrys quit (Quit: natrys)
20:01:42Prestigefirefox and qutebrowser do it for me. Still OT though
20:01:47Prestigewoops
20:02:01disruptekhey man, whatever blows your skirt up.
20:02:24disruptekwhatever peels the prestigious banana, i mean.
20:02:32FromDiscord<Yardanico> @scott totally agree with you
20:02:38PrestigeI'm glad you're here disruptek
20:03:58FromDiscord<Avatarfighter> Disruptek: i use brave because of the possibility of earning BAT
20:05:12FromDiscord<dk> Can you `nimble develop` but only for a local dependency instead of system-wide?
20:05:24FromDiscord<dk> Or should I just clone the dependency
20:09:42*lander quit (Remote host closed the connection)
20:12:24TomDotTomdeech: 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:52TomDotTomFFS, that was awfully written. But you get the gist.
20:12:58*jxy joined #nim
20:13:10FromDiscord<Yardanico> Well treeRepr is like dumpTree, but for NimNodes in macros instead of normal code blocks
20:13:37TomDotTomIt also returns a string instead of echoing to console
20:13:57TomDotTomYou can just us `quote do:` to send the ast into `treeRepr`
20:19:11FromDiscord<ElegantBeef> We are also missing `nimNode.repr` which dumps readable nimcode
20:19:58FromDiscord<ElegantBeef> Although the AST may be incorrect so the readable code, but not compileable
20:20:09FromDiscord<Yardanico> why missing
20:20:15FromDiscord<Yardanico> I know about it :)
20:20:25FromDiscord<ElegantBeef> I mean we're talking about reprs and not talking about the nice one 😛
20:20:38FromDiscord<Yardanico> lispRepr is the nicest of them all
20:21:02disruptekwhat is bat? vietnamese currency?
20:21:04FromDiscord<ElegantBeef> Does that just convert it to polish notation?
20:21:38FromDiscord<Yardanico> @disruptek one of those zoomer "cryptocurrencies"
20:21:38disrupteki don't like parsing ast. i would rather just do it from scratch.
20:21:55disruptekthe api seems to work pretty well to me.
20:21:56FromDiscord<ElegantBeef> You'd rather use MIT's scratch?
20:22:10FromDiscord<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:24FromDiscord<Yardanico> It's own ads in notifications i mean
20:22:29disruptekwhat is bat? vietnamese currency?
20:22:45FromDiscord<Yardanico> batsoup
20:22:52FromDiscord<ElegantBeef> Nah the main ingredient in coronavirus soup
20:22:55disruptekoh, vietnamese culinary?
20:22:59FromDiscord<scott> BAT is a joke of a Cryptocurrency
20:23:08FromDiscord<ElegantBeef> So it's cryptocurrency? 😛
20:23:14FromDiscord<scott> Exactly!
20:23:53FromDiscord<ElegantBeef> Disruptek did you see what i named my name mangling variable?
20:24:04disruptekyour what?
20:24:24FromDiscord<Innokentiy Sokolov> instead of being just a normal browser Brave tries to invent a thing no one asked for
20:24:26FromDiscord<ElegantBeef> I'm mangling proc names for nimscript since i'm now using strings as the only method of interop
20:24:40FromDiscord<ElegantBeef> So i've got a variable entitled "disrupteksAnger" which stores the mangling
20:25:00disrupteksounds about right, but be aware: disrupteksAnger usually leaks.
20:25:09FromDiscord<ElegantBeef> Nah you're thinking of his nappy
20:25:18disruptekdisrupteksPampers
20:26:34FromDiscord<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:40FromDiscord<scott> is `float` an alias for `float32`, `float64`, or architecture-dependent?
20:26:50FromDiscord<ElegantBeef> same as int depends on the arch
20:27:02FromDiscord<scott> perfect that's great
20:27:07FromDiscord<Clyybber> disruptek: suck my vietnamese currency
20:27:25FromDiscord<ElegantBeef> Hah get it cause it's dong
20:27:46disruptekoh, it's thailand i'm thinking of.
20:27:55disruptekjesus. you'd think i wasn't a rare coin dealer.
20:28:02FromDiscord<Yardanico> @ElegantBeef no you're wrong :)
20:28:08FromDiscord<Yardanico> @scott it's always 64 bit
20:28:17FromDiscord<Yardanico> float is the same as float64
20:28:20disruptekyeah.
20:28:40FromDiscord<ElegantBeef> well that's a useless description https://media.discordapp.net/attachments/371759389889003532/767846688898547752/unknown.png
20:28:43FromDiscord<scott> why's that?
20:29:36FromDiscord<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:00disruptekheh
20:30:03disruptekthat's awesome.
20:30:11FromDiscord<Rika> Lol
20:30:12FromDiscord<Clyybber> @Yardanico No, float is 32 bit on 32bit systems
20:30:20FromDiscord<Yardanico> @Clyybber ??
20:30:28FromDiscord<Yardanico> Wat
20:30:34FromDiscord<ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/767847177782951936/unknown.png
20:30:35disrupteki think you're wrong.
20:30:43disruptekiirc it's always 64bit.
20:30:46FromDiscord<Yardanico> ^^
20:30:47FromDiscord<Clyybber> oh, yeah. Sorry
20:30:52FromDiscord<Rika> Why?
20:30:59FromDiscord<ElegantBeef> It's inconsistant, that's why!
20:31:12disrupteki don't know why. or, maybe i did but i forget.
20:31:36FromDiscord<ElegantBeef> What library do i attempt to use nimscript on now, fidget? 😄
20:32:25FromDiscord<Clyybber> semtypes:1990 seems to suggest its size can still vary
20:32:25FromDiscord<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:47FromDiscord<ElegantBeef> Less common, please if you're running a 32bit cpu, you can just leave 😛
20:32:48FromDiscord<Avatarfighter> fidget for sure Beef
20:33:01*Kaivo quit (Ping timeout: 260 seconds)
20:33:02FromDiscord<Clyybber> yeah, I'm pretty sure its still arch dependent
20:33:03FromDiscord<Avatarfighter> Rip my 16bit cpu
20:33:14FromDiscord<scott> I was more thinking of ARMv7 and embedded (even 16-bit) examples
20:33:15FromDiscord<Clyybber> its just that floatSize is set to 64 bit for most archs
20:33:15FromDiscord<ElegantBeef> we dont even have halfs in nim
20:33:16*TomDotTom quit (Quit: leaving)
20:33:21FromDiscord<Clyybber> but try it on avr, it will be 32bit
20:33:30FromDiscord<scott> Nim compiles to AVR??
20:33:32FromDiscord<scott> NICE
20:33:48disruptekoh it's 64bit on common 32bit arch?
20:33:55FromDiscord<Clyybber> yeah
20:34:00disruptekthat makes more sense.
20:34:26FromDiscord<Clyybber> whats a bit crazy is that float64 is also 32bit on avr, I think
20:34:27disruptekcool feature, actually.
20:34:34FromDiscord<Clyybber> don't believe me though, I didn't test that
20:35:26*Kaivo joined #nim
20:36:21FromDiscord<Clyybber> welp, looks like I'm right
20:36:29FromDiscord<Clyybber> thats, ugh, is that intended
20:39:23disruptekdom96 will let us know.
20:50:14FromDiscord<ElegantBeef> @Avatarfighter hey it works https://media.discordapp.net/attachments/371759389889003532/767852128345260042/unknown.png
20:50:24FromDiscord<ElegantBeef> No templates though, but ehhh
20:50:32FromDiscord<Avatarfighter> im so excited
20:50:58FromDiscord<ElegantBeef> Need to get the vm to boot up quicker though
20:51:10FromDiscord<Avatarfighter> threaten to make it run on 16bits
20:51:14FromDiscord<ElegantBeef> It's quicker to compile this program then run revaluate
20:51:19FromDiscord<scott> what is the "vm"?
20:51:28FromDiscord<Avatarfighter> nim has a vm that runs nimscript
20:51:31FromDiscord<ElegantBeef> Nim has a virtual machine for interpreting code at runtime
20:51:35FromDiscord<Avatarfighter> ^
20:51:40FromDiscord<ElegantBeef> I mean compile
20:51:46FromDiscord<Avatarfighter> ^
20:51:59FromDiscord<scott> oh ok so that doesn't have an effect on runtime, right?
20:52:05FromDiscord<ElegantBeef> But it can also be used as a standalone interpreted subset of nim
20:52:17FromDiscord<ElegantBeef> Nope unless you make an interop between the two like i've been working on
20:52:20FromDiscord<scott> ooh, interesting
20:52:50FromDiscord<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:14FromDiscord<ElegantBeef> So you can have scriptable behaviour in your programs, for configuration or what have you
20:53:53FromDiscord<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:04FromDiscord<ElegantBeef> What do you mean?
20:54:22*nature joined #nim
20:54:41disruptekfrosty really would be an improvement here. but even better would be a way to share pointers.
20:54:45FromDiscord<Avatarfighter> I need to think of how to phrase this
20:55:00FromDiscord<ElegantBeef> Yea disruptek using json makes me sad
20:55:14FromDiscord<Clyybber> disruptek: The issue is that the VM represents objects as PNodes
20:55:17FromDiscord<ElegantBeef> plus cant use tuples
20:55:27FromDiscord<ElegantBeef> Since the json cannot serialize tuples
20:55:33FromDiscord<Clyybber> patch json?
20:55:34*arecacea1 quit (Remote host closed the connection)
20:55:40disruptekstop. i can only get so hard.
20:56:15FromDiscord<ElegantBeef> Right now the most annoying thing is the 4-5 second interpreter startup time
20:56:38disruptekbentley is looking at me funny.
20:56:38disruptekhe gets the same look before his 45 minute ball-licking sessions.
20:56:39disruptekpffbt, it takes like 100ms to start the vm.
20:56:42*arecacea1 joined #nim
20:56:50FromDiscord<Avatarfighter> Can the interpreter interpret code during runtime?
20:56:56disruptekwhen else?
20:56:59FromDiscord<Avatarfighter> interpret new code specifically
20:57:06FromDiscord<ElegantBeef> Well you have to revaluate the script
20:57:07FromDiscord<ElegantBeef> So yes
20:57:11FromDiscord<Avatarfighter> 😮
20:57:16FromDiscord<ElegantBeef> That's the entire point of this
20:57:18FromDiscord<Avatarfighter> yeah
20:57:20disruptekjesus.
20:57:35FromDiscord<ElegantBeef> But you cant just add code and it run new code without any hiccups
20:57:40FromDiscord<Avatarfighter> yeah ofc
20:57:41disrupteki picked the wrong week to give up drinking.
20:57:46FromDiscord<Avatarfighter> wowwww
20:58:04FromDiscord<ElegantBeef> This would be pointless if you couldnt reload the nimscript at runtime 😄
20:58:24FromDiscord<ElegantBeef> You even seen the video where i reloaded nimscript!
20:58:29FromDiscord<Avatarfighter> yeah true
20:58:30FromDiscord<Avatarfighter> lol
20:58:38FromDiscord<Avatarfighter> I'm going to see if i can stream a program to nimvm then
20:58:49FromDiscord<Avatarfighter> you've encouraged me beef
20:58:53disrupteki swear my face got larger overnight.
20:59:08disrupteki have more face than ever before, is what i'm saying.
20:59:21FromDiscord<Avatarfighter> just cut the excess off disruptek
20:59:23FromDiscord<Clyybber> face your demons
20:59:30natureWhat 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:33disruptekwhy?
20:59:38disruptekwhy wouldn't i want more of me?
20:59:48disruptekwhat is a ssg?
20:59:51FromDiscord<Avatarfighter> Beef: I assumed that it would be like Python's interpreter where you can't exactly reload the main module lol
20:59:59naturestatic site generator :)
21:00:04disruptekoh right.
21:00:24disrupteki think people use prologue.
21:00:27disruptek!repo prologue
21:00:27disbothttps://github.com/planety/prologue -- 9prologue: 11Prologue is an elegant web framework written in Nim. 15 458⭐ 19🍴 7& 5 more...
21:00:34natureIt's really simple but does what I need
21:00:41disruptekgood.
21:00:47disruptekthat sounds like a good product.
21:00:54FromDiscord<Avatarfighter> Karax is a good frontend framework
21:01:00FromDiscord<Avatarfighter> Prologue is more backend imo
21:01:48FromDiscord<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:01FromDiscord<ElegantBeef> Also built it in danger
21:02:04FromDiscord<ElegantBeef> https://streamable.com/tbqekw
21:02:17FromDiscord<Avatarfighter> https://giphy.com/gifs/funny-spongebob-im-ugly-and-proud-11FkKmUdZxxlJu
21:02:20FromDiscord<Avatarfighter> ^ my code
21:02:26natureThanks disruptek I like that philosophy, yeah I was checking out karax, seems interesting
21:03:03FromDiscord<ElegantBeef> Who needs figma now? 😄
21:03:09disruptekthat looks good.
21:03:51FromDiscord<Avatarfighter> nature: karax is great. I prefer ReactJS over it though just because components are broken in Karax
21:03:56Prestige@Ele nice
21:04:10FromDiscord<ElegantBeef> You need the entire name iirc now 😛
21:04:19Prestigenooooooooooooooooooooo fuck
21:04:31*tane quit (Quit: Leaving)
21:04:34FromDiscord<Avatarfighter> did Yard fix the edge case with someone with spaces in their tag?
21:04:41FromDiscord<ElegantBeef> Yea by making it dumber
21:04:45PrestigeElegantBeef: Come be an irc user :P
21:04:48FromDiscord<ElegantBeef> But it makes it less error prone
21:05:13*ElegantBeef joined #nim
21:05:18ElegantBeefEw how did i get here
21:05:23FromDiscord<Avatarfighter> ew
21:05:25FromDiscord<Avatarfighter> come back
21:05:33ElegantBeefI want help, i'm begging for help, this is not a dance
21:05:37FromDiscord<Clyybber> ew split yourself
21:05:42PrestigeSide note ElegantBeef I like your WM theme
21:05:51FromDiscord<ElegantBeef> Thanks it's stock regolith
21:06:02FromDiscord<tomck> You can do single page apps in nim @Avatarfighter ?
21:06:07FromDiscord<tomck> Have you tried?
21:06:15FromDiscord<Avatarfighter> Yeah you can
21:06:16FromDiscord<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:22FromDiscord<Avatarfighter> @tomck
21:06:24FromDiscord<Avatarfighter> !repo karax
21:06:25disbothttps://github.com/pragmagic/karax -- 9karax: 11Karax. Single page applications for Nim. 15 608⭐ 50🍴 7& 14 more...
21:07:03FromDiscord<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:29FromDiscord<ElegantBeef> Hmm wonder how to work around templates
21:08:48FromDiscord<ElegantBeef> Dont think it's really possible
21:09:08FromDiscord<Avatarfighter> just write inefficient code to do the same thing as the templates
21:09:13FromDiscord<Avatarfighter> easy /s
21:09:16FromDiscord<ElegantBeef> Well that's not automated
21:09:27FromDiscord<Avatarfighter> What are you trying to do?
21:09:34FromDiscord<ElegantBeef> Use fidget
21:09:38FromDiscord<ElegantBeef> It heavily uses templates
21:09:43FromDiscord<Avatarfighter> ah
21:09:52natureI 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:15FromDiscord<Avatarfighter> this ?
21:10:17FromDiscord<Avatarfighter> https://svelte.dev/
21:10:21natureyeah
21:10:31naturecompiling to js is a thing in Nim
21:10:42FromDiscord<ElegantBeef> Fidget is an interesting method of doing webdev
21:10:53natureI was wondering if anybody tried this
21:10:57FromDiscord<ElegantBeef> Doesnt use dom objects though uses webgl rendering
21:11:11FromDiscord<Avatarfighter> I haven't but I don't see why that would be difficult in nim
21:11:59natureIsn't webgl a bit heavy if you want to do simple web stuff ?
21:12:17FromDiscord<Recruit_main707> nimprof does not rely on the gc and can work with gc:none right?
21:12:35nature@Avatarfighter me neither, I just saw a french girl apparently attempted something based off of Svelte 2
21:12:55FromDiscord<Avatarfighter> ooo
21:14:12naturehttp://mildred.fr/en/quick-posts/2020-04-30-svelte-with-nim/
21:16:26FromDiscord<Avatarfighter> thanks for the link
21:40:49*filcuc quit (Ping timeout: 272 seconds)
21:44:33*shinzo left #nim (#nim)
21:45:43FromGitter<ynfle> Is there a way to initialize an `array` with a value other than a loop and `sequtils`?
21:46:19disruptekyep.
21:46:31Prestigesee https://nim-by-example.github.io/arrays/
21:46:44Prestigeor https://nim-by-example.github.io/arrays/
21:46:51Prestigewoops. https://nim-lang.org/docs/tut1.html#advanced-types-arrays
21:46:53FromDiscord<Rika> Isn't that the same link
21:47:05Prestigecopy didn't go off
21:48:26FromGitter<ynfle> Without explicitly writing out each element like initialize all the values to 5?
21:50:23*kenran joined #nim
21:50:26FromGitter<ynfle> Something like `newSeqWith`
21:52:46FromDiscord<Yardanico> https://nim-lang.org/docs/algorithm.html#fill%2CopenArray%5BT%5D%2CT
21:52:50FromGitter<ynfle> `fill` (https://nim-lang.org/docs/algorithm.html#fill%2CopenArray%5BT%5D%2CT) 👍
21:52:57FromDiscord<Yardanico> Heh
21:53:01FromGitter<ynfle> Just got it thanks
21:55:36*kenran quit (Ping timeout: 272 seconds)
21:58:32fowlynfle: 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:19FromDiscord<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:00FromDiscord<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:22ForumUpdaterBotNew 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:30FromDiscord<neow> any way to uninstall a nim version in choosenim?
22:41:22ForumUpdaterBotNew 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:57FromDiscord<neow> nevermind, I can just delete them in ~/.choosenim
22:54:42FromGitter<ynfle> is there a way to concatenate a string with an if expression? like `"a" & if 2 == 2: $1 else: $5`?
22:56:38Prestigehttps://play.nim-lang.org/#ix=2Bjf
22:56:43Prestige@ynfle
22:57:31FromGitter<ynfle> Thanks
22:57:36Prestigeor you can use &= to make it shorter
22:57:38FromGitter<ynfle> Why does it need to wrapped?
22:57:38PrestigeNp
22:57:51FromGitter<ynfle> I tried `&=` but didn't work
22:58:12Prestigehttps://play.nim-lang.org/#ix=2Bjg
22:58:29FromGitter<ynfle> Nvm I meant I tried it without the brackets
22:58:38FromGitter<ynfle> > Why does it need to wrapped? ⏎ ⏎ ☝️
22:59:07FromDiscord<Yardanico> because otherwise it can be ambiguous
22:59:11PrestigeI think ambiguity? Not sure
22:59:14FromDiscord<Yardanico> With indentation you clearly separate stuff
22:59:21FromDiscord<Yardanico> but without it you have to use parens
23:00:07FromGitter<ynfle> I guess `elif` with nested `if` exprs
23:00:09FromGitter<ynfle> Makes sense
23:07:07FromDiscord<neow> I don't see the ambiguity either tbh
23:13:07federico3https://thenewstack.io/which-programming-languages-use-the-least-electricity/
23:13:31federico3this should be updated with Nim
23:17:00FromDiscord<Yardanico> Computer language benchmarks game is honestly not a good pick for a comparison like that
23:17:21FromDiscord<Yardanico> Well maybe it is, but you're testing the performance of the language AND speed of the implementation
23:17:41disruptekhow else?
23:17:47FromDiscord<Yardanico> Some are single threaded, some utilize all cores, some do vectorization, etc
23:17:58FromDiscord<tomck> we need large benchmarks, like whole programs
23:18:00FromGitter<gogolxdong> will it be lower than C
23:18:13FromDiscord<tomck> the problem is that you can hyper optimise benchmarks to not reflect the 'default' usage of the language
23:18:18FromDiscord<Yardanico> Yeah
23:18:29FromDiscord<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:33FromDiscord<Yardanico> Did you ever look at Rust code in CLBG?
23:18:39FromDiscord<Yardanico> it's unreadable mess
23:18:45disruptekwe took one of these benchmarks and rewrote it idiomatically and it was faster.
23:18:57FromDiscord<Yardanico> Havlak?
23:19:03disrupteki forget which one it was. i did it more than a year ago.
23:19:07FromDiscord<tomck> Yeah i can imagine, you have to dive into unsafe & weird rust to get it to run on par w/ c
23:19:14disruptekbut it was around 3x faster idiomatic nim.
23:19:30federico3of course, all benchmarks need to be taken with a big pinch of salt
23:19:48disrupteksure. but idiomatic nim is generally pretty quick.
23:20:01FromDiscord<shashlick> @neow there's a new remove command in the latest version
23:23:41FromDiscord<leorize> disruptek: unless you use sequtils, ofc
23:23:48FromDiscord<leorize> also matrix is acting weird again
23:24:34FromDiscord<tomck> is sequtils slow?
23:24:44FromDiscord<tomck> I use that all the time, does it copy all the time? I was suspecting it did
23:25:04FromDiscord<leorize> yes it does, that's the price of functional programming
23:25:12disrupteklol
23:25:18FromDiscord<tomck> Only found out about zero_functional after i'd put a load of chained mapIt in
23:25:25FromDiscord<tomck> rust seems to handle it alright
23:25:38disrupteki think it's sarcasm.
23:25:49FromDiscord<tomck> oh
23:26:10FromDiscord<leorize> with `dup` and `with` the next strutils will be faster
23:26:18FromDiscord<leorize> sequtils is fast if you just use the mutating procs
23:26:56disruptekallocs are expensive, not gonna lie.
23:28:13FromDiscord<leorize> at least in Nim they're predictable though
23:28:33disruptekand relative to many other languages, they are cheap.
23:28:45FromDiscord<leorize> one of the small perks of having an O(1) allocator
23:29:01FromDiscord<leorize> I've never actually benchmarked the throughput, I expect us to trail behind others actually
23:29:35FromDiscord<leorize> you rarely have both "consistent" and "fast".
23:29:46FromDiscord<tomck> can you chain the mutating procs?
23:29:55disruptekyeah.
23:30:04FromDiscord<tomck> I don't really understand when copies happen, if i chain two mapIt does that allocate twice?
23:30:14FromDiscord<Yardanico> mapIt creates a new seq
23:30:19FromDiscord<Yardanico> Out of the old one
23:30:24FromDiscord<Yardanico> Second one will do that again
23:30:29FromDiscord<leorize> `import std/with` and chaining mutating proc is possible 🙂
23:30:48FromDiscord<leorize> `with` is like one of the best features of 1.2
23:31:27leorize[m]at least in Nim they're predictable though
23:31:29FromDiscord<Yardanico> And yet it's not in lib.html on 1.4 :)
23:31:29disruptekeh.
23:31:41disrupteki think arc was the killer feature of 1.2. 😁
23:31:44PrestigeI like `with` quite a bit
23:32:07FromDiscord<leorize> arc is fine but `with` and `dup` brought some serious ergonomics to the table 😛
23:32:14disruptekit's pretty rare that i have code that i don't want to run on 1.0.
23:33:00FromDiscord<Yardanico> I really think we should extend the docs for it https://nim-lang.org/docs/with.html
23:33:12disrupteki should make a `future` library.
23:33:17FromDiscord<Yardanico> It's almost impossible to discover too
23:33:22FromDiscord<Yardanico> unless you know what you're searching for
23:33:50Prestige`using` is also nice to have
23:33:59disrupteksee, i don't like using.
23:34:04FromDiscord<Yardanico> well it existed since long time
23:34:10disrupteknot my problem.
23:34:30FromDiscord<Yardanico> I wasn't replying to you
23:34:35disrupteki don't care.
23:34:58FromDiscord<Clyybber> I like it
23:35:04FromDiscord<Clyybber> not my problem :p
23:35:14FromDiscord<tomck> ohhhhhh `with` is super cool
23:35:22disruptekclyybber: does cps work?
23:35:28FromDiscord<Clyybber> shush
23:35:33FromDiscord<Clyybber> probably not
23:36:19Yardanicoalso some people might like enumerate
23:36:22Yardanicowhich now exists in stdlib
23:37:00Yardanicoit's just kind of hard to have 3 modules for with/dup/enumerate
23:37:10Yardanico(i know dup is in sugar)
23:37:18Yardanicoany reason why with and/or enumerate aren't in sugar btw?
23:37:47FromDiscord<leorize> no idea but when did we gain enumerate? I didn't know about that one 😛
23:37:59Yardanicohttps://nim-lang.org/docs/enumerate.html
23:38:24Yardanicoit wasn't added to the changelog
23:38:26Yardanicobut in 1.4
23:38:29Yardanicohttps://github.com/nim-lang/Nim/pull/15297
23:38:30disbotadd `enumerate` macro
23:38:39FromDiscord<leorize> we need better changelogs 😛
23:39:17YardanicoIMO different modules make it a bit harder to discover and use these macros
23:39:24disruptekshould just generate them in gh action.
23:39:41FromDiscord<leorize> ask Araq, it seems that narimiran moved it on his request
23:40:07leorize[m]disruptek: we need to get the API diff thingy working if you want that to work
23:40:27disruptekwhy? i don't mind a detail section with all the PRs at least.
23:41:20leorize[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:24FromDiscord<Clyybber> I think with can be moved into sugar now, it wasn't before because Araq doubted its usefulness AFAIR
23:42:46FromDiscord<Clyybber> You can then replace the original with module with `from sugar import with; export with`
23:51:15FromDiscord<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)