ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.32.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
gangstacat has quit [Ping timeout: 272 seconds]
_ht has quit [Quit: _ht]
gangstacat has joined #crystal-lang
_ht has joined #crystal-lang
_ht has quit [Remote host closed the connection]
alex`` has quit [Ping timeout: 265 seconds]
duane has joined #crystal-lang
duane has quit [Ping timeout: 268 seconds]
_ht has joined #crystal-lang
_ht has quit [Remote host closed the connection]
flaviodesousa has joined #crystal-lang
yukai has quit [Ping timeout: 240 seconds]
Human_G33k has quit [Ping timeout: 260 seconds]
Human_G33k has joined #crystal-lang
_whitelogger has joined #crystal-lang
alex`` has joined #crystal-lang
<raz> hmm, is there a way to get proper backtraces out of a static release binary
<raz> i compiled with --release --static --link-flags "-static -lunwind"
<raz> but still seeing '???' :(
<raz> to be precise: ex.backtrace is ["???","???","???","???","???","???","???"]
<raz> (which confuses me a bit, i could've sworn i saw near-complete backtraces printed to the console when originally testing the compile flags. hm)
_whitelogger has joined #crystal-lang
Human_G33k has quit [Remote host closed the connection]
Human_G33k has joined #crystal-lang
<alex``> does `crystal build` generate the binary in the current directory or the directory of the source file?
<alex``> not sure if it would have been `crystal build src/hello_world.cr`
<FromGitter> <yxhuvud> It lands in the current dir
duane has joined #crystal-lang
duane has quit [Quit: leaving]
duane has joined #crystal-lang
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/8gp9 does it make sense this works?
<FromGitter> <Blacksmoke16> i guess a module is considered a parent type?
<FromGitter> <straight-shoota> @Blacksmoke16 Exactly
<FromGitter> <Blacksmoke16> makes sense
duane has quit [Ping timeout: 265 seconds]
duane has joined #crystal-lang
<FromGitter> <Nicolab> Hello, ⏎ ⏎ I can't figure out how to compare 2 dates: ⏎ ⏎ ```Time.utc.shift(seconds: 10) > Time.utc ⏎ => true``` ... [https://gitter.im/crystal-lang/crystal?at=5e2efbb4a420263e03ab2daf]
<FromGitter> <Blacksmoke16> thats the right way
<FromGitter> <Nicolab> It doesn't work
<FromGitter> <Blacksmoke16> why should that be false? you're shifting the current UTC time 10 seconds into the future
<FromGitter> <Blacksmoke16> so its going to be "greater" than the time it actually is
<FromGitter> <Nicolab> Time.utc.shift(seconds: 10) is before utc (now)
<FromGitter> <tenebrousedge> no
<FromGitter> <tenebrousedge> Time.utc.shift(seconds: -10)
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/8gpe
<FromGitter> <Nicolab> Oooh !
<FromGitter> <Blacksmoke16> ^
<FromGitter> <Nicolab> ^^ I check
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/master/Time.html#shift(seconds:Int,nanoseconds:Int):Time-instance-method
<FromGitter> <Blacksmoke16> > Positive values result in a later time, negative values in an earlier time.
<FromGitter> <Nicolab> I wasn't paying attention, thanks, guys :)
<FromGitter> <Blacksmoke16> np
sagax has quit [Remote host closed the connection]
sagax has joined #crystal-lang
alex`` has quit [Ping timeout: 268 seconds]
alex`` has joined #crystal-lang
<repo> does someone know if crystal-pg has issues with pg 12?
<repo> ["SELECT log_messages.id, log_messages.timestamp, log_messages.message, log_messages.level, log_messages.meta FROM log_messages WHERE ts_message @@ websearch_to_tsquery('foobar') AND ( timestamp > 2020-01-13 18:24:04 +01:00 OR timestamp < 2020-01-20 18:24:04 +01:00 ) AND meta @> {\"foo\" => {\"bar\" => 15}}"]
<repo> Unhandled exception: syntax error at or near "18" (PQ::PQError)
<repo> seeing this
<FromGitter> <tenebrousedge> should the timestamp be in quotes?
<repo> i'm not writing that query
<repo> hm maybe it's also an avram issue
<FromGitter> <tenebrousedge> right, but is that what the syntax error is?
<repo> yeah i guess
<repo> same for the jsonb value
<repo> i'm using a prepared statement
<repo> where(sql, args: args)
<repo> (with avram)
<repo> so sql in this case is just ts_message @@ ? AND ( timestamp > ? OR timestamp < ? ) AND meta @> ?
<repo> ah actually ts_message @@ websearch_to_ts_query(?) AND ...
<repo> hm there's this line: params = args.map { |arg| PQ::Param.encode(arg) }
<repo> in pg/src/pg/statement
<FromGitter> <tenebrousedge> hmm
<repo> so not sure, could be that the to_sql method is giving me just a text reprensentation of the actual query
<raz> both crystal-db and crystal-pg are unfortunately still riddled with problems (conn pool fails under various conditions, prep statements mem leak etc.) . wouldn't be surprised if they haven't gotten to fully test with pg12 yet
<repo> mmh
<FromGitter> <tenebrousedge> sounds rough :/
<FromGitter> <tenebrousedge> is there a PG12 feature you need?
<raz> it was when i last tried :( but it's being worked on i think
<repo> teardown: no
<repo> tenebrousedge:
<repo> i can use 11
<FromGitter> <tenebrousedge> :plus1:
<repo> but it's obviously not a solution :D
<repo> just a workaround
<raz> maybe try filing a ticket on crystal-pg
<raz> perhaps it's an easy fix - and in any case they should be made aware of it :)
<raz> in their defense, pg is really pumpin' out those major versions lately
<raz> we had 9.x for 7 years
<raz> and now they bump it up ever year
_ht has joined #crystal-lang
<FromGitter> <straight-shoota> repo, what makes you think this isssue is with psql 12 only?
<FromGitter> <straight-shoota> Did you actually test the query on 11? I doubt it would work there either.
osp has joined #crystal-lang
_whitelogger has joined #crystal-lang
_ht has quit [Remote host closed the connection]
_ht has joined #crystal-lang
sagax has quit [Ping timeout: 248 seconds]
osp has quit [Quit: Leaving]
<sorcus> Crystal has `promise` in stdlib like JS Promise?
<FromGitter> <Blacksmoke16> not that i know of
<jhass> we have a future
<sorcus> Hmm...
<jhass> https://crystal-lang.org/api/0.32.1/toplevel.html#delay(delay,&block:-%3E_)-class-method
<sorcus> jhass: Cool B-)
sagax has joined #crystal-lang
alex`` has quit [Ping timeout: 268 seconds]
alex`` has joined #crystal-lang
Flipez has quit [Read error: Connection reset by peer]
Flipez2 has joined #crystal-lang
coderobe3 has joined #crystal-lang
coderobe has quit [Read error: Connection reset by peer]
coderobe3 is now known as coderobe
ur5us has joined #crystal-lang
<Stephie> future has been a bit neglected though
<Stephie> would be nice if it had a bit of a rework
<raz> ohhh that looks handy <3
<raz> how is it neglected, you mean the internal impl?
<raz> lazy() looks neat too. i gotta find me some excuses to use them
Xeago_ has joined #crystal-lang
masterdonx2 has joined #crystal-lang
Xeago has quit [Ping timeout: 268 seconds]
Xeago_ is now known as Xeago
MasterdonX has quit [Read error: Connection reset by peer]
repo has quit [Ping timeout: 268 seconds]
repo has joined #crystal-lang
<FromGitter> <watzon> Future doesn't work great if you're looking for something like JS promises, and unfortunately neither do any of the current promise implementations
ur5us has quit [Ping timeout: 245 seconds]
<FromGitter> <tenebrousedge> js 😬
ur5us has joined #crystal-lang
<raz> hum. but why would anyone look for anything JS to begin with?
<raz> in languages with an actual concurrency model promises can be a convenience for certain special cases. in JS they're merely the least horrible syntax available to do concurrency at all. ¯\_(ツ)_/¯
<FromGitter> <dscottboggs_gitlab> o/
ur5us has quit [Ping timeout: 246 seconds]
_ht has quit [Remote host closed the connection]
duane has quit [Ping timeout: 240 seconds]
yukai has joined #crystal-lang
<FromGitter> <Blacksmoke16> o/
<FromGitter> <jesfre_gitlab> o/