RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.20.1 | Fund Crystal's development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
<travis-ci> crystal-lang/crystal#2022f7e (master - Wrap GenericInstanceType in link if type vars don't have link): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/184371952
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 256 seconds]
akwiatkowski has quit [Ping timeout: 264 seconds]
<travis-ci> crystal-lang/crystal#5f8eb46 (master - Replace unused `each_with_index` with simple `each`): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/184372067
<FromGitter> <jots_twitter> anyone familiar with nim's "result" variable? https://nim-by-example.github.io/variables/result/ I like it. any chance crystal would implement such an idea?
mgarciaisaia1 has quit [Quit: Leaving.]
dhk has joined #crystal-lang
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
onionhammer has quit [Read error: Connection reset by peer]
dhk has quit [Quit: Leaving]
onionhammer has joined #crystal-lang
elia has quit [Quit: (IRC Client: textualapp.com)]
<Yxhuvud> I don't understand what the point of it is when you automatically return the last statement.
vivus-ignis has joined #crystal-lang
<travis-ci> crystal-lang/crystal#60bf3cd (master - Implement String#lchomp): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/184372462
vivus-ignis has quit [Ping timeout: 240 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 250 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 268 seconds]
mgarciaisaia has joined #crystal-lang
vivus-ignis has joined #crystal-lang
<crystal-gh> [crystal] andrewhamon closed pull request #3711: Check formatting early in CI (master...travis-fail-fast) https://git.io/v19dA
vivus-ignis has quit [Ping timeout: 245 seconds]
<FromGitter> <fridgerator> the point?
sp4rrow has joined #crystal-lang
pawnbox has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 256 seconds]
mgarciaisaia has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
mgarciaisaia has quit [Ping timeout: 260 seconds]
soveran has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
soveran has quit [Ping timeout: 258 seconds]
pawnbox has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 265 seconds]
<FromGitter> <bcardiff> @jots_twitter you can use rails returning pattern for that. http://apidock.com/rails/Object/returning (or just Object#tap like in the last example of the page)
pawnbox has quit [Remote host closed the connection]
vivus-ignis has joined #crystal-lang
vivus-ignis has quit [Ping timeout: 250 seconds]
<FromGitter> <jots_twitter> because you may not want to automatically return the last statement. if you do, don't use the result variable.
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
bjz has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 248 seconds]
vivus-ignis has joined #crystal-lang
vivus-ignis has quit [Ping timeout: 250 seconds]
sp4rrow has quit [Read error: Connection reset by peer]
sp4rrow has joined #crystal-lang
pawnbox has joined #crystal-lang
lacour has quit [Quit: Leaving]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
vivus-ignis has joined #crystal-lang
akwiatkowski has joined #crystal-lang
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vivus-ignis has quit [Ping timeout: 250 seconds]
mark_66 has joined #crystal-lang
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
<FromGitter> <piyush_ranjan_twitter> is there any way I can compile for linux from my mac os machine ?
gloscombe has joined #crystal-lang
<BlaXpirit> piyush_ranjan_twitter, I think it is possible to do all except the final step where you just need LLVM on the target platform. but i don't know about this.
<FromGitter> <piyush_ranjan_twitter> okay. I have a server on which I have a huge log file which I do not want to have locally. Therefore I was thinking if there is some way I could compile here and push the binary. I do not have sudo access on that server to install crystal
<BlaXpirit> you certainly dont need sudo access to use crystal
<BlaXpirit> though it can get annoying especially if you cant even install dependencies
<BlaXpirit> but hey if you invest enough time, even all the dependencies can be installed and used from local folders
<FromGitter> <splattael> @piyush_ranjan_twitter You may use docker for this if you have docker-engine installed on your Mac ;)
<FromGitter> <piyush_ranjan_twitter> yes That is what I am doing now
<FromGitter> <piyush_ranjan_twitter> wanted to know if there is an easier way :)
<FromGitter> <splattael> For me, docker seems to be the easiest :D
<FromGitter> <splattael> In our company, we have the opposite. Devs have Macs and do not have Crystal installed but want to use the binary (statically compiled with Crystal). So we ship the binary (only the bare binary) as a docker image. Problem solved ;)
<FromGitter> <piyush_ranjan_twitter> Devs don't have sudo access !!! :worried:
pawnbox has quit [Remote host closed the connection]
<Yxhuvud> haha. Oh wow, accidental recursive types gives lots of output: https://gist.github.com/yxhuvud/bfc0bd432da4b66d1570e18b468b0a14. That gives 700kB!
<Yxhuvud> (yeah, it should have been flat_map)
bjz has quit [Ping timeout: 250 seconds]
bjz_ has joined #crystal-lang
triangles has joined #crystal-lang
soveran has quit [Remote host closed the connection]
mark_66 has quit [Remote host closed the connection]
<FromGitter> <asterite> Yxhuvud: advent of code? ;-)
<Yxhuvud> yeah!
soveran has joined #crystal-lang
Philpax has joined #crystal-lang
Exilor has joined #crystal-lang
<Exilor> does anybody know what the compiler option --single-module does?
<crystal-gh> [crystal] maiha opened pull request #3714: Fix doc typo for Atomic#add (master...fix-doc) https://git.io/v1HS6
bjz_ has quit [Ping timeout: 268 seconds]
bjz has joined #crystal-lang
<FromGitter> <asterite> It creates a single LLVM module instead of one per "compilation unit"
<FromGitter> <asterite> It's mostly there for debugging purposes
<Exilor> and what are the implications when running a program compiled that way?
<Exilor> because i tried it, not knowing what it would do, and compilation time went from 2+ minutes to about 7 seconds
<Exilor> and the program ran fine
<Exilor> (the codegen bc+obj part of it)
akwiatkowski has quit [Ping timeout: 264 seconds]
<FromGitter> <asterite> Are you on linux?
<FromGitter> <asterite> There's a known issue in linux that the compiler does one fork per compilation unit, and fork seems to be slower in linux than mac, so it might be faster not to fork at all in that case... but I don't know
<Exilor> sort of, on the bash for windows thing
<FromGitter> <asterite> 2+ minutes? What program is that? It's also strange that it goes down to 7 seconds
<Exilor> it takes less than 1 minute on a mac
<Exilor> a mmorpg server
<FromGitter> <asterite> Cool!
<FromGitter> <asterite> I think there's a general optimization to be done regardless of the platform, that I noticed the other day...
Ven has joined #crystal-lang
<Exilor> so, for my purposes, --single-module could be considered the opposite of --release?
<FromGitter> <asterite> When you pass --release, --single-module becomes true
<Exilor> then i have no idea what's going on
<Exilor> but it compiles much faster so i'm happy
<Exilor> lol
<Exilor> thanks asterite!
<FromGitter> <asterite> Exilor: I'll try to optimize it for the next release, I think I found out a way
<Exilor> optimize what exactly?
Ven has quit [Read error: Connection reset by peer]
<FromGitter> <sdogruyol> compile time
Ven has joined #crystal-lang
Exilor has quit [Quit: Page closed]
triangles has quit [Quit: Leaving]
<FromGitter> <Exilor> that'd be cool but i didn't mean to complain about it taking too long
<FromGitter> <Exilor> i was surprised that the compilation time was so drastically different with and without --single-module
Philpax has quit [Ping timeout: 240 seconds]
<FromGitter> <asterite> I think it's because of forking in linux... so I'll try to reduce the number of forks
<FromGitter> <asterite> but generally reduce them, not only in linux... hopefully the first time will take longer (like now) but next compilations will take less than now
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <Exilor> btw ary since you asked https://dl.dropboxusercontent.com/u/1335129/Shot00129.jpg
<FromGitter> <Exilor> it's a port from existing java code though
<FromGitter> <sdogruyol> what's this?
<FromGitter> <sdogruyol> isnt this lineage?
<FromGitter> <Exilor> yep
<FromGitter> <sdogruyol> what are you exactly porting?
pduncan has joined #crystal-lang
<FromGitter> <Exilor> the server
<FromGitter> <paulcsmith> Is there a way to run a crystal file with `crystal run`, but pass args to the file being run?
<FromGitter> <paulcsmith> It seems like that isn't possible and you need to `build` and then run it, but it would be cool to just run it with args
<BlaXpirit> paulcsmith, i think you can even do crystal asdf.cr arg arg
<BlaXpirit> if not, this will always work: crystal run asdf.cr -- arg arg
<FromGitter> <paulcsmith> @BlaXpirit Thanks I'll give that a shot :)
<FromGitter> <sdogruyol> @Exilor that's interesting
<FromGitter> <paulcsmith> @BlaXpirit Worked beautifully. Not sure why I thought I had to use `run` :P
<FromGitter> <Exilor> @paulcsmith there was a time when not using run would compile the program instead
<FromGitter> <paulcsmith> Oh wait that didn't work as I expected :( I'll show a gist of what I'm trying to do. https://gist.github.com/paulcsmith/9f8c5447331b20fb8e5919024a621be3
<FromGitter> <paulcsmith> When I run this with `crystal command.cr --help` It prints the banner and help for `crystal run` instead of for the `command.cr`
<FromGitter> <paulcsmith> My end goal is to create different tasks that I can create without a complicated library. So basically rake tasks with a regular crystal file
Ven has joined #crystal-lang
<FromGitter> <sdogruyol> @Exilor is that oss or something anywhere?
pduncan has quit [Ping timeout: 240 seconds]
<FromGitter> <Exilor> @sdogruyol the server? hell no, the github repo with the java code i was porting from got taken down because of copyright https://github.com/L2J/L2J_Server
<Papierkorb> Thankfully, git is fully decentralized
<FromGitter> <sdogruyol> @Exilor how does the Crystal server performs compared to Java
<FromGitter> <Exilor> it's way waaaay to early to tell. it's a very big project and i'm just one guy
<FromGitter> <Exilor> also i don't have a few thousand players to test performance :P
<FromGitter> <sdogruyol> @Exilor that's still awesome
<FromGitter> <Exilor> @sdogruyol :blush: thanks man
<Papierkorb> Question is, will you make the source code public?
<Papierkorb> I can understand if not
akwiatkowski has joined #crystal-lang
<FromGitter> <Exilor> wouldn't the same thing that happened to them happen to me?
<Papierkorb> That's why I could understand if you wouldn't bother :)
<FromGitter> <asterite> @paulcsmith `crystal command.cr -- --help`
<FromGitter> <Exilor> @asterite i tried that and it didn't work
<FromGitter> <paulcsmith> @asterite Worked beautifully. Thank you :)
<FromGitter> <Exilor> papierkorb: other than that reason i have no feelings for or against it
<RX14> maybe just don't use github
<FromGitter> <Exilor> yeah, that's what the original devs did afterwards
<RX14> but was it their code or what?
<FromGitter> <Exilor> the code was theirs, the mmorpg for which the server was for wasn't
<RX14> isn't that legal though?
<FromGitter> <Exilor> i was under the impression that it was. but i'm not a lawyer :/
<FromGitter> <molovo> @RX14 yeah, if the source code is original, it’s yours and you can do what you like with it, regardless of what it’s for
<FromGitter> <molovo> Unless of course, that something is illegal itself
<RX14> @Exilor056798
<RX14> oops
<FromGitter> <molovo> It only gets messy if there are references to characters/areas in the game hardcoded into the source code, and *those* are subject to copyright or trademarks, in which case you can’t use them.
<FromGitter> <Exilor> that must be it. there are plenty of those
<Papierkorb> Well, all of that depends on the jurisdiction you're under
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <molovo> @papierkorb if it’s on github, it’s subject to US jurisdiction as that’s where they’re registered
<Papierkorb> yes, though I'd be surprised if NPC or area names fall under a trademark already
<FromGitter> <Exilor> there's also the texts that NPCs say which are also server-side
<FromGitter> <Exilor> might be considered something akin to the content of a book
vivus-ignis has joined #crystal-lang
<FromGitter> <molovo> Depends if they’re original or not. Granted, I don’t know this game, but a lot of games license the rights to the characters and stories they use, so they may be trademarked by another party
<Papierkorb> Exilor, yes for quest texts I can understand it
<RX14> you'd probably have luck hosting your repo on https://gitgud.io/
<FromGitter> <Exilor> first time i've heard about it :P anyway the subject came up because papierkorb asked me if i was going to open source it
<FromGitter> <Exilor> i haven't been looking for ways to do it or anything
<Papierkorb> RX14: That page looks awfully slow
<RX14> it loads fine for me
<RX14> 1.97s
<RX14> not fantastic
<RX14> but not bad
<Papierkorb> Looks like it just choked
<RX14> thats from empty cache
<Papierkorb> now it's okay
<RX14> yeah I know the guy that hosts that
<FromGitter> <molovo> 15s and counting for me… still a blank page
<Papierkorb> Had the same molovo, cancel the request and submit again
<RX14> hmm, maybe it's cloudflare doing something weird
vivus-ignis has quit [Ping timeout: 258 seconds]
vivus-ignis has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
soveran has quit [Remote host closed the connection]
<FromGitter> <paulcsmith> Is there a verbose option, or a way to return a raw SQL statement in crystal-db?
<FromGitter> <paulcsmith> I'm running into a strange issue and I'm not sure how to diagnose it https://gist.github.com/paulcsmith/f0def7fe5ca204855bdcf9ee97e48b33
<FromGitter> <paulcsmith> Seems like it must be doing something strange when replacing the `?` with `10` in the first version
<FromGitter> <Exilor> that has happened to me too and i never found out why
<FromGitter> <Exilor> i ended up replacing ? with %s and formatting the string...
<FromGitter> <paulcsmith> Yeah I used regular string interpolation and that worked, but then I think that will allow for SQL injection attacks since it's not being escaped
<FromGitter> <paulcsmith> In this particular case that's probably fine because the query I'm making is not using data from a user, but for other queries that would be a big deal
<FromGitter> <Exilor> maybe you should open an issue at the crystal-db repo
gloscombe has quit [Remote host closed the connection]
<FromGitter> <Exilor> or wait for somebody who knows what's the issue here
<FromGitter> <paulcsmith> Yeah I think I will. I'll make a repo that demonstrates the problem so it's easier to see what the problem is
<FromGitter> <Exilor> lol
<FromGitter> <paulcsmith> For anyone interested, here's the issue: https://github.com/crystal-lang/crystal-db/issues/30
soveran has joined #crystal-lang
pawnbox has joined #crystal-lang
soveran has quit [Ping timeout: 260 seconds]
<FromGitter> <bcardiff> Oops. I was faster to reach in github issue than here. Sorry :-$
<FromGitter> <paulcsmith> It's a-ok! Thanks for the help :D
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 265 seconds]
vivus-ignis has quit [Ping timeout: 256 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
mgarciaisaia1 has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 258 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 256 seconds]
greengriminal has joined #crystal-lang
mgarciaisaia1 has quit [Quit: Leaving.]
mgarciaisaia has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 6 new commits to master: https://git.io/v1QFm
<crystal-gh> crystal/master f92334e Ary Borenszweig: Compiler: use consistent type sort across compilations when processing type declarations
<crystal-gh> crystal/master 3cd37d8 Ary Borenszweig: FileUtils: fixed bug in `cmp` method
<crystal-gh> crystal/master fab210f Ary Borenszweig: Added IO#read_fully?
<crystal-gh> [crystal] asterite closed pull request #2591: Optimize bc+obj codegen, focus: devel rebuilds. (master...codegen-bc-obj-phase-optimization) https://git.io/vrOcY
pawnbox has joined #crystal-lang
mgarciaisaia has quit [Quit: Leaving.]
<travis-ci> crystal-lang/crystal#c792139 (master - Compiler: optimize codegen performance): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/184647582
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
Ven has joined #crystal-lang
soveran has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
soveran has quit [Ping timeout: 256 seconds]
sp4rrow has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
vivus-ignis has joined #crystal-lang
pawnbox has joined #crystal-lang
vivus-ignis has quit [Ping timeout: 250 seconds]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
A124 has quit [Quit: '']
<crystal-gh> [crystal] RX14 opened pull request #3716: Make File.expand_path trailing / test more robust (master...bugfix/home-fixes) https://git.io/v17e5
A124 has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
<FromGitter> <paulcsmith> Still needs lots of improvement, but here are some basic crystal tasks for working with databases https://github.com/paulcsmith/migrate.cr
pawnbox has joined #crystal-lang
<FromGitter> <paulcsmith> Trying to figure out a good way to have configuration so you don't need to type the db name for all the commands, but for now passing the db name works
sp4rrow has joined #crystal-lang
<crystal-gh> [crystal] asterite closed pull request #3714: Fix doc typo for Atomic#add (master...fix-doc) https://git.io/v1HS6
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 256 seconds]
greengriminal has quit [Quit: Leaving]
pawnbox has quit [Remote host closed the connection]
mgarciaisaia has quit [Quit: Leaving.]
<travis-ci> crystal-lang/crystal#c94112f (master - Fix doc typo for Atomic#add): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/184673006
akwiatkowski has quit [Ping timeout: 264 seconds]
Philpax has joined #crystal-lang
<FromGitter> <bcardiff> https://github.com/juanedi/micrate use just ENV["PG_URL"] to setup de database. You could go with an DATABASE_URL for sure and for extensibility work from a `DB::Database` instance maybe.
vivus-ignis has joined #crystal-lang
vivus-ignis has quit [Ping timeout: 250 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
soveran has joined #crystal-lang