<< 20-10-2018 >>

00:02:59dom96be sure to compile with -d:release
00:03:00anamokbye
00:03:05dom96good night
00:03:12*anamok quit (Remote host closed the connection)
00:03:44FromGitter<yyyc514> @alehander42 duh, don’t know why i didn’t think of macro :)
00:04:14FromGitter<yyyc514> dom96 this is with release and opt:speed
00:17:25FromGitter<rayman22201> :table_flip: The reason that fmt doesn't match properly is because the penalty for not matching the module title. In this case "strformat"
00:17:44FromGitter<rayman22201> @timotheecour
00:17:51FromGitter<rayman22201> who is probably sleeping now lol
00:18:47FromGitter<rayman22201> maybe not, if he is in SF like his github profile says.
00:33:52FromGitter<timotheecour> here!
00:36:03FromGitter<timotheecour> i have ideas on how to improve docsearch but let’s do it the non-hacky way (starting with generating indexdata.json )
00:36:14FromGitter<rayman22201> https://github.com/nim-lang/Nim/issues/9198#issuecomment-431532898
00:36:19FromGitter<timotheecour> shd handle fmt case
00:36:25FromGitter<rayman22201> yeah. I think so
00:36:30FromGitter<rayman22201> That's the real fix
00:36:43FromGitter<rayman22201> I'm starting to work on that now
00:37:04FromGitter<rayman22201> also responding to you and dom on the other github thread
00:38:15FromGitter<timotheecour> Awesome; if u're gonna look into https://github.com/nim-lang/Nim/issues/8495 I can look into the rest
00:39:50FromGitter<rayman22201> 👍
00:49:12*zachk quit (Quit: Leaving)
01:16:06*vlad1777d quit (Ping timeout: 252 seconds)
01:20:43FromGitter<timotheecour> @rayman22201 what does your arrow mean in 'compilerapi -> nimsuggest’
01:21:14FromGitter<rayman22201> api boundary
01:25:09FromGitter<rayman22201> @timotheecour your question is exactly my question. Araq did complete his "modularization" of nim recently. Which I take to mean a better / more clean compiler api, but it is completely undocumented, so idk.
01:25:38FromGitter<timotheecour> right but that arrow means: nimsuggest (as nimble package) would depend on compilerapi (as nimble package)?
01:26:03FromGitter<timotheecour> (just to clarify)
01:26:28FromGitter<rayman22201> yes
01:27:31FromGitter<timotheecour> actually, not completely undocumented, there’s a test which has a number of use cases; I’ve used it a bit, looks promising as basis for other tools (maybe a new nimfix)
01:27:33FromGitter<rayman22201> though compilerapi is the Nim compiler itself, so idk if you would consider that a nimble package
01:28:17FromGitter<timotheecour> well it technically is: u can import compilerapi
01:28:39FromGitter<timotheecour> (and add it as a nimble dependency) already today
01:29:00FromGitter<rayman22201> well, "import" doesn't require nimble. But I'm just being pedantic. I understand your meaning.
01:41:06*adeohluwa quit (Quit: Connection closed for inactivity)
02:02:43*RushPL left #nim ("http://quassel-irc.org - Chat comfortably. Anywhere.")
02:04:55*banc quit (Quit: ZNC - http://znc.in)
02:21:41*banc joined #nim
02:39:45FromGitter<rayman22201> So core dev / @araq question: why is suggest.nim part of the compiler and not part of nimsuggest? https://github.com/nim-lang/Nim/blob/548fc778c9b7048f474bf53c5d665bb8425e3343/compiler/suggest.nim
02:41:16*stefanos82 joined #nim
02:52:21leorizemaybe because it was a part of `nim idetools`?
02:54:30*xace quit (Ping timeout: 268 seconds)
02:57:26FromGitter<rayman22201> so legacy code / historical artifact? lol
03:09:20*chemist69 quit (Ping timeout: 276 seconds)
03:10:49*chemist69 joined #nim
03:16:00*xace joined #nim
03:46:44FromGitter<zacharycarter> I'm starting to get the hang of kakoune
03:46:48FromGitter<zacharycarter> starting to write my own dotfiles
03:48:10FromGitter<rayman22201> cool. I always thought kakoune was interesting, but never had enough impetus to actually try it. Work is all Vim, so vim I stay lol
03:57:10FromGitter<zacharycarter> :P
03:57:21FromGitter<zacharycarter> hopefully by next week I will be unemployed
03:57:32FromGitter<zacharycarter> and I won't have to care about what people do at work anymore!
03:57:47FromGitter<zacharycarter> well - not by next week - but by the start of November I guess
03:58:04FromGitter<zacharycarter> need to wait two weeks - unless they just tell me to GTFO as soon as I put in my notice - which is totally possible
03:58:24FromGitter<zacharycarter> I'm about to start doing Nim development in it though - so we'll see how that works out
04:09:09FromGitter<rayman22201> lol. Well that's one way to get more time to work on Nim
04:09:40FromGitter<zacharycarter> :D
04:09:42FromGitter<rayman22201> It sounds like you were ready to move on from that job anyway
04:09:49FromGitter<zacharycarter> yeah - I have been for a while
04:09:56FromGitter<zacharycarter> the catalyst was getting my house on the market
04:10:09FromGitter<zacharycarter> so now I'm going to truck + tiny home / RV it up
04:10:31FromGitter<zacharycarter> and find a few freelance gigs while I work on my studies to land my dream gig
04:10:50FromGitter<rayman22201> You are doing the "digital nomad" thing! nice
04:11:30FromGitter<zacharycarter> yessir
04:20:09FromGitter<kaushalmodi> A Markdown Parser in Nim: https://enqueuezero.com/markdown-parser.html, https://github.com/soasme/nim-markdown
04:20:51FromGitter<zacharycarter> saw that
04:20:53FromGitter<zacharycarter> pretty awesxome!
04:21:10FromGitter<zacharycarter> although - I do like Nim embracing RST for docgen over MD
04:21:19FromGitter<kaushalmodi> The author is very committed
04:21:36FromGitter<kaushalmodi> really impressed just scrolling through that blog post; now reading through it
04:21:58FromGitter<zacharycarter> yeah - the blog post is amazing!
04:22:00FromGitter<kaushalmodi> The author has put in a respectable amount of effort in documenting this
04:22:07FromGitter<zacharycarter> I think it should go onto HN tbh
04:22:32FromGitter<zacharycarter> it's not just nim specific IMO - it goes into detail about how to tackle a problem with software / a good approach to writing a library
04:25:10FromGitter<zacharycarter> http://zdarsky.tumblr.com/image/37403124592 - is great writing btw lol
04:25:49FromGitter<kaushalmodi> I have seen this construct in parsetoml too: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bcaae4c384492366169de73]
04:25:59FromGitter<kaushalmodi> what does the `case` inside `object` do?
04:26:04FromGitter<zacharycarter> it's a variant type
04:26:15FromGitter<zacharycarter> or object variant I think is the correct term
04:26:26FromGitter<zacharycarter> it's like a discriminated union in C++
04:26:26FromGitter<kaushalmodi> ok, thanks, that will help me look it up
04:26:30FromGitter<zacharycarter> I got you - one sec
04:26:39FromGitter<kaushalmodi> no exp with c/c++
04:26:46FromGitter<zacharycarter> https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants
04:26:59FromGitter<zacharycarter> basically a way to avoid inheritance - and achieve a similar pattern
04:29:34FromGitter<kaushalmodi> sorry, it's still not clear.. taking the above Markdown example ..
04:30:01FromGitter<kaushalmodi> if I have `foo: MarkdownTokenRef`, I can access `foo.headerVal`
04:30:16FromGitter<kaushalmodi> but what does the `of MarkdownTokenType.Header` part do?
04:30:37FromGitter<zacharycarter> that's an eum I assume - `MarkdownTokenType`
04:30:44FromGitter<zacharycarter> so it's like a switch statement
04:31:06FromGitter<zacharycarter> and the object is going to have a member property called `type`
04:31:28FromGitter<zacharycarter> although tbh - I don't think that's valid Nim code - because `type` is a reserved keyword in Nim and it would need to be escaped w/ backticks normally
04:31:53FromGitter<kaushalmodi> hmm
04:32:02FromGitter<kaushalmodi> I think I got it
04:32:03FromGitter<zacharycarter> but basically - when an instance of that object is instantiated, and a value of `Header` is assigned to the `type` member property
04:32:16FromGitter<zacharycarter> then the object will also have a `headerVal` property
04:32:25FromGitter<rayman22201> correct. It's a qualified enum: https://nim-lang.org/docs/manual.html#types-enumeration-types
04:32:43FromGitter<zacharycarter> it's basically just changing the definition of the object, based on a value provided at compile time
04:32:52FromGitter<zacharycarter> and usually you use enums with this pattern
04:33:16FromGitter<rayman22201> not usually, always. It's the only way Variant Objects work in Nim
04:33:19FromGitter<zacharycarter> it's there so you don't need a class hierarchy
04:33:46FromGitter<zacharycarter> well - I meant just in general - can't you do the same in C/C++ without enums?
04:34:05FromGitter<zacharycarter> I'm not entirely sure - I just know there are implementations of this pattern in other languages
04:34:10FromGitter<zacharycarter> not sure how exactly they go about doing it
04:36:36FromGitter<rayman22201> In C/C++ it works pretty much the same way actually
04:36:36FromGitter<zacharycarter> https://en.wikipedia.org/wiki/Tagged_union - I guess you can read that @kaushalmodi if you are super interested in the subject :)
04:36:40FromGitter<zacharycarter> ah okay
04:36:49FromGitter<kaushalmodi> so if I understood correctly, with: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ if I have `var foo: MarkdownTokenRef`, it will have 2 "fields": `type` (author shouldn't have used that identifier as it is reserved, as you said), and `headerVal` [https://gitter.im/nim-lang/Nim?at=5bcab0e182893a2f3b0d24fe]
04:36:55Araqor look up "sum type"
04:37:25FromGitter<kaushalmodi> though, `headerVal` would be accessible *only if* `type` were `MarkdownTokenType.Header`
04:37:27FromGitter<kaushalmodi> correct?
04:37:42FromGitter<zacharycarter> interesting - had never heard of http://cyclone.thelanguage.org/ before
04:38:18FromGitter<rayman22201> @kaushalmodi yes.
04:38:24FromGitter<kaushalmodi> @zacharycarter, Araq: thanks! will read up.
04:38:26FromGitter<kaushalmodi> @rayman22201 thanks
04:38:36FromGitter<kaushalmodi> Araq: how does that nightly build look?
04:39:03FromGitter<zacharycarter> Araq: is region based memory management still a thing with Nim?
04:39:28FromGitter<rayman22201> Cyclone is cool, but it's a dead project if I remember correctly
04:39:43Araqyeah, it's still a thing but needs a blog post...
04:39:44FromGitter<zacharycarter> yeah it is - but I guess it inspired a lot of features in rust
04:39:53FromGitter<zacharycarter> http://cyclone.thelanguage.org/wiki/Memory%20Management%20Via%20Regions/ - might be useful
04:40:03FromGitter<zacharycarter> for those who aren't familiar with the concept in general
04:40:06FromGitter<zacharycarter> I'm reading it now
04:40:36FromGitter<rayman22201> Regions is awesome. It's also really awesome that Nim has it. It should be documented / blogged about! lol
04:40:40FromGitter<rayman22201> /is/are
04:40:53FromGitter<zacharycarter> maybe we can zombie some of this explanation from cyclone
04:40:57FromGitter<zacharycarter> to help noobs like me :)
04:41:45FromGitter<zacharycarter> but if it's not applicable - please accept my apology ahead of time - I just saw it and linked it because I thought it might be analogous
04:42:37FromGitter<rayman22201> IDK. I would have to look into into it in more detail. The basic concepts are probably similar, but idk the details of nims implementation to compare
04:43:03FromGitter<zacharycarter> yeah - I'm sure the implementation specifics arent' great
04:43:14FromGitter<zacharycarter> but this documentation from cyclone seems to do a very good job of explaining the concept at a high level
04:43:45FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bcab281ef4afc4f28a0c616]
04:46:37FromGitter<rayman22201> yeah. not a bad explanation
04:50:35FromGitter<zacharycarter> btw @rayman22201 - my parents own a cockatoo that's like 8 or 9 years younger than me - and I'm 33 - I'll send a pic in a PM at some point
04:54:03FromGitter<rayman22201> <3 That's awesome. I grew up with a greenwing macaw who made it to about 20 (he had a kidney disease and died young unfortunately)
04:54:38*dddddd quit (Remote host closed the connection)
04:58:16FromGitter<zacharycarter> that's sad :( losing pets is the worst
04:58:37FromGitter<zacharycarter> I've had a love / hate relationship with this bird - but it's not really mine, it's most affectionate towards my dad
04:58:49FromGitter<zacharycarter> and they tend to be one-owner birds - it's tough to only see the bird so often and still get along with it
04:59:02FromGitter<zacharycarter> but when I stay with my parents for any period of time - we tend to warm up towards each other
04:59:59FromGitter<rayman22201> Birds are very weird that way. The macaw was my grandfathers bird, and when my grandfather passed, I was the only person who could touch him.
05:00:41FromGitter<rayman22201> My current (much smaller) birds, are similarly inclined. One of them likes my wife, one likes me, and they hate each other lol.
05:01:45FromGitter<zacharycarter> lmao yeah
05:02:07FromGitter<zacharycarter> getting bit by that thing sucks though - I remember one night my parents were out of town and I was putting her back in her cage after she had chilled with me a for a few hours on the couch watching tv
05:02:28FromGitter<zacharycarter> she was not having it - bit me all up and down my forearm and it was super torn up for several weeks
05:02:53FromGitter<zacharycarter> lots of blood and lots of holes from her beak :P
05:03:05FromGitter<zacharycarter> and I don't even want to think about getting bit by a macaw
05:03:05FromGitter<rayman22201> lol. bird life. I have many scars :-P
05:03:11FromGitter<zacharycarter> truth
05:03:19FromGitter<zacharycarter> I just have a tough time not wanting to punch the thing when getting bit
05:03:27FromGitter<zacharycarter> I never have - but trust me - the thought has crossed my mind plenty of times
05:04:54FromGitter<rayman22201> yeah... it takes a lot of self control.
05:06:40FromGitter<zacharycarter> yes - it takes more of it than dealing with a yippy dog
05:06:43FromGitter<zacharycarter> and that takes a lot lol
05:06:52*darithorn quit ()
05:07:30*narimiran joined #nim
05:07:38FromGitter<rayman22201> It's frustrating actually. Birds are a big commitment, a lot more than most other pets. People don't understand that, which is why there are so many birds in shelters.
05:07:57FromGitter<zacharycarter> yeah - my parents are trying to pawn theirs off on someone - or at least they were recently
05:08:20FromGitter<zacharycarter> but they didn't because they were concerned about the care the bird would receive from the person that was trying to purchase it
05:08:41FromGitter<zacharycarter> I don't blame my parents though - a bird that lives for 30+ years is a stupid investment to begin with if you're going to be taking care of it
05:08:58FromGitter<zacharycarter> it's definitely going to be alive when they need to go into assisted living / need a family member to take care of them
05:09:15FromGitter<zacharycarter> and they don't even want to deal with it now - which means I'll probably end up taking it - I'm the only kid that doesn't have my own family
05:09:21FromGitter<zacharycarter> so I guess I'm the lucky one that gets the bird :P
05:09:41FromGitter<rayman22201> lol / sad at that same time
05:09:50FromGitter<zacharycarter> yeah
05:10:35FromGitter<rayman22201> this is totally offtopic, and I'm sorry for derailing the main channel lol
05:10:39FromGitter<zacharycarter> it's my fault lol
05:11:10FromGitter<zacharycarter> but tbh - main channel is almost always empty at this time of night so who really cares - if people want to ask questions about Nim - we're certainly not stopping them or de-railing any present convos
05:11:12FromGitter<zacharycarter> with birdspeak
05:11:32FromGitter<rayman22201> lol true
05:14:14FromGitter<zacharycarter> I'm going to try to do gamedev livestream w/ Nim on Sunday evening
05:14:27FromGitter<zacharycarter> hoping that once tomorrow is done with - I won't have any more house crap to do
05:14:51FromGitter<zacharycarter> and I've decided I'm going to focus this engine on building 3d RTS games with Nim
05:14:54FromGitter<kaushalmodi> so.. I don't use osx.. what's the nim binary named on osx? anyone knows?
05:15:00FromGitter<zacharycarter> nim
05:15:13FromGitter<kaushalmodi> hmm
05:15:17FromGitter<kaushalmodi> travis woes
05:15:26FromGitter<zacharycarter> does travis even have osx support?
05:15:41FromGitter<zacharycarter> or are you using a x-compile toolchain?
05:15:43FromGitter<zacharycarter> and linux?
05:15:54FromGitter<zacharycarter> but I mean - I don't even think that's possible
05:15:55FromGitter<kaushalmodi> `- if [[ ! -f "${NIMDIR}/bin/nim" ]]; then export DO_DEPLOY=yes; fi` behaves differently it seems linux vs osx
05:16:04FromGitter<zacharycarter> pretty sure you have to own apple hardware to compile on happle hardware
05:16:19FromGitter<kaushalmodi> no that's not the problem
05:16:23FromGitter<zacharycarter> gotcha
05:16:35FromGitter<zacharycarter> well - the shells might be different but I doubt that's it
05:16:37FromGitter<kaushalmodi> trying to understand why travis cache detection doesn't work on osx
05:16:39FromGitter<zacharycarter> what's the error you're getting?
05:16:44FromGitter<zacharycarter> hmm
05:16:58FromGitter<kaushalmodi> not an error.. unexpected redundant rebuilds
05:17:06FromGitter<zacharycarter> /Users/zachcarter/.nimble/bin/nim
05:17:10FromGitter<zacharycarter> is my nim directory
05:17:15FromGitter<zacharycarter> via choosenim
05:17:16FromGitter<kaushalmodi> I use above logic to check if that bin/nim file exists
05:17:26FromGitter<zacharycarter> or sorry - the path to my Nim executable
05:17:34FromGitter<kaushalmodi> if true, it means that I have nim built from prev build and travis cached it
05:18:01FromGitter<kaushalmodi> but on osx, it always rebuilds; doesn't detect the nim file from cache
05:18:16FromGitter<zacharycarter> yeah - I'm wondering if you're bash script isn't hosed
05:18:23FromGitter<zacharycarter> I'd refer to - https://stackoverflow.com/questions/592620/how-to-check-if-a-program-exists-from-a-bash-script
05:18:28FromGitter<kaushalmodi> hmm..
05:18:35FromGitter<zacharycarter> there are differences b/w linux and osx
05:18:36FromGitter<kaushalmodi> yeah so now getting into debug of that
05:18:59FromGitter<kaushalmodi> I am just checking if a file exists
05:19:12*flaviu quit (Ping timeout: 252 seconds)
05:19:12FromGitter<kaushalmodi> next step.. do an ls on travis in that dir to see what exactly is there
05:19:55FromGitter<zacharycarter> I know - but what I'm getting at is - depending on the OS
05:20:00FromGitter<zacharycarter> how you check to see if a file exists in bash - can differ
05:20:08FromGitter<zacharycarter> there are portable ways to do it - and non-portable ways
05:20:21FromGitter<zacharycarter> I'd just make sure your method is portable
05:21:06FromGitter<kaushalmodi> got it
05:22:27FromGitter<kaushalmodi> looks like `-f` works on osx, now to check if it supports only posix `[ .. ]` vs bash `[[ .. ]]`
05:22:38FromGitter<kaushalmodi> https://superuser.com/a/289821/209371
05:26:17FromGitter<zacharycarter> yeah - I hate all this crap
05:26:22FromGitter<zacharycarter> so annoying
05:26:37FromGitter<zacharycarter> give us a portable shell scripting language already damnit
05:28:35*flaviu joined #nim
05:42:11FromGitter<rayman22201> question for @timotheecour and maybe @araq. So I got nim jsondoc to work, but it doesn't really do what I thought it does. jsondoc produces one json file per nim file, and doesn't really produce any kind of index. This may be useful for tooling / a docsearch server type thing... but doesn't really help the client side search. Should I go back to the plan of creating a new json format for theindex inside the rst
05:42:11FromGitter... parser?
05:43:35FromGitter<rayman22201> let me rephrase that. I think I should go back to the rst parser approach.
05:44:02FromGitter<rayman22201> jsondoc seems kind of orphaned actually
05:46:11FromGitter<rayman22201> The other option is to maybe expand jsondoc to provide more data similar to ctags? proc parameters for example...
05:46:47FromGitter<rayman22201> Though it seems like the compiler api / nimsuggest is a better / more dynamic solution that.
05:47:52FromGitter<rayman22201> :thinking: maybe I need to take this to github lol
05:59:01*Trustable joined #nim
05:59:17FromGitter<rayman22201> signing off. goodnight!
06:05:10*kapil____ joined #nim
06:12:36Summertimeis there any precautions I should take if I want to distribute binaries I've made with nim?
06:16:02stefanos82the same precautions you would take when distributing binaries that got generated with C or C++ code
06:17:18SummertimeI don't know those completely, but I'm guessing from googling that the word "static" is the important thing
06:27:03leorizejust make sure that your binaries work
06:27:25leorizeand that you didn't statically linked anything that might conflict with your binary license
06:32:20Summertimeoof
06:33:37*Vladar joined #nim
06:34:46*vlad1777d joined #nim
06:50:27*Trustable quit (Remote host closed the connection)
06:58:55*Perkol joined #nim
06:59:54Summertimewell this non-static executable runs on fedora and debian so thats good enough for me, rest can be damned
07:00:21Summertime(well, damned to just install it via nimble instead or something)
07:00:39PerkolIs there function which determines host cpu? Because https://nim-lang.org/docs/system.html#hostCPU merely shows under which arch executable was built. I need a func which would allow me to tell wether I am running on x86 or x64
07:09:12Summertimeif you are running on nix-ish only, could probably read something from /dev/ to get the answer easily enough
07:16:08*nsf joined #nim
08:10:04*stefanos82 quit (Quit: Quitting for now...)
08:27:20*xet7 joined #nim
09:03:49*gmpreussner_ joined #nim
09:04:41*gmpreussner quit (Ping timeout: 260 seconds)
09:12:08*craigger_ joined #nim
09:13:22*craigger quit (Ping timeout: 272 seconds)
09:40:03*Perkol quit (Quit: Leaving)
09:41:59*platoff joined #nim
09:42:16*platoff quit (Client Quit)
10:01:24*regtools quit (Quit: leaving)
10:24:04*kapil____ quit (Quit: Connection closed for inactivity)
10:27:34*nsf quit (Quit: WeeChat 2.2)
10:33:15*narimiran quit (Ping timeout: 252 seconds)
10:36:02*platoff joined #nim
10:46:12*stefanos82 joined #nim
10:48:10FromGitter<mratsim> @perkol for runtime CPU detection you can use my lib: https://github.com/numforge/laser/blob/master/laser/cpuinfo.nim
10:48:54FromGitter<mratsim> it’s still a bit raw as I’ve started on it only last weekend
10:51:40FromGitter<mratsim> otherwise `when sizeof(int) == 4` is a good way to detect 32-bit arch
11:15:09*anamok joined #nim
11:15:13anamokhi
11:16:11anamokI have a library for Nim and I want to add Travis CI to it, but I've never used Travis. How to get started?
11:18:23anamokI need to add a `.travis.yml` file, but what is its content? I guess I should ask travis to run `nimble test`. I have a tests/ folder with unit tests.
11:18:46anamokCan someone show me a sample `.travis.yml` file for Nim?
11:18:52Summertimehttps://github.com/nim-lang/Nim/wiki/TravisCI !
11:19:32Summertimethe line: - nim c --cc:$CC --verbosity:0 -r MYFILE.nim
11:20:00Summertimewould be replaced with...
11:20:21Summertime- nimble test --cc:$CC --verbosity:0
11:26:17FromGitter<mratsim> @anamok, this is a Travis CI that uses choosenim to build stable and devel: https://github.com/mratsim/Arraymancer/blob/master/.travis.yml
11:26:31FromGitter<mratsim> including external dependencies installation
11:27:44FromGitter<mratsim> mmm I need to add the version that doesn’t rebuild the compiler on this wiki
11:29:42*wildlander quit (Quit: Konversation terminated!)
11:30:43*Yardanico quit (Quit: Quitting)
11:31:06*Yardanico joined #nim
11:32:56*krux02 joined #nim
11:33:58anamokI'd need some help. Here is my first try: https://github.com/jabbalaci/nimpykot/blob/master/.travis.yml . And the error message is: "nimble command not found".
11:40:47FromGitter<mratsim> @anamok, I’ve update the wiki: https://github.com/nim-lang/Nim/wiki/BuildServices
11:41:05FromGitter<mratsim> This is the simplest way: https://github.com/nim-lang/Nim/wiki/BuildServices#using-docker
11:42:54FromGitter<mratsim> 5900 stars btw!
11:45:33*kapil____ joined #nim
11:46:26anamokThanks guys! The dockerized version worked like a charm.
11:48:49Summertimeoh geez that looks a lot better
12:01:20*Snircle joined #nim
12:01:34FromGitter<mratsim> Cool, I didn’t test it, and just wrote it ont he fly :P
12:25:16enthus1astguys i finished the demo of a windows service, any suggestions? https://github.com/enthus1ast/nimWindowsService/
12:27:22enthus1astone problem i have is (still :/) the wrapping of the services, atm i can wrap just one function cause i had to choose a name for the wrapped proc. Any ideas to avoid this?
12:27:31*dddddd joined #nim
12:39:04*stefanos82 quit (Quit: Quitting for now...)
12:39:33Summertimethe only thing I'd change for the travis file, is sh -c etcetc -> nimble travis, tiiiny bit neater
12:42:51*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
12:43:42FromGitter<mratsim> @Summertime I’m pretty sure the sh -c is needed, I tried removing it to no avail, and you have to use && as well in the same command
12:45:47Summertimeif you use a task to do both the install and the tests, then you don't need the &&, which is shell syntax! its pretty pedantic of me though
12:46:46Summertimeonly problem is exec in nimscript doesn't return anything :(
12:48:18Summertimeah, but if exec returns non-zero, it'll halt, so it should work ok enough!
12:48:24Summertimehttps://github.com/Summertime/splatter-kit/compare/5627ca8a17db...36c097431dbc a-la
12:49:34*hzx joined #nim
12:52:09*hzx quit (Client Quit)
12:54:58*elrood joined #nim
12:55:00anamokmratsim: we could also add this line: `# docker run -v "$(pwd):/project" -w /project nimlang/nim sh -c "find src/ -name "*.nim" -type f -exec nim doc {} \;"`
12:56:45anamokIt would test the runnableExamples too.
12:59:07FromGitter<mratsim> maybe that should be part of a full Travis with build artifacts that update the gh-pages branch ;)
13:00:44anamokHere I don't care about the HTML pages. I only want to see if the embedded runnableExamples pass.
13:00:57*narimiran joined #nim
13:01:07anamok"*.nim" should be '*.nim'
13:01:38anamokThis docker solution is good for testing libraries.
13:03:11anamokmratsim: it can be a comment too. If someone needs it, (s)he switches it on
13:04:06FromGitter<mratsim> feel free, it’s a wiki ;)
13:11:55anamokmratsim: ok, done
13:20:20*nsf joined #nim
13:23:29*vlad1777d_ joined #nim
13:24:39*vlad1777d quit (Ping timeout: 252 seconds)
13:27:12FromGitter<kaushalmodi> anamok: I have a Nim devel build caching + Nim doc + test + gh-pages setup here: https://github.com/kaushalmodi/elnim/blob/master/.travis.yml
13:27:49FromGitter<kaushalmodi> One thing I plan to improve is replace the double quotes long string with YAML multiline `- |` string
13:28:15FromGitter<kaushalmodi> But I have copy pasted that to few Nim repos and it just works.
13:37:37anamokthanks
13:53:21*eleos joined #nim
13:53:48*TheLemonMan joined #nim
13:59:24TheLemonManenthus1ast, you can write a macro to wrap the main procedure for you
13:59:58TheLemonManand then have the user write something like `proc myMain(...) {.service.}`
14:04:59anamokHow does "nim doc --docSeeSrcUrl" work? Do you have a working example?
14:36:21*eleos quit (Ping timeout: 256 seconds)
14:43:38enthus1astdo i need a macro TheLemonMan? Can i somehow compose the name of the proc in a template? or can it be an anonymous function?
14:44:47anamokI tried `nim doc --index:on --docSeeSrcUrl:https://github.com/name/project/blob/master -o:docs/file.html src/file.nim` but I don't see the links to the source lines.
14:46:08enthus1astto annotate the proc with a pragma would indeed be nice
14:46:46TheLemonManyeah, that's IMO the nicest way to do this kind of stuff
14:56:16*Vladar quit (Remote host closed the connection)
15:01:30FromGitter<mratsim> Pragmas, pragmas everywhere
15:15:51narimiran@mratsim: this might be of your interest: https://github.com/nim-lang/Nim/pull/9452 (because of: https://github.com/mratsim/Arraymancer/issues/129). if you have any comments/suggestions, now's the time :)
15:17:50FromGitter<mratsim> I’ll take a look
15:24:40*kapil____ quit (Quit: Connection closed for inactivity)
15:31:29*stefanos82 joined #nim
15:31:56*chemist69 quit (Ping timeout: 252 seconds)
15:33:02*chemist69 joined #nim
15:37:49*regtools joined #nim
15:58:13FromGitter<mratsim> done
15:58:48FromGitter<alehander42> this opening is bad
15:58:58FromGitter<alehander42> ops sorry
16:01:24*vivus joined #nim
16:02:22vivusdoes anybody use cligen? how do I make a proc parameter not required?
16:02:46FromGitter<kaushalmodi> assign it a default value
16:03:14FromGitter<kaushalmodi> `proc foo(required: string; optional = true) =`
16:04:08*enthus1ast quit (Ping timeout: 276 seconds)
16:05:03FromGitter<mratsim> Here is a fully working binary using cligen to create a Nim project template: https://github.com/status-im/nimbus-launch/blob/master/src/nimbus_launch.nim#L20
16:13:30vivusty I assigned 0 to it
16:20:57*darithorn joined #nim
16:29:40FromDiscord<smitop> how can I have nimble use HTTPS to clone packages, instead of ssh
16:33:33*Trustable joined #nim
16:42:36anamokbye
16:42:42*anamok quit (Remote host closed the connection)
16:49:17*enthus1ast joined #nim
17:19:29*tdc joined #nim
17:24:01*wildlander joined #nim
17:34:28*enthus1ast quit (Remote host closed the connection)
17:34:55*enthus1ast joined #nim
17:58:49federico3smitop: if you are passing an URL explicitely it will detect it
17:58:58federico3otherwise look at cloneUsingHttps in the options
17:59:34federico3https://github.com/nim-lang/nimble#configuration
18:22:36*vivus quit (Remote host closed the connection)
18:36:56*tdc quit (Ping timeout: 260 seconds)
18:53:17*stefanos82 quit (Quit: Quitting for now...)
18:54:05*zachk joined #nim
18:54:32*zachk quit (Changing host)
18:54:32*zachk joined #nim
19:09:59FromGitter<yyyc514> anyway to unquote something passed to a template?
19:10:05FromGitter<yyyc514> i have “blah” but i need ‘blah’ (unquoted)
19:11:39FromGitter<yyyc514> ok what was that html templating lib someone showed me the other day?
19:12:46FromGitter<alehander42> you need the identifier?
19:12:50FromGitter<yyyc514> yes
19:13:03FromGitter<yyyc514> is that possible?
19:13:08FromGitter<alehander42> ident("blah")
19:14:38FromGitter<yyyc514> how? this is a template
19:15:04FromGitter<yyyc514> i’m trying to get obj.field
19:15:07FromGitter<alehander42> well, then use a macro
19:15:11FromGitter<yyyc514> haha
19:15:26FromGitter<alehander42> obj.field
19:15:34FromGitter<alehander42> can you give some context
19:15:37FromGitter<yyyc514> it works if i pass it unquoted
19:15:49FromGitter<yyyc514> working on form_for and textarea helpers
19:15:59FromGitter<yyyc514> stuff is not as simple as in ruby :)
19:16:46FromGitter<alehander42> I find it relatively similar
19:16:59FromGitter<alehander42> but it does require some time probably
19:17:09FromGitter<alehander42> i write macros all the time >1 year
19:17:12FromGitter<yyyc514> well in ruby form_for would yield a block to encapsulate the scope of the object
19:17:29FromGitter<yyyc514> i guess i could do that manualy in the macro
19:17:30FromGitter<alehander42> let me see how it works there
19:18:06FromGitter<yyyc514> <%= form_for(@post) do |f| %> <%= f.textarea :body %> etc
19:19:06FromGitter<alehander42> I see, and textarea etc are builtin methods which return html ?
19:19:47FromGitter<yyyc514> right, but at this point textarea is a method on FormHelper or some stuch which is the object being yielded with `f`
19:20:58FromGitter<yyyc514> trying to think of a nim way of doing this stuff without just trying to copy ruby semantics
19:22:24FromGitter<yyyc514> cause you could probably get really far with macros and a smart template parser :)
19:22:39FromGitter<alehander42> ```form_for(post) do (f): ⏎ f.textarea(post.body)``` [https://gitter.im/nim-lang/Nim?at=5bcb807f435c2a518edaa0c5]
19:22:55FromGitter<alehander42> can't you just have a function form_for which takes a model instance and a lambda
19:23:47FromGitter<yyyc514> well what would the lamba signature look like? wouldn’t you have to use typeinfo or something annoying?
19:24:31FromGitter<yyyc514> what is your paste? possible syntax that’d work with a macro?
19:25:13FromGitter<alehander42> proc form_forM (modelInstance: M, formHandler: FormBuilder[M]): YourHTMLType
19:25:19FromGitter<alehander42> `proc form_forM (modelInstance: M, formHandler: FormBuilder[M]): YourHTMLType`
19:25:33FromGitter<alehander42> no, I think it should work with just a proc def
19:25:36FromGitter<yyyc514> but it could be any type of model
19:25:38FromGitter<yyyc514> it’s generic
19:25:38FromGitter<alehander42> Nim does support a do notation
19:25:41FromGitter<alehander42> exactly
19:25:48FromGitter<alehander42> well yeah
19:25:59FromGitter<alehander42> you can still use a macro internally
19:26:08FromGitter<alehander42> or just type the macro this way
19:27:09FromGitter<yyyc514> i haven’t used T with procs yet so i don’t know it’s limitations and such
19:27:22FromGitter<yyyc514> is that what you meant above vs M ?
19:27:31FromGitter<yyyc514> or does the letter really not matteR? lol
19:28:46FromGitter<alehander42> techincally I think you might be able to do it
19:28:48FromGitter<alehander42> in a proc
19:28:51FromGitter<alehander42> using fieldPairs
19:29:04FromGitter<alehander42> https://nim-lang.org/docs/system.html
19:29:08FromGitter<alehander42> (ctrl+f fieldPair)
19:29:40FromGitter<yyyc514> yeah don’t worry i can look stuff up in the docs :)
19:29:46FromGitter<alehander42> yes, T / M is just a generic type
19:29:59FromGitter<alehander42> it doesn't matter the name of course
19:30:17FromGitter<alehander42> you can have `name[K, V, T]`
19:30:27FromGitter<yyyc514> i’m still not quite sure how the yielding would work… if you passed a proc in you’d have to ALSO be inside the outer template scope (for variable references and stuff) so that could get messy i think
19:31:05FromGitter<alehander42> well it's a closure, so it should be able to access the variables from the defining scope
19:32:14FromGitter<alehander42> at least I think it must be a closure
19:32:39FromGitter<alehander42> btw have you thought of a default orm
19:32:49FromGitter<yyyc514> so now the template engine would have to turn the inner template into something and inject it inside a proc and then pass that proc to the form_for
19:33:18FromGitter<yyyc514> no… i wanted to work with nim objects as much as possible so really you could plug it into any ORM is the idea
19:34:41*Trustable quit (Remote host closed the connection)
19:35:08FromGitter<yyyc514> i guess i’m tryign to imagine how this would work (at all) with “raw” nim, not tons of crazy macros :)
19:35:37FromGitter<yyyc514> so far most of the framework would still make sense if you wrote out the code manually, the macros just tidy it all up
19:35:50FromGitter<yyyc514> vs like building a ruby VM with macros :)
19:35:59*kobi7 joined #nim
19:36:05FromGitter<yyyc514> ie the router just spits out a ton of ifs and dispatches to controlelr
19:36:49FromGitter<yyyc514> so you write `match "/pastes/new" => "pastes#new”` but you could also write 10 LOC and do the dispatch manually, it’s sitll “just nim"
19:37:45FromGitter<yyyc514> (https://files.gitter.im/nim-lang/Nim/KCjB/Screen-Shot-2018-10-20-at-3.37.30-PM.png)
19:37:50FromGitter<yyyc514> so far i have, whihc isn’t completely terrible
19:38:49FromGitter<yyyc514> but also isn’t very magical :)
19:40:38CalinouI put together a simple wrapper script for 0x0 in Bash, but now I'm tempted to rewrite it to Nim: https://github.com/Calinou/0x0
19:40:48CalinouI'd gain native Windows support this way (other than in the WSL, that is)
19:49:23*kobi7 quit (Quit: Leaving)
19:52:36FromGitter<zetashift> WHat's stopping you from not rewriting it in Nim?
19:58:28FromGitter<yyyc514> ugh Error: internal error: getTypeDescAux(tyExpr)
20:00:20*nsf quit (Quit: WeeChat 2.2)
20:01:50FromGitter<yyyc514> ok fot the proc version compiling :)
20:16:18FromGitter<yyyc514> @alehander42 ha the block runs before the content from it’s actual call is added
20:16:27FromGitter<yyyc514> which makes sense
20:16:44FromGitter<yyyc514> but means you can’t just output to the buffer inside your proc
20:20:24FromGitter<yyyc514> n/m
20:20:34FromGitter<yyyc514> you can let scoping solve that for you
20:21:31FromGitter<yyyc514> (https://files.gitter.im/nim-lang/Nim/dFEs/Screen-Shot-2018-10-20-at-4.21.16-PM.png)
20:21:35FromGitter<yyyc514> not that that is valid HTML or anything :)
20:38:52*tdc joined #nim
21:07:14*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
21:09:34FromGitter<yyyc514> ok now i need dynamic access to a field
21:09:44FromGitter<yyyc514> var x = “field_name”; obj[x]
21:19:43*narimiran quit (Ping timeout: 246 seconds)
21:20:32FromGitter<Quelklef> Can anyone help me out with a weird bug with a generic template?
21:20:32FromGitter<Quelklef> https://pastebin.com/raw/v8ekecu7
21:22:24FromGitter<Quelklef> Sorry, `line(17)` is wrong. The error points to `Option[T]` in `var res: Option[T]`
21:30:03FromGitter<yyyc514> can i not pass a literal variable to a macro?
21:31:15FromGitter<Quelklef> You can
21:31:24FromGitter<yyyc514> how?
21:31:31FromGitter<Quelklef> give the parameter a type
21:31:38FromGitter<yyyc514> macro `@`M (obj: ref M, field_name: string) : untyped =
21:31:41FromGitter<yyyc514> grrr
21:31:52FromGitter<yyyc514> type string, yes?
21:32:07FromGitter<yyyc514> ```result.add (fh.model@field)```
21:32:12FromGitter<yyyc514> but “field” is passed
21:32:15FromGitter<yyyc514> not the VALUE of field
21:32:19FromGitter<yyyc514> proc textarea*M (fh: FormHelper[M], field: string{lit}) : string =
21:32:33FromGitter<yyyc514> field is a string literal
21:38:07FromGitter<yyyc514> am i missing something? @Quelklef
21:44:12FromGitter<Quelklef> oh tru
21:44:14FromGitter<Quelklef> try*
21:44:17FromGitter<Quelklef> `static[string]`
21:45:33FromGitter<yyyc514> yeah i was just playing with that, that’s a lot closer
21:46:12FromGitter<yyyc514> now i just need to turn StrLit back into a symbol
21:47:39FromGitter<yyyc514> ok ident works but how could i get a Sym?
21:53:07FromGitter<yyyc514> gree hate it when astGenRepr gives you invalid stuff
21:53:09FromGitter<yyyc514> there is no newSymNode
21:59:52FromGitter<yyyc514> what is the deal with sym nodes?
22:05:40krux02bindSym
22:06:06FromGitter<yyyc514> ../../lib/view.nim(35, 23) Error: cannot evaluate at compile time: field_name
22:06:28krux02bindSym generates a symChoice (all symbols with the same name)
22:08:50FromGitter<yyyc514> is there somewhere i can read about the different between symbols and idents?
22:10:27*sagax quit (Ping timeout: 252 seconds)
22:18:48krux02identifiers are just names like you type them into the editor the compiler still has to figure out what they actually refer to
22:19:08krux02a symbol has one exact meaning
22:19:13krux02a symbol has a type
22:19:19FromGitter<yyyc514> so when I see a SymNode it’s already been bound
22:19:19krux02and it has an implementation
22:19:25krux02yes
22:19:46FromGitter<yyyc514> (https://files.gitter.im/nim-lang/Nim/ltrD/Screen-Shot-2018-10-20-at-6.19.35-PM.png)
22:19:49FromGitter<yyyc514> is it possible for do syntax to be less verbose?
22:20:24*elrood quit (Quit: Leaving)
22:20:37krux02yes, you can not use the do notation
22:21:14krux02but I don't know what the form_for does
22:21:26krux02so I can't really help you there
22:21:34FromGitter<yyyc514> generates an HTML form :)
22:21:42krux02but the do notation is just one way to pass a function
22:21:49FromGitter<yyyc514> is do purely syntactic sugar for passing another param?
22:22:01krux02there is also the `->` notation in sugar
22:24:38FromGitter<yyyc514> i actually want to refer to f inside the block though
22:24:43FromGitter<yyyc514> is that possible without the do notation?
22:29:04krux02do you use a macro?
22:29:42FromGitter<yyyc514> deep inside, but these are just procs
22:30:36FromGitter<yyyc514> i’m just wondering if there is some less verbose/more beautiful way to do this without resulting to insane macros :)
22:31:02FromGitter<yyyc514> so far most of this is pure nim
22:32:57krux02There is probably an easier way to do this, but I don't understand a lot of the code you posted, so I can't suggest a simplification
22:33:18krux02you should post some code that I can execute on my local machine in not image form
22:34:08FromGitter<yyyc514> maybe if i can figure out what all i’d have to bundle up
22:34:12krux02I don't know what a FormHelper is nor do I know what a Paste is
22:34:16FromGitter<yyyc514> it’s jst HTML generation
22:34:24FromGitter<yyyc514> Paste is just an object
22:34:41krux02why does it matter?
22:34:43FromGitter<yyyc514> (https://files.gitter.im/nim-lang/Nim/dxBP/Screen-Shot-2018-10-20-at-6.34.29-PM.png)
22:34:51FromGitter<yyyc514> that is the output
22:35:01FromGitter<yyyc514> why does what matter?
22:35:46FromGitter<yyyc514> FormHelper is how I push the context down inside the blocks so that textarea and do things on the object we passed into form_for originally
22:36:00FromGitter<yyyc514> without having to repeat yourself
22:36:46FromGitter<yyyc514> so instead of textarea(person, first_name) textarea(person, last_name) etc.. you can just write `f.textarea “first_name”`
22:36:50krux02well I still can't copy paste that image, but it is only the output, so it's ok
22:37:11krux02but when you want to generate such an output, I recommend to take a look at some serializers
22:37:41krux02nim has a templating engine to generate code such as html
22:38:06krux02and there are serializers. I think this code can be generated with a serializer.
22:38:07FromGitter<yyyc514> you mean stdtmpl stuff?
22:38:31FromGitter<yyyc514> i’m not sure i want a serializing, i’m writing a templating system
22:38:41FromGitter<yyyc514> the user decides how the form should be output
22:38:43FromGitter<yyyc514> i’m just writing helpers
22:39:19FromGitter<yyyc514> but you could link me to the serializer stuff and i’d take a quick look
22:40:18krux02first of all, I don't do web stuff, so my recommendations are not worth a lot, I don't know what is popular and what is broken, but this is something I found: https://flyx.github.io/emerald/
22:41:40FromGitter<yyyc514> yeah i’m building at a layer above that… the stuff i’m writing someone could drop INTO emerald if they wanted
22:41:54FromGitter<yyyc514> so you’d be adding form_for, etc on TOP of emerald
22:41:57krux02with a second look, I can't say that I like it, there are things that are a bit wonky to me, but you get the idea, the syntax can be very compact
22:42:00FromGitter<yyyc514> but i still have to make it work
22:42:15FromGitter<yyyc514> and personalyl (for me) i dislike writing HTML that way
22:42:17FromGitter<alehander42> I think emerald is similar to karax , they're both code DSL-s with different syntax choices
22:42:20FromGitter<yyyc514> in ruby world it’s kind of religious
22:42:23krux02waht is form_for supposed to do?
22:42:27FromGitter<yyyc514> HAML (that type of syntax) vs HTML
22:42:34FromGitter<yyyc514> outputs a HTML form
22:42:34FromGitter<alehander42> but honestly I think for your `<%= .. %>` style of template
22:42:45FromGitter<yyyc514> yeah <%= %> is the goal :)
22:42:47FromGitter<alehander42> it's just easier to half-parse a document
22:42:55FromGitter<yyyc514> that’s just icing though
22:42:59FromGitter<yyyc514> i still have to have the actual code working
22:43:01FromGitter<alehander42> and generate internally the code
22:43:10FromGitter<yyyc514> then you have a function that reads a template and spits out the uglier version
22:43:20FromGitter<alehander42> the code filter stuff is good for some things, but I don't think it's great for this
22:43:21FromGitter<yyyc514> i’m just writing the uglier version first
22:43:27FromGitter<yyyc514> yeah i started with code filter, ugh
22:43:33FromGitter<yyyc514> not powerful enough
22:43:41FromGitter<yyyc514> no way to have custom helpers that take blocks
22:43:44FromGitter<yyyc514> (for one)
22:44:13FromGitter<yyyc514> right now i’m trying to shorten `(form_forPaste (paste, action = "/pastes/") do (f: FormHelper[Paste]) -> string:`
22:44:39FromGitter<yyyc514> i know i could do it with macros but i don’t want a form_for: “FormHelper” style lookup table because then it makes it hard for users to writ their own helpers
22:45:26FromGitter<yyyc514> i supose you could just write the name though
22:45:32FromGitter<yyyc514> FormForHelper :-)
22:46:28FromGitter<yyyc514> so your template is just `<%= for_forPaste (paste) do |f| %>
22:47:03krux02Well I am out, I can't really help. Good night
22:47:06FromGitter<yyyc514> thanks
22:47:13krux02np
22:48:13FromGitter<alehander42> you shoudln't need form_forPaste (paste)
22:48:24FromGitter<alehander42> `form_for[Paste](pa..`
22:48:30FromGitter<alehander42> when you call a generic function
22:48:38FromGitter<alehander42> you don't need to pass the geneeric arg, it's inferred
22:48:45FromGitter<alehander42> so just `form_for(paste..`
22:49:01FromGitter<yyyc514> well hot dog :)
22:49:07FromGitter<yyyc514> i shuld have known that
22:49:14FromGitter<yyyc514> so now just the do syntax is ugly :)
23:09:19FromGitter<yyyc514> @alehander42 i still have to include tpes for the dos though, right?
23:09:30Calinou@zetashift I just don't know if it's overkill for a ~50 line script :)
23:10:16FromGitter<zetashift> But it'll be FUN! I hope...
23:10:25CalinouI can use https://github.com/PMunch/nimcr to make development easier
23:16:29*rockcavera quit (Remote host closed the connection)
23:46:18*SenasOzys joined #nim
23:46:39*SenasOzys quit (Remote host closed the connection)
23:54:46*krux02 quit (Remote host closed the connection)
23:57:44FromGitter<yyyc514> is there anyway of just telling nim “compile this AST right here” without wrapping it in a macro?