ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.32.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
duane has quit [Ping timeout: 265 seconds]
duane has joined #crystal-lang
alexherbo28 has joined #crystal-lang
alex`` has quit [Ping timeout: 258 seconds]
alexherbo2 has quit [Ping timeout: 268 seconds]
alexherbo28 is now known as alexherbo2
duane has quit [Ping timeout: 268 seconds]
alex`` has joined #crystal-lang
Nicolab has quit [Quit: Leaving.]
_whitelogger has joined #crystal-lang
duane has joined #crystal-lang
_whitelogger has joined #crystal-lang
duane has quit [Ping timeout: 258 seconds]
Nicolab has quit [Quit: Leaving.]
ua_ has joined #crystal-lang
ua has quit [Ping timeout: 258 seconds]
renich has joined #crystal-lang
renich has quit [Quit: renich]
renich has joined #crystal-lang
renich has quit [Remote host closed the connection]
_ht has quit [Remote host closed the connection]
ur5us has joined #crystal-lang
ur5us_ has joined #crystal-lang
ur5us has quit [Ping timeout: 268 seconds]
Nicolab has joined #crystal-lang
alexherbo2 has joined #crystal-lang
alex`` has joined #crystal-lang
ur5us_ has quit [Read error: Connection reset by peer]
_ht has joined #crystal-lang
flaviodesousa has joined #crystal-lang
Nicolab has quit [Ping timeout: 268 seconds]
<FromGitter> <bararchy> So.... ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e26ea1a364db33faa08f33f]
<FromGitter> <bararchy> Is this a typo in Crystal ?
<FromGitter> <yxhuvud> The correct spelling is receive.
<FromGitter> <yxhuvud> so I guess that is a yes.
Nicolab has joined #crystal-lang
alexherbo25 has joined #crystal-lang
alex`` has quit [Ping timeout: 240 seconds]
alexherbo2 has quit [Ping timeout: 258 seconds]
alexherbo25 is now known as alexherbo2
alex`` has joined #crystal-lang
<FromGitter> <faustinoaq> Hi @/all people long time no see 😅 I work at Dell EMC now, I'm hoping to use amber or crystal somewhere here hehehe 😃
alex`` has quit [Ping timeout: 258 seconds]
alexherbo2 has quit [Ping timeout: 268 seconds]
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 260 seconds]
alexherbo27 has joined #crystal-lang
alex`` has joined #crystal-lang
<FromGitter> <jlnr> Hey everyone. I'm planning to write a backend for a turn-based mobile game using Crystal, and deploy it on Heroku (usually I use either Rails or Sinatra). I prefer long-term stability/maintenance over having the fanciest syntax available. Is there any library/framework that I should start with?
<FromGitter> <Blacksmoke16> JSON API i assume?
<FromGitter> <jlnr> Yeah. Maybe some admin pages for which even HTTP Basic Auth would be sufficient.
<FromGitter> <Blacksmoke16> cool, you have some choices
<FromGitter> <Blacksmoke16> https://github.com/amberframework/amber - would prob be the most "rails like" ⏎ https://github.com/luckyframework/lucky - similar full stack framework ⏎ https://github.com/kemalcr/kemal - a more sinatra based framework. Not really full stack so going to have some boilerplate ⏎ https://github.com/athena-framework/athena - a more API oriented framework, however not as mature as the others
<FromGitter> <Blacksmoke16> id just go thru the docs and go from there
<FromGitter> <jlnr> Thanks! I'll probably work through them top to bottom then. Let's see how far I get :)
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <btihen> I want to see how websockets work with 'names' or /chat or whatever. Where Can I capture a name or a route in a websocket with the handler? Here is my VERY BASIC WebSocket Handler: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e2718c73fd0cc7cfe0f4b79]
<FromGitter> <Blacksmoke16> `break if mesg.downcase == "q"` 😉
<FromGitter> <Blacksmoke16> id imagine there is some routing you would have to do?
<FromGitter> <Blacksmoke16> based on the path of the request
<FromGitter> <btihen> This is just the client side - it was my 'fancy' cli way to end wo `^c`
<FromGitter> <kinxer> Hey, what is the `out` keyword?
<FromGitter> <kinxer> Ah, thank you. For some reason, the language reference doesn't search if I just try to search for the word "out".
<FromGitter> <Blacksmoke16> prob too short
Nicolab has quit [Quit: Leaving.]
<FromGitter> <kinxer> Is this a known issue? https://play.crystal-lang.org/#/r/8fqc
<FromGitter> <kinxer> It looks like some of the problems I've seen with generics and modules and such.
<FromGitter> <kinxer> I don't think it's that simple. I've done the trick of defaulting the array to an empty superclass (module) array and then adding all the elements to it.
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/8fqk
<FromGitter> <Blacksmoke16> `self.class.new @members.map &.clone.as(Cloneable)`
<FromGitter> <kinxer> Is it related to how `Array#map` works?
<FromGitter> <Blacksmoke16> im not sure of the specifics
<FromGitter> <tenebrousedge> array#map produces a union of the types returned by map
<FromGitter> <kinxer> Okay, yeah. That makes sense.
<FromGitter> <kinxer> Thanks for the insight.
Nicolab has joined #crystal-lang
sagax has joined #crystal-lang
flaviodesousa has quit [Quit: KVIrc 4.9.3 Aria http://www.kvirc.net/]
natrys has joined #crystal-lang
_whitelogger has joined #crystal-lang
maxpowa has quit [Ping timeout: 248 seconds]
maxpowa has joined #crystal-lang
<FromGitter> <bew> Hi @faustinoaq (:
<FromGitter> <bew> 👏 for your job!
<FromGitter> <faustinoaq> Hi @bew, Thank you! 😄 BTW, I already have a simple crystal program running in a R730 server inside my DELL Lab :)
<FromGitter> <faustinoaq> Crystal works like a charm!
<FromGitter> <jwoertink> Anyone here know if doing a cross-compile from mac to ubuntu works?
<FromGitter> <vlazar> > BTW, I already have a simple crystal program running in a R730 server inside my DELL Lab :) ⏎ ⏎ This is the way! 😆
<FromGitter> <jwoertink> lol. He has spoken
<FromGitter> <jwoertink> I've never tried a cross-compile before, so I'm not really sure how this works. Just doing some searching around, I came up with this:
<FromGitter> <jwoertink> ```code paste, see link```
<FromGitter> <jwoertink> What would I put for `target` for Ubuntu? And is there a list of those somewhere?
Nicolab has quit [Quit: Leaving.]
<FromGitter> <jwoertink> ok, setting that to `x86_64-linux-gnu` let it compile. I now have an `app.o` file. Not really sure what that means, but I guess that's my app?
<FromGitter> <jwoertink> shouldn't it just be `app` and no file extension?
<FromGitter> <Blacksmoke16> afaik you have to run some command that it spit out in console
<FromGitter> <Blacksmoke16> on the ubuntu box
<FromGitter> <Blacksmoke16> i.e. copy over `app.o` then run the command
<FromGitter> <jwoertink> oh, I see what you're saying. Yeah, it print out this gnarly long command
<FromGitter> <jwoertink> So I copy my `app.o` to the ubuntu machine, and then run that long command to get my final `app` binary
<FromGitter> <Blacksmoke16> pretty much
<FromGitter> <Blacksmoke16> afaik :p
<FromGitter> <jwoertink> oh... but it spits out `/Users/jeremywoertink/.asdf/installs/crystal/0.31.1/` which wouldn't exist on that ubuntu machine
<FromGitter> <jwoertink> so I'd have to swap all those out
<FromGitter> <Blacksmoke16> probably
<FromGitter> <jwoertink> So does this mean that even though we're cross-compiling a binary, the server it runs on still has to have crystal installed?
<FromGitter> <Blacksmoke16> i think so? afaik cross compiling just gets your application to a certain "stage", then the final box that builds the binary finishes the compilation based on its OS/arch
<FromGitter> <Blacksmoke16> that would be what compiling statically would be for, so all the deps are within the binary
<FromGitter> <Blacksmoke16> which you could use the alpine docker imagine on mac to build a static binary that can then be shipped to ubuntu to run
<FromGitter> <jwoertink> Yeah, that's how we deploy now.
<FromGitter> <jwoertink> We just push the app to docker, build the binary, then zip it up and deploy it
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <jwoertink> I wanted to try removing docker from the deploy process, but it sounds like that makes it way more complicated
<FromGitter> <Blacksmoke16> what about just making the app run in docker?
<FromGitter> <jwoertink> It does.
<FromGitter> <jwoertink> I wanted to make it not run in docker lol
<FromGitter> <Blacksmoke16> ah fair enough
duane has joined #crystal-lang
<FromGitter> <tenebrousedge> static compilation for the win
<FromGitter> <jwoertink> How does Go do it? Doesn't Go have a command that just builds a single file you can drop on any machine and it just works?
Nicolab has joined #crystal-lang
<FromGitter> <vlazar> yeah, something like `GOOS=windows GOARCH=386 go build -o hello.exe hello.go`
<FromGitter> <Blacksmoke16> @straight-shoota is it expected the `ci-test-dev-alpine` image throws `/usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -levent (this usually means you need to install the development package for libevent)` when trying to build a static binary?
<FromGitter> <Blacksmoke16> `docker run --rm -it -v $PWD:/app -w /app crystallang/crystal:ci-test-dev-alpine crystal build --release --static src/oq_cli.cr` is the command im doing
<FromGitter> <Blacksmoke16> maybe also need to install `libevent-static`?
<FromGitter> <Blacksmoke16> `ld: library not found for -lcrt0.o (this usually means you need to install the development package for libcrt0.o)` after installing `libevent-static` :/
<FromGitter> <straight-shoota> @Blacksmoke16 Yeah, I haven't tested it for static linking
<FromGitter> <straight-shoota> Main goal was to get CI running
<FromGitter> <Blacksmoke16> 👍 well heads up, it doesnt work :p
sorcus has quit [Ping timeout: 252 seconds]
<FromGitter> <Blacksmoke16> not sure where this `libcrt0.o` error came from tho, using @j8r's image
<FromGitter> <Blacksmoke16> nvm
sorcus has joined #crystal-lang
<FromGitter> <straight-shoota> crystal-lang/distribution-scripts#53
<FromGitter> <Blacksmoke16> <3
<FromGitter> <Blacksmoke16> this stuff will be so much easier with an official image
_ht has quit [Remote host closed the connection]
badeball_ has quit [Ping timeout: 252 seconds]
badeball_ has joined #crystal-lang
duane has quit [Ping timeout: 240 seconds]
alexherbo27 has quit [Quit: The Lounge - https://thelounge.chat]
alex`` has quit [Quit: WeeChat 2.7]
sorcus has quit [Ping timeout: 272 seconds]
sorcus has joined #crystal-lang
natrys has quit [Quit: natrys]
duane has joined #crystal-lang
duane has quit [Ping timeout: 258 seconds]