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
greenbigfrog has joined #crystal-lang
zipR4ND has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
Philpax has joined #crystal-lang
zipR4ND has quit [Ping timeout: 246 seconds]
balduin has quit [Ping timeout: 255 seconds]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
whomp has joined #crystal-lang
whomp has quit [Ping timeout: 246 seconds]
whomp has joined #crystal-lang
whomp has quit [Ping timeout: 240 seconds]
pduncan has joined #crystal-lang
balduin has joined #crystal-lang
whomp has joined #crystal-lang
whomp has quit [Ping timeout: 240 seconds]
<FromGitter> <bararchy> Papierkorb: I'll add use case to my issues
sz0 has joined #crystal-lang
balduin has quit [Remote host closed the connection]
yogg-saron has joined #crystal-lang
<TheGillies> is there a method that checks to see if class includes a module?
<FromGitter> <bew> There is macro method for that
<TheGillies> Just created I can do write methods that except the module and it will work
<TheGillies> Just realized*
* TheGillies needs sleep
<TheGillies> surprised crystal playground doesn't crystal tool format
Kug3lis has joined #crystal-lang
mark_66 has joined #crystal-lang
yogg-saron has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] mjago opened pull request #4444: Spec description grammer [docs] (master...spec_doc_grammer) https://git.io/vHTME
yogg-saron has joined #crystal-lang
<FromGitter> <bararchy> I wish RubyMine would work with crystal, or, adapt a CrystalMine :)
<FromGitter> <bararchy> Hm... it seems they have support for almost all other langs including Go and Rust ⏎ https://plugins.jetbrains.com/category/48-languages/ruby
<FromGitter> <foi> Hi! How to set ignore ssl certificate errors for HTTP::Client (like unknown ca, expired)? In ruby - OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE, is crystal have this equivalent?
<FromGitter> <bararchy> @foi ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5922a3cf5e34568d5e7b624d]
<FromGitter> <foi> @bararchy Awesome! THANK YOU!
bjz has joined #crystal-lang
bjz has quit [Client Quit]
bjz has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter> <drosehn> @bararchy : I sent a tweet to RubyMine about crystal support, and they said: *There's an open request. Please add your vote: https://youtrack.jetbrains.com/issue/RUBY-17225 *
<FromGitter> <bararchy> Nice !!!!!
<FromGitter> <bararchy> Cool dude
<FromGitter> <drosehn> Note that that issue was opened in Oct 2015, and the only comment is someone who came along four months later and added some pointers to Crystal support in the Atom editor.
<FromGitter> <bararchy> I added my comment, and my vote
<FromGitter> <bararchy> we can Try and get more people voting
<FromGitter> <bararchy> only 11 votes right now
<FromGitter> <bararchy> we have 500~ people here in the gitter alone
<FromGitter> <drosehn> very good :thumbsup:
<FromGitter> <drosehn> it occurs to me that I should have posted that here sooner! I sent the tweet to them (and got the reply) about a month ago.
<FromGitter> <bararchy> Oh :) no worries, I guess it only matters to those using there products
Kug3lis has quit [Quit: Textual IRC Client: www.textualapp.com]
Ven has joined #crystal-lang
Ven is now known as Guest38993
Guest38993 has quit [Client Quit]
<crystal-gh> [crystal] ysbaddaden opened pull request #4445: Use an Enum for process stdio redirections (master...fix-process-run-stdio-argument) https://git.io/vHTpz
Val has joined #crystal-lang
<crystal-gh> [crystal] kostya opened pull request #4446: Time::Span #to_json #from_json (master...time_span_json) https://git.io/vHTjI
zipR4ND has joined #crystal-lang
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 245 seconds]
<FromGitter> <bararchy> @drosehn It seems we got something started, somelse just commented
splitty___ has joined #crystal-lang
splitty__ has quit [Ping timeout: 240 seconds]
<wuehlmaus> Papierkorb: does your fancy_line have emacs bindings beyond control-a and control-e? didn't work for me in your Samples. do i have to roll my own?
<wuehlmaus> i am talking about control-f, control-b , word jumping ....
<Papierkorb> wuehlmaus: i only added those I commonly use for now. adding your own is simple, PRs extending the defaults are also interesting to me
<Papierkorb> wuehlmaus: all ootb key bindings are listed in the README.md
<wuehlmaus> fine, cool project that you did!!
<Papierkorb> wuehlmaus: to me it was priority to 1) get it to a usable state (which it imho is) 2) implement few key bindings correctly instead of all somewhat. E.g., Word jumping, line editors don't seem to agree if it should be Ctrl+ or Alt+cursor by default. Of course, Alt is the correct choice, but maybe those programs I use are in the minority etc.
<Papierkorb> There's also a commit lying dormant on my laptop adding right-prompt. But for that to work properly we need LibC::ioctl(), which doesn't exist, and ioctl() is so huge that I don't want to bind (and hence, maintain) it myself in the shard.
<Papierkorb> ioctl() with proper support for all kinds of platforms
<wuehlmaus> it is a super cool project, i really like it :)
<Papierkorb> :)
<wuehlmaus> coming from zsh i find plain readline a bit poor :) sadly zsh doesn't have their awesome readline replacement as a library.
<Papierkorb> yeah I use zsh myself
<wuehlmaus> haha :)
<FromGitter> <bew> zle as library ? would be completly awesome ^^
<wuehlmaus> totally! but nobody ever did it :(
<FromGitter> <bew> Would also be awesome to make a CrSH shell in crystal, with configuration in crystal & everything in crystal...
<FromGitter> <bew> I'm going crazy...
<Papierkorb> fancylines tutorial will help you get there hehe
<FromGitter> <molovo> @bew I’ve thought about doing exactly that a few times. I do a lot of ZSH development, but a lot of the stuff in the shell itself is a massive load of unnecessary bloat. It could be so much more performant
<wuehlmaus> molovo: at least you can load modules or unload them. but i know what you mean.
<FromGitter> <molovo> I can, but people using my stuff will more often than not be using the default installation, which means I have to support that default configuration
<wuehlmaus> fish could be an alternative but then other stuff is missing ....
mounibec has joined #crystal-lang
<FromGitter> <molovo> @wuehlmaus I’ve tried fish, I actually prefer the syntax, but it’s a long way behind ZSH. Being able to use Crystal and OOP in shell scripts would be epic, plus managing plugins/scripts as shards.
<FromGitter> <bew> the flexibility of zsh + a real language would be :sparkles:
<FromGitter> <molovo> cash (https://github.com/dthree/cash) was a pretty good start at a cross-platform shell built in node, but it’s kinda stagnated. Not a trivial project by any means
<FromGitter> <molovo> Works natively on windows too
<wuehlmaus> bew: and that's the problem: the flexibility of zsh means 25 years of work :)
<wuehlmaus> and to come up with a replacement means LOTS of work at hand.
<Papierkorb> Then start today (well, two months ago), than later ;)
<wuehlmaus> good luck :)
<FromGitter> <molovo> I don’t think all that flexibility is entirely necessary though. ZSH’s biggest problem is that almost everything it does is done to be compatible with KSH and CSH, which are both completely different. Actually just sticking with ‘The ZSH way’ and dropping all the old compatibility stuff would make it a lot leaner and encourage innovation
<wuehlmaus> something like neozsh? :)
<wuehlmaus> [ no, there is not a neozsh project]
<FromGitter> <molovo> Yeah, perhaps. But you’d run into the same issues - people coming from ZSH would expect backwards compatibility, which means supporting KSH and CSH too. Actually starting completely afresh and using a proper language for the syntax would be a really good idea
<FromGitter> <bew> I'd say, as crystal takes inspiration from ruby, crsh could take inspiration from zsh :)
<FromGitter> <molovo> I like the name CrSH too, has a nice ring to it. Or crash, but that might be confusing
<wuehlmaus> crash is funny :)
<FromGitter> <bew> or crsh, but pronounced [crash] :P
<FromGitter> <molovo> And just think how awesome it would be to use exceptions within shell scripts, instead of arbitrary numbers (I tried doing that in zsh, it... sorta works, and is called crash (https://github.com/molovo/crash) too)
<FromGitter> <bew> oh nice!
<FromGitter> <molovo> I might give a shell a go. It would be an interesting challenge
<wuehlmaus> i am not talented enough to program that myself but i would support you!
<Papierkorb> incidentally, I'll build a control shell thing for daemon controlling. daemons written in crystal, so nothing magical. Probably will use JSON-RPC as transport.
<FromGitter> <bew> @Papierkorb don't get it, what are you thinking?
<Papierkorb> bew, I've been writing daemons (services) in Crystal, and all of them have similar requirements. One of them is being able to be controlled from the outside, showing metrics, health checks, etc. I remembered that Asterisk* has a remote "shell", in which you can do all that, so I'll probably copy that idea.
<Papierkorb> bew, and as you'd need a network transport for this, preferably standarized, easy, optionally stateful and securable, JSON-RPC sounds like a good idea.
<FromGitter> <bew> nice!
<FromGitter> <bew> about rpc system, I'm thinking about a msgpack-rpc implementation
<FromGitter> <bew> (to build a neovim plugin host, allowing to write neovim plugins in crystal)
<FromGitter> <bew> @Papierkorb I saw that you made cannon, which has a RPC module for your cannon serialization. Do you think it could be worth to take the RPC part, and make a special shard for the service/client, with generic serialization (JSON, cannon, msgpack, ...) from that ?
<Papierkorb> bew, you mean splitting the rpc stuff from the pure serialization?
<FromGitter> <bew> simply put, yes
<Papierkorb> should be really easy. you have to require the rpc part manually already anyway
mounibec has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Raimondii has joined #crystal-lang
mounibec has joined #crystal-lang
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
Val has left #crystal-lang [#crystal-lang]
<FromGitter> <straight-shoota> Is it possible to use `has_constant?`on global scope? I want to check if `JSON::Any` exists (i.e. `json` is required somewhere).
<FromGitter> <bew> why not simply `require "json"` ?
<FromGitter> <straight-shoota> Well I don't need to if it is not required anywhere else...
<FromGitter> <bararchy> It's a good practice to "require" what you need on any file that might need it to avoid dependency issues
<FromGitter> <bararchy> the compiler will sort it out
<Papierkorb> straight-shoota, `puts {{ @type.has_constant?(:JSON) }}`
<Papierkorb> Try that on the top-level
<FromGitter> <straight-shoota> Yeah, that works. Danke ;) ⏎ For my usecase I need it inside an instance method, though. Any idea?
<FromGitter> <straight-shoota> I find this quite ugly: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5922f8232b926f8a677ec4b2]
<Papierkorb> Put the json specific stuff into its own .cr file and require that
<Papierkorb> You can re-open classes and modules as you see fit, so you can keep the non-json code paths completely unaware of the existence. Throwing it out is really easy too if needed. And integrating it is just a copy/paste away.
<FromGitter> <straight-shoota> :+1:
mounibec has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mounibec has joined #crystal-lang
Ven has joined #crystal-lang
Ven is now known as Guest7189
yogg-saron has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<TheGillies> Why doesn't this work as expected? https://play.crystal-lang.org/#/r/2274
Guest7189 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven is now known as Guest88924
Guest88924 has quit [Client Quit]
<Papierkorb> what did you expect?
<Papierkorb> TheGillies:
<TheGillies> Papierkorb: It to print message in finalize
<TheGillies> even if I put a sleep in there doesn't do it
<Papierkorb> TheGillies: The GC isn't aggressive and only runs if either 1) sufficient amount of allocations made 2) manually forced it to run
<TheGillies> Ah
<Papierkorb> TheGillies: https://crystal-lang.org/api/0.22.0/GC.html#collect-class-method Call that like 10.times
<TheGillies> Why 10 times?
<Papierkorb> iirc it doesn't collect everything on a single run. 3 times catches almost everything, 5 should really do it, but I use 10 in my unit tests if I need to test finalizers
<TheGillies> Still no change
Ven_ has joined #crystal-lang
<Papierkorb> weird, that worked for me
<TheGillies> Papierkorb: like locally?
<TheGillies> I wonder if it's how playground handles GC
<TheGillies> Anyone know if it's possible to infer what class put an object into a channel, or do I explicitly need to add that as meta data in the object?
<Papierkorb> TheGillies: Send a Tuple with your object
<TheGillies> like {FooClass, object} ?
* TheGillies feels like he stepped into erlang :P
<Papierkorb> Well probably `my_chan << {self, some_object}`
<Papierkorb> With my_chan = Channel(Tuple(MySelfType, SomeObjectType)).new
<TheGillies> Yeah righto thats what I meant to convey heh
<TheGillies> >> would be a cool method for receive heh
<DeBot> TheGillies: - https://carc.in/#/r/227g
<TheGillies> DeBot: wat
<FromGitter> <bew> ahahah it's a feature, you write `>> some code` and a bot will try to execute `some code` in carc.in
marciogm has left #crystal-lang ["WeeChat 1.7.1"]
<TheGillies> >>`rm -fr /`
<DeBot> TheGillies: # => "" - https://carc.in/#/r/227r
<Papierkorb> I doubt you're the first one to try
<FromGitter> <jwoertink> @Papierkorb Thanks for the fancyline suggestion. I'm gonna give it a shot!
<Papierkorb> :)
<FromGitter> <bew> > puts test
<FromGitter> <bew> grrr
<FromGitter> <bew> not working through gitter
<Papierkorb> bew, it's `>>` and has to come first, but also, in IRC your gitter name is prepended, so it's still not possible through gitter ;P
<FromGitter> <bew> yeah I know, but maybe the gitter to irc but would be able to figure this out..
<FromGitter> <bew> s/but/bot
mark_66 has quit [Remote host closed the connection]
Ven_ has quit [Ping timeout: 260 seconds]
<wuehlmaus> bew: isn't it butt? ;)
<FromGitter> <bararchy> Butt bot that bridges to IRC , much cool , so naming
Ven has joined #crystal-lang
<wuehlmaus> a bot that is there to annoy :)
Ven is now known as Guest31182
dannyAAM_ has quit [Ping timeout: 255 seconds]
dannyAAM has joined #crystal-lang
Guest31182 has quit [Ping timeout: 260 seconds]
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 240 seconds]
Ven_ has joined #crystal-lang
mounibec has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ven_ has quit [Ping timeout: 240 seconds]
<FromGitter> <akzhan> Is anybody will approve #4422?)
<DeBot> https://github.com/crystal-lang/crystal/pull/4422 (Add .editorconfig template on crystal init command.)
Ven_ has joined #crystal-lang
Philpax has quit [Ping timeout: 255 seconds]
Ven_ has quit [Ping timeout: 255 seconds]
zipR4ND has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Ven is now known as Guest70144
<Papierkorb> Being able to choose different licenses right there would be neat
<Papierkorb> Many people don't even pay attention to what they publish their code as
Guest70144 has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Ven is now known as Guest56196
<Papierkorb> bew, were you talking about having a common `mapping` interface to many (de-)serializers?
<FromGitter> <bararchy> Its a good thing though that they use MIT license hahah
<Papierkorb> I don't know if it's a good thing or not
<Papierkorb> but I constantly have to dig out my MPL-2 LICENSE file from other projects
<FromGitter> <mverzilli> looks like it's unrelated to that PR unless I'm missing something
<Papierkorb> if you're gonna make money off my code, at least contribute your changes
<Papierkorb> mverzilli, it's unrelated
<TheGillies> I've made a career out of making money off other people's code heh
<crystal-gh> [crystal] mverzilli closed pull request #4422: Add .editorconfig template on crystal init command. (master...add-editorconfig-on-crystal-init) https://git.io/v9xkS
<FromGitter> <mverzilli> @akzhan merged!
<FromGitter> <akzhan> @mverzilli thanks a lot.
Guest56196 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <akzhan> btw documentation for vsivility modifiers is outdated. There are only methods mentions. But it is more common technique.
<FromGitter> <akzhan> I have seen private types, constants and enums afair
<FromGitter> <mverzilli> thank you! I really like the defaults you chose... I just hope this doesn't result in soon-to-come issues discussing tabstops vs. spaces vs. tabs or how many spaces should go per indentation level
<FromGitter> <akzhan> it’s just defaults. and crystal tool format also uses ‘em, afaik
monadicDuck has joined #crystal-lang
<FromGitter> <mverzilli> yeah, I actually agree :)
<TheGillies> Can you statically link c libs in crystal?
<FromGitter> <akzhan> it should be easy, Link attribute has Static property. But it need to recompiler compiler itself.
<monadicDuck> why is crystal so fast >_<!!!
<FromGitter> <johnjansen> you could slow it down if you like … `sleeeeep` ;-)
<TheGillies> because it uses llvm
<FromGitter> <akzhan> btw we need option to compile all statically like golang. Whenever.
<FromGitter> <akzhan> oops --link-flags -static
Ven_ has joined #crystal-lang
<FromGitter> <akzhan> @mverzilli btw, #2989 should be merged
<DeBot> https://github.com/crystal-lang/crystal/pull/2989 (Add man page to crystal)
<FromGitter> <akzhan> this is because we need any «not bad" man page on milestone
yogg-saron has joined #crystal-lang
yogg-saron has quit [Client Quit]
<Papierkorb> a man page would be fantastic to have indeed
<RX14> there's a PR but it seems to be stalled
<Papierkorb> yeah akzhan just linked it
<FromGitter> <mverzilli> yep, I
<FromGitter> <mverzilli> sorry early enter :P
<FromGitter> <mverzilli> I think we can merge it, for the reasons RX14 suggested in the comment thread, but someone should take it to a mergeable state again
Ven_ has quit [Ping timeout: 240 seconds]
<RX14> is it not mergeable?
<TheGillies> don't know if me or my generation but I never read man pages. I usually just read README in repo or web docs
<RX14> that's assuming it has a repo
<TheGillies> what code doesn't have a repo?
<TheGillies> heh
<RX14> uhh, everything created before the 90s
<RX14> they just distributed tarballs
<RX14> sent patches in lists
<RX14> the good old way
<RX14> man pages are very useful for syscalls, commandline tools
<Papierkorb> Every good tool should have a man page
<RX14> most people won't read crystal's man page because it has a github presence
Ven has joined #crystal-lang
<Papierkorb> That's actually what a solid tool sets apart from a hipster tool for me, kid you not
<RX14> but there is plenty of stuff out there where the man page is the only docs
<FromGitter> <mverzilli> oh, it is mergeable, not rebaseable
Ven is now known as Guest27595
<FromGitter> <akzhan> man page required because admins never read GitHub.
<FromGitter> <mverzilli> ok! I'll merge it as soon as I find the time
<FromGitter> <drosehn> The man page does not need to be long or exhaustive, but enough to give people a good start. And *NOT* point to some gnu-info document for all the important details!
<RX14> god i hate those ones
<RX14> gnu info is confusing to me
<RX14> just write a darned man page
<Papierkorb> yeah
<FromGitter> <drosehn> I used to know how to use `info`, but if I see that now I just mutter under my breath and do a google-search for the documentation.
<RX14> i just open the info pages in emacs
wontruefree has joined #crystal-lang
<FromGitter> <drosehn> Ah. I have systems where emacs isn't installed, so I've forgotten about that. (not that I've forgotten about emacs, but I've forgotten about using emacs on gnu-info pages0
<FromGitter> <drosehn> )
<FromGitter> <mverzilli> @drosehn, sure. as RX14 said, let's get the ball rolling and work from there :)
<FromGitter> <drosehn> Yep. I agree completely with that.
<FromGitter> <drosehn> I just wanted to add a hostile comment towards gnu-info pages...
<FromGitter> <johnjansen> @drosehn in the current climate, that wasnt at all hostile … ;-)
<FromGitter> <drosehn> heh
<FromGitter> <mverzilli> lol, duly noted
TheLemonMan has joined #crystal-lang
<FromGitter> <johnjansen> you need to try harder
wuehlmaus has quit [Quit: Lost terminal]
<FromGitter> <akzhan> and go deeper?)
wuehlmaus has joined #crystal-lang
<Papierkorb> Does anyone know if there's a stance on localized #crystal-lang spinoffs?
<FromGitter> <johnjansen> personally i think its waaaay early for that kinda thing ;-)
<FromGitter> <akzhan> ru.crystal-lang.org site has untrusted certificate, so I discard it from the history. I have no information about maintainer
<FromGitter> <akzhan> Btw, it’s really to early to think about.
<FromGitter> <akzhan> Language design anyway will be changed.
<TheGillies> We need esperanto crystal channel
<TheGillies> kiu parolas esperanton ĉi tie?
<FromGitter> <johnjansen> also we need to consolidate resources … if we head off on language tangents, then the knowledge is split and so is dev time
<TheGillies> 我也说中文
<RX14> crystal certainly feels a lot more lively recently which is nice
<FromGitter> <akzhan> Mi ne parolas la ĉinan aŭ Esperanto.
Guest27595 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<TheGillies> :(
wontruefree has quit [Quit: Is gone... Just plain old gone]
Ven_ has joined #crystal-lang
<TheGillies> I don't speak russian
<Papierkorb> Schnell, sprecht deutsch während die Moderatoren schlafen
wontruefree has joined #crystal-lang
<FromGitter> <mverzilli> on the other hand, if there's people who don't speak English it's great if they have places to gather and try to collaborate
<Papierkorb> johnjansen, those capable of speaking multiple languages are likely to join all of those channels, but those only capable of speaking their non-english mother tongue, can't be helped
<FromGitter> <mverzilli> exactly!
<FromGitter> <mverzilli> (btw Ary is an Esperanto teacher :))
<FromGitter> <akzhan> we can add actualization of localized sites to after 1.0 milestone with minor priority.
<FromGitter> <johnjansen> i agree with that, however if another language takes off, and becomes dominant, then all those conversations have to move back to all the others IMO … at least if we want to knowledge share … happy to be wrong about this!
Ven_ has quit [Ping timeout: 246 seconds]
<RX14> i don't think another language is going to become "domainant": the source comments, the issue tracker, and the API docs are all currently english-only
<Papierkorb> unlikely to happen, as many still speak english and you collaborate in english anyway on Github and the like
<FromGitter> <mverzilli> I don't think you're wrong, but there's still people who wouldn't *be able* to participate
<FromGitter> <johnjansen> it all depends on your "level of caring”, personally i really want intensity and focus, this needs to become a huge language for the good of the planet :-)
<TheGillies> 中文会主宰!
<RX14> in fact I wouldn't know the correct approach to take for localising source comments in the first place
<RX14> if anything I think the concern would be that the language channels would be too small
<FromGitter> <johnjansen> @RX14 i agree with that too …
<FromGitter> <johnjansen> <- very agreeable
<RX14> haha
<Papierkorb> dunno what too small is. even 10 active ppl at this time would be amazing in a localized spinoff
<Papierkorb> Considering that this IRC channel, not counting gitter, has 100 members
<RX14> active members is a better count
<RX14> let me see...
<Papierkorb> And that changes almost daily
<FromGitter> <johnjansen> from a purely practical point of view, if there is a channel with only 10 people, presumably someone has to be the bridge between languages
* RX14 greps his irc logs
<TheGillies> that's why they made google translate
<Papierkorb> Oh god please no TheGillies
<Papierkorb> Ever tried to help someone who did that?
<TheGillies> better than nothing
<Papierkorb> Not fun. the translation software creates a mess far worse than if those would just use their "quite bad" english
<RX14> wow, i've been in here since 2015-08-21 :)
<Papierkorb> It's actually not, the software is likely to mess up important aspects
<TheGillies> like the difference between 中文 and 中国人
<Papierkorb> In that case, if someone were to come in here, talk in non-english, those who speak their language should tell them to use english, or if they can't, could offer help through PM, if the helper wants to of course
<FromGitter> <johnjansen> i can only imagine what would happen when some untagged code goes through translate ⏎ ⏎ ```Spawn hacer ⏎    Hacer bucle ⏎      Pone "¡Hola!" ⏎    fin ⏎ fin``` [https://gitter.im/crystal-lang/crystal?at=59233a1ceec422e415dac14e]
<FromGitter> <johnjansen> oh no, i can try it
<FromGitter> <johnjansen> ```Spawn do ⏎    Петля делать ⏎      Ставит «Привет!» ⏎    конец ⏎ конец``` [https://gitter.im/crystal-lang/crystal?at=59233a485e34568d5e7e2414]
<FromGitter> <akzhan> oh no… Russians dislike localized keywords.
<FromGitter> <johnjansen> haha ...
<FromGitter> <mverzilli> yeah, maybe it's just me, but Spanish source code looks really weird
<Papierkorb> same for German
<Papierkorb> if it's only the comments, well you can cope
<TheGillies> Papierkorb: helpu min, mi petas. vi estas mia nur helpo
<Papierkorb> but if the classes and methods are German too, then things get hairy real quick
<Papierkorb> TheGillies: those looking for help are unlikely to highlight someone specific :P
<TheGillies> I actually had that thought lol
<FromGitter> <mverzilli> not sure if anyone here is aware, but there's a quite active and big Crystal community in Japan
mounibec has joined #crystal-lang
<FromGitter> <mverzilli> so it's not really a matter of stance... if people are excited about something they'll just find the way
<FromGitter> <johnjansen> i tripped over that yes … and who knows what wonderful stuff they are talking about
<Papierkorb> well do they know about this channel?
<Papierkorb> I figure many just aren't comfortable speaking english
<FromGitter> <johnjansen> presumably if they follow the official lang repo
<FromGitter> <johnjansen> and know about gitter, or have looked for irc reference and “are comfortable with english” :-)
<Papierkorb> But that gives me yet another reason for learning Japanese, so there's that
<TheGillies> change language with macros heh
<FromGitter> <drosehn> Yeah, but think of all those years where all the cool ruby-activity was happening in Japanese. :smile:
<Papierkorb> ?
<TheGillies> Ah this is even better: https://play.crystal-lang.org/#/r/228m
<RX14> well, i've now learned that parsing IRC logs is hard and sed is stupid
<TheGillies> is each word interpreted as a method in AST or something?
<RX14> yes
mounibec has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<FromGitter> <molovo> Are there any other dependencies for Crystal on Ubuntu Trusty, other than `build-essential`? I’m getting missing library errors trying to run `crystal spec`
<FromGitter> <bararchy> What libs are showing missing ?
<FromGitter> <molovo> `libxml2` is installed by default on trusty, so I’m not sure why that’s appearing there. I installed from the official repository
<TheGillies> this is why Im a fan of arch
<TheGillies> sudo pacman -S crystal
<TheGillies> done
<RX14> not really
<RX14> you still need libxml2, it's probably just installed
<RX14> the difference is because arch includes dev stuff in the normal package
<TheGillies> yeah
<TheGillies> I wasn't saying it didn't
<TheGillies> Im just saying i like it because im lazy
wontruefree has quit [Quit: Is gone... Just plain old gone]
<FromGitter> <molovo> Ah, I’ll try the dev libraries and see if that gets me somewhere
<RX14> oh yeah
<FromGitter> <mverzilli> @molovo have you checked https://github.com/crystal-lang/crystal/wiki/All-required-libraries#ubuntu?
<FromGitter> <molovo> Ah! That’s what I’m missing. Thanks @mverzilli. I might make a PR to add that list to the official docs, because it only mentions `build-essential` there.
<FromGitter> <molovo> Out of interest, does anyone know if all those libs are installed in the crystal community build for travis-ci? I’m having a wierd issue there which is what I’m setting up this Ubuntu to debug
<FromGitter> <mverzilli> sorry, but are you trying to set up a dev environment for crystal itself or just run specs on a project?
wontruefree has joined #crystal-lang
<FromGitter> <molovo> Run specs
<FromGitter> <molovo> It works now, thanks
<FromGitter> <mverzilli> yeah, but that's much more than what you need then... sorry for that
<FromGitter> <molovo> No problem - it’s a throwaway Vagrant box, just to try and debug an issue on Travis. Something in that list definitely fixed it though - not sure what
Ven has joined #crystal-lang
Ven is now known as Guest22322
<FromGitter> <bararchy> @johnjansen make sure your LLVM is 3.8 and up
<FromGitter> <bararchy> @molovo
<FromGitter> <molovo> It just installed 3.4, and that worked
<FromGitter> <akzhan> Lucky
Guest22322 has quit [Client Quit]
<FromGitter> <bararchy> Hmmm keep in mind that currently officially supported LLVM versions are 3.8-4
<RX14> crystal won't link with llvm 3.4 so it's not using llvm3.4 even if it's installed
<RX14> you can find out what it's running if you use `crystal -v`
<FromGitter> <molovo> Yeah, I usually run on a mac, and that’s got the right version
<FromGitter> <molovo> That Ubuntu box is actually using 3.5 though, despite having just installed 3.4: `Crystal 0.22.0 [3c71228] (2017-04-20) LLVM 3.5.0`
<RX14> yes
<RX14> crystal bundles llvm with it
<FromGitter> <molovo> Ah, that makes more sense
<FromGitter> <johnjansen> @bararchy ???
<oprypin> johnjansen, were you also confused by that way of writing 3.8 - 4.0 ?
<oprypin> or the random ping
mounibec has joined #crystal-lang
<FromGitter> <bararchy> @johnjansen mistake in tag , sorry ^^
<FromGitter> <johnjansen> @oprypin i was confused as to what went on whilst i was eating lunch … does that count?
<oprypin> i dunno
<FromGitter> <johnjansen> ;-)
<FromGitter> <johnjansen> i havent contemplated anything LLVM, so no
zipR4ND has joined #crystal-lang
literal has quit [Ping timeout: 268 seconds]
<TheGillies> What is a good use case for Atomic?
literal has joined #crystal-lang
mounibec has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
abidon has joined #crystal-lang
<Papierkorb> atomic?
<TheGillies> It seems kinda like what clojure does for STM but I don't know enough compsci to know when to use it
<FromGitter> <akzhan> It’s not useful unless multithreading merged
<Papierkorb> Atomic data types can be changed *atomically* in a multi-threaded environment, usually through the help of CAS
<Papierkorb> TheGillies: You can tell it to "change to value x, but only if you're y", and you read y prior. This way, you can detect that another CPU changed the same data while you were working on it without using a mutex
<TheGillies> Right
<TheGillies> But isn't crystals concurrency paradigm supposed to sidestep that problem all together?
<Papierkorb> You can e.g. use it to build a concurrent list, like a job stealing queue: Many threads (fibers) are trying to pull a job from a queue, and many other threads are putting jobs into it.
<Papierkorb> Channels you mean? You can't model everything with only that
abidon has quit [Ping timeout: 260 seconds]
<TheGillies> yeah so my question is what am i building where channels no longer cut it and i have to use atomic?
<Papierkorb> job stealing queues
<FromGitter> <akzhan> Channels very capable for code written in Crystal paradigm only. But what about C bindings etc.
<Papierkorb> Generally, data structures that are to be changed concurrently by many producers and read by many consumers at once. Frankly, these data structures should end up in the std or in a shard so you won't have to really worry about it too much
<Papierkorb> You can mess it up real quick
<FromGitter> <akzhan> Yep, all these details should be hidden be shards. But they will use atomic.
<TheGillies> by shard you just mean a higher level abstraction library?
<FromGitter> <akzhan> Yes.
<Papierkorb> Yes.
<TheGillies> got it
<Papierkorb> Maybe we'll also get memory barriers at one point lul
<Papierkorb> gotta go fast ~
<TheGillies> i don't even know what that is
<Papierkorb> Well atomic access plays a role in that. You know how your CPU may reorder instructions internally? You can tell it not to, or differently. You can do that across cores as really low-level synchronisation method
<Papierkorb> But getting is right is seriously hard.
<FromGitter> <akzhan> btw atomic.cr is hardly depends on memory barriers, that impemented by LLVM ops.
<FromGitter> <akzhan> see example: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59234ebf9f4f4ab05bee0141]
<FromGitter> <akzhan> So you can extract your own memory barriers ops in same manner.
wontruefree has quit [Quit: Is gone... Just plain old gone]
<FromGitter> <akzhan> details at primitives.cr (codegen), and at https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html#g_t_005f_005fatomic-Builtins
<FromGitter> <akzhan> LLVMV support these ones.
wontruefree has joined #crystal-lang
<FromGitter> <mverzilli> and if you want to see them in use checkout the `single-msqueue` branch and take a look at `scheduler.cr`
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
* TheGillies is now convinced he won't be using Atomic any time soon :P
<FromGitter> <akzhan> btw, can i help to promote single-msqueue to merge?
<FromGitter> <akzhan> this is because multithreading is wanted very much to get crystal everywhere )
<FromGitter> <akzhan> Btw, compiler can improve itself with multithreading.
<TheGillies> is multithreading the same thing as parallelism in crystal?
<TheGillies> or do threads run on single cpu?
<FromGitter> <akzhan> crystal parallelism is idea that now implemented inside one thread so can use one cpu core. ⏎ ⏎ multithreading extends it to multicore.
<TheGillies> so multithreading == parallelism?
wontruefree has quit [Quit: Is gone... Just plain old gone]
<FromGitter> <akzhan> multithreading is implementation of parallelism on multiple threads
<FromGitter> <akzhan> it’s >=
<FromGitter> <akzhan> one advantage of fibers that you should do approx. nothing to get all advantages of multithreading when it is arrived
wontruefree has joined #crystal-lang
<FromGitter> <akzhan> Just like Golang
<wontruefree> I think I might have disconnected in the last conversation
<wontruefree> does crystal have parallelism now ?
<TheGillies> "multithreading is implementation of parallelism on multiple threads" how can you have parallelism on on thread?
<TheGillies> I'm confused
<TheGillies> on one*
<FromGitter> <akzhan> Crystal supports parallelism based on fibers, but doesn’t consume multiple cores.
<TheGillies> oh
<TheGillies> When I say parallelism I mean multi core support, not concurrency
<FromGitter> <akzhan> You got answer :) Multi core support now in development.
<wontruefree> Ok I always thought parallelism meant execution over multiple cores
<wontruefree> but that is not the case
<wontruefree> and crystal is still single core
<FromGitter> <akzhan> You always can run multiple processes of Server using so_reuseport to utlize all cores.
<TheGillies> akzhan single-msqueue == multithreading?
* TheGillies googles so_reuseport
<wontruefree> ok
<wontruefree> thanks
<FromGitter> <molovo> @TheGillies I built a simple module to help with that last night: https://github.com/molovo/herd
<wontruefree> yeah I get a little term overloaded when it comes to this
<FromGitter> <molovo> And to reuse the port, just pass true as the first argument to `HTTP::Server#listen`
<FromGitter> <akzhan> Yes, looks like https://github.com/crystal-lang/crystal/tree/single-msqueue is most updated multithread branch. And it’s already tested with Kemal.
duck_ has joined #crystal-lang
<FromGitter> <molovo> @akzhan is that multithreading enabled by default, or does it need ‘activating’ through some syntax? If so, can you point me to some documentation?
<TheGillies> molovo that looks cool
<FromGitter> <molovo> @TheGillies there’s nothing to it really, I just don’t like re-writing boilerplate code
<FromGitter> <akzhan> You should do nothing to do multithreading. All behind the scene.
<FromGitter> <molovo> @akzhan That’s awesome. I’m gonna have to try that out
<FromGitter> <akzhan> From end-user point of view.
<TheGillies> I would use that branch but compiling crystal takes forever heh
<TheGillies> I wonder how much faster compiling crystal is with multithreading
<FromGitter> <molovo> Lots, I’d imagine
<FromGitter> <akzhan> it’s another task anyway :)
<oprypin> this change would not affect compiling crystal
<oprypin> semantic phase is hard to parallelize and, well, llvm stuff is probably already parallelized, i would imagine
<FromGitter> <molovo> @akzhan Any idea when that branch is likely to land in stable? Is it a long way off?
<FromGitter> <akzhan> Ask @asterite
<Papierkorb> molovo, it is set to be released until the end of this year
<oprypin> Papierkorb, i don't think it's useful to throw around that deadline
<TheGillies> is it gonna be the big 1.0 flagship feature?
<oprypin> because 1. it's not going to happen and 2. parallelism needs to be in the language for a while before 1.0
<Papierkorb> it's gonna be the big $VERSION flagship feature TheGillies
<TheGillies> oh nice it's planned on going in before 1.0
<TheGillies> I thought I was gonna have to wait
<Papierkorb> well you can give it a whirl right now
<oprypin> it could land any day now but there's little communication about it
<TheGillies> I guess makes sense you can
<FromGitter> <akzhan> 1) 0 anyway be with multithreading, but there is no warranty to be released until EOY
<FromGitter> <molovo> It’s compiling as we speak :D
<oprypin> there's probably a lot of work to make it generally usable
<oprypin> what with the needed modifications to libgc and stuff
bjz has joined #crystal-lang
zipR4ND1 has joined #crystal-lang
<FromGitter> <akzhan> I’m glad that bdwgc supports multithreading properly (by README)
zipR4ND has quit [Ping timeout: 255 seconds]
<FromGitter> <akzhan> btw - https://github.com/crystal-lang/crystal/commit/7f756b7a0444066d61a4028fe70b7009bfc8c4d1 - some steps will be parallelyzed. ⏎ ⏎ but not biggest sematic phase, as @oprypin said.
<TheGillies> Is there a test I could do to see if it's actually multithreaded?
<TheGillies> I mean I believe it, just curious
<FromGitter> <akzhan> I hope that you will not have the opportunity to know :)
<TheGillies> ?
<FromGitter> <akzhan> Best implementation of multithreading - when you don’t know about :)
<TheGillies> oh righto
<TheGillies> I guess I could just do busywork and look at htop
<FromGitter> <akzhan> yes
<TheGillies> multithread branch not building for me :)
<TheGillies> er :(
<FromGitter> <akzhan> :-/
wontruefree has quit [Quit: Is gone... Just plain old gone]
<FromGitter> <akzhan> Btw, you need any framework that aware of multithreading, but i have not seen that branch on kemal repo. @sdogruyol knows.
<crystal-gh> [crystal] timsu opened pull request #4448: CSV#each_row add support for separator, quote_char (master...170522-csv) https://git.io/vHIDX
<FromGitter> <ixti> how much RAM does it requires to compile crystal-lang compiler?
<FromGitter> <akzhan> It’s compiled on 8Gb MacBook, I didn’t check memory consumption.
<FromGitter> <ixti> Hmm... failed for me when i was compiling on my laptop with 8GB
<FromGitter> <akzhan> it’s built on MacBook 12» too.
<FromGitter> <ixti> trying again (with nearly no apps running) hope this time will work :D
<FromGitter> <akzhan> brew install llvm-4.0 etc.
<FromGitter> <ixti> I'm not using brew :D
<FromGitter> <akzhan> try to install llvm 4.0 separately.
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <akzhan> it’s `brew install llvm-hs/homebrew-llvm/llvm-4.0z but you can do it any own way
<FromGitter> <ixti> mm.. I have it installed. although it's a older
<FromGitter> <ixti> 1) 9.1
<FromGitter> <akzhan> You ran make on crystal. 4Gb eaten
<FromGitter> <akzhan> Strange but it finished too fast. ( make clean && make )
<FromGitter> <ixti> in fact I just realized that I could have been compiling kernel in parallel when it failed...
<FromGitter> <akzhan> )))
<FromGitter> <akzhan> it’s like 1.2Gb per compiler
<FromGitter> <ixti> So far it's about 5Gb taken for me by compiler
<FromGitter> <akzhan> built less than I wrote previuos phrase
<FromGitter> <akzhan> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5923663cc4d73f445ad31e65]
<FromGitter> <ixti> akzhan: thanks
<FromGitter> <ixti> somehow i didn't even read why it failed and raised issue in bugtracker of funtoo linux... and got response that ebuild was compiled successfully on 48Gb box... So I was a bit confused ;))
<FromGitter> <ixti> but now, i'm pretty sure I had to at least not try compile multiple things at once :D
<FromGitter> <ixti> heh... failed again
<FromGitter> <akzhan> there are 1.1Gb allocated only as written in log
<TheGillies> >> System.hostname
<DeBot> TheGillies: # => "playpen" - https://carc.in/#/r/229p
<FromGitter> <bew> @Papierkorb I was talking about having a common methods/service/remote-rpc-executor interface for several (de-)serializers
<Papierkorb> could work for de/serializers, for RPC, not so much
<Papierkorb> RPC is highly specific to the protocol and then how it's implemented
<TheGillies> Whats the difference between a string pool and something like :"this is a string"
<Papierkorb> The latter is not a string, it's a Symbol
<TheGillies> Is that ever going to matter?
<FromGitter> <bew> Hmm I've only looked at your cannon-rpc, json-rpc & msgpack-rpc system.. And they seemed to be a lot of similarities, but I may be wrong (and I'm not even talking about HTML or 0MQ, for which I know I'm wrong, because I don't know them, and I never *used* rpc stuff too..)
<TheGillies> Like I don't get when I would use a string pool vs just symbol.to_s
<FromGitter> <bew> TheGillies yes because all symbols are known at compile time
<FromGitter> <bew> (and replaced by numbers iirc)
<TheGillies> ah
<FromGitter> <bew> Also, there is no `Symbol#to_s` atm
<TheGillies> what?
<TheGillies> >> :"foo bar".to_s
<DeBot> TheGillies: # => "foo bar" - https://carc.in/#/r/229u
<FromGitter> <bew> Ah, it appears I mixing stuff... Need some sleep...
<TheGillies> Does the stuff I pass to a maco have to be valid ruby?
<TheGillies> er crystal
<TheGillies> weird => isn't a valid macro name
<TheGillies> I guess that would break hashes
<TheGillies> ah it wants a CONST or iDENT
<TheGillies> not sure what an IDENT is
duck_ has quit [Quit: leaving]
<FromGitter> <bew> A macro's arguments must be parsable, not necessarily valid (semantically)
zipR4ND1 has quit [Ping timeout: 240 seconds]