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
marmotini_ has quit [Ping timeout: 245 seconds]
marmotini_ has joined #crystal-lang
marmotini_ has quit [Ping timeout: 268 seconds]
marmotini_ has joined #crystal-lang
<FromGitter> <dscottboggs_gitlab> I'm trying to createa simple test webserver which logs the request for degubbing and whatnot. One of the things i was trying to log was the remote address, but when I run this code (https://play.crystal-lang.org/#/r/5alu) I get this exception: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ do I need to use bind_tls to be able to access the remote_address attribute or am I doing something else wrong
ashirase has quit [Ping timeout: 264 seconds]
rohitpaulk has joined #crystal-lang
marmotini_ has quit [Ping timeout: 246 seconds]
<FromGitter> <sam0x17> I'm trying to trick crystal into letting me inherit a `new` method like so: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ https://play.crystal-lang.org/#/r/5am7 ... [https://gitter.im/crystal-lang/crystal?at=5bcd59bfae7be94016968b21]
<FromGitter> <dscottboggs_gitlab> I think you're supposed to use `#initialize` instead of `#new`? although if you're trying to explicitly use `#new` then idk
<FromGitter> <sam0x17> haha wow my fault
<FromGitter> <dscottboggs_gitlab> nbd :)
<FromGitter> <sam0x17> I jump between languages too much
<FromGitter> <dscottboggs_gitlab> same
<FromGitter> <sam0x17> and now it works thanks :)
<FromGitter> <dscottboggs_gitlab> oh good 👍
<FromGitter> <sam0x17> yeah I actually fully expected it to not let me inherit the initialize but it does
<FromGitter> <dscottboggs_gitlab> oof no that's really important haha
<FromGitter> <sam0x17> yup lol
<FromGitter> <sam0x17> working in rust for 2 weeks has me expecting everything to not work
<FromGitter> <dscottboggs_gitlab> I looked at rust a couple times and decided now wasn't the time to learn it. too...different.
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 264 seconds]
<FromGitter> <Heaven31415> Damn, something terrible is happening to github, everything is fucked up really good. I cannot see issue that I reported...
<FromGitter> <bew> @j8r you can rename your crypt binding namespace from `LibC` to `LibCrypt`now :)
<FromGitter> <dscottboggs_gitlab> yeah I created a new repository and it created then I couldn't see it.
<FromGitter> <j8r> @bew I'll have `LibCrypt.crypt` :/
<FromGitter> <j8r> but why not, good idea
<livcd> i missed this but what is the biggest blocker for Crystal on Windows ?
<FromGitter> <bararchy> nothing too major, just going down the list
<FromGitter> <proyb6> @livcd
<FromGitter> <proyb6> The biggest blocker for a Crystal is Python, Powershell and .Net?
<livcd> lol
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii is now known as Raimondi
<FromGitter> <vladfaust> Hey @ljuti, thank you! You know what for :)
nekocentral has joined #crystal-lang
<nekocentral> i guess i join here as gitter is not working for me atm
<nekocentral> Is there a reason why dns_timeout in http::client has no effect atm?
<FromGitter> <Heaven31415> what is going on with github today?
<FromGitter> <j8r> https://status.github.com/messages :-/
<nekocentral> that explains why gitter doesnt send my messages and keep logging me out
<nekocentral> cant create a solid session because i login with github
<FromGitter> <Heaven31415> I hope this isn't connected to the fact that Microsoft now owns github : (
<FromGitter> <Heaven31415> and github won't share the fate of nokia and skype
<FromGitter> <j8r> it's unrelated
<FromGitter> <j8r> the choice of MySQL was taken before
<FromGitter> <alehander42> it seems to be working for me
<nekocentral> yea its a network partition that failed and took a database down
<FromGitter> <j8r> this only impact webhooks like issues/PR
<nekocentral> i call bs as login with github is also acting wierdly for me
<nekocentral> atleast on gitter so might be a problem there
<nekocentral> on reload i need to relog and cant send messages on multiple browsers
zorp has joined #crystal-lang
<FromGitter> <Heaven31415> Ok, my issue is working again: https://github.com/crystal-lang/crystal/issues/6976
<FromGitter> <Heaven31415> They are indeed restoring them
<nekocentral> I wonder now why is DNS_Timeout marked as not having an effect but in my testing it works
nekocentral has quit [Ping timeout: 246 seconds]
nekocentral has joined #crystal-lang
<nekocentral> back
flaviodesousa has joined #crystal-lang
tankf33der has joined #crystal-lang
nekocentral has quit [Ping timeout: 244 seconds]
<FromGitter> <vladfaust> BountySource is down
<FromGitter> <Heaven31415> any idea why?
<FromGitter> <KevinSjoberg> I'm trying to use Crystal together with Nanobox. There is an outstanding conversation on Trello about this that seem to gone quiet, https://trello.com/c/belEWLqo/60-crystal. Anyone know what the current status is?
nekocentral has joined #crystal-lang
<nekocentral> what is the best way to cast a int to string
<FromGitter> <Heaven31415> `to_s`
<nekocentral> legit
<nekocentral> ffs
<nekocentral> ty
<nekocentral> i feel stupid for that one haha
<FromGitter> <vladfaust> @KevinSjoberg it's better to pursue them on https://docs.nanobox.io/engines/create/
<FromGitter> <vladfaust> You tried DC/OS btw?
<nekocentral> dc/os?
<nekocentral> Damn crystal is nice, going fast
<FromGitter> <KevinSjoberg> @vladfaust I guess you're referring to docker compose/open shift?
<FromGitter> <vladfaust> @KevinSjoberg https://dcos.io/
<nekocentral> @vladfaust saving that one
<FromGitter> <KevinSjoberg> @vladfaust nice!
<nekocentral> going afk, biking home
nekocentral has quit [Ping timeout: 240 seconds]
nekocentral has joined #crystal-lang
<FromGitter> <bararchy> @vladfaust now crystal jobs looks like our website but only in black :) hahaha
<FromGitter> <vladfaust> That particle.js is everywhere
<FromGitter> <bararchy> yeha lol i know was joking :) I really like it, it looks really good!
<FromGitter> <vladfaust> Moreover, it has an utility value at last :)
<FromGitter> <ljuti> @vladfaust You’re welcome! Keep up the great work.
<FromGitter> <bararchy> @vladfaust true, I really hope it serves the community
<FromGitter> <vladfaust> ❤️
<FromGitter> <Heaven31415> I really like your avatar Vlad, on gitter you look like a girl, I had a nice surprise when I zoomed in xD
<FromGitter> <vladfaust> I don't know how to react to this
<FromGitter> <bararchy> LOL
<FromGitter> <bararchy> 😂
<nekocentral> one sec logging in on gitter xD
<FromGitter> <bararchy> hahaha
<nekocentral> LOL
<nekocentral> vlad the trap
<FromGitter> <vladfaust> Surprise mufaka
<FromGitter> <bew> Just don't x)
<nekocentral> xD
<nekocentral> started to work on a crystal version the the tecsmart monitor got first things working partly due to people in here so happy
<nekocentral> but i still dont get why http::client.dns_timeout is marked as not having an effect atm in the docs when it works
<nekocentral> can i cross compile on crystal
<nekocentral> like compile for arm, x86 and x64
<FromGitter> <Heaven31415> I think you can
<nekocentral> yea just trying to find out how
<nekocentral> as i have a couple of architectures that i want to test my thing at
<nekocentral> brb laptop about to die
<FromGitter> <j8r> for arm, only aarch64
nekocentral has quit [Ping timeout: 244 seconds]
nekocentral has joined #crystal-lang
akaiiro has joined #crystal-lang
marmotini_ has joined #crystal-lang
<nekocentral> ffs git is broken again
silmanduin has joined #crystal-lang
<FromGitter> <j8r> github yeah - thinking about a solution to sync mirrors between github - gitlab - bitbucket
<FromGitter> <j8r> e.g. github is master and the 2 others are simply mirrors - PR are merged to github by a bot. If GitHub is down, gitlab becomes master
<FromGitter> <RyanScottLewis> Yeesh took 5 tries to get in here =S
<FromGitter> <RyanScottLewis> Is there an RSS feed for the crystal blog/releases?
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #crystal-lang
marmotini_ has quit [Ping timeout: 264 seconds]
marmotini_ has joined #crystal-lang
<nekocentral> i just use my self hosted git
<nekocentral> long live gitea
<FromGitter> <straight-shoota> nekocentral, it's not about git itself. Setting up a mirror is really simple.
<FromGitter> <straight-shoota> Problematic are the community features around it, discussions in the issue tracker, PRs etc. That's currently affected on Github.
<nekocentral> well i created a repo and asked a couple of people, one page load the repo exist next time not and i cant push to it as it says it doesnt exist
<FromGitter> <straight-shoota> Maybe that's an edge case with a newly created repo?
<FromGitter> <straight-shoota> I didn't face any issues with git access. And Github states "Git repository data remains unaffected and has been available throughout the incident."
<FromGitter> <j8r> that's the hooks that are affected
<FromGitter> <j8r> creating a repo may trigger some
<FromGitter> <straight-shoota> But anyway, mirroring the git repo to Gitlab, Bitbucket or a self-hosted gitea would easily help to prevent issues with accessing the repo
<nekocentral> yea
<nekocentral> i keep my special project on gitea
flaviodesousa has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii is now known as Raimondi
wontruefree has joined #crystal-lang
sevensidedmarble has quit [Ping timeout: 246 seconds]
helaan has joined #crystal-lang
<helaan> @nekocentral: If you want to crosscompile, use the flags "--target=arm-unknown-linux-gnueabihf --cross-compile" for armv7a. Then you need to transfer the resulting .o file to the other host and run the shown cc command
<helaan> Although I've had bad luck with getting it working, including random runtime failures
<FromGitter> <j8r> only aarch64 is supported
<helaan> If I have issues on aarch64, where can I complain?
<FromGitter> <j8r> hum... this isnt a well test platform :/
sevensidedmarble has joined #crystal-lang
<helaan> I've crosscompiled a compiler, then each time I try to use it, I get Invalid memory access errors
<FromGitter> <mettuaditya> is there any reference for garbage collector in crysal
non-aristotelian has joined #crystal-lang
<FromGitter> <KevinSjoberg> Is there any easy way to define a setup/teardown-flow running once for all specs within a test file? I have a mock server I want to start when specs start running and the shutdown when the tests are complete.
<nekocentral> ty helaan, will try i have a armv71 and v5 to test on
<nekocentral> and the code is simple
<helaan> Haven't tried on armv5, but from my armv7a experience I can already say: here be dragons
tankf33der has left #crystal-lang [#crystal-lang]
<FromGitter> <mettuaditya> how to implement stack data structure in crystal
<helaan> @mettuadiya: If you just need one, try Array#push and #pop
<FromGitter> <mettuaditya> is there something like dynamic memory allocation in crystal
<helaan> The language is full of it, for example the Array class is a dynamic array, when you create objects, you also often allocate new memory
<FromGitter> <straight-shoota> @KevinSjoberg No, there are only global spec hooks.
<FromGitter> <straight-shoota> I'd suggest to define a spec helper method accepting a block and call that in each spec.
<FromGitter> <mettuaditya> then how to implement graphs in crystal lang
<FromGitter> <Heaven31415> You can use `GC.malloc` to allocate memory dynamically and build any data structure you need
<FromGitter> <KevinSjoberg> @straight-shoota makes sense, only con is that I have to stop/start the server for each spec. I could probably code my way around that, but I think i'd would be tacky.
<helaan> Are there known issues with Crystal and LLVM 6.0.1? It just likes crashing, even got it to crash on amd64
notdaniel has joined #crystal-lang
<FromGitter> <straight-shoota> @KevinSjoberg Yeah, that's difficult
<FromGitter> <straight-shoota> But maybe it's better anyway to have "fresh" server for each spec?
<FromGitter> <mettuaditya> but to implement graphs we need to have pointers ri8
<nekocentral> damn i even have to compile crystal my own on arm
<FromGitter> <Heaven31415> There is a `Pointer(T)` which you can use
<FromGitter> <Heaven31415> It works like regular C pointer, just a little bit different syntax
<FromGitter> <Heaven31415> You can find more about it in docs
<helaan> nekocentral: you can avoid that by crosscompiling everything from an amd64 host
<FromGitter> <Heaven31415> Also crystal-book tells a few useful things that you will probably need when dealing with pointers
akaiiro has quit [Ping timeout: 252 seconds]
<nekocentral> okay, so just run the cc command from the main machine
<FromGitter> <KevinSjoberg> @straight-shoota usually, I'd agree with you. :slight_smile: This mock server is just static, always returning the same fixture for each "route". I guess the overall overhead isn't that bad anyway, but it would have been nice start/stopping one for the test suite.
<helaan> Crystal is self hosting, so you need a compiler to compile one: if your arm box has enough ram (1 GB on my RPi doesn't cut it) you can try building a compiler natively
<FromGitter> <straight-shoota> @KevinSjoberg You could use the helper to start the server only if it's not running. And add an `at_exit` hook to stop it.
<nekocentral> yea its short from eneugh
<nekocentral> 512mb
<FromGitter> <KevinSjoberg> @straight-shoota oh, totally blanked on `at_exit`. That's a great idea! :)
<FromGitter> <mettuaditya> can u send me link to this crystal-book
<nekocentral> i can make a qemu arm vm
akaiiro has joined #crystal-lang
<helaan> You can crosscompile the compiler from your host, then just use that?
<nekocentral> idk
<helaan> Or just crosscompile your app. I'm assuming you have an amd64 pc?
<helaan> When crosscompiling, I found this SO post useful: https://stackoverflow.com/questions/42796143/x/42796648#42796648
<nekocentral> someone made a unofficial arm repo
<nekocentral> aka easier now
<FromGitter> <Heaven31415> @mettuaditya https://crystal-lang.org/docs/overview/
<nekocentral> ffs
<helaan> I recognize the error, is there more info?
<nekocentral> this is the complete error
<nekocentral> its a crystal build
<helaan> This is what I get when I run crystal build: https://gist.github.com/helaan/261f1052ebfb510b1e6ae1783a87883f
<nekocentral> your own compiled version
<helaan> Yes, that is my own compiled version
<nekocentral> try this version
<helaan> You are using that one?
<nekocentral> yea
<helaan> And it also crashes in the same way?
<nekocentral> not in your way
<nekocentral> i get a crypto problem
silmanduin has quit [Quit: WeeChat 2.2]
<helaan> Not sure how this is a crypto problem
<helaan> nekocentral: Can you compile a simpler piece of code? like `puts "Hello world"` level of simple?
<nekocentral> just found out i was missing libssl-dev
<nekocentral> will check again when done installing
<helaan> That explains the missing stacktrace: likely your compiler doesn't actually crash
<nekocentral> fuck
<nekocentral> out of space xD
<helaan> Does someone know where can I find which versions of LLVM are supported for Crystal? The portalier.com page shows he builds agains LLVM 5, while I build against 6
<FromGitter> <Heaven31415> LLVM 3.8, 3.9, 4.0, 5.0, or 6.0.
<FromGitter> <Heaven31415> At least if this page is telling the truth: https://github.com/crystal-lang/crystal/wiki/All-required-libraries
helaan has quit [Quit: WeeChat 2.2]
helaan has joined #crystal-lang
<helaan> Heaven31415: That page seems recent, thanks for the link
<nekocentral> finaly the project compiled
<nekocentral> passed the withoutopenssl flag
<nekocentral> clear
<nekocentral> oops wrong place haha
ua_ has joined #crystal-lang
ua has quit [Ping timeout: 272 seconds]
helaan has quit [Quit: WeeChat 2.2]
<FromGitter> <dscottboggs_gitlab> I'm getting an error ⏎ `macro 'be_a' must be defined before this point but is defined later` ⏎ when I try to run my specs. is this a bug or am I doing something wrong? my spec is in a macro, would that cause a problem?
<FromGitter> <dscottboggs_gitlab> this is the file that is causing the problem https://github.com/dscottboggs/sysinfo.cr/blob/stat-revisions/spec/sysinfo/stat_spec.cr
<FromGitter> <asterite> you are probably doing `require "spec"` after requiring the file you mention
<FromGitter> <dscottboggs_gitlab> oh, that could be, I'll check that. thanks
davic has quit [Quit: ZNC - http://znc.in]
<FromGitter> <dscottboggs_gitlab> yes, I had not `require`d my spec helper in that file. whoops. thanks
<FromGitter> <wontruefree> Should an http client always send the host header? It looks like curl does
<FromGitter> <straight-shoota> Yes, it's mandatory
<FromGitter> <wontruefree> good I was just checking
<FromGitter> <wontruefree> I didnt see it in the #set_defaults in the http/client
<FromGitter> <wontruefree> I see it now
wontruefree has quit [Quit: this is not the client you are looking for]
davic has joined #crystal-lang
<FromGitter> <girng> Hello!!
marmotini_ has quit [Ping timeout: 252 seconds]
nekocentral has quit [Read error: Connection reset by peer]
<FromGitter> <fridgerator> Pretty good, yourself?
<FromGitter> <dscottboggs_gitlab> I'm doing pretty well, how are you @girng