<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> 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> @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> 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>
<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?
<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>
<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>
<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
<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
<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>
<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