RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
<oprypin> jokke, can u report a bug to baked?
<jokke> tada \o/
<oprypin> oh
<jokke> :D
<jokke> words easiest fix
<oprypin> jokke, it could use a unittest
<jokke> oprypin: yeah, you're right
<oprypin> I'm already imagining bruteforcing gzip to make a minimal example that compresses to #{ lol
<jokke> :D
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qard has joined #crystal-lang
<jokke> lol
<jokke> that was super easy to find
<oprypin> niiiiiiice
<jokke> hmmm
<jokke> ah there
<FromGitter> <watzon> @oprypin what about `WebSocket.run`? Should a thread just automatically be spawned when it's instantiated?
<RX14> if it was blocking, WebSocket#run wouldn't exist
<RX14> there's no socket#run is ther?
<FromGitter> <watzon> Right, that's my thought
relyks has joined #crystal-lang
cremes has joined #crystal-lang
marius has joined #crystal-lang
marius has quit [Client Quit]
cremes has quit [Quit: cremes]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
<FromGitter> <marksiemers> @asterite - I'm halfway through watching your talk at Øredev 2016. It is a great presentation for anyone who is new to the langauge (and even those of us using it for a few months). I think it should be linked in a prominent place in the docs or on the website if it isn't already.
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <watzon> Oh that's him?
<FromGitter> <marksiemers> Yep
<FromGitter> <marksiemers> https://github.com/asterite
DTZUZU2 has quit [Quit: WeeChat 1.9]
snsei has joined #crystal-lang
<FromGitter> <Dillybob1992> @marksiemers i watched it last night, and watched another one on youtube where juan was there too. really cool stuff!
<FromGitter> <marksiemers> Yeah, I think you linked it in the chat - that's how I found out about it.
snsei has quit [Ping timeout: 276 seconds]
relyks has quit [Quit: relyks]
cremes has joined #crystal-lang
relyks has joined #crystal-lang
<FromGitter> <Dillybob1992> awesome. i like watching presentations about programming
aemadrid has quit [*.net *.split]
galstar[m] has quit [*.net *.split]
logen[m] has quit [*.net *.split]
cptaffe has quit [*.net *.split]
DeBot has quit [*.net *.split]
g3funk has quit [*.net *.split]
swav has quit [*.net *.split]
g3funk has joined #crystal-lang
DeBot has joined #crystal-lang
aemadrid has joined #crystal-lang
swav has joined #crystal-lang
<FromGitter> <watzon> @oprypin so it looks like changing the `WebSocket.run` method to `WebSocket.receive` and modifying it to look like this pretty much does the trick ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a5ffecc5ade18be398cd793]
galstar[m] has joined #crystal-lang
cptaffe has joined #crystal-lang
logen[m] has joined #crystal-lang
<FromGitter> <watzon> I could definitely refactor it a bit more too
<crystal-gh> [crystal] MakeNowJust opened pull request #5602: Fix parsing an empty heredoc (master...fix/crystal/empty-heredoc) https://git.io/vNRZ9
<FromGitter> <Dillybob1992> i find it kinda cool how there is another argentina developer that created the Godot game engine, that has the name Juan. Another Juan was also was with Ary during that presentation, haha.
<FromGitter> <asterite> Mark: thanks, I was a bit nervous during that presentation
<FromGitter> <asterite> I think Juan is one of the most common names here in Argentina
<FromGitter> <watzon> Would someone mind linking to it again? I'd like to watch it and share it around
<FromGitter> <jwaldrip> Been working a bunch in typescript this week. It makes me want real interfaces in Crystal – rather than treating a module as an interface.
<FromGitter> <watzon> Yes please!
<FromGitter> <Dillybob1992> @asterite 👏 😄 @watzon here (https://vimeo.com/191351066)
<FromGitter> <watzon> That and better json marshalling/unmarshaling are my top two things that I'd like to see
<FromGitter> <watzon> @Dillybob1992 Thanks!
<FromGitter> <Dillybob1992> @watzon here is the one with Juan! :D (https://www.youtube.com/watch?v=xbdVs4FhZac&t=6s)
<FromGitter> <watzon> Gracias
DTZUZU has joined #crystal-lang
<FromGitter> <jwaldrip> @watzon better Json how?
cremes has quit [Quit: cremes]
<FromGitter> <watzon> @jwaldrip having some kind of metadata tags or decorators instead of using JSON.mapping
<FromGitter> <watzon> There's an issue for it I believe
<FromGitter> <jwaldrip> Hmm. I’m not a big fan of metadata tags... but decorators may be nice.
DTZUZU has quit [Client Quit]
<FromGitter> <watzon> Here's the issue https://github.com/crystal-lang/crystal/issues/3620
<FromGitter> <watzon> @asterite came up with the idea
DTZUZU has joined #crystal-lang
<FromGitter> <watzon> Have you guys seen this? https://github.com/tbrand/SushiCoin
LastWhisper____ has joined #crystal-lang
<FromGitter> <jwaldrip> @watzon okay. Convinced. I like the way @asterite proposed it!
<FromGitter> <watzon> As do I
<crystal-gh> [crystal] waj opened pull request #5603: OpenSSL: Hide errors when either libcrypto or libssl are not found by pkg-config (master...fix/openssl-silence-pkg-config-errors) https://git.io/vNRCq
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
snsei has quit [Remote host closed the connection]
aarongodin has quit [*.net *.split]
olbat[m] has quit [*.net *.split]
Renich has quit [*.net *.split]
mroth has quit [*.net *.split]
foxbot has quit [*.net *.split]
baweaver has quit [*.net *.split]
ephemera_ has quit [*.net *.split]
salvor has quit [*.net *.split]
jhass has quit [*.net *.split]
tliff has quit [*.net *.split]
tliff has joined #crystal-lang
foxbot has joined #crystal-lang
salvor has joined #crystal-lang
aarongodin has joined #crystal-lang
baweaver has joined #crystal-lang
jhass has joined #crystal-lang
baweaver is now known as Guest23702
ephemera_ has joined #crystal-lang
mroth has joined #crystal-lang
olbat[m] has joined #crystal-lang
Renich has joined #crystal-lang
snsei has joined #crystal-lang
<FromGitter> <watzon> Can you take a block and assign it to a proc? Something like this ⏎ ⏎ ```def on_close ⏎ @on_close_callback = yield ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5a6018ddce68c3bc74cf64d2]
<FromGitter> <watzon> Because I know that will just assign the return value of the block to the variable
<FromGitter> <watzon> I'm wondering if you can actually turn that block into a Proc and store it
snsei has quit [Ping timeout: 276 seconds]
relyks has quit [Quit: relyks]
relyks has joined #crystal-lang
snsei has joined #crystal-lang
pleiosaur has quit [Remote host closed the connection]
<FromGitter> <Dillybob1992> is it possible to break out of a loop inside `ensure` statement? (won't let me use break)
<FromGitter> <marksiemers> Yes you can "capture a block"
<FromGitter> <marksiemers> If you don't see an example of what you need to do, there are more examples in this PR: https://github.com/crystal-lang/crystal-book/pull/156/files
<FromGitter> <marksiemers> I've just been lazy getting back to it, so there is a lot of volume and some edits to make (in the PR)
<FromGitter> <marksiemers> @watzon ^
DTZUZO has joined #crystal-lang
return0e_ has quit []
stephenbelanger has joined #crystal-lang
stephenbelanger has quit [Client Quit]
qard has joined #crystal-lang
<qard> Is there a way to use a type restriction in a method argument that refers to a class which derives from a particular class? (The class itself, I mean. Not an instance of that class)
<qard> I'm currently just using arg : Class, but it'd be nice if I could be more specific about it.
<qard> I have an abstract class which it is intended that the user would create their own class implementing that and provide that class to an interface which would create and use instances of that class.
Guest23702 is now known as baweaver
baweaver has quit [Changing host]
baweaver has joined #crystal-lang
<FromGitter> <bew> qard: arg : Base.class
relyks has quit [Quit: relyks]
<qard> Perfect! That was exactly what I needed. Thanks! :)
<FromGitter> <bew> You're welcome ;)
hash has joined #crystal-lang
qard has quit [Quit: qard]
crystal-lang885 has quit [Ping timeout: 260 seconds]
qard has joined #crystal-lang
snsei has quit [Remote host closed the connection]
sz0 has joined #crystal-lang
mark_66 has joined #crystal-lang
wmoxam has quit [Remote host closed the connection]
tec has joined #crystal-lang
qard has quit [Quit: qard]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
snsei has joined #crystal-lang
flaviodesousa has joined #crystal-lang
<greenbigfrog> how can this still return a `nil`? https://hastebin.com/munibehere.rb
<FromGitter> <xfbs> because you don't have a default case?
<greenbigfrog> thanks
<greenbigfrog> or maybe not...
<greenbigfrog> https://hastebin.com/ojosuxunid.pl still getting a error that it can possibly return nil
<FromGitter> <Dillybob1992> Just curious i think i asked something like this but forgot :P ⏎ In my GameServer class I have an instance variable `db` that points to my database. when accepting new tcp connections i do `spawn handle_connection(socket)` as usual. Now, running `db.exec`, `db.db.query_one?` or whatever from functions that handle_connection calls, will they take advantage of being in a "fiber" still?
<greenbigfrog> https://carc.in/#/r/3eq7 somehow works, which is essentially the same as what I have...
<FromGitter> <xfbs> @greenbigfrog: what happens when you manually set the return type to `Nil`, does the compiler complain? ⏎ ⏎ ```def update_config(memo : String, status : Bool, server : UInt64) : Nil ⏎ # ... ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5a6059de6117191e617db3dc]
* greenbigfrog is stupid...
<greenbigfrog> my #update_config and #get_config look so similar that I added the default case on the wrong one...
<greenbigfrog> thanks!
<FromGitter> <xfbs> Whoops haha. I'm guessing that fixed it?
flaviodesousa has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<Groogy_> Morning! o7
<FromGitter> <Dillybob1992> Morning
Groogy_ is now known as Groogy
<greenbigfrog> @xfbs yes it did :)
hightower4 has quit [Read error: Connection reset by peer]
hightower4 has joined #crystal-lang
<FromGitter> <Dillybob1992> Does anyone here listen to music / ambient sounds when they code? What do y'all like? i'm currently listening to this (https://www.youtube.com/watch?v=yhXHH2sZlQU)
hash_ has joined #crystal-lang
<FromGitter> <Dillybob1992> Ten Thousand Years Won't Save your life, LOVE that one
<FromGitter> <xfbs> Been listening to The Weeknd — Starboy quite a lot recently, but mainly just because it's the only decent thing I had offline on spotify on my phone for travelling. That playlist looks pretty dope tho!
hash has quit [Ping timeout: 240 seconds]
<FromGitter> <Dillybob1992> my old gameserver written in nodejs was done mostly when that song was on repeat.. brings back memories
hash_ has quit [Ping timeout: 276 seconds]
<FromGitter> <Dillybob1992> @xfbs wow, 1.3b views almost on that music video
sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter> <xfbs> Haha I haven't actually seen it
<greenbigfrog> I have a string, and I'd like to remove sth from the beginning which is in a Tuple of strings. Somehow I can't get my head wrapped around how to do this easily...
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<greenbigfrog> I guess I could probably switch to using a regex...
snsei has quit [Ping timeout: 255 seconds]
<Groogy> @Dillybob1992 if I want ambient "noise" I watch videos on ant farms
<Groogy> it's great
<FromGitter> <Dillybob1992> @groogy, sweet 👍
<Papierkorb> Groogy: rainymood.com/ or "star trek background noise" lul
<Groogy> well usually for my concentration problems I do it by drowning my brain in shit
<Groogy> so it can't get distracted, that kind of ambient doesn't work for me
hightower3 has joined #crystal-lang
hightower2 has quit [Ping timeout: 256 seconds]
sz0 has joined #crystal-lang
jnyw has quit [Quit: WeeChat 2.0.1]
<FromGitter> <xfbs> whoops sorry for the spam but these are great, you don't hear them so often so it's kinda refreishing
<crystal-gh> [crystal] asterite closed pull request #5602: Fix parsing an empty heredoc (master...fix/crystal/empty-heredoc) https://git.io/vNRZ9
tec has quit [Ping timeout: 248 seconds]
tec has joined #crystal-lang
<Groogy> meh don't worry xfbs, like that about this channel, it's quite friendly and casual :)
faustinoaq has joined #crystal-lang
faustinoaq has quit [Quit: IRC client terminated!]
cremes has joined #crystal-lang
return0e has joined #crystal-lang
<crystal-gh> [crystal] damianham opened pull request #5605: return correct content type for SVG images (master...svg-content-type) https://git.io/vN0eZ
<travis-ci> crystal-lang/crystal#6a574f2 (master - Fix parsing an empty heredoc): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/330333715
DTZUZU has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vN0vQ
<crystal-gh> crystal/master f3168b6 Johannes Müller: Add time zones support (#5324)...
cremes has quit [Quit: cremes]
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vN0fU
<crystal-gh> crystal/master 3b50388 Juan Wajnerman: OpenSSL: Hide errors when either libcrypto or libssl are not found by pkg-config (#5603)
cremes has joined #crystal-lang
hightower4 has quit [Ping timeout: 268 seconds]
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vN0fS
<crystal-gh> crystal/master 1210596 Benny Bach: Add cache control headers to http static file handler + a few more mi… (#2470)...
cremes has quit [Quit: cremes]
<travis-ci> crystal-lang/crystal#1210596 (master - Add cache control headers to http static file handler + a few more mi… (#2470)): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/330353054
<DeBot> https://github.com/crystal-lang/crystal/pull/2470 (Add cache control headers to http static file handler + a few more mi…)
<FromGitter> <straight-shoota> In the last month 114 PRs have been merged 👏
<Groogy> woop woop! 🎉
<FromGitter> <xfbs> Johannes, you're a contributor right?
<RX14> only 1/3 of rust's number @straight-shoota
<Papierkorb> Rust has mozilla backing, Crystal has a fraction of that, 1/3 is pretty good
<crystal-gh> [crystal] RX14 closed pull request #5605: return correct content type for SVG images (master...svg-content-type) https://git.io/vN0eZ
<travis-ci> crystal-lang/crystal#f3168b6 (master - Add time zones support (#5324)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/330348428
<RX14> Papierkorb, i know
<DeBot> https://github.com/crystal-lang/crystal/pull/5324 (Add time zones support)
<RX14> @straight-shoota make that 115
<travis-ci> crystal-lang/crystal#a29e21b (master - return correct content type for SVG images (#5605)): The build is still failing. https://travis-ci.org/crystal-lang/crystal/builds/330358385
<DeBot> https://github.com/crystal-lang/crystal/pull/5605 (return correct content type for SVG images)
<FromGitter> <straight-shoota> https://github.com/crystal-lang/crystal/pulse/monthly says 115
<FromGitter> <straight-shoota> eh 114
wmoxam has joined #crystal-lang
<FromGitter> <straight-shoota> but whatever. for Crystal it's really great.
DTZUZU has joined #crystal-lang
<FromGitter> <straight-shoota> between 0.23.1 and 0.24.1 it was 387 commits in over 5 months. dunno how many PR's but probably a few less.
tec has quit [Ping timeout: 248 seconds]
mark_66 has quit [Remote host closed the connection]
faustinoaq has joined #crystal-lang
<FromGitter> <watzon> Wooo!
<FromGitter> <watzon> Crystal is moving on up
<FromGitter> <watzon> Someone has even started the development of a Crypto Currency using Crystal. If it were to actually get any media exposure that could be really good for Crystal
<RX14> so, is it any good?
<RX14> there's not much point to a cryptocurrency with no new ideas
<RX14> can't find it on google either
<FromGitter> <watzon> It's actually very impressive. Basically brand new, but there's already a cli, daemon, and miner
<FromGitter> <watzon> And it looks like he wants to make it so that it's mostly cpu minable, which would really open things up to people that don't have a good gpu
<FromGitter> <watzon> @tbrand great job so far
<FromGitter> <watzon> Unfortunately it would be Unix only until Crystal gets Windows compilation finished
<RX14> @straight-shoota
alex`` has joined #crystal-lang
cremes has joined #crystal-lang
moei has joined #crystal-lang
<FromGitter> <j8r> Hi Crystalers. I have hard times to manipulate JSON::Any (changing values, arrays...). Is it planned to have some sorts of an auto-mapping?
LastWhisper____ has joined #crystal-lang
<FromGitter> <watzon> There is already a JSON.mapping though
<FromGitter> <j8r> @watzon I know, but how to change a value from a key represented as a String "key.example.test" in an unknown JSON::Any
<RX14> @j8r why if your JSON unknown?
<RX14> is*
<FromGitter> <j8r> I already find a weird solution, but maybe there is a better one
<FromGitter> <asterite> ``````
<FromGitter> <asterite> something like that
<FromGitter> <j8r> In fact, i manipulate various configuration files
<RX14> i mean, `JSON.parse(foo)["key"]["example"].to_h["test"] = whatever` should work
<FromGitter> <j8r> @asterite
<oprypin> asterite, not you too! you just sent `````` to IRC
<RX14> yea
<RX14> @asterite is correct
<RX14> my example is slightly wrong
<FromGitter> <asterite> let's use slack, so much better. you can even edit messages, code snippets, links, files, etc.
<RX14> no, please
<RX14> slack is terrible for open source communities
<RX14> it's a pain to get in
<RX14> you can't use your github account
<oprypin> lol
<FromGitter> <j8r> @asterite yes, not open source. Since git'ab had bought gitter, we are good :)
<vegai> isn't gitter quite ok, though?
<RX14> IRC for the heavy users and gitter is there for easy access
<RX14> thats the way it should be
<RX14> if we hosted an IRC gateway i'd go so far as to remove gitter
<FromGitter> <asterite> I'm using gitter, I see code snippets :)
<RX14> the bot just needs to be imroved
<FromGitter> <asterite> j8r you should probably explain why you need that in the first place
<vegai> would be a good April 1st decision to say that all communication was moved to Microsoft Teams
<RX14> lol
<oprypin> RX14 pls
<vegai> to celebrate the finished Windows port
<RX14> the bot needs to put pastes as URLs
<RX14> the IRC way
<oprypin> but it does
<RX14> just as soon as it sees a code block, host it as a gist or plaintext URL
<RX14> i mean on a proper website oprypin
<FromGitter> <j8r> To modify JSON configurations of applications
<RX14> gitter is a terrible pastebin
<oprypin> RX14, as if that would have saved you
<RX14> and FromGitter tried to use it as on
<FromGitter> <j8r> And build a REST API on top of it
<RX14> oprypin, i mean it needs to handle whatever @asterite did to generate `````` too
<oprypin> it was literally ``````
cremes has quit [Quit: cremes]
<RX14> yeah it usually works
<RX14> who's bot is it anyway
<oprypin> RX14, i thought you knew this. this is just edits
<RX14> was it?
<oprypin> yeah people write `````` and then edit the message and put the whole code block inside, that's quite common
<RX14> *sigh*
<RX14> i wish gitter had a way to block message edits
<oprypin> edits are not propagated through gitter's simple api, and the complicated api is ... complicated
<RX14> immutable message logs are so much nicer
<RX14> than being able to edit
<FromGitter> <j8r> By the way, is it planned to have a typed Hash with Int64, Strings and so on from a JSON.parse,
<RX14> @j8r but wouldn't you know the configuration layout?
<RX14> somewhere, somehow, something must know how the JSON is layed out
<FromGitter> <j8r> Without predefined mapping, Instead of just JSON::Any,
<RX14> and you should bring that up front in a well typed scheme
<RX14> why not just have a predefined mapping
<FromGitter> <j8r> Impossible, because the goal is to build a REST api to modify my apps configurations (config.json of Transmission e.g.) BUT the application itself *can* modify its configuration, of courge (e.g. Gitea)
<FromGitter> <j8r> Arf, hard to talk from mobile
<RX14> but if you're building something to modify the config of transmission you must know how transmission is configured
<RX14> so why not just make a JSON.mapping of that
<FromGitter> <j8r> Partially. The use can modify it by hand as he likes, or by the API, or by the web ui.
<FromGitter> <j8r> *user
<FromGitter> <j8r> All I know is to modify the key host,
<oprypin> j8r, Crystal does have all the types in the Hash and it does know all the types. it just doesn't know them at compile time, because nobody's telling it
<RX14> so you want an API where you can apply arbitrary JSON modifications to a document
<FromGitter> <j8r> Yes, add, delete and change values of keys
<RX14> you can just do something like, for each part of key, except the last: assign json = json[key_part]
<RX14> and then you do json.as_h[last_part] = JSON::Any.new(val)
<oprypin> i think keeping json::any is detrimental for this use case
<RX14> well
<FromGitter> <watzon> @asterite how about Discord instead? Personally I think it's a lot better than Slack
<RX14> how else would you do it oprypin?
<oprypin> you want to be explicit about your assumptions
<FromGitter> <watzon> I agree that gitter isn't the best
<oprypin> json any is for chained [] [] [] pretty much
<RX14> @watzon it's harder to use for people who don't already have discord
<RX14> the great advantage of gitter is you just log in weith github
<RX14> and you're in
<oprypin> let's use skype
<FromGitter> <asterite> probably gitter + irc is fine. But I'll use code snippets in gitter, even if in irc they don't show up well
<FromGitter> <watzon> @RX14 that's true
<FromGitter> <j8r> And it's Open Source, partially
<RX14> @oprypin, well we're removing *not* JSON::Any
<oprypin> RX14, uh what
<RX14> @asterite you realise if you just put a gist link in gitter it shows up really nicely
<RX14> so just do that?
<FromGitter> <j8r> Hey let's have an EtherPad so
<FromGitter> <watzon> I've got a Crystal Telegram group set up already. Just added it to a network I'm a member of
<FromGitter> <watzon> Trying to spread the love
<oprypin> asterite, the messages show up acceptably, but you wrote `````` and posted that and that's all people will see in IRC. edits do not work, so they must be reserved for tiny typo fixes, if even that.
<oprypin> watzon, I view it as trying to fragment the community
<RX14> they really don't show up acceptably oprypin
<oprypin> RX14, make another hexchat plugin
<RX14> no
<oprypin> i'm only 10% serious there
<FromGitter> <j8r> We are talking about
<FromGitter> <watzon> @RX14 not really, I've just got it there for people that are a member of the network and don't use Gitter. I'm trying to get people interested
<oprypin> watzon, why do you want to isolate people from the rest of the community?
<RX14> but why would you want to use telegram and not gitter?
<RX14> or irc?
<FromGitter> <watzon> I don't. I'd much rather they use gitter
<FromGitter> <watzon> but they're already using Telegram
<FromGitter> <j8r> Btw, a gitter badge should be added!
<RX14> so just tell them to?
<oprypin> well im using skype so let's all use skype
<RX14> havent used skype in years lol
<FromGitter> <watzon> And it's easy for me to share stuff with them to get them interested
<RX14> about 3
<FromGitter> <watzon> None of them are currently using Crystal
<RX14> @watzon so keep it a group of friends
<RX14> and talk to them about crystal
<FromGitter> <watzon> That's all it really is
<FromGitter> <asterite> oprypin: I never wrote that, I wrote the full snippet
<RX14> and convince them to join gitter once they're fully interested
<FromGitter> <watzon> That's the goal
<FromGitter> <j8r> Haha
<FromGitter> <asterite> here I go again: ```some snippet```
<FromGitter> <asterite> shows up well?
<RX14> that works fine @asterite
<FromGitter> <asterite> strange...
<oprypin> no it's not strange
<oprypin> you sent the quotes, then edited the code in, without noticing
<RX14> how do you do that without noticing?
<oprypin> absentmindedly press up, i dunno
<oprypin> people get used to that action quickly
<oprypin> holy shit
<oprypin> it was a bug in my bot
<Yxhuvud> :D
<RX14> hmm
<oprypin> how is that even possible
<oprypin> asterite, so sorry :(
<Yxhuvud> did it fail on multiline code or something?
<oprypin> but the scenario can still happen
<FromGitter> <asterite> umm... i never edited the code
<FromGitter> <asterite> I just wrote it, pressed left to go back and added the quotes
<oprypin> asterite, I can see that now in logs. you didn't. sorry.
<RX14> yes, @asterite
<FromGitter> <asterite> but all of that before pressing enter
<FromGitter> <asterite> lol
<oprypin> >> require "markdown"; p Markdown.to_html("```invisible man```")
<FromGitter> <asterite> ok ¯\_(ツ)_/¯
<DeBot> oprypin: "<pre><code class='language-invisible man```'></code></pre>" - more at https://carc.in/#/r/3etg
<RX14> oprypin just realised it was a bug in his bot
<FromGitter> <asterite> I do have bad memory, so it's a possibilit
<oprypin> there's my explanation
<RX14> <oprypin> holy shit
<RX14> <oprypin> it was a bug in my bot
<oprypin> >> require "markdown"; p Markdown.to_html("```invisible man```")
<DeBot> oprypin: "<pre><code class='language-invisible man```'></code></pre>" - more at https://carc.in/#/r/3eth
<oprypin> see anything suspicious here
<RX14> but why didn't that happen with ```some snippet```
<oprypin> >> require "markdown"; p Markdown.to_html("here I go again: ```visible man```")
<DeBot> oprypin: "<p>here I go again: <code></code><code>visible man</code><code></code></p>" - more at https://carc.in/#/r/3eti
<RX14> oh
<RX14> so it's when the ``` is the first?
<oprypin> yeah it's when it starts the line and is immediately followed by text - it's language detection, kinda working as intended
<RX14> fantastic
<oprypin> :s
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cremes has joined #crystal-lang
theIrcguy12 has joined #crystal-lang
<oprypin> i'll just make a PR ¯\_(ツ)_/¯
<crystal-gh> [crystal] oprypin opened pull request #5606: Markdown: fix handling of code fences appearing on the same line (master...code-fence) https://git.io/vN0oC
theIrcguy12 has quit [Ping timeout: 260 seconds]
Excureo has joined #crystal-lang
<FromGitter> <watzon> Just watched that talk @asterite . Good job, it was very informative.
LastWhisper____ has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter> <eliasjpr> Inventor Claims to Have Solved Floating Point Error Problem
<Yxhuvud> Yeah, no. I advise you to read the hacker news comments on that article if you are inclined to believe it matters
<FromGitter> <eliasjpr> My first thought was, now we can find out one of the biggest misteries of life (math), whats the true value of PI
<FromGitter> <eliasjpr> :)
<FromGitter> <marksiemers> √-1 2^3 ∑ π and It Was Delicious!
cremes has quit [Quit: cremes]
greengriminal has joined #crystal-lang
<FromGitter> <eliasjpr> yeah show me the last digit of that
<FromGitter> <marksiemers> It's hard to read without the proper notation, but that's just a math pun, no significant digits needed.
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter> <eliasjpr> lol
<FromGitter> <eliasjpr> got me there
greengriminal has joined #crystal-lang
qard has joined #crystal-lang
<FromGitter> <j8r> I just tested out if Crystal has rational data type with `1/10` or like in Ruby `2/10r`, but no ;(
qard has quit [Ping timeout: 276 seconds]
hello12 has joined #crystal-lang
<hello12> when you are on windows and using this bash there to use crystal: is it even possible to do graphical things? like opening a window? I tried some GUI/framework librarys already but i always got this "Error: execution of command failed with code" error.
greengriminal has quit [Quit: This computer has gone to sleep]
cremes has joined #crystal-lang
hightower4 has joined #crystal-lang
greengriminal has joined #crystal-lang
illy_ has joined #crystal-lang
qard has joined #crystal-lang
qard_ has joined #crystal-lang
illy_ is now known as illyohs
hightower4 has quit [Ping timeout: 265 seconds]
<Papierkorb> hello12: You mean WSL?
Ven` has joined #crystal-lang
<hello12> whats WSL?
<Papierkorb> WSL emulates linux, and thus, you'll have to provide linux tools to do gui (at least a running X server).
<Papierkorb> windoze subsystem for linux. Reverse wine but in bad.
<hello12> yes!
<hello12> the windows subsystem linux
<hello12> this is what i mean
<Papierkorb> Yeah. That's (as far the user space is concerned) "linux". You don't have access to the WinAPI at all. But you can run X programs mostly fine if you have a running X daemon
<Papierkorb> And that indeed worked for me surprisingly with Qt5
<hello12> what are X programs?
<Papierkorb> programs using the X windowing system, that thing providing a graphical interface on Linux (and other) systems.
<Papierkorb> If all of that is new to you, easiest way to get things working is to use a virtual machine (e.g. through VirtualBox) with some Linux system in it (Like Ubuntu)
<hello12> ah ok. i hope microsoft make an update and give access to the winAPI. Because im really sure SDL needs access to winapi
<Papierkorb> No, SDL on linux needs X
<Papierkorb> And always will be
<Papierkorb> the program you use in WSL are running in a linux-esque environment, they'll never know about the WinAPI
<hello12> do i need to install X via apt-get install?
<Papierkorb> You need to provide an X running on your windows machine outside WSL
<Papierkorb> A virtual machine is really less painful
<hello12> hm.. ok yes i will probably do that if X is painful to install/use
Ven` has quit [Read error: Connection reset by peer]
Ven` has joined #crystal-lang
<jhass> "always will be", *cough* wayland *cough*
<Papierkorb> A new better/worse GUI stack emerging wasn't important for the point of it never using WinAPI until the death of the universe
<jhass> sure, fair enough
<jhass> wouldn't be surprised to see some winapi triggered there through some exploit though :P
<Papierkorb> win32 + linux = WinLinux. For when you asked if it's possible and you're past the point of asking if it's sensible.
<Papierkorb> Can you run Wine in WSL though?
<jhass> or wsl in wine?
<Papierkorb> well WSL isn't userspace, that'd make it actually decent
hello12 has quit [Quit: Page closed]
cremes has quit [Quit: cremes]
<FromGitter> <bararchy> This is a bug right? https://play.crystal-lang.org/#/r/3eu7
<oprypin> bararchy, no it's invalid syntax
<Papierkorb> Reduced https://play.crystal-lang.org/#/r/3eu8 the error could be clearer, but I'd expect #as to turn any lvalue into a rvalue, so it should be invalid in any case
<FromGitter> <bararchy> so, how can I let the compiler know this is a Int32 (in the case the hash has more options String, String | Int32) and still do +=
<Papierkorb> x[y] = x[y].as(T) + 1
<FromGitter> <bararchy> Oh
<Papierkorb> Unusual structures require unusual syntax. Are you sure you need to operate on a Hash?
<FromGitter> <bararchy> ok, makes sense
<FromGitter> <bararchy> lol
<FromGitter> <bararchy> yeha, it's not big enough to need a class, so a hash is ok for me
<Papierkorb> Writing a container class is simple
<FromGitter> <bararchy> true, but I need only two options, as in Int32 | String
<FromGitter> <bararchy> so a whole class is a little overhead I think
<FromGitter> <bararchy> but maybe not
<FromGitter> <bararchy> let me re-think it
<Papierkorb> Hash is the definition of overhead when you're actively working with it
<Papierkorb> If you have more than a few of such cases, you could also write a record-like macro building a mutable class instead of a immutable struct
<FromGitter> <bararchy> I just got over my class-o-phobia and create a small container class, it was much simpler then using hash in the end
<FromGitter> <bararchy> thanks for the pointer :)
greengriminal has quit [Quit: This computer has gone to sleep]
Ven` has quit [Ping timeout: 256 seconds]
Ven` has joined #crystal-lang
greengriminal has joined #crystal-lang
<FromGitter> <Dillybob1992> i just woke up, had a dream about my `ChatRoom` class... wat is going on
<greenbigfrog> is it on purpose that I have to install libxml2-dev for spec'ing on ubuntu?
<FromGitter> <Dillybob1992> having trouble trying to assign an instance variable to int64.. ` instance variable '@last_message_time2' of Client must be Int64:Class, not Int64`
<FromGitter> <Dillybob1992> for example, i want it to be Int64, but start at number 0, won't let me
<FromGitter> <bew> Maybe use `@your_var = 0_i64` to force the 0 to be recognized as Int64
<FromGitter> <Dillybob1992> what is that
<FromGitter> <bew> greenbigfrog: what are you spec-ing? The compiler? Or just a simple spec file?
<oprypin> greenbigfrog, there's something weird like java xml format support for specs
<oprypin> you're supposed to have libxml installed anyway if you want to things to not randomly break like this - it's just a `require "xml"` away
<oprypin> greenbigfrog, yeah this stuff https://github.com/crystal-lang/crystal/search?q=junit
<FromGitter> <bew> greenbigfrog: I think crystal spec can generate an xml output for some junit stuff
<greenbigfrog> ok. was just wondering why I had to install the package extra
<FromGitter> <bew> Ah thanks oprypin
<FromGitter> <taylorfinnell> Hello, perhaps this is a dumb question but could someone explain why this code throws an error: https://gist.github.com/taylorfinnell/4f71199f746fe8abca9b214827ebf144
<oprypin> greenbigfrog, it's not extra, it's a dependency
<greenbigfrog> what I meant :P
<greenbigfrog> thanks
relyks has joined #crystal-lang
<FromGitter> <Dillybob1992> What is the difference between Int64 and 0_i64?
<oprypin> Dillybob1992, first is a type, 2nd is a value
<FromGitter> <Dillybob1992> i do read the docs
<FromGitter> <Dillybob1992> and if I assign a variable to Int64, it should let me use int64 numbers on it?
<FromGitter> <Dillybob1992> why do i have to use `0_i64`?
<FromGitter> <j8r> exactly, don't hesitate to RTD and do some `puts typeof(myvariable)`
<oprypin> Dillybob1992, because 0 means 0_i32
<oprypin> and https://github.com/crystal-lang/crystal/issues/2995 remains just a dream
<FromGitter> <j8r> is there a plan to default Floats to rational data type?
<oprypin> j8r, of course not
Groogy has quit [Quit: WeeChat 1.9.1]
<FromGitter> <Dillybob1992> well, im not using int64 again then, i'll be doing 0_i64 :P
<FromGitter> <j8r> too bad there isn't for now `2/10r` or `2/10`
<oprypin> taylorfinnell, i was gonna come up with some witty explanation but i don't have one. it probably should work.
<FromGitter> <j8r> I create an isssue so
<oprypin> ...
<oprypin> taylorfinnell, probably easier to make your point like this: https://carc.in/#/r/3eur https://carc.in/#/r/3eus
qard_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <bew> @j8r what should `2/10r` do?
<oprypin> => (1/5) apparently... cuz ruby
<FromGitter> <j8r> @bew keep rational number without rounding
<FromGitter> <bew> Oh
<FromGitter> <j8r> Maybe I've missed this feature, but I doesn't appear to be in Crystal, so I will create an issue
<FromGitter> <Dillybob1992> @oprypin btw, thank you 👏
<FromGitter> <bew> @taylorfinnell @oprypin iirc it's because captured variables by captured block don't keep restricted types, as when the block is called, the variable could'd have change value
<oprypin> bew, i don't think it could've changed value. but you can try to prove me wrong
<FromGitter> <bew> Hmm don't know, can't experiment r8t now
<oprypin> taylorfinnell, honestly this is the perfect format for a bug report - just do it
jnyw has joined #crystal-lang
<FromGitter> <taylorfinnell> ok :) thank you
<crystal-gh> [crystal] straight-shoota opened pull request #5607: Fix HTTP::StaticFileHandler to properly parse HTTP date (master...jm/fix/http-specs-missing-timezone) https://git.io/vNE3a
aroaminggeek has joined #crystal-lang
aroaminggeek has quit [Quit: Textual IRC Client: www.textualapp.com]
aroaminggeek has joined #crystal-lang
aroaminggeek has quit [Client Quit]
qard_ has joined #crystal-lang
aroaminggeek has joined #crystal-lang
<FromGitter> <Dillybob1992> if a class (that has a lot of property names and values), *get deleted*, assuming no references to any of those properties exist anywhere.. are those free'd as well?
<FromGitter> <watzon> What do you guys thing is the best library for argument parsing?
<RX14> what?
<RX14> argument passing?
<RX14> oh parsing i'm blind
<RX14> if you can get away with it, OptionParser in the stdlib
<RX14> the compiler uses it and it's fine
<FromGitter> <j8r> agree, I have use it - it understands the quotes and splits when there is a space - the `ARGV` array is practical
<oprypin> j8r, Crystal doesn't parse this -- doesn't deal with spaces and quotes, it gets prepared strings
<oprypin> (the story is different on windows ofc)
<RX14> oh is it?
<RX14> feck
<oprypin> RX14, well yeah windows just passes one big string to the executable
<RX14> whyyyyy
<oprypin> libc or whatever it's called has parsing
<FromGitter> <j8r> i didn't know, so it can depends of our Shell interpreter?!
<oprypin> RX14, what, nobody has tried using argv on windwos?
<RX14> well argv is from libc
<RX14> and libc has parsing
<RX14> so it's hidden from us
<oprypin> j8r, i wouldn't call it "depends", it's just that the shell interpreter chooses to provide this syntax
<oprypin> RX14, that's nice then. but i hope you understand that on unix the process gets an array of strings and on windows it gets one string with quotes intact
<RX14> yeah
<RX14> I forgot about that though
<RX14> pain in the ass
<FromGitter> <j8r> That's not bad, this way we can have a unified experience on UN*Xes
<oprypin> RX14, one thing to keep in mind, though, is that for Windows one wants to support a Process.new signature with args as string
<oprypin> otherwise it's impossible to represent some states, like `a b` without quotes lol
<oprypin> but it could be sacrificed
qard has quit [Quit: qard]
moei has quit [Quit: Leaving...]
aroaminggeek has left #crystal-lang ["Textual IRC Client: www.textualapp.com"]
Ven` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]