<FromGitter>
<kaukas_gitlab> I upgraded to 0.26, and now my `crystal spec` does not output dots one-by-one but all at once, when tests finished. This is on latest mac. Is that something that others experience as well?
<oprypin>
kaukas_gitlab, i think i'm getting that as well on linux
<oprypin>
certainly worth reporting
DTZUZO has joined #crystal-lang
Kug3lis has joined #crystal-lang
<oprypin>
not entirely sure though, i havent found a good example of long-running specs, so they're just instantaneous regardless
<FromGitter>
<schoening> What am I doing wrong here? Just testing out. I need to convert objects inside an array into json eventually
<FromGitter>
<asterite> `require "json"`
<FromGitter>
<schoening> Hahaha omg :) Thanks!
<FromGitter>
<schoening> Sorry but I have a second question that I cant figure out.. ⏎ https://play.crystal-lang.org/#/r/4rpn ⏎ Trying to #to_json an array here... Why is that not possible?
<oprypin>
@schoening, well again, require "json" but then also Group has no defined conversion to json
<FromGitter>
<schoening> Thanks for the help @asterite @oprypin now I can generate some large json data that had my node.js choking :D
<FromGitter>
<Groogy> Finally on my way home again
<FromGitter>
<Groogy> Doing some summer cleaning on my webserver and I know there's a bunch of web developers here, what blog app is best to use these days? Or interesting, best is probably still wordpress
<FromGitter>
<schoening> Ghost or Medium are good too. Nothing wrong with Wordpress unless you drink all of the hipster cool aide like I used to
<FromGitter>
<Groogy> Haha I'm not, I'm just going through all of the potentials in softaculous right now
<lvmbdv>
> not static site generators
<lvmbdv>
ewwww
<lvmbdv>
hugo is pretty rad groogy
<oprypin>
> not reinventing your own wheel
<lvmbdv>
yes you can write your own static site generator as well
<FromGitter>
<schoening> if I ever start blogging on either software or self development then I would take Medium. Its a nice platform and I already read 80% of articles from there.
<lvmbdv>
> you visited our site 3 times, please sign up
<FromGitter>
<Groogy> it's not for actual blogging though
<lvmbdv>
> that popup every god damn time
<FromGitter>
<Groogy> I just keep my references to past projects there these days
<FromGitter>
<stronny> good evening. suppose I have aa finalize
<FromGitter>
<stronny> the docs say I shouldn't allocate anything, however how do I get around that?
<oprypin>
you don't
<FromGitter>
<stronny> Time is a struct, so should live on stack, but String is a ref, right?
<oprypin>
give an example and maybe you'll get some alternative
<oprypin>
or explain what you actually want to do
<FromGitter>
<Groogy> Are you trying to figure out when objects are being deleted?
<FromGitter>
<Groogy> you can have a look at my Trashman
<FromGitter>
<Groogy> most probably you want to store away the time and inspect it later
<FromGitter>
<stronny> I just think it's neat to have a debug level runtime logging for GC is all
<FromGitter>
<Groogy> also why are you mixing concenation and #{expr}?? just use "#{expr} #{and more expr}"
<FromGitter>
<stronny> this is just a pseudocode off the top if my head
<FromGitter>
<Groogy> Then you probably want to use Trashman
<FromGitter>
<Groogy> it records everything if you turn it on as long as you mixin the module
<FromGitter>
<stronny> My question is more about memory model though ⏎ Is there a way to use a String on stack?
<FromGitter>
<Groogy> no it's an object
<FromGitter>
<Groogy> you would have to implement it yourself using a struct and StaticArray to mimic a normal String, but it would mean it would be copied everywhere
<FromGitter>
<Groogy> and it's size would be fixed as well
<FromGitter>
<schoening> ri9e
<FromGitter>
<schoening> oi.. cat across keyboard. I thought people made that up
<FromGitter>
<stronny> shame we don't have a StaticStrinig then =(
<FromGitter>
<Groogy> well you can always implement it
<FromGitter>
<Groogy> but you could solve that with macros
<Yxhuvud>
well, string constants are saved in the DATA area, no?
<FromGitter>
<Groogy> since the macro can read string literals
<FromGitter>
<Groogy> ah yeah but it would be a String object
<FromGitter>
<stronny> can I just allocate a buffer and reuse it with Time#to_s(io)?
<FromGitter>
<Groogy> and behave like one, after you've done str = "hello world", str is a String object
<oprypin>
stronny, no matter what you do, time.to_s probably does its own string allocations
<oprypin>
you sshould try, though
<oprypin>
`time.to_s(STDOUT)`
<oprypin>
i suspect it will not work but that will be your confirmation
<lvmbdv>
good project name groogy
literal has quit [Ping timeout: 240 seconds]
<FromGitter>
<Groogy> Also hmm I'm sort of curious, if I want to use Crystal stuff on my server, let's say a Kemal app, all I need is to have the compiled executable, the executable won't depend on anything weird right?
<oprypin>
Groogy, only some libraries that every distro has
<oprypin>
and you likely cant move the executable from a different distro
<FromGitter>
<Groogy> Yeah and I can probably get the server admin to install things for me
<FromGitter>
<Groogy> I've gotten him to do it before so
<oprypin>
O_o
<FromGitter>
<Groogy> ManuFrog is a great server host
<FromGitter>
<Groogy> had my server there for 10 years now
<FromGitter>
<Groogy> for private use at least
<oprypin>
just looked it up, seems like the worst deal that i've seen in a long time
<FromGitter>
<Groogy> Anyway I'm on the edge of starting another project ;^-^
<lvmbdv>
it will groogy
<lvmbdv>
libevent, libyaml, many things
<oprypin>
nvm i thought it was 18 USD
<lvmbdv>
static compiling is not ready yet
<lvmbdv>
(i think
<lvmbdv>
)
<FromGitter>
<Groogy> Ah no it's a Swedish webhost
<FromGitter>
<Groogy> so it's crowns
<FromGitter>
<Groogy> hmm gonna experiment when I get home, see if I can get it to run a simple hello world output
<lvmbdv>
you can list the linked libraries with `ld`
<Yxhuvud>
I mean, if you don't expect to have any load there are plenty of free hosting. heroku has a free tier, etc
<lvmbdv>
yeah there is a crystal webpack for heroku too
<FromGitter>
<Groogy> anyway train almost at end station, time to log out, cya!
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
return0e has joined #crystal-lang
return0xe has joined #crystal-lang
return0e has quit [Read error: Connection reset by peer]
<FromGitter>
<vlazar> I'm updating a small GraphQL service which worked in Crystal 0.24 to Crystal 0.26. The https://github.com/ziprandom/graphql-crystal wasn't working in 0.25 before, now it's fixed and my service appears to work in 0.26 now. ⏎ ⏎ However when I try to build service in release mode with `build --release` I get this weird error: ⏎ ⏎ ```code paste, see link``` [https:/
<FromGitter>
<vlazar> @valamorgon on OSX it's `brew uninstall crystal` and then `brew install <link to raw formula on github>`
<oprypin>
stronny, no it's not safe to assume because it is not part of the functions API / documentation
<FromGitter>
<stronny> so you're saying it can change and I shouldn't depend on a particular observation?
<FromGitter>
<valamorgon> @vlazar any idea on ubuntu? I try sudo apt install crystal=0.25.1-0 or sudo apt install crystal=0.25.1-1 but it says: E: Version '0.25.1-0' for 'crystal' was not found
<oprypin>
stronny, yeah i guess that's what i'm saying. though it's only theoretical.
<oprypin>
what i really mean is that you probably shouldn't be messing with any of this
<FromGitter>
<stronny> so what would you recommend? wrap strftime?
<oprypin>
stronny, do not try to hack your way around the limitation of no allocations
<oprypin>
do not use finalizers for anything important
<FromGitter>
<stronny> writing a debug log is hardly important, though nice to have
<oprypin>
valamorgon, have you checked in local cache perhaps? do you see anything in `ls /var/cache/apt/archives/*crystal*`
<FromGitter>
<stronny> so you suggest storing the information and processing it after the finalizer is done right?
<FromGitter>
<stronny> I suppose it can work, though it would require a more complex logic. I feel it will just move a dangerous piece from one place to another though, because to store something you might need to realloc after all.
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
hightower2 has joined #crystal-lang
<hightower2>
Hey, what was the solution from the other day to convert an Array of e.g. [1,2,3] into a Hash of [1 => true, 2 => true, 3 => true] ?
<oprypin>
hightower2, each_with_object
<oprypin>
.to_h
<hightower2>
ooh yes, thanks!
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 276 seconds]
DTZUZO has joined #crystal-lang
hightower2 has quit [Remote host closed the connection]
<FromGitter>
<bcardiff> @vlazar you can use darwin .tar.gz files from github releases. those binaries will use llvm 3.9, but you can downgrade to any crystal version. ⏎ ⏎ Other alternative is to use docker images.
alex`` has quit [Ping timeout: 276 seconds]
alex`` has joined #crystal-lang
moei has quit [Ping timeout: 272 seconds]
alex`` has quit [Quit: WeeChat 2.2]
moei has joined #crystal-lang
<FromGitter>
<j8r> @Groogy you can statically link your Crystal program, and the only send the binary to any Linux system and that's it