<< 30-08-2020 >>

00:00:02*junland quit (Quit: %ZNC Disconnected%)
00:02:16*junland joined #nim
00:23:31*bouzu_ quit (Quit: Leaving)
00:26:33zedeushey disruptek, you around?
00:26:40disruptekyeah.
00:27:15disruptekdo you believe in fate?
00:27:36zedeusi just got hired as a backend dev at a startup, they're using node.js with some google cloud functions stuff but want to rewrite most of it, open to switching to another language. do you have any experience with it? would it be feasible to use nim?
00:28:06disrupteki think it probably works.
00:28:19disruptekyou mean, native nim or nim->js?
00:28:40zedeusdoesn't seem like they support running native stuff, compiling to js could work
00:29:08zedeushttps://cloud.google.com/functions/docs/writing#functions-writing-helloworld-http-nodejs
00:29:40disruptekit has to be google, huh?
00:30:11zedeusthat's what they went with, not sure they'd be happy with changing that part
00:30:39disrupteki'm just asking because native nim binaries on lambda are ~1ms startup.
00:31:03zedeusyeah i've seen your work on that, it's cool
00:31:20disruptekyou can use openapi but you'll probably have to write your own signing code to hook in for jwt.
00:31:27zedeusthey use it with firebase and firestore so it's all integrated, i dunno
00:31:37disruptekah, i use firebase myself.
00:31:43zedeuswith aws?
00:31:46disruptekyeah.
00:31:54disruptekbecause fuck google.
00:31:56zedeuscool, i'll bring it up at some point
00:32:14disruptekalso fuck firebase.
00:32:19disruptekappsync is a superior product imo.
00:32:27disruptekbut anyway...
00:34:05disruptekcongrats on the hire πŸ˜‰
00:34:36zedeusthanks! i'm excited to get started and y'know, not being poor for once
00:34:46disrupteksounds pretty awesome.
00:40:52disruptekzedeus: i test this with firebase.
00:40:54disruptek!repo gcplat
00:40:55disbothttps://github.com/disruptek/gcplat -- 9gcplat: 11Google Cloud Platform (GCP) APIs in Nim 15 4⭐ 0🍴
00:41:02zedeusneat
00:43:12disrupteki will update it. i guess its been awhile.
00:44:44disruptekoh, 'cause i haven't written the openapi 3.0 translator yet.
00:44:55disrupteksomeone started a pr for it but i guess it never got finished.
01:13:27FromDiscord<Varriount> I have not heard happy things about firebase
01:13:58disruptekit works.
01:15:15disruptekthere was really nothing comparable when i started with them in like 2013.
01:32:14*synshroud joined #nim
01:32:26*synshroud_ quit (Ping timeout: 258 seconds)
01:37:27*apahl quit (Ping timeout: 240 seconds)
01:37:45FromDiscord<Varriount> Hm, I'm not too sure about the recent RFC on serialization.
01:38:42FromDiscord<Varriount> I do like using pragmas, however I think the serialization information should be in one pragma (similar to go). That way, you don't get collisions if you have an object being serialized by different libraries.
01:39:34*apahl joined #nim
01:40:03disruptekit's probably something i'll have a strong opinion on, but that doesn't make participating any more interesting to me, unfortunately.
01:45:43FromDiscord<Varriount> disruptek: Is everything ok?
01:46:11disruptekno worse than usual, how are you?
01:47:07FromDiscord<Varriount> Eh, hanging in there. Currently job hunting
01:47:13disruptekoh shoot
01:48:14FromDiscord<Varriount> It's not too bad - I was given 2 weeks notice, and the job market for programmers is (if not exactly bustling) fairly active.
01:48:54disrupteki've heard that. i guess i'm just terrible at self-promotion.
01:49:15disruptekeven zedeus got hired, somehow.
01:49:31disruptekhard to believe they actually fell for it.
02:20:25*muffindrake quit (Ping timeout: 240 seconds)
02:23:04*muffindrake joined #nim
02:57:55*arecacea1 quit (Remote host closed the connection)
02:59:33*arecacea1 joined #nim
03:23:24*audiofile quit (Quit: Default Quit Message)
03:31:53shashlickHow do you even pay your bills maan
03:32:27FromDiscord<Elegant Beef> He spends a lot of time on his knees
03:35:14FromDiscord<Varriount> @shashlick: You mean me? or disruptek?
03:35:37shashlickD
03:35:48disruptekwho told you i pay my bills?
03:36:18disrupteki think i'm around $70k in debt.
03:38:49*synshroud quit (Quit: ZNC 1.7.5 - https://znc.in)
03:40:04*synshroud joined #nim
03:42:05*waleee-cl quit (Quit: Connection closed for inactivity)
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:39*supakeen joined #nim
04:14:43bung@treeform https://github.com/golang/go/blob/master/src/database/sql/sql.go#L390 go's seems a good target
04:15:06*arecacea1 quit (Remote host closed the connection)
04:15:26*arecacea1 joined #nim
04:18:35*NimBot joined #nim
04:26:16*vicfred quit (Quit: Leaving)
04:26:43FromDiscord<treeform> ?
04:27:27*vicfred joined #nim
04:28:22bungI mean db's pool
05:10:22*synshroud quit (Quit: ZNC 1.7.5 - https://znc.in)
05:12:42*synshroud joined #nim
05:51:25*solitudesf joined #nim
05:53:01*narimiran joined #nim
06:10:54*AndroUser quit (Remote host closed the connection)
06:24:11*bebrws joined #nim
06:27:42ForumUpdaterBotNew thread by Lecale: Alternative to float, see https://forum.nim-lang.org/t/6748
06:28:34*synshroud quit (Quit: ZNC 1.7.5 - https://znc.in)
06:28:50*synshroud joined #nim
06:31:42ForumUpdaterBotNew thread by KerryC: How to wrap JavaScript library, see https://forum.nim-lang.org/t/6749
06:45:11*superbia joined #nim
06:53:07*a_chou joined #nim
06:53:29*a_chou quit (Remote host closed the connection)
07:17:55*tsujp quit (Ping timeout: 240 seconds)
07:21:47*tsujp joined #nim
07:43:34*bouzu_ joined #nim
07:47:40*hnOsmium0001 quit (Quit: Connection closed for inactivity)
08:02:59*synshroud quit (Quit: ZNC 1.7.5 - https://znc.in)
08:36:55*superbia quit (Ping timeout: 240 seconds)
08:37:43*superbia joined #nim
08:42:57*gmaggior joined #nim
08:49:25gmaggiorsorry, how do I do an echo without trailing newline inserted?
08:49:32Yardanicostdout.write "hello"
08:54:27gmaggiorYardanico, thanks
08:55:47gmaggiorYardanico, sorry I have undefined stdout, should I import a module?
08:55:48*bouzu__ joined #nim
08:55:54Yardanicono
08:57:49gmaggiorYardanico, I am in nim secret, with nim version 1.0.6 and doesn't work :(
08:58:07Yardanicoit won't work in nim secret
08:58:10Yardaniconim secret is quite limited :)
08:58:18gmaggiorahhh, thank you very much!
08:58:27Yardanicoit runs nimscript (the VM in the compiler used to evaluate compile-time code including macros)
08:58:37*bouzu_ quit (Ping timeout: 260 seconds)
08:58:58Yardanicoyou might want to try inim for a repl-like wrapper for compiling and running nim code
09:01:42gmaggioroh, ok!
09:04:27*drewr quit (Ping timeout: 260 seconds)
09:05:57*drewr joined #nim
09:09:58*bebrws quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:12:12*bebrws joined #nim
09:23:52*gmaggior quit (Quit: Leaving)
09:28:06FromDiscord<dom96> It’s called secret for a reason πŸ™‚
09:55:41*bouzu__ quit (Quit: Leaving)
10:00:43FromGitter<jorjun_twitter> Any pointers on to how to set up vscode for debugging nim? Will i eventually be able to step through breakpoints in the source and hover over variables to see their value?
10:00:55*Vladar joined #nim
10:03:21*Sembei quit (Read error: Connection reset by peer)
10:03:25*supakeen quit (Ping timeout: 240 seconds)
10:04:49*supakeen joined #nim
10:05:26*Araq quit (Ping timeout: 260 seconds)
10:05:49*Sembei joined #nim
10:05:54*bebrws quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:06:43*Araq joined #nim
10:07:21*gangstacat quit (Ping timeout: 244 seconds)
10:07:22*bebrws joined #nim
10:08:20superbiafirst read dis https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html
10:09:22*fowl_ quit (Ping timeout: 246 seconds)
10:09:29federico3dom96: is there any way to get better tracebacks than https://github.com/FedericoCeratto/nim-package-directory/issues/32 ?
10:09:30disbotβž₯ Site crashes if you search "Http"
10:09:42federico3e.g. with line numbers
10:11:10*bebrws quit (Read error: Connection reset by peer)
10:11:25*ofelas quit (Ping timeout: 240 seconds)
10:11:41*fowl_ joined #nim
10:12:00*l1x quit (Ping timeout: 244 seconds)
10:12:00*alehander92 quit (Ping timeout: 244 seconds)
10:12:00*LyndsySimon quit (Ping timeout: 244 seconds)
10:12:00*Hotbees quit (Ping timeout: 244 seconds)
10:13:03Yardanicoit gives you line numbers
10:13:17Yardaniconot sure why it didn't work in this case
10:13:23Yardanicotry to run without -d:release ?
10:13:41*LyndsySimon joined #nim
10:13:44Yardanicofederico3: https://github.com/FedericoCeratto/nim-package-directory/blob/master/nim.cfg#L4 this is not enough
10:14:05Yardanicoyou also need --lineDir:on
10:14:17federico3it's compiled with -d:release
10:14:22Yardanicoeven moreso
10:14:28Yardanico--stackTrace:on enables stack traces
10:14:30Yardanicobut not line numbers
10:14:47federico3--lineTrace:on ?
10:15:04Yardanicoah yes that one
10:15:21federico3ah there's also --lineDir:on
10:15:57Yardanicoyeah sorry
10:16:14Yardanico--lineDir:on is for when you don't use --debugger:native
10:16:23Yardanicoand still want line numbers in GDB and the like
10:20:25*gangstacat joined #nim
10:22:52federico3why can't we enable checks+assertions+stackTrace+lineTrace+release with one flag..
10:23:18Yardanicoyou don't need -d:release then
10:23:21Yardanicojust --opt:speed :P
10:23:31Yardanicohttps://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L72
10:23:40Yardanicoand https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L55
10:23:58Yardanicoah sorry
10:24:06Yardanicoyeah the -d:release is only the first one
10:24:14Yardanicorelease doesn't disable assertions
10:24:27Yardanicoalso all checks are still enabled
10:25:12*ofelas joined #nim
10:26:09federico3lineTrace implies stackTrace actually
10:27:13federico3and opt:speed is not documented on https://nim-lang.org/docs/nimc.html
10:27:32FromDiscord<lqdev> it is?
10:27:37Yardanicoit is
10:27:47Yardanicofederico3: search "--opt:none"
10:27:57Yardanicoit's literally in "command line switches" in "Options"
10:28:03federico3I only see "optimize not at all or for speed|size Note: use -d:release for a release build!"
10:28:21Yardanico"optimize not at all or for speed|size"
10:28:25Yardanicothat is documentation, no?
10:28:27federico3that's my point
10:28:34Yardanicoit looks pretty clear
10:28:35*Hotbees joined #nim
10:28:50Yardanicoand really with the flags you want to compile I don't think you should use -d:release at all
10:28:50federico3no, it does not say what options are enabled and disabled by setting --opt:speed
10:29:00Yardanicoit doesn't touch any options
10:29:05Yardanicoit just passes -O3 to the C compiler
10:29:09federico3hence my point.
10:29:15Yardanicothat shouldn't be documented
10:29:24Yardanicoit's an internal detail (tm)
10:29:43*gangstacat quit (Ping timeout: 272 seconds)
10:30:57FromDiscord<Rika> the option passed to the compiler depends on backend so i dont think it should be documented like that
10:36:10*alehander92 joined #nim
10:36:53*narimiran quit (Ping timeout: 265 seconds)
10:45:44*l1x joined #nim
10:48:49*gangstacat joined #nim
10:53:20*gangstacat quit (Ping timeout: 244 seconds)
11:07:17*alehander92 quit (Ping timeout: 244 seconds)
11:09:28*alehander92 joined #nim
11:09:29*alehander92 quit (Excess Flood)
11:09:50*alehander92 joined #nim
11:12:55*lritter joined #nim
11:40:52*Hotbees quit (Ping timeout: 244 seconds)
11:41:05*sirn quit (Ping timeout: 240 seconds)
11:41:28*l1x quit (Read error: Connection reset by peer)
11:43:45*sirn joined #nim
11:43:51*l1x joined #nim
11:45:26*Hotbees joined #nim
11:52:47*audiofile joined #nim
11:53:10*r4vi quit (Ping timeout: 256 seconds)
11:53:49*audiofile quit (Client Quit)
11:54:18*zedeus quit (Ping timeout: 256 seconds)
11:54:52*euantorano quit (Ping timeout: 256 seconds)
11:55:35*r4vi joined #nim
11:56:57*zedeus joined #nim
11:57:05*euantorano joined #nim
11:58:41bungdoes seq has proc like `shift` ?
11:59:32Zevvshift where?
12:00:21bungmutate get first element
12:06:02*supakeen quit (Quit: WeeChat 2.9)
12:06:43*supakeen joined #nim
12:14:40*Hotbees quit (Read error: Connection reset by peer)
12:14:50*Hotbees joined #nim
12:14:55*euantorano quit (Ping timeout: 240 seconds)
12:15:09*r4vi quit (Read error: Connection reset by peer)
12:15:12*sirn quit (Read error: Connection reset by peer)
12:15:22*sirn joined #nim
12:15:23*r4vi joined #nim
12:15:28*l1x quit (Read error: Connection reset by peer)
12:15:42*euantorano joined #nim
12:15:52*l1x joined #nim
12:17:18FromDiscord<Rika> wdym?
12:26:29Zevvbung: not sure what you mean. You want to remove the first element and move all the rest one down?
12:26:32ZevvJust use 'delete'
12:38:15*euantorano quit (Read error: Connection reset by peer)
12:40:27*euantorano joined #nim
12:58:17bungthe opossite of `pop`
12:58:44bungremove first and return the first
12:59:01ZevvNot in one operation. Just take the first and delete it
12:59:16Zevvbut it's expensive becuase it will move the rest of the seq in memory
13:00:04bungpop doesn't has that effect ?
13:00:38Zevvit removes the *last* not the first
13:00:47Zevvyou want a dequeue probably
13:01:03Zevvhttps://nim-lang.github.io/Nim/deques.html#popFirst%2CDeque%5BT%5D
13:01:12bungnot sure , maybe I just take last one
13:02:03bungjust pick up a free resource , so first or last doesn't that matters
13:02:20Zevvwell, that is not what you said before, is it
13:02:23bungthanks any way
13:02:26Zevvyw
13:03:48bungI found reservedmem module has shift , seems not fit for seq
13:04:34bungbarely seen that module been used.
13:04:45Zevvyou're still not really clear about what you're looking for
13:05:06Zevvif it's really about pinking a free resource, what's wrong with using seq and just taking the last?
13:05:51bungam clear, just the one question become two then
13:06:49bungfirst one is https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift
13:07:18bungsecond one, taking last seems fine to me
13:07:41Zevvwell, the first is just more expensive because of the shifting
13:09:20bungokay, then choose pop better
13:16:52*vqrs_ quit (Ping timeout: 265 seconds)
13:18:48*ofelas quit (Ping timeout: 265 seconds)
13:19:12*ofelas joined #nim
13:20:50*vqrs joined #nim
13:20:56*agent0x00 joined #nim
13:35:52*arecacea1 quit (Remote host closed the connection)
13:36:26*arecacea1 joined #nim
13:39:05FromDiscord<krisppurg> Is there a way to make an array from 1 to 100 `[1..100]` for example split them into 4 parts, like first one would be `[1..25]` then next one would be `[25..50]`, then `[50..75]` and finally `[75..100]`? I know there are slices but I seem to be confused with how to split them into parts (here's my code in an attempt: https://play.nim-lang.org/#ix=2vGL, but failed)
13:41:24FromDiscord<haxscramper> There is a `sequtils.distribute` proc https://nim-lang.org/docs/sequtils.html#distribute%2Cseq%5BT%5D%2CPositive
13:43:36FromDiscord<krisppurg> thank you @haxscramper
13:43:44FromDiscord<haxscramper> !eval import sequtils; echo toSeq(1..24).distribute(4)
13:43:45NimBot@[@[1, 2, 3, 4, 5, 6], @[7, 8, 9, 10, 11, 12], @[13, 14, 15, 16, 17, 18], @[19, 20, 21, 22, 23, 24]]
13:44:02FromDiscord<krisppurg> I used 4
14:05:54*Vladar quit (Quit: Leaving)
14:14:14*PMunch joined #nim
14:43:55disruptekβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–„β–„β–„β–€β–€β–€β–„β–„β–ˆβ–ˆβ–ˆβ–„β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
14:43:57disruptekβ–‘β–‘β–‘β–‘β–‘β–„β–€β–€β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–β–‘β–€β–ˆβ–ˆβ–Œβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
14:44:00disruptekβ–‘β–‘β–‘β–„β–€β–‘β–‘β–‘β–‘β–„β–„β–ˆβ–ˆβ–ˆβ–‘β–Œβ–€β–€β–‘β–€β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
14:44:05disruptekβ–‘β–‘β–„β–ˆβ–‘β–‘β–„β–€β–€β–’β–’β–’β–’β–’β–„β–β–‘β–‘β–‘β–‘β–ˆβ–Œβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
14:44:06disruptekβ–‘β–β–ˆβ–€β–„β–€β–„β–„β–„β–„β–€β–€β–€β–€β–Œβ–‘β–‘β–‘β–‘β–‘β–β–ˆβ–„β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
14:44:09disruptekβ–‘β–Œβ–„β–„β–€β–€β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–Œβ–‘β–‘β–‘β–‘β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–‘β–‘β–‘β–‘β–‘β–‘
14:44:12disruptekβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–β–‘β–‘β–‘β–‘β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–‘β–‘β–‘
14:44:16disruptekβ–‘β–‘β–‘β–‘β–‘leβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–β–‘β–‘β–‘β–‘β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„
14:44:18disruptekβ–‘β–‘β–‘β–‘toucanβ–‘β–‘β–‘β–‘β–‘β–‘β–€β–„β–‘β–‘β–‘β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„
14:44:21disruptekβ–‘β–‘β–‘β–‘β–‘β–‘hasβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–€β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
14:44:26disruptekβ–‘β–‘β–‘β–‘β–‘arrivedβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘
15:04:55PMunchWhat on earth disruptek..
15:07:13*bung quit (Ping timeout: 246 seconds)
15:10:17solitudesflemao
15:11:00Zevvdude you should ix your toucans, you know the rules
15:13:08disruptekbelieve me, i've tried.
15:18:05disrupteki'm out of food again. give me the strength to scrounge up some bread.
15:20:44*voidpi joined #nim
15:26:49*PMunch quit (Quit: leaving)
15:31:58*natrys joined #nim
15:42:22*bung joined #nim
15:46:45*bung quit (Ping timeout: 240 seconds)
16:01:23*krux02 joined #nim
16:03:22*waleee-cl joined #nim
16:19:28*superbia quit (Quit: WeeChat 2.9)
16:20:32*bung joined #nim
16:20:52*hnOsmium0001 joined #nim
16:23:39*narimiran joined #nim
16:31:32disrupteksomehow, i expected more.
16:32:26FromDiscord<Lod> sent a long message, see http://ix.io/2vHX
16:33:25disrupteki dunno, but how does it fail?
16:34:00disruptekYardanico: why does that qualify as a long message?
16:34:01FromDiscord<Lod> It never builds I think, basically the same happening here; https://github.com/vic/heroku-buildpack-nim/issues/3
16:34:03disbotβž₯ Example app build fails ; snippet at 12https://play.nim-lang.org/#ix=2vHY
16:35:07*endragor quit (Remote host closed the connection)
16:35:35disruptekwhat does this software do?
16:35:35*endragor joined #nim
16:38:02disruptekhave it use NIM_BRANCH version-1-0.
16:38:22FromDiscord<Lod> Will try
16:42:14*endragor quit (Ping timeout: 256 seconds)
16:46:12*gangstacat joined #nim
16:52:19FromDiscord<Hearthstone> I think disruptek is now my favourite person in the Nim community-
16:54:51disrupteki wish i could agree.
16:55:40disruptekhe /is/ pretty sexy, though.
16:55:50disrupteklod: did that work or what?
17:00:24disrupteki like flies best because they really don't eat that much. and whatever they eat, they vomit back on to your food, so it's all good.
17:00:55disruptekrats tend to redistribute too much. mice tend to shit in the food.
17:01:05disruptekbut flies, flies are alright.
17:28:07FromGitter<jorjun_twitter> tried to send a youtube clip featuring Renfield...
17:29:42FromDiscord<KingDarBoja> Any good recommendation for reading xls on Nim? I found this: https://github.com/xflywind/xlsx
17:38:22FromGitter<jorjun_twitter> https://github.com/ckkashyap/xml2json
17:42:27FromGitter<jorjun_twitter> The nim forum is not sending out email confirmations, seems..
17:42:41disrupteki've never known it to do this.
17:46:06FromGitter<jorjun_twitter> ah, @disruptek. Thanks. I will ask to be let in at some point. But no hurry
17:46:34*natrys quit (Ping timeout: 265 seconds)
17:46:36disrupteki think only dom96 can help.
17:48:16*endragor joined #nim
17:55:25*endragor quit (Ping timeout: 240 seconds)
17:56:08*solitudesf quit (Remote host closed the connection)
18:04:45*natrys joined #nim
18:05:07*superbia joined #nim
18:15:10*gmaggior joined #nim
18:42:40*tane joined #nim
18:45:22FromDiscord<haxscramper> Can default parameter values affect generic types? I have `type G[T] = object` and `proc t[T](a: G[T] = G[int]()) = discard` - when I call `t('1')` everything works as expected (meaning it compiles), but just `t()` does not work - `cannot infer T` error. Code example: https://play.nim-lang.org/#ix=2vIP
18:51:21*dv-^_^ joined #nim
18:56:23bungit's not about default param
18:56:56bungthe generic type infered from param but you dont provide anyone
18:57:27FromDiscord<Lod> Thanks to the guy o helped me with the heroku question and suggested using "NIM_BRANCH version-1-0". works great now, thanks again πŸ˜‰
18:57:34FromDiscord<Lod> (edit) 'o' => 'who'
18:57:46disrupteknp, maybe submit a PR.
18:58:42FromDiscord<Lod> I think I will
19:00:00bungforget my words
19:00:05*def- quit (Quit: -)
19:00:19FromDiscord<haxscramper> So type of default parameter for procedure is not considered for type inference, only ones that were explicitly provided by user? Why then `proc t[T](t: T = false) = echo typeof T` works as expected
19:00:26*krux02 quit (Read error: Connection reset by peer)
19:00:45*def- joined #nim
19:01:37bungthe compiler may not infered that deeply I think
19:02:25FromDiscord<Clyybber> it shouldn't work
19:02:37bungyour first case use a container that contains T
19:04:05FromDiscord<Clyybber> i think
19:09:25*bung quit (Ping timeout: 240 seconds)
19:15:30*Jesin quit (Quit: Leaving)
19:21:47*bung joined #nim
19:24:04FromDiscord<Rebel> Hello, I am playing around with nim for async operations and I was told it's not ideal nor recommended to use waitFor() + async(); however, for a simple function that returns Future[string] and is invoked in an async main function such as let result = myfunc(xx) it only works when I use waitFor main() and will not work if I do asyncheck or discard main() does anyone know why as waitFor is blocking and not ideal.
19:24:25disruptekof course.
19:25:05disruptekwaitfor doesn't make a lot of sense in an async proc because it nullifies the whole async concept. use await instead.
19:25:12*Jesin joined #nim
19:25:41disruptekin your main(), which is presumably not async, you will need to use waitfor in order to await results from async procs.
19:26:22disruptekif you're sure your main() is async, show us a paste.
19:26:23disruptek~paste
19:26:23disbotpaste: 11a frowned-upon behavior in chat; please use a service such as https://play.nim-lang.org/ or http://ix.io/ or https://gist.github.com/ and supply us a URL instead. -- disruptek
19:28:57FromDiscord<Rebel> here is what I am doing: https://play.nim-lang.org/#ix=2vIT so it would be better if my main function is not async?
19:30:01disruptekwaitfor is always blocking; you use it, as you are using it here, to complete a future that is async.
19:30:13disruptekthis code is written correctly and working correctly.
19:30:18disruptekwhat are you trying to do?
19:30:49*bung quit (Ping timeout: 264 seconds)
19:32:23*bung joined #nim
19:36:55*bung quit (Ping timeout: 240 seconds)
19:39:47gmaggiorNim has something similar to Python 'with'?
19:41:29*bung joined #nim
19:45:45*bung quit (Ping timeout: 240 seconds)
19:48:18*bung joined #nim
19:53:32FromDiscord<haxscramper> AFAIK no, but if you are interseted in things like property managing access to some resource (like `with file as ee` ) and your type has some kind of `close*()` `open*()` procs you can just write macro for this: https://play.nim-lang.org/#ix=2vJ1 . Although there is no `__enter__` and `__exit__` special methods
19:55:00FromDiscord<haxscramper> Or if you want to have temporary alias for some long variable/expression it can be done with simple template
19:56:03*lritter quit (Ping timeout: 258 seconds)
19:56:49*lritter joined #nim
19:59:05*bung quit (Ping timeout: 240 seconds)
20:03:38*bung joined #nim
20:05:46*narimiran quit (Ping timeout: 265 seconds)
20:07:24*endragor joined #nim
20:07:55*bung quit (Ping timeout: 240 seconds)
20:08:09disruptek!repo with
20:08:10disbothttps://github.com/zevv/with -- 9with: 11with macro for Nim 15 55⭐ 5🍴 7& 29 more...
20:13:28*bung joined #nim
20:16:53*endragor quit (Ping timeout: 265 seconds)
20:17:45*bung quit (Ping timeout: 240 seconds)
20:19:45FromGitter<ynfle> Can we get an "official" consensus on when to use implicit return vs `return` vs `result = `? Like one liners, a single if expression etc.
20:20:47disruptekliteral one-liners, like `proc foo = bar`, i don't use result. otherwise, i almost always specify `result =`. i virtually never use `return`.
20:20:56FromDiscord<Rika> it essentially boils down to "whichever looks the cleanest" im pretty sure
20:22:15FromDiscord<haxscramper> Return is mostly used when explicit termination execution is necessary; A lot of code can be written without either return or result since `if/case` is an expression
20:22:19FromDiscord<Elegant Beef> Sometimes you need to return sometimes you dont
20:22:48disruptekeh.. return and continue are code smell to me in nim.
20:25:40FromGitter<ynfle> @distruptek I agree
20:25:42*natrys quit (Quit: natrys)
20:25:48FromDiscord<Rebel> oh sorry for the late reply I just want to asynchronously read a file as this snippet is part of a bigger codebase that deals with async http communications so want to avoid blocking code.
20:26:32FromGitter<ynfle> What about ⏎ ⏎ ```proc day(dayOfWeek: int): string =``` [https://gitter.im/nim-lang/Nim?at=5f4c0b78c3aa024ef9af3974]
20:27:10disruptekwhat about it?
20:29:30*bung joined #nim
20:37:54*bung quit (Ping timeout: 256 seconds)
20:38:24*agentofuser[m] joined #nim
20:44:54*bung joined #nim
20:52:10*bung quit (Ping timeout: 265 seconds)
20:53:47*bung joined #nim
20:58:32*bung quit (Ping timeout: 258 seconds)
21:00:48FromDiscord<Rika> nim has no postfix procs right? i just noticed this, but if that is true, how is `[]` parsed? like `arr[0]` or `aPointer[]` or something?
21:01:40Zevvhttps://play.nim-lang.org/#ix=2vJk
21:01:57*bung joined #nim
21:01:59ZevvnnkBracjetExpr
21:02:10Zevvalmost right. nnkBracketExpr
21:02:40*arecacea1 quit (Remote host closed the connection)
21:02:45Zevvthere's also curlyExpr for `thing{0}`
21:04:21*arecacea1 joined #nim
21:06:05*bung quit (Ping timeout: 240 seconds)
21:11:36*bung joined #nim
21:12:05disrupteksea slugs really aren't edible.
21:14:34FromDiscord<haxscramper> sent a long message, see http://ix.io/2vJm
21:14:36*solitudesf joined #nim
21:14:49FromGitter<ynfle> @distruptek, using the if expr vs, `result =`
21:14:53*agent0x00 quit (Quit: WeeChat 1.9.1)
21:15:02FromDiscord<haxscramper> I still feel like it might blow up any second and I will hit a wall where I **need** something, but it is fundamentally impossible, ever, period
21:15:10disrupteki don't see an if expr.
21:15:34disruptekoh, it's on gitter.
21:16:06disrupteknot a fan. i would rather `result =\n\t...`.
21:16:21FromGitter<ynfle> I just think that looks much more ugly
21:16:38disruptekmaybe, but it's harder to modify the other version.
21:16:55disruptekhere and there, sure, maybe it's /never/ going to change control flow.
21:17:13disruptekbut part of what i love about `result` is that i can install stuff temporarily without changing control flow.
21:17:27disruptekif it becomes permanent, it's fine.
21:18:04disrupteki want clean diffs and result, named block, dominating if/else... all give me that.
21:18:56disruptekthat said, my style has changed since i've been writing nim. i'm not adverse to change. tell me a story and convince me.
21:19:25*bung quit (Ping timeout: 264 seconds)
21:19:31disrupteki think my current style is pretty damned legible, but everyone can improve. i mean, all the rest of you.
21:21:14disrupteki'm thinking of rika specifically, here.
21:21:35*vicfred quit (Quit: Leaving)
21:22:49*vicfred joined #nim
21:23:19*bung joined #nim
21:25:34FromDiscord<Rika> lol
21:26:03FromDiscord<Clyybber> if expression clearly is superiour :P
21:27:39FromGitter<ynfle> I agree @Clybber but I understand that it isn't evident that it's an expression immediately
21:27:59disruptekexactly.
21:28:30FromDiscord<haxscramper> For this one I thing case + raiseAssert in the else branch would be the most 'evident'
21:29:08disruptekthen it won't compile.
21:29:23*lritter quit (Ping timeout: 265 seconds)
21:29:27FromGitter<ynfle> It was a toy example, I'm referring to any case where an if expression would make sense
21:29:57disruptekany case where i can case, i will case. just in case.
21:30:08disruptekbut yeah, annoyingly, you cannot raise in a case expr.
21:30:54FromDiscord<haxscramper> > then it won't compile.↡@disruptek https://play.nim-lang.org/#ix=2vJs
21:31:33disruptekhmmm.
21:31:42disrupteki stand corrected.
21:32:50disruptekweird.
21:33:00disruptekmaybe that was fixed recently.
21:33:31FromDiscord<Clyybber> not really :p
21:33:51disruptekyou can't do it with try: still, right?
21:34:25*bung quit (Ping timeout: 240 seconds)
21:34:28FromDiscord<Clyybber> of course not
21:34:40FromDiscord<haxscramper> It works since `v0.20.0`
21:34:49FromDiscord<Clyybber> or maybe I odn't understand what you mean concretely
21:35:40*bung joined #nim
21:36:07disrupteksometimes you want an immutable value from a proc that can raise. you either have to wrap all your use of the value or use a var because you cannot `let foo = try: ...`
21:36:31FromDiscord<Clyybber> where the ... contains a raise?
21:36:55disruptekit certainly could. it's a try block.
21:36:58FromDiscord<Clyybber> if thats the case, yeah. Its good that its prevented
21:37:02*krux02 joined #nim
21:37:08FromDiscord<haxscramper> https://play.nim-lang.org/#ix=2vJv
21:37:50disruptekyou know you can `case x: of y: elif z: else: q`
21:38:03disruptekjust to break people's macros.
21:38:26FromDiscord<Clyybber> peoples macros be shite
21:38:27FromDiscord<Clyybber> :p
21:38:33FromDiscord<Clyybber> if they break because of that
21:38:38disruptekdude, don't you have a compiler bug to fix?
21:38:45FromDiscord<Clyybber> :p
21:38:57FromDiscord<Clyybber> I'm thinking about making a game
21:39:09FromDiscord<Clyybber> and fixing up my terminal lib
21:39:18FromDiscord<Clyybber> something chill
21:39:27disrupteki have an idea for a game.
21:39:33FromDiscord<Clyybber> but which bug u want fixed?
21:40:05*bung quit (Ping timeout: 240 seconds)
21:40:21disruptekyour character is a ball. it's multiplayer; you play with teams or in a race or in coop. you can push other balls around. that is all.
21:40:51disruptekmostly it's team-building.
21:41:01FromDiscord<haxscramper> > you know you can `case x: of y: elif z: else: q`
21:41:04FromDiscord<Clyybber> https://github.com/HackerPoet/MarbleMarcher in multiplayer
21:41:21FromDiscord<haxscramper> You mean I can put case on a single line or that I can have elif/else?
21:41:35disruptekyou can have elif in a case.
21:41:35FromDiscord<Clyybber> elif else he is scared of
21:42:04*superbia quit (Quit: WeeChat 2.9)
21:42:05FromDiscord<haxscramper> But not on a single line? Because `if: else:` can do this, so I assumed `case` can too
21:42:13disruptekcase can, too.
21:42:22disruptekand speaking of toucans...
21:42:54FromDiscord<haxscramper> Can you show an example please?
21:42:58FromDiscord<haxscramper> !eval echo (case 2: of 2: 2 elif false: 3 else: 24)
21:42:59NimBotCompile failed: /usercode/in.nim(1, 17) Error: expected: ')', but got: 'keyword of'
21:43:27FromDiscord<haxscramper> It works If I put it on multiple lines but not on a single line
21:43:39disrupteksorry.
21:44:26shashlick!eval echo (case 2 of 2: 2 elif false: 3 else: 24)
21:44:27NimBotCompile failed: /usercode/in.nim(1, 21) Error: expected: ')', but got: '2'
21:44:42disruptekyou're missing a :
21:45:34shashlick!eval var i = 3; echo (case i of 3: 2 else: 24)
21:45:35NimBotCompile failed: /usercode/in.nim(1, 32) Error: expected: ')', but got: '2'
21:45:49*solitudesf quit (Ping timeout: 265 seconds)
21:45:49shashlickThere's no : after case i
21:47:27disrupteki'm surprisingly okay with that.
21:49:37*jacereda joined #nim
21:51:22*sagax joined #nim
21:51:24*bung joined #nim
21:53:08jaceredaI'm writing some nim bindings for my lightweight SDL/GLFW/GLUT alternative for simple single-window apps in case anyone is interested: https://github.com/jacereda/nim-cv
21:53:34*abm joined #nim
21:55:55*bung quit (Ping timeout: 240 seconds)
21:56:07*tane quit (Quit: Leaving)
21:57:59*bung joined #nim
21:58:06disruptekjacereda: any example apps?
21:59:01disruptekoh, you have nim examples but no c examples. πŸ˜‰
22:00:57jaceredathere're some nim examples in the examples directory and some C examples in the test directory of the glcv project
22:02:37*bung quit (Ping timeout: 264 seconds)
22:03:07jaceredaright now it should work on windows/linux/macos and with some tiny work it could also integrate the android/ios backends, but I'm not too interested in mobile development lately
22:03:18*bung joined #nim
22:03:51*apahl quit (Ping timeout: 272 seconds)
22:04:08*Senketsu joined #nim
22:04:29*apahl joined #nim
22:06:52jaceredathis is my first nim project in a long time, so if I'm doing anything stupid please let me know
22:07:45disruptekwell, you don't need trailing ;
22:08:02disruptekother than that, the compiler's feedback is probably more valuable.
22:08:04*bung quit (Ping timeout: 256 seconds)
22:10:06disruptekdom96: i'm working on more single-letter variables for ya.
22:10:16jaceredaoh, right, fixed, thanks
22:11:54FromGitter<ondra05> Nim does this with imports: ⏎ ⏎ ```import math ⏎ ⏎ echo fac(3) # 6 ⏎ echo math.fac(3) # 6``` [https://gitter.im/nim-lang/Nim?at=5f4c2429c3aa024ef9af7cb5]
22:12:20FromGitter<ondra05> but i want this ⏎ ⏎ ``` ⏎ mysterious_import math ⏎ ⏎ echo math.fac(3) # 6 ⏎ echo fac(3) # Some nasty error``` [https://gitter.im/nim-lang/Nim?at=5f4c2444ddc2d041c0d9a1e1]
22:12:38disruptekfrom math import nil
22:12:42FromDiscord<lqdev> `from math import nil`
22:12:45*bung joined #nim
22:12:49FromDiscord<lqdev> don't know why you'd want that but ok
22:13:03disrupteksome people just /love/ nasty errors.
22:13:17FromDiscord<lqdev> some people just _hate_ convenience.
22:13:18FromGitter<ondra05> I want to organise my code, factorial was only an example
22:13:36FromDiscord<lqdev> good luck using UFCS with `from x import nil`
22:13:58disruptekthey don't care about that; they are /python/ programmers.
22:14:46FromDiscord<lqdev> i'm not quite sure how requiring explicit namespacing relates to good code organization, you can still use `my_module.sym` if you have a name clash
22:14:53FromDiscord<lqdev> but that pretty much never happens
22:15:05FromDiscord<lqdev> thanks to Overloadingβ„’
22:16:25FromDiscord<tomck> Can i forward declare a proc from another module?
22:16:41disruptekthat's what an import is.
22:16:43FromDiscord<tomck> (i have circular modules, basically)
22:16:50disruptekyou what?
22:16:51FromDiscord<tomck> ^
22:16:57FromDiscord<tomck> i have two modules
22:17:03FromDiscord<tomck> which define == implementations
22:17:05FromDiscord<tomck> that're circular
22:17:13disruptekhow's that workin' out for ya?
22:17:29FromDiscord<tomck> poorly, i've had to move the == impls into a separate 3rd modules, which is a pain
22:17:43*bung quit (Ping timeout: 265 seconds)
22:17:47disrupteki dunno why so many people have trouble with this.
22:18:00FromDiscord<tomck> because circular types are common
22:18:09disruptekmaybe my code is too trivial.
22:18:28FromDiscord<tomck> I'm writing a compiler, where I have a medium level IR
22:18:55FromDiscord<tomck> the IR is annotated with a type, and the type contains some IR (for default struct field values)
22:19:29disrupteki put shared information in a file that is shared by other files.
22:19:38FromDiscord<tomck> I also have an AST which references the IR node it generated, then that IR node references the AST it was generated from
22:19:51FromDiscord<tomck> (which happens to actually be a circular reference, not just in the types)
22:20:05FromDiscord<tomck> but that means i need a file for my AST, IR, and typesystem definitions
22:20:11FromDiscord<tomck> which is going to be insanely huge
22:20:37disruptekso make it a single file that includes 3 files. then import that single file wherever.
22:21:12disruptekit's pretty rare that filesize is an impediment to software development.
22:21:16FromDiscord<tomck> *sigh* it's still kinda.. yuck
22:22:02disruptekcircular imports aren't a thing yet.
22:22:05FromDiscord<tomck> i disagree, unless you have great tools to hop around your codebase quickly (which brings its own set of problems), it's non-trivial to manage a huge file
22:22:07disruptekhow big is your compiler?
22:22:53FromDiscord<tomck> super trivial at the moment, can't be more than 3k lines
22:22:58FromDiscord<tomck> & it's already a pain
22:23:28disrupteknim suffers from the lack of circular imports, but it's 60k.
22:23:30FromDiscord<tomck> i'll try the 'include' thing
22:23:42disrupteknimph is 7-8k and it's a total non-issue.
22:24:01FromDiscord<tomck> i'm not sure loc is a good measure of circular imports becoming an issue
22:24:14disruptekyou just tried to tell me it was hard to develop large files.
22:24:20disruptekare you saying you measure file size by width?
22:24:26disruptekgirth, as it were?
22:24:36FromDiscord<tomck> what, nimph has a 7k line file? that *would* be a pain
22:24:46FromDiscord<tomck> but just 7k loc codebase is fine
22:24:49disruptekno, i use multiple files.
22:25:03FromDiscord<tomck> yeah it's when you have loads of stuff in one file
22:25:10FromDiscord<tomck> regardless i'll try the include thing, i think that might work
22:25:41disruptekit will work fine. it's just annoying for tooling.
22:26:08FromDiscord<tomck> for tooling?
22:26:17disrupteknimsuggest struggles with includes.
22:26:24FromDiscord<tomck> ahhhhhhhhh shame, how come?
22:26:36disruptek~features
22:26:38disbotfeatures: 11begin in the unfortunate state of /unimplemented/ -- disruptek
22:27:53disruptekwhat does your compiler compile?
22:31:43leorize[m]nimsuggest just can't handle forward declared stuff, not includes
22:36:48gmaggiorFromDiscord, thanks for the answer on 'with'
22:36:57gmaggiordisruptek, thanks for the answer on 'with'
22:37:43FromDiscord<tomck> ahhh fair enough
22:37:52FromDiscord<Clyybber> leorize: Wdym can't handle forward decls?
22:38:01FromDiscord<Clyybber> Is there an issue somwhere for that?
22:38:01disruptekgmaggior: bp
22:38:27FromDiscord<tomck> errr.. some stuff lol, it's a pain to explain - it's a graphical lang! so represented through an application which plugs directly into the ast + has the interpreter embedded
22:38:53FromDiscord<Clyybber> sounds interesting
22:39:01leorize[m]Clyybber nimsuggest returns the location data of the first symbol found during AST construction
22:39:08FromDiscord<tomck> https://media.discordapp.net/attachments/371759389889003532/749760139963269170/Screenshot_from_2020-08-22_23-02-46.png
22:39:27FromDiscord<tomck> not sure if you can see that on irc? but it can show the 'current value' of expressions as they update! which is cool
22:39:33leorize[m]if it found the forwarded symbol it will return that immediately
22:39:55leorize[m]probably need to implement a defer function so that it would wait until the symbol actual location is resolved
22:40:18FromDiscord<Clyybber> so basically go to definition is broken?
22:40:22*Senketsu quit (Ping timeout: 256 seconds)
22:40:29FromDiscord<tomck> nim has goto definition?
22:40:39FromDiscord<Clyybber> nimsuggest, I assume
22:41:01FromDiscord<Clyybber> @tomck thats very cool!
22:41:38leorize[m]@Clyybber yea, that and outline
22:41:59leorize[m]basically anything that's location sensitive
22:42:20FromDiscord<tomck> Oh damn i didn't realise nim's tooling was so fleshed out, this is great
22:42:28FromDiscord<tomck> thanks!
22:42:39leorize[m]I think the reference tracking function got broken by that too
22:43:53leorize[m]@tomck yep, editor integration is sparse though, there aren't many working on it
22:44:27leorize[m]there's a language server implementation fwiw
22:46:14leorize[m]@Clyybber if you're interested in fixing that I can show you how to reproduce it
22:46:39FromDiscord<Clyybber> sure, tell me I'll write it down
22:46:51FromDiscord<Clyybber> or make an asciinema
22:48:47FromDiscord<tomck> i don't think i've ever gotten lsp to work in vim *sigh*, vim plugin seems to work pretty well though
22:49:41leorize[m]@Clyybber https://asciinema.org/a/gZEaBzMv8InIfsQo159LtOMXX
22:49:56FromDiscord<Clyybber> thanks <3
22:50:09leorize[m]@tomck if you use neovim then nim.nvim got all the features
23:23:56*jacereda quit (Ping timeout: 256 seconds)
23:41:34*krux02 quit (Remote host closed the connection)
23:55:16*abm quit (Quit: Leaving)