ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.30.0 | 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
<FromGitter> <Blacksmoke16> @absolutejam_gitlab
<FromGitter> <Blacksmoke16> ```brew tap blacksmoke16/tap ⏎ brew install oq``` [https://gitter.im/crystal-lang/crystal?at=5d4e0a531dadc42a114227d4]
<FromGitter> <Blacksmoke16> i tried it out myself and seems fine, however im on mojave so only bottle i have is for that
<FromGitter> <Blacksmoke16> @watzon correct, their immuatable
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
sorcus has quit [Ping timeout: 250 seconds]
<FromGitter> <voximity> i don't know if this necessarily the place i should be posting my question, but i'm binding a C library (blend2d) to crystal, and i'm having trouble with a specific struct structure. in this library, several structs will write out anonymous unions/structs in the parent struct like this, and i'm not sure how to bind that into crystal's struct format for libraries
<FromGitter> <voximity> can i literally just write out each and every field into the base struct without any extra union keywords?
<FromGitter> <Blacksmoke16> paging @dscottboggs_gitlab
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
return0e_ has joined #crystal-lang
<FromGitter> <dscottboggs_gitlab> yessir?
return0e has quit [Ping timeout: 244 seconds]
<FromGitter> <dscottboggs_gitlab> oh, I see
<FromGitter> <dscottboggs_gitlab> @voximity, union and struct literals are kinda a pain point when it comes to binding to C. If you need to be able to create a `BLPathView` from Crystal (you probably would want to at least be able to), you will need to define each structure as it's own top-level named structure, and then use the structure to denote the type. I'll give an example in a second.
<FromGitter> <dscottboggs_gitlab> (I hope he's still around to see this, sorry I didn't get home earlier)
* FromGitter * tenebrousedge is curious to hear the answer either way
<FromGitter> <dscottboggs_gitlab> If you don't need to create/mutate a `BLPathView` from within Crystal -- that is, you can rely upon calling out to C functions to do work there, you can simply do `type BLPathView = Void*` and call it a day.
<FromGitter> <dscottboggs_gitlab> https://carc.in/#/r/7dqb
<FromGitter> <dscottboggs_gitlab> for example, @tenebrousedge and @voximity
<FromGitter> <dscottboggs_gitlab> I'm very confused about the specific example though -- a union with a single member makes no sense
<FromGitter> <asterite> it's a union of either the struct or the view
<FromGitter> <asterite> in Crystal you would need to give a name to the inner struct
<FromGitter> <dscottboggs_gitlab> Oh, I see
<FromGitter> <dscottboggs_gitlab> I thought BLPathView view was naming the struct and the instance within the union of the struct
alex`` has quit [Ping timeout: 258 seconds]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <absolutejam_gitlab> Say I have an OpenAPI I want to wrap
<FromGitter> <absolutejam_gitlab> Some of the requests & responses use pre-defined parameters or objects, so that's easy enough
<FromGitter> <absolutejam_gitlab> but some of the them are amalgamations of different objects
<FromGitter> <absolutejam_gitlab> the Docker Engine API has a 'ContainerCreate' request and it accepts an object that contains other, pre-defined objects (which i've created classes for)
<FromGitter> <absolutejam_gitlab> I guess, I'm mostly asking about the output from the API. If it just returns some random keys for each request, should I just spit out a hash for the user or should I wrap each one as class?
<FromGitter> <absolutejam_gitlab> Let's start there
<FromGitter> <absolutejam_gitlab> Because if I did wrap each one, I'd probably keep it vague, like `ContainerCreateResult`
<FromGitter> <absolutejam_gitlab> I'm half rubber-ducking here, but if anyone has any suggestions, go wild
devil_tux has joined #crystal-lang
ht_ has joined #crystal-lang
devil_tux has quit [Ping timeout: 248 seconds]
devil_tux has joined #crystal-lang
sorcus has joined #crystal-lang
_whitelogger has joined #crystal-lang
alex`` has joined #crystal-lang
devil_tux has quit [Ping timeout: 268 seconds]
devil_tux has joined #crystal-lang
devil_tux has quit [Ping timeout: 245 seconds]
devil_tux has joined #crystal-lang
<FromGitter> <kingsleyh> hey - does `shards build --release` do the same things as `shards build --production`
<FromGitter> <kingsleyh> hmm or has `--release` been replaced with `--production` - if so I didn't notice lol - maybe i should switch to using `--production`
<FromGitter> <absolutejam_gitlab> Does it do the same as Crystal build? Never used shards build
<FromGitter> <kingsleyh> not sure but `crystal build` does have `--release` - so maybe `shards build --production` just calls down to that
devil_tux has quit [Ping timeout: 245 seconds]
<FromGitter> <andrius> I need to encrypt a string (ruby code: https://gist.github.com/andrius/839015581f1f8dde64447f5f92d148f7). There are notes about OpenSSL RSA key with Crystal limitations on google,, so what is present situation?
<FromGitter> <j8r> @kingsleyh `shards build --release` maps `crystal build --release`
<FromGitter> <j8r> I don't know what is`--production`
<FromGitter> <absolutejam_gitlab> I wish there was a Crystal podcast
<dingenskirchen> going by https://github.com/crystal-lang/shards/search?q=production&unscoped_q=production `--production` mostly seems to exclude dev dependencies from shards tasks
blassin has quit [Ping timeout: 246 seconds]
<FromGitter> <codenoid> so can i combine --release and --production at once ?
blassin has joined #crystal-lang
<FromGitter> <Blacksmoke16> @kingsleyh @codenoid `--production` does `--release` and also only installs non dev deps
<FromGitter> <Blacksmoke16> @absolutejam_gitlab `cat swagger.yaml | oq -i yaml .`
<FromGitter> <Blacksmoke16> was the command you had in the issue actually working for you?
alex`` has quit [Quit: WeeChat 2.5]
devil_tux has joined #crystal-lang
devil_tux has quit [Ping timeout: 248 seconds]
lucasb has joined #crystal-lang
laaron- has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron- has quit [Remote host closed the connection]
laaron has joined #crystal-lang
Nekka_ has joined #crystal-lang
Nekka_ has quit [Client Quit]
devil_tux has joined #crystal-lang
<FromGitter> <Daniel-Worrall> Well don't try to build crystal on docker Ubuntu latest since it has llvm 6.0.0 which is bugged
<sorcus> https://sorcus.name/screenshot-2019-08-10_16-10-29.png - this is known bug or something else?
<FromGitter> <Daniel-Worrall> yikes, getting spec issues on LLVM7 as well
<sorcus> Crystal 0.30.0 (2019-08-06), LLVM: 8.0.1, Default target: x86_64-pc-linux-gnu
<sorcus> Issue reproduced on Archlinux with libevent 2.1.11-1.
<sorcus> No issue with libevent 2.1.10-1.
<FromGitter> <Daniel-Worrall> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d4ef1261dadc42a1148326c]
<sorcus> Failed with `crystal run test.cr`, `crystal build test.cr`. But `crystal build --release test.cr` has no this issue.
<FromGitter> <Daniel-Worrall> Was building it with 0.30.0, seeing if building it with 0.29.0 helps
<FromGitter> <Daniel-Worrall> nope, same shit
devil_tux has quit [Ping timeout: 258 seconds]
fyber has quit [Read error: Connection reset by peer]
<FromGitter> <asterite> known bug, fixed in master
<FromGitter> <asterite> search for libevent
<FromGitter> <asterite> will be fixed in 0.30.1
fyber has joined #crystal-lang
<sorcus> asterite: Good news. Thanks.
<FromGitter> <voximity> @dscottboggs_gitlab got it, thank you :)
<jokke> is there by chance a crystal lib for common algorithms such as the travelling salesman problem
<jokke> i'm aware that there are just approximizations
Raimondi has quit [Quit: WeeChat 2.5: ¡Chau!]
Raimondi has joined #crystal-lang
<FromGitter> <kniknoo> I'm trying to do a RasPi build. Can anyone give me some insight about the "cannot find -lgc" issue? All I see is one for homebrew and I have no clue how it applies to what I'm doing.
lucasb has quit [Quit: Connection closed for inactivity]
<Yxhuvud> jokke: TSP is a problem, not an algorithm. as for solving it, you basically need to implement dijkstras algorithm, and to do that you will need a priority queue. There exists implementations of such queues (and one nice day I'll package mine in a sensible way :P).
<jokke> yeah
<jokke> i've done it back in the day with an ant algorithm
<Yxhuvud> dijkstras is pretty simple once you have a good queue structure though.
<jokke> yeah dijkstra is super simple
<jokke> i don't need to calculate the edges though
<jokke> i basically have a graph with readily calculated edges
<FromGitter> <nsuchy> I'm getting the error `PG::ResultSet#read returned a Nil. A String was expected.`
<FromGitter> <nsuchy> nvm
<FromGitter> <nsuchy> fixed
rohitpaulk has joined #crystal-lang
<FromGitter> <absolutejam_gitlab> @Blacksmoke16 it works but it cuts off
<FromGitter> <absolutejam_gitlab> about like 9060ish in a file with 9999 lines
<FromGitter> <nsuchy> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d4f17225178a7247664b403]
<FromGitter> <nsuchy> any idea what's going wrong here?
<FromGitter> <nsuchy> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d4f18e1c87a0963e749d54d]
<FromGitter> <absolutejam_gitlab> yeah
<FromGitter> <absolutejam_gitlab> installed
<FromGitter> <Blacksmoke16> I'll try it in my Mac, what happens if you pipe it to a file?
<FromGitter> <absolutejam_gitlab> but when I do `cat swagger.yaml | oq -i yaml .`
<FromGitter> <absolutejam_gitlab> Does the same file work for you?
<FromGitter> <absolutejam_gitlab> Looks like the full thing
<FromGitter> <absolutejam_gitlab> when piped to a file
<FromGitter> <absolutejam_gitlab> yeah, it is
<FromGitter> <absolutejam_gitlab> could be a tmux/shell issue i guess
<FromGitter> <Blacksmoke16> Possibly
<FromGitter> <nsuchy> @absolutejam_gitlab were you refering to me or blacksmoke
<FromGitter> <absolutejam_gitlab> Blacksmoke
<FromGitter> <kniknoo> Whew, I figured out finding libgc on raspbian (dunno why I couldn't find it when I apt searched) but still no luck. I'm gonna retrace steps.
<FromGitter> <Blacksmoke16> I'd vote the shell is truncating it, what shell are you using?
<FromGitter> <nsuchy> Who? me
<FromGitter> <Blacksmoke16> No @absolutejam_gitlab
<FromGitter> <nsuchy> k
<FromGitter> <kniknoo> I have the crystal binary running, but now I get ⏎ "Module Validation failed: Intrinsic has incorrect argument type!"
<FromGitter> <Blacksmoke16> Sounds like a bug
rohitpaulk has quit [Remote host closed the connection]
<FromGitter> <kniknoo> Okie doke. Will report, just wanted to make sure it didn't sound familiar here. Thank you.
<FromGitter> <Blacksmoke16> Try against master, iirc was an issue like that was fixed?
<FromGitter> <kniknoo> ...wait, there are still some x factors. I just noticed that it's still searching my old directory structure.
<FromGitter> <kniknoo> It's my first time trying to cross-compile, I'm bound to make every mistake along the way.
<FromGitter> <Daniel-Worrall> Okay, nice, I have docker building ARM cross-compiles now on LLVM7
<FromGitter> <Daniel-Worrall> I wanna get static building working to really reduce the image sizes
<FromGitter> <Blacksmoke16> Wouldn't static binaries make it bigger?
<FromGitter> <Daniel-Worrall> It'd run on a smaller docker image though
<FromGitter> <Daniel-Worrall> The binary would be larger, but not the container
<FromGitter> <Blacksmoke16> Fair enough
<FromGitter> <j8r> @Daniel-Worrall an image `from scratch`?
<FromGitter> <Daniel-Worrall> The one I have working just uses ubuntu
<FromGitter> <Daniel-Worrall> dockerfile goes on the pi, other 2 are the builders
<FromGitter> <Daniel-Worrall> doesn't pass make spec for the record
<FromGitter> <Daniel-Worrall> I *want* to be able to do this on the same computer but I'm not quite understanding how to to QEMU bullshit on docker
<FromGitter> <j8r> @Daniel-Worrall look at https://gist.github.com/j8r/34f1a344336901960c787517b5b6d616
ht_ has quit [Remote host closed the connection]
<FromGitter> <absolutejam_gitlab> can I ignore tls verification with `HTTP::Client`?
<FromGitter> <absolutejam_gitlab> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d4f50adc87a0963e74b4491]
<FromGitter> <Blacksmoke16> @absolutejam_gitlab https://crystal-lang.org/api/master/OpenSSL/SSL/Context.html#verify_mode=(mode:OpenSSL::SSL::VerifyMode)-instance-method prob can set that to none