ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.31.0 | 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
<FromGitter> <anamba> hmm. anyone else seen this? sometimes, if i compile with --error-trace, it crashes. if i remove --error-trace, it completes just fine.
<FromGitter> <anamba> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d8d54f4290b8c354ae03d45]
<FromGitter> <Blacksmoke16> you on mac?
<FromGitter> <anamba> ubuntu 18.04
<FromGitter> <Blacksmoke16> ok
<FromGitter> <anamba> i guess it's not so terrible, ideally you wouldn't need --error-trace when building with --release
<FromGitter> <Blacksmoke16> try with `--no-debug`
<FromGitter> <anamba> with --error-trace AND --no-debug?
<FromGitter> <Blacksmoke16> yea
<FromGitter> <anamba> hmm... hard to tell. it doesn't seem to crash every time :) i guess that's par for the course with weird memory errors. i'll try to test some more later...
alex`` has quit [Ping timeout: 265 seconds]
<FromGitter> <Blacksmoke16> is what you get for using experimental features 😉
ua has quit [Read error: Connection timed out]
blassin3 has joined #crystal-lang
blassin3 has quit [Client Quit]
blassin has quit [Ping timeout: 268 seconds]
<FromGitter> <tenebrousedge> hey @Blacksmoke16
<FromGitter> <Blacksmoke16> o/
<FromGitter> <tenebrousedge> hope things are well in your world
<FromGitter> <Blacksmoke16> yea its going well
<FromGitter> <tenebrousedge> if I want to poke at a property dynamically then I need a macro for that, yeah?
<FromGitter> <Blacksmoke16> like what?
<FromGitter> <tenebrousedge> ```code paste, see link``` ⏎ ⏎ This seems duplicative [https://gitter.im/crystal-lang/crystal?at=5d8d6d7deb1eff63d62f3efb]
<FromGitter> <tenebrousedge> I'd prefer to write ⏎ ⏎ ``` update_node(((new_value > value) ? @right : @left), new_value)``` [https://gitter.im/crystal-lang/crystal?at=5d8d6dac73dd29627ebb4274]
<FromGitter> <Blacksmoke16> hmm
<FromGitter> <Blacksmoke16> prob not worth it
<FromGitter> <tenebrousedge> I would probably agree if it requires a macro, and I think that's the case
<FromGitter> <tenebrousedge> but it would be nice to eliminate the repetition somehow
<FromGitter> <Blacksmoke16> whats the goal here? set the node value if it doesnt exist?
<FromGitter> <tenebrousedge> standard binary tree stuff. If the node exists, call node.insert, otherwise create it
<FromGitter> <Blacksmoke16> gotcha
Raimondi has quit [Read error: Connection reset by peer]
Raimondi has joined #crystal-lang
f1refly has joined #crystal-lang
f1reflyylmao has quit [Ping timeout: 276 seconds]
Raimondii has joined #crystal-lang
Raimondi has quit [Read error: Connection reset by peer]
Raimondii is now known as Raimondi
duane has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
Raimondi has joined #crystal-lang
chemist69 has quit [Ping timeout: 246 seconds]
chemist69 has joined #crystal-lang
ua has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
duane has quit [Ping timeout: 240 seconds]
duane has joined #crystal-lang
duane has quit [Ping timeout: 240 seconds]
ht_ has joined #crystal-lang
rohitpaulk has joined #crystal-lang
ht_ has quit [Quit: ht_]
rohitpaulk has quit [Ping timeout: 276 seconds]
DTZUZO has quit [Ping timeout: 240 seconds]
_whitelogger has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
rohitpaulk has joined #crystal-lang
alex`` has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 265 seconds]
alex`` has quit [Quit: WeeChat 2.6]
alex`` has joined #crystal-lang
<FromGitter> <zsxawerdu> neovim + autocomplete + parameter expansion + ale support ( errors )
<FromGitter> <zsxawerdu> its actually fvim ( Neovim front end. macOS linux windows wsl)
<FromGitter> <fusillicode> Hi guys :)
<FromGitter> <fusillicode> I'm facing a problem building an old app I've developed something like 1 year ago 😅 ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d8df118fcb47b627fd344bb]
<FromGitter> <fusillicode> I'm building on the latest version of Mojave
<FromGitter> <fusillicode> I both tried: ⏎ `LDFLAGS="-L/usr/local/opt/openssl/lib" crystal build src/my_app.cr ` ⏎ & ⏎ `crystal build src/my_app.cr --link-flags /usr/local/opt/openssl/lib` [https://gitter.im/crystal-lang/crystal?at=5d8df1a173dd29627ebf0255]
<FromGitter> <fusillicode> Unfortunately without any different results... :(
alex`` has quit [Quit: WeeChat 2.6]
<FromGitter> <fusillicode> Oh yes the Crystal version is `0.26.1` 😓
alex`` has joined #crystal-lang
<FromGitter> <fusillicode> I've also tried: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d8df36feb1eff63d63302d4]
<FromGitter> <fusillicode> No results unfortunately :(
<FromGitter> <fusillicode> Solved! (at least the build!) ⏎ `crystal build src/my_app.cr --link-flags -L/usr/local/opt/openssl/lib`
<FromGitter> <fusillicode> Still the `crystal spec` breaks even if I specify the flags 🤔
<FromGitter> <asterite> I don't know what's wrong in osx that we need to do that
<FromGitter> <fusillicode> Thanks a lot for the quick support Ary, I had that fix sourced in my shell but it seems it doesn't work anymore :(
rohitpaulk has joined #crystal-lang
xyproto has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 245 seconds]
devil_tux has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
duane has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
alex`` has quit [Ping timeout: 240 seconds]
alex`` has joined #crystal-lang
DTZUZO has joined #crystal-lang
duane has quit [Ping timeout: 240 seconds]
duane has joined #crystal-lang
return0e has quit [Remote host closed the connection]
<FromGitter> <j8r> mps: tested, works great :D
return0e has joined #crystal-lang
<FromGitter> <Blacksmoke16> @bew i figured out why it was so slow with unions
<FromGitter> <Blacksmoke16> was actually some incorrect logic in my code that was "working" but not correctly handling Primitive types
<FromGitter> <Blacksmoke16> i.e the casting was being handled by raising and rescuing exceptions vs like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d8e2e9f66c8b45122292386]
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d8e2ecbfcb47b627fd536b4]
<FromGitter> <Blacksmoke16> is what it is now
ht_ has joined #crystal-lang
<FromGitter> <bew> @zsxawerdu looks good!! I'm a fan of plain terminal neovim, what crystal tool did you use for method autocompletion? Scry?
<FromGitter> <bew> Nice perf' @Blacksmoke16 ❤️
<FromGitter> <bew> Can you link the commit where you did the change? (_wants to see it in my own eyes_)
<FromGitter> <bew> *with* *
<FromGitter> <asterite> @Blacksmoke16 Nice!
alex`` has quit [Ping timeout: 276 seconds]
<FromGitter> <zsxawerdu> @bew scry. I been playing with Neovim + SpaceVim. really want a good front end to Neovim . Oni2 isn't out yet
alex`` has joined #crystal-lang
<FromGitter> <wsdjeg> I recommand to use neovim-qt + spacevim
<FromGitter> <tenebrousedge> spacevim <3
<FromGitter> <Blacksmoke16> @bew will do when i commit it, prob later today/this weekend
* FromGitter * c-cube uses plain old vim8
<FromGitter> <naqvis> @j8r Just published your long awaited Crystal bindings to the (XZ)[https://github.com/naqvis/xz.cr] to the library 😆
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <zsxawerdu> I second neovim-qt + spacevim
<FromGitter> <zsxawerdu> just installed it on my linux box... amazingly fast
<FromGitter> <zsxawerdu> neovim-qt + spacevim hits the sweet spot for me.
<FromGitter> <bararchy> I've wasted something like 2 days of work to find out a change to the specs (how specs works in crystal) has made the tests fail
<FromGitter> <bararchy> 😢
hightower2 has joined #crystal-lang
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.6]
alex`` has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
alex`` has quit [Ping timeout: 240 seconds]
alex`` has joined #crystal-lang
<FromGitter> <sam0x17> does anyone know where `Spec::RootContext.check_nesting_spec` went with 0.31.0? I need it :/
<FromGitter> <sam0x17> @naqvis does that lzma library support incremental addition of data i.e. adding 45 bytes, then 3 bytes, then 26 bytes, all under the same compression context? A lot of compression bindings fail to capture this but it is essential for a lot of use cases that involve streaming
rohitpaulk has quit [Ping timeout: 268 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <asterite> check_nesting_spec was internal details
<FromGitter> <sam0x17> @asterite I had been using this snippet to do `around_each` so I could wrap specs in a database transaction https://gist.github.com/sam0x17/bad71979d2d9f401abea72c72d764ffd -- ideas for a workaround?
<FromGitter> <sam0x17> I might be able to just re-work it based on whatever the new code for `it` is
<FromGitter> <sam0x17> yeah, curiously, I can't figure out how hooks are running in the new system --- https://github.com/crystal-lang/crystal/search?q=run_before_each_hooks&unscoped_q=run_before_each_hooks turns up no results that actually call `run_before_each_hooks` which is quite odd
<jhass> how about just writing a wrapper for `it`? something like `def tx_it(desc) it(desc) do db.transaction do yield end end end` (plus forwaring the line metadata)
<FromGitter> <sam0x17> does `it` actually execute though? I thought it just puts a block somewhere
<FromGitter> <sam0x17> at the time it runs
<FromGitter> <sam0x17> I know in the ruby world examples dont actually run when they are defined
<FromGitter> <sam0x17> like in `rspec`
<FromGitter> <sam0x17> if so, then I could easily do it that way
<FromGitter> <sam0x17> I might just submit a PR that adds `around_each` and random sorting of specs -- I need both desperately on this project -- way too many accidental spec run order sensitivities
<FromGitter> <Blacksmoke16> the PR that implemented focus made all the it blocks run at program exit
<FromGitter> <Blacksmoke16> so like
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d8e674cfb131014e7fab6cf]
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d8e676cdeb6da63d7bc606f]
<FromGitter> <Blacksmoke16> better example
<FromGitter> <sam0x17> makes sense
<FromGitter> <sam0x17> the only remaining mystery is where the @@before_each and @@after_each blocks are getting called, because in the new system https://github.com/crystal-lang/crystal/blob/7ea8fa6c0c13844d426365f365925c86fe61cfb2/src/spec/dsl.cr#L209 doesn't seem to be called from what I can find searching github
<FromGitter> <Blacksmoke16> :shrug:
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <sam0x17> I'm just gonna grep, github search is such garbage
<FromGitter> <Blacksmoke16> has to be somewhere since it still works :P https://play.crystal-lang.org/#/r/7nkc
<FromGitter> <sam0x17> mystery solved -- src/spec/example.cr
<FromGitter> <sam0x17> I literally thought it was an example of using Spec
<FromGitter> <sam0x17> so I disregarded
<FromGitter> <Blacksmoke16> xD
<FromGitter> <sam0x17> well, that fixed it
<FromGitter> <sam0x17> so yeah, I think I'll submit a PR for `Spec.around_each` if people are interested -- it's very useful if you are doing anything transactional and want to wrap specs in a block
ht_ has quit [Quit: ht_]
<FromGitter> <rmarronnier> I have a Type problem (crazy, right?)
<FromGitter> <Blacksmoke16> *doomed*
<FromGitter> <tenebrousedge> what's a type? o__o
<FromGitter> <rmarronnier> :D
<FromGitter> <rmarronnier> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d8e733aeb1eff63d636e915]
<FromGitter> <Blacksmoke16> `if model[0].is_a? Set(String)`
<FromGitter> <Blacksmoke16> try that
<FromGitter> <rmarronnier> `Error: instance variable '@observation_space' of Cadmium::Classifier::Viterbi must be Set(String), not (Apatite::Matrix(Float64) | Set(String) | Nil)`
<FromGitter> <rmarronnier> with ` observation_space = model[0] if model[0].is_a? Set(String) ⏎ `
<FromGitter> <rmarronnier> I thought it would work
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d8e73dbfb131014e7fb12a3]
<FromGitter> <Blacksmoke16> er
<FromGitter> <Blacksmoke16> ```if (model = model[0]).is_a? Set(String) ⏎ @observation_space = model ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5d8e73ff7fe6a605d13f7dc2]
<FromGitter> <Blacksmoke16> would prob do it
<FromGitter> <Blacksmoke16> this way you're only setting it if there is a model and its a `Set(String)`
<FromGitter> <rmarronnier> yeah, it just did it ! Thanks
<FromGitter> <Blacksmoke16> np
<FromGitter> <rmarronnier> But I thought the if suffix would do it
<FromGitter> <rmarronnier> It's weird it's not equivalent
<FromGitter> <Daniel-Worrall> Iirc the suffix works differently
<FromGitter> <Blacksmoke16> part of the problem is `observation_space` would have been left nil if the type was not `Set(String)` which isnt a valid type for it
<FromGitter> <Blacksmoke16> hence the `| Nil` in the type mismatch error
<FromGitter> <Daniel-Worrall> I've had if suffix problems before
<FromGitter> <rmarronnier> Yeah I got it for the `nil` problem. But I guess the key part of the solution is the `.as(Set(String))`
<FromGitter> <Blacksmoke16> that would have helped yea
<FromGitter> <Blacksmoke16> cept it would fail if you try to cast nil to a set
<FromGitter> <rmarronnier> ` @observation_space = model[0].as(Set(String)) if model[0].is_a? Set(String) ⏎ `
<FromGitter> <rmarronnier> This works so that's not a suffix problem :-)
<FromGitter> <Blacksmoke16> the problem with the suffix is it doesnt restrict that `model[0]` would be a `Set(String)` like it does in the normal block version
<FromGitter> <rmarronnier> Yeah, getting rid of the proxy model variable gets rid of the possibility of getting a nil value
<FromGitter> <Blacksmoke16> i.e. why you have to use the `.as`
<FromGitter> <rmarronnier> Thanks. It's very helpful
<FromGitter> <jwoertink> Is there a way to tell the memory size of a hash?
<FromGitter> <jwoertink> I tried using `Benchmark.memory`, but it returns 0
<FromGitter> <jwoertink> `Benchmark.memory` is a bit confusing
duane has quit [Ping timeout: 265 seconds]
<FromGitter> <jwoertink> `Benchmark.memory { lookup = {} of String => String } #=> 160` `Benchmark.memory { lookup } #=> 0`
<FromGitter> <jwoertink> so I guess it's looking at the memory of operations happening and not the objects in the yield?
<FromGitter> <asterite> It returns the number of bytes that get allocated in the block. Referencing a variable doesn't allocate memory. Creating a Hash does.
<FromGitter> <jwoertink> Ah. I thought it was just returning how big the block was in memory.
hightower2 has quit [Ping timeout: 276 seconds]
blassin has joined #crystal-lang
<FromGitter> <sam0x17> that's very cool
blassin has quit [Quit: The Lounge - https://thelounge.chat]
blassin has joined #crystal-lang
<FromGitter> <zsxawerdu> I never learned ruby, other than hack a script together once or twice
<FromGitter> <zsxawerdu> safari books online has this effective ruby course , so I hit play. and all the mistakes they tell you to avoid is caught by the compiler in crystal
<FromGitter> <Blacksmoke16> indeed :)
alex`` has quit [Ping timeout: 240 seconds]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 245 seconds]
Raimondii is now known as Raimondi