RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.19.2 | 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
johnjansen has joined #crystal-lang
<FromGitter> <raydf> Nice @johnjansen, thanks and already starred it.
johnjansen has quit [Client Quit]
txdv has joined #crystal-lang
ruby_ has quit [Remote host closed the connection]
ruby_ has joined #crystal-lang
ruby__ has joined #crystal-lang
ruby_ has quit [Ping timeout: 264 seconds]
ruby__ has quit [Ping timeout: 264 seconds]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vPUt3
<crystal-gh> crystal/master 4c2b242 Ary Borenszweig: Fixed incorrect assignment. Fixes #3363
ruby_ has joined #crystal-lang
ruby_ has quit [Remote host closed the connection]
ruby_ has joined #crystal-lang
<travis-ci> crystal-lang/crystal#4c2b242 (master - Fixed incorrect assignment. Fixes #3363): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/163584149
<DeBot> https://github.com/crystal-lang/crystal/issues/3363 (Heads up on probably unintentional code L2483)
kulelu88 has quit [Quit: Leaving]
johnjansen has joined #crystal-lang
<FromGitter> <johnjansen> anyone know of a sparse matrix implementation (or bindings)
pawnbox has joined #crystal-lang
jamie_ca has quit [Remote host closed the connection]
jamie_ca has joined #crystal-lang
Papierkorb has quit [Ping timeout: 250 seconds]
Papierkorb has joined #crystal-lang
leafybasi has quit [Ping timeout: 250 seconds]
leafybasi has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
ruby_ has quit [Remote host closed the connection]
johnjansen has quit [Quit: johnjansen]
ruby_ has joined #crystal-lang
ruby_ has quit [Remote host closed the connection]
ruby_ has joined #crystal-lang
ome has joined #crystal-lang
soveran has joined #crystal-lang
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]
onethirtyfive has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
mark_66 has joined #crystal-lang
Philpax has quit [Ping timeout: 264 seconds]
<BlaXpirit> johnjansen, just use a Hash? unless you need like a math-y matrix
ruslux has joined #crystal-lang
ruslux has quit [Ping timeout: 240 seconds]
ponga has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
ome has quit [Quit: Connection closed for inactivity]
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
onethirtyfive 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
pawnbox has quit [Remote host closed the connection]
pawnbox 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]
soveran has joined #crystal-lang
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
pawnbox has quit [Remote host closed the connection]
<FromGitter> <sdogruyol> might be a silly question but how can i parse YAML with subkeys
<FromGitter> <sdogruyol> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=57ecfe13857ab70f7d4f368d]
<FromGitter> <sdogruyol> meanwhile i'm using a YAML.mapping
<crystal-gh> crystal/master 6837098 Ary Borenszweig: Compiler: set return, break and next type to NoReturn. Fixes #3364
<crystal-gh> crystal/master 425e0c5 Ary Borenszweig: Compiler: small simplification
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vPTJx
pawnbox has joined #crystal-lang
bjz_ has joined #crystal-lang
Philpax has joined #crystal-lang
bjz__ has joined #crystal-lang
bjz_ has quit [Read error: Connection reset by peer]
bjz__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
globalkeith has joined #crystal-lang
globalkeith has quit [Client Quit]
bjz has quit [Read error: Connection reset by peer]
bjz has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<wmoxam> 🤔🤔🤔
pawnbox has quit [Remote host closed the connection]
<wmoxam> ^^ seems to be crashing when accessing the Fiber's @name attribute
pawnbox has joined #crystal-lang
ruby_ has quit [Remote host closed the connection]
ruby_ has joined #crystal-lang
ruby_ has quit [Ping timeout: 276 seconds]
pawnbox has quit [Remote host closed the connection]
mark_66 has quit [Remote host closed the connection]
mark_66 has joined #crystal-lang
pawnbox has joined #crystal-lang
<asterite> wmoxam: if you use Thread, any program will crash
<wmoxam> asterite: I was just trying to test OpenBSD + Thread.current ... was able to test by looking at #object_id instead of #inspect
<wmoxam> :D
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<FromGitter> <johnjansen> @BlaXpirit i really need an actual sparse matrix since this will be used for some very large matricies which are mostly 0’s which will then be multiplied by another matrix
<BlaXpirit> johnjansen, well if u need only matrix multiplication, there's still no problem with using a Hash({Int32, Int32}, Value) and implementing multiplication
<BlaXpirit> that might be the easiest approach currently
LastWhisper____ has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
bjz has quit [Ping timeout: 276 seconds]
bjz_ has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 276 seconds]
pawnbox_ has joined #crystal-lang
pawnbox_ has quit [Ping timeout: 272 seconds]
<asterite> I think for a classifier you'd need a very specific/optimized sparse matrix implementation... at least I remember we did that in a project where we used classifiers, stemmers, etc.
Philpax has quit [Ping timeout: 272 seconds]
ruby_ has joined #crystal-lang
<FromGitter> <johnjansen> @asterite you know what im up to ;-)
<FromGitter> <johnjansen> @asterite i dont know if you have come across this before, but a large reason that much of silicon valley uses python is due to its good math offerings, this might be a good thing to keep in mind as you consider stdlib candidates
<BlaXpirit> johnjansen, nothing to do with stdlib specifically :|
mark_66 has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<FromGitter> <johnjansen> maybe not … although, adding some of this stuff to the “core” for want of a better word would lower the barrier to entry and make the language more attractive. Its a totally artificial barrier, but there is no doubt in my mind that out of the box support for serious math would show an intent to serve that market segment. Personally, this isnt something i do all day every day, so im not invested in this myself, I have
<FromGitter> ... however become tired of the python is better than ruby for math argument. To my mind, Crystal has the distinct advantage of being naturally fast, and of course the language is easy to handle. Seems like a bit of math/sci might make it killer for ML, NLP and all AI … would be great to be the `GO` of AI …
soveran has quit [Remote host closed the connection]
<FromGitter> <mverzilli> we've been playing with LAPACK/BLAS bindings here: https://github.com/mverzilli/crystalla
<FromGitter> <mverzilli> here's a quick benchmark we've run against numpy: https://manas.tech/blog/2015/10/30/linear-algebra-in-crystal-from-lapack.html
<FromGitter> <johnjansen> thanks @mverzilli i had a look at that, svd looks interesting, didn’t have a good look at the matrix for to see if it was compressed though
<FromGitter> <mverzilli> the one there isn't, but at least it's a POC of how an idiomatic Crystal API that binds to LAPACK/BLAS underneath would work
<FromGitter> <johnjansen> benchmarks look good, and really accentuate my point, an order of magnitude fast at math than python, but with ruby semantics … thats awesome
<FromGitter> <johnjansen> totally
<FromGitter> <mverzilli> BLAS seems to have some sparse specific functions
<FromGitter> <johnjansen> thanks for that link …
<FromGitter> <mverzilli> so maybe a thing to try is expose that through Crystalla
<FromGitter> <johnjansen> ill take a look, thanks Martin
soveran has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
ruby_ has quit [Remote host closed the connection]
ruby_ has joined #crystal-lang
ruby_ has quit [Ping timeout: 264 seconds]
AckZ has joined #crystal-lang
ruby_ has joined #crystal-lang
ruby_ has quit [Client Quit]
<FromGitter> <johnjansen> OK all, out of curiosity and my sudden addiction to crystal (not meth) im going to have a hack at porting spicy.sparse.csr_matrix to pure crystal … is this of interest to anyone else? ⏎ ⏎ http://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csr_matrix.html#scipy.sparse.csr_matrix
soveran has quit [Remote host closed the connection]
<FromGitter> <mverzilli> sounds cool!
<FromGitter> <sdogruyol> @johnjansen that's interesting
<FromGitter> <jwoertink> @johnjansen Aside from remaking tetris, or some 2d RPG, what would be a good use for that?
<FromGitter> <jwoertink> My 2 examples were the only times I saw a need, but I'm curious what other people would use it for
ssvb has joined #crystal-lang
<FromGitter> <johnjansen> @jwoertink classification, clustering etc
<FromGitter> <jwoertink> Is that for machine learning type stuff?
<FromGitter> <johnjansen> in a round about way, image you have a large number of documents, and you want a way of discovering all the subjects covered by the documents … here is a TED talk which on the subject which shows an actual example … we mined TED’s transcript to get this data together https://www.ted.com/talks/eric_berlow_and_sean_gourley_mapping_ideas_worth_spreading?language=en
<FromGitter> <jwoertink> oh nice! Thanks for the explanation. That's pretty awesome
<FromGitter> <johnjansen> oh @jwoertink are you going to write a crystal api wrapper for namechk BTW ?
<FromGitter> <jwoertink> Most likely :)
<FromGitter> <jwoertink> I'm looking at moving the API to crystal once a few more things get in to kemal
<FromGitter> <sdogruyol> @jwoertink like what?
<FromGitter> <jwoertink> Some of those session thing I saw issues on
<FromGitter> <jwoertink> like CSRF protection and stuff
<FromGitter> <sdogruyol> CSRF is already built-in
<FromGitter> <sdogruyol> i mean there's a handler for that
<FromGitter> <jwoertink> oh?
<FromGitter> <sdogruyol> and session is pretty much working (i know it's simple)
<FromGitter> <jwoertink> I must have missed that. I thought I saw an issue
<FromGitter> <sdogruyol> mike did a great job at this
<FromGitter> <jwoertink> sweet. Yeah, I guess I missed that. I guess I need to see if anything else is missing
<FromGitter> <jwoertink> thanks! :D
<FromGitter> <sdogruyol> cool, just let me know :)
<FromGitter> <johnjansen> @sdogruyol @mverzilli here is the sparse matrix repo, ill plug away at it as time allows … there is a stub there so far, this should be fun
<FromGitter> <sdogruyol> @johnjansen you are pretty fast :P
<FromGitter> <jwoertink> @johnjansen That's awesome
<FromGitter> <johnjansen> haha, not much done yet Serdar
ponga has quit [Quit: Connection closed for inactivity]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
<FromGitter> <sdogruyol> it's good
<FromGitter> <johnjansen> thanks ;-)
soveran has joined #crystal-lang
<FromGitter> <johnjansen> oh @sdogruyol i meant to tell you, klassify, which it looks like you want to port to Kemel, is slow as a dog when its loaded with data …
<FromGitter> <sdogruyol> i meant to port it but never got to
<FromGitter> <sdogruyol> klassify developer is actually a friend of mine
<FromGitter> <sdogruyol> a python developer
<FromGitter> <johnjansen> Its fine training it, but classification is diabolical if you have any amount of data … oops, well i cant help the facts
<FromGitter> <johnjansen> ;-)
<FromGitter> <johnjansen> if you still want to do it, you will need that stemmer and a tokenizer, which i have on my list a word and sentance tokenizer port from NLTK
<FromGitter> <sdogruyol> @johnjansen i'm not familiar with those topics
<FromGitter> <johnjansen> haha, lets just say the web server is not the bottleneck — certainly not with Kemal
<FromGitter> <johnjansen> but even with a python server …
<FromGitter> <johnjansen> for that matter, any server
<FromGitter> <sdogruyol> well if you say that it's really slow
<FromGitter> <sdogruyol> must be data cruncing that's really taking time, right?
<FromGitter> <johnjansen> in the case of Klassify, its the score computations which happen on each request to classify
<FromGitter> <johnjansen> at least thats what i think it is without any real poking
<FromGitter> <sdogruyol> yeah
<FromGitter> <raydf> Hi, I'm having this error in macos, i'll appreciate any help :) ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=57ed62e234a8d5681ccb4bce]
<BlaXpirit> what does this have to do with macros???????
<FromGitter> <raydf> mac os :).
<FromGitter> <raydf> sorry
<FromGitter> <raydf> why clang can't be linked?
<FromGitter> <raydf> i'm a noob in c.
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<BlaXpirit> a better question would be why clang wants to be linked
<BlaXpirit> and i can't guess that without any information
<FromGitter> <raydf> I'm testing the example in https://github.com/crystal-lang/crystal_lib
<FromGitter> <raydf> This is the code: ⏎ ```crystal src/main.cr -- examples/lib_git2.cr``` [https://gitter.im/crystal-lang/crystal?at=57ed650534a8d5681ccb5493]
<FromGitter> <jwoertink> @raydf I just ran in to this. I had to uninstall crystal, llvm and something else. Let me see if I can find the github issue that mentioned it
<FromGitter> <jwoertink> oh, actually, wasn't an issue
<FromGitter> <jwoertink> run the `xcode-select --install` and `xcode-select --switch /Library/Developer/CommandLineTools`
<FromGitter> <jwoertink> I think that's what it was
kulelu88 has joined #crystal-lang
<FromGitter> <raydf> @jwoertink , that fixed it. Thanks.
<FromGitter> <raydf> only needed ```xcode-select --switch /Library/Developer/CommandLineTools```
Ven_ has joined #crystal-lang
LastWhisper____ has joined #crystal-lang
<FromGitter> <raydf> Thanks @BlaXpirit
<BlaXpirit> nah I didn't do anything. sorry for misreading :(
<FromGitter> <johnjansen> anyone know if you can alias methods ala ruby
<BlaXpirit> johnjansen, it is discouraged
<FromGitter> <johnjansen> but is it possible
<BlaXpirit> def alias_meth(*args, **kwargs); meth(*args, **kwargs); end
<FromGitter> <johnjansen> ?
<BlaXpirit> or make a macro that writes out code like that, then use it
<FromGitter> <johnjansen> yeah, seems like the plan, thanks
aarongodin_ has joined #crystal-lang
avdi_ has joined #crystal-lang
avdi has quit [Ping timeout: 252 seconds]
aarongodin has quit [Ping timeout: 252 seconds]
aarongodin_ is now known as aarongodin
[spoiler] has quit [Ping timeout: 252 seconds]
avdi_ is now known as avdi
[spoiler] has joined #crystal-lang
bazaar_ has joined #crystal-lang
bazaar has quit [Ping timeout: 252 seconds]
aarongodin has quit [Read error: Network is unreachable]
aarongodin has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
Ven_ has quit [Ping timeout: 244 seconds]
<FromGitter> <sdogruyol> I'm having a weird issue
<FromGitter> <sdogruyol> isn't Array(String | Int32 | Float64 | Bool) supposed to be a combination of any types defined
<FromGitter> <sdogruyol> so i'm expecting to accept all of these as correct [1,2,3,4, "string", true, 999.9], [1,2,3], ["a", "b"]
<asterite> [1, 2, 3] is Array(Int32), so not compatible with Array(String | Int32 | Float64 | Bool)
<asterite> you'd need to write [1, 2, 3] of String | Int32 | Float64 | Bool
<FromGitter> <sdogruyol> ugh
<FromGitter> <sdogruyol> so i thought that it'd accept all combinations containing any of that types
<FromGitter> <sdogruyol> do i have to explicitly tell all the type combinations?
<asterite> maybe you want Object, but for that you'll need to wait a bit...
<FromGitter> <sdogruyol> Array(Int32) | Array(Int32, String) | Array(Int32, Float64) | Array(Int32, String) e.g
<FromGitter> <sdogruyol> @asterite yeah, i definitely want that :P
<FromGitter> <sdogruyol> with that Crystal would be awesome
Ven_ has joined #crystal-lang
<FromGitter> <cjgajard> @asterite, why is not possible to do `[] of Reference`? all its childs are indexable by 8 bytes (on 64bit machines)... Am I forgetting something?
<BlaXpirit> cjgajard, who said it wasn't possible
<BlaXpirit> it's just not done
<BlaXpirit> asterite says even [] of Object (which is absolutely everything not just Reference) will be possible
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ven_ has quit [Ping timeout: 244 seconds]
<FromGitter> <cjgajard> Oh, sorry, I just meant now (0.19.2).. I understand why `[] of Object` is harder to implement, but Reference... Has it an extra difficulty?
<BlaXpirit> well i'm sure the difficulty isn't in the memory layout but in the resolution algorithm. i don't know it though so i'm left to guessing
<BlaXpirit> for Reference itself, as I understand it, the memory layout can stay exactly the same. a Reference-based object always has the class ID first
Ven_ has joined #crystal-lang
<FromGitter> <crisward> I'm using db.mapping macro with crystal-sqlite module. sqlite uses int64. I'm only using sqlite in memory as a replacement for mysql. My mapping specifies my integers as int32. If I make the row nillable, I get the error - `cast from Int64 to (Int32 | Nil) failed, at /Users/cris/Desktop/projects/crystal-duocms/libs/db/db/result_set.cr:79`
<BlaXpirit> crisward, hm yeah, that is quite clear, not sure what to do to solve it though
<BlaXpirit> an Int32 fits into an Int32? variable, an Int64 can be casted to Int32 but casting to (Int32 | Nil) is just not a thing
<FromGitter> <crisward> Is there anyway to avoid the cast if the return value is nil?
<BlaXpirit> return value?
<FromGitter> <crisward> sorry, the value in the result set.
<BlaXpirit> obviously you could just use Int64 in your mapping. or not use mapping at all. i don't see a good solution :(
jadams has quit [Ping timeout: 252 seconds]
<FromGitter> <crisward> int64 works, but then when I switch to mysql, it breaks the other way.
<FromGitter> <crisward> I'll have a mess, see if I can find a solution
Ven_ has quit [Ping timeout: 264 seconds]
soveran has quit [Remote host closed the connection]
Ven_ has joined #crystal-lang
ryanf has quit [Ping timeout: 252 seconds]
matp_ has joined #crystal-lang
emancu has joined #crystal-lang
matp has quit [Ping timeout: 244 seconds]
matp_ is now known as matp
ryanf has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Remote host closed the connection]
<FromGitter> <johnjansen> @crisward `[Int64].to_i` before assignment to (Int32 | Nil)?
soveran has joined #crystal-lang
soveran_ has joined #crystal-lang
<BlaXpirit> well yeah but the problem is there no way to plug into the code to write that anywhere
soveran has quit [Read error: Connection reset by peer]
<BlaXpirit> goes directly from the database to db.mapping
soveran_ has quit [Remote host closed the connection]
<FromGitter> <johnjansen> ahh ok my bad
<FromGitter> <johnjansen> Question: is there any way to pass an operator to a macro as a parameter i.e. `define_simple_equation *`
<Papierkorb> :* ?
<FromGitter> <johnjansen> Papier, was that a question or a statement ?
<Papierkorb> latter
<FromGitter> <johnjansen> so `define_simple_equation *?`
<Papierkorb> :*
<Papierkorb> Pass it as symbol
<FromGitter> <johnjansen> doesnt work, as the ‘:’ is output as code
<Papierkorb> Please gist the code and any error message you get
<FromGitter> <johnjansen> unless there is some macro magic im missing, i wind up with `def :*(value : Number); r = dup; r.a = r.map{ |i| i :* value }; r; end` <- note the `:*`
<Papierkorb> What has the above snippet to do with macros?
<FromGitter> <johnjansen> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=57ed9e32d38f186520b10ac1]
<FromGitter> <raydf> @johnjansen, there's a converter in the mapping macros for the Int64 case
<Papierkorb> And now call #id on the operator inside the {{ }}
<Papierkorb> as in {{ operator.id }}
<FromGitter> <johnjansen> thanks Papier, that was the magic
<FromGitter> <johnjansen> anyone seen reference to the syntax of expect_raises
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vPkd5
<crystal-gh> crystal/master 034e762 Ary Borenszweig: Updated Changelog
<crystal-gh> crystal/master daa2cfe Ary Borenszweig: Base64: added some return types