<FromGitter>
<yxhuvud> If the scheduler tries to resume a dead fiber, that looks like a bug, yes.
t1|Mike has joined #crystal-lang
dwdv has joined #crystal-lang
<repo>
hmm is 5.minutes nowadays returning a float?
<repo>
what happened to Time::Span
<repo>
oh never mind
<repo>
it seems that playground is just pretty printing it as such
<dwdv>
What's the GC's collection behaviour? Is it collecting in certain time intervals, possibly after each allocation once certain conditions are met, is it a mixture of both, or a completely different strategy?
absolutejam has quit [Ping timeout: 240 seconds]
absolutejam has joined #crystal-lang
<dwdv>
Ah, I see: "GC_malloc will invoke the garbage collector when it determines this to be appropriate" and "garbage collections run mostly incrementally, with a small amount of work performed in response to each of a large number of GC_malloc requests"
gangstacat has quit [Quit: Ĝis!]
return0e has joined #crystal-lang
absolutejam has quit [Ping timeout: 250 seconds]
absolutejam has joined #crystal-lang
<repo>
hmmmm
<repo>
i get the following error compiling on alpine:
Human_G33k has quit [Read error: Connection reset by peer]
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter>
<bararchy> Is there a way to give a Fiber higher priority over other Fibers? (when this Fiber wake up, make sure it's the next one to schedule)
<FromGitter>
<bararchy> @bcardiff is this thing possible?
dwdv has quit [Quit: quit]
alex``` has joined #crystal-lang
alex`` has quit [Ping timeout: 246 seconds]
jrayhawk has quit [Ping timeout: 276 seconds]
jrayhawk has joined #crystal-lang
ternarysolo has quit [Read error: Connection reset by peer]
erdnaxeli has quit [Read error: Connection reset by peer]
beepdog has quit [Write error: Broken pipe]
olbat[m] has quit [Remote host closed the connection]
<FromGitter>
<alehander42> you dont need that if you use map {} tho i guess
<FromGitter>
<alehander42> map! updates in place
<FromGitter>
<SewerynKaminski> ? dont update in place
<FromGitter>
<Blacksmoke16> using `map!` will most likely be more performant
<FromGitter>
<Blacksmoke16> the issue is `map` returns a new array with a diff type, since `map!` updates self, the original array must be typed so that it can handle the change in type
<FromGitter>
<SewerynKaminski> @tenebrousedge thx for the trick witch ```of Array(String | Int32) ```
<FromGitter>
<tenebrousedge> if you're continuing the function chain, `map` is fine. But reassigning variables is something of a code smell
<FromGitter>
<nsuchy> We open sourced our Docker & Shards Configuration based on Debian Stable for those interested https://github.com/ulayer/DockerCrystalAmber, we removed the built-in postgres server as we have a central server with all databases and disabled auto migrate in favor of manual hands on migrations. It includes hash checking to make sure the file hasn't somehow changed since we last reviewed Amber and a Crystal version
<FromGitter>
... :) ⏎ ⏎ Would appreciate any feedback the community has.
erdnaxeli has joined #crystal-lang
olbat[m] has joined #crystal-lang
ternarysolo has joined #crystal-lang
<FromGitter>
<ImAHopelessDev_gitlab> nice
<FromGitter>
<ImAHopelessDev_gitlab> ii've never used docker, but if it's crystal related it deserves a star
<FromGitter>
<tenebrousedge> @nsuchy shouldn't this be `node_modules` ? ⏎ `RUN rm -rf /app/node_module`
<FromGitter>
<tenebrousedge> the `groupadd` stuff should be at the beginning of the Dockerfile for best performance
<FromGitter>
<tenebrousedge> and it's probably a better idea to use `USER` to switch user at the beginning rather than `chown` at the end
<FromGitter>
<tenebrousedge> running as root the whole time within the container is not usually the best option
DTZUZU has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter>
<tenebrousedge> for my projects I allow $USER_ID and $GROUP_ID to be passed in, that way any files they create can be owned by my local user -- otherwise you tend to leave a bunch of root-owned files lying around the local filesystem
<FromGitter>
<tenebrousedge> if there's not a good reason to use docker-compose config version 2, use the current version
<FromGitter>
<Blacksmoke16> also don't forget about `.dockerignore`
<FromGitter>
<tenebrousedge> I would probably have the `install` scripts handle their own dependencies
<FromGitter>
<tenebrousedge> but that may not be good for performance; I'm not sure
<FromGitter>
<Blacksmoke16> could also use multiple images, i.e. start off with a base crystal image, then from there you can define other images based on that with additional stuff
<FromGitter>
<Blacksmoke16> so that if you need to add something common to all images it would just work
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
<FromGitter>
<ilanpillemer> man, initialize is so easy to misspell
<FromGitter>
<ilanpillemer> why cant it be init?
<FromGitter>
<tenebrousedge> because Ruby
<FromGitter>
<ilanpillemer> so are Rubyists really good spellers of long words?
Nekka has quit [Quit: zzz]
<FromGitter>
<tenebrousedge> no, probably Ruby got it from Smalltalk
<FromGitter>
<ilanpillemer> So its Alan Kay’s fault?
<FromGitter>
<tenebrousedge> most likely
Nekka has joined #crystal-lang
<FromGitter>
<ImAHopelessDev_gitlab> lol
<FromGitter>
<bew> @ilanpillemer I never type it manually, I configured my editor to have a snippet on `ini` that expands to an initialize definition :P
<FromGitter>
<ImAHopelessDev_gitlab> @bew is alive, wow
<FromGitter>
<ilanpillemer> Acme doesnt work that way
<FromGitter>
<ilanpillemer> its one of the things I have to give up to get others things I like
<FromGitter>
<ilanpillemer> so I *have* to type it
<FromGitter>
<ilanpillemer> ok. I guess I could create something that generates me an template with the word initialize in it..
<FromGitter>
<ilanpillemer> but I doubt I will
<FromGitter>
<ImAHopelessDev_gitlab> guard clauses > all
<FromGitter>
<ImAHopelessDev_gitlab> eZ
Nekka has quit [Ping timeout: 245 seconds]
<FromGitter>
<ilanpillemer> I am having a go at the binary tree exercism now
<FromGitter>
<Blacksmoke16> i bet its WSL slowing it down a bit tho
<FromGitter>
<Blacksmoke16> i dont have a large codebase to test stuff on, suppose building the compiler would be the most standardized one
<FromGitter>
<ImAHopelessDev_gitlab> oh yeah for sure. after looking at the wsl benchmark thread on forum, wsl for compiling is very slow in comparison
<FromGitter>
<ImAHopelessDev_gitlab> i just wanted to show those s/s at first, because i added in that Total Time line :)
Nekka has quit [Ping timeout: 240 seconds]
<FromGitter>
<Blacksmoke16> ah nice one :slight_smile:
<FromGitter>
<ImAHopelessDev_gitlab> thx :)
<FromGitter>
<Blacksmoke16> going to make a PR?
<FromGitter>
<ImAHopelessDev_gitlab> maybe ahah
<FromGitter>
<ImAHopelessDev_gitlab> @Blacksmoke16 did you know, WSL added a editing server for unix files lol. i got to fiddle around inside compiler.cr and progress_tracker.cr in crystal's source
<FromGitter>
<ImAHopelessDev_gitlab> was pretty fun/interesting
<FromGitter>
<Blacksmoke16> why couldn't you have done that before?
<FromGitter>
<Blacksmoke16> not really any diff than editing files locally and running a program no?
<FromGitter>
<ImAHopelessDev_gitlab> i'd have to edit the files in console or something which i don't know how to use, much easier to edit them vscode
<FromGitter>
<Blacksmoke16> why would you have to do that?
<FromGitter>
<Blacksmoke16> i.e. you would just fork the repo and pull it down locally and then its just like any other crystal shard?
<FromGitter>
<ImAHopelessDev_gitlab> to modify crystal's src to re-compile
<FromGitter>
<tenebrousedge> nano is pretty easy to use if you have to
<FromGitter>
<ImAHopelessDev_gitlab> @Blacksmoke16 i think u know this already, but basically it's cause on WSL, previously you were not allowd to edit unix files on windows with an editor, because of potential corruption
ht_ has quit [Quit: ht_]
<FromGitter>
<Blacksmoke16> oh, then how do you edit your other crystal files?
<FromGitter>
<ImAHopelessDev_gitlab> but now, since the new editing server, it's just like you are editing a windows file, but the file is inside ubuntu's directory
<FromGitter>
<ImAHopelessDev_gitlab> those are in a seperate folder on desktop, outside of the mounted ubuntu os
<FromGitter>
<ImAHopelessDev_gitlab> lol sht. i hope i'm explaining it correctly
<FromGitter>
<absolutejam_gitlab> what's the proper term for a question method?
<FromGitter>
<bararchy> `def bool?`
<FromGitter>
<Blacksmoke16> the api docs use `query getter method`
<FromGitter>
<ImAHopelessDev_gitlab> @Blacksmoke16 , from `ldd`
<FromGitter>
<Blacksmoke16> uh
<FromGitter>
<ImAHopelessDev_gitlab> @ilanpillemer thx. yeah, i usually just --static, and --release, and drag n drop it into my vps and it runs perfect
<FromGitter>
<tenebrousedge> @absolutejam_gitlab a predicate method, technically
<FromGitter>
<ImAHopelessDev_gitlab> omg when I run ./GameServer it's like instant fast
<FromGitter>
<ImAHopelessDev_gitlab> oh derp, no compiler
<FromGitter>
<ImAHopelessDev_gitlab> i want to try that lto thing
Nekka has joined #crystal-lang
<FromGitter>
<ImAHopelessDev_gitlab> `: Use ThinLTO, improving performance on release builds.`
<FromGitter>
<ImAHopelessDev_gitlab> how important is this?
<FromGitter>
<absolutejam_gitlab> ty @tenebrousedge
<FromGitter>
<ImAHopelessDev_gitlab> wow, with `--no-debug`, went from 6.1MB to 4.1MB
<FromGitter>
<ilanpillemer> is that calling out to c libraries?
<FromGitter>
<ilanpillemer> or is everything in the binary?
<FromGitter>
<Blacksmoke16> there are prob some system dependencies since its not fully statically linked
<FromGitter>
<ImAHopelessDev_gitlab> wow!! just did `strip`, and it went from 4.1MB to 2.9MB
<FromGitter>
<ImAHopelessDev_gitlab> how low can this baby go?
<FromGitter>
<Blacksmoke16> if you dont statically link it would be less
<FromGitter>
<Blacksmoke16> since it wouldn't have to include some libs in the binary itself
<FromGitter>
<ImAHopelessDev_gitlab> do i need to static link if i'm using the mysql/db shard?
<FromGitter>
<Blacksmoke16> static linking just includes required libs in the binary itself, i.e. making it more portable
<FromGitter>
<Blacksmoke16> but it shouldnt matter if your host and server have the same deps/libs installed
<FromGitter>
<ImAHopelessDev_gitlab> oh, yeah i think static linkking is what i need. cause i don't install crystal on vps
<FromGitter>
<ImAHopelessDev_gitlab> i just drop it in and it's good to go i liek that
<FromGitter>
<Blacksmoke16> not quite the same
<FromGitter>
<Blacksmoke16> crystal is used to compile the binary, its not used itself
<FromGitter>
<Blacksmoke16> i mean things like `lib-xml` or `lib-yaml`
<FromGitter>
<ImAHopelessDev_gitlab> oh
<FromGitter>
<ImAHopelessDev_gitlab> iuno, last time i tried without static linking, i had errors when i executed it on the vps
<FromGitter>
<ImAHopelessDev_gitlab> so i just static link now, this filesize is fine anyway it's so low alredy
<FromGitter>
<Blacksmoke16> fair enough
<FromGitter>
<ImAHopelessDev_gitlab> that's kinda cool, though. it's like all there
<FromGitter>
<ImAHopelessDev_gitlab> in one executable, all my code
<FromGitter>
<ImAHopelessDev_gitlab> all my work
<FromGitter>
<ImAHopelessDev_gitlab> all the shards from other users
<FromGitter>
<ilanpillemer> if you divide a number by `f` and there is no remainder.. its a factor. Also a factor will never be greater than half the number.
<FromGitter>
<tenebrousedge> @ilanpillemer yes, and maybe, but the code isn't on this computer
<FromGitter>
<tenebrousedge> I remember it as a pain in the butt
<FromGitter>
<ilanpillemer> where in the standard library source code are examples?
<FromGitter>
<ImAHopelessDev_gitlab> so let me get this straight. factors are basically numbers that can "EVENLY" be multiplied into a whole number without a remainder???
<FromGitter>
<kinxer> That's a way of saying that, yes.
<FromGitter>
<ilanpillemer> how you multiply oddly?
<FromGitter>
<ImAHopelessDev_gitlab> floats?
<FromGitter>
<ilanpillemer> are right
<FromGitter>
<ImAHopelessDev_gitlab> haha iuno
<FromGitter>
<ImAHopelessDev_gitlab> @kinxer thanks. okay ithink i got them now
<FromGitter>
<kinxer> No problem. I'm glad things are clear.
<FromGitter>
<ilanpillemer> I am getting quite confused trying to work out how to implement each
<FromGitter>
<kinxer> This is for a Binary Search Tree?
<FromGitter>
<ilanpillemer> yes
<FromGitter>
<ImAHopelessDev_gitlab> @kinxer i'm working on the Raindrops example on Exercism ^^
<FromGitter>
<ilanpillemer> I cant seem to call each on the sub trees from within each
<FromGitter>
<ilanpillemer> not working for me either
<FromGitter>
<ImAHopelessDev_gitlab> i was trying to get my factor_list method working and screwd up with my while loop a couple times, forgot to break out of it and my tab froze
<FromGitter>
<ilanpillemer> and you broke the internets
<FromGitter>
<ImAHopelessDev_gitlab> basically
<FromGitter>
<ImAHopelessDev_gitlab> 😆
<FromGitter>
<ImAHopelessDev_gitlab> in any event, that was kinda fun although it took me forever.
<FromGitter>
<ImAHopelessDev_gitlab> that's the first 'exercise' i've ever done
<FromGitter>
<ImAHopelessDev_gitlab> does it get better???
<FromGitter>
<Blacksmoke16> whats the goal of that raindrop thing?
<FromGitter>
<ilanpillemer> I thinking I am too tired to do delete and iterators for binary trees.. not sure this one should be classified as `easy`
absolutejam4 has quit [Ping timeout: 276 seconds]
<FromGitter>
<Blacksmoke16> build a string based on factors of a number?