ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.31.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
dwdv has quit [Ping timeout: 268 seconds]
<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> mainly how it would work, https://crystal-lang.org/api/master/Array.html#sort_by(&block:T-%3E_):Array(T)-instance-method
<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
duane has quit [Ping timeout: 265 seconds]
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5de31b2d32df1245cbbf4b77]
<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> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5de321c95ac7f22fb53b8f74]
<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
DTZUZO has quit [Ping timeout: 240 seconds]
Vexatos has quit [Quit: ZNC Quit]
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
<Yxhuvud> Then it sounds really strange.
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 250 seconds]
ht_ has joined #crystal-lang
dwdv has joined #crystal-lang
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 276 seconds]
DTZUZO has joined #crystal-lang
Vexatos has joined #crystal-lang
DTZUZO has quit [Ping timeout: 252 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 268 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 250 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 268 seconds]
DTZUZO has joined #crystal-lang
alexherbo2 has joined #crystal-lang
DTZUZO has quit [Ping timeout: 276 seconds]
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
alexherbo2 has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 250 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 250 seconds]
Human_G33k has joined #crystal-lang
Human_G33k has quit [Remote host closed the connection]
Human_G33k has joined #crystal-lang
HumanG33k has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
<FromGitter> <vlazar> You mean these benchmarks are slow on MacOS? https://github.com/crystal-data/bottle/tree/master/benchmarks
_whitelogger has joined #crystal-lang
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.
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
dannyAAM has quit [Client Quit]
dannyAAM has joined #crystal-lang
dannyAAM has quit [Client Quit]
dannyAAM has joined #crystal-lang
<FromGitter> <vlazar> @christopherzimmerman I've ran benchmarks https://gist.github.com/vlazar/53ed68232627d21638e346e40807c76b ⏎ Don't know if it's of any help to you. How to compare to numpy now to see if it's slower for me too?
netbastard has quit [Ping timeout: 250 seconds]
alexherbo2 has joined #crystal-lang
netbastard has joined #crystal-lang
Vexatos has quit [*.net *.split]
jetpack_joe has quit [*.net *.split]
melthelesbian has quit [*.net *.split]
jetpack_joe has joined #crystal-lang
melthelesbian has joined #crystal-lang
Vexatos has joined #crystal-lang
Vexatos has quit [Remote host closed the connection]
Vexatos has joined #crystal-lang
<FromGitter> <christopherzimmerman> Thanks for running those. I just ran the benchmarks that numpy includes in their source.
<FromGitter> <vlazar> I can run numpy benchmarks too, have one row I can compare from both benchmarks? :)
<FromGitter> <christopherzimmerman> Look at their bench core, I copied the elementwise operations directly.
<FromGitter> <christopherzimmerman> It matches up with the “Arithmetic” section of mine
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
<FromGitter> <vlazar> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5de407929319bb5190c4c82a]
<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
ht_ has quit [Quit: ht_]