<< 31-01-2019 >>

00:09:10*stefanos82 quit (Remote host closed the connection)
00:46:21rayman22201@ryukoposting: https://pastebin.com/raw/TgigYf6p
00:46:55rayman22201That 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:16ryukopostingaaaaaah i see
00:47:18rayman22201So the way you do it is by creating a whole new type
00:47:47*ghost64 joined #nim
00:48:03rayman22201also, your recursive logic had a bug. I fixed it for you :-P
00:48:04ryukopostinginteresting, that makes sense though
00:48:09ryukopostingoh nice lol
00:48:27ryukopostingyeah i know if h < l it would just crap the bed
00:49:17rayman22201Well, the logic you had originally, would only produce `| array[h, int]`. It only ever printed the `array` in the base case.
00:49:47ryukopostingoh shoot
00:50:06rayman22201technically it would produce `|||| array[h, int]` lol . One pipe for every recursion :-P
00:50:15rayman22201but no arrays to go with the type
00:50:51rayman22201anyway. I think you should stick with the concept instead of the macro
00:51:13rayman22201easier to understand what is going on that way
00:51:17ryukopostingoh definitely yeah, i was just curious to see if it was possible
00:52:15rayman22201anything is possible with macros if you try hard enough 🌈 lol
00:52:29ryukopostingthat's the impression I've gotten
00:52:57ryukopostingit might be hideous but it's pretty intuitive and very powerful
00:53:37rayman22201Yup. that's why they are the "advanced feature" for use only when absolutely necessary :-P
00:53:51rayman22201use with extreme care, blah blah blah
00:54:06rayman22201They 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:50TheKing[m]I'm again dealing with macros myself in c and the temptation to check at last nim grows stronger.
01:39:12ryukopostingwell, 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:41FromDiscord_<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:04FromDiscord_<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:27rayman22201yes 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:18FromDiscord_<exelotl> ok cool, thanks
01:53:27ryukopostingdoes anyone know offhand if httpclient and asyncdispatch are supported by the js toolchain
01:55:00rayman22201httpclient is a definite no. and I think asyncdispatch is also a no considering how it's implemented.
01:55:09rayman22201You don't really need either since JS has those things built in
01:55:31ryukopostingaight cool, was just curious
01:55:38rayman22201You can just use the jsffi module to interface with the built in httpclient from js
01:56:02ryukopostinglibrary I'm writing needs both, i'll look into jsffi
01:58:59rayman22201you use this instead of asyncdispatch for js: https://nim-lang.org/docs/asyncjs.html
02:01:28ryukopostingaight, cool
02:01:33*ikan-keli_ joined #nim
02:01:53ryukopostingI want my libraries to support native and js, so I'll look into it
02:03:34*ng0_ joined #nim
02:04:47rayman22201Shouldn'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:32ryukopostingnice
02:09:19*ng0_ quit (Ping timeout: 256 seconds)
02:11:30*ng0_ joined #nim
02:19:09ryukopostingaaaaay 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:57shashlickwhat 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:09FromGitter<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:08FromGitter<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:22leorizeshashlick: just tell them to use sdl
04:23:42leorizeyou can initialize only the audio part of sdl iirc
04:23:45FromGitter<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:57leorizesdl2 is not even a game library :P
04:24:12leorizeit's just the usecase people widely associated it with
04:32:00rayman22201I 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:22rayman22201seems 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:31rayman22201unless I'm missing something
04:35:52*Marumoto joined #nim
04:36:54leorizerayman22201: don't use [L, T]
04:37:01leorizejust input [M, T] there?
04:37:13leorizeoh wait :P
04:41:58rayman22201M != L ;)
04:42:25rayman22201It'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:47FromGitter<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:38narimiran@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:24FromGitter<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:26PMunchIt'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:34AraqPMunch, take care! :-/
10:15:04*narimiran quit (Quit: Leaving)
10:20:50absolutejamsorry to hear it PMunch
10:21:15*narimiran joined #nim
10:22:04FromGitter<alehander42> good luck!
10:39:00FromGitter<mratsim> nimsuggest on Windows will sometimes lock a file and prevent git pulls :/
10:41:15Araqreally? never happened to me
10:43:16*dom96_w joined #nim
11:00:01PMunchThanks everyone, I'm sure I'll figure something out :)
11:02:36*JustASlacker joined #nim
11:03:51livcdoh noes what happened
11:08:00PMunchNot 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:11ZevvPMunch: where are you located?
11:09:24ZevvUK, right?
11:09:49PMunchNorway
11:10:57PMunchWhy do you ask?
11:12:42*dddddd joined #nim
11:26:00ZevvI can keep an eye open for what it's worth
11:26:38PMunchThanks
11:31:38ZevvGot a C++ job in the netherlands for you :/
11:32:43PMunchHaha, for who? I have some leads for some jobs here in Tromsø as well
11:34:36Zevvhttp://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:44FromGitter<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:41FromDiscord_<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:58PMunchNot sure why it segfaults, but I can guarantee you that that doesn't do what you want it to
12:48:01PMunchhttp://ix.io/1zD5/Nim
12:48:06PMunchSomething as simple as that will work
12:49:05FromDiscord_<Obstinate> This is cut down from a larger program
12:49:11*seni joined #nim
12:49:35FromDiscord_<Obstinate> 😃
12:49:36FromDiscord_<Obstinate> so I already know it doesn't do what i want -- since i deleted all the unrelated code
12:49:57FromDiscord_<Obstinate> Originally, newMatrix was returning the Matrix and doing some initialization of the other fields of Matrix
12:50:15FromDiscord_<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:17PMunchHmm, 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:03PMunchChanging 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:21PMunch(Added in some extra stuff as well to make sure it worked)
13:00:33*stefanos82 joined #nim
13:00:40PMunchObstinate ^
13:00:59PMunchWhat are you using 67Mb of ints for anyways? :P
13:01:04FromDiscord_<Obstinate> ahhhhhhhhh
13:01:37FromDiscord_<Obstinate> I previously had it as an enum, but even with that it would probably be the same result.
13:01:54PMunchYeah, enums are stored as ints IIRC
13:01:59PMunchSo that would be the same result
13:02:00FromDiscord_<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:13FromDiscord_<Obstinate> it's just gonna be a toy program
13:02:43FromDiscord_<Obstinate> that does fix it
13:02:46FromDiscord_<Obstinate> thank you pmunch
13:02:46PMunchBut yeah, allocate it on the heap and you should be fine
13:02:50PMunchNo problem
13:09:27*tweenietomatoes joined #nim
13:09:50tweenietomatoesanyone employed here?
13:10:19PMunchtweenietomatoes, employed with Nim?
13:10:28PMunchOr in general
13:16:35skellocki'm employed... my wife says this is one of my best features.
13:29:06tweenietomatoesno i mean working at or on somewhere/something
13:29:35tweenietomatoesnim is programming something of depressed and unemployed people
13:30:31tweenietomatoesi hope everyone likes popcorn
13:36:10skellockare you asking "who is using nim in ""production""?" (nested airquotes are intentional)
13:40:28tweenietomatoeswriting 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:47FromGitter<mratsim> you can write the frontend in Nim as well, though I’m not too sure about the maturity.
13:58:55FromGitter<mratsim> Maybe @gogolxdong can comment on that
13:59:22FromGitter<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:13Zevv\o/
14:02:06skellockmratsim: amazing!
14:02:49FromGitter<alehander42> I am also using Nim on the frontend
14:03:33*endragor quit (Remote host closed the connection)
14:04:06FromGitter<alehander42> It's quite an ok fit albeit i need to finish two
14:04:44FromGitter<alehander42> things that've been the remaining imperfect points in js interop for me
14:04:47skellockalehander42: is your setup a single page app?
14:04:55FromGitter<alehander42> kinda
14:05:02FromGitter<alehander42> An electron app
14:05:27FromGitter<alehander42> the frontend is a spa indeed
14:06:02FromGitter<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:28Araqwhat's "call-forwarding" a function?
14:10:28*absolutejam quit (Ping timeout: 245 seconds)
14:11:17skellockdeech: 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:01FromGitter<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:07FromGitter<deech> @skellock: Thanks!
14:14:37narimiran@deech forward-declaration ;)
14:15:12FromGitter<deech> jfc, I said call-forwarding didn't I.
14:15:27Araqdeech: totally different, 'mixin' deals with the symbol binding within generics
14:15:46Araqit enforces an "open symbol overload set"
14:16:36FromGitter<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:33FromGitter<gogolxdong> For web frontend, Nim forum is an example.
14:19:41FromGitter<deech> @Araq: I see now. Thanks!
14:21:46FromGitter<gogolxdong> We just borrowed its routing implementation to our production.
14:22:55Araqfun fact: if I patch the reference counting to use atomicInc in gc.nim, bootstrapping slows down by 0.4s
14:23:35Araqfrom 4.4s it goes up to 4.8s
14:28:50FromGitter<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:07Araqatomic_add_fetch(memLoc.addr, x, ATOMIC_RELAXED)
14:40:10AraqI don't think so
14:41:27DominikPichetasSaraq you should start to sell products with your name on it
14:41:31DominikPichetasSto make profit
14:42:33DominikPichetasSthink about go's gopher
14:46:54FromGitter<mratsim> DominikPichetasS are you the real one?
14:47:02AraqI doubt it
14:47:12DominikPichetasSno
14:47:16DominikPichetasSim dominik's snake pet..
14:47:58ZevvQuick, ask him a trick question that only the real dom96 would know
14:48:03DominikPichetasSsomeone please write a proper orm
14:48:26DominikPichetasSnim is so complex
14:48:53FromGitter<mratsim> With great power comes great responsibility
14:49:47narimiranin good old days even trolls were more clever
14:50:18DominikPichetasSi 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:59dom96_wlol wat
15:14:12dom96_wGuess I'm famous now?
15:14:28*solitudesf quit (Quit: ZNC - https://znc.in)
15:14:44tweenietomatoesanother dom?
15:14:49Zevvyou should start to sell products with your name on it
15:14:55Zevvto make profit
15:15:32tweenietomatoesno my aim was to make it like go's gopher
15:15:41tweenietomatoesnim one is crown
15:15:58tweenietomatoesyou cant make toys of it
15:16:07*solitudesf joined #nim
15:17:42tweenietomatoesis http async based on httpbeast?
15:17:55tweenietomatoesany advantage over using tcp?
15:22:48Araqyes, it uses FDDI and is web scale
15:23:41FromGitter<mratsim> FDDI?
15:25:07*Vladar quit (Remote host closed the connection)
15:25:09Araqhttps://en.wikipedia.org/wiki/Fiber_Distributed_Data_Interface
15:26:01tweenietomatoesnim is one of the best performing at techempower benchmark
15:26:37*Vladar joined #nim
15:30:47tweenietomatoeswho 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:21narimirandom96_w, Araq: can you get your ban-hammer out again, please?
15:33:26dom96_wWe've got great documentation, the best.
15:34:54narimiran...now we just wait for trolls to get better too :'(
15:35:33tweenietomatoesnari he is another not me
15:35:39dom96_wmeh, not that bad of a troll
15:35:40tweenietomatoesi was first but i was not troll
15:35:44dom96_wIMO doesn't deserve a ban... yet
15:35:56Zevvthere's always /ignore
15:37:25narimirandom96_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:42Araqyeah yeah yeah, "not yet". IME it never gets better.
15:38:03dom96_wI'm often entertained :P
15:41:25*tweenietomatoes quit (Quit: Page closed)
15:50:32CalinouI used to be quite trollish sometimes
15:50:35Calinouso I probably got better :P
15:53:35*nsf joined #nim
15:53:56narimiranCalinou: yeah, it gets better with practice :)
15:55:13*Ven`` joined #nim
15:55:41FromGitter<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:19Araqsingle inheritance plus composition works just fine for me
16:07:34FromGitter<alehander42> there were some nim talks in the past, is there something like a youtube collection of them etc
16:07:56Araqdom96_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:20dom96_wwhy can't you add 'Blob' into stdlib's dom?
16:08:30FromGitter<bung87> is there a project show the way does in nim ?
16:09:34Araqdom96_w, I can but then karax depends on Nim devel
16:12:15Araqbung87: objects have fields that are other objects
16:12:31*rect0x51 joined #nim
16:13:08FromGitter<alehander42> does the DOM api changes often? if it's stable enough, probably it's still more useful in the stdlib
16:13:33FromGitter<alehander42> (but the way karax needs its own dom module is annoying indeed)
16:13:54FromGitter<bung87> ```code paste, see link``` ⏎ ⏎ this is the class I want porting to nim [https://gitter.im/nim-lang/Nim?at=5c531ec19221b9382df1b535]
16:15:13FromGitter<bung87> I using generic type for various type of same field.
16:15:24Araqdon't port classes, port the code, the algorithms it uses, if any
16:16:02FromGitter<bung87> and try wrap a mixin in a macro ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c531f4241775971a0b4cf12]
16:16:59FromGitter<bung87> if there’s the way do type A = ref object of B,C,D would be more simple
16:17:07Araqusually code like this doesn't even do anything and can be thrown away :-)
16:18:34FromGitter<bung87> so maybe I have to try put all the type definitions into one type
16:19:39FromGitter<alehander42> you can have consumer and logOwner fields and perform their actions/methods on them + the main object
16:22:34FromGitter<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:52FromGitter<bung87> or maybe analyse one file’s code generate a new nim file...
16:25:04FromGitter<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:26FromGitter<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:56FromGitter<bung87> I actually not know the meanning of Composition in programming
16:28:36*JustASlacker quit (Quit: Leaving)
16:28:54FromGitter<bung87> the docs shows the codes ,looks like a one path inheritance. A->B->C
16:31:17FromGitter<bung87> I feel so fine during programing in Nim until I want porting a more complex python lib.
16:31:43FromGitter<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:06FromGitter<alehander42> @bung87 there are a lot of articles about inheritance vs composition
16:33:11FromGitter<alehander42> they're mostly language agnostic
16:33:43FromGitter<alehander42> it results in a bit more explicitness but that's not bad
16:34:13FromGitter<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:16FromGitter<bung87> ah ,so it’s about theory, not a language’s features
16:41:25FromGitter<alehander42> well, it's an approach one can usually use with most languages
16:44:11*floppydh quit (Quit: WeeChat 2.3)
16:51:05Araqarnetheduck: 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:49Araqand 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:18Araqthat said, I'm on Haswell with hardware lock elision
16:52:28Araqso it's surprising to me too
16:53:31Araqon 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:06FromGitter<bung87> ```code paste, see link``` ⏎ ⏎ looks better? [https://gitter.im/nim-lang/Nim?at=5c532afd54f21a71a1d812e4]
17:07:10FromGitter<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:13dom96_wAraq: This is what git tags are for. Tag a version of karax. That way Nimble will install it by default
17:15:21dom96_wKarax
17:15:31dom96_w*Karax #head will only depend on Nim devel which is fine IMO
17:15:52Araqnot for me, no. 0.19 is what Nimble packages should target
17:16:28dom96_wFine, then put the changes in some branch and merge them once new Nim is released
17:16:46Araqthere is a better way
17:17:01dom96_wMoving dom out of stdlib is overkill to workaround this barely-an-issue
17:17:12Araqa simple 'when defined(nimNewDom): import dom else import kdom' should do
17:17:18dom96_wyes
17:17:43Araqthat said, it's interesting how much these modules have diverged :-/
17:17:44dom96_wor... when NimVersion ....?
17:18:00dom96_wAnyway, you should really tag Karax
17:18:03dom96_wThere is 0 releases
17:18:25AraqI don't like tag+Nimble version, do something about this please
17:18:37Araqgive nimble a 'setversion' command or something
17:18:39FromGitter<kaushalmodi> Araq: ++1
17:18:52FromGitter<kaushalmodi> I don't like hard-coding nimble package version in the .nimble
17:19:11FromGitter<kaushalmodi> It should look for the version in the .nimble only if normal means, like a git tag is absent
17:20:16FromGitter<kaushalmodi> (my +1 wasn't on the setversion command suggestion :))
17:24:06dom96_wYes yes, this has been in Nimble's issue tracker for years now
17:25:25dom96_wThis doesn't bother me enough to implement it so I didn't do it, but it should be a fairly easy feature
17:25:56dom96_wBut I have a feeling you guys are imagining something else
17:26:24FromGitter<kaushalmodi> My thinking is that setting just the git tag should be enough
17:26:27dom96_wModifying .nimble file + running `nimble tag` would be enough for me
17:26:35FromGitter<kaushalmodi> the version shouldn't need to be typed in the .nimble file
17:26:53dom96_w.nimble is the source of truth, not the git repo
17:27:13FromGitter<kaushalmodi> my suggestion is to do the opposite
17:27:30dom96_wSomeone can install your package via commit hash and then nimble has no way to know the version
17:28:06FromGitter<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:06FromGitter<kaushalmodi> > Someone can install your package via commit hash ⏎ ⏎ who are such people? :P
17:29:51FromGitter<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:51dom96_wmeh, it should be trivial to get nimble to modify the .nimble file with your desired version
18:31:47shashlick@kaushalmodi - looks like nightlies are broken
18:33:00FromGitter<kaushalmodi> hmm, something broke inbetween 01/25-01/27 for unix type systems
18:33:03shashlicklinux releases are not getting posted even though build passed
18:33:44FromGitter<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:02shashlickthat was just the last build
18:35:23shashlicksome runnable example had an assertion error
18:35:41shashlickbut the linux stuff not posting is a new issue since 25th
18:36:18FromGitter<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:57shashlicki don't see why since the build goes all the way thru
18:37:04shashlickbut that commit was on the 25th
18:37:32FromGitter<kaushalmodi> yep, that's I think that could be the cause
18:38:04shashlickactually devel is working fine
18:38:10FromGitter<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:23FromGitter<kaushalmodi> and no linux/osx builds after that date
18:38:35shashlickexcept the windows failure in last build
18:38:45shashlickv0.19.2 is the one broken
18:38:49shashlickdevel is further down so hard to see
18:38:52shashlickagain, sorting issue
18:38:59shashlicklooks like date should be first, followed by branch
18:39:01FromGitter<kaushalmodi> sorry, the order is screwed
18:39:03FromGitter<kaushalmodi> yeah
18:39:57shashlickok the reason basically is that our caching for 0.19.2 is broken
18:40:11shashlickit works correctly on Linux and OSX - since no changes were made to that branch recently
18:40:20shashlickbut the windows build is running regardless and posting
18:40:23shashlickeven though nothing changed
18:40:38shashlicksee the hash, it is the same
18:40:41FromGitter<kaushalmodi> but still it applies that no builds for linux/osx get posted after 01/25
18:40:44FromGitter<kaushalmodi> .. for 0.19.2
18:41:04shashlickbecause nothing changed - that hash was already built so linux/osx correctly skip the build
18:41:06narimiran@kaushalmodi shashlick i tried to ping you this morning about that ;)
18:41:33narimiranhttps://irclogs.nim-lang.org/31-01-2019.html#08:04:38
18:41:51shashlickyep, i just decided to do something about it 😄
18:42:20narimiranyes, please do something about it, because we rely on you for 0.19.4 release :)
18:42:40narimiranspoiler alert: it is already merged to master and tagged
18:43:14FromGitter<kaushalmodi> version-0-19 also happens to have few commits on 01/25
18:43:32FromGitter<kaushalmodi> so that's the critical date; simulataneous changes on nightly and nim repos :P
18:44:18shashlickokay so we need two fixes - one is to make date first in name, and then fix the windows caching issue
18:44:33FromGitter<kaushalmodi> but .. (things are unrolling)
18:44:44FromGitter<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:59FromGitter<kaushalmodi> and then no changes happened on version-0-19 until 01/31
18:45:13FromGitter<kaushalmodi> so do you want to revert the last commit to nightlies, just to see?
18:45:16shashlickyes that's why linux and osx builds exit immediately
18:45:27shashlickwindows caching is incorrect
18:46:53shashlickhttps://github.com/nim-lang/nightlies/blob/master/.travis.yml#L89
18:47:51FromGitter<kaushalmodi> I'm trying the reverted commit in my fork build
18:47:57FromGitter<kaushalmodi> what about that line 89?
18:48:28shashlickthat is what decides whether to do a build or not
18:48:36shashlickif nim.exe already exists for that hash, build exits
18:48:39shashlicksee 96
18:51:10*rect0x51 quit (Ping timeout: 250 seconds)
18:51:33*rect0x51 joined #nim
18:52:35shashlicki 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:15FromGitter<kaushalmodi> may be that bash -f check works differently on windows?
18:58:38FromGitter<kaushalmodi> You can also echo $NIMEXE
19:01:34shashlickcould be - are you making any changes?
19:01:43FromGitter<kaushalmodi> no
19:02:00FromGitter<kaushalmodi> I am checking out how reverting the last commit looks on my fork
19:02:50FromGitter<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:56narimiran@kaushalmodi it looks like devel on windows is failing :/
19:38:24*Ven`` quit (Ping timeout: 250 seconds)
19:38:39FromGitter<kaushalmodi> yes, we are aware
19:38:43FromGitter<kaushalmodi> the 2 issues are separate
19:39:01FromGitter<kaushalmodi> that travis build is testing that we get back the 0.19.2 releases for osx/linux
19:39:09FromGitter<kaushalmodi> the windows failing started last night
19:39:20FromGitter<kaushalmodi> so it's some recent regression on Nim devel
19:39:51narimiranhmmm, but appveyor is passing in the main repo :/
19:40:09narimiranbut for now, 0.19 branch is more important that is ok, so we can ship 0.19.4
19:40:52FromGitter<kaushalmodi> actually the nightlies build for windows + devel passed 3 days back: https://travis-ci.org/nim-lang/nightlies/builds/485737264
19:41:06FromGitter<kaushalmodi> and that windows fail started happening yest: https://travis-ci.org/nim-lang/nightlies/builds/486765069
19:42:08FromGitter<kaushalmodi> shashlick: looks like reverting that commit started creating the osx/linux releases: https://github.com/kaushalmodi-forks/nightlies/releases
19:42:23FromGitter<kaushalmodi> the osx release is pending .. as it is still building
19:42:28FromGitter<kaushalmodi> OK to revert that commit?
19:42:42FromGitter<kaushalmodi> (anyways the sorting doesn't work; Travis CI is stupid :P)
19:44:14FromGitter<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:59shashlickagain, why do you want linux/osxx releases for 0.19.2 when nothing changed?
19:45:26FromGitter<kaushalmodi> he wants the 0.19.4 releases
19:45:30FromGitter<kaushalmodi> that got tagged yest
19:45:43FromGitter<kaushalmodi> see https://github.com/kaushalmodi-forks/nightlies/releases
19:45:46shashlickwhat time was it tagged?
19:46:04narimiranthis morning
19:46:29narimiran@kaushalmodi i didn't see that
19:46:56FromGitter<kaushalmodi> didn't see what?
19:47:02shashlickthen that makes sense right - the nightly ran last night so there was no new tag to build
19:47:03FromGitter<kaushalmodi> ah that failure
19:47:13narimiranyes
19:47:21narimiranas it is passing on appveyor
19:47:36FromGitter<kaushalmodi> travis see paths differently?
19:47:48shashlickit might have caught a bad state, latest might work
19:47:48FromGitter<kaushalmodi> pointed you to the error as you might be aware of a recent commit that touched this
19:48:01narimiranyeah, i did that :)
19:48:11narimirani must go now, be back in about hour
19:48:16FromGitter<kaushalmodi> well, that solves the windows failure then :)
19:48:49FromGitter<kaushalmodi> shashlick: so no need to revert?
19:48:55shashlicki don't think so
19:49:02shashlickbut we need to fix caching and naming
19:49:05FromGitter<kaushalmodi> today/tomm's build should roll out the 0.19.4 release
19:49:29FromGitter<kaushalmodi> I'm wondering why where was no build for the 3 days before yest
19:50:13FromGitter<kaushalmodi> see https://travis-ci.org/nim-lang/nightlies/builds
19:50:30FromGitter<kaushalmodi> there's a big gap between builds 157 and 158
19:53:09shashlickonly appears so
19:53:31shashlicktimes are rounded into days
19:54:22FromGitter<kaushalmodi> jan 29 12:59am and then jan 31 12:46am
19:54:37FromGitter<kaushalmodi> so Travis somehow didn't want to run the cron on jan 30
19:57:21federico3dom96: 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:43shashlickfederico3: he needs to accept my PR 😄
20:25:00shashlickhttps://github.com/dom96/choosenim/pull/105
20:41:43oculuxany idea why choosenim fails on windows?
20:42:06oculuxanswer: windows is deprected ;)
20:42:29oculuxdeprecated...
20:46:40*abm quit (Quit: Leaving)
20:48:57narimiran@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:33FromGitter<kaushalmodi> reverting that commit should not be needed
20:49:51narimiranwhich commit?
20:50:13FromGitter<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:24FromGitter<kaushalmodi> > which commit? ⏎ ⏎ the last commit on nightlies repo
20:50:39FromGitter<kaushalmodi> I was just testing reverting it on my fork; but that's not needed
20:50:41narimiran" Swap OS and Env to keep releases together" ?
20:50:46FromGitter<kaushalmodi> yep
20:50:47shashlickthat isn't the issue
20:51:00shashlicki'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:57federico3https://github.com/nim-lang/Nim/pull/10518 apparently appveyor is not happy
21:08:09federico3are there plans to keep it around or to switch to Travis CI?
21:08:46narimiranarag doesn't like travis, so i doubt we'll completely switch to travis
21:12:18Calinoutechnically, Azure Pipelines is the "canon" solution for CI on GitHub since they're both owned by Microsoft :P
21:12:34Calinouthey broke scheduled pipelines though, they don't work unless you visit the builds page every day :(
21:13:07narimiranthere is a PR which started experimenting with azure pipelines, but hasn't progressed much
21:13:32FromGitter<timotheecour> @narimiran regarding that PR:
21:13:48FromGitter<timotheecour> ya i need to update it; i can tell u the status:
21:14:33FromGitter<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:43FromGitter<timotheecour> 1 thing missing is running docs from it
21:15:27FromGitter<timotheecour> (i mean, docs are being run and tested since it’s inside `runCI` , but not being deployed)
21:15:45narimiransounds promising
21:16:04FromGitter<timotheecour> it really is; i just need to find the time to “wrap it up"
21:17:28FromGitter<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:48FromGitter<timotheecour> (for the intial bootstrap phase before a nim is built)
21:18:14FromGitter<arnetheduck> @Araq mistake on my part, confused with `mov` which doesn't need lock.. looks like `add` (or `sub` does)
21:18:38Araqyeah atomic reads are "free" on x86
21:19:35narimiran@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:27FromGitter<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:19FromGitter<timotheecour> if there’s strong interest i can reprioritize wrapping it up into a PR
21:27:20FromGitter<timotheecour> timing results is here: https://dev.azure.com/timotheecour/timotheecour/_build/results?buildId=133
21:28:05narimiran"An unexpected error has occurred within this region of the page." :D
21:29:08FromGitter<timotheecour> ```code paste, see link```
21:29:37FromGitter<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:48FromGitter<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:08ryukopostinganyone familiar with the js stuff? I want to be able to do an http POST and that's basically it
21:41:12FromGitter<kaushalmodi> how do I override `setup` in `unittest` locally?
21:41:15FromGitter<kaushalmodi> https://nim-lang.org/docs/unittest.html
21:42:46FromGitter<kaushalmodi> here's a dummy test: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c536bd6f46373406a30eaa3]
21:42:58FromGitter<kaushalmodi> with this, I get " Hint: 'someVar' is declared but not used [XDeclaredButNotUsed]"
21:43:09FromGitter<kaushalmodi> because the `someVar` is not used in the second test
21:43:23FromGitter<kaushalmodi> I'm trying to resolve that warning
21:44:21FromGitter<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:22FromGitter<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:37FromGitter<kaushalmodi> hmm, looks like this works: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c536cbdceb5a2264f7289b8]
21:47:30FromGitter<timotheecour> @iffy did u try `nim c --amd64.windows.gcc.path:foobar` ?
21:47:41*FromGitter * iffy tries it
21:48:13FromGitter<iffy> didn't work
21:48:28FromGitter<iffy> I'm making a ~/.config/nim/nim.cfg to see if that works
21:49:01FromGitter<iffy> That worked
21:49:30FromGitter<timotheecour> so putting `--amd64.windows.gcc.path:foobar` inside `~/.config/nim/nim.cfg` works not not if via cmdline?
21:49:32FromGitter<timotheecour> odd
21:49:53FromGitter<iffy> I put `amd64.windows.gcc.path = "/usr/local/bin"` inside `~/.config/nim/nim.cfg`
21:50:57FromGitter<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:03rayman22201@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:06FromGitter<timotheecour> this works for me: `nim c —clang.options.debug:-g -r main.nim`
21:55:10*TheLemonMan joined #nim
21:57:21FromGitter<kaushalmodi> rayman22201: But that hello_fetch is one example that didn't work for me ..
21:57:23FromGitter<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:26TheLemonManYo, 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:44rayman22201I thought you got it to work @kaushalmodi?
21:58:09FromGitter<kaushalmodi> the commit message for that file doesn't look promising
21:58:16FromGitter<kaushalmodi> I think I hit some npm dependency issue
21:59:04rayman22201that is just amazon lambda stuff. The code demonstrating the http client is fine.
21:59:20FromGitter<kaushalmodi> here is the page: https://nim-lambda-functions.netlify.com/
21:59:28FromGitter<kaushalmodi> I don't have the hello_fetch there, so it didn't work
21:59:46FromGitter<kaushalmodi> but someone can use that repo as a starting point to make that hello_fetch work
22:00:37FromGitter<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:46rayman22201He isn't doing lambda, so that doesn't matter
22:01:00rayman22201lol. It sure is.
22:02:03*TheLemonMan quit (Quit: Page closed)
22:02:51*TheLemonMan joined #nim
22:03:00FromGitter<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:26shashlickTheLemonMan what's the benefit compared to tables
22:09:29TheLemonManshashlick: more compact & doesn't require explicit init & preserves insertion order
22:11:21rayman22201@TheLemonMan This impl? https://morepypy.blogspot.com/2015/01/faster-more-memory-efficient-and-more.html
22:11:46TheLemonManyeah
22:12:17FromGitter<iffy> @timotheecour I'm happy to help debug
22:12:26rayman22201Cool
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:54FromGitter<Varriount> TheLemonMan: What a coincidence - I'm currently in the process of (slowly) reimplementing a hash table from C++ to Nim.
22:51:12FromGitter<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:51shashlickfor some reason, I cannot use a string I make in a template in a strformat str
22:54:23FromGitter<kaushalmodi> that's its limitation
22:54:29FromGitter<kaushalmodi> fmt string is eval on run time
22:54:30shashlicki get undeclared identifier
22:55:32FromGitter<kaushalmodi> shashlick: https://github.com/nim-lang/Nim/issues/7632
22:56:32FromGitter<kaushalmodi> you might have to resort to `"$1" % [foo]`
23:01:13shashlickaah
23:01:18shashlickthanks 😄
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:18FromDiscord_<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:01FromDiscord_<exelotl> like a limited implementation of coroutines
23:34:41FromDiscord_<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:24FromDiscord_<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:17rayman22201It looks a lot like the built in async: https://nim-lang.org/docs/asyncdispatch.html
23:39:32FromDiscord_<exelotl> yeah, it's a similar concept except this is for the gameboy advance so I have to roll my own solution
23:41:11rayman22201couldn't you just add your own poll / event loop to the existing async?
23:42:35rayman22201I 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:07FromDiscord_<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:26rayman22201I 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:26FromDiscord_<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:59rayman22201https://github.com/nim-lang/Nim/blob/master/lib/pure/asyncmacro.nim#L216
23:53:18*solitudesf quit (Client Quit)
23:53:32rayman22201you got the basic idea. You have to turn the script into a closure iterator.
23:54:49*solitudesf joined #nim
23:56:52rayman22201the 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:03FromDiscord_<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:45FromDiscord_<exelotl> ohh that's nice, `typed` expands the templates for me
23:59:57rayman22201You 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