ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.19.4 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
<FromGitter> <jots_twitter> this is about 10 times slower than `wc -l` any way to speed it up? ⏎ ⏎ ```nlines = 0 ⏎ while gets ⏎ nlines += 1 ⏎ end ⏎ puts nlines``` [https://gitter.im/crystal-lang/crystal?at=5829039c31c5cbef43f0b6b0]
<FromGitter> <jots_twitter> and about 3 times slower than ruby. I built with --release.
Papierkorb has quit [Ping timeout: 258 seconds]
Papierkorb has joined #crystal-lang
Raimondi has quit [Read error: Connection reset by peer]
Raimondi has joined #crystal-lang
<A124> Can one have nested Hash like in Ruby?
<havenwood> A124: yup
<A124> havenwood How one goes about that, when Hash is a class, set stuff as pointer type?
<FromGitter> <jots_twitter> I read that but I didn't see anything that helps. also, python is 10 times as fast as crystal as well. maybe not a big deal until dealing with multi GB files like i am right now...
<A124> Well, Ruby has File.foreach to iterate over lines. Also why are you using \s and not \n?
<A124> I'm trying to figure out stuff myself, I took a trip to the source, wrote stuff, then got stuck without documentation.
<FromGitter> <jots_twitter> the split is a different thing than reading lines. i wanted to split each line into tokens on whitespace, but first i need to at least read in the lines at a reasonable rate... like at least as fast as ruby or python. need the speeeed...
<A124> If you code python then python + pypy
<A124> Wonder if the speed is code, caching or other reason though.
<FromGitter> <jots_twitter> I think either the IO system is slow or I'm not using it right... all i'm trying to do is count lines.
<A124> About the recursive hash, I have the problem when I want to create Hash to populate later, I cannot.
<A124> It wants to know what types will be stored in it, and when I say hash, it turns into recursvie problem.
<crystal-gh> [crystal] tbrand closed pull request #3538: `crystal build` without spepecified program files (master...feature-build-cmd) https://git.io/vX6Gp
<FromGitter> <cjgajard> @jots_twitter if you do `time crystal file.cr --release` it need to parse, infer types, compile, do llvm optimizations, link and finally run, that will be slow.. but if you do `crystal build --release file.cr` and then `time ./file` the perfomance is just 1ms slower than `wc -l` (at least in my pc)
<FromGitter> <jots_twitter> I am doing crystal build --release file.cr. how is mine so much slower? maybe something weird going on on my machine. will try to run it on another one.
am_ has quit [Ping timeout: 244 seconds]
<FromGitter> <jots_twitter> tried it on another system and get this: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ not sure what's going on there. [https://gitter.im/crystal-lang/crystal?at=58293f5fc2f2cf7275093a99]
ponga has quit []
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
pawnbox has quit [Ping timeout: 258 seconds]
pawnbox has joined #crystal-lang
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
bjz has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
pawnbox has joined #crystal-lang
gloscombe has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 246 seconds]
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 265 seconds]
mark_66 has joined #crystal-lang
bjz_ has quit [Ping timeout: 250 seconds]
bjz has joined #crystal-lang
pawnbox has joined #crystal-lang
gloscombe has quit [Ping timeout: 240 seconds]
gloscombe has joined #crystal-lang
bjz has quit [Ping timeout: 248 seconds]
bjz_ has joined #crystal-lang
soveran has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
soveran has joined #crystal-lang
gloscombe has quit [Quit: Lost terminal]
pawnbox has quit [Ping timeout: 260 seconds]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
pawnbox has joined #crystal-lang
gloscombe has joined #crystal-lang
<FromGitter> <luislavena> @jots_twitter there is already another *`wc` in Crystal* implementation, you might want to check how that works: https://github.com/sferik/wc.cr
<FromGitter> <luislavena> you might only require change line 37 to use `=>` (so it becomes a hash) instead of a `NamedTuple`
soveran_ has joined #crystal-lang
Philpax_ has quit [Ping timeout: 248 seconds]
soveran has quit [Ping timeout: 256 seconds]
gloscombe has quit [Quit: Lost terminal]
Philpax_ has joined #crystal-lang
Philpax has joined #crystal-lang
Philpax_ has quit [Ping timeout: 260 seconds]
Philpax has quit [Ping timeout: 260 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 252 seconds]
pawnbox has joined #crystal-lang
Philpax has joined #crystal-lang
crystal-lang982 has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
crystal-lang982 has quit [Ping timeout: 260 seconds]
<crystal-gh> [crystal] yxhuvud opened pull request #3541: Add argument to Array#flatten to specify amount of levels to flatten. (master...flatten) https://git.io/vXiF8
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
Philpax has quit [Ping timeout: 260 seconds]
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
<A124> So, anyone any ideas how to contruct a recursive hash if one does not know the depth needed beforehand?
_jungh4ns has joined #crystal-lang
<A124> On other hand I found out how memory efficient current stable Ruby is.
pduncan has joined #crystal-lang
<FromGitter> <luislavena> @A124: as long you know the type of data, you can define the Hash without issues:
<FromGitter> <luislavena> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5829d2a865485ebc6793e0c7]
soveran_ has quit [Remote host closed the connection]
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 260 seconds]
snsei_ has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter> <samueleaton> Is there away to return a slice of a tuple (Immutable or mutable)? When I do... ⏎ ⏎ ```{1, 22, 333}.skip(1) # => [22, 333]``` ⏎ ⏎ ...It returns an array. [https://gitter.im/crystal-lang/crystal?at=5829d64fe097df7575ad3e23]
<crystal-gh> [crystal] yxhuvud closed pull request #3541: Add argument to Array#flatten to specify amount of levels to flatten. (master...flatten) https://git.io/vXiF8
snsei has quit [Remote host closed the connection]
<FromGitter> <bcardiff> @samueleaton you can play with pack/unpack to build new tuples
<FromGitter> <bcardiff> ```def tail(h, *t) ⏎ t ⏎ end ⏎ ⏎ tail(*{1,2,3}) # => {2, 3}``` [https://gitter.im/crystal-lang/crystal?at=5829d8ce65485ebc67940d1c]
snsei has joined #crystal-lang
ponga has joined #crystal-lang
pduncan has quit [Ping timeout: 256 seconds]
<FromGitter> <samueleaton> Thanks. Very functional. I like it.
mark_66 has quit [Quit: Leaving.]
<A124> @luislavena: Thank you, that is what I was looking for and missed. Yet I am lost on usage of the result. Do I need to declare new? Or I just do not get it and cannot seem to find the needed info to figure it out.
<A124> Looking at making merkle tree. Each node having some local data and optionaly children of the same type/class.
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<coderobe> is there something like https://github.com/enkessler/childprocess for crystal already?
soveran has quit [Ping timeout: 260 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter> <luislavena> @coderobe: check `Process.new` and `Process.run`, it lacks some documentation but is quite capable of run child processes
<coderobe> Cool, i'll check it out
<FromGitter> <luislavena> @A124: can't help with merkle tree, but I can recommend starting with the docs on Hash usage.
<A124> @luislavena Merkle tree could just be recursive hash with one key => value being children. I already did that in Ruby. It is suprisingly efficient at memory, the speed when having large trees is not that great though.
<A124> The problem is I am unable even to create a very basic thing. API says look at docs for basic usage, but the basic usage has nothing there.
<A124> I would be very glad for an example of such Tree, as you gave the example. I'm lost. I just have no idea, trying random stuff at this point.
<coderobe> i'm having a problem creating a string from a YAML.mapping: "no overload matches 'MyYamlMapping#to_yaml' with type YAML::Emitter", any ideas?
<A124> It mentions JSON is example of recursive type, but cannot find anything helpful at the source either.
<A124> How would one get single instance of the aliased type, instead of using array?
<A124> The .new method does not work on the alias. And also apparently one cannot set a value of hash to an empty hash
<FromGitter> <johnjansen> you can if you can type it i.e. `{} of String, String`
unshadow has joined #crystal-lang
<FromGitter> <johnjansen> and you can `merge` and `merge!` hashes which might be helpful … perhaps
<A124> But I am using custom type (with alias)
<FromGitter> <johnjansen> without seeing that i personally cant offer anything other than hints
<unshadow> Hi Guys, I'm using Crystal to build a load testing tool for testing Concurrent connections, It seems that I'm kinda hitting a wall when I want Crystal to generate above 20k fibers. I don't see any crashes or something, the machines that test are quite powerfull (36 Cores, 64Gb RAM) and don't seem to be impacted by the program. Is there any logical lock that I should know of ?
<unshadow> Note: I have other programs that do generate more then 40k Concurrent Connections on the same machines, so the machines and Archetecture are not the blame
<A124> @johnjansen Would you mind providing merkle tree example? { :name => "string", :data => "something", :children => {} }
<A124> But the alias is (just a testing one) alias Tree = Hash(Symbol | String, String | Array(String) | UInt64 | Int32 | Tree)
mgarciaisaia has joined #crystal-lang
<A124> I have no idea if there is even a single example on the internet. Github no luck, web search no luck.
<A124> As of Crystal 0.19.4 this won't compile since Blah.new is not valid anymore. @asterite @jhass IMHO you can close this.
<FromGitter> <johnjansen> see if you can get some clues from this https://play.crystal-lang.org/#/r/1dxp
<FromGitter> <sdogruyol> @unshadow i had the same kind of situation with Cryload https://github.com/sdogruyol/cryload
<A124> Thank you. Yes, that does help. I was asking earlier if I have to use a class. So there is no reasonable way to do that with just alias, I suppose. Is there?
<A124> How does one create a single instance of aliased type, instead of array, like in example?
<crystal-gh> [crystal] zatherz opened pull request #3542: JSON.mapping setter/getter generation control (master...feature/json_mapping_setter_getter) https://git.io/vXPwL
<BlaXpirit> A124, i've been looking at your messages from the start but I still have no idea what you need
<RX14> if you have an alias
<A124> Merkle tree in a Hash structure.
<RX14> you can just call .new on it
<A124> Error in ./repl.cr:4: undefined method 'new' for Tree:Class
<RX14> yes
<RX14> as that issue said
<FromGitter> <johnjansen> @A124 i honestly think that you need to start with something you understand and then start trying things like alias types, you can substitiute Struct for Class in the hint i sent you … but see if you can make *something* work before getting tricky
<RX14> if it's recursive it won't compile
<A124> And that is what I need, yes. as I stated before, in Ruby I use { :name => "string", :data => "something", :children => {} }, and access it as root[:children]["name"] or root[:data]. Same aplies for nested levels.
<RX14> uyou wouldn't want to do that in crystal
<A124> Does 'won't compile' == 'not supported' ?
<RX14> use a record
pduncan has joined #crystal-lang
snsei has quit [Ping timeout: 258 seconds]
<RX14> A124, well what you want honestly should work
<RX14> but it doesn't
<A124> Alright, what is a record?
<RX14> it's a macro to generate a class for holding data
<RX14> you don't want to hold data that isn't key value data in Hash in crystal
<RX14> you want to use something more concrete
<RX14> so recird basically defines a class which holds the data
pawnbox_ has quit [Ping timeout: 260 seconds]
<FromGitter> <sdogruyol> a record for example
<RX14> and with getters and setters
<RX14> thats a simplification but
<FromGitter> <sdogruyol> @RX14 you mean a struct?
<RX14> yes
<RX14> but the difference doesn't matter for now
<A124> What is the difference and between what and when it matters?
<RX14> like this
<RX14> A124, it's in the docs but it doesn't make a difference for now
<A124> For those unfamiliar with merkle trees, it is a btree structure where each node can hold data and can have children (usualy of same type) and each non-leaf node data (or part of) is dependent on the closer to leaf (including leaf) levels. https://upload.wikimedia.org/wikipedia/commons/thumb/9/95/Hash_Tree.svg/1280px-Hash_Tree.svg.png
<FromGitter> <johnjansen> @RX14 where abouts in the docs
<RX14> under structs
<FromGitter> <johnjansen> thanks ;-)
<unshadow> sdogruyol : I remmber we had issues with it, (it's me bararchy) , I thought we worked around it by using Fibers\Channels no ?
<FromGitter> <sdogruyol> @unshadow long time no see, well you can generate as much as fiber as you want but there's the event loop
<FromGitter> <sdogruyol> your limit is the event loop
<FromGitter> <johnjansen> ok who can remember how to dump the results of a macro
<FromGitter> <johnjansen> some debug trick from what i remember
<FromGitter> <sdogruyol> {{ %debug() }}
<RX14> no %
<RX14> just {% debug() %}
<RX14> {{}} works too probably
<FromGitter> <sdogruyol> ah yes thanks RX14
mgarciaisaia has left #crystal-lang [#crystal-lang]
<FromGitter> <johnjansen> hmmm, i wanted to dump the result of your record example @RX14 for @A124 to no avail
<A124> How do I dump the record result then?
<FromGitter> <johnjansen> haha
<FromGitter> <sdogruyol> lol
<unshadow> sdogruyol: How much Concurrent Connection did you manage using Cryload ?
<FromGitter> <sdogruyol> @unshadow something between 15k - 20k
<FromGitter> <sdogruyol> i guess i hit the event loop limit
<FromGitter> <sdogruyol> and for now crystal is single thread so
<FromGitter> <johnjansen> anyone written a retry macro yet?
pduncan has quit [Ping timeout: 245 seconds]
pawnbox has joined #crystal-lang
<unshadow> sdogruyol: So the event loop is responsible ? is there an hardcoded value ? or something we can play around with ? why do we hit a limit if no Hardware cap is reached ?
<FromGitter> <sdogruyol> @unshadow i'm not sure if we can play with it. It's libevent
<A124> RX14 So... is there a way to output resulting struct, also given 'you should prefer using structs for immutable data types' if it does pass value, if the tree is large does it pass whole tree, or just the single node? And if not structs, which shall I use, in case of mutable data (by design one has to have mutable, or construct from leaves up).
<RX14> A124, well Array isn't a struct
<RX14> so when you have children : Array(String) thats passing a pointer to the array
<RX14> like usual
<RX14> so no it's actually a small amount of memory
<FromGitter> <johnjansen> @RX14 can you dump the output of that macro for him, i couldn’t make it work and im in the middle of retry :-)
<RX14> you can't dump the macro outside the macro
<FromGitter> <crisward> Has anyone wrote any tutorials on macros?
<RX14> the docs are pretty good
<FromGitter> <johnjansen> thanks @RX14
<FromGitter> <sdogruyol> the docs are good but not so practical
<RX14> i guess i just played around with it until it worked
<RX14> A124, the struct will be
<FromGitter> <crisward> I suppose I'm looking for examples of why / when to use them etc
<A124> So I can just write the setters and getters myself. And compare bahaviour.
<A124> I just wanted to see what the record macro actualy constructs.
<RX14> yes
<RX14> well you can't really
<RX14> you can sort of see it from the macro definition
<FromGitter> <johnjansen> haha @rx14 you beat me to it
<RX14> for every property you define in the record it genrates a getter
<RX14> and then it generates an initialize like (@foo, @bar)
mgarciaisaia has joined #crystal-lang
<RX14> to set the instance vars
<FromGitter> <sdogruyol> has anyone tried to write a GC before?
<RX14> then {{yield}} is so you can put a block on the macro
<RX14> @sdogruyol I presume you mean in crystal
<RX14> otherwise the answer is obvious :P
<FromGitter> <sdogruyol> no
<FromGitter> <sdogruyol> i asked it for everything
<FromGitter> <sdogruyol> :P
mgarciaisaia has left #crystal-lang [#crystal-lang]
<FromGitter> <sdogruyol> i'm interested in GCs and looking for where to start
<FromGitter> <sdogruyol> and it'd be great to have someone experienced for ideas
soveran has joined #crystal-lang
<A124> GCs are not a simple thing, so most people just implement the simple ones until there is need to implement the better ones.
<FromGitter> <sdogruyol> yeah i assume that they're not simple .P
soveran has quit [Ping timeout: 240 seconds]
<A124> Thanks RX14! So I can just copy paste macro and add a setter (does saying 'setter' suffice?, or should I do it differently?), and add default values for the initialize to simplify things. This is great.
<RX14> you can add a = after the type in the record for a default
<RX14> it's part of the language syntax
<A124> Yeah, I know same as ruby, the question was about the setter.
<RX14> ohh
<RX14> well you can add a do
<RX14> then write as if you're inside the class
<RX14> or just write a vanilla struct from scratch
<A124> Would just saying 'setter name' have problems with the copy thing?
<RX14> honestly you don't want a setter in a record
<A124> Then how do I modify it.
<RX14> if you want a setter you want a class
<RX14> records are meant to be immutable
<RX14> because they're pass by value
<RX14> so that changes inside a method don't change anything
<A124> Well say it is a file system. If you modify a file, you want that leaf and all levels up changed.
<RX14> yes, so use a class
<A124> Yeah, I read that in API docs. Ok. Class for everything or just branches?
<A124> Is there negative memory/performance implication in using class?
<RX14> yes but not much
<RX14> it's an extra malloc call
<A124> Alright, thank you very much.
<A124> ... got one more unrelated question. How one would go about reading chunk of file and hashing that chunk with Digest?
<FromGitter> <johnjansen> @RX14 quick question, can you remind me how to reference a block inside a macro, i.e. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=582a034731c5cbef43f60272]
<A124> In Ruby, Go I read a part of the file, then give it to Digest, in Crystal I failed doing so.
<RX14> yes
<RX14> uhh
<RX14> Digest::SHA1 is useless for this
<RX14> let me just get some code
<A124> Or Zlib, compress a chunk, to estimate compression.
<RX14> basically
<A124> I was offline so I had to rely on source, so I figured out how to use a lot, but got stuck, tried using MemoryIO, but had no idea how to use that as a "pipe.
<RX14> you want to use OpenSSL::Digest
<RX14> you don't want to use MemoryIO for this
<A124> I wanted to read a chunk to bufer then do that, did not find how.
<RX14> you need to create a Slice
<RX14> then use io.read(slice)
<RX14> this is an example
<A124> I did that, had no idea how to feed the slice onto the Zlib deflate.
<RX14> the buf = line is a bit complex
<A124> Lovely. Great example for digest.
<RX14> but just ignore that and buffer is a Slice(UInt8) with size 8192 bytes
<RX14> if you JUST need to copy between places you can use `IO.copy`
<A124> Is there the same problem with Zlib in crystal, or is it even possible to give it a buffer?
<RX14> here I couldn't use `IO.copy` because i needed to digest AND write
<RX14> well
<RX14> crystal has a nice deflate wrapper
<RX14> which wraps an IO
<RX14> so you can create a "deflate IO" which wraps another IO
<A124> Same as Ruby.
<RX14> and then you write data to the "deflate IO"
<RX14> and it writes to the underlying IO
<A124> But if I want to feed it a chunk and have the chunk in memory to store in database and not to file immediately?
<A124> Yes, that source I was in.
<A124> In Ruby one has Zlib::Deflate.new(or open?) for the IO, and Zlib::Deflate.deflate(data,level=SOME_DEFAULT)
<A124> The second one was something I could not figure out. The job is to estimate ratio by doing out_size.to_f / in_size.
soveran has joined #crystal-lang
<RX14> well then you need to set the destination as a MemoryIO
<RX14> well
<RX14> if it's just the size you can create a "counter" IO which just stores the size
<RX14> and not the result
<A124> In this case it is just the size, in other it is deflating stuff before database insert.
<A124> Ok. Create MemoryIO, wrap it with Zlib, read slice of file, write it to Zlib, close Zlib, read MemoryIO, returns 0 size data.
<RX14> A124, ah yes
<RX14> after you've written to the "MemoryIO"
<RX14> your position in the IO is at the end
<RX14> so you need to call #rewind
<RX14> before you start reading
<RX14> but you should be able to call #size in the MemoryIO
<A124> Drums... Aaaand it works!
<A124> Thank you really, I did not realize this at all.
kochev has joined #crystal-lang
<A124> About the counter IO, any hint or link? Did not find anything.
<RX14> you'd have to make it yourself
<RX14> it doesn't exist yet
<FromGitter> <sdogruyol> @unshadow have you tried increasing your file limit btw?
<A124> I just read data out of it to nowhere?
<A124> Can I have two handles for the MemoryIO, each with different cursor?
<RX14> well
<RX14> if you do nothing in the #write call
<RX14> then the caller will just give you a new slice
<RX14> and no I don't think you can do that A124
<A124> New slice? I have to read the data or somehow count the data size, that implies reading it or something else.
<RX14> no
<RX14> the api for write is you're given a slice
<RX14> and you write the data in the slice
ponga has quit [Quit: Connection closed for inactivity]
<RX14> so you just do @size += slice.size
<A124> Oh. The slice sice will always much data size, in all cases. Correct if I am wrong.
<RX14> yes, you just give #write a slice and it writes ALL of it
<RX14> the caller owns the data
<RX14> and the slice is almost always reused to write more data
<A124> I have this mindset of things being multiples of some block or buffer size and using len integers to signify the size.
<RX14> well Slice has a length
<RX14> thats it's point
<A124> Great. I am very thankful to you. And others. Those answers moved me miles away from a standstill.
<RX14> you can malloc a slice then take different slices of the underlying memory
<A124> Go-like.
<RX14> i guess
<RX14> i havent used go
soveran has quit [Remote host closed the connection]
<A124> Love it. Now just have to wait for threads and more docs.
<A124> Yeah, slices behave the same way.
<A124> They have length and capacity.
<RX14> the docs are decidedly OK
<RX14> they're quite excellent for the basic stuff
<FromGitter> <johnjansen> @A124 can add to them @RX14
<FromGitter> <johnjansen> ;-)
<RX14> heh
<RX14> nobody ever has tiem for docs :/
<FromGitter> <johnjansen> im sure there is an element of “dont want to look stupid” too ...
<A124> Well, the recursive thing f'me up. The rest is OK if one goes through all the maze.
<FromGitter> <johnjansen> given they have to be PR’d I wonder about the time efficiency also
<RX14> yeah
<RX14> that error for the recursive type would confuse the hell out of me too
<RX14> and i've been here for...
<RX14> over a year
* A124 is glad he is not the one that dumb.
<RX14> well as far as i'm concerned, it's a bug
pawnbox has quit [Ping timeout: 246 seconds]
j2k has joined #crystal-lang
<unshadow> sdogruyol: File limit is at 900,000 :) Those machines can generate above 50K Concurrent Connections using wrk and Nginx
<FromGitter> <sdogruyol> i know
pawnbox has joined #crystal-lang
matp has joined #crystal-lang
matp_ has quit [Read error: Connection reset by peer]
pduncan has joined #crystal-lang
pduncan has quit [Ping timeout: 258 seconds]
pawnbox has quit [Remote host closed the connection]
Philpax has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
<crystal-gh> [crystal] bmulvihill closed pull request #3518: Enum from_value when Flags (master...enum-from-value) https://git.io/vX0n7
kochev has quit [Remote host closed the connection]
Philpax has quit [Ping timeout: 246 seconds]
soveran has quit [Remote host closed the connection]
j2k has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pduncan has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
pduncan has quit [Ping timeout: 260 seconds]
<FromGitter> <jots_twitter> any idea why this is happening and how to prevent it? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=582a381a88fa21d53c20aea8]
bjz has joined #crystal-lang
<FromGitter> <luislavena> @jots_twitter as explained when linked, options is defined as a NamedTuple, not a Hash, a NamedTuple is immutable, so you can't `[]=` on it.
<FromGitter> <luislavena> Change `{key: value}` syntax to use `=>`:
vifino has joined #crystal-lang
<FromGitter> <luislavena> ```options = {:bytes => true, :lines => true, :chars => false, :words => true}```
<FromGitter> <jots_twitter> @luislavena thank you. btw, this is from wc.cr that you pointed me to, so thank you for that as well :-)
<FromGitter> <luislavena> @jots_twitter no worries, I mentioned that when added the link, probably you missed.
<FromGitter> <luislavena> @johnjansen either you can use `{{block.body}}` or `{{yield}}` to reference the block used as part of a macro invocation.
bjz has quit [Ping timeout: 245 seconds]
vifino has quit [Quit: Who turned this off?! D:<]
vifino has joined #crystal-lang
soveran has quit [Remote host closed the connection]
j2k has joined #crystal-lang
j2k has quit [Client Quit]
<FromGitter> <jots_twitter> still messing around with crystal to get a decent wc working. running it on a 200MB file, it's 4 times as slow as perl and 20 times as slow as C. I really want to use crystal for slinging around text in multi GB files, hopefully I'm doing something wrong or there is a fix on the horizon. numbers: https://gist.github.com/anonymous/da6433854e67a1062ed36a668444dae1
vifino has quit [Ping timeout: 256 seconds]
vifino has joined #crystal-lang
<Papierkorb> jots, I'm pretty sure that wc doesn't generate huge arrays
Alexendoo has quit [Quit: ␄]
Alexendoo has joined #crystal-lang