<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."
<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?
<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
* 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.
<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"
<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 :/
<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
<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
<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]
<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
<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.