ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.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
<FromGitter> <uSide> Hey guys! Is there any way to make something like ⏎ mytuple = Tuple.new ⏎ somearray.each { |othertuple| mytuple = mytuple + othertuple }
<FromGitter> <faustinoaq> What is the equivalent of `send` in Python. When I was learning Crystal I also discover `blocks` and now `send`. I found that Python has first class functions and decorators, but I never seen something like `send` before 😅
wes[phi] has quit [Ping timeout: 240 seconds]
<Papierkorb> uSide, no. Tuples are not lists, they're structures. If you need a list, use Array.
<FromGitter> <faustinoaq> Python tuples are quite similar to Crystal ones. Does Ruby have tuples?
<FromGitter> <uSide> @faustinoaq nope
<FromGitter> <Qwerp-Derp> I wish the offline version of Crystal had the Crystal documentation of that version...
<FromGitter> <faustinoaq> Oh, now I see why people are using Crystal tuples as arrays, is a new concept for they. I didn't know Ruby, I came from Python and Crystal tuples was very familiar to me
<FromGitter> <Qwerp-Derp> Wouldn't it be easy to achieve, since there's already a Crystal documentation generator and there already exists documentation in the Crystal source code for the doc generator to create documentation?
<FromGitter> <uSide> @faustinoaq I just thought that tuple is like a light version of array
<FromGitter> <faustinoaq> Well, is a bit different. Arrays and tuples are sequences but tuples are inmutable by default.
<FromGitter> <bew> @Qwerp-Derp you can do it by yourself, using `crystal doc src/compiler/crystal/command.cr` or sth like that (can't test right now)
<FromGitter> <bew> as this file is the compiler entry point, it'll generate the compiler docs
<FromGitter> <bew> it's not the very first entrypoint, but if we use `src/compiler/crystal.cr` it complains that I didn't use that compilation flag "I know what I'm doing thing"
<FromGitter> <jwaldrip> @asterite given our conversation earlier today, can I get approval on the YAML PR and maybe a merge.
_whitelogger has joined #crystal-lang
<FromGitter> <codenoid> hi, btw i still dont know how to use md5 in cr 0.23.1 ,, usually i change md5 location ⏎ . ⏎ ├── bcrypt ⏎ │   ├── base64.cr ⏎ │   ├── blowfish.cr ... [https://gitter.im/crystal-lang/crystal?at=59bdf92b1081499f1f3f1db0]
<crystal-gh> [crystal] MakeNowJust opened pull request #4990: Correctly work formatting double splat argument with trailing comma (master...fix/crystal-format/double-splat-trailing-comma) https://git.io/v5dDt
wes[phi] has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter> <wwselleck> any examples anyone knows of a crystal web app using a DB layer? preferabbly with kemal but not important.
<FromGitter> <elorest> @wwselleck DB layer?
<FromGitter> <wwselleck> like accesses a database
<FromGitter> <wwselleck> CRUD app for example
<FromGitter> <elorest> You can generate a crud that interacts with a database in seconds with amber.
<FromGitter> <elorest> Also kemal has example for how to do it.
<FromGitter> <elorest> @wwselleck `brew install amberframework/amber/amber`
<FromGitter> <elorest> `amber new cruddemo -d [mysql, pg, mysql]`
<FromGitter> <elorest> `cd cruddemo`
<FromGitter> <elorest> `amber g scaffold Post title:string content:text`
wes[phi] has quit [Ping timeout: 264 seconds]
Philpax_ has joined #crystal-lang
Philpax__ has joined #crystal-lang
Philpax_ has quit [Ping timeout: 246 seconds]
alex`` has joined #crystal-lang
snsei has joined #crystal-lang
<FromGitter> <elorest> @wwselleck There are ways to do that in kemal and used to be an example on kemalcr.com. Amber also makes it very easy. There is a demo on the home page. ⏎ https://amberframework.org/
<FromGitter> <bararchy> Arch just got LLVM5, also a new Crystal version ?
<FromGitter> <bararchy> Oh, it's compiled against LLVM5, nice :) ⏎ ⏎ ```Crystal 0.23.1 (2017-09-10) LLVM 5.0.0``` [https://gitter.im/crystal-lang/crystal?at=59be1ce8bc46472974435abf]
rohitpaulk has joined #crystal-lang
Philpax_ has joined #crystal-lang
Philpax__ has quit [Ping timeout: 246 seconds]
snsei has quit [Remote host closed the connection]
claudiuinberlin has joined #crystal-lang
_p0p0pr37 has quit [Remote host closed the connection]
p0p0pr37 has joined #crystal-lang
<FromGitter> <sdogruyol> Morning everyone
<FromGitter> <sdogruyol> @bararchy great, omw to install llvm5
<FromGitter> <bararchy> What is the spec syntax to expect a result between two values
<FromGitter> <bararchy> ?
<FromGitter> <sdogruyol> not sure if there's something for that @bararchy
p0p0pr37_ has joined #crystal-lang
p0p0pr37 has quit [Ping timeout: 260 seconds]
p0p0pr37_ is now known as p0p0pr37
rohitpaulk has quit [Ping timeout: 255 seconds]
<crystal-gh> [crystal] MakeNowJust opened pull request #4992: Refactor 'Crystal::Formatter#format_def_args' (master...feature/crystal-format/refactor-format-def-args) https://git.io/v5d50
<FromGitter> <krypton97> morning all
<FromGitter> <krypton97> I
<FromGitter> <krypton97> I've finally taken a grasp onto rust and love it
<FromGitter> <bararchy> k
<FromGitter> <bararchy> @sdogruyol Seems there is `be_between` in Ruby
rohitpaulk has joined #crystal-lang
<FromGitter> <sdogruyol> @bararchy haven't used that before
<FromGitter> <sdogruyol> @krypton97 Rust is good 👍
<FromGitter> <bararchy> @krypton97 enjoy
<crystal-gh> [crystal] codenoid opened pull request #4993: change wrong example output in comment (master...master) https://git.io/v5dFP
_whitelogger has joined #crystal-lang
bmcginty has quit [Ping timeout: 260 seconds]
bmcginty has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
p0p0pr37 has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
<FromGitter> <bararchy> So, first "offical" release of crystal-fann https://github.com/NeuraLegion/crystal-fann/releases/tag/v1.0.0
p0p0pr37 has joined #crystal-lang
ShalokShalom has quit [Read error: Connection reset by peer]
ShalokShalom has joined #crystal-lang
Philpax__ has joined #crystal-lang
Philpax_ has quit [Ping timeout: 246 seconds]
rohitpaulk has quit [Ping timeout: 264 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <sdogruyol> congrats 🎉 @bararchy
p0p0pr37 has quit [Remote host closed the connection]
<FromGitter> <bararchy> Thanks :)
<FromGitter> <bew> looks nice 👏 👏 Maybe it'll motivate me to try ANN stuff one day :p
<FromGitter> <bararchy> @bew That will be cool, let me know if you need anything or have any input regarding the shard
<FromGitter> <bararchy> Right now I'm trying to get Travis to see it
<FromGitter> <bararchy> no luck so far haha
ShalokShalom_ has joined #crystal-lang
<FromGitter> <bew> will do! What issues do you have with Travis? (never had to deal with it, just curious)
sandelius has joined #crystal-lang
<FromGitter> <bararchy> @bew this ^
ShalokShalom has quit [Ping timeout: 264 seconds]
<FromGitter> <bew> oh...
<FromGitter> <bararchy> XD
<FromGitter> <bew> @bararchy did you activated the repository for travis?
<FromGitter> <bew> (link not tested, it was https://travis-ci.org/profile/bew for me so it should work for you with your gh name)
<FromGitter> <bew> ah no, maybe it's caused by oauth app access restriction for your organization https://github.com/travis-ci/travis-ci/issues/7740#issuecomment-302579943 ?
<FromGitter> <bew> on your profile page (the first link I gave), can you see the organization? (you need to be the owner iirc)
sandelius has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <bararchy> hmmm
<FromGitter> <bararchy> I got travis-ci.com
<FromGitter> <bararchy> is it the same ?
<FromGitter> <bararchy> @bew
<FromGitter> <bew> no idea, seams to be for profesional, where .org is for open source stuff
<FromGitter> <bararchy> Ohhh
<FromGitter> <bararchy> could be it
<FromGitter> <bararchy> cool , it finds it now
<FromGitter> <bew> cool ;)
<FromGitter> <bararchy> Oh... now how I make it install an external lib
<FromGitter> <bararchy> hmmm
<Papierkorb> bararchy
<Papierkorb> If their debians version of fann sucks, you can also compile it on your own. In case you're wondering, yes that's normal to do. You can somehow also cache such data.
<FromGitter> <bararchy> Papierkorb Thanks :) I need to build from source I think
<FromGitter> <bararchy> ugly but works: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59be70a0177fb9fe7ed01f5c]
* Papierkorb is reminded that bindgen requires clang and will get into travis in the near future
<Papierkorb> *shudder*
<FromGitter> <bararchy> XD
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hightower3 has joined #crystal-lang
rohitpaulk has quit [Read error: Connection reset by peer]
hightower4 has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <bararchy> Damn ... what am I missing ? ⏎ https://travis-ci.org/NeuraLegion/crystal-fann/builds/276510423
<wmoxam> Maybe you need to specify /usr/local/lib in link flags?
<wmoxam> --link-flags -L/usr/local/lib
<FromGitter> <bararchy> trying `export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib`
<FromGitter> <bararchy> I'll try that too
<FromGitter> <bararchy> if it fails
<wmoxam> sounds like a plan
<FromGitter> <bararchy> Thanks :)
<FromGitter> <bararchy> Working !
<FromGitter> <bararchy> yey
ShalokShalom_ is now known as ShalokShalom
<FromGitter> <bew> not sure hacking the env vars is the way to go, but it's a good start 👍
<FromGitter> <bararchy> better to use `--link-flags -L/usr/local/lib` ?
<FromGitter> <bew> I don't know, maybe the cmake install was in wrong directory, I think it should be able to detect where to install libs
<FromGitter> <bew> why did you changed CMAKE_INSTALL_PREFIX?
p0p0pr37 has joined #crystal-lang
p0p0pr37 has joined #crystal-lang
p0p0pr37 has quit [Changing host]
<FromGitter> <bararchy> @bew because of above error, tried to tell it to install in /usr/lib , but it added /local/
rohitpaulk has quit [Read error: Connection reset by peer]
rohitpaulk has joined #crystal-lang
<crystal-gh> [crystal] mverzilli pushed 1 new commit to master: https://git.io/v5FJ6
<crystal-gh> crystal/master 74050a4 TSUYUSATO Kitsune: Refactor 'Crystal::Formatter#format_def_args' (#4992)...
rohitpaulk has quit [Quit: Ping timeout (120 seconds)]
rohitpaulk has joined #crystal-lang
<travis-ci> crystal-lang/crystal#74050a4 (master - Refactor 'Crystal::Formatter#format_def_args' (#4992)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/276517322
<DeBot_> https://github.com/crystal-lang/crystal/pull/4992 (Refactor 'Crystal::Formatter#format_def_args')
balduin has joined #crystal-lang
<crystal-gh> [crystal] asterite closed pull request #4990: Correctly work formatting double splat argument with trailing comma (master...fix/crystal-format/double-splat-trailing-comma) https://git.io/v5dDt
<FromGitter> <2called-chaos> Hey guys, I try to write a very simple tool which copies files. Coming from ruby I wonder how read_at is supposed to work. I get offset but what is the second parameter "bytesize"? It's being passed to PReader.new which does not show up in the API docs (at least in the search). If I pass File.size there it breaks because File.size returns a uint64 and PReader wants a int32
rohitpaulk has quit [Quit: Ping timeout (120 seconds)]
rohitpaulk has joined #crystal-lang
<FromGitter> <codenoid> hi, is `HTTP::Client` have a default timeout value ?
<FromGitter> <bew> @codenoid looks like, yes https://crystal-lang.org/api/0.23.1/HTTP/Client.html#read_timeout=(read_timeout:Number)-instance-method
<crystal-gh> [crystal] akzhan closed pull request #4624: [WIP] Intrinsics now platform dependent. LibC::PtrdiffT type introduced. (master...ptrdiff_t) https://git.io/vQ3dV
<FromGitter> <bew> `HTTP::Client#read_timeout=`
<FromGitter> <codenoid> *a default value
<FromGitter> <asterite> 2called-chaos: why do you need read_at to copy files?
<FromGitter> <bew> ah sorry, seems not @codenoid: here is wher it's used: https://github.com/crystal-lang/crystal/blob/e2a1389e8165fb097c785524337d7bb7b550a086/src/http/client.cr#L653
<FromGitter> <bew> so no timeout when not given
<FromGitter> <codenoid> ^ oo, ok, thanks for that link @bew
snsei has joined #crystal-lang
<FromGitter> <ino76> @mverzilli today I finally found something about it in documentation :) >>
rohitpaulk has quit [Ping timeout: 248 seconds]
<crystal-gh> [crystal] asterite opened pull request #4995: Macros: automatically resolve alias in types (master...feature/macro-resolve-alias) https://git.io/v5FLT
<FromGitter> <2called-chaos> @asterite I figured I don't need it :) I just copied the method from fileutils. I just need stream copy while printing offset to stderr (like pv)
<FromGitter> <2called-chaos> It's a little bit slower than pv (tested with --release build) but I can live with that I guess
alex`` has quit [Quit: WeeChat 1.9]
rohitpaulk has joined #crystal-lang
<crystal-gh> [crystal] asterite opened pull request #4996: Semantic: don't find type parameter in alias (master...bug/3502-type-parameter-in-alias) https://git.io/v5Fqv
claudiuinberlin has joined #crystal-lang
<RX14> somehow when I tried to make do/end and {/} block notation have the same prescedence i broke macro blocks, it's weird
rohitpaulk has quit [Read error: Connection reset by peer]
rohitpaulk has joined #crystal-lang
<Yxhuvud> which of the priorities of those two would you unify to?
Philpax__ has quit [Ping timeout: 246 seconds]
snsei has quit [Remote host closed the connection]
_whitelogger has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
snsei_ has joined #crystal-lang
rohitpaulk has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
wes[phi] has joined #crystal-lang
p0p0pr37 has quit [Remote host closed the connection]
alex`` has joined #crystal-lang
snsei_ has quit [Remote host closed the connection]
<oprypin> could be neither -- disallowing priority ambiguity
<oprypin> btw i had a crazy idea recently - doesn't the priority in `a *= b + c` look really confusing?
<oprypin> make it an error or make the formatter do `a *= (b + c)`
<Yxhuvud> No, not really.
<FromGitter> <bew> not confusing to me
<RX14> yeah oprypin i did do neither
<RX14> i enforced requiring () around args when using a block
<RX14> I think its for the best
<RX14> it means you can always just attach the block you're parsing to the last function call
<RX14> and since you error on brackets it all works out in the end
<oprypin> seems good
<RX14> i've done 95% of the work
<RX14> now i just need to do the other 95%
<oprypin> `(a * b) + c` BUT `a *= (b + c)`, `a *= (b += c)` - but i could easily see someone thinking that `a *= b += c` or `a *= b + c` means something else in the heat of the moment
<RX14> a *= b += c means "refactor this code" to me
<oprypin> `a *= b + c` also means that to me
<RX14> i'd work it out from the docs and hope i never saw it again
<oprypin> for anyone still listening, the definition of this would be for assignment operators that have a non-`=` counterpart, require parentheses if the non-`=` would've required parentheses
snsei has joined #crystal-lang
<FromGitter> <bew> I see `a *= <expression>`, that expression shouldn't need parenthesis based on 'what operator is used'..
<oprypin> let me put it another way. would `a = a * b + c` still work the same?
<FromGitter> <bew> no, its `a = <expression>`
<oprypin> im talking about the previous example. `a *= b + c` is entirely different from `a = a * b + c`
<FromGitter> <bew> so it works as `(a * b) + c`
<oprypin> which is why it can confuse people in the heat of the moment
<FromGitter> <bew> (your exaple above
<FromGitter> <bew> )
<FromGitter> <bew> yes it's different
<RX14> thats because `a *= b` isn't `a = a * b`, it's `(a = a * b)` which makes perfect sense
rohitpaulk has quit [Ping timeout: 255 seconds]
<oprypin> that's not right
<oprypin> it's `a = a * (b)` perhaps but the parentheses are not there
<RX14> oh yeah right
rohitpaulk has joined #crystal-lang
<crystal-gh> [crystal] asterite opened pull request #4998: Add Crystal.main (master...refactor/better-main) https://git.io/v5Fne
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
greengriminal has joined #crystal-lang
sz0 has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 252 seconds]
weston has joined #crystal-lang
wes[phi] has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
alex`` has quit [Ping timeout: 264 seconds]
cerulean has joined #crystal-lang
<FromGitter> <kustom666> Hi everyone! I'm trying to add SSL support to crystal-mysql so that I can connect to an aws RDS instance. However, when I turn the TCPSocket into an SSL Socket, I get the SSL23_GET_SERVER_HELLO:unknown protocol error. The server doesn't have SSL v2 or v3 enabled (as they are fairly old). How can I disable them in my crystal app? I've tried passing the NO_SSL_V3 and NO_SSL_V2 options to my context but I get
<FromGitter> ... the same issue
<cerulean> if anyone cares, i just wanted to show off my chatroom I made in Crystal: https://livepost.mixflame.com/chatroom (theres a whole site there besides the chat)
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter> <crisward> cerulean, there you go
<FromGitter> <crisward> not sure if images work on IRC
<FromGitter> <crisward> The web double sockets are probably getting created in your JS.
<FromGitter> <crisward> The both had frames in them, so both connected.
<FromGitter> <jsilverMDX> sorry for the delay, i thought you meant amber room
<FromGitter> <jsilverMDX> ah thanks
<FromGitter> <jsilverMDX> let me see if i can reproduce
<FromGitter> <jsilverMDX> well in FF it only made 1 socket
<FromGitter> <jsilverMDX> let me try chrome
<FromGitter> <jsilverMDX> chrome seems to have a bug here
<FromGitter> <jsilverMDX> i develop with FF
<FromGitter> <jsilverMDX> wait no
<FromGitter> <jsilverMDX> im wrong
<FromGitter> <jsilverMDX> I know why
<FromGitter> <jsilverMDX> i can fix it right now
<FromGitter> <jsilverMDX> brb
<FromGitter> <jsilverMDX> the chat does open two sockets, that's by design and only on the chat page
<FromGitter> <jsilverMDX> because the chat channels are considered seperate from the main site
<FromGitter> <jsilverMDX> it won't hurt you
<FromGitter> <jsilverMDX> or your browser
<FromGitter> <jsilverMDX> the /chat endpoint is able to accept multiple sockets
<FromGitter> <jsilverMDX> obviously
<FromGitter> <jsilverMDX> 💎
rohitpaulk has quit [Ping timeout: 248 seconds]
<Papierkorb> You won't notice now, but with that, you halved the effective count of concurrent users.
<FromGitter> <jsilverMDX> Oh, I see
<FromGitter> <jsilverMDX> good point
<FromGitter> <jsilverMDX> ill make a ticket about it
<FromGitter> <jsilverMDX> i do work on my tickets btw
<FromGitter> <crisward> Thanks, just thought I'd point it out incase it wasn't intensional. Just recently worked with web sockets. Had issue with keep alives, and auto reconnects. Seem to have solved it now. At one point I had over 400 connections...
<FromGitter> <crisward> Real users...
<FromGitter> <jsilverMDX> nice !
<FromGitter> <jsilverMDX> :D
<FromGitter> <jsilverMDX> yeah this is my first websockets app
<FromGitter> <jsilverMDX> and my first crystal app
<FromGitter> <jsilverMDX> there's still problems with our WebSocket implementation serverside it seems but other than that it seems pretty good... I'm not worried, I just need to combine the files or require one or something
<FromGitter> <jsilverMDX> ok I added it to my issues
<Papierkorb> Actually, only using one connection has an effect on your users too. Or rather, their devices. Yes, my desktop computer won't budge. My mobile connection may not either, but it may introduce additional start lag. But more connections to handle means more work for the CPU and Modem, hence, battery life may suffer .. Just a tiny bit. But if every app dev would try their best, those "tiny bits" would really add up
<FromGitter> <crisward> Cool. The big takeway from my experience is be careful with writing js to auto-reconnect. It's possible to ddos yourself if lots of people go to your site and leave their browser open (eg mobile phones). This happens if you don't do the keep alive correctly as all the effort is in the reconnect. If you get the keep alive right everything works well.
<Papierkorb> jsilverMDX, Remember that TCP is slow at first (Not much of an issue for chat). But the TCP and (hopefully) TLS handshakes require some roundtrips before being usable, at which point your application also does some handshake. That are probably like 8-10 TCP packets just for that. Mobile networks have terrible latencies, so say 500ms. You just added up to 5s of boot time to your web page.
weston1 has joined #crystal-lang
weston has quit [Ping timeout: 252 seconds]
rohitpaulk has joined #crystal-lang
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
weston1 has quit [Ping timeout: 248 seconds]
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
weston1 has joined #crystal-lang
weston1 has quit [Ping timeout: 260 seconds]
weston1 has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 264 seconds]
weston1 has quit [Ping timeout: 252 seconds]
snsei_ has quit []
p0p0pr37 has joined #crystal-lang
p0p0pr37 has joined #crystal-lang
snsei has joined #crystal-lang
weston1 has joined #crystal-lang
<FromGitter> <jsilverMDX> oh i see
<FromGitter> <jsilverMDX> i use wss:// so yes TLS
greengriminal has quit [Quit: Leaving]
sz0 has quit [Quit: Connection closed for inactivity]
weston1 has quit [Ping timeout: 240 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang