ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.29.0 | 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
Dreamer3 has joined #crystal-lang
Dreamer3 has quit [Client Quit]
DTZUZO has quit [Ping timeout: 248 seconds]
duane has joined #crystal-lang
alex`` has quit [Ping timeout: 245 seconds]
alex`` has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
rkeene has joined #crystal-lang
<rkeene> I have returned. You're welcome.
<FromGitter> <watzon> Aww, and we were having so much fun
<FromGitter> <watzon> Lol
<rkeene> :-D
<FromGitter> <watzon> Well it works
<rkeene> It's a bit more fancy than that
<rkeene> Some things to consider: 1. It's running on my server and allows arbitrary code execution; 2. JavaScript closures are converted to Tcl lambdas so you can build NodeJS with no Node: http://www.rkeene.org/viewer/tmp/edonjs.js.htm
devil_tux has quit [Ping timeout: 246 seconds]
<rkeene> Also, it's colorful if you do console.debug()
<rkeene> and 3. It knows how to convert to/from Tcl data types: JSON.stringify(runtime.array.get('tcl_platform'))
<FromGitter> <watzon> Oh nice :)
<rkeene> It's a pretty interesting blend of two different languages that actually ended up working out
<rkeene> runtime.after(1000, function() { console.debug('Running in the event loop'); }) that's the Tcl after(n) command ( https://www.tcl.tk/man/tcl8.6/TclCmd/after.htm ) running a JavaScript lambda that's been automatically translated
<rkeene> There's even a C compiler thrown in there, in case you're into that sort of thing
duane has quit [Ping timeout: 246 seconds]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
ua_ has joined #crystal-lang
ua has quit [Ping timeout: 268 seconds]
go|dfish has joined #crystal-lang
rohitpaulk has joined #crystal-lang
DTZUZO has joined #crystal-lang
<FromGitter> <mavu> I appologize in advance, but it is just too much fun to annoy /r/ruby people with mentioning crystal whenever sorbet comes up :)
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
alex`` has quit [Ping timeout: 272 seconds]
alex``` has joined #crystal-lang
<FromGitter> <acoolstraw> hi
<alex```> yo
<alex```> Blacksmoke16 why crystal book is so slow to merge pr? :|
<FromGitter> <acoolstraw> is there any 3D model of the crystal logo available?
<alex```> it's really discouraging to make pr
laaron- has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
duane has joined #crystal-lang
<FromGitter> <Blacksmoke16> hm?
<FromGitter> <Blacksmoke16> @acoolstraw https://crystal-lang.org/media/, doesn't include a 3D model tho...
<FromGitter> <Blacksmoke16> prob because afaik only the core members can
lucasb has joined #crystal-lang
<FromGitter> <Blacksmoke16> neat, should that be added to the media page?
<FromGitter> <acoolstraw> thanks
<FromGitter> <acoolstraw> how many sides is it actually 🤔
<FromGitter> <Blacksmoke16> https://crystal-lang.org/ could spin that one around and count them 😆
<FromGitter> <r00ster91> it has 20 faces
<FromGitter> <benrivero> Hi Everyone
<FromGitter> <benrivero> I have been searching over Google and can't find a solution to this: I am making a report, on the Details part of the report there's a data that sometimes can have a lot of text. But this text doesn't show up
<FromGitter> <benrivero> This is a capture of my report: https://ibb.co/PckkbLB
<FromGitter> <malkomalko> Anybody have a good resource on deploying a crystal web app to production?
<FromGitter> <benrivero> I don't know if is posible that the detail rows can have a dynamic height
<FromGitter> <benrivero> thanks in advance
<FromGitter> <DRVTiny> @benrivero this irs channel is about Crystal language, not Crystal reports
<FromGitter> <benrivero> Thanks @DRVTiny
<RX14> alex```, just takes someone having some free time :)
laaron- has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<FromGitter> <alcatrazire_twitter> Is it possible to create an OAuth2 server in Crystal?
<FromGitter> <Blacksmoke16> yes but afaik it hasnt been done yet
<FromGitter> <Blacksmoke16> are prob plenty of examples to reference
<FromGitter> <acoolstraw> I thought so, as an icosohedron usually has 20
<FromGitter> <acoolstraw> thanks
<FromGitter> <watzon> I don't understand why `include Module::Name` doesn't include it's class properties
<FromGitter> <watzon> https://carc.in/#/r/73m1
moei has joined #crystal-lang
<RX14> because thats not how it works
<RX14> you need to use extend for that
<FromGitter> <Blacksmoke16> that doesnt work either
<z64> include & extend works on instance methods of the parent module, not the class methods that class_* macros define https://carc.in/#/r/73mq
<RX14> well, it does what extend does
<RX14> you can never extend the class methods of an existing module
<RX14> you need to create a module which you use with extend
<FromGitter> <watzon> That's what I'm saying, I don't like that behavior. I know Crystal and Ruby are two islands, but Ruby allows the inclusion of everything, class and instance methods, properties, etc.
<FromGitter> <watzon> Oh well
<RX14> ary would be the one to answer that
<RX14> but
<RX14> i doubt it'll change
<FromGitter> <watzon> I doubt it too
<RX14> it's just one of those opinion things where sometimes you want to inherit cvars and sometimes you don't
<FromGitter> <watzon> But it would be nice
<RX14> we have the ability - albeit more verbosely with extend
<RX14> it's just tradeoffs and speculation of common usecasesd
<RX14> so making any change ends up not worth it
<FromGitter> <watzon> Yeah
<FromGitter> <watzon> Question, is there something existing in crystal that replicates Ruby's `enum_for
<FromGitter> <watzon> Basically taking a method with a block and turning it into a method that spits out an Enumerable
<RX14> no
<RX14> there was talk of adding it but it'd involve using fibers and channels
<RX14> and it was slow so it never got merged
<FromGitter> <watzon> Ahh I see
<oprypin> what do u mean using fibers and channels
<oprypin> Nim is doing it without and is very well off
<RX14> well you can do it with complex compiler state machine transforms, yes
<RX14> do people care to add such complexity to the crystal compiler? no
<oprypin> well they should
<RX14> do it yourself then
<oprypin> haha
<RX14> exactly
<oprypin> also C# and JavaScript and Python, of course
<RX14> But seriously, I'd love it if someone implemented it
<RX14> Realistically that's a post 1.0 feature though
<oprypin> or, if u wanna make it actually well integrated, pre-1.0
<RX14> Crystal has a lot of fancy control flow which makes it hard
<RX14> Well we could make 1.0 perfect and never release it
<oprypin> i think that 1.0 is not even that big of a deal when there is no incremental compilation
dostoyevsky has quit [Quit: leaving]
dostoyevsky has joined #crystal-lang
<RX14> Why? Rust still doesn't have it oprypin
<oprypin> wat
<RX14> Pretty sure they dont
<oprypin> from what i see, they do, since relatively recently
<RX14> Oh, well then
<RX14> Grats to them
<RX14> Ultimately, people don't care how you get fast compiles as long as compiles are fast
<RX14> Crystal compiler still compiles on my laptop in 20s with a warm cache
<oprypin> in Google one gets a different perspective
<RX14> Which is amazing for about 100kloc
<RX14> Maybe, but not everyone gets the privilege
<oprypin> we compile literally everything every time but then literally everything is cached 😂
<RX14> All we can compare to is other languages which are in the open
<RX14> Not, googles custom tooling
<oprypin> it's all in the open tho :p
<RX14> And still not everyone uses it
<RX14> So clearly its not too priority
<RX14> Top*
<RX14> I'm still amazed that the compiler without any caching techniques is as fast as it is
<oprypin> im just saying, "google will never seriously consider it" is not a good place to be
<RX14> Ok
<FromGitter> <j8r> bazel is in Java :o
<RX14> I'm not saying it's not important or I'm not keeping it in mind
<RX14> But, it'll take a while
<RX14> Its not a 1.0 blocking feature to be ready for google
<oprypin> RX14, im somehow convinced that incremental compilation will never happen
<FromGitter> <j8r> Why everyone talk about this, shared libraries are as important
<FromGitter> <j8r> This will prevent to recompile project libraries
<RX14> oprypin: I'm 50/50
<RX14> Which aren't great odds
<RX14> But what else can i do? Give up?
<RX14> Not everything can be perfect
<oprypin> do what's needed to ensure that it's possible, before it's too late
<RX14> Yeah, that's what I've been pushing but nobody seems to listen
<RX14> I know bcardiff wants it
<RX14> And is probably the only one who can implement it in the near term
<RX14> But he seems to always work on other things
<FromGitter> <j8r> Is there a vote on Crystal, "what's youe most awaited feature?"
<FromGitter> <j8r> I know there was one in 2017
<oprypin> j8r, probably has been done before, but it's hard to make such a vote not biased
<oprypin> the decision whether to group some semi-related features in the vote is hard
<oprypin> (from what i remember, that was done poorly)
* FromGitter * Blacksmoke16 most wants less broken generic inheritance
<FromGitter> <j8r> We could open a forum post,
<FromGitter> <watzon> Does the forum currently have a polling option?
<FromGitter> <j8r> IMO that's important to have goals on par with the people expectations
<FromGitter> <Blacksmoke16> prob
<oprypin> i've probably said this before, but incremental compilation implies not being able to instantiate methods with types that haven't been used before
<oprypin> j8r, eh in most OSS projects people just do what's interesting, anyway
<FromGitter> <watzon> Ahh beautiful
<FromGitter> <j8r> oprypin right, still when we have several interesting things :)
<oprypin> RX14, so actually could the first step towards it be the ability for the compiler to instantiate methods less granularly / group things by nearest base class and such
<oprypin> bah it's all been said before
<oprypin> then someone says yeah but that's not backwards-compatible
<oprypin> aha, so Nim doesn't have incremental compilation. nor surprising, they have all the same problems, and then some
<oprypin> not*
<RX14> oprypin: the key ability for me is to be able to type methods with fully specified type signatures
<RX14> That's not something the compiler can currently do, and it should be able to
<oprypin> I didn't understand that
<RX14> Fixing that is a breaking change but an edge case one
<RX14> One that people wouldn't notice much
<RX14> That's what i want in before 1.0
<RX14> It also improves a lot of things that other people complain about like uncalled methods not being type checked or compile errors being too long
<oprypin> i didn't understand what you just said
<oprypin> from the first sentence
<RX14> I'm on my phone I'm not going to explain actually what the change is
<FromGitter> <watzon> I'm curious too. what do you mean by "fully specified type signatures"?
lucasb has quit [Quit: Connection closed for inactivity]
hightower2 has joined #crystal-lang
<hightower2> Hey, is there any crystal-preferred code repository platform other than github?
<FromGitter> <watzon> Gitlab?
<FromGitter> <watzon> Ok so is there any way to do this? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ currently it fails with `can't use `yield` inside a proc literal or captured block`, which I don't get because `headers.each` is literally doing the same thing. [https://gitter.im/crystal-lang/crystal?at=5d0d358fbc834f76a4ba27fa]
<FromGitter> <Blacksmoke16> `every_page.map(&.headers).each { |header| yield headers }`?
<FromGitter> <watzon> Well yeah I suppose I could do that for the sake of brevity. I just don't get why the second one works and the first doesn't.
<hightower2> What does "->" do in a line "def files(&block : String ->)" ?
<FromGitter> <Blacksmoke16> return type from a block
<hightower2> yes, but which type is the return type ?
<FromGitter> <Blacksmoke16> doesnt matter
<FromGitter> <Blacksmoke16> would be more clear to do `String -> _`
<hightower2> would it work if "->" wasn't specified at all?
<FromGitter> <Blacksmoke16> im going to go with no
<FromGitter> <Blacksmoke16> since then it wouldnt be a block restriction?
<FromGitter> <watzon> > every_page.map(&.headers).each { |headers| yield headers } ⏎ ⏎ actually this doesn't work because `every_page` expects a block as well
<FromGitter> <Blacksmoke16> wait really?
<FromGitter> <Blacksmoke16> mm well makes sense i guess
<FromGitter> <Blacksmoke16> yea
<FromGitter> <watzon> This works, but it's terrible ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d0d378d7456db0bb82d2d9f]
<FromGitter> <Blacksmoke16> can you make a quick playground link with this?
<FromGitter> <Blacksmoke16> i have an idea
<FromGitter> <Blacksmoke16> er nvm
<FromGitter> <Blacksmoke16> i dont think it would work
<FromGitter> <watzon> What was the idea?
<FromGitter> <Blacksmoke16> do something with the like `&->` operator,
<FromGitter> <Blacksmoke16> but i dunno if its what we want
<FromGitter> <Blacksmoke16> thats used moreso for passing each item to a method as a proc
<FromGitter> <watzon> How would it work? I'm not familiar with that syntax
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/73nm
<FromGitter> <Blacksmoke16> passes each item in the array to the given method
<FromGitter> <Blacksmoke16> kinda silly example since you could just do `&.upcase` but you get the idea
<FromGitter> <watzon> Ahh interesting
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<hightower2> interesting
<FromGitter> <watzon> This is one reason a `to_enumerable` would be nice to have
<FromGitter> <watzon> That or just allow `yield` inside of captured blocks
<FromGitter> <watzon> Still don't get why it works with `each` though, because that's a captured block as well
<oprypin> watzon, please provide a runnable code sample
<oprypin> the most likely thing is that the problem is with `every_page` but you didnt even provide it
hightower2 has quit [Ping timeout: 258 seconds]
<FromGitter> <watzon> I did, but here it is again ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d0d4d1c7456db0bb82de4be]
<oprypin> what.
<oprypin> no. full runnable example, please
<FromGitter> <watzon> Just a sec, I'm making a runable playground
<oprypin> thanks
<oprypin> but yeah you're right that the method was shown before
<FromGitter> <watzon> Here's the playground https://carc.in/#/r/73nu
<oprypin> yep, that method captures the block, that's the issue
<FromGitter> <watzon> Is there a way that can be done without creating an array of pages and then yielding each item?
<FromGitter> <watzon> Doesn't `Enumerable#each` capture the block too?
<oprypin> well it's abstract first of all.
<oprypin> Indexable.each doesn't, for example def each
<oprypin> capturing the block is all about whether you ever refer to the `block` variable inside the method body
<FromGitter> <watzon> Ahh ok
<FromGitter> <watzon> So it's just not possible without creating the array of elements
<oprypin> im actually having such a hard time understanding the code
<oprypin> maybe there is but not like this
<FromGitter> <watzon> Oh well, I'll do it the ugly way for now
<FromGitter> <watzon> Maybe once this project is out someone will find a better way
duane has quit [Ping timeout: 272 seconds]
FromGitter has quit [Ping timeout: 264 seconds]
oprypin has quit [Ping timeout: 252 seconds]
oprypin has joined #crystal-lang
FromGitter has joined #crystal-lang