<FromGitter>
<zhenfeng-zhu> @j8r sorry,I can't open the website
<FromGitter>
<tenebrousedge> you need to make sure that object won't ever be nil. We can't help without more context. If that website is blocked, use a pastebin
<FromGitter>
<Daniel-Worrall> I've already tried reducing it further with no luck
devil_tux has quit [Ping timeout: 245 seconds]
devil_tux has joined #crystal-lang
<FromGitter>
<tenebrousedge> @Daniel-Worrall have you tried sending it with `kill`?
<FromGitter>
<Daniel-Worrall> kills fine... I *think* kemal might be binding the signals and it isn't getting a chance to run once inside the while loop
DTZUZO has joined #crystal-lang
<FromGitter>
<asterite> `while true; end` will block forever that fiber. Try doing `sleep` (without args) instead
<FromGitter>
<Daniel-Worrall> True, but it still recognises a Kemal flaw in that it traps the sigkill
<FromGitter>
<asterite> sorry, I don't understnad the bug or problem
<FromGitter>
<Daniel-Worrall> Not an immediate problem I guess, but Kemal are working on allowing multiple kemal servers per app and so it would need to be able to handle both on sigkill to exit gracefully
<FromGitter>
<Daniel-Worrall> unless you can register 2 of those
<FromGitter>
<Daniel-Worrall> idk
<FromGitter>
<Daniel-Worrall> yeah, it just overwrites the block
<FromGitter>
<Daniel-Worrall> Could trap be changed to allow extending the code ran?
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
devil_tux has quit [Ping timeout: 245 seconds]
<FromGitter>
<kalinon> Anyone know of a way to find all the included modules in class using macros? Or better yet all iterate through a list of classes the module was included in? aka something like `all_subclasses` but for modules.
<FromGitter>
<Blacksmoke16> doesnt exist atm
<FromGitter>
<kalinon> Was afraid of that
<FromGitter>
<kalinon> didnt see anything in the source
<FromGitter>
<kalinon> ok, will need to do some hacking
<FromGitter>
<kalinon> lol
<FromGitter>
<Blacksmoke16> sec
<FromGitter>
<kalinon> oooo. guessing you have an example
<FromGitter>
<kalinon> i wasn't able to tell if a class had a module (via `Object.all_subclasses`) so i was thinking i may need to switch to an annotation, to then inject a module instead
<FromGitter>
<kalinon> Ive been digging into the compiler more, but no where near i can start making PRs. but i will use yours as a learning opportunity.
<FromGitter>
<kalinon> i find these macros amazingly powerful
<FromGitter>
<Blacksmoke16> you got lucky and i happened to be messing with this a week or so ago haha
<FromGitter>
<kalinon> yeah for your assert lib?
<FromGitter>
<Blacksmoke16> i think so? dont really remember
<FromGitter>
<kalinon> heh
Groogy has joined #crystal-lang
<FromGitter>
<Blacksmoke16> i think i determined a parent abstract class was better for this usecase
<FromGitter>
<watzon> @absolutejam_gitlab I'd say dart is closer to Java tbh, but really they're all kinda similar. Dart has some benefits over typescript, but it's also missing some things that typescript has, like Unions
<FromGitter>
<lbarasti> so I think I get why the signature for content_length is `UInt64 | Nil` :)
<FromGitter>
<lbarasti> the `Unhandled exception in spawn: Invalid UInt64: Nil (ArgumentError)` on invalid content-length header seems undesirable to me, though. Thoughts?
<FromGitter>
<Blacksmoke16> hmm
<FromGitter>
<Blacksmoke16> the error makes sense but im wondering where the Nil comes from
<FromGitter>
<absolutejam_gitlab> so, I'm a bit useless when it comes to understanding compile-time operations, but
<FromGitter>
<lbarasti> The thing with the error as is is that it makes it really hard for me to handle it in a graceful way
<FromGitter>
<Blacksmoke16> cant you just catch it?
<FromGitter>
<absolutejam_gitlab> I can validate the contents of an array and such that I would do at run-time, also at compile-time right?
<FromGitter>
<Blacksmoke16> i.e. return a 500 if something throws you're not handling
<FromGitter>
<absolutejam_gitlab> I've been working on a CLI parser and I have logic to verify that some mutually exclusive parts aren't used, but it's currently validated at runtime because it's all I knew at the time
<FromGitter>
<Blacksmoke16> @absolutejam_gitlab im assuming you mean like an array assigned to a const?
<FromGitter>
<Blacksmoke16> could also do something like what i did for `Assert`, have a `Arg` and `Flag` struct that you can new up based on ann values
<FromGitter>
<absolutejam_gitlab> am I confused in thinking that my example won't be available at compile time?
<FromGitter>
<Blacksmoke16> then you get compile time errors if they forget to supply `name` or pass `"foo"` to `required`
<FromGitter>
<Blacksmoke16> i dont think it is
<FromGitter>
<Blacksmoke16> because those methods run at runtime
<FromGitter>
<absolutejam_gitlab> ah
<FromGitter>
<absolutejam_gitlab> I see
<FromGitter>
<absolutejam_gitlab> I didn't think about that
<FromGitter>
<absolutejam_gitlab> Makes sense
<FromGitter>
<absolutejam_gitlab> I don't mind it failing at run-time, it just needs to be noted in the docs and have it print a nice error message from a custom exception
<FromGitter>
<Blacksmoke16> 👍
<FromGitter>
<absolutejam_gitlab> Just wondered if I could make it happen at compile-time as it is
<FromGitter>
<Blacksmoke16> not without entering macro/annotation land
<FromGitter>
<Blacksmoke16> might be worth looking into, can do some cool stuff
<FromGitter>
<absolutejam_gitlab> I kinda wanted to avoid that unless it's really providing me with a lot of benefit
<FromGitter>
<Blacksmoke16> i think it does :p
<FromGitter>
<Blacksmoke16> sec
<FromGitter>
<absolutejam_gitlab> most of the CLI libraries I saw were so macro heavy and I just wanted a (what I consider) idiomatic way of defining them based on classes & methods
<FromGitter>
<Blacksmoke16> like notice what happens if you dont add `name` to flag/arg ann
<FromGitter>
<Blacksmoke16> or if you remove the `required`
<FromGitter>
<Blacksmoke16> could very easily build out a hash of like `String => BaseCommand`
<FromGitter>
<Blacksmoke16> at compile time
<FromGitter>
<kalinon> Over the last few months i have been porting Entitas-CSharp (https://github.com/sschmid/Entitas-CSharp) over to crystal. I am happy to say i feel confident to release a stable 1.0.0 of entitas.cr (https://github.com/spoved/entitas.cr). Ive achieved a 3x speed increase in some of the slowest benchmark tests compared to C#.
<FromGitter>
<kalinon> pretty excited about it
devil_tux has quit [Ping timeout: 245 seconds]
<FromGitter>
<watzon> @kalinon I'm not exactly sure what a entity component system is
<FromGitter>
<watzon> Not something I've ever used
<FromGitter>
<kalinon> Mainly used in game development, but its an interesting architecture i want to see if it can be used elsewhere @watzon
<FromGitter>
<kalinon> @didactic-drunk yeah! go for it!
<FromGitter>
<Blacksmoke16> @asterite what are your thoughts on like ⏎ ⏎ ```class Foo(T) ⏎ end ⏎ ⏎ {{Foo.name.stringify}} # => "Foo(T)"``` ⏎ ⏎ Shouldnt the name of the type *not* include the type vars? [https://gitter.im/crystal-lang/crystal?at=5d6af5c48b7327421dce5428]
<FromGitter>
<asterite> I don't know
<FromGitter>
<asterite> Generics are problematic because of that
<FromGitter>
<Blacksmoke16> esp since you can just do like `{{Foo.type_vars.stringify}} # => "[T]"` so its not like thats the only way to access them
<FromGitter>
<Blacksmoke16> im having to do `assertion.name.gsub(/\(.*\)/, "")`
<FromGitter>
<Blacksmoke16> because otherwise it turns out like `Foo(T)(String).new`
<FromGitter>
<j8r> Any cross-compilers here? Any idea for `/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: _main.o: error adding symbols: file in wrong format`
alex`` has quit [Ping timeout: 258 seconds]
<FromGitter>
<Blacksmoke16> @kalinon isnt that the same idea as modules?
<FromGitter>
<kalinon> yes and no. It utilizes the module system. But it also provides caching for re-use and optimization.
<FromGitter>
<kalinon> as well as systems/listeners for when the entities change
<FromGitter>
<Blacksmoke16> hmm prob one of those you have to use it to see its usefulness
<FromGitter>
<Blacksmoke16> know like nothing about game de
<FromGitter>
<kalinon> i dont know much either lol
<FromGitter>
<Blacksmoke16> :p
<FromGitter>
<kalinon> but im used to working with large complicated data sets, and this architecture caught my eye
<FromGitter>
<kalinon> because i can be used to manage millions of entities and data in a video game, but we dont use systems like this in enterprise level setups
<FromGitter>
<kalinon> which are way slower
<FromGitter>
<kalinon> so i decided to port it, and see how it worked
<FromGitter>
<Blacksmoke16> sounds like a plan
<FromGitter>
<kalinon> No entity or component is destroyed or GC'd but thrown back into a pool to be re-used. This doesnt have to only be for video games. Can be metrics, kubernetes pods, anything. the data and structure are agnostic.
<FromGitter>
<kalinon> But im most excited because Crystal gave it a 3x speed increase
<FromGitter>
<Blacksmoke16> idk if this is an issue or not, but `component_name.id.underscore` doesnt handle namespaced stuff
<FromGitter>
<Blacksmoke16> i.e. `module Foo::Bar` would be `foo::bar`
<FromGitter>
<Blacksmoke16> which isnt valid
<FromGitter>
<kalinon> their code generators make Separate type restricted Context, Matchers, Groups, and Entities based on the different combinations of crap
<FromGitter>
<kalinon> good to know, i made all mine top level
<FromGitter>
<kalinon> hmm ill have to think about how to protect for that if someone adds a component in a namespace
<FromGitter>
<Blacksmoke16> yea exactly
<FromGitter>
<Blacksmoke16> there is the `identify` method in macro land that would turn it into `"foo__bar"`
<FromGitter>
<Blacksmoke16> or could do like `.split("::").last.underscore`
<FromGitter>
<kalinon> yeah. gsub works too
<FromGitter>
<Blacksmoke16> or `.gsub("::", "_")`
<FromGitter>
<Blacksmoke16> depending on if you want to include the namespace in the method name or not
<FromGitter>
<kalinon> Since i needed to know how to initialize each component