ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.2 | 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
greengriminal has quit [Quit: Leaving]
<crystal-gh> [crystal] MakeNowJust opened pull request #5977: Fix typo 'stritc' in PrettyPrint spec (master...fix/pretty_print/typo) https://git.io/vpYmG
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] MakeNowJust opened pull request #5978: pp: fix the width and indentation of second and later line contents (master...fix/pretty-print/initial-indent) https://git.io/vpYmA
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
<FromGitter> <bew> How can I detect an empty Tuple ? (see https://carc.in/#/r/3wvk)
<FromGitter> <bew> ok, not sure this is a wanted behavior: https://carc.in/#/r/3wvn why does it shows `[T]` for the type_vars of an empty Tuple?
<FromGitter> <bew> that's kinda why: https://carc.in/#/r/3wvr (the type of an empty tuple is `Tuple(T)`)
rohitpaulk has joined #crystal-lang
illy__ has quit [Quit: Leaving]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
<FromGitter> <bew> but I still can't differentiate between empty tuple or not ><
Yxhuvud has quit [Client Quit]
Yxhuvud has joined #crystal-lang
Yxhuvud has quit [Read error: Connection reset by peer]
Yxhvd has joined #crystal-lang
<FromGitter> <bew> generics are fun https://carc.in/#/r/3wvx :P
<FromGitter> <bew> that initialize is pretty cool
Yxhvd has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
<FromGitter> <girng> wtf
<FromGitter> <bew> btw @asterite on my previous messages about detecting an empty tuple type?
<FromGitter> <bew> *any ideas on ...
<FromGitter> <girng> im running `crystal tool format`, and i'm getting: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5adaa8fd6bbe1d27390bb65e]
<FromGitter> <bew> and what happens if you run the command in the message?
<FromGitter> <girng> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5adaa97527c509a774349f1f]
<FromGitter> <bew> can you see if the issue is still there with crystal master?
<FromGitter> <bew> also huh what'in LoginHandler.cr around line 132?
<FromGitter> <girng> `temp = [] of NamedTuple(level: String, character_id: Int64, equipped: String | Hash(String, Int32), acct_name: String, user_id: Int32 last_joined_channel_time: Int64, char: String)`
<FromGitter> <bew> you forgot a comma
<FromGitter> <bew> before `last_joined_channel_time`
<FromGitter> <girng> but crystal compiles
<FromGitter> <bew> are you sure that file gets compiled?
<FromGitter> <bew> I think you can check if you `require` it somewhere
<FromGitter> <girng> yah. i run crystal and my gameserver loads up fine
<FromGitter> <girng> i never knew of this comma issue until now lol
<FromGitter> <bew> also, pleaaase use a struct, not a NamedTuple here!
<FromGitter> <girng> its been like that since we were talking about nametuples last week xD
<FromGitter> <girng> we can create array of structs?
<FromGitter> <bew> of course
<FromGitter> <girng> ic, i'll re-factor that inline namedtuple then sorry about that
<FromGitter> <bew> ok, I didn't know that worked... https://carc.in/#/r/3wvy
<FromGitter> <girng> lol
<FromGitter> <bew> and one more ^^ https://carc.in/#/r/3wvz
<FromGitter> <bew> I think that's a feature, but the formatter is not aware of that
<FromGitter> <bew> but it works only in generic, not in actual named tuples https://carc.in/#/r/3ww0
<FromGitter> <bew> I'll open an issue about that
<FromGitter> <girng> LOL i thinkt hat's wat was causing this cmd lag pop up window in sublime. i put the , there and the pop ups are now back to instant flash.
<FromGitter> <girng> used to be 2-3 sec delay
<FromGitter> <bew> that's definitely weird ^^
<FromGitter> <girng> my life is a bug report, it's ok
<FromGitter> <girng> everything is gonna be ok
<FromGitter> <bew> don't worry, we'll resolve you soon 😂
<FromGitter> <girng> i need more PRs :D
<FromGitter> <girng> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5adaaefd270d7d3708eca2d5]
<FromGitter> <girng> from crystal tool format. i have never touched those files in my life
<FromGitter> <bew> what's at the indicated lines?
<FromGitter> <girng> MasterServer_spec.cr ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5adaaf4b27c509a77434b202]
<FromGitter> <girng> ./src/MasterServer/version.cr ⏎ ⏎ ```module ./GameServer ⏎ VERSION = "0.1.0" ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5adaaf772b9dfdbc3ab1e6c8]
<FromGitter> <bew> ah, hmm looks like there's another issue with `crystal init` when you tell it that the name of the project is `./<something>`
<FromGitter> <bew> just remove the `./` in those files
<FromGitter> <girng> kk
<FromGitter> <girng> YES
<FromGitter> <girng> it's super faster now (the cmd flash on save in sublime)
<FromGitter> <girng> like instant
<FromGitter> <girng> ty @bew for help with this it was bothering me :O
<FromGitter> <girng> knew that delay was hinting at something
<FromGitter> <bew> @girng you stepped on #4817 with the `./` thing!
<DeBot> https://github.com/crystal-lang/crystal/issues/4817 (Bad fs structure with `crystal init lib /path/to/project`)
<FromGitter> <girng> nice catch. you knew it was coming! :D
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
Nathanaelle has joined #crystal-lang
Yxhuvud has quit [Client Quit]
Yxhuvud has joined #crystal-lang
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
<FromGitter> <girng> i just created 387,000 classes with https://paste.ee/p/aCc1B but memory usage stays 0.7MB. it never increase beyond that?
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
<crystal-gh> [crystal] bew opened pull request #5980: Deny invalid project name chars '\' & '/'' (master...deny-invalid-project-name) https://git.io/vpYGA
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
<FromGitter> <bew> it's very annoying to have this error `undefined method 'next_byte' for IO::ARGF (compile-time type is IO+)` evhen when I don't use an `IO::ARGF`...
<FromGitter> <bew> *even
baweaver is now known as baweaver_away
baweaver_away is now known as baweaver
_whitelogger has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter> <bew> ok I must have a problem somewhere, I don't understand why I get this error...
rohitpaulk has quit [Ping timeout: 256 seconds]
<FromGitter> <bararchy> @asterite I was thinking regarding compilation and compilation time issue , when we have multi thread support, that means we can compile using multiple cores which supposedly reduce compile time / cores
<FromGitter> <bararchy> So compile time might be even a lesser issue then we thought because even 8min compile / 8 cores means 1 min which is not that much
<FromGitter> <bew> I don't think the compilation of a crystal program can be done in parallel
<FromGitter> <bararchy> @bew can't it be done via some kind of a queue ?
<FromGitter> <bararchy> Where you can break code-gen and type detection and tests to different fibers ?
<FromGitter> <bew> huh, they must be done in a specific order, they can't be done in parallel
<FromGitter> <bararchy> I have 0 idea how the compiler actually works but can't we follow one code path in one fiber and another in another ?
<FromGitter> <bew> yeah that's for LLVM
<FromGitter> <faustinoaq> Oh, Ok 👍
<FromGitter> <bew> oh no, not llvm, but for the codegen (bc+obj)
<FromGitter> <bew> ok nvm, it's still llvm ^^ (I need to sleep)
<FromGitter> <bew> gn!
<FromGitter> <faustinoaq> @asterite What about making a new language like @ysbaddaden is doing ? 😜 https://github.com/runic-lang/compiler
<FromGitter> <faustinoaq> Even Matz have made his own language (again) https://github.com/matz/streem
<FromGitter> <girng> he's making a new programming language?
<oprypin> bararchy, crystal compilation is already parallelized in places where it can be
<FromGitter> <bararchy> oprypin even for --release mode?
<FromGitter> <bararchy> I remember someone said only on non release the compiler can multi-thread via LLVM or something
<FromGitter> <bararchy> I never saw Crystal uses more then 100% CPU when compiling
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
<FromGitter> <girng> https://play.crystal-lang.org/#/r/3wwu need help plz im trying to find the [img]testlink.png[/img], not just `testlink.png`
<FromGitter> <girng> i think i'm getting closer
<FromGitter> <girng> but i need to find multiple matches, not sure how to do that
<FromGitter> <girng> https://play.crystal-lang.org/#/r/3wy5 GOT IT
<FromGitter> <girng> something in me feels like maybe regex docs should mention that because i was reading the api for regex couldn't find anything
<FromGitter> <girng> i would have never thought of looking at the string API class for the solution, lol but i mean it works im happy =]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter> <drum445> Multi type Arrays are usefull
rohitpaulk has joined #crystal-lang
That_Guy_Anon has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
<RX14> will probably stream a bit more later
<Vexatos> \o/
<FromGitter> <girng> \o
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 264 seconds]
That_Guy_Anon has quit [Remote host closed the connection]
<crystal-gh> [crystal] MakeNowJust opened pull request #5981: Don't parse NamedTuple type without comma seperator (master...fix/crystal/dont-parse-named-tuple-type-without-comma) https://git.io/vpYg5
rohitpaulk has joined #crystal-lang
pbodev1 has joined #crystal-lang
<FromGitter> <faustinoaq> Hi crystal community, any idea how tackle this 👉 https://github.com/crystal-lang/crystal/issues/5821 ? 😅 ⏎ ⏎ I think crystal compiler already generates a lot of intermediate code (macros expanded, types inferred, etc) Could be possible to save that intermediate-code?
rohitpaulk has quit [Ping timeout: 268 seconds]
<FromGitter> <faustinoaq> Maybe by modifying code generation fase and adding an extra step to emit this intermediate code `--emit-expanded-macros` or `--emit-inferred-code` ?
<FromGitter> <faustinoaq> I think this can be very useful for creating nice extensions and tools for crystal
<FromGitter> <faustinoaq> And better debugging
<FromGitter> <faustinoaq> By Example to fix https://github.com/crystal-lang-tools/vscode-crystal-lang/issues/4 I can use `crystal tool expand` but I need to save the expanded code somewhere, would be nice to have some flag to emit expanded code to a file, and even emit typed code after types inference (Better auto completion, posible refactoring, better simbol listing, faster types on hover and more)
<FromGitter> <faustinoaq> I guess `crystal tool context` and `crystal tool expand` already do something similar 😅 ⏎ ⏎ Currently these tools only work in a specified cursor location `-c LOC, --cursor LOC`, Would be nice to increase the scope of these tools by generating expanded macros and context (inferred types) for an entire project and allowing to emit their result to multiples files, WDYT?
<FromGitter> <bew> Typed code after type inference would be niiice yes! (could you add a comment in the issue about that?)
<FromGitter> <codenoid> q hi
<FromGitter> <codenoid> hi
<FromGitter> <codenoid> how to do HTTP POST with application/json content type
<FromGitter> <codenoid> it's very hard
<FromGitter> <codenoid> todo
<FromGitter> <faustinoaq> @bew Yeah, saving inferred typed code to a file would be very nice 👍 ⏎ ⏎ https://github.com/crystal-lang/crystal/issues/5821#issuecomment-383296619 ⏎ ⏎ ^^ I already mentioned that here 👍 ... [https://gitter.im/crystal-lang/crystal?at=5adb46711130fe3d36ff4876]
<FromGitter> <codenoid> it's easy
<FromGitter> <fridgerator> Lol @codenoid your picture
<FromGitter> <faustinoaq> XD
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vpYw7
<crystal-gh> crystal/master 7539c01 TSUYUSATO Kitsune: Fix typo 'stritc' in PrettyPrint spec (#5977)
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
<FromGitter> <j8r> Who knows who is it...
Nathanaelle has quit [Ping timeout: 248 seconds]
Nathanaelle has joined #crystal-lang
<FromGitter> <fridgerator> Haha
mps has joined #crystal-lang
<travis-ci> crystal-lang/crystal#7539c01 (master - Fix typo 'stritc' in PrettyPrint spec (#5977)): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/369512659
<DeBot> https://github.com/crystal-lang/crystal/pull/5977 (Fix typo 'stritc' in PrettyPrint spec)
rohitpaulk has joined #crystal-lang
<crystal-gh> [crystal] RX14 closed pull request #5978: pp: fix the width and indentation of second and later line contents (master...fix/pretty-print/initial-indent) https://git.io/vpYmA
rohitpaulk has quit [Ping timeout: 248 seconds]
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vpYKE
<crystal-gh> crystal/master 2f2c04f TSUYUSATO Kitsune: Don't parse NamedTuple type without comma seperator (#5981)...
That_Guy_Anon has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<travis-ci> crystal-lang/crystal#2f2c04f (master - Don't parse NamedTuple type without comma seperator (#5981)): The build was fixed. https://travis-ci.org/crystal-lang/crystal/builds/369525452
<DeBot> https://github.com/crystal-lang/crystal/pull/5981 (Don't parse NamedTuple type without comma seperator)
rohitpaulk has quit [Ping timeout: 264 seconds]
<FromGitter> <j8r> How can I call a the same macro inside the macro?
<FromGitter> <j8r> I 've figure out this inception
<FromGitter> <j8r> i need to put the exact same arguments, it seems to work
That_Guy_Anon has quit [Remote host closed the connection]
That_Guy_Anon has joined #crystal-lang
<FromGitter> <j8r> I'm working on a CLI built upon a single macros with all informations in a NamedTuple :-D
<FromGitter> <drum445> Time to re-build our work project in Crystal and laugh at Python's run time speed ;)
mps has quit [Remote host closed the connection]
mps has joined #crystal-lang
marrow16180 has joined #crystal-lang
Nathanaelle has quit [Read error: Connection reset by peer]
<mps> crystal doesn't have 'for (i=0; i < 10; i++)' loop. how it is supposed to be done in crystal
<FromGitter> <fridgerator> Wut?
<mps> 'loop do' begins at zero, always?
<crystal-gh> [crystal] j8r closed pull request #5976: Improve the syntax of some if blocks to one line (master...if_cleanups) https://git.io/vpYLD
Nathanaelle has joined #crystal-lang
<FromGitter> <j8r> while/loop aren't for/each loops
<mps> j8r: of course, but I'm missing 'for (i=5; i < 20; i += 2)', just for example
<oprypin> >> (5...20).step(2) do |i|; p i; done
<DeBot> oprypin: Syntax error in eval:18: expecting identifier 'end', not 'EOF' - https://carc.in/#/r/3wzd
<oprypin> omg bash y u do dis
<oprypin> >> (5...20).step(2) do |i|; p i; end
<DeBot> oprypin: 5 - more at https://carc.in/#/r/3wze
marrow16180 has quit [Ping timeout: 264 seconds]
<mps> oprypin: ok, tnx, but still I'm missing 'for'
<oprypin> mps, what do you mean you're missing 'for'
<oprypin> use 'while'
<oprypin> >> [1,2,3].each do |x|; p x; end
<DeBot> oprypin: 1 - more at https://carc.in/#/r/3wzf
That_Guy_Anon has quit [Ping timeout: 276 seconds]
Nathanaelle has quit [Ping timeout: 256 seconds]
<mps> yes, I know, no problem, but I am accustomed to 'for () { }' idiom
<oprypin> k
<mps> I understand for/each and while/do, of course
<FromGitter> <straight-shoota> you could theoretically create your own `for` using a macro
<FromGitter> <straight-shoota> though I wouldn't recommend it
<oprypin> mps, so, what exactly are you missing that I have not shown an example for?
<FromGitter> <straight-shoota> it's better to use the same style
<FromGitter> <straight-shoota> for loop is not idiomatic Crystal
<mps> straight-shoota: I wouldn't go that path, I can live with it as it is
<mps> oprypin: nothing, your example is fine. I'm not yet accustomed to crystal idioms and syntax, nothing more
<mps> just trying to switch my 'thinking' to the crystal syntax
<FromGitter> <straight-shoota> yeah, it's inherited that syntax from Ruby
Nathanaelle has joined #crystal-lang
<mps> straight-shoota: ok, I understand
<Yxhuvud> of course, ruby actualy do have for even if noone uses it
<FromGitter> <straight-shoota> if you're coming from a different language, I understand you need to get acquianted with the Crystal way ;)
<mps> that is the case, and I'm trying, though it is not so hard :)
<FromGitter> <straight-shoota> Yxhuvud, true
<FromGitter> <straight-shoota> while, ranges and iterators are all you need
<mps> another question, how to print 'beep' on terminal. Tried with 'puts "\7"' but finished with calling C printf to do that
<mps> straight-shoota: I know Perl and ranges from there
<FromGitter> <straight-shoota> `\7` equals `7`
<mps> so easy, let me try :)
<FromGitter> <straight-shoota> oh, actually, either I'm wrong or the docs
<oprypin> :p
<FromGitter> <straight-shoota> I'm wrong
<mps> straight-shoota: got '--: line 1: : not found'
<FromGitter> <straight-shoota> `pp "\7" # => "\u0007"`
<FromGitter> <straight-shoota> so `puts "\7"` should give you a beep
<mps> straight-shoota: `puts "\7"` doesn't work but `puts "\u0007"` works
<FromGitter> <straight-shoota> that's odd
<mps> sorry, both works
<FromGitter> <straight-shoota> 👍
<mps> if I didn't tried right now, I would be sure that I'm tried `puts "\7"` and it didn't worked. But I see now it works :/
<FromGitter> <straight-shoota> yeah, it definitely should work
<mps> yesterday I tried, but it printed `7`. Must be that I made mistake somewhere
<mps> thank you all for the help
<mps> btw, I'm trying to understand 'fine points' of the crystal before I begin to write program which should be used for real jobs
That_Guy_Anon has joined #crystal-lang
marrow16180 has joined #crystal-lang
<FromGitter> <r00ster91> uhm can I call it a bug when I get a weird `Invalid memory access (signal 11) at address 0x7fffd0bafff8` error where the following text is very unuseful?
<oprypin> depends
<oprypin> show code
<oprypin> i think likely this is your fault
<FromGitter> <r00ster91> hm but i think the error should be more helpful
<FromGitter> <r00ster91> i will try to make it as tiny as possible
<FromGitter> <asterite> barachy: no, the compiler can't be paralellized, it must all be done in sequence. So multithreading won't help
That_Guy_Anon has quit [Remote host closed the connection]
That_Guy_Anon has joined #crystal-lang
<FromGitter> <r00ster91> uhm.. oh.. its because i named my method print and in the code in the print method i call print.. its just this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5adb9c14109bb04332e7fba2]
<FromGitter> <asterite> that's a stack overflow
<oprypin> honestly, this one really could be made clearer
<FromGitter> <straight-shoota> oprypin, if you know what it means :D
<FromGitter> <fridgerator> @r00ster91 you're trying to call `print` recursively ?!?
<oprypin> straight-shoota, could even be a regex on the error message `[0-9]{5} times` lol
<oprypin> then replace it with "OOPSIE WOOPSIE!! stack overflow"
<FromGitter> <yorci> what type i have to pass "paralel" macro ? have to be proc ?
<oprypin> juts code
<FromGitter> <yorci> @oprypin function?
<oprypin> >> parallel(puts 5, puts 6)
<DeBot> oprypin: 6 - more at https://carc.in/#/r/3x0a
<FromGitter> <yorci> i see, thank you
<FromGitter> <r00ster91> @fridgerator i forgot to call write `::` before print
<FromGitter> <r00ster91> i actually dont wanted to call print recursively
marius has quit [Quit: baj]
marius has joined #crystal-lang
marrow16180 has quit [Ping timeout: 264 seconds]
pbodev1 has quit [Quit: ChatZilla 0.9.93 [Firefox 56.0/20170903140023]]
wojnar has joined #crystal-lang
marrow16180 has joined #crystal-lang
Nathanaelle has quit [Ping timeout: 268 seconds]
zack263 has joined #crystal-lang
zack263 has left #crystal-lang ["Leaving"]
pbodev1 has joined #crystal-lang
wojnar has quit [Remote host closed the connection]
marrow16180 has quit [Remote host closed the connection]
pbodev1 has quit [Quit: ChatZilla 0.9.93 [Firefox 56.0/20170903140023]]