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
ismael has joined #crystal-lang
ismael is now known as Guest18223
ismaelga has quit [Ping timeout: 245 seconds]
<vikaton> jeromegn: so how do we go about this?
<jeromegn> no idea
<jeromegn> sorry, I’m deep down in the docs and in code :)
<vikaton> submitted issue
DerisiveLogic has quit [Remote host closed the connection]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/vJaK2
<crystal-gh> crystal/master 885b717 Ary Borenszweig: Improved location for "'else' is useless without rescue" clause
<crystal-gh> crystal/master c816cfa Ary Borenszweig: Fixed #610: If `rescue` doesn't fire, `else` section should know everything succeeded
<travis-ci> manastech/crystal#2290 (master - c816cfa : Ary Borenszweig): The build is still failing.
jeromegn has quit [Quit: jeromegn]
sfcgeorge has quit [Quit: Textual IRC Client: www.textualapp.com]
k2b6s9j has joined #crystal-lang
<k2b6s9j> anyone know how to track down a segfault in Crystal?
<jhass> k2b6s9j: gdb or valgrind helps to get at least a rough stacktrace and a reason
<k2b6s9j> jhass: so there's no way of doing it with lldb?
<jhass> lldb should just work as gdb
<k2b6s9j> perfect. I'll be back with my findings in a bit.
k2b6s9j has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass> emitting line numbers and file names is currently broken for LLVM 3.6, so the stacktrace is not always helpful
<jhass> sigh
k2b6s9j has joined #crystal-lang
willlll has quit [Quit: willlll]
willlll has joined #crystal-lang
willlll has quit [Client Quit]
k2b6s9j has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Guest18223 has quit [Ping timeout: 276 seconds]
ismaelga has joined #crystal-lang
vikaton has quit [Quit: Connection closed for inactivity]
willlll has joined #crystal-lang
willlll has quit [Client Quit]
k2b6s9j has joined #crystal-lang
k2b6s9j has quit [Quit: Textual IRC Client: www.textualapp.com]
aemadrid has quit [Quit: Connection closed for inactivity]
ismaelga has quit [Remote host closed the connection]
ponga has joined #crystal-lang
DerisiveLogic has joined #crystal-lang
willlll has joined #crystal-lang
willlll has quit [Quit: willlll]
willlll has joined #crystal-lang
willlll has quit [Client Quit]
havenwood has quit [Remote host closed the connection]
Ven has joined #crystal-lang
strcmp1 has quit [Ping timeout: 265 seconds]
BlaXpirit has joined #crystal-lang
Ven has quit [Disconnected by services]
Ven_ has joined #crystal-lang
DerisiveLogic has quit [Ping timeout: 256 seconds]
ponga has quit [Remote host closed the connection]
ponga has joined #crystal-lang
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
HakanD has joined #crystal-lang
HakanD_ has joined #crystal-lang
HakanD has quit [Ping timeout: 256 seconds]
HakanD_ has quit [Quit: Be back later ...]
leafybasil has quit [Read error: No route to host]
leafybasil has joined #crystal-lang
HakanD_ has joined #crystal-lang
Ven_ has joined #crystal-lang
<BlaXpirit> hey, HakanD_. are you doing anything with Crystal or just hanging around?
<HakanD_> hanging around, for now.
blaix has joined #crystal-lang
sfcgeorge has joined #crystal-lang
j0hnnyk has quit [Remote host closed the connection]
ponga has joined #crystal-lang
ponga has quit [Quit: Leaving...]
ponga has joined #crystal-lang
ponga has quit [Quit: Leaving...]
blaix has quit [Quit: Leaving.]
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
JBat has joined #crystal-lang
DerisiveLogic has joined #crystal-lang
DerisiveLogic has quit [Ping timeout: 276 seconds]
vikaton has joined #crystal-lang
ssvb has joined #crystal-lang
jeromegn has joined #crystal-lang
HakanD_ has quit [Quit: Be back later ...]
HakanD_ has joined #crystal-lang
ponga has joined #crystal-lang
ismaelga has joined #crystal-lang
strcmp1 has joined #crystal-lang
JBat has quit [Ping timeout: 265 seconds]
strcmp1 has quit [Quit: Leaving]
Ven has joined #crystal-lang
HakanD_ has quit [Quit: Be back later ...]
HakanD_ has joined #crystal-lang
HakanD_ has quit [Read error: Connection reset by peer]
HakanD_ has joined #crystal-lang
Ven has quit [Disconnected by services]
Ven_ has joined #crystal-lang
strcmp1 has joined #crystal-lang
kulelu88 has joined #crystal-lang
<kulelu88> what is this language comparable to? Go? C? Java?
<jhass> that's a tricky question
<jhass> the syntax is deeply inspired by Ruby
<jhass> 0.7 switched the concurrency & IO model _basically_ to Go's
<kulelu88> okay let me try rephrasing my questions. is this a static language that compiles?
<jhass> yes
<jhass> though you often don't have to specify the types, they're inferred
<kulelu88> inferred types? How does that work?
<jhass> >> x = 1; typeof(x)
<DeBot> jhass: Int32
<kulelu88> oh, it does checking for you at compile time?
<jhass> yes
<kulelu88> well that is a brilliant feature
<kulelu88> can crystal be classified as web-friendly?
<kulelu88> I've been looking for a static(ish) kind of language geared for the web
<jhass> the ecosystem is still way too young for such classifications, but a lot of people are toying with basic webframeworks
<jeromegn> it does have web stuff in its standard lib. like web sockets, oauth..
<kulelu88> so the language has optional type classification (it will check it by itself if you don't specify it) and it is still static and compiles?
<jhass> yes
<kulelu88> I'm liking what I read
DerisiveLogic has joined #crystal-lang
<kulelu88> only wish it was less ruby and more python
<kulelu88> but that's a cosmetic issue
<jhass> :( show more <3 for Ruby
<jhass> :P
<jeromegn> Nim is more python-esque
<kulelu88> Is the aim of the language to "get out of the way" and do more without fighting syntax?
<kulelu88> jeromegn: I thought so too, but Nim doesn't feel like python
<jhass> well, I doubt you'll find a language author who claims otherwise... ;)
<kulelu88> are you the author??? jhass
<kulelu88> *main*
<jhass> no, what I'm saying is that if the language achieves that point is highly subjective, thus I'm not sure it's a good goal
<jhass> it's rather an implicit goal of every language
<kulelu88> well as honest as we can state, most languages eventually forget that part along the way
<jhass> as a strong Rubyist I can say Crystal feels a lot like writing Ruby
<kulelu88> or it could just be me and my pseudo-codish python
<jeromegn> I would agree
<jeromegn> been loving it
<jhass> and well, I'm a strong Rubyist because I find Ruby very expressive ;)
<kulelu88> I see some Nim lurkers here :D
<kulelu88> well if you guys say it's very very similar to ruby, i suppose that would be easier to pick up than the other systems languages
<kulelu88> I initially thought this was "compiled from ruby"
<kulelu88> glad to see it's another language
<jeromegn> well, I miss the meta-programming features of Ruby
<jeromegn> but it’s possible to work around
<jhass> in Ruby we recently compared list comprehensions to equivalent Ruby constructs, one that came up: Python: [os.path.join(d[0], f) for d in os.walk(".") for f in d[2] if f.endswith(".rst")] Ruby: Dir["**/*.rst"]
<jhass> :P
<jhass> * in #ruby
<kulelu88> maybe you guys disagree, but python is the easiest language to understand even if you don't know how to code
<jhass> I think any dynamically typed language is equally good and easy to learn as your first one
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<strcmp1> python and ruby feel like the same language to me sometimes, as far as knowing one doesn't give you much reason to learn the other. python/ruby are easier to read and understand than most perl
<kulelu88> debatable, but not for this room :P
<kulelu88> you guys forget something called PHP =/
<strcmp1> PHP seems readable most of the time, but if i'm going for a dynamic scripting language id forget PHP and perl
<jeromegn> somebody needs to build a slim-like thing for cyrstal
<jeromegn> I miss it dearly
<jeromegn> and have started building one, but this is my first experience with lexers
shama has joined #crystal-lang
<BlaXpirit> for anyone wondering, Crystal is by far closer to Python than Nim
<jhass> PHP poisens your mind with weak typing and mixing map and list into the same datastructure
<jhass> I had PHP as my first language, unlearning that took time
<BlaXpirit> :(
<strcmp1> ha
<strcmp1> perl was mine
<BlaXpirit> pascal :I
<strcmp1> i somehow missed the PHP craze completely
<BlaXpirit> gawd how much time i wasted on php
<BlaXpirit> actually.. not that much
<jeromegn> javascript here :)
<strcmp1> i wasnt using computers at all when PHP become so popular, when i came back i took a brief look, then moved onto ruby/python, and settled on ruby.
<BlaXpirit> for what it's worth... i think javascript is worse than php
<BlaXpirit> big problem is people don't want to admit it's horrible
<strcmp1> i havent ran into any of its quirks yet, i like the functions-first approach
<jeromegn> I do like JS
<jeromegn> best used when not forcing OOP concepts on it
<jeromegn> sure
blaix has joined #crystal-lang
<BlaXpirit> i die of laughter every time
<jhass> my favorite PHP wtf: https://eval.in/108854
<BlaXpirit> `==` is basically undefined behavior
<jhass> ++ too
<jeromegn> I wonder when we can expect a stable Crystal release
<jeromegn> probably not in the short term eh
<BlaXpirit> so why exactly do you want it?
havenwood has joined #crystal-lang
<blaix> BlaXpirit: every time i glance at your name i think it's me
<blaix> because i'm dumb
<BlaXpirit> :|
leafybasil has quit [Remote host closed the connection]
<jeromegn> I want to use it :)
<jeromegn> I can’t fully trust it for now
leafybasil has joined #crystal-lang
willlll has joined #crystal-lang
<BlaXpirit> well i sure haven't witnessed breaking changes in short time
<BlaXpirit> but i dont mind them
<jeromegn> it’s mostly fine
<jeromegn> it’s too early to tell for me
<kulelu88> So BlaXpirit actually makes the point that crystal shares more with python than Nim
<kulelu88> are any of you doing crystalcasts yet?
<BlaXpirit> i wouldn't put it like that
<BlaXpirit> it's just much easier for a python programmer to use crystal because if some similarity with the dynamic techniques used there
<BlaXpirit> of*
<kulelu88> I don't get 1 thing though. if it was always possible to do compile-time type-checking, why do most modern static languages not do this?
<BlaXpirit> wut
<BlaXpirit> i don't know any such language
<kulelu88> BlaXpirit: refer to the point made by jhass above
<kulelu88> you don't need to declare types explicitly in crystal
<BlaXpirit> so?
<BlaXpirit> many would call this a disadvantage
<kulelu88> that's the part where you say "aha!"
<BlaXpirit> that's not "type checking"
<BlaXpirit> do you mean inferring
<kulelu88> BlaXpirit:
<kulelu88> >> x = 1; typeof(x)
<crystal-gh> [crystal] daneharrigan closed pull request #609: WIP: added expect syntax to spec (master...add-expect-to-specs) http://git.io/vJ4lw
<DeBot> kulelu88: Int32
<BlaXpirit> C++, Rust, Nim infer types
<BlaXpirit> oh type checking riight
<kulelu88> >> x = 1; typeof(x)
<DeBot> kulelu88: Int32
<kulelu88> ter we go :D
<BlaXpirit> this is still different
<BlaXpirit> type information maybe
<kulelu88> it seems like a modern language feature to me
<kulelu88> instead of the archaic way of declaring each type
<BlaXpirit> C++, Rust, Nim infer types
<BlaXpirit> Go maybe..?
<kulelu88> I'm glad I found Crystal. A language I look forward to learning about
<ytti> explain the difference in code
<vikaton> kulelu88: ur welcome :)
<ytti> of how rust infers type but crystal does not
<ytti> i don't understand
<BlaXpirit> of course crystal infers type
<vikaton> I like Crystal type's inderence the best
<vikaton> >> typeof(967537256759834+37462396475283547)
<DeBot> vikaton: Int64
<vikaton> automatic type conversion with literals
<BlaXpirit> this particular thing is extremely rarely useful
<vikaton> my website is written in Crystal now :p
<fowl> Xd
<fowl> That domain
<vikaton> heh
<fowl> I'm jelly :(
<vikaton> stacking.money is available if u want to be formal
<kulelu88> whoa, arabic
<BlaXpirit> it's just one page.. what part exactly is written in crystal?
<kulelu88> the static site generator? +D
<kulelu88> =D
<epitron> hey llvm-based language enthusiasts! take a gander at this little number: http://ponylang.org/
<BlaXpirit> dont need a weirder java :|
<vikaton> BlaXpirit: the view counter :D
<vikaton> and the updates page
<vikaton> when u type in 'uptime'
<kulelu88> you know, hello world really is a shit example to evaluate languages. if every language showed how to build a simple todo like app, java would probably not have survived either
<vikaton> uhhh
<vikaton> why would it survive on hello world either lol
<kulelu88> =D
<kulelu88> how much can you really learn about a language from this:
<kulelu88> actor Main
<kulelu88> new create(env: Env) =>
<kulelu88> env.out.print("Hello, world!")
<kulelu88> mehh
<vikaton> yuck
<kulelu88> i'm guessing env is the variable and env is the type
<kulelu88> I mean
<kulelu88> env = variable
<kulelu88> Env = type
<kulelu88> .
<vikaton> who names a language Pony..
<kulelu88> would've been more awesome as unicorn ehh
<kulelu88> or stallion
<kulelu88> or or or! Hidalgo!!!!
<epitron> kulelu88: you can read all the language features...
<epitron> there's a lot of CS in pony
<epitron> ha
<epitron> i thought you guys would be excited
<epitron> i guess you perceive it as a competitor
<vikaton> not rly
<vikaton> I just didnt like it
<epitron> did you see how madly parallel it is?
<Dreamer3> hey
<Dreamer3> can someone walk me thru the requirements for building from source so i can update the docs?
<Dreamer3> (on mac)
<Dreamer3> docs still say llvm 3.5.1 but i'm pretty sure that's not right
<epitron> tar zxvf cyrstal-0.7.1.tar.gz
<Dreamer3> latest recipe for homebrew is still llvm 351 too
<epitron> export PATH=that-crystal/wherever-the-binary/is-located:$PATH
<epitron> cd crystal-git-checkout
<epitron> make
<Dreamer3> but what about LLVM?
<epitron> you need to build llvm?
<Dreamer3> "You will also need LLVM 3.5 present in the path."
<epitron> i haven't done that
<epitron> arch has spoiled me :)
<Dreamer3> i'm just trying to figure out the right steps for mac osx and then i can update the docs
<epitron> it's probably easier to just use a static build of crystal
<Dreamer3> i'm working on the compiler sometimes
<epitron> tru :)
<Dreamer3> nice to see 0.7.1 out though
<kulelu88> you see, the problem starts when you mention "mac osx"
<kulelu88> =D
asterite has joined #crystal-lang
<epitron> at least it's not windows
<Dreamer3> is asterite on linux?
<asterite> Pony looks interesting
<Dreamer3> Ruby people (well, Rails at least) are mostly Mac
<asterite> However they lie when they say they don't have a "null" concept. They have None and union types, just like Crystal, so... it's OK for marketing, I guess :-P
<asterite> But I'm curious about the actors and the concurrent model
<epitron> hahah
<epitron> it sounds like there's some hot computer science in pony
<asterite> Previously you were talking about type inference. The thing that's different in crystal from other languages is that you don't need to specify the types of methods
<asterite> In Rust, Go, D, etc., you (almost) always need to specify those types, because type inference is local to a method/function
<asterite> But, as BlaXpirit said, not everyone might like it
<BlaXpirit> well nim can work without types
<BlaXpirit> but i don't see people praising it
<Dreamer3> how do i build the compiler twice?
<BlaXpirit> you build it and then you build it
<Dreamer3> right, but Make doesn't want to do anything since it's already built
<Dreamer3> i know bin/crystal auto swaps the right binary
<BlaXpirit> change 1 file??
HakanD_ has quit [Quit: Be back later ...]
<Dreamer3> is that going to recompile EVERYTHING? i don't know if there are object files from partial compile steps that might leave around?
<BlaXpirit> hm that's strange. sorry.
<BlaXpirit> i don't know
sfcgeorg_ has joined #crystal-lang
asterite has quit [Quit: Page closed]
<Dreamer3> well it compiles itself
asterite has joined #crystal-lang
<Dreamer3> with llvm 3.5.1
<Dreamer3> so that's something
<asterite> you do bin/crystal src/compiler/crystal.cr
asterite has quit [Client Quit]
<Dreamer3> nope that blows up
asterite has joined #crystal-lang
<Dreamer3> ok the distributed version works
<Dreamer3> so my llvm is the problem then?
<asterite> you need the patched llvm 3.5.1
sfcgeorge has quit [Ping timeout: 256 seconds]
<asterite> I thought 3.6 works, but I experienced some crashes :(
<Dreamer3> why does the makefile list llvm36?
<Dreamer3> oh
<asterite> Check the Contriubuting.md
<asterite> and how it blows up?
<Dreamer3> hmmmm
<Dreamer3> is there any info on the patch? i'd like to write a homebrew recipe that users the official LLVM sources and then just applies the patch, for transparency
willlll has quit [Quit: willlll]
<Dreamer3> ok this is what builds the official releases?
<asterite> Yes
<epitron> hah
<epitron> Dreamer3 raises an interesting point
<epitron> if you're working on crystal, and you're building crystal with crystal...
<epitron> can't you break crystal so that it can't build itself anymore?
<epitron> how do you deal with that, asterite?
<fowl> Very carefully
<Dreamer3> lol
<epitron> always a good approach
<fowl> Doubtful that you would break it in one commit
<asterite> Always run `make clean crystal spec` ;-)
<asterite> That tests the compiler with the new compiler
<fowl> I don't think .6 can compile .7 though
<asterite> And we always use the previous compiler to compile the new one, so 0.6 definitely builds 0.7
<fowl> The best thing to do is not use new features in the compiler
<fowl> ah
<asterite> but it can't build HEAD because I commited some things that use 0.7 features
asterite has quit [Quit: Page closed]
<Dreamer3> is there a repository with the homebrew files?
<Dreamer3> seems it'd be best to add a custom lvvm there and then have the homebrew depend on that when you use with-llvm, no?
<epitron> Dreamer3: i hope a mac user shows up soon
<Dreamer3> ok "homebrew-crystal"
DerisiveLogic has quit [Ping timeout: 255 seconds]
<Dreamer3> taps seem to always get homebrew- appended to their name on github
<Dreamer3> all this annoyance over a push instruction
<Dreamer3> i wonder if there is some reason we're still on 350 vs 351?
zz_Cidan is now known as Cidan
<Dreamer3> in why not
<Dreamer3> trying 351 with patch
<Dreamer3> since homebrew already has 351 recipe handy
<sfcgeorg_> The Homebrew install worked fine for me. To use the compiler I also had to:
<sfcgeorg_> export CRYSTAL_PATH=/usr/local/Cellar/crystal/0.7.1/src
<sfcgeorg_> brew install libevent
<sfcgeorg_> brew install bdw-gc
<Dreamer3> yeah i'm wanting to compile the compiler though
<Dreamer3> LLVM 351 has a bug
<Dreamer3> well, compile and recompile... the compiler i compiled actually works for small things, but not big things (like recompiling itself)
ismaelga has quit [Remote host closed the connection]
<vikaton> still dont understand why they would call it Pony
<jeromegn> I don’t think it matters
<jeromegn> the name of the language
<kulelu88> fowl: you are a traitor to Nim. I can see you moving to Crystal soon
<jeromegn> also, I don’t think it’s healthy to bash on other languages!
<fowl> kulelu88: didn't know I could only use one of them
<kulelu88> joke =/
<Dreamer3> ok built
<Dreamer3> now lets see if i can build
<fowl> kulelu88: :p
<Dreamer3> hmmm ld: library not found for -lyaml
<Dreamer3> yippy
<Dreamer3> working now
<jeromegn> I followed the homebrew install instructions and got 0.7.1 installed really quickly
<jeromegn> not sure what happened there
<jeromegn> I might have compiled a fresh llvm before though
<Dreamer3> some *
<Dreamer3> 5734 examples, 0 failures, 0 errors, 15 pending
<Dreamer3> sweet
waterlink has joined #crystal-lang
<Dreamer3> for anyone else on Mac wanting an easier path: https://github.com/manastech/homebrew-crystal/pull/2/files
<kulelu88> what is the predominant language LLVM is written in?
<Dreamer3> no idea
<Dreamer3> C?
Dreamer3 has quit [Quit: Leaving...]
Dreamer3 has joined #crystal-lang
<fowl> What if its written in llvm o.O
<fowl> Oh its c++
<kulelu88> so LLVM is a tool that programmers use to write their compilers on top of?
<kulelu88> or is it a compiler itself?
DerisiveLogic has joined #crystal-lang
<fowl> It provides a low level language to target that can be compiled or interpreted
<ytti> yeah crystal compiles to llvm ir, which later compiles into machine language
<fowl> Check out the brainfuck samples
<fowl> One is interpreted, one emits llvm ir and compiles a brainfuck program
<ytti> these days chain can be quite long
<ytti> nim => c => llvm ir => machine code
<ytti> i wonder if longer practical chain exists
<kulelu88> you also a nim programmer? ytti
<ytti> no
<ytti> but it looks interesting
<jeromegn> how does one use ECR?
<jeromegn> never ming, got it!
<ddfreyne> Nim compiles to C? That’s odd.
<crystal-gh> [crystal] yyyc514 opened pull request #621: Improve building from source instructions (gh-pages...patch-2) http://git.io/vJ6t8
ponga has quit [Quit: Leaving...]
<kulelu88> ddfreyne: it doesn't. it outputs C
<kulelu88> C isn't a core part of the compilation process
ismaelga has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
Liothen has quit [Ping timeout: 246 seconds]
<jhass> ytti: transpiliers, i. e. vala w/ clang: vala -> C -> llvm ir -> machine code
<jhass> kulelu88: llvm does all the optimizations for us
<BlaXpirit> does this imply that clang is "C -> llvm" ?
<ytti> jhass, tat's the same length of chain as my nim chain
<ytti> jhass, i wonder if longer chain is realistic
<BlaXpirit> you're forgetting freakin javascript
<kulelu88> wouldn't the Java chain be longer?
<jhass> ytti: mmh, emscripten? :P
Liothen has joined #crystal-lang
<jhass> vala -> C -> llvm ir -> javascript -> (javascript vm bytecode) -> machine code (jit) ? Doubt anybody has done it yet :D
<ytti> jhass, i wonder if you'd make the chain sufficiently complex and add random of which-to-which when options exists
<ytti> jhass, and keep it running for some time, how horrendous machine code you'd end up with
shama has quit [Read error: Connection reset by peer]
<ytti> kinda like google translate back-and-forth
shama has joined #crystal-lang
<vikaton> uhhh
<ytti> jhass, wow
<ytti> You will see that QR.rb is the same as QR2.rb.
<ytti> $ diff QR.rb QR2.rb
<ytti> this blows my mind
<ytti> how on earth is that possible
<ytti> these transformations shouldn't be reversible
<ytti> it makes no sense
<jhass> it's not reversible, it doesn't go back, it forms a circular chain
vikaton has quit [Read error: Connection reset by peer]
vikaton has joined #crystal-lang
vikaton has quit [Client Quit]
vikaton has joined #crystal-lang
willlll has joined #crystal-lang
<willlll> Is thre a way to get the size of a type if you only have a variable pointing to the type? sizeof() requires the actual type to be there it seems
<vikaton> willlll: maybe this?
<vikaton> >> "hi".bytesize
<DeBot> vikaton: Sorry, that took too long.
<vikaton> well then...
<vikaton> >> "hi"
<DeBot> vikaton: "hi"
<vikaton> >> "hi".bytesize
<DeBot> vikaton: 2
<vikaton> ^
<BlaXpirit> >> sizeof(5.type)
<DeBot> BlaXpirit: Syntax error in eval:3: expecting token 'CONST', not '5'
<BlaXpirit> >> sizeof((5).type)
<DeBot> BlaXpirit: Syntax error in eval:3: expecting token 'CONST', not '5'
<fowl> >> X= 5.type; sizeof(X)
<DeBot> fowl: Error in line 3: undefined method 'type' for Int32
<BlaXpirit> sizeof seems to be fiction
<BlaXpirit> and it's .class not .type
<BlaXpirit> ah no, sizeof indeed works only on type literals
ismaelga has joined #crystal-lang
<willlll> yeah looks like it’s built into the parser
<jhass> >> class Class; macro def size : Int32; sizeof(self); end; end; "foo".class.size
<DeBot> jhass: 4
DerisiveLogic has quit [Ping timeout: 256 seconds]
<jhass> >> class Class; macro def size : Int32; sizeof(self); end; end; x = "foo"; x.class.size
<DeBot> jhass: 4
<jhass> >> class Class; macro def size : Int32; sizeof(self); end; end; x = LibC::TimeVal.new; x.class.size
<DeBot> jhass: 8
<willlll> interesting
<BlaXpirit> wow
<vikaton> my website has faster load times and can take alot more reqs per second :P
<fowl> Neat use of macro methods
<vikaton> 19,000 more to be exact
<kulelu88> complete total now? vikaton
<vikaton> kulelu88: hm?
<kulelu88> vikaton: complete requests per second?
<vikaton> kulelu88: yeah
<kulelu88> how many? =/
<vikaton> 20,000
<vikaton> on a 512 mb ram vps
<kulelu88> just HTTP?
<kulelu88> not IO calls?
<vikaton> yeah
<vikaton> kulelu88: I'm just comparing wrk results of different implementations and languages
<vikaton> Crystal so far is ahead of the Game
<Dreamer3> any easy way to run a single spec in the right build environment?
<vikaton> compared to Ruby+Passenger/Node.js/Rust
<kulelu88> Rust too?
<kulelu88> what about Go?
<vikaton> havent tried Go
<vikaton> mainly because I dont rly like it
<BlaXpirit> good for you
<jhass> Dreamer3: there's (bin/)crystal spec spec/foo_spec.cr and I don't remember but try :123 where 123 is the line number of the it block
<vikaton> I wanna try Jester when it's optimized
<Dreamer3> fails because of LLVM issues
<Dreamer3> because it doesn't have the right environemnt setup
<jhass> Dreamer3: bin/crystal too?
<Dreamer3> i'm using bin crystal
<jhass> I call weird OS X issues then and bail :P
blaix has quit [Quit: Leaving.]
<Dreamer3> LLVM_PATH=`brew --prefix llvm35-patched` PATH=$LLVM_PATH/bin:$PATH ./bin/crystal spec/compiler/macro/macro_expander_spec.cr
<Dreamer3> works
<Dreamer3> seems like there should be some easier way
<Dreamer3> maybe a way to define any file as a target in makefile?
<sfcgeorg_> What's the fastest way to build up a string in a loop? +=?
<jhass> Dreamer3: I guess the vars should be set in bin/crystal
<jhass> sfcgeorg_: String.build do |io| loop do io << data end end
<sfcgeorg_> Ah okay, thank you.
<vikaton> wait
<vikaton> what?
<Dreamer3> jhass: should they? I assume not since the choice was already made to set them in Makefile
<jhass> I doubt it's a strongly reasoned choice tbh ;)
<sfcgeorg_> Ooh quick benchmark shows that String#build is indeed a lot faster :)
<Dreamer3> true
<vikaton> what is string#build D:
<sfcgeorg_> http://crystal-lang.org/api/String.html#build%28capacity%20%3D%2064%2C%20%26block%29-class-method
<crystal-gh> [crystal] yyyc514 opened pull request #624: bin/crystal should hook up LLVM path on OS X (master...bin_crystal_llvm) http://git.io/vJ6DD
aemadrid has joined #crystal-lang
<vikaton> haha
<crystal-gh> [crystal] yyyc514 opened pull request #625: macro should support string concat (master...macro_support_string_concat) http://git.io/vJ6QV
<vikaton> >> 'a'.ord
<DeBot> vikaton: 97
<vikaton> >> 'a'.ord.to_u8
<DeBot> vikaton: 97
<vikaton> whats the diff?
<jhass> >> 'a'.ord.class
<DeBot> jhass: Int32
<jhass> >> '☃'.ord.class
<DeBot> jhass: Int32
<sfcgeorg_> Wow I just made my app over 20x faster by using StringIO#puts instead of String#+=. 20s runtime now under 1s.
<jhass> >> '☃'.ord
<DeBot> jhass: 9731
<jhass> >> '☃'.ord.to_u8
<DeBot> jhass: 3
<vikaton> >> 'a'.to_u8
<DeBot> vikaton: Error in line 3: undefined method 'to_u8' for Char
<sfcgeorg_> \msg NickServ regain sfcgeorge
<sfcgeorg_> oops sorry O:)-
sfcgeorg_ is now known as sfcgeorge
<vikaton> whats ord short for?
<crystal-gh> [crystal] yyyc514 opened pull request #626: Int@to_s should return only lowercase "digits" (master...lowercase_hex_int_to_s) http://git.io/vJ65N
<Dreamer3> ordinal?
<vikaton> o
BlaXpirit is now known as BlaXpirit_
BlaXpirit_ is now known as BlaXpirit
BlaXpirit has quit [Remote host closed the connection]
BlaXpirit has joined #crystal-lang
BlaXpirit has quit [Client Quit]
<crystal-gh> [crystal] will opened pull request #627: Try, but fail, to reorder structs (master...failed-attempt-to-reorder-structs) http://git.io/vJif2
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/vJiJO
<crystal-gh> crystal/master 2e25e19 Ary Borenszweig: Change: type variables can now only be single letters, same as free vars. Error on unknown types in restrictions (on instantiation). Fixes #487, and it actually uncovered a few bugs/mistakes.
<crystal-gh> crystal/master 79989b7 Ary Borenszweig: Replace leading tabs with spaces in error messages so we can highlight the correct locations
<travis-ci> manastech/crystal#2295 (master - 79989b7 : Ary Borenszweig): The build is still failing.
<fowl> So generic types are one letter consts
<Dreamer3> what is SimpleHash for?
<Dreamer3> just faster hash for smaller things?
<jhass> stack vs heap allocated from the looks of things
<jhass> O(n) key access apparently, so memory light, not fast
<jhass> and since it appears to be backed by a regular array I'm really not sure what the benefit might be
<waterlink> Ehm, Simple means: Simple implementation then ? )
<waterlink> And by the way, if it has like 2-3 elements, then it will be probably faster then full-fledged Hash :)
<waterlink> because of overheads
<jhass> you mean computing the hash?
<waterlink> Hash table is not just computing the hash of the key, right? It needs to resolve collisions for instance
<waterlink> + dependency injection of Comparator(s) as I can see in source )