Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 22:41
    straight-shoota milestoned #12167
  • 22:36
    beta-ziliani labeled #12180
  • 22:35
    beta-ziliani milestoned #12182
  • 22:32
    beta-ziliani milestoned #12169
  • 22:11
    beta-ziliani milestoned #12179
  • 18:44
    Blacksmoke16 labeled #12182
  • 18:44
    Blacksmoke16 labeled #12182
  • 18:44
    Blacksmoke16 labeled #12180
  • 18:44
    Blacksmoke16 labeled #12180
  • 18:41
    asterite opened #12182
  • 18:39
    ThatsJustCheesy labeled #12181
  • 18:39
    ThatsJustCheesy opened #12181
  • 18:10
    asterite ready_for_review #12169
  • 18:09
    asterite edited #12180
  • 18:08
    asterite opened #12180
  • 18:04
    asterite synchronize #12169
  • 17:57
    asterite ready_for_review #12174
  • 13:36
    asterite synchronize #12179
  • 13:36
    asterite synchronize #12179
  • 13:34
    asterite labeled #12179
George Dietrich
@Blacksmoke16
thats a key point
sorry, ARE ignored
mfiano
@mjfiano:matrix.org
[m]
Interesting
mfiano
@mjfiano:matrix.org
[m]
Wondering if I can get some feedback on a small part of my first bit of code in this language, ignoring the missing documentation :) https://gist.github.com/mfiano/735133e2426c46044b21383292645b60
From IRC (bridge bot)
@FromIRC
<riza> is there an obvious way that I can specify an argument type be "any hash"?
George Dietrich
@Blacksmoke16
arg : Hash
From IRC (bridge bot)
@FromIRC
<riza> :⁠|
<riza> it's so easy!
George Dietrich
@Blacksmoke16
and just to clarify this only would work for an argument or return type restriction
From IRC (bridge bot)
@FromIRC
<riza> well I've been overthinking that problem for a week
George Dietrich
@Blacksmoke16
you cant type an ivar to Hash
From IRC (bridge bot)
@FromIRC
<riza> yeah, for sure
George Dietrich
@Blacksmoke16
:thumbsup:
Emilia
@rymiel:rymiel.space
[m]
Decided to poke around with the compiler source and wow i've never experienced having to run the compiler specs... takes like 30 minutes
Ary Borenszweig
@asterite
yeah... we kept adding more and more specs and it became like that. In general you never need to run them locally, we usually run specs for things we change, and then let CI run all of them
Emilia
@rymiel:rymiel.space
[m]
i just don't know the build system well enough to run only the specs i changed and i'm waiting for the CI to finish before i make a pull request because i already had a few dumb mistakes...
mfiano
@mjfiano:matrix.org
[m]
I wonder if non-dependent specs, could be run in parallel
George Dietrich
@Blacksmoke16
./bin/crystal spec spec/path/to/file/or/directory
1 reply
mfiano
@mjfiano:matrix.org
[m]
I will say its better than over in Nim. Just a few tests takes forever to compile, not to mention run, and outputs in tens of thousands of lines of C code iirc
Emilia
@rymiel:rymiel.space
[m]
omg it even tells me the command to run a failed spec for each failed spec... i'm just blind
George Dietrich
@Blacksmoke16
:sweat_smile:
mfiano
@mjfiano:matrix.org
[m]
Is there a decent way to call a method with arguments being the elements of a (small) StaticArray? I'm coming up with hacky stuff without diving into macros
George Dietrich
@Blacksmoke16
if you used a tuple you could *tuple
mfiano
@mjfiano:matrix.org
[m]
Sort of like splatting, but without a tuple or intermediary sequence
George Dietrich
@Blacksmoke16
arr[0], arr[1]
mfiano
@mjfiano:matrix.org
[m]
Yeah I thought I could do function application from the result of a functional map or something
Oh well
are tuples stack objects or are they collected?
George Dietrich
@Blacksmoke16
stack
ofc if you used a struct you could just pass the struct thru and use its getters
mfiano
@mjfiano:matrix.org
[m]
i would assume a tuple is fixed in length then
George Dietrich
@Blacksmoke16
yes
mfiano
@mjfiano:matrix.org
[m]
Ok good
mfiano
@mjfiano:matrix.org
[m]
What are the performance characteristics compared to a StaticArray?
George Dietrich
@Blacksmoke16
not sure, probably similar?
mfiano
@mjfiano:matrix.org
[m]
Yes, I am there. That page is nearly empty :)
George Dietrich
@Blacksmoke16
API docs have a bit more info
mfiano
@mjfiano:matrix.org
[m]
I see. Main difference I see is SA is a homogeneous container, which might be more contiguous/better for cache
From IRC (bridge bot)
@FromIRC
<straight-shoota> @mjfiano What exactly do you want to do?
mfiano
@mjfiano:matrix.org
[m]
straight-shoota: I'm pretty new, just experimenting mostly. But right now I have Vector (math) types in 2-4 dimensions, and currently using separate float ivars. Would like to back their storage in some container, so the method logic can map over them and reduce code by being generic for all 3 types.
mfiano
@mjfiano:matrix.org
[m]
Most operations are element-wise, so could reduce quite a bit of code by iterating over a generic container of some size to produce results for a given operation/vector type.
THat is the idea anyway. Not sure where to start yet :)
George Dietrich
@Blacksmoke16
fwiw its fairly easy to make a struct that is iterable
mfiano
@mjfiano:matrix.org
[m]
Interesting
George Dietrich
@Blacksmoke16
that you could use with .each or .mapetc
mfiano
@mjfiano:matrix.org
[m]
I need to learn that too then
So how does that work? Is it an abstract type where I have to implement some methods?