<FromGitter>
<sergiotapia> Hey guys, quick Q before I dive into Crystal. Can I build a static binary from my Crystal code? I want to build a web app and just have people download a .exe and run it locally without having to install ANYTHING. Is this possible with Crystal?
<RX14>
well building an exe isn't possible because crystal doesn't support windows yet
<RX14>
but it's possible with some effort
<RX14>
it's not too hard to static link for linux in docker
<RX14>
no idea how hard it would be in windows
<RX14>
for macos it's largely impossible
<RX14>
at elast not fully static but you can get a portable executable
<FromGitter>
<eliasjpr> Instead of investing in Crystal they went to create their own ruby compiler
TCZ has quit [Quit: Leaving]
Nathanaelle has joined #crystal-lang
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
alex`` has joined #crystal-lang
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
rohitpaulk has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
alex`` has quit [Ping timeout: 265 seconds]
<FromGitter>
<bew> @asterite why constants are implemented as types in the compiler?
return0e has quit [Remote host closed the connection]
<crystal-gh>
[crystal] bew opened pull request #6160: Allow redefining None to 0 for @[Flags] enum (master...allow-redefine-None-to-0-in-enum-flags) https://git.io/vhly9
return0e has joined #crystal-lang
<FromGitter>
<aisrael> Hi, all! Is there any suggested way for a YAML mapping to call a custom setter rather than set an instance variable directly?
<FromGitter>
<aisrael> (I'm trying to create an "alias" for a boolean property that sets the property to the inverse value. E.g. `nullable` and `required`)
<FromGitter>
<Grabli66> Hi! How to break loop from block?
<crystal-gh>
[crystal] bcardiff opened pull request #6162: Update readme to show red beryl sponsors (master...readme-sponsors) https://git.io/vh8lx
bbobb has joined #crystal-lang
<crystal-gh>
[crystal] bcardiff closed pull request #6162: Update readme to show red beryl sponsors (master...readme-sponsors) https://git.io/vh8lx
<FromGitter>
<alex-kampa> Hello, has anyone here done RSA and/or ECDSA keypair generation using crystal?
Nathanaelle has quit [Ping timeout: 240 seconds]
Nathanaelle has joined #crystal-lang
pabs has quit [Ping timeout: 240 seconds]
pabs has joined #crystal-lang
dragonkh has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
tilpner has quit [Remote host closed the connection]
tilpner has joined #crystal-lang
<Yxhuvud>
nice to see the activity from bcardiff in the repo :D
<FromGitter>
<bcardiff> 👋
<FromGitter>
<HCLarsen> So with this acquisition, is Crystal moving to gitlab, or staying here?
<FromGitter>
<bcardiff> At least for now, staying I would say. Until something that affect us regarding adoption or infraestructure there I am comfortable with satying. But it's just my opinion.
<FromGitter>
<bcardiff> Is there anybody from Budapest?
<FromGitter>
<HCLarsen> Good to know, thanks.
<jokke>
hey! is there something like the the modular version of sinatra for kemal?
<jokke>
i would want to be able to write controllers that define their own routes and then merge them to one router somehow
alex`` has joined #crystal-lang
Nathanaelle has quit [Read error: Connection reset by peer]
rohitpaulk has quit [Ping timeout: 248 seconds]
<crystal-gh>
[crystal] bcardiff pushed 1 new commit to master: https://git.io/vh86P
<crystal-gh>
crystal/master 4e48495 Brian J. Cardiff: Add File.same?(path1, path2) with follow_symlinks option (#6161)
<FromGitter>
<hmans> jokke, that's pretty much how Crappy functions, but I'm afraid I have no immediate plans to release it as a shard since I don't want to pile more stuff on to the heap of web frameworks we already have.
<FromGitter>
<hmans> (if I ever do, it will not be called Crappy, no worries.)
<jokke>
heh
<jokke>
it's also pretty much how crouter functions
<jokke>
i added it to the pile a long time ago
<jokke>
but i wouldn't dare to call it a framework ^^
<jokke>
not to be confused with router.cr! :D
<FromGitter>
<hmans> Crappy doesn't have separate concepts of routes and controllers, its DSL just allows you to implement a routing tree, kind of like Toro, which I was pointed towards a few days ago.
<jokke>
oh
<jokke>
never heard of toro :D
<jokke>
people really like reinventing the wheel ^^
<FromGitter>
<hmans> Yeah, I wasn't aware of Toro when I started, otherwise I would probably just have used that. It seemed very basic (ie. unfinished) though.
<jokke>
mhm
<jokke>
i haven't built in web socket support either
<FromGitter>
<hmans> Either way, I don't want to release Yet Another Half-Done Framework so that's that.
Nathanaelle has joined #crystal-lang
<jokke>
i release half-done stuff just so i can use it as a dep in other projects
<FromGitter>
<bararchy> BTW , shards support gitlab ?
<FromGitter>
<bew> Yes
<FromGitter>
<bararchy> Coll
<FromGitter>
<bararchy> Cool
<FromGitter>
<bararchy> Now just to add gitlab support for shards.info and crystalshards.xyz
pabs has quit [Ping timeout: 240 seconds]
pabs has joined #crystal-lang
<FromGitter>
<bararchy> @bcardiff how is it to be Crystal dev full time?
<FromGitter>
<bcardiff> Wanting to be in 8 repos at the same time :-)
<FromGitter>
<bcardiff> It's great to have some formal allocation on this. Although I like programming a lot I am happy to have other interest that every now and then take me away from the keyboard.
<jokke>
heh i'm just running the "which_is_the_fastest" benchmarks and it looks like docker-proxy is the bottle neck
<FromGitter>
<bew> Are you on macos?
<jokke>
nope
<jokke>
linux
<jokke>
docker-proxy has way more cpu load than the actual test program
<FromGitter>
<bararchy> @bcardiff totally, I fill my after hours with family and D&D ;)
<jokke>
here it's like 100 % docker-proxy 75 % server 70 % client
<FromGitter>
<bew> @bcardiff you're doing great!! I'm really happy that you're working on Crystal, don't hesitate to ask help from the community if you need ;)
<FromGitter>
<bew> Sometimes it's good to power down your brain too ^^
<FromGitter>
<bew> @bararchy what is D&D ?
<jokke>
dungeons and dragons
<jokke>
a role playing game
<FromGitter>
<bew> Ah ok
<FromGitter>
<bararchy> Yeha :) what jokke said
<FromGitter>
<bew> I heard about this game but never tried it (yet?)
<jokke>
you need the right people to try it with %%
<jokke>
^^
<jokke>
it involves really investing in the game and sort of acting.
<jokke>
i played it for the first time with a few people i didn't know that well and it was a bit awkward :P
<FromGitter>
<bew> I'l keep that in mind, ty :p
<jokke>
yw :D
<FromGitter>
<bcardiff> For me is mostly family & dancing (swing & blues). But during these weeks is travelling a bit luckily. Thanks @bew
<jokke>
oh cool! lindy hop?
<FromGitter>
<bcardiff> Exactly :-)
<jokke>
nice!
<jokke>
i've been dancing lindy hop for a bit over a year now
<jokke>
i still feel like i can't dance for shit :D
<jokke>
i _hate_ six count
<FromGitter>
<bcardiff> it's only get better. keep doing it. and then travel with dancing as an excuse. Festival & x-changes are awesome.
<jokke>
it messes with my brain
<jokke>
yeah i'll keep doing it
<FromGitter>
<HCLarsen> I've got a total brain fart here. How do I iterate through a hash, changing values, and returning the changed hash?
<FromGitter>
<HCLarsen> Nevermind.
faustinoaq has joined #crystal-lang
rohitpaulk has joined #crystal-lang
pabs has quit [Ping timeout: 245 seconds]
pabs has joined #crystal-lang
<FromGitter>
<faustinoaq> > They will soon add github to that list ⏎ ⏎ @bararchy OMG, you were right! 😅
<FromGitter>
<faustinoaq> > the vscode docs tell i should have package.json ⏎ ⏎ @fidellr Where? 😅 I know we need some scry docs, though. I opened an issue about that, see: https://github.com/crystal-lang-tools/scry/issues/56
<FromGitter>
<faustinoaq> > but it seem still unstable tho ⏎ ⏎ @fidellr wrq, yeah, vscode-crystal-lang has some features disabled by default because Node.JS backend is a bit unstable 😅 ⏎ ⏎ I'm already working on migrate NodeJS backend to Scry 😄 [https://gitter.im/crystal-lang/crystal?at=5b1594ede26c847ac8b88b98]
<FromGitter>
<faustinoaq> However, Scry depends on `crystal tool` so, we still have some limitations here, hover feature would work on things like variables, arguments and some other simple stuff 😅
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 255 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
Nathanaelle has quit [Quit: Quit]
duane has quit [Ping timeout: 265 seconds]
duane has joined #crystal-lang
duane has quit [Ping timeout: 265 seconds]
duane has joined #crystal-lang
That_Guy_Anon has joined #crystal-lang
<ben___>
Hey guys, that's pretty cool. Many years ago I am loving C, but I do not have enough time for it. Today, i am learning Crystal because Crystal is awesome on so much things. I didn't want to kill Crystal in benchmarks, but today I had a little bit of time, running Crystal against Swoole PHP - with that, PHP is very fast, but Crystal wins mostly with 120%. I was happy, everything is good. But some hours later, in this
<ben___>
moment, I thought, ok ... ... It's time ... ... Run against C ... Huh ... Should I do? ... Ok ... Let's go ... And - sorry - it was a fully useless benchmark and my time today is over, but, optimised compiling for both in several ways - and I thought, I have to do much better in Crystal - no need - Crystal kills C with more than 200% - unbelievable !!!
<ben___>
Crystal is left side
<ben___>
😁
<FromGitter>
<bew> Hehe welcome to Crystal awesomeness :D
<ben___>
😁 just for fun I prepared both terminals, than started C, switching to Crystal terminal, started Crystal - and is end before C - yes!! 😅💜
<That_Guy_Anon>
i am curious in what code optimized crystal can beat optimizec C, but it is awesome that you like the language :)
<That_Guy_Anon>
or rather, can beat it by that much :D
<ben___>
Sorry, I mean build release for Crystal
<FromGitter>
<bew> An optimized C program cannot be beaten, almost
<FromGitter>
<bew> So your benchmark is not fully accurate
<ben___>
Yes pretty cool, I thought, this was the first round for C, but no chance in this stupid calculation benchmark, Crystal did it
<FromGitter>
<bew> Also, did you enabled full optimization for C?
<FromGitter>
<bew> With `-O3`
<ben___>
Yes, I run several tests
<ben___>
What would you choose?
<ben___>
Oh fuck -
<ben___>
But, now it's same, Crystal 1.413 and C 1.473
<ben___>
Something must go wrong - to happy for the first time - but Crystal wins again 😜
<FromGitter>
<faustinoaq> ben___, Yeah, nice! Also remember, take benchmarks with a grain of salt 😉
<ben___>
Yes, I hadn't do this at this time but I never thought Crystal was so close
<ben___>
Stop - in every previous run Crystal takes 1.174 seconds till 1.4 seconds, C needs every time more than 1.462 seconds, so Crystal is nearly 30% faster
<ben___>
again
<That_Guy_Anon>
is C with boehmGC or GC-less. and these are more numbers i had expected. but as faustinoaq said, benchmarks are more for a general direction that really precise comparisions.
TCZ has joined #crystal-lang
<ben___>
This was just for fun, Fast as C - I never thought it's really true - but now, that's nice, I am happy with that - no matter, just a little test 😜 Ok, good night 😁
TCZ has quit [Read error: Connection reset by peer]
<ben___>
There is no GC on C side
<That_Guy_Anon>
oh it def is, on most common benchmarks they are head to head often, or at least relatively close to each other. though memory usage might differ greatly :D
<ben___>
Yes, but is low compared to many other languages 👍
<That_Guy_Anon>
yeah, i guessed that. but still, the speed difference is remarkable :D
<That_Guy_Anon>
thank you for the prof of my assumption though :P
<FromGitter>
<faustinoaq> That_Guy_Anon, Yeah, also build time on crystal is almost 10x slower 😅
<That_Guy_Anon>
crystal has a notoriously slow compiler.
<That_Guy_Anon>
now it would be interesting to get Clang in the mix for C :P
<FromGitter>
<faustinoaq> Oh, BTW, I just realize I wrote `KB` 😅 , this is wrong, the right metric unit is `B` (Bytes), my bad XD
<That_Guy_Anon>
didn't even realise, just compared the numbers :D
<dom96>
Something seems off with that benchmark :P
<dom96>
You should definitely try clang
<dom96>
Actually, I wouldn't be surprised if it's caused by the use of `printf` in C
<dom96>
oh no, nvm
<dom96>
Thought that was in the hot path
<That_Guy_Anon>
if the assembler generated on the site is the same as on the system(aka faustinoaq used gcc8.1) then the assembler does look normal to me
<That_Guy_Anon>
though i am really not used to x64, only weird assembler :D
<faustinoaq>
dom96, Can you try to reproduce this result? :)
<dom96>
Do you have a gist link to the code?
<faustinoaq>
dom96, That_Guy_Anon Oh, looks like Clang is 2x+ faster than crystal ;-)
<faustinoaq>
I was wrong, Crystal is still almost twice fast than Clang or GCC in this micro-bench )
<That_Guy_Anon>
for me c is faster
<That_Guy_Anon>
gcc 7.3
<FromGitter>
<bew> @faustinoaq that codes are probably not optimized at all, but it's definitely weird
<That_Guy_Anon>
i am not sure how to force the crystal compiler to completely build now and not reuse some sort of cash, so i can'T compare these numbers, but hte execution C tops.
<That_Guy_Anon>
0.91s 2872B vs 0.89s 1404B
<FromGitter>
<bew> just delete the cache
<FromGitter>
<bew> `crystal env` will give you the cache directory
<faustinoaq>
That_Guy_Anon, That's a very small difference :)
<That_Guy_Anon>
it fits though, it is the usual difference you see in most benchmarks. defenietly way more expected than what you got :D
<faustinoaq>
@bew Why?, I'm sure using optimization flags :)
<dom96>
lol
<dom96>
-o3 for clang causes it to output a `3` binary
<faustinoaq>
Oh
<FromGitter>
<bew> `-O3` not `-o3`
<dom96>
so yeah, be careful with that guys
<dom96>
It seems Crystal and C (clang) are equivalent for me
<That_Guy_Anon>
hm, i did a few more runs, to get an average. (and with -O3 and not o3, cuz i am stupid)
<dom96>
Both ~1.1 second
<That_Guy_Anon>
crystal got 0.9, C got 0.74 as average on 10 runs each
<FromGitter>
<bew> there is no way to follow the activity of an account on gitlab, you can only track repositories (and issues/MR/etc..)
<FromGitter>
<fgimian> Hey there guys, is there any way to create a property, getter or setter for class variables in Crystal? i.e. those that begin with `@@`?
<That_Guy_Anon>
if enough ppl request it i am sure it will come. besides that, it is open source opposed to GitHub, so anyone can propose a PR
<FromGitter>
<bew> @fgimian just prepend `class_` :) so for example `class_getter`
<FromGitter>
<fgimian> oh wonderful! thank you
<FromGitter>
<fgimian> that works beautifully! 😄
<FromGitter>
<fgimian> oh and one more little question if I may; if I want to access class variables inside instance methods, I'm currently using `self.class.<name>`, is that the best way?
<FromGitter>
<bew> you can just do `TheType.<name>`
<FromGitter>
<fgimian> ah yes
<FromGitter>
<fgimian> cool!
<FromGitter>
<fgimian> thanks again @bew 😄
<FromGitter>
<bew> you're welcome ;)
That_Guy_Anon has quit [Quit: Leaving]
dragonkh has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
return0e has quit [Remote host closed the connection]