Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 11:04
    asterite closed #12350
  • 11:04
    asterite closed #12375
  • 10:57
    straight-shoota milestoned #12375
  • 10:57
    straight-shoota milestoned #12375
  • 10:36
    asterite unlabeled #12403
  • 10:36
    asterite labeled #12403
  • 10:36
    asterite labeled #12403
  • 10:36
    asterite labeled #12403
  • 10:36
    asterite opened #12403
  • 03:13
    HertzDevil labeled #12402
  • 03:13
    HertzDevil labeled #12402
  • 03:13
    HertzDevil labeled #12402
  • 03:13
    HertzDevil opened #12402
  • Aug 18 15:15
    asterite synchronize #12378
  • Aug 18 14:49
    asterite synchronize #12375
  • Aug 18 14:45
    HertzDevil edited #12235
  • Aug 18 14:25
    straight-shoota milestoned #12242
  • Aug 18 14:25
    straight-shoota milestoned #12242
  • Aug 18 14:24
    straight-shoota milestoned #12244
  • Aug 18 14:24
    straight-shoota milestoned #12244
mfiano
@mjfiano:matrix.org
[m]
Yeah it'll all be a learning experience. Been using my over-engineered Lisp math library for about a decade, and I'm always annoyed at how difficult it is to read tabular matrix data when debugging stuff.
George Dietrich
@Blacksmoke16
whats it look like now if you just do pp @data?
mfiano
@mjfiano:matrix.org
[m]
Or rather, unformatted data period
George Dietrich
@Blacksmoke16
prob wouldn't be too bad
mfiano
@mjfiano:matrix.org
[m]
Ah, I don't have a matrix type yet
But in Lisp it looks like this, which is readable only because the PRNG seed made mostly the same digits to the left of the point:
[428.206840, 641.180912, 529.714861, 466.054420
 449.058745, 849.850763, 606.009279, 977.445823
 242.486631, 25.559494, 67.856057, 165.478953
 597.418470, 179.321626, 859.131128, 479.821710]
George Dietrich
@Blacksmoke16
ah pp by default prints a long list, not a 4x4 grid
mfiano
@mjfiano:matrix.org
[m]
So those rand methods in the ClassMethods module...
If I use inheritance, and stick those in an abstract parent struct, that isn't going to cause issues with eg; .new being undefined for the abstract type?
George Dietrich
@Blacksmoke16
if you're using inheritance now just define them as class methods in the parent and call it a day
i dont think so?
mfiano
@mjfiano:matrix.org
[m]
Ok. Inheritance does seem better by far
Unsure if I will even need any mixins for the code I have so far anyway
George Dietrich
@Blacksmoke16
id test that tho, but it should be fine assuming each child has an argless constructor
mfiano
@mjfiano:matrix.org
[m]
wait why?
oh i see what you mean
Yes, that's a given
The one thing I'm unsure about is how to get my T type parameter to resolve for the topmost type....it was passed into include before
mfiano
@mjfiano:matrix.org
[m]
Ah.
My intention is to only allow instances in this library to have Float64 for elements in the various containers, and I don't want type inference to permit anything else, so should be able to just make sure all contructors restrict their types, in addition to the above.
George Dietrich
@Blacksmoke16
then why do you need generics?
yea just do that and dont use generics
mfiano
@mjfiano:matrix.org
[m]
Probably don't anymore. I only needed it before because Indexable required a type parameter.
George Dietrich
@Blacksmoke16
generic inheritance can be kinda buggy
well it would be Indexable(Float64)
mfiano
@mjfiano:matrix.org
[m]
Yeah I was only using T because a lot of function signatures became too long with Float64 everywhere
iirc anyway
George Dietrich
@Blacksmoke16
:S
i always find its better to be explicit
even tho crystal allows you to not use them, i always do
at least on publicly facing libs and APIs
mfiano
@mjfiano:matrix.org
[m]
I do agree.
It may be that I have to support Float32 in the future, I'm not sure. It depends how FFI works in Crystal
It's a performance trap to use doubles on the GPU in most cases, so prob have to send them to the driver with single precision
George Dietrich
@Blacksmoke16
:shrug:
mfiano
@mjfiano:matrix.org
[m]
and also what opengl binding libraries expect I suppose
The Scalar module was/is bothering me, and much moreso with inheritance
George Dietrich
@Blacksmoke16
how so?
cant those 2 methods just live on the parent and not worry about it
mfiano
@mjfiano:matrix.org
[m]
It is unrelated to any of the aggregate types...it defines some functions for Float64 elements themselves
George Dietrich
@Blacksmoke16
if they're unrelated put em in a Utility namespace?
mfiano
@mjfiano:matrix.org
[m]
I could, but how would I make it private to users...they're sort of just an implementation detail of some of the aggregate types' methods
George Dietrich
@Blacksmoke16
nodoc it
wouldnt show up anywhere since you're not including/extending anything
mfiano
@mjfiano:matrix.org
[m]
Sold
George Dietrich
@Blacksmoke16
not sure im a fan of the =~ method name tho for a class method
mfiano
@mjfiano:matrix.org
[m]
For a class name?
oh
I cannot read