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
snsei has quit [Remote host closed the connection]
<FromGitter> <paulcsmith> @elorest that looks super cool. Is that what you’re using for amber exec?
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
<FromGitter> <elorest> It’s really close to `amber exec`, sort of developed them at the same time. Haven’t added the log option to amber exec yet though.
<FromGitter> <paulcsmith> Very cool. That's a really great idea 👍
<FromGitter> <watzon> crystalshards.xyz is down :(
<FromGitter> <johnjansen> dead it appears
<hightower3> yes but someone created https://crystalshards.org/
DissonantGuile has quit [Read error: No route to host]
<FromGitter> <johnjansen> oh good … google doesnt know about that yet apparently
<FromGitter> <johnjansen> at least it doesnt rank for “crystalshards"
<FromGitter> <watzon> Who's project is it anyway?
<FromGitter> <johnjansen> i *think* it was f’s? but @jwaldrip might own the org domain from memory …
<FromGitter> <johnjansen> id have to check
DissonantGuile has joined #crystal-lang
<FromGitter> <johnjansen> @sdogruyol and @jwaldrip had a conversation about all this at #codecamp
DissonantGuile has quit [Read error: Connection reset by peer]
<hightower3> Ruby's Thread#wakeup method has description: "Marks a given thread as eligible for scheduling, however it may still remain blocked on I/O.". Which method on Fiber is most similar to that in Crystal?
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 255 seconds]
<hightower3> When I define something as having type LibC::Char*, I notice that I must #to_s it to use it as a String. Can I avoid this and have it be done automatically?
raz has quit [Excess Flood]
raz has joined #crystal-lang
raz has quit [Changing host]
raz has joined #crystal-lang
rohitpaulk has joined #crystal-lang
Liothen has quit [Quit: The Dogmatic Law of Shadowsong]
Liothen has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
greengriminal has joined #crystal-lang
_whitelogger has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 250 seconds]
aroaminggeek has joined #crystal-lang
saadq has quit [Ping timeout: 255 seconds]
saadq has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
p0p0pr37 has quit [Read error: Connection reset by peer]
p0p0pr37_ is now known as p0p0pr37
greengriminal has quit [Quit: This computer has gone to sleep]
aroaminggeek has quit [Quit: Textual IRC Client: www.textualapp.com]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 252 seconds]
<FromGitter> <picatz> This is an interesting question hightower3 👍 Specifically about Fiber: from my understanding, this really isn't public API.
<FromGitter> <picatz> I'm not terribly sure of anything else other than not to really use it.
<FromGitter> <picatz> For the automatic `#to_s`, wouldn't this potentially cause some issues when people don't want a string?
<FromGitter> <picatz> I'm no expert, but, just a thought I guess.
<FromGitter> <picatz> I'd imagine for the Fiber problem you're asking about that you would arrange your program with `spawn` and `channels` so that the flow of the program would be managing all the scheduling within crystal's internal scheduler. I have a very loose understanding of how all that works though.
<FromGitter> <picatz> Someone else would honestly be better to answer that I'd reckon. But, I figure, it's 3am, why not type stuff in the crystal gitter. 😄
<FromGitter> <unreadable> morning all
<FromGitter> <elorest> Morning!
<FromGitter> <unreadable> https://i.imgur.com/3G8AgEo.png
<FromGitter> <unreadable> just a few attempt of creating ui buttons for my gui libs
<FromGitter> <unreadable> attempts*
snsei_ has quit [Remote host closed the connection]
mark_66 has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
snsei has joined #crystal-lang
Papierkorb_ has joined #crystal-lang
BrianOn99 has joined #crystal-lang
<FromGitter> <extremety1989> hi all
<FromGitter> <extremety1989> @unreadable with SDL ? =)
snsei has quit [Remote host closed the connection]
flaviodesousa has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
BrianOn99 has quit [Remote host closed the connection]
flaviodesousa has joined #crystal-lang
mbarbar has joined #crystal-lang
qard has joined #crystal-lang
<FromGitter> <unreadable> Well, sfml for Now and hopefully raw OpenGL soon
<FromGitter> <extremety1989> @unreadable okey
<FromGitter> <unreadable> Currently I'm using three shapes for drawing the button (2 raw rounded shapes to get pixel borders and the main gradient one) + the text. Would it be better to use only one shape and obtain the 2 pixel borders and the gradient body only with the shaders?
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <r3bo0t> Do we have some equivalent library in crystal for XMPP?
mark_66 has quit [Quit: Leaving.]
mark_66 has joined #crystal-lang
<Papierkorb_> if crystalshards.org (no .xyz anymore!) doesn't know, probably not
<FromGitter> <r3bo0t> @Papierkorb yeah checked their before asking here :)
<FromGitter> <jwaldrip> @watzon the crystalshards.org domain is mine. A fork of xyz should be running there.
<FromGitter> <jwaldrip> I can commit to keeping it running.
rohitpaulk has quit [Ping timeout: 248 seconds]
greengriminal has joined #crystal-lang
<watzon> Ok awesome :) good to know
rohitpaulk has joined #crystal-lang
<oprypin> Papierkorb_, what's wrong with .xyz
<Papierkorb_> That it was down in the last days
daemonwrangler has quit [Quit: ZNC 1.6.3+deb1+jessie0 - http://znc.in]
daemonwrangler has joined #crystal-lang
<oprypin> ok :|
faustinoaq has quit [Ping timeout: 240 seconds]
daemonwrangler has quit [Read error: Connection reset by peer]
<FromGitter> <codenoid> thank @bcardiff https://gist.github.com/bcardiff/bd938e70fc32176fa74a
daemonwrangler has joined #crystal-lang
<FromGitter> <bcardiff> @watzon @jwaldrip I ping github:f a couple of hours ago. He didn't knew crystalshards.xyz and is up and running now.
<FromGitter> <bcardiff> @codenoid I'm glad it helps. I honestly didn't remember doing that! 😅
<FromGitter> <codenoid> haha 😄 👍
mark_66 has quit [Remote host closed the connection]
mbarbar has quit [Ping timeout: 248 seconds]
flaviodesousa has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
faustinoaq has joined #crystal-lang
<Papierkorb_> I'm actually really impressed by the engines' capabilities in the current Zelda installment: https://www.reddit.com/r/NintendoSwitch/comments/7ed1ny/new_tech_analysis_of_botw_graphics_engine_local/ (not written by me lul)
<FromGitter> <jwaldrip> @bcardiff and were back to two shards sites :-/
Papierkorb_ has quit [Quit: Konversation terminated!]
<FromGitter> <bcardiff> @jwaldrip It wasn't good that the one linked in the crystal site was down. I didn't followed that the .org was created.
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
aroaminggeek has joined #crystal-lang
<watzon> Papierkorb_: That is damn impressive. Makes me want to get a switch
snsei has joined #crystal-lang
aroaminggeek has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<watzon> How do you exit the current process in Crystal?
<watzon> Something like `quit` or `exit`?
<hightower3> exit(status) ?
snsei has quit [Remote host closed the connection]
<watzon> Awesome thanks
claudiuinberlin has joined #crystal-lang
<FromGitter> <jwaldrip> Can I add methods to a module dynamically via a macro
<oprypin> @jwaldrip, "dynamically" and "via a macro" are incompatible terms
rohitpaulk has quit [Ping timeout: 246 seconds]
<watzon> What would be the best way to download an image with Crystal? I imagine `HTTP::Client` would help, but I don't know how I would go from a response to a downloaded image
<FromGitter> <jwaldrip> I mean via macro
<FromGitter> <jwaldrip> Can I add a method to an existing module via a macro?
<watzon> Just the way they show it here http://devdocs.io/crystal/docs/syntax_and_semantics/macros
<FromGitter> <jwaldrip> I am building a router and want to add methods to a shared helpers module that can then be included in other classes.
<FromGitter> <jwaldrip> Hmm. that doesn't fit my use case. If I call a macro from within a class, I need to then add a method to a different module, NOT define a method within that class.
<FromGitter> <johnjansen> @watzon you want IO.copy from the HTTP responses body_io from memory
<watzon> Oh you're trying to dynamically add methods to other modules?
<FromGitter> <jwaldrip> Correct
<FromGitter> <johnjansen> @jwaldrip you never do anything simple do you ;-)
<FromGitter> <extremety1989> ahha
<watzon> @johnjansen for some reason I'm getting a `Nil assertion failed`. body_io appears to be nil
<watzon> @jwaldrip I was trying to do something like this myself a couple weeks ago. Pretty sure it's not possible in Crystal
<FromGitter> <jwaldrip> Well trying to make the interface for the router rails'esk in nature.
<watzon> Yeah it's not gonna happen in Crystal haha
<FromGitter> <jwaldrip> I was able to kinda get it working, but then I change a line of code and it breaks.
<FromGitter> <extremety1989> @FromIRC body_io ?
<watzon> I was trying to port ActiveSupport
<FromGitter> <extremety1989> guys what do you knink is better for io application, using chanels or just simple websocket ?
<FromGitter> <jwaldrip> This does not include my latest changes... but this DOES work right now.
<FromGitter> <johnjansen> @watzon is it body_io thats Nil or is it that response might be Nil ?
<FromGitter> <extremety1989> well i already asked that question before, but no concret answer
<watzon> @johnjansen the response is fine, it's just body_io that's nil. body is an empty string
<FromGitter> <johnjansen> check the headers, there might be a redirect or something happening along the way
<watzon> I think you're right
<watzon> Any way to make `HTTP::Client` follow the redirect?
<oprypin> watzon, tried ctrl+f redirect ?
<oprypin> hm so that's empty
<FromGitter> <johnjansen> @watzon test the response and follow the location
<FromGitter> <johnjansen> you need to write it yourself, at least i did when i did this some long time ago
aroaminggeek has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter> <johnjansen> @jwaldrip can you monkey patch the *other* module within the macro?
<FromGitter> <jwaldrip> Thats what I am doing in a sense
<FromGitter> <jwaldrip> module is initially defined here: https://github.com/obsidian/orion/blob/rails-esk/src/orion/router/root.cr#L4-L5
<FromGitter> <jwaldrip> BUT for some reason, that is not the case.
<FromGitter> <johnjansen> god, i always have trouble reading macros ;-)
<FromGitter> <johnjansen> @jwaldrip BTW admiral saved my life yesterday … so thanks ;-)
<FromGitter> <jwaldrip> Lol, glad to hear it.
<FromGitter> <jwaldrip> Another macro beast ;-)
snsei has joined #crystal-lang
<FromGitter> <fridgerator> @extremety1989 websockets communicate over a TCP connection, channels has nothing to do with this
<FromGitter> <fridgerator> not sure what your question means
<FromGitter> <extremety1989> @fridgerator i saw exemple with socket + chanels in crystal-lang documentation, just wanted to know wich technique is best
<FromGitter> <fridgerator> for doing what?
<FromGitter> <extremety1989> real time application
<FromGitter> <fridgerator> web application?
<FromGitter> <extremety1989> yeah
<FromGitter> <fridgerator> then you're going to have to use websockets
<FromGitter> <extremety1989> oh okey
<Papierkorb> instant messaging isn't really realtime
<FromGitter> <extremety1989> @FromIRC as i mentined , im new commer to Crystal programming
<Papierkorb> As already mentioned last time you asked this, and got the same response.
<FromGitter> <extremety1989> i just want to learn concepts of channels
<FromGitter> <fridgerator> The best way to learn will be to follow the examples and continue to play and modify to see how they behave
snsei has quit [Remote host closed the connection]
<FromGitter> <extremety1989> that what i do,but really, documentation in for advance users
<FromGitter> <extremety1989> is for
<FromGitter> <extremety1989> i used socket.io i really liked it, but i wanted something more fastest, so i had to choose between golang and crystal
<Papierkorb> channels don't have anything to do with sockets
<FromGitter> <extremety1989> channel they control the flow
<Papierkorb> huh
<FromGitter> <fridgerator> @extremety1989 have you looked at kemal ?
<FromGitter> <extremety1989> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a14758b71ad3f873612f871]
<FromGitter> <extremety1989> @fridgerator yup
<FromGitter> <fridgerator> well kemal websockets is just like socket.io
<FromGitter> <extremety1989> @fridgerator how do i receive specific reponse in front end ?
<FromGitter> <extremety1989> because i only have one choice
<FromGitter> <extremety1989> ws.onmessage = function (){}
<FromGitter> <fridgerator> thast it
<FromGitter> <fridgerator> its up to you to implement different message types
<FromGitter> <extremety1989> how do i do that ?
<FromGitter> <fridgerator> so send your messages as json: `{type: "message.new", data: "hello"}.to_json`
<FromGitter> <fridgerator> and in javascript parse it `ws.onmessage = function (data) { JSON.parse(data).type }`
<FromGitter> <extremety1989> aa okey i see
<FromGitter> <extremety1989> i did it in server site for crud operation
<FromGitter> <extremety1989> sockets = [] of HTTP::WebSocket ⏎ ws "/notes" do |socket| ⏎ sockets.push socket ⏎ ⏎ `````` [https://gitter.im/crystal-lang/crystal?at=5a14769f540c78242d30bc8a]
snsei has joined #crystal-lang
aroaminggeek has quit [Quit: Textual IRC Client: www.textualapp.com]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter> <jwaldrip> How do you use crystal tool expand?
<FromGitter> <jwaldrip> are there docs?
snsei has quit [Ping timeout: 250 seconds]
<FromGitter> <jwaldrip> All it does is print the help
<FromGitter> <jwaldrip> `crystal tool expand ./spec/sample.cr` does nothing
<Yxhuvud> it is crystal tool expand file:line file that you have to use, or something like that.
<FromGitter> <jwaldrip> Does nothing
<FromGitter> <jwaldrip> Anyone on core team????
<FromGitter> <jwaldrip> care to explain how to use it?
<Papierkorb> What's not clear from the --help page?
<FromGitter> <jwaldrip> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a147cba71ad3f8736132095]
<FromGitter> <jwaldrip> When running that command I get the help page, with no guidance on what I did wrong.
<FromGitter> <jwaldrip> also `-c ./src/sample.cr:5` does not work.
<Papierkorb> that :5 thing most likely isn't your "programfile"
<FromGitter> <jwaldrip> without the line number, it also does not work.
<Papierkorb> the programfile is your main file. the -c then points to a file inside your program, with line and column numbers attached.
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter> <jwaldrip> So `crystal tool expand -c ./src/sample.cr:5:1 ./src/sample.cr` is the correct format
<FromGitter> <jwaldrip> That is not made very clear by the help.
<Papierkorb> It is.
<Papierkorb> I figured it out just by that.
<Papierkorb> And I'm no core contributor.
<FromGitter> <jwaldrip> It does not indicate that LOC is required.
rohitpaulk has quit [Ping timeout: 240 seconds]
<Papierkorb> > Cursor location with LOC as path/to/file.cr:line:column
<Papierkorb> There it is
<FromGitter> <jwaldrip> I see that. But it doesnt say required.
<FromGitter> <jwaldrip> Nor does it tell me I am missing a flag when running it.
<Papierkorb> If it was optional, it would've been in square brackets
<FromGitter> <jwaldrip> you mean `[options]`?
<Papierkorb> like that
<FromGitter> <jwaldrip> That would denote that SOME options were needed, but not which ones.
<Papierkorb> the program doesn't fail, hence it's optional
<Papierkorb> I don't get what you're ranting on about
<Papierkorb> the tool uses canonical --help notation
<FromGitter> <jwaldrip> Just saying, it could be made more clear
<FromGitter> <jwaldrip> I didnt say anything about that.
<Papierkorb> only thing it could do is saying you're missing -c if nothings passed. But apart from that, the --help is fine.
<FromGitter> <jwaldrip> Thats all I am saying
<FromGitter> <jwaldrip> It wasnt clear to me what I was missing... and a simple line saying `-c was required` would have been helpful.
<FromGitter> <jwaldrip> (also, I ranted because you made a statement that "I figured it out by reading the help" thus insinuating that I should have also been able to figure it out.)
<Papierkorb> k
<Yxhuvud> he is definitely not the only one that has had trouble figuring out that command.
greengriminal has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
<FromGitter> <elorest> Would it be possible to turn Crystal Lang into a Not for Profit Organization for Tax purposes. LetsEncrypt managed to pull this off?
<FromGitter> <extremety1989> guys i need help,
<FromGitter> <extremety1989> how can i add params here
<FromGitter> <extremety1989> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a148f262837ee5106b0eaa3]
<FromGitter> <extremety1989> i want statement like
<FromGitter> <extremety1989> select id,data from notes where id=$1
<FromGitter> <extremety1989> well i just figured it out hahaha
<FromGitter> <extremety1989> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a148feacc1d527f6b9c0afa]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
greengriminal has quit [Remote host closed the connection]
greengriminal has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
aroaminggeek has joined #crystal-lang
vivus has joined #crystal-lang
baweaver has left #crystal-lang ["Textual IRC Client: www.textualapp.com"]
snsei has quit [Remote host closed the connection]
<FromGitter> <sam0x17> @elorest traditionally its been super hard to get non-profit status as a software-oriented organization. Let's Encrypt pulled it off because it was a public spectacle pulled off by industry big wigs with very good lawyers. That said, I would definitely give it a try at least.
<FromGitter> <sam0x17> there's a slashdot article somewhere about how lots of orgs get denied if they are software-oriented
<FromGitter> <elorest> Makes sense. Just a thought.
<FromGitter> <elorest> I have 4 empty spots in my google suite account.
watzon_ has joined #crystal-lang
greengriminal has quit [Quit: Leaving]
<FromGitter> <jwaldrip> When does "can't declare module dynamically" get thrown. Looking at the specs, it looks like its only when a module is within an if statement or a def. Can a module be defined within a macro that is called from another macro?
watzon_ has left #crystal-lang ["Good Bye"]
watzon_ has joined #crystal-lang
<FromGitter> <jwaldrip> Well... I must be messing up... https://carc.in/#/r/34mg
<FromGitter> <jwaldrip> Because that works
<Papierkorb> why wouldn't it work
<FromGitter> <jwaldrip> I must have my module definition in a conditional. Im combing through my real code.
<FromGitter> <jwaldrip> That was just an example to ensure that it does in fact work.
<Papierkorb> Macros aren't magic in what they do. They operate on the AST, so everything you can express as AST (Which is any kind of full Crystal expression), you can express as macro. Everything that doesn't operate on the AST in turn can't create new AST nodes to be processed. The latter kind are things that run at run-time, e.g., `if`, `def`, etc
<Papierkorb> That's all regarding their rule-set on what they can/can't do. If something fits in one category and it's not possible, it's likely a bug.
<FromGitter> <HCLarsen> Hey guys, I get an error whenever I try to run or build a crystal program with the --release flag. Is this a known issue, or should I open an issue on github?
<FromGitter> <crisward> it's known
<FromGitter> <HCLarsen> Ok, thanks.
<Papierkorb> Mac?
<hightower3> Is it possible to load a shared lib compiled from Crystal into a C-native program?
<FromGitter> <crisward> use --no-debug as a work around
<FromGitter> <HCLarsen> Ubuntu.
<RX14> hightower3, yes but you can't really do anything once you've loaded it
<FromGitter> <HCLarsen> @crisward do you mean using --no-debug as well as --relase, or in place of it?
<FromGitter> <crisward> yep
<FromGitter> <crisward> as well
<RX14> also you can't load 2 crystal shared libs into a C program
<FromGitter> <HCLarsen> Ok, thanks.
<RX14> which kinda makes it pointless
<RX14> so just dont do it hightower3
<hightower3> RX14, haha, interesting, OK, thanks
<FromGitter> <HCLarsen> Worked perfectly, thanks.
<FromGitter> <crisward> It's an llvm bug, hopefully sorted in the next release.
<FromGitter> <HCLarsen> Good to know.
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<FromGitter> <bew> RX14 why you can't have 2 shared libs in a C program? because GC & libevent?
<RX14> i think so
<FromGitter> <bew> did you actually tried ? or just speculating
<FromGitter> <bew> 'cause I also wondered some time ago how/what it would do in this case but didn't actually tried myself
astronav_ has joined #crystal-lang
astronav_ has quit [Remote host closed the connection]
<FromGitter> <HCLarsen> How do you display a Time object in the correct time zone?
<FromGitter> <bew> iirc we don't handle timezone for now (not sure though)
<FromGitter> <HCLarsen> Yikes.