00:02:59 | dom96 | be sure to compile with -d:release |
00:03:00 | anamok | bye |
00:03:05 | dom96 | good night |
00:03:12 | * | anamok quit (Remote host closed the connection) |
00:03:44 | FromGitter | <yyyc514> @alehander42 duh, don’t know why i didn’t think of macro :) |
00:04:14 | FromGitter | <yyyc514> dom96 this is with release and opt:speed |
00:17:25 | FromGitter | <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:44 | FromGitter | <rayman22201> @timotheecour |
00:17:51 | FromGitter | <rayman22201> who is probably sleeping now lol |
00:18:47 | FromGitter | <rayman22201> maybe not, if he is in SF like his github profile says. |
00:33:52 | FromGitter | <timotheecour> here! |
00:36:03 | FromGitter | <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:14 | FromGitter | <rayman22201> https://github.com/nim-lang/Nim/issues/9198#issuecomment-431532898 |
00:36:19 | FromGitter | <timotheecour> shd handle fmt case |
00:36:25 | FromGitter | <rayman22201> yeah. I think so |
00:36:30 | FromGitter | <rayman22201> That's the real fix |
00:36:43 | FromGitter | <rayman22201> I'm starting to work on that now |
00:37:04 | FromGitter | <rayman22201> also responding to you and dom on the other github thread |
00:38:15 | FromGitter | <timotheecour> Awesome; if u're gonna look into https://github.com/nim-lang/Nim/issues/8495 I can look into the rest |
00:39:50 | FromGitter | <rayman22201> 👍 |
00:49:12 | * | zachk quit (Quit: Leaving) |
01:16:06 | * | vlad1777d quit (Ping timeout: 252 seconds) |
01:20:43 | FromGitter | <timotheecour> @rayman22201 what does your arrow mean in 'compilerapi -> nimsuggest’ |
01:21:14 | FromGitter | <rayman22201> api boundary |
01:25:09 | FromGitter | <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:38 | FromGitter | <timotheecour> right but that arrow means: nimsuggest (as nimble package) would depend on compilerapi (as nimble package)? |
01:26:03 | FromGitter | <timotheecour> (just to clarify) |
01:26:28 | FromGitter | <rayman22201> yes |
01:27:31 | FromGitter | <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:33 | FromGitter | <rayman22201> though compilerapi is the Nim compiler itself, so idk if you would consider that a nimble package |
01:28:17 | FromGitter | <timotheecour> well it technically is: u can import compilerapi |
01:28:39 | FromGitter | <timotheecour> (and add it as a nimble dependency) already today |
01:29:00 | FromGitter | <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:45 | FromGitter | <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:21 | leorize | maybe because it was a part of `nim idetools`? |
02:54:30 | * | xace quit (Ping timeout: 268 seconds) |
02:57:26 | FromGitter | <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:44 | FromGitter | <zacharycarter> I'm starting to get the hang of kakoune |
03:46:48 | FromGitter | <zacharycarter> starting to write my own dotfiles |
03:48:10 | FromGitter | <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:10 | FromGitter | <zacharycarter> :P |
03:57:21 | FromGitter | <zacharycarter> hopefully by next week I will be unemployed |
03:57:32 | FromGitter | <zacharycarter> and I won't have to care about what people do at work anymore! |
03:57:47 | FromGitter | <zacharycarter> well - not by next week - but by the start of November I guess |
03:58:04 | FromGitter | <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:24 | FromGitter | <zacharycarter> I'm about to start doing Nim development in it though - so we'll see how that works out |
04:09:09 | FromGitter | <rayman22201> lol. Well that's one way to get more time to work on Nim |
04:09:40 | FromGitter | <zacharycarter> :D |
04:09:42 | FromGitter | <rayman22201> It sounds like you were ready to move on from that job anyway |
04:09:49 | FromGitter | <zacharycarter> yeah - I have been for a while |
04:09:56 | FromGitter | <zacharycarter> the catalyst was getting my house on the market |
04:10:09 | FromGitter | <zacharycarter> so now I'm going to truck + tiny home / RV it up |
04:10:31 | FromGitter | <zacharycarter> and find a few freelance gigs while I work on my studies to land my dream gig |
04:10:50 | FromGitter | <rayman22201> You are doing the "digital nomad" thing! nice |
04:11:30 | FromGitter | <zacharycarter> yessir |
04:20:09 | FromGitter | <kaushalmodi> A Markdown Parser in Nim: https://enqueuezero.com/markdown-parser.html, https://github.com/soasme/nim-markdown |
04:20:51 | FromGitter | <zacharycarter> saw that |
04:20:53 | FromGitter | <zacharycarter> pretty awesxome! |
04:21:10 | FromGitter | <zacharycarter> although - I do like Nim embracing RST for docgen over MD |
04:21:19 | FromGitter | <kaushalmodi> The author is very committed |
04:21:36 | FromGitter | <kaushalmodi> really impressed just scrolling through that blog post; now reading through it |
04:21:58 | FromGitter | <zacharycarter> yeah - the blog post is amazing! |
04:22:00 | FromGitter | <kaushalmodi> The author has put in a respectable amount of effort in documenting this |
04:22:07 | FromGitter | <zacharycarter> I think it should go onto HN tbh |
04:22:32 | FromGitter | <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:10 | FromGitter | <zacharycarter> http://zdarsky.tumblr.com/image/37403124592 - is great writing btw lol |
04:25:49 | FromGitter | <kaushalmodi> I have seen this construct in parsetoml too: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bcaae4c384492366169de73] |
04:25:59 | FromGitter | <kaushalmodi> what does the `case` inside `object` do? |
04:26:04 | FromGitter | <zacharycarter> it's a variant type |
04:26:15 | FromGitter | <zacharycarter> or object variant I think is the correct term |
04:26:26 | FromGitter | <zacharycarter> it's like a discriminated union in C++ |
04:26:26 | FromGitter | <kaushalmodi> ok, thanks, that will help me look it up |
04:26:30 | FromGitter | <zacharycarter> I got you - one sec |
04:26:39 | FromGitter | <kaushalmodi> no exp with c/c++ |
04:26:46 | FromGitter | <zacharycarter> https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants |
04:26:59 | FromGitter | <zacharycarter> basically a way to avoid inheritance - and achieve a similar pattern |
04:29:34 | FromGitter | <kaushalmodi> sorry, it's still not clear.. taking the above Markdown example .. |
04:30:01 | FromGitter | <kaushalmodi> if I have `foo: MarkdownTokenRef`, I can access `foo.headerVal` |
04:30:16 | FromGitter | <kaushalmodi> but what does the `of MarkdownTokenType.Header` part do? |
04:30:37 | FromGitter | <zacharycarter> that's an eum I assume - `MarkdownTokenType` |
04:30:44 | FromGitter | <zacharycarter> so it's like a switch statement |
04:31:06 | FromGitter | <zacharycarter> and the object is going to have a member property called `type` |
04:31:28 | FromGitter | <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:53 | FromGitter | <kaushalmodi> hmm |
04:32:02 | FromGitter | <kaushalmodi> I think I got it |
04:32:03 | FromGitter | <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:16 | FromGitter | <zacharycarter> then the object will also have a `headerVal` property |
04:32:25 | FromGitter | <rayman22201> correct. It's a qualified enum: https://nim-lang.org/docs/manual.html#types-enumeration-types |
04:32:43 | FromGitter | <zacharycarter> it's basically just changing the definition of the object, based on a value provided at compile time |
04:32:52 | FromGitter | <zacharycarter> and usually you use enums with this pattern |
04:33:16 | FromGitter | <rayman22201> not usually, always. It's the only way Variant Objects work in Nim |
04:33:19 | FromGitter | <zacharycarter> it's there so you don't need a class hierarchy |
04:33:46 | FromGitter | <zacharycarter> well - I meant just in general - can't you do the same in C/C++ without enums? |
04:34:05 | FromGitter | <zacharycarter> I'm not entirely sure - I just know there are implementations of this pattern in other languages |
04:34:10 | FromGitter | <zacharycarter> not sure how exactly they go about doing it |
04:36:36 | FromGitter | <rayman22201> In C/C++ it works pretty much the same way actually |
04:36:36 | FromGitter | <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:40 | FromGitter | <zacharycarter> ah okay |
04:36:49 | FromGitter | <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:55 | Araq | or look up "sum type" |
04:37:25 | FromGitter | <kaushalmodi> though, `headerVal` would be accessible *only if* `type` were `MarkdownTokenType.Header` |
04:37:27 | FromGitter | <kaushalmodi> correct? |
04:37:42 | FromGitter | <zacharycarter> interesting - had never heard of http://cyclone.thelanguage.org/ before |
04:38:18 | FromGitter | <rayman22201> @kaushalmodi yes. |
04:38:24 | FromGitter | <kaushalmodi> @zacharycarter, Araq: thanks! will read up. |
04:38:26 | FromGitter | <kaushalmodi> @rayman22201 thanks |
04:38:36 | FromGitter | <kaushalmodi> Araq: how does that nightly build look? |
04:39:03 | FromGitter | <zacharycarter> Araq: is region based memory management still a thing with Nim? |
04:39:28 | FromGitter | <rayman22201> Cyclone is cool, but it's a dead project if I remember correctly |
04:39:43 | Araq | yeah, it's still a thing but needs a blog post... |
04:39:44 | FromGitter | <zacharycarter> yeah it is - but I guess it inspired a lot of features in rust |
04:39:53 | FromGitter | <zacharycarter> http://cyclone.thelanguage.org/wiki/Memory%20Management%20Via%20Regions/ - might be useful |
04:40:03 | FromGitter | <zacharycarter> for those who aren't familiar with the concept in general |
04:40:06 | FromGitter | <zacharycarter> I'm reading it now |
04:40:36 | FromGitter | <rayman22201> Regions is awesome. It's also really awesome that Nim has it. It should be documented / blogged about! lol |
04:40:40 | FromGitter | <rayman22201> /is/are |
04:40:53 | FromGitter | <zacharycarter> maybe we can zombie some of this explanation from cyclone |
04:40:57 | FromGitter | <zacharycarter> to help noobs like me :) |
04:41:45 | FromGitter | <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:37 | FromGitter | <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:03 | FromGitter | <zacharycarter> yeah - I'm sure the implementation specifics arent' great |
04:43:14 | FromGitter | <zacharycarter> but this documentation from cyclone seems to do a very good job of explaining the concept at a high level |
04:43:45 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bcab281ef4afc4f28a0c616] |
04:46:37 | FromGitter | <rayman22201> yeah. not a bad explanation |
04:50:35 | FromGitter | <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:03 | FromGitter | <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:16 | FromGitter | <zacharycarter> that's sad :( losing pets is the worst |
04:58:37 | FromGitter | <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:49 | FromGitter | <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:02 | FromGitter | <zacharycarter> but when I stay with my parents for any period of time - we tend to warm up towards each other |
04:59:59 | FromGitter | <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:41 | FromGitter | <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:45 | FromGitter | <zacharycarter> lmao yeah |
05:02:07 | FromGitter | <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:28 | FromGitter | <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:53 | FromGitter | <zacharycarter> lots of blood and lots of holes from her beak :P |
05:03:05 | FromGitter | <zacharycarter> and I don't even want to think about getting bit by a macaw |
05:03:05 | FromGitter | <rayman22201> lol. bird life. I have many scars :-P |
05:03:11 | FromGitter | <zacharycarter> truth |
05:03:19 | FromGitter | <zacharycarter> I just have a tough time not wanting to punch the thing when getting bit |
05:03:27 | FromGitter | <zacharycarter> I never have - but trust me - the thought has crossed my mind plenty of times |
05:04:54 | FromGitter | <rayman22201> yeah... it takes a lot of self control. |
05:06:40 | FromGitter | <zacharycarter> yes - it takes more of it than dealing with a yippy dog |
05:06:43 | FromGitter | <zacharycarter> and that takes a lot lol |
05:06:52 | * | darithorn quit () |
05:07:30 | * | narimiran joined #nim |
05:07:38 | FromGitter | <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:57 | FromGitter | <zacharycarter> yeah - my parents are trying to pawn theirs off on someone - or at least they were recently |
05:08:20 | FromGitter | <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:41 | FromGitter | <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:58 | FromGitter | <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:15 | FromGitter | <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:21 | FromGitter | <zacharycarter> so I guess I'm the lucky one that gets the bird :P |
05:09:41 | FromGitter | <rayman22201> lol / sad at that same time |
05:09:50 | FromGitter | <zacharycarter> yeah |
05:10:35 | FromGitter | <rayman22201> this is totally offtopic, and I'm sorry for derailing the main channel lol |
05:10:39 | FromGitter | <zacharycarter> it's my fault lol |
05:11:10 | FromGitter | <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:12 | FromGitter | <zacharycarter> with birdspeak |
05:11:32 | FromGitter | <rayman22201> lol true |
05:14:14 | FromGitter | <zacharycarter> I'm going to try to do gamedev livestream w/ Nim on Sunday evening |
05:14:27 | FromGitter | <zacharycarter> hoping that once tomorrow is done with - I won't have any more house crap to do |
05:14:51 | FromGitter | <zacharycarter> and I've decided I'm going to focus this engine on building 3d RTS games with Nim |
05:14:54 | FromGitter | <kaushalmodi> so.. I don't use osx.. what's the nim binary named on osx? anyone knows? |
05:15:00 | FromGitter | <zacharycarter> nim |
05:15:13 | FromGitter | <kaushalmodi> hmm |
05:15:17 | FromGitter | <kaushalmodi> travis woes |
05:15:26 | FromGitter | <zacharycarter> does travis even have osx support? |
05:15:41 | FromGitter | <zacharycarter> or are you using a x-compile toolchain? |
05:15:43 | FromGitter | <zacharycarter> and linux? |
05:15:54 | FromGitter | <zacharycarter> but I mean - I don't even think that's possible |
05:15:55 | FromGitter | <kaushalmodi> `- if [[ ! -f "${NIMDIR}/bin/nim" ]]; then export DO_DEPLOY=yes; fi` behaves differently it seems linux vs osx |
05:16:04 | FromGitter | <zacharycarter> pretty sure you have to own apple hardware to compile on happle hardware |
05:16:19 | FromGitter | <kaushalmodi> no that's not the problem |
05:16:23 | FromGitter | <zacharycarter> gotcha |
05:16:35 | FromGitter | <zacharycarter> well - the shells might be different but I doubt that's it |
05:16:37 | FromGitter | <kaushalmodi> trying to understand why travis cache detection doesn't work on osx |
05:16:39 | FromGitter | <zacharycarter> what's the error you're getting? |
05:16:44 | FromGitter | <zacharycarter> hmm |
05:16:58 | FromGitter | <kaushalmodi> not an error.. unexpected redundant rebuilds |
05:17:06 | FromGitter | <zacharycarter> /Users/zachcarter/.nimble/bin/nim |
05:17:10 | FromGitter | <zacharycarter> is my nim directory |
05:17:15 | FromGitter | <zacharycarter> via choosenim |
05:17:16 | FromGitter | <kaushalmodi> I use above logic to check if that bin/nim file exists |
05:17:26 | FromGitter | <zacharycarter> or sorry - the path to my Nim executable |
05:17:34 | FromGitter | <kaushalmodi> if true, it means that I have nim built from prev build and travis cached it |
05:18:01 | FromGitter | <kaushalmodi> but on osx, it always rebuilds; doesn't detect the nim file from cache |
05:18:16 | FromGitter | <zacharycarter> yeah - I'm wondering if you're bash script isn't hosed |
05:18:23 | FromGitter | <zacharycarter> I'd refer to - https://stackoverflow.com/questions/592620/how-to-check-if-a-program-exists-from-a-bash-script |
05:18:28 | FromGitter | <kaushalmodi> hmm.. |
05:18:35 | FromGitter | <zacharycarter> there are differences b/w linux and osx |
05:18:36 | FromGitter | <kaushalmodi> yeah so now getting into debug of that |
05:18:59 | FromGitter | <kaushalmodi> I am just checking if a file exists |
05:19:12 | * | flaviu quit (Ping timeout: 252 seconds) |
05:19:12 | FromGitter | <kaushalmodi> next step.. do an ls on travis in that dir to see what exactly is there |
05:19:55 | FromGitter | <zacharycarter> I know - but what I'm getting at is - depending on the OS |
05:20:00 | FromGitter | <zacharycarter> how you check to see if a file exists in bash - can differ |
05:20:08 | FromGitter | <zacharycarter> there are portable ways to do it - and non-portable ways |
05:20:21 | FromGitter | <zacharycarter> I'd just make sure your method is portable |
05:21:06 | FromGitter | <kaushalmodi> got it |
05:22:27 | FromGitter | <kaushalmodi> looks like `-f` works on osx, now to check if it supports only posix `[ .. ]` vs bash `[[ .. ]]` |
05:22:38 | FromGitter | <kaushalmodi> https://superuser.com/a/289821/209371 |
05:26:17 | FromGitter | <zacharycarter> yeah - I hate all this crap |
05:26:22 | FromGitter | <zacharycarter> so annoying |
05:26:37 | FromGitter | <zacharycarter> give us a portable shell scripting language already damnit |
05:28:35 | * | flaviu joined #nim |
05:42:11 | FromGitter | <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:11 | FromGitter | ... parser? |
05:43:35 | FromGitter | <rayman22201> let me rephrase that. I think I should go back to the rst parser approach. |
05:44:02 | FromGitter | <rayman22201> jsondoc seems kind of orphaned actually |
05:46:11 | FromGitter | <rayman22201> The other option is to maybe expand jsondoc to provide more data similar to ctags? proc parameters for example... |
05:46:47 | FromGitter | <rayman22201> Though it seems like the compiler api / nimsuggest is a better / more dynamic solution that. |
05:47:52 | FromGitter | <rayman22201> :thinking: maybe I need to take this to github lol |
05:59:01 | * | Trustable joined #nim |
05:59:17 | FromGitter | <rayman22201> signing off. goodnight! |
06:05:10 | * | kapil____ joined #nim |
06:12:36 | Summertime | is there any precautions I should take if I want to distribute binaries I've made with nim? |
06:16:02 | stefanos82 | the same precautions you would take when distributing binaries that got generated with C or C++ code |
06:17:18 | Summertime | I don't know those completely, but I'm guessing from googling that the word "static" is the important thing |
06:27:03 | leorize | just make sure that your binaries work |
06:27:25 | leorize | and that you didn't statically linked anything that might conflict with your binary license |
06:32:20 | Summertime | oof |
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:54 | Summertime | well this non-static executable runs on fedora and debian so thats good enough for me, rest can be damned |
07:00:21 | Summertime | (well, damned to just install it via nimble instead or something) |
07:00:39 | Perkol | Is 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:12 | Summertime | if 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:10 | FromGitter | <mratsim> @perkol for runtime CPU detection you can use my lib: https://github.com/numforge/laser/blob/master/laser/cpuinfo.nim |
10:48:54 | FromGitter | <mratsim> it’s still a bit raw as I’ve started on it only last weekend |
10:51:40 | FromGitter | <mratsim> otherwise `when sizeof(int) == 4` is a good way to detect 32-bit arch |
11:15:09 | * | anamok joined #nim |
11:15:13 | anamok | hi |
11:16:11 | anamok | I 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:23 | anamok | I 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:46 | anamok | Can someone show me a sample `.travis.yml` file for Nim? |
11:18:52 | Summertime | https://github.com/nim-lang/Nim/wiki/TravisCI ! |
11:19:32 | Summertime | the line: - nim c --cc:$CC --verbosity:0 -r MYFILE.nim |
11:20:00 | Summertime | would be replaced with... |
11:20:21 | Summertime | - nimble test --cc:$CC --verbosity:0 |
11:26:17 | FromGitter | <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:31 | FromGitter | <mratsim> including external dependencies installation |
11:27:44 | FromGitter | <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:58 | anamok | I'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:47 | FromGitter | <mratsim> @anamok, I’ve update the wiki: https://github.com/nim-lang/Nim/wiki/BuildServices |
11:41:05 | FromGitter | <mratsim> This is the simplest way: https://github.com/nim-lang/Nim/wiki/BuildServices#using-docker |
11:42:54 | FromGitter | <mratsim> 5900 stars btw! |
11:45:33 | * | kapil____ joined #nim |
11:46:26 | anamok | Thanks guys! The dockerized version worked like a charm. |
11:48:49 | Summertime | oh geez that looks a lot better |
12:01:20 | * | Snircle joined #nim |
12:01:34 | FromGitter | <mratsim> Cool, I didn’t test it, and just wrote it ont he fly :P |
12:25:16 | enthus1ast | guys i finished the demo of a windows service, any suggestions? https://github.com/enthus1ast/nimWindowsService/ |
12:27:22 | enthus1ast | one 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:33 | Summertime | the 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:42 | FromGitter | <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:47 | Summertime | if 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:46 | Summertime | only problem is exec in nimscript doesn't return anything :( |
12:48:18 | Summertime | ah, but if exec returns non-zero, it'll halt, so it should work ok enough! |
12:48:24 | Summertime | https://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:00 | anamok | mratsim: 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:45 | anamok | It would test the runnableExamples too. |
12:59:07 | FromGitter | <mratsim> maybe that should be part of a full Travis with build artifacts that update the gh-pages branch ;) |
13:00:44 | anamok | Here 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:07 | anamok | "*.nim" should be '*.nim' |
13:01:38 | anamok | This docker solution is good for testing libraries. |
13:03:11 | anamok | mratsim: it can be a comment too. If someone needs it, (s)he switches it on |
13:04:06 | FromGitter | <mratsim> feel free, it’s a wiki ;) |
13:11:55 | anamok | mratsim: 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:12 | FromGitter | <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:49 | FromGitter | <kaushalmodi> One thing I plan to improve is replace the double quotes long string with YAML multiline `- |` string |
13:28:15 | FromGitter | <kaushalmodi> But I have copy pasted that to few Nim repos and it just works. |
13:37:37 | anamok | thanks |
13:53:21 | * | eleos joined #nim |
13:53:48 | * | TheLemonMan joined #nim |
13:59:24 | TheLemonMan | enthus1ast, you can write a macro to wrap the main procedure for you |
13:59:58 | TheLemonMan | and then have the user write something like `proc myMain(...) {.service.}` |
14:04:59 | anamok | How does "nim doc --docSeeSrcUrl" work? Do you have a working example? |
14:36:21 | * | eleos quit (Ping timeout: 256 seconds) |
14:43:38 | enthus1ast | do 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:47 | anamok | I 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:08 | enthus1ast | to annotate the proc with a pragma would indeed be nice |
14:46:46 | TheLemonMan | yeah, that's IMO the nicest way to do this kind of stuff |
14:56:16 | * | Vladar quit (Remote host closed the connection) |
15:01:30 | FromGitter | <mratsim> Pragmas, pragmas everywhere |
15:15:51 | narimiran | @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:50 | FromGitter | <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:13 | FromGitter | <mratsim> done |
15:58:48 | FromGitter | <alehander42> this opening is bad |
15:58:58 | FromGitter | <alehander42> ops sorry |
16:01:24 | * | vivus joined #nim |
16:02:22 | vivus | does anybody use cligen? how do I make a proc parameter not required? |
16:02:46 | FromGitter | <kaushalmodi> assign it a default value |
16:03:14 | FromGitter | <kaushalmodi> `proc foo(required: string; optional = true) =` |
16:04:08 | * | enthus1ast quit (Ping timeout: 276 seconds) |
16:05:03 | FromGitter | <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:30 | vivus | ty I assigned 0 to it |
16:20:57 | * | darithorn joined #nim |
16:29:40 | FromDiscord | <smitop> how can I have nimble use HTTPS to clone packages, instead of ssh |
16:33:33 | * | Trustable joined #nim |
16:42:36 | anamok | bye |
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:49 | federico3 | smitop: if you are passing an URL explicitely it will detect it |
17:58:58 | federico3 | otherwise look at cloneUsingHttps in the options |
17:59:34 | federico3 | https://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:59 | FromGitter | <yyyc514> anyway to unquote something passed to a template? |
19:10:05 | FromGitter | <yyyc514> i have “blah” but i need ‘blah’ (unquoted) |
19:11:39 | FromGitter | <yyyc514> ok what was that html templating lib someone showed me the other day? |
19:12:46 | FromGitter | <alehander42> you need the identifier? |
19:12:50 | FromGitter | <yyyc514> yes |
19:13:03 | FromGitter | <yyyc514> is that possible? |
19:13:08 | FromGitter | <alehander42> ident("blah") |
19:14:38 | FromGitter | <yyyc514> how? this is a template |
19:15:04 | FromGitter | <yyyc514> i’m trying to get obj.field |
19:15:07 | FromGitter | <alehander42> well, then use a macro |
19:15:11 | FromGitter | <yyyc514> haha |
19:15:26 | FromGitter | <alehander42> obj.field |
19:15:34 | FromGitter | <alehander42> can you give some context |
19:15:37 | FromGitter | <yyyc514> it works if i pass it unquoted |
19:15:49 | FromGitter | <yyyc514> working on form_for and textarea helpers |
19:15:59 | FromGitter | <yyyc514> stuff is not as simple as in ruby :) |
19:16:46 | FromGitter | <alehander42> I find it relatively similar |
19:16:59 | FromGitter | <alehander42> but it does require some time probably |
19:17:09 | FromGitter | <alehander42> i write macros all the time >1 year |
19:17:12 | FromGitter | <yyyc514> well in ruby form_for would yield a block to encapsulate the scope of the object |
19:17:29 | FromGitter | <yyyc514> i guess i could do that manualy in the macro |
19:17:30 | FromGitter | <alehander42> let me see how it works there |
19:18:06 | FromGitter | <yyyc514> <%= form_for(@post) do |f| %> <%= f.textarea :body %> etc |
19:19:06 | FromGitter | <alehander42> I see, and textarea etc are builtin methods which return html ? |
19:19:47 | FromGitter | <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:58 | FromGitter | <yyyc514> trying to think of a nim way of doing this stuff without just trying to copy ruby semantics |
19:22:24 | FromGitter | <yyyc514> cause you could probably get really far with macros and a smart template parser :) |
19:22:39 | FromGitter | <alehander42> ```form_for(post) do (f): ⏎ f.textarea(post.body)``` [https://gitter.im/nim-lang/Nim?at=5bcb807f435c2a518edaa0c5] |
19:22:55 | FromGitter | <alehander42> can't you just have a function form_for which takes a model instance and a lambda |
19:23:47 | FromGitter | <yyyc514> well what would the lamba signature look like? wouldn’t you have to use typeinfo or something annoying? |
19:24:31 | FromGitter | <yyyc514> what is your paste? possible syntax that’d work with a macro? |
19:25:13 | FromGitter | <alehander42> proc form_forM (modelInstance: M, formHandler: FormBuilder[M]): YourHTMLType |
19:25:19 | FromGitter | <alehander42> `proc form_forM (modelInstance: M, formHandler: FormBuilder[M]): YourHTMLType` |
19:25:33 | FromGitter | <alehander42> no, I think it should work with just a proc def |
19:25:36 | FromGitter | <yyyc514> but it could be any type of model |
19:25:38 | FromGitter | <yyyc514> it’s generic |
19:25:38 | FromGitter | <alehander42> Nim does support a do notation |
19:25:41 | FromGitter | <alehander42> exactly |
19:25:48 | FromGitter | <alehander42> well yeah |
19:25:59 | FromGitter | <alehander42> you can still use a macro internally |
19:26:08 | FromGitter | <alehander42> or just type the macro this way |
19:27:09 | FromGitter | <yyyc514> i haven’t used T with procs yet so i don’t know it’s limitations and such |
19:27:22 | FromGitter | <yyyc514> is that what you meant above vs M ? |
19:27:31 | FromGitter | <yyyc514> or does the letter really not matteR? lol |
19:28:46 | FromGitter | <alehander42> techincally I think you might be able to do it |
19:28:48 | FromGitter | <alehander42> in a proc |
19:28:51 | FromGitter | <alehander42> using fieldPairs |
19:29:04 | FromGitter | <alehander42> https://nim-lang.org/docs/system.html |
19:29:08 | FromGitter | <alehander42> (ctrl+f fieldPair) |
19:29:40 | FromGitter | <yyyc514> yeah don’t worry i can look stuff up in the docs :) |
19:29:46 | FromGitter | <alehander42> yes, T / M is just a generic type |
19:29:59 | FromGitter | <alehander42> it doesn't matter the name of course |
19:30:17 | FromGitter | <alehander42> you can have `name[K, V, T]` |
19:30:27 | FromGitter | <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:05 | FromGitter | <alehander42> well it's a closure, so it should be able to access the variables from the defining scope |
19:32:14 | FromGitter | <alehander42> at least I think it must be a closure |
19:32:39 | FromGitter | <alehander42> btw have you thought of a default orm |
19:32:49 | FromGitter | <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:18 | FromGitter | <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:08 | FromGitter | <yyyc514> i guess i’m tryign to imagine how this would work (at all) with “raw” nim, not tons of crazy macros :) |
19:35:37 | FromGitter | <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:50 | FromGitter | <yyyc514> vs like building a ruby VM with macros :) |
19:35:59 | * | kobi7 joined #nim |
19:36:05 | FromGitter | <yyyc514> ie the router just spits out a ton of ifs and dispatches to controlelr |
19:36:49 | FromGitter | <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:45 | FromGitter | <yyyc514> (https://files.gitter.im/nim-lang/Nim/KCjB/Screen-Shot-2018-10-20-at-3.37.30-PM.png) |
19:37:50 | FromGitter | <yyyc514> so far i have, whihc isn’t completely terrible |
19:38:49 | FromGitter | <yyyc514> but also isn’t very magical :) |
19:40:38 | Calinou | I 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:48 | Calinou | I'd gain native Windows support this way (other than in the WSL, that is) |
19:49:23 | * | kobi7 quit (Quit: Leaving) |
19:52:36 | FromGitter | <zetashift> WHat's stopping you from not rewriting it in Nim? |
19:58:28 | FromGitter | <yyyc514> ugh Error: internal error: getTypeDescAux(tyExpr) |
20:00:20 | * | nsf quit (Quit: WeeChat 2.2) |
20:01:50 | FromGitter | <yyyc514> ok fot the proc version compiling :) |
20:16:18 | FromGitter | <yyyc514> @alehander42 ha the block runs before the content from it’s actual call is added |
20:16:27 | FromGitter | <yyyc514> which makes sense |
20:16:44 | FromGitter | <yyyc514> but means you can’t just output to the buffer inside your proc |
20:20:24 | FromGitter | <yyyc514> n/m |
20:20:34 | FromGitter | <yyyc514> you can let scoping solve that for you |
20:21:31 | FromGitter | <yyyc514> (https://files.gitter.im/nim-lang/Nim/dFEs/Screen-Shot-2018-10-20-at-4.21.16-PM.png) |
20:21:35 | FromGitter | <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:34 | FromGitter | <yyyc514> ok now i need dynamic access to a field |
21:09:44 | FromGitter | <yyyc514> var x = “field_name”; obj[x] |
21:19:43 | * | narimiran quit (Ping timeout: 246 seconds) |
21:20:32 | FromGitter | <Quelklef> Can anyone help me out with a weird bug with a generic template? |
21:20:32 | FromGitter | <Quelklef> https://pastebin.com/raw/v8ekecu7 |
21:22:24 | FromGitter | <Quelklef> Sorry, `line(17)` is wrong. The error points to `Option[T]` in `var res: Option[T]` |
21:30:03 | FromGitter | <yyyc514> can i not pass a literal variable to a macro? |
21:31:15 | FromGitter | <Quelklef> You can |
21:31:24 | FromGitter | <yyyc514> how? |
21:31:31 | FromGitter | <Quelklef> give the parameter a type |
21:31:38 | FromGitter | <yyyc514> macro `@`M (obj: ref M, field_name: string) : untyped = |
21:31:41 | FromGitter | <yyyc514> grrr |
21:31:52 | FromGitter | <yyyc514> type string, yes? |
21:32:07 | FromGitter | <yyyc514> ```result.add (fh.model@field)``` |
21:32:12 | FromGitter | <yyyc514> but “field” is passed |
21:32:15 | FromGitter | <yyyc514> not the VALUE of field |
21:32:19 | FromGitter | <yyyc514> proc textarea*M (fh: FormHelper[M], field: string{lit}) : string = |
21:32:33 | FromGitter | <yyyc514> field is a string literal |
21:38:07 | FromGitter | <yyyc514> am i missing something? @Quelklef |
21:44:12 | FromGitter | <Quelklef> oh tru |
21:44:14 | FromGitter | <Quelklef> try* |
21:44:17 | FromGitter | <Quelklef> `static[string]` |
21:45:33 | FromGitter | <yyyc514> yeah i was just playing with that, that’s a lot closer |
21:46:12 | FromGitter | <yyyc514> now i just need to turn StrLit back into a symbol |
21:47:39 | FromGitter | <yyyc514> ok ident works but how could i get a Sym? |
21:53:07 | FromGitter | <yyyc514> gree hate it when astGenRepr gives you invalid stuff |
21:53:09 | FromGitter | <yyyc514> there is no newSymNode |
21:59:52 | FromGitter | <yyyc514> what is the deal with sym nodes? |
22:05:40 | krux02 | bindSym |
22:06:06 | FromGitter | <yyyc514> ../../lib/view.nim(35, 23) Error: cannot evaluate at compile time: field_name |
22:06:28 | krux02 | bindSym generates a symChoice (all symbols with the same name) |
22:08:50 | FromGitter | <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:48 | krux02 | identifiers are just names like you type them into the editor the compiler still has to figure out what they actually refer to |
22:19:08 | krux02 | a symbol has one exact meaning |
22:19:13 | krux02 | a symbol has a type |
22:19:19 | FromGitter | <yyyc514> so when I see a SymNode it’s already been bound |
22:19:19 | krux02 | and it has an implementation |
22:19:25 | krux02 | yes |
22:19:46 | FromGitter | <yyyc514> (https://files.gitter.im/nim-lang/Nim/ltrD/Screen-Shot-2018-10-20-at-6.19.35-PM.png) |
22:19:49 | FromGitter | <yyyc514> is it possible for do syntax to be less verbose? |
22:20:24 | * | elrood quit (Quit: Leaving) |
22:20:37 | krux02 | yes, you can not use the do notation |
22:21:14 | krux02 | but I don't know what the form_for does |
22:21:26 | krux02 | so I can't really help you there |
22:21:34 | FromGitter | <yyyc514> generates an HTML form :) |
22:21:42 | krux02 | but the do notation is just one way to pass a function |
22:21:49 | FromGitter | <yyyc514> is do purely syntactic sugar for passing another param? |
22:22:01 | krux02 | there is also the `->` notation in sugar |
22:24:38 | FromGitter | <yyyc514> i actually want to refer to f inside the block though |
22:24:43 | FromGitter | <yyyc514> is that possible without the do notation? |
22:29:04 | krux02 | do you use a macro? |
22:29:42 | FromGitter | <yyyc514> deep inside, but these are just procs |
22:30:36 | FromGitter | <yyyc514> i’m just wondering if there is some less verbose/more beautiful way to do this without resulting to insane macros :) |
22:31:02 | FromGitter | <yyyc514> so far most of this is pure nim |
22:32:57 | krux02 | There 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:18 | krux02 | you should post some code that I can execute on my local machine in not image form |
22:34:08 | FromGitter | <yyyc514> maybe if i can figure out what all i’d have to bundle up |
22:34:12 | krux02 | I don't know what a FormHelper is nor do I know what a Paste is |
22:34:16 | FromGitter | <yyyc514> it’s jst HTML generation |
22:34:24 | FromGitter | <yyyc514> Paste is just an object |
22:34:41 | krux02 | why does it matter? |
22:34:43 | FromGitter | <yyyc514> (https://files.gitter.im/nim-lang/Nim/dxBP/Screen-Shot-2018-10-20-at-6.34.29-PM.png) |
22:34:51 | FromGitter | <yyyc514> that is the output |
22:35:01 | FromGitter | <yyyc514> why does what matter? |
22:35:46 | FromGitter | <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:00 | FromGitter | <yyyc514> without having to repeat yourself |
22:36:46 | FromGitter | <yyyc514> so instead of textarea(person, first_name) textarea(person, last_name) etc.. you can just write `f.textarea “first_name”` |
22:36:50 | krux02 | well I still can't copy paste that image, but it is only the output, so it's ok |
22:37:11 | krux02 | but when you want to generate such an output, I recommend to take a look at some serializers |
22:37:41 | krux02 | nim has a templating engine to generate code such as html |
22:38:06 | krux02 | and there are serializers. I think this code can be generated with a serializer. |
22:38:07 | FromGitter | <yyyc514> you mean stdtmpl stuff? |
22:38:31 | FromGitter | <yyyc514> i’m not sure i want a serializing, i’m writing a templating system |
22:38:41 | FromGitter | <yyyc514> the user decides how the form should be output |
22:38:43 | FromGitter | <yyyc514> i’m just writing helpers |
22:39:19 | FromGitter | <yyyc514> but you could link me to the serializer stuff and i’d take a quick look |
22:40:18 | krux02 | first 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:40 | FromGitter | <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:54 | FromGitter | <yyyc514> so you’d be adding form_for, etc on TOP of emerald |
22:41:57 | krux02 | with 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:00 | FromGitter | <yyyc514> but i still have to make it work |
22:42:15 | FromGitter | <yyyc514> and personalyl (for me) i dislike writing HTML that way |
22:42:17 | FromGitter | <alehander42> I think emerald is similar to karax , they're both code DSL-s with different syntax choices |
22:42:20 | FromGitter | <yyyc514> in ruby world it’s kind of religious |
22:42:23 | krux02 | waht is form_for supposed to do? |
22:42:27 | FromGitter | <yyyc514> HAML (that type of syntax) vs HTML |
22:42:34 | FromGitter | <yyyc514> outputs a HTML form |
22:42:34 | FromGitter | <alehander42> but honestly I think for your `<%= .. %>` style of template |
22:42:45 | FromGitter | <yyyc514> yeah <%= %> is the goal :) |
22:42:47 | FromGitter | <alehander42> it's just easier to half-parse a document |
22:42:55 | FromGitter | <yyyc514> that’s just icing though |
22:42:59 | FromGitter | <yyyc514> i still have to have the actual code working |
22:43:01 | FromGitter | <alehander42> and generate internally the code |
22:43:10 | FromGitter | <yyyc514> then you have a function that reads a template and spits out the uglier version |
22:43:20 | FromGitter | <alehander42> the code filter stuff is good for some things, but I don't think it's great for this |
22:43:21 | FromGitter | <yyyc514> i’m just writing the uglier version first |
22:43:27 | FromGitter | <yyyc514> yeah i started with code filter, ugh |
22:43:33 | FromGitter | <yyyc514> not powerful enough |
22:43:41 | FromGitter | <yyyc514> no way to have custom helpers that take blocks |
22:43:44 | FromGitter | <yyyc514> (for one) |
22:44:13 | FromGitter | <yyyc514> right now i’m trying to shorten `(form_forPaste (paste, action = "/pastes/") do (f: FormHelper[Paste]) -> string:` |
22:44:39 | FromGitter | <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:26 | FromGitter | <yyyc514> i supose you could just write the name though |
22:45:32 | FromGitter | <yyyc514> FormForHelper :-) |
22:46:28 | FromGitter | <yyyc514> so your template is just `<%= for_forPaste (paste) do |f| %> |
22:47:03 | krux02 | Well I am out, I can't really help. Good night |
22:47:06 | FromGitter | <yyyc514> thanks |
22:47:13 | krux02 | np |
22:48:13 | FromGitter | <alehander42> you shoudln't need form_forPaste (paste) |
22:48:24 | FromGitter | <alehander42> `form_for[Paste](pa..` |
22:48:30 | FromGitter | <alehander42> when you call a generic function |
22:48:38 | FromGitter | <alehander42> you don't need to pass the geneeric arg, it's inferred |
22:48:45 | FromGitter | <alehander42> so just `form_for(paste..` |
22:49:01 | FromGitter | <yyyc514> well hot dog :) |
22:49:07 | FromGitter | <yyyc514> i shuld have known that |
22:49:14 | FromGitter | <yyyc514> so now just the do syntax is ugly :) |
23:09:19 | FromGitter | <yyyc514> @alehander42 i still have to include tpes for the dos though, right? |
23:09:30 | Calinou | @zetashift I just don't know if it's overkill for a ~50 line script :) |
23:10:16 | FromGitter | <zetashift> But it'll be FUN! I hope... |
23:10:25 | Calinou | I 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:44 | FromGitter | <yyyc514> is there anyway of just telling nim “compile this AST right here” without wrapping it in a macro? |