<<22-02-2021>>

00:00:22FromDiscord<Yardanico> `interface` and `out` are unused keywords
00:00:47FromDiscord<juan_carlos> `-d:interfaces` Wow, it compiles!.
00:00:55FromDiscord<juan_carlos> I jk. ;P
00:02:34FromDiscord<exelotl> I feel like we missed an opportunity to use `as` in `mapIt`, `withValue` and other templates that introduce symbols
00:03:07FromDiscord<exelotl> sent a code paste, see https://paste.rs/CFz
00:03:42FromDiscord<Rika> looks cursed to me
00:04:27FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2Qhi
00:05:07FromDiscord<Yardanico> @exelotl nobody stops you from doing it like this :P
00:05:10FromDiscord<Yardanico> since it's valid nim syntax
00:05:19FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/813199701083160586/unknown.png
00:06:51FromDiscord<exelotl> yeah, I implemented it the other day: https://play.nim-lang.org/#ix=2ORy
00:07:08FromDiscord<exelotl> well, I called it `lookup`
00:09:45FromDiscord<Yardanico> nice
00:13:36FromDiscord<exelotl> the other advantage it has over withValue is that it doesn't expose a pointer
00:16:53FromDiscord<Yardanico> you can make it even more "cursed" but this doesn't make it easier to read
00:17:00FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Qhj
00:18:17*krux02 quit (Remote host closed the connection)
00:19:30FromDiscord<exelotl> oh no xD
00:20:45FromDiscord<exelotl> I don't think the original is cursed... it's consistent with `try: ... except FooError as e:`
00:21:39FromDiscord<Yardanico> well, that's why I quoted the word
00:23:56FromDiscord<exelotl> Something possibly neat would be allowing `else` to pass a second block, instead of `do`
00:24:24FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2Qhl
00:52:59*Tanger joined #nim
00:57:41*Tlangir joined #nim
01:00:06*Tanger quit (Ping timeout: 260 seconds)
01:33:56*lritter quit (Ping timeout: 240 seconds)
01:42:48*sz0 quit (Quit: Connection closed for inactivity)
01:52:19*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:52:41*njoseph joined #nim
01:54:00FromDiscord<~355/113 Man> is there a compile time equivalent of `for`?
01:54:38FromDiscord<ElegantBeef> yea `for`
01:55:03FromDiscord<~355/113 Man> ?
01:55:22FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2QhC
01:59:21FromDiscord<ElegantBeef> Well for works at compile time https://play.nim-lang.org/#ix=2QhF
01:59:37FromDiscord<ElegantBeef> The issue is that for loop is done at runtime the `for n in 1..m`
01:59:54FromDiscord<~355/113 Man> oh I see
02:00:23FromDiscord<~355/113 Man> so it needs to be in a static block
02:00:41FromDiscord<ElegantBeef> Well you're wanting it to be ran at compile time
02:02:45*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
02:07:22*Lord_Nightmare joined #nim
03:14:41*ebb joined #nim
03:25:51FromDiscord<y_yu> sent a code paste, see https://play.nim-lang.org/#ix=2QhY
03:28:17FromDiscord<ElegantBeef> Well the type is the same for all the Nodes, to differentiate it you have to at runtime with the kind somehow
03:29:06FromDiscord<y_yu> In reply to @ElegantBeef "Well the type is": In Rust, it might be possible to implement it using ghost types and where clauses, etc. Is such a pattern valid in nim?
03:29:20FromDiscord<ElegantBeef> Can you show the rust version?
03:29:29FromDiscord<ElegantBeef> I mean it's certainly possible due to macros
03:29:41FromDiscord<ElegantBeef> But the question is whether it's already implemented in a library
03:35:04*muffindrake quit (Ping timeout: 258 seconds)
03:35:11nisstyreis there a Nim standard library that implements message authentication codes? (e.g. HMAC-SHA1)
03:35:16nisstyreall I see is hash functions
03:35:41nisstyreor should I use nimcrypto?
03:36:19FromDiscord<ElegantBeef> I'd wager you should use nimcrypto, but no clue if the stdlib can
03:36:43nisstyrelooks like stdlib doesn't have it but nimcrypto does
03:37:03*muffindrake joined #nim
03:37:56FromDiscord<y_yu> In reply to @ElegantBeef "Can you show the": I'm using Rust (1.50.0), Nim (1.4.2).
03:38:07FromDiscord<ElegantBeef> I mean the rust implementation
03:38:16FromDiscord<ElegantBeef> Like i want to see what the rust code does 😄
03:41:38FromDiscord<y_yu> In reply to @ElegantBeef "Like i want to": Sorry, I haven't implemented it in Rust yet. I'm just thinking that it could probably be implemented with ghost types.↵But I am interested in Nim, so I am going to try to implement it in Nim.
03:42:05FromDiscord<ElegantBeef> Yea i was just trying to figure out what i could suggest if i knew of something akin to it
03:42:54FromDiscord<Yjuq> In reply to @Yjuq "Hey, can I group": sent a code paste, see https://play.nim-lang.org/#ix=2Qi6
03:45:44FromDiscord<ElegantBeef> In reply to @y_yu "Sorry, I haven't implemented": My current idea is something like `proc toStr(n: Node) {.variant: nkInt.}` with would subscribe that proc to an enum array and emit a `toStr(n: Node)` procedure which is meant to be called
03:49:55FromDiscord<ElegantBeef> But yea need a macro to avoid the manual case stmt
03:55:33FromDiscord<y_yu> In reply to @ElegantBeef "My current idea is": Thank you very much. I'll try your idea first, and then I'll try the macro. If I get a good implementation, I will post it to the community via blog or other means.
03:55:47FromDiscord<ElegantBeef> Well my idea would need a macro 😛
03:56:14FromDiscord<y_yu> (edit) "first, and then I'll try the macro." => "first."
03:57:41FromDiscord<ElegantBeef> I have issues with macros so i've already started a silly impl 😄
04:26:42FromDiscord<ElegantBeef> @y_yu hey i did it, practically a silly Vtable really though afaik https://play.nim-lang.org/#ix=2Qie
04:27:01FromDiscord<ElegantBeef> Skip to line 44 to see it in action
04:34:05*spiderstew joined #nim
04:36:18*spiderstew_ quit (Ping timeout: 256 seconds)
04:49:03FromDiscord<ElegantBeef> Has anyone actually used the macrocache, seems like it'd be able to remove that vtable but i'm uncertain how to use it
04:50:15leorize[m]you don't need it here
04:51:02leorize[m]actually don't mind me :P
04:51:08FromDiscord<ElegantBeef> Lol
04:51:34leorize[m]though it would be hard for your macro to reliably work cross-module
04:51:35FromDiscord<ElegantBeef> I figure you'd use a macro cache to store the bodies then drop them into a `toStr`'s case stmt
04:52:01FromDiscord<ElegantBeef> Yea though i dont know many people that'd do this type of thing cross module
04:54:38FromDiscord<ElegantBeef> The way i see it, it'd still require some manual invokation of something to pack it into a case stmt
04:56:18*rockcavera quit (Remote host closed the connection)
05:01:50saemWondering how this will work with CI's broader testing, but this might fix a bunch of conditional compilation issues: https://github.com/nim-lang/Nim/pull/17143 🤞
05:04:09leorize[m]nimvim?
05:05:19FromDiscord<Yjuq> What does the \` in nim actually means?
05:05:40saemWhoops
05:05:46saemneed to fix that typo
05:06:13FromDiscord<ElegantBeef> Depends on context in the quote do it implants the value of the nim node, outside it's for stropping
05:06:28leorize[m]more about stropping: https://nim-lang.org/docs/manual.html#lexical-analysis-stropping
05:07:01FromDiscord<Yjuq> Ah
05:07:08FromDiscord<Yjuq> Thanks
05:09:23FromDiscord<Yjuq> sent a code paste, see https://paste.rs/Gge
05:09:52FromDiscord<ElegantBeef> yea it's used a bit even in the stdlib, the `dom.div` proc
05:11:52FromDiscord<DARTHVADER NAXXX> Hello,↵what is the best packages to manipulate images `(imageman,nimage,stbimage)`?
05:12:33FromDiscord<ElegantBeef> flippy might work aswell
05:16:25FromDiscord<DARTHVADER NAXXX> thanks
05:20:41FromDiscord<y_yu> In reply to @ElegantBeef "<@!558157391657435143> hey i did": thank a lot
05:21:03FromDiscord<y_yu> (edit) "thank" => "thanks"
05:21:26FromDiscord<ElegantBeef> It's not the fastest but gives a you a place to start later 😛
05:36:18*narimiran joined #nim
05:46:49*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
05:46:58*njoseph joined #nim
05:47:40*njoseph quit (Client Quit)
05:47:48*njoseph joined #nim
06:02:11ForumUpdaterBotNew thread by Halloleo: Can't give testament compiler switches when running a pattern, see https://forum.nim-lang.org/t/7544
06:06:42*zedeus quit (Ping timeout: 260 seconds)
06:07:10*zedeus joined #nim
06:29:05*sz0 joined #nim
06:40:33*waleee-cl quit (Quit: Connection closed for inactivity)
06:53:55*wasted_youth2 quit (Quit: Leaving)
06:58:45*Sembei quit (Ping timeout: 264 seconds)
07:01:53*krux02 joined #nim
07:09:28*vicfred quit (Quit: Leaving)
07:11:56*Tlangir quit (Ping timeout: 240 seconds)
07:15:14*Tanger joined #nim
07:17:04*Sembei joined #nim
07:17:29*Tlangir joined #nim
07:19:58*Tanger quit (Ping timeout: 260 seconds)
08:41:18*Arrrrrrrr joined #nim
08:41:53*PMunch joined #nim
08:42:12*oculuxe quit (Ping timeout: 246 seconds)
08:45:18saem@Araq, FYI this is a blocker for building the IDE presently https://github.com/nim-lang/Nim/pull/17143. 😅 I couldn't sort out a minimised test case, but it's follow-on from the stability work merge. If it's not too offensive would appreciate a merge.
08:49:36PMunchBuilding he IDE?
08:50:09Clonkk[m]I'm guessing it's about the Nim VSCode extensions
08:57:43saemYeah
09:09:14*moleike joined #nim
09:09:30*moleike quit (Client Quit)
09:29:56*^Q-Master^ quit (Ping timeout: 240 seconds)
09:57:39*Q-Master joined #nim
10:02:22*Q-Master quit (Ping timeout: 260 seconds)
10:14:19FromDiscord<Kiloneie> @Araq Hey, you maybe got some time today ?
10:14:37*Kiloneie joined #nim
10:14:47ArrrrrrrrFor what?
10:16:59*Q-Master joined #nim
10:23:11*Kiloneie left #nim ("Leaving")
10:23:13FromDiscord<exelotl> https://media.discordapp.net/attachments/371759389889003532/813355204845895700/42689802_1962504587164766_7691432261220040704_n.png
10:30:07Arrrrrrrrwhat if we make --hint[conf]:off by default
10:35:30*Tlanger joined #nim
10:38:21*Tlangir quit (Ping timeout: 264 seconds)
10:42:54*abm joined #nim
11:17:54*rockcavera joined #nim
11:19:28*Vladar joined #nim
11:26:53*Q-Master quit (Read error: Connection reset by peer)
11:26:57*^Q-Master^ joined #nim
11:39:26*rinzlxr quit (Ping timeout: 260 seconds)
11:49:17*rinzlxr joined #nim
12:00:40*wasted_youth2 joined #nim
12:13:46*Tlanger quit (Quit: Leaving)
12:53:03*asdflkj_ joined #nim
13:00:48*xet7 quit (Remote host closed the connection)
13:01:25ForumUpdaterBotNew thread by Alexeypetrushin: How to implement universal `collection.pick(field_or_fn)`?, see https://forum.nim-lang.org/t/7545
13:01:37*xet7 joined #nim
13:05:26*xet7 quit (Remote host closed the connection)
13:17:22*clemens3 joined #nim
13:45:57FromDiscord<Jett> hello
13:46:08FromDiscord<Jett> how fast is nim compared to other languages?
13:46:20liblq-devfast as C
13:46:26FromDiscord<Jett> Oh shit really
13:46:31FromDiscord<Jett> (edit) "really" => "really?"
13:46:38liblq-devit depends on what you're doing though
13:46:42FromDiscord<Jett> Hmm
13:46:45liblq-devif your code is allocation-heavy it might be slower
13:46:55liblq-devbut still faster than interpreted languages for example
13:47:05FromDiscord<Jett> I just need something that won't be as sluggish with python
13:47:10FromDiscord<Jett> as python
13:47:26liblq-devnim could work, but keep in mind the ecosystem is still young
13:47:35liblq-devso there might not be packages for what you need
13:47:45FromDiscord<Jett> I would only need a websocket lib for what I want to do
13:47:49FromDiscord<Rika> Nim will not be as sluggish as Python provided the same algorithms are used to compare
13:47:56FromDiscord<Yardanico> @Jett https://github.com/treeform/ws
13:48:09liblq-devi was about to send that lol
13:48:34FromDiscord<Yardanico> i'm sleepy but my repo recognition brain interface still functions normally
13:49:07*Jettford joined #nim
13:49:27*Jettford quit (Client Quit)
13:50:10FromDiscord<Yardanico> @PMunch we both replied to https://forum.nim-lang.org/t/7545 :P
13:51:02PMunchOoh, that was the only issue?
13:51:31PMunchI for some reason thought that v.`field` wasn't recognised as calling
13:51:35*lritter joined #nim
13:51:35PMunchI must be tired :P
13:51:50FromDiscord<Yardanico> yeah typeof(T.field) or typeof(T().field) won't work if field is a proc
13:51:56FromDiscord<Yardanico> but typeof(list[0].field) works :P
13:52:02FromDiscord<Yardanico> in both cases
13:52:38PMunchYeah because T is `type tuple[name: string]`
13:52:47FromDiscord<Yardanico> yeah
13:52:49PMunchAnd the procedure doesn't take a type definition
13:53:22FromDiscord<Yardanico> well T() doesn't work either because you can't init a tuple that way
13:54:22PMunchThis works :P https://play.nim-lang.org/#ix=2QlZ
13:54:52PMunchNot in any way, shape, or form recommended though :P
13:54:52FromDiscord<Yardanico> wat
13:55:26PMunchT.`field` calls the template that returns `string` then v.`field` returns the actual strings :P
13:57:58FromDiscord<Yardanico> also seems like google started indexing some of the pages from my read-only forum frontend
13:58:05FromDiscord<Yardanico> "nimscript forum" ->
13:58:13FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/813409315003826186/unknown.png
13:58:49PMunchWhy did you make that?
13:59:14FromDiscord<Yardanico> just for fun, or maybe for when you just want to read nim forum without any JS
13:59:15FromDiscord<Yardanico> https://github.com/Yardanico/kuforum/
13:59:20FromDiscord<Yardanico> forum.my-toolbox.xyz
13:59:38FromDiscord<Yardanico> it's static HTML
13:59:50FromDiscord<Yardanico> since I just get that HTML from the nim forum via the API :P
14:05:03*xet7 joined #nim
14:13:01FromDiscord<arnetheduck> https://github.com/arnetheduck/nlvm/issues/28 - @Araq this would be inspiration for whatever's going on in the compiler
14:16:49FromDiscord<mratsim> In reply to @Rika "Nim will not be": except for strings.
14:27:44PrestigePMunch: the selector solution worked great btw, thanks :)
14:27:52PMunchOh nice .)
14:28:03PMunchI meant to ask you about that whenever I saw you online
14:32:42PrestigeI have it working, there's just an issue with 2 commands but it's unrelated to the ipc code. Haven't looked into it yet
14:52:22FromDiscord<dom96> In reply to @Yardanico ""nimscript forum" ->": You should rename it to not say Nim forum in its title lol
14:52:58FromDiscord<dom96> Oh. I thought it was another instance of Nim forum
15:15:07ForumUpdaterBotNew post on r/nim by Ericarthurc: Is it worth learning nim? (In my case), see https://reddit.com/r/nim/comments/lpqdqt/is_it_worth_learning_nim_in_my_case/
15:15:28*haxscramper joined #nim
15:16:50Clonkk[m]Is it possible to use the name of a ``importc`` proc as ``newCall`` argument inside a macro ?
15:18:00FromDiscord<Yardanico> Why not? importc'd procs don't differ from normal ones in this case
15:22:01*Clonkk[m] sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/IxZGPdciIdaLeyUzNkQykJjc/message.txt >
15:22:39Clonkk[m](Also I have like ~ 20 type to e=ncode and typing ``when... elif`` for each case is boring)
15:23:32*vicfred joined #nim
15:30:40FromDiscord<hamidb80> https://github.com/ksimka/go-is-not-good
15:30:43*waleee-cl joined #nim
15:31:59*PMunch quit (Quit: leaving)
15:33:04*PMunch joined #nim
15:34:46FromDiscord<Rika> ?
15:39:22FromDiscord<mratsim> offtopic
15:41:57*tane joined #nim
16:04:02FromDiscord<XxDiCaprioxX> hey, I was wondering is there a way to include c code in the same file the nim code is in?
16:04:09FromDiscord<neow> same search on startpage
16:04:12FromDiscord<neow> https://media.discordapp.net/attachments/371759389889003532/813441010406260766/unknown.png
16:04:19FromDiscord<neow> oh im 3 hours late
16:06:56PMunch@XxDiCaprioxX, check out the emit pragma
16:07:04FromDiscord<mratsim> In reply to @XxDiCaprioxX "hey, I was wondering": `{.emit: "my C code".}`
16:07:53FromDiscord<XxDiCaprioxX> alright thank you
16:09:26FromDiscord<XxDiCaprioxX> hm it doesnt show up in the manual
16:09:44Clonkk[m]https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-emit-pragma
16:10:12FromDiscord<XxDiCaprioxX> thank you
16:10:34*PMunch quit (Remote host closed the connection)
16:11:09FromDiscord<XxDiCaprioxX> and I can put the c-code directly into the `""" """`?
16:11:19Clonkk[m]Yup
16:11:25FromDiscord<XxDiCaprioxX> okay thanks
16:11:39Clonkk[m]Or if you prefer you can write a C file a,d use {.compile: "csrc.c".}
16:11:53Clonkk[m]https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compile-pragma
16:11:59FromDiscord<XxDiCaprioxX> I am limited to one file so that is the point why I asked
16:12:21Clonkk[m]You can also write a bash script that write both file for you if you really want to
16:12:34Clonkk[m]Simple solution are overrated
16:12:47Clonkk[m](I'm kidding please don't do that)
16:14:19FromDiscord<XxDiCaprioxX> xDD
16:19:38FromDiscord<XxDiCaprioxX> hold up - if I use {.compile: "csrc.c".} does it get compiled together into one .exe?
16:19:42FromDiscord<XxDiCaprioxX> then that solution might be better
16:20:57FromDiscord<mratsim> sure
16:21:07FromDiscord<mratsim> you can replace CMake or make with Nim
16:21:14FromDiscord<mratsim> and you can compile assembly files as well
16:21:24Clonkk[m]I believe compile will create an object file that will be linked with your Nim file
16:21:30FromDiscord<mratsim> https://github.com/status-im/nim-blscurve/blob/master/blscurve/blst/blst_lowlevel.nim#L25-L26
16:22:19FromDiscord<mratsim> replacing CMake: https://github.com/numforge/agent-smith/blob/master/third_party/ale_build.nim#L66-L83
16:22:32FromDiscord<XxDiCaprioxX> Actually hold up I just noticed sth
16:22:51FromDiscord<XxDiCaprioxX> Thank you for your help!
16:28:05FromDiscord<XxDiCaprioxX> Also - does nim have a module that allows one to work with images (like cropping and merging images)?
16:28:30FromDiscord<Rika> many, but depends on what formats you need
16:30:32FromDiscord<XxDiCaprioxX> ~~(does your pfp change every day o.O) ~~ only png is fine
16:31:26FromDiscord<Rika> no, it changes every few months
16:31:36FromDiscord<Rika> there is nimPNG
16:31:38FromDiscord<XxDiCaprioxX> oh then I just hit it lucky cuz yday it was different xD
16:31:44FromDiscord<XxDiCaprioxX> In reply to @Rika "there is nimPNG": thank you 😄
16:32:01FromDiscord<Rika> i mean you can also just search github `language:nim image`
16:35:18FromDiscord<Rika> nim js compiles to ES5 right?
16:45:43FromDiscord<XxDiCaprioxX> So uh, I wasn't quite able to understand how I put together two images from the github page. can someone tell me the proc for that?
16:47:15FromDiscord<Rika> i create a blank image that fits both images and i copy them both (given they have same dimension)
16:47:19FromDiscord<Rika> if not you can scale one
16:48:41FromDiscord<XxDiCaprioxX> Okay and if I want to place image A over a certain part of image B, is that possible?
16:48:54FromDiscord<Solitude> anything is possible
16:49:04FromDiscord<Rika> yeah im pretty sure thats easily doable
16:50:03FromDiscord<XxDiCaprioxX> Okay, good to hear.↵Now I just gotta work myself into how on earth png encoding works
16:50:51FromDiscord<Rika> with nimpng you dont need to deal with that
16:50:58FromDiscord<Solitude> dont use nimpng directrly, either use pixie or imageman
16:51:16FromDiscord<XxDiCaprioxX> Now that's conflicting crap
16:51:59FromDiscord<XxDiCaprioxX> Anyways, I will look into both
16:52:08FromDiscord<XxDiCaprioxX> Is there a documentation page for nimpng?
16:53:20FromDiscord<Rika> okay i think i didnt use nimpng for the combining images
16:53:25FromDiscord<Rika> i'd recommend imageman
16:53:44FromDiscord<XxDiCaprioxX> Okay thanks, if you both recommend it, imagemann it is
16:54:37FromDiscord<Rika> to ask again, nim compiles to ES5 right?
17:06:30FromDiscord<dom96> In reply to @Rika "to ask again, nim": I believe so, yes
17:06:56FromDiscord<Rika> oh hi dom haha how do you js module export on nim 😓
17:07:05FromDiscord<dom96> But note that any JS library can emit code. And that may or may not be ES5
17:07:23FromDiscord<dom96> In reply to @Rika "oh hi dom haha": Emit is your friend lol
17:07:34FromDiscord<Rika> okay so i just emit and exportc?
17:08:13FromDiscord<dom96> Yep. Pretty much. Do have a Google though, there might be better advice on the forums 🙂
17:10:48FromDiscord<Rika> js backend needs more love xd
17:15:30FromDiscord<mratsim> js.find("love") "FileNotFoundException"
17:18:54FromDiscord<XxDiCaprioxX> Ij ust realized `.add` is deprecated, what do I use now instead?
17:19:23FromDiscord<Solitude> which add
17:19:35FromDiscord<XxDiCaprioxX> seq
17:19:48FromDiscord<Solitude> ?
17:20:14FromDiscord<XxDiCaprioxX> `seq[T].add(content)` has deprecated since 1.4 it says
17:20:31FromDiscord<XxDiCaprioxX> oh wait no
17:20:33FromDiscord<XxDiCaprioxX> table
17:20:53FromDiscord<XxDiCaprioxX> (edit) "`seq[T].add(content)`" => "`Table[T].add(key, content)`"
17:21:35FromDiscord<Solitude> use table[key] = value
17:21:49FromDiscord<Solitude> or ignore the warning
17:21:52FromDiscord<XxDiCaprioxX> do I have to add the key beforehand or is it just included?
17:22:10FromDiscord<Solitude> you dont have to
17:22:33FromDiscord<XxDiCaprioxX> so it does literally the same, just with a different command
17:23:04FromDiscord<XxDiCaprioxX> ?
17:23:56FromDiscord<Solitude> no, add can add duplicate keys
17:24:17FromDiscord<XxDiCaprioxX> so with add I could have accidentally added a duplicate key
17:24:20FromDiscord<haxscramper> https://forum.nim-lang.org/t/7055
17:24:34FromDiscord<haxscramper> ^ about `.add` etc.
17:24:54FromDiscord<haxscramper> But in short - yes, `.add` can create duplicate values, which was more confusing than necessary
17:25:00FromDiscord<XxDiCaprioxX> okay thanks
17:25:38FromDiscord<XxDiCaprioxX> In reply to @haxscramper "^ about `.add` etc.": yeah I read that but I was not fully able to understand what was written and wanted to make sure it wouldn't break
17:27:42*xet7 quit (Quit: Leaving)
17:34:07FromDiscord<XxDiCaprioxX> umm is there a good way of dealing with the reoccurring issue of "could not load: zlib1.dll"
17:34:16FromDiscord<XxDiCaprioxX> sometimes it works, sometimes it doesnt
17:41:54FromDiscord<mratsim> use Linux
17:42:33FromDiscord<treeform> In reply to @XxDiCaprioxX "Okay, good to hear.": You can also checkout our very fast pure nim png loading/saving here: https://github.com/treeform/pixie/blob/master/src/pixie/fileformats/png.nim
17:43:23FromDiscord<mratsim> when PPM support :p
17:43:41FromDiscord<treeform> I don't even know what PPM is?
17:44:28FromDiscord<Kiloneie> Oo nice
17:44:42FromDiscord<mratsim> what you use for teaching graphics https://en.wikipedia.org/wiki/Netpbm#PPM_example
17:44:55FromDiscord<mratsim> https://raytracing.github.io/books/RayTracingInOneWeekend.html#outputanimage/theppmimageformat
17:45:19FromDiscord<mratsim> I have an exporter here: https://github.com/mratsim/trace-of-radiance/blob/master/trace_of_radiance/io/ppm.nim#L14-L49
17:46:20*rockcavera quit (Remote host closed the connection)
17:46:42FromDiscord<Rika> what can i do to see some "easy" perf. gains when using nim's js backend
17:47:03FromDiscord<mratsim> In reply to @Rika "what can i do": Google closure compiler
17:47:32FromDiscord<Rika> that can improve performance? TIL
17:48:42FromDiscord<mratsim> When I'm bored, maybe I'll explore Javascript performance but I'm already full with C/Assembly/Nim perf
17:50:42FromDiscord<Rika> yeah its because the peg i made in npeg is giving me like 500ms per run
17:52:06FromDiscord<mratsim> maybe compile it to a library/object file. AFAIK regexp/pcre does that.
17:52:16FromDiscord<Rika> i cannot, its to run in browser
17:54:08*Arrrrrrrr quit (Quit: Arrrrrrrr)
17:54:19FromDiscord<haxscramper> There is a pure nim regex implementation, and maybe you can try to use wasm (though I don't know anything wrt. to tradeoffs yet, but just compiling & running nim code via wasm turned out to be not that difficult)
17:59:26FromDiscord<Rika> no can do with the pure nim regex, not going to rewrite this massive peg into regex; i will look into wasm though
18:05:27FromDiscord<DARTHVADER NAXXX> In reply to @treeform "I don't even know": Neighbours from hell sprites depth conversion flashbacks
18:05:43FromDiscord<Rika> emscripten is what you guys use? or the 3rd party wasm backends thingies in gh?
18:08:47FromDiscord<haxscramper> emscripten
18:09:38FromDiscord<Rika> ok
18:09:42FromDiscord<haxscramper> I have a small example (about 1/2 of flags from what I found when I was searching for it too) - https://gist.github.com/haxscramper/0aef37a22c17cdf830fbe85f87de6188
18:09:50FromDiscord<Rika> thank you
18:11:49FromDiscord<haxscramper> And completely cursed one for using nim compiler in wasm https://github.com/haxscramper/hack/tree/master/testing/c/wasm/niminterop - it also shows how to interface nim functions in js code etc.
18:30:57Oddmongerwhen i debug nim exes with gdb, i have code printed in red in the tui mode
18:31:10Oddmongeri want to change it, but i don't see where it's defined
18:31:32*beeswax joined #nim
18:31:39Oddmonger« show style » doesn't show red style
18:33:35beeswaxHi! I've been playing around with the nim bencode example on Nim-Days. Have any of the more experienced devs here looked at the code? The code seems super repetitive, is that really what idiomatic nim looks like?
18:35:49liblq-devit's not
18:35:59liblq-devthe author just didn't engage their brain i think
18:36:03FromDiscord<haxscramper> Most likely nim-days author choose not to introduce any syntactic sugar because it was not really necessary
18:36:13liblq-devwe have `.toOrderedTable` which can shorten the table construction
18:36:39liblq-devin the first example
18:36:43liblq-devotherwise it looks ok
18:39:55beeswaxokay thanks for the info. What's the best way to get into nim actually? I've programmed in Python and C before it's just with the more advanced language features it becomes difficult to not miss the forest for the trees. I've been coding for a while but I'm not a CS major so it seems a little overwhelming at first
18:41:17liblq-devidk just write something in it
18:41:26liblq-devi learned nim mainly by trying to write a game engine in it
18:41:36FromDiscord<haxscramper> For general learning links you can also visit https://nim-lang.org/learn.html and look into tutorials if you haven't already. Then just find something to write in nim and go from there
18:41:53liblq-devso pick whatever tickles your fancy and code away
18:42:41beeswaxokay that's pretty much the answer I expected ;) Thank you!
18:47:06FromDiscord<apollo> In reply to @liblq-dev "i learned nim mainly": noice
18:47:47FromDiscord<apollo> In reply to @beeswax "okay thanks for the": if u ever needed something close to a CS degree i think this covers alot of stuff for free ↵http://cs50.harvard.edu/x/2021/
18:49:18FromDiscord<carpal> sent a long message, see http://ix.io/2QoA
18:49:26FromDiscord<carpal> (edit) "sent" => "I know that this is" | "long message, see http://ix.io/2QoA" => "stupid test, but why is this code so slow compared to the rust version?"
18:49:30FromDiscord<carpal> https://media.discordapp.net/attachments/371759389889003532/813482613796503582/d.png
18:51:35FromDiscord<carpal> maybe the stopwatch import?
18:52:04FromDiscord<carpal> is there a more reliable stopwatch include?
18:52:43Prestigecan you share the code instead of a screenshot?
18:52:56liblq-devhow did you compile the code?
18:53:37FromDiscord<Rika> what is stopwatch>
18:53:38liblq-devand
18:53:41liblq-devwhat is the rust version?
18:55:22FromDiscord<Solitude> and you can freely convert between byte and char without cast
18:55:56FromDiscord<carpal> sent a code paste, see https://play.nim-lang.org/#ix=2QoE
18:56:17FromDiscord<carpal> ah, this rot13 does not work lol, but it is for a missmatch alphabet count
18:56:37FromDiscord<carpal> In reply to @liblq-dev "what is the rust": something wrote very more bad
18:56:59liblq-devthat doesn't tell me anything.
18:57:02liblq-devplease send the rust code.
18:57:20FromDiscord<Recruit_main707> and nim compilation flags
18:57:21FromDiscord<Recruit_main707> pls
18:57:29liblq-devyeah
18:57:30FromDiscord<Solitude> idk wtf is stopwatch, you should just compare your programs with hyperfine
18:57:47liblq-devyeah, good idea too
18:58:15liblq-devgenerally you wanna compare the whole program runtime instead of just this small segment where it rot13-encodes the text
19:03:44FromDiscord<carpal> https://media.discordapp.net/attachments/371759389889003532/813486200458707014/main.rs
19:04:32FromDiscord<carpal> In reply to @Solitude "idk wtf is stopwatch,": hyperfine? I tried it some hours ago and got me 4 ms of execution with a program didn't anything lol
19:05:24FromDiscord<Solitude> In reply to @carpal "hyperfine? I tried it": what
19:05:38FromDiscord<carpal> https://gitlab.com/define-private-public/stopwatch
19:05:46FromDiscord<carpal> this is the stopwatch I used in nim
19:10:34*xet7 joined #nim
19:13:12FromDiscord<Rika> didnt use hyperfine, cba to install https://media.discordapp.net/attachments/371759389889003532/813488574623383562/unknown.png
19:13:43FromDiscord<Rika> they seem to be "the same"? though what the difference is in user time and system time, i do not know
19:14:52FromDiscord<Rika> using rust 1.49.0, nim devel
19:16:22FromDiscord<Rika> let me make the code "more equivalent" and use hyperfine
19:18:09FromDiscord<Rika> looks like it really is pretty much the same? https://media.discordapp.net/attachments/371759389889003532/813489823637569576/unknown.png
19:19:50FromDiscord<carpal> but you don't compile in release lol
19:20:29FromDiscord<Solitude> -O is release
19:21:27FromDiscord<Rika> bruh
19:21:35FromDiscord<Rika> i didnt use cargo, i used rustc
19:21:45FromDiscord<Rika> they use different parameters
19:21:50FromDiscord<Rika> http://stackoverflow.com/questions/45593026/ddg#45593027
19:22:18FromDiscord<carpal> okay using include "system/timers" it works fine
19:22:29FromDiscord<carpal> 124 nanos
19:22:36FromDiscord<Rika> okay
19:23:12FromDiscord<Rika> using the listed cmd there `rustc -C debuginfo=0 -C opt-level=3` gives the same speed
19:23:16FromDiscord<Rika> rather, results
19:23:36FromDiscord<carpal> mh but your computer is probably better than mine
19:23:46FromDiscord<carpal> you can't perform a test on different machines
19:24:23FromDiscord<Rika> then the tests are irrelevant, if test data is not comparable why even test
19:25:23FromDiscord<carpal> on my computer the rust version is performed in 500 nanos, but it uses function pointers and more heavy
19:26:03FromDiscord<Rika> then make the code equivalent again
19:32:11FromDiscord<carpal> yes
19:48:34*xet7 quit (Quit: Leaving)
19:55:39*kitech1- joined #nim
19:56:36*kitech1 quit (Ping timeout: 240 seconds)
20:01:33FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2Qp9
20:03:06FromDiscord<Anonymous Poet> in particular, i think the big challenge i have is figuring out how to set the name of the generated function, since nim interprets anything i pass in as a string
20:05:23liblq-dev@carpal that whole section with `isAlphabeticLetter` seems very redundant in your code, you can reduce that proc to just `proc isAlphabeticLetter(chr: char): bool = chr in {'a'..'z', 'A'..'Z'}`
20:06:12liblq-devbut i feel like you're overoptimizing such a dumb example
20:06:29FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2Qpd
20:06:49liblq-devthere are better things to optimize than rot13 which is like, not heavy at all :)
20:07:34FromDiscord<Seedofarson> bruh
20:07:35FromDiscord<hamidb80> https://media.discordapp.net/attachments/371759389889003532/813502267528970270/unknown.png
20:07:43FromDiscord<hamidb80> just wow
20:07:43FromDiscord<Seedofarson> I dont get functioons in this language
20:07:59FromDiscord<Seedofarson> if I want to make a function
20:08:05FromDiscord<Seedofarson> that just prints "hello world"
20:08:32FromDiscord<hamidb80> In reply to @Seedofarson "that just prints "hello": functions has no side effects
20:08:38FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qpg
20:08:40FromDiscord<Seedofarson> Huh
20:08:45FromDiscord<Seedofarson> thats my best guess
20:08:48FromDiscord<Seedofarson> wont work
20:08:48liblq-devah
20:08:50FromDiscord<Seedofarson> im coming from python
20:08:53FromDiscord<Anonymous Poet> sure it will
20:08:55FromDiscord<hamidb80> writing in stdout has sideeffect
20:08:58liblq-dev`proc hello() = echo "hello world"`
20:09:04liblq-devis the syntax in nim
20:09:11FromDiscord<Anonymous Poet> `proc != func`
20:09:15FromDiscord<Seedofarson> hmm
20:09:21liblq-devbut he's not even referring to func…
20:09:24liblq-devthey're*
20:09:27FromDiscord<Anonymous Poet> `func` = `proc {.noSideEffect.}`
20:09:31FromDiscord<Seedofarson> um
20:09:38FromDiscord<Seedofarson> whats difference between func and proc
20:09:39FromDiscord<Seedofarson> haha
20:09:42FromDiscord<Seedofarson> im coming from python
20:09:42liblq-devreally they were just confused about proc declaration syntax
20:09:45FromDiscord<Seedofarson> I feel so dumbrn
20:09:55FromDiscord<Seedofarson> (edit) "dumbrn" => "dumb rn"
20:09:57FromDiscord<Seedofarson> okay
20:10:02liblq-dev@Seedofarson, you see, Nim has an effect tracking system which helps you eliminate side effects like I/O
20:10:03FromDiscord<Seedofarson> lets get a more complicated example
20:10:13FromDiscord<Seedofarson> ?
20:10:27liblq-devif you're just a beginner don't worry about it
20:10:39liblq-devthe others were thinking you were referring to the `func` feature of the language
20:10:45FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qpi
20:10:52liblq-devwhich is a syntactic sugar for a `proc` with the {.noSideEffect.} pragma
20:11:10FromDiscord<Seedofarson> what is "{.noSideEffect.}"?
20:11:16*haxscramper quit (Remote host closed the connection)
20:11:27FromDiscord<hamidb80> In reply to @Seedofarson "what is "{.noSideEffect.}"?": it's a pragma
20:11:31FromDiscord<Seedofarson> elaborate
20:11:32FromDiscord<Anonymous Poet> you can think of it as a python decorator
20:11:36FromDiscord<Seedofarson> idk what pragma is either
20:11:38*haxscramper joined #nim
20:11:44liblq-devreally don't worry about it, you'll learn in due time
20:11:47FromDiscord<Rika> yall dinguses just confused them more
20:11:52FromDiscord<Anonymous Poet> it asks the compiler to enforce that your function wont have any effects on the programs state outside of its return value
20:11:54FromDiscord<Seedofarson> return function
20:11:58FromDiscord<Seedofarson> (edit) "return function" => "return?"
20:12:01FromDiscord<Seedofarson> uh
20:12:02FromDiscord<Seedofarson> yeah
20:12:04*haxscramper quit (Remote host closed the connection)
20:12:10FromDiscord<Seedofarson> I know what return is but
20:12:13FromDiscord<Rika> back to the issue at hand
20:12:24FromDiscord<Seedofarson> cuz
20:12:25liblq-devhttps://play.nim-lang.org/#ix=2Qpj
20:12:25FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qpi
20:12:28FromDiscord<Seedofarson> what you did
20:12:29liblq-devthis would be the syntax
20:12:31FromDiscord<Seedofarson> was put it all on one line
20:12:39FromDiscord<Seedofarson> ahhh
20:12:43FromDiscord<Seedofarson> so you need an equal sign
20:12:52liblq-devyes. nim uses `=` because `:` is used for types
20:13:06liblq-devso `proc aaa(): ` makes it expect a return type after the colon
20:13:13FromDiscord<Seedofarson> so like
20:13:22FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qpk
20:13:22FromDiscord<Anonymous Poet> you're assigning the "body" to the "name" of the function
20:13:36FromDiscord<Anonymous Poet> ignore that, its not important right now
20:13:39liblq-dev@Seedofarson yes
20:13:46FromDiscord<Seedofarson> ok
20:13:49FromDiscord<Seedofarson> what about returning something in nim
20:13:49liblq-devand you can put more lines after the echo ofc
20:13:51FromDiscord<Seedofarson> if I want
20:13:56FromDiscord<Seedofarson> sum(a,b)
20:13:57liblq-devthere are a few options
20:14:08liblq-devone is assigining to the implicit `result` variable
20:14:13liblq-devanother is using `return x`
20:14:26FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qpl
20:14:32liblq-devanother is just leaving the expression you want to return as the last statement in the procedure
20:14:38FromDiscord<Seedofarson> like that?
20:14:44FromDiscord<hamidb80> In reply to @hamidb80 "": @Rika , i thought the first example would give me an error
20:14:47liblq-devnim is a typed language, so you need type annotations
20:14:57FromDiscord<Seedofarson> hmmm
20:15:03liblq-devhttps://play.nim-lang.org/#ix=2Qpm
20:15:05liblq-devlike that
20:15:32liblq-devbecause you're returning a single expression, you can omit the `return` and just have `proc sum(a, b: int): int = a + b`
20:15:43FromDiscord<Seedofarson> um
20:15:44FromDiscord<Seedofarson> ok
20:15:44FromDiscord<Seedofarson> so
20:16:17FromDiscord<hamidb80> @Seedofarson i suggest take a look at this:↵https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers
20:16:36FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qpp
20:16:52FromDiscord<Seedofarson> there is no .upper in nim
20:16:56FromDiscord<Seedofarson> ofc
20:17:02FromDiscord<Seedofarson> but if there was
20:17:05FromDiscord<Rika> .toUpperAscii
20:17:08FromDiscord<Rika> in strutils
20:17:20liblq-devor .toUpper in unicode
20:17:20FromDiscord<Seedofarson> ah
20:17:24FromDiscord<Seedofarson> would that work?
20:17:30FromDiscord<Rika> no
20:17:34FromDiscord<Rika> missing equals sign
20:17:42FromDiscord<Rika> then it would work
20:17:47FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qpq
20:17:47FromDiscord<Rika> need to import strutils
20:17:48FromDiscord<Seedofarson> (edit) "https://play.nim-lang.org/#ix=2Qpp" => "https://play.nim-lang.org/#ix=2Qpq"
20:17:49FromDiscord<Seedofarson> yay
20:17:56FromDiscord<Rika> (edit) "import strutils" => "`import strutils`"
20:18:01FromDiscord<Rika> at the top
20:18:05FromDiscord<Rika> "like python"
20:18:34FromDiscord<Seedofarson> yeah
20:19:21FromDiscord<Seedofarson> ok
20:19:26FromDiscord<Seedofarson> so
20:19:30FromDiscord<Seedofarson> I jumped forwards to that
20:19:30FromDiscord<Seedofarson> sent a code paste, see https://paste.rs/exn
20:19:38FromDiscord<Seedofarson> how do I declare that it is a string
20:19:38FromDiscord<Rika> no need to echo, there is no return value
20:19:41FromDiscord<Seedofarson> or w/e
20:19:47FromDiscord<Rika> oh
20:19:50FromDiscord<Rika> you changed it to return
20:19:56FromDiscord<Seedofarson> yeah
20:20:26FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=2Qpt
20:20:41FromDiscord<Rika> you should really just read the manual, it might be faster
20:20:53FromDiscord<Seedofarson> alright
20:23:47FromDiscord<IndianGoldSmith> @Seedofarson Here us a youtube video series for beginners. ↵https://www.youtube.com/watch?v=5tVIsDYPClA&list=PLvwc2YT9MFOlPPexrsY-t7BNTdg2Vsx06
20:23:55FromDiscord<IndianGoldSmith> (edit) "<@!798398880584171530>" => "@Seedofarson" | "us" => "is"
20:24:12FromDiscord<Solitude> https://nim-lang.org/docs/tut1.html
20:25:51reversem3anyone using wasmrt on maxOSX?
20:26:11*beeswax quit (Quit: leaving)
20:27:28reversem3Has anyone seen Yuriy ?
20:31:56FromDiscord<mratsim> I have seen him. Over a year ago.
20:32:02FromDiscord<mratsim> at FOSDEM
20:32:25reversem3umm.. ok
20:34:43*Kiloneie joined #nim
20:35:01*Kiloneie quit (Client Quit)
20:36:17FromDiscord<Seedofarson> how do I compile something with "-d:ssl"
20:37:03liblq-devjust compile it but add `-d:ssl` to the command, before your program's filename
20:37:11liblq-devlike `nim r -d:ssl file`
20:37:46FromDiscord<Seedofarson> ty
20:44:52*reversem3 sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/FOjsnEnLoSeiSjRaNJzuMBtZ/message.txt >
20:45:20reversem3https://github.com/yglukhov/nimx/blob/master/nimx/layout_vars.nim
20:46:26FromDiscord<carpal> In reply to @liblq-dev "<@699146708466008115> that whole section": it is not the same thing, else I used utils lol
20:46:36FromDiscord<Hi02Hi> In reply to @liblq-dev "like `nim r -d:ssl": isnt it `nim c -r -d:ssl file` intead of `nim r -d:ssl file` ?
20:46:47FromDiscord<Rika> theyre not equivalent
20:47:00FromDiscord<Rika> former puts binary in pwd, latter puts binary in cache folder
20:47:12liblq-devit… is?
20:47:13FromDiscord<Seedofarson> ty
20:47:13liblq-devit compiles down to the same code
20:47:16FromDiscord<Seedofarson> it worked
20:47:24FromDiscord<Seedofarson> im trying to execute a discorrd webhook in nim's httpclient
20:47:26FromDiscord<Seedofarson> lol
20:47:44liblq-devyeah
20:47:45liblq-dev`nim r` is new
20:48:17FromDiscord<exelotl> nim r is cool
20:50:12FromDiscord<Rika> i mean equivalent in functionality
20:50:18FromDiscord<Rika> they dont do the same thing
20:50:38FromDiscord<Rika> or do you mean to carpal, i just realized
20:51:41reversem3I don't see any -newExpression in kiwi https://github.com/yglukhov/kiwi/blob/master/kiwi/expression.nim
20:54:49FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2QpH
20:55:14FromDiscord<hamidb80> A nested proc can have generic parameters only when it is used as an operand to another routine and the types of the generic paramers can be inferred from the expected signature.
20:55:34FromDiscord<hamidb80> In reply to @Seedofarson "is there any other": strformat module
20:55:48FromDiscord<Seedofarson> import strformat
20:56:02FromDiscord<hamidb80> In reply to @Seedofarson "import strformat": https://nim-lang.org/docs/strformat.html
20:56:37FromDiscord<hamidb80> In reply to @hamidb80 "A nested proc can": any idea?
20:59:13FromDiscord<mratsim> Was there a question?
20:59:50FromDiscord<Seedofarson> ty
21:00:13FromDiscord<hamidb80> https://media.discordapp.net/attachments/371759389889003532/813515507634012190/unknown.png
21:00:59FromDiscord<carpal> In reply to @liblq-dev "it… is?": are you referring to my message?
21:01:15liblq-dev@carpal yea
21:01:28FromDiscord<carpal> mhhh
21:01:30FromDiscord<Seedofarson> the thing is
21:01:36FromDiscord<carpal> I don't think it
21:01:46FromDiscord<Seedofarson> I am trying to put variables in a json string and they are full of "{"'s
21:01:51FromDiscord<hamidb80> In reply to @hamidb80 "": i can't understant what compiler trying to say
21:01:57FromDiscord<Seedofarson> so
21:02:03FromDiscord<carpal> in is an operator, what I wrote is a logic solution
21:02:08FromDiscord<Seedofarson> idk how to put varibales in it
21:02:57FromDiscord<mratsim> In reply to @hamidb80 "i can't understand what": why do you have a dangling `;`
21:02:59FromDiscord<Seedofarson> (edit) "varibales" => "variables"
21:03:02*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
21:03:17FromDiscord<mratsim> on line 26
21:03:33FromDiscord<Seedofarson> guy's
21:03:40FromDiscord<Seedofarson> if I want to put variables in a json string
21:03:44FromDiscord<Seedofarson> I cat use strformat
21:03:48*pbb joined #nim
21:03:52FromDiscord<Seedofarson> cuz there are already so many curly brackets
21:04:22FromDiscord<hamidb80> In reply to @mratsim "why do you have": you can write `using ti: TerminalInteractable` and then wherever in your function calls `ti` type would be `TerminalInteractable`
21:04:34FromDiscord<hamidb80> (edit) "calls" => "parameter list"
21:04:47*pbb quit (Client Quit)
21:04:56FromDiscord<mratsim> that doesn't mean that `proc foo(ti;)` is valid though
21:05:10FromDiscord<mratsim> shouldn't it be `proc foo(ti)` ?
21:05:18FromDiscord<hamidb80> In reply to @mratsim "that doesn't mean that": it's valid
21:05:28*pbb joined #nim
21:05:40FromDiscord<mratsim> the error points to that line and pretty sure it's the parser erroring
21:05:47FromDiscord<neow> it's the other file
21:05:58PrestigeHm I need pmunch to magically appear
21:06:17FromDiscord<neow> it's pointing to ttunnel.nim (left) not tunnel.nim (right)
21:06:51FromDiscord<hamidb80> In reply to @mratsim "the error points to": it refers to the other file (left side that is shown in screenshoft
21:07:06FromDiscord<hamidb80> (edit) "screenshoft" => "screenshot"
21:07:10FromDiscord<Solitude> In reply to @Seedofarson "guy's": https://nim-lang.org/docs/strformat.html#fmt.m%2Cstring%2Cchar%2Cchar
21:07:10FromDiscord<mratsim> oh right
21:07:52FromDiscord<mratsim> try using the proc syntax, the sugar is finicky from time to time.
21:08:21FromDiscord<mratsim> This is something that we need to solve because right now lambdas are a really clunky
21:10:57FromDiscord<hamidb80> In reply to @mratsim "This is something that": wow
21:11:08FromDiscord<hamidb80> i replaced it with a simple proc
21:11:23FromDiscord<hamidb80> i think that's kinda bug
21:11:46FromDiscord<Rika> its more of a quirk of sugar i guess
21:12:42FromDiscord<mratsim> It actually become worse
21:14:51FromDiscord<mratsim> looking for the example
21:16:13FromDiscord<konsumlamm> In reply to @hamidb80 "i can't understand what": have you also tried annotating `s` (the lambda parameter)?
21:16:50FromDiscord<hamidb80> In reply to @konsumlamm "have you also tried": (s:string) => ... ?
21:16:54liblq-dev@carpal `in` is an operator, just like `>=` and `<=` are operators. good observation.
21:17:00FromDiscord<konsumlamm> In reply to @hamidb80 "(s:string) => ... ?": ye
21:17:49FromDiscord<hamidb80> In reply to @konsumlamm "ye": that works
21:17:51FromDiscord<hamidb80> wow
21:17:55FromDiscord<hamidb80> why?!
21:18:01FromDiscord<hamidb80> 😕
21:18:58FromDiscord<konsumlamm> lambdas can't infer generic arguments and apparently your lambda uses a generic proc
21:19:37FromDiscord<mratsim> This one is fun: https://github.com/nim-lang/Nim/issues/8432
21:21:56FromDiscord<mratsim> well I can't find it again but I remember that for one of Arraymancer functions I suddently had to add some {.nimcall, gcsafe.} where Nim could previously infer that
21:23:43liblq-dev@carpal https://godbolt.org/z/33hj6W
21:24:05liblq-devthe assembly produced by `c in 'a'..'z'` and `c >= 'a' and c <= 'z'` is exactly the same
21:27:35FromDiscord<mratsim> the C code is different though
21:27:41FromDiscord<Seedofarson> how would I do for charcter in string?
21:27:44FromDiscord<mratsim> 'a'..'z' should use the GCC range extension
21:28:20FromDiscord<Seedofarson> just
21:29:25*rockcavera joined #nim
21:33:54FromDiscord<Seedofarson> im
21:33:55FromDiscord<Seedofarson> so confusde
21:33:58FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2QpV
21:34:00FromDiscord<Seedofarson> im trying to stop bothering yall
21:34:05FromDiscord<Seedofarson> and figure it out on my own
21:34:06FromDiscord<Seedofarson> but
21:34:10FromDiscord<Seedofarson> im actually stupid
21:34:10FromDiscord<Seedofarson> lol
21:37:40FromDiscord<hamidb80> In reply to @Seedofarson "im actually stupid": don't say that word
21:39:21FromDiscord<hamidb80> In reply to @Seedofarson "``` proc sprint(message: string):": this code doesn't have any problem
21:39:34FromDiscord<hamidb80> (edit) "In reply to @Seedofarson "``` proc sprint(message: string):": ... this" 03added "there is no problem with" | 04removed "doesn't have any problem"
21:39:35*narimiran quit (Ping timeout: 260 seconds)
21:40:35FromDiscord<Seedofarson> expression 'sprint("hello")' is of type 'string' and has to be used (or discarded)
21:41:04FromDiscord<hamidb80> In reply to @Seedofarson "expression 'sprint("hello")' is of": your `sprint` returns a value with type of `string`
21:41:41FromDiscord<Seedofarson> ohhhh
21:41:42FromDiscord<Seedofarson> so
21:41:43FromDiscord<Seedofarson> I have to do
21:41:44FromDiscord<Seedofarson> echo(sprint("test"))
21:41:49FromDiscord<Seedofarson> also
21:42:01FromDiscord<Seedofarson> there are \n's between all the characters
21:42:42FromDiscord<hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=2Qq0
21:43:12FromDiscord<hamidb80> (edit) "https://play.nim-lang.org/#ix=2Qq0" => "https://play.nim-lang.org/#ix=2Qq2"
21:43:47FromDiscord<Seedofarson> hmm
21:43:47FromDiscord<Seedofarson> ok
21:43:55FromDiscord<Seedofarson> there aare still \n's between
21:44:00FromDiscord<Seedofarson> but
21:44:12FromDiscord<hamidb80> In reply to @Seedofarson "there aare still \n's": oh , if you dont want new line
21:44:25FromDiscord<hamidb80> you can use `stdout.write "some things"`
21:44:39FromDiscord<Seedofarson> ahhh
21:44:40FromDiscord<Seedofarson> tysm
21:45:56FromDiscord<Seedofarson> hmm
21:45:57FromDiscord<Seedofarson> wait
21:46:01FromDiscord<Seedofarson> it still writes the whole thing at once
21:46:02FromDiscord<Seedofarson> idk why
21:46:09FromDiscord<Seedofarson> (edit) "still" => "just"
21:46:10FromDiscord<hamidb80> In reply to @Seedofarson "idk why": ??
21:46:17FromDiscord<hamidb80> ah
21:46:25FromDiscord<hamidb80> sleep takes milisecconds
21:46:30FromDiscord<hamidb80> (edit) "sleep" => "`sleep`"
21:46:41FromDiscord<hamidb80> ok?
21:46:52FromDiscord<hamidb80> (edit) "milisecconds" => "miliseconds"
21:47:03FromDiscord<hamidb80> (edit) "ah" => "oh"
21:47:29FromDiscord<Seedofarson> https://ideone.com/eXTxOm
21:47:30FromDiscord<Seedofarson> ik
21:47:32FromDiscord<Seedofarson> I did 1000
21:47:34FromDiscord<Seedofarson> and it just waited
21:47:35FromDiscord<Seedofarson> a second
21:47:36FromDiscord<Seedofarson> then
21:47:38FromDiscord<Seedofarson> printed
21:48:24FromDiscord<Seedofarson> nvm
21:48:27FromDiscord<Seedofarson> its a repl.it thing
21:48:27FromDiscord<Seedofarson> lol
21:48:28FromDiscord<hamidb80> stdout.write "k"↵ stdout.flushFile
21:48:34FromDiscord<hamidb80> (edit) ""k"↵ stdout.flushFile" => ""k"↵stdout.flushFile"
21:48:53FromDiscord<hamidb80> (edit) ""k"↵stdout.flushFile" => ""some thing"↵stdout.flushFile"
21:50:28FromDiscord<Seedofarson> sent a code paste, see https://paste.rs/erV
21:50:40FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qq7
21:50:51FromDiscord<hamidb80> In reply to @Seedofarson "``` proc sprint(message: string,": sleep(int) ??
21:50:55*madnight joined #nim
21:51:01FromDiscord<Seedofarson> ohhh
21:51:01FromDiscord<Seedofarson> lmao
21:51:02FromDiscord<Seedofarson> my bad
21:51:15FromDiscord<hamidb80> i think you wanted to write `sleep sleeptime`
21:51:23FromDiscord<Seedofarson> yeah
21:51:24FromDiscord<Seedofarson> lol
21:51:28FromDiscord<Seedofarson> haha
21:51:31FromDiscord<Seedofarson> tysm bruh
21:52:06FromDiscord<hamidb80> oh that 1 AM
21:53:07FromDiscord<hamidb80> i should go to sleep
21:55:10FromDiscord<Seedofarson> hmmm
21:55:15FromDiscord<Seedofarson> how could I add an optional param
21:55:38FromDiscord<Seedofarson> I want to add an optional parameter that if is filled doesnt add a newline at the end
21:55:55*FromDiscord quit (Remote host closed the connection)
21:56:10*FromDiscord joined #nim
21:56:29FromDiscord<Seedofarson> if the parameter is not passed than it adds a "\n" at the end
21:56:38FromDiscord<Seedofarson> if a parameter is passed, then it doesnt add the "\n"
21:56:44FromDiscord<Seedofarson> @hamidb80
21:58:23FromDiscord<hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=2Qqb
21:59:29reversem3seriously why would something work fine on linux but on macosx ?
21:59:57FromDiscord<hamidb80> In reply to @reversem3 "seriously why would something": what is that `something`?
22:00:02reversem3/Users/.env/nim/nimx/nimx/layout_vars.nim(19, 32) Error: type mismatch: got <Variable>
22:00:25reversem3but I can build nimx and rod just fine on linux
22:00:38FromDiscord<hamidb80> In reply to @reversem3 "/Users/.env/nim/nimx/nimx/layout_vars.nim(19, 32) E": i think you should ask in froum
22:00:51reversem3ok
22:02:57FromDiscord<Seedofarson> yay
22:03:02FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2QoU
22:03:06FromDiscord<Seedofarson> I did sleep(0) lmao
22:03:12FromDiscord<Seedofarson> whats the equivalent of "pass" in nim
22:03:39FromDiscord<juan_carlos> discard
22:03:55FromDiscord<Seedofarson> hhaa
22:03:58FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qqi
22:03:59FromDiscord<Seedofarson> final function!!!
22:05:09ForumUpdaterBotNew thread by Reversem3: Building nimx and rod on MacOSX (get error, but not using linux), see https://forum.nim-lang.org/t/7546
22:12:18FromDiscord<Seedofarson> are there "and" or "or" statements in nim if statements?
22:13:20reversem3https://nim-lang.org/docs/tut1.html#control-flow-statements
22:14:28FromDiscord<Seedofarson> like that?
22:14:29FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qqm
22:15:41*tane quit (Quit: Leaving)
22:15:51FromDiscord<ElegantBeef> That's not a feature of if statments it's boolean logic
22:33:33*Vladar quit (Quit: Leaving)
22:35:34*qwr quit (Ping timeout: 244 seconds)
22:40:41*qwr joined #nim
22:44:34*xet7 joined #nim
22:47:22FromDiscord<carpal> sent a long message, see http://ix.io/2QqA
22:56:30FromDiscord<ElegantBeef> nope it's `initMyType`
22:56:50FromDiscord<ElegantBeef> The reason we use `init` and `new` is it tells you in the construction where the object exists
22:57:27FromDiscord<ElegantBeef> intializing happens on the stack, new objects are created on the heap
23:00:30FromDiscord<ElegantBeef> @Anonymous Poet hey, it kinda works now(global fields dont work atm) https://media.discordapp.net/attachments/371759389889003532/813545779087147038/unknown.png
23:01:13FromDiscord<ElegantBeef> I say global but i mean base object fields outside a case statement
23:02:33FromDiscord<Seedofarson> hey guys
23:02:38FromDiscord<Seedofarson> I just finsihed my first program
23:02:40FromDiscord<Seedofarson> gg
23:02:45FromDiscord<ElegantBeef> Congrats
23:02:55FromDiscord<Seedofarson> idk if im allowed to share
23:03:15FromDiscord<Seedofarson> https://media.discordapp.net/attachments/371759389889003532/813546472234156042/firstnim.exe
23:03:22FromDiscord<Seedofarson> https://media.discordapp.net/attachments/371759389889003532/813546502886129694/firstnim.nim
23:03:26FromDiscord<Seedofarson> suorce code
23:03:26FromDiscord<Seedofarson> and
23:03:29FromDiscord<Seedofarson> nim
23:03:43FromDiscord<Seedofarson> in the source code there are some functions that I dont use, they are what I used to learn
23:03:44FromDiscord<ElegantBeef> No point sharing a binary, plus you can just through the source code on https://play.nim-lang.org/
23:03:46FromDiscord<Seedofarson> you can ignore them
23:04:28FromDiscord<Seedofarson> https://play.nim-lang.org/#ix=2QqI
23:04:59*xet7 quit (Ping timeout: 260 seconds)
23:05:12FromDiscord<ElegantBeef> Isnt that webhook url supposed to be kept secret?
23:07:34FromDiscord<ElegantBeef> Also you can replace a lot of those if statements with a case statment
23:12:06FromDiscord<ElegantBeef> @Seedofarson less repetitive code and more readable https://play.nim-lang.org/#ix=2QqL
23:13:15FromDiscord<Seedofarson> ahh
23:13:15FromDiscord<Seedofarson> ok
23:17:26FromDiscord<Seedofarson> bro
23:17:30FromDiscord<Seedofarson> nim is such a goated language
23:18:59krux02goated?
23:19:36FromDiscord<ElegantBeef> Nothing makes me feel out of the loop more than seeing someone say something i have 0 clue what it means
23:21:33FromDiscord<Yjuq> Can I access if something is compiled with the backend c or cpp?
23:21:45FromDiscord<Yjuq> (edit) "access" => "determine"
23:22:08FromDiscord<Yjuq> (edit) "determine" => "determine/access (don't know a better english word xd)"
23:22:52FromDiscord<Yjuq> (edit) "determine/access (don't know a better english word xd)" => "detect"
23:23:11FromDiscord<ElegantBeef> `when defined(c)`
23:23:17FromDiscord<Rika> greatest of all time-ed i believe, krux
23:23:43krux02good
23:23:55krux02;)
23:24:01FromDiscord<Rika> i wish it was better but wishing gets us nowhere
23:24:42FromDiscord<Yjuq> In reply to @ElegantBeef "`when defined(c)`": thanks
23:32:56FromDiscord<Seedofarson> lmao
23:33:05FromDiscord<Seedofarson> Greatest↵Of↵All↵Time
23:33:10FromDiscord<Seedofarson> GOAT
23:33:15FromDiscord<Seedofarson> goated
23:33:39FromDiscord<Yjuq> If I {.push.} a calling convention in a file and don't pop it in the end, does this influence the files where I import this particular file?
23:34:14FromDiscord<Yjuq> (edit) "pop" => "{.pop.}"
23:35:10FromDiscord<Yjuq> Is a calling convention even needed if I get them out of a c header?
23:35:24FromDiscord<Yjuq> How does it interact with a cpp backend and a c header?
23:35:28*wasted_youth2 quit (Quit: Leaving)
23:35:51FromDiscord<Yjuq> Don't know what nim does in the background. sigh :(
23:49:06*krux02 quit (Remote host closed the connection)