ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.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
hightower3 has joined #crystal-lang
hightower4 has quit [Ping timeout: 248 seconds]
<cerulean> just implemented theme changing support on livepost https://livepost.mixflame.com
<cerulean> you guys might get an idea of how i did it and implement on your own site
<cerulean> if not feel free to ask
<RickHull> this doesn't work for me -- there is no form input https://livepost.mixflame.com/chatroom
<RickHull> just a big textbox or whatever for the history
<RickHull> oops, nevermind. the big gray bar on the bottom is apparently the text input
<RickHull> styling / layout could use some work. maybe I need to change theme? ;)
<cerulean> lol yup
<cerulean> themes are only colors right now, that chat is rather new.. i know it needs help
<cerulean> it will get better and nicer, i work on it every day
<RickHull> screenshot: https://imgur.com/a/Q80j9
<FromGitter> <hermanzdosilovic> @RickHull ~ $2 :P
<cerulean> oh.. that's browser specific. that shouldn't be there
<cerulean> the scrollbar
<RickHull> the closest I ever got to Croatia was Czech Republic and beer at the time was something like $0.30 but that was over 15 years ago. Here it's about $6 these days
<RickHull> here=USA
<RickHull> cerulean: screenshot is Chrome/Win7
<crystal-gh> [crystal] MakeNowJust opened pull request #5075: Parser: add missing escape sequence for Char (master...feature/add-missing-escape-sequence-for-char) https://git.io/vdlHx
<cerulean> strange
<cerulean> chat should work despite the rogue scrollbar tho
<RickHull> yes, it works. my main complaint is that the text input was nonobvious
<RickHull> the chat history styling/layout needs work
<RickHull> but actually, your text input in this case matches http://webchat.freenode.net/ pretty closely
<RickHull> and that works fine for me
<RickHull> but in the freenode case, the chat history is not divorced from the text input which is what makes it obvious and usable
<cerulean> oh, I see what you're saying. I'll make a ticket, thanks! :D
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 260 seconds]
pduncan has joined #crystal-lang
<FromGitter> <jwaldrip> Good evening all.
<FromGitter> <jwaldrip> So anything happen today regarding an upcoming release, or are things still in a mysterous state?
pduncan has quit [Ping timeout: 246 seconds]
DTZUZO has joined #crystal-lang
<cerulean> wasn't aware something was up
<FromGitter> <jwaldrip> Just seems like we get close and other things come up. I saw the PRs needed get merged today but no indicator of a release.
alex`` has joined #crystal-lang
early has quit [Quit: Leaving]
early has joined #crystal-lang
alex`` has quit [Ping timeout: 246 seconds]
olbat has quit [Ping timeout: 240 seconds]
<FromGitter> <Rinkana> Morning :)!
snsei has joined #crystal-lang
<FromGitter> <jasonrobot> Hey, question: What's the tool that crystal uses to build documentation?
<FromGitter> <Rinkana> Its an internal tool. Can be run with `crystal docs`
<FromGitter> <jasonrobot> sweet thanks!
<FromGitter> <jasonrobot> kinda wondering if it might be possible to modify it to insert the interpolated return types into method docs. Do you have a link to the code of the tool? I'm honestly having a hard time googling it
<FromGitter> <Rinkana> Yeah that documentation is still somewhat lacking i guess. But the main tool file is this: https://github.com/crystal-lang/crystal/blob/master/src/docs_main.cr
<FromGitter> <Rinkana> But that's just a list of includes
<FromGitter> <Rinkana> There is this documentation: https://crystal-lang.org/docs/conventions/documenting_code.html
<FromGitter> <jasonrobot> Ya, I've found that second link there, dunno if the first one will me of much help.
<FromGitter> <jasonrobot> My thing right now is that I'm messing with the DB module, and I keep forgetting the class of object that DB.open returns. The source code doesnt specify, and that function calls off to another method, so I keep having to search around for the actual return type, even though I know the compiler can figure it out.
<FromGitter> <jasonrobot> I was thinking it would be cool if the doc tool could leverage the type inference algorithm in the compiler to document the return types even if the people who wrote the library didn't specify it explicitly
<FromGitter> <Rinkana> Ah i see
<FromGitter> <jasonrobot> and I'd love to help Crystal lang out, so I thought I'd take a crack at it. I'm enjoying the hell out of this thing, for real
snsei_ has joined #crystal-lang
snsei has quit [Read error: Connection reset by peer]
<FromGitter> <jasonrobot> Thanks! That's the one I was looking for. Ya, no combination og "crystal docs tool" or anything like it I could google was coming up with the code for the tool.
<FromGitter> <crisward> I find you have to search for "crystal-lang", a bit like you have to with go. Otherwise you just get lots of hippy dippy crystal weird stuff.
<Groogy> Morning
<Groogy> Hmm curious on the doc tool, would it be possible to write addons to it?
<Groogy> i.e have my contracts auto document methods?
<FromGitter> <bew> @jasonrobot what you ask (documented return types) are not that simple to get: sure the compiler can find all the types when you call a method, but I don't know how it could find them on a method that is not called by anything.. do you see what I mean? The type inference engine deduct the return type(s) based on the "input types, generic types" and the context if the call. When there is no call, no type context, I
<FromGitter> ... think there is no way to find the return type. (Well I think there could be I've, but it's reaally hard)
<FromGitter> <bew> Groogy, one day probably, not sure there is an issue about that yet
mark_66 has joined #crystal-lang
<Groogy> well I need to get back on my project and work on that before I do those niceties :P
<Groogy> but I want to support that in the long run and have it generate "this argument accepts only objects that are blah blah"
<FromGitter> <bew> That would be nice!
alex`` has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
<FromGitter> <jasonrobot> @bew Actually, that makes a lot of sense. I had also been wondering for a while about similar things in my code - I'll occasionally have some methods that I write half way, and should have errors, but that the compiler doesnt complain about. I thought it would check these things regardless of whether or not they were called, but I can see how that might not be. Thanks for the info!
RickHull has quit [Quit: Page closed]
<FromGitter> <bew> You're welcome ;)
Papierkorb_ has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 264 seconds]
rohitpaulk has joined #crystal-lang
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vd8IW
<crystal-gh> crystal/master 17ac8a2 Johannes Müller: Improve decoding of HTML entities (#5064)...
<FromGitter> <Rinkana> I currently have this Rails-y code setup: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ However it does not feel like the best way for Crystal. Does anyone have toughts on improvements? [https://gitter.im/crystal-lang/crystal?at=59d49dd3b59d55b8236f4c5a]
rohitpaulk has quit [Ping timeout: 246 seconds]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
claudiuinberlin has joined #crystal-lang
<travis-ci> crystal-lang/crystal#17ac8a2 (master - Improve decoding of HTML entities (#5064)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/283096490
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Read error: Connection reset by peer]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
snsei_ has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<Groogy> Rinkana what are you trying to do?
rohitpaulk has joined #crystal-lang
DTZUZO has quit [Read error: Connection reset by peer]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
rohitpaulk has quit [Ping timeout: 258 seconds]
rohitpaulk has joined #crystal-lang
Philpax has joined #crystal-lang
<crystal-gh> [crystal] asterite closed pull request #5075: Parser: add missing escape sequence for Char (master...feature/add-missing-escape-sequence-for-char) https://git.io/vdlHx
<FromGitter> <Rinkana> Groogy, `ModA` is a basic library and `ModB` is the actual application. But both need to have the same interface to talk to so they both can call `test_prop` from any place from any of the modules
<Papierkorb_> What's the actual issue you're facing Rinkana? Or, what feels "off"?
ShalokShalom_ has joined #crystal-lang
<Papierkorb_> That small pseudo-sample alone doesn't show enough of the whole picture
<FromGitter> <Rinkana> It feels off to store the class into the module an reference that.
<FromGitter> <Rinkana> I'm thinking there should be some sort of intermediate class. But i can't imagine a functionally better method
<Papierkorb_> The biggest thing that sticks out to me is the use of singletons
ShalokShalom has quit [Ping timeout: 248 seconds]
<Papierkorb_> If you need an interface, so that the application code can provide logic to the library code, use a module with abstract defs
<Papierkorb_> (Or def's if there are reasonable default implementations of course)
<Papierkorb_> Or real base class to inherit from, like you already do with `App`.
<Papierkorb_> But I think the biggest issue is the singleton entanglement, which can lead to funny ("interesting") dependencies
<FromGitter> <Rinkana> Hmm, i see. i don't think that this will have those dependancy issues as `ModB` in this case will always be the entry point of the application. It can't be used next to something
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
claudiuinberlin has joined #crystal-lang
nikkkk has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
claudiuinberlin has joined #crystal-lang
alex`` has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] asterite opened pull request #5076: GitHub issue template: redirect users to Google Groups, Stack Overflow, etc. (master...feature/github-issue-template) https://git.io/vd86f
ShalokShalom_ has quit [Quit: No Ping reply in 180 seconds.]
ShalokShalom has joined #crystal-lang
rohitpaulk has joined #crystal-lang
nanophate has joined #crystal-lang
nanophate has quit [Ping timeout: 260 seconds]
rohitpaulk has quit [Ping timeout: 246 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
rohitpaulk has joined #crystal-lang
sz0 has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Papierkorb_ has quit [Quit: Konversation terminated!]
<RX14> anyone notice that we currently have 9999 commits on master?
<RX14> next PR merged gets 10k :)
<FromGitter> <bararchy> That's cool , let's hope 10k = 0.24 ;)
rohitpaulk has quit [Ping timeout: 246 seconds]
<FromGitter> <jwaldrip> You cant currently type macro arguments right?
alex`` has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter> <bew> 9999 commits and 42 branches!
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
claudiuinberlin has joined #crystal-lang
jlfr has joined #crystal-lang
<FromGitter> <bew> @jwaldrip what do you mean? restrict macro with type restriction? (like `macro bla(node : NumberLiteral)`?)
jlfr has quit [Client Quit]
<FromGitter> <sdogruyol> wow
rohitpaulk has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] asterite closed pull request #5076: GitHub issue template: redirect users to Google Groups, Stack Overflow, etc. (master...feature/github-issue-template) https://git.io/vd86f
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
olbat has joined #crystal-lang
olbat has quit [Changing host]
olbat has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 258 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <jose-rodrigues> C'est fait
claudiuinberlin has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 258 seconds]
mark_66 has quit [Remote host closed the connection]
<FromGitter> <monouser7dig> good evening, reading crystal docs again, skimming through issues, the last Ama session, I wanted to ask if there is any further information on threading? The Ama session had some information that said it was kind of working on linux but not at all on Mac and the release would be about a year ahead? So is it like thread will actually take a year (probably)?
sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter> <monouser7dig> and another question: how do you build crystal versions for yourself? I had some conversation today about the home-brew formula because it was broken for HEAD builds, now one issue is gone but another came up, do you just use the makefile in the repo?
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
<FromGitter> <drosehn> I suspect it isn't too hard. At one point I 'git clone'd the github repository and was able to build it on MacOS (Yosemite) without too much trouble. I don't remember the details, right now, but I assume that it couldn't have been too hard. I am a "macOS developer" of sorts, but I'm certainly not an expert at it. And I'm *very* far away from being an expert at building compilers!
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <mixflame> any i18n recommendations for a Crystal/Amber web app?
claudiuinberlin has joined #crystal-lang
<FromGitter> <monouser7dig> build from source using home-brew works just fine anyway but I am not actually suspecting the crystal team, I was just trying to install the latest version cause someone said it was not hard to compile crystal (which is actually true, it does not take long at all)
<FromGitter> <mverzilli> Hi! You can follow the instructions here: https://github.com/crystal-lang/crystal/blob/master/CONTRIBUTING.md
<FromGitter> <mverzilli> that explains different ways to build from master depending on what parts of Crystal you want to tinker with
<FromGitter> <monouser7dig> @mixflame ⏎ https://github.com/amberframework/amber/issues/56https://github.com/akzhan/crystal-cldr ⏎ as a beginning? maybe a good way to contribute a bit and learn something more about it (maybe it just works fine for you though) [https://gitter.im/crystal-lang/crystal?at=59d51facbac826f054356664]
<FromGitter> <mixflame> thanks @monouser7dig
rohitpaulk has joined #crystal-lang
<FromGitter> <monouser7dig> okay so basically make, I am probably not yet in a position where I can actually do something to the compiler (programming simple state machine and simple parser is ok but..) but was wondering how I could build the master just to know.... homebrew fails if the specs fail so if you want to build the latest master which might have some issues it seems to be better to use make instead of homebrew HEAD
<FromGitter> <drosehn> Seems perfectly reasonable thing to try. If I had a bit more time to spare, I'd probably try to keep a version built from HEAD branch in the crystal repository. Although homebrew is getting pretty good, too.
<FromGitter> <drosehn> "homebrew in general", I mean. I used to have a lot of problems with it, but it has gotten much better in the last year or two.
<oprypin> monouser7dig, the problem is that you need to have Crystal already available, and use that to build master with `make`
<FromGitter> <monouser7dig> yes I can use the tar from the website https://crystal-lang.org/docs/installation/from_a_targz.html
<FromGitter> <monouser7dig> just some experiments with crystal, such a relief compared to java
<FromGitter> <mixflame> @monouser7dig have you used CLDR? can you give any information how to use it? the repo is bare of instructions, if I can figure it out I'll provide a pull request with a README
<FromGitter> <monouser7dig> @drosehn for binaries it is actually really good, the only bad thing is that once you uninstall sth. it does not remove its dependencies and there is no solid way of getting all these `leftovers`, there was an attempt but did not get merged, I took a look at their code but all that DSL stuff without proper documentation was just too much for me (others seem to perfectly fine with it I guess)
<FromGitter> <monouser7dig> @mixflame best bet is to look at the spec and see how the author intends the library to be used or look for information on https://github.com/unicode-cldr/cldr-json which is the base of that
<FromGitter> <mixflame> bahut bahut shukriya!!! :D
<FromGitter> <mixflame> (thanks)
<FromGitter> <monouser7dig> still questioning how the progress on threads is, cause it is always named as the nr1 goal for 1.0 and progress since end of april seems kind of stopped (at least the one we can see from the outside)
<Papierkorb> Last thing I heard was that the core team was working on it
<Papierkorb> Nothing more detailed. But, I also haven't taken a look at what's public yet either
<FromGitter> <monouser7dig> I looked at two branches (I just looked at the dates to be honest) and the wiki
<FromGitter> <monouser7dig> there are build instructions as well but it is probably not worth yet
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
<FromGitter> <drosehn> Note that good support for threads is not some easy task. It's going to take some significant and careful work to get it right.
<Papierkorb> Yeah, getting it to work is kinda easy. Getting it right is the polar opposite.
<FromGitter> <monouser7dig> sure it is not easy but that is why we study I guess, these people definitely put much more time into the project than they get paid that is for sure too, nevertheless some continuous work would be ... encouraging?
<FromGitter> <drosehn> For all I know they're doing all kinds of continuous work, but they don't want to 'commit' any changes publicly until they're confident that what they have is working right. Would I *like* to see more activity there? Sure. But I'm not surprised that it is taking a lot time to do that.
<FromGitter> <monouser7dig> yes makes some sense
<FromGitter> <monouser7dig> the communication strategy of crystal overall is really nice IMO though, ⏎ like the post in the wiki about the compiler etc. at least they try to document what they are doing and all people so far seemed really honest (up to point where saying "I don't know how to do it either" is perfectly fine) not sure I've seen this so far much elsewhere
Groogy2 has quit [Ping timeout: 240 seconds]
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <monouser7dig> (comparing this to homebrew e.g. many commits have no description at all/ are discussed in some ingroup and issues are closed after 20 days automatically)
<FromGitter> <HCLarsen> Got Crystal working on a Raspberry Pi, sort of.
<FromGitter> <HCLarsen> Question though, when you compile with the --release option, should the executable really be so big?
<Papierkorb> define big
<FromGitter> <HCLarsen> 1mb executable for a single line of a code, ie puts "hello world."
<oprypin> how is that big
<FromGitter> <HCLarsen> You don't find 1MB to be big for outputting a single line of code?
<Papierkorb> HCLarsen, that size stems from that the program has linked in a ton of libs that normal programs will need to function
<Papierkorb> HCLarsen, that Hello World program you wrote is capable of interacting with libevent, which is used for all I/O things
<Papierkorb> (* for most I/O things)
<FromGitter> <HCLarsen> So the compiler included one big library just because I used an output function?
<Papierkorb> HCLarsen, on top of that, the binary comes with a DWARF section for stracktrace generation
<Papierkorb> That output function that uses STDOUT, which is I/O, hence, libevent
<FromGitter> <HCLarsen> I'll be honest, the only DWARF I know about is Gimli, so I'll take your word for it.
<Papierkorb> Ever wondered how a debugger knows in "which file" an exception occured? That's how
<FromGitter> <HCLarsen> That helps.
<FromGitter> <HCLarsen> It's been over a decade since I've worked with a fully compiled language, so I guess I've got a learning curve to understand some of this.
<FromGitter> <HCLarsen> Mostly I'm glad the Raspbian package worked. It installed with a warning that it wasn't authenticated, but if it works, I'm happy.
<FromGitter> <crisward> I've just tried a hello world on my mac, and its only 256kb
<FromGitter> <HCLarsen> Maybe it's an OS thing.
<FromGitter> <pawandubey> For comparison, Go hello world binaries are typically twice that size for a hello world program. (last time I checked, anyway)
<FromGitter> <crisward> 211kb with --no-debug
Groogy2 has joined #crystal-lang
<Papierkorb> hello world with --release comes down to 392KiB for me
<FromGitter> <HCLarsen> @crisward , did you also use hte --release flag?
<FromGitter> <crisward> yes
<FromGitter> <crisward> 211kb with --no-debug flag too
<Papierkorb> 177KiB with --release --no-debug on Linux/x64
<FromGitter> <crisward> Not sure this actually helps anyone though...
<FromGitter> <HCLarsen> Must be a Raspbian thing then. I haven't tried it on my Ubuntu install yet. With the --release flag it was 1MB, and without that flag, it was 1.5MB.
<Papierkorb> Considering that hello world really is a whacko case, that size is acecptable
<FromGitter> <HCLarsen> Well, I will listen to the voices of experience.
<Papierkorb> HCLarsen, I have a simple HTTP caching proxy for a slow API for testing at work. That process uses 2.4MiB of residential memory, which is less than zsh uses. So even for small real-world programs it's not an issue :)
<FromGitter> <crisward> Rasberry pi is pretty limited if you're working from a small sim card though.
<FromGitter> <HCLarsen> Sim card, or flash card?
<FromGitter> <crisward> erm... flash card...
<FromGitter> <HCLarsen> Just wanted to check.
xiljin has joined #crystal-lang
<FromGitter> <crisward> what are compile times like on you pi?
<FromGitter> <HCLarsen> Yeah, I know it's limited, but considering how quickly you can reinstall the OS from scratch, it's a great way to play around with things that you're new to.
<FromGitter> <HCLarsen> It actually took a fair bit to compile that tiny program, so it's not pretty.
xiljin has quit [Client Quit]
<Papierkorb> HCLarsen, virtual machine?
<FromGitter> <crisward> I agree, they're fun little things.
<FromGitter> <HCLarsen> I have an Ubuntu virtual machine as well. I've done a little bit of Crystal on that one.
<FromGitter> <crisward> I've got one in my cupboard gathering dust... when I last messed with it I just kept crashing it.
<FromGitter> <crisward> I did have it plugged into a 42 inch tv though
xiljin has joined #crystal-lang
<FromGitter> <HCLarsen> Yeah. I've got one plugged into my TV, which I use as a dev machine/torrent server.
<FromGitter> <HCLarsen> Another one is part of an IoT project that I made in Ruby, and am hoping to rewrite in Crystal.
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xiljin has quit [Client Quit]
<FromGitter> <crisward> Sounds cool.
claudiuinberlin has joined #crystal-lang
<FromGitter> <HCLarsen> Yeah. With Ruby, the libraries I needed already existed, so with Crystal, it's going to be a bigger challenge.
<FromGitter> <OldhamMade> do I need any special flags for building with `--release` on OSX? builds are never successful for me with that flag.
<FromGitter> <crisward> What kind of things to you need to do?
<FromGitter> <crisward> @OldhamMade try using --no-debug too.
<FromGitter> <crisward> You're possibly using a release, where --release was broke.
<FromGitter> <crisward> You should be on 0.23.1-1
<FromGitter> <OldhamMade> @crisward amazing -- didn't think to try that!
<FromGitter> <OldhamMade> yeah, I'm on 0.23.1
<FromGitter> <HCLarsen> Visual interface(I used GTK in Ruby), fetching data from OpenWeatherMap or Wunderground, a way to access data from iCal, and a way to stream internet radio.
xiljin has joined #crystal-lang
xiljin has quit [Client Quit]
<FromGitter> <crisward> fetching data is possible with crystals http client. Processing ical data isn't too bad, the format is plain text. However processing all the logic can be a pain. Not sure about streaming internet radio.
<FromGitter> <HCLarsen> The thing about processing iCal data is that it's stored in iCloud, and I can't seem to find any direct API interface for developers to use.
<FromGitter> <HCLarsen> The weather data is likely where I'm going to start, since it should be the easiest to implement.
nikkkk has quit [Quit: Textual IRC Client: www.textualapp.com]
<FromGitter> <crisward> What about google calendar. There api's are really nice and the data is in json. I'm doing it here with crystal - https://www.duodesign.co.uk/contact/arrange/
<FromGitter> <HCLarsen> I don't use Google services.
<FromGitter> <crisward> You can also run you own ical server, ical is run on webdav. I think apples server is open sourced.
<FromGitter> <HCLarsen> Really? Hmm. That's an idea.
<FromGitter> <HCLarsen> I wonder if I could run that on my Pi, then it's all right there.
<FromGitter> <crisward> https://www.calendarserver.org/
<FromGitter> <crisward> I'm pretty sure this is what they ship with apple server. Only with a nice gui, which you don't get on the free version.
<FromGitter> <HCLarsen> If I could set my iPhone and Mac to interface with my own server, then I should be able to get my Pi to interface with it too.
<FromGitter> <crisward> Good luck... sounds like the kind of project you'll loose a lot of time to.
<FromGitter> <HCLarsen> The Ruby version also took a lot of time, but I learned so much doing it.
<FromGitter> <mixflame> has anyone done WebRTC with crystal?
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <crisward> WebRTC is browser to browser, why would you want to do it with crystal?
<Papierkorb> Why not for bridging?
<Papierkorb> I'm pretty sure that discord and friends don't connect directly browser to browser
<Papierkorb> ah, scratch the "pretty sure"
<Papierkorb> "I'd be surprised if they did" is more accurate
claudiuinberlin has joined #crystal-lang
<FromGitter> <crisward> WebRTC when used browser to browser has an issue when you go over a certain number of connections, each client has to connect to all the other clients so doesn't scale too well. I think you need to create servers to manage the distribution of duplicate data.
<FromGitter> <crisward> I messed with webrtc few years ago, I created a 4 way video conference chat app which turned my mac air into a hovercraft.
<FromGitter> <crisward> Think the most compelling use I've seen for it is web torrent clients.
<Papierkorb> You mean, you built a video chat drone? Ahead of your time!
claudiuinberlin has quit [Client Quit]
<FromGitter> <crisward> We built a collaborate presentation tool too, trouble is webrtc doesn't make sense for many use cases. Not sure if it's changed, but it wasn't ios friendly at the time which prevented it being developed further.
<Yxhuvud> ah, reading https://swift.org/blog/dictionary-and-set-improvements/ and wondering why they didn't steal more from ruby/crystal. many of the solutions seems so .. ad hoc.
<FromGitter> <monouser7dig> @HCLarsen https://forums.docker.com/t/building-image-on-mac-to-run-on-rpi/12082/4 ⏎ crystal in docker is already available maybe sth. like this would speed up the workflow
<FromGitter> <crisward> I messed with swift last year.. they're really not scared about breaking the language api on every release. Struggled to get many open source libs to work at the time. Think a new version had just come out. For web use I'd consider pre v1. Unless its stabilised recently.
<Yxhuvud> well, apple in a nutshell.
<FromGitter> <raydf> Hi everyone
<FromGitter> <monouser7dig> ```code paste, see link``` ⏎ ⏎ if it reads more like English than actual code, I do not feel comfortable, cause indeed it is not English and never will [https://gitter.im/crystal-lang/crystal?at=59d54264f7299e8f53ab4ecb]
<FromGitter> <crisward> Is that swift or objective c?
<FromGitter> <mixflame> @crisward I'm implementing calls in My app, LIvePost
<Yxhuvud> monouser: compare to groceries.group_by &.department
<FromGitter> <raydf> i'm having a problem with the http::client namespace
<Yxhuvud> crisward: it was an example from the link I posted
<FromGitter> <raydf> i'm trying to do something like this ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59d542d5177fb9fe7e3c869d]
<FromGitter> <OldhamMade> qq; i've got deployments happening with docker from travis-ci. works fine, but I'm building the release version in the docker file itself. my understanding is that I should be able to build the release on travis, copy just the build file to the docker container, and run it from there... is that correct?
<FromGitter> <raydf> I'm receiving file descriptors errors
<FromGitter> <monouser7dig> @FromIRC yes thanks, reads a lot smoother
<FromGitter> <raydf> Is there any example of calling HTTP::Client and waiting for the response from the IO?
<Yxhuvud> monouser: Yes, it reads even smoother, but it is still very much english. it is just .. better english.
<Yxhuvud> (arguable)
<Papierkorb> raydf, according to the docs, .exec will block https://crystal-lang.org/api/0.23.1/HTTP%2FClient.html#exec%28method%2Curl%3AString%7CURI%2Cheaders%3AHTTP%3A%3AHeaders%3F%3Dnil%2Cbody%3ABodyType%3Dnil%2Ctls%3Dnil%29%3AHTTP%3A%3AClient%3A%3AResponse-class-method
claudiuinberlin has joined #crystal-lang
<Papierkorb> Swift: `cart.merge(otherCart, uniquingKeysWith: +)` uniquing for president
<FromGitter> <bew> @raydf you probably want `HTTP::Client.post`
rohitpaulk has quit [Ping timeout: 260 seconds]
<Yxhuvud> Papierkorb: uniquing i a funny word. Hmm. Doesn't merge take a block in crystal? At least in ruby, hsh.merge(b: 1, c: 2) {|key, x, y| x + y} works fine
<Papierkorb> Same over here
<FromGitter> <raydf> thanks @Papierkorb
<FromGitter> <raydf> thanks @yxhuvud
<Yxhuvud> huh, what did I do? :)
<FromGitter> <raydf> sorry
<FromGitter> <raydf> thanks @bew
<FromGitter> <raydf> :)
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
<FromGitter> <monouser7dig> @OldhamMade so you build in docker and copy the final product out of your docker container, like a piece coming out of a mold?
<FromGitter> <OldhamMade> @monouser7dig in the Dockerfile I'm copying all the project files to the container and building with `--release` as one of the steps.
<FromGitter> <monouser7dig> in theory this should work with cross compiling even without docker I think? https://crystal-lang.org/docs/syntax_and_semantics/cross-compilation.html
<FromGitter> <OldhamMade> I just wanted to confirm whether it's possible to build outside of the Dockerfile build steps and copy the final binary across to the container to be run
<FromGitter> <OldhamMade> and, if so, what I'd need to do to achieve this
<FromGitter> <OldhamMade> ah, I see. I'll give that a try. thanks! :)
<FromGitter> <monouser7dig> propably issues with libraries that your Mac install assumes to be present but pi has not arise
<FromGitter> <OldhamMade> yeah, I can see that it's looking for some paths that don't exist. I think I should be able to provide the correct ones for the container though.
<FromGitter> <OldhamMade> hmm, nope, doesn't look like it'll play ball... ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59d54c21b59d55b8237377f6]
<FromGitter> <monouser7dig> `FROM crystallang/crystal:0.19.2` how do they not specify a distro as a base?
<Papierkorb> Because they're inheriting from a pre-made image with crystal already included?
<Papierkorb> 0.19 is super old though
<FromGitter> <OldhamMade> thanks @monouser7dig -- I've got it building fine in a Docker container running alpine, comes out at around 275mb. the crystallang one is around 700mb iirc as it's running ubuntu
<FromGitter> <OldhamMade> I was just wondering, really. would be nice to get a tiny alpine image with just the essentials running in the cloud. :)
<FromGitter> <monouser7dig> what alpine based container did you use? maybe I'll try
<FromGitter> <monouser7dig> if you got it building it should run? or was the error data from that exact container?
<FromGitter> <OldhamMade> this is what my alpine Dockerfile looks like: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59d54d52614889d47576ad74]
<FromGitter> <monouser7dig> and this runs without error or with the error you provided? 😄
<FromGitter> <OldhamMade> the error comes from changes which look like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59d54d99e44c43700af4b1b0]
<FromGitter> <OldhamMade> 1st one -- runs fine. 2nd one -- throws the error
<FromGitter> <OldhamMade> wait...
<FromGitter> <OldhamMade> yep, that's right. the `RUN cc` line is where it fails.
<FromGitter> <monouser7dig> and where does test.o come from? not build in the docker, right?
<FromGitter> <OldhamMade> no, that comes from running `crystal build --release --no-debug src/test.cr --cross-compile --target "x86_64-unknown-linux-gnu"` on my mac
rohitpaulk has joined #crystal-lang
<FromGitter> <OldhamMade> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59d54ef5b20c642429c35a3e]
<FromGitter> <monouser7dig> yes ok so guess all makes sense, cross compilation may just not be the easiest thing 😄 `"x86_64-unknown-linux-gnu"` I hardly believe is a valid flag for llvm so I am surprised you did not get an error here, at least it is nice to have a working docker image for compilation and running
<FromGitter> <monouser7dig> ..... but it is no problem to now get that prebuild docker image deployed on a pi is it? so the pi basically has a docker running alpine which executes crystal
<FromGitter> <OldhamMade> yep -- I'm very happy with the 275mb size. I'll keep playing with it, if I get any success I'll pop another message in here.
<FromGitter> <OldhamMade> I'm not running this on a pi, I'm running it in the cloud
<FromGitter> <monouser7dig> I think this would very well be worth a writeup if time and joy comes together just because building crystal on a pi is not a good use of time 😄 pi...cloud...runs anywhere hopefully ✨
<FromGitter> <OldhamMade> well, that was easy... just needed to set the target to `x86_64-alpine-linux-musl`
<FromGitter> <OldhamMade> and copy across any static files
<FromGitter> <OldhamMade> (I'm using kemal)
<FromGitter> <OldhamMade> is there a way I can bundle the static files in with the binary? just so I only have to worry about a single-file for deployment
<FromGitter> <bew> yes it's possible! I know RX14 recently did a full static compiler
<RX14> that's not what @OldhamMade is asking
<RX14> he's asking if he can put web assets in the executable, for example
<FromGitter> <bew> ah sorry I mis-understood then
<FromGitter> <bew> ooh I see (I won't be of any help here)
<FromGitter> <OldhamMade> @bew yep, apologies, should'be been more clear
<RX14> i swear there was a shard around
<RX14> but i cant find it
<FromGitter> <bew> somethign about virtual filesystem?
<oprypin> RX14, yeah it's really hard to find it
<oprypin> baked fs is how i remember it
<RX14> ohh
<RX14> there it is
<RX14> i was googling embedded
<RX14> it's a bad impl right now though, i think
<RX14> i should PR slice literals
<RX14> which would make it much more sane
<oprypin> RX14, :) :) :)
<FromGitter> <bew> for sure :D
<RX14> please don't expect me to do it
<RX14> or even remember it more than 5 minutes
<oprypin> RX14, what do you mean
<FromGitter> <OldhamMade> @RX14 thanks!
<oprypin> i'll ping you every week
<RX14> haha
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<oprypin> wow this is insane indeed
<oprypin> runs a crystal process that runs a cat process thru a b64encode process
<oprypin> and honestly the bytes literal alone wouldnt change much
<FromGitter> <bew> @RX14 any way you can validate and merge this? #5050 it's cluttering my local repo for almost no reason :D
<RX14> done
<oprypin> bew, someone wants to be 10000
<crystal-gh> [crystal] RX14 closed pull request #5050: string: Fix typo in documentation of `*` (master...string-fix-doc-typo) https://git.io/vdm98
<oprypin> he's done eet
<FromGitter> <bew> RX14 ty!
<RX14> congrats on the 10000'th commit to crystal
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <bew> I forgot about that x) cooool ;)
<RX14> put it on your CV :)
<FromGitter> <bew> oh yeah that I'll do :p
<Papierkorb> Wait, Commit #10k in issue #5050
<RX14> yup
<RX14> numerical coincidences
ragmaanir has joined #crystal-lang
<FromGitter> <georgeu2000> What is a good way to share a variable across specs? ⏎ ⏎ ```it "works" do ⏎ get "/" ⏎ ⏎ expect( last_response.status ).to eq 200 ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=59d55d0bb59d55b82373cba5]
<travis-ci> crystal-lang/crystal#22efba4 (master - string: Fix typo in documentation (#5050)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/283409361
<FromGitter> <bew> why not simply return it from `get`?
<FromGitter> <bew> a module is stateless, it has no variable..
<FromGitter> <bew> @georgeu2000 ^
<FromGitter> <georgeu2000> I wanted to follow the Rack::Test convention...
<FromGitter> <georgeu2000> I guess I can have a class to manage "globals" in the test environment...
<FromGitter> <georgeu2000> And learning how to use Crystal...
<FromGitter> <bew> maybe that's simply not how you should do that in crystal
<FromGitter> <bew> you shouldn't have globals in your program and especially not in tests
<FromGitter> <georgeu2000> OK thanks.
<FromGitter> <bew> (I think, maybe there are valid usecases that I don't know)
<FromGitter> <pawandubey> Can you do it in `before_each`? I haven't tried it but I think `before_each`/`after_each` are for that very reason, no?
<FromGitter> <georgeu2000> OK, I'll try that.
<FromGitter> <georgeu2000> It's not really a global. It is just shared across specs.
alex`` has quit [Ping timeout: 246 seconds]
ragmaanir has quit [Quit: Leaving]