<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
<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>
<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>
<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
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
<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
<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>
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.
<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?