00:09:10 | * | stefanos82 quit (Remote host closed the connection) |
00:46:21 | rayman22201 | @ryukoposting: https://pastebin.com/raw/TgigYf6p |
00:46:55 | rayman22201 | That took way too long. Recursion isn't the problem here. You can't put macros in type definitions or proc argument lists |
00:46:55 | * | ghost64 quit (Quit: See you!) |
00:47:16 | ryukoposting | aaaaaah i see |
00:47:18 | rayman22201 | So the way you do it is by creating a whole new type |
00:47:47 | * | ghost64 joined #nim |
00:48:03 | rayman22201 | also, your recursive logic had a bug. I fixed it for you :-P |
00:48:04 | ryukoposting | interesting, that makes sense though |
00:48:09 | ryukoposting | oh nice lol |
00:48:27 | ryukoposting | yeah i know if h < l it would just crap the bed |
00:49:17 | rayman22201 | Well, the logic you had originally, would only produce `| array[h, int]`. It only ever printed the `array` in the base case. |
00:49:47 | ryukoposting | oh shoot |
00:50:06 | rayman22201 | technically it would produce `|||| array[h, int]` lol . One pipe for every recursion :-P |
00:50:15 | rayman22201 | but no arrays to go with the type |
00:50:51 | rayman22201 | anyway. I think you should stick with the concept instead of the macro |
00:51:13 | rayman22201 | easier to understand what is going on that way |
00:51:17 | ryukoposting | oh definitely yeah, i was just curious to see if it was possible |
00:52:15 | rayman22201 | anything is possible with macros if you try hard enough 🌈 lol |
00:52:29 | ryukoposting | that's the impression I've gotten |
00:52:57 | ryukoposting | it might be hideous but it's pretty intuitive and very powerful |
00:53:37 | rayman22201 | Yup. that's why they are the "advanced feature" for use only when absolutely necessary :-P |
00:53:51 | rayman22201 | use with extreme care, blah blah blah |
00:54:06 | rayman22201 | They are also really fun and addicting |
01:14:52 | * | absolutejam quit (Ping timeout: 244 seconds) |
01:20:07 | * | redlegion quit (Ping timeout: 240 seconds) |
01:21:26 | * | redlegion joined #nim |
01:21:26 | * | redlegion quit (Changing host) |
01:21:26 | * | redlegion joined #nim |
01:26:50 | TheKing[m] | I'm again dealing with macros myself in c and the temptation to check at last nim grows stronger. |
01:39:12 | ryukoposting | well, nim more or less has C macros with dirty templates, but nim macros are a whole lot more powerful |
01:40:18 | * | zachk quit (Quit: Leaving) |
01:40:45 | * | ikan-keli_ quit (Quit: ZNC 1.8.x-git-125-e415d9f5 - https://znc.in) |
01:42:41 | FromDiscord_ | <exelotl> it's a heck of a lot more pleasant though, given that templates have type checking and it's impossible to generate a syntax error |
01:44:04 | FromDiscord_ | <exelotl> btw is it normal to set the root of the project as an import directory? I want to do `import utils` instead of `import ../../utils` |
01:44:58 | * | shashlick joined #nim |
01:46:08 | * | smitop quit (Quit: Connection closed for inactivity) |
01:46:27 | rayman22201 | yes it's normal. Other people have complained about this. I don't remember the details of the discussion, but `import ../../utils` is the way it is atm. |
01:53:18 | FromDiscord_ | <exelotl> ok cool, thanks |
01:53:27 | ryukoposting | does anyone know offhand if httpclient and asyncdispatch are supported by the js toolchain |
01:55:00 | rayman22201 | httpclient is a definite no. and I think asyncdispatch is also a no considering how it's implemented. |
01:55:09 | rayman22201 | You don't really need either since JS has those things built in |
01:55:31 | ryukoposting | aight cool, was just curious |
01:55:38 | rayman22201 | You can just use the jsffi module to interface with the built in httpclient from js |
01:56:02 | ryukoposting | library I'm writing needs both, i'll look into jsffi |
01:58:59 | rayman22201 | you use this instead of asyncdispatch for js: https://nim-lang.org/docs/asyncjs.html |
02:01:28 | ryukoposting | aight, cool |
02:01:33 | * | ikan-keli_ joined #nim |
02:01:53 | ryukoposting | I want my libraries to support native and js, so I'll look into it |
02:03:34 | * | ng0_ joined #nim |
02:04:47 | rayman22201 | Shouldn't be a big problem, but there are a few differences, so you are going to have to detect which backend you are using `when defined(js):` |
02:06:29 | * | ng0 quit (Ping timeout: 256 seconds) |
02:08:32 | ryukoposting | nice |
02:09:19 | * | ng0_ quit (Ping timeout: 256 seconds) |
02:11:30 | * | ng0_ joined #nim |
02:19:09 | ryukoposting | aaaaay i'm the 1000th pull request to nimble packages |
02:21:11 | * | ng0_ quit (Quit: Alexa, when is the end of world?) |
03:00:02 | * | flaviu quit (Remote host closed the connection) |
03:02:23 | * | banc quit (Quit: Bye) |
03:02:24 | * | flaviu joined #nim |
03:06:22 | * | craigger quit (Quit: bye) |
03:09:24 | * | craigger joined #nim |
03:13:27 | * | dddddd quit (Remote host closed the connection) |
03:16:12 | * | Marumoto quit (Ping timeout: 246 seconds) |
03:23:56 | * | banc joined #nim |
03:24:33 | * | darithorn joined #nim |
03:48:02 | * | darithorn quit (Quit: Leaving) |
04:07:56 | * | nsf joined #nim |
04:12:57 | shashlick | what do you tell this guy - https://stackoverflow.com/questions/53512264/how-to-play-a-wav-file-in-nim/54350188?noredirect=1#comment95673339_54350188 |
04:17:09 | FromGitter | <timotheecour> my take on this: let’s be nice to this guy and go out of the way to help, i’ve seen lots of cases where not-so-great first contact turns into future good contributors |
04:19:08 | FromGitter | <timotheecour> @shashlick maybe we can try to wrap this in an examples folder (not part of test suite perhaps, at leasts not part of CI) which runs this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c52773c8aa5ca5abf5cc1ac] |
04:23:22 | leorize | shashlick: just tell them to use sdl |
04:23:42 | leorize | you can initialize only the audio part of sdl iirc |
04:23:45 | FromGitter | <timotheecour> he mentioned this: ⏎ ⏎ > I have had some small success with the sdl2 library, but it feels like overkill loading a full game library for this tiny use case. |
04:23:57 | leorize | sdl2 is not even a game library :P |
04:24:12 | leorize | it's just the usecase people widely associated it with |
04:32:00 | rayman22201 | I was thinking about compile time verifiable seqs... I really want linear types in Nim now :-P. Also, I would love a way to reference the components of a generic from concept. I would love to able to do this: https://pastebin.com/raw/8R5mhXtc |
04:33:22 | rayman22201 | seems like you should be able to do that, but there is no way to get at the `[L, T]` parts of the generic. |
04:33:31 | rayman22201 | unless I'm missing something |
04:35:52 | * | Marumoto joined #nim |
04:36:54 | leorize | rayman22201: don't use [L, T] |
04:37:01 | leorize | just input [M, T] there? |
04:37:13 | leorize | oh wait :P |
04:41:58 | rayman22201 | M != L ;) |
04:42:25 | rayman22201 | It's a dependent type |
05:00:47 | * | Marumoto quit (Ping timeout: 240 seconds) |
05:03:37 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
05:45:29 | * | Marumoto joined #nim |
05:55:22 | * | Marumoto quit (Remote host closed the connection) |
06:15:54 | * | narimiran joined #nim |
06:47:56 | * | vlad1777d quit (Ping timeout: 240 seconds) |
07:29:12 | * | krux02 joined #nim |
07:59:47 | FromGitter | <bung87> ```code paste, see link``` ⏎ ⏎ can make it be more simple usage? [https://gitter.im/nim-lang/Nim?at=5c52aaf3454aad4df7cedbfc] |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:04:38 | narimiran | @kaushalmodi, shashlick: you are our nightlies guys, right? i'm looking at the latest builds and there are no "...-linux.tar.xz" and "...-osx.tar.xz". is this on purpose? |
08:04:50 | * | gmpreussner joined #nim |
08:26:38 | * | absolutejam joined #nim |
08:55:11 | * | enow joined #nim |
09:01:24 | * | abm joined #nim |
09:08:24 | FromGitter | <bung87> ```mixins(F,consumerMixin,logOwnerMixin) ⏎ ⏎ type FileDescriptor = ref object of F``` ⏎ ⏎ now I have [https://gitter.im/nim-lang/Nim?at=5c52bb089221b9382deee558] |
09:25:33 | * | Vladar joined #nim |
09:31:25 | * | floppydh joined #nim |
09:43:11 | * | endragor joined #nim |
09:47:17 | * | PMunch joined #nim |
10:04:26 | PMunch | It's with heavy heart that I am now made to leave Status again. It was a short run, but I learned a lot. So if anyone is looking for a Nim programmer you know where to find me :P |
10:04:54 | * | endragor quit (Remote host closed the connection) |
10:05:03 | * | endragor joined #nim |
10:08:33 | * | endragor quit (Remote host closed the connection) |
10:09:38 | * | endragor joined #nim |
10:11:34 | Araq | PMunch, take care! :-/ |
10:15:04 | * | narimiran quit (Quit: Leaving) |
10:20:50 | absolutejam | sorry to hear it PMunch |
10:21:15 | * | narimiran joined #nim |
10:22:04 | FromGitter | <alehander42> good luck! |
10:39:00 | FromGitter | <mratsim> nimsuggest on Windows will sometimes lock a file and prevent git pulls :/ |
10:41:15 | Araq | really? never happened to me |
10:43:16 | * | dom96_w joined #nim |
11:00:01 | PMunch | Thanks everyone, I'm sure I'll figure something out :) |
11:02:36 | * | JustASlacker joined #nim |
11:03:51 | livcd | oh noes what happened |
11:08:00 | PMunch | Not going to go into detail here, but essentially they didn't want to continue my contract past the trial period. Been a rough year for me thus far, let's hope it gets better :) |
11:09:11 | Zevv | PMunch: where are you located? |
11:09:24 | Zevv | UK, right? |
11:09:49 | PMunch | Norway |
11:10:57 | PMunch | Why do you ask? |
11:12:42 | * | dddddd joined #nim |
11:26:00 | Zevv | I can keep an eye open for what it's worth |
11:26:38 | PMunch | Thanks |
11:31:38 | Zevv | Got a C++ job in the netherlands for you :/ |
11:32:43 | PMunch | Haha, for who? I have some leads for some jobs here in Tromsø as well |
11:34:36 | Zevv | http://www.activevideo.com/ |
11:44:20 | * | ng0 joined #nim |
11:44:24 | * | enow quit (Read error: No route to host) |
12:11:27 | * | skellock joined #nim |
12:12:58 | * | hoijui joined #nim |
12:21:44 | FromGitter | <bung87> ```code paste, see link``` ⏎ ⏎ found it can’t pass compile time ,I got `Error: internal error: genTypeInfo(tyNone)`nimsuggest has no hints [https://gitter.im/nim-lang/Nim?at=5c52e85893fe7d5ac01def62] |
12:45:41 | FromDiscord_ | <Obstinate> Friends, I have a small program that results in a segfault, and I do not understand why. Full code and instructions to repro in this gist: https://gist.github.com/jaguilar/36892bb9b3533b055bba8e8cf746efb5 |
12:47:58 | PMunch | Not sure why it segfaults, but I can guarantee you that that doesn't do what you want it to |
12:48:01 | PMunch | http://ix.io/1zD5/Nim |
12:48:06 | PMunch | Something as simple as that will work |
12:49:05 | FromDiscord_ | <Obstinate> This is cut down from a larger program |
12:49:11 | * | seni joined #nim |
12:49:35 | FromDiscord_ | <Obstinate> 😃 |
12:49:36 | FromDiscord_ | <Obstinate> so I already know it doesn't do what i want -- since i deleted all the unrelated code |
12:49:57 | FromDiscord_ | <Obstinate> Originally, newMatrix was returning the Matrix and doing some initialization of the other fields of Matrix |
12:50:15 | FromDiscord_ | <Obstinate> however, if just creating the matrix segfaults it's rather pointless to try to do the rest, isn't it? |
12:54:41 | * | nsf quit (Quit: WeeChat 2.3) |
12:56:17 | PMunch | Hmm, I think you might actually just be blowing your stack there. You're trying to allocate 256*256*256 integers or 67Mb as a stack-variable |
13:00:03 | PMunch | Changing Matrix to a `ref object` like so: http://ix.io/1zD7/Nim means it gets allocated on the heap and your snippet works fine |
13:00:21 | PMunch | (Added in some extra stuff as well to make sure it worked) |
13:00:33 | * | stefanos82 joined #nim |
13:00:40 | PMunch | Obstinate ^ |
13:00:59 | PMunch | What are you using 67Mb of ints for anyways? :P |
13:01:04 | FromDiscord_ | <Obstinate> ahhhhhhhhh |
13:01:37 | FromDiscord_ | <Obstinate> I previously had it as an enum, but even with that it would probably be the same result. |
13:01:54 | PMunch | Yeah, enums are stored as ints IIRC |
13:01:59 | PMunch | So that would be the same result |
13:02:00 | FromDiscord_ | <Obstinate> It's been a long time since i worked with an array so large so i had forgotten that stack smashing looks the same as a real segfault |
13:02:13 | FromDiscord_ | <Obstinate> it's just gonna be a toy program |
13:02:43 | FromDiscord_ | <Obstinate> that does fix it |
13:02:46 | FromDiscord_ | <Obstinate> thank you pmunch |
13:02:46 | PMunch | But yeah, allocate it on the heap and you should be fine |
13:02:50 | PMunch | No problem |
13:09:27 | * | tweenietomatoes joined #nim |
13:09:50 | tweenietomatoes | anyone employed here? |
13:10:19 | PMunch | tweenietomatoes, employed with Nim? |
13:10:28 | PMunch | Or in general |
13:16:35 | skellock | i'm employed... my wife says this is one of my best features. |
13:29:06 | tweenietomatoes | no i mean working at or on somewhere/something |
13:29:35 | tweenietomatoes | nim is programming something of depressed and unemployed people |
13:30:31 | tweenietomatoes | i hope everyone likes popcorn |
13:36:10 | skellock | are you asking "who is using nim in ""production""?" (nested airquotes are intentional) |
13:40:28 | tweenietomatoes | writing all routers in frontend jscript and serving backend on single page nim is sö good |
13:44:56 | * | Snircle joined #nim |
13:49:24 | * | tweenietomatoes quit (Quit: Page closed) |
13:58:47 | FromGitter | <mratsim> you can write the frontend in Nim as well, though I’m not too sure about the maturity. |
13:58:55 | FromGitter | <mratsim> Maybe @gogolxdong can comment on that |
13:59:22 | FromGitter | <mratsim> I’ve been working in Nim full-time for a year (will be a year tomorrow) |
13:59:26 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:00:13 | Zevv | \o/ |
14:02:06 | skellock | mratsim: amazing! |
14:02:49 | FromGitter | <alehander42> I am also using Nim on the frontend |
14:03:33 | * | endragor quit (Remote host closed the connection) |
14:04:06 | FromGitter | <alehander42> It's quite an ok fit albeit i need to finish two |
14:04:44 | FromGitter | <alehander42> things that've been the remaining imperfect points in js interop for me |
14:04:47 | skellock | alehander42: is your setup a single page app? |
14:04:55 | FromGitter | <alehander42> kinda |
14:05:02 | FromGitter | <alehander42> An electron app |
14:05:27 | FromGitter | <alehander42> the frontend is a spa indeed |
14:06:02 | FromGitter | <deech> What is the difference between using the `mixin` keyword to get late binding inside a function and call-forwarding a function? |
14:07:13 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
14:07:54 | * | Snircle joined #nim |
14:08:03 | * | endragor joined #nim |
14:09:28 | Araq | what's "call-forwarding" a function? |
14:10:28 | * | absolutejam quit (Ping timeout: 245 seconds) |
14:11:17 | skellock | deech: unrelated -- loved your Lamda World talk on pharo tooling capabilities -- a couple of "o wow" moments in there. |
14:12:27 | * | endragor quit (Ping timeout: 240 seconds) |
14:14:01 | FromGitter | <deech> @Araq: Where you have `proc foo(..):..` at the top so you can use it in a function even though it's implemented below it. |
14:14:07 | FromGitter | <deech> @skellock: Thanks! |
14:14:37 | narimiran | @deech forward-declaration ;) |
14:15:12 | FromGitter | <deech> jfc, I said call-forwarding didn't I. |
14:15:27 | Araq | deech: totally different, 'mixin' deals with the symbol binding within generics |
14:15:46 | Araq | it enforces an "open symbol overload set" |
14:16:36 | FromGitter | <deech> @Araq Yes but if I symbol bind a function instead of forward declaring doesn't it use whatever's in scope at the point of the call? |
14:19:33 | FromGitter | <gogolxdong> For web frontend, Nim forum is an example. |
14:19:41 | FromGitter | <deech> @Araq: I see now. Thanks! |
14:21:46 | FromGitter | <gogolxdong> We just borrowed its routing implementation to our production. |
14:22:55 | Araq | fun fact: if I patch the reference counting to use atomicInc in gc.nim, bootstrapping slows down by 0.4s |
14:23:35 | Araq | from 4.4s it goes up to 4.8s |
14:28:50 | FromGitter | <arnetheduck> fun fact: that's because you're using fully sequential constraints, whereas relaxed on inc and acquire/release on dec would be enough, leading to no overhead on x86 for a fully thread-safe version |
14:30:01 | * | aguspiza joined #nim |
14:32:20 | * | dom96_w joined #nim |
14:33:26 | * | endragor joined #nim |
14:37:46 | * | endragor quit (Ping timeout: 246 seconds) |
14:39:49 | * | DominikPichetasS joined #nim |
14:40:07 | Araq | atomic_add_fetch(memLoc.addr, x, ATOMIC_RELAXED) |
14:40:10 | Araq | I don't think so |
14:41:27 | DominikPichetasS | araq you should start to sell products with your name on it |
14:41:31 | DominikPichetasS | to make profit |
14:42:33 | DominikPichetasS | think about go's gopher |
14:46:54 | FromGitter | <mratsim> DominikPichetasS are you the real one? |
14:47:02 | Araq | I doubt it |
14:47:12 | DominikPichetasS | no |
14:47:16 | DominikPichetasS | im dominik's snake pet.. |
14:47:58 | Zevv | Quick, ask him a trick question that only the real dom96 would know |
14:48:03 | DominikPichetasS | someone please write a proper orm |
14:48:26 | DominikPichetasS | nim is so complex |
14:48:53 | FromGitter | <mratsim> With great power comes great responsibility |
14:49:47 | narimiran | in good old days even trolls were more clever |
14:50:18 | DominikPichetasS | i will start reading tutorials |
14:52:27 | * | PMunch quit (Remote host closed the connection) |
15:00:03 | * | DominikPichetasS quit (Quit: Page closed) |
15:02:39 | * | absolutejam joined #nim |
15:04:56 | * | tweenietomatoes joined #nim |
15:13:59 | dom96_w | lol wat |
15:14:12 | dom96_w | Guess I'm famous now? |
15:14:28 | * | solitudesf quit (Quit: ZNC - https://znc.in) |
15:14:44 | tweenietomatoes | another dom? |
15:14:49 | Zevv | you should start to sell products with your name on it |
15:14:55 | Zevv | to make profit |
15:15:32 | tweenietomatoes | no my aim was to make it like go's gopher |
15:15:41 | tweenietomatoes | nim one is crown |
15:15:58 | tweenietomatoes | you cant make toys of it |
15:16:07 | * | solitudesf joined #nim |
15:17:42 | tweenietomatoes | is http async based on httpbeast? |
15:17:55 | tweenietomatoes | any advantage over using tcp? |
15:22:48 | Araq | yes, it uses FDDI and is web scale |
15:23:41 | FromGitter | <mratsim> FDDI? |
15:25:07 | * | Vladar quit (Remote host closed the connection) |
15:25:09 | Araq | https://en.wikipedia.org/wiki/Fiber_Distributed_Data_Interface |
15:26:01 | tweenietomatoes | nim is one of the best performing at techempower benchmark |
15:26:37 | * | Vladar joined #nim |
15:30:47 | tweenietomatoes | who documented this language, probably one of the best documentation ever |
15:31:03 | * | Vladar quit (Remote host closed the connection) |
15:31:26 | * | Vladar joined #nim |
15:32:38 | * | narimiran_ joined #nim |
15:32:49 | * | narimiran_ quit (Remote host closed the connection) |
15:33:21 | narimiran | dom96_w, Araq: can you get your ban-hammer out again, please? |
15:33:26 | dom96_w | We've got great documentation, the best. |
15:34:54 | narimiran | ...now we just wait for trolls to get better too :'( |
15:35:33 | tweenietomatoes | nari he is another not me |
15:35:39 | dom96_w | meh, not that bad of a troll |
15:35:40 | tweenietomatoes | i was first but i was not troll |
15:35:44 | dom96_w | IMO doesn't deserve a ban... yet |
15:35:56 | Zevv | there's always /ignore |
15:37:25 | narimiran | dom96_w: eh, if that isn't the perfect example of our age difference in practice.... (or maybe it is just that i'm old and grumpy) |
15:37:42 | Araq | yeah yeah yeah, "not yet". IME it never gets better. |
15:38:03 | dom96_w | I'm often entertained :P |
15:41:25 | * | tweenietomatoes quit (Quit: Page closed) |
15:50:32 | Calinou | I used to be quite trollish sometimes |
15:50:35 | Calinou | so I probably got better :P |
15:53:35 | * | nsf joined #nim |
15:53:56 | narimiran | Calinou: yeah, it gets better with practice :) |
15:55:13 | * | Ven`` joined #nim |
15:55:41 | FromGitter | <bung87> what’s plan for supporting multiple inheritance, interfaces ? |
15:56:02 | * | hovis joined #nim |
16:04:46 | * | kungtotte quit (Ping timeout: 250 seconds) |
16:07:19 | Araq | single inheritance plus composition works just fine for me |
16:07:34 | FromGitter | <alehander42> there were some nim talks in the past, is there something like a youtube collection of them etc |
16:07:56 | Araq | dom96_w, can we move dom.nim to a Nimble package? karax cannot depend on the stdlib's dom because it's missing e.g. 'Blob' |
16:08:20 | dom96_w | why can't you add 'Blob' into stdlib's dom? |
16:08:30 | FromGitter | <bung87> is there a project show the way does in nim ? |
16:09:34 | Araq | dom96_w, I can but then karax depends on Nim devel |
16:12:15 | Araq | bung87: objects have fields that are other objects |
16:12:31 | * | rect0x51 joined #nim |
16:13:08 | FromGitter | <alehander42> does the DOM api changes often? if it's stable enough, probably it's still more useful in the stdlib |
16:13:33 | FromGitter | <alehander42> (but the way karax needs its own dom module is annoying indeed) |
16:13:54 | FromGitter | <bung87> ```code paste, see link``` ⏎ ⏎ this is the class I want porting to nim [https://gitter.im/nim-lang/Nim?at=5c531ec19221b9382df1b535] |
16:15:13 | FromGitter | <bung87> I using generic type for various type of same field. |
16:15:24 | Araq | don't port classes, port the code, the algorithms it uses, if any |
16:16:02 | FromGitter | <bung87> and try wrap a mixin in a macro ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c531f4241775971a0b4cf12] |
16:16:59 | FromGitter | <bung87> if there’s the way do type A = ref object of B,C,D would be more simple |
16:17:07 | Araq | usually code like this doesn't even do anything and can be thrown away :-) |
16:18:34 | FromGitter | <bung87> so maybe I have to try put all the type definitions into one type |
16:19:39 | FromGitter | <alehander42> you can have consumer and logOwner fields and perform their actions/methods on them + the main object |
16:22:34 | FromGitter | <bung87> or can I collect type’s fields and methods and modify the ast make a new type ? |
16:22:44 | * | tribly quit (Quit: WeeChat 2.3) |
16:24:52 | FromGitter | <bung87> or maybe analyse one file’s code generate a new nim file... |
16:25:04 | FromGitter | <alehander42> the point is that it might be easier to you to just try to model things a bit differently: using e.g. composition than to reinvent / code generate a whole new construct |
16:25:25 | * | tribly joined #nim |
16:25:26 | FromGitter | <alehander42> not trying to discourage you, it's an interesting problem, but it's good to try both |
16:26:10 | * | darithorn joined #nim |
16:27:54 | * | absolutejam quit (Quit: WeeChat 1.9.1) |
16:27:56 | FromGitter | <bung87> I actually not know the meanning of Composition in programming |
16:28:36 | * | JustASlacker quit (Quit: Leaving) |
16:28:54 | FromGitter | <bung87> the docs shows the codes ,looks like a one path inheritance. A->B->C |
16:31:17 | FromGitter | <bung87> I feel so fine during programing in Nim until I want porting a more complex python lib. |
16:31:43 | FromGitter | <arnetheduck> @Araq Oh, that's odd, given that they're supposed to compile to the same instruction generally (x86 already has some synchronization guarantees)... would be curious to see the ASM difference between the two |
16:32:55 | * | ng0 quit (Ping timeout: 256 seconds) |
16:33:06 | FromGitter | <alehander42> @bung87 there are a lot of articles about inheritance vs composition |
16:33:11 | FromGitter | <alehander42> they're mostly language agnostic |
16:33:43 | FromGitter | <alehander42> it results in a bit more explicitness but that's not bad |
16:34:13 | FromGitter | <bung87> @alehander42 thanks , using “ inheritance vs composition” I found that articles |
16:35:18 | * | ng0 joined #nim |
16:38:18 | * | skellock quit (Ping timeout: 252 seconds) |
16:39:16 | FromGitter | <bung87> ah ,so it’s about theory, not a language’s features |
16:41:25 | FromGitter | <alehander42> well, it's an approach one can usually use with most languages |
16:44:11 | * | floppydh quit (Quit: WeeChat 2.3) |
16:51:05 | Araq | arnetheduck: well I should also check clang I guess, but on x86 there is the LOCK prefix and that's generally used for atomic inc |
16:51:49 | Araq | and it's expensive, the problem is you don't get atomic ops without it and x86 cannot make use of the fact we only need a "relaxed" barrier |
16:52:18 | Araq | that said, I'm on Haswell with hardware lock elision |
16:52:28 | Araq | so it's surprising to me too |
16:53:31 | Araq | on the other hand, lock elision doesn't refer to the LOCK prefix opcode, I guess. hmm |
16:57:48 | * | hovis quit (Quit: Page closed) |
17:06:06 | FromGitter | <bung87> ```code paste, see link``` ⏎ ⏎ looks better? [https://gitter.im/nim-lang/Nim?at=5c532afd54f21a71a1d812e4] |
17:07:10 | FromGitter | <bung87> with a mark in case I forgot where these come from.. |
17:10:54 | * | hoijui quit (Remote host closed the connection) |
17:13:14 | * | abm quit (Ping timeout: 250 seconds) |
17:15:13 | dom96_w | Araq: This is what git tags are for. Tag a version of karax. That way Nimble will install it by default |
17:15:21 | dom96_w | Karax |
17:15:31 | dom96_w | *Karax #head will only depend on Nim devel which is fine IMO |
17:15:52 | Araq | not for me, no. 0.19 is what Nimble packages should target |
17:16:28 | dom96_w | Fine, then put the changes in some branch and merge them once new Nim is released |
17:16:46 | Araq | there is a better way |
17:17:01 | dom96_w | Moving dom out of stdlib is overkill to workaround this barely-an-issue |
17:17:12 | Araq | a simple 'when defined(nimNewDom): import dom else import kdom' should do |
17:17:18 | dom96_w | yes |
17:17:43 | Araq | that said, it's interesting how much these modules have diverged :-/ |
17:17:44 | dom96_w | or... when NimVersion ....? |
17:18:00 | dom96_w | Anyway, you should really tag Karax |
17:18:03 | dom96_w | There is 0 releases |
17:18:25 | Araq | I don't like tag+Nimble version, do something about this please |
17:18:37 | Araq | give nimble a 'setversion' command or something |
17:18:39 | FromGitter | <kaushalmodi> Araq: ++1 |
17:18:52 | FromGitter | <kaushalmodi> I don't like hard-coding nimble package version in the .nimble |
17:19:11 | FromGitter | <kaushalmodi> It should look for the version in the .nimble only if normal means, like a git tag is absent |
17:20:16 | FromGitter | <kaushalmodi> (my +1 wasn't on the setversion command suggestion :)) |
17:24:06 | dom96_w | Yes yes, this has been in Nimble's issue tracker for years now |
17:25:25 | dom96_w | This doesn't bother me enough to implement it so I didn't do it, but it should be a fairly easy feature |
17:25:56 | dom96_w | But I have a feeling you guys are imagining something else |
17:26:24 | FromGitter | <kaushalmodi> My thinking is that setting just the git tag should be enough |
17:26:27 | dom96_w | Modifying .nimble file + running `nimble tag` would be enough for me |
17:26:35 | FromGitter | <kaushalmodi> the version shouldn't need to be typed in the .nimble file |
17:26:53 | dom96_w | .nimble is the source of truth, not the git repo |
17:27:13 | FromGitter | <kaushalmodi> my suggestion is to do the opposite |
17:27:30 | dom96_w | Someone can install your package via commit hash and then nimble has no way to know the version |
17:28:06 | FromGitter | <kaushalmodi> 1) if version in .nimble set, use that ⏎ 2) elif version in .nimble not set, use git tag ⏎ 3) else, throw error |
17:29:06 | FromGitter | <kaushalmodi> > Someone can install your package via commit hash ⏎ ⏎ who are such people? :P |
17:29:51 | FromGitter | <kaushalmodi> nimble can always get the latest tag, right? |
17:55:18 | * | zachk joined #nim |
17:56:34 | * | zachk quit (Changing host) |
17:56:34 | * | zachk joined #nim |
18:19:20 | * | smitop joined #nim |
18:27:51 | dom96_w | meh, it should be trivial to get nimble to modify the .nimble file with your desired version |
18:31:47 | shashlick | @kaushalmodi - looks like nightlies are broken |
18:33:00 | FromGitter | <kaushalmodi> hmm, something broke inbetween 01/25-01/27 for unix type systems |
18:33:03 | shashlick | linux releases are not getting posted even though build passed |
18:33:44 | FromGitter | <kaushalmodi> .. and I see fails on windows builds: https://travis-ci.org/nim-lang/nightlies/builds/486765069?utm_source=github_status&utm_medium=notification |
18:34:02 | shashlick | that was just the last build |
18:35:23 | shashlick | some runnable example had an assertion error |
18:35:41 | shashlick | but the linux stuff not posting is a new issue since 25th |
18:36:18 | FromGitter | <kaushalmodi> shashlick: is this related to that swapping os and env vars commit? |
18:36:44 | * | dom96_w quit (Quit: Textual IRC Client: www.textualapp.com) |
18:36:57 | shashlick | i don't see why since the build goes all the way thru |
18:37:04 | shashlick | but that commit was on the 25th |
18:37:32 | FromGitter | <kaushalmodi> yep, that's I think that could be the cause |
18:38:04 | shashlick | actually devel is working fine |
18:38:10 | FromGitter | <kaushalmodi> because on 01/25, build 151 posted https://github.com/nim-lang/nightlies/releases/tag/version-0-19-2019-01-25-d53e3db |
18:38:23 | FromGitter | <kaushalmodi> and no linux/osx builds after that date |
18:38:35 | shashlick | except the windows failure in last build |
18:38:45 | shashlick | v0.19.2 is the one broken |
18:38:49 | shashlick | devel is further down so hard to see |
18:38:52 | shashlick | again, sorting issue |
18:38:59 | shashlick | looks like date should be first, followed by branch |
18:39:01 | FromGitter | <kaushalmodi> sorry, the order is screwed |
18:39:03 | FromGitter | <kaushalmodi> yeah |
18:39:57 | shashlick | ok the reason basically is that our caching for 0.19.2 is broken |
18:40:11 | shashlick | it works correctly on Linux and OSX - since no changes were made to that branch recently |
18:40:20 | shashlick | but the windows build is running regardless and posting |
18:40:23 | shashlick | even though nothing changed |
18:40:38 | shashlick | see the hash, it is the same |
18:40:41 | FromGitter | <kaushalmodi> but still it applies that no builds for linux/osx get posted after 01/25 |
18:40:44 | FromGitter | <kaushalmodi> .. for 0.19.2 |
18:41:04 | shashlick | because nothing changed - that hash was already built so linux/osx correctly skip the build |
18:41:06 | narimiran | @kaushalmodi shashlick i tried to ping you this morning about that ;) |
18:41:33 | narimiran | https://irclogs.nim-lang.org/31-01-2019.html#08:04:38 |
18:41:51 | shashlick | yep, i just decided to do something about it 😄 |
18:42:20 | narimiran | yes, please do something about it, because we rely on you for 0.19.4 release :) |
18:42:40 | narimiran | spoiler alert: it is already merged to master and tagged |
18:43:14 | FromGitter | <kaushalmodi> version-0-19 also happens to have few commits on 01/25 |
18:43:32 | FromGitter | <kaushalmodi> so that's the critical date; simulataneous changes on nightly and nim repos :P |
18:44:18 | shashlick | okay so we need two fixes - one is to make date first in name, and then fix the windows caching issue |
18:44:33 | FromGitter | <kaushalmodi> but .. (things are unrolling) |
18:44:44 | FromGitter | <kaushalmodi> https://github.com/nim-lang/nightlies/releases/tag/version-0-19-2019-01-25-d53e3db is built using the last commit on 01/25 |
18:44:59 | FromGitter | <kaushalmodi> and then no changes happened on version-0-19 until 01/31 |
18:45:13 | FromGitter | <kaushalmodi> so do you want to revert the last commit to nightlies, just to see? |
18:45:16 | shashlick | yes that's why linux and osx builds exit immediately |
18:45:27 | shashlick | windows caching is incorrect |
18:46:53 | shashlick | https://github.com/nim-lang/nightlies/blob/master/.travis.yml#L89 |
18:47:51 | FromGitter | <kaushalmodi> I'm trying the reverted commit in my fork build |
18:47:57 | FromGitter | <kaushalmodi> what about that line 89? |
18:48:28 | shashlick | that is what decides whether to do a build or not |
18:48:36 | shashlick | if nim.exe already exists for that hash, build exits |
18:48:39 | shashlick | see 96 |
18:51:10 | * | rect0x51 quit (Ping timeout: 250 seconds) |
18:51:33 | * | rect0x51 joined #nim |
18:52:35 | shashlick | i don't know why NIMEXE check isn't working - have to see contents of ${NIMDIR}/bin to know if it is correct on windows |
18:54:23 | * | Tyresc joined #nim |
18:58:15 | FromGitter | <kaushalmodi> may be that bash -f check works differently on windows? |
18:58:38 | FromGitter | <kaushalmodi> You can also echo $NIMEXE |
19:01:34 | shashlick | could be - are you making any changes? |
19:01:43 | FromGitter | <kaushalmodi> no |
19:02:00 | FromGitter | <kaushalmodi> I am checking out how reverting the last commit looks on my fork |
19:02:50 | FromGitter | <kaushalmodi> the build is running: https://travis-ci.org/kaushalmodi-forks/nightlies/builds/487081084 ; will check back in an hour |
19:31:35 | * | abm joined #nim |
19:32:00 | * | aguspiza quit (Ping timeout: 246 seconds) |
19:32:04 | * | rect0x51 quit (Quit: WeeChat 2.3) |
19:37:56 | narimiran | @kaushalmodi it looks like devel on windows is failing :/ |
19:38:24 | * | Ven`` quit (Ping timeout: 250 seconds) |
19:38:39 | FromGitter | <kaushalmodi> yes, we are aware |
19:38:43 | FromGitter | <kaushalmodi> the 2 issues are separate |
19:39:01 | FromGitter | <kaushalmodi> that travis build is testing that we get back the 0.19.2 releases for osx/linux |
19:39:09 | FromGitter | <kaushalmodi> the windows failing started last night |
19:39:20 | FromGitter | <kaushalmodi> so it's some recent regression on Nim devel |
19:39:51 | narimiran | hmmm, but appveyor is passing in the main repo :/ |
19:40:09 | narimiran | but for now, 0.19 branch is more important that is ok, so we can ship 0.19.4 |
19:40:52 | FromGitter | <kaushalmodi> actually the nightlies build for windows + devel passed 3 days back: https://travis-ci.org/nim-lang/nightlies/builds/485737264 |
19:41:06 | FromGitter | <kaushalmodi> and that windows fail started happening yest: https://travis-ci.org/nim-lang/nightlies/builds/486765069 |
19:42:08 | FromGitter | <kaushalmodi> shashlick: looks like reverting that commit started creating the osx/linux releases: https://github.com/kaushalmodi-forks/nightlies/releases |
19:42:23 | FromGitter | <kaushalmodi> the osx release is pending .. as it is still building |
19:42:28 | FromGitter | <kaushalmodi> OK to revert that commit? |
19:42:42 | FromGitter | <kaushalmodi> (anyways the sorting doesn't work; Travis CI is stupid :P) |
19:44:14 | FromGitter | <kaushalmodi> @narimiran May be you already saw this, but this is the failure on Windows: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c53500df04ef00644baaea1] |
19:44:59 | shashlick | again, why do you want linux/osxx releases for 0.19.2 when nothing changed? |
19:45:26 | FromGitter | <kaushalmodi> he wants the 0.19.4 releases |
19:45:30 | FromGitter | <kaushalmodi> that got tagged yest |
19:45:43 | FromGitter | <kaushalmodi> see https://github.com/kaushalmodi-forks/nightlies/releases |
19:45:46 | shashlick | what time was it tagged? |
19:46:04 | narimiran | this morning |
19:46:29 | narimiran | @kaushalmodi i didn't see that |
19:46:56 | FromGitter | <kaushalmodi> didn't see what? |
19:47:02 | shashlick | then that makes sense right - the nightly ran last night so there was no new tag to build |
19:47:03 | FromGitter | <kaushalmodi> ah that failure |
19:47:13 | narimiran | yes |
19:47:21 | narimiran | as it is passing on appveyor |
19:47:36 | FromGitter | <kaushalmodi> travis see paths differently? |
19:47:48 | shashlick | it might have caught a bad state, latest might work |
19:47:48 | FromGitter | <kaushalmodi> pointed you to the error as you might be aware of a recent commit that touched this |
19:48:01 | narimiran | yeah, i did that :) |
19:48:11 | narimiran | i must go now, be back in about hour |
19:48:16 | FromGitter | <kaushalmodi> well, that solves the windows failure then :) |
19:48:49 | FromGitter | <kaushalmodi> shashlick: so no need to revert? |
19:48:55 | shashlick | i don't think so |
19:49:02 | shashlick | but we need to fix caching and naming |
19:49:05 | FromGitter | <kaushalmodi> today/tomm's build should roll out the 0.19.4 release |
19:49:29 | FromGitter | <kaushalmodi> I'm wondering why where was no build for the 3 days before yest |
19:50:13 | FromGitter | <kaushalmodi> see https://travis-ci.org/nim-lang/nightlies/builds |
19:50:30 | FromGitter | <kaushalmodi> there's a big gap between builds 157 and 158 |
19:53:09 | shashlick | only appears so |
19:53:31 | shashlick | times are rounded into days |
19:54:22 | FromGitter | <kaushalmodi> jan 29 12:59am and then jan 31 12:46am |
19:54:37 | FromGitter | <kaushalmodi> so Travis somehow didn't want to run the cron on jan 30 |
19:57:21 | federico3 | dom96: any idea why choosenim fails on windows? https://travis-ci.org/FedericoCeratto/nightlies/jobs/487106673 |
20:00:59 | * | nsf quit (Quit: WeeChat 2.3) |
20:19:56 | * | smitop quit (Quit: Connection closed for inactivity) |
20:24:43 | shashlick | federico3: he needs to accept my PR 😄 |
20:25:00 | shashlick | https://github.com/dom96/choosenim/pull/105 |
20:41:43 | oculux | any idea why choosenim fails on windows? |
20:42:06 | oculux | answer: windows is deprected ;) |
20:42:29 | oculux | deprecated... |
20:46:40 | * | abm quit (Quit: Leaving) |
20:48:57 | narimiran | @kaushalmodi, shashlick: so, since your fork managed to create 0.19.4, does that mean that the official nightlies will work, or you need to do some fix? |
20:49:33 | FromGitter | <kaushalmodi> reverting that commit should not be needed |
20:49:51 | narimiran | which commit? |
20:50:13 | FromGitter | <kaushalmodi> on the next cron run on Travis, it will detect a change on the version-0-19 branch and publish the 0.19.4 releases |
20:50:24 | FromGitter | <kaushalmodi> > which commit? ⏎ ⏎ the last commit on nightlies repo |
20:50:39 | FromGitter | <kaushalmodi> I was just testing reverting it on my fork; but that's not needed |
20:50:41 | narimiran | " Swap OS and Env to keep releases together" ? |
20:50:46 | FromGitter | <kaushalmodi> yep |
20:50:47 | shashlick | that isn't the issue |
20:51:00 | shashlick | i'll be fixing the nightlies windows caching issue and the sorting later today |
20:51:45 | * | aguspiza joined #nim |
20:59:30 | * | aguspiza quit (Ping timeout: 246 seconds) |
21:00:09 | * | darithorn quit (Quit: Leaving) |
21:07:57 | federico3 | https://github.com/nim-lang/Nim/pull/10518 apparently appveyor is not happy |
21:08:09 | federico3 | are there plans to keep it around or to switch to Travis CI? |
21:08:46 | narimiran | arag doesn't like travis, so i doubt we'll completely switch to travis |
21:12:18 | Calinou | technically, Azure Pipelines is the "canon" solution for CI on GitHub since they're both owned by Microsoft :P |
21:12:34 | Calinou | they broke scheduled pipelines though, they don't work unless you visit the builds page every day :( |
21:13:07 | narimiran | there is a PR which started experimenting with azure pipelines, but hasn't progressed much |
21:13:32 | FromGitter | <timotheecour> @narimiran regarding that PR: |
21:13:48 | FromGitter | <timotheecour> ya i need to update it; i can tell u the status: |
21:14:33 | FromGitter | <timotheecour> basically i get a large speedup (forgot whether a 2X factor) PLUS 10 concurrent builds which is more than appveyor+travis combined IIRC |
21:14:43 | FromGitter | <timotheecour> 1 thing missing is running docs from it |
21:15:27 | FromGitter | <timotheecour> (i mean, docs are being run and tested since it’s inside `runCI` , but not being deployed) |
21:15:45 | narimiran | sounds promising |
21:16:04 | FromGitter | <timotheecour> it really is; i just need to find the time to “wrap it up" |
21:17:28 | FromGitter | <timotheecour> 1 controversial aspect is (forgot whether i pushed that part) that i’m using python instead of bash, which makes it cross platform (works on windows, linux, osx) with cleaner code at the (tiny) expense of adding dependency on python |
21:17:48 | FromGitter | <timotheecour> (for the intial bootstrap phase before a nim is built) |
21:18:14 | FromGitter | <arnetheduck> @Araq mistake on my part, confused with `mov` which doesn't need lock.. looks like `add` (or `sub` does) |
21:18:38 | Araq | yeah atomic reads are "free" on x86 |
21:19:35 | narimiran | @timotheecour https://github.com/nim-lang/Nim/pull/10367/files this is the only thing you have pushed, as far as i can tell |
21:20:19 | * | vlad1777d joined #nim |
21:24:27 | FromGitter | <timotheecour> i need to push from my private branch ; the WIP is here: https://github.com/nim-lang/Nim/compare/devel...timotheecour:azure-pipelines2_temp2 it’s not ready for review but it works |
21:25:19 | FromGitter | <timotheecour> if there’s strong interest i can reprioritize wrapping it up into a PR |
21:27:20 | FromGitter | <timotheecour> timing results is here: https://dev.azure.com/timotheecour/timotheecour/_build/results?buildId=133 |
21:28:05 | narimiran | "An unexpected error has occurred within this region of the page." :D |
21:29:08 | FromGitter | <timotheecour> ```code paste, see link``` |
21:29:37 | FromGitter | <iffy> Cross-compiling for win on macOS, it fails looking for `/usr/bin/x86_64-w64-mingw32-gcc` because it's actually at `/usr/local/bin/x86_64-w64-mingw32-gcc`. How do I tell nim where the mingw gcc binary is? |
21:29:48 | FromGitter | <timotheecour> (gitter messed up the above link ; so had to add it inside triple quotes) |
21:36:36 | * | narimiran quit (Ping timeout: 246 seconds) |
21:41:08 | ryukoposting | anyone familiar with the js stuff? I want to be able to do an http POST and that's basically it |
21:41:12 | FromGitter | <kaushalmodi> how do I override `setup` in `unittest` locally? |
21:41:15 | FromGitter | <kaushalmodi> https://nim-lang.org/docs/unittest.html |
21:42:46 | FromGitter | <kaushalmodi> here's a dummy test: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c536bd6f46373406a30eaa3] |
21:42:58 | FromGitter | <kaushalmodi> with this, I get " Hint: 'someVar' is declared but not used [XDeclaredButNotUsed]" |
21:43:09 | FromGitter | <kaushalmodi> because the `someVar` is not used in the second test |
21:43:23 | FromGitter | <kaushalmodi> I'm trying to resolve that warning |
21:44:21 | FromGitter | <iffy> I see that `amd64.windows.gcc.path = "/usr/bin"` in Nim/config/nim.cfg but is it possible to set that value when running `nim c`? |
21:44:22 | FromGitter | <kaushalmodi> I was hoping for this to work, but it fails compilation: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c536c3513a2814df6fbdb76] |
21:46:37 | FromGitter | <kaushalmodi> hmm, looks like this works: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c536cbdceb5a2264f7289b8] |
21:47:30 | FromGitter | <timotheecour> @iffy did u try `nim c --amd64.windows.gcc.path:foobar` ? |
21:47:41 | * | FromGitter * iffy tries it |
21:48:13 | FromGitter | <iffy> didn't work |
21:48:28 | FromGitter | <iffy> I'm making a ~/.config/nim/nim.cfg to see if that works |
21:49:01 | FromGitter | <iffy> That worked |
21:49:30 | FromGitter | <timotheecour> so putting `--amd64.windows.gcc.path:foobar` inside `~/.config/nim/nim.cfg` works not not if via cmdline? |
21:49:32 | FromGitter | <timotheecour> odd |
21:49:53 | FromGitter | <iffy> I put `amd64.windows.gcc.path = "/usr/local/bin"` inside `~/.config/nim/nim.cfg` |
21:50:57 | FromGitter | <iffy> but `nim c -d:mingw --cpu:amd64 --amd64.windows.gcc.path:/usr/local/bin -o:/tmp/goober_win.a myfile.nim` did not work |
21:54:46 | * | darithorn joined #nim |
21:55:03 | rayman22201 | @ryukoposting, here is a good simple example from @kaushalmodi's lambda project: https://github.com/kaushalmodi/nim-netlify-functions/blob/master/src/lambda/hello_fetch.nim |
21:55:06 | FromGitter | <timotheecour> this works for me: `nim c —clang.options.debug:-g -r main.nim` |
21:55:10 | * | TheLemonMan joined #nim |
21:57:21 | FromGitter | <kaushalmodi> rayman22201: But that hello_fetch is one example that didn't work for me .. |
21:57:23 | FromGitter | <timotheecour> @iffy there shd’n’t be a difference whether it comes from cmd line or config file; this needs to be tracked down and investigated |
21:57:26 | TheLemonMan | Yo, in case you need a compact dictionary that preserves the insertion order (and doesn't require any initTable & stuff) head here https://github.com/LemonBoy/compactdict :) |
21:57:44 | rayman22201 | I thought you got it to work @kaushalmodi? |
21:58:09 | FromGitter | <kaushalmodi> the commit message for that file doesn't look promising |
21:58:16 | FromGitter | <kaushalmodi> I think I hit some npm dependency issue |
21:59:04 | rayman22201 | that is just amazon lambda stuff. The code demonstrating the http client is fine. |
21:59:20 | FromGitter | <kaushalmodi> here is the page: https://nim-lambda-functions.netlify.com/ |
21:59:28 | FromGitter | <kaushalmodi> I don't have the hello_fetch there, so it didn't work |
21:59:46 | FromGitter | <kaushalmodi> but someone can use that repo as a starting point to make that hello_fetch work |
22:00:37 | FromGitter | <kaushalmodi> btw looks like the original Netlify Lambda hello_fetch example is bit-rotting: https://functions-playground.netlify.com/.netlify/functions/hello_fetch |
22:00:46 | rayman22201 | He isn't doing lambda, so that doesn't matter |
22:01:00 | rayman22201 | lol. It sure is. |
22:02:03 | * | TheLemonMan quit (Quit: Page closed) |
22:02:51 | * | TheLemonMan joined #nim |
22:03:00 | FromGitter | <kaushalmodi> well, that said, @ryukoposting all the .nim files here, except for that hello_fetch.nim are working: https://github.com/kaushalmodi/nim-netlify-functions/tree/master/src/lambda |
22:08:26 | shashlick | TheLemonMan what's the benefit compared to tables |
22:09:29 | TheLemonMan | shashlick: more compact & doesn't require explicit init & preserves insertion order |
22:11:21 | rayman22201 | @TheLemonMan This impl? https://morepypy.blogspot.com/2015/01/faster-more-memory-efficient-and-more.html |
22:11:46 | TheLemonMan | yeah |
22:12:17 | FromGitter | <iffy> @timotheecour I'm happy to help debug |
22:12:26 | rayman22201 | Cool |
22:16:06 | * | skellock joined #nim |
22:16:27 | * | TheLemonMan quit (Quit: Page closed) |
22:26:58 | * | solitudesf quit (Ping timeout: 250 seconds) |
22:43:26 | * | skellock quit (Ping timeout: 250 seconds) |
22:44:47 | * | solitudesf joined #nim |
22:50:54 | FromGitter | <Varriount> TheLemonMan: What a coincidence - I'm currently in the process of (slowly) reimplementing a hash table from C++ to Nim. |
22:51:12 | FromGitter | <Varriount> I was thinking of doing what Python does as a possible modification to the original implementation. |
22:52:11 | * | Vladar quit (Remote host closed the connection) |
22:53:51 | shashlick | for some reason, I cannot use a string I make in a template in a strformat str |
22:54:23 | FromGitter | <kaushalmodi> that's its limitation |
22:54:29 | FromGitter | <kaushalmodi> fmt string is eval on run time |
22:54:30 | shashlick | i get undeclared identifier |
22:55:32 | FromGitter | <kaushalmodi> shashlick: https://github.com/nim-lang/Nim/issues/7632 |
22:56:32 | FromGitter | <kaushalmodi> you might have to resort to `"$1" % [foo]` |
23:01:13 | shashlick | aah |
23:01:18 | shashlick | thanks 😄 |
23:11:41 | * | solitudesf quit (Quit: ZNC - https://znc.in) |
23:14:35 | * | solitudesf joined #nim |
23:15:44 | * | solitudesf quit (Client Quit) |
23:18:13 | * | solitudesf joined #nim |
23:26:25 | * | solitudesf quit (Quit: ZNC - https://znc.in) |
23:30:11 | * | solitudesf joined #nim |
23:32:18 | FromDiscord_ | <exelotl> hey, I'm working on a macro that turns a dialogue script into a chain of functions, like this: https://hastebin.com/raw/camiwitaho |
23:33:01 | FromDiscord_ | <exelotl> like a limited implementation of coroutines |
23:34:41 | FromDiscord_ | <exelotl> so, every yield keyword marks a point where the script should return, allowing the next part of the script to be executed later |
23:36:24 | FromDiscord_ | <exelotl> but ideally I'd like to hide the yield keywords by putting them in templates, but I can't figure out how to expand a template from within a macro which takes an untyped block |
23:37:17 | rayman22201 | It looks a lot like the built in async: https://nim-lang.org/docs/asyncdispatch.html |
23:39:32 | FromDiscord_ | <exelotl> yeah, it's a similar concept except this is for the gameboy advance so I have to roll my own solution |
23:41:11 | rayman22201 | couldn't you just add your own poll / event loop to the existing async? |
23:42:35 | rayman22201 | I only suggest it so that you get the benefit of all the work that has been put into that module. It's probably one of the better tested modules in Nim. |
23:47:07 | FromDiscord_ | <exelotl> I would if I could but the majority of the standard library is off-limits to me, --gc:none is currently the only viable option for this platform |
23:47:26 | rayman22201 | I might be talking out of my ass. I don't know much about gba. Maybe the async macro would be a useful place to steal some ideas from at least. |
23:47:32 | * | solitudesf quit (Quit: ZNC - https://znc.in) |
23:50:26 | FromDiscord_ | <exelotl> yeah i'm getting some ideas... maybe I have to go through several stages e.g. turn the script into an iterator so that the compiler will be happy, pass it as a `typed` parameter to a macro, expand the templates, then turn the script into procs like I'm already doing |
23:52:08 | * | solitudesf joined #nim |
23:52:59 | rayman22201 | https://github.com/nim-lang/Nim/blob/master/lib/pure/asyncmacro.nim#L216 |
23:53:18 | * | solitudesf quit (Client Quit) |
23:53:32 | rayman22201 | you got the basic idea. You have to turn the script into a closure iterator. |
23:54:49 | * | solitudesf joined #nim |
23:56:52 | rayman22201 | the sucky thing about closures is that they might allocate. maybe bad news for a gc:none enviornment. |
23:57:55 | * | solitudesf quit (Client Quit) |
23:58:03 | FromDiscord_ | <exelotl> yeah, I almost certainly can't use them. So I guess I'll just be relying on iterator for the nice 'yield' syntax and then I'll turn it into regular procs |
23:58:12 | * | solitudesf joined #nim |
23:59:45 | FromDiscord_ | <exelotl> ohh that's nice, `typed` expands the templates for me |
23:59:57 | rayman22201 | You might be able to, there is some code dealing with {.gc_safe.} https://github.com/nim-lang/Nim/blob/master/lib/pure/asyncmacro.nim#L305 |