Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 00:07
    Blacksmoke16 labeled #12783
  • 00:07
    Blacksmoke16 labeled #12783
  • Nov 26 23:55
    carlhoerberg opened #12783
  • Nov 26 11:21
    straight-shoota milestoned #12781
  • Nov 26 11:21
    straight-shoota milestoned #12781
  • Nov 26 02:15
    straight-shoota assigned #11331
  • Nov 25 23:24
    straight-shoota labeled #12782
  • Nov 25 23:24
    straight-shoota labeled #12782
  • Nov 25 23:24
    straight-shoota opened #12782
  • Nov 25 23:17
    straight-shoota labeled #12781
  • Nov 25 23:17
    straight-shoota labeled #12781
  • Nov 25 23:17
    straight-shoota opened #12781
  • Nov 25 23:01
    straight-shoota synchronize #11635
  • Nov 25 22:56
    straight-shoota synchronize #11840
  • Nov 25 22:49
    straight-shoota labeled #12636
  • Nov 25 19:21
    straight-shoota labeled #12780
  • Nov 25 19:21
    straight-shoota labeled #12780
  • Nov 25 19:21
    straight-shoota labeled #12780
  • Nov 25 19:21
    straight-shoota opened #12780
  • Nov 25 19:11
    straight-shoota labeled #12779
moe
@moe:busyloop.net
[m]
it's also for when you don't want to write a whole bunch of boilerplate for it 😛
Quinton Miller
@HertzDevil
well there is no deserialization here
George Dietrich
@Blacksmoke16
it does have a JSON.parse in there, but nothing like JSON::Serializable at least
+1 for the name/comment tho :P
moe
@moe:busyloop.net
[m]
yeh it's only for the way out anyway. (although i feel like some kind of filtering should be baked into stdlib at some point)
George Dietrich
@Blacksmoke16
best you could do atm is use another shard, or use the existing annotations, having a like immutable struct for each view
could open an issue for it, tho TBD on if thats something that would be accepted given its getting into a fairly complex feature? :shrug:
moe
@moe:busyloop.net
[m]
yeh, i'm trying to minimize boilerplate. most often i just want foo.to_json(:a, :b, :c). although even cooler would be to also have it work with arrays/nesting, but then it obv becomes way more complicated.
George Dietrich
@Blacksmoke16
might be able to monkey patch that in
moe
@moe:busyloop.net
[m]
yeh, i just realized, it's actually not too bad anyway; https://carc.in/#/r/d4fz
George Dietrich
@Blacksmoke16
still would be if one of the values was an obj/array that you also wanted to filter
moe
@moe:busyloop.net
[m]
should be fine for my dabblings, i don't need more than that anyway. basically just wanting to strip fields from db responses before rendering them out http client.
yes, if it gets more nested than that, a proper serialization framework will be needed. one with ExclusionStrategies and what not 😬
George Dietrich
@Blacksmoke16
hehe, could also just leave it up to the user and let them deal with it :P
moe
@moe:busyloop.net
[m]
if anyone uses my stuff they're by definition lazy and don't want to deal with anything, gotta minimize them keystrokes
George Dietrich
@Blacksmoke16
xD fair enough
moe
@moe:busyloop.net
[m]
oh, while i'm rambling, https://github.com/Sija/any\_hash.cr is quite joyful to work with for certain things. gives me hope that crystal could actually have a hash-variant that behaves almost like a ruby hash at some point. prob more of a 4.0 thing, if ever, but i'll already propose to call it LazyHash then :)
George Dietrich
@Blacksmoke16
at that point is it really type safe? :P
Quinton Miller
@HertzDevil
that shard is still very far from a true any-hash
moe
@moe:busyloop.net
[m]
in places where it matters, it can still be. sometimes you (or at least i) just want to wrap things up to bring them "elsewhere", without having to (or even being able to) explicitly type it all the way down.
and yup, it's not a true-any, yet. but very helpful for incrementally building up json-serializable things. not sure if an entirely true-any is actually possible - but even in this relatively limited form i already found it very helpful.
Quinton Miller
@HertzDevil
a true any might be something like Reference | Box(Nil) | Box(Char) | Box(Bool) | Box(Int8) | ... ranging over all storable Value types
moe
@moe:busyloop.net
[m]
yup, just wrap it up in a hash-style syntax and i'll take it :)
Lewis E. Bogan
@lebogan
  I am attempting to compile crystal from source  and keep getting this error:
LLVM ERROR: Cannot generate unaligned atomic store
I am using crystal 1.4.0 with llvm 10 on ubuntu 20.04. As a casual user, theios error has me boggled. Any help is greatly appreciated.
George Dietrich
@Blacksmoke16
:thinking: interesting
you're not building llvm from source too are you?
Lewis E. Bogan
@lebogan
Nope
George Dietrich
@Blacksmoke16
and what are you running to get this?
Lewis E. Bogan
@lebogan
./bin/crystal build src/compiler/crystal.cr --cross-compile --target "armv7l-unknown-linux-gnueabihf" --release -s -D without_openssl -D without_zlib
George Dietrich
@Blacksmoke16
alright yea thats prob the problem
make clean && make
Lewis E. Bogan
@lebogan
Still errors. Installed all the required libs and gc per instructions.
George Dietrich
@Blacksmoke16
what arch are you on?
x86?
Lewis E. Bogan
@lebogan
x86_64
George Dietrich
@Blacksmoke16
is there any other output?
Lewis E. Bogan
@lebogan
Nope. Just that
George Dietrich
@Blacksmoke16
yea not sure, never saw that one before
maybe try the forums?
oh wait
are you using make clean && make or still using that command you provided?
because i can reproduce using that command
make clean && make target=armv7l-unknown-linux-gnueabihf seems to work fine
Lewis E. Bogan
@lebogan
I was using the former. Will try using target= with make.
Well that worked. Ran make help and did not find anything about targets. I will investigate further. Thanks always for your assistance.
George Dietrich
@Blacksmoke16
... i did suggest using make and you said you did and still errors
because make is the primary entrypoint into compiling crystal
a PR to add it would be :pray:
Lewis E. Bogan
@lebogan
Yes, I used make but without the target= flag. My mistake :faceplant: