ChanServ changed the topic of #crystal-lang to: The Crystal programming language | | Crystal 0.22.0 | Fund Crystal's development: | Paste > 3 lines of text to | GH: | Docs: | API: | Logs:
duckqlz has quit [Remote host closed the connection]
_whitelogger has joined #crystal-lang
snsei has joined #crystal-lang
<crystal-gh> [crystal] MakeNowJust opened pull request #4499: Compiler: use Colorize.on_tty_only! (master...fix/colorize/use-in-crystal-command)
snsei has quit [Remote host closed the connection]
Raimondi has quit [Ping timeout: 268 seconds]
Philpax has joined #crystal-lang
<crystal-gh> [crystal] bcardiff opened pull request #4501: Add llvm operand bundle def and catch pad/ret/switch (master...llvm-operand-bundle-def)
<crystal-gh> [crystal] bcardiff opened pull request #4502: Refator time platform specific implementation (master...time)
<crystal-gh> [crystal] bcardiff pushed 1 new commit to master:
<crystal-gh> crystal/master 3e6bd33 Chris Hobbs: Support windows linker (#4491)...
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
<travis-ci> crystal-lang/crystal#3e6bd33 (master - Support windows linker (#4491)): The build passed.
<DeBot> (Support windows linker)
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
leex has quit [Ping timeout: 255 seconds]
leex has joined #crystal-lang
<FromGitter> <bigtunacan> I'm trying to use micrate to generate my database migrations (, but it is erroring out on my Mac (10.12.4).
<FromGitter> <bigtunacan> dyld: Library not loaded: /usr/local/opt/libevent/lib/libevent-2.0.5.dylib
<FromGitter> <elorest> yeah that’s a pretty standard error. try updating your version of libevent from homebrew and re compiling micrate
<FromGitter> <bigtunacan> Yeah; I force uninstalled libevent from homebrew, force uninstalled micrate
<FromGitter> <bigtunacan> Then I reinstalled everything; same error
<FromGitter> <elorest> don’t install micrate from homebrew
<FromGitter> <elorest> compile from source.
<FromGitter> <elorest> Also i sort of feel like micrate is supposed to be included in an app rather than stand alone but that could have changed.
<FromGitter> <elorest> in amber we use it as part of the amber command line
<FromGitter> <bigtunacan> I was going off the GitHub repo which talks about using it standalone from the cli
<FromGitter> <bigtunacan> I'm not sure how exactly to compile it from source; I tried to clone the repo and run `crystal src/`, but this errors out.
<FromGitter> <elorest> A while I ago I was trying to do something similar.
<FromGitter> <elorest> Here was his resposne.
Philpax_ has joined #crystal-lang
Philpax has quit [Ping timeout: 260 seconds]
<FromGitter> <bigtunacan> Herrm..
<FromGitter> <bigtunacan> Yeah; that doesn't make it real clear how you would use it outside of including it in a shard for another prog
<FromGitter> <bigtunacan> Looks like he has a separate repo here which is where the homebrew cask is coming from
<FromGitter> <bigtunacan> I was able to build that successfully and then run that from the cli even though the brew install doesn't work when used directly
<FromGitter> <elorest> I think that’s just the homebrew formula-tap
<FromGitter> <elorest> guess not.
<FromGitter> <elorest> cool
<FromGitter> <bigtunacan> It works so I'll take it :)
<FromGitter> <elorest> sorry I wasn’t more help. Check out amber if your playing with web stuff in crystal
<FromGitter> <elorest>
<FromGitter> <bigtunacan> No; I appreciate it anyway.
<FromGitter> <bigtunacan> Yeah; I saw some of the discussion going earlier today too.
<FromGitter> <bigtunacan> Right now I'm spinning up a Kemal site.
<FromGitter> <bigtunacan> As I get a better handle on how Crystal works.
<FromGitter> <bigtunacan> But I'll definitely look at it.
<FromGitter> <elorest> Amber provides some cool generators which get can get a full crud up and running very fast. Sometimes having working code to look at and modify helps and lot in learning languages as well.
<FromGitter> <elorest> Anyway have a good night.
<FromGitter> <bigtunacan> You too
<FromGitter> <bigtunacan> I'm definitely planning on checking out Amber and Kemalyst both for future stuff.
<FromGitter> <elorest> Don’t sell you stock quite yet but I’m pretty sure that kemalyst and amber are merging
<FromGitter> <bigtunacan> I'm mostly interested in building out more educational materials and some middleware/handlers that can drop into any of the web frameworks that support handlers
<FromGitter> <elorest> Have you looked at crack?
<FromGitter> <bigtunacan> Yeah; I'm on there as a contributor
<FromGitter> <elorest> oh cool
<FromGitter> <bigtunacan> So Kemal's total barebones approach is a bit easier for doing that when I'm trying to spin up new dev on a handler
<FromGitter> <bigtunacan> Not really caring about much actual other real functionality :)
<FromGitter> <elorest> Have you seen amber’s pipeline… It makes it super easy to add in different handlers for different routes?
<FromGitter> <bigtunacan> Then once I have things working like I expect I can test on Amber and Kemalyst
<FromGitter> <drujensen> Question, does anyone know what is going on with Amethyst?
<FromGitter> <elorest> Is anything going on?
<FromGitter> <drujensen> If it’s a dead project, I would like to see it removed from some of the lists
<FromGitter> <drujensen> because people will go their and not find any activity
<FromGitter> <bigtunacan> Not yet; but I followed the discussion going on earlier today between @drujensen and team Amber
<FromGitter> <drujensen> then think Crystal is not being supported
<FromGitter> <elorest> Good point. We should probably summit a PR on awesome crystal
<FromGitter> <bigtunacan> @drujensen I agree; I don't think it's just Amethyst though
<FromGitter> <bigtunacan> I think a bunch of stuff should be removed as it looks like quite a few dead projects are still on there
<FromGitter> <elorest> same with rust...
<FromGitter> <elorest> maybe there should be an inactive flash or something...
<FromGitter> <bigtunacan> If it's not kept up to date then the awesome list isn't so awesome
<FromGitter> <drujensen> haha, right
<FromGitter> <elorest> It’s still potentially useful to see that there is this huge out of date project.
<FromGitter> <drujensen> not sure who would make the call though
<FromGitter> <elorest> look at the last version of crystal in the shard.yml
<FromGitter> <elorest> we could probably set up a script for that.
<FromGitter> <elorest> one of these days lol
<FromGitter> <drujensen> right, lol
<FromGitter> <elorest> Hey do you think it would be useful to use flash for csrf so that it will automatically reset everytime?
<FromGitter> <drujensen> I really like the Amethyst name and would pay to own it. :-)
<FromGitter> <elorest> Can’t we… They don’t have a domain or anything.
<FromGitter> <bigtunacan> lol
<FromGitter> <bigtunacan> I picked up this domain last weekend
<FromGitter> <bigtunacan>
<FromGitter> <drujensen> nice, like it
<FromGitter> <bigtunacan> You ever used echojs or rubyflow?
<FromGitter> <bigtunacan>
<FromGitter> <drujensen> no, just ruby weekly and js weekly
<FromGitter> <bigtunacan>
<FromGitter> <bigtunacan> Yeah; and I know there is the Crystal Weekly site.
<FromGitter> <elorest> It’s more of a mailing list I think
<FromGitter> <elorest> mailgun or something.
<FromGitter> <bigtunacan> Those are all a curated mailing list type
<FromGitter> <drujensen> this would be easy to build
<FromGitter> <elorest> I’d like to see that written in crystal
<FromGitter> <elorest> it’s awesome that it exists though.
<FromGitter> <bigtunacan> This is more a social news aggregator that we can all submit to
<FromGitter> <bigtunacan> That's what I'm doing with Same thing as echojs/rubyflow, but Crystal specific
<FromGitter> <drujensen> cool! great idea
<FromGitter> <drujensen> I will subscribe. :-)
<FromGitter> <elorest> same
<FromGitter> <bigtunacan> It's pretty simple; I'll have a v1 up and running in a week or two.
<FromGitter> <mjago> Regarding awesome ruby - I noticed the curses entry is a single commit with no tests that barely pretends to work - yet there are several pretty good versions out in the wild - very misleading :worried:
Raimondi has joined #crystal-lang
<FromGitter> <bigtunacan> I'll announce on here when it's live, and then just build out from there
<FromGitter> <drujensen> should be a test to be on awesome crystal
<FromGitter> <drujensen> > 10 stars and > 10 commits
<FromGitter> <mjago> ```code paste, see link``` []
<FromGitter> <bigtunacan> lol
<FromGitter> <drujensen> ugh
<FromGitter> <drujensen> even the test fails
<FromGitter> <mjago> :smile:
<FromGitter> <bigtunacan> Well shit; in that case I have several shards I can add to awesome crystal right now ;-)
<FromGitter> <drujensen> lol
<FromGitter> <bigtunacan> I thought I would wait until there was some working code... but hey
<FromGitter> <mjago> seriously some quality control would be great @bigtunacan
<FromGitter> <bigtunacan> Yeah; I'm sarcastic by nature, but I really agree with you.
<FromGitter> <bigtunacan> I spent too much time digging through the list trying to find what I should really be using.
Raimondi has quit [Ping timeout: 268 seconds]
<FromGitter> <bigtunacan> @drujensen Amethyst is running on the latest version of Crystal and was last updated a little less than a month ago.
<FromGitter> <bigtunacan> Last commit was 12 days ago
<FromGitter> <drujensen> oh, interesting. ok.
<FromGitter> <bigtunacan> I dropped a PR on awesome that just strikes out old unsupported web frameworks. I'll see if V accepts if. If so then I may do some additional cleanup on it manually for now.
<FromGitter> <bigtunacan> But some automation like @elorest suggested would be best
<FromGitter> <drujensen> @bigtunacan thanks for taking the time to do that. very helpful!
<FromGitter> <drujensen> :clap:
<FromGitter> <bigtunacan> No problem
<FromGitter> <sdogruyol> Hey all
<FromGitter> <bigtunacan> Hey
<FromGitter> <sdogruyol> I'll be speaking about Crystal at today :)
<FromGitter> <bigtunacan> Sweet! Good luck.
<FromGitter> <bararchy> @sdogruyol amazing !!
<FromGitter> <sdogruyol> Thank you :+1:
<FromGitter> <bigtunacan> Is it going to get streamed or uploaded to YouTube or Vimeo later so we can check it out?
<FromGitter> <sdogruyol> yeah
<FromGitter> <sdogruyol> updated to youtube later
<FromGitter> <bigtunacan> Nice
<FromGitter> <bigtunacan> It's almost 3am here; time or sleep.
<FromGitter> <bigtunacan> Goodnight all
<FromGitter> <sdogruyol> good night
_whitelogger has joined #crystal-lang
<FromGitter> <bararchy> It would be cool to have a live stream of "let's program X in Crystal" , where someone takes it upon himself to make a small program from scratch Live :)
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
<FromGitter> <sdogruyol> Twitch streams Crystal
<RX14> @sdogruyol that would be an entirely different stream: a lot more fun and a lot less productive
<FromGitter> <sdogruyol> haha yes
<FromGitter> <sdogruyol> i really like those kind of streams
<RX14> so, I think we just merged the first step to windows support into master
<FromGitter> <sdogruyol> yeah thank you @RX14
<FromGitter> <sdogruyol> having a linker is definitely a good beginning
<FromGitter> <sdogruyol> now you can add it to crane :P
<RX14> it looks like just a series of small steps from here :)
<FromGitter> <sdogruyol> and we can cross-compile to windows
<FromGitter> <sdogruyol> :D :D
<crystal-gh> [crystal] kostya closed pull request #4446: Time::Span #to_json #from_json (master...time_span_json)
splitty_ has quit [Ping timeout: 240 seconds]
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
<FromGitter> <bararchy> I always forget (and it's missing in docs ? ) What are the names of the accessors in Crystal ?
<FromGitter> <sdogruyol> getter setter property
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
<FromGitter> <bararchy> Hmm ... Seems I can't get `TCPSocket.gets` to work, it will raise "Closed Stream" every time
<FromGitter> <bararchy> Anyone else got into this issue ?
_whitelogger has joined #crystal-lang
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondi has joined #crystal-lang
pduncan has quit [Ping timeout: 255 seconds]
<FromGitter> <bararchy> NM my bad , did a client.close instead of client.closed?
tankfeeder has joined #crystal-lang
<tankfeeder> hi all
<FromGitter> <akzhan> What’s wrong in my code? ⏎ ⏎ ```puts s=0x1C22414141221C.to_s(16) ⏎ puts s.to_i(16)``` ⏎ ⏎ []
<FromGitter> <akzhan> Ruby does ok
<RX14> @akzhan 1c22414141221c is probably greater than a 32bit int
<RX14> you need to use to_i64
<FromGitter> <faultyserver> @sdogruyol @RX14 @bararchy I've done a few streams on Twitch where I've worked on Crystal projects. I'm actually going to be doing more this weekend working on a compiler for a play-language
<FromGitter> <faultyserver> I want to see if I can get to a point of writing a simple compiler in under an hour so I can turn it into a presentation to give at meetups and such
<FromGitter> <akzhan> @RX14 Thanks, it is.
Philpax_ has quit [Ping timeout: 260 seconds]
<FromGitter> <fridgerator> I streamed on a couple of times while building credit
tankfeeder has quit [Ping timeout: 240 seconds]
tankfeeder has joined #crystal-lang
guardianxx has joined #crystal-lang
tankfeeder has quit [Quit: Leaving]
<FromGitter> <jwoertink> Anyone have a good idea for an internal counter for a method? I want a method where each time I call it, it will cycle through some numbers. I need it at the instance level though so I can use this method multiple times and have separate counters
<FromGitter> <jwoertink> I guess I could just make a property to hold that variable
<crystal-gh> [crystal] asterite pushed 1 new commit to master:
<crystal-gh> crystal/master a3b77d3 Ary Borenszweig: Fixed #4503: assume token_type is Bearer in OAuth2 when not specified.
guardianxx has quit [Read error: Connection reset by peer]
guardianxx has joined #crystal-lang
guardianxx has quit [Remote host closed the connection]
<travis-ci> crystal-lang/crystal#a3b77d3 (master - Fixed #4503: assume token_type is Bearer in OAuth2 when not specified.): The build passed.
<DeBot> ( ouath2 empty token_type)
<crystal-gh> [crystal] asterite pushed 1 new commit to master:
<crystal-gh> crystal/master 041199c Ary Borenszweig: Fixed #4481: Nil assertion failed when using super outside method
<travis-ci> crystal-lang/crystal#041199c (master - Fixed #4481: Nil assertion failed when using super outside method): The build passed.
<DeBot> (Nil assertion failed when using super outside method)
<FromGitter> <elorest> Probably just an instance variable… I guess I’d have to see a gist or something.
<FromGitter> <elorest> Is there a Constant or something in a shard that I could use to get the name of the program I’m currently running?
<FromGitter> <elorest> basically the name of `src/`
<FromGitter> <eliasjpr> Create a counter class that listens for the method calls
<FromGitter> <eliasjpr> Something like an observer should do it elegantly
yogg-saron has joined #crystal-lang
snsei has joined #crystal-lang
<FromGitter> <HarrisonTotty> Hello everyone! I am new to the Crystal language (as well as Ruby) after having worked mainly in C#/C++/Python for a while. I have a quick question concerning inheritance: ⏎ If I have a class `A` that has a particular instance variable `children` that is an array of `A`'s, how can another class `B < A` store objects of type `B` into `children`?
<FromGitter> <HarrisonTotty> Essentially I am trying to write a computer algebra library where the `Expression` class contains an array of `children` which may be any type that inherits `Expression`. So that way I can have the classes `Symbol < Expression` and `Value < Expression` and thus say something like: ⏎ ⏎ ```code paste, see link``` []
<FromGitter> <HarrisonTotty> 1) meant to write `expr ="Sum", x, y, two)`
<FromGitter> <elorest> I’m working on an example. Is this close to what you mean?
<FromGitter> <elorest> class A ⏎ property children : Array(A | Nil) ⏎ property name : String ⏎ ⏎ def initialize(@name : String) ... []
<FromGitter> <HarrisonTotty> @elorest Essentially yes, but now my question is, can we store a class of type `B < A` into `@children`?
<FromGitter> <HarrisonTotty> Also what is the difference between using `property`, `getter`, and just instance variables like `@children = [] of Expression`?
<FromGitter> <HarrisonTotty> I assume this is something tranferred over from Ruby?
<FromGitter> <HarrisonTotty> *transferred
<FromGitter> <elorest> Yeah it’s similar to ruby setters and getters just named better.
<FromGitter> <elorest> I’m sure there’s a more generic way to do this but that example works.
<FromGitter> <HarrisonTotty> @elorest In your example you specify the array to be a union of types `(A | B | Nil)`. What about if I have potentially hundreds of class types that inherit `A`? I'm trying to avoid having to specify type unions...
<FromGitter> <HarrisonTotty> I know that Crystal requires you to be a bit more specific, so that may be unavoidable...
<FromGitter> <HarrisonTotty> In C# for instance you can store `B`'s in an array `A[]` provided `B : A`
<FromGitter> <faultyserver> if `B < A`, you can just store them inside as you would in C#, C++, etc.
snsei has quit [Remote host closed the connection]
<FromGitter> <elorest> @HarrisonTotty Just revised my code based on jon’s comment.
snsei has joined #crystal-lang
<FromGitter> <faultyserver> Then, if you want to iterate over them, but use properties that are specific to `B`, you can either do `` to cast the entire array for your operations, or you can iterate and cast each one individually, which may give better control if you're not sure that all elements of `children` will be `B`: ⏎ ⏎ ```code paste, see link``` [https://gitte
<FromGitter> ...]
<FromGitter> <faultyserver> nice comment highlighting -.-
<FromGitter> <HarrisonTotty> haha
<FromGitter> <elorest> yeah you can use standard markdown code highlights in gitter
<FromGitter> <faultyserver> I did...
<FromGitter> <HarrisonTotty> Thanks for all of the help @faultyserver & @elorest ! I think that helps
<FromGitter> <elorest> sweet.
<FromGitter> <faultyserver> here's the reference for the `case` statement. It explains a bit about the type restrictions:
<FromGitter> <faultyserver> Just a general suggestion: if you're building something to parse algebraic statements, you're going to want to build a tree, rather than a list.
<FromGitter> <faultyserver> specifically, you want something like an AST:
snsei has quit [Remote host closed the connection]
yogg-saron has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master:
<crystal-gh> crystal/master ccda23a Ary Borenszweig: Fix a couple of typos
rohitpaulk has quit [Ping timeout: 255 seconds]
<crystal-gh> [crystal] asterite pushed 1 new commit to master:
<crystal-gh> crystal/master 7973c43 Ary Borenszweig: Fixed #4492: wrong malloc_atomic for virtual struct
<travis-ci> crystal-lang/crystal#ccda23a (master - Fix a couple of typos): The build passed.
<FromGitter> <elorest> Is there a constant or something that I could call to get the name of my current app? ⏎ ⏎ `PROJECT => my_blog # for src/`
<travis-ci> crystal-lang/crystal#7973c43 (master - Fixed #4492: wrong malloc_atomic for virtual struct): The build passed.
<DeBot> (Memory corruption(?) after commit "Codegen: use malloc_atomic whenever possible" f1998de8 )
<crystal-gh> [crystal] oprypin closed pull request #3434: Unify Random and SecureRandom (
<oprypin> elorest, app or file name?
<oprypin> >> __FILE__
<DeBot> oprypin: # => "eval" -
<oprypin> app name would presumably be something from shard.yml - that is not easily doable
<FromGitter> <elorest> Yeah I could pull it from shard.yml or have `PROJECT_NAME= {{__FILE__}}`in my first file. I was just wondering if the system kept that information anywhere already.
gool has joined #crystal-lang
gool has quit [Client Quit]
<oprypin> no i dont think so, PROJECT_NAME is a good bet
<oprypin> PROGRAM_NAME is name of executable, obtained at runtime, changes if you rename it
<FromGitter> <elorest> PROGRAM_NAME might be what I’m looking for.
<oprypin> yeah but let me just emphasize again it's not the name of, it's the name of ./program
<FromGitter> <elorest> yeah it’s close to what I want though...
<oprypin> >> {{__FILE__}}
<DeBot> oprypin: # => "eval" -
<FromGitter> <elorest> I want `my_project` instead of /bin/myproject.
<oprypin> (ignore the last example, i think {{ }} makes no difference)
<FromGitter> <elorest> PROGRAM_NAME is what I want because *FILE* is different for whatever file I call it from.
<FromGitter> <elorest> thanks
<crystal-gh> [crystal] asterite pushed 2 new commits to master:
<crystal-gh> crystal/master d8eac43 Ary Borenszweig: Fixed #4311: `{"a" : 1}` won't parse anymore as a named tuple
<crystal-gh> crystal/master 7eba0e8 Ary Borenszweig: Fixed #4319: incorrect value for sizeof abstract struct
<crystal-gh> [crystal] asterite pushed 1 new commit to master:
<crystal-gh> crystal/master ddc3cb3 Ary Borenszweig: Fixed #4458: missing location for to_unsafe call
<travis-ci> crystal-lang/crystal#d8eac43 (master - Fixed #4311: `{"a" : 1}` won't parse anymore as a named tuple): The build was broken.
<DeBot> (Formatter fails to format named tuple with a string key and a extra whitespace)
<crystal-gh> [crystal] asterite pushed 1 new commit to master:
<crystal-gh> crystal/master 0c3c3d4 Ary Borenszweig: Formatter: fix removal of newline when it had spaces
<travis-ci> crystal-lang/crystal#ddc3cb3 (master - Fixed #4458: missing location for to_unsafe call): The build was broken.
<DeBot> (Module validation failed: inlinable function call in a function with debug info must have a !dbg location)
<crystal-gh> [crystal] RX14 opened pull request #4506: Fix current-stage compiler stats output (master...bugfix/stats-realtime)
<RX14> @asterite thanks for the heads-up on that regression
<travis-ci> crystal-lang/crystal#0c3c3d4 (master - Formatter: fix removal of newline when it had spaces): The build is still failing.
sagax has joined #crystal-lang
<sagax> hi all
<RX14> sagax, hi
Val has joined #crystal-lang
<FromGitter> <elorest> @sdogruyol How’d the talk go?