<FromGitter>
<simenge> anyone here familiar with the cltk parser generator library?
alex``` has quit [Ping timeout: 240 seconds]
akaiiro has quit [Ping timeout: 244 seconds]
ashirase has quit [Ping timeout: 256 seconds]
<FromGitter>
<Timbus> @talbergs Crystal does not use concurrent threads, it uses cooperative threads. If you call 'sleep' in your thread it will Yield to another thread. In your case; the empty `while true` loop
<FromGitter>
<Timbus> this essentially causes your program to hang. Instead of `while true ; end` try a long sleep.
phvse has quit [Remote host closed the connection]
_whitelogger has joined #crystal-lang
akaiiro has joined #crystal-lang
beizhia has joined #crystal-lang
akaiiro has quit [Ping timeout: 244 seconds]
akaiiro has joined #crystal-lang
akaiiro has quit [Ping timeout: 244 seconds]
wontruefree has joined #crystal-lang
wontruefree has quit [Quit: bye]
akaiiro has joined #crystal-lang
akaiiro has quit [Ping timeout: 260 seconds]
DTZUZO has joined #crystal-lang
alex``` has joined #crystal-lang
beizhia has quit [Ping timeout: 264 seconds]
ua_ has joined #crystal-lang
ua has quit [Ping timeout: 260 seconds]
DissonantGuile has joined #crystal-lang
<DissonantGuile>
Hey, any way to bind Crystal from C? Is in calling a Crystal method from a C program
rohitpaulk has joined #crystal-lang
<crystal-gh>
[crystal] RX14 closed pull request #6379: Parser: don't use invalid internal names for arguments like `@select` or `@@select` (master...bug/5997-invalid-internal-names) https://git.io/fNqah
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
<FromGitter>
<drum445> possible to see what vars a class has via macros before initializing it?
<crystal-gh>
[crystal] felixbuenemann opened pull request #6383: Fix version check for LLVM < 6.0 (master...llvm-6.0-support) https://git.io/fNmVI
<FromGitter>
<asterite> Instead of a long sleep, you can just sleep without arguments
<FromGitter>
<asterite> (maybe sounds like a haiku, but it's in reference to something you were discussing above)
TCZ has joined #crystal-lang
alex``` has joined #crystal-lang
TCZ has quit [Quit: Leaving]
<FromGitter>
<talbergs> @Timbus as you suggested, by adding a second of sleep in the last `while true` all worked, thanks! I did know that there is only cocurrency on single thread, but I did not think that an empty `while true`will not ever allow a gap for other Fibers to continu work. Meaning, two concurrent empty `while true` loops would not interchange execution between em.
<FromGitter>
<jwoertink> It sounds like this might be an area that needs some love
<DissonantGuile>
IT has the benefit of having a cool name
<FromGitter>
<jwoertink> Can someone explain what this error means? `Proc(HTTP::Server::Context, Nil) is not a generic type, it's a function`
<FromGitter>
<simenge> I always struggle when I need to implement operator precedence for a large number of operators
<FromGitter>
<simenge> doing it manually is kind of a bitch
<FromGitter>
<simenge> otherwise peg parsing is cool
<DissonantGuile>
I prefer PEG for sure
<DissonantGuile>
Outside of those two, I can't think of anything
<FromGitter>
<simenge> thanks for the input anyway
<FromGitter>
<simenge> I'll keep plugging away at it
alex``` has joined #crystal-lang
<FromGitter>
<Daniel-Worrall> Using https://github.com/crystal-lang/html_builder/ ⏎ Trying to have a non breaking space in my html ` `, but the ampersand is escaped and it becomes `&nbsp;`
<FromGitter>
<Daniel-Worrall> and there's no code replacement for the nbsp
<FromGitter>
<Daniel-Worrall> since it uses crystal HTML#escape
<FromGitter>
<Daniel-Worrall> Yeah, I'm the dummy here
<DissonantGuile>
The #html method does exactly the same as the #text function, only without escaping. Maybe you could preparse your test
<FromGitter>
<Daniel-Worrall> this was my original code ⏎ `thead { tr { {"Base", " ", "Mod"}.each { |string| th{ text string } } } }`
<DissonantGuile>
Er pre..processes *text
<FromGitter>
<Daniel-Worrall> so I tried to do `html(" ")` like a dummy
<DissonantGuile>
Ah
<FromGitter>
<Daniel-Worrall> I have it working with ⏎ `thead { tr { {"Base", " ", "Mod"}.each { |string| th{ html string } } } }`
<FromGitter>
<Daniel-Worrall> Apologies for the time wasting
<DissonantGuile>
Please, time wasting is my personal pastime
<FromGitter>
<talbergs> could we improve `spawn` macro, so it accepts block? ⏎ f.e. this may not be written `spawn poll 1.seconds, "./conf.json", &->set_conf` if the `poll` method accepts mandatory block.
<FromGitter>
<bew> @talbergs good idea, you can make a pr if you want ;)
<FromGitter>
<talbergs> or if I can :D I'm really new with crystal. But I may give it a try ;)
<FromGitter>
<j8r> The main advantage is to have a dynamic path
<FromGitter>
<bew> @j8r that's interesting!
<FromGitter>
<soanvig> Hi there. I'm super new to Crystal, but experienced in programming and have nice knowledge about Ruby. ⏎ ⏎ Do You know any IDE/Editor which has nice Crystal support. For everyday work I use VS Code, and there is plugin, but it doesn't help much during writing.
<FromGitter>
<talbergs> Does that plugn provides linting for you?
<FromGitter>
<soanvig> @talbergs not really
<FromGitter>
<talbergs> I tried IntelliJ plugin that barely gave some syntax highlight and that's t
<FromGitter>
<soanvig> It does however precompile file on save so I get errors on fly.
<FromGitter>
<talbergs> Now I use neovim it gives decent linting and some completion
<FromGitter>
<soanvig> And has nice syntax highliting. I'm however used to advanced autocompletion rules, and I would like to have some in Crystal, esp I'm new.
<FromGitter>
<jwoertink> so I end up getting this weird error
<FromGitter>
<jwoertink> Anyone know why it aliases Proc here?
<FromGitter>
<jwoertink> or how I can use the original Proc?
<FromGitter>
<jwoertink> oh, actually, looks like if I just use `::Proc` I'll be ok
<FromGitter>
<jwoertink> but that's weird though, right?
moei has quit [Quit: Leaving...]
<FromGitter>
<sam0x17> is there like an on_extended block I can define that executes when a class is extended? I know there is something like that but can't find it
<FromGitter>
<jwoertink> You mean inherited? `class Something < Parent`
<FromGitter>
<bew> @jwoertink yes it looks really weird, maybe a leftover from old times? That alias should be renamed, the programmer reading the code would benefit from that i think!
<FromGitter>
<jwoertink> Thanks @bew, I'll submit an issue. I actually just crashed the compiler with it, so gotta try to submit anyway
<FromGitter>
<bew> @sam0x17 you're talking about the macro hook `inherited`?
<FromGitter>
<jwoertink> yeah that thing ^ `macro inherited`
<FromGitter>
<talbergs> @jwoertink could you glance at the gist I pasted above, there must be something obvious for mature eye
<FromGitter>
<jwoertink> sure. Let me read what's up
<FromGitter>
<jwoertink> @talbergs Is that all of your code, or just abstracted bits out? It seems like you're playing with scopes a bit there. Have you tried making `app_conf` an instance variable?
<FromGitter>
<talbergs> Yes, that's all the code.
<FromGitter>
<talbergs> Not using class or modules there
<FromGitter>
<talbergs> The idea there was to spawn a file watcher that updates config object (line 18) on file change, and web server just serves current config object. It seems there has been made a copy and I have scoping problems there.
<FromGitter>
<jwoertink> Yeah, in that method, I think the `app_conf` just becomes a local variable only available inside the method. I didn't run anything to test, so I could be wrong about that
<FromGitter>
<jwoertink> That's just my guess. I was thinking maybe if it was an instance variable instead, then maybe it would scope outside the method? `@app_conf = get_conf`
akaiiro has joined #crystal-lang
<FromGitter>
<talbergs> jeez that must be it! Letme try
<FromGitter>
<talbergs> Then linter complains like so: "can't use instance variables at top level"