RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.27.0 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
_whitelogger has joined #crystal-lang
<FromGitter> <dscottboggs_gitlab> what about `Specify`
<FromGitter> <Blacksmoke16> hmm
<FromGitter> <Blacksmoke16> `QuerySpec(Bool).eq("admin", true)` vs `Specify(Bool).eq("admin", true)`
<FromGitter> <dscottboggs_gitlab> So... I tend to go way overboard with making my code read like natural language. So I would obviously pick the one on the right...but that's just my opinon haha
<FromGitter> <Blacksmoke16> i could go with that
<FromGitter> <dscottboggs_gitlab> not sure I get what it's supposed to do. is it like a spec extension?
<FromGitter> <Blacksmoke16> nothing to do with tests
<FromGitter> <Blacksmoke16> its basic a query builder for SQL that allows you to:
<FromGitter> <Blacksmoke16> have type safe queries
<FromGitter> <Blacksmoke16> reusable "modules"
<FromGitter> <Blacksmoke16> easily test and document
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/633e
<FromGitter> <Blacksmoke16> is what i got going so far
<FromGitter> <dscottboggs_gitlab> I love the idea
<FromGitter> <Blacksmoke16> <3
<FromGitter> <dscottboggs_gitlab> what about `and(Specify(String).column("name").eq("jim"))`
<FromGitter> <Blacksmoke16> so like the `IsActive` if you wanted to change what that means, can do it in one place and updates everywhere
<FromGitter> <dscottboggs_gitlab> oh nice
<FromGitter> <dscottboggs_gitlab> I see that
<FromGitter> <Blacksmoke16> plus can also do complex stuff in the classes so like
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c4a678420b78635b67a54ea]
<FromGitter> <Blacksmoke16> doesnt have to just be single things
<FromGitter> <Blacksmoke16> plan is to expand it to also allow for like
<FromGitter> <dscottboggs_gitlab> yeah, I see, that's such a nice API for query building!
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c4a67cd7a0f4d5b1902a458]
<FromGitter> <dscottboggs_gitlab> I see
<FromGitter> <Blacksmoke16> so really your classes can take whatever on init and build out your logic based on those
<FromGitter> <dscottboggs_gitlab> wait, would `#add` add another branch to the `or` statement then?
<FromGitter> <Blacksmoke16> yea if that was true would be same as doing like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c4a6814f780a1521f645b54]
<FromGitter> <dscottboggs_gitlab> I hadn't heard of that Specification pattern
<FromGitter> <Blacksmoke16> shamelessly stole it from https://github.com/Happyr/Doctrine-Specification :p
<FromGitter> <Blacksmoke16> we use it at work, is quite nice
<FromGitter> <Blacksmoke16> am a big fan
<FromGitter> <Blacksmoke16> https://github.com/Happyr/Doctrine-Specification#doctrine-specification is a good example of making the reusable blocks
<FromGitter> <Blacksmoke16> vs duplicating that for each query
<FromGitter> <Blacksmoke16> it also has like `matchOneOrNull`
<FromGitter> <Blacksmoke16> is super powerful and flexible
<FromGitter> <dscottboggs_gitlab> Can't wait to make use of that
<FromGitter> <Blacksmoke16> <3
<FromGitter> <Blacksmoke16> should be pretty simple for ORMs to support
<FromGitter> <Blacksmoke16> really just need a way to execute a sql string and have a class getter with the table name
<FromGitter> <Blacksmoke16> then just like `extend Specify` in your model to add the `match` and other methods
<FromGitter> <Blacksmoke16> think its defined enough to make a repo for it and start writing tests, next up would be alias to support joins
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<FromGitter> <Blacksmoke16> ehh, will have to think on this more, gotta build a query builder AND the spec thing, least in their case they already had a query builder to wrap
jemc has joined #crystal-lang
Creatornator has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
Creatornator has quit [Client Quit]
Creatornator has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jemc has quit [Ping timeout: 240 seconds]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
<FromGitter> <bararchy> @vladfaust was there suppose to be a Crystal event in Minsk ?
<FromGitter> <j8r> @Blacksmoke16 or something with Assert?
<FromGitter> <j8r> Or Test?
<FromGitter> <j8r> sorry to bother you again, do you know how to https://carc.in/#/r/635s
ashirase has quit [Ping timeout: 268 seconds]
ashirase has joined #crystal-lang
<FromGitter> <vladfaust> @bararchy yes, Bar. I was planning to attend the Ruby conf with Crystal speech
<FromGitter> <girng> @vladfaust oh really? will there be a video of it available online?
<FromGitter> <vladfaust> @girng I think so
<FromGitter> <bew> @j8r tried with typeof, no sucess i don't think that's possible
<FromGitter> <j8r> 🎉 https://carc.in/#/r/6361
<FromGitter> <j8r> Maybe even more useful than a stacktrace because it prints the Object
<FromGitter> <bew> Neat 👍
vegai has joined #crystal-lang
<FromGitter> <mavu> Question about Http::Client: Documentation says ⏎ ⏎ > Reusing a connection ⏎ Similar to the above cases, but creating an instance of an HTTP::Client ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5c4af2369bfa375aab598dcc]
<FromGitter> <mavu> I *think* it is just a shortcut from looking at the code in client.cr.
<FromGitter> <mavu> No, actually, I think it does reuse connections. which explains why my service randomly stopps working with broken pipe errors :P
<FromGitter> <vlazar> It must be Crystal spinning the Ruby logo for conference in Minsk https://rubyconference.by/
<FromGitter> <codenoid> cool
<FromGitter> <Blacksmoke16> @j8r what would executing that macro in that struct do? wouldnt you be getter off with a class method
<FromGitter> <j8r> @Blacksmoke16 this can't be, a macro is needed - it uses ASTNode features
<FromGitter> <j8r> Like knowing the line, the class. If it's a class method, it will be the line of the class method and the class name
<FromGitter> <j8r> And `Error.throw` is the standard error class. Else, I don't understand what you mean?
<FromGitter> <j8r> that's like raising an error
<FromGitter> <j8r> there are limitations through of this approach: ⏎ ⏎ 1) must be in a method ⏎ 2) can't be used in initialize - self.new has to be used to return an Union [https://gitter.im/crystal-lang/crystal?at=5c4b0ca50721b912a5d80cea]
<FromGitter> <Blacksmoke16> ah, fair enough
<FromGitter> <j8r> https://github.com/j8r/error.cr created :)
<FromGitter> <girng> O_O
<FromGitter> <Blacksmoke16> neat
<FromGitter> <girng> "stack unwinding"? is this an expensive operation ?
<FromGitter> <j8r> for sure
<FromGitter> <girng> interesting, never heard of that term before. obviously something to do with the stack's memory right
<FromGitter> <girng> this is prob the farthest i should go into this topic.. let me back away from the keyboard
<FromGitter> <j8r> I've taken some idea from https://docs.swift.org/swift-book/LanguageGuide/ErrorHandling.html
<FromGitter> <Blacksmoke16> whoa, first time i ever saw this
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c4b0f8795e17b4525aa7137]
<FromGitter> <bew> Nice error :p
<FromGitter> <j8r> yep, probably you use an instance var of the struct inside the same struct
<FromGitter> <codenoid> idk, Go is easier than crystal, wdyt ?
<FromGitter> <girng> crystal 10x easier imo
<FromGitter> <j8r> that's why I use class instead of struct for my error handling library
<FromGitter> <codenoid> *for me
<FromGitter> <j8r> @codenoid we don't know you, lol. What's your experience?
<FromGitter> <j8r> Are you better in Ruby/Python or C/Java?
<FromGitter> <codenoid> depending on the case, but usually if I'm bored, I change the language :/
<FromGitter> <j8r> What do you master the most?
<FromGitter> <j8r> or prefer?
<FromGitter> <codenoid> i'm never code in C*
<FromGitter> <codenoid> master of none
<FromGitter> <codenoid> prefer Go
<FromGitter> <girng> do what your heart feels
<FromGitter> <j8r> I'd say if you like magic, Crystal. If you like things basic, Go
<FromGitter> <codenoid> yeah @girng , I have to keep learning something new so I don't get bored
<FromGitter> <codenoid> i do code in crystal, for Gov Project,
<FromGitter> <j8r> nice!
<FromGitter> <codenoid> too many routes, feature, bussiness logic, and i feel bored, then i try Golang,
<FromGitter> <j8r> But with Go, you'll likely be done before learning all Crystal possibilities
<FromGitter> <codenoid> 👌
<FromGitter> <j8r> Not sure Golang will be better
<FromGitter> <j8r> For me, probably I'll be bored to write boilerplate codes
<FromGitter> <j8r> where I can use macros or generics
<FromGitter> <j8r> I think the key is to avoid big monolith and split as much as possible in reusable libraries
<FromGitter> <codenoid> agree
<FromGitter> <j8r> This way you *can* have a better architectured app without mixups in namespaces
<FromGitter> <j8r> maybe try Rust?
<FromGitter> <codenoid> i already try rust, but their Mongo lib is not maintained and slower than mgo
<FromGitter> <girng> lol the rust's wikipedia says Rust is syntactically similar to C++ 😆
<FromGitter> <j8r> mongo is no longer open source :(
<FromGitter> <j8r> @codenoid this https://github.com/thijsc/mongo-rust-driver ?
<FromGitter> <codenoid> i forgot which library, but my early code : https://gist.github.com/codenoid/27c9f78a8a5e8097842483ceaff36481
<FromGitter> <j8r> I like the `match` syntax
<FromGitter> <j8r> with the `=>` arrows
<FromGitter> <j8r> anyway, the above library is a binding, it should be close to the C speed
jemc has joined #crystal-lang
<FromGitter> <mavu> Is this a bug or am I doing it wrong? ⏎ https://play.crystal-lang.org/#/r/637p
<FromGitter> <j8r> @mavu see the last like `in /usr/lib/crystal/yaml/to_yaml.cr:14: no overload matches 'HTTP::Cookie#to_yaml' with type YAML::Nodes::Builder`
<FromGitter> <j8r> `HTTP::Cookie#to_yaml` doesn't exists
<FromGitter> <mavu> the documentation says it exists and is inherited from Object. https://crystal-lang.org/api/0.27.0/HTTP/Cookie.html
<FromGitter> <j8r> that's https://crystal-lang.org/api/0.27.0/Object.html#to_yaml%28io%3AIO%29-instance-method
<FromGitter> <j8r> not `to_yaml`, `to_yaml(io :IO)`
<FromGitter> <mavu> Ohh... I see. that easy to confuse.
<FromGitter> <j8r> but then you have `in /usr/lib/crystal/yaml/to_yaml.cr:14: no overload matches 'HTTP::Cookie#to_yaml' with type YAML::Nodes::Builder`
<FromGitter> <j8r> So no, you can't do a `to_yaml` at the end
<FromGitter> <j8r> but you can't `to_yaml` a method of `HTTP::Cookie`
jemc has quit [Ping timeout: 245 seconds]
<FromGitter> <mavu> I'm not sure I understand that.
<FromGitter> <mavu> So, what is the purpose of the to_yaml methods in Object? are they supposed to call some methods the child-object must implement?
<FromGitter> <mavu> If so, which ones/
<FromGitter> <mavu> wait.
<FromGitter> <mavu> to_yaml(nodes_builder) needs to be implemented in my object, and *that* is called by the to_yaml method.
<FromGitter> <mavu> did I get that right?
<FromGitter> <j8r> more or less
<FromGitter> <mavu> yes i have that open, but it doesn't seem to contain a to_yaml function that accepts a Nodes::Builder.new
<FromGitter> <Blacksmoke16> its passed in from the `Object#to_yaml`
<FromGitter> <Blacksmoke16> so you just have to implement a `def to_yaml(yaml : ::Nodes::Builder)` in your type to build out how your obj should be serialized
<FromGitter> <mavu> ok. I might try my hand at that. thanks
gangstacat has quit [Quit: Ĝis!]
<FromGitter> <Blacksmoke16> np, can look at that file to see how the other types work
<FromGitter> <j8r> @proyb6 why renaming `error` to `error.cr`?
jemc has joined #crystal-lang
<FromGitter> <proyb6> “shard install” has an error @j8r
gangstacat has joined #crystal-lang
<FromGitter> <proyb6> you try if the same error could be reproduce when you try shard install
<FromGitter> <j8r> @proyb6 oh yes sorry I fix that
<FromGitter> <j8r> @proyb6 thanks, fixed
<FromGitter> <proyb6> Great!
<FromGitter> <j8r> if you have feedbacks, don't hesitate :)
<livcd> [how far away are we from Windows release ?
<jhass> 23,5 far away
<jhass> don't ask me what unit that is in, no idea
<FromGitter> <fridgerator> metric nanobots
<FromGitter> <yxhuvud> Meh, I prefer Imperial nanobots
<FromGitter> <girng> 😆
shmibs has quit [Quit: leaving =o]
shmibs has joined #crystal-lang
jemc has quit [Ping timeout: 240 seconds]
gangstacat has quit [Remote host closed the connection]
<FromGitter> <girng> good morning everyone..
<FromGitter> <r00ster91> good evening
<FromGitter> <girng> hi @r00ster91 havn't seen you in in chat for a while. glad to see ya back
<FromGitter> <ilanusse> Anyone have any idea why Range is Range(B, E) instead of just Range(T)?
<FromGitter> <ilanusse> Shouldn't begin and end have the same type? What's the use case for different types?
<FromGitter> <r00ster91> because `1_i32..2_u64` is a valid range
<FromGitter> <ilanusse> Good enough for me
<FromGitter> <ilanusse> Thanks!
<FromGitter> <ilanusse> I'm porting Chronic and I'm creating a class for time spans but: ⏎ `class Span < Range(Time, Time)`
<FromGitter> <ilanusse> throws `can't make class 'Span' inherit generic struct 'Range(Time, Time)'`
<FromGitter> <ilanusse> Is there a workaround to this?
<FromGitter> <r00ster91> yes by making `Span` a Struct too, I think
<FromGitter> <ilanusse> Oh mb I was thinking it had sth to do with generics
<FromGitter> <j8r> @ilanusse I strongly don't recommend doing this - inheriting from stdlib is bad
<FromGitter> <r00ster91> But `struct Span < Range(Time, Time)`gives `Error in line 1: can't extend non-abstract struct Range(Time, Time)`. That's probably because of the `(Time, Time)` as it doesn't make sense to inherit a type with the generics. So `struct Span < Range` will work
<FromGitter> <j8r> I don't think so
<FromGitter> <r00ster91> hmm no that doesn't work either actually
<FromGitter> <j8r> struct can only be inherited from abstract structs
<FromGitter> <ilanusse> I'll just use a Range inside the Span object
<FromGitter> <ilanusse> And not inherit
<FromGitter> <j8r> Again, don't inherit from stdlib - save us!
<FromGitter> <ilanusse> :shrug:
<FromGitter> <girng> what is an "abstract" struct vs just a struct?
<FromGitter> <j8r> you can inherit from
<FromGitter> <ilanusse> Yeah, I'll go ahead and not inherit from stdlib
<FromGitter> <ilanusse> Thanks for the feedback
<FromGitter> <bew> @ilanusse you're creating a class for time spans... you could use `Time::Span` from the stdlib maybe?
gangstacat has joined #crystal-lang
<FromGitter> <matthewmcgarvey> Shouldn't this just return nil instead of raising? https://play.crystal-lang.org/#/r/63ag
<FromGitter> <matthewmcgarvey> `JSON::Any#dig?` documentation https://crystal-lang.org/api/0.27.0/JSON/Any.html#dig%3F%28key%3AString%7CInt%2C%2Asubkeys%29-instance-method
<FromGitter> <Blacksmoke16> i think the issue is its expecting a hash and getting an array
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/63ai
<FromGitter> <Blacksmoke16> so its not that it *didnt* find a value, its that it cant. because you cant access an array with a string key
<FromGitter> <matthewmcgarvey> exactly, put it seems like the whole point of dig? is a safe get that doesn't raise
<FromGitter> <matthewmcgarvey> *but
<FromGitter> <matthewmcgarvey> just going to have to use ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ to get around it :/ [https://gitter.im/crystal-lang/crystal?at=5c4b5dda831899452449d5ef]
<FromGitter> <wontruefree> I was looking through the docs and I dont see if macros are still considered harmful to performance
<FromGitter> <wontruefree> Should I avoid macros if worried about compile time?
<FromGitter> <j8r> They slow down the compilation
<FromGitter> <j8r> Indeed bigger they are, slower it is
<FromGitter> <j8r> If you can, better avoid them
<FromGitter> <j8r> Sometimes it's not possible without having to write annoying boilerplating
<FromGitter> <Blacksmoke16> @matthewmcgarvey kinda but not really. it returns nil if it *doesnt* exist, but in this case it doesn't *know* if it exists or not
<FromGitter> <Blacksmoke16> guess the question is should it raise if you give it an invalid path?
<FromGitter> <j8r> @matthewmcgarvey are you handling dynamic data, unknown in advance?
<FromGitter> <Blacksmoke16> idk if id say to avoid them, compilation only happens once. the benefits you can get from them outweigh a bit of extra time imo
<FromGitter> <Blacksmoke16> use them smartly would be a bette way to put it
<FromGitter> <matthewmcgarvey> @j8r kinda. It's not that I can't know it, but I only want to handle the happy path and have it return nil if it doesn't match that.
<FromGitter> <j8r> No, better avoid *If* you can do more or less the same, without them
<FromGitter> <Blacksmoke16> ye
<FromGitter> <j8r> Maybe you can use https://github.com/j8r/dynany
<FromGitter> <j8r> I've create this lib to deal with highly dynamic data
rohitpaulk has joined #crystal-lang
<FromGitter> <vladfaust> Is it possible to get current fibers amount?
<FromGitter> <vladfaust> I tried to dig into the Scheduler, but `Thread.current.scheduler.runnables.size` keeps giving me zero
<FromGitter> <vladfaust> I have a feeling that at some moment of intensive work in my program fibers stop being freed from the RAM even when `spawn` block is ended
<FromGitter> <vladfaust> It happens on ~ 400k fibers
<FromGitter> <wontruefree> @j8r do you know any crystal ORMs that do not rely heavily on macros?
<FromGitter> <Blacksmoke16> i been working on an annotation based version of Granite, it doesnt abuse macros in the same regard, but i cant imagine making an ORM *without* any
<FromGitter> <ilanusse> @bew Thanks for pointing that out, thanks!
<FromGitter> <j8r> @wontruefree i've no experience in ORMs, sorry
<FromGitter> <j8r> like @Blacksmoke16 said, there is no problems with macross
<FromGitter> <j8r> the only one is abusing them where there is no need
<FromGitter> <j8r> if it increases dev productivity with a slight compilation time penalty - that's all good!
<FromGitter> <r00ster91> @vladfaust does this help? https://carc.in/#/r/63bj
<FromGitter> <vladfaust> Yeah, `Fiber.fibers` should do the thing! Thanks, @r00ster91
<FromGitter> <vladfaust> I mean, that would help me to localize the bug
gangstacat has quit [Quit: Ĝis!]
rohitpaulk has quit [Ping timeout: 240 seconds]
_whitelogger has joined #crystal-lang
<FromGitter> <theretromaniac> Nim lang get a 19000 per month sponsor
<FromGitter> <j8r> wow!
<FromGitter> <j8r> where, who @theretromaniac ?
<FromGitter> <theretromaniac> status.im
<FromGitter> <vladfaust> Any proofs? None found neither on BountSource nor OpenCollective
<FromGitter> <theretromaniac> https://nim-lang.org/sponsors.html
<FromGitter> <j8r> that's total
<FromGitter> <vladfaust> That's per month
<FromGitter> <theretromaniac> that’s per month
<FromGitter> <j8r> oh yes didn't see
<FromGitter> <j8r> wrong colors they have
<FromGitter> <theretromaniac> and last update was 5 months ago
<FromGitter> <j8r> wtf 19000
<FromGitter> <vladfaust> Could be a mistake?
<FromGitter> <j8r> I didn't even know how status.im can earn money
<FromGitter> <theretromaniac> neither do i
gangstacat has joined #crystal-lang
<FromGitter> <theretromaniac> @vladfaust i dont know. we can only wait for the next update
<FromGitter> <theretromaniac> this money is enough for at least 2 full time devs
<FromGitter> <vladfaust> *looks at the last fifty euros* That's cool when you earn on what you love to do
gangstacat has quit [Client Quit]
<FromGitter> <theretromaniac> we must find a sponsor like status for crystal 😆
<FromGitter> <j8r> we have not that big contributors
<FromGitter> <j8r> but we have good ones
<FromGitter> <j8r> omg Anonymous $25 $13,750 Aug 6, 2015
<FromGitter> <j8r> for Crystal, on bountysource
<FromGitter> <theretromaniac> i suppose is all the anonymous users together
<FromGitter> <j8r> no
<FromGitter> <j8r> hum maybe
<FromGitter> <j8r> no no, that's a single oone
<FromGitter> <j8r> there are others anonymous
<FromGitter> <theretromaniac> yes you are right
<FromGitter> <theretromaniac> i think is the top sponsor
<FromGitter> <bew> [offtopic] anyone knows/have-used/use NixOS ? reading everything about it makes me wanting to ditch Archlinux and all the problems I have with it, and use NixOS as my main
<FromGitter> <j8r> all the problems? unstabilities?
<FromGitter> <bew> what do you mean by 'unstabilities'?
<FromGitter> <j8r> instabilities
<FromGitter> <bew> not better x) nvm I'll try to explain
<FromGitter> <j8r> does it breaks for you?
<FromGitter> <bew> yesterday it did..
<FromGitter> <bew> with an AUR package that doesn't work due to a full system upgrade, and that I can't re-build due to a weird error
<FromGitter> <j8r> why not using btrfs? then, rollback to a snapshot
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
<FromGitter> <j8r> i love this FS :)
<FromGitter> <bew> but I still want the other packages I upgraded (some of them at least), but they then depends on the last version of their dependencies
laaron has joined #crystal-lang
<FromGitter> <j8r> dependency hell :(
<FromGitter> <bew> which will ultimately leads me to inconsistant package versions, and will potentially break other
<FromGitter> <bew> exactely
laaron has quit [Remote host closed the connection]
<FromGitter> <j8r> and nix package manager solves this
laaron has joined #crystal-lang
<FromGitter> <bew> https://nixos.org/nix/
laaron has quit [Remote host closed the connection]
<FromGitter> <bew> I'll first try to use the nix package manager on Arch, see how it goes
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <bew> also, I can't build crystal right now, because the llvm package it too up to date, and #6754 has no fix yet
<DeBot> https://github.com/crystal-lang/crystal/issues/6754 (Fails to build with LLVM 7)
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <j8r> I build on a docker container :/
laaron has quit [Remote host closed the connection]
<FromGitter> <bew> ah yes, that another solution^^
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <j8r> at least, we all agree that being able to only have a single version of a package hurts
<FromGitter> <matthewmcgarvey> not on mac :D
<FromGitter> <bew> on mac you don't have a single version of a package
<FromGitter> <bew> for exemple brew can manages different versions of the same package
<FromGitter> <bew> iirc
<FromGitter> <bew> (I heard that in the talk about Nix)
<FromGitter> <j8r> yeah but that's a hack , real system packages and Apps are only single
<FromGitter> <j8r> there is also linuxbrew
<FromGitter> <bajro17> Hello can I please ask is there crystal drivers for rethinkdb (rebirthdb) because I cant find
<FromGitter> <Blacksmoke16> not that im aware of
<FromGitter> <Blacksmoke16> https://github.com/kingsleyh/crystal-rethinkdb maybe there is
g- has joined #crystal-lang
<FromGitter> <Blacksmoke16> nothing similar to the existing mysql/pg shards at least afaik
<FromGitter> <Blacksmoke16> but that seems to be a good start for PRs ;)
blassin has quit [Read error: Connection reset by peer]
blassin has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <Blacksmoke16> @dscottboggs_gitlab how do you think i should handle joins?
<FromGitter> <dscottboggs_gitlab> I would make it a method on the result of a query probably?
<FromGitter> <dscottboggs_gitlab> Idk how your query result will work
<FromGitter> <dscottboggs_gitlab> like what kind of data structure gets returned from `#eq()`?
<FromGitter> <Blacksmoke16> `field operator value`
<FromGitter> <Blacksmoke16> current idea was like `InnerJoin(Int32).new Customer, "id", Specify(Int32)eq("id", 123))`
<FromGitter> <dscottboggs_gitlab> I'm not sure I get what you mean.
<FromGitter> <Blacksmoke16> me neither :(
<FromGitter> <dscottboggs_gitlab> SQL is not my strongest subject haha
<FromGitter> <dscottboggs_gitlab> what is `"c"` supposed to be?
<FromGitter> <Blacksmoke16> the alias to the join
<FromGitter> <dscottboggs_gitlab> oh
<FromGitter> <dscottboggs_gitlab> hang on
<FromGitter> <Blacksmoke16> so then you could do Specify(Int32).neq("c.customer_id", 123)
<FromGitter> <Blacksmoke16> but im kidna struggling to come up with a use case where you would want to do an arbitrary join like this, vs using an association on your model via your ORM
<FromGitter> <Blacksmoke16> well i guess if you're not using an ORM then maybe
<FromGitter> <dscottboggs_gitlab> wouldn't an ORM benefit from the type checks of the syntax you're working on?
<FromGitter> <Blacksmoke16> for sure
<FromGitter> <dscottboggs_gitlab> so then inside an ORM would be the use case
<FromGitter> <Blacksmoke16> i guess what im struggling with is the fact that the doctrine-spec was built on top of a query builder FOR doctrine
<FromGitter> <dscottboggs_gitlab> or if you don't want to use an ORM, but want type safety in your queries
<FromGitter> <Blacksmoke16> where in crystal land, i have to build a query builder AND the spec thing, since there are a bunch of ORMs and no stable api between them
<FromGitter> <Blacksmoke16> like do i want to build an API like https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/query-builder.html#high-level-api-methods, then build the blocks on top of that, or just have the blocks be the query builder
<FromGitter> <dscottboggs_gitlab> so wouldn't it be something like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c4b9ee4f46373406afeced0]
<FromGitter> <dscottboggs_gitlab> I don't know if that actually makes any sense
gangstacat has joined #crystal-lang
<FromGitter> <Blacksmoke16> is one of those hard to theorize about without actually using it
<FromGitter> <dscottboggs_gitlab> > then build the blocks on top of that ⏎ ⏎ you mean the Specify api?
<FromGitter> <dscottboggs_gitlab> Yeah I agree
<FromGitter> <Blacksmoke16> yea, like do i want to make some internal/public query builder api like doctrine has, then use that to build the spec portion of it
<FromGitter> <Blacksmoke16> or just skip that query builder intermediary step, and make the spec part the query builder
<FromGitter> <Blacksmoke16> also brings about the question, how do you provide what columns to select
<FromGitter> <Blacksmoke16> oo so many question :(
<FromGitter> <Blacksmoke16> maybe just start small and do simple querying as proof of concept and go from there?
<FromGitter> <dscottboggs_gitlab> I think they're probably two separate things? like, I like the query builder api, and I think that should be a thing, but I don't know if the Spec thing needs to rely on that to exist, or if they should necessarily be tied together like that. It kinda bothers me that there are ORMs but not a standard query builder
<FromGitter> <dscottboggs_gitlab> > maybe just start small and do simple querying as proof of concept and go from there? ⏎ ⏎ That's what I was thinking. You could always jump over to the spec thing if you get an idea from the query-builder.
<FromGitter> <Blacksmoke16> exactly, is what benefits doctrine and php, they only have the one ORM vs liek 5
<FromGitter> <dscottboggs_gitlab> damn it too many windows open!
<FromGitter> <Blacksmoke16> :p
<FromGitter> <dscottboggs_gitlab> my center monitor has 6 workspaces rn 😞
<FromGitter> <Blacksmoke16> ouch
Yxhuvud has joined #crystal-lang
<FromGitter> <Blacksmoke16> oh
<FromGitter> <Blacksmoke16> i forgot that other lib has a `modify` method in addition to the `getSpec` method
<FromGitter> <Blacksmoke16> so that could be used to modify the query within a block
<FromGitter> <Blacksmoke16> have to just play with everything i guess