ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.2 | 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
moei has quit [Quit: Leaving...]
moei has joined #crystal-lang
p0p0pr37 has quit [Read error: Connection reset by peer]
p0p0pr37 has joined #crystal-lang
p0p0pr37 has joined #crystal-lang
faustinoaq has quit [Ping timeout: 265 seconds]
faustinoaq has joined #crystal-lang
Raimondi has quit [Quit: WeeChat 1.9.1: ¡Chau!]
Raimondi has joined #crystal-lang
hightower3 has joined #crystal-lang
hightower2 has quit [Ping timeout: 265 seconds]
rohitpaulk has joined #crystal-lang
duane has joined #crystal-lang
<FromGitter> <bararchy> Da fuck `Dah for some reason thought it compiles to JVM `
<FromGitter> <bararchy> Who the hell thinks a.compiled language will run willingly on JVM XD
krystal has joined #crystal-lang
krystal has quit [Client Quit]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter> <bew> @OvermindDL1 note: Crystal does not compile to JVM, it compiles to *native code* not to JVM bytecode
snsei has quit [Remote host closed the connection]
sz0 has quit [Quit: Connection closed for inactivity]
duane has quit [Ping timeout: 240 seconds]
johndescs_ has joined #crystal-lang
johndescs has quit [Ping timeout: 250 seconds]
johndescs_ is now known as johndescs
<OvermindDL1> bew: Huh? When did I ever say that? I know it compiles to native via LLVM.
<OvermindDL1> What are you taking about?
<OvermindDL1> I think you meant andre1sk, not me
snsei has joined #crystal-lang
<FromGitter> <bew> oh yeah sorry about that I misread everything ^^
<OvermindDL1> Lol
<OvermindDL1> I may find Ruby and Crystal and Elixir syntaxes absolutely abhorrent, but I know decently how each work. 😉
* OvermindDL1 considers any language with a GC fundamentally broken as it focus on only one type of resource management instead of all resource management as well as it's an uncontrollable manager in the significant majority of cases
<OvermindDL1> focuses*
<OvermindDL1> I would never touch elixir if I could but the beam vm makes it almost stupid easy to scale. I can do the same in c++ sure but significantly more work, work that is not worth it to get the same guarantees that the beam gives
<FromGitter> <girng> @bararchy was quoting a post on elixir forum xD
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter> <girng> @OvermindDL1 long time no see how r u doing
<FromGitter> <girng> hows this look for a simple server tickrate per game instance? https://paste.ee/p/gM1nw
snsei has quit [Remote host closed the connection]
<FromGitter> <girng> you know what, now that i think of it. since i have my masterserver created so well, t hat it syncs with my game servers (cheap VPSs). and since crystal is just using 1 core. if the vps i buy is a dual core, i could actually load up two game servers, one on each port. for example, 9300, and 9301. ⏎ however, im looking to buy cheap VPSs and those cheap ones are usuually a quarter of a core, lol. for example, the
<FromGitter> ... one i have now is just giving me 600MHz on a `E5620 @ 2.40GHz`. which isn't even 1 full single core access lol. ⏎ ⏎ btw, @bew and bar Hofesh.. i don't know if u remember, but a couple days ago when i posted my server specs on my vps remember it was 500MHz? well, i went to re-install the OS and it failed. so i made a suppo ... [https://gitter.im/crystal-lang/crystal?at=5afd1d262df44c2d06344c92]
<OvermindDL1> Laying in bed. Passing out... 😅
<FromGitter> <girng> @OvermindDL1 did you go to university?
<OvermindDL1> I teach and work at a college?
<FromGitter> <girng> @OvermindDL1 oh, figured lol. you seem very educated =]
<FromGitter> <girng> why i asked
<FromGitter> <girng> cause you helped a lot couple weeks ago with my questions with elixir n stuff
<OvermindDL1> Eh, more industry knowledge that educated knowledge, I worked at Xerox for over 8 years before my current job
<OvermindDL1> Than*
<FromGitter> <girng> wow
<OvermindDL1> Ehh, I'll leave it at that, not a job I'd want to do again for moral reasons...
<FromGitter> <girng> only job I had was a caregiver at a nursing home. i went to college for an associates and got a CIS certificate. (pell grant, totally free). i had the option to xfer to a university, to get a bachelors. but i stopped, because college seemed like high school 2.0. it was boring, just a waste of time and i made no connections with friends
<FromGitter> <girng> came out of college just as empty as high school
<OvermindDL1> It was, honestly for most degrees you don't go to school to learn, you go for that piece of paper. Some degrees are worth school, like nursing, but not programming or IT
<OvermindDL1> I'm not sure I'd hire someone that learned programming in school...
<FromGitter> <girng> my CIS professor was insanely nice though, that's all i remember. like 70 year old, he used to program back in the day too lol
<OvermindDL1> Hehe, those people are fun
<FromGitter> <girng> ya you would probably hire them on more of their experience and knowledge, than a degree, right?
<OvermindDL1> Show me a GitHub repo of their work yeah, I can see how their coding is, how they interact in issue communications, PR details, etc...
<OvermindDL1> It is pretty obvious when someone is coding without understanding what they are writing
<FromGitter> <girng> yeah, it seems like how they conduct themselves and their programming history far succeeds a piece of paper
<FromGitter> <girng> but i guess the degree is nice to have too, i guess
<OvermindDL1> HR likes the degree, no one else does
<OvermindDL1> And you have to get through HR first
<FromGitter> <girng> haha, good point
<OvermindDL1> I have two degrees and a minor, none did me a lick of usefulness after HR
DTZUZO has quit [Ping timeout: 240 seconds]
Ven`` has joined #crystal-lang
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wuehlmaus has quit [Quit: Lost terminal]
Ven`` has joined #crystal-lang
wuehlmaus has joined #crystal-lang
<crystal-gh> [crystal] sdogruyol closed pull request #6095: Improve documentation of String#% (master...patch-2) https://git.io/vpQc8
<travis-ci> crystal-lang/crystal#645afb0 (master - Improve documentation of String#% (#6095)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/380071183
<DeBot> https://github.com/crystal-lang/crystal/pull/6095 (Improve documentation of String#%)
faustinoaq has quit [Ping timeout: 264 seconds]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven`` has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.1]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven`` has joined #crystal-lang
Ven`` has quit [Ping timeout: 240 seconds]
<FromGitter> <girng> is it more expensive to parse a float 32 with 2 decimals, or a string that's the same length?
<FromGitter> <yxhuvud> Can you please rephrase the question? It really doesn't make sense as it is now.
mps has joined #crystal-lang
<FromGitter> <girng> sorry. basically, "5234.51" coming in from JSON::Any,and you read it with number.as_f (float 32). compared to number.as_s (as a string). is it about the same, in terms of efficiency?
<FromGitter> <girng> `as_f32` oops.
<FromGitter> <yxhuvud> I doubt there will be a relevant change, but I'd suggest you benchmark it yourself if you want to know. See https://crystal-lang.org/api/0.24.2/Benchmark.html for some help on how to do that
<FromGitter> <girng> ok yeah good idea forgot about benchmark tool xD
alex`` has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
DTZUZO has joined #crystal-lang
DTZUZO has quit [Client Quit]
<FromGitter> <Grabli66> Hi! What is the best way to make plugin in crystal? Plugin for app that also written in crystal.
<FromGitter> <girng> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5afd48279ad18967b9f17ee6]
<FromGitter> <girng> yeah, it's negligible rofl xD
alex`` has quit [Quit: WeeChat 2.1]
alex`` has joined #crystal-lang
<mps> do any of you use crystal in financial apps? I have some fear because it is in alpha state
<FromGitter> <girng> not sure if @sdogruyol's app is financed related, but he uses crystal in production
<mps> girng: I tested some of my apps in perl with crystal version and the results looks ok
<FromGitter> <girng> o really? nice
<FromGitter> <girng> i could never get into perl
<FromGitter> <girng> i've always wanted to try it out however
<mps> but, it would be nice to know if someone experienced in crystal can share opinion about that domain of use
<FromGitter> <girng> i will ping @sdogruyol for you, he can help answer. sorry i can't
<mps> girng: perl is not hard to learn
<FromGitter> <girng> can perl be used for tcp server?
<mps> it have bad 'image' because it is not 'academic' language
<mps> but most and best languages are not born in academia, anyway :)
<mps> girng: yes, there are a lot of TCP servers in Perl
<FromGitter> <girng> really? epic can u give me a example of a lightweight simple one
<FromGitter> <girng> does it work across multiple processes is perl single core like crystal?
<mps> well, Perl supports fork(2) quite well, but threads are not so good
<FromGitter> <girng> eh
<FromGitter> <girng> iuno man, i'll check perl out but if i were to move to a new language, i'd want multi core support out oft he box, similar to elixir.
<FromGitter> <girng> but im too deep anyway i was just curious hahaha
<mps> I have perl HTTP servers in production real-time and critical apps which works for more than 10 years
<mps> it is not without problems, but I didn't found anything without problems till now :)
<FromGitter> <girng> how many requests you getper month?
<FromGitter> <girng> on that http server
<mps> didn't count, but daily (from the head) it servers hundreds of thousands requests
<FromGitter> <girng> oh wow lol
<mps> it is RESTfull services
<FromGitter> <bararchy> perl programming is bsiclly `Shift` + number keys :)
<FromGitter> <girng> LOL
<mps> bararchy: yes, for those who cannot comprehend curly braces and semicolons :)
<mps> and sigils of course
<FromGitter> <bararchy> anyway, it's a "older Ruby", so If you would want something like that I would just use Ruby
<mps> ruby, to my knowledge originated from perl
<FromGitter> <bararchy> yeha, it was
<FromGitter> <bararchy> exactly the reason after 20 years of Ruby, the "child of Perl" I would not suse something like perl for anything XD
<FromGitter> <girng> `$variable`??
<FromGitter> <bararchy> yeha
<mps> when the ruby announced I even started to look at it, and it was so easy because I already knew perl
<mps> girng: php also borrowed a lot from perl
<FromGitter> <girng> @mps in that example, does that server utilize all cores on cpu?
<FromGitter> <girng> on server*
<mps> if it doesn't use threads or some of the coro module/framework (async) I suspect
<FromGitter> <girng> ic
<FromGitter> <girng> @mps have u checked out #Kemal's web framework for crystal?
<mps> girng: yes, it looks quite good, but I don't like to use ready made frameworks
<FromGitter> <girng> you can use that to convert your old perl restful thingamajig
<mps> I prefer to make it from the ground where I can control (reprogram) whatever i need
<FromGitter> <girng> @mps like this? https://crystal-lang.org/api/master/HTTP/Server.html
<mps> actually, I made some of my perl servers in crystal (well, not complete) for tests
<mps> it works quite fine, but I'm still learning crystal so I have bugs and problems
<mps> I'm trying to comprehend crystal reading ruby book, and that is 'try and error' method :)
<mps> but, as Lewis Carol told in 'Alice in wonderland' "you will learn, my dear. You will learn!"
<FromGitter> <girng> /master docs when scrolling on firefox = insane lag
<FromGitter> <girng> did someone change the scroll behavior plz change it back xD
<FromGitter> <sdogruyol> @mps I've used Crystal extensively with critical payment stuff
<FromGitter> <sdogruyol> what's your use-case?
<mps> sdogruyol: nice to hear. I'm working in on-line service where we calculate monthly invoices for users
<mps> till now all calculations are in perl, with some help of C
<mps> I'm learning crystal, and would like to move some services to crystal
<mps> but my fear is about sentence 'crystal is alpha state' which I read somewhere on crystal-lan.org IIRC
<wuehlmaus> doesn't feel like alpha at all. I think it's only a warning that the behaviour could change fast. but stability wise it feels quite stable IMO
<wuehlmaus> but, okay, i don't use in production so ...
<wuehlmaus> ^ it
<mps> wuehlmaus: well, I also have that feeling, but it is not unwise to hear from other with a deeper experience
<wuehlmaus> yes, very good idea!
<livcd> well i would definitely not use Crystal for something mission critical
Ven`` has joined #crystal-lang
<FromGitter> <girng> so i did some testing with my game server.. each new game class that get instanced, spawns a 15hz tick rate. i spawned 1000 of them. so t hat's over 15,000 iterations per second
<FromGitter> <girng> cpu % in `top` fluctuated around 0.2 to 5% lol
<mps> livcd: is your opinion from experience or just thougt. could you tell little about it
<mps> I would like to hear pro end contra
<livcd> it's ofc subjective opinion
<mps> ok, sometimes gut feeling is better than rational explanations, in my experience at least
<FromGitter> <girng> i think he's saying you should be fine, unless you are using it for NASA, or like flying drones, etc
<FromGitter> <girng> simple restful API or w/e you should be more than fine
<mps> girng: long time ago I worked in ballistic calculations and then I learned how the computers are bad at math
<mps> from that time I always triple check everything
<FromGitter> <girng> lol
<livcd> well people use proprietary niche technologies and are doing just fine
<livcd> RubyMotion is still used and it's maintained by 1 guy only if i recall correctly
<mps> I don't see any problem if something maintained by 1 person if well designed, tested and carefully looked
<mps> s/if well/is well/
moei has quit [Quit: Leaving...]
<FromGitter> <sdogruyol> @mps that one service in Crystal had like more than 1.5 years uptime with no restarts :P
<FromGitter> <sdogruyol> talks to weird SOAP banking apis and does some crazy xml parsing
<FromGitter> <sdogruyol> you know the drill
<FromGitter> <girng> how can i access another value outside of a class?
<mps> sdogruyol: yes, I know. Thank you for sharing your experience
<FromGitter> <sdogruyol> anytime!
<mps> ok, I will start to work on test system with crystal
<FromGitter> <sdogruyol> go for it
<FromGitter> <sdogruyol> I'm sure that it's worth a shot and you're gonna like it :)
<mps> sdogruyol: Well, I'm still learning crystal and in my experience the best method to learn something is to do a real work with the learning subject
<FromGitter> <girng> i think i got it. i need to use `class_property`
<FromGitter> <sdogruyol> @mps absolutely!
<mps> it is somehow slow but the results are good
<mps> sdogruyol: btw, are you author of Kemal framework
<FromGitter> <sdogruyol> yes
<mps> Nice work. I looked at it to learn about REST and HTTP crystal solutions :)
<FromGitter> <sdogruyol> thanks a lot! Glad you liked it 👍
<FromGitter> <girng> actually. im keeping track of my game tick rate iterations.. and it stops at around 500 games open. which is around 500 fibers, each having their own 15hz loop do. which is around 7,500 iterations per second. after that, the fibers just stop working
<FromGitter> <girng> im going to now test, just one main game loop at 15hz, that iterates over the games, and players instead. see how many games i can get open =]
<FromGitter> <girng> hmm that's odd. even when the fibers stop, when i look at the process in `top`, it still shows crystal not even at max load. so i think something else is screwy.
<FromGitter> <girng> im going to isolate this in my own file and test it out separately. needs to be reduced
greengriminal has joined #crystal-lang
<FromGitter> <sdogruyol> are you sure that you're not io bound @girng?
<FromGitter> <girng> @sdogruyol not sure, can i check that in `top`? i'll post this mini example here in a min 1 second
<FromGitter> <sdogruyol> use iotop https://linux.die.net/man/1/iotop @girng
<FromGitter> <girng> lol wow
<FromGitter> <girng> tried to install iotop ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5afd747752194a4a67f1471b]
<FromGitter> <girng> whatever that means, whatever. must be because im on WSL
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter> <girng> @sdogruyol check this: https://paste.ee/p/PtaGX
<FromGitter> <girng> i can get up to `Total Game Loop Iterations: 391000, Games Open: 1000`... which is far more than my total of 300 on my real gameserver. i wonder if socket.send has anything to do with it. i bet that is part of the `IOTOP` part
<FromGitter> <girng> i can actually increase it further than that cpu usage is still low as heck
greengriminal has joined #crystal-lang
<FromGitter> <sdogruyol> well that means you're locking up the event loop and not cpu bound
<FromGitter> <sdogruyol> how's your memory usage e.g?
<FromGitter> <girng> forgot to check memory let me try on real gameserver
<FromGitter> <girng> it's crystal-run-game, here is screenshot (https://i.gyazo.com/a991cc6b932cdc5e8942aeecce3d0a06.png)
<FromGitter> <girng> seems like iterations stop and increase really slowly lol
<FromGitter> <girng> this (https://paste.ee/p/mXjKf) is the rickrate, compared to the one in my reduced sample
<manveru> where can i find docs about syntax like ``?
<FromGitter> <girng> im going to remove bit by bit, to see if that's the bottleneck
<z64> manveru: you mean https://crystal-lang.org/api/0.24.2/toplevel.html#%60%28command%29%3AString-class-method ?
<manveru> ah, thanks
<z64> np
<manveru> fun to see yet another language with $? :)
<FromGitter> <girng> @sdogruyol LOL, now look at the results (https://i.gyazo.com/cc05d1af09f01997415f14044b81b5b4.png), after I commented out ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5afd77a8e0b50c2d05ccff0a]
<FromGitter> <girng> definitely IO bound right, cause send?
<FromGitter> <sdogruyol> yeah
<FromGitter> <sdogruyol> I assume those are websockets?
<FromGitter> <girng> just regular tcp server from api page
<FromGitter> <sdogruyol> if so then publishing to all of those is gonna some bandwith
<FromGitter> <sdogruyol> well still those are sockets = network
<FromGitter> <girng> well yeah
<FromGitter> <girng> so, doing the game loop in each fiber isn't issue. more io bound. which means me testnig the 1 game loop, and iterating through games is pointless to test
<FromGitter> <girng> fibers pretty damn powerful
<FromGitter> <sdogruyol> it's Crystal power
<FromGitter> <sdogruyol> :)
<FromGitter> <girng> so that socket io is basically means my local speeds are just not fast enough, right?
<FromGitter> <girng> bcz memory and CPU in top still very low
<FromGitter> <girng> if i buy a vps, it will need high port
<FromGitter> <girng> right?
<FromGitter> <girng> not 100mbps, but 1000mbps
<FromGitter> <girng> "gig port" or w/e lol
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter> <bararchy> @girng Do you have a demo running?
<FromGitter> <girng> locally lol
<FromGitter> <girng> stupid iotop don't work on WSL
<FromGitter> <girng> but really. even if i could get 500 games active on a VPS, that's still AMAZING. 6 players per game, that's 3,000 online players. which is far more than i prob will ever get lol
<FromGitter> <girng> i mostly just want the extra VPSs, because i want to place them around the world, so players don't experience lag
rohitpaulk has quit [Ping timeout: 256 seconds]
<FromGitter> <bararchy> @girng I'm gonna get a beta key? ;)
<FromGitter> <yxhuvud> you could perhaps not send all data every time and improve performance that way
<FromGitter> <girng> sure, i generate with `UUID.random` :D
<FromGitter> <bararchy> LOL
<FromGitter> <girng> lol actualyl, i will probably do that. and put them in mysql so when a player uses it, it'll remove the beta key and set access =true to play :D
<FromGitter> <bararchy> Will you have Steam\GOG client support?
<FromGitter> <girng> nah, just linux and windows native. my game has microtransactions, don't want steeam taking my $
<FromGitter> <girng> they take %
<FromGitter> <girng> anyway, i'm going to add in socket io to my example (https://paste.ee/p/PtaGX), so i test it / reduce it by itself brb
<FromGitter> <bararchy> as in "freemium"?
<FromGitter> <girng> yah
<FromGitter> <girng> but NO P2W
<FromGitter> <girng> Cosmetic only!
moei has joined #crystal-lang
<FromGitter> <bararchy> ok, makes sense
greengriminal has joined #crystal-lang
<FromGitter> <girng> alternative to iotop?
greengriminal has quit [Client Quit]
<FromGitter> <girng> iftop?
<FromGitter> <girng> wow, iftop doesn't work on WSLeither ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5afd7d249ad18967b9f2456c]
<FromGitter> <girng> *googling WSL iotop alternatives*
<FromGitter> <bararchy> `shards.info` is down with Kemal 500 error :(
<FromGitter> <sdogruyol> http://crystalshards.xyz/
<FromGitter> <bararchy> @mamantoha
duane has joined #crystal-lang
<FromGitter> <mamantoha> @bararchy thanks. Restarting dynos on Heroku resolves problem :)
<FromGitter> <bararchy> Thanks :)
<FromGitter> <bararchy> 🎉
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven`` has joined #crystal-lang
Ven`` has quit [Client Quit]
Ven`` has joined #crystal-lang
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
greengriminal has joined #crystal-lang
Ven`` has joined #crystal-lang
rohitpaulk has joined #crystal-lang
greengriminal has quit [Ping timeout: 248 seconds]
rohitpaulk has quit [Ping timeout: 256 seconds]
faustinoaq has joined #crystal-lang
<FromGitter> <faustinoaq> > `shards.info` is down with Kemal 500 error :( ⏎ ⏎ @mamantoha Would be interesting to see how many resources (RAM, CPU, etc) do `shards.info` use? Maybe you can share us 😅
<FromGitter> <faustinoaq> > Restarting dynos on Heroku resolves problem :) ⏎ ⏎ Thank you! 😄 ✨
<FromGitter> <girng> https://github.com/crystal-lang/crystal/releases which one would work for debian server?
<faustinoaq> @girng I guess the `.deb` one ;-)
<FromGitter> <girng> amd64 or i386 one? whats the difference?
<FromGitter> <girng> obviously 1 64-bit?
<FromGitter> <mamantoha> @faustinoaq I’m using a free plan on Heroku. Metrics are only available for apps running paid plans.
<faustinoaq> @mamantoha Oh, ok, no problem :-)
<FromGitter> <girng> ```code paste, see link``` ⏎ ⏎ what did i do wrong [https://gitter.im/crystal-lang/crystal?at=5afd96582df44c2d06363254]
<FromGitter> <fridgerator> looks like you linked a bin folder instead of the actual executable?
<FromGitter> <girng> should it be /root/crystal/bin/crystal?
<FromGitter> <fridgerator> if thats the crystal executable, then yes
<FromGitter> <girng> now it won't let me add it
<FromGitter> <girng> says already executes
<FromGitter> <girng> exists*
<FromGitter> <fridgerator> `rm /usr/local/bin/crystal` first
<FromGitter> <girng> ty
<FromGitter> <girng> ok i think i'm almost there, now when i do `crystal` it just pauses on a new line
<FromGitter> <girng> i think i got it linked however
<FromGitter> <girng> im using the `Source code (tar.gz) ` from https://github.com/crystal-lang/crystal/releases, 1.74MB compressed
<FromGitter> <girng> should i try to symbolically link another one?
<FromGitter> <fridgerator> I'm not sure i've never run crystal from the source
<FromGitter> <fridgerator> dont you have to compile it first?
<FromGitter> <girng> im trying to do this: https://crystal-lang.org/docs/installation/from_a_targz.html
<FromGitter> <fridgerator> ah
<FromGitter> <girng> cuz when i try to do apt-get install crystal. it takes FOREVER, debian downloads bunch of sht
<FromGitter> <fridgerator> yeah i've never done that
<FromGitter> <girng> and this vps is too slow, i just wanna upload the executable n run it
<FromGitter> <fridgerator> I'm assuming what Debian is downloading is required depedencies
<FromGitter> <fridgerator> dependencies*
<FromGitter> <girng> good point
<FromGitter> <girng> `yes | apt-get install curl apt-transport-https && curl https://dist.crystal-lang.org/apt/setup.sh | bash && yes | apt-get install crystal`
<FromGitter> <girng> my own script, eZ
<FromGitter> <r00ster91> What about adding a `--no-gc` flag or something to completely disable the GC? Then Crystal will be even more faster and closer to C speed. And eventually compile times would be faster. I know garbage collecting is important sometimes and useful so you don't need to manage the memory yourself but sometimes at pretty simple programs theres just not a GC needed. And then it would be nice that you can disable it.
<FromGitter> ... ⏎ ⏎ I know its possible to redefine the normal main function so `GC.init` doesn't runs but it would be still really good and quite handy to have a flag for this that the user can specify instead of needing to redefine it first.
That_Guy_Anon has joined #crystal-lang
<faustinoaq> I found some outdated syntax on that file :-)
<faustinoaq> I just realize of that when I was trying to test my code for crystal syntax support on Kate https://phabricator.kde.org/D7909
<faustinoaq> :-)
<FromGitter> <girng> @r00ster91 if no GC, we then manually clean up classes in their destructor?
<FromGitter> <r00ster91> yes. But whats with really simple little programs without classes which really dont need a GC?
<FromGitter> <girng> too advanced 4 me, i wait for rx14+other master devs to chime in sry
<RX14> you can turn off the gc
<RX14> it wont make your programs much faster
<RX14> and it won't make them compile faster
<RX14> and you'll run out of memory pretty quick
faustinoaq has quit [Ping timeout: 265 seconds]
<FromGitter> <r00ster91> hm I thought the compile times were faster when I once redefined the main function. And didnt you said some time ago that the only thing thats keeping crystal from being fast as C is because its a GCd language? I think it would be still handy to have a flag for this.
<RX14> it's 10% speed for a non-solution
<RX14> C provides manual memory management
<RX14> thats impractical in crystal
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DTZUZO has joined #crystal-lang
<FromGitter> <S-YOU> -Dgc_none exists
<FromGitter> <S-YOU> But bohem gc 's GC_malloc is much faster than C's malloc at same amount of call.
<OvermindDL1> Theoretically a GC can handle memory better than traditional malloc/free, however the tracing style to keep the root's of the memory is generally what incurs the main overhead
<OvermindDL1> And of course how to iterate those
<OvermindDL1> Mischat on that link*
<RX14> OvermindDL1, a classic
<OvermindDL1> Heh, very, someone brought it up in another channel on another network and I was trying to get my bot to print it out, which it obviously does not do here... ^.^;
<FromGitter> <S-YOU> I do think that your password was `malloc`
ua has quit [Ping timeout: 240 seconds]
ua has joined #crystal-lang
sz0 has joined #crystal-lang
<oprypin> i officially declare bitbucket as the website with the worst UI in the world
<OvermindDL1> It is pretty bad, but unlimited private repo's though, before gitlab existed...
<OvermindDL1> And it is faster than gitlab
<RX14> self-hosted gitea seems the way to go
t0nyandre has quit [Quit: Account terminated by the PanicBNC Staff Team.]
<RX14> or just become an academic and get free github private repos
<OvermindDL1> Eh but then have to contend with losing access when you leave that then, or paying
<OvermindDL1> github doesn't have a good way to recover things in a variety of ways
<RX14> true
<RX14> but at the end of the day it's git
<RX14> and you should have backups anyway
<RX14> my stuff is rsynced every 5 mins to my nas
<RX14> and from there backed up incrementally daily to two cloud providers
<OvermindDL1> Hear hear
<RX14> private repos just provide easy access, you shouldnt really rely on them for backup
<RX14> i spend probably a bit too much money in not bitrotting my own stuff
<FromGitter> <bew> What do you rely on for backups?
<RX14> I use duplicacy, which is an extremely nice piece of software but unfortunately only visible source
<RX14> when restic gets sparse file, deletion, and compression support then i'll move to that
<FromGitter> <Wulfklaue> Guys, i am sorry to say this but i will be moving to Go ( *yuck* ) for a rather large project. ⏎ ⏎ I have been following ( for over a year ) and financially supporting Crystal for a long time behind the screens but this lack of progress is detrimental to my projects. ⏎ ⏎ The whole progress from Manas looks to be nothing. There last effort dating back months being the CircleCI 2.0 may have had
<FromGitter> ... benefits but its things that as a "end user" i do not see. ... [https://gitter.im/crystal-lang/crystal?at=5afdae65e0b50c2d05cdf015]
<FromGitter> <Wulfklaue> All the best wishes!
<RX14> bcardiff will be starting work on crystal full-time next week
<RX14> there are plenty of good other reasons to move to go though
<FromGitter> <r00ster91> when im running my program after i already runned it before and i made no change to my file, why is crystal not just caching the executable and running it again then instead of building it completely again? because it will just build the exactly same thing. so caching would be much smarter and faster
<RX14> that could be done with crystal run just by a hash of all required files
<RX14> but it wouldn't work for crystal build
<RX14> it's just a low-priority enhancement
<FromGitter> <girng> wat just happended
That_Guy_Anon has quit [Quit: Leaving]
txdv has quit [Ping timeout: 264 seconds]
txdv has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
alex`` has quit [Quit: WeeChat 2.1]
alex`` has joined #crystal-lang
alex`` has quit [Read error: Connection reset by peer]
<FromGitter> <fridgerator> dude bailed
* FromGitter * manveru just coming from go....
<FromGitter> <manveru> i just wish static compiling was as easy
<FromGitter> <manveru> btw in case someone here's using nix, i made a little thing: https://gist.github.com/manveru/8241ae64b86ec9ae8262125b0516ce64
greengriminal has joined #crystal-lang
alex`` has joined #crystal-lang
<oprypin> what does it do though
<oprypin> i ran nix in a vm once for like 15 minutes, so i guess things are pretty serious
<FromGitter> <manveru> :)
<FromGitter> <manveru> basically it makes it possible to build crystal projects that depend on shards with nix
<FromGitter> <manveru> i did similar stuff for yarn/rubygems/elm-packages/guile/vim, since they each insist on having their own half-assed implementation of half of nix
manveru has left #crystal-lang [#crystal-lang]
hightower2 has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
<hightower2> Hey, can I invoke a macro on an object directly somehow? I notice that if I do obj.some_method, and that method calls a some_macro, that works. But if I do obj.some_macro, that doesn't work.
<oprypin> hightower2, macros are never associated with an object. that would make no sense because an object's state is entirely run-time
<hightower2> yes, sure, but I would expect it would somehow still expand. Although I probably answered it by asking... it would be questionable how would obj.some_macro expand a macro into anything useful
<hightower2> So, invoking a method, which called some macro internally and now has the code that macro inserted, is the way to go?
<OvermindDL1> Eh, I could see macro's being associateable with an object if it's type was known at runtime (and it didn't use something horrible like OOP or so)
<oprypin> hightower2, that's the only thing that makes sense, yes
<hightower2> Great, thanks for confirming/clarifying oprypin
<oprypin> github.com homepage improved
greengriminal has joined #crystal-lang
greengriminal has quit [Client Quit]
<hightower2> mm, interesting change
alex`` has quit [Quit: WeeChat 2.1]
<hightower2> I am calling a macro with a block as argument ( some_macro "x", { block code } ). Is it possible to somehow compute a .hash() of that block within the macro? If I just do {{block}}.hash, that seems to execute it or in some other way not do what is wanted
<oprypin> hightower2, would you write { block code }.hash ?
<oprypin> cuz that's what this ends up as
<oprypin> what are you actually trying to do?
<hightower2> I'd like the effect to be something like def my_method(&block) puts block.hash end
<hightower2> But need to do it in the context of a macro
<oprypin> what are you actually trying to do?
<hightower2> Good question :) Let me try phrasing it :)
greengriminal has joined #crystal-lang
greengriminal has quit [Quit: Leaving]
<hightower2> On a side note, why does some_macro { |x| puts x } work, while some_macro "arg1", { |x| puts x } produces "unexpected token: |"
<hightower2> must be in the second form it is being treated as a tuple or hash
alex`` has joined #crystal-lang
<hightower2> figured it out
<oprypin> >> { puts 5 }
<DeBot> oprypin: 5 - more at https://carc.in/#/r/435e
<oprypin> >> { |x| puts 5 }
<DeBot> oprypin: Syntax error in eval:17: unexpected token: | - https://carc.in/#/r/435f
<oprypin> hightower2, perhaps my examples will help you come to the right conclusion
<oprypin> you should note that you're not supposed to write a comma when passing a block, then it just doesn't work
<oprypin> then it's something entirely different, seems equivalent to `begin; end` rather than `do; end`
<hightower2> yeah, managed to get it working by doing some_macro("arg1") { block }, and explicitly adding & macro definition, so it's macro some_macro(arg, &block)
<oprypin> that is correct
<oprypin> and i was incorrect, it really is a tuple then
<hightower2> As for what I was trying to do with block.hash above... I have macro to which I pass blocks, and it stores them somewhere. As its return value, I would like it to return the block's hash, so that later I can use the hash value to iterate through existing blocks and delete the one(s) matching the hash
<hightower2> But if I'm making a mistake somewhere and finding/removing blocks can be done without a hash (or using some other way of tracking/finding the right ones), I'm all ears
<hightower2> oh solved it.. my macro in turn calls some method which returns the hash, so I don't need to compute it while in macro context
duane has quit [Ping timeout: 256 seconds]
hightower2 has quit [Ping timeout: 256 seconds]
duane has joined #crystal-lang
johndescs has quit [Ping timeout: 268 seconds]
duane has quit [Ping timeout: 240 seconds]
duane has joined #crystal-lang
johndescs has joined #crystal-lang