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
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ismaelga has quit [Remote host closed the connection]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
wanderer_ has quit [Quit: Page closed]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
havenwood has quit [Remote host closed the connection]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
havenwood has joined #crystal-lang
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
<crystal-gh> [crystal] asterite closed pull request #599: LibC::TimeVal#tv_sec is TimeT (master...fix_32bit_sleep) http://git.io/vJ3he
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
<travis-ci> manastech/crystal#2279 (master - 86d387c : Ary Borenszweig): The build is still failing.
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ismaelga has joined #crystal-lang
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
waterlink1 has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
waterlink has quit [Ping timeout: 276 seconds]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
vikaton has left #crystal-lang [#crystal-lang]
vikaton has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
<vikaton> "Crystal".join.reverse.split
<vikaton> >> "Crystal".join.reverse.split
<DeBot> vikaton: Error in line 3: undefined method 'join' for String
ponga has joined #crystal-lang
<vikaton> >> "Crystal".split.reverse.join
<DeBot> vikaton: "Crystal"
<vikaton> >> ["h","i"].reverse
<DeBot> vikaton: ["i", "h"]
<vikaton> >> ["h","i"].reverse.join
<DeBot> vikaton: "ih"
<vikaton> >> "hi".split
<DeBot> vikaton: ["hi"]
<vikaton> o
<vikaton> >> "hi".split("")
<DeBot> vikaton: ["h", "i"]
ponga has quit [Read error: No route to host]
<vikaton> >> "Crystal".split("").reverse.join
<DeBot> vikaton: "latsyrC"
ponga has joined #crystal-lang
<crystal-gh> [crystal] niftyn8 closed pull request #601: String#camelcase handles -es (master...camelcase-dashes) http://git.io/vJsOm
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
<fowl> cool
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
<vikaton> ping DerisiveLogic
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
<DerisiveLogic> vikaton: Sup.
<vikaton> pm brutha
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
<vikaton> >> i = 24; printf "%s", i
<DeBot> vikaton: 24nil
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
DerisiveLogic has quit [Remote host closed the connection]
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
<crystal-gh> [crystal] niftyn8 opened pull request #602: Init handles dashes in project names (master...init-with-dash) http://git.io/vJsQl
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
ponga has quit [Read error: No route to host]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
DerisiveLogic has joined #crystal-lang
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
willlll has quit [Quit: willlll]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
DerisiveLogic has quit [Remote host closed the connection]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
willlll has joined #crystal-lang
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
<fowl> this is ponga's play
<fowl> enter stage, exit stage, repeat
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
waterlink1 has quit [Ping timeout: 256 seconds]
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
vikaton has quit [Quit: Connection closed for inactivity]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Client Quit]
ponga has joined #crystal-lang
havenwood has quit [Remote host closed the connection]
Cidan has joined #crystal-lang
<Cidan> congrats on the release
<Cidan> language looks very interesting, eager to mess with it
JBat has joined #crystal-lang
HakanD___ has joined #crystal-lang
Ven has joined #crystal-lang
canhtak has joined #crystal-lang
jua_ has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
HakanD___ is now known as HakanD
Ven has joined #crystal-lang
Cidan is now known as zz_Cidan
BlaXpirit has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
ssvb has quit [Ping timeout: 256 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ssvb has joined #crystal-lang
canhtak has quit [Quit: canhtak]
c355E3B has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
Ven has joined #crystal-lang
leafybasil has joined #crystal-lang
<BlaXpirit> >> Hash.new([{1,2}])
<DeBot> BlaXpirit: in /usr/lib/crystal/hash.cr:39: undefined constant K
wanderer_ has joined #crystal-lang
<BlaXpirit> >> [{1,2}].to_h
<DeBot> BlaXpirit: {1 => 2}
_whitelogger has joined #crystal-lang
ismaelga has joined #crystal-lang
ponga has quit [Remote host closed the connection]
ismaelga has quit [Remote host closed the connection]
canhtak has joined #crystal-lang
ponga has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ponga has quit [Remote host closed the connection]
BlaXpirit_ has joined #crystal-lang
BlaXpirit has quit [Ping timeout: 240 seconds]
vikaton has joined #crystal-lang
c355E3B has quit [Quit: Connection closed for inactivity]
<wanderer_> jhass: crystal creates another compiler object when expanding macros, but it doesn't seem to forward e.g. linker flags which it should afaik
canhtak has quit [Quit: canhtak]
<wanderer_> I'm atm having troubles getting the compilation working because of the wrong flags and at first it seemed like my flags simply got overwritten until I realized that a new compiler object is created for the macros that don't get my flags..
<jhass> might be, I never even glanced at the responsible code
<jhass> though you're talking about macros that invoke a new compiler right, like run?
ponga has joined #crystal-lang
<wanderer_> yes
<wanderer_> the compiler always failed because of wrong invocation of gcc and I was like "why isn't gcc called with my flags?"
<wanderer_> I don't even know what is being compiled there
<wanderer_> now it's failing with "undefined refere nce to `WinMain@16'"
<jhass> it's the run macro command
<wanderer_> oh, ofc it's failing, it's invoking gcc with no input
<jhass> you're running the specs right?
r0ast has joined #crystal-lang
<wanderer_> no, I'm trying to compile the compiler with the newly compiled compiler lol
<jhass> mh
<wanderer_> when I'm trying to compile a new compiler with a freshly compiled one, it's trying to compile ecr/process.cr before that
<jhass> not sure why it would call the run macro there
<jhass> ah probably to embed the templates for crystal init
<wanderer_> Error: execution of command failed with code: 1: `gcc -o .crystal\Users\blubb\Documents\crystal-head\src\ecr\process.cr\main.o -levent -lws2_32 -lpcl -lp cre -lgc -lpthread -lws2_32`
<wanderer_> `gcc -o .crystal\Users\blubb\Documents\crystal-head\src\ecr\process.cr\main.o` somethings wrong there
<wanderer_> an argument for -o is missing, isn't it?
<jhass> mh yeah, did you mock Tempfile?
<wanderer_> ah
<wanderer_> yes, I've modified it, haven't tested it yet
<wanderer_> mkstemp is a POSIX function
<jhass> I bet it returns nil or an empty string
<wanderer_> yes, path is empty...
<wanderer_> I've called tmpfile instead :s
howtoslaydragons has joined #crystal-lang
howtoslaydragons has quit [Remote host closed the connection]
howtoslaydragons has joined #crystal-lang
<vikaton> how long does it take to download Crystal on Red hat systems :/
<jhass> 20secs to two days depending on your internet connection
<vikaton> the installation kinda stops at 194 recieved
<wanderer_> jhass: thx, gonna change the tempfile code and see if it works
<vikaton> jhass, its been like this for about 5 mins now, no chnage http://i.imgur.com/lx2nHb6.png
<jhass> aha
<vikaton> ?
<jhass> I don't use rhel if you didn't notice yet
<BlaXpirit_> lol wut
<vikaton> :(
<BlaXpirit_> > running a script downloaded from a sketchy source through insecure channel, on the fly, giving it full access to your computer
<jhass> oh that guy doesn't mind
<jhass> runs unrestricted eval bots as root
<vikaton> u guys r bullies ;-;
<jhass> yes, until you start taking your own systems security even vaguely serious
<BlaXpirit_> also
<BlaXpirit_> > using RHEL
<jhass> it's stable!
<vikaton> this box isnt mine
<jhass> *cough*
<vikaton> I use Debian
<vikaton> but this particular one isnt mine
<jhass> that makes it only worse that you blindly execute stuff as root without understanding what it's doing
<vikaton> well, It isnt mine, and its a 300mb RAM box, :(
<jhass> you keep saying that, it doesn't defeat any of our points
<vikaton> well theres no point to argue
<jhass> you're right, there's none. One simply doesn't do that
<vikaton> thats what im doing BlaXpirit_
<vikaton> but isnt doing anything about 2 seconds into configuring yum
r0ast has quit [Remote host closed the connection]
howtoslaydragons has quit [Ping timeout: 255 seconds]
canhtak has joined #crystal-lang
jeromegn has joined #crystal-lang
HakanD has quit [Quit: Be back later ...]
canhtak has quit [Quit: canhtak]
r0ast has joined #crystal-lang
howtoslaydragons has joined #crystal-lang
havenwood has joined #crystal-lang
r0ast has quit [Read error: Connection reset by peer]
howtoslaydragons has quit [Remote host closed the connection]
HakanD has joined #crystal-lang
jua_ has quit [Ping timeout: 264 seconds]
HakanD_ has joined #crystal-lang
HakanD has quit [Ping timeout: 276 seconds]
zz_Cidan is now known as Cidan
jtarchie has quit [Quit: Connection closed for inactivity]
HakanD_ has quit [Quit: Be back later ...]
waterlink has joined #crystal-lang
<jeromegn> Is it possible to specify which type “self” will be within a Proc? I’ve basically stumbled on https://github.com/manastech/crystal/issues/123
<BlaXpirit_> how to get a C array? a pointer to a contiguous block of memory?
<BlaXpirit_> oh it might be just to_unsafe
<BlaXpirit_> :)
<jhass> jeromegn: no, sadly impossible atm
<jhass> BlaXpirit_: Pointer supports arithmetic and there's Slice as a wrapper with bound checking
<jeromegn> jhass: the “atm” gives me hope! I was fiddling with building a Rails-like framework. Trying to navigate around the fact that there’s not much of meta-programming possible with Crystal (that’s ok and expected)
<jeromegn> caching and passing procs, yielding with instances, but that doesn’t seem to work quite right yet
Ven_ has joined #crystal-lang
<jhass> jeromegn: yeah, you need to shift paradigms from runtime modification to compile time code generation with macros
<jhass> that takes a bit
<jeromegn> it’s fun stuff though
<jeromegn> been dreaming of a compiled Ruby-like language
<fowl> wanderer_: upload a binary if you can, the last link to our gave me was broken
colorados2 has joined #crystal-lang
<BlaXpirit_> uhh
<colorados2> i tried compile crystal and got error http://pastie.org/10123844
<BlaXpirit_> colorados2, so did u run out of ram?
<colorados2> i dont know
<colorados2> max use was 64%
<BlaXpirit_> "can't send closure to C function" - but I gotta send a closure, to bind this to an instance method. anyway... the C code can store and pass me a Void*, - so... can I pass a lambda through Void* or something
<fowl> Maybe. Maybe not. Depends on what c does with the pointer it receives
<fowl> What the c lib does
c355E3B has joined #crystal-lang
<BlaXpirit_> I also thought about passing pointerof(self) but that doesn't work of course..
<wanderer_> jhass: so tempfile was the error at first, but now the macros themselves seem to be not working.. kinda messy, if I only knew more about those macros and ecr ~,~
willlll has quit [Quit: willlll]
<wanderer_> do you know where args come from?
<jhass> BlaXpirit_: you can call .pointer on a captured block to get a function pointer and .closure_data to get the closure data, if the function is called with that data it'll work
<BlaXpirit_> jhass, awesome!!!
<BlaXpirit_> can I pass that data through Void*?
<jhass> BlaXpirit_: however I had some issues with the GC apparently deleting the closure_data when I lost references to it and only the external lib had them
<jhass> yeah
<BlaXpirit_> jhass, well maybe you gotta keep it inside the instance
<BlaXpirit_> oh and I will need to pass 2 of these in one Void* :S
<BlaXpirit_> i don't get it
<jhass> BlaXpirit_: it's a bit tricky yeah
<BlaXpirit_> I don't see how to pass an arbitrary object through Void*
<BlaXpirit_> arbitrary object in this case being tuple of 2 lambdas
<jhass> you could cast it (Void* can be casted to any other pointer type)
<jhass> but Box makes that a bit easier
<BlaXpirit_> nice, how?
<BlaXpirit_> box, eh
<wanderer_> jhass: hm.. process.cr is compiled and then executed like this: process.exe "C:UsersBlubbDocumentscrystal-headsrccompilercrystal\tools/init/template/example_spec.cr.ecr" "__io__", obviously there are \ missing
<jhass> BlaXpirit_: like in my last link, Box.new(tuple); tuple = Box({String -> Bool, Int32 -> Symbol}).unbox data
<fowl> Ty wanderer_ I'll try it shortly
willlll has joined #crystal-lang
willlll has quit [Client Quit]
<wanderer_> jhass: yes, I'm atm looking through it. is __DIR__ faulty or what is causing the missing \ ? can I somehow deactivate this.. I don't even know what it's doing :s
willlll has joined #crystal-lang
willlll has quit [Client Quit]
<jhass> common, let your brain do some pattern matching!
<jhass> \tools/init/template/example_spec.cr.ecr
<jhass> TEMPLATE_DIR = "#{__DIR__}/init/template"
<jhass> template SpecExampleView, "example_spec.cr.ecr", "spec/#{config.name}_spec.cr"
<jhass> oh, lol, nvm me :D
<jhass> then __DIR__ is faulty, yeah
<jhass> probably some escaping issue since \ is also escape char
<fowl> You can use / on windows as long as you don't mix it with \
<wanderer_> yes, but that's not the problem
<wanderer_> the separators are missing at all
<wanderer_> in the first part of the path
<jhass> are they there in a simple p __DIR__ program?
<wanderer_> TEMPLATE_DIR is "C:\Users\Blubb\Documents\crystal-head\src\co mpiler\crystal\tools/init/template"
<wanderer_> so it's still correct there
<jhass> uh
<jhass> and then "{{TEMPLATE_DIR.id}} inserts that as is in the macro
<jhass> so you have
<wanderer_> just stumbled over it, too
<jhass> >> puts "C:\Users\Blubb\Documents\crystal-head\src\co mpiler\crystal\tools/init/template"
<DeBot> jhass: C:UsersBlubbDocumentscrystal-headsrcco mpilercrystalools/init/template
<wanderer_> huh?
<fowl> O.o
<wanderer_> ahh
<vikaton> lol
<fowl> So you need {{template_Dir}} maybe
<wanderer_> it gets "transformed" to a string literal
<wanderer_> and in a string literal \ must be \\
<jhass> File.join {{{TEMPLATE_DIR}}, {{template_path}} I guess
shama has joined #crystal-lang
<wanderer_> no, wait..
<wanderer_> I'm confused :D
<jhass> macros build a string essentially which is then parsed by the compiler
<wanderer_> so the string itself is correct, but it is inserted as it is and gets parsed again?
<jhass> {{"foo".id}} inserts foo, {{"foo"}} inserts the AST node unmodified, so "foo"
<jhass> yeah
<wanderer_> but would it produce a faulty string in both cases?
<jhass> that allows you to do stuff like def foo_{{bar.id}
<jhass> }
<jhass> I'm not sure but I think .id makes it faulty
<wanderer_> I'll try
<jhass> the source string should be "foo\\bar", so {{foo.id}} inserts foo\bar while {{foo}} inserts "foo\\bar", I think
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<wanderer_> but doesn't __DIR__ return just "C:\bla\blubb"?
<wanderer_> so if this is reinterpreted as a string literal, the \ are always faulty
<jhass> no, it should return "C:\\bla\\blubb"
<jhass> try p __DIR__
<jhass> (not puts __DIR__)
<wanderer_> ecr_file File.join {{TEMPLATE_DIR}}, {{template_path}} ?
<jhass> yeah
<jhass> maybe add parens to join so it's easier to read
<wanderer_> gives me "undefined macro method TypeNode#new'"
<BlaXpirit_> jhass, so I ended up with something like this. "->(i, data) { Box({(-> Int32), (Int32 -> SF::Vector2f)}).unbox(data)[1].call(i) }" but it seems like the C library receives only the first component of Vector2f, and the Y is 0
<BlaXpirit_> yeah, that's exactly what happens :o
<BlaXpirit_> must be a bug
<vikaton> lol
<wanderer_> wtf, when I exchange / for #{File::SEPARATOR} in the string constants I get "unexpected token: C"
<jhass> doesn't it dump the generated macro on that one?
<wanderer_> there are no exceptions yet, so I only get that single line on a raise
willlll has joined #crystal-lang
<jhass> oh, wait
<wanderer_> when I try to use #{File::SEPARATOR} in TEMPLATE_DIR or in `ecr_file "{{TEMPLATE_DIR.id}}/{{template_path.id}}"` I get errors
<jhass> ecr_file is a macro call
<jhass> method calls in that won't work
<jhass> mmh
<wanderer_> can't I use #{File::SEPARATOR} or #{File::SEPARATOR_STRING} with them?
<jhass> I guess we need a macro level File.join...
<jhass> mmmh
<wanderer_> I tried `TEMPLATE_DIR = "#{__DIR__}\\init\\template"`
<wanderer_> and `ecr_file "{{TEMPLATE_DIR.id}}\\{{template_path.id}}".tr("\\", "\\\\")`
<jhass> that's still a method call
<jhass> "#{{{TEMPLATE_PATH}}}#{File::SEPARATOR}#{{{template_path}}}"
<jhass> I think...
ssvb has quit [Ping timeout: 245 seconds]
willlll has quit [Quit: willlll]
<wanderer_> gives me `undefined macro method TypeNode#new'` again :s
<wanderer_> can I somehow make two out of those \?
<jhass> can you paste the full error output?
<wanderer_> these is none ^^;
<wanderer_> no exceptions, no backtrace, no unwinding
<jhass> ah, I actually get decent error output here when I try that approach
<jhass> {{ run("ecr/process", ((((::String::Builder.new(99)) << "/home/jhass/projects/crystal/src/compiler/crystal/tools/init/template") << File::SEPARATOR) << example_spec.cr.ecr).to_s, "__io__") }}
willlll has joined #crystal-lang
<jhass> ecr_file {{ [TEMPLATE_DIR, template_path].join(File::SEPARATOR_STRING) }} ?
<jhass> (that doesn't feel right...)
<jhass> wanderer_: ^
leafybas_ has joined #crystal-lang
leafybasil has quit [Ping timeout: 265 seconds]
leafybas_ has quit [Ping timeout: 256 seconds]
BlaXpirit-UA has joined #crystal-lang
BlaXpirit_ has quit [Ping timeout: 272 seconds]
Cidan is now known as zz_Cidan
BlaXpirit-UA has quit [Read error: Connection reset by peer]
leafybasil has joined #crystal-lang
BlaXpirit-UA has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
<wanderer_> jhass: sry, gonna try it out now
<wanderer_> do you think it'd also deal with the single \ ?
<jhass> maybe
<jhass> looks good if I try inserting a \ in some involved string here
BlaXpirit-UA has quit [Ping timeout: 272 seconds]
BlaXpirit-UA has joined #crystal-lang
ponga has quit [Quit: Leaving...]
willlll has quit [Quit: willlll]
willlll has joined #crystal-lang
zipR4ND has joined #crystal-lang
BlaXpirit-UA has quit [Ping timeout: 245 seconds]
BlaXpirit-UA has joined #crystal-lang
BlaXpirit has joined #crystal-lang
BlaXpirit-UA has quit [Ping timeout: 256 seconds]
<fowl> wanderer_, i get the delimiter start error
<fowl> what git state is this im trying it from the windows branch
BlaXpirit has quit [Ping timeout: 256 seconds]
DerisiveLogic has joined #crystal-lang
BlaXpirit has joined #crystal-lang
BlaXpirit has quit [Ping timeout: 256 seconds]
<crystal-gh> [crystal] waj pushed 1 new commit to master: http://git.io/vJWvG
<crystal-gh> crystal/master c82b8f5 Juan Wajnerman: Improve performance of Regex execution using pcre_study (#604)
HakanD_ has joined #crystal-lang
<fowl> wanderer_, do you have a fork or no?
<wanderer_> fowl: I'll create one if I'm done with this macro error
<wanderer_> jhass: seems to be working, thx
<fowl> ok
<travis-ci> manastech/crystal#2281 (master - c82b8f5 : Juan Wajnerman): The build is still failing.
aemadrid has joined #crystal-lang
ssvb has joined #crystal-lang
<aemadrid> say I have a constant with color names, how can I build methods dynamically off of that list?
<wanderer_> jhass: now it's failing at `process.exe "C:\\Users\\Blubb\\Documents\\crystal-head\\src\\compiler\\crystal\\tools\\doc/html/main.html" "__io__"`
<wanderer_> it seems to be stuck
<jhass> aemadrid: it only works if you pass the literal to a macro directly for now
<aemadrid> jhass: ic, thx
<jhass> aemadrid: in a macro you then can {% for x in things %}
<jhass> aemadrid: an alternative is to use an enum, that has some macro methods to iterate iirc
<jhass> mh, can't find them anymore though
blaix has joined #crystal-lang
asterite has joined #crystal-lang
<vikaton> wanderer_, fowl, are you guys building the windows version for Crystal?
<asterite> aemadrid: you can use {% for color in COLORS %} ... {{color}} {% end %}
<vikaton> asterite, is there a way to get the visitors IP using Frank?
<asterite> Frank was just a start, it's lacking everything
<asterite> for example it can't match things if there's a query string
<jhass> asterite: would be nice to be able to parameterize it though
<asterite> jhass: how?
<fowl> {% for color in colors %}
<jhass> FOO = {1, 2, 3}; macro do_with(things) {% for x in things %} ... {% end %} end; do_with FOO
<asterite> Ah, yes, I think that doesn't work. Would need a way to solve that constant
<asterite> maybe eval(things), I don't know
<vikaton> why are there for loops in macros but not in crystal itself?
<willlll> I haven’t been able to figure out what the +nn mean in lldb, for example:
<willlll> * frame #4: 0x00000001006fddae sizeof_spec`*Crystal::Exception@Exception#initialize<Crystal::TypeException, String>:Array(String) + 46
<willlll> +46
<asterite> because the macro language is a different language, although it looks very similar. And `for` shows that
<wanderer_> asterite: hi, small question, what does it actually mean that crystal is now using non-blocking io?
<asterite> `for` also is a uniform way to iterate array and hash literals, but you can't iterate other things, it's pretty limited
<wanderer_> what do the fcntl-calls bring?
<vikaton> thanks
<asterite> when you read from a socket, if there's no data, instead of blocking the current thread the current fiber is suspended and a scheduler decides to schedule another fiber, if there's any
<asterite> that's what it means
<asterite> so you can have many small tasks in the same thread... eventually we'll distribute the fibers in many threads, like in Go
willlll has quit [Quit: willlll]
willlll has joined #crystal-lang
<vikaton> asterite, installing crystal using red hat os doesnt seem to work :[
<wanderer_> but it's applied to every descriptor, not just sockets
<asterite> Yes, but files apparently never block
<asterite> Gotta go now...
asterite has quit [Quit: Page closed]
<wanderer_> wut
<wanderer_> so the only thing that is non blocking are sockets?
<wanderer_> then why is it non blocking IO instead of non blocking sockets?
<vikaton> does anyone know the new method return type syntax?
<vikaton> nvm found it
BlaXpirit has joined #crystal-lang
<jhass> wanderer_: files can block, it's just less likely that they do
<wanderer_> jhass: but what does the current crystal version different when a file would actually block?
<jhass> what asterite wrote
<wanderer_> yes, I know the difference between a blocking recv and a non blocking one, but in crystal you wouldn't use recv, but the stdlib
<wanderer_> so the stdlib simply returns without blocking? what would it return?
<wanderer_> how does the behaviour differ in total?
<jhass> no, from the callers perspective it'll seem blocking
<jhass> that blocking just won't hold the program from doing something else in that time, without requiring threads
<wanderer_> ah
<jhass> if you have only one fiber running you have no benefit
<wanderer_> ah, ok
<jhass> but say you deliver a file in response to a http request
<jhass> you can handle another request while waiting for the file to be read
<jhass> without using threads
<wanderer_> does it matter with files?
<jhass> I think I just gave a case where it can matter
<wanderer_> when do files block?
<jhass> when the OS needs to read them from disk
<jhass> into memory
<jhass> or think things like network memory
<jhass> er, network filesystems I wanted to write
<wanderer_> "EAGAIN The file descriptor fd refers to a file other than a socket and has been marked nonblocking (O_NONBLOCK), and the read would block."
<wanderer_> hm, ok
<wanderer_> non-blocking sockets on windows can be used the same way as they are on linux
willlll has quit [Quit: willlll]
<wanderer_> non-blocking files, however, have a pretty different api
willlll has joined #crystal-lang
leafybasil has joined #crystal-lang
<wanderer_> jhass: ehm, how would you port such a macro to crystal:
<wanderer_> #define _IOR(x,y,t) (IOC_OUT|(((__LONG32)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
<jhass> uh
<jhass> mh, do we have sizeof?
<jhass> >> LibC::TimeVal
<DeBot> jhass: LibC::TimeVal
<jhass> >> sizeof(LibC::TimeVal)
<DeBot> jhass: 8
<jhass> \o/
<jhass> (sizeof(t).to_i32 & LibC::IOCPARM_MASK) << 16 | (x << 8) | y I think
<vikaton> >> sizeof("hi")
<DeBot> vikaton: Syntax error in eval:3: expecting token 'CONST', not 'DELIMITER_START'
<vikaton> >> sizeof(String)
<DeBot> vikaton: 4
<jhass> oh, missed the LibC::IOC_OUT | in front
<vikaton> How can I detect OS architecture?
<jhass> >> ifdef x86; puts "32bit"; else; puts "64bit"; end;
<DeBot> jhass: 64bit
<jhass> hrm
<jhass> >> ifdef x86_64; puts "64bit"; else; puts "32bit"; end;
<DeBot> jhass: 32bit
<BlaXpirit> uhh
<jhass> >> ifdef i686; puts "32bit"; else; puts "64bit"; end;
<DeBot> jhass: 32bit
<vikaton> is ifdef from C ?
<BlaXpirit> ok that seems right :>
<wanderer_> >> `uname -s`
<DeBot> wanderer_: "Linux\n"
<jhass> it takes them straight from uname, yeah
<wanderer_> >> `uname -m -s`
<DeBot> wanderer_: "Linux i686\n"
<jhass> let's just pretend nobody runs i486 or i586 anymore and we're good :P
JBat has quit [Quit: Computer has gone to sleep.]
<wanderer_> the stdlib checks for x86 and x86_64
<vikaton> is idef also a preprocessor ?
<wanderer_> i686 would cause problems :o
HakanD_ has quit [Quit: Be back later ...]
<vikaton> ifdef*
<vikaton> wanderer_: on a scale from 0-100, how close are u to finishing windows version? 100 being ready to use
<wanderer_> vikaton: 2000
<wanderer_> - 1997
<wanderer_> got the basics working, but only with mingw-w64
<vikaton> thats good
<wanderer_> I finally got rid of the ECR errors
<wanderer_> so I guess I'll now create a fork
<vikaton> though, can someone tell me if ifdef is a preproccessor from C in this casE?
<wanderer_> preprocessor from C?
<wanderer_> you can pass flags to crystal and check them with ifdef
<wanderer_> not matching parts are skipped
<vikaton> well a quick google search of ifdef came up C preprocessor
<wanderer_> #ifdef
<vikaton> and ruby doesnt have ifdef, so thats why I asked
<wanderer_> well, it's kinda a feature borrowed from C
<vikaton> yeah
<wanderer_> flags are determined either with `uname -m -s` or when using --cross-compile
<wanderer_> so when you do `--cross-compile "windows x86"` every `ifdef windows` and `ifdef x86` is compiled
<vikaton> cool
<vikaton> thanks
<jhass> they're similar to macros, as that the condition gets evaluated at compile time, the conditions you can use are very limited and the surrounded code isn't even parse if the condition isn't matched
<jhass> whether you want to caller them preprocessor statements is debatable, since they're built into the compiler and I think even into the same parser
<jhass> s/caller/call/
<fowl> Is ifdef the only way to do that
<jhass> add platform specific code? yes
<fowl> Ifdef a || b looks odd surely it should be if defined(a)||defined(b)
<wanderer_> well, you can do it in regular code, too
<wanderer_> but that will go into your executable
<jhass> not everything, some code generates underyling code that won't link on all platforms
<wanderer_> yes, obviously
<fowl> wanderer_: are you still working on bringing the windows branch up to date
<wanderer_> doing it at runtime makes only sense on rare occasions
<wanderer_> however, you don't actually need more than ifdef, an additional `defined` is redundant, is the "preprocessor" only has this one feature
<wanderer_> *as
<fowl> Right but you might want to do more like #if sizeof(pointer) < 8
<fowl> C++ calls this a const expression
<jhass> I actually like that you're forced to use type aliases in crystal for that
<wanderer_> you could probably do a normal `if sizeof(UInt32) == 4`, as it's a constant if, it should get optimized away if it's not truthy
<wanderer_> I cloned master one week ago and got it working with mingw-w64 now, just the basic stuff like compiling the compiler
<jhass> compiling the compiler is quite a milestone I'd say ;)
<wanderer_> jhass: two more things, any idea about porting the above macro? :P also where would you pass the link flags used for the main compilation to the macro expander?
<jhass> scroll up, I think I already made my guess :)
<jhass> and no idea about the second one
<jhass> I guess it'd need some global state in the compiler
<wanderer_> sry, didn't see it
<wanderer_> the macro expander is created in class program
<wanderer_> program is instantiated in class compiler
<wanderer_> hm, I could pass the flags to program that passes it over to the macro expander
<wanderer_> ugly though
<wanderer_> but imagine you have to pass -Lmylibs to the linker without it the file can't be linked
<wanderer_> now how would the macro expander be able to link process.cr?
<jhass> yeah, I guess having some global "default" link flags would make sense
<vikaton> >> def add(x,y);
<DeBot> vikaton: Syntax error in eval:7: expecting identifier 'end', not 'EOF'
<vikaton> would it be a good idea to write bastract methods like so?
<vikaton> abstract*
<jhass> looks harder to parse/easier to mistype
<vikaton> I'll suggest, see how the devs react
<wanderer_> ENV["linker_flags"] could be used, afaik you often use such variables on linux, as you also don't necessarily invoke the executable themselves but via shell scripts, not so common on windows, though
<wanderer_> what's wrong with `abstract def add(x, y)`? it's more obvious
<vikaton> o
<vikaton> I always see metthods like
<vikaton> 'def add(x,y);end;
<jhass> wanderer_: yeah, I've been thinking, maybe just apply the classic 3 step, default overridden by ENV_VAR overridden by commandline argument
<jhass> and then the parent compiler could just set the var to whatever he concluded
<wanderer_> should probably invoked with a script on windows, too
<vikaton> >> abstract def add(x,y)
<DeBot> vikaton: nil
<vikaton> oh wow
<vikaton> nevermind then
<vikaton> thanks wanderer_ lol
colorados2 has quit [Ping timeout: 272 seconds]
<wanderer_> jhass: wut, the exe I get with regular build is smaller than the one I get via "--cross-compile"
<jhass> huh, mabye the optimizer is less aggressive? *shrug*
<wanderer_> sry, I'm getting a bit.. I was passing -static when linking it myself
<wanderer_> for -lstdc++
<wanderer_> hmm, by the way
<wanderer_> @[link("bla")] emits -lbla
<wanderer_> so something like `-Wl,-Bstatic -lbla -Wl,-Bdynamic` can't be passed that way, can it?
<jhass> I don't think so
<jhass> and we probably should have @[Link("bla")] @[Static] or so for it anyway
<wanderer_> @[Link("bla", static)]
<jhass> yeah, maybe
<wanderer_> ye, you're right :P
aemadrid has quit [Quit: Connection closed for inactivity]
BlaXpirit has quit [Ping timeout: 252 seconds]
BlaXpirit_ has joined #crystal-lang
willlll has quit [Quit: willlll]
willlll has joined #crystal-lang
blaix has quit [Quit: Leaving.]
Ven_ has joined #crystal-lang
c355E3B has quit [Quit: Connection closed for inactivity]
willlll has quit [Quit: willlll]
willlll has joined #crystal-lang
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<wanderer_> jhass: `(sizeof(t).to_i32 & LibC::IOCPARM_MASK) << 16 | (x << 8) | y` as macro? like `macro IOR; return (sizeof(t).to_i32 & LibC::IOCPARM_MASK) << 16 | (x << 8) | y; end;`? I haven't digged into macros yet
<jhass> should work as method
<jhass> and don't worry about the call, it'll be optimized away
<wanderer_> hm, however, I want to define some constants in LibC with it
<jhass> oh, mh
<jhass> with changing x, y & t?
<jhass> most likely
<jhass> mh, then indeed macro I guess, though I never tried if they work in libs
<jhass> >> lib Foo; macro bar(x); {{x}} << 4; end; X = bar(4); end; Foo::X
<DeBot> jhass: Syntax error in eval:3: unexpected token: macro
<jhass> of course
<jhass> >> macro bar(x); {{x}} << 4; end; lib Foo; X = bar(4); end; Foo::X
<DeBot> jhass: 64
<jhass> \o/
<jhass> so it counts into the top level namespace, which is not so nice, but better than nothing
<wanderer_> k, thx
<wanderer_> >> IOCPARM_MASK = 0x7f; macro ior(x, y, t); (sizeof(t).to_i32 & IOCPARM_MASK) << 16 | (x << 8) | y; end; lol = ior('f'.ord, 127, UInt32)
<DeBot> wanderer_: Syntax error in expanded macro: ior:1: expecting token 'CONST', not 't'
<wanderer_> >> IOCPARM_MASK = 0x7f; macro ior(x, y, t); (sizeof({{t}}).to_i32 & IOCPARM_MASK) << 16 | ({{x}} << 8) | {{y}}; end; lol = ior('f'.ord, 127, UInt32)
<DeBot> wanderer_: 288383
<wanderer_> >> IOCPARM_MASK = 0x7f; macro ior(x, y, t); (sizeof({{t}}).to_i32 & IOCPARM_MASK) << 16 | ({{x}} << 8) | {{y}}; end; lol = ior('f'.ord, 127, UInt32).to_s(16)
<DeBot> wanderer_: "4667F"
<jhass> wanderer_: you can actually define the mask constant inside
<jhass> since it's essentially a string replacement
<vikaton> holy crystal
<vikaton> Ive never seen it do stuff like this before o.o
havenwood has quit []
<vikaton> Question: how to specify port with Frank?
<vikaton> Frank wont run on red hart
<vikaton> hat
<vikaton> error code 127
<vikaton> and thanks jhass
<vikaton> whats cc ?
<wanderer_> unix c compiler
<wanderer_> ?
<vikaton> my box says cc: command not found
<wanderer_> try gcc
<wanderer_> or install build-essentials
<vikaton> ok
HakanD_ has joined #crystal-lang
HakanD_ has quit [Ping timeout: 244 seconds]
<crystal-gh> [crystal] will opened pull request #608: Allow Time.parse to return UTC times (master...utc-time-parse) http://git.io/vJlSU
waterlink1 has joined #crystal-lang
<vikaton> one hell of an error
waterlink has quit [Ping timeout: 276 seconds]
<wanderer_> use --single-module
<wanderer_> to make the error smaller :P
<vikaton> 0k
BlaXpirit-UA has joined #crystal-lang
BlaXpirit_ has quit [Ping timeout: 250 seconds]
<vikaton> Error: execution of command failed with code: 1: `cc -o /tmp/crystal-run-hello_world.vspeL2 .crystal//root/Frank/samples/hello_world.cr/main.o -lssl -lcrypto -levent -lrt -lpcl -lpcre -lgc -lpthread -lunwind`
<vikaton> :(
<fowl> --verbose ?
<vikaton> fowl, I think https://gist.github.com/Vikaton/7aeeb0d85ba6aa972641 is verbose enough
<fowl> i dont even see and error there
<fowl> because it isnt shown
<vikaton> fowl, updated it, at the bottom
<vikaton> Thats very weird