jhass changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Crystal 0.35.1 | 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
deavmi has quit [Ping timeout: 260 seconds]
deavmi has joined #crystal-lang
oddp has quit [Ping timeout: 256 seconds]
postmodern has joined #crystal-lang
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 260 seconds]
_whitelogger has joined #crystal-lang
Liothen has joined #crystal-lang
redplateaus[m] has joined #crystal-lang
return0e[m] has joined #crystal-lang
r0bby has quit [Ping timeout: 261 seconds]
sagax has joined #crystal-lang
Seich has joined #crystal-lang
gangstacat has joined #crystal-lang
jhass has joined #crystal-lang
f1reflyylmao has joined #crystal-lang
repo has joined #crystal-lang
DeBot has joined #crystal-lang
antoszka has joined #crystal-lang
fifr has joined #crystal-lang
FromGitter has joined #crystal-lang
Human_G33k has joined #crystal-lang
duane has joined #crystal-lang
raz has joined #crystal-lang
Elouin has joined #crystal-lang
csaba has joined #crystal-lang
Nekka has joined #crystal-lang
bazaar has joined #crystal-lang
oprypin has joined #crystal-lang
coderobe has joined #crystal-lang
postmodern has joined #crystal-lang
early has joined #crystal-lang
livcd has joined #crystal-lang
redplateaus[m] has quit [Ping timeout: 246 seconds]
return0e[m] has quit [Ping timeout: 246 seconds]
oprypin has quit [Max SendQ exceeded]
r0bby has joined #crystal-lang
oprypin has joined #crystal-lang
hamoko[m] has joined #crystal-lang
return0e[m] has joined #crystal-lang
ryanprior has joined #crystal-lang
psydroid has joined #crystal-lang
ChrisVincent[m] has joined #crystal-lang
MasterdonX has quit [Ping timeout: 240 seconds]
MasterdonX has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter> <jwaldrip> Is there a hook that fires at the end of the program?
<FromGitter> <jwaldrip> Rather than after a class/module is closed?
<FromGitter> <jwaldrip> im looking to dynamically add render methods, but I dont know if its possible
<FromGitter> <jwaldrip> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5f0801d68b72655b5561c469]
alexherbo2 has joined #crystal-lang
<raz> jwaldrip: unfortunately not. i find myself wanting one surprisingly often, too
<jhass> Stephie: 32 and I give each VM 2 though. I kinda wanted to see how many we need to not be the bottleneck, that's why I started low
<FromGitter> <xmonader> Hello any idea on this problem with toml? https://github.com/crystal-community/toml.cr/issues/24 is it a regression in the library? loading that with python works just fine?
<jhass> why regression, did it work before?
<jhass> it probably should be elsif !has_more_names
<FromGitter> <naqvis> `A TOML parser for Crystal, compliant with the v0.4.0 version of TOML.`
<FromGitter> <naqvis> this is from https://github.com/crystal-community/toml.cr
<FromGitter> <naqvis> Array related clarifications were added to TOML v0.5 and upward
<FromGitter> <naqvis> so I would say Toml shard is doing what is says on its github page
<jhass> updating it for the latest version is most likely welcome though
<FromGitter> <naqvis> +1
<FromGitter> <xmonader> @jhass I asumed it's a first class citzen in the language, but looks like my assumption was wrong
<jhass> uhm yeah, it would be in stdlib otherwise
<jhass> even then regression = something previously working broke
<jhass> broken since forever is just called bug
<FromGitter> <xmonader> > *<jhass>* even then regression = something previously working broke ⏎ ⏎ yeah, i assumed it's a regressionn because i did some toml before with crystal and this one seemed legit :)
<FromGitter> <xmonader> but thank you for clarification indeed
<jhass> I would see if turning https://github.com/crystal-community/toml.cr/blob/master/src/toml/parser.cr#L152 into elsif !has_more_names breaks any tests, add a test for a minimal version of your case and send a PR :)
<jhass> fixing these kinds of things is usually faster than complaining :P
oddp has joined #crystal-lang
<FromGitter> <grkek> I fucking hate the crystal subreddit
<jhass> why?
<jhass> also why wouldn't you just ignore it then
<raz> i never quite understood why reddit got so popular. but i guess that may have to do with me not being 14 anymore :<
<jhass> my guess is the lax content policies and good separation of different niches. Opposing viewpoints are just contained to different non-interacting parts of the site. In that sense reddit isn't one community or forum, but a platform for any number of them.
<raz> yea, dunno. the S/N ratio seems to be about the same as twitter, with the only advantage being that the noise comes at you in chronological instead of randomized order
<jhass> the difference is that discussions are separated by interest, not topic. While the same links are crossreferenced, you actively need to go to the discussion another community has about the topic, you don't see it right away and you're not even nudged to take a look
<jhass> it creates a much stronger and thus more engaging echochamber
<raz> hmm astute observation indeed
<FromGitter> <xmonader> @jhass seems it's fixed https://github.com/xmonader/toml.cr :)
<jhass> and all specs still pass? Then great, add a spec and send a PR :)
<jhass> also you can just join the else and the if into an elsif
<FromGitter> <xmonader> @jhass isn't that else of `when` expression?
<FromGitter> <xmonader> yup all specs passed
<jhass> oh, right, nvm me then :D
<FromGitter> <xmonader> jhass, when added the example in spec and created an equivalent json from python ⏎ I found the keys aren't the same ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5f083f403e4a827d19b7d39d]
<jhass> sorry, I'm not actually familar with the shard
<jhass> I just went by the error message you posted for my initial suggestion
<FromGitter> <xmonader> no worries I already asked manas to help too thank you so much
postmodern has quit [Quit: Leaving]
duane has quit [*.net *.split]
Human_G33k has quit [*.net *.split]
FromGitter has quit [*.net *.split]
duane has joined #crystal-lang
FromGitter has joined #crystal-lang
Human_G33k has joined #crystal-lang
<yxhuvud> urgh. having to create Time::Span with the value measured in nanoseconds just to compare against a millisecond was a bit inconvenient. so many zeros :/
<FromGitter> <asterite> jwaldrip: macro finished runs at the end of the program. It seems some misunderstanding that it runs when a class is closed is running around here, but that's not true
<jhass> "at the end of the program" might not be the best description either :P
<raz> ohhh, TIL
<raz> agree "end of program" is confusing. would "end of macro processing" be more accurate?
<raz> hmm, the docs say `finished is invoked after instance variable types for all classes are known.`
<yxhuvud> I guess I can just make a float out of it, but it is quite silly to have a timespan class that isn't the most convenient way to actually compare time spans..
<jhass> yxhuvud: you're aware of .seconds, .milliseconds etc?
<FromGitter> <asterite> it's really at the end of the program, after the last expression
<raz> jhass: hmm yep, that sounds clearer to me. perhaps could be extended to "after parsing and macro processing is finished"? (if that is even true)
<jhass> is it true? No clue
<raz> well, that's kinda the critical bit for me and i imagine for most people who look for this macro :D
<jhass> asterite: I think "the program" is not clearly defined in this context. It could be the compiler finished running, it could the user program finished running or it could be what you mean, the parsing reached the end of the user code
<yxhuvud> jhass: if I can do `sleep 0.005` I'd expect to be able to test that with `Time.measure {sleep 0.005}.should be > 0.005` or at least `.. .should be > Time.span.new(0.005)`
<jhass> .should be > 5.milliseconds
<yxhuvud> ok, better than the constructor but still an inconsistency.
<FromGitter> <asterite> yeah... I wish I never introduced finished
<jhass> yxhuvud: sleep 5.milliseconds is valid fwiw
<jhass> asterite: yeah, I still believe the usecases could be (mostly better) solved with gradual hooks, the ones we already have like inherited/included/extended, method_added and some more like instance_var_added, constant_added, class_var_added etc
<jhass> one for everything
<FromGitter> <Blacksmoke16> finished has some usecases imo
<jhass> but does it have any where we couldn't come up with a mechanism that's easier to reason about?
<FromGitter> <Blacksmoke16> not sure, let me see if i can put together some example
<FromGitter> <Blacksmoke16> meh, cant think of a good one atm
<jhass> :P
<FromGitter> <jwaldrip> I like the idea of finished. But it doesn't fire when I expect it to
<FromGitter> <jwaldrip> Finished is powerful and allows for some post processing at compile time.
<FromGitter> <jwaldrip> In Orion I use it to start the server if the user has not already done so manually already
<FromGitter> <jwaldrip> When in app mode
<FromGitter> <jwaldrip> And I was trying to use it again to create a view registry. The issue with layouts in orion is that they call yield to render the inner view which means they need to define a method. Unless procs can take blocks as an argument
<FromGitter> <jwaldrip> or call yield themselves
<FromGitter> <jwaldrip> My top level layout macro just defines the `render_layout` function which works if controllers has a single layout. But I wanted the ability to also have overridable inline layouts using a layout option on the render macro.
<FromGitter> <jwaldrip> i guess I could do a toplevel `register_layout_function`
deavmi has quit [Ping timeout: 258 seconds]
<FromGitter> <jwaldrip> I figured something out. I think i got it
deavmi has joined #crystal-lang
Human_G33k 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> <Blacksmoke16> that was quick
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
<raz> hooks like finished save your bacon when you're dealing with other peoples code tho
<raz> my use case is always "let this ORM do all its ormy things" and then i do my thing on top of that.
<raz> because the alternative of patching up something like an ORM is usually a nightmare. patches can later evolve from the hooked-up version. but it's _way_ easier to start with such a hook-approach than finding all the correct spots that need to be patched up in the ORM itself.
<FromGitter> <jwaldrip> So every view sits within a known folder... so I can just scan every file in that folder, tokenize it, and then use code generation to make my methods
<FromGitter> <jwaldrip> using run to generate the code and then `{{ run "defs.cr" }}` to insert the code back into my main program
<FromGitter> <jwaldrip> but of course `{{ run "../view/defs.cr", `date +%s%N` }}` to avoid caching
<FromGitter> <jwaldrip> unless there is a better way to prevent macro caching?
<FromGitter> <eliasjpr> @asterite hey I am giving a Crystal Workshop for my team at the New York Times, this is a talk to a potential 400+ engineers that we have my goal of the workshop/talk is to give an introduction to the language and build excitement around release of v1. I would like to get some ideas for the intro and hands on coding session (What can we build)
<FromGitter> <eliasjpr> Community please chime in ☝️
<FromGitter> <jwaldrip> Do we have a general timeline on v1?
<FromGitter> <jwaldrip> @eliasjpr what does NYT use right now?
<FromGitter> <jwaldrip> If possible. It would be awesome to do a remote workshop over zoom and have other teams join too.
<FromGitter> <jwaldrip> @asterite it would also be great to organize a global zoom conference in the next few months. Much like the one we had in SF but much more available and unlimited from a space standpoint
<FromGitter> <eliasjpr> @jwaldrip I can arrange for that. But this is more for internal NYT. In regards to stacks we use most of the main stacks, (Go, Java, Ruby, Python, Scala, PHP...) depending on the team youre on
<FromGitter> <jwaldrip> Gotcha. Makes sense.
<FromGitter> <eliasjpr> There is a big potential given all the tech that we use internally is a big pool of broad tech audience
<FromGitter> <asterite> @eliasjpr nice!
alexherbo2 has quit [Ping timeout: 256 seconds]
<FromGitter> <eliasjpr> Does anyone have a presentation deck for Crystal Language that would like to share? I will like to know what you think is important to present/demo about Crystal?
deavmi has quit [Read error: No route to host]
deavmi has joined #crystal-lang
<raz> eliasjpr: planning to use crystal mostly for backend or web stuff, or both? (it might be interesting to look into the relevant/preferred frameworks for the respective tasks, lucky, amber, grip, etc.)
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 272 seconds]
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 260 seconds]
<FromGitter> <eliasjpr> Backend and Web mostly
<FromGitter> <deiv> Hi ... https://packages.qa.debian.org/c/crystal.html <--- @RX14 thanks for the bootstrap (swamp) thing :p
<Stephie> thank you!!
<Stephie> this is cool
<Stephie> i'm glad you managed to figure it out
<FromGitter> <deiv> nah nah, you you ... :)
<FromGitter> <Blacksmoke16> coughsoundslikeajobforathenacough :p
alexherbo2 has joined #crystal-lang
<FromGitter> <ondreian> when was `crystal spec` changed to no longer run any tests in `spec/`?
<FromGitter> <ondreian> seems a bit weird that it exits with status zero if no tests are run, it breaks the default Travis CI environment silently now
<FromGitter> <Blacksmoke16> hm?
<FromGitter> <ondreian> If I run ` crystal spec` without any arguments, it doesn't run any of my tests
<FromGitter> <Blacksmoke16> do you have tests? and do they end in `_spec.cr`?
<FromGitter> <ondreian> hmm, they do not end in `_spec.cr` but the project was autogenerated by `crystal new`
<FromGitter> <Blacksmoke16> `crystal --version` what does this return?
<FromGitter> <Blacksmoke16> `crystal new` isnt a thing
<FromGitter> <Blacksmoke16> (at least anymore)
<FromGitter> <ondreian> Ok, not sure what happened, but yeah, adding `_spec` to the files fixed runner them
<FromGitter> <ondreian> I'm on whatever is newest in apt, maybe I accidentally renamed them in a glob
<FromGitter> <ondreian> 😦 I did de-nest some unnecessary folders the other day
<FromGitter> <Blacksmoke16> rip
<FromGitter> <Blacksmoke16> yea they have to end in `_spec.cr` for it to pick them up
<FromGitter> <ondreian> Well, I was very cornfused there for a minute, thanks
<FromGitter> <Blacksmoke16> np
<FromGitter> <alexherbo2> @asterite I like your idea
<FromGitter> <alexherbo2> Does something prevent `&meth(&2, &1)` syntax?
_whitelogger has joined #crystal-lang
<FromGitter> <asterite> Yes: the other core team members not wanting it before 1.0
Human_G33k has joined #crystal-lang
HumanG33k has quit [Ping timeout: 246 seconds]
sagax has quit [Remote host closed the connection]
renich has joined #crystal-lang