jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.7.6 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/manastech/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
zamith_ has quit [Quit: Be back later ...]
fiveteesixone has joined #crystal-lang
waj has joined #crystal-lang
kyrylo has quit [Ping timeout: 260 seconds]
<fiveteesixone> hi, i am interested in translating the official docs of crystal from english to japanese. how does it sound to you?
<fiveteesixone> ah i see there already is a topic about translation in a google group, sorry but never mind about the above.
waterlin1 has joined #crystal-lang
waterlink has quit [Ping timeout: 252 seconds]
_whitelogger has joined #crystal-lang
waj has quit [Read error: Connection reset by peer]
waj_ has joined #crystal-lang
waterlin1 has quit [Quit: leaving]
waj_ has quit [Remote host closed the connection]
ssvb has quit [Ping timeout: 256 seconds]
fiveteesixone has quit [Remote host closed the connection]
fiveteesixone has joined #crystal-lang
fiveteesixone has quit [Ping timeout: 265 seconds]
fowlduck has joined #crystal-lang
fowlduck has quit [Remote host closed the connection]
fowlduck has joined #crystal-lang
fowlduck has quit [Remote host closed the connection]
havenwood has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
leafybasil has quit [Ping timeout: 260 seconds]
kulelu88 has quit [Quit: Leaving]
qard has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
oal has joined #crystal-lang
qard has joined #crystal-lang
fiveteesixone has joined #crystal-lang
BlaXpirit has joined #crystal-lang
fiveteesixone has quit [Ping timeout: 256 seconds]
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
qard has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tatey_ has quit []
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 256 seconds]
Ven has joined #crystal-lang
Ven has quit [Read error: No route to host]
Ven has joined #crystal-lang
trapped has joined #crystal-lang
waterlink has joined #crystal-lang
<waterlink> The interesting thing about these segfaults is that they don't happen on my mac..
tatey_ has joined #crystal-lang
<jhass> might be luck :P
<jhass> or a library version mismatch
<jhass> or even platform dependent code in the library
kyrylo has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zamith_ has joined #crystal-lang
<crystal-gh> [crystal] BlaXpirit opened pull request #1332: Add overload of `sleep` that accepts `TimeSpan` (master...sleep-timespan) http://git.io/vG4Xg
<jhass> >> TimeSpan.new(0, 0, 0, 1, 20).total_seconds
<DeBot> jhass: # => 1.02 - http://carc.in/#/r/dbj
<jhass> interesting
<BlaXpirit> >> (5.minutes + 70.seconds).total_seconds
<DeBot> BlaXpirit: # => 370 - http://carc.in/#/r/dbk
<BlaXpirit> this is more interesting, jhass
havenwood has quit [Ping timeout: 265 seconds]
Ven has joined #crystal-lang
zamith__ has joined #crystal-lang
<BlaXpirit> hmm is there a better way to write arr.each { |x| puts x.inspect }
zamith_ has quit [Ping timeout: 246 seconds]
<BlaXpirit> hm looks like i won't need the .inspect part, that's good
<jhass> puts calls to_s though
<jhass> that just happens to be the same in the default
<BlaXpirit> yeah i know
<jhass> puts arr.map(&.inspect).join("\n") # not really better
ssvb has joined #crystal-lang
<jhass> p arr if you can live with arr.inspect
<waterlink> jhass: Probably platform dependent
<BlaXpirit> i want it separated by newlines, nto all in one line
waterlink has quit [Ping timeout: 240 seconds]
waterlink has joined #crystal-lang
sardaukar has quit [Ping timeout: 256 seconds]
sardaukar has joined #crystal-lang
Ven has quit [Read error: No route to host]
Ven has joined #crystal-lang
BlaXpirit_ has joined #crystal-lang
rhaps0dy has joined #crystal-lang
wanderer_ has quit [Ping timeout: 246 seconds]
<BlaXpirit_> ok this is a big problem
<BlaXpirit_> i just needed to click through 5 pages to see what i can actually do with a socket
<BlaXpirit_> seeing all inherited functionality of a class is very important
<Kilo`byte> BlaXpirit_: btw, i yesterday got some more pointers on how to do event listening on a socket
<Kilo`byte> without needing to interface directly with libevent
<BlaXpirit_> good job, Kilo`byte. meanwhile i implemented introspection
<Kilo`byte> i still haven't read into libdbus though
<BlaXpirit_> that stuff is brutal
<BlaXpirit_> i'm gonna investigate now
BlaXpirit_ has quit [Quit: Konversation]
leafybasil has joined #crystal-lang
kulelu88 has joined #crystal-lang
Ven has quit [Read error: No route to host]
sardaukar has quit [Quit: ZNC - http://znc.in]
Ven has joined #crystal-lang
waterlink has quit [Ping timeout: 264 seconds]
<tatey_> gs
<tatey_> IRC is not my terminal. Whoops.
sardaukar has joined #crystal-lang
<Kilo`byte> tatey_: y u no terminal irc client ;)
ssvb has quit [Ping timeout: 272 seconds]
havenwood has joined #crystal-lang
orliesaurus has quit [Excess Flood]
a| has joined #crystal-lang
a| is now known as Guest39051
Guest39051 is now known as orliesaurus
<crystal-gh> [crystal] asterite pushed 3 new commits to master: http://git.io/vGB5m
<crystal-gh> crystal/master c950ef3 Ary Borenszweig: Moved levenshtein distance method inside the Levenshtein module, and show it in docs
<crystal-gh> crystal/master a15972f Ary Borenszweig: Fixed #1333: allow declaring classes and defs from inline macro expressions
<crystal-gh> crystal/master da2aff6 Ary Borenszweig: Documented the CSV module and all its related types
leafybasil has quit [Read error: Connection reset by peer]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/vGBdX
<crystal-gh> crystal/master 15a1871 Oleh Prypin: Add sleep(TimeSpan)
<crystal-gh> crystal/master 6c9cb81 Ary Borenszweig: Merge pull request #1332 from BlaXpirit/sleep-timespan...
leafybasil has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vGBbx
<crystal-gh> crystal/master 1731673 Ary Borenszweig: Allow setting IO timeouts as TimeSpans. Related to #1332
<crystal-gh> [crystal] asterite closed pull request #1327: Macro def doc (gh-pages...macro_def_doc) http://git.io/vGcMO
waterlink has joined #crystal-lang
<travis-ci> manastech/crystal#6c9cb81 (master - Merge pull request #1332 from BlaXpirit/sleep-timespan): The build passed. https://travis-ci.org/manastech/crystal/builds/78033601
<travis-ci> manastech/crystal#1731673 (master - Allow setting IO timeouts as TimeSpans. Related to #1332): The build has errored. https://travis-ci.org/manastech/crystal/builds/78034339
<travis-ci> manastech/crystal#da2aff6 (master - Documented the CSV module and all its related types): The build has errored. https://travis-ci.org/manastech/crystal/builds/78032964
tatey_ has quit []
shadeslayer has quit [Ping timeout: 256 seconds]
shadeslayer has joined #crystal-lang
<trapped> is there any way to get the caller's name in a function? for logging purposes
<BlaXpirit> trapped, in a macro, yes
<BlaXpirit> wait,
<BlaXpirit> i'm confusing somethin
<trapped> also, jhass: "Failed to find a valid digest in the 'integrity' attribute for resource 'http://carc.in/assets/vendor-94365628e4f93d3e8962b9ba300651e5.js' with computed SHA-256 integrity 'RFBQGZsbLC36f6syk09ZGRU6yx2HtIc9URqJwSTeCFI='. The resource has been blocked."
<jhass> >> def foo; caller; end; def bar; foo; end; bar
<DeBot> jhass: # => ["*foo:Array(String) +23 [3077750691]", "*bar:Array(String) +23 [3077750691]", "__crystal_main +23089 [3077750691]", "main +94 [3077750691]", "__libc_start_main +247 [3077750691]", "_start +33 [3077750691]"] - http://carc.in/#/r/dca
<jhass> you could try to parse that
<jhass> trapped: uh
<jhass> after a Ctrl+F5 too?
<trapped> yep
<jhass> weird
<jhass> what browser/OS?
<trapped> chrome 45.0.2454.15 m (64-bit) stable on win7 x64
<jhass> trapped: my (latest) FF and Chromium work, thus it's a bit hard to debug for me :/
<jhass> do you IPv6?
<trapped> nope
waj_ has joined #crystal-lang
ssvb has joined #crystal-lang
NeverDie has joined #crystal-lang
Ven has quit [Ping timeout: 264 seconds]
<jhass> nope, I just cannot reproduce
<jhass> which makes it rather hard to debug
<jhass> maybe let me rebuild it
<jhass> idk why it's requesting 943.. anyway, that's not the most recent
<jhass> trapped: try again pls?
<trapped> same
<trapped> >> /\*\w:/i =~ "*foo:Array"
<DeBot> trapped: # => nil - http://carc.in/#/r/dcb
<jhass> >> "*foo:Array"[/\*(\w+):/i, 1]
<DeBot> jhass: # => "foo" - http://carc.in/#/r/dcc
<trapped> ah thanks
<jhass> trapped: project is on github.com/jhass/carcin, as said I cannot reproduce thus I can hardly debug, if you find any hints we can try them
<trapped> alright
waterlink has quit [Ping timeout: 246 seconds]
<trapped> jhass: where is the integrity attribute's content computed? is it just the sha256/512 of the stylesheet file?
<jhass> somewhere inside the guts of ember-cli
Ven has joined #crystal-lang
<jhass> I just ember build -prod inside the frontend folder
<crystal-gh> [crystal] jhass opened pull request #1334: Automatic docs rebuild fixes (gh-pages...docs_rebuild_fixes) http://git.io/vGROC
<jhass> uh, but it's a prod build
<jhass> test stuff shouldn't be included
<trapped> this is where the error is produced
<trapped> in chromium, that is
waj_ has quit [Read error: Connection reset by peer]
waj__ has joined #crystal-lang
<jhass> oh, there's an update
<jhass> let's see
<jhass> trapped: try again please
<trapped> seems to be still complaining
<jhass> made sure to Ctrl+F5?
<trapped> yes
waterlink has joined #crystal-lang
<trapped> the tor browser accepts the integrity
<trapped> perhaps it's a bug in chrome
<trapped> computing an incorrect sha256 or whatever
<jhass> I'll nuke the dependencies and reinstall them and then we'll try one more time, else I'll just rip out that mess
<jhass> great, now node throws me bus errors ?!
ingsoc has joined #crystal-lang
<trapped> you could just disable ember-cli-sri
<trapped> seems like it's some kind of module or something
<trapped> no clue about how ember works
<jhass> yeah, that's what I meant with rip it out
<trapped> how do i do what this would be doing if it worked? def foo(x = 3 : Int32)
waj__ has quit [Read error: Connection reset by peer]
<jhass> it should work
waj_ has joined #crystal-lang
<jhass> >> def foo(x = 3 : Int32); x; end; foo
<DeBot> jhass: # => 3 - http://carc.in/#/r/dcd
<jhass> >> def foo(x = 3 : Int32); x; end; foo("")
<DeBot> jhass: Error in line 4: no overload matches 'foo' with types String - http://carc.in/#/r/dce
<jhass> >> def foo(x = 3 : Int32); x; end; foo(4)
<DeBot> jhass: # => 4 - http://carc.in/#/r/dcf
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vGRlD
<crystal-gh> crystal/master e0815e7 Ary Borenszweig: Docs: show methods from all ancestors
<trapped> this erroneous line numbers in compile errors thing is starting to get annoying
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vGR8I
<crystal-gh> crystal/master bd44a64 Ary Borenszweig: Missing file from last commit
<BlaXpirit> yeah, traceback is so bad, it's not usable at all
<travis-ci> manastech/crystal#e0815e7 (master - Docs: show methods from all ancestors): The build has errored. https://travis-ci.org/manastech/crystal/builds/78045428
<BlaXpirit> if only it showed the lines of code that caused the error
<jhass> trapped: any change?
<trapped> nope
<jhass> so much for FF42 validating it too
<trapped> isn't the vendor-xxxxx.js file the emberjs lib?
waj_ has quit [Remote host closed the connection]
<trapped> the other js file doesn't get blocked
<jhass> it's all third party libs combined
<travis-ci> manastech/crystal#bd44a64 (master - Missing file from last commit): The build passed. https://travis-ci.org/manastech/crystal/builds/78045524
<trapped> how do i get the class name from self
<trapped> seems like casting to Class then calling .name crashes the compiler
<RX14> self.class?
<trapped> actually that works
<RX14> >> class X; def foo; self.class.name;end;end; X.new.foo
<DeBot> RX14: # => "X" - http://carc.in/#/r/dch
<RX14> yup
<trapped> do i escape % using \ in macros? for TimeFormat
<jhass> yes
<jhass> \{% actually iirc
<jhass> oh, you mean in general
<jhass> shouldn't need to escape it
<jhass> only {% and {{ iirc
<trapped> using \%d/\%b/\%Y:\%H:\%M:\%S \%z prints __temp_98/__temp_99/__temp_100:__temp_101:__temp_102:__temp_103 __temp_104 using
<jhass> ah right, forgot about macro vars -.-
<jhass> though they shouldn't trigger inside string literal (at least IMO)
<trapped> probably they shouldn't, no
<jhass> trapped: alright, disabled that SRI shit
<jhass> feel free to suggest that in an issue ;)
<RX14> I would say % triggering inside strings would be a bug
<BlaXpirit> yes....
<crystal-gh> [crystal] asterite closed pull request #1334: Automatic docs rebuild fixes (gh-pages...docs_rebuild_fixes) http://git.io/vGROC
<trapped> in the meanwhile is there a way to circumvent the issue
<trapped> maybe using a global var with the format string?
<trapped> that worked
<trapped> it works now btw jhass
<trapped> now that you've disabled sri
<trapped> "there's no self in this scope"
<trapped> apparently i can't check the value of self
<crystal-gh> [crystal] jhass opened pull request #1335: Add rake to Gemfile, add set -e to travis-build.sh (gh-pages...docs_rebuild_fixes) http://git.io/vGRay
<trapped> or begin/rescue it
<jhass> trapped: \% doesn't work?
waj has joined #crystal-lang
<trapped> jhass: no
<jhass> :(
<jhass> that's a bug on its own
<jhass> definitely open an issue about those two
<trapped> the global variable way works, though
BlaXpirit has quit [Ping timeout: 265 seconds]
<jhass> if you use a CONSTANT it should be less bad :P
<trapped> yeah i meant a constant
<trapped> i seem to be CONSTANTLY confusing the two
<jhass> I'd found it interesting if we would actually forbid user defined globals, forcing you to use singletons and such
<trapped> but did you get the pun
<Kilo`byte> jhass: make the compiler performance go down the hill when it finds globals! \s
<jhass> trapped: it wasn't that hard to find :P
<trapped> now to bring up again the `self` issue
<trapped> is there any way to catch/ignore that error?
<Kilo`byte> trapped: hm?
<Kilo`byte> which one?
<trapped> this one
<Kilo`byte> long live slow internet...
<trapped> i need to use `self.class` but when it's top level it throws an error
<trapped> because, of course, there's no self
<Kilo`byte> because afaik there is no top-level object
<trapped> but it seems there's no way to catch that error
<Kilo`byte> yes, because its a compile-time error
<trapped> right
<Kilo`byte> if you need to catch such an error, you are probably having a different flaw in your design
<trapped> just trying to write a generic log() function that prints the caller's class name
<Kilo`byte> well you can use caller for that
<Kilo`byte> sec
<Kilo`byte> trapped: http://carc.in/#/r/dd6 check this out :P
<trapped> ah cool there's the class name in there too
<trapped> it gets harder to parse tho
<waj> I wouldn't use `caller` for anything but debugging
<Kilo`byte> waj: just curious, what approach would you suggest?
<waj> it's really slow
<Kilo`byte> hmmm lets test that!
<waj> can't you just define the log() method in Object?
<waj> I'm not fan of adding methods to Object anyway...
<trapped> but then how would you call it from top level?
<waj> mm... define another method just for that case
<trapped> but then does crystal prefer Object#log to just log?
<waj> sure
<trapped> well it seems it does
* Kilo`byte is no fan of top-level code for most part
<Kilo`byte> caller takes half a millisecond in my test
<Kilo`byte> on average that is
<trapped> how do i access macro variables (%var)?
sfcgeorge has joined #crystal-lang
<sfcgeorge> Have throw/catch been considered for Crystal? Just discovered them in Ruby, completely different from exceptions but confusingly named and I've never seen them used. http://ruby-doc.com/docs/ProgrammingRuby/html/tut_exceptions.html
<jhass> I don't like that construct too much, to me it's a mixture of a hidden scoped goto up the stack and the reason why you shouldn't use exceptions for control flow
<willl> throw/catch is used in sinatra http://patshaughnessy.net/2012/3/7/learning-from-the-masters-sinatra-internals if you want to see it used in ruby
<willl> it is not common and yeah feels weird
* sfcgeorge Mm it does look a bit like goto, and you could achieve similar with an instance variable and some if statements maybe.
* sfcgeorge Thanks will that'll be interesting to read!
* sfcgeorge It definitely feels weird but I quite like being able to get out of multiple layers of loops, though too many nested loops is bad practice anyway.
<trapped> why does __FILE__ in a macro equal "expanded macro" instead of the name of the file containing the macro call
<Kilo`byte> trapped: probably some compiler internals
* sfcgeorge will: Wow ok that's kinda crazy! In a good way, but, I'm quite happy for Crystal to be simpler and less confusing.
<Kilo`byte> sfcgeorge: just curious, why do you talk in actions for no apparentl reason
<trapped> i was wondering too
<sfcgeorge> Kilo`byte: Drat! Sorry. I'm used to hitting cmd+enter in other apps to send a message, but in this IRC app that apparently makes it an action. I should change the shortcut or kick the muscle memory.
<Kilo`byte> only thing i've ever seen clients do on ctrl+enter is ignoring the leading / if any and not stripping leading spaces (kvirc)
<sfcgeorge> There, disabled that shortcut so I don't keep doing it XD This is Textual 5 on OS X.
<Kilo`byte> weechat masterrace!
<Kilo`byte> i've yet to find a gui client that can compete with weechat
<sfcgeorge> Kilo`byte: I like my nice OS X interface ;)
<Kilo`byte> functionality is important to people like me :P
<Kilo`byte> and weechat just has so many features :P
<Kilo`byte> (not saying its the best client, i'd love to hear about other good clients)
<sfcgeorge> Kilo`byte: It has functionality :P Not that I use IRC to the full anyway. Oooh, write one in Crystal!
<Kilo`byte> textual doesn't compile on linux though as it uses osx specific apis
<Kilo`byte> sfcgeorge: afaik it can't do things like split screen for example :P
<sfcgeorge> Kilo`byte: Well yes it's OS X only, unless you use GNUStep or something crazy. I've not found a decent cross platform GUI toolkit, but I keep dreaming.
<Kilo`byte> Qt is decent
<Kilo`byte> :P
<trapped> can you call a class method by name?
<Kilo`byte> have used it quite a bit and its fairly easy to use and produces nice looking guis
<Kilo`byte> trapped: explain how you mean that :P
<sfcgeorge> Kilo`byte: I used Tk in Ruby which produces ok native GUIs but the documentation is atrocious.
<trapped> class A; def b; puts "ok"; end; end; A.new.call :b
<jhass> trapped: no, you could build a case when with a macro, but better find another solution
<Kilo`byte> yeah, method invokations are resolved at compile time, not runtime (for most part)
<trapped> can i override `def` so that inside that class declaring a method adds the method name to an hash
<trapped> or get the method list at compile time
<Kilo`byte> why'd you want that? :P
<trapped> to avoid writing an hash entry for every SMTP command
<trapped> or case
<jhass> trapped: no, but you can bass a def to macro
<trapped> ah right
havenwood has quit [Ping timeout: 250 seconds]
<trapped> macro cmd(name, &block); def {{name}}; yield ; end; end;
<jhass> >> METHODS = [] of Symbol; macro rec(method); {{method}}; METHODS << :{{method.name.id}}; end; rec def foo; end; rec def bar; end; METHODS
<DeBot> jhass: # => [:foo, :bar] - http://carc.in/#/r/ddm
<Kilo`byte> trapped: iirc you can actually do macro cmd(name) def {{name}}; {{ yield }}; end; end
<trapped> cool
<jhass> I like passing the entire def, less hassle with argument lists and you can clearly see it defines a method on the caller side
<Kilo`byte> jhass: is that how private etc are implemented?
<Kilo`byte> probably not
<jhass> don't think so
<Kilo`byte> but this gets pretty close to what i like about scala: being able to build language constructs that look like native elements :D
<jhass> in Ruby it kinda works that way, def returns the name of the method as a symbol, private is a method call accepting a symbol thus you can private def foo in ruby too nowadays
<Kilo`byte> yeah
<Kilo`byte> i usually don't prefix private to the method in ruby though
<sfcgeorge> Mmm macros are awesome
<Kilo`byte> most modern languages have pretty good macro systems
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Kilo`byte> well, compiled ones
<sfcgeorge> I feel Ruby metaprogramming and reflection only gets you so far and can become overcomplicated.
sooli has joined #crystal-lang
<Kilo`byte> its neat in some cases but not really all
<sfcgeorge> Oh yeah, but I feel Crystal macros can do a lot of it better.
<Kilo`byte> yeah
waj has quit [Read error: Connection reset by peer]
waj_ has joined #crystal-lang
daphee has joined #crystal-lang
<daphee> Hey. Is it possible to use the "delegate" macro to delegate a setter? Using delegate(property=, @property_holder) failed. I get a syntax error "Unterminated call"
<Kilo`byte> never used it, sorry
BlaXpirit has joined #crystal-lang
<jhass> daphee: parser could be improved there I guess, but http://carc.in/#/r/ddp
<willl> can drop the : also http://carc.in/#/r/ddq
<daphee> Ahh, cool. Thanks!
Ven has joined #crystal-lang
Ven has quit [Client Quit]
<trapped> how do i reference a method? e.g. Hash["name"] = self.cmd_name
sooli has quit [Quit: sooli]
grindhold_ is now known as grindhold
waj_ has quit [Read error: Connection reset by peer]
waj has joined #crystal-lang
<jhass> trapped: you can do ->self.cmd_name, ->self.cmd_name(String, Int32) if it takes any params
<trapped> ah just like a proc then
<jhass> but using such gets brittle quickly since you still get huge unions fast that are ugly to work with
<trapped> i was missing the params part
<jhass> Command pattern might work better
<trapped> `@@methods["noop"] = ->self.cmd_noop(TCPSocket, Array(String))` after the def macro complains that cmd_noop is not defined
<jhass> mmh, without self.?
<jhass> I never tried it with self tbh
<trapped> error instantiating ->cmd_noop(TCPSocket, Array(String))
<jhass> what's cmd_noop's definition?
<jhass> that doesn't run into an undefined local variable or method block?
<jhass> note that you don't access the {{macro_param}} there
<jhass> besides no real need for the &block stuff, just {{yield}}
<trapped> block.call?
<jhass> yes
<jhass> >> macro foo(&block); block.call; end; foo { 1+1 }
<DeBot> jhass: Error in macro 'foo' eval:4, line 1:
<DeBot> undefined local variable or method 'block' - http://carc.in/#/r/ddr
<trapped> with just yield it still says error instantiating
<jhass> how about you add the full error message to your gist? or make a small example reproducing on carc.in?
<jhass> also just yield is "yield" or {{yield}} ?
<trapped> "yield"
<jhass> yes, still wrong
<jhass> yield is the method level yield
<jhass> {{yield}} is the macro level one
<trapped> alright
<trapped> it did seem fishy to me to yield in a macro
<trapped> didn't know about the macro yield though
<jhass> well, I don't put {{}} around stuff for fun ;P
<jhass> ugh, where does that macro var come from
<jhass> how do you define noop?
<jhass> oh, nvm
<trapped> i think amethyst does the same thing with its `get "/path" do` macro
havenwood has joined #crystal-lang
<jhass> mmh, probably with method calls, not arguments
waterlink has quit [Quit: leaving]
<jhass> great, I crashed the compiler http://carc.in/#/r/de0
<jhass> trapped: http://carc.in/#/r/de4 I just guessed that syntax, but apparently it works
<jhass> http://carc.in/#/r/de8 prolly a bug, the yield params are irrelevant, the block param makes the var "known"
<jhass> http://carc.in/#/r/de9 yeah, can swap them around and what not
<trapped> so i gotta add the |params| part
<trapped> actually it's not just that it seems
<trapped> undefined constant "CFileIO"
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
waj has quit [Read error: Connection reset by peer]
waj_ has joined #crystal-lang
<trapped> jhass: http://carc.in/#/r/def
<trapped> it's because mine is in a class
<jhass> whoops, was still on .1
<jhass> well, yeah that doesn't work
<jhass> it's an instance method
<jhass> you have no instance there you could get a reference for
<jhass> http://carc.in/#/r/deo could make it a class method, whether it's what you want... well I'm not sure what you want
<jhass> why the hassle of defining methods? Why not just store Proc's?
<trapped> you're probably right
<trapped> at the beginning i thought something like .methods would've worked
<trapped> so that i could use it to get the capabilities list
waj_ has quit [Read error: Connection reset by peer]
waj has joined #crystal-lang
<jhass> you'll probably have to reset/define METHODS/@@methods via an inherited hook so they don't get shared between subclasses
<jhass> well, HANDLERS/@@handlers rather :P
<trapped> nah they don't have to be reset
<jhass> if you want to have a look how it could work with defining methods, have a look at artanis
<jhass> the approach is basically to record everything and then generate a dispatcher case when
havenwood has quit [Ping timeout: 240 seconds]
ingsoc has quit [Ping timeout: 256 seconds]
kyrylo has quit [Ping timeout: 264 seconds]
qard has joined #crystal-lang
kyrylo has joined #crystal-lang
kyrylo has quit [Ping timeout: 255 seconds]
zamith__ has quit [Ping timeout: 244 seconds]
havenwood has joined #crystal-lang
<crystal-gh> [crystal] BlaXpirit opened pull request #1339: Docs: group inherited methods and add detailed tooltips (master...doc-inherited-tooltip) http://git.io/vGEJi
havenwood has quit [Ping timeout: 252 seconds]
kumpelblase2 has joined #crystal-lang
waj has quit [Read error: Connection reset by peer]
waj_ has joined #crystal-lang
daphee has quit [Ping timeout: 260 seconds]
waj_ has quit [Read error: Connection reset by peer]
waj has joined #crystal-lang
fowlduck has joined #crystal-lang
_waterlink has joined #crystal-lang
daphee has joined #crystal-lang
_waterlink is now known as waterlink
qard has quit [Max SendQ exceeded]
Raimondii has joined #crystal-lang
daphee has quit [Read error: Connection reset by peer]
daphee has joined #crystal-lang
Raimondi has quit [Ping timeout: 256 seconds]
qard has joined #crystal-lang
Raimondii is now known as Raimondi
glenab has joined #crystal-lang
daphee has quit [Read error: Connection reset by peer]
daphee has joined #crystal-lang
daphee has quit [Read error: Connection reset by peer]
daphee has joined #crystal-lang
daphee has quit [Read error: Connection reset by peer]
DeBot has quit [Read error: Connection reset by peer]
NeverDie has joined #crystal-lang
daphee has joined #crystal-lang
DeBot has joined #crystal-lang
daphee has left #crystal-lang [#crystal-lang]
DeBot has quit [Ping timeout: 250 seconds]
DeBot has joined #crystal-lang
glenab has quit [Remote host closed the connection]
<Kilo`byte> dzv: mind a pm regarding your advice from yesterday?
waj has quit [Read error: Connection reset by peer]
havenwood has joined #crystal-lang
waj_ has joined #crystal-lang
<crystal-gh> [crystal] kumpelblase2 opened pull request #1341: Properly handle sending data that is longer than 125 bytes in WebSockets (master...patch-1) http://git.io/vGuuP
<waterlink> Uhh. Still can't figure out the problem with this particular segfault. It looks like whatever objects C library allocates - GC is unaware of them and it segfaults when GC tries to allocate memory somewhere where these were allocated..
<waterlink> *objects=structs
<crystal-gh> [crystal] jhass pushed 3 new commits to master: http://git.io/vGuw4
<crystal-gh> crystal/master f3e5263 Tim Hagemann: Allow sending WebSocket data longer than 125 bytes
<crystal-gh> crystal/master fa3f177 Tim Hagemann: Added specs for sending long data over websocket
<crystal-gh> crystal/master 1cc274f Jonne Haß: Merge pull request #1341 from kumpelblase2/patch-1...
<waterlink> and GC.disable makes the test pass, but of course this is not a solution :/
<jhass> https://github.com/manastech/crystal/blob/master/src/gc/boehm.cr#L96 would make it explicitly known to the GC, but also prevents collection
<jhass> that is you'll have to manually free it with the GC.free above, if libmysqlclient doesn't do it
glenab has joined #crystal-lang
<crystal-gh> [crystal] jhass closed pull request #1339: Docs: group inherited methods and add detailed tooltips (master...doc-inherited-tooltip) http://git.io/vGEJi
<crystal-gh> [crystal] jhass pushed 2 new commits to master: http://git.io/vGuPw
<crystal-gh> crystal/master e879796 Anton Davydov: Fix typos in docs/macros.cr
<crystal-gh> crystal/master 08ce734 Jonne Haß: Merge pull request #1328 from davydovanton/fix-typo-docs-macros...
<travis-ci> manastech/crystal#22b29bf (master - Merge pull request #1339 from BlaXpirit/doc-inherited-tooltip): The build passed. https://travis-ci.org/manastech/crystal/builds/78117390
<travis-ci> manastech/crystal#08ce734 (master - Merge pull request #1328 from davydovanton/fix-typo-docs-macros): The build passed. https://travis-ci.org/manastech/crystal/builds/78117622
fowlduck has quit [Remote host closed the connection]
fowlduck has joined #crystal-lang
kyrylo has joined #crystal-lang
dyulax has quit [Read error: Connection reset by peer]
dyulax has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vGzf3
<crystal-gh> crystal/master 36d468b Ary Borenszweig: Fixed #1336: added `\%` escape sequence inside macros
<waterlink> GC.add_root didn't help
fowlduck has quit [Remote host closed the connection]
<travis-ci> manastech/crystal#36d468b (master - Fixed #1336: added `\%` escape sequence inside macros): The build passed. https://travis-ci.org/manastech/crystal/builds/78126122
sfcgeorge has quit [Quit: Textual IRC Client: www.textualapp.com]
<waj_> waterlink: are you aware of https://github.com/manastech/crystal-mysql ?
<waj_> very preliminar work though, mostly proof of concept
waj_ is now known as waj
fowlduck has joined #crystal-lang
tatey_ has joined #crystal-lang
<jhass> waj: asterite what about https://github.com/manastech/crystal/issues/666, missing bug label?
<waterlink> waj: Yes I am aware, I have looked into it and it tries to implement everything from scratch (what is already implemented in C library)
ytti has quit [Ping timeout: 248 seconds]
<waj> jhass: I wonder if that is still happening
<jhass> true
<waj> waterlink: Yes, that's the idea. I found the pure Crystal version to be twice as fast as using libmysql in the middle, mostly because all the required memory copies
<jhass> on 32bit perhaps, might actually be linked to https://github.com/manastech/crystal/issues/1311
<waj> waterlink: also, I don't know if it's possible to obtain async results using libmysql, but otherwise it will block the entire thread while waiting for a query result stopping other fibers to do their job
<waterlink> waj: Yes, idea is good, but the problem is that it uses "Internals" instead of "Public APIs", which means that to support new version you might need major rework. + it is easy to introduce bugs that are already long time ago fixed in C implementation.
glenab has quit [Remote host closed the connection]
<waj> waterlink: the binary protocol is documented, is not internal
<waj> jhass: regarding #1311, were you able to reproduce outside the docker instance?
<jhass> waj: yes, it happens in my 32bit chroot too
<waj> waterlink: Ok, got it, it's in the "internals" section of the manual :) https://dev.mysql.com/doc/internals/en/client-server-protocol.html
<waterlink> waj: AFAIK, yes it is possible. At least it is possible to fetch result bit-by-bit from server (lazily) instead of getting the whole response in one go.
<waterlink> "Public Internals" then ? :)
<jhass> waterlink: and I verified the workaround in #1316 there too, though I understand it might just hide an issue in the scheduler
<jhass> er, waj ^, sorry weechat failed on me
BlaXpirit has quit [Quit: Konversation]
kumpelblase2 has quit [Quit: Leaving...]
fowlduck has quit [Remote host closed the connection]
<jhass> https://github.com/manastech/crystal/issues/575 what do you think, bug or enhancement? given the first one raises already I'd say bug
<waj> jhass: you're too fast. Still digesting #1316 here :)
<jhass> no worries, answer whenever you feel like ;)
<waj> you're right that Scheduler.yield should try to run as many fibers as possible before returning to the current one. Still I don't understand how can that affect.
glenab has joined #crystal-lang
<jhass> just looking through the issues and seeing if I can add a tag to most untagged ones, I like organized issue trackers :P
<waj> absolutely!
fowlduck has joined #crystal-lang
glenab has quit [Remote host closed the connection]
<waj> jhass: I have no idea how to handle that error
<jhass> but ssvb apparently has?
<ssvb> jhass: the sanity check in https://github.com/manastech/crystal/blob/36d468bcdbfe69e42ea372dba6189fd61c6ab30d/src/int.cr#L63 can be also extended to handle this special case
<jhass> ah, kay that's actually easy
<ssvb> at the expense of having a bit higher runtime overhead
<waj> yes but also is that the only case?
<ssvb> waj: yes, one can check the Intel manual about the division instruction
fowlduck has quit [Remote host closed the connection]
<ssvb> it describes these special cases, where hardware exception can be raised by the CPU when handling this instruction
<ssvb> also ruby code can be probably used as a reference, it should handle these cases too (I have not checked this yet)
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
<waj> yup, makes sense. So for signed integer division, MIN_VALUE / -1 should raise an overflow exception
<waj> waterlink: if there is a way to yield work to other fibers while executing a query then it's ok, but otherwise I think it would be a big bottleneck
kulelu88 has left #crystal-lang ["Leaving"]
<waj> waterlink: I just want to make sure that you're aware of the potential issues. I'm really happy with all the excitement around Crystal and all of you guys are doing tremendous job. And I'd feel really sad if you spend too much time with something that later is found to not work properly with the design of the language.
fowlduck has joined #crystal-lang