leafybas_ has quit [Remote host closed the connection]
<ytti>
sorry to pester
leafybasil has quit [Read error: Connection reset by peer]
<ytti>
anyone remember blog article or such about the concurrency? or documents?
leafybasil has joined #crystal-lang
<ytti>
there is no 'GIL' right, as there is no I
<ytti>
but what is the idiomatic way in crystal to achieve concurrency?
Ven has quit [Ping timeout: 264 seconds]
ismaelga has quit [Read error: Connection reset by peer]
ismaelga has joined #crystal-lang
<jhass>
ytti: atm, spawn & channels
<ytti>
jhass, is there document on their use?
<jhass>
not sure, probably not
<ytti>
jhass, maybe i'm dreaming, but i recall article even about them, and in the article i recall they mentioend golang and how same ideology is shared 'share memory by communicating'
<jhass>
well, I don't :P
<jhass>
which of course doesn't mean there's none
<jhass>
ytti: what do you want to parallelize (well, concurentize? for now)
<jhass>
?
<ytti>
jhass, i want share state between webserver and thread/process/method/function which runs periodically
<jhass>
how exact does the periodic invocation need to be?
A124 has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
<jhass>
like do you need it to happen exactly at 00:00:00, 00:00:05, 00:00:10, ... for a five second interval or is some slop okay?
ismaelga has joined #crystal-lang
<jhass>
and is some drifting okay?
ismaelga has quit [Remote host closed the connection]
<ytti>
jhass, there will be GET/POST to web server, and these will have seconds to future, after which something must trigger
<ytti>
jhass, i don't want to the webserver thread itself to do much anything else than to take the requests in and store the state
<ytti>
jhass, i want another thread to process the thread, trigger actions etc
buggs has joined #crystal-lang
<jhass>
ytti: best just spawn a coroutine for each and sleep for the timeout
<jhass>
or delay I should say rather
<jhass>
coroutine's are quite cheap, having a few thousands is of no issue
<jhass>
in fact http/server already does spawn one for each request incoming for example
<ytti>
jhass, thanks, i'm just misgign the article :) pretty sure it exists, i can't have dreamd so specifically
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 255 seconds]
n1ftyn8_ has quit [Ping timeout: 240 seconds]
danzilio has quit [Ping timeout: 240 seconds]
avdi has quit [Ping timeout: 240 seconds]
n1ftyn8_ has joined #crystal-lang
avdi has joined #crystal-lang
danzilio has joined #crystal-lang
<BlaXpirit>
is this still the best info available on fibers?
<ytti>
is there plan to integrate the CLI tools 'crystal' and 'shards'
<ytti>
imho, it's not too late
<ytti>
why have multiple CLI, why not make shards integral part of it
<ytti>
also, i'd really love golang style opinionated formatting
<ytti>
(i know docs page has a start, but enforcing it by standard tooling is neat)
<ytti>
i'm not sure why i need to say
<ytti>
crystal build --release src/software.cr
<ytti>
shouldn't that be by convention?
<ytti>
i'm in directory 'software' shard.yml ays name is is software
<ytti>
why wouldn't 'crystla build' be sufficient
<ytti>
i wish idiomati crystal would omit parenthesis
<ytti>
but it seems that ship has sailed
<jhass>
ytti: yes, shards will eventually be merged into crystal, crystal deps already delegates to it. For now keeping them separate allows for faster iteration on both though
<jhass>
ytti: there's crystal tool format now
<ytti>
w
<ytti>
cool
<jhass>
ytti: release is quite a bit slower to compile, and unoptimized binaries aren't slow at all. You do development builds far more often than release builds, so it's the saner default
<jhass>
ytti: there are a couple of issues open on the crystal and shards repos regarding a sane default target for crystal run and crystal build
<jhass>
and yes, I too wish parenthesis less would be favored
<jhass>
by they felt that def foo : Bar and def foo baz : Bar is to ambiguous to the reader
<jhass>
it's one of the reasons I probably won't use the format tool on my own projects though
<jhass>
er, *but they
Sadin has joined #crystal-lang
<ytti>
i wonder if it was good decision to us YML instead of just crystal DSL in shard.yml
<ytti>
there is no reason to support non-programmers
<ytti>
as only programmer would ever create it
<ytti>
so it's not immediately obvious to me, who is receiving the favour there
<jhass>
a format you can parse at runtime is _way_ easier to implement
<jhass>
having to compile something in order to parse it is quite a barrier
<jhass>
you make your otherwise fairly small tool depend on the entire compiler
<jhass>
it's just unnecessary surface really
kulelu88 has joined #crystal-lang
kulelu88 has joined #crystal-lang
<ytti>
i was thinking that shard has some skeleton software which creates packages, fetches dependnecies etc
<ytti>
and this module definition file, would be taped into that
<ytti>
so when you call shards install or similar it compile the program and runs it
<ytti>
but i don't have right now example in my mind where i'd want dynamism in the package definitino
<jhass>
I mean you could always built a tool that writes out a generated shard.yml and calls shards if you wanted
<jhass>
but we had lengthy discussions about the format, it'll stay this way for now
ismaelga has quit [Remote host closed the connection]