RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.1 | 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
<FromGitter> <kazzkiq> Has anyone used Crystal for cryptocurrencies purposes? Just curious.
<FromGitter> <kazzkiq> From generating a bitcoin address, to building a PoC blockchain. No?
wontruef_ has joined #crystal-lang
wontruefree has quit [Ping timeout: 246 seconds]
OceannBoy has joined #crystal-lang
<FromGitter> <fridgerator> I saw this earlier : https://github.com/tbrand/Garnet
<Papierkorb> kazzkiq, sure
<FromGitter> <potz> Anyone knows if the Hash class keeps items in the same order they were added? I’m inclined to think it doesn’t, but could not find any authoritative answer in the docs...
OceannBoy has quit [Ping timeout: 256 seconds]
<FromGitter> <marksiemers> @potz - That may require looking at the source code.
<FromGitter> <marksiemers> Based on this: https://github.com/crystal-lang/crystal/blob/master/src/hash.cr#L416 ⏎ It must maintain some order
OceannBoy has joined #crystal-lang
<FromGitter> <marksiemers> But I don't know if all the iterators guarantee that order
sz0_ has joined #crystal-lang
sz0_ is now known as sz0
OceannBoy has quit [Ping timeout: 260 seconds]
OceannBoy has joined #crystal-lang
raz has quit [Changing host]
raz has joined #crystal-lang
DTZUZU has quit [Quit: WeeChat 1.9]
wontruef_ has quit [Quit: The Internet needs a break and I need a cookie]
wontruefree has joined #crystal-lang
OceannBoy has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
<FromGitter> <Dillybob1992> hey all, i'm getting `(signal 11) ??? (523495 times)` which i checked github and i read that it means it's a stack overflow, but i've been stuck for 3 hours trying to find out way and not sure what i'm doing wrong
<FromGitter> <Dillybob1992> here is my pastebin: https://pastebin.com/raw/9KM3M9Bz it happens whenever the users << socket is called (i know i could just use the code straight-shoota and rx14 helped me with yesterday), but i feel like this could be a learning moment on what I did wrong so I can avoid the mistakes in future :)
OceannBoy has joined #crystal-lang
OceannBoy has quit [Ping timeout: 248 seconds]
nick__ has joined #crystal-lang
nick__ has quit [Client Quit]
rohitpaulk has joined #crystal-lang
<FromGitter> <bararchy> Morning all :)
snsei has joined #crystal-lang
alex`` has joined #crystal-lang
alex`` has quit [Quit: WeeChat 1.9]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter> <elorest> Morning.
snsei has quit [Ping timeout: 276 seconds]
rohitpaulk has quit [Ping timeout: 255 seconds]
<FromGitter> <codenoid> morning yoo,
<FromGitter> <codenoid> i clone directly from master
<FromGitter> <codenoid> `Using /usr/bin/llvm-config-3.8 [version=3.8.0]`
<FromGitter> <bararchy> I think this will only work on LLVM4 and above. ⏎ anyway, this seems to be triggered by the last fix\additions to Int128
<FromGitter> <codenoid> should i upgrade my crystal (with llvm) to 0.24.1 ?
<FromGitter> <bararchy> yeha, you should usually follow latest
<FromGitter> <bararchy> what OS are you using?
<FromGitter> <codenoid> ubuntu 16.04.3
<FromGitter> <codenoid> I'm too lazy to change my old (0.23.1) crystal app
<FromGitter> <bararchy> and you installed crystal via manas formal repo ?
<FromGitter> <codenoid> yes
<FromGitter> <bararchy> so it should update automaticlly
<FromGitter> <codenoid> idk
<FromGitter> <bararchy> "apt-get update && apt-get dist-upgrade -y"
<FromGitter> <bararchy> should take care of it
<FromGitter> <codenoid> i try to install 2 version of crystal in my ubuntu
<FromGitter> <codenoid> 1) 23.1 and 0.24.1
<FromGitter> <codenoid> but 0.24.1 use 0.23.1 llvm
<FromGitter> <bararchy> why have two versions ?
<FromGitter> <codenoid> because i won't change my old (0.23.1) crystal app code
<FromGitter> <codenoid> and i want start my new crystal app with 0.24
<FromGitter> <bararchy> it's not much to change, mostly RANDOM and UUID, nothing breaking for me other then that
<FromGitter> <bararchy> but, w\e you want :)
<FromGitter> <codenoid> okay ⏎ ⏎ ```apt-get update ⏎ apt-get install crystal``` [https://gitter.im/crystal-lang/crystal?at=5a571b185a9ebe4f75728619]
<FromGitter> <codenoid> RIP my mongo.cr
<FromGitter> <bararchy> lol
<FromGitter> <codenoid> 😄
<FromGitter> <codenoid> sam0x17/mongo.cr thanks
flaviodesousa has joined #crystal-lang
alex`` has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
rohitpaulk has joined #crystal-lang
jnyw has joined #crystal-lang
mark_66 has joined #crystal-lang
cbass has joined #crystal-lang
<FromGitter> <ArtLinkov> Morning guys. ⏎ I need help with something, let's say I got two class instances, each has an array (which is accessible from outside). I want the second class to take a copy of the array from the first class into it's own class. However, I want to change the array in the second without changing the array in the first. ⏎ I tried something like this: ⏎ class2.array = class1.array ⏎ or class2.array =
lacour has quit [Quit: Leaving]
<oprypin> ArtLinkov, array.dup is python's list.copy() , nothing strange here
<oprypin> what is the actual problem?
<FromGitter> <ArtLinkov> Well, as I mentioned, any manipulation to the copied array also happens on the source array
<FromGitter> <ArtLinkov> I want to only change the copied one
<oprypin> i doubt your statement, perhaps it's changes to sub-objects
<FromGitter> <ArtLinkov> Well, it might be due to the fact the array hold class objects
<FromGitter> <ArtLinkov> i'm not sure
<oprypin> still the same as in Python
<oprypin> if you want a quick and dirty solution, use array.clone
<FromGitter> <bararchy> So, you are looking for "deep-dup" kind of abiltiy, where it clones all objects and sub objects
<oprypin> if you want a proper solution, provide a proper example
<FromGitter> <ArtLinkov> Ok, give me a min
flaviodesousa has quit [Remote host closed the connection]
<FromGitter> <ArtLinkov> Can you take a look a this code? ⏎ https://play.crystal-lang.org/#/r/3dcw ⏎ What am I missing?
<FromGitter> <straight-shoota> you're just copying the reference from `c1` with `sub_array = other_class.array`
<FromGitter> <straight-shoota> so it's the same array
<FromGitter> <bararchy> other_class.array.dup
<FromGitter> <bararchy> or
<FromGitter> <bararchy> other_class.array.clone
<FromGitter> <straight-shoota> https://play.crystal-lang.org/#/r/3dcx
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
<FromGitter> <ArtLinkov> Hmm... array.dup doesn't work for me. I'm guessing because the array is of class instances (i.e specific neuron)
<FromGitter> <ArtLinkov> I'll try .clone
<FromGitter> <ArtLinkov> thanks
wontruefree has joined #crystal-lang
wontruefree has quit [Client Quit]
wontruefree has joined #crystal-lang
wontruefree has quit [Client Quit]
wontruefree has joined #crystal-lang
wontruefree has quit [Client Quit]
wontruefree has joined #crystal-lang
wontruefree has quit [Client Quit]
wontruefree has joined #crystal-lang
wontruefree has quit [Client Quit]
rohitpaulk has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #crystal-lang
<oprypin> sigh
DTZUZO has quit [Ping timeout: 240 seconds]
<FromGitter> <bararchy> oprypin, your'e not obligated to help, remmber not everyone has expirance like you and understand the issue or solution you give, sometimes answers that makes 100% sense to you might be "but why?" to others.
<FromGitter> <bararchy> other than that, thanks for your time :)
<FromGitter> <bararchy> you do help alot
jnyw has quit [Quit: WeeChat 2.0.1]
<FromGitter> <potz> @marksiemers Good catch in the sources. Probably not a good idea to depend on this behaviour anyway. Thanks.
gewo has quit [Quit: WeeChat 1.6]
gewo has joined #crystal-lang
hightower3 has joined #crystal-lang
hightower2 has quit [Ping timeout: 265 seconds]
alex`` has quit [Ping timeout: 255 seconds]
<crystal-gh> [crystal] asterite opened pull request #5571: Compiler: ensure parentheses inside assign value (master...bug/5568-op-assign) https://git.io/vN3sf
literal has quit [Ping timeout: 256 seconds]
literal has joined #crystal-lang
thews has quit [Ping timeout: 256 seconds]
<FromGitter> <asterite> bararchy: hi! o/. Did you have a chance to optimize that program?
thews has joined #crystal-lang
thews has quit [Changing host]
thews has joined #crystal-lang
<FromGitter> <bararchy> @asterite Hi :) ⏎ Working on that, we removed a few of the offending array manipulation shourtcuts, and moved to do itirations
<FromGitter> <bararchy> @ArtLinkov is currently hard at work on Adding Convolutional Neural Networkto SHAInet, we will then work on more cleaning and refactors
<FromGitter> <bararchy> then move on to LSTM (RNN)
<FromGitter> <bararchy> anyway, we really hope we can showcase SHAInet as a viable machine learning platform that can maybe make users interested in trying Crystal
<raz> so it seems crest only works with crystal 0.24.1, but kemal only works with 0.23.1
<raz> :sadparrot
<FromGitter> <straight-shoota> kemal v0.22.0 supports Crystal 0.24.1
<raz> oh, yes! it seems my shards were just confused
<raz> it works now, yay!
rohitpaulk has quit [Ping timeout: 240 seconds]
<raz> has anyone else had the effect that running (seemingly any) crystal app confuses the terminal so badly that subsequently vim produces garbled output?
<raz> i have this on iTerm/OSX and am a bit baffled (reset doesn't fix it)
ShalokShalom has joined #crystal-lang
ShalokShalom has quit [Remote host closed the connection]
<FromGitter> <straight-shoota> might be related to #2713
<DeBot> https://github.com/crystal-lang/crystal/issues/2713 (Wrong output when piping to less)
<raz> possibly. it's baffling that one process can permanently break the terminal that way.
<raz> took me a while to make the connection, at first i thought my vim was bugged ;)
<raz> yes!
<raz> ^ this is exactly what i'm seeing, too
<raz> this is extremely disruptive and probably makes many newbies drop crystal like a hot potato
dragonkh has joined #crystal-lang
dragonkh has quit [Client Quit]
rohitpaulk has joined #crystal-lang
DTZUZO has joined #crystal-lang
<FromGitter> <Dillybob1992> ```code paste, see link``` ⏎ ⏎ hey guys, im getting `undefined method 'character_name=' for RPG_USER`, am i using class_property right? [https://gitter.im/crystal-lang/crystal?at=5a57703f5a9ebe4f75746cb2]
<FromGitter> <straight-shoota> class_property creates a class method, but you're using an instance method
<FromGitter> <straight-shoota> So either `RPG_USER.charachter_name` (class variable) or `property character_name = "Joey"`(instance variable)
<FromGitter> <Dillybob1992> oh okay :)
<FromGitter> <Dillybob1992> change to `property`, got it johannes, thanks again ^^
rohitpaulk has quit [Ping timeout: 276 seconds]
<FromGitter> <Dillybob1992> hey, got another small little question ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ i am getting `instance variable '@socket' of RPG_USER must be TCPSocket+:Class, not TCPSocket+` . What does TCPSocket+:Class mean? [https://gitter.im/crystal-lang/crystal?at=5a577d3583152df26d5b802e]
<FromGitter> <bew> Maybe you meant `property socket : TcpSocket`?
<FromGitter> <Dillybob1992> Oh wow, yeah
<FromGitter> <bew> It means that you're storing the class `TCPSocket` not an instance of this class
<FromGitter> <bew> Well no the other way around but you get it
<FromGitter> <Dillybob1992> now, am getting `. Indirect initialization is not supported.` Is that because it's only be filled to a TCPSocket when a user joins the server?
<FromGitter> <Dillybob1992> Oh, look here. I changed it to `property socket = TCPSocket.new` and it worked with no errors. I think I am understanding instanced classes now
<FromGitter> <eliasjpr> GitHub is down!
<FromGitter> <hugoabonizio> run to the hills
<FromGitter> <eliasjpr> there goes shards deps
<FromGitter> <hugoabonizio> @Dillybob1992 you can use `property socket : TCPSocket` to avoid creating a new TCPSocket
<FromGitter> <Dillybob1992> yah, I tried that but I get `instance variable '@socket' of RPG_USER was not initialized directly in all of the 'initialize' methods, rendering it nilable. Indirect initialization is not supported.`
<FromGitter> <bararchy> @eliasjpr I'll trust github HA and DT over any self hosted community server
<FromGitter> <hugoabonizio> @Dillybob1992 a solution is to define a `#initialize` method which accepts a socket, like: `def initialize(@socket); end`
<FromGitter> <hugoabonizio> github is back
<FromGitter> <Dillybob1992> thanks hugo, i did that and now the error is gone :) i also tested `socket = [] of TCPSocket` and got no error, even without having initialize. i wonder which way is better?
<FromGitter> <hugoabonizio> `[] of TCPSocket` is equivalent to `Array(TCPSocket).new`, so in this case you are instantiating an Array object
<FromGitter> <Dillybob1992> O_O i see
<FromGitter> <Dillybob1992> Ya, i much rather do your way then feels more appropriate
<FromGitter> <hugoabonizio> @Dillybob1992 :bowtie: 👍
<FromGitter> <Dillybob1992> "Crystal combines all definitions into a single class. The following works just fine:" omg epic :DD
<FromGitter> <Dillybob1992> Man, I'm loving Crystal!! 👍
<FromGitter> <eliasjpr> > @eliasjpr I'll trust github HA and DT over any self hosted community server ⏎ ⏎ Me too :)
mark_66 has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 263 seconds]
<ua> jesus christ, crystal code written 5 months ago is that old already?
<ua> shard written 5 months ago, broken in multiple ways :<
<FromGitter> <fridgerator> There are breaking changes every crystal release, they are listed in the release notes
<FromGitter> <Dillybob1992> are there any benchmarks comparing crystal to nodejs via tcp server or websocket performance? just mildly curious because i'm from nodejs and getting kind of fed up with it lately (why im learning crystal)
cbass has quit [Ping timeout: 256 seconds]
<ua> is it possible to install multiple versions of crystal like with rvm in ruby?
<ua> also is there something like long term support releases?
<FromGitter> <fridgerator> what OS are you using? I can switch between crystal versions with brew, but I dont know if thats a good solution
<ua> ubuntu
<FromGitter> <fridgerator> There is crenv, but I haven't used it in a while. I dont nkow if its maintained
<FromGitter> <Fryguy> ua: I think that anyenv supports crystal (haven't used it myself)
<FromGitter> <Fryguy> https://github.com/riywo/anyenv
<ua> thanks
<FromGitter> <fridgerator> I wouldnt assume there would any kind of "LTS" release until 1.0
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<ua> crenv does work but that shard is still broken lol
<ua> fridgerator: by LTS i mean more something like consensus among developers about which version to use at that particular moment in time thats not always the latest version
<ua> lol
<ua> but yeah at the point where language is still evolving extensively that might not make mech sense yet i guess
DTZUZO has quit [Ping timeout: 255 seconds]
<FromGitter> <marksiemers> @Fryguy @fridgerator - `crenv` depend on `anyenv` (for their preferred installation anyway). And I install both of them, but there has been no update for the newest version of crystal. So either that will be a manual process to update or someone will have to fork `crenv` or get added as a member of that repo.
DTZUZO has joined #crystal-lang
<FromGitter> <Fryguy> thanks for the update @marksiemers
<ua> yes, crenv install 0.24.1 doesnt work
<ua> but overall it gets stuff from github.com/crystal-lang/crystal/releases
<ua> it can install 0.24.0 tho which was released after last crenv repo update which was 7 months ago
<FromGitter> <straight-shoota> ua, until 1.0 you should always use the latest release
<ua> ok
<FromGitter> <straight-shoota> surprisingly not too many things get broken usually, so has actually been quite easy to follow up
<RX14> crenv I don't recommend
<RX14> I don't really have any better idea either - i ust use the arch package
<ua> RX14, don't recommend why? here on ubuntu i've just installed and ran 5-6 versions in a row and worked great
<Yxhuvud> in the longer term I'd want a port (or extension) of chruby - it is really small and does the least it can get away with.
DTZUZO has quit [Ping timeout: 256 seconds]
p0p0pr37 has quit [Quit: Going offline, see ya! (www.adiirc.com)]
<FromGitter> <straight-shoota> I'm not sure how useful such a tool would be for Crystal...
<FromGitter> <straight-shoota> you just need Crystal to build you application
<FromGitter> <straight-shoota> not to run it like in an interpreted language
<FromGitter> <Fryguy> it's useful if something worked in a previous version but not a new version
<FromGitter> <Fryguy> you can switch back and forth really easily
<FromGitter> <Fryguy> but as you said "surprisingly not too many things get broken usually, so has actually been quite easy to follow up"
<RX14> ua, because for me it didn't work great
alex`` has joined #crystal-lang
<RX14> it introduces bugs when working on crystal itself
<FromGitter> <straight-shoota> yes but you don't necessarily need a tool for that. it can just be integrated into a build script
<FromGitter> <straight-shoota> plus, it's less likely to have such a high diversity of language versions as with an interpreted lanugages
<FromGitter> <straight-shoota> *supported lanugage versions
alex`` is now known as alexherbo2
alexherbo2 is now known as alex``
<RX14> well
<RX14> rust has rustup
<RX14> and they're post-1.0 and fairly stable
<RX14> there's space for it
<RX14> and I started writing a proper version manager for crystal
<RX14> I just never got around to it
<FromGitter> <marksiemers> Would it make sense to have `shards` handle crystal version management, in addition to shard version management?
<oprypin> no
<oprypin> at least there is 0 advantage to it
<RX14> agree
<RX14> do some thing and do it well
<RX14> one*
<oprypin> wel lactually for usage it could be nice, lik installing crystal version in shard.yml
<oprypin> locally together with shards
<RX14> it's easy to make a version tool parse version: foo in shard.yml
<RX14> which was absolutely something I planned to do for my own tool
<oprypin> just saying not literally 0 advantage
<RX14> ok
<RX14> lol
<RX14> you could reuse the shatds.yml parser
<RX14> cool
<RX14> i saved 5 lines of code
<crystal-gh> [crystal] RX14 closed pull request #5454: Fix to keep paren information for `to_s` on clone (master...fix/crystal/keep-keyword-info-on-clone) https://git.io/vb7z7
robacarp has quit [Quit: robacarp]
<crystal-gh> [crystal] RX14 closed pull request #5444: Change Hash#key to Hash#key_for (master...fix/change-key-to-key_for) https://git.io/vbQsx
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vN3j5
<crystal-gh> crystal/master f16e63a Mark: Change Hash#key to Hash#key_for (#5444)...
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vNseC
<crystal-gh> crystal/master bd42727 Johannes Müller: Reimplement Dir.glob (#5179)
<FromGitter> <marksiemers> From a usage perspective, it likely means 2 commands to choose between - `shards ...` or `crystal ...` instead of 3 or more `crenv` or `anyenv` or `rx14env` or whatever version manager a certain team decided to use, or roll their own.
<FromGitter> <marksiemers> It's like `Spec` being built into the language - since specs are pretty universal, why not have it baked in. ⏎ Version management is pretty universal as well I would argue.
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
DTZUZO has joined #crystal-lang
<travis-ci> crystal-lang/crystal#f59a349 (master - Fix to keep paren information for `to_s` on clone (#5454)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/327803390
<DeBot> https://github.com/crystal-lang/crystal/pull/5454 (Fix to keep paren information for `to_s` on clone)
<FromGitter> <potz> Any idea how to format number with thousands separator?
<FromGitter> <marksiemers> I guess that is more of an argument to build it into `crystal` and not `shards`, which seems paradoxically.
<FromGitter> <marksiemers> @potz - you mean `1_000`?
<FromGitter> <potz> No, I mean as output to string
<FromGitter> <potz> is there some number_format in the api? Couldn't find one...
<FromGitter> <marksiemers> ah, not sure about that
<FromGitter> <potz> and sprintf (`".2f" % number`) doesn't seem to have a code for that either
<RX14> yeah I don't think we implement it
<RX14> it's probably worth making an issue
<FromGitter> <potz> want me to open one on gh?
DTZUZO has quit [Ping timeout: 252 seconds]
<RX14> if one doesn't already exist, sure
<travis-ci> crystal-lang/crystal#bd42727 (master - Reimplement Dir.glob (#5179)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/327806310
<DeBot> https://github.com/crystal-lang/crystal/pull/5179 (Proper implementation of Dir.glob )
<crystal-gh> [crystal] ngsankha opened pull request #5574: UUID implements inspect (master...uuid_inspect) https://git.io/vNskM
handicraftsman has left #crystal-lang ["Leaving"]
rohitpaulk has joined #crystal-lang
wontruefree has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
Ven`` has joined #crystal-lang
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
DTZUZO has joined #crystal-lang
wontruefree has joined #crystal-lang
DTZUZO has quit [Ping timeout: 248 seconds]
claudiuinberlin has joined #crystal-lang
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
rohitpaulk has joined #crystal-lang
alex`` has quit [Ping timeout: 276 seconds]
rohitpaulk has quit [Ping timeout: 265 seconds]
ua has quit [Quit: Leaving]
ua has joined #crystal-lang
wontruefree has joined #crystal-lang
<crystal-gh> [crystal] rab opened pull request #5575: Alter logic in Time.leap_year? for performance (master...slightly-better-leap_year-calc) https://git.io/vNslW
<crystal-gh> [crystal] GloverDonovan opened pull request #5576: Fix unexpected h1 in CHANGELOG.md (master...fix/changelog) https://git.io/vNs8a
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] chris-huxtable opened pull request #5577: Adds chroot to Process (master...chroot) https://git.io/vNs4S
jnyw has joined #crystal-lang
<crystal-gh> [crystal] asterite opened pull request #5578: Correct implementation of heredoc (master...feature/heredoc) https://git.io/vNsRs
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
DTZUZO has joined #crystal-lang
early has quit [Ping timeout: 260 seconds]
early has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]