<FromGitter>
<neutrinog> Greetings. I'm setting up some bindings to a c library and can't figure out how to bind to `char**`. For example I'm binding to this function in c `glutInit( int* pargc, char** argv );` Any pointers? (no pun intended) Here's a gist describing my situation in detail https://gist.github.com/neutrinog/a7c0fe8662f4c2f959fcfa43594ac23d
ashirase has quit [Ping timeout: 272 seconds]
ashirase has joined #crystal-lang
<Groogy>
Morning! o/
<FromGitter>
<Timbus> @neutrinog looking at the error, it's accessing addr 0. So I guessed you passed the first arg wrong, and the docs for glutInit confirm it.. You have to pass a pointer to argc
Groogy has quit [Read error: Connection reset by peer]
<FromGitter>
<Timbus> Ah and you even noted that. Jeez. But you aren't doing it in the crystal binding
<FromGitter>
<vladfaust> @j8r I need full path to be printed
<FromGitter>
<j8r> and, what is the use case? This sounds tricky
<FromGitter>
<vladfaust> Full paths to models in Core; e.g. a `User` model may be under `MyProject::Models` module and referenced by `Post` model under the same module like `class MyProject::Models::Post; property user : User; end`. This property must be expanded to be used outside afterwards. It can be solved by writing `class MyProject::Models::Post; property user : MyProject::Models::User; end`, but it's a waste of time for a
<FromGitter>
... developer.
<FromGitter>
<schoening> Hi, I noticed that when I do not specify the type of a property that *@[JSON::Field(key: "Test")]* has no effect and wont re-name it. How come?
<FromGitter>
<asterite> Vlad: replied, there's no way right now
<FromGitter>
<asterite> schoening: yeah, I think that's how it works. You can open a bug or feature request, but I'm not sure how it can be implemented, or who will do it
<Groogy>
you can find all of those nice helper macros in the object class documentation
<FromGitter>
<Prutheus> ok nice to know, thanks
<Groogy>
np
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
<FromGitter>
<neutrinog> @Timbus thanks *facepalm* can't believe I missed that asterisk. I shouldn't be programming in the middle of the night. lol.
<FromGitter>
<sclee15> Do we have any news for pararellism parallelism
<FromGitter>
<sclee15> Suppor
druonysus has joined #crystal-lang
Yxhuvud has quit [Remote host closed the connection]
return0e has joined #crystal-lang
<FromGitter>
<vladfaust> Thank you @asterite
Yxhuvud has joined #crystal-lang
<Groogy>
Anyone else here who live in Stockholm or nearby area?
DTZUZO has quit [Ping timeout: 240 seconds]
druonysus has quit [Ping timeout: 240 seconds]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 272 seconds]
Raimondii is now known as Raimondi
<FromGitter>
<vladfaust> I got an interesting issue. I'm implementing a versatile ruby-like callbacks system and it's almost working, but. https://carc.in/#/r/4s8z compiles nicely, however uncommenting leads to compile error: https://carc.in/#/r/4s90. That is strange, is it a bug here?
<FromGitter>
<straight-shoota> @vladfaust You need to use `super { yield }`
<FromGitter>
<straight-shoota> `super(&block)` captures the block and you can no longer call it with `yield` in the next definition
<FromGitter>
<vladfaust> I totally don't understand the concept of capturing (even with a help of docs) 😕 However, it does solve the issue. Thanks, mighty @straight-shoota
<FromGitter>
<vladfaust> Hm, I expect it to print `[13, 15, 3, 5, 15, 6, 4, 16, 14]` but got `[13, 3, 5, 15, 16, 6, 4, 14]` instead...
<FromGitter>
<vladfaust> That's complicated
<FromGitter>
<vladfaust> I'm not sure if further `around` definitions should be deeper in the call stack or, in reverse, higher?
<FromGitter>
<rishavs> Hi. Are ECRs built at compile time or run time?
DTZUZO has joined #crystal-lang
<FromGitter>
<vladfaust> @rishavs had no exp with ecr yet, but variables within ecr should be replaced with actual values in the runtime, otherwise what's the point of server side rendering
<FromGitter>
<rishavs> Thing is that I am currently using heredocs to create string templates which get embedded into my crystal app binary at compile time. But its been a bit cumbersome. I was thinking of using ECR's but I don't want to sacrifice the runtime perf
<FromGitter>
<vladfaust> Run simple benchmarks and share your results then :)
<oprypin>
rishavs, ecr and most others are compile time
<oprypin>
crinja is a good choice for run time
<FromGitter>
<vladfaust> Okay, after some googling I understand that further `around` definitions should be deeper in the stack, however children's `around` should be higher in the stack, but that's not possible because in that case *the latest* around has to call `super{ yield }`, unlike earlier ones which use just `yield`. And we cannot know if this particular `around` is the latest in the class.
return0e has quit [Quit: Leaving]
<FromGitter>
<straight-shoota> @rishavs ECR is expanded to plain Crystal at compile time. That's the best runtime performance you can reasonably get.
DTZUZO has quit [Ping timeout: 256 seconds]
<FromGitter>
<straight-shoota> There should not be any relevant overhead compared to manual string interpolation.
<FromGitter>
<BrucePerens> Why is this happening with 0.26?
<FromGitter>
<BrucePerens> Error in /usr/share/crystal/src/string.cr:139: can't declare variable with Self ⏎ ⏎ include Comparable(self)
<FromGitter>
<straight-shoota> @vladfaust A proc is a block stored in a variable. You can pass it around, store it on the heap and whatever. `yield` essentially inlines the block's code directly at codegen. That's why you can only yield if the block is an actual block. A proc can't be inlined because it is just a pointer to some anonymous function and can be changed at runtime.
<FromGitter>
<straight-shoota> @BrucePerens see #6547
<FromGitter>
<straight-shoota> Fix is already in master
<FromGitter>
<vladfaust> @straight-shoota it's impossible to capture a block without implying in and out arguments, right?
<FromGitter>
<vladfaust> Thanks for explanation, I understand it better now 🎉
<FromGitter>
<bcardiff> yes @bararchy :-) sorry we didn't send an ACK. I share it with the core team already.
<FromGitter>
<j8r> @rishavs you wish to make a web app, and server html pages? If you want the best performances, you have to put static as much as you can. So, you can serve static html pages and eventually "hydrate" them with an API for the dynamic contents. Another advantage is you can also have different client than web like mobile, desktop apps etc