<FromGitter>
<Dan-Do> I already copy the `reindexer_c.cc.o` to the same directory of `libreindexer.a`. What am I missing?
<FromGitter>
<Blacksmoke16> it's amazing how many different ways C code can make you go 🤔
<FromGitter>
<Dan-Do> it's said `Reindexer's core is written in C++17 and uses LevelDB as the storage backend, so the Cmake, C++17 toolchain and LevelDB must be installed before installing Reindexer. To build Reindexer, g++ 8+, clang 3+ or MSVC 2017+ is required.`
<FromGitter>
<Dan-Do> Maybe crystal use other version of C compiler?
<FromGitter>
<Dan-Do> I built the static libaray successfully `libreindexer.a`
ur5us has quit [Remote host closed the connection]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 245 seconds]
ur5us has joined #crystal-lang
<FromGitter>
<Dan-Do> I added `@[Link("stdc++")]` to the lib.cr then new errors come
<FromGitter>
<Dan-Do> `/usr/bin/ld: /mnt/d/projects/services/lib/cridxerdb/ext/libreindexer.a(rocksdbstorage.cc.o): in function `rocksdb::PinnableSlice::~PinnableSlice()': ⏎ /usr/include/rocksdb/slice.h:145: undefined reference to `rocksdb::Cleanable::~Cleanable()'`
ur5us has quit [Remote host closed the connection]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 245 seconds]
postmodern has quit [Read error: Connection reset by peer]
repo[m] has joined #crystal-lang
<repo[m]>
ping
<repo[m]>
that took 6 minutes to arrive xD
postmodern has joined #crystal-lang
<postmodern>
debugging an issue with calling initialize when it's defined in various modules, and wondering why "indirect initialization" isn't supported? Seems like the compiler should be able to track calling super in initialize and note which ivars have been initialized. https://carc.in/#/r/byvr
<postmodern>
also how do you test whether a class included a module?
<FromGitter>
<Blacksmoke16> in a macro or at runtime?
<postmodern>
either, it's for specs. Will `klass < Mod` work?
<FromGitter>
<Blacksmoke16> `.is_a?` would for sure
<postmodern>
that got me further, thanks
<postmodern>
how does crystal print it's exceptions out? I don't see an equivalent of ruby's Exception#full_message, which returns the ANSI highlighted exception+backtrace.
<FromGitter>
<Blacksmoke16> is kinda interesting there is literally only 1 char in the response
<FromGitter>
<Blacksmoke16> works if you remove your `accept-encoding` header
<FromGitter>
<Blacksmoke16> might be a clue
<FromGitter>
<syeopite:matrix.org> Well yeah, but removing that just queries the uncompressed data instead. It *works* but isn't ideal for speed and bandwidth.
<FromGitter>
<Blacksmoke16> right, but it gives you an idea of where the problem might be
<FromGitter>
<Blacksmoke16> would need to dig into the client to see what it's doing. might be a bug or something in there
<repo[m]>
quick question: is it possible to run shards build in parallel for all targets?
<FromGitter>
<Blacksmoke16> not atm afaik
<repo[m]>
alright
<FromGitter>
<Blacksmoke16> at least in a built in way
<postmodern>
xyhuvud, awesome that works. slowly getting this test suite passing...
<repo>
postmodern: are you converting something from ruby to crystal?
<repo>
*migrating
notzmv has quit [Ping timeout: 252 seconds]
postmodern has quit [Read error: Connection reset by peer]
postmodern has joined #crystal-lang
Peter0x44 has quit [Ping timeout: 246 seconds]
<postmodern>
protip: if you define your own Int32 class inside your class it will shadow the top-level Int32... That took way too long to debug and figure out.
Peter0x44 has joined #crystal-lang
<FromGitter>
<Blacksmoke16> protop, dont define your own primitive types :S
<FromGitter>
<Blacksmoke16> protip*
<postmodern>
yeah... kind of had to in Ruby, since i was modeling C primitives in addition to various endian-ness.
<postmodern>
after porting it over to crystal, it appears i've found a primitive shadowing bug in spectator
postmodern has quit [Read error: Connection reset by peer]
postmodern has joined #crystal-lang
notzmv has joined #crystal-lang
<postmodern>
how do you define a constant that's a Hash, which references pre-existing elements in that Hash? Constants are obviously constant, so you can't do CONST[:alias] = CONST[:other_key]
<xyhuvud>
constants are constant, but not frozen. So I don't see why that would be a problem.
<postmodern>
ah it's being defined as a named tuple
<xyhuvud>
Then you'd need to have the value separately before creating the tuple.
<postmodern>
what is the crystal equivalent of #object_id ? i need to test that an Array of objects are different copies via #dup.
<xyhuvud>
object_id exists. However, do note that it isn't defined on value types.
<xyhuvud>
(except on Nil, which is a special case)
<postmodern>
ah ha
<postmodern>
makes sense
postmodern has quit [Read error: Connection reset by peer]
Volk has joined #crystal-lang
Volk has quit [Changing host]
Volk has joined #crystal-lang
Volk has quit [Client Quit]
ur5us has joined #crystal-lang
hightower3 has quit [Ping timeout: 252 seconds]
<FromGitter>
<Blacksmoke16> im super confused at bdwgc's release process
<FromGitter>
<Blacksmoke16> so far they published versions `7.2o`, `7.4.20`, `7.6.14`, and `8.0.6`? 🤔
<FromGitter>
<jwaldrip:matrix.org> I wish Crystal would roll its own GC at some point
<FromGitter>
<jwaldrip:matrix.org> I know it's no easy feat. But one can dream.
postmodern has joined #crystal-lang
<postmodern>
so why doesn't crystal stdlib have a simplified popen method? I see there's Process.run which appears to support popen and every variation, but seems kind of difficult to use for simple popen(command,mode) -> io usecases
<FromGitter>
<mwlang> Anyone know how to profile Crystal programs with Apple's `instruments`? It seems Apple removed this command (even though its still invokable -- it just gives me an error that I need to install xcode (which I've done and redone...). Apple's forum says `instruments` is replaced with `xctrace` but that command's non-existent. This is the blog article that led me down this path:
<FromGitter>
<asterite> I used Instruments some days ago on the latest Mac. You need to install Xcode, open it, and from some menu you can access Instruments
ur5us has quit [Ping timeout: 245 seconds]
hightower3 has joined #crystal-lang
<postmodern>
hmm so IO::ByteFormat.decode can't handle Bytes slices that are less than the desired types length. now i'm wondering how best to indicate partial data has been attempted to be read. yield only one argument (the slice) or yield the slice, nil ?
<postmodern>
i know it's common practice in crystal to avoid nils when possible, as then you have to guard against them, which gets annoying fast