ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.21.1 | Fund Crystal's development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
<FromGitter> <elorest> Everytime I run shards install this week on any projects with a database I get `Error resolving db (*, ~> 0.4.0, ~> 0.4.0, ~> 0.3.1)` Has anyone else seen this. A couple weeks ago this seemed fine.
<FromGitter> <elorest> Here's an example of something I didn't write that fails with the same error.
balduin has quit [Ping timeout: 240 seconds]
<FromGitter> <elorest> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58dc4cbfad849bcf42319aef]
<FromGitter> <fridgerator> one of the depedencies requires an old version of crystal-db it seems like
<FromGitter> <elorest> Yeah I just started to track that down. Weird because removeign sqlite3 fixes it but it actually requires ~> 0.4.0
<FromGitter> <jwoertink> I get this invalid memory error:
<FromGitter> <jwoertink> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58dc50b78fcce56b20afb9cd]
<FromGitter> <jwoertink> What's the best way to track this down?
<FromGitter> <fridgerator> @elorest that is strange
<FromGitter> <elorest> Ok finally fixed it. Ended up having to point it at master
<FromGitter> <elorest> It claims it's been bumped to 0.8.2 but there's not tag created for that. so when I tell it to use that version it still doesn't.
<kodo[m]> There a quick way to go from array to tuple?
<FromGitter> <jwoertink> https://crystal-lang.org/api/0.21.1/Tuple.html#from%28array%3AArray%29-class-method
<FromGitter> <jwoertink> `Tuple(String, Int64).from(["world", 2])`
<kodo[m]> thnx
bungoman has joined #crystal-lang
<kodo[m]> What if you don't know size of array?
<FromGitter> <jwoertink> hmm.. My guess is that you have to figure out what size the array is first and what types you have
<kodo[m]> like it could be #from[1,2,3,4] or #from[1,2]
<kodo[m]> How do you insert them at runtime though?
<kodo[m]> Seems like I need a macro, bu whenever I use macros I ask myself if I could do it simpler heh
<FromGitter> <jwoertink> Since a Tuple is pretty much static, I don't think you can. From what I understand, it's a one shot deal
<kodo[m]> ok
<kodo[m]> I'm trying to pass an array as a splay to a struct consrtructor
<kodo[m]> but it looks like splats need to be tuples?
<FromGitter> <jwoertink> I don't think so. I'm pretty sure they can be an array
<FromGitter> <jwoertink> are you passing it like `*[1,2,3]` ? or like `1,2,3`
<kodo[m]> argument to splat must be a tuple, not Array(String)
<kodo[m]> `*the_array`
<FromGitter> <jwoertink> oh weird. Yeah, just tried that
<kodo[m]> I'm using a record macro for struct, i wonder if I can put the splat character in constructor if I use full version
<kodo[m]> I guess since it's a struct they expect that you know what you're passing in
<FromGitter> <jwoertink> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58dc56b78fcce56b20afced4]
<FromGitter> <jwoertink> like that?
<FromGitter> <tjgillies> yeah
<FromGitter> <tjgillies> er
<FromGitter> <tjgillies> I was gonna pass in 1,2,3 as an arg
<FromGitter> <tjgillies> I was get confused on how splats deconstruct
<FromGitter> <tjgillies> always*
snsei has joined #crystal-lang
<FromGitter> <jwoertink> Before I fall down this rabbit hole, is this a normal thing when it comes to C lib bindings? I have this function that returns a struct, that struct has a reference to another struct, and that one references another one and so on... At this point I'm re-implementing every single one.
<FromGitter> <jwoertink> If I have to call it in Crystal, then I have to define it, right? How does crystal know when to call the things in the actual C lib?
<FromGitter> <jwoertink> like, can I implement half of one of these structs, an crystal will know how to access the other half when it needs it?
balduin has joined #crystal-lang
DaleK5whr has joined #crystal-lang
DaleK5whr has quit [Client Quit]
bmcginty has quit [Ping timeout: 260 seconds]
bmcginty has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
pduncan has joined #crystal-lang
<crystal-gh> [crystal] huacnlee opened pull request #4213: Rename `secure_random.cr` to `securerandom.cr` for keep same behavior as Ruby (master...rename-securerandom) https://git.io/vSGDN
balduin has quit [Ping timeout: 240 seconds]
early has quit [Quit: Leaving]
balduin has joined #crystal-lang
early has joined #crystal-lang
<FromGitter> <mjago> @jwoertink you around?
_whitelogger has joined #crystal-lang
balduin has quit [Remote host closed the connection]
pabs_ has joined #crystal-lang
pabs has quit [Ping timeout: 260 seconds]
jaitaiwan has quit [Ping timeout: 252 seconds]
ChickeNES has quit [Ping timeout: 240 seconds]
ChickeNES has joined #crystal-lang
jaitaiwan has joined #crystal-lang
<FromGitter> <mjago> @jwoertink I took a look at SDL_Mixer.h and turns out Mix_LoadWAV() is a C macro so you can’t use that.
<FromGitter> <mjago> You need to use Mix_LoadWAV_RW instead.
<vegai_> bmcginty: yeah, I suppose
olek_poz has joined #crystal-lang
<crystal-gh> [crystal] ysbaddaden closed pull request #4213: Rename `secure_random.cr` to `securerandom.cr` for keep same behavior as Ruby (master...rename-securerandom) https://git.io/vSGDN
dzv has quit [Ping timeout: 260 seconds]
dzv has joined #crystal-lang
Raimondi has quit [Ping timeout: 260 seconds]
mark_66 has joined #crystal-lang
Svenskunganka has quit [Ping timeout: 264 seconds]
olek_poz has quit [Ping timeout: 258 seconds]
Svenskunganka has joined #crystal-lang
olek_poz has joined #crystal-lang
Raimondi has joined #crystal-lang
<crystal-gh> [crystal] ysbaddaden opened pull request #4215: Fix: compilation against OpenSSL 1.1.0 (master...std-fix-openssl-110) https://git.io/vSZv1
mjago has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
<FromGitter> <hbakhtiyor> does anyone know any mature open source projects base on crystal?
<FromGitter> <KCreate> The compiler itself? :P
<FromGitter> <KCreate> Kemal also comes to mind
<FromGitter> <hbakhtiyor> something web projects :)
Raimondi has joined #crystal-lang
snsei has quit [Remote host closed the connection]
Raimondi has quit [Ping timeout: 268 seconds]
kodo[m] has quit [Write error: Connection reset by peer]
sija[m] has quit [Read error: Connection reset by peer]
MatrixTraveler[m has quit [Write error: Connection reset by peer]
braidn[m] has quit [Write error: Connection reset by peer]
MatrixTraveler[m has joined #crystal-lang
braidn[m] has joined #crystal-lang
kodo[m] has joined #crystal-lang
sija[m] has joined #crystal-lang
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
bjz has joined #crystal-lang
snsei has joined #crystal-lang
p0p0pr37 has quit [Ping timeout: 268 seconds]
snsei has quit [Ping timeout: 246 seconds]
gloscombe has joined #crystal-lang
p0p0pr37 has joined #crystal-lang
p0p0pr37 has joined #crystal-lang
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
fazibear has joined #crystal-lang
unshadow has joined #crystal-lang
mark_66 has quit [Quit: Leaving.]
mark_66 has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
<FromGitter> <luislavena> @hbakhtiyor can you define mature?
unshadow has quit [Quit: leaving]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 264 seconds]
snsei has joined #crystal-lang
<FromGitter> <crisward> I think of mature as used lots of production. Not sure you could say that about anything in crystal land yet.
<FromGitter> <KCreate> The answer is very subjective. But basically if the software can answer to most of these criteria (in no order of importance): ⏎ ⏎ secure ⏎ reliable ⏎ actively maintained ... [https://gitter.im/crystal-lang/crystal?at=58dd08ee7ea420cc421ecac0]
<FromGitter> <KCreate> However I disagree with mature software needing to have an active community
<FromGitter> <sdogruyol> kinda
Raimondi has joined #crystal-lang
Svenskunganka has quit [Quit: leaving]
Raimondi has quit [Ping timeout: 268 seconds]
KCreate has joined #crystal-lang
olek_poz has quit [Ping timeout: 260 seconds]
KCreate has left #crystal-lang [#crystal-lang]
<vegai_> C is very mature, but I'd rather not use it anywhere :)
snsei has quit []
snsei has joined #crystal-lang
Raimondi has joined #crystal-lang
snsei has quit [Read error: Connection reset by peer]
snsei has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
snsei has quit [Remote host closed the connection]
<crystal-gh> [crystal] asterite closed pull request #4206: Use well known non-existent name for socket specs (master...feature/socket_spec_hostnames) https://git.io/vSOqF
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
Raimondi has joined #crystal-lang
<FromGitter> <hbakhtiyor> ok, without mature :D but actively maintaining and production-ready
sz0 has joined #crystal-lang
mark_66 has quit [Quit: Leaving.]
<wmoxam> @hbakhtiyor Sidekiq
<FromGitter> <KCreate> kemal
<FromGitter> <KCreate> https://github.com/kemalcr/kemal
Raimondi has quit [Ping timeout: 268 seconds]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter> <hbakhtiyor> thanks, but any web apps?
<FromGitter> <hbakhtiyor> there are any crystal binding for headless chrome library?
<travis-ci> crystal-lang/crystal#0b3f7e5 (master - Use well known non-existent name for socket specs): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/216796270
<wmoxam> @hbakhtiyor See the bottom of http://kemalcr.com/
maxpowa has quit [Read error: Connection reset by peer]
<FromGitter> <hbakhtiyor> thanks
maxpowa has joined #crystal-lang
snsei has joined #crystal-lang
mjago has quit [Ping timeout: 240 seconds]
<FromGitter> <jwoertink> @mjago Thanks for the help! I've updated my code to use what you suggested, and got rid of that C macro. The code still fails for me though
<FromGitter> <jwoertink> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58dd2efd7ea420cc421f8a1d]
<FromGitter> <mjago> just looking
KCreate has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter> <mjago> @jwoertink enum Type is problematic (I think type is a keyword maybe?). Anyway it builds for me ok when I change that
<FromGitter> <jwoertink> hmm. Maybe it's a keyword in SDL2_Mixer? I was just trying to be consistent with https://github.com/ysbaddaden/sdl.cr/blob/master/src/image.cr#L11
<FromGitter> <jwoertink> oh, actually, I get the same error after renaming it to `SoundType`
<FromGitter> <jwoertink> Are you building on macOS, or on linux? @mjago
<FromGitter> <mjago> mac os
<FromGitter> <mjago> its complaining for me since Type is already defined in my mixer.cr as is alias Init
<FromGitter> <jwoertink> Yeah, I renamed `SDL::Mixer::Type` to `SDL::Mixer::SoundType`, but I still get the same error. Maybe I'm just missing some lib
<FromGitter> <jwoertink> oh that's weird. Do crystal alias carry across modules?
<FromGitter> <mjago> This is how i installed sdl2_mixer… brew install sdl2_mixer --with-flac --with-fluid-synth --with-libmikmod --with-libmodplug --with-libvorbis --with-smpeg2
<FromGitter> <mjago> I had problems before that
<FromGitter> <jwoertink> Ok, that's how I installed too.
KCreate has quit [Quit: leaving]
<FromGitter> <jwoertink> alright, I'll rename the alias, and the enum to be specific for this
<FromGitter> <jwoertink> Ok. pushed that up. Doesn't fix my issue, but maybe it'll fix yours?
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
<FromGitter> <jwoertink> ah! You know what? I'm calling `Mix_PlayChannel` which is a macro. Gonna fix that
<FromGitter> <mjago> Ah that will do it!
krigare[m] has joined #crystal-lang
<FromGitter> <jwoertink> Awesome! They all play now :D
<FromGitter> <jwoertink> Thanks for your help @mjago
<FromGitter> <mjago> your welcome. You should be able to put Type and Init back - that was something at this end
<FromGitter> <jwoertink> ok, cool. I'll revert those. It's nice to keep them consistent with the other APIs
fazibear has quit [Quit: leaving]
<FromGitter> <mjago> Are you running a sample?
<FromGitter> <jwoertink> yeah. sample 21
Raimondi has joined #crystal-lang
<FromGitter> <mjago> @jwoertink just checked - your new code all works good for me too - except resume play doesn’t happen since playing is still 1 when paused
<FromGitter> <mjago> *in sample 21
<FromGitter> <mjago> Also stop is not implemented - and when it is you need to “resume” before stopping since stopping doesn’t reset paused (sdl2 bug)
<kodo[m]> Can compiled crystall libs have a c api?
<kodo[m]> So I can use them from c?
<vegai_> were there prebuilt crystal binaries built against musl?
mroth_ has joined #crystal-lang
pleiosau1 has joined #crystal-lang
jhass has quit [Ping timeout: 276 seconds]
mroth has quit [Ping timeout: 276 seconds]
dom96 has quit [Ping timeout: 276 seconds]
pleiosaur has quit [Ping timeout: 276 seconds]
bjmllr has quit [Ping timeout: 276 seconds]
jhass has joined #crystal-lang
mroth_ is now known as mroth
bjmllr has joined #crystal-lang
dom96 has joined #crystal-lang
fazibear has joined #crystal-lang
olek_poz has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
fazibear has quit [Quit: leaving]
A124 has joined #crystal-lang
A124 has quit [Client Quit]
<kodo[m]> There a way to make logger.error go to STDERR?
<Papierkorb> kodo[m]: w.r.t. "calling from C": This is currently not supported, but it can be done: `build --cross-compile`, then link the object file as -shared library (using the cc line crystal tells you)
<Papierkorb> kodo[m]: Then use `fun` to create functions that are callable from C
Raimondi has joined #crystal-lang
canta has quit [Ping timeout: 240 seconds]
<FromGitter> <elorest> Lets get more stars on https://github.com/crystal-lang/crystal ⏎ If anyone here hasn't starred it lets do that. Or if you have 5 or so coworkers on github have them star it too. I'm sick of swift-lang frameworks having more stars than one of my favorite non ruby languages.
Raimondi has quit [Ping timeout: 268 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
leonardschuetz has joined #crystal-lang
leonardschuetz is now known as KCreate
KCreate has quit [Quit: leaving]
<FromGitter> <jwoertink> @mjago Ah, good catch. Thanks. I'll update that.
<FromGitter> <schoening> wow.. I just checked out the surface book irl. I think I fell in love.. Just hope I can dual book Linux on it for crystal :D
<FromGitter> <jwoertink> Get it and then help get windows running crystal :)
<FromGitter> <elorest> what he said ^
<Papierkorb> schoening, afaik surface books have really good linux support :)
<FromGitter> <schoening> Hah! Id love to try and help. I havent used windows for 5 years now tho, so it will be strange to change back for a while :p
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vSnXY
<crystal-gh> crystal/master cae9a20 Ary Borenszweig: Make Process.new(pid) be private. Fixes #4197
<FromGitter> <schoening> @Papierkorb I can't tell if you are sarcastic or not :p
<Papierkorb> schoening, you haven't missed anything
<Papierkorb> I was not
<Papierkorb> funnily enough, the surface is probably the best convertible in terms of linux support
<Papierkorb> I tried my luck with an ASUS T101HA. It did work to some extend, but not really. Missing sound and wifi. bleh.
<FromGitter> <schoening> Now we just need good touch support on linux xD
<FromGitter> <schoening> Aww
<Papierkorb> Chrome was decent
<FromGitter> <schoening> Well thats great news then. Coz I gotta move and take a load for that, so perhaps I can push it a bit and get one of the cheaper version of the surface books xD
<FromGitter> <schoening> Probably any version will beat my ancient thinkpad ^^
<Papierkorb> Yeah please try it, shouldn't be much worse than trying booting an ubuntu live pendrive
<Papierkorb> Mh they have all i-Cores, right?
<Papierkorb> My Thinkpad X201 (i5 520M, that's 2010 HW) was running circles around the CPU in the ASUS tablet
<Papierkorb> I was impressed, but of the wrong machine ;)
bjz has joined #crystal-lang
gloscombe has quit [Remote host closed the connection]
<FromGitter> <chuckremes> Working on my first crystal program by porting over something I wrote in Ruby a while ago. I am trying to do `require “benchmark”` which appers to succeed but crystal throws an error and says: `can’t require dynamically`
<FromGitter> <chuckremes> what should I do here?
<FromGitter> <chuckremes> do I need to create a `yml` file to somehow include/require benchmark?
<FromGitter> <jwoertink> What does your code look like?
<FromGitter> <jwoertink> Put that require at the very first line of the file
<FromGitter> <elorest> an issue I seem to get all the time while using crystal compiled binaries that used to work is `dyld: Library not loaded: /usr/local/opt/libevent/lib/libevent-2.0.5.dylib` A fix is often to remove it and everything that depends on it and reinstall libevent. It's frustrating to have to do this every month though.
<FromGitter> <jwoertink> My guess is that it's throwing the error because the compiler saw the `if` and thinks it could be required later
<FromGitter> <chuckremes> @jwoertink that solved that problem and gave me a new one. I’ll ping back here if I need help. Thanks for your assist.
<FromGitter> <jwoertink> cool :thumbsup:
<FromGitter> <elorest> right now if I install micrate from brew it compiles just fine but when I try to run it I get that libevent error.
<FromGitter> <jwoertink> I've got that libevent error a few times too.
Raimondi has joined #crystal-lang
maxpowa has quit [Ping timeout: 264 seconds]
Raimondi has quit [Ping timeout: 268 seconds]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <elorest> i wonder if there's a better way to fix it than just uninstalling a bunch of stuff.
Raimondi has joined #crystal-lang
<FromGitter> <elorest> I'm a little bit confused about that though. Isn't the point of compiling something that you don't need to have all the dependencies installed for it to work? Shouldn't they be compiled into the binary?
<FromGitter> <jwoertink> I think with macOS it's a little weird because you can't static link libraries or something like that
Raimondi has quit [Ping timeout: 268 seconds]
<FromGitter> <elorest> weird. You've ran into this issue when setting up homebrew for fez?
<FromGitter> <elorest> also have you looked into kgen at all?
<FromGitter> <jwoertink> yeah, I did. I'm still not really sure exactly what the issue was, but basically it would install, but when you'd run `fez` it wouldn't do anything
<FromGitter> <jwoertink> no errors, just nothing
<FromGitter> <jwoertink> What's kgen?
<FromGitter> <elorest> kemalist project generator and scaffolding
<FromGitter> <elorest> dyld: Library not loaded: /usr/local/opt/libevent/lib/libevent
<FromGitter> <jwoertink> oh, Dru actually submitted the PR that adds kemalyst support in to fez
<FromGitter> <elorest> Yeah i saw that
<FromGitter> <elorest> but just for ecr files
<FromGitter> <jwoertink> Yeah, it's extendable to add in slang support and such
<FromGitter> <elorest> the scaffolding part is what I find interesting in kgen
<FromGitter> <jwoertink> I haven't actually used kemalyst yet, so I wasn't sure about adding anything in.
<FromGitter> <jwoertink> I was hoping others would just commit to the project to really help beef it up
<FromGitter> <elorest> Yeah for sure. It seems that libraries should be able to be compiled into an executable but maybe not.
<FromGitter> <jwoertink> Yeah. I was trying to find where I had a discussion about that. I thought it was on the crystal repo, but I can't find it. It's something specific with the OS where macOS doesn't allow you to statically link libs
Raimondi has joined #crystal-lang
bjz has joined #crystal-lang
<FromGitter> <faustinoaq> Hi Crystal community! I made three shards yesterday. You can look in my repositories whenever you want. ⏎ ⏎ 1) watcher (https://github.com/faustinoaq/watcher) - Watch files using File.stat ⏎ 2) kemal-watcher (https://github.com/faustinoaq/kemal-watcher) - Live-reload the browser using `WebSockets` and `watcher` ⏎ 3) sentry-run (https://github.com/faustinoaq/sentry-run) - Add `sentry.lock` to use `Sentry` embedded with
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <jasdeepsingh> hey fellow crystal-ers!
<Papierkorb> Yo
<FromGitter> <jasdeepsingh> hey hey @Papierkorb
olek_poz has quit [Ping timeout: 240 seconds]
maxpowa has joined #crystal-lang