<< 04-09-2022 >>

00:00:22FromDiscord<Shiba> ``bash : nim not found``
00:00:32FromDiscord<Shiba> nim in terminal still works
00:00:47FromDiscord<Shiba> (edit) "``bash : nim not found`` ... " added "in the console"
00:00:49FromDiscord<Elegantbeef> Lite doesnt load your config so it doesnt populate the path with choosenim's nim
00:01:36FromDiscord<Shiba> okay easy ill add it myself , since its just lua
00:01:46FromDiscord<Shiba> i thought you said "Life"
00:02:29FromDiscord<Shiba> (edit) "i thought you said "Life" ... " added "lol"
00:04:10FromDiscord<Shiba> thuna
00:18:24*neceve quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
00:19:07*neceve joined #nim
00:24:52*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
00:30:31*neceve quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
00:36:32FromDiscord<Shiba> okay i have found a better soloution
00:37:03FromDiscord<Shiba> you can run lite-xl throught terminal and its will inherit the PATH
00:37:36FromDiscord<Shiba> but since i use x11 i can just add the PATH to .profile
00:37:40FromDiscord<Shiba> and now its works
00:37:59FromDiscord<Shiba> the lite-xl community helped me a lot
00:57:35*wallabra quit (Ping timeout: 252 seconds)
01:05:59*jmdaemon joined #nim
01:26:08*neceve_ joined #nim
01:34:00*arkurious quit (Quit: Leaving)
01:38:11*jmdaemon quit (Ping timeout: 248 seconds)
01:55:14*neceve joined #nim
02:20:47*jmdaemon joined #nim
02:22:27*neceve_ quit (Ping timeout: 248 seconds)
03:22:02FromDiscord<JeysonFlores> Is there any forums or sites to look up for Nim jobs?
03:22:31FromDiscord<alexchole> "I'll help 10individuals how to earn $30,000 in 72 hours from the crypto market. But you will pay me 10% commission when you receive your profit. if interested send me a direct message on Telegram by asking me (HOW) for more details on how to get started↵↵https://t.me/+lD4Ec_gRjCljYjNk
03:23:22FromDiscord<Yardanico> In reply to @JeysonFlores "Is there any forums": not really, there's #jobs but it's not that active
03:23:34FromDiscord<Yardanico> and out of all companies Status has the most jobs that are related to Nim :P
03:25:50FromDiscord<Yardanico> wow, copilot seems to work for Nim now!
03:26:06FromDiscord<Elegantbeef> Just in time for github to no longer offer it for free
03:26:20FromDiscord<Yardanico> they offer it to people with popular enough open source repos I think
03:26:42FromDiscord<Yardanico> idk the threshold, but it just shows up as "free" for me
03:26:44FromDiscord<Yardanico> can you check in your account?
03:26:54FromDiscord<Yardanico> https://github.com/settings/billing
03:26:55*rockcavera joined #nim
03:26:55*rockcavera quit (Changing host)
03:26:55*rockcavera joined #nim
03:26:57FromDiscord<Yardanico> add-ons section
03:27:33FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1015825415585140756/image.png
03:27:36FromDiscord<JeysonFlores> In reply to @Yardanico "and out of all": Damn, I hope more new companies use Nim for their software.
03:27:46FromDiscord<Yardanico> In reply to @Elegantbeef "image.png": and what if you enable it?
03:28:00FromDiscord<Yardanico> but I guess for myself it's enabled because I was in the beta
03:28:06FromDiscord<Elegantbeef> 60 free trial with 10/100 yr
03:28:08FromDiscord<Yardanico> sent a long message, see http://ix.io/49AW
03:28:18FromDiscord<Yardanico> but, like, in the past for Nim it outputted garbage from other languages
03:28:25FromDiscord<Yardanico> now it can do quite advanced stuff, it clearly knows Nim stdlib
03:28:31FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1015825661077758002/unknown.png
03:28:35FromDiscord<Yardanico> lines before 4 were written by copilot
03:28:38FromDiscord<Yardanico> after
03:28:41FromDiscord<flywind> What is a maintainer? Like owner?
03:28:50FromDiscord<Yardanico> In reply to @flywind "What is a maintainer?": I guess, or a collaborator? not sure
03:29:34FromDiscord<JeysonFlores> In reply to @flywind "What is a maintainer?": probably someone who contribute substantial code to a project
03:29:47FromDiscord<JeysonFlores> (edit) "contribute" => "contributes"
03:31:25FromDiscord<Patitotective> In reply to @Yardanico "": really cool
03:31:51FromDiscord<Patitotective> "KDL document language lexer and parser"
03:31:58FromDiscord<Patitotective> lmao
03:32:01FromDiscord<Yardanico> it still seems to confuse Nim with other languages sometimes, but you can help it by specifying "Nim" somewhere in the file
03:32:19FromDiscord<Yardanico> In reply to @Patitotective ""KDL document language lexer": https://media.discordapp.net/attachments/371759389889003532/1015826616800264232/unknown.png
03:32:32FromDiscord<Patitotective> :o
03:32:51FromDiscord<Yardanico> let's see if it can do imports on its own
03:33:50FromDiscord<Yardanico> not really I think
03:34:03FromDiscord<Yardanico> but it knows Nim stdlib which is really cool
03:35:39FromDiscord<JeysonFlores> can it use generics or macros?
03:35:50FromDiscord<Patitotective> now it only has to learn all nimble packages and programming becomes funnier
03:36:19FromDiscord<Generic> oh wow last time I used copilot it always spit out Pythonisms and for some reason sprinkled with a bit of C#
03:36:39FromDiscord<Yardanico> yeah it seems better now, not perfect but much better
03:36:48FromDiscord<Elegantbeef> "Generate a Caeser cipher look up table"
03:37:05FromDiscord<JeysonFlores> "Make my dinner"
03:37:07FromDiscord<Yardanico> In reply to @Elegantbeef ""Generate a Caeser cipher": https://media.discordapp.net/attachments/371759389889003532/1015827827897143306/unknown.png
03:37:30FromDiscord<Elegantbeef> How wrong could it be
03:37:48FromDiscord<Rika> It doesn’t look wrong to me
03:38:04*wallabra joined #nim
03:38:05FromDiscord<Elegantbeef> It's using integers as an index!
03:38:06FromDiscord<Elegantbeef> 😛
03:38:11FromDiscord<Rika> Well, the result thing is kinda cursed
03:38:16FromDiscord<Rika> But it’s not wrong
03:38:44FromDiscord<Generic> implicit result variables aren't that common apparently
03:38:52FromDiscord<Generic> atleast not in other programming languages
03:39:03FromDiscord<Rika> It isn’t
03:39:25FromDiscord<Rika> I don’t know any other language with it that’s somewhat older than Nim
03:39:32FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1015828432833220618/unknown.png
03:39:37FromDiscord<Yardanico> i typed "template" myself
03:39:50FromDiscord<Rika> In reply to @Yardanico "": Kinda wrong, scope issues
03:39:53FromDiscord<Generic> try asking it to write a macro
03:39:59FromDiscord<Yardanico> with what functionality
03:40:07FromDiscord<Generic> maybe the exact same thing as a test?
03:40:08FromDiscord<Yardanico> i can't think of anything simple
03:40:10FromDiscord<Yardanico> okay
03:40:18FromDiscord<Rika> Ask it to rewrite dup?
03:40:27FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1015828664207806504/unknown.png
03:40:40FromDiscord<Yardanico> it didn't add the import of course, but it knows newStmtList
03:40:42FromDiscord<Rika> Still the same scope issue but wow it’s good
03:40:51FromDiscord<Generic> wow
03:40:52FromDiscord<Yardanico> yes, kind of scary
03:40:58FromDiscord<Yardanico> because Nim is supposed to be niche :P
03:41:16FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1015828867283419236/unknown.png
03:41:16FromDiscord<Yardanico> wow!
03:42:07FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1015829082652541050/unknown.png
03:42:08FromDiscord<Elegantbeef> "Write a macro to generate a closure iterator from an iterator" 😛
03:42:23FromDiscord<Yardanico> didn't close httpclient smh
03:42:51FromDiscord<Yardanico> In reply to @Elegantbeef ""Write a macro to": lol
03:43:23FromDiscord<Yardanico> in this case it doesn't give a suggestion right away, but if you ask it for suggestions, some of them are clearly "overfitted"
03:43:34FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1015829446671994981/unknown.png
03:43:41FromDiscord<Yardanico> some are weird https://media.discordapp.net/attachments/371759389889003532/1015829476208279672/unknown.png
03:46:12FromDiscord<Rika> Interesting
03:49:40FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1015830984937193583/unknown.png
03:49:50FromDiscord<Yardanico> this is of course very simple, but at least it knows how to translate algorithms to Nim
03:50:04*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
03:50:04FromDiscord<Yardanico> everything is written by copilot, I didn't even have to "proc" myself
03:50:10FromDiscord<Elegantbeef> How about the simpler loop unroll macro 😄
03:50:45FromDiscord<Yardanico> the default suggestion is some nonsense (wtf is LineNode?) https://media.discordapp.net/attachments/371759389889003532/1015831255696289812/unknown.png
03:51:11FromDiscord<Elegantbeef> It has the right idea, but that's still no cigar 😄
03:52:34FromDiscord<Rika> Smoking is bad
03:53:06FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1015831846078128168/unknown.png
03:53:08FromDiscord<Elegantbeef> Final thing i'll ask to test is "Heap allocate an integer and set it to 32 then print it out" 😄
03:53:40FromDiscord<Elegantbeef> My money is on a `alloc` call
03:53:44FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1015832006858391603/unknown.png
03:53:50FromDiscord<Yardanico> all 3 lines are without my input
03:53:51FromDiscord<Elegantbeef> Shit
03:53:52FromDiscord<Yardanico> xdd
03:54:16FromDiscord<Elegantbeef> It's clearly a bot though cause it does `new(int)` like a neanderthal
03:54:31FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1015832203340554320/unknown.png
03:55:41FromDiscord<Elegantbeef> Shit i now want to see if it can handle "Allocate a cstring and copy it to a Nim string"
03:56:23FromDiscord<Yardanico> i had to type `proc`, but it gave an almost good result
03:56:26FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1015832684100067478/unknown.png
03:56:33FromDiscord<Yardanico> lets see all 10 variations of the answer
03:57:04FromDiscord<Yardanico> yeah it can't for some reason generate Nim code on top-level well
03:57:07FromDiscord<Yardanico> it needs to be inside of procs
03:58:12FromDiscord<Yardanico> lol https://media.discordapp.net/attachments/371759389889003532/1015833131162554479/unknown.png
03:58:31FromDiscord<Rika> Close enough
04:00:08FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1015833617928294503/unknown.png
04:08:26FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1015835709774503976/unknown.png
04:09:01FromDiscord<Yardanico> but it used 4 spaces :((
04:09:54FromDiscord<Yardanico> and this is what I mean by it being overtrained or something
04:09:56FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1015836082794922064/unknown.png
04:10:01FromDiscord<Yardanico> this is from some github or stackoverflow issue
04:10:03FromDiscord<Yardanico> or a forum maybe
04:14:53FromDiscord<Elegantbeef> It's an odd thing to see that message
04:15:03FromDiscord<Elegantbeef> I do wonder what platform it's from
04:16:04FromDiscord<Yardanico> it's kind of scary for "simple" inputs
04:16:21FromDiscord<Yardanico> there are errors here, but it's still very impressive - https://play.nim-lang.org/#ix=49Bc
04:16:36FromDiscord<Yardanico> everything is generated, I only had to type "type" or "proc"
04:16:51FromDiscord<Yardanico> i guess it did copy quite a lot from my own github repo for this :DD
04:17:12FromDiscord<Prestige> What's the best way to allow a user to pass in an int literal to a function that expects a float? Maybe using `SomeNumber` and doing `float(x)`?
04:17:27FromDiscord<Elegantbeef> just take a float
04:17:27*kenran joined #nim
04:17:28FromDiscord<Prestige> Basically just want to avoid having to type the `.0`
04:17:29FromDiscord<Yardanico> passing an int _literal_ already works by default for float arguments
04:17:33FromDiscord<Elegantbeef> Nim converts int literals to floats
04:17:46FromDiscord<Elegantbeef> you also dont need the `.0` you can type just `d`
04:17:56FromDiscord<Elegantbeef> or `f` if you want a 32bit float
04:18:06FromDiscord<Prestige> hm it is not doing so for me because I am using a union type, or whatever it's called
04:18:25FromDiscord<Prestige> I have a `proc foo(x: float|Size)` and can't pass in an int
04:18:51FromDiscord<Elegantbeef> Typeclasses do cause confusion with literals
04:19:06FromDiscord<Elegantbeef> in that case it's best just to do `d`
04:19:11FromDiscord<Prestige> Is there an overhead to doing `float(x)` or is that a compile time thing?
04:19:22FromDiscord<Yardanico> it is a runtime thing if you're doing it from an integer
04:19:29FromDiscord<Elegantbeef> It's generally negligable though
04:19:29FromDiscord<Yardanico> if the C compiler doesn't manage to optimize it away I guess
04:19:32FromDiscord<Yardanico> but the cost is small
04:19:33FromDiscord<Yardanico> yeah
04:19:57FromDiscord<Prestige> Cool, thanks
04:20:42FromDiscord<Elegantbeef> It's funny i've found 2 issues with Wasmer's C-api already
04:20:51FromDiscord<Elegantbeef> Their webpage doesnt link to the proper docs, and their examples doesnt compile
04:21:34FromDiscord<Elegantbeef> Why their examples arent tested in a CI is beyond me
04:25:13FromDiscord<Elegantbeef> More and more making an interpreter for wasm from scratch seems sensible
04:32:21*tiorock joined #nim
04:32:22*tiorock quit (Changing host)
04:32:22*tiorock joined #nim
04:32:22*rockcavera quit (Killed (molybdenum.libera.chat (Nickname regained by services)))
04:32:22*tiorock is now known as rockcavera
04:50:03*kenran quit (Quit: WeeChat info:version)
04:52:07FromDiscord<Yardanico> found a funny codegen regression in nim devel compared to 1.6.6, beef, do you think this code should work or not?
04:52:15FromDiscord<Yardanico> https://play.nim-lang.org/#ix=49Bd
04:52:25FromDiscord<Yardanico> found in gintro's binding generator
04:52:50FromDiscord<Yardanico> ah it's not even specific to "result"
04:52:57FromDiscord<Yardanico> any variable in the template will trigger it
04:53:08FromDiscord<Yardanico> but it's specific that there's subscript operator as far as I can see
04:53:36FromDiscord<Elegantbeef> I imagine it should work
04:54:08FromDiscord<Yardanico> doesn't look like anyone reported an issue like that
05:01:24FromDiscord<Yardanico> guess i should at least try bisecting to help
05:02:34FromDiscord<Yardanico> ah wait I think it's arc/orc specific
05:02:40FromDiscord<Yardanico> yep
05:02:58*def- quit (*.net *.split)
05:02:58*jkl quit (*.net *.split)
05:02:58*alice quit (*.net *.split)
05:02:58*droidrage quit (*.net *.split)
05:02:58*om3ga quit (*.net *.split)
05:02:58*LyndsySimon quit (*.net *.split)
05:02:59*xaltsc quit (*.net *.split)
05:02:59*ixmpp quit (*.net *.split)
05:02:59*blackbeard420 quit (*.net *.split)
05:02:59*buster_blue[m] quit (*.net *.split)
05:02:59*FromDiscord quit (*.net *.split)
05:03:00*via__ quit (*.net *.split)
05:03:00*euantorano quit (*.net *.split)
05:03:00*dv^_^ quit (*.net *.split)
05:03:00*wallabra quit (*.net *.split)
05:03:00*mahlon quit (*.net *.split)
05:03:00*koltrast quit (*.net *.split)
05:03:00*lumidify quit (*.net *.split)
05:03:00*lain quit (*.net *.split)
05:03:00*tk quit (*.net *.split)
05:03:00*adium quit (*.net *.split)
05:03:01*rb quit (*.net *.split)
05:03:01*tinystoat quit (*.net *.split)
05:03:01*attah quit (*.net *.split)
05:03:01*_________ quit (*.net *.split)
05:03:01*neceve quit (*.net *.split)
05:03:01*hexeme_ quit (*.net *.split)
05:03:02*Onionhammer quit (*.net *.split)
05:03:02*genpaku quit (*.net *.split)
05:03:02*cornfeedhobo quit (*.net *.split)
05:03:02*qwestion quit (*.net *.split)
05:03:02*void09 quit (*.net *.split)
05:03:02*NimEventer quit (*.net *.split)
05:03:02*Amun-Ra quit (*.net *.split)
05:03:03*qwr quit (*.net *.split)
05:03:03*syl quit (*.net *.split)
05:03:03*nisstyre quit (*.net *.split)
05:03:03*oz quit (*.net *.split)
05:03:04*DixieFlatline quit (*.net *.split)
05:03:04*mal`` quit (*.net *.split)
05:03:04*gshumway quit (*.net *.split)
05:03:04*Yardanico quit (*.net *.split)
05:03:04*madprog quit (*.net *.split)
05:03:04*crem quit (*.net *.split)
05:03:04*disso_peach quit (*.net *.split)
05:03:04*djanatyn quit (*.net *.split)
05:03:05*systemdsucks quit (*.net *.split)
05:03:05*supakeen quit (*.net *.split)
05:03:05*redj quit (*.net *.split)
05:03:05*fallback quit (*.net *.split)
05:03:05*notchris quit (*.net *.split)
05:03:05*oddish quit (*.net *.split)
05:03:05*oprypin quit (*.net *.split)
05:03:05*reversem3[m] quit (*.net *.split)
05:03:06*drewr quit (*.net *.split)
05:03:14*madprog joined #nim
05:03:14*drewr joined #nim
05:03:14*redj joined #nim
05:03:14*systemdsucks joined #nim
05:03:14*Yardanico joined #nim
05:03:14*gshumway joined #nim
05:03:14*djanatyn joined #nim
05:03:14*syl joined #nim
05:03:14*qwr joined #nim
05:03:14*supakeen joined #nim
05:03:14*mal`` joined #nim
05:03:14*DixieFlatline joined #nim
05:03:14*dv^_^ joined #nim
05:03:14*euantorano joined #nim
05:03:14*via__ joined #nim
05:03:14*oz joined #nim
05:03:14*FromDiscord joined #nim
05:03:14*Amun-Ra joined #nim
05:03:14*ixmpp joined #nim
05:03:14*xaltsc joined #nim
05:03:14*NimEventer joined #nim
05:03:14*LyndsySimon joined #nim
05:03:14*alice joined #nim
05:03:14*void09 joined #nim
05:03:14*jkl joined #nim
05:03:14*qwestion joined #nim
05:03:14*def- joined #nim
05:03:14*om3ga joined #nim
05:03:14*droidrage joined #nim
05:03:14*_________ joined #nim
05:03:14*buster_blue[m] joined #nim
05:03:14*reversem3[m] joined #nim
05:03:14*attah joined #nim
05:03:14*oprypin joined #nim
05:03:14*tinystoat joined #nim
05:03:14*rb joined #nim
05:03:14*cornfeedhobo joined #nim
05:03:14*oddish joined #nim
05:03:14*nisstyre joined #nim
05:03:14*adium joined #nim
05:03:14*genpaku joined #nim
05:03:14*Onionhammer joined #nim
05:03:14*tk joined #nim
05:03:14*hexeme_ joined #nim
05:03:14*notchris joined #nim
05:03:14*lain joined #nim
05:03:14*disso_peach joined #nim
05:03:14*crem joined #nim
05:03:14*blackbeard420 joined #nim
05:03:14*lumidify joined #nim
05:03:14*koltrast joined #nim
05:03:14*fallback joined #nim
05:03:14*mahlon joined #nim
05:03:14*neceve joined #nim
05:03:14*wallabra joined #nim
05:03:21*nullsh quit (Max SendQ exceeded)
05:04:00*nullsh joined #nim
05:04:01FromDiscord<Yardanico> now I don't know if it ever worked with ARC :P
05:06:12FromDiscord<Yardanico> okay it did not work on 1.6.6 either
05:07:17*def- quit (*.net *.split)
05:07:17*jkl quit (*.net *.split)
05:07:17*alice quit (*.net *.split)
05:07:56*alice joined #nim
05:08:09*droidrage quit (*.net *.split)
05:08:09*om3ga quit (*.net *.split)
05:08:09*LyndsySimon quit (*.net *.split)
05:08:09*xaltsc quit (*.net *.split)
05:08:09*ixmpp quit (*.net *.split)
05:08:32*blackbeard420 quit (*.net *.split)
05:08:32*buster_blue[m] quit (*.net *.split)
05:08:32*FromDiscord quit (*.net *.split)
05:08:32*via__ quit (*.net *.split)
05:08:33*euantorano quit (*.net *.split)
05:08:33*dv^_^ quit (*.net *.split)
05:09:10*neceve quit (*.net *.split)
05:09:11*hexeme_ quit (*.net *.split)
05:09:11*Onionhammer quit (*.net *.split)
05:09:11*genpaku quit (*.net *.split)
05:09:11*cornfeedhobo quit (*.net *.split)
05:09:11*qwestion quit (*.net *.split)
05:09:11*void09 quit (*.net *.split)
05:09:11*NimEventer quit (*.net *.split)
05:09:11*Amun-Ra quit (*.net *.split)
05:09:12*qwr quit (*.net *.split)
05:09:12*syl quit (*.net *.split)
05:10:09*nisstyre quit (*.net *.split)
05:10:09*oz quit (*.net *.split)
05:10:09*DixieFlatline quit (*.net *.split)
05:10:09*mal`` quit (*.net *.split)
05:10:09*gshumway quit (*.net *.split)
05:10:09*Yardanico quit (*.net *.split)
05:10:09*madprog quit (*.net *.split)
05:10:22*crem quit (*.net *.split)
05:10:22*disso_peach quit (*.net *.split)
05:10:23*djanatyn quit (*.net *.split)
05:10:23*systemdsucks quit (*.net *.split)
05:10:23*supakeen quit (*.net *.split)
05:10:23*redj quit (*.net *.split)
05:10:31*nisstyre joined #nim
05:10:31*oz joined #nim
05:10:31*DixieFlatline joined #nim
05:10:31*mal`` joined #nim
05:10:31*gshumway joined #nim
05:10:31*Yardanico joined #nim
05:10:31*madprog joined #nim
05:10:42*crem joined #nim
05:10:42*disso_peach joined #nim
05:10:42*supakeen joined #nim
05:10:42*djanatyn joined #nim
05:10:42*systemdsucks joined #nim
05:10:42*redj joined #nim
05:10:51*fallback quit (*.net *.split)
05:10:51*notchris quit (*.net *.split)
05:10:51*oddish quit (*.net *.split)
05:10:51*oprypin quit (*.net *.split)
05:10:51*reversem3[m] quit (*.net *.split)
05:10:52*drewr quit (*.net *.split)
05:11:11*fallback joined #nim
05:11:11*notchris joined #nim
05:11:11*oddish joined #nim
05:11:11*oprypin joined #nim
05:11:11*reversem3[m] joined #nim
05:11:11*drewr joined #nim
05:11:14*reversem3[m] quit (Ping timeout: 274 seconds)
05:11:59*droidrage joined #nim
05:11:59*om3ga joined #nim
05:11:59*LyndsySimon joined #nim
05:11:59*xaltsc joined #nim
05:11:59*ixmpp joined #nim
05:12:17*def- joined #nim
05:12:17*jkl joined #nim
05:12:54*blackbeard420 joined #nim
05:12:54*FromDiscord joined #nim
05:12:54*via__ joined #nim
05:12:54*euantorano joined #nim
05:12:54*dv^_^ joined #nim
05:13:06*neceve joined #nim
05:13:06*hexeme_ joined #nim
05:13:06*Onionhammer joined #nim
05:13:06*genpaku joined #nim
05:13:06*cornfeedhobo joined #nim
05:13:06*qwestion joined #nim
05:13:06*void09 joined #nim
05:13:06*NimEventer joined #nim
05:13:06*Amun-Ra joined #nim
05:13:06*qwr joined #nim
05:13:06*syl joined #nim
05:13:20*void09_ joined #nim
05:13:21*wallabra quit (*.net *.split)
05:13:21*mahlon quit (*.net *.split)
05:13:21*koltrast quit (*.net *.split)
05:13:22*lumidify quit (*.net *.split)
05:13:22*lain quit (*.net *.split)
05:13:22*tk quit (*.net *.split)
05:13:22*adium quit (*.net *.split)
05:13:22*rb quit (*.net *.split)
05:13:22*tinystoat quit (*.net *.split)
05:13:22*attah quit (*.net *.split)
05:13:22*_________ quit (*.net *.split)
05:13:30*void09 quit (Max SendQ exceeded)
05:14:04*wallabra joined #nim
05:14:04*mahlon joined #nim
05:14:04*koltrast joined #nim
05:14:04*lumidify joined #nim
05:14:04*lain joined #nim
05:14:04*tk joined #nim
05:14:04*adium joined #nim
05:14:04*rb joined #nim
05:14:04*tinystoat joined #nim
05:14:04*attah joined #nim
05:14:04*_________ joined #nim
05:19:11*jmdaemon joined #nim
05:23:16FromDiscord<Yardanico> ah @flywind I missed that part from the FAQ
05:23:21FromDiscord<Yardanico> "A maintainer of a popular open source project is defined as someone who has write or admin access to one or more of the most popular open source projects on GitHub."
05:23:29FromDiscord<Yardanico> so that's why I have free access I guess, since I have write access to the Nim repo
05:23:40FromDiscord<Yardanico> you should have it too
05:45:08*xcodz-dot joined #nim
05:45:49xcodz-dotHow do you write binary string literals. So that b"Hello" turns to a seq[byte]. I tried using a `b` prefix. It did not work
05:47:33FromDiscord<Yardanico> you can't really do that, and there's no real need as Nim strings are already "binary" literals since they don't have an encoding
05:47:34FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=49Bh
05:47:53FromDiscord<Yardanico> or do as beef said I guess, better also add compiletime pragma then :P
05:48:10xcodz-dotHmm, thanks
05:48:58xcodz-dotIsn't it inefficient that way? Shouldn't I preallocate some space to prevent reallocations each time for each character. I am saying so because I am working on a compression algorithm
05:49:50xcodz-dotNvm, I think I would just use strings instead.
05:54:50*reversem3[m] joined #nim
05:54:59*buster_blue[m] joined #nim
06:09:49FromDiscord<flywind> In reply to @Yardanico "so that's why I": I don't seem to have access to it though.
06:10:00FromDiscord<Yardanico> In reply to @flywind "I don't seem to": weird, can you check in the billing? i think you can apply here maybe
06:10:21FromDiscord<Yardanico> in https://github.com/settings/billing in Add-ons section
06:10:32*xcodz-dot quit (Ping timeout: 255 seconds)
06:11:07FromDiscord<flywind> https://media.discordapp.net/attachments/371759389889003532/1015866579508015125/unknown.png
06:11:27FromDiscord<Yardanico> select plan
06:11:34FromDiscord<flywind> https://media.discordapp.net/attachments/371759389889003532/1015866694532612126/unknown.png
06:11:40FromDiscord<Yardanico> weird
06:11:49FromDiscord<Yardanico> is nim not popular enough? 🤔
06:11:59FromDiscord<Yardanico> and yeah, I don't know, maybe I have it for free due to my student plan that'll soon expire
06:12:22FromDiscord<flywind> Probably I wasn't involved in beta testing, or selected programming languages repo needed
06:13:31FromDiscord<flywind> (edit) "Probably ... I" added "because"
06:14:23*xcodz-dot joined #nim
06:14:49*tiorock joined #nim
06:14:49*tiorock quit (Changing host)
06:14:49*tiorock joined #nim
06:14:49*rockcavera is now known as Guest5887
06:14:50*Guest5887 quit (Killed (copper.libera.chat (Nickname regained by services)))
06:14:50*tiorock is now known as rockcavera
06:19:27FromDiscord<Prestige> In reply to @flywind "": I can't imagine anyone paying for this
06:19:50*kenran joined #nim
06:20:06FromDiscord<Rika> You’d be surprised…
06:20:36FromDiscord<Prestige> I would be
06:23:52FromDiscord<flywind> In reply to @Avahe "I can't imagine anyone": If I use Python for work, I probably pay for it.
06:24:14FromDiscord<Prestige> Why?
06:25:02FromDiscord<Rika> In reply to @Avahe "Why?": It works well for python
06:25:40FromDiscord<Prestige> I've seen too much bad/incorrect code come out of that thing
06:28:40FromDiscord<4zv4l> why does the doc for function need to be written under it's name ?↵I don't know if that's the best practice but I'm used to write its doc upside of it
06:29:43*xcodz-dot quit (Quit: Leaving)
06:34:04FromDiscord<Elegantbeef> Cause that's how it is↵(@4zv4l)
06:34:24FromDiscord<Elegantbeef> There is some ambiguity with top level doc comments and procedures though
06:35:18FromDiscord<Elegantbeef> I mean if you do it with the comment above the procedure
06:35:43FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=49Bp
06:42:00*jmdaemon quit (Ping timeout: 244 seconds)
06:50:36*jmdaemon joined #nim
06:58:45*kenran quit (Quit: WeeChat info:version)
07:10:38*jmdaemon quit (Ping timeout: 240 seconds)
07:29:03*tiorock joined #nim
07:29:03*tiorock quit (Changing host)
07:29:04*tiorock joined #nim
07:29:04*rockcavera is now known as Guest7450
07:29:04*Guest7450 quit (Killed (calcium.libera.chat (Nickname regained by services)))
07:29:04*tiorock is now known as rockcavera
07:41:03FromDiscord<Hamid_Bluri> can someone explain why `string` is different from `seq[char]`? ↵I don't get it
07:41:33FromDiscord<Elegantbeef> String stores a nul character after the collection where `seq[byte]` doesnt
07:41:43FromDiscord<Elegantbeef> or `seq[char]` doesnt
07:43:16FromDiscord<Hamid_Bluri> both data types store `size` & `capacity` of their content
07:43:33FromDiscord<Hamid_Bluri> why is `\0` important?
07:43:40FromDiscord<Elegantbeef> Correct but `seq[char]` does not end with a `\0`, `string` is guaranteed to
07:43:48FromDiscord<Elegantbeef> Cause it's a 0 cost transformation to cstring
07:43:59FromDiscord<Hamid_Bluri> Oh, thanks
07:45:14FromDiscord<retkid> I've yet to find a reason to ever make a mcro
07:45:17FromDiscord<retkid> (edit) "mcro" => "macro"
07:45:25FromDiscord<retkid> thats not true
07:45:25FromDiscord<Elegantbeef> Good
07:45:43FromDiscord<retkid> the things I would need a macro for im too lazy to write the macro for
07:46:05FromDiscord<retkid> so whats a good thing to learn to use macros to do
07:46:10FromDiscord<retkid> i cant think of a problem
07:47:55FromDiscord<Rika> You’ll need it when you find it
07:48:16FromDiscord<retkid> its been literal years
07:48:35FromDiscord<retkid> I suppose I just now started using templates
07:48:39FromDiscord<Rika> In reply to @retkid "the things I would": If you’re not lazy enough to put in the effort to make a macro for it then it’s not worth making a macro for then
07:48:47FromDiscord<Rika> In reply to @retkid "its been literal years": Who cares
07:48:57FromDiscord<Rika> So what if it’s been years
07:49:06FromDiscord<Rika> Sometimes you just don’t need a feature
08:11:54*sagax joined #nim
08:19:01FromDiscord<Phil> ~~And sometimes your PR for a feature just lies in wait for ages~~
08:19:56FromDiscord<Elegantbeef> What PR?
08:21:28FromDiscord<Phil> norm one, I merged that very same PR on my fork of norm just so I finally could have the feature. Basically allowing you to use your own ref object with norm instead of being forced to use Model object, only for selects though for now
08:22:30FromDiscord<Phil> webdev space, that stuff is about converting database Row objects to a custom object type
08:24:07FromDiscord<Elegantbeef> Yea my PR to async build nimibook pages took forever to be merged
08:24:07FromDiscord<Elegantbeef> But now it is and it's like \<30s for norm docs to be built
08:24:54FromDiscord<Phil> neat-o!
08:32:34*derpydoo quit (Ping timeout: 244 seconds)
09:17:08*vicecea quit (Remote host closed the connection)
09:17:37*vicecea joined #nim
09:21:51FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=49BV
09:30:11FromDiscord<Rika> What?
09:30:48FromDiscord<4zv4l> In reply to @4zv4l "how can I control": I can't interact with the program after that
09:31:39FromDiscord<4zv4l> when I type, it's my shell that execute commands not the program
09:31:47FromDiscord<4zv4l> but the program still appear so that's weird
09:32:52FromDiscord<4zv4l> so except sigaction, no other solution ?
09:33:00FromDiscord<4zv4l> why doesn't try/except doesn't catch that ?
09:33:27FromDiscord<4zv4l> in ruby we can do `rescue SystemExit, Interrupt`
09:34:51FromDiscord<Rika> Because signals are not exceptions
09:35:18FromDiscord<Rika> I believe you have to disable the hook that ends the program first, I forgot hot but I think it’s a define flag
09:39:14FromDiscord<4zv4l> In reply to @Rika "I believe you have": where can I find that ?
09:39:39FromDiscord<domosokrat> sent a code paste, see https://play.nim-lang.org/#ix=49BY
09:40:01FromDiscord<domosokrat> Meaning, ctrl-c does not terminate the program
09:42:01FromDiscord<4zv4l> alright, it works now when I move `setControlCHook(ctrlC)` outside of the main function
09:42:08FromDiscord<4zv4l> is there anything similar for ctrlD ?
09:42:41FromDiscord<4zv4l> because then I get the same behavior when doing ctrl-d
09:46:12FromDiscord<domosokrat> usually ctrl-d does not get mapped to a signal
09:46:58FromDiscord<domosokrat> it's just eof for stdin
09:59:03*neceve_ joined #nim
10:01:22FromDiscord<4zv4l> alright thanks !
10:01:29FromDiscord<4zv4l> can I increase the terminal font with my program ?
10:02:59madpropsi really doubt it
10:03:09madpropsunless you modify your terminals config and apply the changes somehow
10:03:54madpropsoh i guess you mean just printing bigger letters
10:04:02madpropsnot sure i've seen that either
10:04:44madpropshttps://i.imgur.com/oygnZq0.jpg
10:05:35FromDiscord<domosokrat> some terminals allow changing the used font via control codes. But that is terminal dependent
10:06:00FromDiscord<4zv4l> alright T-T↵just I made a terminal game but it looks better when zooming but it's ok
10:11:47FromDiscord<vestel> In reply to @Bubblie "const pointer": let x = addr someObj
10:22:15FromDiscord<dain> what exactly is "nim check"
10:22:21FromDiscord<dain> (edit) ""nim check"" => "`nim check`"
10:22:32FromDiscord<dain> ive seen it used / mentioned in some places but I can't find any documentation for it at all
10:22:39FromDiscord<dain> `nim --help` makes no mention of it
10:23:46FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=49C4
10:23:57FromDiscord<dain> that's not the same thing
10:24:04FromDiscord<dain> that's `nim --checks` not `nim check`
10:24:26FromDiscord<aruZeta> ah my bad
10:24:43FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=49C5
10:25:02FromDiscord<dain> huh where is that
10:25:08FromDiscord<dain> it doesn't say that when i run `nim --help`
10:25:25FromDiscord<aruZeta> `nim --fullhelp`
10:25:34FromDiscord<aruZeta> and also https://nim-lang.org/docs/nimc.html#compiler-usage
10:25:34FromDiscord<dain> oooo
10:25:39FromDiscord<dain> thx
10:25:43FromDiscord<aruZeta> https://media.discordapp.net/attachments/371759389889003532/1015930652497023026/unknown.png
10:31:30FromDiscord<domosokrat> sent a code paste, see https://play.nim-lang.org/#ix=49C6
10:38:48FromDiscord<dain> is there a way to "manually" step through an iterator rather than using a for loop, similar to python's `next` function?
10:39:22FromDiscord<Rika> Only if the iterator is not inline
10:39:48FromDiscord<Rika> You can “convert” inline iterators into closure iterators but I don’t know which of beef’s packages it’s in
10:40:09FromDiscord<dain> how do you do it with closure iterators
10:40:26FromDiscord<Rika> Say you store a closure iterator in a variable by calling the function that returns it
10:40:54FromDiscord<Rika> Calling that variable will return the value and advance the iterator
10:42:39FromDiscord<Rika> Nim doesn’t raise an exception when the iterator is finished, you have to check with a call to “finished”
10:42:48FromDiscord<Rika> Info here
10:42:48FromDiscord<Rika> https://nim-lang.github.io/Nim/manual.html#iterators-and-the-for-statement-firstminusclass-iterators
10:43:22FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=49Ca
10:44:39FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=49Cb
10:45:19FromDiscord<Rika> You have to call the variable
10:45:21FromDiscord<Rika> it()
10:45:46FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=49Cc
10:45:49FromDiscord<Rika> ? What’s the error
10:46:05FromDiscord<Rika> Oh wait no that’s not returning the iterator
10:46:19FromDiscord<Rika> ? I’m confused wait
10:46:32FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=49Cd
10:46:56FromDiscord<Rika> In reply to @dain "can you explain more.": That should work, what’s the error for this
10:47:20FromDiscord<Rika> Actually should it?
10:47:27FromDiscord<Rika> I think not really
10:47:48FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=49Ce
10:47:48FromDiscord<Rika> var it = mycount↵echo mycount()
10:48:37FromDiscord<dain> okay yeah that worked. that's so weird though
10:49:08FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=49Cf
10:49:10FromDiscord<Rika> You can’t directly call a closure iterator because it doesn’t then have a place to store the data
10:49:19FromDiscord<Rika> So you store it in a variable first then call it
10:49:30FromDiscord<Rika> At least that’s what I assume is why it doesn’t work
10:49:32FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=49Cg
10:49:42FromDiscord<Rika> (edit) "You can’t directly call a closure iterator because it doesn’t then have a place to store the ... data" added "closure"
10:51:11FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=49Ch
10:52:01FromDiscord<dain> looks like this is just aliasing `it1` and `it2` to `mycount` or something.
10:52:14FromDiscord<Rika> Yeah I can see the confusion
10:52:46FromDiscord<dain> also it doesnt seem to be documented in the manual that you can do this, iterators are only accessed in a for loop there
10:53:11*rockcavera quit (Ping timeout: 260 seconds)
10:54:44FromDiscord<dain> oh wait no there is a part where it shows another way
11:09:00*rockcavera joined #nim
11:09:01*rockcavera quit (Changing host)
11:09:01*rockcavera joined #nim
11:53:10FromDiscord<dlesnoff> I have a simple question.↵Is it possible to remove a variable/type from the « namespace » ?↵Especially in inim, I would like to do tests on a type. I want to change a type's field (and keep the same name for the object).
11:53:20FromDiscord<dlesnoff> (edit) "I have a simple question.↵Is" => "Is"
11:58:55FromDiscord<Superstart033> Good morning everyone
12:02:31FromDiscord<auxym> In reply to @Jiezron "Is it possible to": you can use a `block` to create a new scope when you define your type. this way as soon as you exit the scope, your type is not visible anymore, and you are free to create it in a new block
12:10:38FromDiscord<headphonejack> I just compiled Nim from source on my Gentoo Linux. Is it possible to install the nim binaries under -say- $HOME/.local/bin/. ? Is there something like 'make install' ?
12:16:52*arkurious joined #nim
12:27:38FromDiscord<dlesnoff> In reply to @auxym "you can use a": I guess what I want to do in the end is to import and unimport type definitions from a module. It would easen back and forth changes, and enable a similar code to use two differents type definitions.
13:21:39FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=49CN
13:23:51FromDiscord<aruZeta> you just can't
13:24:07FromDiscord<aruZeta> you must do it like in your 2nd or 3rd example
13:24:27FromDiscord<aruZeta> the type of everything must be able to be known at compiletime
13:30:05FromDiscord<dlesnoff> Then why don't we get an error message at the type construction ? This is surprising !
13:30:09FromDiscord<vestel> Seq is a collection of objects, it must know size of objects that it will store
13:30:21FromDiscord<vestel> So you must specify type
13:31:08FromDiscord<vestel> In reply to @Jiezron "Then why don't we": maybe there is some messing with typedesc, not sure
13:31:11FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=49CQ
13:31:17FromDiscord<vestel> (edit) "typedesc," => "`typedesc`,"
13:31:29FromDiscord<aruZeta> In reply to @Jiezron "Then why don't we": you get it
13:31:44FromDiscord<aruZeta> `Error: invalid type: 'T' in this context: 'myObject' for var`
13:32:56FromDiscord<aruZeta> https://play.nim-lang.org/ is down :(
14:01:23FromDiscord<dlesnoff> I have transposed my question in a forum post: https://forum.nim-lang.org/t/9436
14:02:56FromDiscord<auxym> In reply to @Jiezron "I guess what I": hm can you use import in a block? Never tried it but you could try
14:04:01FromDiscord<dlesnoff> The thing is I don't want scoping. Now that I think about it, I could use a when block
14:08:26*kenran joined #nim
14:35:21FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=49D4
14:49:07FromDiscord<auxym> how does it differ from std/lists?
14:57:13FromDiscord<Prestige> I've been curious if there are advantages to using uint vs Natural for stuff like this
14:57:30FromDiscord<Prestige> For the `length` property
14:58:55FromDiscord<jos> is there any way to avoid name collisions with imports themselves
14:59:11FromDiscord<aruZeta> you mean the module's name?
14:59:13FromDiscord<jos> like import x; var x = 1; doesn't work
14:59:14FromDiscord<jos> ye
14:59:27FromDiscord<jos> I noticed ppl usually use plural for module names
14:59:41FromDiscord<Prestige> import x as xModule
14:59:46FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=49Da
15:00:04FromDiscord<jos> is xModule even like
15:00:10FromDiscord<jos> valid as an identifier now or something
15:00:29FromDiscord<jos> like if it imports all the items by default why does it care if there's a collision anyway
15:00:46FromDiscord<aruZeta> for exporting for example
15:00:58FromDiscord<aruZeta> you can export a whole module you imported
15:01:17FromDiscord<aruZeta> so how would it know which module to export if you import 2 modules with the same name
15:02:02FromDiscord<aruZeta> this could be solved if you could export modules like `export a/b/myModule`, but it does not wokr
15:02:03FromDiscord<aruZeta> (edit) "wokr" => "work"
15:02:16FromDiscord<aruZeta> you have to `export myModule`
15:13:24*kenran quit (Quit: WeeChat info:version)
15:26:27FromDiscord<dain> i always get tripped up with trying to use iterators for anything at all
15:26:32FromDiscord<dain> what am i doing wrong here
15:26:42FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=49Dj
15:28:06FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=49Dl
15:28:37FromDiscord<dain> (edit) "https://play.nim-lang.org/#ix=49Dj" => "https://play.nim-lang.org/#ix=49Dm"
15:29:40FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=49Dn
15:30:37FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=49Do
15:31:10*estiquelapice joined #nim
15:43:34FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=49Dq
15:43:53FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=49Dr
15:44:04FromDiscord<dain> it is so annoying how you can't just use iterators like actual values and need this workaround
15:44:47FromDiscord<dain> like yeah i know there are inline vs closure iterators but i never know which one im dealing with when it's given to me by a function
15:45:29FromDiscord<aruZeta> In reply to @dain "like yeah i know": you can check their definition
15:45:32FromDiscord<aruZeta> https://nim-lang.org/docs/io.html#lines.i%2CFile
15:47:48*estiquelapice quit ()
15:48:53*estiquelapice joined #nim
15:51:27FromDiscord<dain> it just says iterator
15:52:53*estiquelapice quit (Client Quit)
15:53:44FromDiscord<dain> also what is the difference between iterable and iterator
15:54:04*estiquelapice joined #nim
15:57:23*estiquelapice quit (Client Quit)
15:58:28*estiquelapice joined #nim
16:00:21*estiquelapice quit (Client Quit)
16:10:37*estiquelapice joined #nim
16:12:15FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=49Dw
16:12:56FromDiscord<0ffh> Um, how do you format-quote source in a message again?
16:13:05FromDiscord<dain> triple backtick
16:13:09FromDiscord<0ffh> Thanks!
16:13:56*estiquelapice quit (Client Quit)
16:14:26FromDiscord<0ffh> sent a code paste, see https://play.nim-lang.org/#ix=49Dx
16:15:00*estiquelapice joined #nim
16:15:48FromDiscord<aruZeta> so you like circles huh 🤨 https://media.discordapp.net/attachments/371759389889003532/1016018755077279795/unknown.png
16:19:43*estiquelapice quit (Client Quit)
16:42:20FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=49DE
16:43:26FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=49DI
16:43:28FromDiscord<dain> (it goes on longer than this)
16:43:37FromDiscord<dain> i just want to be able to take two iterables and yield another iterable
16:47:53FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=49DM
16:48:41FromDiscord<dlesnoff> Hmm but you want to change this line: for seqitm in items(seqs): inc(L, len(seqitm))
16:51:01FromDiscord<0ffh> sent a code paste, see https://play.nim-lang.org/#ix=49DP
16:51:21FromDiscord<dain> but that doesn't work either, for a different reason. i posted above about it
16:51:33FromDiscord<dain> you can't even assign the `a.lines` to a variable. you have to just use it straight away
16:51:52FromDiscord<0ffh> oh, okay 😔
16:51:55FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=49DQ
16:52:23FromDiscord<0ffh> so nim doesn't like to assign iterators into variables
16:52:42FromDiscord<dain> every time i try to use nim i run into some fucking absurdity like this
16:53:21FromDiscord<aruZeta> In reply to @dain "you can't even assign": ig that's because it's an inline operator?
16:53:51FromDiscord<aruZeta> > An inline iterator is an iterator that's always inlined by the compiler leading to zero overhead for the abstraction, but may result in a heavy increase in code size.↵↵> a closure iterator can be passed around more freely
16:54:03FromDiscord<0ffh> might be, you'd have to look in the library implementation
16:54:03FromDiscord<dain> okay so how do I turn it into a closure iterator
16:54:13FromDiscord<aruZeta> In reply to @0ffh "might be, you'd have": it is
16:54:25FromDiscord<aruZeta> In reply to @dain "okay so how do": that's ... something i don't know :|
16:54:41FromDiscord<dain> like .. why would i ever want an inline iterator if i can't even assign it to a variable
16:55:01FromDiscord<0ffh> In reply to @dain "okay so how do": I think you should be able to write your own closure iterator for this case and then use that
16:55:03FromDiscord<dain> or pass it into a proc or do anything with it
16:55:24FromDiscord<dain> but every fucking iterator in the stdlib is inline by default so i'd be writing wrappers for days
16:56:06FromDiscord<0ffh> Hmmm, how about a template or macro that creates a closure iterator from an inline iterator?
16:56:36FromDiscord<dain> i guess that would work. but really what i dont understand is why this split exists in the first place
16:56:37FromDiscord<Rika> Already made
16:56:46FromDiscord<Rika> Beef made one somewhere in his libraries
16:57:03FromDiscord<aruZeta> the good beef
16:57:35FromDiscord<0ffh> now to find it! 😆
16:58:38FromDiscord<Rika> Probably his iterator library
16:58:58FromDiscord<0ffh> sounds vaguely plausible 😂
16:59:41FromDiscord<aruZeta> maybe https://github.com/beef331/slicerator/blob/master/src/closures.nim
17:00:09FromDiscord<aruZeta> ig https://github.com/beef331/slicerator/blob/master/src/closures.nim#L60-L62
17:00:53FromDiscord<0ffh> @dain that looks quite like what you need!
17:01:50*estiquelapice joined #nim
17:06:19FromDiscord<dain> gives an error when I try to use it
17:06:33FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=49DU
17:07:47FromDiscord<dain> but still this is a side issue, even when I just pass in `.lines` directly it doesn't work and im no closer to figuring out why
17:09:07FromDiscord<dain> sent a code paste, see https://paste.rs/Iee
17:09:15FromDiscord<dain> (edit) "https://play.nim-lang.org/#ix=49DX" => "https://play.nim-lang.org/#ix=49DW"
17:09:48FromDiscord<dain> ive tried a bunch of different ways of writing and wrapping the `union` iterator
17:10:11FromDiscord<dain> as a proc, iterator, template, etc
17:10:32FromDiscord<dain> i just want to lazily go through two iterators and yield the union
17:12:55FromDiscord<0ffh> In reply to @dain "i just want to": try this workaround: if you cannot pass the inline iterators, just pass the files instead
17:13:06FromDiscord<dlesnoff> In reply to @0ffh "A question about concatenating": Tried to modify the std implementation for the concatenation but I don't get how to circumvent the issue with the return type. We can not return an openArray, and we have to know the size of the array we return before the call. At the same time, we need the list of arrays to concatenate to determine the size of the final array.
17:14:03FromDiscord<0ffh> In reply to @Jiezron "Tried to modify the": Thanks! If it doesn't work nevermind it's not super important to me. I'll just use sequences and everything is fine!
17:14:39FromDiscord<0ffh> Seems like this will be done in the compiler at some point or not at all.
17:14:44*emery quit (Ping timeout: 255 seconds)
17:15:46FromDiscord<aruZeta> @0ffh if you want to use a seq as a array (if you know which will be it's size when creating it) you can use `newSeqOfCap[type](max len)`
17:16:05FromDiscord<dlesnoff> In reply to @0ffh "Thanks! If it doesn't": I think this is an important point that you raised. If I cant do it with a func, maybe I will manage to do it with a macro/template
17:16:20FromDiscord<dain> In reply to @0ffh "try this workaround: if": yeah that's what I did at first. it worked. but I wanted to extend it to arbitrary iterators, to make it more general-purpose
17:16:28FromDiscord<aruZeta> it's kind of the same as using an array, the only difference is that the seq will also hold the cap
17:16:51FromDiscord<dain> (edit) "general-purpose" => "general-purpose. make it generic over any pair of iterators over the same type"
17:17:10FromDiscord<dain> and i can't for the life of me figure it out
17:18:34*ehmry joined #nim
17:18:42FromDiscord<0ffh> In reply to @aruZeta "it's kind of the": I assume that with a constant sequence the compiler will automatically set the cap to the number of elements.
17:18:54*jmdaemon joined #nim
17:19:08FromDiscord<0ffh> So that shouldn't be neccessary.
17:19:16FromDiscord<0ffh> (edit) "neccessary." => "necessary."
17:23:25FromDiscord<aruZeta> In reply to @0ffh "I assume that with": oh yh right
17:23:50FromDiscord<aruZeta> sometimes I forget abt that lol
17:33:42FromDiscord<! Nilts> Is nim good for server backend?
17:35:28FromDiscord<treeform> yes, use one at work
17:35:37FromDiscord<treeform> (edit) "yes, ... use" added "I"
17:38:06FromDiscord<! Nilts> In reply to @treeform "yes, I use one": I don’t get that stament? You use a nim server backend at work?
17:38:21FromDiscord<! Nilts> ah
17:38:22FromDiscord<! Nilts> ok
17:38:25FromDiscord<! Nilts> nice!
17:40:04FromDiscord<treeform> yes that's right
17:40:28FromDiscord<treeform> I use it both on front end and backend... which also allows me to share some code.
17:40:50*estiquelapice quit ()
17:42:26*estiquelapice joined #nim
17:43:57FromDiscord<Phil> In reply to @not logged in "Is nim good for": Yes, I have a REST backend with nim's "prologue" framework
17:44:22FromDiscord<! Nilts> 👍
17:46:40FromDiscord<Phil> Backend for an Angular REST API.↵The entire tech stack is↵Angular (Frontend) - Nginx (Reverse Proxy) - Prologue (Covers Routing and general request handling)↵Within the prologue application I use jsony for (de)serialization, tinypool for connection pooling, and constructor to make writing construction-procs for norm-models less annoying
17:47:18FromDiscord<Phil> Also zippy to compress the requests as part of a middleware I wrote on the fly for request compression
17:47:48FromDiscord<Phil> Further the entire thing is deployed in a docker-alpine container and thus dynamically linked with musl, guides on how to do that are within the prologue docs
17:51:14FromDiscord<Phil> Oh and openssl for password encryption I guess
17:51:49FromDiscord<Phil> (edit) "encryption" => "hasing"
17:51:53FromDiscord<Phil> (edit) "hasing" => "hashing"
18:01:12FromDiscord<Forest [She/Her]> In the compiler/modulegraphs module, is it possible to get the defined symbols passed by the user?
18:01:23FromDiscord<Forest [She/Her]> Defined... Types?
18:01:44FromDiscord<Forest [She/Her]> Idk, like when you pass `-d:definition=value` to the compiler
18:02:02FromDiscord<Forest [She/Her]> I'm making a compiler backend so using `when defined(definition)` won't work
18:07:13FromDiscord<Forest [She/Her]> Figured it out
18:07:17FromDiscord<Forest [She/Her]> Mostly
18:09:27*estiquelapice quit ()
18:10:32*estiquelapice joined #nim
18:26:30FromDiscord<voidwalker> anyone with some curl/nim httpclient/http api calls experience can take a look at this please ?: https://forum.nim-lang.org/t/9434
18:27:02FromDiscord<voidwalker> been 24 hours and no hint how to go forward with this. I can't even open the code, I have trauma
18:33:48*estiquelapice quit ()
18:33:52*rockcavera quit (Remote host closed the connection)
18:35:49FromDiscord<Bung> there is newHttpHeaders
18:36:22FromDiscord<voidwalker> yeah I tried with those, only it appears they are not actual http headers but still in the form data
18:36:57FromDiscord<voidwalker> I should maybe search for http server made for debuggin, see what curl does there.. and see where I can change in httpclient
18:37:29FromDiscord<Bung> can't be that, form data is in http body
18:38:15FromDiscord<Bung> otherwise many http server or client usage are goes wrong
18:39:27FromDiscord<Bung> haven't seen such a problem in nim economy
18:39:36FromDiscord<voidwalker> I have no idea, I only know that curl line works, and anything I tried in httpclient gives me code 500
18:39:51FromDiscord<voidwalker> I cannot use libcurl since it is not async
18:40:33FromDiscord<Bung> it might be your problem, so show the code
18:45:39FromDiscord<Bung> https://github.com/bung87/scorper/blob/5080928361b464a36cb4966d996d6ec9bb4808e0/tests/trange.nim#L28 you use it like this ?
18:47:53FromDiscord<voidwalker> I tried something like this
18:47:54FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=49Eb
18:50:08FromDiscord<Rika> nim lowercases the header names as they should not be case sensitive as per the http spec
18:50:19FromDiscord<Rika> perhaps the server has this incorrectly programmed
18:50:30FromDiscord<Rika> and has header names as case sensitive
18:51:00FromDiscord<Bung> I have no idea why u create two client
18:51:03FromDiscord<voidwalker> i looked at other http client api wrappersm java, go, js, none have implemented this nocopy shit that I need
18:51:04FromDiscord<Rika> test with curl by using `abspath` instead of `Abspath` ig
18:51:34FromDiscord<voidwalker> @Bung I did that just to debug, to make sure it is all separated.. cause I needed another config call before the actual call, to make sure an option is set
18:51:53FromDiscord<voidwalker> but I have since learned that it requires server restart to take effect, and I can't restart server via API ,so quite useless
18:52:15FromDiscord<voidwalker> (edit) "@Bung I did that just to debug, to make sure it is all separated.. cause I needed another config ... call" added "setting API"
18:53:31FromDiscord<voidwalker> it works with lowercase in curl @Rika , so that's not it.. sigh
18:53:44FromDiscord<voidwalker> time to google some http debug servers
18:54:31FromDiscord<Bung> that's maybe the server side problem , if your request correctly sent
18:55:09FromDiscord<voidwalker> well it is not sent correctly, otherwise it would work
18:57:41FromDiscord<Bung> u need modified to one client version , otherwise I cant see the real logic
18:58:03FromDiscord<Rika> arent there stub webservers to look at sent requests
18:58:55FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=49Ee
18:59:21FromDiscord<Bung> yeah, that's should be easy confirm, also send with header is very basic function I dont think there's much problem on there
19:01:25FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=49Eg
19:01:32FromDiscord<voidwalker> (edit)
19:03:18FromDiscord<voidwalker> vs nim:
19:03:26FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=49Eh
19:03:34FromDiscord<voidwalker> (edit)
19:04:17FromDiscord<voidwalker> so yeah that abspath bullshit does not go in the main headers, like I thought
19:07:42FromDiscord<voidwalker> with this code:
19:08:35FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=49Ek
19:08:35FromDiscord<voidwalker> I get:
19:08:43FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=49El
19:08:55FromDiscord<voidwalker> (edit)
19:09:37FromDiscord<voidwalker> so I need to get that Abspath thing to go with the file data somehow
19:12:00FromDiscord<Bung> what's your nim version ? have you tried old version
19:12:05FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=49Em
19:13:06FromDiscord<voidwalker> 1.6.6 Why would I try older versions?
19:13:59FromDiscord<Phil> ~~devel or bust~~
19:14:54FromDiscord<Bung> like here people may answered base on their experience, it may out of date , as their experience base on older nim version
19:15:04FromDiscord<Bung> maybe something is broken
19:18:21FromDiscord<voidwalker> I have a feeling that something might not be implemented, with the higher level API
19:18:43FromDiscord<voidwalker> Like my first nim httpclient post, what I wanted to do could not be done, and the solution was a mod
19:18:56FromDiscord<voidwalker> we need a crowdfunding to get a real capable httpclient in nim : (
19:22:39FromDiscord<Bung> can't be "not be implemented" , maybe just broken
19:24:05FromDiscord<voidwalker> Nah there is nothing broken here as I feel it, I just can't set a custom "header" for the multipart data
19:25:53FromDiscord<voidwalker> doing data.add and data.addFiles opens up two elements in the multi part data object, and I need everything to be in just one. Not familiar with the http protocol, but that's what I got from this
19:26:13FromDiscord<Bung> no idea, it works for me as https://github.com/bung87/scorper all test passed
19:26:28*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
19:27:08FromDiscord<voidwalker> what does scorper have to do with it, do you have a similar API request done with nim's httpclient ?
19:28:06FromDiscord<Bung> https://github.com/bung87/scorper/blob/5080928361b464a36cb4966d996d6ec9bb4808e0/tests/trange.nim yeah , http range request , similar with your usage
19:28:15FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=49Eq
19:33:30*estiquelapice joined #nim
19:36:15FromDiscord<Bung> ?
19:38:12FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=49Et
19:38:21FromDiscord<voidwalker> maybe I can add name/content to that entry manually
19:41:17FromDiscord<Bung> but you dont have to , it's http spec, one data one entry
19:44:51FromDiscord<voidwalker> well whatever the http spec is, curl can do it
19:45:11FromDiscord<voidwalker> and for file there is separate filename/fileSize entries, in addition to name/content
19:51:11FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=49Eu
19:51:15FromDiscord<voidwalker> ah, I cannot change it since content is not exported
19:51:36FromDiscord<Bung> oh, I read the issue , yeah it's in spec, just many tools never use that
19:52:01FromDiscord<Bung> you should implement the client your self now
19:54:22FromDiscord<voidwalker> haha 😄
19:54:37FromDiscord<voidwalker> I'd rather start a crowdfunding for a proper one
19:54:49FromDiscord<voidwalker> it does not help we have 5 shitty http clients instead of a good one
19:55:23FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=49Ev
19:55:29FromDiscord<voidwalker> data.content[0], data.content[1]
19:55:54FromDiscord<voidwalker> so name and content should be a seq, not a simple var.. to handle this case?
20:04:37*jmdaemon joined #nim
20:05:56FromDiscord<Bung> dont know what you mean name and content
20:09:26FromDiscord<Require Support> when new post? https://nim-lang.org/araq/ 🤔
20:18:17FromDiscord<Tuatarian> how would I make this work as expected?
20:18:28FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=49EA
20:19:37FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=
20:19:38FromDiscord<Tuatarian> oops
20:20:00FromDiscord<Tuatarian> but if I write `echo vec(1, 2, 3)` it gives me the error `type mismatch: got 'varargs[int]' for '[1, 2, 3]' but expected 'Vec[3]`
20:32:33FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=49EC
20:33:36FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=49EE
20:39:41*rockcavera joined #nim
20:39:41*rockcavera quit (Changing host)
20:39:41*rockcavera joined #nim
20:47:58*jmdaemon quit (Ping timeout: 240 seconds)
20:54:30FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=49EI
20:54:52FromDiscord<dain> i know that in python you can't do this safely because mutating a container as you iterate over it can cause items to be skipped. is that the case in nim too? if so, how do i do this
20:59:45FromDiscord<Elegantbeef> Nims iterators check generally that the collection is not mutated, probably best to just make a new table as you go
21:04:23qwrdain: mutating iterated collection is generally unsafe: https://play.nim-lang.org/#ix=49EK
21:05:17qwrdain: but you can copy the pairs iterator with .toSeq (from sequtils)
21:07:22qwrso it would be for k, v in my_table.pairs.toSeq: # mutating te my_table
21:08:29*qwr don't know, which is more efficient, copying the iterator or table itself...
21:11:07*termer quit (Quit: ZNC 1.7.5+deb4 - https://znc.in)
21:15:59*termer joined #nim
21:19:02*adium quit (Quit: Stable ZNC by #bnc4you)
21:22:36*tiorock joined #nim
21:22:36*tiorock quit (Changing host)
21:22:36*tiorock joined #nim
21:22:36*rockcavera is now known as Guest7059
21:22:36*tiorock is now known as rockcavera
21:25:20*jmdaemon joined #nim
21:25:55*Guest7059 quit (Ping timeout: 252 seconds)
21:32:05*adium joined #nim
21:35:42FromDiscord<can.l> Is there a version of the "of" Operator (as in "myObject of BaseType") which does not allow subtypes?
21:38:34FromDiscord<can.l> So that only exact type matches are allowed (assuming that B inherits from A, "B() of A" would return false, while "B() of B" would return true).
21:41:43FromDiscord<Elegantbeef> There is not a way presently, but there is a sorta bodge you can do
21:42:58*neceve_ quit (Ping timeout: 240 seconds)
21:43:56FromDiscord<can.l> I thought I vaguely remembered that there was some weird pointer math you could do in order to access the typeid of the object. Are you referring to that?
21:44:02FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=49ES
21:44:08FromDiscord<Elegantbeef> Yea that's what i'm referring to
21:44:13FromDiscord<Elegantbeef> I'm presently writing it 😄
21:44:20FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=49ET
21:44:24FromDiscord<Tuatarian> not sure what exactly this means
21:44:37FromDiscord<Elegantbeef> It means you passed non static values to that
21:44:47FromDiscord<Tuatarian> oh I see
21:45:09FromDiscord<Tuatarian> wait that doesn't make sense
21:45:25FromDiscord<Tuatarian> ` let rect = dvec(tan(c.fovX/2), tan(c.fovY/2))`
21:45:32FromDiscord<Elegantbeef> I generally say only use varargs for procedures
21:45:35FromDiscord<Tuatarian> this is the line that spawns that issue, the length of the varargs is known at comptime
21:45:36FromDiscord<Elegantbeef> i mean for macros
21:45:45FromDiscord<Elegantbeef> it's not the length that's the issue it's the value
21:45:51FromDiscord<Elegantbeef> `c.fovX` isnt a static value
21:46:06FromDiscord<Tuatarian> is there any way to separate the two
21:46:15FromDiscord<Tuatarian> should I just make the size of a `Vec` a runtime value?
21:46:42FromDiscord<Tuatarian> ie `Vec[N : uint16]` instead of `Vec[N : static uint16]`?
21:46:51FromDiscord<Tuatarian> is there a better way around this?
21:46:57FromDiscord<Elegantbeef> That doesnt make it a runtime value
21:46:59FromDiscord<Elegantbeef> and that's not the issue
21:47:20FromDiscord<Tuatarian> is there anyway to make this so that the args don't need to be known at compile time?
21:47:28FromDiscord<Elegantbeef> The issue is that the value you provide isnt a compile time value cause i use `static`
21:47:33FromDiscord<Elegantbeef> Yes remove the static
21:51:45FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=49EU
21:53:10FromDiscord<can.l> Ah, thank you! I was searching on the forum for a while now and completly unable to find it 🙂
21:53:47FromDiscord<Elegantbeef> It really shouldnt be `ref` but i cannot be arsed to make a concept that works for it 😄
21:54:22FromDiscord<Elegantbeef> Anywho Nim stores the type information as the first data on OOP so if you scrape that you can happily get the type information
21:54:47FromDiscord<Elegantbeef> I'm an idiot https://nim-lang.org/docs/system.html#getTypeInfo%2CT exists
22:26:52*jmdaemon quit (Read error: Connection reset by peer)
23:06:48FromDiscord<Elegantbeef> @creikey\: also you made me realise i can simplify vershun to not use macros as much it's much more tame now https://github.com/beef331/nimtrest/blob/master/vershun.nim
23:12:27*jmdaemon joined #nim