RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.27.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
<FromGitter> <anamba> oh hey, i got part 1. i don't know why i am still working on this though
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
<FromGitter> <DanilaFe> I stayed up till 3 am my time to finish it so I wouldn't have to do it today
Raimondi has joined #crystal-lang
<FromGitter> <anamba> @DanilaFe ah geez. i kept inputting the min ap needed for part 2. reading skills...
<FromGitter> <DanilaFe> reading skills is exactly what this problem strained today
<FromGitter> <DanilaFe> it's very poorly written imo
DTZUZO has quit [Ping timeout: 250 seconds]
_whitelogger has joined #crystal-lang
<FromGitter> <proyb6> Day15 may be faster with BFS than A*?
<FromGitter> <lokeshh> Isn't it possible to use Rubex in the following manner? ⏎ ⏎ I write some Ruby code as I would normally do, I debug is using interpreter and so on. But when I move it to production I use crystal to make it run fast?
<FromGitter> <lokeshh> Because the only drawback of Crystal is that it turns Ruby to a Compiler language then a interpreted one.
DTZUZO has joined #crystal-lang
<FromGitter> <anamba> i don't consider that a drawback. interpreted languages in production are a lot more vulnerable (for example, deserialization vulnerabilities are a constant threat)
<FromGitter> <lokeshh> @anamba Ok. What's the recommended way of debugging? In Ruby I'm use `pry`.
<FromGitter> <anamba> i might be unusual here, but i don't use debuggers for... anything, really. except Xcode, since it kinda pushes you into that workflow.
<FromGitter> <anamba> if the code is complicated enough that i can't easily follow it in my head, i fix that :)
<FromGitter> <anamba> ah, i see `pry` is not a debugger (sorry, never used it before). different definition of debugging. when i need this kind of thing `crystal play` is usually sufficient
<FromGitter> <lokeshh> I mean like this https://learn.co/lessons/debugging-with-pry
<FromGitter> <anamba> nope changed my mind again :) misunderstood what they meant by "IRB alternative." it definitely does let you look around "running" code. (which again, I think should generally be unnecessary if you've built it right)
Raimondi has quit [Ping timeout: 240 seconds]
<FromGitter> <anamba> build up functionality incrementally, write specs to make sure each layer is doing what you think it's doing. that usually does the trick
<FromGitter> <anamba> @lokeshh rubex looks interesting, i wonder how well/how often it actually works in the real world?
<FromGitter> <DanilaFe> dang
<FromGitter> <DanilaFe> almost rank 100
<FromGitter> <DanilaFe> boom!
<FromGitter> <DanilaFe> not to mention, 29 millis
<yxhuvud> today was not a slow task though.
<FromGitter> <DanilaFe> that is true, but I mean speed relative to other solutions.
<FromGitter> <DanilaFe> How did today go for you, Linus?
_whitelogger has quit [Ping timeout: 250 seconds]
_whitelogger has joined #crystal-lang
<FromGitter> <DanilaFe> wow, TDD
<FromGitter> <DanilaFe> that's quite intense for a daily programming puzzle, but good habits :D
DTZUZO has quit [Ping timeout: 244 seconds]
<yxhuvud> @danila: place 442 globally, so okish. I lost a lot of time due to doing stupid stuff in part2 :&
<yxhuvud> I wish I took more time to continue with my parser generator ;)
<yxhuvud> but I'm stuck in a hellish long refactoring so it is a lot of work for few features.
azuri5 has joined #crystal-lang
<FromGitter> <DanilaFe> well, mine doesn't have a lot of features besides...generating parsers :D
<FromGitter> <DanilaFe> I made it so that it outputs JSON data, and that means it can generate parsers for different languages via "backends", but then it doesn't have proper support for semantic actions, which is how I believe Yacc does it
<FromGitter> <DanilaFe> once I'm done with my current project I'll look into it once again
<yxhuvud> semantic actions as what happens when a rule is completed? I have that (somewhat limited to the first derivation), but otoh I don't support character ranges yet :)
<FromGitter> <DanilaFe> Yeah, that's what semantic actions are. I've actually spent a considerable amount of time making regex engines (runtime) before, probably starting junior year high school. They're always the same, based on Thompson NFA. This time I just made it generate lookup tables. My main concern is that I want it to be mostly language-agnostic, but semantic actions are very tied to the language of the parser
_whitelogger has joined #crystal-lang
ua has quit [Ping timeout: 246 seconds]
azuri5 has quit [Quit: azuri5]
ua has joined #crystal-lang
ashirase has quit [Ping timeout: 246 seconds]
ashirase has joined #crystal-lang
azuri5 has joined #crystal-lang
azuri5 has quit [Client Quit]
<foxxx0> hey, might one of the AoC guys provide me with his day12 input and day12p2 result? i'm probably in the off-by-one sort of bugs in my code and would like to have something to validate against :)
<foxxx0> would be much appreciated!
azuri5 has joined #crystal-lang
<FromGitter> <asterite> today's AoC was nice, having to guess opcodes (different from the other years where you had to just execute ops). And I'm so glad we have macros :-)
<foxxx0> ah, finally found my bug
<FromGitter> <asterite> if anyone wants to learn Crystal, here's a 122 pages PDF written in Japanese (jawdrop): https://crystal-jp.github.io/introducing-crystal/assets/pdfs/introducing-crystal.pdf
<FromGitter> <proyb6> We have to learn Crystal and Japanese languages
<mps> "Yoku mireba, nazuna hana saku. Kakine kana!" when I way young I learnt this haiku :)
<FromGitter> <greenbigfrog> @jwoertink I thought it was stable, got some errors PoolTimeout again though
<yxhuvud> asterite: ah yes, macros were nice. Though I have to admit I added them after solving things. In retrospect I think I lost time by not doing it directly.
<yxhuvud> @asterite: I recognize makejustnow out of the authors, but havn't seen the other 3.
<yxhuvud> I also noticed the formatter don't like oneline macros.
_whitelogger has joined #crystal-lang
azuri5 has quit [Quit: azuri5]
azuri5 has joined #crystal-lang
<FromGitter> <r00ster91> In the Lexer class of Crystal: https://github.com/crystal-lang/crystal/blob/665b18c73066b88acd84777f22a68bfa1b63a646/src/compiler/crystal/syntax/lexer.cr#L6 ⏎ How do I find out if color output is enabled or disabled for the program that is being currently compiled? There's no `program` getter or anything.
<oprypin> r00ster91, i dont understand how are the 2 things you mentioned related in any way
azuri5 has quit [Quit: azuri5]
<FromGitter> <r00ster91> oprypin: the `Program` has the color getter: https://github.com/crystal-lang/crystal/blob/master/src/compiler/crystal/program.cr#L71
azuri5 has joined #crystal-lang
azuri5 has quit [Quit: azuri5]
azuri5 has joined #crystal-lang
azuri5 has quit [Client Quit]
azuri5 has joined #crystal-lang
DTZUZU has joined #crystal-lang
azuri5 has quit [Quit: azuri5]
azuri5 has joined #crystal-lang
sevensidedmarble has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
<oprypin> i dont think you can obtain this value and i dont see why you would want that
<FromGitter> <r00ster91> oprypin: I'm trying to fix this: https://github.com/crystal-lang/crystal/blob/665b18c73066b88acd84777f22a68bfa1b63a646/src/compiler/crystal/syntax/lexer.cr#L684 ⏎ I'm trying to make the did you mean message yellow
<oprypin> ok that's valid then
<FromGitter> <j8r> @proyb6 I've an idea for the library to filter characters
<FromGitter> <j8r> I'll use an enum :)
<FromGitter> <j8r> the function will return the type of the characters, then that's up to the user what to do
JuanMiguel has joined #crystal-lang
JuanMiguel has quit [Remote host closed the connection]
rohitpaulk has quit [Remote host closed the connection]
ua has quit [Ping timeout: 246 seconds]
<FromGitter> <j8r> Does it exists a way to iterate over enum value, with a macro?
<FromGitter> <vladfaust> Hey guys, I've updated my HTTP params parsing shard with annotatons -- https://github.com/vladfaust/http-params-serializable. Use master branch for now
<FromGitter> <j8r> @vladfaust thanks a lot, macro lord 😄
<FromGitter> <vladfaust> Nah, take a look at https://github.com/vladfaust/http-params-serializable/blob/master/src/http-params-serializable.cr -- I've documented it a lot, may be useful to gain additional knowledge
ua has joined #crystal-lang
<FromGitter> <j8r> @vladfaust what is the `ext` directory?
<FromGitter> <j8r> i.e why having this subdirectory architecture vs all in `/src`?
<FromGitter> <vladfaust> Because it's extending known classes
<FromGitter> <j8r> I suppose having `http-params-serializable` inside src is a gem convention
<FromGitter> <j8r> @proyb6 @Prutheus I've created this shard for you 😄 https://github.com/j8r/unicode_blocr
<FromGitter> <j8r> @vladfaust I really need to take the time to have a CI like you, that build docs to a `gh-pages` branch
<FromGitter> <vladfaust> @j8r, to `require "http-params-serializable"` you have to put `http-params-serializable.cr` into `src`, isn't that?
<FromGitter> <j8r> nope, why it would be needed?
<FromGitter> <j8r> hum yes
<FromGitter> <j8r> but i mean, all the other stuff
<FromGitter> <j8r> like the ext directory @vladfaust
<FromGitter> <vladfaust> > Because it's extending known classes
<FromGitter> <vladfaust> Because it's crystal code, so it's under `src`. Because it's extending, so it's under `ext`
<FromGitter> <j8r> got it
<FromGitter> <j8r> but why not `/src/ext`
<FromGitter> <j8r> :)
<FromGitter> <vladfaust> Because `/src/*` directiories rewrites each other when required as dependency. For example, if shardA had a `src/ext` diredctory, it would be shadowed by my `src/ext` directory
<FromGitter> <j8r> I doubt
<oprypin> vladfaust, no
azuri5 has quit [Quit: azuri5]
<FromGitter> <talbergs> ```code paste, see link``` ⏎ ⏎ Compiler says "Can't infer the type of instance variable '@pane' of Display". How so? I explicitly tell the return type of a method "draw_pane" [https://gitter.im/crystal-lang/crystal?at=5c16b07be86b0460b3aa8436]
azuri5 has joined #crystal-lang
<FromGitter> <j8r> @talbergs all ivars need to be defined in initialize, or in the main class
<FromGitter> <j8r> not in methods
<FromGitter> <j8r> hum
<FromGitter> <talbergs> @pane is in constructor isn't it
<FromGitter> <j8r> oh yes
<FromGitter> <j8r> you have to defined it
<FromGitter> <j8r> in the class
<FromGitter> <j8r> `class Display; @pane : NCurses::Window`
<FromGitter> <talbergs> Yes it seems to work now. Thanks!
Renich has quit [Quit: Renich]
Renich has joined #crystal-lang
azuri5 has quit [Ping timeout: 264 seconds]
<FromGitter> <proyb6> @j8r Nice unicode blocker! Appreciate.
<FromGitter> <j8r> @proyb6 Thanks! not really a blocker, more a character idientifier. It tells its type: emoticon, latin, greek etc
<FromGitter> <j8r> I may rename it to `unicode_identifier`
sagax has joined #crystal-lang
go|dfish has quit [Ping timeout: 250 seconds]
<FromGitter> <girng> nice shard @j8r !!
<FromGitter> <asterite> @talbergs the compiler won't infer the type from instance methods, only from class methods (it's a bit simpler to do)
<FromGitter> <j8r> @girng thanks, it's a really dumb one (one big enum). In fact, enums are really cool
go|dfish has joined #crystal-lang
<FromGitter> <j8r> More or less like a collection of immutable tags
go|dfish has quit [Ping timeout: 246 seconds]