<FromGitter>
<Blacksmoke16> prob should build in release as well :p
<FromGitter>
<silmanduin66> if you're patient yes
<FromGitter>
<silmanduin66> if you just want to see if it's working better not :-P
<FromGitter>
<Blacksmoke16> :p fair enough
<FromGitter>
<kevinelliott> @silmanduin66 Oh I see, cool.
<FromGitter>
<kevinelliott> What version has the aarch64 armv8 patches?
<FromGitter>
<silmanduin66> Crystal 0.27.1-dev
<FromGitter>
<silmanduin66> llvm 6.0.1
<FromGitter>
<kevinelliott> awesome
<FromGitter>
<silmanduin66> but Crystal is partially broken on aarch64 with
<FromGitter>
<silmanduin66> llvm 6.0.1
<FromGitter>
<silmanduin66> that why I have to cross compile
<FromGitter>
<silmanduin66> *that's
<FromGitter>
<kevinelliott> oh otherwise you’d build directly on device?
<FromGitter>
<kevinelliott> what are you building for embedded btw?
<FromGitter>
<silmanduin66> yeah , but after some thoughts it s useless to directly build on the device ( too slow )
<FromGitter>
<silmanduin66> i have 2 raspberry pi 3
<FromGitter>
<silmanduin66> on one I will make a simple static web
<FromGitter>
<silmanduin66> on the other I m making a chat app
<FromGitter>
<silmanduin66> using the Amber framework
<FromGitter>
<silmanduin66> *website
<FromGitter>
<kevinelliott> chat app on pi? what’s the use case there?
<FromGitter>
<kevinelliott> btw, i do a lot on embedded too… i think i have about 20 pi’s here at home
<FromGitter>
<silmanduin66> I m building a small app which will be included in a website so people from this website can talk to each other and answers questions
<FromGitter>
<silmanduin66> the only reason I use rpi3 is that is the only "server" I have for the moment
<FromGitter>
<kevinelliott> Oh i see, cool
<FromGitter>
<silmanduin66> I had to buy a rpi for some sensors project
<FromGitter>
<silmanduin66> accelerometer and gyroscope
<FromGitter>
<silmanduin66> but I don't use any more so I ll use them as web server for the moment :-P
Raimondi has joined #crystal-lang
<FromGitter>
<Blacksmoke16> is there a way to build and run tests against a built app?
wmoxam has joined #crystal-lang
spacemanspam has joined #crystal-lang
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 245 seconds]
jemc has quit [Quit: WeeChat 2.2]
<FromGitter>
<Blacksmoke16> nvm didnt end up needing it
_whitelogger has joined #crystal-lang
<FromGitter>
<Nbotz> SO I found this shard for detecting user agents, but its completely useless if i have to enter the user agent manually, so how do i detect user agents?
return0e_ has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
spacemanspam has quit [Read error: Connection reset by peer]
cyberarm has quit [Ping timeout: 240 seconds]
<FromGitter>
<r00ster91> Isn't Crystal's `var = uninitialized Int32` actually the same as C's `int var;`?
cyberarm has joined #crystal-lang
<FromGitter>
<j8r> @silmanduin66 you can build statically for arm64 with Docker on x86-64 if you're interested. It's not really fast with qemu, usually it take x10 more times
<FromGitter>
<silmanduin66> @j8r thanks but i'm only targetting aarch64 for the moment and i do it from my x86-64 pc so it's fine.
<FromGitter>
<silmanduin66> btw i have absolutely no idea what is docker
<FromGitter>
<silmanduin66> same with qemu
<FromGitter>
<silmanduin66> my plan is to simply test the code on my x86-64 machine and then cross compile to aarch64
<FromGitter>
<j8r> You have exactly the same library version on both your PC and RPi?
<FromGitter>
<j8r> For all the dependencies? This is required for linking
<FromGitter>
<silmanduin66> yes i have
<FromGitter>
<silmanduin66> archlinux OS, crystal 0.27.0-1 and llvm 6.0.1
<FromGitter>
<j8r> Nice then 👍
<FromGitter>
<silmanduin66> but i guessi should learn how to use docker right ?
<FromGitter>
<j8r> Don't know, depends of your needs. Sometimes Docker is useful
<FromGitter>
<j8r> That's like LXC, Jails or even VM but more user friendly (on the surface)
<FromGitter>
<silmanduin66> well i come from a math background so all my programs were pretty long single file calculation code
<FromGitter>
<silmanduin66> but i'm going into web developpement
<FromGitter>
<silmanduin66> so i have no idea about most of the tools people are using
<FromGitter>
<j8r> Oh, ok. Interesting
<FromGitter>
<j8r> For devs the main advantages with Docker is having the same environment for all people, even in macOS, Windows, whatever Linux and in Prod
<FromGitter>
<j8r> This prevents also setup times to install all the dependencies locally
<FromGitter>
<silmanduin66> so you actually run your code with / on ? docker before deploying or the target machine ?
<FromGitter>
<silmanduin66> *on the target
<FromGitter>
<j8r> I compile inside the container. That's a reproducible build
<FromGitter>
<silmanduin66> so if you 're making a web app, where do you test it ?
<FromGitter>
<j8r> I've crystal installed on my machine for simplicity, I use Docker primilarly for the final release build
<FromGitter>
<j8r> i.e I run `crystal build myapp.cr` locally and `crystal build --release myapp.cr` in Docker
<FromGitter>
<silmanduin66> ok i see, and what is the speed diffrence with building on docker and locally ?
<FromGitter>
<j8r> I build also with --static on docker
<FromGitter>
<j8r> A bit slower – normal
<FromGitter>
<j8r> Not that much, it shares the kernel with the host
<FromGitter>
<silmanduin66> oh about --static , i didn't understand what is the advantage . It makes a bigger file right ?
<FromGitter>
<j8r> Yes, that you can run everywhere
<FromGitter>
<j8r> All libs are bundled into it
<FromGitter>
<silmanduin66> oh interesting
<FromGitter>
<silmanduin66> i didn't know about that :-P
<FromGitter>
<j8r> It works only on Alpine Linux
<FromGitter>
<silmanduin66> hmm
<FromGitter>
<silmanduin66> i don't have alpine linux
<FromGitter>
<j8r> Because of musl.
<FromGitter>
<j8r> Me too, that's why Docker :)
<FromGitter>
<j8r> Some uses also LXC/LXD, that's up to your taste
<FromGitter>
<j8r> It's also practical to have a quick sandbox ready in 1s instead of a big VM
<FromGitter>
<silmanduin66> hmm i actually spent hours trying to make crystal work on my aarch64 and now i learn i could just use docker
<FromGitter>
<silmanduin66> :-P
<FromGitter>
<j8r> :) Yes you could compile statically, drop the binary in your RPi and done
<FromGitter>
<silmanduin66> yeah now i'm doing that with cross-compile but i think your way is much more efficient
<FromGitter>
<silmanduin66> i'll try tonight if i have time thanks :-)
<FromGitter>
<Sija> adding `.as(String?)` helps but that’s ugly and pointless :/
<Jenz>
There's also `| nil`
<Jenz>
(i.e. `"foo" | nil`)
<FromGitter>
<Sija> no?
<FromGitter>
<Sija> that’s calling `|` operator on `String` instance?
<Jenz>
Oh
<FromGitter>
<talbergs> Yes today I run in many Proc type issues as well: `Proc(Nil, Nil) # is created if i capture method that returns nil` and `Proc(Nil) # is made from "proc = ->{}"` and they are not equal.
<Jenz>
True, Sija
<FromGitter>
<talbergs> Also some `Proc(NoReturn)` type appeared among all this
<FromGitter>
<talbergs> Id expect all 3 of them to be assumed the same at compile time
<Jenz>
I meant "foo" ||nil
<FromGitter>
<Sija> `Proc(Nil, Nil)` means you’re passing a `Nil` argument and expect a `Nil` return type, whereas in the second case there’s no arguments passed, just `Nil` return type
<Jenz>
Though it'll always evaluate to "foo", it'll be of type String?
<FromGitter>
<talbergs> Yes but the class method I capture - it does not accept any arguments, and still `Proc(Nil, Nil)` got implied
<FromGitter>
<Sija> @Jenz yep, that would work but it’s just a different flavor of `.as(String?)`, still weird and pointless :(
<Jenz>
Indeed :(
<FromGitter>
<Sija> @talbergs that’s odd,do you have any short repro code?
<FromGitter>
<talbergs> Second.
<Jenz>
Uh, how do I list all items in view again?
<Jenz>
Oops wrong chat, sorry
<Jenz>
*channel
simerax has joined #crystal-lang
<FromGitter>
<talbergs> Ok, that must be my overlook. No issues sorry
<FromGitter>
<girng> guess what Saturday is?? Crystalday!!
<FromGitter>
<girng> All day bby lets get it
<FromGitter>
<girng> @Blacksmoke16 thanks for helping me with `round`. am using it and my hp/mp values get sent over the pipe as 2 decimals only now, not 5.999999 or whatever.
<FromGitter>
<Blacksmoke16> np
<FromGitter>
<Blacksmoke16> https://carc.in/#/r/5zif trying to implement `Union#nilable?` but i dont know what im doing :p
<FromGitter>
<Blacksmoke16> in my example if i print `pp @types # => [String, :Nil]` but that returns flast
<mps>
RX14: Alpine v3.9_rc1 is released with crystal 0.27.0 on x86_64 and aarch64
<RX14>
Yay
<mps>
I tested in on both and looks fine, didn't noticed any problem
<mps>
s/in on/it on/
<mps>
if I see something not working I will post here
<FromGitter>
<kingsleyh> evening :)
<FromGitter>
<Blacksmoke16> o/
<FromGitter>
<kingsleyh> @girng I see there is Ruby custom language support for godot - I was considering making a Crystal one
spacemanspam has quit [Read error: Connection reset by peer]
<FromGitter>
<girng> @kingsleyh that would be very interesting/cool
<FromGitter>
<girng> i saw the ruby repo on that, i remember it saying it had like 20x worse performance than gdscript though LOL. although, crystal would be faster i imagine
<FromGitter>
<girng> but, seems like a big undertaking (from my perspective)
simerax has quit [Remote host closed the connection]
_whitelogger has joined #crystal-lang
<FromGitter>
<kingsleyh> I think it will have threading issues
<FromGitter>
<kingsleyh> After reading more into it - it looks pretty easy to write C bindings same as the Ruby one
<FromGitter>
<kingsleyh> But godot works by using many threads which cause the Ruby version to hang and crash - which is one reason they wrote gdscript - I think Crystal will suffer the same issues with threading
<FromGitter>
<kingsleyh> Maybe forking multiple processes would be a workaround