ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.21.1 | Fund Crystal's development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
Renich has quit [Quit: Renich]
unshadow has quit [Quit: Lost terminal]
DaleK5whr has joined #crystal-lang
DaleK5whr has quit [Client Quit]
Cyrus has quit [Ping timeout: 268 seconds]
Philpax_ has joined #crystal-lang
Philpax has quit [Read error: Connection reset by peer]
LastWhisper____ has quit [Remote host closed the connection]
fryguy9 has joined #crystal-lang
fryguy9 has quit [Client Quit]
Cyrus has joined #crystal-lang
mark_66 has joined #crystal-lang
xmonader2 has joined #crystal-lang
xmonader has quit [Ping timeout: 252 seconds]
Raimondi has quit [Read error: Connection reset by peer]
Raimondi has joined #crystal-lang
Ven has joined #crystal-lang
Ven is now known as Guest37478
<FromGitter> <ultra2mh> hi , what is best ide for crystal lang ?
<FromGitter> <ultra2mh> im using phpstorm ,,is there any ide like that for crystal ? or samething
bjz has joined #crystal-lang
Guest37478 has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Ven is now known as Guest2485
<FromGitter> <codenoid> well, i cant detect some error in my .ecr file
<FromGitter> <ultra2mh> i need ide for crystall help me :(
<FromGitter> <codenoid> jetbrains will made it
<FromGitter> <ultra2mh> when?
<FromGitter> <nicck> btw, what do you want fro IDE for crystal? autocomplete/IntelliSense?
<FromGitter> <codenoid> / just for "Crystal IDE" title ?,
<FromGitter> <nicck> @ultra2mh your options are: https://github.com/veelenga/awesome-crystal#editor-plugins ⏎ This is not IDEs of course, just some powerful editors.
<FromGitter> <nicck> ah, look https://github.com/kofno/crystal-ide :)
<FromGitter> <codenoid> and, sir i have a question, how to show array data in crystal ? ,, (like print_r in php)
<FromGitter> <lhz> `puts` should work fine
<FromGitter> <codenoid> hmm, i want get "username" value from this variable ⏎ list = collection.find({ "username" => "suhu"})
<FromGitter> <codenoid> as a single result (not each)
<FromGitter> <codenoid> and my list variable just have 1 row documents (with username value)
zipR4ND has joined #crystal-lang
<FromGitter> <lhz> what kind of object is `collection`? Enumerable#find would return a single object, so it's something else. how about `collection.find(...).first`?
bjz has quit [Ping timeout: 240 seconds]
bjz has joined #crystal-lang
<FromGitter> <codenoid> well, i can "echo" that collection after do ⏎ `list.each do |payment|` ⏎ but ^ it for eaching data
<FromGitter> <nicck> you can share example here: https://play.crystal-lang.org/#/cr so we will able to help
Guest2485 has quit [Ping timeout: 260 seconds]
Ven has joined #crystal-lang
Ven is now known as Guest98008
zipR4ND has quit [Ping timeout: 240 seconds]
Guest98008 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <codenoid> hang on
Ven has joined #crystal-lang
Ven is now known as Guest49446
zipR4ND has joined #crystal-lang
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 255 seconds]
Guest49446 has quit [Ping timeout: 255 seconds]
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 260 seconds]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/v9fp2
<crystal-gh> crystal/master 9265f7f Ary Borenszweig: Changelog: add missing breaking change regarding `'\"'`
Ven_ has joined #crystal-lang
<zipR4ND> "can't specify arguments in both, command and args without including "${@}" into your command" => please Eli5
<FromGitter> <chuckremes> Crystal 0.22 has been released. Here’s the changelog.
<FromGitter> <Sija> gr8 language feature; crystal implementation takes 3 lines… :D
pduncan has joined #crystal-lang
<FromGitter> <Sija> https://carc.in/#/r/1wp4
Ven_ has quit [Ping timeout: 268 seconds]
Ven has joined #crystal-lang
Ven is now known as Guest54785
Guest54785 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Ven is now known as Guest78706
pduncan has quit [Ping timeout: 255 seconds]
<FromGitter> <eliasjpr> Does anyone has more context on the hooks macros, how they work, besides what the docs explain https://crystal-lang.org/docs/syntax_and_semantics/macros/hooks.html?
Guest78706 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <bew> what do you want to know?
<FromGitter> <eliasjpr> well first if the hooks works the same way a ruby included and extended?
<FromGitter> <nicck> > gr8 language feature; crystal implementation takes 3 lines… :D
<FromGitter> <nicck> no exactly. in swift guard "If the condition passes, the optional variable here is automatically unwrapped"
<FromGitter> <nicck> https://carc.in/#/r/1wph => undefined method '+' for Nil (for pp bar + 1)
<FromGitter> <chuckremes> @eliasjpr No, the hooks do NOT work the same in Crystal as in Ruby. For example, in Ruby the `included` and `extended` hooks take an argument so you can operate on the class/module that did the include/extend call.
<FromGitter> <chuckremes> In Crystal, you can get to some similar information via the `@type` ivar.
<FromGitter> <chuckremes> I’ve started a wiki page to documents some tips & tricks for metaprogramming on Crystal. The include/extend hooks will be covered at some point. You can find it here:
<FromGitter> <bew> some hooks.... https://carc.in/#/r/1wpk
ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.22.0 | Fund Crystal's development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
xmonader2 has quit [Quit: Leaving]
zipR4ND has quit [Ping timeout: 240 seconds]
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <eliasjpr> nice! I actually like the fact you dont have to do the infamous `klass`
<FromGitter> <schoening> Hurray my new/old MacBook pro has arrived. Never had a Mac before. I get homebrew now?
mark_66 has quit [Remote host closed the connection]
<FromGitter> <fridgerator> yeah
<FromGitter> <fridgerator> @schoening you'll also want to install xcode tools, even if you don't plan on using xcode
<RX14> I vote install linux on it :)
<FromGitter> <fridgerator> ^
<FromGitter> <fridgerator> I have linux dual booted on mine, using a mac keyboard in linux is weird
<jfontan> RX14, that's the smartest option
<FromGitter> <schoening> It came with 500gb ssd so yeah I would like dual booting :) I'm impressed by the touchpad even tho it's from 2012 . Feels like a phone screen .
<BlaXpirit> fridgerator, why would using a mac keyboard in linux be weird?
<BlaXpirit> using a mac keyboard in mac is weird
<RX14> mac keyboards are weird
<FromGitter> <fridgerator> its hard to go back and forth, mac uses CMD+_ for things whereas pc uses CTRL+_ for things
<RX14> well
<BlaXpirit> that's the problem alright
<RX14> my keyboard config is even weirder
<RX14> i'm using an ANSI layout keyboard but a UK ISO layout in linux
<RX14> so none of the symbols match
<RX14> and the ANSI layout has 1 less key so my "start" button does \ and |
<FromGitter> <fridgerator> and I tried just remapping the keys, but that just messes things up further
<BlaXpirit> fridgerator, hate to spam this channel but i cant private message you. anyway. what i did was use Karabiner Elements to remap Fn to be another Cmd. and put Fn on whatever other key you don't use. old Karabiner (which doesnt work anymore) can do even better with some configuration
<RX14> the channel's pretty empty so off-topic is fine
<RX14> the only rule i'd say is don't interrupt on-topic with off-topic
<FromGitter> <fridgerator> ok
<FromGitter> <fridgerator> @BlaXpirit that would work for the macbook keyboard. The stanadlone keyboard though has the fn button up next to the home button
<FromGitter> <fridgerator> I think my next laptop purchase (which wont be for a while) will definitely be a pc, I really don't like the new macbooks
<BlaXpirit> fridgerator, so you're using standalone keyboard with a macbook?
<FromGitter> <fridgerator> yes at work, because i'm plugged into a thunderbolt display with an external mouse and keyboard
<FromGitter> <fridgerator> at home I just use the macbook
McSoFake has joined #crystal-lang
<wmoxam> whoa, new release
<wmoxam> will try an OpenBSD build tonight
<RX14> wmoxam, re:openbsd, how easy would it be to get a box for CI purposes?
<wmoxam> I'm not sure :p
<wmoxam> RX14: I've had problems compiling directly on OpenBSD, have been cross-compiling
<RX14> oh...
<RX14> the compiler should work on openbsd
<wmoxam> crystal compiler crashes when compiling crystal on OpenBSD
<RX14> oh dear
<wmoxam> :p
<wmoxam> I haven't had issues compiling anything else though
<RX14> weird
<RX14> what was the error?
<wmoxam> I'll have to check again
<wmoxam> it possibly may not be an issue with the recent OpenBSD 6.1 release
<wmoxam> 😅
<wmoxam> I feel like compiler releases have become much more solid recently
<wmoxam> in the past a release would break a lot of things in the Liquid port that I've been working on
<wmoxam> now it "just works"
<wmoxam> specs pass, etc
<RX14> if only we got new features...
<RX14> i'm a little disappointed that there's nothing noteworthy in this release
<RX14> I had hoped it would finally be the one for parallelism
<RX14> with the branch coming along
<wmoxam> I'm not really interested in parallelism tbh :p
<RX14> me neither to be honest
<wmoxam> am used to not having it in Ruby
<RX14> but i'm interested for it as a step to 1.0
<RX14> to finally get it in and fix the bugs
<RX14> it's nearly may, and we have this rediculous goal of 1.0 before the end of the year. It seems madness to release 1.0 with less than 6 months production usage of a feature which touches so much
<BlaXpirit> you're worrying about this as if it has any chance of happening
<RX14> true
<FromGitter> <codingphasedotcom> which is the best ORM
<FromGitter> <codingphasedotcom> on crystal
<FromGitter> <bew> I'd say: It's the one you build :P
<FromGitter> <codingphasedotcom> yea lol
<FromGitter> <codingphasedotcom> i was thinking of doing one
<FromGitter> <bew> there are some here: http://awesome-crystal.com/#awesome-crystal-ormodm-extensions don't know if they're up to date..
<FromGitter> <bew> Never used one in crystal yet, but I've heard that Jennifer (https://github.com/imdrasil/jennifer.cr) is used for some projects
<FromGitter> <codingphasedotcom> ok cool thx
<RX14> @codingphasedotcom i'd say crecto is probably the best
<FromGitter> <bew> crecto looks very nice!
kubaxvx_ has joined #crystal-lang
kubaxvx has quit [Read error: Connection reset by peer]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
A124 has quit [Quit: '']
A124 has joined #crystal-lang
Renich has joined #crystal-lang
<Renich> o/
<Renich> hey guys, I am having a very strange issue. Every time I invoke crystal, my terminal session is broken and I can't do su -, for example.
<Renich> There's the proof
<Renich> I've tried comparing env's output before and after and I don't see a problem
* Renich is using the tar.gz release.
<Renich> I noticed this in 0.21
<Renich> I am using 0.22 now and it is the same
<Renich> My installation method is: download to ~/Downloads; decompress; go to ~/bin; ln -sf path-to-crystal-bin
* Renich is checking
<Renich> It was closed. Will it not be fixed? Bash is like... very common
<RX14> ...it's not a closed issue Renich
<Renich> ah, you're right
<Renich> RX14: do you think it will be fixed? I tried the tee workaround and it didn't help
<RX14> Renich, if the tee workaround doesn't help maybe it's a different issue...
<Renich> I tried crystal | tree /dev/null. Maybe I need to provide some arg?
<Renich> I will try crystal help | tree /dev/null
<RX14> well it wont fix it if it's already broken
<FromGitter> <bew> `tee` not `tree`
<Renich> yeah, hehe
<RX14> you'll need a new terminal where su works
<Renich> sorry, misspelled
<Renich> yep
<RX14> then then only use | tee
<Renich> I close the current one and try again
<Renich> OK
<Renich> RX14: I, always, close the current terminal and bring up a new one
<RX14> oh uhh
<RX14> try this
<RX14> crystal help 2>&1 < /dev/null | tee /dev/null
<RX14> or just `crystal help </dev/null >/dev/null 2>/dev/null`
<Renich> RX14: that worked
<RX14> great!
<Renich> crystal help </dev/null >/dev/null 2>/dev/null
<RX14> remove the redirects until it starts working
<RX14> sorry
<RX14> breaking
<RX14> and then you know what the issue is
<RX14> i reckon it's stdin
<Renich> maybe, just &> /dev/null?
<Renich> but I won't get output, eh?
<RX14> no
<Renich> OK, I'll just write a bash wrapper
<Renich> hehe
<RX14> well
<RX14> 2>&1 | tee /dev/null will get your output back
<Renich> ok
<RX14> you still need </dev/null though
<RX14> i'm 99% sure
<Renich> OK
<Renich> just a wrapper that goes like crystal $@ 2>&1 < /dev/null | tee /dev/null
<Renich> that will work.
<RX14> any crystal programs built will break it too
<RX14> you can use STDIN.blocking = true, STDOUT.blocking=true, STDERR.blocking = true to fix that though
<RX14> honestly it might be ebst to recompile the compiler
<RX14> and add those
<Renich> OK. I am running Gentoo... but, currently, have some problems with the build. This is why I am downloading the tar.gz
<Renich> The thing is I am using LLVM-4.0 and it might be breaking crystal (the system's version)
<FromGitter> <bew> Renich, crystal only need llvm to compile something, not to print some lines, so I don't think it's an issue
<RX14> @bew you typically compile packages from source in gentoo
<Renich> bew: OK... didn't quite get the "print some files" part.
<Renich> RX14: exactly
<RX14> Renich, what problem do you get
<Renich> RX14: let me show you... one sec
<FromGitter> <bew> @RX14 yeah I know, but as the issue appear when not compiling anything, the llvm version is not the root issue here..
<RX14> @bew we're talking about building crystal
<RX14> not the original su issue
<FromGitter> <bew> oh sorry, missed to read some comment..
<Renich> RX14: I know it's a shard bug report, but it applies to crystal as well
<FromGitter> <exts> Quick question: Is it bad practice when you build a crystal app project using shards cmd to write code outside the project module? I'm assuming that file+project module is treated like how some languages use a "main" function when compiled.
bjz has joined #crystal-lang
<RX14> Renich, thats really weird
<Renich> RX14: crazy stuff
<Papierkorb> exts, I don't understand. Are you pointing the resulting binary outside of your project root dir (or child directories of it)?
<Papierkorb> exts, if yes, that's not a good idea indeed. Your project only "owns" its directory, in which it may do as it pleases. It has no business outside of it though.
<Renich> RX14: ah! wait, I just tried merging it and it worked! Maybe it was a related update (recent) to LLVM
<RX14> merging which?
<Renich> shards
<RX14> what do you mean by merge
<Renich> RX14: it's how us, Gentoons, say "install"
<Renich> merging means building and installing
<FromGitter> <exts> @PandaWhisperer no, i'm just wondering when you create a fresh project and it creates that default module file named after your app which is used as the default binary is it bad practice to write code outside that main namespace.
<RX14> Renich, oh...
<Renich> The repository ins git based and it's really cool. I can add patches on the fly as well.
<FromGitter> <bew> @exts you mean Papierkorb I think ^^
<Renich> RX14: it would be cool to fix this with a patch applied on the fly
<FromGitter> <exts> oh sorry it messed up autocomplete,
McSoFake has quit [Quit: leaving]
<RX14> one day i'll bother with gentoo
<RX14> probably not actually
<FromGitter> <exts> sorry @PandaWhisperer , wrong person :D
<RX14> i'm playing with https://agunix.org/ recently
<Renich> RX14: hehehe. If you do, you'll fall in love, my friend. Believe me. I was a Fedora maintainer and switched... Rolling release rocks
<RX14> i'm on arch right now
<RX14> rolling release is great
<Renich> seems interesting. A lean linux
<RX14> yeah
<Renich> RX14: yep, it rocks. Arch is amazing as well
<Papierkorb> exts, ah, now I understand. If it's an *application*, I wouldn't say it's bad practice. Though I mostly have a "X_bin.cr" (or similar) file, which then uses `MyApp::Tool.run ARGV` to jump into the front-end CLI handling code. This is especially nice if your application may end up as being useful as library too. It also saves you the headache of not writing `MyApp::` everywhere. Apart from that, it's acceptible I think
<Renich> RX14: if you wanted to scratch the itch, here: https://wiki.gentoo.org/wiki//etc/portage/patches
<Renich> RX14: it's about patches on the fly
<Renich> I'll see if I can fix it myself and deploy it
<FromGitter> <exts> ah thanks @Papierkorb (gitter doesn't want to autocomplete your name for some reason)
<RX14> thats really cool Renich
<RX14> damn i should try gentoo
<Papierkorb> exts, I'm on IRC, that's probably why ;)
<RX14> i havent reinstalled in... years
<Renich> LOL. Well, if you do, let me know if you need any help.
<FromGitter> <exts> ah
<RX14> Renich, this FS was created jun 23 2014
<RX14> so prettty old arch install
<RX14> i need to start from scratch :)
<Renich> wow. Yeah. Are you using systemd?
<RX14> remove all the stuff I don't use any more
<RX14> Renich, yeah
<Papierkorb> Though I also sometimes end up tabbing the nick just to be reminded that no, the correct recipient is on gitter and I just annoyed some random internet user instead :)
<Renich> cool
<Renich> RX14: well, you could try gentoo, check it out, and go back to a fresh arch install.
<RX14> Renich, systemd is cool, all the bloat around it isn't
<Renich> I mean, it will take some time to get right, but I have a script I've used for my workstation. Maybe it could help you, if you decide
<RX14> one day i'll write my own init in crystal which is basically a stripped down systemd...
<FromGitter> <exts> lol yeah, that's what I just did a second ago :)
<Renich> RX14: I love systemd. I feel it gets deminished every time they hatters hate it. It is not just an init system.
<Renich> RX14: cool!
<RX14> i don't love systemd
<RX14> it's way better than sysv
<RX14> but it's bloated and does much more than it should
<RX14> especially the networking stuff
<RX14> i endeded up ripping that out and using connman
<RX14> also why on earth does it even have a bootloader
<RX14> it's just silly
<Renich> well, it makes thing standardized accross distros, which is really cool. I don't like the fact that we are segmented as hell.
<Renich> yeah, I get your point
<RX14> making init scripts for daemons standard is good, but networking? nah
<Renich> RX14: well, if it gets good, I would go for it. I use NetworkManager for now. With bonding and stuff
<RX14> i think runit is pretty cool though
<RX14> having seen it in practice
<Renich> RX14: hey man, if I put the workaround in compiler/stdout.cr (doesn't exist) you think it would be enough? I mean, wrap it in module Crystal and stuff
<RX14> Renich, probably?
<Renich> well, I'd, definitely, test a crystal init ;)
<Renich> RX14: will try that out
<Renich> let's see how it goes
<Renich> I'll let you know in, like, 3 hours... ;)
* Renich will be watching Ary's video in the meantime
<FromGitter> <exts> anyone tried crystal on codewars? that bookseller problem didn't even pass values even though the test did :|
<Renich> ah, it finished compiling. Now, I will test
<Renich> hah! it works! ;D
<Renich> So, I will suggest this patch to the crystal maintainer in Gentoo
<Renich> Thanks for the guideance RX14
<RX14> np
<Renich> do we have a copy/log of our conversation somewhere?
<FromGitter> <fridgerator> @exts i havent tried yet but was planning on it
<Renich> Or, rather, I will just reference the bug report
<FromGitter> <bew> How/When to use `macro def my_macro_def; ...; end` ?
<FromGitter> <eliasjpr> I think something is up here https://play.crystal-lang.org/#/r/1wsz
<FromGitter> <eliasjpr> I would expect valid, and valid? to be true
<FromGitter> <eliasjpr> No?
<FromGitter> <bew> no, because `valid = ...` creates a local variable
<FromGitter> <bew> to achieva what you want: `self.valid = ...`
<FromGitter> <eliasjpr> ahh ok
<FromGitter> <eliasjpr> I would think a this point the accessor will be used
<FromGitter> <eliasjpr> but Im wronf
<FromGitter> <eliasjpr> `self.valid = with self yield || false`
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <bew> I though the same until a recent issue
<FromGitter> <eliasjpr> yeah, but it makes complete sense