jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.7.4 | 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
havenwood has quit [Ping timeout: 246 seconds]
<ozra> Is there any way of "opening" enums (including the symbols in the namespace), or preferably: get the enum namespacing infered only in params where the type is specifically given in the declaration?
blue_deref has quit [Ping timeout: 250 seconds]
NeverDie_ has joined #crystal-lang
NeverDie has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ozra has quit [Ping timeout: 246 seconds]
Guest83433 is now known as orliesaurus
havenwood has joined #crystal-lang
unshadow_ has joined #crystal-lang
unshadow has quit [Ping timeout: 248 seconds]
strcmp1 has quit [Quit: Leaving]
havenwood has quit [Read error: Connection reset by peer]
havenwood has joined #crystal-lang
NeverDie_ has quit [Quit: I'm off to sleep. ZZZzzz…]
blue_deref has joined #crystal-lang
BlaXpirit has joined #crystal-lang
havenwood has quit [Ping timeout: 246 seconds]
<crystal-gh> [crystal] asterite pushed 3 new commits to master: http://git.io/vqHUD
<crystal-gh> crystal/master b447927 Ary Borenszweig: Small cleanup: remove unused reference to non-existing instance var
<crystal-gh> crystal/master 61a4bc9 Ary Borenszweig: Codegen: store full context in exception handler, instead of just the vars
<crystal-gh> crystal/master 428ba66 Ary Borenszweig: Fixed #960: allow refering to a lib type
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vqHIV
<crystal-gh> crystal/master 1f84701 Ary Borenszweig: Fixed #951: set the type of %w(...) and %i(...) arrays
<travis-ci> manastech/crystal#428ba66 (master - Fixed #960: allow refering to a lib type): The build passed. https://travis-ci.org/manastech/crystal/builds/70349694
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vqHmk
<crystal-gh> crystal/master d9a770b Ary Borenszweig: Fixed #958: fixed multi-assign for constants
<travis-ci> manastech/crystal#d9a770b (master - Fixed #958: fixed multi-assign for constants): The build passed. https://travis-ci.org/manastech/crystal/builds/70351823
<travis-ci> manastech/crystal#1f84701 (master - Fixed #951: set the type of %w(...) and %i(...) arrays): The build passed. https://travis-ci.org/manastech/crystal/builds/70350473
Courtney has joined #crystal-lang
Courtney is now known as Guest95291
<Guest95291> I would like to ask questions on crystal. When it compiles to native code. does that produce a new binary? if yes does crystal go into a diffrent toolchain (gcc,clang). incase i want to cross compile.
<jhass> Guest95291: yes, it does. Crystal uses LLVM to produce object files and then just invokes cc to call the linker
<crystal-gh> [crystal] asterite closed pull request #952: Use %i %w to determine the expected type of the array literal (master...empty-array-literals) http://git.io/vqwEu
<jhass> crystal build --help should list you some options for cross compiling and passing flags to the linker
<Guest95291> thank you. thats all. i cant wait to try somethink easyer than c. tho that reminds me. does crystall have Pinvoke
<jhass> what does that do?
<Guest95291> pinvoke like FFI Exacute(Navitelibname,entrypoint,args*)
<jhass> ah
<Guest95291> in other words could exacute SDL_Init from libSDL
<jhass> yes and no
<Guest95291> ? in what way
<jhass> yes, Crystal does allow you to do that, no, it's not a runtime mechanic
<jhass> instead the definitions are parsed at compile time and linked at compile time
<Guest95291> is there an API that explains useing a navite lib?
<jhass> if you search for sdl on http://crystalshards.herokuapp.com/, you'll find some examples
<jhass> though I think none of these is quite complete yet
<Guest95291> That looks like a very nice libary system. inspired by rubygems?
<jhass> not quite
<jhass> what's shipped with crystal atm is really basics
<jhass> the crystalshards site for the moment just lists repos on github with crystal code^^
<Guest95291> How new is crystal?
<jhass> started a good 2 years I think, gaining traction only in this year though
<jhass> *years ago
<jhass> being written in itself, it had to be bootstrapped first etc
<jhass> https://github.com/ysbaddaden/shards will likely end up being the true library manager btw
<Guest95291> i might end up writeing my own wrapper to libmono (Why people want this i have no clue. C# is nice. but i would not use for every think)
<jhass> mh, what you'd want to use in Crystal from libmono?
<Guest95291> not much. but i could use libmono to call into .netlibs Essentally Crytal->libmono->System.Windows.Forms. (Or i could just use QT and skip the middle man)
<jhass> :P
<jhass> I did play a bit with binding generation from gobject introspection
ozra has joined #crystal-lang
<jhass> so if .netlibs provides a similar level of introspection, it could be interesting for generating a direct binding
<Guest95291> only problem is .netlibs are interperted code
<Guest95291> so a direct link would be diffacult
blue_deref has quit [Quit: bbn]
Guest95291 has quit [Quit: Page closed]
unshadow has joined #crystal-lang
unshadow_ has quit [Ping timeout: 256 seconds]
<ozra> Is it possible somehow to make enum symbols local to the namespace you're in?
<ozra> Or do you have to use consts?
<BlaXpirit> ozra, consts, pretty sure
<ozra> right
<jhass> "enum symbols"? You mean :foo ?
<BlaXpirit> ozra, there is an `enum` construct in Crystal...
<BlaXpirit> woops,
<BlaXpirit> jhass, there is an `enum` construct in Crystal...
<jhass> I know
<jhass> but I'd call those just enums
<jhass> and there's Symbol's, so I'm wondering what's meant
<BlaXpirit> right...
<BlaXpirit> what's meant is enum members probably
<jhass> mh, even then I don't fully understand the question tbh
<BlaXpirit> jhass, i understand it like... can enum members be accessed without enum name before them
<BlaXpirit> if enum A has member B, can u make it so it's possible to use B instead of A::B
<jhass> mh, yeah that's one interpretation I have
<jhass> the other being, can I use the current namespace as an enum too
<BlaXpirit> and when we talk about consts, what's meant is writing B = A::B after the enum declaration
<jhass> module Foo; FOO; BAR; BAZ; def foo...
<BlaXpirit> so is there an alternative?
<jhass> no, I'm just saying where the question is ambiguous for me
<jhass> there are some thoughts on auto converting symbols to enums where appropriate
<jhass> like enum Foo; BAR; BAZ; end; def foo(bar : Foo); end; foo(:bar) == foo(Foo::BAR)
<jhass> foo(:quux) -> error
<BlaXpirit> interesting, very interesting
<ozra> jhass: Sorry, I realized as soon as I wrote it there might be some confusion. I just ment the enums, simply.
<ozra> As BlaXpirit mentions
<ozra> I'd love that auto conversion. Or even better - matching enum by "reverse inference" so to speak. But that would require the compiler to postpone the identification of unknown constants until/after the type inference phase, which would complicate things. But it would be neeeato :)
<ozra> Funny there's an alias being made to BlaXpirit BlaXpirit CSFML::Keycode, polluting the namespace, and then still not making use of it in the huge list below..
<ozra> Eh, BlaXpirit, the name just popped in, alt+tab problem :-/
<BlaXpirit> generated code is funny :p
<ozra> BlaXpirit: Is there a .c or .h -> .cr transpiler?
<BlaXpirit> a couple
<BlaXpirit> this is a custom one, not usable in the general case
<ozra> BlaXpirit: Alright, cool, didn't know, was thinking about taking on something like that, but then I can skip that hideous task :)
<BlaXpirit> actually, ozra, there is no c -> cr compiler
<BlaXpirit> just things that produce lib definitions based on headers
<BlaXpirit> a full compiler is an unsurmountable task, if even possible
<ozra> BlaXpirit: That could pose a heavy task. But using Rose and writing a crystal backend would probably be most suitable. Don't know much about the clang AST though. Still hideous task.
<BlaXpirit> ozra, first of all, there is no goto
<BlaXpirit> just one of many things that crystal doessn't have from C
<ozra> BlaXpirit: Tell me if you port som GUI for SFML, then I could possibly port my Qt app :)
<BlaXpirit> no such plans
<ozra> BlaXpirit: Most things can probably be "emulated", but goto - well if that's in the code, it should be considered for rewrite before in any event ;-)
NeverDie has joined #crystal-lang
Ven has joined #crystal-lang
havenwood has joined #crystal-lang
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
unshadow_ has joined #crystal-lang
txdv has joined #crystal-lang
unshadow has quit [Ping timeout: 255 seconds]
<txdv> is there a way to tell crystal to just use .rb files instead of .cr files?
<jhass> while Crystal doesn't care about the file extension, it is not a Ruby interpreter (or compiler), it's its own language
<txdv> im fully aware of that
<jhass> or are you talking about require? it looks like it needs the .cr extension, though it probably should fallback to not adding it
NeverDie has joined #crystal-lang
NeverDie has quit [Client Quit]
<txdv> it says that there is a keyword getter used instead of attr_reader
<txdv> but if i try to do it it just says "Error in ostruct.cr:260: undefined method 'getter'"
NeverDie has joined #crystal-lang
NeverDie has quit [Max SendQ exceeded]
NeverDie has joined #crystal-lang
unshadow_ has quit [Quit: leaving]
NeverDie has quit [Client Quit]
<jhass> >> class Foo; getter bar; end;
<DeBot> jhass: # => nil - http://carc.in/#/r/6ve
<jhass> note it's a macro
NeverDie has joined #crystal-lang
<jhass> so you can't call it from the runtime
<txdv> and i got a core dump
<jhass> perhaps a stack overflow?
<txdv> this freaks out
<jhass> yes, that's a stack overflow
<jhass> it's a macro, so you have to access the macro parameter with {{name}}
<jhass> this version calls the method name which generates a method through the method_missing macro like def name; name; end;
<txdv> o i get it
<txdv> how do i create symbols from strings in crystal?
<jhass> you can't really (except in macros)
<jhass> the Symbol table is generated at compile time and embedded into the binary
ponga has quit [Quit: Connection closed for inactivity]
<txdv> why is {{name}} in the method_missing not a symbol but a string then?
<jhass> it's compile time, it makes no real difference
<jhass> unlike Ruby, Crystal doesn't use Symbols internally to represent stuff and even if it did, those Symbol's ids wouldn't match the ones ending up in your binary
<jhass> oh and I just realized, as you've seen you can't dynamically create symbols at runtime
<jhass> and the compiler is a crystal program and the macros are interpreted by it
<txdv> have you written anything with crystal?
<jhass> DeBot here is written in Crystal
<jhass> the backend of carc.in is written in Crystal
<jhass> and I toyed a bit with gobject introspection
<jhass> oh and I've written the 2048 sample ;)
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
NeverDie has joined #crystal-lang
havenwood has quit [Ping timeout: 255 seconds]
fowlduck has joined #crystal-lang
fowlduck has quit [Remote host closed the connection]
fowlduck has joined #crystal-lang
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
NeverDie has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/vqde5
<crystal-gh> crystal/master 65264b8 Ary Borenszweig: Codegen: don't store rescue block in exception handler
<crystal-gh> crystal/master 6cc0086 Ary Borenszweig: Codegen: execute ensure when raising inside rescue
fowlduck has quit [Remote host closed the connection]
<travis-ci> manastech/crystal#6cc0086 (master - Codegen: execute ensure when raising inside rescue): The build passed. https://travis-ci.org/manastech/crystal/builds/70429879
blue_deref has joined #crystal-lang
havenwood has joined #crystal-lang
luislavena has joined #crystal-lang
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
NeverDie has joined #crystal-lang
fowlduck has joined #crystal-lang
fowlduck has quit [Ping timeout: 246 seconds]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vqd2L
<crystal-gh> crystal/master e9e4126 Ary Borenszweig: Delete .deps.lock
fowlduck has joined #crystal-lang
<travis-ci> manastech/crystal#e9e4126 (master - Delete .deps.lock): The build passed. https://travis-ci.org/manastech/crystal/builds/70438741
havenwood has quit [Ping timeout: 246 seconds]
fowlduck has quit [Remote host closed the connection]
fowlduck has joined #crystal-lang
<crystal-gh> [crystal] jdjkelly opened pull request #963: Added link and button to HTML::Builder (master...new-tags) http://git.io/vqFm5
luislavena has quit []
havenwood has joined #crystal-lang
fowlduck has quit [Remote host closed the connection]
fowlduck has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/vqFgK
<crystal-gh> crystal/master 411c47c Joshua Kelly: Added link and button to HTML::Builder
<crystal-gh> crystal/master 52685a4 Ary Borenszweig: Merge pull request #963 from jdjkelly/new-tags...
BlaXpirit has quit [Quit: Konversation]
zodiak has quit [Read error: Connection reset by peer]
zodiak has joined #crystal-lang
asbradbury has quit [Ping timeout: 276 seconds]
asbradbury has joined #crystal-lang
<travis-ci> manastech/crystal#52685a4 (master - Merge pull request #963 from jdjkelly/new-tags
NeverDie has quit [Quit: Textual IRC Client: www.textualapp.com]
NeverDie has joined #crystal-lang
blue_deref has quit [Quit: bbn]