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