jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.28.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
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter> <parruda> Hello everyone! faastRuby is written 90% in Crystal. I am looking for ppl who would be interested in looking at the code and doing a security review prior to the release in exchange for credits on the repo’s readme. ⏎ The most sensitive part is the runners service, responsible for running untrusted code. We’d have to do this over a hangouts call with all the parties where I could share my screen, walk you
<FromGitter> ... through the design and answer any questions you may have. ⏎ Once the review is over I will open it up to the world!
<FromGitter> <parruda> I should have said prior to the opensource release
<FromGitter> <Daniel-Worrall> Is there a way to find dependent repos? I have an underused library and wish to view others code and searching gh isn't pulling anything
<FromGitter> <Daniel-Worrall> Repos j
<FromGitter> <Blacksmoke16> like where that shard is in their shard.yml?
<FromGitter> <Daniel-Worrall> Yeah
<FromGitter> <Blacksmoke16> could write some script to search github by lang, parse raw shard.yml for each one as yaml, and build it out
<FromGitter> <Blacksmoke16> but i dont know anyway to do that off the top of my head
<FromGitter> <Daniel-Worrall> I'm just thinking that rubygems has something similar
<FromGitter> <Daniel-Worrall> Probably doesn't exist (yet)
<FromGitter> <Blacksmoke16> i think @straight-shoota was working on something similar?
<FromGitter> <mwlang> well, rubygems, gems get published directly to rubygems site.
<FromGitter> <mwlang> they don't have to comb github to find gems.
<FromGitter> <mwlang> hmmm.... https://github.com/imdrasil/sam.cr or https://github.com/axvm/cake -- that is the question.
<FromGitter> <Blacksmoke16> Why use either
<FromGitter> <Blacksmoke16> Depending on what you need to do might not be necessary
<FromGitter> <mwlang> automate redundant tasks.
<FromGitter> <mwlang> I'm messing a round some with the amber framework and it seems I need something like sam / cake to automate deployments. I could use capistrano to deploy crystal projects, but that seems somehow "wrong" even though I've done it for Perl and PHP projects.
<FromGitter> <Blacksmoke16> Option parser and some methods would probably do the same thing without an extra dependency
<FromGitter> <Blacksmoke16> Depending on complexity of what you need to do
<FromGitter> <mwlang> ok, looking at that now.
<FromGitter> <mwlang> didn't know about it before.
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <Blacksmoke16> 👍
gangstacat has quit [Ping timeout: 250 seconds]
alex``` has quit [Ping timeout: 252 seconds]
alex```8 has joined #crystal-lang
_whitelogger has joined #crystal-lang
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
<FromGitter> <bew> @parruda hi, I'd suggest you to ask in the crystal forum too, to avoid your request to be flooded by the help messages here.. Personally I would be interested, but I'm not sure I qualify for this kind of review..
_ht has quit [Remote host closed the connection]
<FromGitter> <mavu> Hi, which one is the smallest web framework that is still maintained? (in crystal) ⏎ I just need to display one page with a form that gets send and saved as a config file. ⏎ Does it even make sense to use a framework for this? Or should I just diy it with http-server?
<FromGitter> <vladfaust> @mavu http-server is enough
ashirase has quit [Ping timeout: 258 seconds]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
ashirase has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <mavu> thanks :)
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
gangstacat has joined #crystal-lang
tdc has quit [Remote host closed the connection]
tdc has joined #crystal-lang
alex```89 has joined #crystal-lang
alex```8 has quit [Ping timeout: 268 seconds]
livcd has quit [Remote host closed the connection]
<FromGitter> <mavu> ```code paste, see link``` ⏎ ⏎ Will this work with binary files? like a PNG? ⏎ Is there an alternative that results in a slice? [https://gitter.im/crystal-lang/crystal?at=5cdd564b509b1035c759e17e]
<FromGitter> <Blacksmoke16> not in macro land
<FromGitter> <mavu> Seems to work for my PNG. :)
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <mavu> should this not be a problem with null chars? because a string in crystal is a just a null-terminated-cstring?
alex```899 has joined #crystal-lang
alex```89 has quit [Ping timeout: 245 seconds]
<FromGitter> <Blacksmoke16> :shrug:
<FromGitter> <straight-shoota> @mavu Crystal strings are size delimited. They can contain null chars
<FromGitter> <straight-shoota> `read_file` can be used for binary data
<FromGitter> <straight-shoota> Shouldn't be an ussue
livcd has joined #crystal-lang
<FromGitter> <mistergibson> do you have to mess with encodings as with Ruby?
<FromGitter> <mistergibson> I use ascii-8-bit encoding a lot for binary manipulations
rohitpaulk has joined #crystal-lang
alex```8998 has joined #crystal-lang
sz0 has joined #crystal-lang
alex```899 has quit [Ping timeout: 258 seconds]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
rohitpaulk has quit [Remote host closed the connection]
laaron has joined #crystal-lang
mistergibson has joined #crystal-lang
alex```8998 has quit [Ping timeout: 248 seconds]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<FromGitter> <parruda> @bew I am sure you qualify :) ⏎ The most important part is the design of it, that’s why I have to do a walk through. So if you are interested I am sure it will be very helpful to have you look at it
<FromGitter> <parruda> I will post on the forum though, good idea
<FromGitter> <bararchy> Is there a default timeout for `HTTP::Client.exec`? (socket timeout)
<FromGitter> <bararchy> or will it just hang forever
<FromGitter> <bararchy> I know the Instance variant allows setting read_timeout and connect_time, the class variable won't support it
<FromGitter> <mwlang> I have two problems I'm trying to solve with websockets. This is the gist: https://gist.github.com/mwlang/57876320390c899be690a5a79eed8125 Overall it works as designed, but when left running for a long time, one or two things happen:
<FromGitter> <mwlang> 1) the server simply stops sending data to the websocket (but never sends a CLOSE) -- yet, the client still thinks it's connected and waiting for new data to arrive. I think this is an issue specifically with line 30 in the gist
<FromGitter> <mwlang> 2) A CLOSE is sent, but I apparently never exits the fiber so it never gets restarted in the main loop. It seems that calling "break" to exit the while loop of the listener never leads to main loop of the program checking that the listener is stopped and can thus attempt to restart.
<FromGitter> <mwlang> I suspect my problems are with how the Listener's while loop is coded, but I am not at all sure how to resolve these two issues "exit" instead of "break" exits the whole program. Fiber.yield after the listener's while loop doesn't seem to have any effect (idea was to pass control back to main loop) either.
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
alexherbo2 has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
josh5tone has joined #crystal-lang
josh5tone has quit [Client Quit]
<FromGitter> <Blacksmoke16> are there any work around/alternative solutions to something like https://play.crystal-lang.org/#/r/6xeq?
josh5tone has joined #crystal-lang
<FromGitter> <Blacksmoke16> where i need an array of values that could be any type, then later do some transformations on some of them to new up a class based on the transformed values?
return0e has quit [Ping timeout: 244 seconds]
return0e has joined #crystal-lang
<FromGitter> <asterite> This? https://play.crystal-lang.org/#/r/6xf2
<FromGitter> <Blacksmoke16> moment
<FromGitter> <asterite> @mwlang maybe you need `select`, but it's undocumented... though it works more or less like in Go
<FromGitter> <Blacksmoke16> @asterite unfortunately no. Might step back and see if there is a different approach that would make things easier
<FromGitter> <mwlang> @asterite where is "select" in the crystal library? I'll have to read the source to see if it'll do what I need as I'm not familiar with how Go does anything.
<FromGitter> <asterite> it's not in the library, it's in the language
<FromGitter> <asterite> but maybe you don't need it
mistergibson has quit [Quit: Leaving]
_ht has joined #crystal-lang
_ht has quit [Quit: Lost terminal]
sz0 has quit [Quit: Connection closed for inactivity]
FromGitter has quit [Remote host closed the connection]
oprypin has quit [Quit: Bye]
oprypin has joined #crystal-lang
FromGitter has joined #crystal-lang
oprypin has quit [Quit: Bye]
oprypin has joined #crystal-lang
<FromGitter> <watzon> `select` is the opposite of `reject` isn't it? Look up the Ruby docs. Should be similar.
<FromGitter> <Blacksmoke16> i think its something diff
<FromGitter> <Blacksmoke16> like a lang construct
<FromGitter> <watzon> I'm considering doing some documenting tonight. Specifically in the `Array`, `Iterable`, `Enumerable` area
<FromGitter> <Blacksmoke16> i think thats it
<FromGitter> <omidathari> Hi allsf1 = File.open("/dev/ttyUSB0", "r") ⏎ ⏎ spawn do ⏎ while true ⏎ value = sf1.gets ... [https://gitter.im/crystal-lang/crystal?at=5cdde8a383ae782aee7db04c]
<FromGitter> <omidathari> Hi all, ⏎ In the code below we are attempting to open a serial port and spawn a fiber that simply blocks waiting for data from the serial port. ⏎ The (stdin) gets() below the fiber never executes. Can someone help me understand why. ⏎ Thanks ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5cddea8cad024978c6dab0f2]
<FromGitter> <Blacksmoke16> prob gets caught in infinite loop from the while statement
<FromGitter> <omidathari> @Blacksmoke16 The puts "tell me your name:" executes ok.
<FromGitter> <Blacksmoke16> right but the loop happens in a fiber
<FromGitter> <Blacksmoke16> im not *super* familiar with fibers, but imo when you do `gets.to_s` that causes a blocking IO, which executes the next available fiber, which has a infinite loop so it never switches back to the main fiber to print the name
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5cddeda9509b1035c75e7d40]
<FromGitter> <Blacksmoke16> for example prints
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5cddedbf0ac9852a95ed64f5]
<FromGitter> <Blacksmoke16> print `tell me your name`, gets blocks it, so prints the content of my shard.yml, then prints what i type in
<FromGitter> <asterite> the code looks fine to me and it should execute well. What's not working?
<FromGitter> <Blacksmoke16> in his example it never prints the name you typed in
<FromGitter> <asterite> but does he type something in the console?
<FromGitter> <omidathari> Interesting. The first gets is blocking on the serial port file descriptor and the name gets() is waiting on the stdin file descriptor and that is why I thought they should be completely independent of each other. Don't you think?
<FromGitter> <Blacksmoke16> its concurrency, only 1 fiber executes at a time
<FromGitter> <omidathari> Yes we are typing the name in the console @asterite
<FromGitter> <Blacksmoke16> at first the main fiber is executing, hence why it prints the `tell me your name:`, then the `name = gets.to_s` blocks waiting for user input, so the fiber you defined in your spawn block executes
<FromGitter> <Blacksmoke16> but i imagine the infinite loop in the fiber never blocks/end so it never goes back to the main fiber to print your name
<FromGitter> <omidathari> I am under the impression that the whole point of gets is to block a fiber until it becomes ready to run. It should not be a busy wait. Correct?
<FromGitter> <Blacksmoke16> im not sur
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 252 seconds]
<FromGitter> <omidathari> @Blacksmoke16 Thank you ⏎ Love to hear any other suggestions
alexherbo2 has joined #crystal-lang