<FromGitter>
<menih> Hi, I am new to Crystal - when do we expect to release v1? I am looking specifically for threading and IDE improvement before we can take a more serious attempt to use it in production. Specifically, with threading, need to allow multi thread, allow synchronous semantics, mutexes, semaphores, etc. With IDE, need full symbolic and language auto-completion, as well as interactive debugging, including breakpoints,
<FromGitter>
... variable evaluation, etc.
alexherbo2 has joined #crystal-lang
<FromGitter>
<naqvis> @menih Welcome aboard. Crystal already supports parallelism (multiple threads) when compiled in MT mode, Standard lib already comes with `Mutex` semantic. For IDE there isn't any full-blown IDE support (though you can find plugins for editors like VSCode, Vim etc). Debugging support is present as well, but would require you to manually configure that on VSCode or use at command line. There is no announced date
<FromGitter>
... for V1 yet, but Crystal is already quite stable enough and in use in production by early adopters. So if you are relying your decision on having language achieve its V1 then you shouldn't consider yourself as early adopter :P β β Just my two cents
<FromGitter>
<Daniel-Worrall> v1 was initially going to be the next release, but it got delayed for a reason I'm not aware of. Next release is 0.36.0 "soon". β Multithreading support is experimental as of right now, there are some gotchas in the stdlib, but you can definitely write MT safe code if you pay attention and use Mutex and Channels appropriately with regard to shared state and passing data. β IDEs, there is some support
<FromGitter>
... with LSP through https://github.com/elbywan/crystalline Auto-completion isn't there yet, but there is some support for diagnostics, goto, formatting, and symbols
<FromGitter>
<Daniel-Worrall> Oh, there's debugging support as naqvis says, but I've yet to try it
<FromGitter>
<Daniel-Worrall> I haven't actually dealt with a project that needed it, so that's why I haven't spent the time to look into it :D
<FromGitter>
<naqvis> same here, but I know it exists :P
<hightower2>
is that vscode editor shown in the screenshots in that thread?
<FromGitter>
<naqvis> yeah
<FromGitter>
<menih> thanks all for replies... seems like need a bit more maturity needed for our use case. Thanks again for prompt responses. I'll keep my eye on progression. I see a very bright future for crystal. It really sound too good to be true, so I hope it will get there. The three areas I've mentioned are pivotal to success - threading concurrency, decent IDE with symbolic auto-completion, and interactive debuggability.
<FromGitter>
<Daniel-Worrall> As do I. Crystal really brings on its promises of the ease of use of Ruby and the speed of C.
<FromGitter>
<Daniel-Worrall> I'd love to see you pop up either here or in the forums if you're in the market for remote Crystal Developers
<FromGitter>
<Daniel-Worrall> There used to be a crystaljobs site but it's down :(
<FromGitter>
<asterite> menih: interactive debuggability will never happen. This is a compiled language, and debuggers in such languages are never good. Or at least never as good as dynamic languages.
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
gangstacat has quit [Quit: Δis!]
<hightower2>
Hey I have a need to run something with 1 second of delay whenever a request for it comes in, regardless of how many other requests come in during that 1 second of waiting. I thought I could use channels for signalling, but they'll block when capacity is reached (instead I would just want to drop the extra messages during that 1 second window).
<FromGitter>
<Daniel-Worrall> Could you elaborate on the functionality? 1 second of delay for *every* request? Or just an initial 1 second delay and ignore any requests that come in while this delay occurs?
<hightower2>
So right now I use an Atomic#compare_and_set to make sure only one succeeds, and then I send a request through the channel, which upon receiving, waits 1 second, runs then thing, and resets the atomic value.
<hightower2>
So, it's an endless loop, doing: (1) wait for request, (2) when it comes in, schedule something to happen after 1 second, (3) ignore any other requests that come in during that 1 second, (4) when time elapses and action executes, reset flag to accept new requests
<hightower2>
and wondering if there's any more efficient way to do it
<hightower2>
(Note: that carc example seems to never print "already_scheduled", which it should... not sure why that is, but the idea should be clear anyway.)
<FromGitter>
<Daniel-Worrall> I'll take a look once I wrap my head around this model stuff I'm struggling with lol
deavmi has quit [Read error: Connection reset by peer]
<FromGitter>
<naqvis> only magicians like Ary are able to use them :P
gangstacat has joined #crystal-lang
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
postmodern has joined #crystal-lang
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 246 seconds]
^ has quit [Remote host closed the connection]
V[excess] has joined #crystal-lang
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
deimos_ has quit [*.net *.split]
issyl0 has quit [*.net *.split]
snapcase has quit [*.net *.split]
kevinsjoberg has quit [*.net *.split]
dom96 has quit [Ping timeout: 246 seconds]
issyl0 has joined #crystal-lang
snapcase has joined #crystal-lang
deimos_ has joined #crystal-lang
kevinsjoberg has joined #crystal-lang
deavmi has joined #crystal-lang
dom96 has joined #crystal-lang
fifr[m] has quit [Ping timeout: 240 seconds]
<FromGitter>
<erdnaxeli:cervoi.se> wow this is so weird
<FromGitter>
<erdnaxeli:cervoi.se> but good to known
hightower2 has quit [Ping timeout: 264 seconds]
<yxhuvud>
they are weird but work mostly like they do in ruby
<FromGitter>
<erdnaxeli:cervoi.se> yeaaah, I always have a weird feeling with those calls to ruby, as I never did ruby before :p
fifr[m] has joined #crystal-lang
<repo>
hey Blacksmoke16: is it possible to configure athena without using a yaml file?
<repo>
e.g. programmatically?
<repo>
i'd like to configure it using env vars
fifr[m] has quit [Ping timeout: 260 seconds]
fifr[m] has joined #crystal-lang
<FromGitter>
<repomaa> @Blacksmoke16 not sure if you got a notification from irc without the `@`
<repo>
i also have the issue that i can't write custom config classes that have required attrbutes. (not initialized directly in all initializer methods...)
<repo>
and it's not clear to me for what i need the ConfigurationResolver
<yxhuvud>
That depends on what irc client you use. It is not something that is standardized.
<repo>
i'm using weechat
<repo>
and parse_relay_msg.pl but it doesn't seem to be working...
<FromGitter>
<naqvis> and you are unable to access `config` inside services?
<FromGitter>
<Blacksmoke16> mm let me catch up
<FromGitter>
<Blacksmoke16> yea so the configuration stuff atm is all fairly coupled with yaml
<FromGitter>
<Blacksmoke16> a bit longer term i had the vision that you could do stuff in yaml like `host: !crystal/env HOST`
<FromGitter>
<Blacksmoke16> have you tried just not including that module?
<FromGitter>
<Blacksmoke16> using the block version of the `getter` macro might be fine, `getter credentials : Credentials { Credentials.new }` where internally that credentials type uses `ENV`
<FromGitter>
<Blacksmoke16> im not super happy with the yaml config stuff, just not sure how i want to handle it if i went some other direction
<FromGitter>
<Blacksmoke16> env vars are deff the simplest, but it doesnt really allow for more complex values than strings
<FromGitter>
<Blacksmoke16> easily at least
<FromGitter>
<Blacksmoke16> my thinking with the yaml was it would be possible to have some external build step that generates it based on the env it'll be running on
<FromGitter>
<Blacksmoke16> but idk, i'm open to alternatives to allow removing yaml as a dep. I could just me over thinkings all this
<FromGitter>
<Blacksmoke16> could just be*
<repo>
Blacksmoke16: see my shard, it supports quite a few data types
<FromGitter>
<jrei:matrix.org> all is about strings at first
<FromGitter>
<jrei:matrix.org> the question is the parsing
<repo>
^
<repo>
not trying to say env_config is perfect, i wrote it a long time ago and it could certainly need some love, but just for demonstration purposes: it's possible to map env vars to a quite complex config structure
<FromGitter>
<jrei:matrix.org> does Athena requires having YAML then?
<repo>
yeah
<FromGitter>
<jrei:matrix.org> too bad :( It would be better to be like the stdlib's `Log`
<FromGitter>
<Blacksmoke16> way things are designed atm it would be pretty easy for the end user to customize how the config obj is provided and forgo yaml
<raz>
i just use this teeny macro to turn env vars into consts. complains at startup if they're not set. works like a champ
<FromGitter>
<jrei:matrix.org> @Blacksmoke16: right, for this case better using JSON/YAML
<FromGitter>
<jrei:matrix.org> personally, I'm not a fan of all this complex runtime configuration that frameworks provide
<FromGitter>
<jrei:matrix.org> I don't mind re-deploying the app to change the configuration
<FromGitter>
<anapsix> I suppose it should be called `reachable?`
<FromGitter>
<Blacksmoke16> @jrei:matrix.org to be clear its not really runtime configuration as its loaded and not really changeable after starting the app
<FromGitter>
<jrei:matrix.org> so, why not using Crystal then?
<FromGitter>
<jrei:matrix.org> if I see a JSON/YAML file, I can think to change it and reload the app to change its configuration
<FromGitter>
<Blacksmoke16> :shrug: i guess the only reason i can think of is it makes things less verbose, like if you had a few rules to configure
<FromGitter>
<jrei:matrix.org> Not sure. A Crystal NamedTuple would be as-verbose
<FromGitter>
<Blacksmoke16> but for the amount of stuff thats configurable atm, prob not a problem
<FromGitter>
<Blacksmoke16> esp given both yaml configurable things are optional
<FromGitter>
<jrei:matrix.org> repo then, I don't really see the point of env vars for compile-time
<FromGitter>
<jrei:matrix.org> at least if makes more sense to me than a JSON/YAML
<FromGitter>
<naqvis> @anapsix you'd better use `connect_timeout` argument of `TCPSocket.new` to timeout at specified interval, instead of waiting for long time
<FromGitter>
<anapsix> @naqvis afaik, it doesn't wait if endpoint which is being checked is not yet listening
<FromGitter>
<naqvis> attempt should drop if connection port not yet listening instead of hanging for system defined timeout, thatβs why you have retry mechanism. As your intention is to identify quickly if specific port is up and ready for connection
<FromGitter>
<anapsix> the intention is to wait roughly as long as the timeout and keep retrying to connect
<FromGitter>
<anapsix> return failure if connection could not established after reaching timout
<FromGitter>
<naqvis> so you should check what kind of exception is being raised, if connect error you can do a short sleep and retry, but if its connect timout then abort
<FromGitter>
<anapsix> which is pretty much what I ended up doing β was wondering is there's a more elegant way
<FromGitter>
<naqvis> elegant in what sense?
<FromGitter>
<naqvis> donβt perform a complete handshake? behave like nmap?
<FromGitter>
<anapsix> something more graceful, something that supports "timeout" and keeps retrying on it's own, without me having to sleep and try again :D β since I only need to check if port if is open and accepting connections
<FromGitter>
<naqvis> havenβt seen any language where stdlib comes with such feature, itβs always custom code, you already made a func, but for sure you can move that to shard for others to use π
deavmi has quit [Read error: Connection reset by peer]
<FromGitter>
<anapsix> alright... just checking, thanks!
<FromGitter>
<naqvis> π
deavmi has joined #crystal-lang
<raz>
i think go-lang has some stuff around timeouts baked in
<raz>
it's prob not easy to generalize, but would be nice to have something robust in stdlib, since people inevitably get it more or less wrong every time (no exponential backoff, no jitter etc.)
daemonwrangler has quit [Quit: ZNC 1.7.5 - https://znc.in]
deavmi has quit [Ping timeout: 246 seconds]
<FromGitter>
<andrewc910> Hey, I saw the forum post about 0.36.0. What's up with 1.0? What's the reason 1.0 was pushed back?
<FromGitter>
<Blacksmoke16> its just been so long since the last release
<FromGitter>
<andrewc910> I get why 0.36.0 is being released.
<FromGitter>
<andrewc910> More curious what's the hold up on 1.0
ua_ has joined #crystal-lang
<FromGitter>
<jrei:matrix.org> not sure what difference will it be between 1.0 and an hypothetical 0.36.1
<straight-shoota>
effectively, 1.0 wasn't pushed back by 0.36.0, it's just inserted in between
<FromGitter>
<Blacksmoke16> prob is a lot going on behind the scenes
<straight-shoota>
*(at least not more than 1.0 was already delayed before)
<straight-shoota>
essentially, 1.0.0-pre1 has been rebranded as 0.36.1 for having so many changes
ua_ has quit [Excess Flood]
<straight-shoota>
at this point, we would have definitely required a 1.0.0-pre2, so that's just going to be called 1.0.0-pre1 now
<straight-shoota>
(and potentially a 0.36.x between if anything needs fixing after the release)
<straight-shoota>
(which is very likely considering the amount of changes in master)
hightower2 has joined #crystal-lang
deavmi has joined #crystal-lang
ua has joined #crystal-lang
deavmi has quit [Ping timeout: 240 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 260 seconds]
hightower2 has quit [Ping timeout: 264 seconds]
<FromGitter>
<asterite> j8r the difference is 0.64 vs 0.63.9
deavmi has joined #crystal-lang
<FromGitter>
<anapsix> I would like to publicly thank @bcardiff for https://github.com/bcardiff/ghshard β Thank you, Brian. I found ghshard very helpful.
deavmi has quit [Ping timeout: 240 seconds]
deavmi has joined #crystal-lang
<FromGitter>
<oprypin:matrix.org> @anapsix: how did you discover this repo?
<FromGitter>
<anapsix> I was looking for docs on how to submit a shard to crystalshards.org, and found this by accident.. β Later, I realized crystalshards.org is finding shards automagically :)
deavmi has quit [Ping timeout: 264 seconds]
<FromGitter>
<bcardiff> Thanks @anapsix itβs might be a bit to opinionated but Iβm glad you like it.
<FromGitter>
<anapsix> created in Dec 2016, last updated in Nov 2018 - works well
deavmi has joined #crystal-lang
<FromGitter>
<jrei:matrix.org> @asterite: there should have no breaking changes between 0.36 and 1.0, right?
<FromGitter>
<jrei:matrix.org> That's all good, 1.0 to be like ~0.36.2 + LTS
deavmi_ has joined #crystal-lang
deavmi has quit [Read error: Connection reset by peer]
<FromGitter>
<jrei:matrix.org> IIRC some projects did even promote a 0.x version to 1.0, the 2 being identical
<FromGitter>
<asterite> No idea, but I'm sure there will be breaking changes
<FromGitter>
<jrei:matrix.org> I hope too, but just small ones
<FromGitter>
<jrei:matrix.org> It won't be wise to have big ones
<FromGitter>
<jrei:matrix.org> In a sense, if the 1.0 is like the 0.36.2, pre-releases won't even be necessary
<straight-shoota>
I guess we'll figure that out after 0.36.0 is released
_ht has quit [Remote host closed the connection]
hightower2 has joined #crystal-lang
<FromGitter>
<jrei:matrix.org> Maybe, but there is the VERSION file (no big deal)
<straight-shoota>
Yeah well, that can always need to change
<straight-shoota>
after releasing x.y there's always some uncertainty about whether the next release is x.(y + 1) or (x + 1).0
<FromGitter>
<jrei:matrix.org> VERSION must be a semantic one?
hightower2 has quit [Quit: Leaving]
HumanG33k has quit [Read error: Connection reset by peer]
HumanG33k has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
<FromGitter>
<watzon> Is it possible to `{% debug %}` an entire file so that you can see all generated code?
<FromGitter>
<Blacksmoke16> idt it works like that, you put it in macro code and it shows that expansion
<FromGitter>
<watzon> Right, that's why I'm wondering. I'm getting an error without a helpful trace (using `--error-trace`) that's giving me a line number where the error couldn't possibly be occurring. So I'm pretty sure it's giving me an adjusted line number that comes from after code has been generated by my macros.
<FromGitter>
<watzon> It would be really helpful to be able to debug the whole file the way you can a single macro
<FromGitter>
<Blacksmoke16> maybe could use that other crystal tool thing for this
<FromGitter>
<watzon> `expand`?
<FromGitter>
<Blacksmoke16> yea
<FromGitter>
<watzon> Doesn't seem to do any more than `{% debug %}` does
<FromGitter>
<Blacksmoke16> welp, thats all i got
<FromGitter>
<watzon> Oh well I'll have to do some good ol' fashioned print debugging
<FromGitter>
<watzon> Figured it out
<FromGitter>
<Blacksmoke16> that was quick
<FromGitter>
<watzon> Yeah ended up being easier to track down than I thought it'd be