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
snsei has joined #amber
snsei has quit [Ping timeout: 252 seconds]
<FromGitter> <waghanza> thats what I using for `go` comparison, happy to use the same for `©rystal` ⏎ https://github.com/the-benchmarker/web-frameworks/pull/632
snsei has joined #amber
snsei has quit [Ping timeout: 268 seconds]
feepbot has quit [Ping timeout: 250 seconds]
feepbot has joined #amber
snsei has joined #amber
snsei has quit [Ping timeout: 268 seconds]
snsei has joined #amber
<FromGitter> <Blacksmoke16> @drujensen @robacarp I took another stab at the annotation based approach, however i'm not sure if it is something that would be worth it, thoughts?
<FromGitter> <Blacksmoke16> benefits of it would be like, everything would kinda just work.. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5bfeda9ad24f9324d26a0e2d]
<FromGitter> <Blacksmoke16> downsides it would require a good chunk of refactoring and some pretty significant changes in usage. For example on the prototype i have, i removed validations for now (inheritance works now tho), have to explicitly declare table and primary keys, with PK key being nilable
<FromGitter> <Blacksmoke16> There might be solutions to some/all of the issues but for now thats what im running with...
<FromGitter> <drujensen> I really dislike the annotations myself. I think they look ugly and I’ve always avoided them in Java/Hibernate implementations myself.
<FromGitter> <drujensen> I may be in the minority though
<FromGitter> <drujensen> @ro
snsei has quit [Remote host closed the connection]
snsei has joined #amber
snsei has quit [Remote host closed the connection]
<FromGitter> <robacarp> I’m with you, Dru. There is a lot of potential, but I’d avoid it wherever possible.
<FromGitter> <Blacksmoke16> fair enough
<FromGitter> <Blacksmoke16> guess im the sole supporter. Just seems that it'll have to be done eventually. based on what i keep reading it sounds like the mutable constants and such we're doing isnt real liked and would in future possibly be replaced by annotations
<FromGitter> <Blacksmoke16> plus the amount of boilerplate and stuff i was able to remove with this is great
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5bff0a34e25cc274055b5adb]
<FromGitter> <Blacksmoke16> like thats what i got the fields module down to
<FromGitter> <drujensen> wow, nice. So you just look up the annotation instead of maintaining the mutable constant on your own
<FromGitter> <Blacksmoke16> yes, just use macros to find all ivars with the annotatino
<FromGitter> <Blacksmoke16> which then sets the return values for these methods to use
<FromGitter> <drujensen> damn…if they weren’t so ugly...
<FromGitter> <drujensen> i’m torn, this is so much nicer
<FromGitter> <Blacksmoke16> also opens the door for properties on the annotations, so imagine something like
<FromGitter> <drujensen> But this is so much uglier ⏎ ⏎ ```@[Granite::Column] ⏎ @[Granite::PrimaryKey] ⏎ property id : Int64?``` [https://gitter.im/amberframework/amber?at=5bff0cef8dffd748dbfa24a4]
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5bff0cf5b6c0701052a25b4c]
<FromGitter> <Blacksmoke16> im undecided on how to handle some of this still, is still a prototype/idea stage so just seeing if everything is doable atm
<FromGitter> <Blacksmoke16> i.e. could have a `@[Granite::Column(primary: true)]` instead
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5bff0d45cfa682348d9d4236]
<FromGitter> <drujensen> that is a little better. maybe i can tell my browser to hide the annotations. ;-)
<FromGitter> <Blacksmoke16> i mean in theory you could make it pick up *all* ivars on a type
<FromGitter> <Blacksmoke16> and just have a `@[Granite::Exclude]` or something
<FromGitter> <Blacksmoke16> on ones you dont want, vs annotating ones you *do* want to act as fields
<FromGitter> <drujensen> how serious is the crystal core team on removing mutable constants?
<FromGitter> <Blacksmoke16> but granted i dont think its going to happen tomorrow so :shrug:
<FromGitter> <Blacksmoke16> ill prob work on it for the fun of it and will at least have something if it ever comes to it
<FromGitter> <drujensen> that sucks
<FromGitter> <drujensen> not you, i mean that they are recommending annotations
<FromGitter> <drujensen> i find them an eyesore myself
<FromGitter> <drujensen> hard to read and distracting
<FromGitter> <Blacksmoke16> to each their own i guess, im a big fan. the things they allow you to do and makes it pretty clear what they are doing is super nice vs how you would have to do it otherwise
<FromGitter> <Blacksmoke16> like macing a macro to build the property for you etc
<FromGitter> <drujensen> no, i get that they are powerful. used them all the time in Java
<FromGitter> <Blacksmoke16> so like any annotations people want to apply, e.g. from my validation/serialization lib etc just works
<FromGitter> <drujensen> just not asthetically pleasing
<FromGitter> <drujensen> you lose the eye pleasing code that ruby provided
<FromGitter> <Blacksmoke16> did ruby have annotations?
<FromGitter> <drujensen> one of the big reasons to choose Crystal imo
<FromGitter> <drujensen> not that i’m aware of
<FromGitter> <drujensen> never seen it in any code i’ve ever worked on for the last 10 years
<FromGitter> <Blacksmoke16> am wondering how you would do this kind of stuff in ruby
<FromGitter> <Blacksmoke16> or do they have their own system in place to handle this kind of stuff
<FromGitter> <drujensen> ruby is interpreted so you can pretty much do anything
<FromGitter> <drujensen> method missing, etc
<FromGitter> <drujensen> meta programming
<FromGitter> <drujensen> macros provide a similar power
<FromGitter> <drujensen> oh well, I agree its powerful and will definitely clean up stuff
<FromGitter> <drujensen> but it will get fairly ugly once everyone decides to use them
<FromGitter> <drujensen> and abuse them. ::=/
<FromGitter> <Blacksmoke16> just like with macros ;)
<FromGitter> <drujensen> yup
<FromGitter> <drujensen> lol
<FromGitter> <drujensen> gotta go
<FromGitter> <drujensen> ttyl
<FromGitter> <Blacksmoke16> o/
<FromGitter> <robacarp> there are non-annotation ways of solving the problem of mutable constants though
<FromGitter> <robacarp> I can't find it but somewhere something like this has been discussed: ⏎ ⏎ `````` [https://gitter.im/amberframework/amber?at=5bff157df849b222e0bc5bd9]
<FromGitter> <robacarp> ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5bff164e958fc53895057887]
<FromGitter> <robacarp> I believe the jennifer orm does similar
<FromGitter> <Blacksmoke16> true true
<FromGitter> <robacarp> at the end of the "columns" macro processing, it renders the fields and such. I think granite used to do it this way as well, actually, but switched to the finished macro at some point in history.
<FromGitter> <Blacksmoke16> where in reality the macros just add the properties and such to the class?
<FromGitter> <robacarp> right now?
<FromGitter> <Blacksmoke16> in that example
<FromGitter> <Blacksmoke16> but yea, thats what the `field` macro does atm
<FromGitter> <robacarp> I think the `field` macro would add to a macro-space variable, which isn't a "constant", and is then iterated at the end of the `columns` macroblock
<FromGitter> <robacarp> reading back, my objection to annotations is pretty much the same as what Dru said: they're kind of messy looking. Maybe the functionality they provide is great, and if it's the best way to go then :shrug:
<FromGitter> <robacarp> ¯\_(ツ)_/¯
snsei has joined #amber
<FromGitter> <Blacksmoke16> too early to tell for now
<FromGitter> <Blacksmoke16> not something that has to be done until some more concrete info comes along
<FromGitter> <robacarp> yeah, I worry that the concrete info isn't going to come along until way too late :<
<FromGitter> <Blacksmoke16> :P
<FromGitter> <Blacksmoke16> see how it goes i guess
snsei has quit [Remote host closed the connection]
snsei has joined #amber
snsei has quit [Remote host closed the connection]
snsei has joined #amber
<FromGitter> <drujensen> I wonder if they can make the annotations look more rubyish instead of `@[]`
<FromGitter> <drujensen> like a comment or something
snsei has quit [Remote host closed the connection]