jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.9.1 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/manastech/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
sorbo_ has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
azgil has joined #crystal-lang
<azgil> hi, i have error
<azgil> Syntax error in ./src/controllers/forum_controller.cr:4: expecting token ')', not ','
<azgil> mforums_threads = Hash(Int32, [] of {Int32, Int32, String}).new
<azgil> is possible decalre hash with int32 as key and value as array of{int32...}
<azgil> if i remove '[]' code is working
<BlaXpirit> azgil, you must specify a type
<BlaXpirit> azgil, [] of Something is code to make a new array
<BlaXpirit> Array(Something) is the type
<BlaXpirit> you want Hash(Int32, Array({Int32, Int32, String})).new
<azgil> ok
<azgil> can't dinf in doc how add subarray to array
<azgil> can't find in doc how add subarray to array
<azgil> i gett error in mforums_threads[mf[0]] += site_forum_threads
<vikaton> >> "hello".length
<DeBot> vikaton: undefined method 'length' for String - http://carc.in/#/r/nki
<vikaton> >> "hello".len
<DeBot> vikaton: undefined method 'len' for String - http://carc.in/#/r/nkj
<vikaton> >> "hello".count
<DeBot> vikaton: in /usr/lib/crystal/string.cr:1309: no overload matches 'Char#in_set?' with types - http://carc.in/#/r/nkk
<BlaXpirit> >> "hello".size
<vikaton> :(
<DeBot> BlaXpirit: # => 5 - http://carc.in/#/r/nkl
<vikaton> o
<vikaton> why take out length?
<BlaXpirit> vikaton, they took away all aliases
<vikaton> whats the reason?
<BlaXpirit> search for it
<BlaXpirit> ugh even i cant find it
<BlaXpirit> github search is totally useless
<vikaton> thanks
<vikaton> all my code is broken since 0.7.1 :)))))))))))
<jhass> yes and the next bigger version will break it all over again
* CompanionCube is tempted to paraphrase the borg regarding that
<vikaton> sigh :(
<CompanionCube> vikaton, I agree with you :)
<azgil> the most complex code that I wrote http://pastie.org/10612583
<azgil> ;)
<azgil> on crystal
<vikaton> azgil, what lib r u using?
<azgil> crystal-pg
<azgil> amatista
<vikaton> ah
<vikaton> I'm using Moonshine atm but it's breaking :(
<vikaton> jhass, what big chnage is coming?
<CompanionCube> vikaton, more mandatory type annotations
<jhass> for instance variables
<vikaton> ah ok
<sorbo_> when is that landing?
<jhass> hard to say
<azgil> got error http://pastie.org/10612616
<azgil> if request from browser , all id ok
<azgil> is ok
<azgil> if i use wrk "wrk -c 2 -d 5 http://localhost:3000" i get this erro
<jhass> ah
<jhass> mh, no
<jhass> https://github.com/manastech/crystal/issues/1865 thought of this, but it's different
lokulin has joined #crystal-lang
lokulin has quit [Changing host]
joedrl has joined #crystal-lang
joedrl has quit [Client Quit]
fowlduck has joined #crystal-lang
fowlduck has quit [Ping timeout: 245 seconds]
A124 has quit [Quit: '']
<jwaldrip> the compiler is yelling at me for empty structs in lib definitions. How would I define this in lib? https://github.com/graphql/libgraphqlparser/blob/master/c/GraphQLAstNode.h#L17
azgil has quit [Quit: Leaving]
<crystal-gh> [crystal] rmosolgo opened pull request #1928: Add Int#popcount from LLVM intrinsic (master...int-popcount) http://git.io/vRgqQ
sorbo_ has quit [Remote host closed the connection]
sorbo_ has joined #crystal-lang
sorbo_ has quit [Remote host closed the connection]
sorbo_ has joined #crystal-lang
sorbo_ has quit [Ping timeout: 260 seconds]
emancu_ has quit []
CompanionCube has quit [Ping timeout: 264 seconds]
fowlduck has joined #crystal-lang
fowlduck has quit [Remote host closed the connection]
sorbo_ has joined #crystal-lang
sorbo_ has quit [Ping timeout: 260 seconds]
fowlduck has joined #crystal-lang
fowlduck has quit [Ping timeout: 260 seconds]
BlaXpirit has quit [Quit: Bye]
BlaXpirit has joined #crystal-lang
sorbo_ has joined #crystal-lang
sorbo_ has quit [Ping timeout: 260 seconds]
fowlduck has joined #crystal-lang
fowlduck has quit [Ping timeout: 260 seconds]
CompanionCube has joined #crystal-lang
CompanionCube has quit [Changing host]
CompanionCube has joined #crystal-lang
trapped has joined #crystal-lang
trapped has quit [Client Quit]
trapped has joined #crystal-lang
sorbo_ has joined #crystal-lang
sorbo_ has quit [Ping timeout: 246 seconds]
<jhass> jwaldrip: the real definition is somewhere else I guess
<jhass> jwaldrip: but you should be able to just alias GraphQLAstNode = Void; or even Void*, if it's opaque you should have allocation functions for it hopefully
azgil has joined #crystal-lang
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
unshadow has joined #crystal-lang
trapped has joined #crystal-lang
ponga has joined #crystal-lang
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
trapped has joined #crystal-lang
justinmcp_ has joined #crystal-lang
bjmllr_ has joined #crystal-lang
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
salvor has joined #crystal-lang
wmoxam_ has joined #crystal-lang
justinmcp has quit [Quit: No Ping reply in 180 seconds.]
Keziolio- has joined #crystal-lang
Keziolio- is now known as Keziolio
unshadow has quit [Quit: leaving]
bjmllr_ has quit [Ping timeout: 260 seconds]
bjmllr_ has joined #crystal-lang
sdogruyol has joined #crystal-lang
wminor_ has joined #crystal-lang
wminor has quit [Ping timeout: 264 seconds]
trapped has joined #crystal-lang
sdogruyol has quit [Remote host closed the connection]
A124 has joined #crystal-lang
wminor__ has joined #crystal-lang
wminor_ has quit [Ping timeout: 264 seconds]
kulelu88 has joined #crystal-lang
kulelu88 has quit [Changing host]
kulelu88 has joined #crystal-lang
<miketheman> I've been trying poke at how to send UDP messages in a sane manner, and one of the problems I've been having that I cannot get this to run without having a UDP server on the other side.
<miketheman> since UDP is connectionless, it should "behave" in a manner of tossing the message to void, and if something is there to catch it, that's great, but if not, that shouldn't result in a connection error
<jhass> miketheman: seems to work locally, the sandbox just rejects (that kind of) network access
<miketheman> jhass: that makes sense, I guess.
<miketheman> jhass: so while I can't show the example on the sandbox, even if I run the same sample with a listener, `nc -l -u 127.0.0.1 8125` only a single payload is emitted
<miketheman> I was also trying to see if I could minimize the opening/closing of file descriptors for socket call, but I'll settle for getting the payloads through. :)
<jhass> mh, no idea
<jhass> I didn't toy much with UDP yet in C yet
<jhass> , not even in C yet
<jhass> if you have a C variant that works, it might be worth to compare the strace's
<jhass> though libevent will make them a bit harder to follow I guess
<miketheman> I think that my listener might not be a good representation, as I'm closing the socket. I'll try to work with a better "realish" listener before bugging again
<jhass> miketheman: mh, sure this isn't some interaction issue with netcat? if I run it twice with the same nc instance running I still only see a single payload
<miketheman> yeah, it might be netcat - yesterday I was able to see all payloads flow through, but that was using a different variant of my client that did connection tracking and bailed when there was no server
<jhass> miketheman: http://cloud.aeshna.de/u/mrzyx/screenshots/screenshot_20151206_161951.png crystal seems to send them all and then nc rejects subsequent packets?!
<miketheman> jhass: that seems to mirror the behavior I see on the client side
<miketheman> I wonder if I rescued the ICMP message (i.e DONT CARE!) and continued to send if it would work
<jhass> well, it already does continue to send
<jhass> idk enough about UDP :/
<miketheman> ok.
<miketheman> I'll continue to poke
<miketheman> thanks for the help!
<miketheman> oh, I had another q: is there anything out there on how to best read call traces?
<jhass> if your LLVM version is old enough you can generate debug symbols, which might give you filenames in it, I don't remember
<jhass> miketheman: mh, if I use netcat as client too, I can send multiple messages inside the same session to the netcat server but if I restart the netcat client it too gets rejected
<jhass> UDP is weird
<jhass> or nc is, idk
<miketheman> yes to both
sdogruyol has joined #crystal-lang
<sdogruyol> is there anybody using travis-ci without any errors? I'm getting this in all my projects https://travis-ci.org/sdogruyol/kemal/jobs/95185560
<jhass> ugh
<BlaXpirit> sdogruyol, :o
<BlaXpirit> yeah that's no good for sure
<BlaXpirit> apt-get: command not found really?
<jhass> no idea what they broke this time
<jhass> but it must have broken at least half of the community supported languages
<jhass> yeah, I mean what?
<BlaXpirit> uh it says osx
<BlaXpirit> sdogruyol, why do u have osx
<sdogruyol> hold on
<jhass> sdogruyol: let's switch through the images, try sudo: false, sudo: required, sudo: true
<jhass> dist: trusty is also available
<jhass> but I think only with sudo: required, iirc
<BlaXpirit> yes
<BlaXpirit> but it's not easy to switch through images, doesnt that require commits?
<jhass> yes
<sdogruyol> os x shouldnt be there
<sdogruyol> let me check
<BlaXpirit> if in doubt check my travis.yml
<sdogruyol> trying to find it could oyu shared it
<sdogruyol> share it*
<sdogruyol> lol
<BlaXpirit> srsly just remove osx
<sdogruyol> i wonder why os x fails
ponga has quit [Quit: Connection closed for inactivity]
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<BlaXpirit> sdogruyol, did you have it before and did it just work?
<sdogruyol> not sure
<jhass> ugh, looks like I messed up the nightly
<jhass> Err http://nightly.crystal-lang.org crystal/main amd64 Packages
<jhass> Undetermined Error
<jhass> APT, helpful as fuck as always
<jhass> guess it doesn't follow redirects?
<jhass> so much for upgrading to HTTPS without having to interact with travis-build :/
<BlaXpirit> ah that's what it is
<BlaXpirit> ok so nightly is broken
<BlaXpirit> so it seems like osx is just ignored then?
<sdogruyol> lol seems so
<jhass> no, the earlier link was to the latest build
trapped has joined #crystal-lang
<jhass> sdogruyol: could you relaunch it please?
<sdogruyol> sure
<sdogruyol> good job
<jhass> thanks
<BlaXpirit> so now it succeeds in failing the tests :)
<sdogruyol> BlaXpirit: yeah they fail on nightly :)
sdogruyol has quit [Remote host closed the connection]
sdogruyol has joined #crystal-lang
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
trapped has joined #crystal-lang
fowlduck has joined #crystal-lang
fowlduck has quit [Ping timeout: 246 seconds]
danzilio has quit [Ping timeout: 264 seconds]
FLOOR_9_ has joined #crystal-lang
<FLOOR_9_> good day
<FLOOR_9_> strange, i couldn't find this channel in /list
FLOOR_9_ has quit [Read error: Connection reset by peer]
danzilio has joined #crystal-lang
FLOOR_9_ has joined #crystal-lang
<FLOOR_9_> also some connection problems... argh
<FLOOR_9_> how is it here?
greengriminal has joined #crystal-lang
<FLOOR_9_> but i would like to say
<FLOOR_9_> what a awesome language
<FLOOR_9_> i love ruby and stopped using it because it wasn't fast enough for my needs
<FLOOR_9_> then i went over to nodejs
<FLOOR_9_> and then i saw crystal i was like WOOHA, this is awesome
<FLOOR_9_> because when i was using ruby, i found myself constantly wondering, if ruby will ever achieve C like speed
<FLOOR_9_> and most of the people i talked to (including irc) said, forget it, so i was disappointed for some time
<FLOOR_9_> so all in all i really hope this is going to be great
A124 has quit [Remote host closed the connection]
sdogruyol has quit [Remote host closed the connection]
sdogruyol has joined #crystal-lang
<crystal-gh> [crystal] porras opened pull request #1929: Basic YAML generation (master...to-yaml) http://git.io/vRaMv
lokulin has quit [Ping timeout: 264 seconds]
<sdogruyol> FLOOR_9_: you are in the right place
<FLOOR_9_> feels good :D
<sdogruyol> FLOOR_9_: what do you do that requires so much speed?
<sdogruyol> not web
kulelu88 has left #crystal-lang ["Leaving"]
<FLOOR_9_> yeah also web, because of node
greengriminal has quit [Quit: This computer has gone to sleep]
<FLOOR_9_> i was working on a web api
<FLOOR_9_> and was using ruby for some serverside scripting
<sdogruyol> FLOOR_9_: have you done web programming with crystal then
<FLOOR_9_> no , i was testing a http server in crystal tho
<FLOOR_9_> and benchmarking it with wrk
<sdogruyol> FLOOR_9_: it's pretty darn fast
<vikaton> ^
<FLOOR_9_> yeahi think i read somewhere 60k req/s
<sdogruyol> FLOOR_9_: i recommend taking a look at Kemal https://github.com/sdogruyol/kemal
<sdogruyol> FLOOR_9_: if you use express or sinatra pretty familiar
<FLOOR_9_> i was using sinatra actually
<FLOOR_9_> yes that was the benchmark i saw
<sdogruyol> FLOOR_9_: good to hear
<FLOOR_9_> funny enough that number 64986, is close to the maximum number of file descriptors
<sdogruyol> FLOOR_9_: actually the limit is the io not cpu
<FLOOR_9_> well in unix systems, the OS has a limit
<sdogruyol> FLOOR_9_: yeah
<sdogruyol> FLOOR_9_: and also was tested on os x
<FLOOR_9_> that's why the max allowed file disc on 1 ip adress is 65K
lokulin has joined #crystal-lang
<sdogruyol> FLOOR_9_: you can perform your own benchmarks and check the difference
<FLOOR_9_> is it using the native http server in crystal?
<sdogruyol> FLOOR_9_: yes
<FLOOR_9_> could it be , that the native http server is bound by the max file descriptors?
<vikaton> sdogruyol: putting kemal in my shard.yml is giving me a git error :/
<sdogruyol> vikaton: can you share your shard.yml
<sdogruyol> FLOOR_9_: havent seen that in the source https://github.com/manastech/crystal/blob/master/src/http/server/server.cr
<vikaton> nvm fixed it :)
<sdogruyol> vikaton: great
<FLOOR_9_> because in nodejs http server benchmarks, they talk about , modifying the max file desc to get more req/s
<FLOOR_9_> 1 million concurrent connections ! :)
<sdogruyol> yeah but that's another story 1m concurrent is really OS specific
<FLOOR_9_> because what i am aiming for , is a realtime web api
<FLOOR_9_> with as much of req/s i can get, and on the backend, as low as latency i can get
<FLOOR_9_> that's why i encountered crystal :)
<sdogruyol> FLOOR_9_: then Crystal is a great fit for that imho
<FLOOR_9_> yeah i would imagine is 64K on 1 core, the multithreaded version would be somewhat 4x
<FLOOR_9_> like when i benchmark my node app, and then use cluster, to utilise more cores
<FLOOR_9_> in theory of course
<sdogruyol> yeah
<FLOOR_9_> have you got any experience with zeromq?
<sdogruyol> no
<FLOOR_9_> you know what it is?
<sdogruyol> yes
<FLOOR_9_> cool, because the limit i am running into , is because of nodejs
<FLOOR_9_> nodejs does about 10K reqs per core, and using zeroMQ for IPC communication
<sdogruyol> why not try out Crystal and make a blog post about it
<sdogruyol> that'd be really good
<FLOOR_9_> well i don't know how to use IPC within crystal
<sdogruyol> i also dont know about it but we all have to start from somewhere :)
<FLOOR_9_> mind you that i am pretty new to crystal
<FLOOR_9_> but i think that if you can use IPC in crystal, you can already do somewhat multithreading
<sdogruyol> FLOOR_9_: the thing is that you can use spawn for async
<sdogruyol> much more easier than node and performant
<FLOOR_9_> do you have a tutorial?
<sdogruyol> FLOOR_9_: for starter i think you can port the ruby 0mq driver to Crystal
<sdogruyol> FLOOR_9_: https://github.com/askn/crystal-by-example you can check this for simple point-on snippets
<sdogruyol> FLOOR_9_: spawn and channels are what i am talkning about
<FLOOR_9_> the zeromq gem is written in C , and i am not that good in C :)
<sdogruyol> FLOOR_9_: it's super simple to write C bindings in Crystal
<CompanionCube> yes
<CompanionCube> there's even a tool that takes the .h files
<FLOOR_9_> i am a real noob in C
<CompanionCube> and generates the low-level binding for you
<FLOOR_9_> a REAL noob
<FLOOR_9_> lol
<FLOOR_9_> i think it would be less of a challenge for someone who is used to C
* CompanionCube also wrote a minimal CLI for the above tool
<FLOOR_9_> sdogruyol: what does spawn do? is it like fork in javascript?
<FLOOR_9_> ah yes i see now what it does, like in ruby
<FLOOR_9_> i didn't use spawn in my ruby apps tho, i used thread.new sometimes
<FLOOR_9_> sdogruyol: do you use Thread.new in kemal?
<azgil> what is kemal?
<FLOOR_9_> awsome http server written in crystal by sdogruyol
<FLOOR_9_> simular to sinatra and rails
<azgil> so funny
<FLOOR_9_> ?
<azgil> special for kidds
<FLOOR_9_> well for setting up a simple http server for speed
<FLOOR_9_> it's quite cool
<sdogruyol> azgil: ?
<sdogruyol> FLOOR_9_: no thread at all
<azgil> lim(usage of kemal) -> 0
FLOOR_9_ has quit [Ping timeout: 260 seconds]
FLOOR_9_ has joined #crystal-lang
<sdogruyol> so?
<FLOOR_9_> having some connections problems :)
<FLOOR_9_> the speed of that http server azgil is 60k reqs
<azgil> what for create another one if already exsit good web frameworks
<FLOOR_9_> try that with your rails app :)
<sdogruyol> because it's fun?
<FLOOR_9_> azgil which OS do you use?
<azgil> ah ok
<azgil> mac
<azgil> he use mac
<FLOOR_9_> do you think it's better than windows?
<FLOOR_9_> what i am reffering to, that like Linux , someone tried to make something different
<FLOOR_9_> and hey, look what we have today
<FLOOR_9_> if everyone stopped because there is already something, we all be using the same OS right now
<azgil> you drink a lot
<FLOOR_9_> ok
<RX14> FLOOR_9_, AFAIK all of the http frameworks for crystal use the http server/parser in the stdlib
<RX14> the only perf difference between crystal http frameworks is in routing
<FLOOR_9_> yeah, but because the req/s are so close to the max file descriptor limit, i thought about articles raising that limit
<azgil> try to use db , u will see real limit
<FLOOR_9_> like in node
<FLOOR_9_> the zeromq module 'zmq' also was benchmarked, it also had a 65K messages/s limit
<FLOOR_9_> no matter the protocol, IPC, TCP, so whenever i see that 65K limit, i can't help notice
CompanionCube has quit [Ping timeout: 260 seconds]
sdogruyol has quit []
<FLOOR_9_> but i am not knowledgable enough, to know the relation between sockets and open file descriptors in a unix system
<FLOOR_9_> alto anything is a stream in unix, even a file, it could be something to do with it
<azgil> u a smart guy
<FLOOR_9_> and that's why these articles with 500K, 1 Million Reqs all mention raising that kernel limit
<FLOOR_9_> on a unix system
<azgil> what os d u use
<FLOOR_9_> mac, linux, windows
<azgil> favorite
<FLOOR_9_> mac right now
<FLOOR_9_> for developing
<azgil> mac sucks
<FLOOR_9_> hahahha
greengriminal has joined #crystal-lang
<FLOOR_9_> btw, when i say unix i also mean unix-like, so also Linux
CompanionCube has joined #crystal-lang
CompanionCube has quit [Changing host]
CompanionCube has joined #crystal-lang
<FLOOR_9_> don't know if it adds something useful RX14
<FLOOR_9_> what i just said
elbow-jason has joined #crystal-lang
CompanionCube has quit [Ping timeout: 264 seconds]
greengriminal has quit [Quit: This computer has gone to sleep]
CompanionCube has joined #crystal-lang
CompanionCube has quit [Changing host]
CompanionCube has joined #crystal-lang
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
trapped has joined #crystal-lang
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
trapped has joined #crystal-lang
FLOOR_9_ has quit []
sorbo_ has joined #crystal-lang
greengriminal has joined #crystal-lang
lokulin has quit [Ping timeout: 245 seconds]
greengriminal has quit [Quit: This computer has gone to sleep]
lokulin has joined #crystal-lang
fowlduck has joined #crystal-lang
fowlduck has quit [Ping timeout: 246 seconds]
Keziolio has left #crystal-lang ["Leaving"]
greengriminal has joined #crystal-lang
greengriminal has quit [Client Quit]
fowlduck has joined #crystal-lang
bmcginty has joined #crystal-lang
fowlduck has quit [Ping timeout: 260 seconds]
sorbo_ has quit [Remote host closed the connection]
trapped has quit [Quit: Textual IRC Client: www.textualapp.com]
<CompanionCube> you know what'd be an interesting idea?
<CompanionCube> if one could easily compile Crystal code to JavaScript using Emscripten
<jhass> there's an issue for that somewhere
sorbo_ has joined #crystal-lang
fowlduck has joined #crystal-lang
fowlduck has quit [Ping timeout: 246 seconds]
elbow-jason has quit [Ping timeout: 246 seconds]