00:00:02 | * | junland quit (Quit: %ZNC Disconnected%) |
00:02:16 | * | junland joined #nim |
00:23:31 | * | bouzu_ quit (Quit: Leaving) |
00:26:33 | zedeus | hey disruptek, you around? |
00:26:40 | disruptek | yeah. |
00:27:15 | disruptek | do you believe in fate? |
00:27:36 | zedeus | i 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:06 | disruptek | i think it probably works. |
00:28:19 | disruptek | you mean, native nim or nim->js? |
00:28:40 | zedeus | doesn't seem like they support running native stuff, compiling to js could work |
00:29:08 | zedeus | https://cloud.google.com/functions/docs/writing#functions-writing-helloworld-http-nodejs |
00:29:40 | disruptek | it has to be google, huh? |
00:30:11 | zedeus | that's what they went with, not sure they'd be happy with changing that part |
00:30:39 | disruptek | i'm just asking because native nim binaries on lambda are ~1ms startup. |
00:31:03 | zedeus | yeah i've seen your work on that, it's cool |
00:31:20 | disruptek | you can use openapi but you'll probably have to write your own signing code to hook in for jwt. |
00:31:27 | zedeus | they use it with firebase and firestore so it's all integrated, i dunno |
00:31:37 | disruptek | ah, i use firebase myself. |
00:31:43 | zedeus | with aws? |
00:31:46 | disruptek | yeah. |
00:31:54 | disruptek | because fuck google. |
00:31:56 | zedeus | cool, i'll bring it up at some point |
00:32:14 | disruptek | also fuck firebase. |
00:32:19 | disruptek | appsync is a superior product imo. |
00:32:27 | disruptek | but anyway... |
00:34:05 | disruptek | congrats on the hire π |
00:34:36 | zedeus | thanks! i'm excited to get started and y'know, not being poor for once |
00:34:46 | disruptek | sounds pretty awesome. |
00:40:52 | disruptek | zedeus: i test this with firebase. |
00:40:54 | disruptek | !repo gcplat |
00:40:55 | disbot | https://github.com/disruptek/gcplat -- 9gcplat: 11Google Cloud Platform (GCP) APIs in Nim 15 4β 0π΄ |
00:41:02 | zedeus | neat |
00:43:12 | disruptek | i will update it. i guess its been awhile. |
00:44:44 | disruptek | oh, 'cause i haven't written the openapi 3.0 translator yet. |
00:44:55 | disruptek | someone started a pr for it but i guess it never got finished. |
01:13:27 | FromDiscord | <Varriount> I have not heard happy things about firebase |
01:13:58 | disruptek | it works. |
01:15:15 | disruptek | there 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:45 | FromDiscord | <Varriount> Hm, I'm not too sure about the recent RFC on serialization. |
01:38:42 | FromDiscord | <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:03 | disruptek | it's probably something i'll have a strong opinion on, but that doesn't make participating any more interesting to me, unfortunately. |
01:45:43 | FromDiscord | <Varriount> disruptek: Is everything ok? |
01:46:11 | disruptek | no worse than usual, how are you? |
01:47:07 | FromDiscord | <Varriount> Eh, hanging in there. Currently job hunting |
01:47:13 | disruptek | oh shoot |
01:48:14 | FromDiscord | <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:54 | disruptek | i've heard that. i guess i'm just terrible at self-promotion. |
01:49:15 | disruptek | even zedeus got hired, somehow. |
01:49:31 | disruptek | hard 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:53 | shashlick | How do you even pay your bills maan |
03:32:27 | FromDiscord | <Elegant Beef> He spends a lot of time on his knees |
03:35:14 | FromDiscord | <Varriount> @shashlick: You mean me? or disruptek? |
03:35:37 | shashlick | D |
03:35:48 | disruptek | who told you i pay my bills? |
03:36:18 | disruptek | i 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:43 | bung | @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:43 | FromDiscord | <treeform> ? |
04:27:27 | * | vicfred joined #nim |
04:28:22 | bung | I 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:42 | ForumUpdaterBot | New 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:42 | ForumUpdaterBot | New 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:25 | gmaggior | sorry, how do I do an echo without trailing newline inserted? |
08:49:32 | Yardanico | stdout.write "hello" |
08:54:27 | gmaggior | Yardanico, thanks |
08:55:47 | gmaggior | Yardanico, sorry I have undefined stdout, should I import a module? |
08:55:48 | * | bouzu__ joined #nim |
08:55:54 | Yardanico | no |
08:57:49 | gmaggior | Yardanico, I am in nim secret, with nim version 1.0.6 and doesn't work :( |
08:58:07 | Yardanico | it won't work in nim secret |
08:58:10 | Yardanico | nim secret is quite limited :) |
08:58:18 | gmaggior | ahhh, thank you very much! |
08:58:27 | Yardanico | it 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:58 | Yardanico | you might want to try inim for a repl-like wrapper for compiling and running nim code |
09:01:42 | gmaggior | oh, 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:06 | FromDiscord | <dom96> Itβs called secret for a reason π |
09:55:41 | * | bouzu__ quit (Quit: Leaving) |
10:00:43 | FromGitter | <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:20 | superbia | first 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:29 | federico3 | dom96: is there any way to get better tracebacks than https://github.com/FedericoCeratto/nim-package-directory/issues/32 ? |
10:09:30 | disbot | β₯ Site crashes if you search "Http" |
10:09:42 | federico3 | e.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:03 | Yardanico | it gives you line numbers |
10:13:17 | Yardanico | not sure why it didn't work in this case |
10:13:23 | Yardanico | try to run without -d:release ? |
10:13:41 | * | LyndsySimon joined #nim |
10:13:44 | Yardanico | federico3: https://github.com/FedericoCeratto/nim-package-directory/blob/master/nim.cfg#L4 this is not enough |
10:14:05 | Yardanico | you also need --lineDir:on |
10:14:17 | federico3 | it's compiled with -d:release |
10:14:22 | Yardanico | even moreso |
10:14:28 | Yardanico | --stackTrace:on enables stack traces |
10:14:30 | Yardanico | but not line numbers |
10:14:47 | federico3 | --lineTrace:on ? |
10:15:04 | Yardanico | ah yes that one |
10:15:21 | federico3 | ah there's also --lineDir:on |
10:15:57 | Yardanico | yeah sorry |
10:16:14 | Yardanico | --lineDir:on is for when you don't use --debugger:native |
10:16:23 | Yardanico | and still want line numbers in GDB and the like |
10:20:25 | * | gangstacat joined #nim |
10:22:52 | federico3 | why can't we enable checks+assertions+stackTrace+lineTrace+release with one flag.. |
10:23:18 | Yardanico | you don't need -d:release then |
10:23:21 | Yardanico | just --opt:speed :P |
10:23:31 | Yardanico | https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L72 |
10:23:40 | Yardanico | and https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L55 |
10:23:58 | Yardanico | ah sorry |
10:24:06 | Yardanico | yeah the -d:release is only the first one |
10:24:14 | Yardanico | release doesn't disable assertions |
10:24:27 | Yardanico | also all checks are still enabled |
10:25:12 | * | ofelas joined #nim |
10:26:09 | federico3 | lineTrace implies stackTrace actually |
10:27:13 | federico3 | and opt:speed is not documented on https://nim-lang.org/docs/nimc.html |
10:27:32 | FromDiscord | <lqdev> it is? |
10:27:37 | Yardanico | it is |
10:27:47 | Yardanico | federico3: search "--opt:none" |
10:27:57 | Yardanico | it's literally in "command line switches" in "Options" |
10:28:03 | federico3 | I only see "optimize not at all or for speed|size Note: use -d:release for a release build!" |
10:28:21 | Yardanico | "optimize not at all or for speed|size" |
10:28:25 | Yardanico | that is documentation, no? |
10:28:27 | federico3 | that's my point |
10:28:34 | Yardanico | it looks pretty clear |
10:28:35 | * | Hotbees joined #nim |
10:28:50 | Yardanico | and really with the flags you want to compile I don't think you should use -d:release at all |
10:28:50 | federico3 | no, it does not say what options are enabled and disabled by setting --opt:speed |
10:29:00 | Yardanico | it doesn't touch any options |
10:29:05 | Yardanico | it just passes -O3 to the C compiler |
10:29:09 | federico3 | hence my point. |
10:29:15 | Yardanico | that shouldn't be documented |
10:29:24 | Yardanico | it's an internal detail (tm) |
10:29:43 | * | gangstacat quit (Ping timeout: 272 seconds) |
10:30:57 | FromDiscord | <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:41 | bung | does seq has proc like `shift` ? |
11:59:32 | Zevv | shift where? |
12:00:21 | bung | mutate 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:18 | FromDiscord | <Rika> wdym? |
12:26:29 | Zevv | bung: not sure what you mean. You want to remove the first element and move all the rest one down? |
12:26:32 | Zevv | Just use 'delete' |
12:38:15 | * | euantorano quit (Read error: Connection reset by peer) |
12:40:27 | * | euantorano joined #nim |
12:58:17 | bung | the opossite of `pop` |
12:58:44 | bung | remove first and return the first |
12:59:01 | Zevv | Not in one operation. Just take the first and delete it |
12:59:16 | Zevv | but it's expensive becuase it will move the rest of the seq in memory |
13:00:04 | bung | pop doesn't has that effect ? |
13:00:38 | Zevv | it removes the *last* not the first |
13:00:47 | Zevv | you want a dequeue probably |
13:01:03 | Zevv | https://nim-lang.github.io/Nim/deques.html#popFirst%2CDeque%5BT%5D |
13:01:12 | bung | not sure , maybe I just take last one |
13:02:03 | bung | just pick up a free resource , so first or last doesn't that matters |
13:02:20 | Zevv | well, that is not what you said before, is it |
13:02:23 | bung | thanks any way |
13:02:26 | Zevv | yw |
13:03:48 | bung | I found reservedmem module has shift , seems not fit for seq |
13:04:34 | bung | barely seen that module been used. |
13:04:45 | Zevv | you're still not really clear about what you're looking for |
13:05:06 | Zevv | if it's really about pinking a free resource, what's wrong with using seq and just taking the last? |
13:05:51 | bung | am clear, just the one question become two then |
13:06:49 | bung | first one is https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift |
13:07:18 | bung | second one, taking last seems fine to me |
13:07:41 | Zevv | well, the first is just more expensive because of the shifting |
13:09:20 | bung | okay, 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:05 | FromDiscord | <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:24 | FromDiscord | <haxscramper> There is a `sequtils.distribute` proc https://nim-lang.org/docs/sequtils.html#distribute%2Cseq%5BT%5D%2CPositive |
13:43:36 | FromDiscord | <krisppurg> thank you @haxscramper |
13:43:44 | FromDiscord | <haxscramper> !eval import sequtils; echo toSeq(1..24).distribute(4) |
13:43:45 | NimBot | @[@[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:02 | FromDiscord | <krisppurg> I used 4 |
14:05:54 | * | Vladar quit (Quit: Leaving) |
14:14:14 | * | PMunch joined #nim |
14:43:55 | disruptek | ββββββββββββββββββββββββββββββββββ |
14:43:57 | disruptek | ββββββββββββββββββββββββββββββββββ |
14:44:00 | disruptek | ββββββββββββββββββββββββββββββββββ |
14:44:05 | disruptek | ββββββββββββββββββββββββββββββββββ |
14:44:06 | disruptek | ββββββββββββββββββββββββββββββββββ |
14:44:09 | disruptek | ββββββββββββββββββββββββββββββββββ |
14:44:12 | disruptek | ββββββββββββββββββββββββββββββββββ |
14:44:16 | disruptek | βββββleβββββββββββββββββββββββββββ |
14:44:18 | disruptek | ββββtoucanββββββββββββββββββββββββββ |
14:44:21 | disruptek | ββββββhasββββββββββββββββββββββββββ |
14:44:26 | disruptek | βββββarrivedββββββββββββββββββββββ |
15:04:55 | PMunch | What on earth disruptek.. |
15:07:13 | * | bung quit (Ping timeout: 246 seconds) |
15:10:17 | solitudesf | lemao |
15:11:00 | Zevv | dude you should ix your toucans, you know the rules |
15:13:08 | disruptek | believe me, i've tried. |
15:18:05 | disruptek | i'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:32 | disruptek | somehow, i expected more. |
16:32:26 | FromDiscord | <Lod> sent a long message, see http://ix.io/2vHX |
16:33:25 | disruptek | i dunno, but how does it fail? |
16:34:00 | disruptek | Yardanico: why does that qualify as a long message? |
16:34:01 | FromDiscord | <Lod> It never builds I think, basically the same happening here; https://github.com/vic/heroku-buildpack-nim/issues/3 |
16:34:03 | disbot | β₯ 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:35 | disruptek | what does this software do? |
16:35:35 | * | endragor joined #nim |
16:38:02 | disruptek | have it use NIM_BRANCH version-1-0. |
16:38:22 | FromDiscord | <Lod> Will try |
16:42:14 | * | endragor quit (Ping timeout: 256 seconds) |
16:46:12 | * | gangstacat joined #nim |
16:52:19 | FromDiscord | <Hearthstone> I think disruptek is now my favourite person in the Nim community- |
16:54:51 | disruptek | i wish i could agree. |
16:55:40 | disruptek | he /is/ pretty sexy, though. |
16:55:50 | disruptek | lod: did that work or what? |
17:00:24 | disruptek | i 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:55 | disruptek | rats tend to redistribute too much. mice tend to shit in the food. |
17:01:05 | disruptek | but flies, flies are alright. |
17:28:07 | FromGitter | <jorjun_twitter> tried to send a youtube clip featuring Renfield... |
17:29:42 | FromDiscord | <KingDarBoja> Any good recommendation for reading xls on Nim? I found this: https://github.com/xflywind/xlsx |
17:38:22 | FromGitter | <jorjun_twitter> https://github.com/ckkashyap/xml2json |
17:42:27 | FromGitter | <jorjun_twitter> The nim forum is not sending out email confirmations, seems.. |
17:42:41 | disruptek | i've never known it to do this. |
17:46:06 | FromGitter | <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:36 | disruptek | i 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:22 | FromDiscord | <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:23 | bung | it's not about default param |
18:56:56 | bung | the generic type infered from param but you dont provide anyone |
18:57:27 | FromDiscord | <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:34 | FromDiscord | <Lod> (edit) 'o' => 'who' |
18:57:46 | disruptek | np, maybe submit a PR. |
18:58:42 | FromDiscord | <Lod> I think I will |
19:00:00 | bung | forget my words |
19:00:05 | * | def- quit (Quit: -) |
19:00:19 | FromDiscord | <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:37 | bung | the compiler may not infered that deeply I think |
19:02:25 | FromDiscord | <Clyybber> it shouldn't work |
19:02:37 | bung | your first case use a container that contains T |
19:04:05 | FromDiscord | <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:04 | FromDiscord | <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:25 | disruptek | of course. |
19:25:05 | disruptek | waitfor 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:41 | disruptek | in your main(), which is presumably not async, you will need to use waitfor in order to await results from async procs. |
19:26:22 | disruptek | if you're sure your main() is async, show us a paste. |
19:26:23 | disruptek | ~paste |
19:26:23 | disbot | paste: 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:57 | FromDiscord | <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:01 | disruptek | waitfor is always blocking; you use it, as you are using it here, to complete a future that is async. |
19:30:13 | disruptek | this code is written correctly and working correctly. |
19:30:18 | disruptek | what 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:47 | gmaggior | Nim 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:32 | FromDiscord | <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:00 | FromDiscord | <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:09 | disruptek | !repo with |
20:08:10 | disbot | https://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:45 | FromGitter | <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:47 | disruptek | literal one-liners, like `proc foo = bar`, i don't use result. otherwise, i almost always specify `result =`. i virtually never use `return`. |
20:20:56 | FromDiscord | <Rika> it essentially boils down to "whichever looks the cleanest" im pretty sure |
20:22:15 | FromDiscord | <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:19 | FromDiscord | <Elegant Beef> Sometimes you need to return sometimes you dont |
20:22:48 | disruptek | eh.. return and continue are code smell to me in nim. |
20:25:40 | FromGitter | <ynfle> @distruptek I agree |
20:25:42 | * | natrys quit (Quit: natrys) |
20:25:48 | FromDiscord | <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:32 | FromGitter | <ynfle> What about β β ```proc day(dayOfWeek: int): string =``` [https://gitter.im/nim-lang/Nim?at=5f4c0b78c3aa024ef9af3974] |
20:27:10 | disruptek | what 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:48 | FromDiscord | <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:40 | Zevv | https://play.nim-lang.org/#ix=2vJk |
21:01:57 | * | bung joined #nim |
21:01:59 | Zevv | nnkBracjetExpr |
21:02:10 | Zevv | almost right. nnkBracketExpr |
21:02:40 | * | arecacea1 quit (Remote host closed the connection) |
21:02:45 | Zevv | there'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:05 | disruptek | sea slugs really aren't edible. |
21:14:34 | FromDiscord | <haxscramper> sent a long message, see http://ix.io/2vJm |
21:14:36 | * | solitudesf joined #nim |
21:14:49 | FromGitter | <ynfle> @distruptek, using the if expr vs, `result =` |
21:14:53 | * | agent0x00 quit (Quit: WeeChat 1.9.1) |
21:15:02 | FromDiscord | <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:10 | disruptek | i don't see an if expr. |
21:15:34 | disruptek | oh, it's on gitter. |
21:16:06 | disruptek | not a fan. i would rather `result =\n\t...`. |
21:16:21 | FromGitter | <ynfle> I just think that looks much more ugly |
21:16:38 | disruptek | maybe, but it's harder to modify the other version. |
21:16:55 | disruptek | here and there, sure, maybe it's /never/ going to change control flow. |
21:17:13 | disruptek | but part of what i love about `result` is that i can install stuff temporarily without changing control flow. |
21:17:27 | disruptek | if it becomes permanent, it's fine. |
21:18:04 | disruptek | i want clean diffs and result, named block, dominating if/else... all give me that. |
21:18:56 | disruptek | that 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:31 | disruptek | i think my current style is pretty damned legible, but everyone can improve. i mean, all the rest of you. |
21:21:14 | disruptek | i'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:34 | FromDiscord | <Rika> lol |
21:26:03 | FromDiscord | <Clyybber> if expression clearly is superiour :P |
21:27:39 | FromGitter | <ynfle> I agree @Clybber but I understand that it isn't evident that it's an expression immediately |
21:27:59 | disruptek | exactly. |
21:28:30 | FromDiscord | <haxscramper> For this one I thing case + raiseAssert in the else branch would be the most 'evident' |
21:29:08 | disruptek | then it won't compile. |
21:29:23 | * | lritter quit (Ping timeout: 265 seconds) |
21:29:27 | FromGitter | <ynfle> It was a toy example, I'm referring to any case where an if expression would make sense |
21:29:57 | disruptek | any case where i can case, i will case. just in case. |
21:30:08 | disruptek | but yeah, annoyingly, you cannot raise in a case expr. |
21:30:54 | FromDiscord | <haxscramper> > then it won't compile.β΅@disruptek https://play.nim-lang.org/#ix=2vJs |
21:31:33 | disruptek | hmmm. |
21:31:42 | disruptek | i stand corrected. |
21:32:50 | disruptek | weird. |
21:33:00 | disruptek | maybe that was fixed recently. |
21:33:31 | FromDiscord | <Clyybber> not really :p |
21:33:51 | disruptek | you can't do it with try: still, right? |
21:34:25 | * | bung quit (Ping timeout: 240 seconds) |
21:34:28 | FromDiscord | <Clyybber> of course not |
21:34:40 | FromDiscord | <haxscramper> It works since `v0.20.0` |
21:34:49 | FromDiscord | <Clyybber> or maybe I odn't understand what you mean concretely |
21:35:40 | * | bung joined #nim |
21:36:07 | disruptek | sometimes 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:31 | FromDiscord | <Clyybber> where the ... contains a raise? |
21:36:55 | disruptek | it certainly could. it's a try block. |
21:36:58 | FromDiscord | <Clyybber> if thats the case, yeah. Its good that its prevented |
21:37:02 | * | krux02 joined #nim |
21:37:08 | FromDiscord | <haxscramper> https://play.nim-lang.org/#ix=2vJv |
21:37:50 | disruptek | you know you can `case x: of y: elif z: else: q` |
21:38:03 | disruptek | just to break people's macros. |
21:38:26 | FromDiscord | <Clyybber> peoples macros be shite |
21:38:27 | FromDiscord | <Clyybber> :p |
21:38:33 | FromDiscord | <Clyybber> if they break because of that |
21:38:38 | disruptek | dude, don't you have a compiler bug to fix? |
21:38:45 | FromDiscord | <Clyybber> :p |
21:38:57 | FromDiscord | <Clyybber> I'm thinking about making a game |
21:39:09 | FromDiscord | <Clyybber> and fixing up my terminal lib |
21:39:18 | FromDiscord | <Clyybber> something chill |
21:39:27 | disruptek | i have an idea for a game. |
21:39:33 | FromDiscord | <Clyybber> but which bug u want fixed? |
21:40:05 | * | bung quit (Ping timeout: 240 seconds) |
21:40:21 | disruptek | your 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:51 | disruptek | mostly it's team-building. |
21:41:01 | FromDiscord | <haxscramper> > you know you can `case x: of y: elif z: else: q` |
21:41:04 | FromDiscord | <Clyybber> https://github.com/HackerPoet/MarbleMarcher in multiplayer |
21:41:21 | FromDiscord | <haxscramper> You mean I can put case on a single line or that I can have elif/else? |
21:41:35 | disruptek | you can have elif in a case. |
21:41:35 | FromDiscord | <Clyybber> elif else he is scared of |
21:42:04 | * | superbia quit (Quit: WeeChat 2.9) |
21:42:05 | FromDiscord | <haxscramper> But not on a single line? Because `if: else:` can do this, so I assumed `case` can too |
21:42:13 | disruptek | case can, too. |
21:42:22 | disruptek | and speaking of toucans... |
21:42:54 | FromDiscord | <haxscramper> Can you show an example please? |
21:42:58 | FromDiscord | <haxscramper> !eval echo (case 2: of 2: 2 elif false: 3 else: 24) |
21:42:59 | NimBot | Compile failed: /usercode/in.nim(1, 17) Error: expected: ')', but got: 'keyword of' |
21:43:27 | FromDiscord | <haxscramper> It works If I put it on multiple lines but not on a single line |
21:43:39 | disruptek | sorry. |
21:44:26 | shashlick | !eval echo (case 2 of 2: 2 elif false: 3 else: 24) |
21:44:27 | NimBot | Compile failed: /usercode/in.nim(1, 21) Error: expected: ')', but got: '2' |
21:44:42 | disruptek | you're missing a : |
21:45:34 | shashlick | !eval var i = 3; echo (case i of 3: 2 else: 24) |
21:45:35 | NimBot | Compile failed: /usercode/in.nim(1, 32) Error: expected: ')', but got: '2' |
21:45:49 | * | solitudesf quit (Ping timeout: 265 seconds) |
21:45:49 | shashlick | There's no : after case i |
21:47:27 | disruptek | i'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:08 | jacereda | I'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:06 | disruptek | jacereda: any example apps? |
21:59:01 | disruptek | oh, you have nim examples but no c examples. π |
22:00:57 | jacereda | there'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:07 | jacereda | right 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:52 | jacereda | this is my first nim project in a long time, so if I'm doing anything stupid please let me know |
22:07:45 | disruptek | well, you don't need trailing ; |
22:08:02 | disruptek | other than that, the compiler's feedback is probably more valuable. |
22:08:04 | * | bung quit (Ping timeout: 256 seconds) |
22:10:06 | disruptek | dom96: i'm working on more single-letter variables for ya. |
22:10:16 | jacereda | oh, right, fixed, thanks |
22:11:54 | FromGitter | <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:20 | FromGitter | <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:38 | disruptek | from math import nil |
22:12:42 | FromDiscord | <lqdev> `from math import nil` |
22:12:45 | * | bung joined #nim |
22:12:49 | FromDiscord | <lqdev> don't know why you'd want that but ok |
22:13:03 | disruptek | some people just /love/ nasty errors. |
22:13:17 | FromDiscord | <lqdev> some people just _hate_ convenience. |
22:13:18 | FromGitter | <ondra05> I want to organise my code, factorial was only an example |
22:13:36 | FromDiscord | <lqdev> good luck using UFCS with `from x import nil` |
22:13:58 | disruptek | they don't care about that; they are /python/ programmers. |
22:14:46 | FromDiscord | <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:53 | FromDiscord | <lqdev> but that pretty much never happens |
22:15:05 | FromDiscord | <lqdev> thanks to Overloadingβ’ |
22:16:25 | FromDiscord | <tomck> Can i forward declare a proc from another module? |
22:16:41 | disruptek | that's what an import is. |
22:16:43 | FromDiscord | <tomck> (i have circular modules, basically) |
22:16:50 | disruptek | you what? |
22:16:51 | FromDiscord | <tomck> ^ |
22:16:57 | FromDiscord | <tomck> i have two modules |
22:17:03 | FromDiscord | <tomck> which define == implementations |
22:17:05 | FromDiscord | <tomck> that're circular |
22:17:13 | disruptek | how's that workin' out for ya? |
22:17:29 | FromDiscord | <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:47 | disruptek | i dunno why so many people have trouble with this. |
22:18:00 | FromDiscord | <tomck> because circular types are common |
22:18:09 | disruptek | maybe my code is too trivial. |
22:18:28 | FromDiscord | <tomck> I'm writing a compiler, where I have a medium level IR |
22:18:55 | FromDiscord | <tomck> the IR is annotated with a type, and the type contains some IR (for default struct field values) |
22:19:29 | disruptek | i put shared information in a file that is shared by other files. |
22:19:38 | FromDiscord | <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:51 | FromDiscord | <tomck> (which happens to actually be a circular reference, not just in the types) |
22:20:05 | FromDiscord | <tomck> but that means i need a file for my AST, IR, and typesystem definitions |
22:20:11 | FromDiscord | <tomck> which is going to be insanely huge |
22:20:37 | disruptek | so make it a single file that includes 3 files. then import that single file wherever. |
22:21:12 | disruptek | it's pretty rare that filesize is an impediment to software development. |
22:21:16 | FromDiscord | <tomck> *sigh* it's still kinda.. yuck |
22:22:02 | disruptek | circular imports aren't a thing yet. |
22:22:05 | FromDiscord | <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:07 | disruptek | how big is your compiler? |
22:22:53 | FromDiscord | <tomck> super trivial at the moment, can't be more than 3k lines |
22:22:58 | FromDiscord | <tomck> & it's already a pain |
22:23:28 | disruptek | nim suffers from the lack of circular imports, but it's 60k. |
22:23:30 | FromDiscord | <tomck> i'll try the 'include' thing |
22:23:42 | disruptek | nimph is 7-8k and it's a total non-issue. |
22:24:01 | FromDiscord | <tomck> i'm not sure loc is a good measure of circular imports becoming an issue |
22:24:14 | disruptek | you just tried to tell me it was hard to develop large files. |
22:24:20 | disruptek | are you saying you measure file size by width? |
22:24:26 | disruptek | girth, as it were? |
22:24:36 | FromDiscord | <tomck> what, nimph has a 7k line file? that *would* be a pain |
22:24:46 | FromDiscord | <tomck> but just 7k loc codebase is fine |
22:24:49 | disruptek | no, i use multiple files. |
22:25:03 | FromDiscord | <tomck> yeah it's when you have loads of stuff in one file |
22:25:10 | FromDiscord | <tomck> regardless i'll try the include thing, i think that might work |
22:25:41 | disruptek | it will work fine. it's just annoying for tooling. |
22:26:08 | FromDiscord | <tomck> for tooling? |
22:26:17 | disruptek | nimsuggest struggles with includes. |
22:26:24 | FromDiscord | <tomck> ahhhhhhhhh shame, how come? |
22:26:36 | disruptek | ~features |
22:26:38 | disbot | features: 11begin in the unfortunate state of /unimplemented/ -- disruptek |
22:27:53 | disruptek | what does your compiler compile? |
22:31:43 | leorize[m] | nimsuggest just can't handle forward declared stuff, not includes |
22:36:48 | gmaggior | FromDiscord, thanks for the answer on 'with' |
22:36:57 | gmaggior | disruptek, thanks for the answer on 'with' |
22:37:43 | FromDiscord | <tomck> ahhh fair enough |
22:37:52 | FromDiscord | <Clyybber> leorize: Wdym can't handle forward decls? |
22:38:01 | FromDiscord | <Clyybber> Is there an issue somwhere for that? |
22:38:01 | disruptek | gmaggior: bp |
22:38:27 | FromDiscord | <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:53 | FromDiscord | <Clyybber> sounds interesting |
22:39:01 | leorize[m] | Clyybber nimsuggest returns the location data of the first symbol found during AST construction |
22:39:08 | FromDiscord | <tomck> https://media.discordapp.net/attachments/371759389889003532/749760139963269170/Screenshot_from_2020-08-22_23-02-46.png |
22:39:27 | FromDiscord | <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:33 | leorize[m] | if it found the forwarded symbol it will return that immediately |
22:39:55 | leorize[m] | probably need to implement a defer function so that it would wait until the symbol actual location is resolved |
22:40:18 | FromDiscord | <Clyybber> so basically go to definition is broken? |
22:40:22 | * | Senketsu quit (Ping timeout: 256 seconds) |
22:40:29 | FromDiscord | <tomck> nim has goto definition? |
22:40:39 | FromDiscord | <Clyybber> nimsuggest, I assume |
22:41:01 | FromDiscord | <Clyybber> @tomck thats very cool! |
22:41:38 | leorize[m] | @Clyybber yea, that and outline |
22:41:59 | leorize[m] | basically anything that's location sensitive |
22:42:20 | FromDiscord | <tomck> Oh damn i didn't realise nim's tooling was so fleshed out, this is great |
22:42:28 | FromDiscord | <tomck> thanks! |
22:42:39 | leorize[m] | I think the reference tracking function got broken by that too |
22:43:53 | leorize[m] | @tomck yep, editor integration is sparse though, there aren't many working on it |
22:44:27 | leorize[m] | there's a language server implementation fwiw |
22:46:14 | leorize[m] | @Clyybber if you're interested in fixing that I can show you how to reproduce it |
22:46:39 | FromDiscord | <Clyybber> sure, tell me I'll write it down |
22:46:51 | FromDiscord | <Clyybber> or make an asciinema |
22:48:47 | FromDiscord | <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:41 | leorize[m] | @Clyybber https://asciinema.org/a/gZEaBzMv8InIfsQo159LtOMXX |
22:49:56 | FromDiscord | <Clyybber> thanks <3 |
22:50:09 | leorize[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) |