ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.1 | 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> <codenoid> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5979314d89aea4761dd96c70]
<FromGitter> <watzon> Has anyone actually used https://github.com/Fusion/libui.cr yet? It looks pretty great
Jomakasi has joined #crystal-lang
Jomakasi has quit [Client Quit]
jhass has quit [Ping timeout: 276 seconds]
jhass has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit []
snsei has joined #crystal-lang
olbat[m] has quit [Ping timeout: 276 seconds]
jplatte has quit [Ping timeout: 276 seconds]
olbat[m] has joined #crystal-lang
jplatte has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter> <codenoid> can crystalgiri remove dom from loaded data ?
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
_whitelogger has joined #crystal-lang
<TheGillies> Any news coming out? last blog update was in march
<TheGillies> was pretty frequent before that
watzon has joined #crystal-lang
snsei has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
rohitpaulk has joined #crystal-lang
snsei has quit [Remote host closed the connection]
pwned has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 255 seconds]
mark_66 has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<watzon> Possibly stupid question: why can't we just use `Int` as a type yet? Is there something big holding that up?
rohitpaulk has quit [Ping timeout: 246 seconds]
mark_66 has quit [Quit: Leaving.]
mark_66 has joined #crystal-lang
snsei has joined #crystal-lang
hightower2 has joined #crystal-lang
<FromGitter> <bew> Well Int is a generic type for all integers, Int32 and Int64 iirc.. Those two have different size in memory, so you need to choose one to store your number. But you can use it as a restriction, saying "I want an integer"
<FromGitter> <Qwerp-Derp> Hello!
<Groogy> Morning!
<FromGitter> <Qwerp-Derp> ```Syntax error in test.cr:1: unterminated array literal ⏎ ⏎ [*0...100].each do |a|``` [https://gitter.im/crystal-lang/crystal?at=59799b9f76a757f8084e82b2]
<FromGitter> <Qwerp-Derp> I moved here from Ruby, so I have no idea what this means - a Google search didn't return any useful info.
<Groogy> what's the asterix(*) supposed to mean in this context?
hightower2 has quit [Ping timeout: 246 seconds]
<Groogy> don't remember that from Ruby, is that a new thing? Either way don't think that's supported in Crystal
<FromGitter> <Qwerp-Derp> Yeah, it's a thing from Ruby, `*` is the spread operator
<Groogy> oh you mean splatting? It would splat the range 0...100 into an array essentially?
<FromGitter> <Qwerp-Derp> Yep
<Groogy> ah yeah don't think Crystal supports that yet
<FromGitter> <Qwerp-Derp> Oh. :P
<Groogy> didn't know you could use that on ranges in Ruby though, that's neat
<FromGitter> <Qwerp-Derp> Uhhhhh how would I do something like a range though? Do I have to define a function with a for loop?
<Groogy> let me see if I can find an easy way to accomplish same result
<Groogy> actually
<Groogy> ranges are enumerable which means they implement the #map method
<FromGitter> <Qwerp-Derp> Hmmm?
<Groogy> so you should be able to do 0...100.map { |val| val } => Array
<FromGitter> <Qwerp-Derp> yeah
<Groogy> ups I meant # => Array
<FromGitter> <Qwerp-Derp> Yeah, I'm used to using `each` though :P
<Groogy> Well map is pretty much an #each just that it takes the blocks value and puts it into an array for you
<Groogy> so you don't have to do it manually
<FromGitter> <drosehn> Um, for that specific example, just do: `0.upto(100) do |a|`
<FromGitter> <Qwerp-Derp> @FromIRC Yeah, I know what `map` does, I mainly use `each` though (for some bizarre reason)
<Groogy> but yeah if you just want to iterate over the numbers 0 to 100, you don't need to create an immediary array, would just do what drosehn suggested
tzekid has quit [Read error: Connection reset by peer]
<FromGitter> <Qwerp-Derp> Does Crystal have mixins, like Ruby?
<FromGitter> <Qwerp-Derp> And can I add methods to default classes, e.g. ⏎ ⏎ ```class Array ⏎ def average ⏎ end ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=59799d961c8697534a643095]
<Groogy> It have Module mixins yes
<Groogy> and you can still open up classes yes
<FromGitter> <Qwerp-Derp> Oh, neat :)
<Groogy> though keep in mind that definitions do matter compared to Ruby
<Groogy> i.e you can't inherit from a class that is defined later because the constant needs to be defined
<Groogy> donno if that is by design and it might be something fixed later? But that's how it works right now
<FromGitter> <bew> Groogy are you sure about that?
<Groogy> Yepp
<FromGitter> <Qwerp-Derp> Yeah that's perfectly fine Groogy, Crystal is a really nice language regardless :D
<Groogy> and @bew if you try to get around it by like "declaring before" it breaks again if that one has to inherit from something as well https://play.crystal-lang.org/#/r/2feu
<Groogy> @Qwerp-Derp yeah it's awesome
<Groogy> and from what I can see/understand Bew, the problem is not the inheritance itself, it is just that the constant itself has not been defined as anything yet
<FromGitter> <bew> Yeah that I can understand! But regarding the position of type declaration, I mixed it up with the fact that you can use a class even before it's déclaration, but you just can't use it to declare new types anywhere you could want, which makes sense (at least for me) actually
<FromGitter> <Qwerp-Derp> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5979a19a1c8697534a64407a]
<Groogy> also this error message is super funny :D
<FromGitter> <Qwerp-Derp> I did a quick benchmark with this code compared to Ruby's, it's ~6* faster :)
<watzon> @bew Is there a reason why using `Int` itself can't just choose the one that is compatible with the user's system? So if they're running on a 32 bit system it would be an `Int32` and vice-versa
<Groogy> Well why would you need to refer to Int specifically besides just restricting arguments?
<watzon> I mean, the error given says that it's not possible "yet", so I assume something is in the works
<watzon> I'm just wondering for curiosity sake haha
<Groogy> Well if you think about it as well, Int8, Int16, Int32, Int64 are all different types in memory as well. Int as a colleciton just guarrantees that "these operations will work on this memory"
<Groogy> that's how I usually view it
<Groogy> most of the time when I work, what size the int is actually matters
snsei has quit [Remote host closed the connection]
<Groogy> but that might be because of the direction I come from
<FromGitter> <bew> Ahahah Groogy x)
<FromGitter> <bew> The class error is epic!
<watzon> I guess that's a good point Groogy
<Groogy> so for making let's say a Vector class and you have specific Float/Int operations
<Groogy> you only have to write it once since it will work on every single memory layout
<Groogy> but when I actually instantiate a Vector I very much care about how big is the Int/Float
<Groogy> @bew would be nice though to be able to forward declare types or something. I am a bit worried as my project gets more complex I am gonna be more and more dependent on order of loading stuff since Crystal goes with the "Everything is loaded"
<FromGitter> <bew> Oh yes forgot about those other Ints, I think there is also BigInt but not sure (and Int128 ? I saw it in a PR somewhere iirc)
<Groogy> yeah but BigInt is dynamically allocated I guess?
<FromGitter> <bew> Ah yes probably
<Groogy> so if you can avoid BigInt you should
<Groogy> and I mean if you need a bigger number than 9,223,372,036,854,775,807
<Groogy> then wow
<Groogy> or 18,446,744,073,709,551,615 if you make it a UInt64
<Groogy> unsigned 128 would be insanely huge.... 340,282,366,920,938,463,463,374,607,431,768,211,455
<FromGitter> <oprypin> watzon, Crystal doesn't do types that magically change on a different platform, it was never a good idea
<FromGitter> <oprypin> int32 performs well on all platforms. if you need 64 bits, that's what you use then. old cpus slow? oh well, who cares
<Groogy> Oprypin why are you on Gitter D: you used to be on IRC
<FromGitter> <oprypin> D:
<watzon> We traded places
<FromGitter> <oprypin> I'm on mobile only this week. the irc client sucks
<Groogy> "old tech"-master race ヽ( ゚ヮ・)ノ
<Groogy> ow yeah IRC clients on mobile, never found a good one really
<watzon> What's the easiest way to create an Array, lets say with a length of 100, filled with one Char?
<watzon> So `['a', 'a', 'a'...]`
<FromGitter> <bew> `Array.new(100, 'a')` I guess
<watzon> Thanks :)
<FromGitter> <straight-shoota> `['a'] * 100`
<FromGitter> <bew> @straight-shoota it's fatser to directly create the array with the value though
Raimondii has joined #crystal-lang
<FromGitter> <Qwerp-Derp> @oprypin I'm trying to run CrSFML, but I can't require it for some reason in my project
Groogy3 has quit [Read error: Connection reset by peer]
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
<FromGitter> <straight-shoota> @bew yes. But it's a nice alternative... shorter and imo easier to understand
<FromGitter> <bew> true!
<crystal-gh> [crystal] MakeNowJust opened pull request #4751: Correctly work __has_color check in bin/crystal (master...fix/work-has-colors-correctly) https://git.io/v7Go6
<watzon> How do you create a hook to a C macro like `COLOR_PAIR`? https://linux.die.net/man/3/color_pair
<FromGitter> <oprypin> @Qwerp-Derp probably gotta read install instructions... master branch does not contain requireable code
<watzon> Now if I could just find where it's defined. I hate C...
<FromGitter> <bew> its line 623 in `ncurse.h` on my system :p
<FromGitter> <watzon> I can't find ncurses.h lol
<FromGitter> <bew> huh no line 1229, and its defined as: `#define COLOR_PAIR(n)(NCURSES_BITS((n), 0) & A_COLOR)`
<FromGitter> <watzon> Damn, now how to translate that to Crystal...
<FromGitter> <bew> and `A_COLOR` as: `#define A_COLORNCURSES_BITS(((1U) << 8) - 1U,0)`
<FromGitter> <akzhan> what is NCURSES_BITS?
<FromGitter> <bew> and finally `NCURSES_BITS` as `#define NCURSES_BITS(mask,shift) (NCURSES_CAST(chtype,(mask)) << ((shift) + NCURSES_ATTR_SHIFT))`
<FromGitter> <bew> and `#define NCURSES_ATTR_SHIFT 8`
<FromGitter> <akzhan> and NCURSES_CAST, NCURSES_ATTR_SHIFT :)
<FromGitter> <watzon> 😦 fml, all I want to do is add the wbkgd (https://linux.die.net/man/3/wbkgd) method to ncurses-crystal (https://github.com/jreinert/ncurses-crystal)
<FromGitter> <bew> cast is simply a C cast: `#define NCURSES_CAST(type,value) (type)(value)`
<FromGitter> <watzon> `wbkgd` is defined as follows: `int wbkgd(WINDOW *win, chtype ch);`
<FromGitter> <watzon> And `chtype ch` appears to be the result of `COLOR_PAIR(n)`
<FromGitter> <akzhan> NCURSES_ATTR_SHIFT = 8 ⏎ def ncurses_bits(mask , shift); mask << (shift + NCURSES_ATTR_SHIFT); end
<FromGitter> <akzhan> and so on
<crystal-gh> [crystal] ysbaddaden closed pull request #4641: Makefile: fix to work 'make help' when using Makefile.local (master...fix/makefile/help-work-when-use-makefile-local) https://git.io/vQBqY
<FromGitter> <akzhan> def a_color; ncurses_bits(1_u32 << 8 - 1, 0); end
<FromGitter> <watzon> What does something like this `NCURSES_BITS((n), 0)` look like in Crystal? I have no idea what that's doing in C
<FromGitter> <watzon> Thanks btw @akzhan
rohitpaulk has joined #crystal-lang
<FromGitter> <akzhan> it’s just a bit shift op.
<FromGitter> <watzon> So ⏎ ⏎ ```def color_pair(n) ⏎ ncurses_bits(n << 0) & a_color ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5979b9b789aea4761ddb233f]
<FromGitter> <watzon> ??
<FromGitter> <bew> not exactly, sth like https://carc.in/#/r/2ff2
<travis-ci> crystal-lang/crystal#7185965 (master - Merge pull request #4641 from MakeNowJust/fix/makefile/help-work-when-use-makefile-local): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/258075161
<FromGitter> <watzon> We did it!
<FromGitter> <watzon> :D
<FromGitter> <watzon> Thanks so much haha. I need to study C a "bit" more
<FromGitter> <bew> thats the word x)
<crystal-gh> [crystal] RX14 closed pull request #4609: String: implement Rabin-Karp algorithm for #byte_index (master...fix/string/byte-index-rabin-karp) https://git.io/vQqZk
<FromGitter> <watzon> I'm working on making an IRC client in Crystal, and that `wbkgd` method is what I needed to make the status bar's background color
<FromGitter> <bew> great it worked!
<travis-ci> crystal-lang/crystal#7185965 (master - Merge pull request #4641 from MakeNowJust/fix/makefile/help-work-when-use-makefile-local): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/258075161
<FromGitter> <watzon> And now I get to make a PR for the `ncurses-crystal` lib as well
<FromGitter> <watzon> Good day all around
<travis-ci> crystal-lang/crystal#7185965 (master - Merge pull request #4641 from MakeNowJust/fix/makefile/help-work-when-use-makefile-local): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/258075161
<travis-ci> crystal-lang/crystal#d23db08 (master - String: implement Rabin-Karp algorithm for #byte_index (#4609)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/258081564
<travis-ci> crystal-lang/crystal#d23db08 (master - String: implement Rabin-Karp algorithm for #byte_index (#4609)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/258081564
rohitpaulk has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <crisward> Think I've found an issue with crystal-mysql or crystal-db. Anyone around to help pin it down?
<FromGitter> <bew> Don't ask to ask, just ask! Describe it, and probably someone will help you!
<FromGitter> <crisward> It appears mysql-db is not returning connections to the pool when an exceptions happens. So if I write a query asking for a non-existant column, and do it enough times, the connection pool gets exhausted.
<FromGitter> <crisward> I'm not sure where the error is occurring, if it's in crystal-db or crystal-mysql. Crystal-db deals with the pool, so it should be there.
<FromGitter> <crisward> It's in a prepared statement if it helps.
<FromGitter> <crisward> The specific exception I'm getting is a `Exception: (DB::PoolTimeout)`
<FromGitter> <crisward> I'm also seeing the number of connections increase on the db as the errors occur. So if you have your `max_pool_size` set high the error takes a while to reproduce.
<FromGitter> <sdogruyol> hey everyone
<FromGitter> <sdogruyol> @crisward that's a nice bug report
<FromGitter> <bew> hey @sdogruyol ;) you good?
<FromGitter> <sdogruyol> hey @bew thanks, how about you :)
<FromGitter> <bew> good too ;)
<FromGitter> <sdogruyol> are you using Crystal in production yet @bew ?
<FromGitter> <bew> aaah no, I'd love to!
<FromGitter> <watzon> What would be the best way to watch for `SIGINT` inside of a loop?
<FromGitter> <sdogruyol> just trapping is enough?
<FromGitter> <watzon> I want to make sure my cli doesn't close until `ctrl-c` is hit
<FromGitter> <watzon> I tried trapping, but the documentation on `Signal` is pretty much non-existent
<FromGitter> <sdogruyol> @watzon specs are your friend but you are right about docs :) https://github.com/crystal-lang/crystal/blob/1f3e8b0e742b55c1feb5584dc932e87034365f48/spec/std/signal_spec.cr#L11
<FromGitter> <sdogruyol> or more practical one from my shard cryload https://github.com/sdogruyol/cryload/blob/f38ebfcace47232e0dc2b4e95997bff2d7a9c5d3/src/cryload.cr#L67 @watzon
<FromGitter> <watzon> `Signal::INT` would trap `ctrl-c`, right?
<Papierkorb> Signal::INT traps SIGINT "Interrupt". Most terminals, by convention, send a SIGINT to the program in focus upon detecting Ctrl-C though.
<Papierkorb> watzon, if you're writing a shell(-like) application, maybe the `fancyline` shard might interest you, which handles this in a manner you be more familiar with.
<Papierkorb> watzon, unix signals are delivered out of band. That is, they run in a different context than your normal program flow, that flow is never aborted, just halted for a moment. If you come from a language like Ruby or Python, you may have handled SIGINT by catching an Interrupt exception - This is specific to those language, and doesn't actually reflect how signals work at all.
<FromGitter> <watzon> Papierkorb: ok, so what's the best way to have a never ending loop, but still capture `ctrl-c`/`ctrl-d` and terminate the program?
<FromGitter> <watzon> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5979d64ac101bc4e3ac5e0af]
<FromGitter> <watzon> That's not working :(
<Papierkorb> Ctrl-C and Ctrl-D are inherently different in what terminals commonly emit when they're pressed. Ctrl-D notifies an EOF on stdin, which is not a unix signal.
<Papierkorb> And a EOF you only get to know about when you're actually reading from stdin.
<FromGitter> <watzon> Well ctrl-c is the only real important one haha
<Papierkorb> Would be surprising if curses didn't already offer an SIGINT handler
<Papierkorb> for curses you have a main loop?
<FromGitter> <sdogruyol> This is a great idea https://github.com/crystal-lang/crystal/issues/4749 thanks @MakeNowJust
<Papierkorb> watzon, Trap SIGINT, and in there, simply update a variable. Like `@running = false`. then check in the loop if @running is true, or not.
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <crisward> @sdogruyol I've added a bug here, along with a link to an example breaking test. https://github.com/crystal-lang/crystal-mysql/issues/40
<FromGitter> <crisward> Hope that helps
<FromGitter> <sdogruyol> Thanks again for the great bug reports @crisward
<FromGitter> <crisward> My stack traces on MacOS don't seem to have line numbers, anyone else have that issue?
<FromGitter> <crisward> Crystal 0.23.1 (2017-07-13) LLVM 4.0.1
watzon has quit [Ping timeout: 240 seconds]
rohitpaulk has quit [Ping timeout: 255 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <akzhan> @crisward here is w/a https://github.com/crystal-lang/crystal/issues/4186
<FromGitter> <crisward> @akzhan thanks
<FromGitter> <akzhan> @crisward looks like somebody need to do pull request for this :)
alibby1 has joined #crystal-lang
alibby has quit [Read error: Connection reset by peer]
<FromGitter> <crisward> @akzhan Just done one for my database error - https://github.com/crystal-lang/crystal-db/pull/65
<FromGitter> <crisward> @sdogruyol think I've fixed it, it's a nasty one as it slowly eats your db pool, so if like us you have a typo in an non-obvious query somewhere you'll eventually run out of connections and your app will die. One of our sites was dying every couple of days.
<FromGitter> <sdogruyol> ouch, that's really nasty. Glad that we got a great issue resolver like you @crisward :)
<FromGitter> <crisward> @sdogruyol You're too kind 😊
rohitpaulk has quit [Ping timeout: 268 seconds]
mark_66 has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
pwned has quit [Ping timeout: 258 seconds]
pwned has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 255 seconds]
<RX14> is it just me or does IO::Buffered#sync = true not turn off read buffering?
<Papierkorb> that code also doesn't check if /dev/urandom has been tampered with
<RX14> yes thats the issue i came from
<Papierkorb> Which, if you want to do it right, is hilariously complex
<RX14> whats the earliest kernels for getrandom
<Papierkorb> something around >3.6 ..?
<FromGitter> <bew> 1) 17
<RX14> 3.17
<RX14> says the man page
<Papierkorb> It's older on (certain?) BSDs, though those I have no idea about
<RX14> i wish we could require it
<RX14> it's a much more sane interface
<RX14> looks like we'll want to refactor Crystal::System::Random to have it such that both the urandom and getrandom impls are required, and the getrandom impl will simply call the general unix impl instead of having that duplicated urandom code
<Papierkorb> Long story short, the device id of urandom on linux should always be major 1, minor 9. Else, it's not the real deal.
<RX14> so how difficult is that to check?
<RX14> it sounds easy from your description
<Papierkorb> should be a stat()
<Papierkorb> So, not hard
<RX14> "Which, if you want to do it right, is hilariously complex"
<Papierkorb> There was something else, but I can't find the post yet
<Papierkorb> Also check owner (uid 0 gid 0), possibly permission flags, and it has to be a chardev. And then it was about it. The hard part wasn't to do it in the end, but knowing what you have to check to make sure everything is fine
<RX14> the libsodium code linked doesn't seem to be checking that it's more than a character device
<Papierkorb> Yeah and it'll fail if I do `ln -s /dev/zero /dev/urandom`
<Papierkorb> well, not fail. which is the issue.
<Papierkorb> err, without -s. but you get the idea.
<Papierkorb> 1) the file is linux specific already 2) Yeah that sucks 3) we don't have to guarantee it, only up to 3.17 4) defense in depth is always a good idea
<RX14> doesn't /dev/urandom exist on manu unixes
<Papierkorb> sure it does, but that file you're looking at is linux only already. at least, that's how I read the macro in line 1
<FromGitter> <watzon> ```code paste, see link``` ⏎ ⏎ Why would this be giving me "instance variable '@status_bar_top' of Circ::Cli was not initialized in all of the 'initialize' methods, rendering it nilable". I still don't completely understand that error message, and I get it all the f*ing time [https://gitter.im/crystal-lang/crystal?at=597a0e4bc101bc4e3ac6c748]
<Papierkorb> RX14: iirc urandom isn't really the standard, only random is, so ... but I've barely any idea about BSDs, and with more enterprise unices, no idea at all
<Papierkorb> watzon, the `self` is the culprit on those lines. You're passing `self` before that self is fully initialized. that will work for the first one, but not for the later ones. Say, if that StatusBar wants to access the @display_panel, the program would crash. Crystal can't know and thus, prohibits this.
<FromGitter> <watzon> Well damn haha. I should've thought of that
<FromGitter> <watzon> And here I thought I was being clever. Would there be a better way to do that?
<Papierkorb> watzon, the solution is architectural: You can have a "main" class like the Cli one, which takes care of the library part. Then you have a CliApplication (or whatever) class for the application logic, which uses (not inherits) that Cli, and then builds the components, passing in that @cli
<FromGitter> <watzon> Ahh I gotcha
<Papierkorb> Simpler solution, but much less nice: nilable `property!`s. Sometimes required. Quick to be thrown in. But super hard to get rid of later on, also hurts modularity of the application, hurting longterm maintenance.
<Papierkorb> May even cause cancer, not sure. In any case, avoid if possible.
rohitpaulk has joined #crystal-lang
ome has quit [Ping timeout: 246 seconds]
ome has joined #crystal-lang
<FromGitter> <watzon> Papierkorb: Is there a good convention for sending an event from one class to another?
<FromGitter> <watzon> Some kind of Event Bus
<FromGitter> <watzon> I've tried the event_emitter.cr (https://github.com/hugoabonizio/event_emitter.cr) shard, but it didn't seem to work to well
<Papierkorb> watzon, in that case, see github.com/Papierkorb/cute *cough*
<Papierkorb> also has a helper for testing signal emissions. The README could have something more I guess, the samples/ dir has some more examples. Maybe I should add a small real-world application there too.
pwned has quit [Ping timeout: 255 seconds]
pwned has joined #crystal-lang
<FromGitter> <watzon> Papierkorb: I'll check it out :)
Dreamer3_ has quit [Quit: Computer has gone to sleep.]
<Papierkorb> watzon, please also see the in-source docs
<FromGitter> <watzon> Seems to be very well documented
<FromGitter> <watzon> I've already got it working :)
<FromGitter> <sdogruyol> :D
<Papierkorb> yay
Groogy2 has joined #crystal-lang
Groogy has quit [Disconnected by services]
Groogy2 is now known as Groogy
Groogy_ has joined #crystal-lang
<FromGitter> <watzon> `Logger` should accept a file as the `IO` right?
<FromGitter> <watzon> I'm not getting any errors, but it's not writing either
hightower2 has joined #crystal-lang
<Papierkorb> `require "logger"; Logger.new(STDERR).info("foo")` works fine here
<FromGitter> <watzon> Yeah I figured it out
<FromGitter> <watzon> I was opening the file as read instead of write
pwned_ has joined #crystal-lang
pwned has quit [Ping timeout: 248 seconds]
pwned has joined #crystal-lang
pwned_ has quit [Ping timeout: 268 seconds]
asterite has quit [Ping timeout: 246 seconds]
jhass has quit [Ping timeout: 276 seconds]
jhass has joined #crystal-lang
asterite has joined #crystal-lang
DTZUZU has quit [Quit: WeeChat 1.9]
sz0 has joined #crystal-lang
<FromGitter> <fridgerator> awesome-crystal.com is down 😱
<FromGitter> <fridgerator> domain expired, does anyone know who runs that?
<FromGitter> <elorest> Good catch.
<FromGitter> <elorest> Possibly the owner of the github repo awesome crystal at least knows who set up the website.
<FromGitter> <fridgerator> @veelenga
<FromGitter> <fridgerator> was looking to see if there was a libsass wrapper already, which there is (found on crystalshards)
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
DTZUZU has joined #crystal-lang
<Papierkorb> > BUG: called create_llvm_type for T
<Papierkorb> Ah come on compiler-tan, it's not even completely insane macro magic this time around
<Papierkorb> Either that's a regression, or I'm the first one to use generics
<FromGitter> <elorest> There are actually 2 crass and one other one.
Dreamer3_ has joined #crystal-lang
<Papierkorb> Feels like my issue titles are getting longer each time. oh well.
DTZUZU has quit [Quit: WeeChat 1.9]
DTZUZU has joined #crystal-lang
<RX14> Papierkorb, you forgot to include the issue stderr?
<Papierkorb> Oh
<Papierkorb> There you go
<RX14> thats a long backtrace
<Papierkorb> Err, lemme quickly remove the path junk
rohitpaulk has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
tzekid has joined #crystal-lang
<Groogy> It is possible right to pass a method directly to #each? I think I saw someone do arr.each &method
<Yxhuvud> &.method
<Yxhuvud> is the same as {|x| x.method}
<Groogy> hmm but doesn't work if method takes an argument?
<Yxhuvud> actually it does: &.method(arg)
<Groogy> oh nice
<Yxhuvud> or &.[1]
<Groogy> why do I get here that it is nilable?
DTZUZU has quit [Quit: WeeChat 1.9]
DTZUZU has joined #crystal-lang
<Papierkorb> watzon, when I get around to writing specs (Maybe now, or tomorrow), I just added a (not-public-yet) feature to Cute which lets you synchronize multiple signals easily. Great to e.g. reduce screen flicker in a UI :)
<Papierkorb> Well, technically, any not-super-complex kind of inter-dependency in an asynchronous flow
<FromGitter> <bew> Groogy, in your example, when you invoke the InputHandler constructor with self as parameter, the variable `@input_handler` has not yet been initialized, so it could be nil (in the InputHandler constructor)
<Yxhuvud> ouch. seems like a case where a better error message would be nice to have
dexter1 has joined #crystal-lang
dexter1 is now known as DTZUZO
DTZUZO has quit [Client Quit]
DTZUZO has joined #crystal-lang
<Groogy> oh okay
<Groogy> dang then... hmm
<Groogy> The input handler is just a nice helper that I want to move out later :/
rohitpaulk has quit [Ping timeout: 248 seconds]
Dreamer3_ has quit [Remote host closed the connection]
Dreamer3_ has joined #crystal-lang
Dreamer3_ has quit [Client Quit]
rohitpaulk has joined #crystal-lang
<FromGitter> <elorest> Many of my colleagues in the ruby community I've been evangelizing crystal to keep asking my why there haven't been any new blog posts for months
Dreamer3_ has joined #crystal-lang
<FromGitter> <oprypin> The person authoring almost all blog posts (and actual commits tbh) has distantiated from the project
Dreamer3_ has quit [Quit: Computer has gone to sleep.]
<FromGitter> <faustinoaq> @elorest Many recent crystal articles here 👉 https://manas.tech/blog/
<FromGitter> <faustinoaq> Someone knows How Can I connect a crystal program to MSSQL?
pwned has quit [Ping timeout: 255 seconds]
hightower2 has quit [Ping timeout: 246 seconds]
rohitpaulk has quit [Ping timeout: 268 seconds]
tzekid has quit [Remote host closed the connection]
hightower2 has joined #crystal-lang
Philpax_ has quit [Read error: Connection reset by peer]
Philpax_ has joined #crystal-lang
Raimondii has joined #crystal-lang
RX14 has quit [Excess Flood]
<FromGitter> <codenoid> heiiii, can somebody give me example, how to manage sub domain with kemal
Raimondi has quit [Write error: Broken pipe]
Raimondii is now known as Raimondi
havenwood has quit [Excess Flood]
w-p_ has joined #crystal-lang
<FromGitter> <codenoid> dynamic subdomain (without nginx / something like nginx)
RX14 has joined #crystal-lang
leex has joined #crystal-lang
Groogy2 has joined #crystal-lang
Groogy__ has joined #crystal-lang
ryanf_ has joined #crystal-lang
bazaar_ has joined #crystal-lang
bmcginty_ has joined #crystal-lang
ryanf has quit [Write error: Broken pipe]
Groogy_ has quit [Write error: Broken pipe]
Groogy has quit [Write error: Broken pipe]
leex_ has quit [Write error: Broken pipe]
bazaar has quit [Remote host closed the connection]
bmcginty has quit [Remote host closed the connection]
havenwood has joined #crystal-lang
havenwood has joined #crystal-lang
havenwood has quit [Changing host]
w-p has quit [Ping timeout: 260 seconds]
<FromGitter> <fridgerator> @faustinoaq SQL Server ?
<FromGitter> <faustinoaq> yes
<FromGitter> <fridgerator> good luck with that, even doing that with rails doesn't work well
<FromGitter> <faustinoaq> 😅
<FromGitter> <fridgerator> Had to do it recently, lots of bugs and workarounds