<FromGitter>
<j8r> Is there a way to have stack-allocated strings? There are symbols, but we can't create new ones at runtime
<FromGitter>
<j8r> I guess slices
<FromGitter>
<bew> Slices are not on the stack (not their content at least)
<FromGitter>
<yxhuvud> @j8r: to have stack allocated strings, you'd have to know the size at compile-time.
<FromGitter>
<j8r> If I assign a string to a constant?
ashirase has quit [Ping timeout: 245 seconds]
<FromGitter>
<bew> The strings known at compile time are embedded in a special read only section of the program
<FromGitter>
<bew> There is no allocation cost when using them
<FromGitter>
<bew> Why do you want them on the stack specifically?
ashirase has joined #crystal-lang
<FromGitter>
<j8r> I just want to know more about them :)
<FromGitter>
<bew> Did you read the string constructors yet? :)
<FromGitter>
<bew> Like what is the data model behind a String object
<FromGitter>
<j8r> I see in the big picture what the String is
<FromGitter>
<j8r> I was wondering about alternatives and special uses cases like constants
<FromGitter>
<bew> Constants are not special, or i don't understand what you mean
<FromGitter>
<proyb6> Anyone have experiment websocket with your benchmark?
<FromGitter>
<j8r> @bew I don't know, sometimes things are inlined
<FromGitter>
<j8r> *I didn't know
[spoiler] has quit [Ping timeout: 246 seconds]
[spoiler] has joined #crystal-lang
<FromGitter>
<bew> Sorry but i don't know what you're referring to, can you give an example? @j8r
<FromGitter>
<j8r> I was working on the struct passed by value thing
<FromGitter>
<j8r> if there are nested, sometimes they are inlined
<FromGitter>
<j8r> So i was wondering if constants have optimizations, that's it
DTZUZO_ has joined #crystal-lang
<FromGitter>
<j8r> anyway i got the answer, thanks
<FromGitter>
<vladfaust> Is it possible to trigger multiple channel subscribers, i.e. https://carc.in/#/r/62tc print `true` exactly two times?
<FromGitter>
<Blacksmoke16> @girng 😎
<z64>
@vladfaust no; a channel doesn't really have a concept of "subscribers" - that would be a higher level concept, i.e.: `@subscribers = Array(Channel(T))`, `@subscribers.each(&.send(t))`
<FromGitter>
<Blacksmoke16> @bew you think its intended that it doesn't work out of the box? or is that something that could be a bug?
<FromGitter>
<bew> The type restriction doesn't ensure the type of the splat tuple, if you want a tuple with only Grandparent
<FromGitter>
<bew> GrandParent types, you have to cast it so the compiler handle it like you want
<FromGitter>
<bew> Not a bug
<FromGitter>
<Blacksmoke16> shouldnt it just work due to inheritance? like a `Parent` should *be* a `GrandParent` since it inherits from it?
<FromGitter>
<Blacksmoke16> i see where you're coming from, is just a pain point for me :shrug:
<FromGitter>
<bew> It is, but the binary representation of array of parent could be different from the one for array of grandparent
<FromGitter>
<bew> The compiler don't want to guess i guess^^
<FromGitter>
<Blacksmoke16> oh well, i can work with that
<FromGitter>
<j8r> @ilanusse if you really need to you can modify a string but that's unsafe
<FromGitter>
<j8r> and not recommended
<FromGitter>
<yxhuvud> .. unless it is stored in the DATA region, which I think all strings created at compile time is.
<FromGitter>
<asterite> yup, that will crash the program immediately
<FromGitter>
<bew> Definitely not recommended, more like "technically you can, but it's your problem if it doesn't work" ^^ (and yes if you ever try to modify a String in the data segment (a constant String, known at compile time) it'll segfault on you right away)
<FromGitter>
<j8r> how can I get the object where I execute a macro?
<FromGitter>
<j8r> Awesome, you are really the king of macros @Blacksmoke16 😮
<FromGitter>
<Blacksmoke16> i try :p
<FromGitter>
<Blacksmoke16> those are the only 2 fancy accessors
<FromGitter>
<Blacksmoke16> `@type` and `@def`
<FromGitter>
<Blacksmoke16> credit goes to @bew for informing me of the def one
<FromGitter>
<j8r> So now I can have full featured efficient backtraces :D
<FromGitter>
<Blacksmoke16> well there you go
<FromGitter>
<j8r> The only thing that is missed is the column number, that's not a big deal
<FromGitter>
<Blacksmoke16> yea meh
<FromGitter>
<j8r> I don't like raising a previously raises message, that was previously raised etc...
<FromGitter>
<j8r> Abusing panics for "normal" errors :/
<FromGitter>
<codenoid> hi
<FromGitter>
<Blacksmoke16> o/
<FromGitter>
<j8r> Hi
rohitpaulk has quit [Remote host closed the connection]
<FromGitter>
<girng> hi
<FromGitter>
<girng> how are you all doing today
<FromGitter>
<Blacksmoke16> Fine
<FromGitter>
<girng> @Blacksmoke16 you gonna stick with 7700k, or get the new ryzen 2? i heard the new ryzen 2 chips are gonna be amazing. but the 7700k will prob still yield higher GHz
<FromGitter>
<Blacksmoke16> if anything id get a new i9
<FromGitter>
<Blacksmoke16> but dont really need a new one yet
Creatornator has joined #crystal-lang
<FromGitter>
<girng> i've stopped listening to music recently. i think it increases my productivity. i feel more focused
<FromGitter>
<Blacksmoke16> 😱
<FromGitter>
<fridgerator> Have you ever tried white noise?
<FromGitter>
<girng> @fridgerator nope but i did buy my mom a white noise machine to help her sleep. but i havn't tried it in my room
<FromGitter>
<noahlh> related to white noise, anyone try coding to this: https://brain.fm/
<FromGitter>
<noahlh> the 'focus' tracks have a weird effect -- i can't say for sure they're better, but i def feel different than when coding to normal music or white/brown noise
<FromGitter>
<girng> looks interesting
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<dscottboggs_gitlab> shit, actually, I wrote that when I was gonna use an array, it doesn't make any sense to have a Channel of a Channel
JuanMiguel has joined #crystal-lang
<FromGitter>
<dscottboggs_gitlab> yeah forget the whole thing
<FromGitter>
<Blacksmoke16> :3
JuanMiguel has quit [Quit: Saliendo]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<Blacksmoke16> man i want to name my new shard something with `Spec` in it, but it conflicts so much with the stdlib `Spec` and gives wrong idea its about testing :/
<FromGitter>
<Blacksmoke16> maybe `QuerySpec` would be doable... hmm
<FromGitter>
<Blacksmoke16> yea ill go with that
jemc has quit [Ping timeout: 240 seconds]
<FromGitter>
<dscottboggs_gitlab> why not just spell out the whole word
<FromGitter>
<j8r> I can even add Class name in the backtraces :)
<FromGitter>
<j8r> Like ` from src/app.cr:10 in 'MyClass#test'`
_whitelogger has joined #crystal-lang
<FromGitter>
<Blacksmoke16> `Specification` is kidna long :/ esp how i set it up now to write it a lot