jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.9.0 | Fund Crystals development: http://is.gd/X7PRtI | 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
elia has joined #crystal-lang
elia has quit [Quit: Computer has gone to sleep.]
reed_ has quit [Ping timeout: 272 seconds]
nakilon has joined #crystal-lang
nakilon has quit [Ping timeout: 265 seconds]
dylanmei has joined #crystal-lang
kgadek has quit [Quit: gone sleep]
Cidan is now known as zz_Cidan
zz_Cidan is now known as Cidan
matp has joined #crystal-lang
ssvb has quit [Ping timeout: 264 seconds]
ssvb has joined #crystal-lang
circ-user-bNaS0 has joined #crystal-lang
dylanmei has quit [Quit: ZZZzzz…]
nakilon has joined #crystal-lang
nakilon has quit [Ping timeout: 268 seconds]
dylanmei has joined #crystal-lang
A124 has quit [Read error: Connection reset by peer]
dylanmei has quit [Client Quit]
A124 has joined #crystal-lang
circ-user-bNaS0 has quit [Remote host closed the connection]
nakilon has joined #crystal-lang
nakilon has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 250 seconds]
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
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
nakilon has joined #crystal-lang
nakilon has quit [Ping timeout: 264 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
trapped has joined #crystal-lang
trapped has quit [Quit: Textual IRC Client: www.textualapp.com]
nakilon has joined #crystal-lang
nakilon has quit [Ping timeout: 268 seconds]
yie has quit [Remote host closed the connection]
nakilon has joined #crystal-lang
nakilon has quit [Ping timeout: 272 seconds]
elia has joined #crystal-lang
alsm has joined #crystal-lang
<alsm> Is there any list of currently known crystal libraries maintained anywhere?
BlaXpirit has joined #crystal-lang
blue_deref has quit [Quit: bbn]
nakilon has joined #crystal-lang
nakilon has quit [Ping timeout: 260 seconds]
alsm has quit [Remote host closed the connection]
alsm has joined #crystal-lang
Cidan is now known as zz_Cidan
<BlaXpirit> how can i get (a copy of) a column in a Matrix as an Array?
<BlaXpirit> .column(i).to_a
alsm has quit [Remote host closed the connection]
alsm has joined #crystal-lang
unshadow has joined #crystal-lang
gamemanj has joined #crystal-lang
reed_ has joined #crystal-lang
<BlaXpirit> does crystal have any unicode database? getting characters' names etc.
blassin has joined #crystal-lang
reed_ has quit [Ping timeout: 240 seconds]
vegai has left #crystal-lang [#crystal-lang]
<jhass> alsm: github search for language:crystal is your best bet
nakilon has joined #crystal-lang
nakilon has quit [Ping timeout: 268 seconds]
<BlaXpirit> how to get a random enum item?
<BlaXpirit> .values.sample
sardaukar has quit [Read error: Connection reset by peer]
sardaukar has joined #crystal-lang
ssvb has quit [Ping timeout: 272 seconds]
kgadek has joined #crystal-lang
<alsm> jhass: thanks
xdougx has joined #crystal-lang
<BlaXpirit> sigh, unicode data looks like a huge pain to put into a language, if you wanna get it right
xdougx has quit [Read error: Connection reset by peer]
<jhass> it's a complex topic
trapped has joined #crystal-lang
<jhass> BlaXpirit: you're looking into all of CLDR or just something particular for now?
<BlaXpirit> jhass, don't know what "CLDR" is
<BlaXpirit> jhass, i dunno, just these things https://docs.python.org/dev/library/unicodedata.html
xdougx has joined #crystal-lang
<BlaXpirit> mainly first 2 functions
<jhass> well, that's two hash maps?
<BlaXpirit> pretty much
<BlaXpirit> but do note that there is a huge amount of overlap between these names. it would be wasteful to not compress it
<jhass> yeah, there's probably some nifty tree structure one can use
<jhass> I've seen something fitting once, trying to remember its name
<BlaXpirit> what, prefix tree?
<jhass> just a Trie should work well in fact https://en.wikipedia.org/wiki/Trie
<BlaXpirit> same thing :p
<jhass> yeah
<BlaXpirit> the overlap is not only at the start but that should cover 80% of it
<ytti> hash is significantly more performant than trie
<ytti> but trie is needed for non-exact lookups
<BlaXpirit> u dont want to store 1.5 MB of data in two hash tables
<jhass> well, we're actually more looking for something memory efficient, trie that doesn't repeat the prefix in the nodes basically I guess
<BlaXpirit> another problem is distributing it with programs
<jhass> we really need an "arbitrary byte sequence" literal :/
nakilon has joined #crystal-lang
<buggs> suffix array
blassin has quit [Quit: Page closed]
nakilon has quit [Ping timeout: 268 seconds]
dylanmei has joined #crystal-lang
ssvb has joined #crystal-lang
<crystal-gh> [crystal] ysbaddaden pushed 2 new commits to master: http://git.io/vWoNC
<crystal-gh> crystal/master 1ade40a Benoist Claassen: added OpenSSL::Digest
<crystal-gh> crystal/master 62757d7 Julien Portalier: Merge pull request #1806 from benoist/feature/openssl-digest...
<BlaXpirit> gaaah how to yield recursively
<BlaXpirit> say i want to implement depth-first search recursively, and it yields every item on the way
<BlaXpirit> here is my attempt at a stupid recursive function http://carc.in/#/r/ki8
<BlaXpirit> doesn't work, of course, no matter what i try
<jhass> BlaXpirit: http://carc.in/#/r/ki9
<crystal-gh> [crystal] jhass closed pull request #1785: Add documentation to Random module (master...add-doc) http://git.io/vCjlt
<BlaXpirit> thanks
unshadow has quit [Quit: leaving]
<crystal-gh> [crystal] jhass pushed 2 new commits to master: http://git.io/vWojc
<crystal-gh> crystal/master 8569e76 Adler: add Hash#key & Hash#key?
<crystal-gh> crystal/master 0cd4f5e Jonne Haß: Merge pull request #1759 from adlerhsieh/add-code...
<crystal-gh> [crystal] jhass pushed 2 new commits to master: http://git.io/vWKeJ
<crystal-gh> crystal/master efb70bf Jake Waksbaum: time/span: add / and + methods
<crystal-gh> crystal/master b11b2b0 Jonne Haß: Merge pull request #1742 from jbaum98/master...
pawnbox_ has joined #crystal-lang
<xdougx> jhass: hello, process 250000 rows with validations and database consults, last at least 40 minutos, is a good time for crystal?
<xdougx> minutes*
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vWKJm
<crystal-gh> crystal/master d1d7eb5 Ary Borenszweig: Fixed #1823: wrong logic in exception handler
<jhass> xdougx: I have no experience in that regard. I'd assume most time is spent in the database queries?
kostya has joined #crystal-lang
<xdougx> jhass: i think so, is between 0.006 and 0.06 the required time to process select, insert and update
pawnbox has quit [Ping timeout: 256 seconds]
<xdougx> jhass: started a process 25 minutos ago already processed 82000 rows
<xdougx> jhass: i think is going to last 1 hour
dylanmei has quit [Quit: ZZZzzz…]
<jhass> if you have some memory to spend, usually minimizing the amount of roundtrips can do wonders
<jhass> like do a single select to read everything, do a single insert (you can insert multiple rows with a single one), maybe even aggregate the update's where possible
alanwillms has joined #crystal-lang
pawnbox_ has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
nakilon has joined #crystal-lang
nakilon has quit [Ping timeout: 246 seconds]
Renich has joined #crystal-lang
<xdougx> jhass: wish i could do it, but is needed to run each row time, maybe run from the start to middle and middle+1 to end
<jhass> concurrent reads over multiple connections can help to speed things up, concurrent writes to the same table not so much
<jhass> not sure how much locking is done on conflict free updates these days
<xdougx> jhass: i see, it could be a probleman
kgadek has quit [Quit: gone sleep]
matp has quit [Remote host closed the connection]
<xdougx> type is a reserved word?
zz_Cidan is now known as Cidan
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
<jhass> xdougx: yup, type is similar to alias
<jhass> except that you can't cast between the two or whatever the difference was
<xdougx> jhass: but if i use @type = 'my type', will it be a probleman?
reed_ has joined #crystal-lang
<xdougx> >> puts @type = "hello"
<DeBot> xdougx: can't use instance variables at the top level - http://carc.in/#/r/kj7
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<xdougx> >> puts type = "hello"
<DeBot> xdougx: hello - more at http://carc.in/#/r/kj8
<jhass> >> def type; end; type
<DeBot> jhass: # => nil - http://carc.in/#/r/kj9
<jhass> mh
<jhass> interesting
kgadek has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Read error: Connection timed out]
kgadek has quit [Client Quit]
sdogruyol has joined #crystal-lang
<sdogruyol> is there a built-in way to parse form parameters in http post requests
kgadek has joined #crystal-lang
kgadek has quit [Client Quit]
BlaXpirit has quit [Quit: Konversation]
<xdougx> jhass: should it raise a error?
trapped has joined #crystal-lang
kgadek has joined #crystal-lang
<jhass> xdougx: I'm not sure, but probably
<jhass> sdogruyol: HTTP::Params.parse
<sdogruyol> jhass: thanks let me check
<CompanionCube> hm. Someone should write a port of Thor for Crystal. I don't have the skills required myself
<jhass> how do you know you don't?
<jhass> I bet you can learn tons just by trying, even if you don't succeed
kgadek has quit [Client Quit]
<CompanionCube> for some reason I imagine it involves advanced metaprogramming
pawnbox_ has quit [Read error: Connection reset by peer]
<sdogruyol> CompanionCube: you should try like jhass said
<CompanionCube> I will :)
<sdogruyol> and there's always Thor source code to guide you :P
pawnbox has joined #crystal-lang
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kgadek has joined #crystal-lang
canhtak has joined #crystal-lang
nakilon has joined #crystal-lang
canhtak has quit [Quit: canhtak]
kgadek has quit [Quit: gone sleep]
nakilon has quit [Ping timeout: 240 seconds]
<xdougx> jhass: wow
<xdougx> jhass: started to not find an constant that is inside the same folder and even with require "./file" get undefined constant
<jhass> xdougx: you know, I don't see your screen, I have no idea
<jhass> xdougx: if you want help with a problem, make me able to reproduce it locally
<xdougx> jhass: i know, srry, btw do you any reason?
AckZ has joined #crystal-lang
<jhass> see above
<jhass> it's way to vague to guess anything
<xdougx> no idea how to you reproduce it
<xdougx> jhass: the compiled files goes to the .crystal folder, right?
pawnbox_ has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
<jhass> by default, yes
<jhass> well, the intermediate results
alsm has quit [Ping timeout: 240 seconds]
alanwillms has quit [Quit: Saindo]
fowlduck has joined #crystal-lang
pawnbox_ has quit [Read error: Connection reset by peer]
BlaXpirit has joined #crystal-lang
pawnbox has joined #crystal-lang
elia has quit [Quit: Computer has gone to sleep.]
McDougal has joined #crystal-lang
<McDougal> Hi, I was wondering how ready Crystal is for web development?
arcwest1 has joined #crystal-lang
kostya has quit [Remote host closed the connection]
<jhass> McDougal: 23 ready (I have no idea of the scale though)
Cidan is now known as zz_Cidan
<McDougal> Is it still in beta phase, it looks promising for those of us from a ruby background
pawnbox has quit [Read error: Connection reset by peer]
<McDougal> jhass: I see there are some micro frameworks which should suffice
<jhass> McDougal: yup, I wrote the backends for carc.in and p.jhass.eu in artanis
<jhass> McDougal: but you can expect breaking changes with every release
<McDougal> jhass: V nice. What are you using to render html & for sessions. Is there a postgres driver or a rubygems style repo?
pawnbox has joined #crystal-lang
<jhass> carc.in has a ember.js frontend that's served statically, the backend just provides JSON endpoints
<jhass> p.jhass.eu uses ECR (ERB for Crystal)
nakilon has joined #crystal-lang
<jhass> (and a grunt pipeline for the static stuff)
<jhass> didn't see anything with session support yet
<jhass> postgres driver is at http://github.com/will/crystal-pg
<jhass> best bet for finding things is github search with language:crystal, http://crystalshards.herokuapp.com/ is basically a frontend for that
pawnbox has quit [Remote host closed the connection]
<McDougal> jhass: thanks, when do you feel this will be version 1.0?
<jhass> I don't know
<jhass> maybe somewhere in 2017
<jhass> that doesn't mean it's not usable beforehand
<McDougal> I'm doing rails mostly but looking at go and elixir at the moment which brought me to crystal. I tried crystal and had a pretty smooth experience
<McDougal> I think a microwebframework is probably usable today
elia has joined #crystal-lang
zz_Cidan is now known as Cidan
<jhass> the edges are not polished yet, but yeah, artanis is fairly usable
<sdogruyol> i forked frank and currently developing this https://github.com/kemalcr/kemal
<asterite> jhass: I don't understand, what concurrency issues?
<jhass> I mean the threaded scheduler and all the thread safety issues that will arise from it
<asterite> But that can be done in the standard library without breaking existing code
<jhass> this is about prioritizing effort
<asterite> And you can already do it in single thread mode. Node.js works like that and it's pretty popular and fast
<asterite> Well, if we focus now on the concurrency and later change the language, all code breaks
<asterite> If we change it now, less code will break
<jhass> asterite: I'd suggest you start reading logs here again. People ask for it once or twice a week minimum
<asterite> So I can't imagine why you would prefer to break code later than sooner
<jhass> it would be a _giant_ selling point
<asterite> That's the point: we don't sell the language
<sdogruyol> jhass +1
<asterite> We don't want to do something quick and dirty so that everyone will start using the language only to find out it's broken
<jhass> well, I also hope that these issues might eventually be solved with less explicitness if given a bit more time
<jhass> solving them now swiftly through explicitness will reduce 30% of the appeal of the language
<jhass> I still hope for procs to become less explicit but all recent changes favor explicitness
<asterite> Well, if somebody finds an algorithm that will scale that way, we are open for suggestions
<jhass> which will be even harder to integrate when you change the language design now to favor explicitness
<jhass> finding solid concurrency primitives might even allow to parallelize parts of the type inference, idk
<asterite> Imagine a project that depends on 10, 20 or more libraries, like typical projects. Would you prefer to wait 30 seconds but keep things implicit every time you compile, or add a bunch of trivial type annotations and compile that in 1 second?
<asterite> The problem is that right now such project doesn't exist, but it will
<jhass> ever heard of premature optimization?
<jhass> anyway, I don't want to fight over this, now you know my opinion, that's all I can give
<asterite> It's not premature, the compiler already takes 5 seconds for type inference
<asterite> And that's just 40 thousands lines of code
<asterite> At work we have an app with 200k lines, and that without counting gems
<asterite> Thanks. We definitely appreciate your opinion. But if we don't tackle this now the worry will remain. The threaded scheduler and so on are solved problems, it's just a matter of time. The language needs a lot more thought
<jhass> interesting, if it's a solved problem you would've have somebody willing to spend time implementing it. Just saying.
<asterite> Let's not fight :-)
<sdogruyol> have to admit that was tough to watch :P
<McDougal> sdogruyol: thanks ref kernal. So session handling & html template options available?
<sdogruyol> agree on not fighting
* CompanionCube would prefer as few type annotations as possible
<sdogruyol> McDougal: not yet
<McDougal> sdogruyol: Gotcha, so we have to bide our time for a little bit
<sdogruyol> McDougal: yeah the thing is that lots of stuff are missing but improving :)
<McDougal> sdogruyol: It looks v promising though, the concurrency story will be interesting as a comparison with elixir/erlang
<sdogruyol> McDougal: yeah it'll be :)
<CompanionCube> hm
<CompanionCube> is it not possible to let the user decide if they want to make the trade-off?
<sdogruyol> CompanionCube: how could you achieve something like that?
<CompanionCube> sdogruyol, just an idea
<sdogruyol> CompanionCube: yeah sounds OK but is there any example for that?
<CompanionCube> sdogruyol, hm. I can't seem to think of one :(
Renich has quit [Quit: leaving]
Renich has joined #crystal-lang
<CompanionCube> You *could* have it as some command-line flag but how it'd be implemented I have no idea
elia has quit [Ping timeout: 240 seconds]
elia has joined #crystal-lang
Renich has quit [Ping timeout: 244 seconds]
jwaldrip has joined #crystal-lang
Renich has joined #crystal-lang
sdogruyol has quit [Read error: Connection reset by peer]
sdogruyol has joined #crystal-lang
<xdougx> jhass: if im inside a module ::Const will get the toplevel contant?
<jhass> xdougx: it should
Renich has quit [Ping timeout: 272 seconds]
BlaXpirit has quit [Quit: Konversation]
Renich has joined #crystal-lang
BlaXpirit has joined #crystal-lang
<xdougx> nide
<xdougx> nice
McDougal has quit [Quit: Textual IRC Client: www.textualapp.com]
leafybasil has joined #crystal-lang
jwaldrip has quit [Quit: Be back later ...]
BlaXpirit has quit [Quit: Konversation]
jwaldrip has joined #crystal-lang
BlaXpirit has joined #crystal-lang
<xdougx> difference betwen frank and kemal?
<xdougx> whats the difference between frank and kemal?
fowlduck has quit [Quit: Leaving...]
BlaXpirit has quit [Client Quit]
jwaldrip has quit [Ping timeout: 240 seconds]
BlaXpirit has joined #crystal-lang
sdogruyol has quit [Remote host closed the connection]
blue_deref has joined #crystal-lang
arcwest1 has quit [Ping timeout: 246 seconds]
jwaldrip has joined #crystal-lang
xdougx has quit [Remote host closed the connection]
kgadek has joined #crystal-lang
xdougx has joined #crystal-lang
kgadek has quit [Client Quit]
xdougx has quit [Ping timeout: 250 seconds]
reed_ has quit [Ping timeout: 240 seconds]
fowlduck has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vWiBD
<crystal-gh> crystal/master 7037b95 Ary Borenszweig: Fixed #1760: show inherited class methods in docs
McDougal has joined #crystal-lang
toydestroyer has quit [Ping timeout: 256 seconds]
toydestroyer has joined #crystal-lang
greengriminal has joined #crystal-lang
fowlduck has quit [Remote host closed the connection]
McDougal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
McDougal has joined #crystal-lang
<jokke> jhass: hey
<jokke> i'm a bit confused about Time#-
<jokke> i'm trying to subtract seconds from a time object
<jhass> >> Time.now - 20.seconds
<DeBot> jhass: # => 2015-10-26 21:07:47 +0000 - http://carc.in/#/r/kjk
<jokke> aaaah
<jokke> omg!
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vWii7
<crystal-gh> crystal/master 9d324df Ary Borenszweig: HTTP::Request: don't use delegate to improve API docs
<jokke> that's too awesome!
<jokke> thanks
McDougal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vWiPd
<crystal-gh> crystal/master b5ccd5c Ary Borenszweig: HTTP::Request: say "lazily parses and returns" instead of just "lazily parses"
canhtak has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
canhtak has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
canhtak has joined #crystal-lang
Ven has quit [Client Quit]
canhtak has quit [Ping timeout: 264 seconds]
shama has joined #crystal-lang
fowlduck has joined #crystal-lang
canhtak has joined #crystal-lang
McDougal has joined #crystal-lang
McDougal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
McDougal has joined #crystal-lang
trapped has joined #crystal-lang
greengriminal has quit [Quit: Leaving]
gamemanj has quit [Ping timeout: 260 seconds]
canhtak has quit [Ping timeout: 268 seconds]
canhtak has joined #crystal-lang
<jokke> jhass: how would i do a non blocking gets on stdin?
trapped has quit [Quit: Textual IRC Client: www.textualapp.com]
<jhass> read_nonblock is still a thing I think?
<jokke> hmm
<jokke> i need to specify a size
<jokke> jhass: maybe i should just two threads
<jokke> *make
<crystal-gh> [crystal] rosylilly opened pull request #1825: Allow plus and hyphen in markdown list (master...allow-plus-and-hyphen-in-markdown-list) http://git.io/vWPty
trapped has joined #crystal-lang
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jokke> jhass: am i blind or is there really no docs whatsoever for fibers and concurrency in general?
<jhass> you're not blind
<jokke> i'm trying to spawn two fibers and wait for them to finish
<jhass> use a channel
<jhass> receive twice
<jokke> mh ok
<jokke> so channel receive blocks?
<jhass> yes
<jhass> note unless you do IO inside them that's pointless atm
<jokke> i would also need a channel which doesn't block :/
<jokke> yeah i'm doing io
<jhass> a buffered channel doesn't block on send unless full and doesn't block on receive unless empty
<jokke> yeah i need it not to block even if it's empty
<jhass> and then?
<jokke> return nil
<jhass> why?
<jokke> i'm doing stuff periodically in this one fiber. it should receive stuff from a channel if there is anything new and then do stuff with it
<jokke> if there's nothing new it should just continue doing what it's doing
<jhass> use two separate coroutines
<jokke> fibers aren't coroutines?
<jhass> they are
<jhass> the little bits asterite & waj mentioned indicate they consider Fiber an internal so I try to establish the general term
<jokke> ok
<jokke> anyway
<jokke> i have two spawns
<jokke> so i have two coroutines
<jokke> one of which feeds the channel and one of which consumes it
<jokke> seems that i can't even check if a channel is empty
<jhass> I don't see the issue yet
<jokke> oh i can
<jhass> but so far it doesn't sound like you should
<jokke> awesome
<jokke> oh i can dump that fiber =
<jhass> well, as long as there's not parallelism you could just closure both over last_text and set it directly
<jokke> mmh true
nakilon has quit [Ping timeout: 256 seconds]
<BlaXpirit> so is there currently any way to parallelize heavy computations?
<jokke> BlaXpirit: raw Threads
<jokke> but it's hacky
<jokke> there's no queue for example
<jokke> (none that would be backed by real mutexes)
BlaXpirit has quit [Quit: Konversation]
ssvb has quit [Ping timeout: 250 seconds]
benner_ has quit [Read error: Connection reset by peer]
benner has joined #crystal-lang
CompanionCube has quit [Quit: ZNC - http://znc.in]
CompanionCube has joined #crystal-lang
CompanionCube has quit [Changing host]
CompanionCube has joined #crystal-lang
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]