These are chat archives for dry-rb/chat

10th
Dec 2015
just gonna leave it here ;)
Peter Leitzen
@splattael
Dec 10 2015 15:57 UTC
hey!
does dry-data depend on dry-equalizer? I'm getting a LoadError: require': cannot load such file -- dry-equalizer pointing to dry-data-0.3.1/lib/dry/data/constraints.rb:1
Piotr Solnica
@solnic
Dec 10 2015 15:58 UTC
@splattael hm, I thought I fixed it in 0.3.1
Piotr Solnica
@solnic
Dec 10 2015 15:59 UTC
oh man
Peter Leitzen
@splattael
Dec 10 2015 15:59 UTC
btw, trying to run your benchmark @solnic :D
Piotr Solnica
@solnic
Dec 10 2015 15:59 UTC
yes, well, that’s a double screw-up
I need to fix it on the dry-validation side
Peter Leitzen
@splattael
Dec 10 2015 15:59 UTC
ok, should I file an issue? :D
Piotr Solnica
@solnic
Dec 10 2015 16:00 UTC
no, thanks. there’s an issue about that already which I thought I fixed
Peter Leitzen
@splattael
Dec 10 2015 16:00 UTC
:+1: perfect
Piotr Solnica
@solnic
Dec 10 2015 16:26 UTC
@splattael I fixed it by adding a new feature, go figure ;)
Piotr Solnica
@solnic
Dec 10 2015 16:35 UTC
@splattael I pushed 0.3.2 with Dry::Data::Value support
it also fixes the issue with the missing require
oh and that benchmark is in the repo now
Andy Holland
@AMHOL
Dec 10 2015 16:37 UTC
Build is failing on rubinius
Piotr Solnica
@solnic
Dec 10 2015 16:37 UTC
I know
Andy Holland
@AMHOL
Dec 10 2015 16:37 UTC
Cool :)
Piotr Solnica
@solnic
Dec 10 2015 16:37 UTC
sth weird with thread_safe require
no time to look into this now
Andy Holland
@AMHOL
Dec 10 2015 16:39 UTC
Just wasn't sure you saw it
Piotr Solnica
@solnic
Dec 10 2015 16:41 UTC
it works when the whole thread_safe is required
but we only use cache
so I just required that, works everywhere, except rbx ¯_(⊙ʖ⊙)
Andy Holland
@AMHOL
Dec 10 2015 16:42 UTC
Yeah, seen a lot of weird fuckups on rbx
Piotr Solnica
@solnic
Dec 10 2015 16:43 UTC
ruby-concurrency/thread_safe#23
reported an issue
Andy Holland
@AMHOL
Dec 10 2015 16:44 UTC
Cool
Piotr Solnica
@solnic
Dec 10 2015 16:45 UTC
dryrb/dry-data@faf3d73 there, I fixed it ;)
Andy Holland
@AMHOL
Dec 10 2015 16:45 UTC
lmao :heart:
Piotr Solnica
@solnic
Dec 10 2015 16:46 UTC
ugh, what a no-life OH WAIT
Andy Holland
@AMHOL
Dec 10 2015 16:46 UTC
lmao
I'm #1 in Manchester
Out of 2 :(
Piotr Solnica
@solnic
Dec 10 2015 16:46 UTC
^5
Hunter Madison
@hmadison
Dec 10 2015 16:47 UTC
I'm 420 worldwide?
Piotr Solnica
@solnic
Dec 10 2015 16:47 UTC
I’m number 1 in Kraków out of 1
such success :joy:
Andy Holland
@AMHOL
Dec 10 2015 16:47 UTC
:laughing:
solnic @solnic updates his CV
Andy Holland
@AMHOL
Dec 10 2015 16:48 UTC
:joy:
@solnic you can put #1 Ruby, Elixir, Shell, C & Javascript programmer in Kraków
Piotr Solnica
@solnic
Dec 10 2015 16:50 UTC
yeah man, especially C
Andy Holland
@AMHOL
Dec 10 2015 16:51 UTC
lol
Piotr Solnica
@solnic
Dec 10 2015 16:51 UTC
btw I started looking at rust
Andy Holland
@AMHOL
Dec 10 2015 16:51 UTC
Nice, I saw brew install rust on your Twitter feed
How are you finding it?
Piotr Solnica
@solnic
Dec 10 2015 16:51 UTC
it’s an interesting language
I haven’t written anything real yet
2 hours were not enough
but I learned about some basics, like how to setup a project, compile it, run tests etc
Andy Holland
@AMHOL
Dec 10 2015 16:52 UTC
Cool, interesting in what sense?
Piotr Solnica
@solnic
Dec 10 2015 16:52 UTC
plus about its primitive types, generics and traits
Andy Holland
@AMHOL
Dec 10 2015 16:52 UTC
New concepts?
Ahh nice, I haven't really looked into it myself
Think I might have to learn Go for work
Hunter Madison
@hmadison
Dec 10 2015 16:56 UTC
Go isn't that bad
Provided you treat it like C
It's type system is anemic
Piotr Solnica
@solnic
Dec 10 2015 16:57 UTC
friends told me lack of generics is a pita
Hunter Madison
@hmadison
Dec 10 2015 16:57 UTC
For some applications
Piotr Solnica
@solnic
Dec 10 2015 16:58 UTC
heard some insane stories about libs compiled into few variations each dedicated to work with a specific type O_o
Hunter Madison
@hmadison
Dec 10 2015 16:58 UTC
Yeah
I've also found that every place I could use Go Erlang is a better fit
What I find cool about rust is the fad
*fact that most data structures run w/o gc
Piotr Solnica
@solnic
Dec 10 2015 17:01 UTC
yeah that’s…intriguing
Hunter Madison
@hmadison
Dec 10 2015 17:02 UTC
It's also one of teo
*three popular languages to use substructral types
Piotr Solnica
@solnic
Dec 10 2015 17:03 UTC
gotta read about that
Hunter Madison
@hmadison
Dec 10 2015 17:04 UTC
Afaik David walker wrote a good guide on it
Piotr Solnica
@solnic
Dec 10 2015 17:38 UTC
@AMHOL hey mate, seems like we’re using ancient technology: https://github.com/ruby-concurrency/thread_safe/issues/23#issuecomment-163696906
(thread_safe is now part of concurrent gem)
I guess we must make the switch...
Andy Holland
@AMHOL
Dec 10 2015 17:39 UTC
Yeah, defo, I'll have a look at changing stuff over next time I get a chance :+1:
Piotr Solnica
@solnic
Dec 10 2015 17:39 UTC
cool!
Andy Holland
@AMHOL
Dec 10 2015 17:40 UTC
Unless I win 250 grand on this scratch card, then I'm off on holiday for a year :laughing:
Piotr Solnica
@solnic
Dec 10 2015 17:41 UTC
what’s up with you british people and scratch cards, my wife came back from UK and she’s scratching those cards now!!11
Peter Leitzen
@splattael
Dec 10 2015 17:41 UTC
@solnic thanks for fixing <3
Piotr Solnica
@solnic
Dec 10 2015 17:41 UTC
@splattael sure :)
Andy Holland
@AMHOL
Dec 10 2015 17:42 UTC
Life is so shit over here you have to have your dreams
Piotr Solnica
@solnic
Dec 10 2015 17:42 UTC
@AMHOL right :)
Andy Holland
@AMHOL
Dec 10 2015 17:42 UTC
lol
Well, I spent 4 pounds and won 5 :)
Piotr Solnica
@solnic
Dec 10 2015 17:44 UTC
that’s progress, baby steps man, take it easy and be patient
Andy Holland
@AMHOL
Dec 10 2015 17:45 UTC
:joy:
I like your outlook
Now I just need to buy 249,999 more scratch cards
Piotr Solnica
@solnic
Dec 10 2015 17:46 UTC
lol
Peter Leitzen
@splattael
Dec 10 2015 18:09 UTC
@solnic I made AM::Validation even slowerrr "7.0x": splattael/dry-data@24b3b9c ;)
Andy Holland
@AMHOL
Dec 10 2015 18:52 UTC
@solnic is there a public API to get attribute names from a Dry::Data::Struct?
Piotr Solnica
@solnic
Dec 10 2015 18:54 UTC
@AMHOL kinda, self.class.schema.keys
Andy Holland
@AMHOL
Dec 10 2015 18:55 UTC
OK, thanks
Looking at rom-rb/rom-http#7 again
Piotr Solnica
@solnic
Dec 10 2015 18:58 UTC
@AMHOL btw I want to add json.* types to dry-data
probably a lot in common with form.*
Andy Holland
@AMHOL
Dec 10 2015 18:59 UTC
Nice, didn't think of that :)
Andy Holland
@AMHOL
Dec 10 2015 19:11 UTC
Sorry @solnic meant a Dry::Data::Type::Hash
Piotr Solnica
@solnic
Dec 10 2015 19:13 UTC
@AMHOL nope, at least not yet
Andy Holland
@AMHOL
Dec 10 2015 19:13 UTC
Ahh OK
Peter Leitzen
@splattael
Dec 10 2015 19:26 UTC
@solnic thoughts about my perf eval hack? Too ugly? Is it worth to follow that path?
Andy Holland
@AMHOL
Dec 10 2015 19:40 UTC
It's still pretty ugly @solnic rom-rb/rom-http#7
If I used structs it would be much simpler, but I want to get hashes and maintain the DSL
Piotr Solnica
@solnic
Dec 10 2015 19:43 UTC
@AMHOL which part is ugly?
It's basically repeating the struct DSL
Piotr Solnica
@solnic
Dec 10 2015 19:47 UTC
we can generalize this dsl
Andy Holland
@AMHOL
Dec 10 2015 19:47 UTC
Do you think it makes sense for a hash?
Piotr Solnica
@solnic
Dec 10 2015 19:47 UTC
ie extend Dry::Data::AttributeDSL
Andy Holland
@AMHOL
Dec 10 2015 19:48 UTC
That would be cool
Piotr Solnica
@solnic
Dec 10 2015 20:01 UTC
@splattael I’d like to avoid such solutions, at least for now :)
Peter Leitzen
@splattael
Dec 10 2015 20:05 UTC
Damn, but you're right. I thought I could lure you with perf boost ;)
There is a lot room for perf improvement at those kind of use-cases.
Peter Leitzen
@splattael
Dec 10 2015 20:12 UTC
Data definition is static therefore most (maybe all?) code pathes which depend on those definitions could be pre-compiled avoiding tedious (hash) iterations.
Hash.strict_constructor could benefit from those "solutions" too
(I've done too much Elixir and Crystal lately, dammit)
Piotr Solnica
@solnic
Dec 10 2015 20:47 UTC
@splattael in this case it defines a new constructor every time you call attribute so I dunno, feels "wrong"
and btw we have dry-constructor that I would like to use there soon
Peter Leitzen
@splattael
Dec 10 2015 20:49 UTC
@solnic true, you could define this constructor only once in self.new
I know my patch is just a hack but it improved perf a lot
Piotr Solnica
@solnic
Dec 10 2015 20:50 UTC
Just to make it clear, I am all for perf improvements :) to a point where I want to write various extensions in rust for dry and transproc :joy:
Peter Leitzen
@splattael
Dec 10 2015 20:51 UTC
o^O nice! :D
Piotr Solnica
@solnic
Dec 10 2015 20:52 UTC
ie form coercions in dry-data or those heavy transformations in transproc...imagine dat speed boost
Peter Leitzen
@splattael
Dec 10 2015 20:53 UTC
over nine thousand! at least :D
we should do more code compilation in Ruby. read "macros" :D
Piotr Solnica
@solnic
Dec 10 2015 20:58 UTC
Word
Peter Leitzen
@splattael
Dec 10 2015 20:58 UTC
@solnic https://gist.github.com/splattael/41a87cbde4cf08efa479 <- idea might boost Type::Hash.*_constructor because we know the attributes upfront
Piotr Solnica
@solnic
Dec 10 2015 20:58 UTC
:D
Peter Leitzen
@splattael
Dec 10 2015 21:00 UTC
I like @plexus' macros: https://github.com/plexus/macros
Peter Leitzen
@splattael
Dec 10 2015 21:06 UTC
@solnic regarding redefining initializer over and over again: splattael/dry-data@922dc4a
gonna stop stealing your time - just my 2 cents :D
Piotr Solnica
@solnic
Dec 10 2015 21:22 UTC
:ok I see what you did there
Peter Leitzen
@splattael
Dec 10 2015 21:23 UTC
:D