<< 10-04-2021 >>

00:15:04FromDiscord<Gennadiy> Why is this advice given in the `sequtils` section of the docs: "Instead of using map and filter, consider using the collect macro from the sugar module."?
00:21:54*krux02 quit (Remote host closed the connection)
00:26:11FromDiscord<ElegantBeef> cause the collect module can be more idiomatic
00:28:39FromDiscord<Hi02Hi> ah yes, the collect module
00:29:16FromDiscord<Hi02Hi> isnt another reason that the collect macro makes less copies?
00:30:31FromDiscord<ajusa> okay, this is going to seem like a dumb question, but how do I convert a cstring to a string for the JS backend? I tried `echo $(data.hashPart).type` but this prints out cstring
00:33:30FromDiscord<ElegantBeef> Ah yea macro πŸ˜„
00:33:56FromDiscord<ElegantBeef> Yea it doesnt do each in a step it's all at once
00:37:28FromDiscord<Gennadiy> It's such a shame because the collect macro is much more verbose.
00:39:11FromDiscord<ElegantBeef> I mean you can use whatever you want
00:43:39FromDiscord<Gennadiy> Yes, but if using map and filter are less efficient, then I may have to use collect.
00:59:45*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:00:04*njoseph joined #nim
01:02:52*lf_ joined #nim
01:08:46*Amun_Ra quit (Quit: Gdyby mi siΔ™ chciaΕ‚o tak jak mi siΔ™ nie chce…)
01:22:54*Amun_Ra joined #nim
02:09:57*rockcavera quit (Remote host closed the connection)
02:17:45*lf_ quit (Quit: lf_)
02:18:21*lf_ joined #nim
02:29:34*kwilczynski quit (Ping timeout: 245 seconds)
02:32:07*kwilczynski joined #nim
02:36:26*fredrikhr quit (Ping timeout: 240 seconds)
02:38:41FromDiscord<ajusa> sent a code paste, see https://paste.rs/UJT
02:38:53FromDiscord<ajusa> (edit) "https://play.nim-lang.org/#ix=2Vzd" => "https://play.nim-lang.org/#ix=2Vze"
02:53:26*rockcavera joined #nim
02:57:09*leorize quit (Ping timeout: 240 seconds)
02:58:20*lf_ quit (Quit: lf_)
02:59:31*leorize joined #nim
03:28:07*spiderstew joined #nim
03:28:19*spiderstew_ quit (Ping timeout: 248 seconds)
03:37:11FromDiscord<Esther> hey quick q: does nim automatically initialise values to zero? like if I declare `var f: float` can I safely assume it has the value 0.0 to start with?
03:37:32FromDiscord<ajusa> I believe so
03:38:37FromDiscord<Esther> awesome
03:38:43FromDiscord<Esther> guess I could test that in a few seconds but waa
03:41:50FromDiscord<ElegantBeef> Yea it does default all values
03:42:53FromDiscord<ElegantBeef> there is a `var f {.noinit.}: float` if you want to override that behaviour
03:44:03FromDiscord<ElegantBeef> Also the same rule applies to objects they're 0-inited
03:45:40FromDiscord<Esther> nah I do want it, saves me setting my arrays to 0 for default return values
03:45:49FromDiscord<Esther> ty for the info
03:45:49FromDiscord<ElegantBeef> you dont even need to do that
03:46:13FromDiscord<ElegantBeef> What i mean is you dont need a default return value πŸ˜„
03:46:20FromDiscord<ElegantBeef> Assuming you dont know about `result`
03:46:24FromDiscord<Esther> I do hahah
03:46:42FromDiscord<Esther> I just mean I'm hoping result doesn't contain garbage floats if I don't fill it with zeroes myself
03:47:09FromDiscord<Esther> (btw result is like the best thing ever, why on earth don't other languages do this)
03:47:20FromDiscord<ElegantBeef> I concur with the aside
03:47:31FromDiscord<ElegantBeef> but it'll be for of 0s
03:47:34FromDiscord<ElegantBeef> (edit) "for" => "full"
03:47:36FromDiscord<Esther> awesome
03:48:55FromDiscord<ElegantBeef> Worth getting inim for things like this
03:48:58FromDiscord<ElegantBeef> `nimble install inim`
03:49:05FromDiscord<ElegantBeef> It's a good repl
04:02:49FromDiscord<Esther> oh whoa I had no idea
04:02:51FromDiscord<Esther> ;0
04:03:17FromDiscord<ElegantBeef> Lol it's perfect for small things, that and your `/tmp/` folder
04:03:33FromDiscord<ElegantBeef> Though the latter is a terrible idea to do anything serious in, pmunch lost a lot of work that way πŸ˜„
04:03:39FromDiscord<Esther> I'm on windows :PepeHands:
04:03:45FromDiscord<ElegantBeef> Well sucks to suck
04:03:51FromDiscord<Esther> aye
04:04:12FromDiscord<Esther> okay wait msys2 has /tmp
04:04:17FromDiscord<Esther> I just don't use it Β―\_(ツ)_/Β―
04:04:40FromDiscord<ElegantBeef> It has to have a temp file somewhere probably `%tempdir%`
04:05:59FromDiscord<Esther> windows has %TEMP% I think idk
04:15:44FromDiscord<Rika> In reply to @Esther "(btw result is like": some people argue it can lead to unhandled cases
04:15:48FromDiscord<Rika> which is true
04:16:01FromDiscord<Rika> in which case expression-return would be better
04:16:16FromDiscord<Rika> compiler would catch cases where no return value is given
04:16:41FromDiscord<hamidb80> why cant i do this πŸ€” 😐 https://media.discordapp.net/attachments/371759389889003532/830295191709024267/unknown.png
04:17:10*shodan45 quit (*.net *.split)
04:17:10*FromDiscord quit (*.net *.split)
04:17:10*revere quit (*.net *.split)
04:17:10*ldlework quit (*.net *.split)
04:17:10*acidx quit (*.net *.split)
04:17:10*jken quit (*.net *.split)
04:17:10*leorize quit (*.net *.split)
04:17:10*motersen quit (*.net *.split)
04:17:10*sekao[m] quit (*.net *.split)
04:17:10*Avahe[m] quit (*.net *.split)
04:17:10*fbpyr[m] quit (*.net *.split)
04:17:10*watzon quit (*.net *.split)
04:17:10*jess quit (*.net *.split)
04:17:10*d10n-work quit (*.net *.split)
04:17:10*hoek quit (*.net *.split)
04:17:10*npgm quit (*.net *.split)
04:17:10*FlammableDuck[m] quit (*.net *.split)
04:17:10*solitudesf quit (*.net *.split)
04:17:11*blackbeard420 quit (*.net *.split)
04:17:11*EastByte quit (*.net *.split)
04:17:11*bozaloshtsh quit (*.net *.split)
04:17:11*kwilczynski quit (*.net *.split)
04:17:11*Amun_Ra quit (*.net *.split)
04:17:11*njoseph quit (*.net *.split)
04:17:11*Gustavo6046 quit (*.net *.split)
04:17:11*Jeff[m]2 quit (*.net *.split)
04:17:11*zedeus quit (*.net *.split)
04:17:11*gangstacat quit (*.net *.split)
04:17:11*pbb quit (*.net *.split)
04:17:11*teasea quit (*.net *.split)
04:17:11*ehmry quit (*.net *.split)
04:17:11*giaco__ quit (*.net *.split)
04:17:11*mwbrown quit (*.net *.split)
04:17:11*kaliy quit (*.net *.split)
04:17:11*voidpi quit (*.net *.split)
04:17:11*Eyess quit (*.net *.split)
04:17:11*fmaruki quit (*.net *.split)
04:17:11*Araq quit (*.net *.split)
04:17:11*vicfred quit (*.net *.split)
04:17:12*def- quit (*.net *.split)
04:17:12*mal`` quit (*.net *.split)
04:17:12*beenz quit (*.net *.split)
04:17:12*so_ quit (*.net *.split)
04:17:12*Technisha[m] quit (*.net *.split)
04:17:12*guelosk[m] quit (*.net *.split)
04:17:12*Clonkk[m] quit (*.net *.split)
04:17:12*anoj[m] quit (*.net *.split)
04:17:12*jfondren[m] quit (*.net *.split)
04:17:12*Avatarfighter[m] quit (*.net *.split)
04:17:12*GitterIntegratio quit (*.net *.split)
04:17:12*unclechu quit (*.net *.split)
04:17:12*Northstrider[m] quit (*.net *.split)
04:17:12*dom96 quit (*.net *.split)
04:17:12*Simon[m]5 quit (*.net *.split)
04:17:12*Onionhammer quit (*.net *.split)
04:17:13*arecaceae quit (*.net *.split)
04:17:13*koltrast_ quit (*.net *.split)
04:17:13*qwr quit (*.net *.split)
04:17:13*hyiltiz quit (*.net *.split)
04:17:13*lain quit (*.net *.split)
04:17:13*MightyJoe quit (*.net *.split)
04:17:13*blueberrypie quit (*.net *.split)
04:17:13*ForumUpdaterBot quit (*.net *.split)
04:17:13*antranigv quit (*.net *.split)
04:17:13*ShalokShalom[m] quit (*.net *.split)
04:17:13*m33[m] quit (*.net *.split)
04:17:13*MTRNord quit (*.net *.split)
04:17:13*goblinslayer[m] quit (*.net *.split)
04:17:13*liblq-dev quit (*.net *.split)
04:17:13*reversem3 quit (*.net *.split)
04:17:13*antholop[m] quit (*.net *.split)
04:17:13*robertmeta quit (*.net *.split)
04:17:13*fowl quit (*.net *.split)
04:17:13*JStoker quit (*.net *.split)
04:17:13*zopsi quit (*.net *.split)
04:17:13*icebattle quit (*.net *.split)
04:17:13*sknebel quit (*.net *.split)
04:17:13*Ekho quit (*.net *.split)
04:17:13*astronavt quit (*.net *.split)
04:17:13*oz quit (*.net *.split)
04:17:13*YovelKey-Cohen[m quit (*.net *.split)
04:17:13*ee7[m] quit (*.net *.split)
04:17:13*Zoom[m] quit (*.net *.split)
04:17:13*k0mpjut0r quit (*.net *.split)
04:17:13*lnxw37d4 quit (*.net *.split)
04:17:13*stefantalpalaru quit (*.net *.split)
04:17:14*euantorano quit (*.net *.split)
04:17:14*crem quit (*.net *.split)
04:17:14*mids quit (*.net *.split)
04:17:14*rockcavera quit (*.net *.split)
04:17:14*blackpawn quit (*.net *.split)
04:17:14*m4r35n357 quit (*.net *.split)
04:17:14*Mister_Magister quit (*.net *.split)
04:17:14*threenp quit (*.net *.split)
04:17:14*cornfeedhobo quit (*.net *.split)
04:17:14*sacredfrog quit (*.net *.split)
04:18:01*leorize joined #nim
04:18:01*rockcavera joined #nim
04:18:01*kwilczynski joined #nim
04:18:01*Amun_Ra joined #nim
04:18:01*njoseph joined #nim
04:18:01*Gustavo6046 joined #nim
04:18:01*blackpawn joined #nim
04:18:01*hyiltiz joined #nim
04:18:01*vicfred joined #nim
04:18:01*m4r35n357 joined #nim
04:18:01*ShalokShalom[m] joined #nim
04:18:01*sekao[m] joined #nim
04:18:01*guelosk[m] joined #nim
04:18:01*Simon[m]5 joined #nim
04:18:01*Technisha[m] joined #nim
04:18:01*ee7[m] joined #nim
04:18:01*YovelKey-Cohen[m joined #nim
04:18:01*Clonkk[m] joined #nim
04:18:01*Zoom[m] joined #nim
04:18:01*Jeff[m]2 joined #nim
04:18:01*solitudesf joined #nim
04:18:01*FlammableDuck[m] joined #nim
04:18:01*anoj[m] joined #nim
04:18:01*k0mpjut0r joined #nim
04:18:01*GitterIntegratio joined #nim
04:18:01*lnxw37d4 joined #nim
04:18:01*jfondren[m] joined #nim
04:18:01*antholop[m] joined #nim
04:18:01*MTRNord joined #nim
04:18:01*Avahe[m] joined #nim
04:18:01*Avatarfighter[m] joined #nim
04:18:01*fbpyr[m] joined #nim
04:18:01*liblq-dev joined #nim
04:18:01*m33[m] joined #nim
04:18:01*goblinslayer[m] joined #nim
04:18:01*watzon joined #nim
04:18:01*reversem3 joined #nim
04:18:01*unclechu joined #nim
04:18:01*jken joined #nim
04:18:01*acidx joined #nim
04:18:01*ldlework joined #nim
04:18:01*revere joined #nim
04:18:01*FromDiscord joined #nim
04:18:01*shodan45 joined #nim
04:18:01*jess joined #nim
04:18:01*d10n-work joined #nim
04:18:01*hoek joined #nim
04:18:01*npgm joined #nim
04:18:01*giaco__ joined #nim
04:18:01*motersen joined #nim
04:18:01*mwbrown joined #nim
04:18:01*bozaloshtsh joined #nim
04:18:01*EastByte joined #nim
04:18:01*blackbeard420 joined #nim
04:18:01*ehmry joined #nim
04:18:01*teasea joined #nim
04:18:01*pbb joined #nim
04:18:01*gangstacat joined #nim
04:18:01*zedeus joined #nim
04:18:01*Araq joined #nim
04:18:01*fmaruki joined #nim
04:18:01*Eyess joined #nim
04:18:01*voidpi joined #nim
04:18:01*kaliy joined #nim
04:18:01*so_ joined #nim
04:18:01*beenz joined #nim
04:18:01*mal`` joined #nim
04:18:01*def- joined #nim
04:18:01*dom96 joined #nim
04:18:01*Northstrider[m] joined #nim
04:18:01*qwr joined #nim
04:18:01*koltrast_ joined #nim
04:18:01*arecaceae joined #nim
04:18:01*Onionhammer joined #nim
04:18:01*antranigv joined #nim
04:18:01*ForumUpdaterBot joined #nim
04:18:01*blueberrypie joined #nim
04:18:01*MightyJoe joined #nim
04:18:01*lain joined #nim
04:18:01*oz joined #nim
04:18:01*astronavt joined #nim
04:18:01*sknebel joined #nim
04:18:01*Ekho joined #nim
04:18:01*icebattle joined #nim
04:18:01*zopsi joined #nim
04:18:01*JStoker joined #nim
04:18:02*fowl joined #nim
04:18:02*robertmeta joined #nim
04:18:02*crem joined #nim
04:18:02*mids joined #nim
04:18:02*euantorano joined #nim
04:18:02*stefantalpalaru joined #nim
04:18:02*sacredfrog joined #nim
04:18:02*threenp joined #nim
04:18:02*Mister_Magister joined #nim
04:18:02*cornfeedhobo joined #nim
04:18:24*giaco__ quit (Max SendQ exceeded)
04:18:26FromDiscord<hamidb80> but not `seq[seq[Type]]`
04:18:32FromDiscord<hamidb80> (edit) "seq[array[n, Type]]" => "`seq[array[n, Type]]`"
04:20:07*d10n-work quit (Ping timeout: 276 seconds)
04:20:13*goblinslayer[m] quit (Ping timeout: 246 seconds)
04:20:22*FlammableDuck[m] quit (Ping timeout: 243 seconds)
04:20:22*solitudesf quit (Ping timeout: 243 seconds)
04:20:24*DannyHpy[m] quit (Ping timeout: 245 seconds)
04:20:25*anoj[m] quit (Ping timeout: 252 seconds)
04:20:26*GitterIntegratio quit (Ping timeout: 252 seconds)
04:20:34*ShalokShalom[m] quit (Ping timeout: 244 seconds)
04:20:34*m33[m] quit (Ping timeout: 244 seconds)
04:20:34*reversem3 quit (Ping timeout: 244 seconds)
04:20:35*Simon[m]5 quit (Ping timeout: 248 seconds)
04:20:42*phatnael[m] quit (Ping timeout: 258 seconds)
04:20:43*stisa quit (Ping timeout: 258 seconds)
04:20:43*Jeff[m]2 quit (Ping timeout: 252 seconds)
04:20:44FromDiscord<hamidb80> In reply to @Rika "strange": do you think i should open an issue or not?
04:20:46*YovelKey-Cohen[m quit (Ping timeout: 245 seconds)
04:20:46*ee7[m] quit (Ping timeout: 245 seconds)
04:20:46*Zoom[m] quit (Ping timeout: 245 seconds)
04:20:46*k0mpjut0r quit (Ping timeout: 245 seconds)
04:20:46*lnxw37d4 quit (Ping timeout: 245 seconds)
04:20:47*antholop[m] quit (Max SendQ exceeded)
04:20:47*Technisha[m] quit (Ping timeout: 252 seconds)
04:20:47*guelosk[m] quit (Ping timeout: 252 seconds)
04:20:48*Avatarfighter[m] quit (Ping timeout: 252 seconds)
04:20:48*unclechu quit (Max SendQ exceeded)
04:20:49*Benjamin[m]2 quit (Ping timeout: 245 seconds)
04:20:49*leorize[m] quit (Ping timeout: 245 seconds)
04:20:49*raboof quit (Ping timeout: 245 seconds)
04:20:55*MTRNord quit (Ping timeout: 246 seconds)
04:20:55*liblq-dev quit (Ping timeout: 246 seconds)
04:21:01FromDiscord<Rika> i feel like there is already an open issue for this
04:21:05FromDiscord<Rika> maybe check if there is first
04:21:05*BitPuffin quit (Ping timeout: 258 seconds)
04:21:07*giaco__ joined #nim
04:21:09*Clonkk[m] quit (Ping timeout: 252 seconds)
04:21:09*jfondren[m] quit (Ping timeout: 252 seconds)
04:21:14*j-james[m] quit (Ping timeout: 245 seconds)
04:21:16*waleee-cl quit (Ping timeout: 258 seconds)
04:21:25*sekao[m] quit (Ping timeout: 276 seconds)
04:21:26*Avahe[m] quit (Ping timeout: 276 seconds)
04:21:26*fbpyr[m] quit (Ping timeout: 276 seconds)
04:21:26*watzon quit (Ping timeout: 276 seconds)
04:21:26*hoek quit (Ping timeout: 276 seconds)
04:22:05*npgm quit (Ping timeout: 276 seconds)
04:24:47FromDiscord<hamidb80> how can i search something among 1.8k issuesπŸ˜„
04:25:12*npgm joined #nim
04:25:26*waleee-cl joined #nim
04:25:27FromDiscord<ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/830297401633669140/unknown.png
04:25:28*rockcavera quit (Read error: Connection reset by peer)
04:25:57*rockcavera joined #nim
04:26:34*raboof joined #nim
04:28:06FromDiscord<ElegantBeef> Ah this is actually a varargs issue
04:28:24FromDiscord<ElegantBeef> varargs assumes the sequence is what you want
04:28:35FromDiscord<ElegantBeef> so you need to do `[a, b]`
04:28:41*hoek joined #nim
04:28:51*d10n-work joined #nim
04:28:59FromDiscord<hamidb80> oh
04:33:38FromDiscord<hamidb80> i didn't see an open issue for it
04:33:47FromDiscord<hamidb80> so i'm going to open new one
04:36:57FromDiscord<hamidb80> https://github.com/nim-lang/Nim/issues/8304
04:45:55FromDiscord<James> Dumb super newbie question, what is the proper way to import types from another file? The tutorials I've read make it seem like anything not marked private in an imported file will be available, but I'm getting errors about undefined identifiers when I try to use them.
04:46:40FromDiscord<James> I have an example here, I was trying to add a level map to a Nico example.↡https://gist.github.com/jamesgecko/c9bb543fa8d187ac646b52d0374cfdf2
04:46:46FromDiscord<hamidb80> anything you dont mark as public is private
04:46:53FromDiscord<hamidb80> (edit) "anything you dont mark ... as" added "it"
04:47:04FromDiscord<hamidb80> (edit) "anything ... you" added "that"
04:47:27FromDiscord<James> Ohhhh. Thanks! πŸ€¦β€β™‚οΈ
04:48:14FromDiscord<ElegantBeef> Ah you had the export marker backwards
04:48:24FromDiscord<ElegantBeef> You thought it was a private marker πŸ˜„
04:50:05FromDiscord<James> I was having a terrible time finding anything about public or private methods; knowing it's called the export marker helps a lot.
04:57:04*BitPuffin joined #nim
05:07:37FromDiscord<sealmove> how to programmatically call a proc at runtime?
05:07:53FromDiscord<sealmove> I mean, construct its name at runtime and use it.
05:09:20FromDiscord<sealmove> is it possible?
05:11:21FromDiscord<ElegantBeef> What are you imagining is the api?
05:11:29*rockcavera quit (Remote host closed the connection)
05:12:19FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2Vzz
05:12:43FromDiscord<sealmove> (edit) "https://play.nim-lang.org/#ix=2Vzz" => "https://play.nim-lang.org/#ix=2VzA"
05:12:55FromDiscord<sealmove> (edit) "https://play.nim-lang.org/#ix=2VzA" => "https://play.nim-lang.org/#ix=2VzB"
05:13:13FromDiscord<ElegantBeef> Well you can always subscribe procedures to a lut using a pragma and macro cache
05:13:32FromDiscord<ElegantBeef> But the calling is the odd thing since they'd probably be `pointer`
05:14:10FromDiscord<sealmove> I want this to avoid having to use a lut. It's possible to check if a proc i declared with `when declared`.
05:14:26FromDiscord<sealmove> (edit) "i" => "is"
05:14:42FromDiscord<ElegantBeef> I dont really see how this is possible without a lut
05:15:30FromDiscord<Rika> In reply to @รєคɭ๓๏שє "I want this to": that is not on runtime
05:15:46FromDiscord<ElegantBeef> What's the intended usecase of this?
05:16:48FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2VzC
05:16:58FromDiscord<ElegantBeef> then dont
05:17:09FromDiscord<ElegantBeef> We have macros, use them
05:17:26FromDiscord<sealmove> but, the opcode is found at runtime
05:17:30FromDiscord<ElegantBeef> So what
05:17:35FromDiscord<ElegantBeef> the data can be stored at compile time
05:17:36FromDiscord<sealmove> macros don't work
05:17:42FromDiscord<sealmove> hmm
05:17:56FromDiscord<ElegantBeef> You're talking to someone that did similar for nimscript -> nim interop
05:18:20FromDiscord<ElegantBeef> The way i did it was use a lambda + string to call the procedure
05:18:31FromDiscord<ElegantBeef> string held the data the lambda parsed + called the procedure
05:18:32FromDiscord<sealmove> yes, that's exactly what I need
05:18:48FromDiscord<ElegantBeef> You're doing nimscript interop?
05:18:56FromDiscord<sealmove> But you are saying I should turn my whole program to run at compile-time
05:19:02FromDiscord<ElegantBeef> Nope
05:19:14FromDiscord<ElegantBeef> I'm saying make a LUT and then you can call it at runtime no problem
05:19:31FromDiscord<ElegantBeef> <https://github.com/beef331/nimscripter> shameless source of inspiration
05:19:35FromDiscord<sealmove> and how is a lut better than the snipper I posted above? :>
05:19:45FromDiscord<ElegantBeef> Cause it's automated with a pragma
05:19:52FromDiscord<ElegantBeef> All parsing/calling
05:20:08FromDiscord<ElegantBeef> Using a macro to save your fingees
05:20:33FromDiscord<sealmove> Ah, the logging is not done by hand. I see.
05:20:57FromDiscord<ElegantBeef> yep in the end all you need to do is `vmTable[function](buffer)`
05:21:23FromDiscord<ElegantBeef> then the lambdas that were automagically generated parse that string to the arguments and calls the function
05:21:41FromDiscord<ElegantBeef> And just like that you have a scriptable runtime
05:29:37FromDiscord<ElegantBeef> Well thanks seal you gave me an idea and it works so i can finally move nimscripter to macrocache!
05:30:10FromDiscord<ElegantBeef> Apparently added nnkSyms are looked up cross modules
05:36:51*goblinslayer[m] joined #nim
05:36:51*m33[m] joined #nim
05:36:51*Benjamin[m]2 joined #nim
05:36:51*Avatarfighter[m] joined #nim
05:36:51*k0mpjut0r joined #nim
05:36:51*lnxw37d4 joined #nim
05:36:51*jfondren[m] joined #nim
05:36:51*leorize[m] joined #nim
05:36:51*stisa joined #nim
05:36:51*MTRNord joined #nim
05:36:51*Avahe[m] joined #nim
05:36:51*DannyHpy[m] joined #nim
05:36:51*unclechu joined #nim
05:36:52*j-james[m] joined #nim
05:36:52*GitterIntegratio joined #nim
05:36:52*liblq-dev joined #nim
05:36:52*antholop[m] joined #nim
05:36:52*fbpyr[m] joined #nim
05:36:53*reversem3 joined #nim
05:36:53*watzon joined #nim
05:36:57*solitudesf joined #nim
05:36:57*YovelKey-Cohen[m joined #nim
05:36:58*Technisha[m] joined #nim
05:36:58*Jeff[m]2 joined #nim
05:36:58*Clonkk[m] joined #nim
05:36:58*guelosk[m] joined #nim
05:36:58*ShalokShalom[m] joined #nim
05:36:59*ee7[m] joined #nim
05:36:59*FlammableDuck[m] joined #nim
05:36:59*phatnael[m] joined #nim
05:36:59*Zoom[m] joined #nim
05:36:59*sekao[m] joined #nim
05:36:59*anoj[m] joined #nim
05:37:00*Simon[m]6 joined #nim
06:11:09FromDiscord<sealmove> nice :)
06:11:22FromDiscord<sealmove> json module doesn't support insert?
06:11:46saem@ElegantBeef: what does moving to macrocache mean?
06:12:46FromDiscord<ElegantBeef> Currently i use compiletime variables for holding my procedures and like, but with macrocache i can do it in a way that might not be dependant on import order
06:13:16saemoh neat.
06:13:42FromDiscord<ElegantBeef> Right now if you want to have code scripted from nimscript you need to do it all before importing nimscripter anywhere
06:13:52saemI might have simplified that typedesc wrapping logic a bit... just took a while. smh
06:14:57FromDiscord<ElegantBeef> Nice
06:15:34FromDiscord<ElegantBeef> @sealmove what do you mean insert, in a jarray?
06:15:41FromDiscord<sealmove> yup
06:15:43saemkinda weird that we allow `static int` in type params. I wonder if we allow that for other generic types.
06:15:57FromDiscord<ElegantBeef> Also it's weird to now know we can call procedures across module barriers
06:16:02FromDiscord<ElegantBeef> Yes
06:16:21FromDiscord<ElegantBeef> `static T` is allowed pretty much anywhere a `T` is
06:16:33FromDiscord<ElegantBeef> Within reason of course πŸ˜„
06:17:20saemoh that I get, I meant `static T` is `static[T]`. But can you do another generic type and use that same syntax.
06:17:49FromDiscord<ElegantBeef> Apparently not
06:18:06FromDiscord<ElegantBeef> aside from typedesc/ type
06:18:13saemYeah, that's what I mean, wish we didn't.
06:20:29FromDiscord<ElegantBeef> Yea it makes it odder
06:21:02saemhmm, maybe `type MyType` should be `TypeDef[symbol]` in the type expression language... might be a thing for concepts -- this is stretching my understanding. Sounds like a thing Concepts would care about, since that's in HKD land.
06:21:51FromDiscord<ElegantBeef> Not a clue, you've flown over me when talking about the underlying logic πŸ˜„
06:22:17saemI'm over my own head, but that's the fun bit. πŸ˜…
06:24:19*spiderstew quit (Ping timeout: 258 seconds)
06:26:19saemIt's kinda like CT, RT, and TT (type time). Moreover, I'm referring to the parts of Nim that's the type language, where you define (abstraction) or use/annotate (application) types.
06:26:57saemnow let's see if my silly changes explode everything.
06:27:13FromDiscord<ElegantBeef> Saems house caught fire
06:27:20saem:(
06:27:22FromDiscord<Rika> beef dont we need him
06:27:27saemOuch.
06:27:36saemWait... I didn't parse that right
06:27:38saemThanks!
06:27:44FromDiscord<Rika> lmao
06:27:58saemMy brain flipped that to, "beef we don't need him" πŸ˜†
06:29:01saemSilence is all the answer we need in this case, Rika.
06:29:52FromDiscord<Rika> i was busy with laundry
06:30:02FromDiscord<ElegantBeef> We need him, of course who else will i laugh at bugs with
06:30:29saem🀠
06:30:42FromDiscord<Rika> so you prefer murdering bugs slowly while ridiculing them instead of destroying them quickly
06:30:51FromDiscord<ElegantBeef> We've had many of giggles about bugs
06:31:25FromDiscord<ElegantBeef> Meanwhile saem's like "Well beef giggled, i was wondering 'How long until he leaves me be'"
06:32:01saemOh man... just those 20 lines of code... that was surprising.
06:32:03FromDiscord<Rika> "how long do i have to fake my laugh before he leaves"
06:32:45saemIt's all true... I've been found out.
06:33:00FromDiscord<ElegantBeef> Good i never liked you anyway!
06:33:09FromDiscord<ElegantBeef> Your name is a poorly spelled version of same! πŸ˜›
06:33:20FromDiscord<Rika> your name makes no sense
06:33:21saemπŸ’”
06:33:36FromDiscord<ElegantBeef> Well rika what you're saying is it fits me
06:33:39saemIn all honesty, i think the social part of Nim is my favourite bit.
06:34:05*spiderstew joined #nim
06:34:14saemI figure if you're not a diehard Fedora user I'd be so disappointed.
06:34:52FromDiscord<ElegantBeef> Well good thing for you, you dont have to be disappointed
06:35:29saem17 was a good vintage: https://beefymiracle.org/
06:35:31FromDiscord<Rika> eh? you're already a disappointment wdym
06:36:30saemweird... the tests are running a lot slower. :/
06:36:32FromDiscord<ElegantBeef> Well i might be a disappointment but that doesnt mean you people are disappointed in me
06:36:45FromDiscord<Rika> ??? we are though
06:36:47saemwe keep holding out hope
06:36:55saemwell some of us
06:38:17*spiderstew quit (Ping timeout: 250 seconds)
06:38:37FromDiscord<ElegantBeef> I'm too complacent with my state, so have fun!
06:38:55FromDiscord<ElegantBeef> Any of the lurkers working on anything cool?
06:39:00FromDiscord<ElegantBeef> We know you're reading
06:39:21saem(from the back) NO!
06:39:56saemEver considered stalking them on github?
06:40:06FromDiscord<ElegantBeef> In all sincerity there has to be a few dozen people reading this that are like 1/10th the way to writting a message
06:40:08FromDiscord<Rika> asking a lurker to speak is almost like asking a wall to speak
06:40:19FromDiscord<ElegantBeef> Yea i know
06:41:45saemHmm, that's some interesting stalking: https://github.com/search?o=desc&q=lang%3Anim&s=updated&type=Repositories
06:42:33saemOh neat, Nim Julia and Erlang bridges.
06:42:49FromDiscord<ElegantBeef> Yea that's going on TMWN for april
06:43:00FromDiscord<ElegantBeef> So in 3 weeks you'll see it there
06:43:05FromDiscord<ElegantBeef> the nim julia one that is
06:43:24FromDiscord<Rika> lmao
06:43:33FromDiscord<Rika> why not the erlang oine
06:43:38FromDiscord<ElegantBeef> Cause they didnt submit
06:44:00FromDiscord<Yardanico> @saem I do that from time to time :)
06:44:04FromDiscord<Rika> you must submit to the great beef
06:44:07FromDiscord<Yardanico> and you should use pushed:>some recent date
06:44:20FromDiscord<Yardanico> that gives better results
06:44:34FromDiscord<ElegantBeef> In reply to @Rika "you must submit to": I mean i'm not that great, just the schmuck that decided to do it
06:44:47saem@Yardanico it's pretty great -- I've found some gems that way.
06:44:56FromDiscord<Yardanico> yeah, same
06:45:19FromDiscord<Yardanico> also @saem it's "language:nim"
06:45:22FromDiscord<Yardanico> not "lang:nim" :)
06:45:30FromDiscord<Yardanico> https://github.com/search?o=desc&q=language%3Anim+pushed%3A%3E2021-04-01&s=updated&type=Repositories
06:45:35FromDiscord<Yardanico> here, all updates repos since 1st of april
06:45:38saemI always get confused
06:45:47FromDiscord<Yardanico> sorted by recently updated
06:47:37saemweirds me out when I see my own stuff in those searches.
06:49:04FromDiscord<Yardanico> lol
06:50:03*spiderstew joined #nim
06:50:06saemThen I run into https://github.com/yglukhov/rod, that engine code, the nim to shader thing Kruz wrote, hot code reload, and the compiler being written in Nim itself are what pulled me into Nim.
06:52:45*narimiran joined #nim
06:54:35FromDiscord<ElegantBeef> Then there is me that just wanted to try something that didnt rely on a runtime, and Nim had the cleanest syntax to me
06:54:56FromDiscord<ElegantBeef> (edit) "Then there is me that just wanted to try something that didnt rely on a ... runtime," added "need to be distributed"
06:55:14saemwhat brought those requirements?
06:55:37FromDiscord<ElegantBeef> Well i did most programming inside Unity so i wanted to try something else
06:55:57FromDiscord<ElegantBeef> And didnt want to use C# since it didnt interest me much
06:56:23FromDiscord<ElegantBeef> making users have to get a runtime is just ugh
06:57:17saemI _thought_ you could distribute that?
06:58:06saemhmm, does sublime have particularly good Nim syntax highlighting?
06:59:00FromDiscord<Yardanico> wdym "particularly good"?
06:59:06FromDiscord<Yardanico> it's normal syntax highlighting
06:59:10FromDiscord<Yardanico> also it's what is used by github
06:59:10FromDiscord<Yardanico> https://github.com/Varriount/NimLime
07:00:33FromDiscord<ElegantBeef> Dont know if you can distribute the runtime for unix usuers
07:00:34saemI know about that, I'm wondering if it's good as in has issues or does it handle things well, like triple quotes, pragmas not ending with `.}` and `}` instead, etc...
07:00:36FromDiscord<ElegantBeef> (edit) "usuers" => "users"
07:00:43saemmono or something?
07:00:52FromDiscord<ElegantBeef> well dotnetcore3.0
07:00:54saembut I get what you mean.
07:01:18FromDiscord<Yardanico> @saem i don't think it has any issues with triple quoting
07:02:19FromDiscord<Yardanico> huh https://github.com/herEmanuel/Nide
07:02:51saemthat's neat
07:04:28FromDiscord<ElegantBeef> So a step away from embedded javascript πŸ˜„
07:04:38FromDiscord<Yardanico> In reply to @ElegantBeef "So a step away": something something QuickJS :)
07:04:45FromDiscord<Yardanico> but yeah, there's quite a lot of langdev in nim
07:04:45FromDiscord<Yardanico> https://github.com/maxadamski/vitamin
07:05:03saemI guess I should test that syntax highlighting vs what I have in the current vscode extension to see if it looks better. Though I'd be curious what other people think about it.
07:06:25saemoh wow, that's dependently typed.
07:06:52saemSomeone who gets QTT has got more than a few things figured out.
07:08:04FromDiscord<Yardanico> then again https://github.com/tontinton/panther
07:08:10FromDiscord<Yardanico> a lot of langdev work in nim :)
07:08:18FromDiscord<ElegantBeef> Except on the language itself πŸ˜„
07:08:44FromDiscord<Yardanico> because it's already good enough (TM) :P
07:08:49FromDiscord<ElegantBeef> Lol
07:09:00FromDiscord<Yardanico> people wouldn't have used it for making their own languages otherwise :)
07:09:35FromDiscord<Yardanico> https://github.com/h3rald/mn https://h3rald.com/mn/
07:09:39FromDiscord<Yardanico> by author of min
07:10:15FromDiscord<ElegantBeef> The joke was mostly just the quantity of developers on Nim
07:10:30saemAdd a pattern matching lib and the stdlib will cover all the various things you end up needing for various plumbing, all of a sudden not a bad thing to write a compiler in.
07:10:52FromDiscord<ElegantBeef> There are about 1000 languages implemented in it but relatively few developers on the language
07:10:56FromDiscord<Yardanico> fusion/matching :P
07:11:49saemI know, that's what I was alluding to.
07:15:07FromDiscord<archiloque> I used the Advent of Code to start learning Nim (I'm always doing it after the fact to avoid the pressure of having a fixed schedule), I've done it all and will try to use Nim for some personal projects https://archiloque.net/blog/aoc2020/
07:15:26*teal joined #nim
07:15:30FromDiscord<ElegantBeef> Welcome, and cool good to hear!
07:15:40saem^^
07:16:33FromDiscord<ElegantBeef> lol "-no hype"
07:18:09FromDiscord<ElegantBeef> looking at you code do you prefer explict types on variables?
07:18:22FromDiscord<ElegantBeef> Or do you just not realize there is local type inference πŸ˜„
07:18:38*saem goes and "fixes" that
07:18:41FromDiscord<archiloque> I know there is, I mostly add it as s visual aid
07:18:44FromDiscord<ElegantBeef> Ah
07:19:01FromDiscord<archiloque> I'll probably use less of them in the future I think
07:19:03FromDiscord<ElegantBeef> Couldnt help myself to actually read over the code
07:19:18FromDiscord<archiloque> No problem at all, I published it so people can read it
07:20:11FromDiscord<Yardanico> oh well... https://media.discordapp.net/attachments/371759389889003532/830341371960360960/unknown.png
07:20:15FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/830341389555466250/unknown.png
07:20:30FromDiscord<archiloque> (edit) "s" => "a"
07:21:07saemhahaha
07:21:21FromDiscord<Yardanico> apparently it was in NIm, then the person wanted to switch to Rust but reverted the commits
07:21:34FromDiscord<ElegantBeef> Oooh Archiloque i can suggest a cool module!
07:21:41FromDiscord<archiloque> yes ?
07:21:46FromDiscord<Yardanico> (edit) "NIm," => "Nim,"
07:21:49FromDiscord<ElegantBeef> For strscans!
07:21:53FromDiscord<ElegantBeef> It's like regex but not shit πŸ˜›
07:22:03FromDiscord<Yardanico> we also have pure-nim regex (nim-regex)
07:22:03FromDiscord<Yardanico> and npeg
07:22:07FromDiscord<ElegantBeef> Yea
07:22:18FromDiscord<ElegantBeef> But strscans is in the stdlib and i can understand it
07:22:24FromDiscord<Yardanico> In reply to @archiloque "yes ?": also, as a tip - it's preferred to use the "std" import prefix nowadays
07:22:29FromDiscord<Yardanico> for importing std modules
07:22:38FromDiscord<ElegantBeef> `std/[strutils, os, re...]`
07:23:11FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2VzW
07:24:16FromDiscord<archiloque> Thanks
07:25:24FromDiscord<archiloque> I've looked for a PCRE2 Regex engine for one of the exercices and couldn't find it, so I generated the regex from Nim and used Perl
07:25:40FromDiscord<Yardanico> nim's "re" uses pcre
07:26:24FromDiscord<archiloque> I know, but I needed the recursion features of PCRE2
07:26:41FromDiscord<archiloque> (edit) "needed" => "wanted"
07:32:35FromDiscord<ElegantBeef> Also for the intellij issue cross your fingers and hope they open the editor extension up πŸ˜„
07:33:06FromDiscord<Yardanico> In reply to @ElegantBeef "Also for the intellij": yeah, saw that
07:33:23FromDiscord<Yardanico> https://github.com/nim-lang/RFCs/issues/300#issuecomment-815583102 for those who didn't
07:33:58FromDiscord<Yardanico> that said, I still don't use it :P
07:34:10FromDiscord<Yardanico> mainly because no UFCS support
07:34:16FromDiscord<Yardanico> but it's cool, I tried it
07:35:45*teal quit (Quit: WeeChat 3.1)
07:39:08saemSadly none of the workbench stuff is really transferable. :(
07:39:26FromDiscord<Yardanico> wdym?
07:39:28saemI have InteliJ ultimate edition, just never use it.
07:40:19saemThe semantics analyzer in InteliJ for nim uses their language workbench thing.
07:40:43FromDiscord<Yardanico> yeah, that's true
07:40:50saemThat's a bunch of definitions in java/kotlin (iirc).
07:40:59FromDiscord<Yardanico> yep
07:41:16saemThe language workbench is super cool, just stuck on an island.
07:42:15saemIf you could define nim in there and output the definition back in Nim, that's be hilarious.
07:44:48FromDiscord<archiloque> Intellij can display metadata in the middle of the code, with Nim it could display the inferred types of the variables and it could be really handy
07:45:06saemI still kinda hold it hope someone goes wild on the Nim VM, adds in symbolic evaluation, and we end up with a futamura protection.
07:45:38saemI know, but handy for an IDE user, not the language and its long-term health necessarily.
07:46:18saemThose are improvements that should ideally go back into Nim's semantic analysis later.
07:46:19FromDiscord<archiloque> I don't understand what you mean
07:46:28FromDiscord<archiloque> Ah yes I agree
07:46:40saemTwo threads of thought
07:49:23FromDiscord<archiloque> I'm all for the langage to be improved so it can support all external tools, not specific tooling for one IDE. But if users of one IDE are so used to some advanced features that they work on adding them to the language and then other can benefit from it, it would be nice.
07:51:16saemFutamura projections are kinda amazing, sorta a thought experiment in some ways. http://blog.sigfpe.com/2009/05/three-projections-of-doctor-futamura.html?m=1
07:53:05saemSure, I just don't see those InteliJ related things meaningfully impacting Nim. I say that with an InteliJ pro subscription.
08:05:46FromDiscord<Yardanico> compiling nimsuggest with LTO and march=native to see if it gets faster :P https://media.discordapp.net/attachments/371759389889003532/830352840668217434/unknown.png
08:07:34saemDanger Zone!
08:08:02saemI haven't been doing lto, but haven been using danger.
08:08:14saemI should give that a go.
08:08:46saemAny public code case where you find it really craps the bed?
08:09:31FromDiscord<Yardanico> not sure, but you can check some benchmarks of LTO + PGO for the nim compiler in https://forum.nim-lang.org/t/6295
08:09:49FromDiscord<Yardanico> also to see where the C compiler is doing optimizations (esp. in case of vectorization when compiling with -march and stuff) you can use -fopt-info
08:09:54FromDiscord<Yardanico> the output is quite verbose though, be prepared :P
08:10:18FromDiscord<Yardanico> it'll show both LTO and vectorization optimizations the C compiler does
08:10:27FromDiscord<Yardanico> "Inlined add_system_4825/1010 into doOperation_system_5267/261 which now has time 18.471632 and size 88, net change of +27."
08:11:09FromDiscord<Yardanico> "/home/dian/Projects/nim-strenc/here/stdlib_io.nim.c:335:8: optimized: Semantic equality hit:asgnRef/29->asgnRef/843"
08:17:36saemOnce I get the generics type stuff in the compiler a bit better and the CPS bits are more in my head, then it might be time to return to playing with profiling the compiler.
08:18:20saemI'm fun bits I did get rr working, was even able to time travel back.
08:26:18*vicfred quit (Quit: Leaving)
08:33:41FromDiscord<jtiai> sent a code paste, see https://play.nim-lang.org/#ix=2VAc
08:35:49FromDiscord<haxscramper> You can use {.union.} to pack register into 16 bits, and define upper and lower halves via tuple
08:36:12FromDiscord<haxscramper> So your register is a union of full 16-bit value or a tuple
08:37:17FromDiscord<haxscramper> That's how most of the CPU emulators written in C do that, the o ly difference is that they define nested anonymous struct instead of a tuple
08:38:26FromDiscord<haxscramper> And because it is anonymous you get .low, .high, .full syntax when adressing register, but in non you would have to do reg.BCtuple.low. this can be mitigated by defining template
08:40:07FromDiscord<haxscramper> Template is recommended to get perfect inlining
08:43:31FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2VAf
08:48:48FromDiscord<jtiai> Ooo... πŸͺ„ ...
08:50:27FromDiscord<Yardanico> @haxscramper I wonder how unsafe is this :D
08:50:38FromDiscord<Yardanico> sent a code paste, see https://paste.rs/C62
08:50:43FromDiscord<Yardanico> "The object declaration then must not use inheritance or any GC'ed memory but this is currently not checked."
08:52:15FromDiscord<haxscramper> That is not designed to work with strings or any complicated data type of course
08:52:39FromDiscord<haxscramper> Only actual value objects
08:52:53FromDiscord<haxscramper> Not "it has value semantics" type of thing
08:53:39FromDiscord<Yardanico> i mean with ARC strings/seqs are "value objects", they contain 2 ints and 1 pointer
08:53:46FromDiscord<haxscramper> > pointer
08:54:01FromDiscord<haxscramper> That's exactly what I'm talking about
08:54:54FromDiscord<haxscramper> They might be "value objects" from regular semantics point of view, but in this case it only works for types that are actually fully contained in one block of memory
08:55:06FromDiscord<haxscramper> Like int, tuples of primitives, chars enums
08:55:45FromDiscord<haxscramper> I.e. the data types that CPU can operate on
08:56:16FromDiscord<haxscramper> We don't have built-in BCD integer type in the language but this would've worked too
08:58:21FromDiscord<haxscramper> It might be possible to somehow pack selector kind in the enum, but I'm afraid it would go over 16 bits
08:58:35FromDiscord<haxscramper> (edit) "enum," => "register,"
09:02:07*teasea quit (Ping timeout: 260 seconds)
09:06:28saemHmm, a bunch of the SSL tests fail on my machine when testing the compiler.
09:09:18*haxscramper joined #nim
09:10:37FromDiscord<Goel> sent a code paste, see https://paste.rs/yBf
09:10:45FromDiscord<Varriount> In reply to @archiloque "Intellij can display metadata": If you can actually get usable documentation for the IntlliJ Editor API, I would be quite interested.
09:14:36FromDiscord<archiloque> In reply to @Varriount "If you can actually": Sorry I never tinkered with IntelliJ dΓ©veloppent, I’m just a happy user since a long time
09:15:06*teasea joined #nim
09:15:15FromDiscord<archiloque> (edit) "dΓ©veloppent," => "development,"
09:22:18FromDiscord<jtiai> sent a code paste, see https://paste.rs/3zf
09:23:00FromDiscord<haxscramper> Reverse order of flags or set values explicitly
09:23:12FromDiscord<haxscramper> You can do `1 shl 3` as a value
09:24:41FromDiscord<Rika> Value of the enum is the bit shift so a (value 1) is bit one and so on
09:45:47FromDiscord<haxscramper> After adding `#programming-language`-tagged repositories there are now 12 languages written in nim (each has different state of completion of course). I also found https://github.com/maxadamski/vitamin which seems really interesting as it allows to define custom syntax with includes custom mixfix operators
09:52:33FromDiscord<Yardanico> yeah I linked that one above :P
09:57:38*fredrikhr joined #nim
09:58:09FromDiscord<haxscramper> I know
09:58:33FromDiscord<Yardanico> In reply to @haxscramper "I know": also, I found more than 12
09:59:00FromDiscord<haxscramper> In reply to @Yardanico "also, I found more": https://gist.github.com/haxscramper/3562fa8fee4726d7a30a013a37977df6 I updated list - if anything is missing I can add this
09:59:11FromDiscord<Yardanico> sent a long message, see http://ix.io/2VAr
09:59:24FromDiscord<haxscramper> ah, I did search with `#programming-language` only
09:59:47FromDiscord<Yardanico> yeah a lot of them are like this https://media.discordapp.net/attachments/371759389889003532/830381534480564244/unknown.png
09:59:48FromDiscord<Yardanico> https://github.com/dom96/nael
10:00:58FromDiscord<Yardanico> In reply to @haxscramper "https://gist.github.com/haxscramper/3562fa8fee4726d": honestly you should make a nim wiki page for this :)
10:01:07FromDiscord<Yardanico> in https://github.com/nim-lang/Nim/wiki I mean
10:02:11FromDiscord<haxscramper> when I finally get my site generator working I will put in on my wiki
10:02:27FromDiscord<Yardanico> why not on nim wiki? :P
10:03:08FromDiscord<haxscramper> I want to have full control over what is written in thist list
10:03:14FromDiscord<haxscramper> feel free to copy-paste it or whatever
10:06:59FromDiscord<haxscramper> 18 languages
10:19:17FromDiscord<nsauzede> What is the recommended/official VScode Nim extension ?
10:19:37FromDiscord<nsauzede> (edit) "VScode" => "VSCod{e|ium}"
10:20:53FromDiscord<nsauzede> this one ? https://marketplace.visualstudio.com/items?itemName=kosz78.nim
10:22:09FromDiscord<Yardanico> yes but it's not in active development really
10:22:22FromDiscord<Yardanico> there's https://marketplace.visualstudio.com/items?itemName=nimsaem.nimvscode which is a Nim version of that Nim extension with some improvements
10:22:36FromDiscord<Yardanico> (that is, it's written in Nim and uses the JS backend to compile to JS so it can be used as a vscode extension)
10:22:41FromDiscord<Yardanico> https://github.com/saem/vscode-nim
10:40:13*lritter joined #nim
10:40:18*tane joined #nim
10:51:04FromDiscord<Gary M> there's also my fork which is just better syntax highlighting from the original πŸ˜„
10:51:13FromDiscord<Gary M> I never got around to rewriting the whole plugin.
11:15:49FromDiscord<nsauzede> I must say Nim is really neat
11:19:26FromDiscord<Gary M> Yes it is
11:34:01FromDiscord<nsauzede> is it possible to output an `\n` within a `fmt""` string ?
11:34:39FromDiscord<nsauzede> sent a code paste, see https://play.nim-lang.org/#ix=2VAY
11:34:42FromDiscord<nsauzede> (edit)
11:34:48FromDiscord<haxscramper> Either use `&"\n"` or `fmt("\n")`
11:35:07FromDiscord<haxscramper> https://nim-lang.org/docs/strformat.html#fmt-vsdot-amp
11:36:18FromDiscord<haxscramper> `fmt""` basically works the same way as `r""` - i.e. it generates raw string literal
11:36:35FromDiscord<Solitude> sent a code paste, see https://paste.rs/tYk
11:39:46FromDiscord<nsauzede> ok; so if I want to output an `\n` within an `fmt""` (which is raw), may I use some `{10:c}` form, to force an arbitrary `char` output ?
11:40:22FromDiscord<nsauzede> like a `printf("%c", 10)`
11:40:29FromDiscord<nsauzede> (edit) "like a ... `printf("%c",for" added "C" | "C`printf("%c", 10)` ... " added "for instance"
11:41:33FromDiscord<haxscramper> !eval import std/strformat; echo fmt"[{char(10)}]"
11:41:38NimBot[↡]
11:41:47FromDiscord<haxscramper> But I would just use `&`
11:42:18FromDiscord<haxscramper> or `const nl = char(10)`
11:42:35FromDiscord<haxscramper> if you need raw string literal for other reasons
11:43:59FromDiscord<nsauzede> The cast works fine, thank you
11:44:23FromDiscord<nsauzede> I prefer it to keep everything inline, to not be distracted by an extra variable etc..
11:45:11FromDiscord<haxscramper> !eval import std/strformat; echo &"[{1+2}\n{3+4}]"
11:45:17NimBot[3↡7]
11:45:18FromDiscord<Yardanico> In reply to @nsauzede "The cast works fine,": fyi - it's a conversion, not a cast :)
11:45:27FromDiscord<Yardanico> we have `cast` for actual casts
11:45:33FromDiscord<Yardanico> conversion is safe, a cast is not
11:46:35FromDiscord<nsauzede> I'm still a noob, must learn πŸ™‚
11:47:47FromDiscord<nsauzede> In reply to @haxscramper "!eval import std/strformat; echo": so basically you're telling that `&""` offers `{}` as `fmt""`, but is not raw so tolerates escape chars ?
11:48:10FromDiscord<Yardanico> In reply to @nsauzede "so basically you're telling": did you see the docs link? :)
11:48:16FromDiscord<Yardanico> https://nim-lang.org/docs/strformat.html#fmt-vsdot-amp
11:48:22FromDiscord<Yardanico> talks about the difference between fmt and &
11:50:03FromDiscord<nsauzede> In reply to @Yardanico "did you see the": oops sorry I only looked at the other link, not yours -- I did now
11:50:17FromDiscord<Yardanico> that wasn't my link, but okay :)
11:50:22FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/830409365772697600/unknown.png
11:51:01FromDiscord<nsauzede> yes; `&""` is exactly what I needed, as you suggested indeed.
11:52:06FromDiscord<nsauzede> is it possible to make an `echo XXX` without the (implicit) trailing `newline` ?
11:52:41FromDiscord<Rika> stdout.write
11:52:50FromDiscord<nsauzede> excellent, thanks
11:53:34FromDiscord<haxscramper> Although `write` is not variadic, and it does not perform implicit stringification
12:03:50FromDiscord<nsauzede> is there a Nim equivalent of C `printf`, that is : with variadic, positional arguments (following the first `format` string) ?
12:04:06FromDiscord<nsauzede> (or : can we easily call printf ?)
12:04:19FromDiscord<nsauzede> (edit) "(or : can we easily call ... printf" added "C"
12:04:28FromDiscord<haxscramper> https://nim-lang.org/docs/manual.html#types-cstring-type
12:04:59FromDiscord<nsauzede> marvelous πŸ‘
12:18:17FromDiscord<Yardanico> wait
12:18:18FromDiscord<Yardanico> is that nim https://www.reddit.com/r/badcode/comments/mo26yu/i_had_a_programming_exam_and_had_5_minutes_left/ ?
12:18:26FromDiscord<Yardanico> i'm really confused
12:18:30FromDiscord<Yardanico> it's `readFile` and `items`
12:18:37FromDiscord<Yardanico> but dynamic typing and no `var`
12:19:06FromDiscord<Yardanico> ah python dict has a items method
12:25:37FromDiscord<Solitude> In reply to @haxscramper "Although `write` is not": https://nim-lang.org/docs/io.html#write%2CFile%2Cvarargs%5Bstring%2C%5D
12:55:20FromDiscord<krisppurg> Hey uh has anyone used zippy?
13:11:35FromDiscord<dom96> In reply to @Yardanico "is that nim https://www.reddit.com/r/badcode/commen": The print gives it away. Unmistakable Python.
13:15:48FromDiscord<krisppurg> sent a code paste, see https://play.nim-lang.org/#ix=2VBp
13:19:45*rockcavera joined #nim
13:20:57FromDiscord<krisppurg> I even did uncompress(buffer)
13:22:03*Gustavo6046 quit (Ping timeout: 260 seconds)
13:22:29FromDiscord<haxscramper> BTW you don't need to use `@` prefix for "\x00", I just used it to convert string to `seq[char]`
13:22:39FromDiscord<krisppurg> oh
13:26:14FromDiscord<haxscramper> I haven't used zippy, but you can try to figure out what is wrong based on checks in `uncompress` that raise this exception
13:26:14FromDiscord<haxscramper> https://github.com/guzba/zippy/blob/c922587070bd2f4eccc9183bebd966082428d5b9/src/zippy.nim#L94-L125
13:26:43FromDiscord<krisppurg> alright
13:31:12*Gustavo6046 joined #nim
13:46:18*xet7 quit (Ping timeout: 268 seconds)
13:47:56FromDiscord<krisppurg> I dont see anything wrong
13:48:06FromDiscord<krisppurg> @haxscramper
13:49:55*Vladar joined #nim
13:54:07FromDiscord<haxscramper> I just made a suggestion, you would have to wait for someone who actually knows where this library can fail. And of course you need to look at stacktrace and see where exception was raised and go from there
13:54:31FromDiscord<haxscramper> If you haven't done so already
13:57:16FromDiscord<krisppurg> In reply to @haxscramper "I just made a": the stacktrace doesnt locate where the exception was raised
13:58:15FromDiscord<haxscramper> you mean this particular exceptions is incorrectly shown in the stacktrace?
13:58:20FromDiscord<haxscramper> ah yes, I see
13:58:21FromDiscord<haxscramper> https://github.com/guzba/zippy/blob/c922587070bd2f4eccc9183bebd966082428d5b9/src/zippy/common.nim#L183
13:58:35FromDiscord<haxscramper> Last exception points here, right?
13:59:47FromDiscord<krisppurg> yes
14:04:06haxscramperThis is a common mistake with raise inside of a template where lineinfo gets clobbered by template instantiation. It cannot be fixed externally, you need to add `{.line: instantiationInfo().}` to the template definition. So you can just find where zippy is installed in your system (most likely it is somewhere in the `~/.nimble/pkgs/<zippy-XXX>`, find `failUncompress` template and make an edit
14:08:11haxscramperI think `newException` should not be used anywhere except top-level code, it is too easy to misuse to completely destroy stacktrace
14:08:22haxscramperAlso people forget about `{.line:.}`
14:08:59haxscramperThat's why almost half of the stacktraces in the stdlib lead to template or macro definitions
14:11:18FromDiscord<krisppurg> it says cannot attach a custom pragma to failCompress
14:11:47FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2VBF
14:11:56FromDiscord<haxscramper> https://nim-lang.org/docs/manual.html#pragmas-line-pragma
14:11:59FromDiscord<krisppurg> O
14:12:16FromDiscord<haxscramper> IIRC `{.dirty.}` might have the same effect
14:12:24FromDiscord<haxscramper> But I"m not sure and I think it gets weird in some cases
14:12:33FromDiscord<haxscramper> Like very weird
14:12:54FromDiscord<haxscramper> (edit) removed "Like"
14:13:02FromDiscord<Solitude> can i somehow get the name of generated result variable from PProc in jsgen?
14:14:45FromDiscord<krisppurg> it still doesn't show the stacktrace that locates to where the exception was raised
14:22:12FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2VBJ
14:22:19FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2VBK
14:22:24*xet7 joined #nim
14:22:37FromDiscord<krisppurg> sent a code paste, see https://play.nim-lang.org/#ix=2VBL
14:22:59FromDiscord<krisppurg> the version im using is `zippy-0.3.14`
14:23:58FromDiscord<haxscramper> First - try updating. Current one is `0.5.5`
14:24:07FromDiscord<haxscramper> Which is a lot newer
14:24:28FromDiscord<haxscramper> And might now even have the same issue as one you are currently having
14:24:49FromDiscord<krisppurg> alright
14:34:19FromDiscord<krisppurg> still same
14:35:56FromDiscord<haxscramper> Can you show the stacktrace
14:36:04FromDiscord<krisppurg> alright
14:36:37FromDiscord<krisppurg> https://media.discordapp.net/attachments/371759389889003532/830451207285899274/message.txt
14:37:01FromDiscord<haxscramper> async backtrace
14:37:03FromDiscord<haxscramper> I'm out
14:37:22FromDiscord<krisppurg> ?
14:37:58FromDiscord<haxscramper> have you tried running `uncompress` without async? Just store packet somewhere, and run `import zippy; discard uncompress("packet".readFile())`
14:40:56FromDiscord<krisppurg> In reply to @krisppurg "Welp, besides locating to": I think it would be more of a hassle, even when the stacktrace is found, there still is an issue going on.
14:41:16FromDiscord<krisppurg> wrong message
14:41:38FromDiscord<haxscramper> now you can't even see where exception originated
14:41:57FromDiscord<haxscramper> Maybe someone knows a way how to make async return sane exceptions
14:42:04FromDiscord<haxscramper> But that "someone" is certainly not me
14:43:05FromDiscord<krisppurg> https://discord.com/channels/371759389889003530/371759389889003532/830447659276959745
14:45:51FromDiscord<archiloque> As a first Nim personal project I'm tempted to try working on a graphical ActivityPub client, it's a kind of project I could probably do easily in a language I'm experienced with, but not sure if it's not too big for a first project in a lang I'm learning
14:50:25FromDiscord<dk> In reply to @archiloque "As a first Nim": would that be just a terminal program that does http requests
14:53:42FromDiscord<archiloque> No, I was thinking of a GUI, I don't really like the provided web interfaces and want to have a look at some graphical interface tools
14:59:55FromDiscord<dom96> In reply to @haxscramper "have you tried running": best plan IMO
15:07:31*PMunch joined #nim
15:08:48PMunch@ElegantBeef, guess what I got in the mail yesterday!
15:33:08*PMunch quit (Quit: leaving)
15:49:22ForumUpdaterBotNew Nimble package! ffmpeg - ffmpeg.nim is the Nim binding for FFMpeg(4.3.2)., see https://github.com/momeemt/ffmpeg.nim
15:58:20FromDiscord<Hi02Hi> In reply to @ElegantBeef "Any of the lurkers": finished with my small bigint lib, and also a bigrationals (?) lib. working on implementing std/math for bigints
16:06:29*Menduist joined #nim
16:06:50*rockcavera quit (Remote host closed the connection)
16:15:24FromDiscord<krisppurg> I think most likely I have found the issue why I am getting invalid buffer, is that zippy or zip does not support reusing the same z_stream context for multiple messages in code (`uncompress`), hence why I'm getting the `Invalid Buffer` error
16:17:04FromDiscord<flywind> In reply to @Hi02Hi "finished with my small": cool! we need bigints https://github.com/nim-lang/Nim/issues/14696
16:18:02FromDiscord<krisppurg> !repo zlib
16:19:10*Menduist quit (Quit: Connection closed)
16:47:35FromDiscord<Hi02Hi> In reply to @flywind "cool! we need bigints": isnt there https://github.com/def-/nim-bigints ?↡also, my lib in not at all geared towards performance, though i am happy i am within 1/2 the speed of the above link while being 4x shorter
16:50:14FromDiscord<Hi02Hi> now that i look, araq said ↡"For the Nim compiler I don't care much about the speed, it's much more important that it has no dependencies."↡my lib also only depends on system, his imports strutils
16:51:43FromDiscord<Rika> in this case its more of "[external] dependencies"; any stdlib is fine
16:54:30FromDiscord<Hi02Hi> ok
16:56:51FromDiscord<Hi02Hi> but yeah, mine isnt the fastest out there
17:06:33FromDiscord<hugogranstrom> I've been having trouble unzipping a large file (3GB zipped, 6GB unzipped) using Nim (1.4.4 Windows 64 bit) lately without success. `zip` can't seem to handle it (hard to tell exactly what as it just returns false) and `zippy` eats up my memory and gives me an `out of memory` error. Any suggestions? The file can be opened just fine in the file explorer and on WSL
17:08:55saemI would pull down the code for zippy and start debugging. Does that seem very out of reach?
17:09:42FromDiscord<hugogranstrom> I think the problem with zippy primarly is that it read the entire file into memory at once :/
17:10:01FromDiscord<hugogranstrom> My RAM is just 8GB after all
17:10:01saemWell, there you go.
17:10:31federico3"just"?
17:10:45saemIs it possible to use file stream in zippy, might be a moderate PR?
17:11:30FromDiscord<hugogranstrom> federico3: hehe I'm spoiled πŸ˜›
17:11:53FromDiscord<hugogranstrom> It's not possible atm but guzba has plans for it in the future: https://github.com/guzba/zippy/issues/12#issuecomment-814430510
17:12:25FromDiscord<hugogranstrom> "It is a quite large refactor though" So perhaps not a moderate PR exactly
17:13:58FromDiscord<hugogranstrom> I think it's strange that the standard `zip` library can't handle it as well
17:15:14FromDiscord<hugogranstrom> Just got a though though, if `zlib.dll` that comes bundled with Nim only is compiled with 32 bits, would that be a problem when I have a file larger than 4GB (uint32 maxes out there)
17:15:21FromDiscord<hugogranstrom> (edit) "there)" => "there)?"
17:22:09ForumUpdaterBotNew thread by Mrhdias: How to iterate over a SharedTable?, see https://forum.nim-lang.org/t/7772
17:30:11*krux02 joined #nim
17:55:23*fredrikhr quit (*.net *.split)
17:55:24*mwbrown quit (*.net *.split)
17:55:24*kaliy quit (*.net *.split)
17:55:24*voidpi quit (*.net *.split)
17:55:24*Eyess quit (*.net *.split)
17:55:24*fmaruki quit (*.net *.split)
17:55:24*Araq quit (*.net *.split)
17:56:21*fredrikhr joined #nim
17:56:22*mwbrown joined #nim
17:56:22*kaliy joined #nim
17:56:22*voidpi joined #nim
17:56:22*Eyess joined #nim
17:56:22*fmaruki joined #nim
17:56:22*Araq joined #nim
18:14:36FromDiscord<Charlotte> Is it possible to use Nimscript in Python?
18:15:07FromDiscord<Charlotte> Like, i wanna use Nimscript as a scripting language for my python discord bot, since Nimscript is easy to use and stuff
18:15:40FromDiscord<Charlotte> I can't directly use Python since that's unsafe, but i can't use JS and Lua isn't preferable imo
18:15:56FromDiscord<Charlotte> Nimscript would be the perfect choice for me, especially because of the macros
18:17:40FromDiscord<Charlotte> Also, this is @Technisha's alt
18:17:45FromDiscord<Charlotte> (No I'm not banned)
18:18:30FromDiscord<Technisha> This is le proof I'm not banned
18:18:31FromDiscord<jtiai> Um. Does Nim have something equivalent to Python `getattr()` ?
18:19:26FromDiscord<Yardanico> In reply to @jtiai "Um. Does Nim have": you can use https://nim-lang.org/docs/iterators.html#fieldPairs.i%2CT and check by the field name
18:19:34FromDiscord<Yardanico> or write a macro :)
18:19:52FromDiscord<Yardanico> don't worry, fieldPairs is compile-time too
18:20:23FromDiscord<Yardanico> as in, it unrolls the loop at compile-time, so with a when check for the field name you can get it all at compile-time
18:20:38FromDiscord<Yardanico> but if you only get the attribute name at runtime, you'll have a harder time
18:22:14FromDiscord<Charlotte> :p
18:22:48FromDiscord<Charlotte> I could probably use Nimpy to embed Nimscript after some manual wrapping tbh
18:23:00FromDiscord<Charlotte> But idk how I'd actually implement my custom functions :p
18:23:13FromDiscord<Yardanico> take a look at https://github.com/beef331/nimscripter
18:23:26FromDiscord<Charlotte> Oh?
18:24:09*vicfred joined #nim
18:24:40FromDiscord<Charlotte> That's perfect! Thanks!
18:30:11FromDiscord<Charlotte> ~~I saw you typing, Beef-~~
18:31:15FromDiscord<Yardanico> In reply to @Charlotte|πŸ’»β­ "Also, this is <@470131488856211476>'s": why do you need alts though? πŸ€”
18:32:32FromDiscord<Charlotte> This was my old account from ages ago that i lost
18:32:43FromDiscord<Charlotte> And i cnba to actually switch between them constantly
18:32:56FromDiscord<Charlotte> Since most of my programming servers are on this account
19:02:22*haxscramper quit (Remote host closed the connection)
19:02:47*haxscramper joined #nim
19:09:04*lritter quit (Remote host closed the connection)
19:14:03FromDiscord<dom96> In reply to @saem "Is it possible to": in general, we seem to have a streaming problem in Nim. It suggests that our streams API is not good enough.
19:19:09saem@dom96: I'll admit I'm not a fan of them. There is a unifying concept that helps then and other problem areas, it's just really painful to have only two people noodling through it.
19:19:27FromDiscord<mlokis> what actually takes most of the compile time? I guess frontend because of so match sugar syntax has
19:21:10saemDepends, macros and other compile time code have their code, and as you mean harder on the type system is possible to hit suboptimal paths. Converters can really add up too.
19:27:24FromDiscord<treeform> In reply to @dom96 "in general, we seem": Guzba and me are not huge fans of streams. Mainly that they are slow.
19:28:47*PMunch joined #nim
19:31:27FromDiscord<zetashift> But aren't streams supposed to be fast for big stuff? Is it an implementation problem or something inherent to Streams?
19:31:57FromDiscord<treeform> I think its an implementation problem. I think status has streams that are way faster.
19:32:03FromDiscord<treeform> We have not explored the area though.
19:33:15FromDiscord<treeform> I think the problem is that I/O api is slower then modern systems then memory mapping. There might be some solution based on memory mapping that we would like.
19:33:25FromDiscord<treeform> (edit) "then" => "on"
19:33:57PMunch@Charlotte, it should be possible. Not sure how easy it'd be to set up though..
19:36:41FromDiscord<Charlotte> That's alright tbh, as long as it's possible it's fine for me :p
19:38:14PMunchI mean you "just" need to build a DLL/so that loads the nimscript stuff and then have some function to trigger that from Python
19:38:36FromDiscord<Charlotte> Yeah :p
19:38:51FromDiscord<Charlotte> Though idk how I'd access certain functions from Python
19:38:56FromDiscord<Charlotte> I know Nimpy can do it but like
19:39:22FromDiscord<Charlotte> Idk how i should go about implementing this
19:39:56PMunchHmm, I don't really know enough about Python <-> dynamic library interaction to help I think..
19:40:31FromDiscord<Charlotte> That's alright, thanks anyway though!
19:46:58*narimiran quit (Quit: leaving)
19:51:29FromDiscord<archiloque> I'm looking for a GUI toolkit for personnal projects, I have experience in web and Java GUI (so I know the paradigms) but not in toolkits like QT or others, and I want something that don't need to invest too much time. nimx seem to be a good choice since it doesn't require to learn an external toolkit and the API seem easy to grasp, are there better / more popular tool, or any caveat to consider ?
19:59:42FromGitter<symgryph> How do I specify the default binary location in my config.nims file. I tried --outdir:/blah/blah it totally hated hat.
19:59:44FromGitter<symgryph> that
20:03:34FromDiscord<Yardanico> -o:binary
20:03:44FromDiscord<Yardanico> or --out:
20:03:49FromDiscord<Yardanico> check advanced options https://nim-lang.org/docs/nimc.html
20:06:10*PMunch quit (Ping timeout: 268 seconds)
20:08:57FromGitter<symgryph> so for "generic" directory:
20:09:08FromGitter<symgryph> -o:/my/directory/to/save
20:09:34FromGitter<symgryph> --output-dir works fine on cli:
20:10:19FromGitter<symgryph> nim --outdir=/Users/tmunn/src/nim/chat/bin c client.nim
20:10:27FromGitter<symgryph> but when I put in my client.nims:
20:11:51FromGitter<symgryph> it puts it in the src directory where I am compiling
20:12:05FromGitter<symgryph> client.nims=
20:12:07FromGitter<symgryph> --threads:on ⏎ --outdir:/Users/tmunn/src/nim/chat
20:18:33*PMunch joined #nim
20:27:29*haxscramper quit (Remote host closed the connection)
20:27:52*haxscramper joined #nim
20:27:53*haxscramper quit (Remote host closed the connection)
20:32:40ForumUpdaterBotNew thread by Sflennik: RegexFlag, see https://forum.nim-lang.org/t/7773
20:33:14FromDiscord<nsauzede> A noob question : how to make a func parameter mutable ?
20:33:39FromDiscord<nsauzede> sent a code paste, see https://play.nim-lang.org/#ix=2VDW
20:34:21FromDiscord<nsauzede> and I didn't add any special flag to the `rec` param of my func
20:34:29FromDiscord<nsauzede> so ig I should πŸ™‚
20:35:11FromDiscord<nsauzede> sent a code paste, see https://play.nim-lang.org/#ix=2VDX
20:36:05FromDiscord<Yardanico> In reply to @nsauzede "and I didn't add": `var`
20:36:24FromDiscord<Yardanico> rec: var HitRec
20:36:58FromGitter<symgryph> for anyone else having this problem (*in nims*) to get your compilation to work if you aren't using cwd (default location for binary --outdir" correct syntax is:
20:37:01FromDiscord<Yardanico> remember that you don't need that if you have a `ref object`, but in case of normal value objects you do need it
20:37:19FromGitter<symgryph> --outdir:"../bin" if your output directory is located in a directoyr above say your source code"
20:37:20FromDiscord<nsauzede> πŸ€¦β€β™‚οΈ thanks @Yardanico
20:49:09FromDiscord<nsauzede> is it expected, that nim refuses to compile a file whose name comprises an `-` ? (I got and `module name error` or so)
20:49:30FromDiscord<ElegantBeef> yes `-` is not a valid nim identifier character
20:49:41FromDiscord<Yardanico> In reply to @nsauzede "is it expected, that": all nim module names must be valid identifiers
20:49:45FromDiscord<Yardanico> since you must be able to import them
20:49:51FromDiscord<Yardanico> and refer to them (fully qualify if needed)
20:50:04FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#modules
20:50:05FromDiscord<nsauzede> ok -- and there is a strong relation bw module name and file name right
20:50:14FromDiscord<nsauzede> (edit) "relation" => "relationship"
20:50:21FromDiscord<Yardanico> as I described
20:50:33FromDiscord<nsauzede> got it
20:50:42FromDiscord<nsauzede> (edit) "got it ... " added "πŸ‘"
20:50:45FromDiscord<ElegantBeef> you can do `module.procedureName` and if it was capable of being a bad ident, you couldnt do that
20:50:51FromDiscord<mrotaru> I'm trying to send some server-sent events but getting errors from both `httpie` and `curl`, complaining about chunked-encoding issues; tried lots of combinations but still wont' work; any examples of working code for sending chunked-encoded HTTP responses ?
20:52:41*a_chou joined #nim
20:54:37*a_chou quit (Remote host closed the connection)
20:55:54FromDiscord<nsauzede> sent a code paste, see https://play.nim-lang.org/#ix=2VE0
20:56:14FromDiscord<ElegantBeef> `--out:name`
20:57:22liblq-devor just -o:name
20:57:42FromDiscord<Charlotte> I wonder if I'd be allowed to distribute Nimscript in Python on PyPi-
20:57:55*reversem3 < https://matrix.org/_matrix/media/r0/download/matrix.org/wWBLHnSlOjHczlAqielSKhMr/message.txt >
20:57:58FromDiscord<Charlotte> Nimscrpy
20:58:05FromGitter<symgryph> I really liked --outdir:bin since it just uses the name of the source code plus my bin directory in the current working directory.
20:58:12FromGitter<symgryph> it even creates it for you if its missing!
20:58:13FromDiscord<Charlotte> Now i gotta make the repo
20:58:16FromDiscord<Charlotte> https://cdn.discordapp.com/emojis/772498743378575403.png?v=1&size=64
20:58:17FromDiscord<ElegantBeef> Why wouldnt you be allowed to it's MIT licensed
20:58:26FromDiscord<Charlotte> I mean if PyPi would accept it-
20:58:29FromDiscord<ElegantBeef> I dont know why you would use nimscript in python
20:58:37FromDiscord<ElegantBeef> 2 interpreters deep, for what reason?!
20:58:38FromDiscord<Charlotte> For scripting custom commands
20:58:43FromDiscord<Charlotte> Safely
20:58:54FromDiscord<ElegantBeef> So just make the program in Nim then use nimscript to script that πŸ˜„
20:59:03FromDiscord<Charlotte> It's a python bot-
20:59:11FromDiscord<ElegantBeef> Exactly my point πŸ˜„
20:59:12FromDiscord<Charlotte> That's using a lib that i really like-
20:59:23FromDiscord<Charlotte> And it doesn't work in Nimpy-
20:59:33FromDiscord<Charlotte> ~~Discord.py sucks, Hata is the best-~~
20:59:47FromDiscord<ElegantBeef> Yea excuse me i have my biases πŸ˜„
20:59:58FromDiscord<Charlotte> Mood xD
21:00:15FromDiscord<ElegantBeef> I'd just rather use Dimscord + my command handler + nimscript, than touch python
21:00:46FromDiscord<Charlotte> Lmaooo
21:01:06*filcuc_ joined #nim
21:01:13FromDiscord<Charlotte> It'd also be good for other devs who want a python-like scripting language that's safer then eval/exec
21:02:15FromDiscord<ElegantBeef> Personally since bots are rather rigid and compile times are quick i dont see the benefit of live scripting commands
21:02:25FromDiscord<Charlotte> Custom command system
21:02:28FromDiscord<Charlotte> :p
21:02:54FromDiscord<ElegantBeef> Sure but isnt this easy enough? https://github.com/GaryM-exkage/GDGW-Maverick-Bot/blob/master/src/nimcordbot/command/justask.nim
21:03:21PMunchHi @ElegantBeef, did you see my message from earlier?
21:03:27FromDiscord<Charlotte> For custom commands?
21:03:28FromDiscord<ElegantBeef> Yea
21:03:43FromDiscord<ElegantBeef> Oh you want users to provide their own custom commands
21:03:45FromDiscord<Charlotte> That someone can make with `v>addcmd`
21:03:47FromDiscord<Charlotte> Yeah
21:03:53FromDiscord<ElegantBeef> That's dumb, but carry on πŸ˜„
21:04:04FromDiscord<ElegantBeef> Yea pmunch i did
21:04:12FromDiscord<ElegantBeef> pitter patter get some code running on the pico
21:04:18FromDiscord<Charlotte> Lmao
21:04:21PMunchI'm ready to break your stuff now :P
21:04:25FromDiscord<ElegantBeef> clone my template and run cmake
21:04:49FromDiscord<ElegantBeef> Nice, think i convinced my friend to get a pico, but no clue if he plans on using/learning Nim
21:05:45FromDiscord<ElegantBeef> He's an electronics tech graduate, so atleast hardware wise he thinks the pico is quite awesome
21:06:03FromDiscord<ElegantBeef> Considering the cost and the features
21:06:45FromDiscord<ElegantBeef> You might have to help me get the tinyusb support running since you actually have a modicum of understand with C πŸ˜„
21:06:57FromDiscord<ElegantBeef> (edit) "understand" => "understanding"
21:08:39PMunchShhh, don't mention for federico that you like the Pico :P
21:09:07FromDiscord<ElegantBeef> Lol for the cost and functionality i think you're hard pressed to find another equally good device
21:09:42PMunchHe linked one last time I brought it up
21:09:54PMunchBut I think for the ease of use for new users it's hard to beat
21:10:29PMunchNow I just need to create a program with MicroPython that fills the entire memory, then rewrite the whole thing in Nim showing how nice and small it can be when done right :P
21:10:35FromDiscord<Yardanico> how big is the flash size on pico?
21:10:50reversem3ok I figured it out inim only works when installed via stable nim repo
21:11:01reversem3same with nsh and tnim
21:11:04FromDiscord<Charlotte> How would i release a package that uses some Nim code?
21:11:09FromDiscord<Charlotte> Like, how would i distribute it
21:11:10FromDiscord<ElegantBeef> Nimble
21:11:12FromDiscord<Charlotte> With wheels?
21:11:12FromDiscord<Yardanico> check out how https://github.com/Pebaz/nimporter does it
21:11:19FromDiscord<Charlotte> Oh okay!
21:11:22FromDiscord<Yardanico> but this isn't really a nim question
21:11:30FromDiscord<Yardanico> it's more specific to pypi/binary releases
21:11:43FromDiscord<Yardanico> 2mb flash memory on the pico
21:11:52FromDiscord<Yardanico> good enough I guess
21:12:13PMunchYardanico 2MB I think
21:12:28FromDiscord<ElegantBeef> I wager he searched it manually
21:12:35PMunchWho me?
21:12:40FromDiscord<ElegantBeef> Yard
21:12:47FromDiscord<ElegantBeef> Considering he said it before you
21:13:16PMunchI used a LoPy device than ran only Micropython, filled the whole thing up with a simple screen and font..
21:13:24PMunchAnd that thing had 4Mb I think
21:14:05FromDiscord<ElegantBeef> I'm missing hardware to test different things, so aside from tiny usb mostly hit the limits of stuff i can implement
21:14:07FromDiscord<Yardanico> yeah I had a nodemcu esp8266
21:14:14FromDiscord<Yardanico> before I burned it :P
21:14:43FromDiscord<Yardanico> mostly used it as a WiFi UART bridge lol
21:16:05PMunchI've got plenty of sensors and stuff I can plug into it :)
21:16:13FromDiscord<ElegantBeef> Yea i assumed so
21:16:27FromDiscord<ElegantBeef> do need to get pio and i2c ported still, but atleast i know gpio works πŸ˜›
21:16:53FromDiscord<ElegantBeef> My super elaborate gpio test https://streamable.com/xd8w81
21:17:17FromDiscord<ElegantBeef> wrote a whole fancy pure 7 segmented display module for that single project
21:17:55PMunchHmm, in the documentation what does "Navigate to the build folder" mean?
21:18:19FromDiscord<ElegantBeef> `csource/build`
21:19:23FromDiscord<jtiai> if I have an array is there simple way to fill in block there except for-loop? somethings like: `myarray[0:3] = [1, 2, 3]` ?
21:20:28FromDiscord<ElegantBeef> Don think there is, might be wrong
21:20:38FromDiscord<Charlotte> How would i make it so in Nimscripter, i can expose functions in Python for use in Nimscript, programmatically?
21:20:47FromDiscord<Charlotte> Unless this is impossible which i hope isn't
21:20:50PMunchI guess you could write a `[]=` that takes a range and put your loop in there
21:21:24FromDiscord<ElegantBeef> You'd have to replicate the logic nimscripter does for nim code, for python code
21:21:36FromDiscord<ElegantBeef> so a LUT of `proc(string)`
21:21:41FromDiscord<ElegantBeef> Which then call python code
21:22:40FromDiscord<ElegantBeef> nimscript -> nim -> python is what you need to do
21:22:51FromDiscord<Charlotte> Wait so how would I do this in pure Nim (programmatically)
21:22:57FromDiscord<Charlotte> What file contains the logic?
21:23:00*vicfred quit (Quit: Leaving)
21:23:13FromDiscord<ElegantBeef> You'd need to have bindings to python code inside the binary
21:23:49FromDiscord<ElegantBeef> So nimscript calls `doThing(args)` which goes to nim, which then calls python
21:23:59FromDiscord<ElegantBeef> Hence the reason i said this seems silly
21:24:11FromDiscord<ElegantBeef> 2 intepreters + 1 binary
21:24:36FromDiscord<Charlotte> Ah alright
21:25:36FromDiscord<Charlotte> ~~Not gonna stop doing this though lmao~~
21:26:03FromDiscord<ElegantBeef> Excuse me whilst i delete nimscripter
21:26:09FromDiscord<Yardanico> In reply to @Charlotte|πŸ’»β­ "~~Not gonna stop doing": no one stops you from doing so, but you're making things harder for yourself :)
21:26:29FromDiscord<Yardanico> and people don't usually help with pointless things, they'll instead point you out to why they think it's pointless
21:26:35FromDiscord<Yardanico> x y problem and stuff
21:26:45FromDiscord<Yardanico> e.g. for python there's https://github.com/hylang/hy
21:26:54FromDiscord<Charlotte> O
21:27:05PMunchI for one congratulate you, doing stupid things is sometimes the most fun :P
21:27:10FromDiscord<Charlotte> In reply to @Yardanico "no one stops you": It's reusable so-
21:27:20FromDiscord<Charlotte> In reply to @PMunch "I for one congratulate": EXACTLY! SOMEONE GETS IT-
21:27:29FromDiscord<ElegantBeef> I just dont see the benefit from using the python discord library
21:27:34FromDiscord<ElegantBeef> We have a Nim one
21:27:39FromDiscord<Charlotte> Yeah but like
21:27:49FromDiscord<Charlotte> Implementing this once will help be do a lot more things
21:27:58FromDiscord<Yardanico> a lot more cursed things?
21:28:01FromDiscord<Charlotte> Yes-
21:28:07PMunch@ElegantBeef, yay first error! http://ix.io/2VEf
21:28:09FromDiscord<Yardanico> eh, your choice
21:28:10FromDiscord<ElegantBeef> What's the benefit of using the python library?
21:28:47FromDiscord<ElegantBeef> Is that just the normal hello world project?
21:28:55FromDiscord<Charlotte> It's something I'm really comfortable with and have used in the past reliably, and the dev is actually really open to new ideas that could actually benefit the lib
21:29:14FromDiscord<Charlotte> No I'm not talking about Discord.py, Danny would never do that-
21:29:20FromDiscord<Charlotte> Dpy is shit anyway-
21:29:22FromDiscord<ElegantBeef> I mean krispurg is in here somewhere
21:29:42FromDiscord<Charlotte> Yeah but like, it's so much more preferable to me
21:30:04FromDiscord<ElegantBeef> Pmunch, what code did you try to compile?
21:30:07FromDiscord<Charlotte> Especially since it's in the language I've been using for the past 3 years and have the most experience in
21:31:16FromDiscord<Yardanico> In reply to @Charlotte|πŸ’»β­ "Especially since it's in": yes, no one is stopping you from doing so, but as this might seem strange for some people they wouldn't want to help (like beef, no offense, I completely understand him :P)
21:31:24PMunch@ElegantBeef, just the template
21:31:34PMunchI was just following the build instructions
21:31:48FromDiscord<clyybber> In reply to @Charlotte|πŸ’»β­ "Also, this is <@470131488856211476>'s": Do you want it to be renamed to Technishia too?
21:31:51FromDiscord<Charlotte> Yeah i understand too xD
21:31:59PMunchOn latest stable by the way
21:32:11FromDiscord<ElegantBeef> open cmakelists.txt and save it
21:32:20FromDiscord<Charlotte> Β―\\_(ツ)\_/Β―
21:32:37FromDiscord<Nisha's alt> @Nisha's alt Γ™vÚ
21:32:44FromDiscord<mrotaru> in this code: ` msg.add "\c\L"` what are \c and \L ?
21:32:44FromDiscord<Yardanico> who is nisha
21:32:45FromDiscord<ElegantBeef> Ah this explains alot
21:32:55FromDiscord<clyybber> yardanico was faster :D
21:33:01FromDiscord<Yardanico> In reply to @mrotaru "in this code: `": https://nim-lang.org/docs/manual.html#lexical-analysis-string-literals
21:33:12FromDiscord<Nisha's alt> In reply to @Clyybber "yardanico was faster :D": I changed it
21:33:17FromDiscord<clyybber> oh
21:33:19FromDiscord<Nisha's alt> Nisha is my nickname :p
21:33:21FromDiscord<Yardanico> carriage return followed by a line feed I think
21:33:25FromDiscord<Nisha's alt> It's still Technisha :p
21:33:29*filcuc_ quit (Quit: Konversation terminated!)
21:33:35FromDiscord<mrotaru> yep, thanks !
21:33:36FromDiscord<clyybber> I thought you couldnt change your own username
21:33:39FromDiscord<ElegantBeef> It's annoying pmunch, but you need to tick the cmakelist's modification date for it to search for all the `.c`/`.h` files
21:33:42FromDiscord<Nisha's alt> Nah you can
21:33:42*filcuc_ joined #nim
21:33:47FromDiscord<Yardanico> In reply to @Clyybber "I thought you couldnt": the display name you can
21:33:54FromDiscord<Yardanico> username too, but that's global
21:33:58FromDiscord<Yardanico> display name is specific to the server
21:34:02FromDiscord<clyybber> but for irc that means easy impersonation no?
21:34:05FromDiscord<Yardanico> yes
21:34:12FromDiscord<Yardanico> as it's already been shown
21:34:21FromDiscord<Yardanico> but people complained so ircord uses display names now :)
21:34:30FromDiscord<clyybber> ah but if.you can change global it.wouldnt make sense to prevent it anyways
21:34:36FromDiscord<Yardanico> since a lot of people have weird stuff in their usernames like unicode
21:34:40FromDiscord<Yardanico> and only change display name on the nim server
21:37:51FromDiscord<Nisha's alt> For Nimscripter, to add my own file to the stdlib in Nimscript, all i need to do is drop it in, right?
21:38:14PMunch@ElegantBeef `touch csource/CMakeList.txt`
21:38:19PMunchEasier way of doing it
21:38:42PMunchMaybe that should just be put in the `make` target?
21:38:45reversem3nim> var seqlist = newSeq[string](3)
21:38:45reversem3nim> assert seqlist[0] == nil
21:38:45reversem3Error: 'nil' is now invalid for 'string'; compile with --nilseqs:on for a migration period; usage of '==' is an {.error.} defined at /home/nixfreak/.choosenim/toolchains/nim-1.4.4/lib/system.nim(2947, 5)
21:39:03reversem3so no more nil unless compiled with nilseq:on ?
21:39:05PMunchreversem3, yeah strings can't be nil any longer
21:39:12FromDiscord<Yardanico> @reversem3 since a long time ago, yes
21:39:15PMunchSame for sequences
21:39:18FromDiscord<Yardanico> strings/seqs are empty by default
21:39:21FromDiscord<ElegantBeef> Yea that's all you have to do for nimscripter
21:39:33FromDiscord<ElegantBeef> `touch` isnt crossplatform though is it?
21:40:07PMunchwhen defined(goodOS): execCmd "touch csources/CMakeList.txt"
21:40:12*filcuc_ quit (Ping timeout: 265 seconds)
21:40:17FromDiscord<Yardanico> :)
21:40:18FromDiscord<ElegantBeef> Also i do suggest using a recent devel version of Nim since there was an issue with nimscript module iimporting
21:40:23FromDiscord<ElegantBeef> Lol i suppose
21:40:30PMunchI mean you could probably do the same with some NimScript as well
21:40:30FromDiscord<Nisha's alt> In reply to @ElegantBeef "Yea that's all you": Thanks!
21:40:42FromDiscord<Nisha's alt> In reply to @ElegantBeef "Also i do suggest": Oh?
21:40:52PMunchNimScript module importing?
21:41:01PMunchWait, have you put NimScript on the Pico?
21:41:05FromDiscord<ElegantBeef> Nope
21:41:09FromDiscord<ElegantBeef> Nisha is talking about nimscript
21:41:14PMunchOh, sorry :P
21:41:22FromDiscord<Nisha's alt> I'm using Nim 1.4.2 (latest version that comes on Termux)
21:41:28PMunchHmm, how big does the program get when you add NimScript?
21:41:38PMunchLike could you theoretically do it
21:41:54FromDiscord<ElegantBeef> A meg or so
21:42:02FromDiscord<Yardanico> with LTO it'd be less probably
21:42:02FromDiscord<ElegantBeef> But that's not --opt:siize
21:42:14FromDiscord<Yardanico> and opt size, yeah
21:42:24FromDiscord<ElegantBeef> But eitherway it's dumb
21:42:28FromDiscord<Yardanico> -d:danger --opt:size -d:lto
21:42:31FromDiscord<ElegantBeef> I dont condone it
21:42:34FromDiscord<Yardanico> heh
21:42:37*Vladar quit (Remote host closed the connection)
21:42:46FromDiscord<Yardanico> In reply to @ElegantBeef "I dont condone it": people use python and JS on microcontrollers :)
21:42:49FromDiscord<Yardanico> so why can't they use nimscript :D
21:43:00FromDiscord<ElegantBeef> Cause nimscript is even slower than python πŸ˜›
21:43:12FromDiscord<Yardanico> shhh
21:43:37FromDiscord<Nisha's alt> What's lto?
21:43:44FromDiscord<ElegantBeef> Link time optimization
21:43:47FromDiscord<Nisha's alt> O
21:44:20PMunchOh I mean for sure it's dumb
21:44:28PMunchThat's not really the point though :P
21:44:34FromDiscord<Nisha's alt> And why is Nimscript slower then Python? :P
21:44:38FromDiscord<Yardanico> because it is
21:44:54FromDiscord<ElegantBeef> The only dumb thing i do is exist πŸ˜›
21:45:26FromDiscord<clyybber> In reply to @Charlotte|πŸ’»β­ "And why is Nimscript": not sure, probably something stupid
21:45:39FromDiscord<Yardanico> any meaningful benchmarks one can try?
21:45:55FromDiscord<ElegantBeef> I was curious and was going to profile it, but never got around to, plus i'm not the person to attempt to increase the performance of it
21:46:22FromDiscord<clyybber> In reply to @ElegantBeef "I was curious and": how do you know you aren't :p
21:46:39FromDiscord<Nisha's alt> In reply to @Clyybber "not sure, probably something": Hm
21:46:45FromDiscord<ElegantBeef> Cause i've read a small amount of it and could barely process it
21:49:55FromDiscord<Nisha's alt> Oof
21:50:00FromDiscord<Nisha's alt> That's a mood :p
21:55:18reversem3this doesn't work anymore either ?
21:55:22*reversem3 uploaded an image: (5KiB) < https://matrix.org/_matrix/media/r0/download/matrix.org/wQZLSgWVKUuujlhpmzBysxgM/image.png >
21:56:03FromDiscord<Yardanico> ..<
21:56:18PMunchHoorah, it's output Hello Worlds
21:56:23FromDiscord<Yardanico> are you perhaps reading nim in action?
21:56:28reversem3yes
21:56:34FromDiscord<Yardanico> see https://deepakg.github.io/nim/2019/09/28/nim-in-action-errata.html
21:59:29reversem3ok thanks
22:03:16*reversem3 < https://matrix.org/_matrix/media/r0/download/matrix.org/owhcqyiAtKwwOOUMIpDBEkgX/message.txt >
22:03:33reversem3there we go
22:03:33FromDiscord<Yardanico> yes
22:03:49FromDiscord<Yardanico> also you can just iterate over seq elements :)
22:04:02FromDiscord<Yardanico> for elem in list: stdout.write($elem & " ")
22:04:08reversem3that is true
22:05:47FromDiscord<Nisha's alt> Wait in Nimscripter would i also need to import my custom stdlib modules or no? Preferably not
22:06:05FromDiscord<ElegantBeef> You can import them automatically
22:06:28FromDiscord<ElegantBeef> when you create the interpreter there is an optional `modules` variable
22:07:12FromDiscord<ElegantBeef> so if you do `"strutils"` the file will import strutils
22:07:31FromDiscord<ElegantBeef> Also good to hear pmunch
22:10:12FromDiscord<Nisha's alt> Ah alright, nice!
22:11:05FromDiscord<ElegantBeef> Worth noting pmunch i believe all the example but tinyusb work, but dont know if if they truly do
22:12:23FromDiscord<ElegantBeef> I'm only one numpty with limited knowledge in micro controllers i can only certify so much πŸ˜„
22:17:13FromDiscord<Nisha's alt> ~~I can make my own fork of Nimscripter right?~~
22:17:32FromDiscord<ElegantBeef> It's MIT licensed, and the button is right there
22:17:43FromDiscord<Yardanico> In reply to @Charlotte|πŸ’»β­ "~~I can make my": no, you must sell your soul first
22:17:44FromDiscord<ElegantBeef> Why do you need a fork though
22:17:48FromDiscord<Nisha's alt> Lmao
22:17:57FromDiscord<Yardanico> and don't forget the eternal damnation in hell
22:18:04FromDiscord<Nisha's alt> In reply to @ElegantBeef "Why do you need": Adding Python support to it by default
22:18:09FromDiscord<Nisha's alt> In reply to @Yardanico "and don't forget the": XD
22:18:13FromDiscord<ElegantBeef> Ah yea not supporting that πŸ˜„
22:18:20FromDiscord<Nisha's alt> Yeah exactly xD
22:18:25FromDiscord<Yardanico> i'm curious how far technisha will get with that idea :)
22:18:47FromDiscord<ElegantBeef> Yea it's fairly macro heavy and i did finally learn i can use macro cache so probably will change a bit
22:19:01FromDiscord<Nisha's alt> I'm doing that for if someone wants low level access
22:19:09FromDiscord<Nisha's alt> But meh it's not that important
22:19:15FromDiscord<Nisha's alt> Mmm maybe I'll make a fork
22:19:21FromDiscord<Nisha's alt> Probably not
22:19:37FromDiscord<Nisha's alt> I'll just write a crappy wrapper for it-
22:19:37FromDiscord<ElegantBeef> Didnt realize that symbols stored in a macrocache are still looked up on unpacking so you can call procedures across modules πŸ˜„
22:21:28FromDiscord<ElegantBeef> With that knowledge i think i can clean it up quite a bit
22:21:42FromDiscord<Nisha's alt> Go ahead-
22:21:49FromDiscord<Nisha's alt> ~~It'll help me more~~
22:21:52FromDiscord<ElegantBeef> Didnt realize i needed permission
22:22:07FromDiscord<Nisha's alt> ?
22:22:16FromDiscord<ElegantBeef> You said "go ahead"
22:22:18FromDiscord<Yardanico> we do a little trolling
22:23:15FromDiscord<Nisha's alt> I meant as in no-one's stopping you :p
22:23:33FromDiscord<jtiai> sent a code paste, see https://play.nim-lang.org/#ix=2VEn
22:23:47FromDiscord<Yardanico> need more code
22:24:01FromDiscord<Yardanico> can you show how you call it?
22:24:03FromDiscord<ElegantBeef> issue is you're passing a ref to a var cpu procedure
22:24:14FromDiscord<ElegantBeef> ref != var
22:24:33FromDiscord<jtiai> `cpu.fillMem(0, @[0x3E'u8, 0x2A])` like this.
22:24:39FromDiscord<ElegantBeef> cpu in this case is a reference
22:24:47FromDiscord<ElegantBeef> Consider not making a reference or changing the procedure type
22:25:10FromDiscord<ElegantBeef> are you using `new Cpu` to initalize it, purposely?
22:25:16FromDiscord<jtiai> Yes.
22:25:24FromDiscord<ElegantBeef> You want a reference cpu then?
22:25:36FromDiscord<jtiai> `cpu.reset()` funny that this works just fine...
22:25:45FromDiscord<ElegantBeef> It shouldnt
22:25:50FromDiscord<jtiai> But it does.
22:26:15FromDiscord<ElegantBeef> !eval echo ref int is int
22:26:19NimBotCompile failed: /usercode/in.nim(1, 6) Error: attempting to call routine: 'ref'
22:26:28FromDiscord<ElegantBeef> lol
22:26:33FromDiscord<ElegantBeef> I never do code right
22:26:38FromDiscord<Nisha's alt> Mood
22:26:54FromDiscord<Yardanico> In reply to @jtiai "`cpu.reset()` funny that this": if your Cpu is already a ref you don't need "var" argument type modifier
22:26:59FromDiscord<Yardanico> since refs are mutable already
22:27:11FromDiscord<jtiai> But it's not ref...
22:27:16FromDiscord<ElegantBeef> you used new on it
22:27:17FromDiscord<jtiai> or does something magically makes it ref?
22:27:17FromDiscord<Yardanico> but it is a ref as the compiler said
22:27:19FromDiscord<ElegantBeef> new makes a ref
22:27:26FromDiscord<Yardanico> `new Type` makes a `ref Type`
22:27:26FromDiscord<ElegantBeef> if you want a zeroed object do `Cpu()`
22:27:39FromDiscord<ElegantBeef> or it instantiates a ref type of T is a ref
22:28:03FromDiscord<ElegantBeef> `new` in nim land means `heap allocated`
22:28:24FromDiscord<ElegantBeef> `init` means stack allocated
22:28:42FromDiscord<ElegantBeef> Though tables are odd in that they're `init` which i suppose they're root object isnt heap allocated
22:29:21FromDiscord<ElegantBeef> also objects are default 0 innited so `var cpu: Cpu` is the same as `var cpu = Cpu()`
22:29:56FromDiscord<Yardanico> also, @jtiai , doing "argument: var Type" in proc argument list when "Type" is a ref will mean double pointer indirection
22:30:30FromDiscord<ElegantBeef> The only time you need `var ref T` is when you want to reassign the reference or are using strict functions
22:31:00FromDiscord<jtiai> Well just getting hang of this. Probably my 5th partial day with nim...
22:31:01FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/830570588790587443/unknown.png
22:31:14FromDiscord<Yardanico> sent a code paste, see https://paste.rs/Vck
22:31:30FromDiscord<ElegantBeef> Yea it's fine we're just teaching you how it works πŸ˜„
22:32:02FromDiscord<Yardanico> i wonder if it would be hard for the compiler to emit a performance hint/warning if it sees a ref being passed as "var Type" in the proc argument list
22:32:06FromDiscord<ElegantBeef> in the above example you can also do `x = nil` which would reassign it
22:32:08FromDiscord<jtiai> And unit test failed....
22:32:24FromDiscord<Yardanico> In reply to @jtiai "And unit test failed....": don't forget that stack-allocated objects are copied :)
22:32:34FromDiscord<ElegantBeef> In reply to @Yardanico "i wonder if it": Well aslong as strict functions is not on
22:32:39FromDiscord<Yardanico> (unless they're big enough, but that's internal details)
22:32:45FromDiscord<Yardanico> In reply to @ElegantBeef "Well aslong as strict": they don't affect normal preocs
22:32:46FromDiscord<Yardanico> (edit) "preocs" => "procs"
22:32:52*vicfred joined #nim
22:32:55FromDiscord<jtiai> stack allocated are passed by value?
22:33:03FromDiscord<ElegantBeef> Well yea they're value types
22:33:06FromDiscord<Yardanico> yes, unless they're bigger than 24 bytes, then they're passed by a reference
22:33:09FromDiscord<Yardanico> but that's an internal detail
22:33:27FromDiscord<jtiai> Then I probably want refs after all.
22:33:30FromDiscord<ElegantBeef> Nah
22:33:40FromDiscord<ElegantBeef> Most likely you dont need refs
22:33:43FromDiscord<Yardanico> In reply to @jtiai "Then I probably want": you really only need refs if you need shared ownership
22:33:52FromDiscord<Yardanico> but refs make it a bit easier to write code, that is true
22:34:05FromDiscord<Yardanico> since you don't need to care to insert the "var T" annotations in proc arguments where you mutate it
22:40:13FromGitter<ynfle> What's the difference between `%%` and `mod` for modulus?
22:44:19FromDiscord<jtiai> sent a code paste, see https://paste.rs/PAj
22:45:44FromDiscord<ElegantBeef> well you can do `cpu.Pc += 2`
22:45:54FromDiscord<ElegantBeef> or you could also do `cpu.incPc(2)`
22:46:48FromDiscord<jtiai> Gets a bit tedious for 20 registers... πŸ™‚
22:47:12FromDiscord<ElegantBeef> Well i'm uncertain the entire use case so dont know what's desired
22:47:23FromDiscord<jtiai> cpu emulation. what else?
22:47:32FromDiscord<ElegantBeef> I mean the actual programming use case
22:47:44FromDiscord<ElegantBeef> Like i dont know what design you're after
22:48:45FromDiscord<jtiai> so that I could drop out those parenthesis from registers when using them in the code.
22:49:06FromDiscord<jtiai> so `cpu.PC()` -> `cpu.PC`
22:49:18FromDiscord<jtiai> and same for all the registers.
22:49:50FromDiscord<ElegantBeef> you can already
22:50:03FromDiscord<ElegantBeef> in nim you dont need `()` for any single argument procedure
22:50:29FromDiscord<Yardanico> In reply to @ElegantBeef "in nim you dont": he's using the template on lhs side though
22:50:35FromDiscord<jtiai> `Error: attempting to call undeclared routine: 'PC='`
22:50:44FromDiscord<ElegantBeef> ah
22:50:44FromDiscord<jtiai> Didn't end up that well.
22:50:46FromDiscord<Yardanico> you can define PC= :P
22:51:19FromDiscord<jtiai> and rest of ~20? more or less automated.
22:51:33FromDiscord<Yardanico> it's a single line template anyway
22:51:36FromDiscord<ElegantBeef> Remove them and write a macro to generate them πŸ˜„
22:51:45FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2VEw
22:51:48FromDiscord<Yardanico> but this is for assignment only
22:51:55FromDiscord<Yardanico> for getters you should keep your current pc
22:52:25FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2VEx
22:52:41*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
22:56:35*tane quit (Quit: Leaving)
23:01:28*Gustavo6046 joined #nim
23:03:31FromDiscord<jtiai> Hmmph. Have to think about this...
23:03:43FromDiscord<Yardanico> lol @ElegantBeef it works and was very easy to do
23:03:45FromDiscord<Yardanico> just for fun
23:03:59FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/830578886265667614/unknown.png
23:04:08FromDiscord<Yardanico> semtypes.nim https://media.discordapp.net/attachments/371759389889003532/830578922940137492/unknown.png
23:04:13FromDiscord<ElegantBeef> Lol
23:04:14FromDiscord<ElegantBeef> Nice
23:05:00FromDiscord<ElegantBeef> !remindme add the explict "A mismatch is due to reference passed in as `var`" and "A mismatch is due to a immutable passed in as `var`" πŸ˜„
23:05:08FromDiscord<Yardanico> when the compiler is sus https://media.discordapp.net/attachments/371759389889003532/830579175269203998/unknown.png
23:05:15FromDiscord<Yardanico> (trying this on the compiler itself)
23:05:32FromDiscord<ElegantBeef> Certainly need a config option
23:05:55FromDiscord<Yardanico> i mean in most cases in the compiler the "var" is used when it's reassigned
23:06:06FromDiscord<Yardanico> and checking that a variable is reassigned is much harder than what I did :P
23:06:12FromDiscord<ElegantBeef> Yea i know
23:06:47FromDiscord<ElegantBeef> I was just thinking about when i was playing without colourful output and seeing how easy it was to have a single line dedicated to "Your sending an immutable to a mutable procedure"
23:06:54FromDiscord<ElegantBeef> (edit) "without" => "with"
23:06:55FromDiscord<Yardanico> hm, found one proc where it's not needed
23:07:07FromDiscord<Yardanico> or am I missing something obvious here https://media.discordapp.net/attachments/371759389889003532/830579678573887528/unknown.png
23:07:20FromDiscord<Yardanico> DepN is a ref object
23:09:12FromDiscord<Yardanico> but yeah, actually analysing if it was reassigned in the proc is much harder and would require using varpartitions I guess :P
23:09:20FromDiscord<Yardanico> or dfa or something like that (changing them)
23:09:21FromDiscord<ElegantBeef> God damnit i just got hit with `for i in 4..1` not working πŸ˜„
23:09:53FromDiscord<clyybber> @Yardanico With the current strict funcs you are encouraged to do `var someRef` so I think it's better if the compiler optimizes the double indirection away if no reassign is happening
23:10:00FromDiscord<Yardanico> yeah that's true
23:18:40FromDiscord<Nisha's alt> I wonder if there's a benefit to implementing Nimscript in Java-
23:18:52FromDiscord<Nisha's alt> :)
23:19:07PMunchNow you're just going too far...
23:19:33FromDiscord<Yardanico> In reply to @Charlotte|πŸ’»β­ "I wonder if there's": just reimplement nim in python at this point
23:20:16FromDiscord<clyybber> In reply to @Charlotte|πŸ’»β­ "I wonder if there's": lol
23:20:26FromDiscord<Nisha's alt> Lmaoooo
23:21:05FromDiscord<ElegantBeef> Hey it already has performance issues, lets implement it in a language that cannot have cache efficiency
23:22:01FromDiscord<Nisha's alt> XDDD
23:22:10FromDiscord<Nisha's alt> It's better then Python though-
23:22:19FromDiscord<Nisha's alt> Python is way slower then Java-
23:23:23PMunchDamn it, there was an Aprils fool on that a while back
23:23:28PMunchBut now I can't find it..
23:23:35FromDiscord<Technisha> Really?
23:23:39FromDiscord<Technisha> What was it?-
23:23:48FromDiscord<Yardanico> -
23:24:10PMunchThat Nim would be reimplemented in Python
23:24:21FromDiscord<Yardanico> ah yes
23:25:03FromDiscord<Nisha's alt> Lmaooooo
23:26:41FromDiscord<Yardanico> @PMunch https://forum.nim-lang.org/t/6136
23:29:02PMunchAh yes!
23:29:11PMunchHow did you find that? :P
23:29:19FromDiscord<Yardanico> checked araq's threads
23:29:20PMunchHave you got it bookmarked or something?
23:29:22PMunchAah
23:29:23FromDiscord<Yardanico> he rarely creates threads on the forum
23:29:37FromDiscord<Yardanico> so it's the 5th in 10 of his last threads
23:31:11PMunchMakes sense
23:34:04PMunchGuess I could've found it like this as well: https://irclogs.nim-lang.org/01-04-2020.html#11:53:04
23:35:03*NimBot joined #nim
23:35:55*fredrikhr quit (Remote host closed the connection)
23:36:22*fredrikhr joined #nim
23:37:51PMunchHmm, https://github.com/nim-lang/Nim/pull/13757#issuecomment-603998025 Zig uses Clang to analyse .h files for wrapper free interop. Have anyone looked into doing this for Nim?
23:38:35FromDiscord<ElegantBeef> Someone was working on clang analysis for bindings, think it was haxscramper
23:38:37FromDiscord<Nisha's alt> Oh?
23:38:50FromDiscord<Nisha's alt> Zig in Nim? What's the advantage?
23:39:04FromDiscord<Gary M> No, not using Zig with Nim
23:39:26PMunchUgh, I should go to bed..
23:39:27FromDiscord<Gary M> Although the zig compiler can be used I think
23:39:38FromDiscord<Gary M> Which is more or less the clang compiler with caching
23:39:40PMunchI think I'll do some more keyboard development tomorrow by the way
23:40:08PMunchReimplementing the USB stuff in Nim, and improving the progmem stuff is the plan
23:40:18*PMunch quit (Quit: leaving)
23:40:27FromDiscord<Yardanico> In reply to @Gary M "Although the zig compiler": it has no LLVM interface based on itself
23:40:56FromDiscord<Gary M> Hm?
23:40:57FromDiscord<Yardanico> so haxscramper's work is not really related to Zig
23:40:58*fredrikhr quit (Ping timeout: 240 seconds)
23:41:03FromDiscord<Yardanico> it's related to clang/LLVM directly
23:41:17FromDiscord<Gary M> Yeah, I'm not saying hax's stuff is zig related
23:41:25FromDiscord<Gary M> It was in response to Nisha
23:41:36FromDiscord<Gary M> In reply to @Charlotte|πŸ’»β­ "Zig in Nim? What's": This in particular
23:41:56FromDiscord<Yardanico> not sure why technisha thought of zig in this case πŸ€”
23:42:15FromDiscord<ElegantBeef> Pmunch's references
23:42:33FromDiscord<Gary M> Because Zig was mentioned with how they use clang for wrapper free ffi
23:42:35FromDiscord<Nisha's alt> I mean the Zig compiler in Nim :p
23:42:48FromDiscord<Yardanico> again, how is that mentioned to clang and nim πŸ€”
23:42:58FromDiscord<Nisha's alt> In reply to @PMunch "Hmm, https://github.com/nim-lang/Nim/pull/13757#iss": ^^^^
23:43:06FromDiscord<Gary M> In reply to @Charlotte|πŸ’»β­ "I mean the Zig": Then yeah afaik the only real benefit is the caching and maybe the ability to switch the stdlib... I think.
23:43:16FromDiscord<Gary M> I haven't used zig so I can't say with confidence
23:43:17FromDiscord<Yardanico> In reply to @Gary M "Then yeah afaik the": wdym "stdlib"?
23:43:20FromDiscord<Nisha's alt> Switch the stdlib, wdym?
23:43:31FromDiscord<Yardanico> the only benefit is just somewhat easier cross-compilation
23:43:33FromDiscord<Yardanico> nothing else really
23:44:10FromDiscord<Gary M> Stdlib is probably the wrong term
23:44:27FromDiscord<Yardanico> you mean libc?
23:44:32FromDiscord<Gary M> What I meant is you can force it to target musl or glibc
23:44:35FromDiscord<Yardanico> yes, that's libc
23:44:38FromDiscord<Yardanico> that's kind of a part of cross-compilation
23:44:55FromDiscord<Gary M> Whatever the case is πŸ˜„
23:45:19FromDiscord<Gary M> It has artifact caching built in.
23:46:07FromDiscord<Gary M> I don't know if that would really have any noticable improvements to build speed unless it was a large project
23:46:21FromDiscord<Gary M> And then, I'm not sure how much of that would be taken by Nim itself without IC
23:47:07FromDiscord<Nisha's alt> Hm, does Nim support it rn? If so then I'll try it :p
23:47:33FromDiscord<Yardanico> "zig cc" just acts as a C compiler
23:47:40FromDiscord<Yardanico> with a clang cli
23:47:51FromDiscord<Gary M> Yeah so change to clang and redirect to zig cc
23:47:55FromDiscord<Gary M> Or whatever
23:48:01FromDiscord<Gary M> Again, not something I'm familiar with
23:48:03FromDiscord<Nisha's alt> I'll compile Nim with zig's compiler, then with clang, and then compile Nim with each respectively-
23:48:11FromDiscord<Nisha's alt> Wait
23:48:11FromDiscord<Yardanico> what?
23:48:22FromDiscord<Nisha's alt> Idk I'm confusing myself lmaooo
23:48:26FromDiscord<Yardanico> "zig cc" is literally clang with cross-compilation and caching added on top
23:48:29FromDiscord<Yardanico> it's not some new C compiler
23:48:35FromDiscord<Gary M> That's the point yard
23:48:44FromDiscord<Yardanico> @Gary M I'm trying to let nisha understand
23:48:50FromDiscord<Gary M> Benchmarking the incremental build time of caching
23:48:52FromDiscord<Gary M> But
23:48:54FromDiscord<Nisha's alt> Yeah
23:48:57FromDiscord<Gary M> my point is that
23:49:08FromDiscord<Gary M> You aren't going to see a difference in a small project.
23:49:26FromDiscord<Nisha's alt> Mhm
23:49:30FromDiscord<Gary M> So benchmarking probably won't yield any valuable results.
23:49:50FromDiscord<Nisha's alt> I'd compile it multiple times to actually see the caching work
23:50:01FromDiscord<Nisha's alt> Since I'm just dumb like that 😎
23:50:17FromDiscord<Gary M> I'm dumb like that too just ask @ElegantBeef
23:50:31FromDiscord<Nisha's alt> Lmao really?-
23:50:42FromDiscord<Gary M> I like benchmarking just for the fun of it
23:50:49FromDiscord<Nisha's alt> Lmao
23:50:54FromDiscord<ElegantBeef> Why ask me?
23:50:59FromDiscord<Gary M> But now I'm doing something that validates my atrocious addiction
23:51:11FromDiscord<Nisha's alt> I do stupid shit ALL the time, no-one can compare to me >:3
23:51:13FromDiscord<Gary M> Because I have annoyed you with my benchmarking shit :P
23:51:18FromDiscord<Gary M> And other stupid shit I do
23:57:43FromDiscord<Nisha's alt> Mood