ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.2 | 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
yaewa has joined #crystal-lang
moei has quit [Ping timeout: 252 seconds]
yaewa has quit [Quit: Leaving...]
moei has joined #crystal-lang
<FromGitter> <S-YOU> From the benchmarks, what I understood was PG(postgresql?) is fast 😄
rohitpaulk has joined #crystal-lang
hightower3 has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 252 seconds]
hightower2 has quit [Ping timeout: 264 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 245 seconds]
sherjilozair has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter> <galvertez> is there anything i can do to enforce a given behavior before/during/after class inheritance? kind of like `Class#inherited` from ruby
<FromGitter> <galvertez> not a huge deal if no, but i have leveraged that method in ruby and have grown to like the fact that you can kind of set policies for classes and keep child classes up to date and simultaneously keep behind the scenes stuff... behind the scenes :)
<FromGitter> <galvertez> macros come close, but don't quite cut it for a particular implementation i'm wrestling with
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 245 seconds]
<FromGitter> <bew> what are you trying to do?
<FromGitter> <galvertez> i can't think of a way explain in more detail without giving a ton of context... which now that i'm thinking about it probably means it's not such a good idea in the first place lol. ⏎ i guess the best way to say it is that i want my class to keep a running list of `{} of String => Proc(Generic(A), Generic(B))` defined by macros, and then at the end of the class definition it would create a method w/ a case
<FromGitter> ... statement based on the contents therein. Hash(K,V) is probably not the right thing to use, and what i want might not be realistically feasible
<FromGitter> <galvertez> with ruby this was so simple, since everything's runtime you can just create a throwaway hash that gets blown away shortly after the file is required. but i still haven't learned all the mechanisms crystal has in place for approximating or augmenting ruby features. i must say, it is difficult to stop myself from thinking in ruby when writing crystal
<FromGitter> <galvertez> i think i'm carrying over a lot of bad habits XD
alex`` has joined #crystal-lang
<FromGitter> <faustinoaq> > I dont believe in that benchmarks. :) ⏎ ⏎ @Grabli66 Check https://tfb-status.techempower.com/ 😉
sherjilozair has quit [Quit: Leaving...]
rohitpaulk has joined #crystal-lang
marius has quit [Quit: baj]
rcvalle has quit [Ping timeout: 245 seconds]
rcvalle has joined #crystal-lang
marius has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
rohitpaulk has quit [Quit: Ping timeout (120 seconds)]
rohitpaulk has joined #crystal-lang
ua has quit [Ping timeout: 245 seconds]
notdaniel has joined #crystal-lang
<crystal-gh> [crystal] sdogruyol closed pull request #6117: Update project status in README (master...update-readme) https://git.io/vhfBu
rohitpaulk has quit [Ping timeout: 264 seconds]
rohitpaulk has joined #crystal-lang
Nik736 has joined #crystal-lang
<FromGitter> <Grabli66> It can't be true. Fortunes. php-pgsql-raw - latency 0.4 ms. Crystal - latency 5.3 ms. Whaaaaaaat?
notdaniel has quit [Quit: Leaving]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 252 seconds]
Raimondii is now known as Raimondi
<crystal-gh> [crystal] sdogruyol pushed 1 new commit to master: https://git.io/vhURn
<crystal-gh> crystal/master 6cff884 r00ster: Fix Time.new and Time.utc (#6118)
ua has joined #crystal-lang
<crystal-gh> [crystal] bcardiff opened pull request #6120: Add missing stdarg.cr for i686-linux-musl (master...fix/i686-musl-stdarg) https://git.io/vhU0M
<travis-ci> crystal-lang/crystal#6cff884 (master - Fix Time.new and Time.utc (#6118)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/382582501
<DeBot> https://github.com/crystal-lang/crystal/pull/6118 (Fix Time.new and Time.utc)
<crystal-gh> [crystal] asterite closed pull request #6120: Add missing stdarg.cr for i686-linux-musl (master...fix/i686-musl-stdarg) https://git.io/vhU0M
That_Guy_Anon has joined #crystal-lang
<FromGitter> <manveru> hmm
<FromGitter> <manveru> looking at that, it might be any number of things making it slow, in my experience the pg binding isn't very fast, not sure about ECR or JSON
<FromGitter> <manveru> i'd love to see a flamegraph for this
<travis-ci> crystal-lang/crystal#d2a44eb (master - Merge pull request #6120 from crystal-lang/fix/i686-musl-stdarg): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/382618476
<DeBot> https://github.com/crystal-lang/crystal/pull/6120 (Add missing stdarg.cr for i686-linux-musl)
pabs has quit [Ping timeout: 245 seconds]
<FromGitter> <yxhuvud> creating reasonable flamegraph for an evented system could be hard
pabs has joined #crystal-lang
<FromGitter> <manveru> might still be useful even if it's aggregated across all fibers?
<FromGitter> <manveru> not that i know how you'd measure that without changing the crystal compiler itself...
<FromGitter> <faustinoaq> > No way, they are already too fast, it's unfair smile ⏎ ⏎ lol ^^ https://github.com/TechEmpower/FrameworkBenchmarks/pull/3751#issuecomment-390038498
<FromGitter> <faustinoaq> @Grabli66 They are well tested and optimized, TFB is the best web framework benchmark IMO. Crystal still need some optimizations 😅
<FromGitter> <faustinoaq> @manveru I think you're right, https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Crystal/crystal/server.cr#L6 <<< This line maybe is slowing plaintext a json tests, should we create a separate test for them, WDYT? 😅
<FromGitter> <Grabli66> I choose crystal for it's performance, and now you say that something like shitty java is more performant? No.I don't want to believe in that. :)
<FromGitter> <faustinoaq> @Grabli66 Not Java but JVM 😉
<FromGitter> <faustinoaq> Crystal can be faster, though, we need to do some profiling to see what is being slow 😄
<FromGitter> <Grabli66> Yes. But i don't believe that VM with JIT is faster than compiled language.
<FromGitter> <bararchy> All depends on optimizations, the JIT can do wonders after X iterations
<FromGitter> <faustinoaq> @Grabli66 It depends, VM and JIT *can* be faster than compiled languages, even interpreted languages can be faster than compiled ones in some situations, please see: https://crystal-lang.org/2016/07/15/fibonacci-benchmark.html
<FromGitter> <faustinoaq> Does someone has a mac here? 😉 ⏎ ⏎ If so, can follow this guide: https://www.mikeperham.com/2016/06/24/profiling-crystal-on-osx/ and profile server.cr (https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Crystal/crystal/server.cr) at least on plaintext and json tests ? 😅
alex`` has quit [Quit: WeeChat 2.1]
<FromGitter> <Grabli66> I know that all. I am just joking. :) Someone needs to improve performance of crystal
alex`` has joined #crystal-lang
<FromGitter> <j8r> Performance is a thing, but memory efficiency is also important. Less memory = cheaper = more instances to buy. Compiled languages can't be beaten for memory/CPU efficiency
<FromGitter> <faustinoaq> @j8r Yep, that's true, JVM is super fast, but is also super bloated 😅
<FromGitter> <faustinoaq> TFB should graph resources usage as well, WDYT?
return0e_ has quit [Read error: Connection reset by peer]
<jeromegn> that'd be very interesting yes
duane has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei_ has joined #crystal-lang
snsei_ has quit [Read error: Connection reset by peer]
snsei_ has joined #crystal-lang
snsei_ has quit [Ping timeout: 256 seconds]
rohitpaulk has quit [Ping timeout: 248 seconds]
<wuehlmaus> is there a GUI system which is relatively mature. I tried the awesome links but it seems they don't work on my Mac here.
<wuehlmaus> or i am too stupid :)
<wuehlmaus> [or i am too stupid to try that on my Mac :)]
wontruefree has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter> <j8r> Qt
<wuehlmaus> exactly that seems not to be tested on Apple
<wuehlmaus> i try that on my Archlinux
<FromGitter> <girng> hello
rohitpaulk has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vhTmC
<crystal-gh> crystal/master 6cef3d2 Sijawusz Pur Rahnama: Use white-space: pre-wrap; for constants <code> entries (#5657)
<FromGitter> <fuegito> @manveru The remote_IP will be added to HTTP::Server::Response. Finally I found it. I was only looking for request/context. https://github.com/crystal-lang/crystal/pull/5870
<FromGitter> <fuegito> I hope this will be in the next release.
<travis-ci> crystal-lang/crystal#6cef3d2 (master - Use white-space: pre-wrap; for constants <code> entries (#5657)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/382741562
<DeBot> https://github.com/crystal-lang/crystal/pull/5657 (Use soft linebreaks for constant doc styles)
shalmezad has joined #crystal-lang
wontruefree has quit [Quit: bye]
<FromGitter> <paulcsmith> @ysbaddaden Just wanted to say thanks for your work on selenium webdriver! It is extremely helpful for browser testing :)
wontruefree has joined #crystal-lang
duane has quit [Ping timeout: 260 seconds]
<FromGitter> <paulcsmith> I think it's not a bad idea. He has some great points here: https://github.com/anp/rfcbot-rs/pull/210#issuecomment-391369978
<FromGitter> <paulcsmith> up/down works for comments, but if it is done on the initial issue it is almost useless because you don't know *why* it is upvoted/downvoted. It could be something very minor that could be easily fixed but there is no way to know
<FromGitter> <girng> Well, for issues I can see your point
<FromGitter> <paulcsmith> Though maybe on RFCs up/down is fine
<FromGitter> <girng> But, he said PRs...
<FromGitter> <girng> Aswell*
<FromGitter> <paulcsmith> Yeah for RFCs is it probably helpful. Outside that I think it can quickly lead to hurt feelings or useless information (what does the thumbs down mean?)
Nik736 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <girng> It gets worse, he wants to convert downvotes to upvotes: https://internals.rust-lang.org/t/up-votes-instead-of-down-votes-on-rfcs/6309/49
<FromGitter> <girng> How does that work?
<FromGitter> <vladfaust> Is it possible to do non-recursive (one level)`Array#flatten`?
duane has joined #crystal-lang
<crystal-gh> [crystal] asterite opened pull request #6123: Fix: can't require after annotation (master...fix/6094-annotation-parsing) https://git.io/vhT4R
wontruefree has quit [Quit: bye]
<oprypin> vladfaust, obviously yes
That_Guy_Anon has quit [Remote host closed the connection]
wontruefree has joined #crystal-lang
return0e has joined #crystal-lang
duane has quit [Ping timeout: 245 seconds]
<7GHAAU90F> [crystal] ysbaddaden closed pull request #6123: Fix: can't require after annotation (master...fix/6094-annotation-parsing) https://git.io/vhT4R
<DeBot> https://github.com/crystal-lang/crystal/pull/6123 (Fix: can't require after annotation)
<crystal-gh> [crystal] ysbaddaden pushed 1 new commit to master: https://git.io/vhTV5
<crystal-gh> crystal/master df279d1 Ary Borenszweig: Fix: can't require after annotation
<FromGitter> <Sija> @oprypin `Array#flatten` *is* recursive at the time of writing
<oprypin> that is correct
<FromGitter> <Sija> ok, just wanted to clarify things :)
<FromGitter> <girng> Nice, bought a KVM VPS from PnZHosting, log in through SolusVM = Offline
That_Guy_Anon has joined #crystal-lang
<oprypin> why are you doing this to yourself
<FromGitter> <girng> Doing what?
<oprypin> girng, buying crappy "VPS"
<FromGitter> <girng> Well, it was on the front page of LowEndBox.com and figuredI could snag a deal
<oprypin> i dont know why you think buying something from people who paid to be on the front page will somehow get you a good deal
<FromGitter> <girng> I did not know they were paid
<FromGitter> <girng> Their paid?
<FromGitter> <girng> They paid*?
krystal_ has joined #crystal-lang
<oprypin> i just assumed it cuz that's how the world works
<FromGitter> <girng> well, if they paid to get on the front page, then yeah I prob shouldn't have bought it
<FromGitter> <girng> i always thought it was a community thing they just highlighted the best hosters
Nik736 has joined #crystal-lang
<FromGitter> <girng> i'm going to search on their forum and see if they are though
<krystal_> Is there any reason why stdlib things like Hash with functions named similarly to ruby behave different? For example keys? in Crystal returns the first key that matches a value and in Ruby it's a synonym for has_key?
<RX14> if it's *on* lowendbox it's probably not a good idea
<RX14> go for something reputable but cheap like ovh/scaleway/hetzner cloud
<oprypin> girng, oh to be honest I saw the part about "KVM VPS" but turns out that's not a bad thing
<RX14> ...
<krystal_> Another difference I noticed when porting some ruby code to crystal was the parsing of functions without parens. My ruby code did something like: array.size - 1 in crystal this gets parsed as array.size(-1) instead of size() - 1.
<FromGitter> <theo3y> hey I just installed crystal on OS X, keep getting the error -bash !: event not found when I try to run puts "Hello world!"
<RX14> krystal_, I don't think the latter is true
<RX14> if it is it's a bug
<FromGitter> <theo3y> installed it properly using home brew
<oprypin> krystal_, `array.size - 1` is just that. you may have had some very weird spacing like array.size -1
<krystal_> Further are patches to stdlib welcome to add similar functionality to ruby stdlib? For example Array in ruby has a zero argument count which is a synonym for size, but crystal does not have such a method
<krystal_> oprypin that is exactly what I had you are right
<FromGitter> <girng> hetzner is really nice but no services over in the US, same for OVH
<FromGitter> <theo3y> just not sure how to get terminal to access crystal
<RX14> krystal_, no
<oprypin> krystal_, synonyms/aliases are explicitly discouraged
<FromGitter> <theo3y> could y'all help me out?
<oprypin> krystal_, also Ruby having some method is one of the least relevant reasons for adding it to Crystal
<RX14> @girng ovh has services in canada
<krystal_> Ok that makes sense. I was just expecting a simpler porting story for myself. So far everything is going pretty well besides running into these kinds of things
<RX14> yeah we don't really aim to maker porting easier
<RX14> we originally based the stdlib off ruby
<RX14> but we've refactored and cleaned up quite a bit of cruft
<krystal_> Got it. It seemed so similar that I just assumed way too much that I could type in ruby :)
<krystal_> I am porting the code from this book (https://pragprog.com/book/jbmaze/mazes-for-programmers) to Crystal to learn it somewhat.
<oprypin> krystal_, definitely don't assume that. and certainly read https://crystal-lang.org/docs/ rather than just trying to write ruby and seeing how that goes
<RX14> @girng also why do you need services in the US?
<krystal_> oprypin thanks yeah that is now my approach after hitting these issues :)
<FromGitter> <girng> im not answering that cuz anything i say = CRITICISM / WRONG
<FromGitter> <theo3y> well could you answer my question?
<krystal_> What about methods like between? that are on Comparable in Ruby but not Crystal? Is Crystal trying to be batteries included stdlib?
<RX14> krystal_, i mean we have a chance to clean up the stdlib and make breaking changes so why not take them :)
<travis-ci> crystal-lang/crystal#df279d1 (master - Fix: can't require after annotation): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/382826019
<krystal_> RX14 agree 100%. I am a C++ developer and wish C++ would drop a bunch of old stuff :)
<FromGitter> <jpincas> I just spent an hour fiddling with VSCode to get perfect support for `ecr` templates. If anyone is interested, add ```"files.associations": { ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ }``` to settings file and install `Beautify` and `erb` extensions. [https://gitter.im/crystal-lang/crystal?at=5b05bee75f3e6b40fadce3bf]
<RX14> @theo3y that looks to me like you're trying to write `puts "Hello World!"` in the terminal directly
<FromGitter> <theo3y> right
<FromGitter> <theo3y> what should I do instead?
<FromGitter> <theo3y> new to this
<oprypin> theo3y, crystal does not have an interactive session that you can type things into
<oprypin> make a source file and `crystal file.cr`
<FromGitter> <theo3y> how do you make a source file?
<oprypin> with a text editor
<oprypin> the file would contain `puts "Hello world!"` or something
<FromGitter> <theo3y> so like on OS X, I'd open TextEdit and type puts "Hello world!"
<FromGitter> <theo3y> and then use the compiler to run the code, or whatever code when I'm done writing it
<oprypin> sounds right
<FromGitter> <theo3y> great thank you
<wontruefree> girng www.kimsufi.com has some cheap servers too
return0e has quit [Ping timeout: 256 seconds]
<FromGitter> <girng> @wontruefree thanks i heard of them, and check em out
return0e has joined #crystal-lang
Jenz has joined #crystal-lang
<FromGitter> <manveru> i'd still recommend hetzner
<FromGitter> <noahlh> @theo3y and to be specific: You'd save the file (hello_world.cr) and the on your command line run `crystal run hello_world.cr` (or just `crustal hello_world.cr` since run is the default command).
<FromGitter> <noahlh> *`crystal` not `crustal` lol
<krystal_> Why do all array methods use signed integers when unsigned would seem to make more sense?
<krystal_> For example the #* function accepts Int but you can't use negative numbers
<oprypin> also because `a = 5` a is explicitly an `Int32` and you wouldnt be able to write array[a] cuz it's a different type
<krystal_> That doesn't really address my point about #*
<oprypin> links do
<krystal_> "The use of a signed parameter type in the Array constructor makes this kind of sanity checking possible." . Doesn't crystal prohibit signed -> unsigned conversion by default such that this wouldn't be an issue anyways?
<krystal_> It seems better to have a compile time check for these things instead of a runtime check I guess is what I am getting at.
<FromGitter> <manveru> krystal_: but but but `crystal eval 'pp [1][-2]'`
<FromGitter> <manveru> that's signed, right?
Ven`` has joined #crystal-lang
Ven`` has quit [Client Quit]
<FromGitter> <faustinoaq> @girng Wow, thanks you! I really needed some cheap servers to do some stuff 😄
<FromGitter> <girng> @faustinoaq well, i recommend none on their front page.. i learned the hard way
<FromGitter> <faustinoaq> Oh, ok 😅
<FromGitter> <girng> Scammers
Ven`` has joined #crystal-lang
<FromGitter> <faustinoaq> Well, at least https://www.vultr.com/ is cheap/good enough 😉
Ven`` has quit [Client Quit]
Jenz has quit [Remote host closed the connection]
<FromGitter> <girng> are thoseKVM or OpenVZ?
<FromGitter> <vladfaust> I'm so tired of these stupid errors like `can't cast Hash(Symbol, String) to Hash(String | Symbol, String | Symbol)`
<FromGitter> <girng> what's the difference between the two ?
Raimondii has joined #crystal-lang
<FromGitter> <vladfaust> God knows
Raimondi has quit [Ping timeout: 264 seconds]
<FromGitter> <vladfaust> *asterite, I mean
Raimondii is now known as Raimondi
<FromGitter> <vladfaust> It's counter-intuitive
<FromGitter> <girng> opyrin, rx14 might too
<FromGitter> <girng> ysbaddaden and some others don't comment in here so.. no idea
marrow16180 has joined #crystal-lang
<RX14> this has been explain on the issue tracker countless times
<RX14> you can't cast
<Yxhuvud> right. create the hash you want from the start when you initialize it - not afterwards
<RX14> yeah
<RX14> nobody has this problem if they write their code properly typed
<Yxhuvud> I would say it is more about planning than about properness.
<oprypin> girng, i use vultr. it says it's kvm. you have full access to everything, anyway.
<RX14> Yxhuvud, it's about planning to be proper
<Yxhuvud> planning to be improper is also fine
<FromGitter> <girng> @oprypin oh really, cool
<FromGitter> <girng> @oprypin i prob should have just gone with them
<oprypin> prob
<oprypin> one thing to note is that their $2.50 plan is available in very few locations
Ven`` has joined #crystal-lang
<oprypin> the locations are usually the US so you're probably fine
<oprypin> only Miami and New York currently allow creation of $2.50 https://www.vultr.com/pricing/
<FromGitter> <girng> yah, well if this pnzhosting crap not working 1 day i'll use ur referral link
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wontruef_ has joined #crystal-lang
wontruefree has quit [Read error: Connection reset by peer]
That_Guy_Anon has quit [Quit: Leaving]
shalmezad has quit [Quit: Leaving]
wontruef_ has quit [Ping timeout: 252 seconds]
marrow16180 has quit [Quit: Leaving]
duane has joined #crystal-lang
<FromGitter> <faustinoaq> oprypin, Yeah,I have been aware of that, Thank you +1
<FromGitter> <faustinoaq> @vladfaust Why don't use Hash alias? like this `MyHashType{"item" => :item}; MyHashType{:item => "item"}` and so on 😅
Nik736 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duane has quit [Ping timeout: 240 seconds]
Ven`` has joined #crystal-lang
sz0 has joined #crystal-lang
wontruefree has joined #crystal-lang
Liothen has quit [Changing host]
Liothen has joined #crystal-lang
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wontruefree has quit [Quit: bye]
wontruefree has joined #crystal-lang
wontruefree has quit [Quit: bye]
wontruefree has joined #crystal-lang
wontruefree has quit [Quit: bye]
wontruefree has joined #crystal-lang