<hightower3>
How about, if these are generated through macros, adding them to an arraylisteral or hashliteral first jsut as names, then sorting and changing the list before outputting them as series of #new() lines?
<FromGitter>
<Blacksmoke16> the hard part is the sorting itself :p
<hightower3>
due to unclear rules when sorting, or?
<FromGitter>
<Blacksmoke16> is what i have access to, (built in method wise) which im not sure how that would be used in my case
<FromGitter>
<Blacksmoke16> at a high level the order should be like {no_service_deps, services_with_service_dep(ordered so they get defined in correct order)}
duane has joined #crystal-lang
<FromGitter>
<Blacksmoke16> > unclear rules ⏎ ⏎ pretty much
<FromGitter>
<Blacksmoke16> would have to be like `for each service, iterate over that services deps, then compute some metric to use as the comparator`
<FromGitter>
<Blacksmoke16> but i have no idea what the `comparator` would be
<FromGitter>
<Blacksmoke16> sum of the occurrences of service deps in each service? hmm
<FromGitter>
<Blacksmoke16> is what i ended up doing
<FromGitter>
<Blacksmoke16> problem now is it would be possible to get into an infinite loop..
<FromGitter>
<Blacksmoke16> but :shrug:
<FromGitter>
<watzon> Is it possible to make a macro that works like the `%w`, `%x`, etc literals? I feel like the answer is no, but for DSL purposes it would be really helpful for me if I could basically make a list without commas
<FromGitter>
<Blacksmoke16> like within the macro syntax, or that you pass to a macro?
<FromGitter>
<Blacksmoke16> assuming the latter it *should* work since its essentially just an array?
<FromGitter>
<watzon> Within the syntax. I'll explain more later, g2g haha
<FromGitter>
<Blacksmoke16> 👍
<FromGitter>
<Blacksmoke16> :phew:
<FromGitter>
<Blacksmoke16> i think this is working
<FromGitter>
<Blacksmoke16> i now support optional dependencies
<FromGitter>
<Blacksmoke16> if there is a service named `logger` registered, it would get injected, otherwise would be set to `nil`
<FromGitter>
<Blacksmoke16> main use case of this is say you have one project that you want to make optionally depend on another. inject an optional service (like a logger), if its not nil. log something, otherwise skip
<FromGitter>
<Blacksmoke16> where the logger service could come from installing another shard, or adding another require
netbastard has quit [Read error: Connection reset by peer]
netbastard has joined #crystal-lang
<FromGitter>
<christopherzimmerman> Has anyone run into issues with crystal being much slower on Mac OSX than unix?
<tleydxdy>
maybe your Mac is just overheating
hightower3 has quit [Ping timeout: 265 seconds]
f1refly has joined #crystal-lang
f1reflyylmao has quit [Ping timeout: 265 seconds]
<FromGitter>
<wontruefree> @christopherzimmerman I find crystal to be faster on Linux. But then I run ruby on both and remember how far crystal has come
<FromGitter>
<christopherzimmerman> That's good to hear at least, it was depressing having my benchmarks be at least 3x faster than numpy on linux and 3 times as slow on mac
<Yxhuvud>
have you verified that numpy isn't doing special optimizations on mac? do you link against hte same c binaries etc?
<FromGitter>
<christopherzimmerman> If it was anything that depended on blas or lapack that could factor in, since Mac uses accelerate which includes implementations of those. But I've just been benchmarking elementwise operations
<FromGitter>
<christopherzimmerman> My numpy flags are pretty much identical apart from using accelerate
f1refly has quit [Read error: Connection reset by peer]
f1reflyylmao has joined #crystal-lang
<FromGitter>
<vlazar> How to compare these benchmarks to numpy?
<FromGitter>
<vlazar> I can try to run, to see if I'll get similar results on MacOS.
<FromGitter>
<christopherzimmerman> Use the ones on the “perf” branch to see the faster ones. I fixed reductions and accumulations. They are about 5x slower on master
<FromGitter>
<christopherzimmerman> I really need to maintain a nightly branch that has stuff I’m testing on it.
<FromGitter>
<christopherzimmerman> Yea that’s what I was seeing on mac.
<FromGitter>
<vlazar> mid is 4x slower ⏎ large is just 1.5x slower
<FromGitter>
<vlazar> I would imagine in numpy there was a lot of effort to make it fast
<FromGitter>
<vlazar> but it's weird linux is much faster for computations
<FromGitter>
<vlazar> thank you for working on bottle, it's what will make more people interested in Crystal
<FromGitter>
<christopherzimmerman> Thanks, having lots of fun working on it! I just wanted to implement something similar to pandas, but needed the underlying ndarray to do it, so had to do bottle first :P
<FromGitter>
<asterite> I can try to profile these benchmarks on mac osx and see if I can optimize them
<FromGitter>
<christopherzimmerman> Are there any good tools for profiling crystal? I've been using instruments on osx so far.
<FromGitter>
<watzon> @christopherzimmerman hahaha that's how things work in a lesser known language. *I want A, but A requires B which relies on C, so I need to build C and B to get to A*
hightower4 has joined #crystal-lang
return0e_ has joined #crystal-lang
<FromGitter>
<manveru> is there any way to get pattern matching like `def foo(:a); end; def foo(:b); end`?
<FromGitter>
<Blacksmoke16> use an enum
<FromGitter>
<manveru> then calling `foo(:b)` would excute the second one
return0e has quit [Ping timeout: 265 seconds]
<FromGitter>
<Blacksmoke16> or some method with a case in it that calls the corresponding method based on the value
<FromGitter>
<watzon> There is method overloading, but there isn't pattern matching like you'd find in Elixir
<FromGitter>
<asterite> I use instruments on osx too