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
hightower3 has joined #crystal-lang
<FromGitter> <mverzilli> well "reverse engineering" is a very poor choice of terminology :P, it'd be more "capturing"
hightower2 has quit [Ping timeout: 240 seconds]
hightower4 has joined #crystal-lang
hightower3 has quit [Ping timeout: 240 seconds]
<FromGitter> <nickbclifford> can someone help explain the usage of `fun` outside of a `lib` declaration to me?
<FromGitter> <nickbclifford> I've seen it used in some issues as a way to mess with the definition of `main`
<FromGitter> <nickbclifford> but I don't fully understand how that works
hightower4 has quit [Ping timeout: 260 seconds]
hightower4 has joined #crystal-lang
rohitpaulk has joined #crystal-lang
hightower4 has quit [Ping timeout: 240 seconds]
Philpax has joined #crystal-lang
<crystal-gh> [crystal] asterite closed pull request #5017: Remember STDIN, STDOUT and STDERR blocking state when program begins and restore it at the end (master...bug/2713-fix-blocking) https://git.io/vdvMu
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vdqtb
<crystal-gh> crystal/master ef7fe20 TSUYUSATO Kitsune: Remove 'macro def' related code from lexer.cr...
<crystal-gh> crystal/master 7aa1a08 Ary Borenszweig: Merge pull request #5043 from MakeNowJust/fix/crystal-lexer/follow-remove-macro-def...
rohitpaulk has quit [Ping timeout: 248 seconds]
tilpner has quit [Quit: :wq]
tilpner has joined #crystal-lang
_whitelogger has joined #crystal-lang
<travis-ci> crystal-lang/crystal#6e0e4e8 (master - Merge pull request #5017 from asterite/bug/2713-fix-blocking): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/280221912
<travis-ci> crystal-lang/crystal#7aa1a08 (master - Merge pull request #5043 from MakeNowJust/fix/crystal-lexer/follow-remove-macro-def): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/280222191
rohitpaulk has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
rohitpaulk has quit [Ping timeout: 248 seconds]
hightower2 has joined #crystal-lang
DTZUZU has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
ShalokShalom has quit [Ping timeout: 248 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
rohitpaulk has quit [Ping timeout: 252 seconds]
rohitpaulk has joined #crystal-lang
danielpclark has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
DTZUZU has joined #crystal-lang
rohitpaulk has joined #crystal-lang
snsei has joined #crystal-lang
<FromGitter> <codenoid> finally, crystal and @ysbaddaden selenium used in my office <3
snsei has quit []
<FromGitter> <elorest> Is there such a thing as a private macro?
sp4rrow has joined #crystal-lang
Philpax has quit [Ping timeout: 240 seconds]
cerulean_ has joined #crystal-lang
vegai_ has joined #crystal-lang
shelvac2 has joined #crystal-lang
kubaxvx_ has joined #crystal-lang
stnly_ has joined #crystal-lang
BlaXpirit has joined #crystal-lang
snsei has joined #crystal-lang
rohitpaulk has quit [*.net *.split]
hightower2 has quit [*.net *.split]
cerulean has quit [*.net *.split]
vegai has quit [*.net *.split]
minus has quit [*.net *.split]
baweaver has quit [*.net *.split]
shelvacu has quit [*.net *.split]
kubaxvx has quit [*.net *.split]
fiete has quit [*.net *.split]
oprypin has quit [*.net *.split]
Poeticode has quit [*.net *.split]
stnly has quit [*.net *.split]
BlaXpirit is now known as oprypin
baweaver has joined #crystal-lang
baweaver has quit [Changing host]
baweaver has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Poeticode has joined #crystal-lang
tatey has quit [Ping timeout: 240 seconds]
Philpax has joined #crystal-lang
tatey has joined #crystal-lang
minus has joined #crystal-lang
hightower2 has joined #crystal-lang
fiete has joined #crystal-lang
Philpax has quit [Ping timeout: 255 seconds]
hightower3 has joined #crystal-lang
hightower2 has quit [Ping timeout: 240 seconds]
alex`` has joined #crystal-lang
hightower3 has quit [Ping timeout: 252 seconds]
hightower3 has joined #crystal-lang
hightower3 has quit [Ping timeout: 246 seconds]
hightower3 has joined #crystal-lang
hightower4 has joined #crystal-lang
snsei has quit [Remote host closed the connection]
hightower3 has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
<FromGitter> <faustinoaq> > <oprypin> what's your use case? ⏎ ⏎ None, I was reading flow documentation, and then I ask me if there is something similar on Crystal, but the @mverzilli answer solved my question. 👍
<FromGitter> <faustinoaq> > can someone help explain the usage of `fun` outside of a `lib` declaration to me? ⏎ ⏎ I think the `fun` usage outside libs is very limited, `fun` doesn't support overloading and only support basic types, I think it is more like a C function, thinking on shared libraries or similar stuff.
<FromGitter> <faustinoaq> By example an use case is Writing a dynamic library in Crystal, and calling it from C (https://gist.github.com/Papierkorb/02d6ba53c28b5035a80bf7695f4706bb)
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
hightower4 has quit [Ping timeout: 246 seconds]
<FromGitter> <faustinoaq> @nickbclifford 👆
<FromGitter> <pawandubey> @bew Sorry for the late reply. Yes I saw your wiki - pretty good. I didn't do so much research. I knew that I wanted to parse PEGs, and I liked the DSL of Parslet. I looked at D's Pegged, Clojure's Instaparse, Haskell's Earley and a couple from Go. Although I didn't spend much time ruminating and went to implementation.
<oprypin> elorest, you can put a macro in a private module
femto has joined #crystal-lang
<FromGitter> <ekremkaraca> Morning 🌄👋
<FromGitter> <ekremkaraca> I am now trying to install Crystal via Linuxbrew
<FromGitter> <ekremkaraca> I think we should include it to the book
<FromGitter> <sdogruyol> Morning everyone
<FromGitter> <ekremkaraca> Llvm is too big: 3 GB
<FromGitter> <ekremkaraca> Why did I add --with-llvm option
<FromGitter> <ekremkaraca> I am so pişman :(
<FromGitter> <sdogruyol> lol
<FromGitter> <ekremkaraca> Finally I have built it in 14 min 12 sec
<FromGitter> <sdogruyol> you have some low specs?
<FromGitter> <ekremkaraca> I wonder what llvm source contains?
<FromGitter> <ekremkaraca> Yep
<FromGitter> <sdogruyol> LLVM is a beast, lots of C++
<FromGitter> <ekremkaraca> 6GB ram with i5
<FromGitter> <sdogruyol> CPU?
<FromGitter> <ekremkaraca> 4x with 2 ghz
<FromGitter> <sdogruyol> that must be the cultprit
<FromGitter> <ekremkaraca> I bought it in 2011
<FromGitter> <sdogruyol> yeah
<FromGitter> <sdogruyol> that explains
Papierkorb_ has joined #crystal-lang
snsei has quit [Remote host closed the connection]
mark_66 has joined #crystal-lang
flaviodesousa has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
femto has quit [Ping timeout: 260 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
Philpax has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Groogy> Morning!
femto has joined #crystal-lang
<femto> class Hierarchy def foo end def self.methods {{@type.methods}} # using all_subclasses for illustration end end class A < Hierarchy; end class B < A; end class C < B; end puts Hierarchy.methods
<femto> how do I get all the methods of a class?
<Groogy> doesn't it show there?
<femto> Syntax error in expanded macro: macro_4594465744:1: can't define def inside def [def foo ^ ================================================================================ {{@type.methods}} # using all_subclasses for illustration
<femto> in src/hello2.cr:11: macro didn't expand to a valid program, it expanded to: ================================================================================ -------------------------------------------------------------------------------- 1. [def foo 2. end]
claudiuinberlin has joined #crystal-lang
<Groogy> you probably have to do something more sensible than {{@type.methods}} since that probably just expands into the methods own defintion it seems
<Groogy> methods is a collection of ASTNodes is my guess you probably have to create a macro that converts them to like an array of strings
<Groogy> or similar
<FromGitter> <crisward> @sdogruyol morning! - finally got around to adding this to github - https://github.com/crisward/mailer
<FromGitter> <sdogruyol> wow congrats @crisward 🎉
rohitpaulk has joined #crystal-lang
<FromGitter> <bew> femto, use `@type.methods.map &.name.stringify`
hightower2 has joined #crystal-lang
<FromGitter> <bew> What is this type syntax `*{Int32, Int32}` (from https://github.com/crystal-lang/crystal/issues/5037#issuecomment-332381702)
<FromGitter> <bew> Should it mean something specific in his example?
<FromGitter> <sdogruyol> deconstructing the tuple?
<FromGitter> <sdogruyol> (haven't looked at the issue)
<FromGitter> <bew> Look at it
<FromGitter> <bew> It's use in `def bla(*arg : *{Int32, Int32})`
hightower3 has joined #crystal-lang
hightower4 has joined #crystal-lang
<oprypin> bew, it's invalid syntax, hence the error
hightower2 has quit [Ping timeout: 260 seconds]
<oprypin> except that the compiler should say invalid syntax not break
hightower3 has quit [Ping timeout: 240 seconds]
hightower4 has quit [Ping timeout: 240 seconds]
<FromGitter> <bew> Okay, makes sense
<Papierkorb_> Morning
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <sdogruyol> Morning @papilip
<FromGitter> <sdogruyol> ah wrong @Papierkorb
<FromGitter> <papilip> Morning @sdogruyol
<FromGitter> <sdogruyol> morning to you too @papilip :) Sorry for the wrong mention btw
<FromGitter> <papilip> ok
<FromGitter> <papilip> gyhave a goog day
femto has quit [Ping timeout: 260 seconds]
<FromGitter> <sdogruyol> thank you 😄
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Papierkorb_> Hi sdogruyol!
<FromGitter> <bararchy> I hate C bindings
<FromGitter> <bararchy> hahaha
<FromGitter> <bew> @bararchy why? ˆˆ
<FromGitter> <bew> @oprypin good catch, thanks
<FromGitter> <bararchy> @bew working on getting crystal-fann to support Float64 instead of Float32, the underlying C lib gives me trubles and I don't really know why :\ ⏎ https://github.com/NeuraLegion/crystal-fann/issues/6
<FromGitter> <bararchy> so annoying :(
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
<FromGitter> <bew> Ah, no idea how I could help, I don't understand anything about what you'r doing! 😂
<FromGitter> <bararchy> lol, it's just something stupid , I guess I need something to be a float ...
claudiuinberlin has joined #crystal-lang
<FromGitter> <bararchy> Is there a way to automagiclly cast Array(Float64) to Array(Float32) ?
<FromGitter> <bew> With a `map`?
<FromGitter> <bew> You can't automagically do that
<FromGitter> <bew> Plus, I think you need to save the generated array before sending it to the lib (to prevent it being collected by the gc while in us in the lib)
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
rohitpaulk has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fiete has quit [Remote host closed the connection]
fiete has joined #crystal-lang
RX14 has quit [Excess Flood]
RX14 has joined #crystal-lang
Philpax has quit [Ping timeout: 246 seconds]
RX14 has quit [Excess Flood]
RX14 has joined #crystal-lang
Philpax has joined #crystal-lang
_whitelogger has joined #crystal-lang
DTZUZO has joined #crystal-lang
<FromGitter> <bararchy> Something I would really like in specs, it to have a ⏎ ⏎ ```on_fail do ⏎ puts debug_info ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=59cb88147b7d98d30d4105f3]
<FromGitter> <bararchy> this way I don't need to just print stuff out if I dont need it
<FromGitter> <bararchy> only if specs fails
<FromGitter> <codenoid> btw, ⏎ ⏎ ```puts "slay"``` [https://gitter.im/crystal-lang/crystal?at=59cb8886f7299e8f537a5ff3]
<FromGitter> <codenoid> btw, ⏎ ⏎ ```puts "slay" ⏎ exit 0 ⏎ at_exit { puts "bye" }``` ⏎ ⏎ why `at_exit` should be above `exit` [https://gitter.im/crystal-lang/crystal?at=59cb88aeb20c64242991ab41]
<FromGitter> <sdogruyol> you call exit before declaring at_exit
xiljin has joined #crystal-lang
<oprypin> codenoid, at_exit is a method. in your example it's never called
<FromGitter> <codenoid> but, "I will do `at_exit`, when I `exit` " :/ 👍
<FromGitter> <sdogruyol> why not moving at_exit line up?
<FromGitter> <codenoid> I am just asking :shipit:
claudiuinberlin has joined #crystal-lang
<FromGitter> <bararchy> @codenoid you can also ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59cb95747b7d98d30d41612b]
<FromGitter> <bararchy> I wouldn't do that, but it's a posibilty
<FromGitter> <bew> Huh
<FromGitter> <bew> Not in Crystal
<FromGitter> <bararchy> wouldn't work ?
<oprypin> undefined constant SystemExit
<FromGitter> <bew> Exit doesn't raise an exception
<FromGitter> <bararchy> Oh..
<FromGitter> <bew> It simply exits!
<FromGitter> <bararchy> In Ruby this: ⏎ ⏎ ```exit ⏎ SystemExit ⏎ ``` [https://gitter.im/crystal-lang/crystal?at=59cb967fb59d55b82342b810]
<FromGitter> <bararchy> So I guess in this regard it's not comptabile
<FromGitter> <bararchy> @codenoid Sorry for misleading
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
<crystal-gh> [crystal] asterite closed pull request #4852: Improve #4708 (master...fix/crystal/to-s-comparison-correctly) https://git.io/v5vvl
rohitpaulk has quit [Ping timeout: 255 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] asterite opened pull request #5046: Remove XML.escape (master...feature/5045-remove-xml-escape) https://git.io/vdqhd
rohitpaulk has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
hightower2 has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter> <codenoid> tidak masalah @bararchy , thanks for sharing ✨
rohitpaulk has joined #crystal-lang
<FromGitter> <codenoid> no problem @bararchy , thanks for sharing ✨
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter> <paulcsmith> Is there a way to rescue compile time errors in order to provider more info to the user? I've found that in some of the libraries I'm writing the compile time errors would be a lot more helpful with a little more info. So instead of something like "must return LuckyWeb::Response not WhateverType" it could say that *and* "that usually means you need to call `render` or `redirect` at the end of your action"
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
Papierkorb_ has quit [Quit: Konversation terminated!]
<oprypin> paulcsmith, no u cant rescue, but maybe u can anticipate those cases and make them nonfatal but with a manual {% raise "" %} in them
<oprypin> needs an example to say more
<oprypin> if return_result.is_a? LuckyWeb::Response; good stuff; else; {% raise
<FromGitter> <paulcsmith> @oprypin thanks for the suggestion. Here's a more thorough example: https://gist.github.com/paulcsmith/3282626b39c0ba626db3e135bc1a66a2
flaviodesousa has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<FromGitter> <paulcsmith> Does that make more sense now? `render` and `redirect` both return a `LuckyWeb::Response`
<oprypin> paulcsmith, nah has to be a runnable exammple
<FromGitter> <paulcsmith> Ok one sec. I"ll try to put something together
<oprypin> i suspect that action has like `&block : -> LuckyWeb::Response`
<oprypin> in which case add another one with `&block : -> _` that has `{% raise "foo" %}` as its body
<oprypin> also `# :nodoc:` it. not sure if it's worth it tho
snsei has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <paulcsmith> @oprypin https://play.crystal-lang.org/#/r/2t8s is a runnable example
<FromGitter> <paulcsmith> In this case it's fairly clear you need render but in the framework it's less clear what a LuckyWeb::Response is since you never directly instantiate it. You always use `render/redirect/etc.`
<oprypin> yeah that's not possible to intercept
<oprypin> but you do have the ` : Response` part clearly there
<oprypin> what if you didnt have it
claudiuinberlin has joined #crystal-lang
sz0 has joined #crystal-lang
<FromGitter> <paulcsmith> Yeah the tricky part is that you don't generate the responses directly so framework user's may not realize what they need to do. If you don't have it it will still require a Response, but the error is even less clear. Here is an example https://play.crystal-lang.org/#/r/2t8w
<FromGitter> <paulcsmith> @oprypin Oh yeah that might do the trick
<FromGitter> <paulcsmith> Very cool. Thank you :)
<FromGitter> <paulcsmith> I didn't realize you could do a raise like that at compile time. That's pretty slick
<oprypin> just another thing that is not mentioned anywhere
<FromGitter> <paulcsmith> I can probably use this in some other places to make things nicer. I like it!
<Papierkorb> #raise can also be called on an ASTNode, making it point where the user f'd up
<FromGitter> <paulcsmith> Too bad it's not documented but it is a more niche feature so I understand why it isn't easier to find
<FromGitter> <paulcsmith> Papierkorb: I'm not sure I understand. What do you mean?
<oprypin> not sure if it's applicable here?
<Papierkorb> May not be the case, maybe through a code rework
<oprypin> paulcsmith, it is technically documented but you gotta know where to look https://crystal-lang.org/api/0.23.1/Crystal/Macros.html#raise%28message%29%3ANoReturn-instance-method
<Papierkorb> paulcsmith, `macro foo(bar); {% bar.raise "One does not simply call foo" %}; end`, then call that macro and see the magic happen
<FromGitter> <paulcsmith> Awesome! I'm not sure I can use that in this example, but I've got some other parts where that may work
rkeene has joined #crystal-lang
<rkeene> Any planned support for concurrent threads in Crystal ?
<Papierkorb> It's planned
<rkeene> Suite
<FromGitter> <bew> Concurrency is already possible (https://crystal-lang.org/docs/guides/concurrency.html) parallelism is not, but planned
<rkeene> Has there been any progress on bootstrapping Crystal onto a system without Crystal ?
<Papierkorb> Oh I remember when you were around. No progress aimed towards that, but Crystal can now compile statically, including the compiler itself (as in, producing a static compiler binary)
<Papierkorb> So maybe that helps to some extent
<rkeene> Are the static binaries hosted anywhere and support more than 2 platforms ?
<rkeene> If so, it might !
<Papierkorb> You should ask RX14
<rkeene> It's not as good as bootstrapping, but way better than the situation before
<RX14> rkeene, why would static vs dynamic binaries make a difference?
<RX14> all of the libraries crystal links to can be bootstrapped from gcc
rohitpaulk has joined #crystal-lang
<RX14> therefore using a dynamic binary + building deps you have the exact same situation
<Papierkorb> Well iirc rkeene builds systems aimed at working for a decade or so, so a static binary may actually be beneficial
<rkeene> Building the exact set of dependencies Crystal requires would be tedious, since you have to build from libc up
<RX14> well surely other dependencies require libc
<RX14> so you have that around already
<Papierkorb> Even if it's just to get around the brutally outdated glibc's some systems ship with.
<RX14> i fail to see how a dynamic crystal downloaded from the internet is any different from any other dynamic executable
<rkeene> I don't download any other executable from the Internet
Philpax has quit [Ping timeout: 240 seconds]
<RX14> well then static binaries dont help
<RX14> you're still downloadeng it from the internet whether it's static or not
<rkeene> They would help guarentee that the downloaded binary would run (modulo kernel ABI changes)
<rkeene> But in 10 years, the exact same binary will run when statically linked, when dynamically linked to get the same guarentee I have to do the same thing as statically linking it -- which is build the exact same libc, etc
rohitpaulk has quit [Ping timeout: 240 seconds]
<RX14> but this binary is simply an intermediary build step
<RX14> a bootstrap compiler to compile crystal
<RX14> does it really need the same guarantees?
<rkeene> And if it fails to build Crystal then the whole show stops
<RX14> what if in 10 years the download links have changed? will you check in the downloaded build artifact?
<rkeene> And, as we previously discussed, the only thing that can build Crystal version N is Crystal verison N-1
<RX14> if yes, then you might as well statically build your own crystal compiler
<rkeene> I cache everything downloaded by its SHA256
<RX14> which is what I suggested last time
<rkeene> I still have to, in 10 years, be able to compile my own Crystal compiler
<RX14> and to do that you need a crystal compiler
<rkeene> Of the exact same version
<RX14> whether thats in your cache because its from the internet
<rkeene> Right, specifically I need the N-1 Crystal version of the Crystal I'm compiling
<RX14> or whether you built it yourself
<RX14> it doesn't matter
<rkeene> So Crystal N-1 needs to be runnable in 10 years so I can build Crystal N from 10 years ago
<RX14> ok yep i understand now
<rkeene> Hence static linking *AND* supporting more platforms being important to ensure that this is possible
<RX14> you'll want to build your own statically compiled crystal compiler
<RX14> to bootstrap from
<RX14> and then you should be fine
<oprypin> sounds like a fun project - having a collection of all crystal versions statically linked
<rkeene> Well, the question is -- does someone else already do this so I don't have to do it and host the binaries for me to consume ?
<oprypin> jhass has many of the versions but probably normally built - see https://carc.in/
<RX14> no
<oprypin> binaries are not downloadable
<Papierkorb> rkeene: w.r.t platforms, Linux and OpenBSD worked on x86/x64, iirc something worked on ARM too. MacOS is probably not much of your interest (but works fine), Windows doesn't yet.
<rkeene> Papierkorb, Actually, I support compiling my Linux distribution on Mac OS X
<Papierkorb> (I think it was open bsd ... well, it's some BSD for sure)
<rkeene> ./configure && make will correctly produce the installer ISO
<rkeene> (Output is always a Linux/x86_64 distribution installer ISO)
<rkeene> Windows support is also in the works
<rkeene> But Windows is kind of a ghetto, making it more difficult
<Papierkorb> "Windows is kond of a ghetto" this channel is worth joining just for the quotes you read here
<rkeene> It almost works on Linux/arm but LuaJIT is used as a dependency of Sysdig... and LuaJIT is real dumb
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<rkeene> (Compiling the Linux/x86_64 distribution on Linux/arm, that is)
<rkeene> Compiling it on other platforms is mostly to ensure proper build-host isolation is working which helps code quality and reproducibility
Creatornator has joined #crystal-lang
<rkeene> Reproducibility is hard
<RX14> sounds like you're trying hard to make the world perfect
<rkeene> No, just the 400 packages I maintain able to be rebuilt and fixes shipped out to older appliances
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
<FromGitter> <sdogruyol> what OS are you maintaining for?
<FromGitter> <sdogruyol> anything public?
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<rkeene> sdogruyol, It's a commercial appliance
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter> <sdogruyol> thought so
rohitpaulk has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
<FromGitter> <pawandubey> @bew I tried your block capturing macro yesterday and it seems like it doesn't work outside the top-level namespace: https://carc.in/#/r/2syv
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vdmRr
<crystal-gh> crystal/master 215bc2e Ary Borenszweig: Remove XML.escape...
<crystal-gh> crystal/master f9c2e58 Ary Borenszweig: Merge pull request #5046 from asterite/feature/5045-remove-xml-escape...
<FromGitter> <bew> @pawandubey yeah that an issue I knew would happen: as `Block.capture_with_context` is a macro that must receive the block (not a proc), you need to use a macro to forward the block untouched to the macro (using `def bla(&block)` will always create a proc for the block) https://carc.in/#/r/2t9r
<FromGitter> <pawandubey> Ah that's super interesting but also super inconvenient.
<FromGitter> <bew> yeah I know :/ however I don't know how/if we could do better with what we have with the language for that
<FromGitter> <asterite> Just to be clear, there's no way to do it. That macro just pastes the content of the block inside another block, but there's no way to pass a Proc object
<FromGitter> <pawandubey> 👍
<FromGitter> <pawandubey> It would be amazing to be able to change the object which acts as the callsite for the methods inside a captured block. I'm not sure how possible that is as I am not 100% upto date on the literature but it would be a *killer* feature.
rohitpaulk has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] oprypin opened pull request #5047: Expand children of currently selected item in documentation (master...doc-open) https://git.io/vdmE4
cyberarm has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
<travis-ci> crystal-lang/crystal#f9c2e58 (master - Merge pull request #5046 from asterite/feature/5045-remove-xml-escape): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/280515103
rohitpaulk has joined #crystal-lang
<FromGitter> <jamiepirie> Hi there, can anyone point me to any reading material for the following syntax: bit = bit >> 1 (bit being 0x8000_u16 as an example). I'm trying to understand how the crystal implementation of tetris works but I don't really understand the use of bits here.
<FromGitter> <pawandubey> That is right shifting the `bit` value by 1 bit. Effectively dividing by 2.
<FromGitter> <jamiepirie> As simple as that, thanks Pawan.
sz0 has quit [Quit: Connection closed for inactivity]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vdm2k
<crystal-gh> crystal/master 707ad6f Ary Borenszweig: Merge pull request #5047 from oprypin/doc-open...
<crystal-gh> crystal/master 4c225dc Oleh Prypin: Expand children of currently selected item in documentation
<FromGitter> <elorest> <oprypin> Thanks.
Creatornator has quit [Quit: Textual IRC Client: www.textualapp.com]
<oprypin> dont even remember what that was
<FromGitter> <crisward> Anyone know if crystal provides a way of getting the cpu usage of the current process?
<FromGitter> <bew> I don't think so, as it's difficult to be portable about that I think
xiljin has quit [Ping timeout: 240 seconds]
xiljin has joined #crystal-lang
<travis-ci> crystal-lang/crystal#707ad6f (master - Merge pull request #5047 from oprypin/doc-open): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/280530495
<rkeene> libstatgrab FTW
<FromGitter> <bew> oh that's cool rkeene!
<rkeene> I ported it to HP-UX at one point
snsei has quit [Remote host closed the connection]
<FromGitter> <crisward> Thanks... looking into that now.
alex`` has quit [Quit: WeeChat 1.9]
<FromGitter> <bew> I've added it to the library needed if someone want to do it! https://github.com/crystal-community/crystal-libraries-needed/issues/74
<FromGitter> <elorest> Is there anyway to define a function inside of a macro that is called inside of another method? https://carc.in/#/r/2tap
<FromGitter> <pawandubey> I don't think that's currently possible unfortunately :/
<FromGitter> <bew> not like that, but using some macro-fu is should be possible i think
<FromGitter> <bew> but maybe not a good practice..
<FromGitter> <pawandubey> Yeah I think defining methods dynamically is (heavily) discouraged. I'm not even sure how possible that is. (because the error is very specific : can't define def inside def)
<FromGitter> <elorest> It’s not dynamic though since it’s precompiled.
sp4rrow has joined #crystal-lang
<FromGitter> <bew> hum it doesn't work, but I think it should: https://carc.in/#/r/2tay @asterite are you around? what do you think?
<FromGitter> <elorest> I don’t actually want the method to be defined inside of the def… It actually works fine if I call the macro from outside of a method. That’s why I’m trying to define it on a module. I need to like cd outside of the current def and define it lol.
<FromGitter> <ezrast> The compiler doesn't know how many times #name is going to be called
<FromGitter> <elorest> It doesn’t need to know that because the code compiled into it by the macro would be compiled and then called the same every time it was called. The macro doesn’t render dynamically.
<oprypin> bew, great example!!
<FromGitter> <bew> thanks, do you think sth like this should work?
<oprypin> technically yes, but it's too evil
<FromGitter> <elorest> I would prefer it to not be evil lol. All I want is for this to work regardless of where I call the macro. https://carc.in/#/r/2tb8
<FromGitter> <bew> won't work without evil macros I think :p
<FromGitter> <elorest> :(
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
<FromGitter> <elorest> I was just trying to yield a template.ecr into a layout.ecr instead of saving template into content and passing the variable in. I have it working except that I usually render ecr inside of a method.
<oprypin> elorest, why does it have to be a method??
<FromGitter> <elorest> Render is usually used inside of a method. ⏎ ⏎ ```def show ⏎ somelogic ⏎ render(“show.ecr”) ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=59cbed7d210ac269207c4564]
<oprypin> elorest, that's the outer method. but why do u need another inner method?
<FromGitter> <elorest> <oprypin> Here’s some sudo code. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59cbeec1f7299e8f537cee35]
<oprypin> uhhhh calls yield inside, huh
<FromGitter> <elorest> Typically the way this is done in crystal is: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ This is confusing to some people who are used to `yield` for the template inside of the layout. [https://gitter.im/crystal-lang/crystal?at=59cbef3a32fc8b7e40495d34]
<FromGitter> <elorest> It seems possible and I can make it work but I need to be able to call render from inside of an action method. :(
<FromGitter> <elorest> I don’t think there’s anyway to create a block and yield it, and <% = content.call %> would be worse than <%= content %>
<FromGitter> <elorest> So anyway creating a method with fresh names seemed like a good idea until I tested it inside of my action.
sp4rrow has joined #crystal-lang
<FromGitter> <bew> anyone knows where is the "this is a macro call" / "this is a def call" decision in the parser?
<FromGitter> <bew> hmm or maybe it's not in the parser... :/
<oprypin> of course it can't be the parse r
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <bew> yeah I just realized it can't be there
rohitpaulk has joined #crystal-lang
hightower2 has quit [Ping timeout: 248 seconds]
<FromGitter> <bew> thanks @asterite !
<FromGitter> <bew> exactly it's line 268
<FromGitter> <bew> @asterite did you see the discussion above? What do you think about https://carc.in/#/r/2tay ? I think it shouldn't fail like this
<FromGitter> <bew> Should I open an issue so we can discuss this?
<FromGitter> <asterite> macros expanded inside methods happen after "finished" happens
<FromGitter> <bew> oh...
<FromGitter> <asterite> Once methods are typed, the class hierarchy and its methods are fixed
<FromGitter> <bew> yeah it makes perfectly sense
<FromGitter> <asterite> "Once methods are typed" -> "Just before methods are typed"
<FromGitter> <bew> ^^ I didn't read your messages actually, but yes.. so no way to do the intented behavior for @elorest I guess
<crystal-gh> [crystal] bew opened pull request #5049: parser: Fix typo in comment (master...parser-fix-typo) https://git.io/vdm9q
<crystal-gh> [crystal] bew opened pull request #5050: string: Fix typo in documentation of `*` (master...string-fix-doc-typo) https://git.io/vdm98
hightower2 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]
rohitpaulk has quit [Ping timeout: 260 seconds]
sp4rrow has joined #crystal-lang
DeBot has joined #crystal-lang
<FromGitter> <pawandubey> Is there a way of modifying instance variables inside macros?
<oprypin> pawandubey, no. these are entirely runtime values and macros deal entirely with compilettime stuff
<oprypin> pawandubey, you might be interested to know that macros can modify constants and then you can initialize an instance variable with a constant
<FromGitter> <pawandubey> Oh wait, how?
<oprypin> bew, u probably should make one pull request if u know u have multiple typos
<oprypin> pawandubey, https://carc.in/#/r/2tcs
<oprypin> the idea is that the compiletime modification of the constant can only serve as an initializer for all objects that have this instance variable
<oprypin> `normal` is just a normal runtime modifications of the actual instance, but wrapped in a macro. that's technically modifying instance variable inside macros
<FromGitter> <bew> @oprypin okay! I just wanted to make the distinction of a doc typo, and a typo in the code, but I agree it's a bit overkill to make 2 PR for 2 char changed
<FromGitter> <pawandubey> @oprypin Thanks!
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
claudiuinberlin has joined #crystal-lang
LastWhisper____ has joined #crystal-lang
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
asterite has quit [Quit: Bye]
jhass has quit [Quit: Bye]
asterite has joined #crystal-lang
asterite has quit [Remote host closed the connection]
asterite has joined #crystal-lang
jhass has joined #crystal-lang
<FromGitter> <elorest> <oprypin> Is there an example could point me too regarding private macro’s in a module or something.
<FromGitter> <elorest> It looks as if you’re still able to call it from outside despite it being private?
<oprypin> elorest, i call it inside `module SF`
<FromGitter> <elorest> Ok I understand private, protected, etc in regard to methods… On modules that could be included in something I’m a little less clesar.
<FromGitter> <opensas> hi, I'm trying to find the source code for the non-destructive Array#select method, docs point to http://devdocs.io/crystal/api/0.23.0/array#select!(&block)-instance-method, and it seems like the non-destructive version is implemented via macros (https://github.com/crystal-lang/crystal/blob/3c3d3e2b830e81de0aa39b7af0cd6f82f759c410/src/compiler/crystal/macros.cr#L563) I'd like to ahve a look at it
<FromGitter> <opensas> I understan that macros.cr is a dummy module whose only purpose is to document the pseudo methods implemented by macros, but I don't know where are the sources of those macros
<oprypin> elorest, this module is solely for namespacing, dont think about including it. also scroll down for Private types
<Papierkorb> opensas, that docs thing you're using is pointing to the completely wrong source
<Papierkorb> opensas, https://crystal-lang.org/api/0.23.1/Enumerable.html#select%28%26block%3AT-%3E%29-instance-method
<oprypin> opensas, yeah i dunno it's just the wrong link. the link is actually https://github.com/crystal-lang/crystal/blob/3c3d3e2b830e81de0aa39b7af0cd6f82f759c410/src/array.cr#L894 even in devdocs
<FromGitter> <opensas> @FromIRC hmm, good to know, where should it point?
<Papierkorb> To where it the official docs point.
<Papierkorb> -it
<FromGitter> <pawandubey> I think the docs thingy he was using was correct
<FromGitter> <pawandubey> The official docs are the same
<Papierkorb> Not at all
<FromGitter> <pawandubey> https://crystal-lang.org/api/0.23.1/Array.html#select%21%28%26block%29-instance-method
<Papierkorb> that's #select!, not #select
<FromGitter> <pawandubey> Since Array inherits `select` from Enumerable, `select` is not documented there
<oprypin> Papierkorb, i see no fault in devdocs.io, it's just opensas doing private research
<FromGitter> <pawandubey> I know, I am saying that the devdocs doc was the same as the Crystal doc
<FromGitter> <pawandubey> Just to get to `select` you had to look at Enumerable, not Array
<oprypin> opensas, basically macros have nothing to do with this. u need to look at Instance methods inherited from module Enumerable(T)
<FromGitter> <opensas> yeah, forgot to have a look at included modules, thanks! just using devdocs.io cause it's easier to search
<FromGitter> <pawandubey> What does a standard debugging workflow look like with Crystal? Do we have any lldb support?
<Papierkorb> gdb at least works fine, kgdb worked fine for me too
<FromGitter> <opensas> > **<oprypin>** @opensas, https://straight-shoota.github.io/crystal/doc-search/ ⏎ ⏎ really nice! it would be pretty useful, do you know if it's possible to pass a query via querystring?
<oprypin> opensas, 99% sure that it is not possible
<FromGitter> <opensas> I guess I'll just stick with devdocs.io
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sp4rrow has joined #crystal-lang
sp4rrow_ has joined #crystal-lang
sp4rrow has quit [Ping timeout: 240 seconds]
LastWhisper____ has joined #crystal-lang
DTZUZU has quit [Read error: Connection reset by peer]
DTZUZU has joined #crystal-lang
sp4rrow_ has quit [Quit: The Internet needs a break and I need a cookie]
hightower2 has quit [Ping timeout: 248 seconds]
hightower2 has joined #crystal-lang
danielpclark has quit [Quit: Leaving]
sp4rrow has joined #crystal-lang
hightower2 has quit [Ping timeout: 240 seconds]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Ping timeout: 240 seconds]