<FromGitter>
<jrei:matrix.org> I was starting to say sigfault instead of segfault š
<FromGitter>
<jrei:matrix.org> there are other mentions around, too
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #crystal-lang
<FromGitter>
<oprypin:matrix.org> j8r (https://matrix.to/#/@jrei:matrix.org): seems wrong yes. it's either "segfault" or `SIGSEGV` not a hybrid of the two š
<FromGitter>
<jrei:matrix.org> I've done a `grep -rnI sigfault crystal`
<FromGitter>
<jrei:matrix.org> Will do a PR to change to rename that.
<FromGitter>
<rnice01> Nice!
hendursaga has quit [Remote host closed the connection]
hendursaga has joined #crystal-lang
<watzon>
straight-shoota: unfortunately it's the only way I can think to handle this particular issue. This code was auto generated from this Type Language schema https://core.telegram.org/schema. The problem is that there are a lot of constructors which return a constructor that isn't defined in the document, making it more of an abstract constructor. Then there are some types which return a constructor that has been defined,
<watzon>
but unlike in Crystal where you would say that `class B` is a subclass of `class B`, the two actually don't share any common functionality, just a common interface.
<watzon>
So I decided to just treat empty abstract classes like interfaces for the purpose of appeasing the type system
postmodern has joined #crystal-lang
hendursa1 has joined #crystal-lang
hendursaga has quit [Ping timeout: 268 seconds]
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
_ht has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 265 seconds]
deavmi has joined #crystal-lang
postmodern has quit [Quit: Leaving]
<FromGitter>
<jrei:matrix.org> oprypin (https://matrix.to/#/@oprypin:matrix.org): maybe it is a short-band for "segmentation fault signal"? š¤·
<FromGitter>
<oprypin:matrix.org> j8r (https://matrix.to/#/@jrei:matrix.org): yes thats the main thing i thought so it's not so clear. but it's too misleading this way
_whitelogger has joined #crystal-lang
<FromGitter>
<Luj8n> Hi! Is it possible to draw (graphics api or like library idk) in Crystal like in javacript canvas or with c# graphics? Thanks
hendursaga has quit [Remote host closed the connection]
hendursaga has joined #crystal-lang
<FromGitter>
<Blacksmoke16> @watzon could you use modules instead? Not sure if that would be any different tho
<FromGitter>
<wyhaines> Ruby has a Find class that implements a Filesystem search function, similar to the `find` command in unixes. Crystal does not appear to have adopted Find into its stdlib. Does anyone know of a shard that implements similar functionality, or will I need to roll my own (or shell out to `find`) to get it?
<FromGitter>
<wyhaines> I am just going to roll one into a new Shard.
<straight-shoota>
maybe that finder shard is what you're looking for
<FromGitter>
<wyhaines> Huh. I spent a while looking for exactly that kind of thing, and failed. Ha! Well, thanks. That's basically what I am looking for.
<straight-shoota>
well, "find" is hard to search for :D
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
<watzon>
@BlackSmoke16 technically I could, but it would end up being about the same. More lines though since Iād need an extra line for an include statement.
<FromGitter>
<Blacksmoke16> Yea pretty much
<watzon>
Overall it's just kind of a shitty situation. The other option would be to not use class inheritance at all, but then I'd miss out on some of the niceties of OOP.
<FromGitter>
<Blacksmoke16> id be curious to see if the compiler treats modules differently than parent types
<FromGitter>
<Blacksmoke16> id doubt it tho, given you pretty much end up with the same result
_ht has quit [Remote host closed the connection]
<watzon>
What I'm curious about is how slow compilation is going to be once all generated objects are being referenced. For instance, if I compile a class which has a property with the type `TLObject`.
<watzon>
The last iteration of the generated types made compilation of a very simple program take 30+ seconds
<FromGitter>
<jrei:matrix.org> Having a new object like `GarbageCollectedPool(T) < Pool(T)`, or have an object which holds pool.
<FromGitter>
<jrei:matrix.org> I think maybe having an independent object would be better. Generally inheritance with generics is a bad idea
<straight-shoota>
hm, but you probably want to use GC pool and non-GC pool interchangably
<straight-shoota>
alternatively, you could make GC completely external to the pool implementation. but then you'd need to provide an API for the GC to hook in
<FromGitter>
<jrei:matrix.org> yes good idea, I was also thinking to that
<straight-shoota>
I wouldn't expect GC to be very complex for that... so maybe you could also just implement a GC method on regular pool
<straight-shoota>
so GC comes included (but inactive by default probably)
<FromGitter>
<jrei:matrix.org> I aims to have a simple base, easy to use/understand, but provide additional features for those needing them
<FromGitter>
<jrei:matrix.org> max_pool_size... I got why it is needed. It is mainly for Databases, not to exhaust its limited connections. Makes less sense for others objects
<straight-shoota>
err, I'd say it makes sense for everything that uses a pool
<straight-shoota>
if you don't have a limitation on resources, you don't need a pool
<straight-shoota>
more or less
<FromGitter>
<jrei:matrix.org> unless creating this very resource is expensive
<straight-shoota>
yeah, but then you still need to have a way to release resources in long running processes
<straight-shoota>
the pool makes it impossible to release directly after use
<straight-shoota>
so you need a different mechanism
<FromGitter>
<jrei:matrix.org> yep, that's the GC i'm building ;)
<FromGitter>
<jrei:matrix.org> it will handle bursts, and progressively release resources - at least I would like to handle like this
<straight-shoota>
and a pool size limit is a good indicator for triggering GC
<FromGitter>
<jrei:matrix.org> maybe, I think a memory limit would be better
<FromGitter>
<jrei:matrix.org> because at the end that's the memory we want to save
<straight-shoota>
if memory use varies, yes probably
<straight-shoota>
but if we're talking about resources that are costly to create but cheap to keep around, variable memory use shouldn't be a factor
<FromGitter>
<jrei:matrix.org> yeah. I think I won't have a problem with no more memory, unless I'm DDOS
<straight-shoota>
totally depends on the kind of resource
<FromGitter>
<jrei:matrix.org> of course, yeah
<straight-shoota>
I'm just saying if the memory per item varies, it probably doesn't fit the criterium "cheap to keep around"
<FromGitter>
<jrei:matrix.org> per item in the pool?
<straight-shoota>
yes
<FromGitter>
<jrei:matrix.org> yes, you're right
<FromGitter>
<jrei:matrix.org> at any rate: on one side, I want to prevent incident in production, but on another side, it can be premature optimization :/
<FromGitter>
<oprypin:matrix.org> straight-shoota, then i'd say it's not finding any types
<FromGitter>
<jrei:matrix.org> I don't know... we could change the handler interface to make it possible to pass a third party mutable object?
<FromGitter>
<jrei:matrix.org> Like, a `call(context, object)` overload
<straight-shoota>
oprypin, looks like it. I'm running `.venv/bin/python3 docs/gen_doc_stubs.py`, crystal source files are in src/
<FromGitter>
<oprypin:matrix.org> straight-shoota, does `crystal docs --format=json --project-name= --project-version=` produce anything, then?
<straight-shoota>
jrei, why? what would that object be? Who defines what it is and where is it initalized? doesn't make any more sense than reopening HTTP::Server::Context
<straight-shoota>
oh no, it does not
<straight-shoota>
hm
<FromGitter>
<oprypin:matrix.org> straight-shoota, what about `crystal docs --format=json --project-name= --source-refname=master`, does that work?
<straight-shoota>
weird. `crystal docs --format=json --project-name= --project-version= src/http-session.cr` works
* FromGitter
* Blacksmoke16 this is why I like the listener/service based approach
<straight-shoota>
refname should be irrelevant for lookup
<FromGitter>
<636f7374> The YAML.use_yaml_discriminator enumeration cannot use types other than Int32 #10458
<FromGitter>
<636f7374> The YAML.use_yaml_discriminator enumeration cannot use types other than Int32. ā For example, enumerating UInt8 does not work. ā JSON.use_json_discriminator will not cause any problems.