RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.25.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
<travis-ci> crystal-lang/crystal#3de4c52 (master - Compiler: evaluate instance var initializers at the metaclass level (#6414)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/410100980
DTZUZU has quit [Ping timeout: 260 seconds]
duane has joined #crystal-lang
moei has quit [Ping timeout: 264 seconds]
return0e has quit [Remote host closed the connection]
return0e has joined #crystal-lang
<FromGitter> <AZanellato> @paulcsmith I kinda get why the compile times are slow (checking every type in the stack trace), but why can't this be much improved in the subsequent times?
moei has joined #crystal-lang
<FromGitter> <paulcsmith> I think it can be, it’s just difficult to get right. The core team knows about it and is thinking about how to cache stuff and so incremental compilation. It’s tricky though
<FromGitter> <paulcsmith> Elixir does a pretty good job but still sometimes requires clearing the cache manually. I hope it can be done sometime soon but it’s hard to do so I bet it’ll take a bit
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
Groogy has quit [Read error: Connection reset by peer]
duane has quit [Ping timeout: 268 seconds]
raz has quit [Ping timeout: 276 seconds]
raz has joined #crystal-lang
vikaton has quit [Quit: Connection closed for inactivity]
<FromGitter> <aisrael> How can I wrap an `IO::Memory` as an `IO::Buffered`?
<FromGitter> <aisrael> Oh, nvm. I think I don't need it 🐑
pbodev1 has joined #crystal-lang
snsei has quit [Ping timeout: 256 seconds]
snsei has joined #crystal-lang
<FromGitter> <syrm> Any idea why this won't compile https://play.crystal-lang.org/#/r/4n5p ?
<FromGitter> <bararchy> @syrm ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b601bb5854add6cee0d0740]
<FromGitter> <bararchy> this works
<FromGitter> <bararchy> the thing is that `@input` is a instance var and can be changed mid-execution by another Thread\Fiber.
<FromGitter> <bararchy> that's why we "force" it into `IO::FileDescriptor`
<FromGitter> <syrm> ok, can i make it as a value and not a variable ?
<FromGitter> <j8r> better to do https://play.crystal-lang.org/#/r/4n5w
<FromGitter> <bararchy> ^
<FromGitter> <bararchy> yeha, mush better
<FromGitter> <syrm> i want an IO to be more flexible
<FromGitter> <syrm> (to use IO::Memory)
<FromGitter> <j8r> `#as` has to be avoided has much as possible 😄
<FromGitter> <j8r> @syrm you can create an overload
<FromGitter> <syrm> how ?
<FromGitter> <bararchy> yeha, 2 initialize, one for IO::Memory and one for IO::FileD
<FromGitter> <syrm> indeed, you're right, it's will be very clean
<FromGitter> <j8r> something like that https://play.crystal-lang.org/#/r/4n61
<FromGitter> <bararchy> 👍
<FromGitter> <syrm> still the same error this way
<FromGitter> <syrm> i need to look deeper :)
<FromGitter> <bararchy> look at @j8r example above
<FromGitter> <bararchy> it compiles great
<FromGitter> <syrm> yes i try to understand why my code don't work ;)
<FromGitter> <syrm> your example don't work : https://play.crystal-lang.org/#/r/4n69
<FromGitter> <bararchy> @syrm you didn't specify the other intialize, it's a generic IO, do something like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b602030c83d1230b13a528f]
<FromGitter> <bararchy> one for FileDesc, the other for IO::Mem
<FromGitter> <bararchy> this works
<FromGitter> <syrm> i need to put an overload for each subclass of IO ?!
<FromGitter> <syrm> it's not very clean...
<FromGitter> <bararchy> else you have not control what goes where
<FromGitter> <syrm> i only want an IO :p
<FromGitter> <bararchy> but IO can be anything from File to Socket to Memory, do you really want to put 4 `if` statments everywhere or just make overloads?
<FromGitter> <syrm> https://play.crystal-lang.org/#/r/4n6c something like that should work
<FromGitter> <E-stein> Hello, I wrote a tap formatter for crystal spec but I'm not sure it's perfect, can I still make a merge request?
<FromGitter> <syrm> I only need to handle FileDescriptor case @bararchy i don't understand wy my previous example don't work
<FromGitter> <bararchy> because it tells you the `@input` might be of the type `IO::ARGF` which has no `.raw!` method. ⏎ because you allow `@input` to be any type of `IO` and as such lose grained control of `@input` type.
<FromGitter> <syrm> i typed input to be IO::FileDescriptor in initialize where i use raw in other i typed to IO but i don't use raw
<FromGitter> <bararchy> when a var is an instance var (`@var`) it's type is checked thourghout the whole class, and so the type is `IO+` which means multiple types of `IO`
<FromGitter> <syrm> ok
<FromGitter> <straight-shoota> @E-stein there is already #6286
<FromGitter> <syrm> I fixed it :)
<FromGitter> <straight-shoota> I think it's a pretty solid implementation of the basics, but please take a look if you find things to improve.
<FromGitter> <straight-shoota> And if your implementation is better, don't hesitate from opening a new PR, I won't mind ;)
<FromGitter> <syrm> Now its work https://play.crystal-lang.org/#/r/4n6p :)
<FromGitter> <bararchy> yeha :)
<FromGitter> <straight-shoota> @syrm I wouldn't overload `initialize` but rather `self.new`
<FromGitter> <syrm> what's the difference ?
<FromGitter> <straight-shoota> less duplication
<FromGitter> <syrm> hum ? i don't understand
<FromGitter> <straight-shoota> hm, well okay it's probably not that easy in that case because FileDescriptor is also IO
<FromGitter> <straight-shoota> nevermind then
<FromGitter> <syrm> ok
ashirase has quit [Ping timeout: 244 seconds]
ashirase has joined #crystal-lang
alex`` has joined #crystal-lang
bazaar has quit [Ping timeout: 256 seconds]
lvmbdv has joined #crystal-lang
lvmbdv has quit [Client Quit]
bazaar has joined #crystal-lang
<crystal-gh> [crystal] RX14 closed pull request #6471: Fix OpenSSL::Digest for multibyte strings (master...bugfix/openssl-digest-multibyte-string) https://git.io/fNaA7
lvmbdv has joined #crystal-lang
lvmbdv has quit [Client Quit]
lvmbdv has joined #crystal-lang
<travis-ci> crystal-lang/crystal#939a81b (master - Fix OpenSSL::Digest for multibyte strings (#6471)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/410259078
<FromGitter> <alex-kampa> fyi, posting on upwork "Back-end developer - Ruby Crystal Golang Blockchain" - https://www.upwork.com/ab/applicants/1024225805494566912/job-details
<FromGitter> <alex-kampa> pls contact me directly if interested
<FromGitter> <alex-kampa> There is also an ECDSA.cr module for which I might need a few hours of help from an experienced dev...
hightower4 has quit [Ping timeout: 240 seconds]
<FromGitter> <bararchy> ohh Eliptic curve signitures, nice :)
<FromGitter> <bararchy> I hope you and dev will know what you're doing, this is one of the hardest standards to implement, and most prone to security issues
hightower4 has joined #crystal-lang
bjz has joined #crystal-lang
<FromGitter> <syrm> https://play.crystal-lang.org/#/r/4n7y Tempfile don't exist ?
bjz has quit [Client Quit]
<FromGitter> <waghanza> @syrm https://play.crystal-lang.org/#/r/4n80 just require it ;-)
<FromGitter> <syrm> oh i tried require "Tempfile" :(
<FromGitter> <j8r> does a tempdir exists?
<FromGitter> <waghanza> in fact a directory is a file in `unix`
<FromGitter> <j8r> i.e. https://crystal-lang.org/api/master/Tempfile.html , a `Tempdir.new "mydir"`
<FromGitter> <syrm> why Actor feature is not planned at all ? :)
<FromGitter> <j8r> What is Actor :)?
<FromGitter> <waghanza> @j8r a `design pattern` @see https://github.com/actix/actix ⏎ @syrm I'm not sure this is a language-feature
<FromGitter> <syrm> my pow is one of the best solution for parallelism https://www.scala-lang.org/old/node/242
<FromGitter> <alex-kampa> @bararchy re ECDSA "I hope you and dev will know what you're doing..." - yup we want to be sure there are no mistakes. I used the ECDSA functions of SushiChain as the basis, and then modified to make it more generic. But yes we'll need very thorough reviews and lots of testing.
<FromGitter> <bararchy> That's cool, will you let the @tbrand and @kingsleyh use the changes? it would benifit the project greatly to have a stronger and more secure encryption
<FromGitter> <alex-kampa> Sure, but before that I need to do more testing and also some code cleanup - which is where a more experienced crystal dev will be useful.
<FromGitter> <alex-kampa> Later on we could make a standalone shard out of it, many projects use ECDSA these days...
vegai has joined #crystal-lang
vegai has left #crystal-lang [#crystal-lang]
<FromGitter> <fridgerator> @alex-kampa is your upwork post limited by country?
<FromGitter> <fridgerator> I have no blockchain experience, I just wanted to look at it 😆
<FromGitter> <fridgerator> I think its cool crystal has something on Upwork
<FromGitter> <alex-kampa> @fridgerator - no blockchain experience needed for the project :-) Re "is your upwork post limited by country?" why, can't you see it?
<FromGitter> <vegai> String not having to_a is a concious design choice, right?
<FromGitter> <fridgerator> I see "You are not authorized to access this page"
<FromGitter> <fridgerator> Yep I can see that one 👍
<z64> @vegai what would String#to_a do? it sounds like an alias for String#chars..?
<FromGitter> <alex-kampa> @fridgerator thx for pointing this out!
duane has joined #crystal-lang
emilsp has quit [Read error: Connection reset by peer]
emilsp has joined #crystal-lang
emeve89 has joined #crystal-lang
emeve89 has quit [Client Quit]
<FromGitter> <cfsamson> Hello. Does anybody know what GC.disable do? Does it disable the entire GC? What are the risks for short lived programs?
_whitelogger has joined #crystal-lang
<FromGitter> <syrm> Why i can't read end write in STDIN like that : https://gist.github.com/syrm/552543587862782f1a2daf5b7dd6d715 ?
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
alex`` has quit [Quit: WeeChat 2.2]
<FromGitter> <j8r> we can write in th STDIN?!
<FromGitter> <j8r> you may mean STDOUT
Ven`` has joined #crystal-lang
wontruefree has joined #crystal-lang
moei has quit [Quit: Leaving...]
alex`` has joined #crystal-lang
vikaton has joined #crystal-lang
Jenz_ has joined #crystal-lang
<Jenz_> For being able to do anything with --prelude=empty, do I have to bind to C ?
Jenz_ is now known as Jenz
Jenz has quit [Quit: Lost terminal]
Jenz has joined #crystal-lang
<FromGitter> <fridgerator> example here : https://perens.com/2018/07/06/tiny-crystal-language-programs/
<Jenz> @fridgerator, thanks a ton!
<FromGitter> <fridgerator> 👍
wontruefree has quit [Quit: bye]
flaviodesousa has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
moei has joined #crystal-lang
wontruefree has joined #crystal-lang
wontruefree has quit [Client Quit]
DTZUZU has joined #crystal-lang
wontruefree has joined #crystal-lang
hgost has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.2]
hgost has quit [Quit: leaving]
Jenz has quit [Disconnected by services]
ua_ has quit [Ping timeout: 268 seconds]
wontruefree has quit [Quit: bye]
ua has joined #crystal-lang
wontruefree has joined #crystal-lang
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
hightower4 has quit [Ping timeout: 265 seconds]
<wontruefree> I has a script that `spawn` 10 time and then has a `Fiber.yield` after the spawns to wait for them all to finish. Will that work
vikaton has quit [Quit: Connection closed for inactivity]
ma has joined #crystal-lang
<wontruefree> it seems to just exit immediately. I can use sleeps to see the spawns will work if given time
<FromGitter> <straight-shoota> `Fiber.yield` is just `sleep(0)` that means, it yields execution to be resumed by a different fiber, but the main fiber will immediately be enqueued in the scheduler. It will probably be resumed before the spawned fibers are finished and exits the program.
<FromGitter> <straight-shoota> In order to wait for all fibers and only resume execution afterwards, you'd need some kind of wait group. This can be implemented using a channel which receives the a value once each fiber has finished.
<FromGitter> <straight-shoota> Like so: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b60c428cb4d5b036cadbdf1]
<FromGitter> <straight-shoota> I actually posted an RFC about this topic yesterday: #6468
Ven`` has joined #crystal-lang
pbodev1 has quit [Quit: ChatZilla 0.9.93 [Firefox 56.0/20170903140023]]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven`` has joined #crystal-lang
<lvmbdv> offtopic, pls dont get mad ^
Ven` has joined #crystal-lang
<FromGitter> <bew> Worst based on what?
<lvmbdv> personal opinion
Jenz_ has joined #crystal-lang
Ven`` has quit [Ping timeout: 264 seconds]
Jenz_ is now known as Jenz
hightower4 has joined #crystal-lang
duane has quit [Ping timeout: 248 seconds]
Jenz has quit [Quit: Mutter: www.mutterirc.com]
duane has joined #crystal-lang
ma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wontruefree has quit [Quit: bye]
duane has quit [Ping timeout: 256 seconds]
duane has joined #crystal-lang
<FromGitter> <Timbus> I have used all of these and, at certain times, all of them feel like the worst.
<FromGitter> <Timbus> @straight-shoota neat. So a spindle is sorta like a local scheduler? Do you attach handlers to it for when threads end/die/etc? Does it have any other features beyond thread waiting? Like I dunno, messaging
<FromGitter> <Timbus> I assume not, since there are already channels.
alex`` has joined #crystal-lang
ma has joined #crystal-lang
ma has quit [Client Quit]
alex`` has quit [Ping timeout: 248 seconds]
Ven` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ma has joined #crystal-lang
<FromGitter> <straight-shoota> It's not a scheduler. Scheduler is still global. It's a context for encapsulating fibers.
<FromGitter> <straight-shoota> Channels are for messaging, and the implementation actually uses channels. But a spindle can be used for collecting return values of the fibers.
duane has quit [Ping timeout: 256 seconds]
<FromGitter> <Timbus> Yup, that's what I guess I meant by 'local scheduler'. I guess I was also thinking it might be extended for things like 'actor' threads (send message to spindle -> all threads react). Guess that's out of scope though.
<FromGitter> <Timbus> probably handled better by some kinda supply/fanout type channely thing