<FromGitter>
<codingphasedotcom> how do you get user input in crystal
<FromGitter>
<picatz> `user_input = gets`
<FromGitter>
<picatz> In one line: `user_input = gets; puts user_input`
<FromGitter>
<codingphasedotcom> ok so its just like ruby
<FromGitter>
<codingphasedotcom> i was trying to find that info the documentation but couldnt find it
<FromGitter>
<picatz> Yeah. That kind of stuff is going to be harder to google for I'd assume, since it's a newer language -- I'd assume that kind of stuff could be blogged about or something to communicate those ideas.
<FromGitter>
<picatz> *I wonder how hard it could be to, like, quantify that stuff.* Which is a different thought entirely. :smile:
<FromGitter>
<codingphasedotcom> @picatz thanks
<FromGitter>
<codingphasedotcom> what would be the best uses for crystal lang? I'm more of a web developer and wondering what would be the best scenarios to use crystal
shelvac2 has quit [Quit: Goodbye for now]
shelvacu has joined #crystal-lang
<FromGitter>
<redcodefinal> @codingphasedotcom Ruby isn't fast enough and you are not worried about using a statically typed language (if you are coming from ruby there are some differences and oddititys). I mainly came to crystal because I wanted to write games and ruby is too slow. Crystal is blazingly fast if you are coming from a language like JavaScript, Ruby, or Python. If you use Ruby On Rails we have many MVC frameworks to use.
<FromGitter>
<redcodefinal> @codingphasedotcom but crystal is a really fun language in a lot of ways and I'm super excited it's around, I've felt we needed speedier alternatives to ruby and I think this language will be able to over take it eventually.
<FromGitter>
<codingphasedotcom> @redcodefinal cool was wondering what others were using it for
<FromGitter>
<redcodefinal> @codingphasedotcom you can check out our version of rubygems @ http://crystalshards.xyz
<FromGitter>
<redcodefinal> You can see what shards are the most popular that way
blufor has quit [Ping timeout: 240 seconds]
olek_poz has joined #crystal-lang
FromGitter has quit [Ping timeout: 240 seconds]
FromGitter has joined #crystal-lang
olek_poz has quit [Ping timeout: 260 seconds]
bungoman has quit [Ping timeout: 240 seconds]
bungoman has joined #crystal-lang
Qchmqs has joined #crystal-lang
olek_poz has joined #crystal-lang
bungoman has quit [Ping timeout: 255 seconds]
mark_66 has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
<kodo[m]>
What's the best way to get byte array from hex string?
Yxhuvud has quit [Read error: Connection reset by peer]
Ven_ has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
Ven is now known as Guest42930
<RX14>
yeah...
<RX14>
hexbytes is actually performant
<RX14>
I wrote the hexbytes inner loop I think
<RX14>
yeah it's copy and pasted from camo.cr <3
Guest42930 has quit [Ping timeout: 240 seconds]
Ven_ has joined #crystal-lang
splitty_ has joined #crystal-lang
gloscombe has joined #crystal-lang
Ven_ has quit [Ping timeout: 255 seconds]
Ven_ has joined #crystal-lang
<FromGitter>
<sdogruyol> lol
<FromGitter>
<sdogruyol> @RX14 i'm sad that you stopped working on crane :(
<FromGitter>
<sdogruyol> i don't want to use crenv
<RX14>
i'd love to work on it
<RX14>
i'm just a bit busy
<FromGitter>
<sdogruyol> that's good to hear
<RX14>
you could work on it :)
<RX14>
it's open source
Ven_ has quit [Ping timeout: 255 seconds]
Ven has joined #crystal-lang
Ven is now known as Guest11277
Guest11277 has quit [Ping timeout: 255 seconds]
<FromGitter>
<sdogruyol> yeah that's true but i'm not good at that kind of stuff :P
sz0 has joined #crystal-lang
Ven_ has joined #crystal-lang
bungoman has joined #crystal-lang
Ven_ has quit [Ping timeout: 240 seconds]
zipR4ND has joined #crystal-lang
<zipR4ND>
hey all, trying to get LibPCRE's copy substring to work (hoping it is faster than Regex::Matchdata[]? is atm.). don't know how to interpret the result as String.. https://play.crystal-lang.org/#/r/1ucg
Ven_ has joined #crystal-lang
<RX14>
buffer{} is the string
<RX14>
well
<RX14>
kinda
<RX14>
the string is in buffer
<RX14>
you just need to turn it into a crystal string
<zipR4ND>
the thing is, I'm working with the cltk framework, so I'm looking at a way to keep the nice api I have there ...
<RX14>
there aren't meany rules
<RX14>
so it's probably quite okay to do what crystal's lexer does
<RX14>
but it is a bit messy
<zipR4ND>
hmm, yeah writing a custom lexer would be a way to become fast, but what I would like to have is a lexer generator that offers cltks nice api and still creates a super fast lexer ..
<RX14>
well the long and short of it is that pcre is slow
<RX14>
you can write a fast lexer but it can't use pcre
<RX14>
well, eat leat not in the hot path
<zipR4ND>
ok, so I need a parser that parses a subset of regex and builds up it's own state machine ..
<RX14>
you could write something that generated crystal code
<RX14>
like traditional parser generators which generated C
<zipR4ND>
like something that gets fed to the run macro?
<RX14>
yeah
<RX14>
something like that
<zipR4ND>
hmm, I was looking for a lexer generator written in ruby or a language that I can easily understand to have an example but it seems all ruby lexer generators use regex ...
<zipR4ND>
because this is my project: https://github.com/ziprandom/cltk and I want to use it and I would really like to see it evolve into something that is usable for production needs
Guest90388 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
McSoFake has joined #crystal-lang
<FromGitter>
<sdogruyol> @zipR4ND i really think that having something useful as cltk is a great achievement for the language at this early days
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
olek_poz has quit [Ping timeout: 245 seconds]
<zipR4ND>
@sdogruyol cool, I'm still quite unsure as its my first project with the language and noone has used it until now. I'm thinking of writing a tutorila implementing a little toy language with it. still thinking about which language ..
<FromGitter>
<asterite> Also on mmap on mac: >``` MAP_ANON Map anonymous memory not associated with any specific file. The offset argument is ignored. Mac OS X specific: the file descriptor used for creat- ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58ebbbc1a0e4856242ee9875]
KCreate has quit [Ping timeout: 240 seconds]
KCreate has joined #crystal-lang
zipR4ND has quit [Ping timeout: 255 seconds]
KCreate has quit [Ping timeout: 255 seconds]
KCreate has joined #crystal-lang
<KCreate>
Okay I managed to map a file into memory :)
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: https://git.io/vSilH
<crystal-gh>
crystal/master c4bbb59 Ary Borenszweig: Removed old "see also" doc. Fixes #4267
bungoman has joined #crystal-lang
zipR4ND has quit [Ping timeout: 260 seconds]
<FromGitter>
<elorest> @sdogruyol have you tried compiling it with a swapspace?
<FromGitter>
<elorest> that's worked fine for us here at nikola.
zipR4ND has joined #crystal-lang
McSoFake has quit [Quit: No reason]
<FromGitter>
<drosehn> Hmm. Looks like there is no `find` module, like there is in ruby? (I can write something easy enough, but if crystal has a `find` then I should use that...)
<jhass>
BlaXpirit: can't get 0.7.7 or 0.7.6 running under playpen anymore on the new VM, so back to 0.8.0 must be enough
<BlaXpirit>
that's pretty good, thanks
bjz has joined #crystal-lang
_bowser_ has joined #crystal-lang
<FromGitter>
<drosehn> No. In ruby, there is a `Find` module which can be pulled in via `require 'find'`. What it implements is a ruby-way to search one or more directories in the file system, the way that you'd do with the `find` command on unix.
<FromGitter>
<drosehn> If it was not a separate module (the way it is in ruby), I'd expect to see it under `Fileutils` or maybe `File` or `Dir`.
<_bowser_>
So, I'm toying with crystal and building a pipeline thing
<_bowser_>
And I'm curious, is there a placeholder type that the compiler will actually accept?
<_bowser_>
e.g.
<_bowser_>
`_` in scala, haskell(?)
<_bowser_>
I need to keep a reference to a prior type, but one of the type parameters is inconsequential
<FromGitter>
<drosehn> It might be that you want to look at "generics".
<FromGitter>
<drosehn> (but I have never used them, so I won't be much help other than saying the word "generics")
<_bowser_>
well, while you are correct - what I am doing uses generics (too much, perhaps)
<_bowser_>
the compiler doesn't seem to be friendly to unbound types in certain scenarios
<_bowser_>
I think I've figured a type hierarchy that will please the compiler
<_bowser_>
in doing this, I have also managed to terribly upset the vim plugin, so I guess I'll have to fix that
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter>
<drosehn> Hmm. Looks like the `Find` module didn't appear in ruby until version 1.9.