ChanServ changed the topic of #crystal-lang to: The Crystal programming language | | Fund Crystal's development: | GH: | Docs: | Gitter:
<FromGitter> <michelson> Hello, if you were to port a Rails app to one of the Crystal frameworks what framework would you use?
<FromGitter> <Blacksmoke16> is it a large or small application?
<FromGitter> <michelson> I would say is a medium/large, but uses Rails niceties, ActiveStorage, polymorphic relations, mailers, websockets etx..
ur5us has joined #crystal-lang
<FromGitter> <Blacksmoke16> gotcha
<FromGitter> <Blacksmoke16> Closest full stack framework would be Amber, but imo they haven't seemed to be as active as they used to :/
<FromGitter> <Blacksmoke16> there's also spider gazzle which is rails like, but not going to have all the stuff rails does like active storage/mails afaik
<FromGitter> <Blacksmoke16> have quite a few choices if you're not tied to Railsequeue design
<FromGitter> <michelson> ok, Thanks George 👍
<FromGitter> <Blacksmoke16> np
ur5us has quit [Ping timeout: 252 seconds]
Volk has joined #crystal-lang
Volk has quit [Changing host]
Volk has joined #crystal-lang
xyhuvud has joined #crystal-lang
yxhuvud has quit [Ping timeout: 252 seconds]
ur5us has joined #crystal-lang
<FromGitter> <> Not the best approach IMHO, nothing match Rails in Crystal
<FromGitter> <> You may be disappointed. However for micro services, it is the best :)
<FromGitter> <> and things like APIs
taupiqueur has joined #crystal-lang
ur5us has quit [Ping timeout: 260 seconds]
hightower2 has joined #crystal-lang
<FromGitter> <onoderaproject> Sorry for the stupid question, but how can I get `JSON.parse(raw_json)["results"][0]["id"]` to work?
<FromGitter> <> it does not work?
<FromGitter> <onoderaproject> Oh, now I see my problem: raw_json was a string rather than JSON
<FromGitter> <onoderaproject> Thanks for the help
<FromGitter> <> Wonder if porting Invidious to a more full-stack orientated framework would be worthwhile
<FromGitter> <Blacksmoke16> long term, most likely
<FromGitter> <Blacksmoke16> but as part of that i think they'd need to spend some timing figuring out how to reimplement it. otherwise no matter which framework you port it to, you can end up in the same state
<FromGitter> <Blacksmoke16> plus ofc learning the framework
hightower2 has quit [Ping timeout: 245 seconds]
<FromGitter> <> True. Numerous parts of Invidious really aren't designed very well.
<FromGitter> <Blacksmoke16> i imagine part of that is needing to essentially implement your own framework on top of kemal
hightower2 has joined #crystal-lang
taupiqueur has quit [Ping timeout: 245 seconds]
taupiqueur has joined #crystal-lang
adam12 has joined #crystal-lang
taupiqueur has quit [Remote host closed the connection]
taupiqueur has joined #crystal-lang
taupiqueur has quit [Remote host closed the connection]
taupiqueur has joined #crystal-lang
<FromGitter> <asterite> Quinton Miller: I think we use it when we want to set a node's type but make sure that if it's bound to something (either on purpose or accidentally), the type we set before doesn't get lost. At this point I consider it mostly a hack.
taupiqueur has quit [Remote host closed the connection]
taupiqueur has joined #crystal-lang
taupiqueur has quit [Remote host closed the connection]
taupiqueur has joined #crystal-lang
<hightower2> Hm I have a UInt8 field where values are not treated exactly as flags enum, but the 8 bits are additionally split into 2, 4, and 2 bits, which have standalone/separate meanings. What's the most convenient way to check for values inside those 3 sub-groups?
<xyhuvud> bitfield perhaps?
<hightower2> Aha BitArray you mean. Could be, let me check what it's API is. Thanks!
<hightower2> s/it's/its/
<hightower2> I see there is even Int#bits
<straight-> You can also SHIFT and AND your values to isolate the individual bit ranges.
straight- is now known as straight-shoota
<hightower2> yeah, I was ideally trying to find a method that does a lookup into an existing value, without further parsing/changing.
<FromGitter> <Blacksmoke16> convert it to a binary string and index into that? :P
<hightower2> Unless you advise differently, I think I'm gonna use Int#bits_set? (
<hightower2> although I really dislike that it wouldn't give me an enum-like interface
<straight-shoota> You can do something like this:
<hightower2> that's pretty nice, I was just experimenting with going with shifting after all. Thanks!
taupiqueur has quit [Ping timeout: 252 seconds]
<hightower2> straight-shoota, got it working using your example. Works beautifully++
taupiqueur has joined #crystal-lang
<FromGitter> <> is crystal i being released in 1.2?
<FromGitter> <Blacksmoke16> no
<FromGitter> <> :-(
olbat[m] has quit [Ping timeout: 264 seconds]
olbat[m] has joined #crystal-lang
<SamantazFox> Stack overflow (e.g., infinite or very deep recursion)
<SamantazFox> That's the first time I see that
<SamantazFox> it ended in a loop 94008244249514 times
<SamantazFox> What kind of tools can be used to trace that sort of stuff?
<FromGitter> <Blacksmoke16> cant just look at the trace?
<FromGitter> <Blacksmoke16> `src/invidious/helpers/`
<SamantazFox> yeah, the trace points to a `to_json` method
<SamantazFox> but that's not really helpful, as this part of the code hasn't changed (it was only moved to a different file)
<FromGitter> <Blacksmoke16> but wouldnt that be it? because it's calling `to_json` from `to_json`
<FromGitter> <Blacksmoke16> possibly in the past you never passed a `builder` instance to it, could have always been `nil`
<SamantazFox> Ah, mmh, I see...
<FromGitter> <Blacksmoke16> idk, is a thought :shrug:
<SamantazFox> not a bad one, actually
<SamantazFox> didn't think about that
<SamantazFox> I'll try to change that, we'll see if it improves or not
<FromGitter> <Blacksmoke16> er maybe `locale` isnt a hash so its not hitting the above overload
<FromGitter> <Blacksmoke16> could prob split that up into dedicated overloads as well
<SamantazFox> yeah
repo[m] has quit [Ping timeout: 250 seconds]
<SamantazFox> Error: no overload matches 'SearchVideo#to_json' with types (Hash(String, JSON::Any) | Nil), JSON::Builder
<SamantazFox> Ah, that's why
<SamantazFox> you were right
<FromGitter> <Blacksmoke16> 😊 i try :P
<FromGitter> <Blacksmoke16> glad you figured it out
repo[m] has joined #crystal-lang
sorcus has quit [Ping timeout: 260 seconds]
sorcus has joined #crystal-lang
hightower2 has quit [Ping timeout: 245 seconds]
ulyssa has quit [Remote host closed the connection]
<FromGitter> <vgramkris> > @vgramkris currently no. You could bind LibC's prlimit yourself, but not sure if that's cleaner. ⏎ ⏎ thanks, thats my next step
<SamantazFox> Blacksmoke16: Haven't figured out yet, but I think that we're on the right way. I forced the data type and removed the ambiguities by doing separate methods for the different data types, and it compiled much faster than usual, so it's a good sign
<FromGitter> <Blacksmoke16> nice!
<SamantazFox> Test binary is deployed, now I have to wait and see if that happens again
<FromGitter> <Blacksmoke16> 👍 gl
<SamantazFox> ty :)
<SamantazFox> I'll ping you on GH anyway when the PR will be ready :P
ulyssa has joined #crystal-lang
hightower2 has joined #crystal-lang
Volk has quit [Quit: See you next time!]
<FromGitter> <vgramkris> Is there an equivalent of python's multiprocessing. active_children in crystal? I am checking the crystal Process API page but not able to find any
<FromGitter> <Blacksmoke16> dont think so
ur5us has joined #crystal-lang
<FromGitter> <vgramkris> ah ok
<FromGitter> <Blacksmoke16> at least built in
<FromGitter> <vgramkris> yeah, may need to implement a simple process manager whenever i call Process then and clean it up in at exit probably
<FromGitter> <Blacksmoke16> what do you need this for?
<FromGitter> <vgramkris> well, want to kill all my child processes when my process exits/crashes
<FromGitter> <Blacksmoke16> wouldnt that happen on its own by the OS given the proper signal to the parent process?
<FromGitter> <vgramkris> well, if no signals are handled in my process OR if there is an unhandled signal causing my process to crash then my children becomes zombies or goes to init as parent
<FromGitter> <Blacksmoke16> 👍 fair enough
<FromGitter> <vgramkris> more of an uncontrolled/unexpected signal, not for graceful shutdown
taupiqueur_ has joined #crystal-lang
taupiqueur has quit [Read error: Connection reset by peer]
jhass[m] has quit [Ping timeout: 268 seconds]
jhass[m] has joined #crystal-lang
hightower2 has quit [Ping timeout: 268 seconds]
Volk has joined #crystal-lang
Volk has quit [Changing host]
Volk has joined #crystal-lang
taupiqueur_ has quit [Ping timeout: 245 seconds]
<FromGitter> <vgramkris> Can someone please give some quick explanation what ysbaddaden says here wrt crystal master? ⏎ ⏎ "Note that you need crystal master for the at_exit block to be actually run (and thus print Terminated)."
<FromGitter> <Blacksmoke16> Given that's over 3 years old, probably no longer relevant
<FromGitter> <vgramkris> ahh ok, thats a quick explanation :) thank you
<riza> trying to build shards without a shard executable on my system already, and I'm running into a weird state. The makefile is able to download and extract the resolver dependency, but the compiler doesn't see it
<riza> I get the typical `Error: can't find file 'molinillo'` message, even though the dependency does seem to exist in the lib folder as expected
<FromGitter> <Blacksmoke16> what's the output of `crystal env`
<FromGitter> <Blacksmoke16> at least for `CRYSTAL_PATH`
<riza> CRYSTAL_PATH=/opt/crystal-ci-univ2nd-dev-1/src
<FromGitter> <Blacksmoke16> set it to `lib:/opt/crystal-ci-univ2nd-dev-1/src`
<riza> that's the location of the crystal source I've pulled
<riza> oh okay, that makes sense
<FromGitter> <Blacksmoke16> 👍
<riza> nice, that seems to have done it. thank you as always @Blacksmoke16
<FromGitter> <Blacksmoke16> 👍
Volk has quit [Ping timeout: 268 seconds]
ur5us has quit [Ping timeout: 268 seconds]