<FromGitter>
<raydf> This is a interesting talk by Ary.
hako has quit [Read error: Connection reset by peer]
<FromGitter>
<jots_twitter> thanks @raydf I will watch this tonight. I have not delved into macros yet.
hako has joined #crystal-lang
x0f has joined #crystal-lang
<FromGitter>
<fridgerator> thanks @raydf
mgarciaisaia has quit [Quit: Leaving.]
mgarciaisaia has joined #crystal-lang
mgarciaisaia1 has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 260 seconds]
mgarciaisaia1 has quit [Ping timeout: 252 seconds]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 245 seconds]
shawn42 has quit [Quit: Connection closed for inactivity]
mgarciaisaia has joined #crystal-lang
zacts has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
pawnbox has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 240 seconds]
bjz has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
<FromGitter>
<crisward> Thanks @raydf been trying to get my head around macros to contribute to a templating lib.
Fichtenstein has joined #crystal-lang
bjz has quit [Read error: Connection reset by peer]
bjz has joined #crystal-lang
mgarciaisaia has quit [Quit: Leaving.]
mark_66 has joined #crystal-lang
sustained has joined #crystal-lang
sustained has joined #crystal-lang
sustained has quit [Changing host]
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: https://git.io/vXp8s
<crystal-gh>
crystal/master de680fb Ary Borenszweig: Added old `Char#digit?` and `Char#alpha?` with a deprecation warning, to ease migration. Updated Changelog.
hako has quit [Ping timeout: 250 seconds]
hako has joined #crystal-lang
hako_ has joined #crystal-lang
hako has quit [Ping timeout: 260 seconds]
sustained has quit [Read error: Connection reset by peer]
gloscombe has joined #crystal-lang
<travis-ci>
crystal-lang/crystal#de680fb (master - Added old `Char#digit?` and `Char#alpha?` with a deprecation warning, to ease migration. Updated Changelog.): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/177906928
zacts has quit [Ping timeout: 256 seconds]
soveran has quit [Remote host closed the connection]
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 258 seconds]
<crystal-gh>
[crystal] asterite pushed 2 new commits to master: https://git.io/vXpwT
<crystal-gh>
crystal/master 1def773 Ary Borenszweig: Unicode: consider special case conversions like the uppercase of "ffl" and the downcase of "İ"
<crystal-gh>
crystal/master da21f0b Ary Borenszweig: String#reverse: iterate grapheme clusters for correct output when combining characters are used
<FromGitter>
<xdougx> @ysbaddaden Hello, having this message `ConnectionPool(T) in unions yet, use a more specific type`, this T class, what class should i user?
<FromGitter>
<mverzilli> @xdougx for example if you're using crystal-db you'd use ConnectionPool(::DB::Database)
<FromGitter>
<xdougx> Gonna try this one
<FromGitter>
<mverzilli> if you're following the README from ysbadadden's pool probably you're just missing a type annotation. where are you storing the pool? an ivar in a class?
<FromGitter>
<xdougx> yes, i was trying to store in a instance var, but um having some trouble in the compile-time receiving a bill when i try to make a configuration, now im thinking how to solve it with a especific class for connection 'cos ivar isn’t working properly
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: https://git.io/vXp7o
<FromGitter>
<mverzilli> can you paste some code here?
<FromGitter>
<xdougx> gonna commit
<FromGitter>
<mverzilli> for example, something like this inside a module works: ⏎ ` ⏎ @@pool : ConnectionPool(::DB::Database) ⏎ @@pool = ConnectionPool.new(capacity: 10, timeout: 10.0) do ⏎ ::DB.open(YOUR_DB_URI) ... [https://gitter.im/crystal-lang/crystal?at=58343fc92db95267046826e3]
<FromGitter>
<mverzilli> well the formatting sucks :P
<FromGitter>
<mverzilli> there should be a new line after the first closing parens
<FromGitter>
<xdougx> if you opened, please refresh
pawnbox has quit [Ping timeout: 240 seconds]
kulelu88 has joined #crystal-lang
<FromGitter>
<mverzilli> that's because @@config in base.cr is annotated as nilable
<FromGitter>
<xdougx> if i remove it will ask to start, if i start on the class body, when i connect, im getting the default configuration instead of the configured params in the init
<FromGitter>
<xdougx> the probleman is now in the connection string, the method is using the `@@config, but in the compile time of `base.cr` there is no configuration
<FromGitter>
<mverzilli> exactly
<FromGitter>
<mverzilli> instead of accessing @@config directly, use self.config and ensure there's an instance there
<FromGitter>
<mverzilli> (btw, you may need to think about thread safety of this once it works)
<FromGitter>
<xdougx> yeah, its something is needed to think about too
hako_ has quit [Read error: Connection reset by peer]
hako_ has joined #crystal-lang
<FromGitter>
<xdougx> i think i need to change this strategy, instance var isn’t been a good approach in this case.
<FromGitter>
<mverzilli> maybe your life's going to be a bit easier if you move the initialization of @@config to the declaration of the var
<FromGitter>
<mverzilli> then you con asume there's an instance in self.configure and just yield it
<FromGitter>
<mverzilli> then you don't need to declare the var as nilable, just a plain Selenite:DB::Configuration
<FromGitter>
<xdougx> have success in make the code work, but, instead of the configuration in the init, got the default configuration
<FromGitter>
<xdougx> @mverzilli Ok, made it :D
<FromGitter>
<mverzilli> \o/
<FromGitter>
<mverzilli> I'm at a meeting right now, sorry for not helping more
<FromGitter>
<mverzilli> what was it?
<FromGitter>
<xdougx> made the `self.configuration` in the configuration class, make a `singleton` returning always the same configuration object and used it to connect to the base
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: https://git.io/vXhmF
<crystal-gh>
crystal/master 6eee1e9 Ary Borenszweig: Another missing changelog entry
<FromGitter>
<spalladino> At least on my machine, when running that code, all requests are STARTed first, and then they are either DONE or ERRORed; but it seems odd that no response is returned in-between the STARTs
mgarciaisaia has quit [Ping timeout: 252 seconds]
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: https://git.io/vXh3H
<crystal-gh>
crystal/master ab61b89 Ary Borenszweig: Mention API docs notes highlighting in changelog
<Sharcho>
asterite: It's not starting all the requests immediately, it's waiting for a while before it processes all the request, and all the DONE seems to be arriving at the end, not when they're done
pawnbox has quit [Remote host closed the connection]
<FromGitter>
<xdougx> Gonna take a look :thumbsup:
<Sharcho>
spalladino, I think that expains it, I didn't see these issues when using URLs such as 'http://1.1.1.1/test'
<FromGitter>
<spalladino> It's basically the same as the `JSON.mapping` macro, only that it builds instances from a `DB::ResultSet` instead of a `PullParser`
<FromGitter>
<spalladino> Sharcho I was going to test exactly that. Good to know!
<FromGitter>
<xdougx> interesting lib, very good!!!
<crystal-gh>
[crystal] asterite pushed 2 new commits to master: https://git.io/vXhEM
<crystal-gh>
crystal/master eab0094 Ary Borenszweig: Allow passing case options to `String#capitalize`
<FromGitter>
<spalladino> `crystal play` may come in handy for these kind of doubts
<FromGitter>
<johnjansen> +1
<FromGitter>
<xdougx> crystal play is a REPL?
<FromGitter>
<johnjansen> run `crystal play` from terminal then `open http://localhost:8080`
<FromGitter>
<xdougx> Wow carc.in at localhost
<FromGitter>
<spalladino> Not exactly a REPL, since it will compile and run all your code on every change; but it's useful for quick tests, such as this one
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: https://git.io/vXho4
<crystal-gh>
crystal/master 202e771 Ary Borenszweig: Enum: automatically generate a `none?` method for a Flags enum
<FromGitter>
<xdougx> Liked, when it become available?
<RX14>
oh lol I thought you realised we were on 0.20.0 and was asking for the schedule for point releases lol
<FromGitter>
<johnjansen> bloody hell …
<FromGitter>
<mverzilli> yeah, I wasn't sure if you were kidding or what :D
<FromGitter>
<johnjansen> im really not that much of an ass
<FromGitter>
<johnjansen> i am laughing now though
<FromGitter>
<mverzilli> the synchronicity was a bit creepy
<FromGitter>
<johnjansen> a touch impatient perhaps
<FromGitter>
<johnjansen> i need a whip to crack
<FromGitter>
<johnjansen> sorry for that everyone
<FromGitter>
<johnjansen> just one question, how did everyone know about that release?
<RX14>
github
<RX14>
and just the tone of development over the last week
<RX14>
i'm watching the github repo, have been since mid-july
<RX14>
also the mailing list
<RX14>
and yeah
<RX14>
many different ways
<FromGitter>
<johnjansen> thanks @RX14 id forked the repo, starred the repo, but forgot to watch the repo
<FromGitter>
<fridgerator> I'm on the mailing list as well, usually I get an email about releases. I did not get one with this release yet.
<RX14>
it's there
<RX14>
at 17:40
gloscombe has quit [Quit: Lost terminal]
soveran has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
<FromGitter>
<fridgerator> I am writing a Database / Query wrapper, any feedback would be appreciated. I just started 3 days ago so its still in its infancy. https://github.com/fridgerator/crecto
gloscombe has joined #crystal-lang
<FromGitter>
<fridgerator> It is based on / inspired by Ecto (Elixir lang)
gloscombe has quit [Client Quit]
soveran has quit [Ping timeout: 260 seconds]
mark_66 has quit [Remote host closed the connection]
<FromGitter>
<phoffer> @fridgerator that looks really cool so far (going by readme). I played with Ecto a little bit, a stable port for Crystal would be awesome
<FromGitter>
<fridgerator> I like Ecto, because I prefer the abstraction of the `Repo`
<RX14>
you should probably use `field age : Int32` for declaring fields
<FromGitter>
<fridgerator> point taken, would make the macro simpler
<FromGitter>
<fridgerator> I'm currently choosing the tye in the macro based on the parameter (i.e. `{% field_type = "Int32 | Int64" if field_type == :integer %}`)
<RX14>
hmm
<RX14>
if it's DB work, choosing the DB type from the crystal type might be easier
<RX14>
`Int32` is faster and smaller then `Int32 | Int64`
<RX14>
so if you can, I would prefer using crystal types, especially as it makes typing easier
<FromGitter>
<xdougx> Int32 is -2billions up to 2 bilions?
<FromGitter>
<spalladino> @xdougx @fridgerator make sure to share your work later in https://github.com/veelenga/awesome-crystal (and also to check if there are any other similar projects you could draw ideas from!)
pduncan has quit [Ping timeout: 245 seconds]
<FromGitter>
<xdougx> okay added to awesome crystal
<FromGitter>
<xdougx> pull request done
<FromGitter>
<spalladino> Cool
<RX14>
@fridgerator how about the name correcto?
<FromGitter>
<spalladino> Also, I'd suggest (for both projects) to try and build upon crystal-db. The goal of that project is to act as a common interface to all SQL-like DBs, with minimal functionality; so you don't need to replicate postgres/sqlite/mysql adapters, pools, etc on every project.
<FromGitter>
<spalladino> @RX14 love the name :P
<RX14>
also yes
<RX14>
if you can build it on crystal-db that would be awesome
<FromGitter>
<fridgerator> so crystal-db would be used along with crystal-pg?
<RX14>
well unfrtunately crystal-db doesn't have a pg driver yet
<RX14>
crystal-pg has a PR/branch which makes it a crystal-db adapter
<RX14>
so actually yes
<FromGitter>
<fridgerator> ok great
<FromGitter>
<xdougx> is that possible to incorporate the crystal-db into crystal-db?
<RX14>
what?
<FromGitter>
<xdougx> ‘cos crystal-pg is a adpter for Postgresql
<FromGitter>
<xdougx> Also crystal-db could use crystal-pg implementation
<FromGitter>
<spalladino> crystal-db is adapter-agnostic, the idea is to have satellite projects that extend crystal-db for a specific db
<RX14>
@xdougx you said crystal-db twice
<RX14>
also crystal-pg will eventually be a crystal-db driver
<RX14>
hopefully
<RX14>
crystal-db has some great ideas in
<FromGitter>
<xdougx> i think the idea is all of then have the same interface, its correct?
<RX14>
yep
<FromGitter>
<xdougx> if every body, has a pool, connect, exec and return a ResultSet, will be perfect
<FromGitter>
<fridgerator> crystal-db is providing an interface just to connecting to, sending queries and receiving query responses, the specific query strings will still need to be built.... is that correct?
<FromGitter>
<paulcsmith> The first one works, but if you use `crystal tool format` it will change it to the second version
<RX14>
@paulcsmith crystal tool format doesn't have any configuration and thats a feature IMHO
<FromGitter>
<paulcsmith> RX14 yeah I see the benefits
<RX14>
it's interesting because I like having calls aligned most of the time
<Yxhuvud>
if you care alot, do a feature/pull request and see what happens
<FromGitter>
<paulcsmith> @ Yxhuvud yeah I might do that! Just wanted to make sure I wasn't missing anything in the meantime :)
<FromGitter>
<paulcsmith> BTW is there any docs on creating custom tools? Another option would be to create a custom tool that uses the default crystal formatter, and then runs a second formatter that changes just that one style back :) Not the most efficient, but maybe it would work
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: https://git.io/vXhba
<crystal-gh>
crystal/master 98e8c65 Ary Borenszweig: MemoryIO -> IO::Memory (was introduced by merging old PR)
<FromGitter>
<xdougx> There is any initiative for a library lije rails/arel?
<FromGitter>
<spalladino> @Yxhuvud -1 to directly sending a PR; I'd suggest opening an issue beforehand to ask whether there is interest in that change, and whether it would be accepted, so you don't work on implementing it just to see it rejected if that style is not agreed upon
<RX14>
well it depends on the magnitude of the change
<FromGitter>
<paulcsmith> @RX14 Yeah I like that. My general rule of thumb is everything is indented by 2 spaces. It makes diffs clean and you never have to worry about whether to lines things up or not. You just always do two
<RX14>
well I like alignment when it's an expression split between lines
<FromGitter>
<paulcsmith> Yeah I'd prob do an issue first. That's a good idea. Wouldn't want to waste time and effort if it won't get accepted. Also it's easier for maintainers to reject an issue than a PR. You don't feel so bad when it's just an issue :)
<RX14>
if it's a 5 minute change you might as well send a PR right away
<RX14>
but your first compiler change is never 5 minutes
<FromGitter>
<paulcsmith> Haha yeah I'd have to get it all set up first. Also not sure if I should change it or introduce an option so you can configure which version you want. Since I'm not sure what the maintainers would like I'd probable open an issue first
<RX14>
having an option is the worst of both worlds because you loose consistency throughout all projects
<RX14>
having formatter options is a slippery slope
<RX14>
and it leads to rubocop, which is great but isn't exactly where I would want to end up on the configuration side of things
<RX14>
i like go's idea of this is the standard format, like it or not
<FromGitter>
<paulcsmith> Yeah I see good points on both sides. I personally like a little configuration, but I know that's up to the core team. If they don't want it I won't fight it, but I might make my own tool to change certain things
<FromGitter>
<paulcsmith> So both sides win either way :)
rolha has joined #crystal-lang
<FromGitter>
<fridgerator> wow, 0.20.0 is taking longer than previous releases to compile, was this the case for others?
<RX14>
how much longer?
<RX14>
i assume you mean compile other programs
<FromGitter>
<fridgerator> well, install from brew
<FromGitter>
<fridgerator> `make` has been running for probably 7 minutes now
<RX14>
oh
<RX14>
hmm
<RX14>
blame LLVM
<FromGitter>
<sdogruyol> @fridgerator ecto is awesome
<FromGitter>
<fridgerator> ok, i will ;)
<FromGitter>
<xdougx> :eyes:
rolha has quit [Client Quit]
<FromGitter>
<paulcsmith> @fridgerator Cool stuff. I also like Ecto :)
<tilpner>
echosystm - What do you mean by concurrent?
<echosystm>
does it halt the main thread unecessarily
<tilpner>
"A Crystal program executes in a single operating system thread, except the Garbage Collector (GC) which implements a concurrent mark-and-sweep (currently Boehm GC)."