<FromGitter>
<00dani> I've also tried building from source now. No dice. :|
<FromGitter>
<00dani> Hmm, just tried `crystal play` and that seems to work, oddly enough. Hmm.
<oprypin>
00dani, low on RAM? maybe ~/.cache/crystal went bad? (if that's even the cache path, i don't remember)
<oprypin>
show the stack trace
<FromGitter>
<00dani> Yeah, that is the cache path. But it looks like the problem was actually with my project, somehow? I'm guessing I installed an incompatible combo of shards or something, since I'm experimenting with Amber and different ORMS. Crystal is working just fine anywhere *except* that project. Here's the trace anyway: https://gist.github.com/c395d23389c5138c86a751de656eb137
<FromGitter>
<00dani> Figured out what was happening: I had an infinite recursion in one of my Slang templates because the Amber docs say to use `render "partialname"` for a partial but should say `render partial: "partialname"`.
<FromGitter>
<00dani> It's surprisingly difficult to discern what's happened when you have an infinite macro expansion.
sherjilozair has quit [Quit: Leaving...]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter>
<Grabli66> Hi! How to catch exceptions, that was raised in fibers?
rohitpaulk has joined #crystal-lang
<oprypin>
Grabli66, you must catch exceptions inside the fiber
<oprypin>
you can then send them through a channel if you really want to, and re-throw
<hightower6>
oprypin, hey, I was thinking about your comment from the other day that macros are never associated with an object, so one can't call obj.some_macro. While that's OK, it is strange that inside a def that works -- one *can* call a macro as if seemingly it was on an instance... E.g. https://play.crystal-lang.org/#/r/43sk
sz0 has quit [Quit: Connection closed for inactivity]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 252 seconds]
Raimondii is now known as Raimondi
<FromGitter>
<Flipez> Hi guys, I'd like to initialize a property later in the code and cannot assign it on startup since I miss some params. I am used to do this in Ruby but how am I supposed to do this in crystal? I bet there must be a way? :D β https://play.crystal-lang.org/#/r/43sw
<FromGitter>
<epergo> you can add a `?` when declaring the property
<FromGitter>
<epergo> that means it can be nil
<FromGitter>
<epergo> you could write it this way too `property me : Battlesnake::Snake | Nil` which is more explicit
<FromGitter>
<Flipez> Ah that's what I was looking for. Thank you!
OvermindDL1 has quit [Quit: Connection closed for inactivity]
<FromGitter>
<epergo> π
<FromGitter>
<Flipez> I like how crystal handle the type safety but this is still a bit confusing if you grow up with ruby though π
<FromGitter>
<bararchy> @Flipez Yeha as a Ruby dev it takes some time to get used too
<FromGitter>
<manveru> anyone using `anykeyh/clear` here? I'm wondering how I'd express `Post.query.with_user.find(12)`...
<FromGitter>
<manveru> also `file.project ? file.project.name : ""` fails with `undefined method 'name' for Nil (compile-time type is (Project | Nil))`, i don't quite understand why
<FromGitter>
<manveru> `project = file.project; project_name = project ? project.name : ""` seems to work though
<FromGitter>
<yxhuvud> @Flipez it is also possible to initialize a variable as `uninitialized` but that is not type safe and should be avoided if possible.
<FromGitter>
<yxhuvud> @manveru the compiler is not smart enough to know that the value of file.project doesn't change between your calls.
<FromGitter>
<yxhuvud> (I'm not certain it *could* be that smart, in the general case)
<FromGitter>
<manveru> ok
emilsp has quit [Quit: cya]
<FromGitter>
<manveru> also seems like clear craps out when i do some benchmarking... doesn't look like it's using a connection pool and runs out of fds
emilsp has joined #crystal-lang
hightower6 has quit [Quit: Leaving]
<FromGitter>
<bararchy> Is there a way to find a string inside antoerh string without using Regex?
<FromGitter>
<bararchy> @faustinoaq you need to publish this gif as a tutorial :)
<FromGitter>
<Grabli66> Crystal is awesome, but not so popular as python and django. And lack of good IDE, and parallelism, and so on :)
<That_Guy_Anon>
i feel like the biggest thing simply is parallelism and windows, not sure if a IDE is that needed, the vscode plugin is really nice and probably enough for most
<wmoxam>
Is windows support really a big deal?
<That_Guy_Anon>
yeah
<wmoxam>
What sort of programs do people want to use Crystal for to run on windows?
<That_Guy_Anon>
many devs i know still use windows
<wmoxam>
Most dev I see Crystal being used for is server oriented
<wmoxam>
and most Windows oriented folks I know want to use a MS stack for that
<wmoxam>
(and I don't blame them for it)
<That_Guy_Anon>
hm, i think more about the barrier of entry, but yeah, might be scewed perspective :D
rohitpaulk has joined #crystal-lang
<FromGitter>
<bararchy> Windows because you want to be able to run your clients, GUI, games, utils, etc.. In Windows
<oprypin>
hightower2, in your example it's just "a macro available inside objects of this type", still no instances are involved
<FromGitter>
<faustinoaq> I use Windows and Visual Studio with C# & .Net in my daily basics at university and work π
<FromGitter>
<faustinoaq> C# and Visual Basic are not that bad π
<FromGitter>
<faustinoaq> > you need to publish this gif as a tutorial :) β β @bararchy Oh, yeah! With the new GitBook UI is very pleasant and easy π https://amberframework.gitbook.io/amber
<FromGitter>
<faustinoaq> I just need some time, though
<FromGitter>
<faustinoaq> > Django does suck β β @fridgerator Well, I still use Django on some client projects and isn't that bad, just a different approach π
<FromGitter>
<faustinoaq> @Grabli66 For me the most important is Windows support, parallelism and stability π
<FromGitter>
<faustinoaq> > What sort of programs do people want to use Crystal for to run on windows? β β wmoxam, Would be very nice to create a GUI using QT5.cr (https://github.com/Papierkorb/qt5.cr) and deploy it to a windows machine π
<That_Guy_Anon>
stability in the sense of stable API (?) or in the sense of stable programs
<FromGitter>
<faustinoaq> That_Guy_Anon both
<FromGitter>
<faustinoaq> Stable for me, means a LTS (Long Term Support) release with no more breaking-changes and critical bug fixes
<That_Guy_Anon>
i still haven't really gotten into crystal, like ive red docu, did tutorials but am still missing a project that gets me hooked
<FromGitter>
<faustinoaq> > Is windows support really a big deal? β β <wmoxam> Yes, I big one
<That_Guy_Anon>
faustinoaq well that only means my perception isn't wrong :D
<That_Guy_Anon>
i mean even i use windows from time to time if i have to use CodeSys or smth
<FromGitter>
<faustinoaq> > Most dev I see Crystal being used for is server oriented β β <wmoxam> I still use Windows Server at work π
<FromGitter>
<faustinoaq> My boss loves Windows XD
<That_Guy_Anon>
tbh i don't dislike windows per se either, i dislike where they are taking it
<FromGitter>
<faustinoaq> > and most Windows oriented folks I know want to use a MS stack for that β β <wmoxam> Well, that's true, At work I only use .Net, nothing more. I tried to introduce crystal & amber but it doesn't work on windows yet, so I'll try once crystal support on Windows, (2019-2020 I guess π )
<FromGitter>
<faustinoaq> > tbh i don't dislike windows per se either, i dislike where they are taking it β β <That_Guy_Anon> Well, The new Open Souce approach at Microsoft feel very nice, the new VSCode and Net Core are very awesome projects, well received by the community π
<That_Guy_Anon>
they are, but windows core is still unaffected by this, and for example the VSCode license does have a few ouchie points
<That_Guy_Anon>
i mean i even like many things about windows 10, and will probably be dualbooting for quite some years to come
<FromGitter>
<faustinoaq> I already implemented basic rename and working on code-actions feature I'll publish them soon π
<FromGitter>
<Grabli66> @faustinoaq , i use vscode, crystal plugin and scry. Not so bad :). Need to try intellij idea
<FromGitter>
<Flipez> If I am working on a variable that either can be nil or a class, how do I avoid the compile-time 'undefined method for nil' error? Checking if the variable is nil does not seem to do the trick
<FromGitter>
<faustinoaq> <That_Guy_Anon> I do dual booting with W10 and Manjaro Linux and works pretty nice π
<That_Guy_Anon>
i have had issues with dualbooting in the pas but solus /win10 works really well so far
<FromGitter>
<faustinoaq> π
<FromGitter>
<faustinoaq> > Need to try intellij idea β β @Grabli66 Not yet, I still need to publish some bugfixes on Scry protocol π
<FromGitter>
<faustinoaq> @Flipez You can use `if my_var = var` (recommended) or `.try` (alternative) or `.not_nil!` (not recommended)
<FromGitter>
<S-YOU> @Flipez checking does not change the type of variable, you need to assign to another variable
<FromGitter>
<faustinoaq> `.not_nil!` just creates a Nil Assertion Error very similar to Undefined method for nil on Ruby, JavaScript and Java, etc
<FromGitter>
<faustinoaq> Checking nil is a crystal feature like Scala, Kotlin or Rust π
<FromGitter>
<Flipez> I see, thanks guys :)
<FromGitter>
<Flipez> Feels a bit like a overhead reassigning those every time π
<FromGitter>
<S-YOU> LLVM compiles down to SSA, which reassign to new variable for every step, and it is very good for optimizations.
<FromGitter>
<faustinoaq> Also Nim have nil checks :-)
<FromGitter>
<faustinoaq> @S-YOU π
rohitpaulk has quit [Ping timeout: 245 seconds]
OvermindDL1 has joined #crystal-lang
That_Guy_Anon has quit [Remote host closed the connection]
greengriminal has joined #crystal-lang
sz0 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
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
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter>
<fuegito> Hi. Is there a specific reason why there is no method to get the remote IP from a HTTP::Request? Am I missing something?
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter>
<fuegito> I know the workaround with adding a http-header by a reverse-proxy. The discussions on github/crystal-lang did not make me smarter...
<FromGitter>
<vladfaust> WDYT on where to place stlib extensions in shards? E.g. add `Int#my_method`. Should I place it in `shard/src/ext/int/my_method.cr` or `shard/src/shard/ext/int/my_method.cr`?
<FromGitter>
<fuegito> It was discussed in an issue in 2015. There has been a PR adding it as a property in 2016 I think. I'll look if I find the links. I just wonder why there is almost no "noise" around this issue...i mean getting the IP from the connecting socket in a HTTP context is not really an exotic use case...
<Jenz>
Im more impressed by you setting up a systemd service for running an amber server (im a web-dev noob)
<FromGitter>
<faustinoaq> Yep, I was worried it didn't work, because the memory usage was just growing and growing without freeing. Now I know Crystal GC works very nice π
wontruefree has joined #crystal-lang
<FromGitter>
<faustinoaq> BDWGC doesn't recollect as frequently as I want but does the work! π
<Jenz>
Yeah, I remember seing some interesting talk about the boehm tackling data-intensive situations