<FromGitter>
<stronny> good style is what works for you, not what other people decided
<FromGitter>
<stronny> but for what it's worth I saw it in stdlib more than once
<FromGitter>
<Daniel-Worrall> Use ? Instead of Nil union
<FromGitter>
<Blacksmoke16> its essentially the same thing just shorter
<FromGitter>
<stronny> it's exactly the same thing
gangstacat has quit [Quit: Ĝis!]
gangstacat has joined #crystal-lang
<FromGitter>
<asterite> it's not about good style, you can't do that `unless block`, a method with a block always receives a block. Doing it the overload way is the only way to do it
_whitelogger has joined #crystal-lang
return0e has quit [Remote host closed the connection]
return0e has joined #crystal-lang
chemist69 has quit [Ping timeout: 246 seconds]
chemist69 has joined #crystal-lang
absolutejam1 has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 246 seconds]
DTZUZU has quit [Quit: WeeChat 2.2]
DTZUZU has joined #crystal-lang
ht_ has joined #crystal-lang
absolutejam1 has joined #crystal-lang
<companion_cube>
so what makes Int? so hard to support? the fact it's not a reference class?
ht_ has quit [Remote host closed the connection]
absolutejam1 has quit [Ping timeout: 265 seconds]
absolutejam1 has joined #crystal-lang
alex`` has joined #crystal-lang
<FromGitter>
<j8r> For example sending an http request, waiting user input, etc
sorcus has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.5]
hypercore has joined #crystal-lang
<hypercore>
hello everybody, i'm getting "column posts.id does not exist" when i try to follow the "lucky gen.resource.browser Post title:String" command on the lucky index page
<hypercore>
anyone have an idea of what i could be doing wrong?
<FromGitter>
<stronny> what database are you using?
<hypercore>
postgres
<hypercore>
only change i made to db config was to set the db name manually
<FromGitter>
<kinxer> It looks like adding it improves both memory and speed.
<FromGitter>
<kinxer> Oh, wait. I misread.
Human_G33k has joined #crystal-lang
Human_G33k has quit [Remote host closed the connection]
Human_G33k has joined #crystal-lang
HumanG33k has quit [Ping timeout: 265 seconds]
absolutejam1 has quit [Ping timeout: 245 seconds]
<FromGitter>
<kingsleyh> @watzon I was looking for eval originally but instead I managed to find a solution that worked for me
<FromGitter>
<kingsleyh> It probably won't help you but in my case - I generate a hash map of method base name to a proc of code to execute - and at runtime I lookup the base method in the map and execute the proc
<FromGitter>
<kingsleyh> I'm moving this to an annotation based solution at the moment
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
<hypercore>
can i use it to build generic apps without having any major problems
<hypercore>
excluding some scenarios where some esoteric shards don't exist
<hypercore>
obviously it's still a new platform so that would be understandable
<FromGitter>
<tenebrousedge> people do build apps with it
<FromGitter>
<Blacksmoke16> an HTML site i imagine?
<hypercore>
yeah like a generic saas app
<hypercore>
if such a thing exists
alex`` has quit [Ping timeout: 245 seconds]
alex`` has joined #crystal-lang
Yxhuvud has joined #crystal-lang
<FromGitter>
<fridgerator> quite a few people are using crystal in production, I believe Lucky as well
<FromGitter>
<fridgerator> There is a Lucky gitter channel too, you might get more specific info there
<FromGitter>
<watzon> Holy crap @asterite @kinxer
<FromGitter>
<watzon> I'll plug that in later and see what happens
<FromGitter>
<watzon> Hmm, now here's a question. How do you prevent people from abusing `while` and `for` loops in a REPL type environment where the REPL is a bot?
<companion_cube>
ulimit
<FromGitter>
<Blacksmoke16> the playground has a limit on execution time
<FromGitter>
<watzon> I also need to set a flood limit on my bot. I've got an asshole DOSing it with requests.
<companion_cube>
why does a loop use memory? :s
<FromGitter>
<stronny> because it allocates a string
<FromGitter>
<watzon> A lot of strings very quickly in this case
<FromGitter>
<stronny> Chris, you are allowing random people to run arbitrary code on your harware
<FromGitter>
<stronny> limits are the least of your concerns
<companion_cube>
ah ok, and the compiler can't hoist the string outside the loop
<FromGitter>
<watzon> It's in a docker container
<FromGitter>
<stronny> set the limits for it
<FromGitter>
<stronny> or rather start each binary inside its own cont and set the limits there
<FromGitter>
<watzon> That would end up making things terribly slow
<FromGitter>
<stronny> OS?
<FromGitter>
<watzon> For? The host or the containers?
<FromGitter>
<stronny> containers do not have its own OS
<FromGitter>
<watzon> They run an OS, do they not? Alpine Linux in this case.
<FromGitter>
<watzon> The host is debian
<FromGitter>
<stronny> running a process in docker has a really small overhead
<FromGitter>
<stronny> it's not a VM
<companion_cube>
it's the same kernel but not the same distro, in a way
<FromGitter>
<watzon> I guess I haven't learned how Docker really works underneath
<FromGitter>
<stronny> they don't run an OS, they run one process at start
<FromGitter>
<stronny> that can fork, sure
alex`` has quit [Quit: WeeChat 2.5]
<FromGitter>
<stronny> now, docker on mac os or windows -- that's an entirely different story
<FromGitter>
<stronny> there it has to bootstrap an honest vm
alex`` has joined #crystal-lang
<companion_cube>
on linux it uses some container API, which is why it's more lightweight indeed
absolutejam1 has joined #crystal-lang
hightower2 has quit [Ping timeout: 245 seconds]
<hypercore>
anyone know why i get "Error: can't find file './fizzbuzz/*' relative to '/tmp/crystal/fizzbuzz/spec'" when i add "require './fizzbuzz/*' to the top of my spec file?
<FromGitter>
<Blacksmoke16> sure you dont mean like `require "../src/fizzbuzz"`?
<hypercore>
oh that work, thank you
<hypercore>
lots of resources seem to all have: require "./<app>/*"
<FromGitter>
<Blacksmoke16> which it does for you by default when you init the app
<hypercore>
oh didn't notice that
<hypercore>
thanks
beepdog has joined #crystal-lang
DTZUZO has quit [Ping timeout: 246 seconds]
ht_ has quit [Quit: ht_]
<hypercore>
is is possible to speed up compile times while working in dev? currently takes about 10s just to change a template
alex`` has quit [Quit: WeeChat 2.5]
<FromGitter>
<watzon> @asterite seems to work pretty well, but it's having some trouble with some characters it seems https://play.crystal-lang.org/#/r/7k8p
<FromGitter>
<absolutejam_gitlab> remember to run it as non-root
<FromGitter>
<absolutejam_gitlab> or use user name spaces for multiple
<FromGitter>
<absolutejam_gitlab> Podman looks interesting in that regards. no daemon
ternarysolo has joined #crystal-lang
olbat[m] has joined #crystal-lang
DTZUZO has joined #crystal-lang
<FromGitter>
<watzon> Already running as non-root :)
<FromGitter>
<zbaylin> the @'s produce the same result
<FromGitter>
<watzon> Although I think your problem is actually the fact that you're using `self` in one of the initialilzers
<FromGitter>
<zbaylin> oh you're right
<FromGitter>
<zbaylin> that's my bad
<FromGitter>
<zbaylin> i guess that's not doable, correct?
<FromGitter>
<zbaylin> because the object hasn't been initialized yet
<FromGitter>
<watzon> Pretty much. You can always make the reference nilable and add it after the fact.
<FromGitter>
<watzon> Not a perfect solution, but it works
<FromGitter>
<zbaylin> okay thanks
<FromGitter>
<Blacksmoke16> hypercore I'm assuming you're not building in release mode?
<hypercore>
sorry, should've been more explicit, i'm using Lucky framework
<hypercore>
normally my frameworks pretty much reload the page instantly when i make a change to a template or css, but maybe this is the tradeoff with crystal?