RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.25.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
ua has quit [Ping timeout: 244 seconds]
ua has joined #crystal-lang
ua has quit [Excess Flood]
ua has joined #crystal-lang
ua has quit [Excess Flood]
ua has joined #crystal-lang
ua has quit [Ping timeout: 260 seconds]
ua has joined #crystal-lang
DTZUZO has quit [Read error: No route to host]
DTZUZO has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 272 seconds]
Raimondii is now known as Raimondi
DTZUZO has quit [Ping timeout: 272 seconds]
pabs has quit [Ping timeout: 260 seconds]
ashirase has quit [Ping timeout: 260 seconds]
ashirase has joined #crystal-lang
lvmbdv has quit [Quit: 'they found me']
<FromGitter> <bararchy> :)
<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
pabs has joined #crystal-lang
<FromGitter> <schoening> https://play.crystal-lang.org/#/r/4rph ⏎ ⏎ :o no #to_json on hash?
<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
<oprypin> why isnt json mapping gone btw?
<FromGitter> <schoening> I see, thanks! Why did you call it record instead of class in your example btw?
<FromGitter> <bararchy> I still use it, it another method to define a mapping
<oprypin> schoening, cuz i'm being cheeky. just shorter way to write what you had. but the whole point is include JSON::Serializable
<FromGitter> <schoening> Haha ok :)
DTZUZO has quit [Quit: WeeChat 2.0]
Kug3lis is now known as Kug3lis_off
Kug3lis_off is now known as Kug3lis
<FromGitter> <asterite> Yeah, JSON.mapping should be gone at one point. Not sure how the core team wants to handle this
<FromGitter> <rishavs> aren't you in the core team ? o.0
<FromGitter> <asterite> I am, I just don't want to take decisions anymore
alex`` has quit [Remote host closed the connection]
<FromGitter> <bmulvihill> Looks like https://github.com/crystal-lang/crystal/pull/6286 stopped the spec dots from printing out during run, particularly this https://github.com/crystal-lang/crystal/pull/6286/files#diff-1743af63147895659bc0e1ccdc6a7b75R29
<oprypin> bmulvihill, did you confirm it or is it just "looks like"?
<oprypin> also do you confirm that it happens to you?
<FromGitter> <bmulvihill> I bisected it
alex`` has joined #crystal-lang
<FromGitter> <bmulvihill> Yes it happens to me
<oprypin> great job! everything we need for a good bug report
<FromGitter> <bmulvihill> when I flush the IO after printing it at that line it works as expected, looks like top level print flushes
<FromGitter> <j8r> Yep great! I suspect the change in the dot formatter, `print` changed to `@
<FromGitter> <j8r> @io <<
<FromGitter> <j8r> It can be flush because print/puts append to io and then flush
lvmbdv has joined #crystal-lang
<FromGitter> <j8r> It's likely that, nice @bmulvihill !
<FromGitter> <bmulvihill> Ill open an issue, don't have time to fix currently
Kug3lis is now known as Kug3lis_off
Kug3lis_off is now known as Kug3lis
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis has joined #crystal-lang
Raimondii has joined #crystal-lang
<FromGitter> <MrSorcus> https://github.com/crystal-lang/crystal/issues/6534 ⏎ How to debug it? X-)
Raimondi has quit [Ping timeout: 272 seconds]
Raimondii is now known as Raimondi
<FromGitter> <vladfaust> Hi, if anyone uses Prism, there are some RFC @ https://github.com/vladfaust/prism/issues
<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> <stronny> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b7845e8d7901b2c605742b0]
<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> it's just all code
<FromGitter> <stronny> so how do string literals allocated? if I have a ⏎ ⏎ ```def method ⏎ puts "hello world" ⏎ end``` ⏎ ⏎ does "hello world" also live in heap? [https://gitter.im/crystal-lang/crystal?at=5b7848a7796f7b601d5d8099]
<FromGitter> <Groogy> yes
<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> ... /gitter.im/crystal-lang/crystal?at=5b786b78157b9d34efa610fe]
<FromGitter> <vlazar> Anyone seen this error before?
<FromGitter> <valamorgon> is there any easy way to downgrade crystal from 26 to 25?
<FromGitter> <stronny> so provided I have ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ is it safe to assume that `Time.now.to_s(buf)` doesn't allocate memory? [https://gitter.im/crystal-lang/crystal?at=5b786c530825690ea2eb3b3e]
<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*`
<oprypin> either use or learn from https://github.com/Groogy/trashman
<FromGitter> <valamorgon> @opryn
<oprypin> valamorgon, edits are not seen on my side. don't use edits for anything important
<FromGitter> <valamorgon> @opryn yes I have crystal 26 deb in the path you have sent
<oprypin> 26 does not help
<FromGitter> <valamorgon> @oprypin got it thanks
<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
<FromGitter> <j8r> You can use an Alpine Docker image (like this one https://store.docker.com/community/images/jrei/crystal-alpine
<lvmbdv> ye you can do it that way
<FromGitter> <j8r> Or use chroot, LXC, a VM