RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.26.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
<non-aristotelian> Sweet. Submitted a bug-report for Salt.
<non-aristotelian> I updated environment.cr to use File.tempfile instead of Tempfile.
_ore has quit [Remote host closed the connection]
_ore has joined #crystal-lang
DTZUZO has quit [Ping timeout: 268 seconds]
<FromGitter> <pitosalas> I want to convert an http response to a hash
<FromGitter> <pitosalas> Best I have so far (it doesn't work) is: ` y = Hash.new(JSON::PullParser.new(response.body))`
<FromGitter> <pitosalas> Looking for suggestions
_ore has quit [Ping timeout: 268 seconds]
non-aristotelian has quit [Quit: non-aristotelian]
<FromGitter> <Blacksmoke16> any reason to not just make an obj from the response?
<FromGitter> <Blacksmoke16> then you could implement a `.to_h` if you really needed
<FromGitter> <Blacksmoke16> @pitosalas
return0e_ has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
DTZUZO has joined #crystal-lang
DTZUZO has quit [Client Quit]
<FromGitter> <swinSpo> Hi, How do you call this style of programming?
_whitelogger has joined #crystal-lang
<FromGitter> <Blacksmoke16> macros
<FromGitter> <swinSpo> oh wow that sounds powerful
<FromGitter> <Blacksmoke16> indeed
<FromGitter> <swinSpo> damn it works
<FromGitter> <swinSpo> so function names can only be lowercase?
<FromGitter> <Blacksmoke16> think so yea
_whitelogger has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter> <swinSpo> Hey I am looking at the examples here
<FromGitter> <swinSpo> Oh nevermind it works.. I had a different Person class so it gave me an error :D
<FromGitter> <proyb6> Can I write TCPServer to handle high volume of requests from end-clients side? I seem to get very low like <800 req/s compare to the Crystall HTTP server can hit >100K req/s
rohitpaulk has quit [Ping timeout: 245 seconds]
<FromGitter> <swinSpo> Hi I need some help installing shards
<FromGitter> <swinSpo> I am here https://github.com/crystal-lang/crystal-sqlite3
<FromGitter> <swinSpo> after adding it to my shard.yml file and running shard install it tells me "missing required attribute: name at line 4, column 1"
<FromGitter> <swinSpo> oh it actually seems to work after i shards init and then manually add the dependency back in
rohitpaulk has joined #crystal-lang
sagax has quit [Ping timeout: 268 seconds]
rohitpaulk has quit [Ping timeout: 268 seconds]
_whitelogger has joined #crystal-lang
ashirase has quit [Ping timeout: 252 seconds]
ashirase has joined #crystal-lang
<FromGitter> <swinSpo> Hi, I am getting an error with mysql
<FromGitter> <swinSpo> "crystal run test.cr ⏎ Unhandled exception: packet 254 not implemented (Exception) ⏎ from lib/mysql/src/mysql/connection.cr:29:9 in 'initialize' ⏎ from lib/mysql/src/mysql/connection.cr:4:3 in 'new' ⏎ from lib/mysql/src/mysql/driver.cr:3:5 in 'build_connection' ... [https://gitter.im/crystal-lang/crystal?at=5be16e7b7c6c9e5df2160a32]
<FromGitter> <swinSpo> I am using the example code
<FromGitter> <swinSpo> DB.open "mysql://user:password@192.168.0.102:3306/db" do |db| ⏎ db.exec "drop table if exists contacts" ⏎ db.exec "create table contacts (name varchar(30), age int)" ⏎ db.exec "insert into contacts values (?, ?)", "John Doe", 30 ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5be16ee29c65e607e709883a]
<FromGitter> <vladfaust> Hello, ⏎ ⏎ Does every method call create a new array instance in this case? ⏎ ⏎ ```code paste, see link``` ... [https://gitter.im/crystal-lang/crystal?at=5be16f611f2bb1676b60a111]
<FromGitter> <straight-shoota> @vladfaust yes
<FromGitter> <straight-shoota> you might want to use a tuple or constant instead
<FromGitter> <vladfaust> Thanks
<FromGitter> <straight-shoota> you could easily check that yourself
<FromGitter> <swinSpo> And I forgot to mention this, but I have an application written in Go that connects to the same mysql database and it works
<FromGitter> <swinSpo> But crystal does not seem to work here
<FromGitter> <swinSpo> Anyone?
<FromGitter> <swinSpo> I can see inside the 0.5 mysql version shard.yml that it specifies
<FromGitter> <swinSpo> crystal: 0.25.0
<FromGitter> <swinSpo> Maybe that is the issue?
<FromGitter> <swinSpo> I am on Crystal 0.27.0 [c9d1eef8f] (2018-11-01)
<FromGitter> <vladfaust> @swinSpo go into mysql source code, it's fairly easy to read. Follow the exception's stack, i.e. start at `mysql/src/mysql/connection.cr:29:9 in 'initialize'`. Add `pp` and `pp!` statements to debug your code to see which exact call raises the error
<FromGitter> <swinSpo> Well I can see the error
<FromGitter> <swinSpo> read_ok_or_err do |packet, status| ⏎ ⏎ ``` raise "packet #{status} not implemented" ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5be17418de33dd0c96d98339]
<FromGitter> <swinSpo> but i dont really know what causes it because the next code path points to the constructor function
<FromGitter> <swinSpo> either way though, I am completely new with crystal and I was hoping for at least the basics to work (like a database connection)
<FromGitter> <swinSpo> its a bit disappointing if this does not work "out of the box"
moei has joined #crystal-lang
_ore has joined #crystal-lang
t0nyandre has joined #crystal-lang
_ore has quit [Remote host closed the connection]
ua has quit [Ping timeout: 252 seconds]
<t0nyandre> Just wanted to inform everyone that uses any AUR distro that I'm maintaining https://aur.archlinux.org/packages/scry-git. The languageserver is easily accessible using /usr/bin/scry after installation :)
<t0nyandre> Love the developers of scry for making such a lovely tool :)
t0nyandre has quit [Quit: WeeChat 2.3]
<FromGitter> <bew> awesome t0nyandre!! mind to post that on https://gitter.im/crystal-scry/Lobby :)
<FromGitter> <schoening> Is crystal gonna be available for serverless programming at some point? :p
<FromGitter> <Sija> @schoening IIRC it alreadt works on lambda
<FromGitter> <schoening> Ohhh, very nice. Can probably, potentially, save some cash compared to using JS :D
<FromGitter> <Sija> @schoening https://github.com/apex/up
early has quit [Quit: Leaving]
<FromGitter> <schoening> @Sija thanks! I saw that years ago not understanding any of it. I was given a link to this earlier today: https://serverless.com/ any thoughts on which to pick. Seem to do the same?
early has joined #crystal-lang
<FromGitter> <Sija> kubernetes: https://github.com/psykube/psykube
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
jemc has joined #crystal-lang
jemc has quit [Ping timeout: 246 seconds]
Yxhuvud has joined #crystal-lang
<FromGitter> <kinxer> Is there a method I need to overload on the class used as a key in a Hash to allow for Hash equality with keys that are equal but not the same object?
jemc has joined #crystal-lang
jemc has quit [Client Quit]
jemc has joined #crystal-lang
<FromGitter> <kinxer> Nevermind; I found `#hash(hasher)` and the `def_hash` macro
<FromGitter> <fusillicode_twitter> Hi guys, quick questione, is there a way to getting around the compiler complains about the required type specification for memoizing methods?
<FromGitter> <fusillicode_twitter> I mean, if I have an instance method that memoize an instance variable the compiler complains about the impossibility to infer the correct tye
<FromGitter> <fusillicode_twitter> So I usually need to put a getter with the explicit type expected
<FromGitter> <fusillicode_twitter> Unfortunately I'm in the situation in which the type is actually dynamic, i.e. passed as a initialization var
<FromGitter> <fusillicode_twitter> btw I've already read this https://github.com/crystal-lang/crystal/issues/4681 :(
<FromGitter> <fusillicode_twitter> but I was still wondering if there is a good DRY way to getting around this situation
<FromGitter> <bew> writing types is good sometimes you know, when you get back at the code a few weeks/month later, you'll probably be happy to see the types, instead of having to infer it your self :)
<FromGitter> <bew> @oprypin I see you're the maintainer of AUR package `crystal-icr`, there's `shards` missing as a build dependency (I got a build fail on a new laptop because of that)
<FromGitter> <fusillicode_twitter> @bew yep buddy I totally understand this point of view but in the situation I'm in having them automagically inferred would spare me an abstraction ;)
jemc has quit [Ping timeout: 240 seconds]
moei has quit [Read error: Connection reset by peer]
moei has joined #crystal-lang
non-aristotelian has joined #crystal-lang
<FromGitter> <Blacksmoke16> @swinSpo thats a known issue when using mysql 8
rohitpaulk has joined #crystal-lang
<FromGitter> <pitosalas> @Blacksmoke16 what do you mean an "obj"? Specifically what would the code look like?
rohitpaulk has quit [Ping timeout: 250 seconds]
<FromGitter> <Blacksmoke16> like create a class and then can do like `MyObj.new xxx`
<FromGitter> <Blacksmoke16> or if the body is json you could do `MyObj.from_json response.body`
<FromGitter> <Blacksmoke16> but im not sure what the ultimate goal is, i.e. what you wanted your hash to contain/use it for
<oprypin> bew, ok, thanks. yeah, a commit simply added a dependency on shards for no reason whatsoever
Jenz has joined #crystal-lang
<Jenz> Moin
<Jenz> And again, moin
<Jenz> (P *
<Jenz> Oops
<Jenz> Sorry about that DX
Jenz has left #crystal-lang [#crystal-lang]
DTZUZU has quit [Read error: Connection reset by peer]
DTZUZU has joined #crystal-lang
<FromGitter> <codenoid> is crystal have built-in "time from now" feature ?
<FromGitter> <codenoid> "2 hours ago"
<FromGitter> <codenoid> okay, that should not in programming language
t0nyandre has joined #crystal-lang
t0nyandre has quit [Quit: WeeChat 2.3]
moei has quit [Quit: Leaving...]
jemc has joined #crystal-lang
t0nyandre has joined #crystal-lang
<t0nyandre> I'm getting "[scry] while requiring './file'". Anyone know why?
<t0nyandre> It shows as an error inside vscode but it is imporing variables etc. so in a way it works ;P
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]