<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
<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
<FromGitter>
<faustinoaq> @Grabli66 They are well tested and optimized, TFB is the best web framework benchmark IMO. Crystal still need some optimizations 😅
<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>
<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
<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.
<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…]
<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 :)
<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 :)
<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