faustinoaq changed the topic of #amber to: Welcome to Amber Framework community! | https://amberframework.org | Developer happiness, productivity and bare metal performance | GH: https://github.com/amberframework | Docs: https://docs.amberframework.org | Gitter: https://gitter.im/amberframework/amber | IRC Logger: https://irclog.whitequark.org/amber | Amber::Server.start
<FromGitter> <Blacksmoke16> @drujensen i pushed a fix for the specs on default values
<FromGitter> <Blacksmoke16> im not sure how specs passed the first time...
<FromGitter> <drujensen> ok
<FromGitter> <drujensen> oh, so when I merged, there were conflicting changes. I might have messed up on the merge
<FromGitter> <Blacksmoke16> ahh no, i know what it was
<FromGitter> <Blacksmoke16> one of the PRs that got merged in, fixed the PG only specs, which the bug was in that, forgot the `:` on `default`, and was on wrong array field def
<FromGitter> <Blacksmoke16> so after that was fixed they failed since it wasnt before
<FromGitter> <drujensen> πŸ‘
<FromGitter> <drujensen> @Blacksmoke16 nice work on granite changes. I will release it soon.
<FromGitter> <Blacksmoke16> πŸ‘Œ
<FromGitter> <drujensen> Granite 0.15.2 released with several new features.
<FromGitter> <Blacksmoke16> can prob do a router one too
<FromGitter> <Blacksmoke16> πŸ’―
<FromGitter> <drujensen> aah, ok
<FromGitter> <eliasjpr> Beware that the in queries is still need to support floats
<FromGitter> <eliasjpr> is that correct @Blacksmoke16 ?
<FromGitter> <Blacksmoke16> floats work, just some issue with float32s
<FromGitter> <eliasjpr> @Blacksmoke16 got it
<FromGitter> <Blacksmoke16> but i need to figure out if its a granite issue or an adapter/db shard issue
<FromGitter> <Blacksmoke16> ```PG::ResultSet#read returned a Float32. A (Float64 | Nil) was expected. (Exception)```
<FromGitter> <eliasjpr> what if someone enters a union?
<FromGitter> <Blacksmoke16> i dont think that would be supported anyway, you cant insert a String OR Float64 into a column
<FromGitter> <eliasjpr> definitely true, but would be good to handle that case with a nice message
<FromGitter> <eliasjpr> the crystal db drive should handle that
<FromGitter> <Blacksmoke16> prob yea
<FromGitter> <Blacksmoke16> πŸ’―
<FromGitter> <drujensen> Amber Router v0.2.1 released
<FromGitter> <Blacksmoke16> thanks
<FromGitter> <Blacksmoke16> yea im pretty sure this is a pg shard error, its not making it to granite
<FromGitter> <Blacksmoke16> oh wait nvm, i just had wrong data type on column in db
<FromGitter> <Blacksmoke16> ignore me
<FromGitter> <Blacksmoke16> its actually not an issue
<FromGitter> <Blacksmoke16> i need to get back into the annotation granite, been a while since i worked on that
<FromGitter> <Blacksmoke16> iirc was pretty slick and coming along well
<FromGitter> <eliasjpr> iirc?
<FromGitter> <Blacksmoke16> if i remember correctly
<FromGitter> <eliasjpr> πŸ‘
<FromGitter> <eliasjpr> I am just getting back in the loop, have to read what has changed since
<FromGitter> <Blacksmoke16> more of a pet project, would be a super massive breaking change. Would have its own pros and cons
<FromGitter> <drujensen> yeah, that would be massive. It might match better with Athena using annotations though.
<FromGitter> <Blacksmoke16> possibly, never really thought of having a built in ORM
<FromGitter> <Blacksmoke16> not sure what benefits that would give me
<FromGitter> <drujensen> not built in, just having a matching ORM
<FromGitter> <Blacksmoke16> true
<FromGitter> <drujensen> if crystal goes full on Annotations, it would be good to get a jump on it
<FromGitter> <eliasjpr> What is athena?
<FromGitter> <drujensen> glad you are looking into it
<FromGitter> <Blacksmoke16> @eliasjpr its a web framework i been working on, that has some neat features compared to the others
<FromGitter> <eliasjpr> sweet! is it ready for use?
<FromGitter> <drujensen> So, we were talking about using annotations to automatically build routes and @Blacksmoke16 went and built it
<FromGitter> <Blacksmoke16> for the most part yes, was waiting on that router release before releasing 0.1.0
<FromGitter> <drujensen> pretty cool
<FromGitter> <Blacksmoke16> also does param conversion, so you have access to the actual param as the wanted type, vs having to convert from string all the time, or load a user
<FromGitter> <eliasjpr> The annotations looks pretty cool
<FromGitter> <Blacksmoke16> https://github.com/Blacksmoke16/athena/tree/v0.1.0/docs#exists is my personal fav
<FromGitter> <eliasjpr> I like the self documenting feature that it brings
<FromGitter> <drujensen> I find them hard to read myself. ;-)
<FromGitter> <drujensen> but super powerful
<FromGitter> <Blacksmoke16> yea really, maybe a future goal would be like building out a swagger type file automatically
<FromGitter> <Blacksmoke16> since you have all routes defined, with params/types
<FromGitter> <drujensen> ooh, that would be awesome
<FromGitter> <eliasjpr> I just saw the converters thing
<FromGitter> <eliasjpr> I did something similar for the schema-validation thing
<FromGitter> <Blacksmoke16> yup, works quite well
<FromGitter> <Blacksmoke16> i got basically same setup
<FromGitter> <eliasjpr> I just noticed, there is no other way I guess
<FromGitter> <eliasjpr> it does make sense to use a struct instead of a class
<FromGitter> <Blacksmoke16> not unless you go a big case statement like granite did ha
<FromGitter> <elorest> @eliasjpr with your shard. ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Is there a reason to have the users specify the setter and initializers for params? Couldn't the macro set that up as well? [https://gitter.im/amberframework/amber?at=5c32cea91d1c2c3f9cd33045]
<FromGitter> <drujensen> that was my masterpiece. :-D
<FromGitter> <eliasjpr> I added the converter thing because I am hoping that it can be adopted by any case
<FromGitter> <eliasjpr> Hey @elorest
<FromGitter> <elorest> Hey :)
<FromGitter> <eliasjpr> That was for example purposes
<FromGitter> <eliasjpr> to demonstrate
<FromGitter> <elorest> Got it. So basically it just assumes there is an instance var named @params. Like there would be in a controller.
<FromGitter> <eliasjpr> but behind the scences to wire it with a framework like Amber just need to automatically pass the params to the initializer
<FromGitter> <Blacksmoke16> https://github.com/Blacksmoke16/granite/blob/annotation-columns/src/granite/columns.cr is what `fields.cr` looks like now in the annotation version of granite
<FromGitter> <Blacksmoke16> everything kinda just works since you arent abstracting the properties anymore
<FromGitter> <Blacksmoke16> default values/annotations etc
<FromGitter> <eliasjpr> @elorest thats correct
<FromGitter> <eliasjpr> I build this with amber in mind
<FromGitter> <elorest> @eliasjpr Which it already does right? Amber controllers are initialized with @params.
<FromGitter> <eliasjpr> since amber already has a params ivar
<FromGitter> <drujensen> @Blacksmoke16 really clean!
<FromGitter> <elorest> Sweet I love it.
<FromGitter> <eliasjpr> but I was hesistant with this
<FromGitter> <eliasjpr> the reason for that is that you might have an endpoint (controller action) that received json in the request body
<FromGitter> <eliasjpr> so you would have to reinitialize
<FromGitter> <drujensen> I think the repo pattern and crecto would work really well with this since you can just say `Repo.insert(user)` where user is the class or struct created here
<FromGitter> <eliasjpr> with something like `ExampleController::User.from_json(pyaload: String)`
<FromGitter> <drujensen> we could have an initializer in Granite that takes a struct
<FromGitter> <eliasjpr> > Sweet I love it. ⏎ Thanks I hope amber can make use of it
<FromGitter> <Blacksmoke16> ```code paste, see link``` ⏎ ⏎ :0 ;) [https://gitter.im/amberframework/amber?at=5c32d0053cf6c35a84a1be59]
<FromGitter> <eliasjpr> @drujensen one thing I notice that might benefit granite is that it can be initialize with strong types
<FromGitter> <Blacksmoke16> example?
<FromGitter> <eliasjpr> for instance definig a schema that matches what granite expects
<FromGitter> <eliasjpr> not need to take a Hash(String, String) in granite
<FromGitter> <eliasjpr> in can simple take in a schema
<FromGitter> <eliasjpr> UserModel.new(UserSchema)
<FromGitter> <drujensen> right, that might work but we would need to make sure they matched so you are defining it twice
<FromGitter> <drujensen> once in granite and once in the controller
<FromGitter> <Blacksmoke16> have a class method on a model to get its schema
<FromGitter> <Blacksmoke16> which you can build off the properties/fields
<FromGitter> <eliasjpr> > have a class method on a model to get its schema ⏎ ⏎ bingo
<FromGitter> <elorest> @eliasjpr I would think that regardless of the type if we've already parsed params they have a from_json option. So we could probably add something to the schema macro to take custom code. for instance. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5c32d09a5ec8fe5a8513170d]
<FromGitter> <eliasjpr> but it is reinitializing twice
<FromGitter> <Blacksmoke16> same idea can be applied for its SQL schema
<FromGitter> <Blacksmoke16> for a `schema.rb` type thing
<FromGitter> <eliasjpr> @Blacksmoke16 I like that thought
<FromGitter> <Blacksmoke16> if its a Granite model it has from_json and from_yaml built in
<FromGitter> <eliasjpr> got it
<FromGitter> <Blacksmoke16> since `Granite::Base` includes `JSON::Serializable` and `YAML::Serializable`
<FromGitter> <eliasjpr> As I was stating to @drujensen to me feels that the model has a lot of responsability
<FromGitter> <eliasjpr> but again it is MVC, thats why the schema thing might suit better with a REPO pattern
<FromGitter> <drujensen> yeah, so the idea was to bring the included modules up a level
<FromGitter> <eliasjpr> you can still use the library to do simply valiations
<FromGitter> <eliasjpr> it has nice way to define custom validations
<FromGitter> <eliasjpr> and custom predicates
<FromGitter> <Blacksmoke16> personally, i just wouldnt be a fan of defining a schema, like that above AND a model with the same properites
<FromGitter> <eliasjpr> I agree
<FromGitter> <elorest> @eliasjpr My suggestions above would allow for it to easily work with amber controllers without reinitializing... I'm pretty sure. Do you see an issue with it?
<FromGitter> <drujensen> me neither
<FromGitter> <Blacksmoke16> take the annotation route ;)
<FromGitter> <drujensen> ugh
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5c32d1b83cf6c35a84a1c7cc]
<FromGitter> <Blacksmoke16> because i just know you love them, ha
<FromGitter> <drujensen> lol
<FromGitter> <Blacksmoke16> in annotation granite would just throw a like `Granite::Column` on there and you good
<FromGitter> <elorest> Any idea what the the Shardrocks instance on our Digital Ocean account is?
<FromGitter> <Blacksmoke16> that would handle validations/serialization/orm stuff
<FromGitter> <eliasjpr> I have to mention that when I see controller I see two other things a Request and a Response, so if I can define with a schema my request input and another schema my response output to me it has a very good construct to reduce any side effecs
<FromGitter> <Blacksmoke16> depends on how much you want/need to transform the obj
<FromGitter> <Blacksmoke16> but yea, thats a good way to think about it
<FromGitter> <eliasjpr> well everything is a transformation in the lifecycle
<FromGitter> <drujensen> @Blacksmoke16 I think annotations is a really clean way of bringing a modular approach. @eliasjpr and I were discussing that
<FromGitter> <Blacksmoke16> as you'd want to consume a password on a user for example, but ofc not return that in the response
<FromGitter> <eliasjpr> @Blacksmoke16 I would have a Response object without it
<FromGitter> <drujensen> so there are more things than just request/response
<FromGitter> <drujensen> you could be dealing with a background job or a websocket
<FromGitter> <drujensen> but I agree that in a controller, your job is to convert a request into a response
<FromGitter> <eliasjpr> thing of it as SomePasswordService(PasswordRequest, PasswordResponse)
<FromGitter> <elorest> @eliasjpr @drujensen @faustinoaq Is it ok if I delete the `shardrocks` instance from our DO account?
<FromGitter> <eliasjpr> @drujensen extactly there is more that happens behind the scene and while I have the request object being pass around to other part of the system
<FromGitter> <drujensen> we have a DO account? ;-)
<FromGitter> <eliasjpr> > @eliasjpr @drujensen @faustinoaq Is it ok if I delete the `shardrocks` instance from our DO account? ⏎ ⏎ I dont know what that is sorry
<FromGitter> <drujensen> me neither
<FromGitter> <elorest> Ok. I'm going to delete it then in case I end up having to pay for the account for a couple months until they sponsor us again.
<FromGitter> <drujensen> So back to the architecture. I like what @Blacksmoke16 is doing with the annotations. We will have the ability to use different patterns like serializers/services/jobs/etc and not be locked in. Right now, granite doens’t allow us to have a separate validator for example
<FromGitter> <drujensen> its all or nothing
<FromGitter> <eliasjpr> Fine with me :)
<FromGitter> <drujensen> what would be cool is the have a POCO and then decorate it
<FromGitter> <Blacksmoke16> well athena has mine built in atm. IMO there would have to be some higher level spec to determine how each should be implemented for that to work
<FromGitter> <drujensen> if you add ORM to it, then it will map to a table/column and give you save/delete
<FromGitter> <Blacksmoke16> similar to https://github.com/straight-shoota/taskmaster
<FromGitter> <drujensen> if you add Serializer, you have the ability to convert to json
<FromGitter> <drujensen> so granite has a bunch of includes in its base
<FromGitter> <drujensen> I’m wondering if we can change granite to be more of a set of tools
<FromGitter> <drujensen> and you decorate a POCO to get the functionality you want
<FromGitter> <Blacksmoke16> id be game to strip out some stuff ;p
<FromGitter> <drujensen> validation, serialization, query, etc would be separate modules you would include
<FromGitter> <eliasjpr> Im fine either way honestly I think granite was built with a very focused idea and that idea is evolviing
<FromGitter> <Blacksmoke16> would just need a defined api for how third parties can create other shards to work with it
<FromGitter> <drujensen> how you do the mapping may be annotations
<FromGitter> <eliasjpr> the schema validation thing is trying to address the first 2 of that list @drujensen
<FromGitter> <eliasjpr> and only those two
<FromGitter> <drujensen> right
<FromGitter> <Blacksmoke16> imo the way i imagine things is like you have a class with properties, you then annotate those properties; to control things like ORM mappings, validations, serializations, etc. This way all the logic is there and its nothing more than a crystal class (or struct).
<FromGitter> <eliasjpr> > similar to https://github.com/straight-shoota/taskmaster ⏎ ⏎ This is great!
<FromGitter> <drujensen> @Blacksmoke16 yes, that is what i’m proposing
<FromGitter> <Blacksmoke16> then whatever implementations those things use it doesnt really matter as you're just adding an annotation, not writing custom code for one thing in particular
<FromGitter> <drujensen> yup
<FromGitter> <drujensen> so you could remove serialization if you don’t need it
<FromGitter> <eliasjpr> well
<FromGitter> <eliasjpr> but validation is domain concern
<FromGitter> <drujensen> yes, but in an MVC, it would be in the model
<FromGitter> <drujensen> this would allow you to move that concern where it best fits
<FromGitter> <Blacksmoke16> fits well with json apis as well
<FromGitter> <eliasjpr> we are stating the same then
<FromGitter> <drujensen> yeah
<FromGitter> <eliasjpr> is just matter of adopting a pattern
<FromGitter> <drujensen> right, this will allow you to use different patterns
<FromGitter> <drujensen> repo pattern for example
<FromGitter> <eliasjpr> now will the annotations will still validate without the wiring?
<FromGitter> <drujensen> ???
<FromGitter> <drujensen> you wouldn’t have any mapping without the annotations
<FromGitter> <eliasjpr> personally I like annotations for 2 things 1 auto generate code and 2 if it has the ability to do assertions as tests
<FromGitter> <eliasjpr> I see
<FromGitter> <drujensen> I don’t like annotations at all
<FromGitter> <drujensen> but this woudl be really powerful
<FromGitter> <eliasjpr> so if I want to integrate with Granite I can simply annotate a class
<FromGitter> <drujensen> yes
<FromGitter> <Blacksmoke16> well not yet
<FromGitter> <eliasjpr> okay so if I do not want to use granite and my class is already annotated what happends with the logic that lives in the annotations?
<FromGitter> <Blacksmoke16> that logic lives in the third party shard
<FromGitter> <eliasjpr> does that do something?
<FromGitter> <eliasjpr> why 3rd party?
<FromGitter> <Blacksmoke16> because your app doesnt have anything to do with how granite works
<FromGitter> <eliasjpr> so thats not different than having any other shard no?
<FromGitter> <eliasjpr> understood
<FromGitter> <Blacksmoke16> yes, but the idea would be say you have a class
<FromGitter> <drujensen> it will still fall under the amberframework
<FromGitter> <Blacksmoke16> so if you have a `@[Granite::Column]` on a property
<FromGitter> <drujensen> but you could remove that shard
<FromGitter> <Blacksmoke16> and you want to change to AbcORM
<FromGitter> <Blacksmoke16> would just change it to `@[AbcORM::Column]`
<FromGitter> <Blacksmoke16> (in a perfect world where ORMs have a common pattern)
<FromGitter> <drujensen> that would be an amazing world
<FromGitter> <Blacksmoke16> and you not longer have to change/implement specific things
<FromGitter> <eliasjpr> this only works well in a close ecosystem like .net
<FromGitter> <drujensen> hhmm
<FromGitter> <Blacksmoke16> crystal isnt that big, still doable
<FromGitter> <eliasjpr> where the annotations are standardize
<FromGitter> <Blacksmoke16> define them now while its early
<FromGitter> <eliasjpr> the things is that anyone can create their own annotations
<FromGitter> <drujensen> @eliasjpr that is very true
<FromGitter> <eliasjpr> is like me saying well I want to annotate Orm columns this way and now anyone who wants to use my orm has to do it my way
<FromGitter> <eliasjpr> now I think this is the same issue that macros bring to crystal
<FromGitter> <Blacksmoke16> pretty much
<FromGitter> <drujensen> its the same issue
<FromGitter> <Blacksmoke16> but at least then it wouldn't be radically diff
<FromGitter> <eliasjpr> everyone is defining macros to map orms
<FromGitter> <drujensen> currently, yes
<FromGitter> <Blacksmoke16> would still just be a crystal class with annotations
<FromGitter> <eliasjpr> instead of ussing the crystal way of mapping
<FromGitter> <eliasjpr> which is JSON.mapping
<FromGitter> <eliasjpr> should be generalize for orm
<FromGitter> <drujensen> I had DB.mapping
<FromGitter> <eliasjpr> as ORM.mapping
<FromGitter> <drujensen> in granite years ago
<FromGitter> <eliasjpr> quite honestly I thing that would be best to do
<FromGitter> <drujensen> moved to using the β€œfinished” macro
<FromGitter> <eliasjpr> adopt what the language is doing
<FromGitter> <drujensen> the language has moved over the years
<FromGitter> <drujensen> and granite has moved with it
<FromGitter> <eliasjpr> in fact I might now go back and change it to Schema.mapping
<FromGitter> <drujensen> it was recommended
<FromGitter> <eliasjpr> and Validations.mapping
<FromGitter> <drujensen> now the community is moving to annotations
<FromGitter> <eliasjpr> really?
<FromGitter> <drujensen> not sure i’m a fan but that is the talk
<FromGitter> <drujensen> on the crystal channel
<FromGitter> <eliasjpr> gzz I must been sleeping a lot
<FromGitter> <Blacksmoke16> JSON.mapping is deprecated yea
<FromGitter> <eliasjpr> annotations is not good
<FromGitter> <drujensen> yeah, i agree ;-(
<FromGitter> <eliasjpr> > JSON.mapping is deprecated yea ⏎ ⏎ πŸ‘“
<FromGitter> <eliasjpr> omg
<FromGitter> <Blacksmoke16> well not super officially
<FromGitter> <Blacksmoke16> just the talk i hear
<FromGitter> <eliasjpr> look how easy I was able to add json support to the schema thing
<FromGitter> <eliasjpr> Im very surprised now
<FromGitter> <drujensen> So this is all kinda theoretical if crystal moves to annotations
<FromGitter> <drujensen> @Blacksmoke16 is ahead of the curve on this
<FromGitter> <drujensen> but it is being discussed and annotations is supported
<FromGitter> <eliasjpr> Didnt java moved away from annotations/
<FromGitter> <eliasjpr> annotations are supported on most languages but are use rarely
<FromGitter> <eliasjpr> and only for special cases
<FromGitter> <drujensen> I think java still supports them but yeah
<FromGitter> <Blacksmoke16> we use them a lot at work in PHP Symfony
<FromGitter> <drujensen> so the talk is that they want to remove supporting mutable constants
<FromGitter> <Blacksmoke16> basic modeled Athena and CrSerializer after some stuff they got
<FromGitter> <eliasjpr> mutable is bad
<FromGitter> <drujensen> which is what our macros are using and annotations is being discussed on how to avoid that
<FromGitter> <eliasjpr> specially for constants
<FromGitter> <drujensen> right
<FromGitter> <eliasjpr> constants lol
<FromGitter> <eliasjpr> mutable :thinking_face:
<FromGitter> <drujensen> mutable is not bad but mutable constants is
<FromGitter> <eliasjpr> sorry I have to say that after my scala experiences
<FromGitter> <eliasjpr> πŸ˜“
<FromGitter> <eliasjpr> at the end is cheaper to create a new one that mutate one
<FromGitter> <drujensen> so we have this CONTENT_FIELDS
<FromGitter> <eliasjpr> if Crystal does not want people using constance they should provide a special variable
<FromGitter> <drujensen> macros will add stuff to it
<FromGitter> <drujensen> and then we run a `macro finished` to process them
<FromGitter> <drujensen> my understanding is they want to get rid of the ability to do this
<FromGitter> <drujensen> and the solution is to use annotations
<FromGitter> <drujensen> @Blacksmoke16 is this your understanding as well?
<FromGitter> <eliasjpr> crystal has to lock and commit it cant have everything
<FromGitter> <eliasjpr> imo
<FromGitter> <Blacksmoke16> uhh, i know that is frowned upon, i dont know what the ultimate plan with them is tho
<FromGitter> <drujensen> we could go back to using the `ORM.mapping do`
<FromGitter> <drujensen> instead of the cleaner `field :name`
<FromGitter> <eliasjpr> you cans still use field no?
<FromGitter> <drujensen> or we can move to the uglier `@[Granite::Column]` annotations
<FromGitter> <drujensen> field is using the `macro finished` to process them
<FromGitter> <eliasjpr> or pass it an object with the fields it needs πŸ˜…
<FromGitter> <drujensen> they get added to a CONST
<FromGitter> <drujensen> lol
<FromGitter> <Blacksmoke16> https://github.com/Blacksmoke16/athena/releases/tag/v0.1.0 published v0.1.0 if you wanted to checkout it out
<FromGitter> <drujensen> it would still need a mapping but yeah, we could do that
<FromGitter> <drujensen> cool!
<FromGitter> <Blacksmoke16> thats my big pet peeve, defining properties AND a mapping
<FromGitter> <Blacksmoke16> so anything that helps with that is πŸ’―
<FromGitter> <eliasjpr> congrats
<FromGitter> <Blacksmoke16> id say annotations are still up in the air, ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Id be happy with this syntax as well [https://gitter.im/amberframework/amber?at=5c32dc1857c6883f9b7561c0]
<FromGitter> <eliasjpr> I wanna see more of athena
<FromGitter> <eliasjpr> and take her for a dance
<FromGitter> <Blacksmoke16> ;) id welcome the feedback, feel free to create issues
<FromGitter> <eliasjpr> is `# The user's current password` annotation or simply comment?
<FromGitter> <Blacksmoke16> comment
<FromGitter> <eliasjpr> ok
<FromGitter> <Blacksmoke16> that adds annotations to the comment bock of a property
<FromGitter> <eliasjpr> ok
<FromGitter> <eliasjpr> I see
<FromGitter> <Blacksmoke16> but stuff is still up in the air, really comes down to need someone to implement it
<FromGitter> <eliasjpr> who is driving this conversation?
<FromGitter> <Blacksmoke16> https://github.com/crystal-lang/crystal/issues/7000 well it was here
<FromGitter> <Blacksmoke16> but maybe the forums?
<FromGitter> <Blacksmoke16> is also https://github.com/crystal-lang/crystal/issues/7274
<FromGitter> <Blacksmoke16> which would be helpful
<FromGitter> <Blacksmoke16> vs my not terrible work around for athena
<FromGitter> <eliasjpr> πŸ˜… saw who opened the PR and I was already with mixed feelings
<FromGitter> <drujensen> I dislike annotations but I agree with Vlad that they are currently pretty ugly
<FromGitter> <drujensen> and a different syntax may help
<FromGitter> <eliasjpr> unnecessary evil
<FromGitter> <drujensen> yeah, i know
<FromGitter> <drujensen> I think symphony looks nicer
<FromGitter> <eliasjpr> look scala uses anotations for instance to tell the compiler things
<FromGitter> <eliasjpr> for intances you can tell the scala compiler that a method is tail recursive
<FromGitter> <eliasjpr> and scala compiler will do something magical if you tell him that
<FromGitter> <eliasjpr> it will optimize for that operation and ensure that your code will work
<FromGitter> <drujensen> nice. other languages do the same thing
<FromGitter> <eliasjpr> basically what I am trying to say is that annotations are reserved at least in scala to speak to the compiler
<FromGitter> <drujensen> ugly as hell
<FromGitter> <drujensen> not crystal or ruby'ish as all
<FromGitter> <eliasjpr> and this is how you do that `@tailrec` in scala
<FromGitter> <eliasjpr> so to your point it is cleaner
<FromGitter> <Blacksmoke16> https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v3.0/petstore.yaml is what i had in mind, when i was talking about swagger spec
<FromGitter> <eliasjpr> but we are already using the `@` symbol
<FromGitter> <Blacksmoke16> which allows for nice generated docs like https://petstore.swagger.io/
<FromGitter> <eliasjpr> I use swagger a lot at work
<FromGitter> <drujensen> @Blacksmoke16 I use swagger at work
<FromGitter> <drujensen> lol
<FromGitter> <Blacksmoke16> :3
<FromGitter> <eliasjpr> you see that is good use of annotation
<FromGitter> <Blacksmoke16> game i play uses it for their api
<FromGitter> <eliasjpr> because it will not cause my side effect on my cde
<FromGitter> <Blacksmoke16> miles better than their old api
<FromGitter> <drujensen> @eliasjpr if an annotation causes a side affect, you think it shouldn’t be used?
<FromGitter> <drujensen> Is that your rule of thumb?
<FromGitter> <Blacksmoke16> anyway, im off to bed. ill catch up tomorrow
<FromGitter> <drujensen> good night. thanks for all the improvements!
<FromGitter> <eliasjpr> I am no expert but going back to the scala thing, no annotation affects the output of your code
<FromGitter> <drujensen> it will work with or without the annotation
<FromGitter> <eliasjpr> is simply used to enhance the compiler knowlege of the code
<FromGitter> <eliasjpr> yes
<FromGitter> <drujensen> right, i think that makes perfect sense
<FromGitter> <drujensen> using it to do ORM mapping may be an abuse
<FromGitter> <eliasjpr> In Scala 2.8, you will also be able to use the new @tailrec annotation to get information about which methods are optimised. ⏎ This annotation lets you mark specific methods that you hope the compiler will optimise. ⏎ You will then get a warning if they are not optimised by the compiler.
<FromGitter> <drujensen> you should add this to my fib repo
<FromGitter> <eliasjpr> so everything at compile time not run time
<FromGitter> <eliasjpr> lol
<FromGitter> <drujensen> https://github.com/drujensen/fib
<FromGitter> <drujensen> I don’t have scala yet
<FromGitter> <eliasjpr> yes you should
<FromGitter> <drujensen> and @tailrec would be inthe optimized versions
<FromGitter> <eliasjpr> i guess it will
<FromGitter> <drujensen> lol
<FromGitter> <eliasjpr> haha πŸ˜…
<FromGitter> <drujensen> example of using a constexpr
<FromGitter> <drujensen> python annotation
<FromGitter> <eliasjpr> that last one is about memory allocation lru
<FromGitter> <drujensen> yup
<FromGitter> <eliasjpr> you should add it and run the benchmark
<FromGitter> <eliasjpr> I heading to bed
<FromGitter> <drujensen> you, ok. good night!
<FromGitter> <eliasjpr> got to work on scala code tomorrow
<FromGitter> <eliasjpr> :sad:
<FromGitter> <drujensen> haha
<FromGitter> <eliasjpr> i was enjoying crystal a lot over the weekend
<FromGitter> <eliasjpr> β™₯️
<feepbot> Awwwwwwwwwwwwwww!
<FromGitter> <eliasjpr> gn
<FromGitter> <vifreefly> > validation, serialization, query, etc would be separate modules you would include ⏎ ⏎ Sounds like a good idea! Similar to Sequel plugin system (Ruby's best ORM adapter ever) https://sequel.jeremyevans.net/plugins.html
feepbot has quit [Ping timeout: 240 seconds]
feepbot has joined #amber
_whitelogger has joined #amber
<FromGitter> <eliasjpr> @drujensen something in Granite is breaking the tests for amber. https://travis-ci.org/amberframework/amber/jobs/476412488
<FromGitter> <Blacksmoke16> ah
<FromGitter> <Blacksmoke16> fix for that is just make sure `Granite.settings.logger` isnt nil before setting that
<FromGitter> <Blacksmoke16> in the past the logger was defaulted to `Logger.new nil` which would silently swallow everything that was logged to it
<FromGitter> <Blacksmoke16> because of the colorize stuff, i changed it to be `nil` by default, so the extra logging logic wouldnt run if the user didnt define a logger
<FromGitter> <Blacksmoke16> i can make a PR to fix that in amber later today if you need
<FromGitter> <Blacksmoke16> @eliasjpr
<FromGitter> <eliasjpr> Sweet! If you can get to that cause some PRs are failing because of it
<FromGitter> <Blacksmoke16> yea can do when i get home tonight
<FromGitter> <Blacksmoke16> should be pretty easy
<FromGitter> <eliasjpr> yes
<FromGitter> <Blacksmoke16> @eliasjpr Managed to do it via Gitub UI
<FromGitter> <Blacksmoke16> hmm, why did that log granite queries
<FromGitter> <Blacksmoke16> ah, fixed
<FromGitter> <eliasjpr> I gave it πŸ‘
<FromGitter> <Blacksmoke16> @drujensen Rx14 brought to my attention a better way to handle the logger thing, I'll make a PR tonight.
<FromGitter> <Blacksmoke16> Not a major issue, can just wait till next release
<FromGitter> <drujensen> πŸ‘
<FromGitter> <drujensen> @vifreefly thanks for that reference library toolkit. ❀️
<FromGitter> <drujensen> Looks awesome
<FromGitter> <vifreefly> @drujensen Glad to help! As for me, Sequel in many ways much more better than ActiveRecord (performance, working with threads, etc, in more details explained by Janko Marohnić here https://twin.github.io/ode-to-sequel/ and here https://bits.citrusbyte.com/building-sql-expressions-with-sequel/ )