<asterite>
do you think it would make sense for us to try to be there?
asterite_ has joined #crystal-lang
<jhass>
I'm not sure, I always find it hard to decipher the blabla, but given the speaker set, I think you wouldn't be misplaced ;)
<jhass>
I think Crystal is a very practical approach to a programming language while many new languages are fairly academical, so it might add a nice perspective
asterite has quit [Ping timeout: 244 seconds]
asterite_ is now known as asterite
<jhass>
For a talk I'd mainly focus on motivation & history, not too much on the language actually
<asterite>
Thanks for the feedback :)
<asterite>
My main concern is that we are not dealing with, like, big-data or security, as they say there. Nor we are doing something academic. We are trying to make something useful, fun and efficient. On the other hand there’s Brendan Eich there :)
asterite has quit [Client Quit]
<jhass>
big-data and security are just buzz words
<jhass>
security since snowden ;)
<jhass>
so that's what I called "blabla" ;)
<jhass>
I'm sure you'll meet some nice people there and maybe take away an idea or two and after all that's what a conference like that is about
asterite has joined #crystal-lang
bcardiff has joined #crystal-lang
bcardiff1 has quit [Ping timeout: 264 seconds]
endou_ has joined #crystal-lang
endou has quit [Ping timeout: 256 seconds]
filer has quit [Quit: No Ping reply in 180 seconds.]
filer has joined #crystal-lang
Liothen has quit [Ping timeout: 245 seconds]
Liothen has joined #crystal-lang
asterite_ has joined #crystal-lang
asterite has quit [Ping timeout: 245 seconds]
asterite_ is now known as asterite
Liothen has quit [Ping timeout: 245 seconds]
Liothen has joined #crystal-lang
<asterite>
jhass: do you have enums whose values come later?
<jhass>
maybe
<asterite>
I mean, something like: enum Bar; X = A; end; A = 1
<jhass>
the generated binding for Gtk is already ~10kloc ^^
<asterite>
:-o
<jhass>
ah, no
<asterite>
Does it compile fast?
<jhass>
it does not compile yet :D
<asterite>
How are you generating the bindings?
<jhass>
with gobject-introspection
<jhass>
I have functions using enums in their signature before they're defined apparently, mmh
<jhass>
but nothing like you wrote there
<jhass>
brb, shopping
asterite_ has joined #crystal-lang
asterite has quit [Ping timeout: 252 seconds]
asterite_ is now known as asterite
leafybasil has quit [Remote host closed the connection]
waj1 has joined #crystal-lang
bcardiff1 has joined #crystal-lang
waj has quit [Ping timeout: 256 seconds]
bcardiff has quit [Ping timeout: 245 seconds]
shama has joined #crystal-lang
zamith__ has quit [Ping timeout: 250 seconds]
<jhass>
back
<asterite>
jhass: Pushed. Let me know if that works for you :)
crystal-gh has joined #crystal-lang
<crystal-gh>
[crystal] asterite pushed 4 new commits to master: http://git.io/b6Xd
<crystal-gh>
crystal/master 908bcf9 Ary Borenszweig: Improved Call#to_s when there's &.
<crystal-gh>
crystal/master 970933b Ary Borenszweig: Fixed a parser bug involving &. and do
<crystal-gh>
crystal/master 1a289d3 Ary Borenszweig: Correct way to do BufferedIO#gets(delimiter : Char) (although slower)
<jhass>
it's basically an object orientation framework for C
<jhass>
you can define objects, interfaces, methods, callbacks, signals and so on
<asterite>
And why do you want to use that from crystal?
<jhass>
I'm not saying I fully grasped it yet
<jhass>
I don't, I want to use Gtk which uses it ;)
<asterite>
Oh! :)
<jhass>
so, gobject-introspection is a project that gives you an API that allows you to enumerate all the gobject stuff
<jhass>
"give me all entities in this namespace, give me all methods for this object" etc
<jhass>
but tbh I'm not sure I'll pursue it beyond the "hello world window" state
<jhass>
so it probably stays a PoC
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: http://git.io/bivu
<crystal-gh>
crystal/master ebee669 Ary Borenszweig: Fixed a parser bug where a hash literal of namespaced values couldn't be created ({Foo::A => 1, Foo::B => 2})
<jhass>
wow, that was fast :D
<asterite>
You can see that the fix was easy, my comment about the symbol-things was right… had a duplicated code but it wasn’t exactly duplicated :)
<asterite>
I like to fix bugs soon :)
r20 has joined #crystal-lang
travis-ci has joined #crystal-lang
<travis-ci>
manastech/crystal#1931 (master - ebee669 : Ary Borenszweig): The build was broken.
<asterite>
We should check if llvm 3.6 still has that bug or not. I think not, llvm 3.5.1 has it but the patch has been later merged
<jhass>
it was branched mid January I think
<waj>
yup, 3.6 has the patch
<jhass>
silly question: how close are captured blocks to C functions? Could I get a pointer to them and pass it where some library expects a function pointer?
<asterite>
It’s not a silly question at all :)
<asterite>
Our function pointers are represented as a pair of pointers: one for the real function, another one for the closure data
<asterite>
The closure data will be nil if the function is not a closure
<asterite>
You can’t cast one of our function pointers to void* because they are not exaclty pointers, but you can do...
<asterite>
>> ->{ 1 }.pointer
<DeBot>
asterite: Pointer(Void)@80495B0
<asterite>
And you can actually pass them to C just like that
<asterite>
However, if you try to pass a closure, you will get a runtime exception saying “can’t pass closure to C”
<jhass>
mmh
<asterite>
And, if the compiler can detect that you are indeed passing a closure, it will give you an error (like, when you define the function literal right in the call)
<jhass>
kay, it definitely should supported closures
<asterite>
>> a = 1; ->{ a }.closure?
<DeBot>
asterite: true
<asterite>
>> ->{ 1 }.closure?
<DeBot>
asterite: false
<jhass>
mmh
<asterite>
How it should support closures?
<jhass>
well, ultimately the high level API should look like window.connect("quit") do Gtk.quit; end or so
<jhass>
while that case doesn't require a closure
<jhass>
think about button.connect("click") do self.some_method end
<asterite>
I don’t know what the low-level api looks like
<asterite>
Yes, but in C apis you usually can pass a (void* data), so you can pass a function that has the closure and then invoke it
<jhass>
but still no real idea how that looks lke
<asterite>
Sorry, not exactly like that
<asterite>
You can pass something you can use in user_data
<asterite>
You can also try passing f.pointer and … mmm… there’s no way to get the closure data right now :(
<asterite>
When I said “pass them to C just like that”, I mean that you don’t need to invoke “.pointer”, crystal will do that for you, but will first check that it’s not a closure (and raise in that case)