<crystal-gh>
[crystal] Val opened pull request #4508: [vagrant provisioning] make git call the last one (master...fix_vagrant_provisioning_script_order) https://git.io/vH264
<crystal-gh>
[crystal] Val opened pull request #4510: [vagrant box] update Ubuntu vivid to xenial (LTS) (master...update_vivid_vagrant_box_to_xenial) https://git.io/vH26P
_whitelogger has joined #crystal-lang
ctxz has quit [Quit: Page closed]
<FromGitter>
<sdogruyol> @elorest great
<FromGitter>
<sdogruyol> there's a lot of interest to Crystal, hopefully we'll make it easier for newcomers to get on board
<crystal-gh>
[crystal] akzhan opened pull request #4511: [WIP] String.casefold and Char.casefold instance methods (master...string-and-char-casefold) https://git.io/vH21w
<FromGitter>
<elorest> I’m doing everything I can.
<FromGitter>
<sdogruyol> same :)
<FromGitter>
<elorest> :)
<FromGitter>
<sdogruyol> thanks for being awesome @elorest :tada:
<FromGitter>
<bluetwin> where was the talk? (im new here but want to help)
<FromGitter>
<elorest> Write now pretty much the whole crystal community is pretty cool. Like 2005 with ruby.
<FromGitter>
<sdogruyol> Hey @bluetwin welcome :)
<FromGitter>
<elorest> welcome!
<FromGitter>
<sdogruyol> I did a talk at https://rubyc.eu a Ruby conference in Ukraine
<FromGitter>
<bluetwin> thanks!
<FromGitter>
<bluetwin> @sdogruyol cool!
<FromGitter>
<bluetwin> I’ve been a rubyist since 2004, Chicago originally, but in Seattle and looking to contribute where I can.
<FromGitter>
<bluetwin> how big is the community? also is it pretty spread out or concentrated?
<FromGitter>
<bluetwin> I was talking to some RoR people at Twilio’s SIGNAL conf and crystal came up a bunch
<FromGitter>
<sdogruyol> I don't know an exact number but as you can see only in gitter we have 500+ and it's from all around the world
<FromGitter>
<sdogruyol> for example i'm from Istanbul, Turkey
<FromGitter>
<sdogruyol> it's great to hear Crystal being talked :P
<FromGitter>
<bluetwin> There are a lot of people not sure about the migration to elixir and phoenix.
<FromGitter>
<elorest> And I’m from `Utah` of all places lol
<FromGitter>
<sdogruyol> Elixir is great but i feel right at home with Crystal from day 0
<FromGitter>
<elorest> Yeah same here. I like elixir more than node but something seems off and it’s not the functional part.
<FromGitter>
<elorest> I’m pretty happy in C.
<FromGitter>
<sdogruyol> think of Ruby but for 21st century :P
<FromGitter>
<sdogruyol> it's more like Ruby 4.0
<FromGitter>
<bluetwin> same feeling here
<FromGitter>
<sdogruyol> having a compiler really saves a lot
<FromGitter>
<elorest> why is the `not_nil!` necessary here? ⏎ `if upload.filename.is_a?(String) && !upload.filename.not_nil!.empty?`
<FromGitter>
<elorest> shouldn’t the fact that’s it’s a string be enough to know that it’s not nil.
<FromGitter>
<sdogruyol> seems like you don't have to do that not_nil!
<FromGitter>
<elorest> I already have that up… I think a newer version of crystal must have changed it. Kemal works with that but if you try using it you need to check both that filename exists and isn’t empty in your route...
<FromGitter>
<elorest> I can’t remove the checks in amber too but then I have to do them in the action.
<FromGitter>
<sdogruyol> really?
<FromGitter>
<elorest> Yeah. I’m on 0.22.0
<FromGitter>
<sdogruyol> yeah i leave the empty check to user actually
<FromGitter>
<elorest> Yeah I had to add the empty check and not_nil!
<FromGitter>
<sdogruyol> this `filename = file.filename`
<FromGitter>
<elorest> in the File.join.
<FromGitter>
<elorest> I’ll try that.
<FromGitter>
<sdogruyol> saves the day
<FromGitter>
<elorest> Yep. Why is that?
<FromGitter>
<sdogruyol> union type :)
<FromGitter>
<elorest> you probably want to add that to your docs.
<FromGitter>
<sdogruyol> the compiler infers the type beforehand
<FromGitter>
<sdogruyol> why?
<FromGitter>
<sdogruyol> this is internal to kemal
<FromGitter>
<elorest> but if one variable has a union of (Nil | String) and you save it to another variable it’s just a string?
<FromGitter>
<sdogruyol> nope
<FromGitter>
<sdogruyol> if you handle the both condition cases the runttime type is the returning one
<FromGitter>
<sdogruyol> in this case it's just `String`
<FromGitter>
<elorest> Because your docs don’t say to do `filename = file.filename`. So when if I follow the instructions on your site it doesn’t work.
<FromGitter>
<sdogruyol> but compile time type is `String | Nil`
<FromGitter>
<elorest> Interesting.
<FromGitter>
<sdogruyol> you're actuall right
<FromGitter>
<sdogruyol> thanks for the feedback
<FromGitter>
<sdogruyol> i'll fix the docs asap
<FromGitter>
<elorest> Yeah anytime.
<FromGitter>
<elorest> Thanks.
<FromGitter>
<sdogruyol> :metal:
<FromGitter>
<sdogruyol> btw i really like where amber is going
<crystal-gh>
[crystal] asterite pushed 3 new commits to master: https://git.io/vH2DB
<crystal-gh>
crystal/master 91f1035 Ary Borenszweig: Another way to fix #4311
<crystal-gh>
crystal/master 7c51424 Ary Borenszweig: Revert "Fixed #4311: `{"a" : 1}` won't parse anymore as a named tuple"...
<FromGitter>
<akzhan> I should note that master branch of Crystal is broken. ⏎ ⏎ spec/compiler/macro/macro_methods_spec.cr throw errors.
<FromGitter>
<elorest> Thanks.
<FromGitter>
<elorest> @sdogruyol I think that with the files if we check on parsing we can avoid creating that object if it’s empty. Should save a tiny bit of time and memory and make it easier for the end user.
<FromGitter>
<bararchy> So, who want's to help me build a mail serve (postfix style) in Crystal ? --> https://github.com/bararchy/servo
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
snsei has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter>
<sdogruyol> @bararchy i'd really love to but have no exp :P
<FromGitter>
<sdogruyol> i also want to have an smtp layer for connecting to smtp servers
rohitpaulk has quit [Ping timeout: 255 seconds]
<FromGitter>
<bararchy> @sdogruyol I dont have expireance too XD it's just fun playing around, when I get into a "what does this means" I just go to the RFC page and see, implamenting protocols is just following instructions
<FromGitter>
<sdogruyol> yeah but i find following (reading) RFCs hard and boring :D
<FromGitter>
<bararchy> @sdogruyol If you will do the cool networking\DB\handeling I'll handle boring RFC and validation XD
<FromGitter>
<sdogruyol> BTW how's your company's big Crystal project going on @bararchy
<FromGitter>
<bararchy> Well, we will know after tomorow when we will finish talking with Manas ;) ⏎ But all in all it's gonna be awsome. I also hope we can release parts as OpenSource
<FromGitter>
<sdogruyol> wow, exciting times ahead :)
<FromGitter>
<bararchy> indeed !
<FromGitter>
<bararchy> addoptaion has to start somewhere
<FromGitter>
<sdogruyol> i really agree with that
<FromGitter>
<sdogruyol> way to 1.0 and beyond needs more people pitching in :tada:
<FromGitter>
<bararchy> It's true, we need to get Google or Facebook to release something like "We saw Crystal and decided to drop Go "
<FromGitter>
<bararchy> XD
<FromGitter>
<sdogruyol> trust me there're a lot of people wanting to do that
<FromGitter>
<sdogruyol> just a RubyC conference i talked with at least 5 people who want to use Crystal instead of X (mostly Go)
<FromGitter>
<bararchy> As a Ruby dev it's a no brainer , the interesting part is other devs from differrent langs, as in , C\C++ devs or java , etc..
rohitpaulk has joined #crystal-lang
<FromGitter>
<Koroeskohr> hello people ! i'd like to get started with crystal and get involved in the community, where should I start ? i have a solid experience with ruby dev, is there any article/blog post indicating from where to start to catch up with the language subtleties ? thanks :)
A124 has quit [Ping timeout: 240 seconds]
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter>
<bararchy> @Koroeskohr There are the Docs, the API and more at : ⏎ https://crystal-lang.org/
<FromGitter>
<akzhan> So it should be reviewed by @asterite
<FromGitter>
<sdogruyol> ofc
<FromGitter>
<akzhan> Another trouble that String.compare doesn’t know about folding. ⏎ ⏎ I can update code but it will have big performance penalty.
<FromGitter>
<sdogruyol> that's a bummer
<FromGitter>
<akzhan> Now we may do ` a.downcase(Unicode::CaseOptions::Fold) <=> a.downcase(Unicode::CaseOptions::Fold)`
<FromGitter>
<akzhan> or may implement String.locale_compare
<RX14>
@akzhan you should add an option to compare which compares with folding
<RX14>
but have it off by default
<RX14>
so people can choose the performance penalty when they need it
<FromGitter>
<sdogruyol> i'm not sure why but `Regex#match` started to return `(Nil:Class | Regex::MatchData:Class)` instead of just `Regex::MatchData:Class`
<FromGitter>
<sdogruyol> does anyone know why?
<RX14>
why would it return :Class
<RX14>
that sounds wrong
<RX14>
can you show code?
<FromGitter>
<sdogruyol> btw this is on master, it works on 0.22.0
<FromGitter>
<bararchy> There's nothing better then looking at http://crystalshards.xyz/?sort=updated and seeing so many projects spawning every hour :)
<crystal-gh>
crystal/master 4d07680 Ary Borenszweig: Rename FloatPrinter to Float::Printer. Related to #4333
bmcginty has quit [Ping timeout: 260 seconds]
bmcginty has joined #crystal-lang
teratoma has quit [Quit: leaving]
Winty has joined #crystal-lang
<Winty>
hey guys. i have a question about crystal. why i can't user pointerof(self) but self.as(Animal*) works and returns me the pointer to the current instance?
<RX14>
that I think the limitation should just be removed
<RX14>
sure you can replace selfptr's value, but thats really not a big issue
<Winty>
well it depends. i'm using it as a workaround for unability to pass clojures to C functions, which should get fixed and then i cant think of any more situations where you woudl want pointer to self
<RX14>
well
<RX14>
have you read how to pass closures to C functions?
<FromGitter>
<bew> you can use `Box.box(self)` for that
thelonelyghost has quit [Ping timeout: 255 seconds]
TheGillies has quit [Ping timeout: 264 seconds]
MatrixTraveler[m has quit [Ping timeout: 258 seconds]
werthen[m] has quit [Ping timeout: 264 seconds]
krigare[m] has quit [Ping timeout: 255 seconds]
<FromGitter>
<bew> why is there the limitation when trying to pass a closure to C function as callback? Is it because the GC won't be found in some cases?
MatrixTraveler[m has joined #crystal-lang
<FromGitter>
<sdogruyol> yeah
<FromGitter>
<bew> when the callback is used in another thread from the C world maybe?
<FromGitter>
<bew> huh no that will create scheduler issues IMO, don't knwo about GC
snsei has quit [Remote host closed the connection]
<crystal-gh>
[crystal] asterite closed pull request #4134: Formatter: fix to separate defs with visibility modifiers (master...fix/crystal-format/modifier-def) https://git.io/vyKWw
<RX14>
@bew @sdogruyol it's nothing to do with the GC
<RX14>
crystal procs consist of a function pointer *and* a pointer to a data struct which contains the closure data
<RX14>
(local variables referenced etc.)
<FromGitter>
<bew> oh
<RX14>
if you're trying to pass that to a C function which only expects a function pointer
<RX14>
it doesn't work
<FromGitter>
<bew> so from a closure, you need to create a proc without closure stuff, and pass it to the C lib along with the closure data or sth?
<RX14>
what you have to do is pass a proc with no closure, and then pass a pointer to the old proc as a data argument to that proc
<RX14>
so it's slower
<RX14>
for sure
<FromGitter>
<bew> wut Oo do you have an example?
<RX14>
thats literally the example in the docs
<FromGitter>
<bew> just curiosity, no use case
<RX14>
with Box.box
<RX14>
it passes the box to the C library as the "data argument" to the proc
<RX14>
which is what I said
<RX14>
that box contains the original proc
<FromGitter>
<bew> *Going back re-read*
<FromGitter>
<bew> okaaay makes sense now! I mis-read that part from the begining, even when I thought I understood what was going on! (or maybe I just forgot, too...)