asterite changed the topic of #crystal-lang to: #crystal-lang The Crystal programming language | http://crystal-lang.org | Crystal 0.6.1 | 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
<Dreamer3_> --link-flags doens't seem to have any effect :(
<vikaton> anyone here want postgres driver with Crystal?
<Dreamer3_> i can't compile with the compiler i compile
<Dreamer3_> grrr
<Dreamer3_> Using compiled compiler at .build/crystal
<Dreamer3_> or maybe it's not meant to work from inside the same dir?
<Dreamer3_> that kind of makes sense but there should also be some easy way to test compiling with a just compiled compiler, no?
asterite has joined #crystal-lang
<asterite> Dreamer3_: you have to have LLVM on the path
<Dreamer3_> that's not the issue
<Dreamer3_> trying it again moving .build to .built and changing the makefile to use that
<vikaton> asterite: for the next release, will you be able to do this?: def foo(x,y): (Int32, Int32); return (x,y); end; ?
<Dreamer3_> makefile sets path to include llvm
<asterite> You mean, specify a tuple as a return type?
<vikaton> I guess yeah
<asterite> Yes, but the syntax is {Int32, Int32}
<vikaton> ah
<vikaton> cool
<vikaton> asterite: do you have a twitter? :P
<Dreamer3_> asterite: any other suggestions?
<Dreamer3_> the compile works the first time
<Dreamer3_> but i can't compile the compiler with my compiler version
<Dreamer3_> *compiled
<Dreamer3_> not sure what stage bc+obj is
<asterite> I have, it's asterite
<asterite> I go by asterite everywhere, nobody seems to like that character as much as I do :-P
<asterite> Dreamer3_: do you have any llvm-config binary in the shell you are doing that?
<asterite> doing llvm-config (or its versioned variants) should work for crystal to compile
HakanD_ has joined #crystal-lang
<Dreamer3_> i don't think that's it
<Dreamer3_> agian the first time it compiled just fine
<Dreamer3_> make
<vikaton> asterite: you should follow @shardscrystal so you can be up2date on new crystal projects xP
<Dreamer3_> it works
<asterite> I will!
<Dreamer3_> then i try to use the compiled one and it all falls apart (using same makefile, just changing the executable)
<asterite> Strange. Gotta go now, but the trace looks like it can't link against llvm for some reason
<Dreamer3_> maybe homebrew is doing somethin gweird
asterite has quit [Quit: Page closed]
<Dreamer3_> ok lets try this agian
HakanD_ has quit [Ping timeout: 248 seconds]
<Dreamer3_> ok now it works
<Dreamer3_> you might have been right
<Dreamer3_> but the makfile is so borked
<Dreamer3_> brew --prefix llvm36 is nothing
<Dreamer3_> my llvm is "llvm" no number
<Dreamer3_> and no idea why it compiled the FIRST time
<Dreamer3_> maybe it's compiling the path to LLVM in the compiler?
<Dreamer3_> why would it work the first time thru?
leafybasil has quit [Remote host closed the connection]
<Dreamer3_> OH
<Dreamer3_> beacuse homebrew hacks bin/crystal to hardwire the LLVM path that is knows is correct
<Dreamer3_> tisk tisk
<Dreamer3_> now, what should be done about all this
endou_________ has quit [Ping timeout: 256 seconds]
jtarchie has quit [Ping timeout: 256 seconds]
endou_________ has joined #crystal-lang
jtarchie has joined #crystal-lang
<crystal-gh> [crystal] yyyc514 opened pull request #582: version of llvm should not be hardcoded (master...master) http://git.io/vfypJ
<Dreamer3_> annoying
<vikaton> Dreamer3_: :D
<Dreamer3_> annoyingha
<Dreamer3_> great my app won't compile on the latest version
<Dreamer3_> ld: library not found for -lgc
<Dreamer3_> now what am i missing
<crystal-gh> [crystal] yyyc514 opened pull request #583: libevent and boehmgc seem to be required now (gh-pages...patch-1) http://git.io/vfSek
<Dreamer3_> ok
<Dreamer3_> i think with self yield is totally weird now
<Dreamer3_> it seems to do the opposite
<Dreamer3_> with blah yield doesn't seem useful unless you do it immediately as soon as the first method has the block
<Dreamer3_> seems you can't really pass blocks around
<Dreamer3_> at least not expecting any sane behavior
DerisiveLogic has joined #crystal-lang
DerisiveLogic has quit [Remote host closed the connection]
DerisiveLogic has joined #crystal-lang
<Dreamer3_> at least not expecting any sane behavior
<Dreamer3_> grrr
<Dreamer3_> sorry
havenn has joined #crystal-lang
sadin has joined #crystal-lang
havenwood has quit [Ping timeout: 256 seconds]
dhruv has joined #crystal-lang
Kache4 has joined #crystal-lang
dhruv has quit [Ping timeout: 244 seconds]
vikaton has quit [Quit: Connection closed for inactivity]
sadin has quit []
ponga has joined #crystal-lang
havenn has quit [Remote host closed the connection]
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
HakanD_ has joined #crystal-lang
HakanD__ has joined #crystal-lang
HakanD_ has quit [Ping timeout: 255 seconds]
Kache4 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
BlaXpirit has joined #crystal-lang
DerisiveLogic has quit [Ping timeout: 264 seconds]
HakanD__ has quit [Quit: Be back later ...]
HakanD__ has joined #crystal-lang
vikaton has joined #crystal-lang
ponga has quit [Remote host closed the connection]
ponga has joined #crystal-lang
BlaXpirit_ has joined #crystal-lang
BlaXpirit has quit [Ping timeout: 252 seconds]
ponga has quit [Ping timeout: 250 seconds]
HakanD__ has quit [Quit: Be back later ...]
HakanD__ has joined #crystal-lang
HakanD__ has quit [Ping timeout: 240 seconds]
HakanD__ has joined #crystal-lang
flan3002 has quit [Ping timeout: 264 seconds]
ponga has joined #crystal-lang
flan3002 has joined #crystal-lang
Dreamer3_ is now known as Dreamer3
<Dreamer3> what is the purpose of an abstract class?
<Dreamer3> trying to understand the variable scoping code in the compiler
<jhass> personally I still claim they're redundant to modules, the main reason for their addition was that it allowed for some huge speed optimizations in the type interference algorithm I heard
<Dreamer3> semantic/call.cr is not easy reading
<jhass> yeah, I didn't dig into the compiler code much yet
havenwood has joined #crystal-lang
asterite has joined #crystal-lang
<Dreamer3> is there any support for dynamic dispatch?
<jhass> if you mean what I think you mean with that, no
DerisiveLogic has joined #crystal-lang
<ponga> "if you mean what i think you mean" , English was never difficult
* ponga shakes his head
DerisiveLogic has quit [Ping timeout: 245 seconds]
ismaelga has joined #crystal-lang
<Dreamer3> i mean no way to turn resources :dogs into Dog class or "dogs#create" into Dogs.call(:create)
<jhass> not runtime, no
<jhass> it should be possible with a macro though
<Dreamer3> how can i specify the in/out requirements when using the short proc notation?
<jhass> I'm not sure what you mean
<jhass> you can't directly specify the return type of a proc literal
<jhass> you can give the compiler a good hint though by casting the return value
<jhass> though that's only a workaround for when the type interference fails
<Dreamer3> route "/test", -> (request : Moonshine::Request ) { Dogs.new.all(request) }
<Dreamer3> def route(regex, &block : Moonshine::Request -> Moonshine::Response)
<Dreamer3> trying to make that work
<Dreamer3> but for some reason it's not lining up
<Dreamer3> i'm guessing because the types don't match
<asterite> If it's &block, you just pass a block in the caller: route "test" { |request| Dogs.new.all(request) }
ponga has quit [Remote host closed the connection]
<asterite> but Dogs.new.all(request) must be Moonshine::Response
<asterite> Otherwise you can define it without the & and pass it as you are passing it now, with the arrow
<BlaXpirit_> asterite, can you help me with https://github.com/BlaXpirit/crsfml/issues/2#issuecomment-96573054 ?
<asterite> Shouldn't it always be crsfml and not csfml?
<Dreamer3> any docs on macros?
<BlaXpirit_> ok let's say I change everything to crsfml, what then>
<BlaXpirit_> maybe if I do actually change it, everything will fix itself
<Dreamer3> any docs on macros?
<asterite> BlaXpirit_: yes, I think so
<BlaXpirit_> doesn't appear so, asterite
<BlaXpirit_> now i have libs/crsfml/crsfml/graphics
dhruv has joined #crystal-lang
<Dreamer3> trying to figure out how to build a smart router without dynamic dispatch
<jhass> Dreamer3: http://paste.mrzyx.de/pes7lkva7 just a rough concept
<Dreamer3> that all works in latest?
<Dreamer3> i thought macros were maybe going away?
<jhass> huh, no?
<Dreamer3> but i can't run real code there right?
<Dreamer3> can't do :exclude => [:index]
<jhass> limited, see the json_mapping macro for example
<Dreamer3> yeave i have it local
<Dreamer3> what is the templating language?
<Dreamer3> looks just like crystal sometimes
<Dreamer3> and you're doing first, capitalize, split is_a?
<jhass> yeah
<jhass> it's interpreted at compile time though, all the magic is in https://github.com/manastech/crystal/blob/master/src/compiler/crystal/macros/methods.cr
bcardiff has joined #crystal-lang
<Dreamer3> ok so that's the documentation for now :)
<jhass> kinda :P
<jhass> as you can see it's quite easy to add new macro methods
<jhass> you find the right AST node you want to call it on and add a branch to the case when
<jhass> then recompile the compiler
HakanD__ has quit [Quit: Be back later ...]
<Dreamer3> ok ECR is neatish
bcardiff has quit [Quit: Leaving.]
DerisiveLogic has joined #crystal-lang
leex_ is now known as leex
bcardiff has joined #crystal-lang
<Dreamer3> do macros know anything about the current compile scope?
<jhass> uh, I don't know, we gotta ask asterite about that
<jhass> or maybe precise what you want to do first :)
<Dreamer3> class Dog; def index; render "blah"... generates def _render_dog_blah, etc
<asterite> >> macro foo; {{@type.stringify}}; end; class Foo; def bar; foo; end; end; Foo.new.bar
<DeBot> asterite: "Foo"
<asterite> They do
<Dreamer3> neat
<Dreamer3> jhass: grrrr you paste is gone
<Dreamer3> can you repaste and i'll save?
<Dreamer3> i'm spoiled by pasties being forever
<jhass> eh, right default time is 30 minutes :D
<Dreamer3> thought i could just save a link
<Dreamer3> got it
<jhass> as said, just meant as a rough idea/to show some concepts
<Dreamer3> right
<Dreamer3> i got it :)
asterite has quit [Ping timeout: 246 seconds]
JBat has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
<Dreamer3> jhass: did you have that laying around or wrote that just for me?
<jhass> I just wrote that up
<jhass> it's no big deal once you grasp macros ;)
bcardiff has joined #crystal-lang
shama has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
dhruv has quit [Ping timeout: 245 seconds]
Kache4 has joined #crystal-lang
DerisiveLogic has quit [Ping timeout: 240 seconds]
DerisiveLogic has joined #crystal-lang
DerisiveLogic has quit [Remote host closed the connection]
DerisiveLogic has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vf72j
<crystal-gh> crystal/master f826bdf Ary Borenszweig: Optimized Slice#to_a
ismaelga has quit [Remote host closed the connection]
<Dreamer3> &handler : Frank::Context -> _)
<Dreamer3> what is _ ?
<jhass> didn't know you can use that as type
<jhass> >> def foo(&block : String -> _); typeof(block); end; foo do |s| "f" end
<DeBot> jhass: Syntax error in eval:3: expecting identifier 'end', not 'do'
<jhass> >> def foo(&block : String -> _); typeof(block); end; foo {|s| "f"; }
<DeBot> jhass: (String -> String)
<jhass> >> def foo(&block : String -> _); typeof(block); end; foo {|s| 1; }
<DeBot> jhass: (String -> Int32)
<jhass> >> def foo(&block : String -> _); typeof(block); end; foo {|s| 1; }; foo {|s| "f"; }
<DeBot> jhass: (String -> String)
<jhass> >> def foo(&block : String -> _); typeof(_); end; foo {|s| 1; }
<DeBot> jhass: Syntax error in eval:3: unexpected token: UNDERSCORE
<jhass> apparently "accept whatever"
<jhass> >> def foo(&block : String ->); typeof(block); end; foo {|s| 1; }
<DeBot> jhass: (String -> Void)
<Dreamer3> interesting
<Dreamer3> i guess the return type really doesn't matter in the case where this is being used
<travis-ci> manastech/crystal#2262 (master - f826bdf : Ary Borenszweig): The build passed.
DerisiveLogic has quit [Ping timeout: 256 seconds]
DerisiveLogic has joined #crystal-lang
ismaelga has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
ismaelga has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
DerisiveLogic has quit [Ping timeout: 250 seconds]
zipR4ND has joined #crystal-lang
zipR4ND has quit [Ping timeout: 256 seconds]
HakanD__ has joined #crystal-lang
JBat has quit [Quit: Computer has gone to sleep.]
<BlaXpirit_> procrastination is nice
ssvb has joined #crystal-lang
zipR4ND has joined #crystal-lang
<vikaton> w0t
<vikaton> heh nice BlaXpirit_
Dreamer3 has quit [Quit: Computer has gone to sleep.]
DerisiveLogic has joined #crystal-lang
HakanD__ has quit [Quit: Be back later ...]
HakanD__ has joined #crystal-lang
HakanD__ has quit [Ping timeout: 250 seconds]
bcardiff has joined #crystal-lang
DerisiveLogic has quit [Ping timeout: 252 seconds]
bcardiff has quit [Quit: Leaving.]
BlaXpirit_ has quit [Quit: Quit Konversation]
fowl has joined #crystal-lang
ismaelga has joined #crystal-lang
leafybasil has joined #crystal-lang
waterlink has joined #crystal-lang
zipR4ND has quit [Ping timeout: 248 seconds]
bcardiff has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
ponga has joined #crystal-lang
ponga has quit [Remote host closed the connection]
bcardiff has quit [Quit: Leaving.]
<waterlink> Just got this: Could not raise Program terminated abnormally with error code: 1280. Any idea what that could mean?
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/vfd5o
<crystal-gh> crystal/master f29ed84 Ary Borenszweig: Added Pointer#clear
<crystal-gh> crystal/master 4bd4b07 Ary Borenszweig: Clear pointer values when doing Array#pop and other methods that shrink an array. Fixes #580