<FromGitter>
<bew> I had to do this kind of parsing once for a school project, where we had to rewrite a simple `strace`, kinda bruteforce way but it works
moei has quit [Read error: Connection reset by peer]
moei has joined #crystal-lang
alex`` has quit [Quit: WeeChat 1.9]
jxv has quit [Quit: string on the can snapped off]
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
chromis has left #crystal-lang [#crystal-lang]
hightower3 has quit [Ping timeout: 265 seconds]
OceannBoy has joined #crystal-lang
faustinoaq has quit [Quit: IRC client terminated!]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
faustinoaq has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
faustinoaq has quit [Read error: Connection reset by peer]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
OceannBoy has quit [Ping timeout: 256 seconds]
flaviodesousa has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
instancer73 has joined #crystal-lang
<instancer73>
are macros not having access to instance variables ? because when im trying to use an instance variable array in the macro " for " then I get " unknown macro instance var: '@myarr' "
<FromGitter>
<amadanmath> `Spec.expect_raises(IndexError) { ... }` says `wrong number of arguments for macro 'expect_raises' (given 1, expected 1, 2, 3, 4)`
<FromGitter>
<amadanmath> I have no idea what the error is trying to tell me
Papierkorb has quit [Ping timeout: 255 seconds]
jnyw has quit [Ping timeout: 260 seconds]
<FromGitter>
<amadanmath> Ooh, never mind, removing `Spec.` fixes it.
<FromGitter>
<aisrael> Stupid question: How do I ‘upcast’ in `Int32` to an `Int64`?
jnyw has joined #crystal-lang
<FromGitter>
<aisrael> NVM I just discovered `n.to_i64`
Papierkorb has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
<FromGitter>
<xfbs> Either that, or Int64.new(anytype) :)
<FromGitter>
<xfbs> I've been there haha
<FromGitter>
<xfbs> The Int64.new(anytype) syntax is useful for when you write generic classes, btw.
<FromGitter>
<aisrael> Thanks. Will keep that in mind.
<FromGitter>
<aisrael> Next stupid question: How can we check or test if we’re running in a test/spec? I know it’s not ideal but for now this will have to do. What am doing now is using a class instance variable (`testmode : Bool`) and setting that to `true` in `spec_helper.cr`. Is there a more elegant way to do this?
<FromGitter>
<xfbs> Hmm, good question.. why exactly do you have to do that? Normally the way to go would be to use mocking I guess
<FromGitter>
<aisrael> Am using Cossack. Since (currently) there’s no way to globally “inject” a `Middleware` (for testing, I want to log/record all HTTP calls, trying to make a VCR for Crystal), I have to resort to “if testing, inject test middleware"
alex`` has joined #crystal-lang
<FromGitter>
<xfbs> Well I'm not sure, but there is one thing you could try: if the Cossack module has an internal method to send off a HTTP call, what you could do is you could override this method inside your tests, like so: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a742d7a4a6b0dd32b7c82e1]
hightower3 has joined #crystal-lang
<FromGitter>
<xfbs> This way you don't have to clutter your main codebase with testing-related code
<FromGitter>
<aisrael> Oh. I can override Cossack’s methods! Yeah didn’t realize I could do that. Thanks will give it a try
hightower3 is now known as hightower4
<FromGitter>
<aisrael> Hmmnn… I just realize I’d also need to know what the current spec file and `describe` context is if I really want to mimic what VCR does. Looking at Crystal Spec’s docs I don’t think there’s an easy way to do that right now :(
<FromGitter>
<xfbs> What is VCR?
<FromGitter>
<aisrael> (Also, turns out I need to override `Cossack::Client.new` (or the `initialize`) method and that’s beyond my Crystal-fu
<FromGitter>
<aisrael> VCR is the Ruby gem that silently and magically intercepts and records HTTP calls, then can play them back at a later execution. Useful for tests. You write and execute your code as normal, then VCR can record the interaction the first time, then just replay from thereon
<FromGitter>
<xfbs> Ahh I see. Well maybe it would be useful if someone ported `vcr` to crystal? Seems like a nice gem :)
<FromGitter>
<aisrael> I was hankering to do that… but… :)
<FromGitter>
<yxhuvud> @mamantoha please reformulate your question into something that makes a bit more sense
<FromGitter>
<aisrael> Am I the only one who frequently gets confused between `[] of String` and `Array(String)`?
<FromGitter>
<mamantoha> In my example, do_something will be run sequentially one after the other. But I would like them to be executed in parallel by 5 pieces for examples.
<oprypin>
mamantoha, Crystal doesn't have parallel execution. if this is IO-heavy, you can settle for concurrent execution. start a fiber that sends these into a channel sequentially, and start 5 worker fibers each pulling from the channel
<FromGitter>
<mamantoha> `GC Warning: Out of Memory! Heap size: 6285 MiB. Returning NULL!`. Anyway thanks @oprypin. I'll try to figure out what this code does)
rohitpaulk has quit [Read error: Connection reset by peer]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
hightower3 has joined #crystal-lang
rohitpaulk has joined #crystal-lang
hightower has quit [Ping timeout: 276 seconds]
<FromGitter>
<j8r> @aisrael I agree, one syntax should exist instead of two. I prefer the last one, leds confusing. Anyway there ishttps://github.com/mamantoha/crest
<FromGitter>
<j8r> Using gitter on mobile is awful - changing to another tab of paste something make us send the message :(
OceannBoy has joined #crystal-lang
<txdv>
is there a threadpool now that literally runs multiple threads?
<FromGitter>
<faustinoaq> Hi, some ArchLinux user knows why I'm getting warnings on `amber-aur` package: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I marked crystal and shards as dependencies, because they ARE needed to use amber successfully, be namcap keep saying is not needed. Also why is warning about `/usr/lib/librt.so.1'` ? [https://gitter.im/crystal-lang/crystal?at=5a7466f4ce68c3bc7437746b]
alex`` is now known as alexherbo2
alexherbo2 is now known as alex``
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Read error: Connection reset by peer]
<FromGitter>
<faustinoaq> crystal stars vs commits XD
duane has joined #crystal-lang
<FromGitter>
<imonmyown> guys timezone everyone!
<FromGitter>
<imonmyown> did anyone have problems running crystal apps from VSCode on arch?
faustinoaq has quit [Quit: IRC client terminated!]
faustinoaq has joined #crystal-lang
<FromGitter>
<imonmyown> seems like some environment variables did not make it into the shell environment used by VSCode :/
faustinoaq has quit [Read error: Connection reset by peer]
<FromGitter>
<j8r> @RX14 I'm working on adding new targets. I'm seeing to types of syntax. Do I favor `fun access(name : Char*, type : Int) : Int` or `fun access(x0 : Char*, x1 : Int) : Int`- the first one maybe?
<FromGitter>
<straight-shoota> @j8r names should follow the header files
<FromGitter>
<faustinoaq> > did anyone have problems running crystal apps from VSCode on arch? ⏎ ⏎ @imonmyown Are you using vscode internal terminal?
<FromGitter>
<imonmyown> I'm using a shell task in tasks.json
<FromGitter>
<straight-shoota> These lib bindings are presumably going to be generated at one point
<RX14>
Named is better
<RX14>
The weird x0 is because they were auto generated
<FromGitter>
<imonmyown> @faustinoaq I mean the run task I have configured. It doesn't reproduce with disabled extensions btw
<FromGitter>
<j8r> I was thinking so too... I will take the named one. What is the most straight forward way to test if my bindings are correct, cross compile the compiler and test it with qemu?
<FromGitter>
<faustinoaq> > I mean the run task I have configured. It doesn't reproduce with disabled extensions btw ⏎ ⏎ What vscode extensions are you using? `vscode-crystal-lang` doesn't touch the internal terminal, just provides syntax and some other basic features.
<FromGitter>
<faustinoaq> @imonmyown ^
<FromGitter>
<imonmyown> @faustinoaq I *am* using it and it is like one of the other three I'm using, so I'm kinda suspicious. Besides I'm not sure the configured tasks are using integrated terminal and not some other kind of special shell environment.
<FromGitter>
<j8r> This won't be tomorrow that the bindings will be finished, but it's moving forward :-)
<knight_>
RX14: I'd be willing. Just need to figure out what to do.
<RX14>
yeah
<RX14>
well you need to install the qt5 development files and work out where they go and how to tell Papierkorb's scripts where to find the relevant files and directories
<Papierkorb>
Don't have time right now (in 1.5hrs .. ish?), but the gist is that yeah, you need to provide qmake so it can find most files. You'll also need to edit config/find_paths.yml and just remove lines 56-65 for now. In any case, you need to get bindgen working first, use its test suite (just `crystal spec`) for that
<Papierkorb>
If the test suite works, qt5 is just a (potentional) path fix away from working too knight_
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Papierkorb>
And for bindgen you should only actually need: clang, llvm, and development libraries of both (basically, tons of static libs and headers)
<Papierkorb>
You can use LLVM4.0 or 5.0, both work.
<Papierkorb>
Use the master branch on qt5, the ready-to-use branch doesn't ship with macos files, only thing you get is a headache from getting your changes into the master branch otherwise :P
<RX14>
i need to just steal someone's amc
<RX14>
mac*
qard has joined #crystal-lang
<RX14>
honestly I'm sure someone would be happy to arange for you to get a remote shell on their mac for a few hours Papierkorb
<FromGitter>
<imonmyown> I'm currently trying to figure this out, if I fail (in 1.5hrs .. ish?), I'll arrange a remote shell
<FromGitter>
<imonmyown> the problem I see now is that maverix, which I got downgraded to recently has no current support for crystal homebrew package. So need to download and install an update
<FromGitter>
<imonmyown> Which might send me to constantly recurring reboots after update starts.
<FromGitter>
<imonmyown> So-o-o.. remote shell is under the question
DTZUZU has quit [Read error: Connection reset by peer]
<oprypin>
lvmbdv, well it's done so that it runs at compilation, not every time you run the program
<oprypin>
but i guess it's not absolutely necesary
<lvmbdv>
thanks
willamin has joined #crystal-lang
<crystal-gh>
[crystal] Sija opened pull request #5675: Support BigDecimal comparison with and initialization from BigRational (master...bigdecimal-with-bigrational) https://git.io/vNAIv
moei has quit [Read error: Connection reset by peer]
moei has joined #crystal-lang
qard has joined #crystal-lang
<FromGitter>
<j8r> What is llvm_ext.o?
<FromGitter>
<j8r> A better question is: how to generate one for cross compilation?
<RX14>
`make deps`
<RX14>
on the target
<RX14>
when cross-compiling you need the same version on target and host
<FromGitter>
<j8r> ok I see
<FromGitter>
<j8r> Not easy - I use docker containers to do so
<FromGitter>
<aisrael> @vonKingsley Nice! FWIW I already got a functioning Cossack hook. But will check out Hi8 (no use reinventing the wheel) and maybe hopefully contribute
cremes has quit [Quit: cremes]
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]