RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.20.1 | Fund Crystal's development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
<FromGitter> <asterite> pretty print
<FromGitter> <asterite> `p obj`
<FromGitter> <johnjansen> ooooooh yes, thats niiiiiice
<FromGitter> <johnjansen> hey @asterite you still around
mussela has quit [Quit: Page closed]
akwiatkowski has quit [Ping timeout: 264 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 245 seconds]
vikaton has joined #crystal-lang
<FromGitter> <asterite> ?
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
<FromGitter> <raydf> Hi everyone, i need an easy way to convert yaml to json in crystal, any ideas?
<crystal-gh> [crystal] samueleaton opened pull request #3652: Add button in playground to run formatter (master...feat-playground-formatter) https://git.io/v1gki
<FromGitter> <samueleaton> The reason I was asking about accessing the crystal formatter API here earlier :smile: #3652
<DeBot> https://github.com/crystal-lang/crystal/pull/3652 (Add button in playground to run formatter)
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 258 seconds]
<crystal-gh> [crystal] dennisjbell opened pull request #3653: Enhancement to Regex::MatchData methods (master...expand-regex-functionality) https://git.io/v1gqS
vikaton has quit [Quit: Connection closed for inactivity]
mgarciaisaia has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
mgarciaisaia has quit [Ping timeout: 256 seconds]
soveran has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
soveran has quit [Ping timeout: 256 seconds]
mgarciaisaia has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
Philpax has quit [Ping timeout: 244 seconds]
lacour has quit [Ping timeout: 250 seconds]
mgarciaisaia has quit [Quit: Leaving.]
mgarciaisaia has joined #crystal-lang
vivus-ignis has joined #crystal-lang
<BlaXpirit> raydf, i can't search for it right now but it was really easy. can't you just do YAML.parse(...).to_json
bjz has joined #crystal-lang
soveran has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
soveran has quit [Ping timeout: 258 seconds]
bjz has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 246 seconds]
Philpax has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
muelleme has quit [Ping timeout: 244 seconds]
mentero has quit [Quit: Connection closed for inactivity]
muelleme has joined #crystal-lang
A124 has quit [Quit: '']
pawnbox_ has quit [Remote host closed the connection]
muelleme has quit [Ping timeout: 258 seconds]
A124 has joined #crystal-lang
fcmod has joined #crystal-lang
optikfluffel has joined #crystal-lang
pawnbox has joined #crystal-lang
matp_ has joined #crystal-lang
matp has quit [Ping timeout: 250 seconds]
pawnbox has quit [Remote host closed the connection]
mark_66 has joined #crystal-lang
vivus-ignis has quit [Quit: vivus-ignis]
pawnbox has joined #crystal-lang
olbat has joined #crystal-lang
olbat has joined #crystal-lang
olbat has quit [Changing host]
olbat has quit [Client Quit]
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 256 seconds]
olbat has joined #crystal-lang
olbat has left #crystal-lang [#crystal-lang]
olbat has joined #crystal-lang
optikfluffel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 256 seconds]
Ven has joined #crystal-lang
akwiatkowski has joined #crystal-lang
bjz has joined #crystal-lang
bjz_ has quit [Ping timeout: 244 seconds]
<BlaXpirit> > A+ is not a class, it's a A+
<FromGitter> <sdogruyol> a virtual class, right?
<RX14> BlaXpirit, what's that message from?
<BlaXpirit> instance_sizeof(self)
<RX14> lol
<RX14> fantastic
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RX14> i'd say thats a bug
<BlaXpirit> so, what's wrong here? https://carc.in/#/r/1fqj it segfaults
gloscombe has joined #crystal-lang
<RX14> BlaXpirit, I don't think the compiler "actually" calls allocate
<BlaXpirit> if it doesnt, then why would it crash, regardless
<RX14> so just try using one new method which allocates, casts, then calls initialize
<RX14> BlaXpirit, because it would use the instance allocate
<BlaXpirit> RX14, that kills inheritance like i said
<RX14> which allocates inly instance_sizeof bytes
<RX14> then the segfault is in the stor
<RX14> BlaXpirit, how does it?
<BlaXpirit> you can't make a different `initialize`
<BlaXpirit> RX14, you don't understand. if you delete the `allocate` methods, it doesnt crash
<BlaXpirit> if you're saying they are unused, that would be equivalent to deleting them. so you are incorrect
<RX14> oh
<RX14> yeah thats interesting
<RX14> I think you're just not meant to override allocate
<BlaXpirit> ooh i forgot to set the type id
<BlaXpirit> makes no difference
soveran has quit [Remote host closed the connection]
mgarciaisaia has quit [Ping timeout: 265 seconds]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 246 seconds]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 260 seconds]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 258 seconds]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 245 seconds]
mgarciaisaia has joined #crystal-lang
optikfluffel has joined #crystal-lang
asdlh has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 260 seconds]
mgarciaisaia1 has joined #crystal-lang
akwiatkowski has quit [Ping timeout: 264 seconds]
<FromGitter> <yxhuvud> If you are not meant to override the allocate method, then perhaps there should be a variant alike what is created by the struct or class keywords that allows you to define it by yourself and do manual memory management.
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <sdogruyol> manual memory management?
<FromGitter> <sdogruyol> how can you guarantee to make it play nice with the GC?
<FromGitter> <yxhuvud> The point would be to bypass the GC for those.
<FromGitter> <sdogruyol> sure but how can you guarantee that it won't broke the whole program?
<FromGitter> <yxhuvud> Eh, that would not come with guarantees like that. Manual memory management is obviously not safe.
<FromGitter> <sdogruyol> yeah, forgive me if i dont get the point of what you try to achieve :P
Philpax has quit [Ping timeout: 260 seconds]
<Papierkorb> Yxhuvud: Just use malloc() directly?
mgarciaisaia1 has quit [Read error: Connection reset by peer]
<Papierkorb> Yxhuvud: Though I'm not sure if even that'd help. The BoehmGC does not know of all objects, it scans the stack and goes on from there
<Papierkorb> It more or less does educated guesses on what's probably a pointer and whats not.
<Papierkorb> Yep it's scary if you think about it, and even more scary that it actually works
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 244 seconds]
mgarciaisaia has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
mgarciaisaia has quit [Ping timeout: 250 seconds]
mgarciaisaia has joined #crystal-lang
optikfluffel has quit [Ping timeout: 258 seconds]
akwiatkowski has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/v12TN
<crystal-gh> crystal/master 8295d8c Ary Borenszweig: Compiler: let method_missing work with named arguments. Fixes #3654
<travis-ci> crystal-lang/crystal#8295d8c (master - Compiler: let method_missing work with named arguments. Fixes #3654): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/182292178
<DeBot> https://github.com/crystal-lang/crystal/issues/3654 (method_missing with named argument)
mgarciaisaia has quit [Quit: Leaving.]
<akwiatkowski> is there a point how markdown parser is written now? it looks like it byte by byte, not to try find elements from smallest one to all?
<FromGitter> <firejox> I think RAII is a way for manual management. Allocate memory when struct is created, and free memory when struct is destroyed.
<BlaXpirit> firejox, what's that about
<BlaXpirit> if you mean about the earlier conversation, the way you're describing is the most strightforward way, but every operation has to go through 2 pointers
mussela has joined #crystal-lang
<mussela> hey all!
<mussela> BlaXpirit: you there?
<mussela> tell me what I'm doing wrong (when you can)
<FromGitter> <firejox> @BlaXpirit every operation would not go through 2 pointers
<crystal-gh> [crystal] akwiatkowski opened pull request #3657: [WIP] Adds refered links to Markdown (master...markdown) https://git.io/v12c0
AckZ has quit []
<BlaXpirit> mussela, first of all that's a compiler bug
<mussela> OK
<BlaXpirit> im not sure what's going on. you should try ensuring that all numeric types used in vectors and rects is Float32
<BlaXpirit> there's a big mess because sfml uses float32 everywhere but crystal uses float64 everywhere
<BlaXpirit> but again, the error should be reported by crystal, never by llvm
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
mark_66 has quit [Remote host closed the connection]
AckZ has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
p0p0pr37 has quit [Ping timeout: 265 seconds]
p0p0pr37_ is now known as p0p0pr37
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Ping timeout: 245 seconds]
<FromGitter> <piyush_ranjan_twitter> Hello. I am new to Crystal. Do we have any library to do AES or bridge to openssl ?
<FromGitter> <sdogruyol> @piyush_ranjan_twitter ssl is available in Crystal standard library
<FromGitter> <piyush_ranjan_twitter> oh! Let me check. Any ready docs ?
<BlaXpirit> piyush_ranjan_twitter, sure https://crystal-lang.org/api/OpenSSL.html but i dont see any direct mention of AES
<BlaXpirit> please check out the tree on the left to find subitems of openssl
<FromGitter> <piyush_ranjan_twitter> I see ⏎ require "./openssl/bio" ⏎ require "./openssl/ssl/*" ⏎ require "./openssl/digest/*" ⏎ require "./openssl/md5" ... [https://gitter.im/crystal-lang/crystal?at=5849a31fc29531ac5d3a0773]
<BlaXpirit> uh ok
<FromGitter> <piyush_ranjan_twitter> checking
<BlaXpirit> looks like you're in the right place
<FromGitter> <piyush_ranjan_twitter> seems like this is what I need
<FromGitter> <piyush_ranjan_twitter> will check
sp4rrow has joined #crystal-lang
<FromGitter> <piyush_ranjan_twitter> yes :D
<FromGitter> <piyush_ranjan_twitter> I must say that I am really really excited about Crystal.
<FromGitter> <piyush_ranjan_twitter> Being from ruby, I really do not want to do java for speed
<FromGitter> <piyush_ranjan_twitter> Crystal seems really ideal for me. I hope it catches fire :D
<FromGitter> <piyush_ranjan_twitter> I found this too https://github.com/datanoise/openssl.cr
<BlaXpirit> if it works
<RX14> that was merged into maxter iirc
<RX14> it's been abandoned since february so no, it won't work
<FromGitter> <asterite> @BlaXpirit it seems allocate does need to set the type id... and getting that seems to be kind of impossible right now
<RX14> string get it
<BlaXpirit> oh? I thought just using crystal_type_id would work (I mean it compiled, anyway)
<RX14> yeah, String uses `"".crystal_type_id`
gloscombe has quit [Remote host closed the connection]
<FromGitter> <asterite> Yes, the problem is how to get an instance of AA without creating it... and whenever you use `.as(AA)` it will make it an `AA+`, and to get the type id from a virtual type we use the first element behind the pointer
<BlaXpirit> :(
<FromGitter> <asterite> Allocate is overwritten here, for example: https://github.com/crystal-lang/crystal/blob/master/src/weak_ref.cr#L11
<FromGitter> <asterite> but that code fails as soon as you put a WeakRef inside a union (which you normally wouldn't do, but it shouldn't crash)
<BlaXpirit> so basically anyone who subclasses WeakRef makes the program crash...
<FromGitter> <asterite> I guess so
<FromGitter> <asterite> Maybe allocate should invoke allocate_memory that returns a pointer to the memory, because that's what you basically want to override
<FromGitter> <asterite> At least WeakRef wants to override that, and it seems you too
<BlaXpirit> yes
<BlaXpirit> what i want is to add a constant amount of memory to my instances. which i can do with StaticArray, but if I do inheritance, I need to extend that memory somehow so I add another StaticArray but what if someone adds a variable in between
<BlaXpirit> that's the current state of my lib, would be nice to have a safer alternative and always put the memory region after whatever the user may have defined
<FromGitter> <asterite> why do you need that extra memory?
<BlaXpirit> asterite, it's the good old bindings to SFML. the memory is for C++ objects to reside in
<BlaXpirit> i finally want a proper solution to this, then i can try to popularize this approach and get more performant bindings
<RX14> you want to avoid a double-dereference?
<BlaXpirit> yes
<RX14> have you actually benchmarked it to see if it's worth the effort?
<BlaXpirit> no :p
<BlaXpirit> hm maybe i did
<BlaXpirit> i remember something vaguely, i guess i just compared simple examples on old bindings and new bindings
<BlaXpirit> was like 30% faster or something but not necessarily due to avoiding double dereference
mussela has quit [Quit: Page closed]
asdlh has quit [Quit: Leaving]
<crystal-gh> [crystal] Sija opened pull request #3658: Implement class_* accessor macros (master...class-accessor-macros) https://git.io/v12h8
Cyrus has joined #crystal-lang
djbell has joined #crystal-lang
<djbell> is this a known bug? `icr(0.20.1) > false ? : 7 : : 9
<djbell> => 9
fcmod has quit [Ping timeout: 260 seconds]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
<FromGitter> <raydf> @BlaXpirit , YAML::Any.to_json doesn't exist.
<RX14> @raydf maybe parse_raw will work
<BlaXpirit> ah of course, that's a great suggestion
<BlaXpirit> djbell, probably not known
bjz has joined #crystal-lang
bjz has quit [Client Quit]
Philpax has joined #crystal-lang
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
akwiatkowski has quit [Ping timeout: 264 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 250 seconds]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
sp4rrow has joined #crystal-lang
sp4rrow_ has joined #crystal-lang
sp4rrow has quit [Ping timeout: 246 seconds]
elia has joined #crystal-lang
elia has quit [Client Quit]
elia has joined #crystal-lang
soveran has quit [Remote host closed the connection]