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
Groogy1 has quit [Ping timeout: 252 seconds]
DTZUZO has quit [Ping timeout: 246 seconds]
Tortice has quit [Ping timeout: 252 seconds]
non-aristotelian has quit [Quit: non-aristotelian]
Tortice has joined #crystal-lang
Tortice has quit [Remote host closed the connection]
robacarp has quit [Ping timeout: 240 seconds]
robacarp has joined #crystal-lang
<FromGitter> <cpunion> Hi, is there a library to parse numbers with unit likes “1936300Ki", “1024M” etc.?
rohitpaulk has joined #crystal-lang
ashirase has quit [Ping timeout: 252 seconds]
ashirase has joined #crystal-lang
<FromGitter> <Grabli66> Hi! I compiled hashlink for raspberry pi 3 (arm7). And then i am tried to launch simple program compiled to hashlink. But i got an error "Illegal instruction" on launch. Anyone know whats wrong?
<FromGitter> <Grabli66> Ooops
DTZUZO has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 244 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <proyb6> @cpunion Your name is almost similar to mine, I would rather do regex since it’s so easy to write your own custom API of different units
shmibs has quit [Remote host closed the connection]
shmibs has joined #crystal-lang
<FromGitter> <girng> i LOVE crystal!
<FromGitter> <drum445> @j8r Seems like a lot of people just jumped on the hate train, it isn't bad at all imo. Has some problems, but what language doesn't
<FromGitter> <drum445> Amen @girng
<FromGitter> <yxhuvud> regarding the hacktober fest, someone should tell them that the octoberfest is actually mostly in september :P
rohitpaulk has quit [Ping timeout: 246 seconds]
DTZUZO has quit [Ping timeout: 252 seconds]
<FromGitter> <bajro17> Someone have this book? https://pragprog.com/book/crystal/programming-crystal
<FromGitter> <fusillicode_twitter> Hi guys, sorry as usual for the bothering, but I'm facing a problem that I would like like to solve with Crecto and its changesets but I fear that I need some custom code around it
<FromGitter> <fusillicode_twitter> Here's the problem
<FromGitter> <fusillicode_twitter> I have some validations that I would like to have but that are not related to the schema. ⏎ My use case is this: I get some random strings that I need to validate and convert to the proper types before saving a record inside the db. ⏎ If there are some validations errors however I still want to save the record with default "fallback" values (in general just null). ⏎ Right now I'm trying to
<FromGitter> ... understand if I can actually achieve this with just Crecto changesets but sincerely I feel kind of stucked 😞 [https://gitter.im/crystal-lang/crystal?at=5bb7270582893a2f3ba1d0a6]
<FromGitter> <proyb6> @bajro17 I have the book
<FromGitter> <proyb6> Anyone came across this site on coroutine?
<FromGitter> <bajro17> @proyb6 What you think about it
<FromGitter> <bajro17> I buy it also few min before
flaviodesousa has joined #crystal-lang
ashirase has quit [Ping timeout: 252 seconds]
ashirase has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter> <proyb6> I feel Chapter 8 is too short on advanced topic, I feel there should be more? Perhaps, the source code example should tell you the level of difficulty from beginner to intermediate seem okay for newbie, C programmers or professionals might want more could look elsewhere
<FromGitter> <proyb6> I learn to read it a lot better than resources on the web
<FromGitter> <vladfaust> Hey, Gian D, take a look at github.com/vladfaust/validations.cr
<FromGitter> <fusillicode_twitter> Hi @vladfaust I already took a look at it and if I should go with a validation shard it would totally be my first choice! ;) ⏎ But as I was already using Crecto to handle the DB and a few models I was wondering if its changesets could have been used to address my problem 🤔
DTZUZO has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 245 seconds]
<FromGitter> <KevinSjoberg> I just noticed running `crystal spec -h` does not show all available options. Looking at https://github.com/crystal-lang/crystal/blob/0.26.1/src/spec.cr#L69 I clearly see more options not present in the help output. For instance, `--fail-fast` isn't present in the output, but running `crystal spec --fail-fast` works perfectly.
<FromGitter> <KevinSjoberg> Is this a bug? If so, would you care for a pull request?
<FromGitter> <bew> try `crystal spec -- --help`
<FromGitter> <KevinSjoberg> @bew yep, that did it. I assume, that's not how we want to have it?
<FromGitter> <bew> `crystal spec -h` gets you the help infos of the `crystal` command, not the spec
<FromGitter> <KevinSjoberg> But running `crystal spec -h` give me output related to `spec`, but incomplete. I'd assume `crystal spec -h` give me spec related output. Doing `crystal spec -- -h` is not intuitive. I understand why it works, but not sure it's what you'd expect coming from other CLI interfaces.
<FromGitter> <bew> `crystal spec -h` is not related to spec in any way..
<FromGitter> <bew> it's related to basic build options
<FromGitter> <KevinSjoberg> @bew how is this true? `crystal init -h` and `crystal spec -h` clearly give me different help output. For instance, `crystal spec -h` tell me I can use `--no-color` to disable coloured output. Which it does.
<FromGitter> <bew> `crystal spec ...` is basically `crystal run spec/**/*_spec.cr`
<FromGitter> <bew> there are some special cases like colors that are handled in the crystal command, and forwarded to the spec when run, and for all unknown `crystal` options, they are forwarded directly to the spec (that's why `--fail-fast` works)
<FromGitter> <KevinSjoberg> I see. Would it be of interest to change this behaviour? Naturally, I feel that `crystal spec -h` should give spec-specific instructions.
<FromGitter> <KevinSjoberg> I definitely open to be convinced otherwise. Maybe I'm missing something crucial. :)
<FromGitter> <bew> no idea if this should change, maybe remove the special cases and make the behavior more generic, or simply have a note at the end of `cr spec -h` to tell the user that full spec lib help is available with `cr spec -- --help`
<FromGitter> <KevinSjoberg> Yeah, that would be helpful as well. As a first step, making it more clear is perhaps the best choice.
<FromGitter> <bew> would be nice to also add `-h` in addition to `--help` in the spec lib, because currently it crashes ^^
<FromGitter> <bew> feel free to open an issue about this
<FromGitter> <KevinSjoberg> I will. I'll take a stab at it tonight. :slight_smile:
<FromGitter> <proyb6> @S-YOU I wonder how do you use C malloc and read_file in Crystal?
<FromGitter> <bew> like any other c code call from crystal i guess
<FromGitter> <codenoid> this makes my route won't loaded
<FromGitter> <codenoid> so sad :(
<FromGitter> <codenoid> I already wrote this application in crystal
<FromGitter> <codenoid> actually,. this https://github.com/kemalcr/kemal/issues/300
<FromGitter> <vusaalab> hey guys what do think about Spider-Gazelle is this Ok for production, i am going to build video processing service
akaiiro has joined #crystal-lang
Tortice has joined #crystal-lang
* FromGitter * codenoid start learn GO
<FromGitter> <fridgerator> I'm assuming the answer is no, but is it possible to link an osx framework when binding a c lib?
<FromGitter> <bew> The answer is yes
<FromGitter> <fridgerator> oh rly?
<FromGitter> <bew> At least from what i read somewhere in the codebase, you can say `@[Link("blabla", framework: "bli")]` or something like that
<FromGitter> <bew> Hm no, just framework (no positional arg)
<FromGitter> <bew> Checkout in samples/sdl/sdl/lib_sdl.cr
<FromGitter> <fridgerator> Ok, thanks
akaiiro has quit [Ping timeout: 246 seconds]
Yxhuvud has joined #crystal-lang
DTZUZO has quit [Ping timeout: 252 seconds]
akaiiro has joined #crystal-lang
Tortice has quit [Ping timeout: 268 seconds]
<FromGitter> <vusaalab> hey guys what do think about Spider-Gazelle is this Ok for production, i am going to build video processing service
<FromGitter> <fridgerator> Personally I would use something else. Spider-Gazelle only has one contributor.
<FromGitter> <fridgerator> Kemal, Amber, Lucky all a lot of contributors and are used by more of the community.
<FromGitter> <fridgerator> have*
<FromGitter> <vusaalab> @fridgerator do you thing ffmpeg process can done using crystal
<FromGitter> <fridgerator> But i've never used Spider-Gazelle so I cant speak about it directly
<FromGitter> <fridgerator> @vusaalab I've only used ffmpeg from the command line
<FromGitter> <fridgerator> I'm not seeing any ffmpeg bindings yet for crystal
<FromGitter> <fridgerator> so you would either have to create the bindings, or call the cli from crystal
<FromGitter> <vusaalab> I am building a bindings now
<FromGitter> <vusaalab> like ruby ffmpeg
<FromGitter> <fridgerator> cool
<FromGitter> <elorest> ffmpeg can be used from crystal
<FromGitter> <fridgerator> Oh, I just saw this : https://github.com/marceloboeira/ffmpeg.cr
<FromGitter> <elorest> Usually I just wrap the cmd though.
<FromGitter> <fridgerator> nvmd, that project is empty
<FromGitter> <vusaalab> project is empty i have done move.cr and doing transcode.cr
<FromGitter> <fridgerator> nice!
flaviodesousa has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<FromGitter> <vusaalab> How is you experience with command line ffmpeg , I am looking a stable web framework to make it works as API, any suggestion
<FromGitter> <fridgerator> I havent used it in quite a while, I was only using it for personal stuff and usually end up using HandBrake if I need to do some video stuff
<FromGitter> <fridgerator> Kemal, Amber and Lucky all work as an api, I would suggest any fo those
<FromGitter> <vusaalab> @fridgerator Thanks!
<FromGitter> <fridgerator> Maybe look at their api's to see which you like best
<FromGitter> <elorest> > Kemal, Amber and Lucky all work as an api, I would suggest any fo those ⏎ ⏎ seconded.
<FromGitter> <fridgerator> There are more I didnt mention, Crystal has plenty to chose from : https://github.com/veelenga/awesome-crystal#web-frameworks
<FromGitter> <fridgerator> But those 3 are the most popular, AFAIK
Tortice has joined #crystal-lang
DTZUZO has joined #crystal-lang
non-aristotelian has joined #crystal-lang
Tortice has quit [Remote host closed the connection]
DTZUZO has quit [Ping timeout: 252 seconds]
return0xe has quit [Ping timeout: 245 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 244 seconds]
DTZUZO has joined #crystal-lang
DTZUZO_ has joined #crystal-lang
DTZUZO has quit [Ping timeout: 252 seconds]
DTZUZO_ has quit [Read error: Connection reset by peer]
DTZUZO_ has joined #crystal-lang
<FromGitter> <jwoertink> Is there anything I should look out for, or be concerned about, if I have a web endpoint, and I throw a `spawn` in like this?
<FromGitter> <jwoertink> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bb7b0b6271506518dc1254d]
<FromGitter> <jwoertink> is this a good use for `spawn` or, could this lead to other issues like memory leak or whatever?
<FromGitter> <newtonapple> d
DTZUZO_ has quit [Quit: WeeChat 2.0]
DTZUZO has joined #crystal-lang
<jokke> is there a way to know at compile time whether a file is being used as the main for a program?
<RX14> jokke, no, and the best way to work around that is to structure your app as a library with a small stub entrypoint.cr which requires your code then calls MyApp.run
<jokke> yeah
<jokke> i think that's cleaner too
Tortice has joined #crystal-lang
<jokke> RX14: i just pushed a shard that defines executables and postinstall but after i pulled it as a dev dep it's binary isn't copied into bin/
<jokke> any idea what might be going wrong? https://github.com/jreinert/guardian
<jokke> the postinstall was run when i ran shards install
return0xe has joined #crystal-lang
<RX14> well that'd put the binaries in lib/.../bin/ right?
<robacarp> jokke: I think you have to symlink it yourself with a command like this: ln -s lib/guardian/bin/guardian bin/guardian
<oprypin> jokke, in https://github.com/oprypin/crystal-chipmunk/tree/master/examples i make each file in demos/*.crc individually runnable and then also demos.cr imports them all and is runnable. this is all very hacky but certainly worth it
<robacarp> or cp it, I guess, like lucky does: https://github.com/luckyframework/lucky/blob/master/shard.yml#L65
<robacarp> I suppose ln might error out on successive `shard install` without -f, so cp might be better.
Tortice has quit [Remote host closed the connection]
Tortice has joined #crystal-lang
DTZUZO has quit [Ping timeout: 268 seconds]
baweaver is now known as lemur
<jokke> hm wasn't there a way to do something like this? `foo.try(&bar.baz=)` ?
<jokke> (without having to write the block)
akaiiro has quit [Quit: The Lounge - https://thelounge.chat]
non-aristotelian has quit [Quit: non-aristotelian]
<FromGitter> <ohenepee> This is a part of my code ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ What am I doing wrong exactly? and how do I correct it since I supposed *media* would be `nil` or a `string` at some point. [https://gitter.im/crystal-lang/crystal?at=5bb7eb45ae7be9401609c6cd]
<FromGitter> <jwoertink> you need `property` in front of `media` and `caption`
<FromGitter> <jwoertink> well, assuming this is all inside of a class
<FromGitter> <jwoertink> not sure if property works outside of a class
<FromGitter> <jwoertink> oh, and maybe give them default values since you state they are `String` as opposed to `String?` ?
<FromGitter> <j8r> @ohenepee avoid using `as(String)` also
<FromGitter> <j8r> do like `if (filemame = part.filename).is_a? String`
<FromGitter> <j8r> same with media, i guess
<FromGitter> <j8r> or not, don't know the whole code
Tortice has quit [Read error: Connection reset by peer]
DTZUZO has joined #crystal-lang
ua has quit [Ping timeout: 268 seconds]