<FromGitter>
<matthewmcgarvey> What led you to find that? Or how should I have recognized it
<FromGitter>
<Bherivy> I am new to Crystal 😂 But when I can't find something, my first thinking is it must be generated by macro
<FromGitter>
<girng> lol
<FromGitter>
<codematix> Hi, I have seen in many examples and libraries, Hash literals can be written Ruby style as in `{ one: 1, two: 2 }`. I however do not understand why the Crystal documentation does not mention this. Should this literal syntax no be used?
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
ashirase has quit [Ping timeout: 272 seconds]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
ashirase has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
marmotini_ has quit [Ping timeout: 246 seconds]
marmotini_ has joined #crystal-lang
<FromGitter>
<ArtLinkov> Hey all, I think there is a bug in the .from_json method while parsing both int and float in an array ⏎ Here is an example: https://play.crystal-lang.org/#/r/62i1
<FromGitter>
<ArtLinkov> Is this a known issue?
<FromGitter>
<girng> is it possible to add the total amount of time taken in --stats?
marmotini_ has quit [Ping timeout: 245 seconds]
<FromGitter>
<bew> you can always use `time` before the command, to get time information on that command
rohitpaulk has joined #crystal-lang
<FromGitter>
<proyb6> Which other WebSocket benchmark tool can I use since I think the Thor (NPM) isn't update to date now.
<FromGitter>
<mavu> Okay. It does in fact. but why? Whats happening there?
<FromGitter>
<Blacksmoke16> id have to say that `@@` denotes a class variable, so that code was running on the class level, which that local var was out of scope
<FromGitter>
<Blacksmoke16> can read class vars in class level stuff but ivar/local vars cant be read at class level
<FromGitter>
<kinxer> Or what @Blacksmoke16 said. Mine was just a guess.
<FromGitter>
<kinxer> It does seem kind of odd to me to have a local variable in a module that isn't an instance or class variable... Are you just trying to make `@@config` more easily customizable in your code?
<FromGitter>
<mavu> Ok, i think I'm using module wrong. I'm trying to make config globally accessible without passing it to the initializers of my different classes
<FromGitter>
<mavu> I think I need a "anatomy of a Crystal program" kind of help. ⏎ crystal init creates a directory structure which has a .cr file under src/ and that contains ⏎ module projectname ⏎ end ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5c487b6935350772cf78fab2]
<FromGitter>
<kinxer> Yeah, you can do that with modules, using class variables as you're doing. What's weird is `config_file`.
marmotini_ has quit [Ping timeout: 240 seconds]
<FromGitter>
<kinxer> Are you trying to discard that as soon as you use it?
<FromGitter>
<mavu> ok, so the module should only contain class variables and functions, but not program logic, and local variables?
<FromGitter>
<Blacksmoke16> also prob be a better idea to use a struct and read the yaml file in, then its type safe vs `@@config` being a bunch of `YAML::Any`
<FromGitter>
<kinxer> ^
<FromGitter>
<Blacksmoke16> could still use your module be do like
<FromGitter>
<Blacksmoke16> where you ofc have a `Config` struct with the properties in the yaml file
<FromGitter>
<mavu> Ok, I think I understand that.
<FromGitter>
<dscottboggs_gitlab> I don't see any reason to avoid putting logic into modules.
<FromGitter>
<dscottboggs_gitlab> Modules allow for a bit of a simulation of a functional workspace if that's what's appropriate. But it is just a simulation: Crystal is a strictly OOP language.
<FromGitter>
<mavu> @dscottboggs_gitlab functional workspace as in functional language?
<FromGitter>
<mavu> ok, thank you all, that is interesting. I think I need a bit of time to restructure . ⏎ One more question: In the documentation of OptionParser ( https://crystal-lang.org/api/0.18.7/OptionParser.html)
<FromGitter>
<mavu> the example of how to use it. how would that relate to packing things in a module and methods?
<FromGitter>
<Blacksmoke16> could still call methods inside a module
<FromGitter>
<Blacksmoke16> or to set settings from your settings struct
<FromGitter>
<Blacksmoke16> well if you're doing that prob best to use a class not a struct
<FromGitter>
<girng> i want to make a topic on the forum to get everyones results and time taken to do a benchmark script. and compare it to my system on WSL and see how fast the compiler is. but i believe there are too many variables that wouldn't create good data. any idea?
<FromGitter>
<kinxer> @girng Do you mean too many variables about how fast it should be due to differences in everyone's system?
<FromGitter>
<gildub> Hi, any idea how far Crystal is from production?
<FromGitter>
<mavu> @girng I can run it on my raspberryPi if you want to know how slow it can get :P
<FromGitter>
<girng> @kinxer yah exactly!
<FromGitter>
<kinxer> @gildub Do you mean 1.0?
<FromGitter>
<gildub> @kinxer, yes.
<FromGitter>
<girng> like, i'm on a i7 2600. another user might be on raspberry PI, or a 8700k, etc lol
<FromGitter>
<fridgerator> @gildub People are already using crystal in production
<FromGitter>
<dscottboggs_gitlab> for certain workloads...
<FromGitter>
<kinxer> @girng Well, you could have everyone tell you what OS they're on and with what resources (clock speed, ram, etc.).
<FromGitter>
<gildub> @fridgerator, yes I know but is not until Windows is supported it won't be 1.0?
<FromGitter>
<dscottboggs_gitlab> @gring I would get some weird results I'm on dual-10-year-old-xeons
<FromGitter>
<girng> there is a user on the forum that said WSL hinders crystal's compilation process by a lot. just want to see how big of a difference. i guess the best way is to install linux on a separate SSD and just compare the time difference on WSL
<FromGitter>
<dscottboggs_gitlab> I was reading earlier that there are some huge performance hits with WSL and IO
<FromGitter>
<girng> @kinxer good idea i'll just ask for users to list their specs
<FromGitter>
<fridgerator> @gildub I dont know what 1.0 means for the core team, probably windows support + other things
<FromGitter>
<mavu> @dscottboggs_gitlab that does not surprise me at all.
<FromGitter>
<kinxer> @gildub Are you just wanting to know when Windows will be supported, or are you just using that as an example of why it's now 1.0?
<FromGitter>
<dscottboggs_gitlab> yes, from what I've read it's Windows support and Multiprocessing for 1.0, along with some other minor milestones
<FromGitter>
<girng> with that said, what's a good generic benchmark script though? like parsing a huge json file with JSON.parse? or what lol i don't know how to make a fair one
<FromGitter>
<gildub> @kinxer, if 1.0 means windows support then yes, when (roughly) would that happen? Until then it's not really realistic to propose crystal for a big project.
<FromGitter>
<gildub> 839435
<FromGitter>
<gildub> Oops
<FromGitter>
<dscottboggs_gitlab> There is steady but slow progresss on it.
<FromGitter>
<dscottboggs_gitlab> According to some core guys there's not gonna be any ETAs without a lot more funding
<FromGitter>
<gildub> Yeah that's the impression I have following on the commits ^^.
<FromGitter>
<gildub> I'm going to try bringing some funds (besides just my personal wallet)....
<FromGitter>
<dscottboggs_gitlab> that would be awesome I'd love to see crystal gain some more traction
<FromGitter>
<gildub> Absolutely!
<FromGitter>
<mavu> Well, crystal has my 5$ per month now, so everything will be fine :)
<FromGitter>
<j8r> @mavu on opencollective?
<FromGitter>
<dscottboggs_gitlab> @mavu has saved the day!
<FromGitter>
<mavu> link above that leads to bountysource
<FromGitter>
<mavu> @dscottboggs_gitlab not only that, but I also tweeted it to all of my 3 followers!
<FromGitter>
<girng> when doing `time crystal benchmark.cr`, it outputs: ⏎ ⏎ ```real 0m1.410s ⏎ user 0m0.578s ⏎ sys 0m1.000s``` ⏎ ⏎ which one is the time taken to complete execution form start to finish after all io is done in the console? [https://gitter.im/crystal-lang/crystal?at=5c4881f5c45b986d11a8fbb0]
<FromGitter>
<dscottboggs_gitlab> @j8r that makes sense but if someone's already donating through bountysource I wouldn't discourage them from doing so. Perhaps someone with the authority to do so could change the link?
<FromGitter>
<j8r> there is already a PR
<FromGitter>
<j8r> from someone of opencollective
<FromGitter>
<dscottboggs_gitlab> ah I was just about to look into that
<FromGitter>
<dscottboggs_gitlab> but I meant in the chat info on gitter
<FromGitter>
<girng> ROFL at the inactivity fee email
<FromGitter>
<mavu> ahh, so thats a macro, creating the contents at compile time. neat. I'm starting to understand where they come into the language design.
<FromGitter>
<mavu> Oh, holla there is a lot hidden under that unassuming heading in the documentation.
<FromGitter>
<Blacksmoke16> yea, thats all the macro level types