<FromGitter>
<jrei:matrix.org> sounds like keep-alive is supported
<raz>
doh!
<FromGitter>
<Blacksmoke16> rip
<raz>
did that land in 0.35.1?
* raz
rejoices
<raz>
when i looked it wasn't there yet, but maybe that was back in the 0.34 days
<raz>
ah, or maybe it was just about "transparent re-use" (looks like you still have to keep a client-per-server around)
<oprypin>
raz, i chose Halite
<raz>
yup, i just switched to it, too. for a pretty mundane reason tho. it supports namedtuple as args, which is shorter to type than crest (which requires hash) :p
<FromGitter>
<Blacksmoke16> :rolls_eyes:
<raz>
hey with athena in the mix i gotta save on keystrokes elsewhere πββοΈ
<FromGitter>
<watzon> As long as speed isn't a concern, Halite is wonderful
<raz>
yup nothing too intense here
<raz>
for high freq api calls i'd go with the stdlib http client
<FromGitter>
<watzon> Yeah that's what I ended up having to switch to for my Telegram bot API library. It has to be able to handle hundreds or even thousands of concurrent requests, and I just wasn't able to get good response times out of Halite.
<raz>
might be the lack of keepalive we just talked about :D
<FromGitter>
<watzon> Possible, though I'm not using keepalive (intentionally anyway) and made my client before it existed in the standard library
<FromGitter>
<watzon> Really wish we had nightly releases for Crystal
<FromGitter>
<watzon> Or at least weekly
<oprypin>
watzon, what do you want from those releases
<FromGitter>
<Blacksmoke16> There is a nighly release, docker and snap
<oprypin>
and like, if u dont have a local setup to just compile it for yourself, just what..
<FromGitter>
<watzon> @oprypin just the ability to test changes on master without having to compile it myself locally. It's turning out to be kind of a pain in the ass building Crystal on my mac.
<oprypin>
:o
<FromGitter>
<Blacksmoke16> Oh?
<FromGitter>
<watzon> Just would be a nice to have. Lots of languages do nightly releases.
<FromGitter>
<Blacksmoke16> `make clean && make`
<oprypin>
probably machine too weak?
<oprypin>
cc @Daniel-Worrall
<FromGitter>
<watzon> Pretty sure I actually know the problem I was having before. It was likely just do to a conflict between the xcode version of cmake and the llvm version.
<FromGitter>
<Daniel-Worrall> ohai
<FromGitter>
<watzon> My mac is plenty powerful though haha
<oprypin>
Daniel-Worrall, did u find anything about nightly releases
<FromGitter>
<Daniel-Worrall> I didn't even look yet
<oprypin>
:s
<FromGitter>
<Daniel-Worrall> I'm very easily distracted owo
<lunarkitty7>
Hey, this is heresy to ask :p but how is crystal vs nim these days?
<oprypin>
lunarkitty7, nim probably more serious and crystal probably more pleasant to use
<lunarkitty7>
nim seems like a more ruby-esque compiled python, and crystal seems like ruby compiled, with less metaprogramming
<lunarkitty7>
hmm
<oprypin>
lunarkitty7, you're making way too many conclusions from syntax
<FromGitter>
<watzon> I still prefer Crystal in most cases, but the occasional compiler bug still rears its ugly head and makes me hate life
<FromGitter>
<watzon> Nim is great though
<oprypin>
nim is absolutely nothing like python
<lunarkitty7>
yeah I could see how it's totally different
<lunarkitty7>
even just looking at the attitude about lambdas and functional
<oprypin>
lunarkitty7, anyway if you're gonna be comparing, Crystal is much closer to both Ruby and Python than Nim is
<lunarkitty7>
interesting
<lunarkitty7>
Of the two I've really only used crystal and not nim, been thinking about messing with nim a bit too
<FromGitter>
<Daniel-Worrall> I've used and liked crecto recently
<FromGitter>
<erdnaxeli:cervoi.se> I would like something that helps me to write SQLΒ queries (like the Jennifer query builder), but without the ORMΒ part
psydroid has quit [Quit: Bridge terminating on SIGTERM]
fifr[m] has quit [Quit: Bridge terminating on SIGTERM]
woodruffw has quit [Ping timeout: 246 seconds]
woodruffw has joined #crystal-lang
psydroid has joined #crystal-lang
<hightower3>
Eh regarding my question from yesterday about having to do (x & 1) != 0 to test... I realized the ~ operator exists, so possibly easier to write: if ~(x & 1)
<hightower3>
or rather, n/m, not applicable here
<hightower3>
ehm, how do I force treating the ivar as Int in this case: https://carc.in/#/r/a85p
fifr[m] has joined #crystal-lang
deavmi has quit [Quit: No Ping reply in 180 seconds.]
<hightower3>
so far used: x = x.as(Int) + 2 instead of +=
deavmi has joined #crystal-lang
<FromGitter>
<HertzDevil> `x.x = x.x.as(Int) + 2`
deavmi has quit [Ping timeout: 246 seconds]
deavmi has joined #crystal-lang
<hightower3>
right, thanks
<hightower3>
Btw, was it in Crystal or Ruby that I read method arguments can have aliases?
<hightower3>
ooh, crystal... pretty funky, was almost sure it wasn't
deavmi has quit [Quit: Eish! Load shedding.]
<raz>
yup, that looks like a recipe for self-confusion
<raz>
i'd prob constantly misread those aliases as extra args
<raz>
the idea is neat tho
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 256 seconds]
deavmi has joined #crystal-lang
Volk has joined #crystal-lang
Stephie has quit [Quit: Fuck this shit, I'm out!]
Stephie has joined #crystal-lang
hightower3 has quit [Ping timeout: 240 seconds]
<FromGitter>
<HertzDevil> when a one-commit pr is merged does it automatically grab the message of the sole commit instead of the pr title
<FromGitter>
<sam0x17> how's 1.0 coming? haven't checked in in a good while
<FromGitter>
<HertzDevil> and does the change log choose the commit msg or the pr title in that case
<FromGitter>
<Blacksmoke16> the changelog is a manual thing
<FromGitter>
<weirdbricks> +1 on the question about 1.0 @sam0x17 . I would like to make a pitch to use it in projects and getting to 1.0 will help towards that
hmmm has joined #crystal-lang
<FromGitter>
<watzon> Just realized Kemal isn't using the standard Log module. Sad.
<FromGitter>
<Blacksmoke16> kemal hasn't really had any feature dev done in quite some time
<FromGitter>
<jrei:matrix.org> Yes, people have to move on, and use something else now
<FromGitter>
<jrei:matrix.org> Therea plenty of modern alternatives now
<straight-shoota>
Kemal is still working very well
<straight-shoota>
it doesn't need new features for the sake of it.
<straight-shoota>
updating to new log module would be nice, of course
hightower2 has joined #crystal-lang
<FromGitter>
<watzon> @jrei:matrix.org what lightweight alternatives do you know of?
<FromGitter>
<watzon> The main thing I tend to use kemal for is really small, lightweight projects. I need something else Sinatra-esque
<FromGitter>
<Blacksmoke16> coughathenacough π
<raz>
:p
<raz>
can confirm athena is reasonably lightweight (unless you get into fancy stuff)
<raz>
that doesn't show the cool part tho, param validation!
<FromGitter>
<Blacksmoke16> now you're getting into the fancy stuff π
<raz>
heh
<FromGitter>
<watzon> Lol Athena might actually work well. Is there any built in view support yet?
<FromGitter>
<Blacksmoke16> like to return html?
<FromGitter>
<watzon> Yessir. Specifically from .ecr files ideally.
<FromGitter>
<watzon> Or any other template engine
<raz>
hurm, not sure i'd recommend athena for html. if you want html you'll also want forms, cookies, CSRF and a billion other things soon :|
<raz>
(imho there is no lightweight when html gets involved, unless you just want to serve static files, but then you don't need an appserver to begin with π€·ββοΈ)
<FromGitter>
<watzon> That's the thing, I need a lightweight framework that's got some focus on front end. I know Athena is great for API stuff.
<FromGitter>
<Blacksmoke16> er sorry, the one before that
<FromGitter>
<watzon> That should do it
<FromGitter>
<Blacksmoke16> to raz's point, HTML is deff not a first class citizen yet
<raz>
yeh, i've recently discarded the idea of HTML altogether and joined the cool kids with vue
<FromGitter>
<Blacksmoke16> at least the like Lucky's level, but should suffice on a kemal level
<FromGitter>
<watzon> That's fine for now. I just need something simple at the moment.
<FromGitter>
<Blacksmoke16> π
<FromGitter>
<Blacksmoke16> the tools are there to be able to expand it (esp with some in progress work), just not a lot built in by default atm other than those two render macros
<FromGitter>
<Blacksmoke16> happy to chat thru anything if you have any questions/issues
<FromGitter>
<jrei:matrix.org> @Blacksmoke16: I won't call Athena lightweight and simple. More a full-featured framework
<FromGitter>
<watzon> Everything was working fine one second, then I had to forcefully close a process that wasn't responding to a SIGINT and now it's telling me that libssl isn't installed.
<FromGitter>
<jrei:matrix.org> Kemal is simple on the implementation and use, and don't have much concepts vs Athena
<FromGitter>
<Blacksmoke16> cant be both? There are a lot of concepts but you dont need to know/use them all to get started
<FromGitter>
<Blacksmoke16> but they're there when you do
<FromGitter>
<jrei:matrix.org> @watzon: I know Grip and Gripen
<FromGitter>
<jrei:matrix.org> @Blacksmoke16: I mean, just compare de code base. Kemal as less features but is smaller
<FromGitter>
<Blacksmoke16> so?
<FromGitter>
<Blacksmoke16> better to start off with something more robust than rewriting everything later when you outgrow it
<FromGitter>
<jrei:matrix.org> So, @watzon seek a light library for a simple app, or I guess an app not needing loads of things from a router
<FromGitter>
<watzon> Well apparently one of the things I did worked. I think I might have screwed things up earlier when I edited my .zshrc file and just didn't notice till now because I hadn't closed that terminal window.
<FromGitter>
<Blacksmoke16> that would do it
Volk has quit [Quit: See you next time!]
<FromGitter>
<watzon> Unfortunately seems like Grip is fairly API focused as well
<FromGitter>
<watzon> Meh I'm already using Granite, may as well use Amber as well
<FromGitter>
<Blacksmoke16> boo
<FromGitter>
<Blacksmoke16> missing out :p
<FromGitter>
<watzon> Well I'd use Athena, but for some reason it's not exiting on SIGINT. Any idea why?
<FromGitter>
<Blacksmoke16> so not sure why that wouldnt work
<FromGitter>
<watzon> Hmm seems like it is actually my fault. I've got 2 futures that I'm waiting on, the one with Athena running and one with Tourmaline running. Athena definitely dies on SIGINT, but the Tourmaline one keeps running I guess. It's just weird that this didn't happen with Grip or Kemal.
<FromGitter>
<Blacksmoke16> does Tourmaline also trap that signal?
hmmm has quit [Quit: WeeChat 3.0]
<FromGitter>
<watzon> Nope, I should probably add that though
<FromGitter>
<Blacksmoke16> π that would prob do it
<FromGitter>
<watzon> Actually apparently I do trap the signal, but I'm not stopping the polling task
<FromGitter>
<watzon> Let's see if this fixes it
<FromGitter>
<Blacksmoke16> any luck?
<FromGitter>
<watzon> It's working, but also not. For some reason Athena isn't actually stopping. I'll show you what I'm doing and what's happening.
<FromGitter>
<Blacksmoke16> π
_ht has quit [Remote host closed the connection]
<FromGitter>
<watzon> So I'm running this β β ```code paste, see link``` β β where LucyBot is my Tourmaline bot and I have a very basic Athena controller. When I press Ctrl+c I end up getting "bot done", but never "server done" which means that something is stopping Athena from actually exiting. [https://gitter.im/crystal-lang/crystal?at=5ff62aaf5562a61e9a8cd9b8]
aquijoule_ has quit [Remote host closed the connection]
<FromGitter>
<watzon> The futures themselves are basically just spawns and the `Future.all` just uses a channel to make sure all the futures exit. This same code worked fine with Kemal and Grip though, which is why I think something may be keeping Athena from exiting fully.
<FromGitter>
<Blacksmoke16> maybe i need an `exit` like it has? But i would have thought just stopping the server would be enough as it would just stop/exit on its own
<FromGitter>
<Blacksmoke16> could try adding that in `lib/athena/athena.cr` and see if that helps?
<raz>
what if i have multiple athenas and want to stop only one of them?
<raz>
not sure why someone would wanna do that but...
<FromGitter>
<Blacksmoke16> fwiw, theres some nodoced stuff that would help with that
<FromGitter>
<watzon> For real though. The docs aren't terrible looking, but they're not great either.
<raz>
what's wrong with the styling?
* raz
likes the docs
<raz>
just the search jumps around a bit funky sometimes
<oprypin>
im talking about the [View source] link in particular, it's just too prominent and repetitive
<oprypin>
also becase i cant come up with anything better myself
<FromGitter>
<Blacksmoke16> > Adding exit to athena didn't work. I'll let you know if I figure anything out though. β β π, ill play around with trying to ctrl+c and stuff as well
<raz>
imho that link is fine. nice and big unambiguous click target
<raz>
guess it could be made less prominent, but visually i think it actually helps to have it as a divider between the methods
<straight-shoota>
+1 to that^
<raz>
my fav api-docs used to be javadoc with the 3-pane frame layout. but at some point they screwed it up somehow, with tiny fonts and it feels just overcrowded now
<FromGitter>
<Blacksmoke16> you see the beta athena api docs yet raz?
<raz>
a little eplash of color could make that easier, as one option
<lunarkitty7>
are you guys actually going to change the docs or just talking about possible changes? I'd actually be pretty interested in taking a crack at it myself or helping
<FromGitter>
<watzon> I'd love to have the option to choose a theme with the official doc generator
<FromGitter>
<Blacksmoke16> @watzon my understanding is that's possible with what @oprypin is doing
<FromGitter>
<Blacksmoke16> in `lib/athena/athena.cr`
<straight-shoota>
both left sidebars are just combined because in Crystal there's no separation between namespaces and types
<raz>
yea. it might be an interesting experiment to see how crystal docs would fare with a third pane on the left bottom to contain the method list etc.
<FromGitter>
<Blacksmoke16> or what lib is that async thing so i can try with that code?
<raz>
atm the only way to find e.g. "instance methods" is to scroll and search
<FromGitter>
<jrei:matrix.org> or a struct that embeds some of the properties
<Andriamanitra>
straight-shoota: ty, i think i'll experiment with some improvements
<raz>
jrei: well, my methods tend to have short signatures anyway. but sometimes long signatures are unavoidable, so the doc generator should display them nicely, too
<FromGitter>
<jrei:matrix.org> raz agree 100%
<straight-shoota>
of course
<straight-shoota>
Andriamanitra, I'm seriously questioning if it's worth investing more time into the doc formatter
<Andriamanitra>
why is that
<straight-shoota>
it's a mess in a lot of places, and in some parts shamelessly broken
<straight-shoota>
like Markdown rendering
<raz>
what would be the alternative? rebuild or switch to something external like mkdocs?
<straight-shoota>
I would remove the html generation part from the compiler and let it just extract the docs in a structured format
<raz>
hmmm.
* raz
scratches head
<raz>
structured format = json?
<straight-shoota>
yeah
<straight-shoota>
that's how the mkdocs-plugin gets the data
<raz>
nice. indeed. then someone could just build a cool view/react app as the viewer
<oprypin>
that already exists though, it's what i use lol
<raz>
vue*
<raz>
ah... ok, i'm behind as usual :D
<Andriamanitra>
hmm, maybe my efforts would be better spent creating my own viewer then
<raz>
ohhh when that json becomes available i might try one too, that sounds like fun
<oprypin>
o.o
<straight-shoota>
the json is already working
<raz>
hmpf, there goes my weekend, maybe :P
<straight-shoota>
crystal docs --format json
<straight-shoota>
even with --format html the JSON is generated as docs/index.json because the embedded search engine uses that
<raz>
indeed! hm, i think i've never looked at crystal docs --help before lol
<oprypin>
straight-shoota, wait what, docs/index.json is a dump of the exact same structure??
<straight-shoota>
yes
<oprypin>
well that's unfortunate. it's quite a big one!
<oprypin>
also i wasnt aware that changing something in it could break search
<FromGitter>
<watzon> I'll try in a bit though. Just working on mkdocs stuff for Tourmaline.
<oprypin>
watzon, will you integrate api docs with my plugin?
<FromGitter>
<Blacksmoke16> :p that was quick
<FromGitter>
<watzon> @oprypin sure will! I was going to try the other day, but I was having trouble installing mkdocstrings because of some clang issues.
<FromGitter>
<watzon> Got all that solved now though
<oprypin>
wait how is clang involved in *that*
_whitelogger has joined #crystal-lang
<FromGitter>
<jrei:matrix.org> straight-shoota: the project could be the directory name by default
<FromGitter>
<Blacksmoke16> oh i didnt add it to the thing
<straight-shoota>
jrei:matrix.org Oh, finding a name for the project really isn't an issue. It's not essential, so it wouldn't even matter if it was empty
<straight-shoota>
the point is to error if the automatic recognition based on shard.yml fails
<straight-shoota>
and most crystal projects should have a shard.yml, so in practice that should rarely fail
<straight-shoota>
unless you're building stdlib docs
<oprypin>
mkdocs.yml can take care of that :D :D :D
<FromGitter>
<jrei:matrix.org> I really think it should work without this file
<straight-shoota>
it does, you just need to tell the name =)
<FromGitter>
<jrei:matrix.org> yes, but as you said, that's not even that important
<straight-shoota>
but what's the point in having no name?
<straight-shoota>
by default
<FromGitter>
<jrei:matrix.org> usually the directory name is close to the actual library name
<FromGitter>
<jrei:matrix.org> so that's a good enough default IMO
<FromGitter>
<jrei:matrix.org> btw that's how `shards init` do
<FromGitter>
<jrei:matrix.org> *what it does
<straight-shoota>
and that's fine because shards init is usually run interactively
<FromGitter>
<jrei:matrix.org> ha?
<straight-shoota>
crystal docs runs a lot in automated environments
<FromGitter>
<jrei:matrix.org> shards init --help does not print if/how to run interactively
<straight-shoota>
if the repo is checked out in a randomly named directory, you wouldn't want that to show up as project name
<straight-shoota>
I mean a human being runs the program in their teminal
<FromGitter>
<Blacksmoke16> @watzon i think the loop isnt giving any time to switch to other fibers which the trap runs in
<straight-shoota>
and the result is double checked when you commit to vcs
oddp has joined #crystal-lang
<FromGitter>
<jrei:matrix.org> the name is really not a big deal for me - content matters a lot more
<FromGitter>
<jrei:matrix.org> not sure I will notice if the name change on the API docs...
<straight-shoota>
but exactly that's the point
<straight-shoota>
if it doesn't fail, it can go unnoticed
<straight-shoota>
very easily
<straight-shoota>
So failing is good because it draws attention that something doesn't work as intended
<straight-shoota>
if you have a project without shard.yml you can just setup a make recipe and call "make docs" instead of "crystal docs"
<FromGitter>
<Blacksmoke16> @watzon i think you can only have one handler per signal
<FromGitter>
<Blacksmoke16> so they might be overriding each other?
<FromGitter>
<Blacksmoke16> because when i run one or the other its fine, running them both things dont fully exit
<FromGitter>
<jrei:matrix.org> maybe. just feel strange to mention shard.yml. I still find that having a strong bind between a language and a package manager is not that great
<straight-shoota>
so you would rather use the directory name than the shard name from shard.yml?
<FromGitter>
<jrei:matrix.org> no, but just not mention it
<straight-shoota>
but whether its mentioned in the error message or not doesn't change that crystal docs collects input from shard.yml
<FromGitter>
<jrei:matrix.org> anyway, this will be moved out from the compiler.
<FromGitter>
<jrei:matrix.org> the outside doc generator could have this logic
<FromGitter>
<jrei:matrix.org> and the Crystal compiler focus on crystal files
<FromGitter>
<jrei:matrix.org> Having logic related to Git, shards, Travis, etc in the compiler - I'm not fan π
<Andriamanitra>
i think it's better to have some of the most commonly used things bundled, otherwise everyone will waste their time creating countless (bad) competing implementations and no actual work gets done
<Andriamanitra>
power users will find a way to create their own things anyway but for us casual programmers having git, shards etc well integrated with compiler is a life saver
<FromGitter>
<jrei:matrix.org> that's not better to core member waste time on a tool
<FromGitter>
<jrei:matrix.org> but it can still be bundled
<FromGitter>
<jrei:matrix.org> like shards come with crystal, the doc generator can too
<straight-shoota>
yes, it should definitely be bundled
<FromGitter>
<jrei:matrix.org> Andriamanitra: do you know that `crystal deps` => `shards`
<FromGitter>
<jrei:matrix.org> so at then, we will have `crystal docs` => `whatever-doc-gen`
<Andriamanitra>
ah, that makes sense
<Andriamanitra>
i didnt even realize shards are separate from the compiler
<FromGitter>
<jrei:matrix.org> monorepo is cool, but we as easily have teams maintaining separate parts of the code
<FromGitter>
<jrei:matrix.org> *can't have
<oprypin>
jrei:matrix.org, monorepo has literally 0 downside for collaboration, if that's what you're saying
oddp has quit [Quit: quit]
<FromGitter>
<jrei:matrix.org> oprypin: I don't agree, because you can't freely develop/deploy
<FromGitter>
<jrei:matrix.org> not as easily at least
<oprypin>
then that's a problem of something other than the actual repo
<FromGitter>
<jrei:matrix.org> I don't say you *can't$ - everything's possible
<FromGitter>
<jrei:matrix.org> I think that's why shards has been separated from crystal?
<FromGitter>
<jrei:matrix.org> and why the doc generator could be too?
<FromGitter>
<jrei:matrix.org> at least on GitHub, what I can see is to have less PRs depending of few members approvals...
<oprypin>
jrei:matrix.org, again that's a human problem, not a repo problem
<FromGitter>
<jrei:matrix.org> absolutely, all is about humans
<FromGitter>
<jrei:matrix.org> how GItHub is done make several teams on a monorepo harder to manager, that's it
<FromGitter>
<Blacksmoke16> How so?
<FromGitter>
<jrei:matrix.org> there are CodeOwners that improve the situation a bit
<FromGitter>
<Blacksmoke16> ^
<oprypin>
> requires repo write rights to be a codeowner
<oprypin>
so that sux
<FromGitter>
<jrei:matrix.org> yeah, not ideal either. As you said oprypin, the goal is to have more people be able to handle more code. How to do it in GitHub usually is multiple repos
<FromGitter>
<jrei:matrix.org> I mean, that's of course a people issue
<FromGitter>
<jrei:matrix.org> GitLab is better with monorepos, AFAIK
<oprypin>
u could do a fork and delegate some part of it to some other team, then arrange no-questions-asked merges into main repo
<oprypin>
but yea github indeed could do more
<FromGitter>
<jrei:matrix.org> maybe, but nothing stop the teams touching the code of others
<oprypin>
that could have a technical solution
<FromGitter>
<jrei:matrix.org> totally different subject: how many installation you got with nightly.link?
<FromGitter>
<jrei:matrix.org> *GitHub App ones
<FromGitter>
<watzon> @Blacksmoke16 that makes sense actually
<FromGitter>
<watzon> Not ideal
<FromGitter>
<Blacksmoke16> Indeed b:/
<FromGitter>
<Blacksmoke16> whats the use case for wrapping those in that future thing?