ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
teardown has quit [Ping timeout: 268 seconds]
teardown has joined #crystal-lang
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
postmodern has joined #crystal-lang
teardown has quit [Ping timeout: 268 seconds]
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
<FromGitter> <didactic-drunk> @j8r Was that directed at me?
hendursaga has quit [Quit: hendursaga]
hendursaga has joined #crystal-lang
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 244 seconds]
f1reflyylmao is now known as f1refly
chachasmooth has quit [Ping timeout: 256 seconds]
chachasmooth has joined #crystal-lang
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
<FromGitter> <nickbclifford> Having a little trouble with Fibers right now, how would I mark a call as IO blocking? I'm calling a C library that blocks until an event is received, and I can't seem to get my current implementation to play nice with a Signal handler
<FromGitter> <Dan-Do> Have no idea, may be using `sleep` or something?
<FromGitter> <nickbclifford> Yeah, I thought `Fiber.yield` or something would do it, but no dice
<FromGitter> <nickbclifford> or possibly I'm doing this horribly wrong, lol
<FromGitter> <Dan-Do> Uhm, take a look at this
<FromGitter> <nickbclifford> Not sure I see how that's helpful
<FromGitter> <Dan-Do> Do you have any example/reduced code?
hightower2 has quit [Ping timeout: 256 seconds]
<FromGitter> <nickbclifford> ```code paste, see link``` ⏎ ⏎ Basically, the trap never gets called and it just does nothing on Ctrl-C, and I think it's something to do with my fiber handling [https://gitter.im/crystal-lang/crystal?at=6054254aef43061daa81ce4e]
<FromGitter> <Dan-Do> Ah, I saw this somewhere.
<postmodern> hmm can you define abstract methods in a module, or do you typically leave them undefined and hope the including class/struct defines them?
<FromGitter> <nickbclifford> > *<postmodern>* hmm can you define abstract methods in a module, or do you typically leave them undefined and hope the including class/struct defines them? ⏎ ⏎ You can make them abstract, that's how `Comparable(T)` does `<=>`
<postmodern> ah cool. needed to not define them directly in a `macro included`, but move them into a ClassMethods module, since i'm including into a struct
<FromGitter> <HertzDevil> this is actually done by `SystemError` in the stdlib
<postmodern> why isn't there a UInt generic type in stdlib, for when you want to restrict a function to working with unsigned values but don't want to specify the word-size of the uints?
<FromGitter> <HertzDevil> `Int::Unsigned`
<postmodern> aaaah, thank you
<FromGitter> <HertzDevil> there's also a signed counterpart but both include only the primitive integers
<FromGitter> <HertzDevil> that is, neither includes `BigInt`
teardown has joined #crystal-lang
<postmodern> so handy that crystal has a #clamp method built-in
coderobe has quit [Ping timeout: 276 seconds]
coderobe has joined #crystal-lang
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
_ht has joined #crystal-lang
<FromGitter> <HertzDevil> > :sad: :P ⏎ ⏎ @Blacksmoke16 enjoy
fifr` has joined #crystal-lang
<FromGitter> <HertzDevil> my next step probably is to refactor things to prepare for a commutative implementation of `Crystal::Type#restrict` between two types
<FromGitter> <didactic-drunk> Maybe this is a bug, but I'll ask here first. ```
<FromGitter> <HertzDevil> something like `Program#type_lower_bound`
<FromGitter> <HertzDevil> renaming the current `#type_merge` to `#type_upper_bound` to reduce confusion
<FromGitter> <didactic-drunk> Why can't I require a specific file in *some* shards. ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Is this a bug or misunderstanding on my part. [https://gitter.im/crystal-lang/crystal?at=605459b288edaa1eb8c7d830]
hendursa1 has joined #crystal-lang
hendursaga has quit [Ping timeout: 268 seconds]
<FromGitter> <naqvis> for local files, you will have to use relative path
<FromGitter> <naqvis> only stdlib and shards doesn't require relative path
<FromGitter> <didactic-drunk> `require` statements are in my app. All paths are in shards.
<FromGitter> <didactic-drunk> sodium is 1 shard. blake3 is another.
<FromGitter> <naqvis> `digest` is also a shard?
<FromGitter> <naqvis> i see on your line 2 in above snippet, that's showing as `FAIL`
<FromGitter> <didactic-drunk> blake3 with file as src/digest/blake3.cr
<FromGitter> <naqvis> then you should try `shardname/file`
<FromGitter> <naqvis> `blake3/digest/blake3`
<FromGitter> <didactic-drunk> That works but I don't understand why. The projects are structured as follows: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I can `require "sodium/digest/blake2b` but not `digest/blake2b`. Based on what you said shouldn't it be `sodium/sodium/digest/blake2b`? Why can use a short form with one but not another? [https://gitter.im/crystal-lang/crystal?at=60547121563232374c2d531e]
<FromGitter> <naqvis> `digest/` refers to either stdlib or shard name
<FromGitter> <naqvis> so you need to differentiate and tell the compiler which library you are referring to
<FromGitter> <didactic-drunk> I thought the rules would be similar to ruby
<FromGitter> <naqvis> sorry don't have any clue on that
<FromGitter> <didactic-drunk> `gem "foo"` adds the gem to the search path. You can require anything underneath it without a gem/shard name.
<FromGitter> <naqvis> `CRYSTAL_PATH` variable is normally set to `lib:/stdlib_location`
<FromGitter> <naqvis> so it does go through lib first, then to stdlib
<FromGitter> <naqvis> inside lib, shards are separated via folder
<FromGitter> <naqvis> so my guess is compiler follow that path, and i might be wrong here
<FromGitter> <naqvis> let's wait for others to jump in and provide their thoughts
<FromGitter> <didactic-drunk> I don't see the compiler attempt to access `digest/blake3` via `open`/`stat when I require it directly.
zorp has joined #crystal-lang
postmodern has quit [Quit: Leaving]
<FromGitter> <Blacksmoke16> @HertzDevil ❤️
<FromGitter> <Blacksmoke16> @jrei:matrix.org hightower2 Could you use https://crystal-lang.org/api/master/IO/Sized.html? Ref: https://github.com/crystal-lang/crystal/pull/10520
<FromGitter> <jrei:matrix.org> @didactic: to oprypin (https://matrix.to/#/@oprypin:matrix.org) and you – subtree is a good alternative to subdomules, no need to stick no matter what
oprypin_ has joined #crystal-lang
oprypin has quit [*.net *.split]
FromGitter has quit [*.net *.split]
FromGitter has joined #crystal-lang
<FromGitter> <jrei:matrix.org> @Blacksmoke16: not really
<FromGitter> <jrei:matrix.org> because the it is not a limit for the whole message, but for a field. Furthermore, it won't work for streaming IOs
<FromGitter> <jrei:matrix.org> IO streams
<FromGitter> <jrei:matrix.org> and for my case where I deal with WebSocket messages, I just have a simple condition to check the byte size
zorp has quit [Read error: Connection reset by peer]
<FromGitter> <Blacksmoke16> 👍 ah fair enough
<FromGitter> <didactic-drunk> @j8r I think I took issue with "old habits", but pehaps that's being pedantic.
<FromGitter> <didactic-drunk> @j8r I think I took issue with "old habits" but perhaps that's being pedantic. Subtree conversion took place yesterday. I wasn't locked in to a particular solution and my first and only use of a submodule is with this one project only because it seemed to work well.
<FromGitter> <HertzDevil> so it turns out even the union operator isn't fully commutative
DTZUZU has quit [Read error: Connection reset by peer]
DTZUZU has joined #crystal-lang
<FromGitter> <naqvis> curious, how would you define partially commutative? shouldn’t it be either commutative or not
<FromGitter> <naqvis> though unions should be commutative
Xeago has joined #crystal-lang
<FromGitter> <asterite> With the new tutorial thing, I was thinking carc.in will get a lot more traffic. And for example the example `puts "Hello World!"` will create new entries, all for the same string. And the output should be the same too. I wonder if it would be a good idea to enhance carc.in to also store a hash of the input. Then given a new input, hash it, check if the hash is there in the DB, then actually checking the
<FromGitter> ... contents to see if it's there, and finally reusing that link. It would save space, but it would also mean evaluation is faster because it's known from previous runs
<FromGitter> <MrSorcus> @asterite 👍
avane has quit [Changing host]
avane has joined #crystal-lang
<FromGitter> <jrei:matrix.org> there should be a carc.in with no snippet save
<FromGitter> <jrei:matrix.org> because by default it will save the code to an URL, so having a lot more traffic will store unnecessary snipets in case of a modification
<FromGitter> <asterite> Well, but `puts "Hello world"` and hundred more examples will run, and their output will be the same. I think storing those and reusing those is best. It means they don't need to be compiled over and over
<FromGitter> <Blacksmoke16> prob should use the version + output for the hash
<FromGitter> <Blacksmoke16> er version + input
<FromGitter> <jrei:matrix.org> @asterite: I agree for the default example, caching the result is great. But what if I change to `puts "Hello world" + "test"`
<FromGitter> <jrei:matrix.org> infinite possibilities. And saving the snipet/result won't be useful
<FromGitter> <asterite> Umm... carc.in already saves the snippet :-)
Xeago has quit [Ping timeout: 240 seconds]
ua has quit [Ping timeout: 256 seconds]
frojnd1 is now known as frojnd
ua has joined #crystal-lang
<straight-shoota> @asterite I also considered that and talked about it with jhass. The thing is, carc.in needs a rewrite.
<straight-shoota> The sandboxing library isn't supported anymore, so there are security concerns. And some design decisions can probably be improved upon.
<straight-shoota> Within such a rewrite performance optimizations through caching can be considered. It's not trivial though with non-deterministic programs for example.
alexherbo2 has joined #crystal-lang
<straight-shoota> Currently carc.in runs on a VM with single CPU and 1 GB memory, so there's much room to grow if performance is an immediate issue
riffraff169 has quit [Ping timeout: 256 seconds]
duane has quit [Ping timeout: 260 seconds]
<FromGitter> <asterite> thanks!
duane has joined #crystal-lang
<FromGitter> <jrei:matrix.org> wow, and as far as I used it, it was fine performance-wise
_ht has quit [Remote host closed the connection]
postmodern has joined #crystal-lang
HumanG33k has quit [Quit: Leaving]
DTZUZU has quit [Read error: Connection reset by peer]
commavir has quit [Excess Flood]
commavir has joined #crystal-lang