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>
<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>
<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>
<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>
<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>
<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?