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
early has quit [Quit: Leaving]
early has joined #crystal-lang
duane has quit [Ping timeout: 248 seconds]
duane has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
p0p0pr37 has quit [Ping timeout: 268 seconds]
p0p0pr37_ is now known as p0p0pr37
duane has quit [Ping timeout: 240 seconds]
duane has joined #crystal-lang
coderobe has left #crystal-lang [#crystal-lang]
notdaniel has quit [Ping timeout: 244 seconds]
<FromGitter> <S-YOU> I havn't finished h2o binding yet because of this little issue. ⏎ `$h2o__tokens : H2oTokenT[100]`
<FromGitter> <S-YOU> that variable is filled by C function onload, and I can't find a away to access pointerof each item inside that variable.
<FromGitter> <S-YOU> that variable is need for add Content-Type header, Hello world is not really affected, but not TechEmpower compatible yet.
<FromGitter> <S-YOU> > because it'll be impractical to use libh2o on a real crystal app ⏎ Kind of truth, libevent and libuv cannot live together. you choose one of them.
<FromGitter> <S-YOU> libevent in Crystal is kind of connected to fiber, io and even gc, so it is kind of hard to use another eventloop.
duane has quit [Ping timeout: 260 seconds]
<FromGitter> <S-YOU> > but i don't think we will end up as fast as rust in some places ⏎ ⏎ If Fiber / GC extracted from core, and detach stdin/out/err with Scheduler, adjust some exceptions, Crystal can be as fast as any LLVM based languages or C.
Creatornator has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
p0p0pr37 has quit [Ping timeout: 260 seconds]
p0p0pr37_ is now known as p0p0pr37
duane has joined #crystal-lang
Nathanaelle has joined #crystal-lang
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
Nathanaelle has quit [Ping timeout: 245 seconds]
Nathanaelle has joined #crystal-lang
Nathanaelle has quit [Ping timeout: 260 seconds]
p0p0pr37 has quit [*.net *.split]
Creatornator has quit [*.net *.split]
jeromegn has quit [*.net *.split]
danzilio has quit [*.net *.split]
oz has quit [*.net *.split]
foca has quit [*.net *.split]
baweaver has quit [*.net *.split]
Nathanaelle has joined #crystal-lang
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
p0p0pr37 has joined #crystal-lang
p0p0pr37 has joined #crystal-lang
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
alex`` has joined #crystal-lang
rohitpaulk has joined #crystal-lang
Nathanaelle has quit [Ping timeout: 256 seconds]
Nathanaelle has joined #crystal-lang
Creatornator has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
p0p0pr37 has quit [Ping timeout: 240 seconds]
p0p0pr37_ is now known as p0p0pr37
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven`` has joined #crystal-lang
Ven`` has quit [Read error: Connection reset by peer]
Ven`` has joined #crystal-lang
DTZUZO has quit [Ping timeout: 255 seconds]
rohitpaulk has quit [Quit: Ping timeout (120 seconds)]
rohitpaulk has joined #crystal-lang
baweaver has joined #crystal-lang
foca has joined #crystal-lang
oz has joined #crystal-lang
jeromegn has joined #crystal-lang
danzilio has joined #crystal-lang
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <Grabli66> Is it possible(in future) to extract crystal GC and put it in shared library? Nim has that feature. You can compile nimrtl.so that contains GC, and then link your applications to that lib.
rohitpaulk has quit [Quit: Ping timeout (120 seconds)]
rohitpaulk has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
p0p0pr37 has quit [Ping timeout: 256 seconds]
p0p0pr37_ is now known as p0p0pr37
rohitpaulk has quit [Read error: Connection reset by peer]
rohitpaulk has joined #crystal-lang
<FromGitter> <vlazar> S-YOU interesting... would love to see your experiments with h2o bindings anyway
<FromGitter> <bendietze_twitter> I want to print the API stdlib, but, seems to be some hundred nice pages - i shrinked everything via CSS, but, I have to copy and paste it for every page and than save as pdf, so it could be easier to write a little app to extract the code and the text - but - it could be very easy if anywhere is that as morely plain text or already as shrinked pdf - knows anyone something that can help me ? I tested
<FromGitter> ... as pdf, copy and paste to wordprocessor and so on, but it's hard work for long time. I did this for the reference as a printed hardcover and it was very handy and good for old school reading 😄
Ven`` has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
<FromGitter> <faustinoaq> @bendietze_twitter What about this one 👉 https://pryp.in/crystal/? 😅
<FromGitter> <bendietze_twitter> @faustinoaq thank you very much! The reference is like I printed, it would save me little time now, and the API is already offline version, so I don't have to do it online 😄 the written HTML of API is clean and easy, but I hoped to find a more originally version - maybe - the API is originally based on this HTML? Are these the base documents? Thank you
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
<FromGitter> <bendietze_twitter> @faustinoaq and ... for this part I only have to change one css for API so just saving the pages saves me more time as writing something for this - good link 👍
p0p0pr37_ has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
p0p0pr37 has quit [Ping timeout: 248 seconds]
p0p0pr37_ is now known as p0p0pr37
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <faustinoaq> 😄 Thanks to @oprypin 👍
Ven`` has joined #crystal-lang
Ven`` has quit [Read error: Connection reset by peer]
<FromGitter> <lodestone> Morning all
Ven`` has joined #crystal-lang
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
alex`` has quit [Ping timeout: 260 seconds]
Nathanaelle has quit [Read error: Connection reset by peer]
Ven`` has quit [Read error: Connection reset by peer]
Ven`` has joined #crystal-lang
alex`` has joined #crystal-lang
Nathanaelle has joined #crystal-lang
Nathanaelle has quit [Read error: Connection reset by peer]
Ven`` has quit [Read error: No route to host]
Ven`` has joined #crystal-lang
Ven`` has quit [Read error: No route to host]
Ven`` has joined #crystal-lang
Nathanaelle has joined #crystal-lang
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TCZ has joined #crystal-lang
Nathanaelle has quit [Ping timeout: 245 seconds]
Nathanaelle has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter> <bendietze_twitter> Tanks to @oprypin 👍
Ven`` has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
rohitpaulk has quit [Quit: Ping timeout (120 seconds)]
Ven`` has quit [Read error: Connection reset by peer]
Ven`` has joined #crystal-lang
<FromGitter> <hmans> What is up, Crystalland
<faustinoaq> Oh, https://www.swoole.co.uk/ (a PHP Framework) is way faster than Crystal :(
<faustinoaq> ^^ https://www.techempower.com/benchmarks/previews/round16/#section=data-r16&hw=ph&test=json&l=hma70f
<FromGitter> <bendietze_twitter> Shrinked to 393 pages 👷 Just doing this one time for having a hardcover reference and a ring binded API 😀 so wouldn't be actual for a long time but if someone needs ... Mostly only the code is coloured for cheaper printing 🆒 But I would do some other kind of sorting now, before merging...
<FromGitter> <bendietze_twitter> What? PHP? 😨
<FromGitter> <bendietze_twitter> 😨😬😨😬😠
<FromGitter> <hmans> That's disgusting
<FromGitter> <hmans> However, PHP *is* very very very fast.
<faustinoaq> Yeah, a well optimized PHP framework :/
<FromGitter> <fridgerator> yeah but then you have to use PHP
<FromGitter> <bendietze_twitter> Ok, guys, puuuuuh, there's something wrong... But... It's PHP and remains as 😁
<faustinoaq> I guess now I can't convince my coworkers PHP is slow ;-)
<FromGitter> <bendietze_twitter> 8 years ago that I loved the language
<FromGitter> <bendietze_twitter> RX14 has to code faster! 😜 Chris! Chris! Chris!
<faustinoaq> Well, at least JVM and .NET are by far faster that PHP :)
<faustinoaq> ^^ https://www.techempower.com/benchmarks/previews/round16/#section=data-r16&hw=ph&test=json&l=hr9zlp
<faustinoaq> ^^ (fortunes) https://www.techempower.com/benchmarks/previews/round16/#section=data-r16&hw=ph&test=fortune&l=hr9zlp
<FromGitter> <bendietze_twitter> Uuuuuh no man online here ... ... ? ... There is an earthquake in Crystal land 😬 but... I will stay 😜
<FromGitter> <hugoabonizio> actually, it's most written in C https://github.com/swoole/swoole-src
<faustinoaq> I still prefer crystal syntax, though :)
<faustinoaq> @hugoabonizio Yeah, is just like japronto then, see: https://github.com/squeaky-pl/japronto
<dom96> and then as soon as you do something other than responding with the same JSON as fast as possible your performance drops like a stone
<faustinoaq> "a c thing" with a PHP face XD
<FromGitter> <bendietze_twitter> ...
<FromGitter> <hugoabonizio> they also have go routines https://github.com/swoole/swoole-src#short-api-name
<faustinoaq> No, I mean.. XD
<dom96> It's far too easy to game these benchmarks :P
<FromGitter> <hugoabonizio> nice addition to php community
<FromGitter> <bendietze_twitter> Crystal. 📴 by PHP
<FromGitter> <bendietze_twitter> 😁😁😁
<FromGitter> <hugoabonizio> php is still ugly as hell though
<faustinoaq> dom96 What do you mean? I think TFB have done a great work on their benchmarks :)
<FromGitter> <hmans> I wish more of these frameworks/app servers would bet on mruby or maybe Lua for scripting
<dom96> I mean that people pay too much attention to these benchmarks
<dom96> and put too much trust in benchmarks in general
<faustinoaq> Yeah, my boss use them to tell me why we should stay with JVM :(
<dom96> :/
<faustinoaq> I tried to introduce him crystal, but he doesn't even like NodeJS. He just trust on .NET, JVM and sometimes PHP
<faustinoaq> I guess is because enterprise support and other stuff like that :/
<FromGitter> <bendietze_twitter> Sorry guys, that's nothing special. Till 2013 I wrote my own complete webserver fully in C - it outperformed G-WAN !! with 130% !! ... So why Crystal? Because it's beautiful and fast and much much much much cheaper and easier as PHP and others and the time of winning changes everyday for everyone - so, there is a strong backend like h2o - so what? Would you admin PHP again? 😜 So, give cakes to core
<FromGitter> ... team and everything becomes good again 😉🍟🍔🍕
<faustinoaq> @bendietze_twitter Yeah, the fastest tool is not always the best option. I think languages like crystal/nim/elixir are nice because they are "fast enough" with a good syntax and easy to maintain :)
<FromGitter> <bendietze_twitter> 🍉
Ven`` has quit [Read error: Connection reset by peer]
Ven` has joined #crystal-lang
<dom96> True, but I think another thing Crystal/Nim have is that it's easier to get "fast enough" performance than it is in PHP/Python/etc.
<FromGitter> <hmans> "fast" is great, but nowhere near being the only or even most important feature.
<FromGitter> <hmans> Exactly, dom96
<FromGitter> <hmans> C-like performance with Ruby-like syntax = <3
<FromGitter> <hmans> Otherwise we'd all be writing ASM.
Ven` has quit [Client Quit]
Ven`` has joined #crystal-lang
Groogy has quit [Quit: WeeChat 2.1]
duane has quit [Ping timeout: 255 seconds]
<jokke> hey
<jokke> how can i read a struct from a socket?
<z64> see `IO#read_bytes`, `IO#read_fully` etc.; you would use those to build primitives to pass to a struct's ctor
TCZ has quit [Quit: Leaving]
<z64> if i remember right, `IO#read_bytes(T, format)` delegates to `T.from_io(io, format)`; so you can `def MyType.from_io(io, format)` and pass it neatly to `io.read_bytes(MyType)`
Rifa[m] has left #crystal-lang ["User left"]
<FromGitter> <bendietze_twitter> My android App never got messages correct? On my laptop you wrote - sorry, I got no messages between, looks I am drunken 😐
return0e_ has joined #crystal-lang
<FromGitter> <hmans> Gitter for Android is very broken :(
<FromGitter> <BenDietze> yes, i noticed 👎
<FromGitter> <faustinoaq> @bendietze_twitter Have you tried and IRC client for android?
return0e has quit [Ping timeout: 256 seconds]
<FromGitter> <BenDietze> @faustinoaq yes, if, we all could write good old C - but, what i wrote in C on a day, maybe, i think, i can write in Crystal in an hour 😄
<FromGitter> <BenDietze> no, month ago, i believe i must try because gitter drives me crazy 😟
<FromGitter> <hmans> Besides the Gitter-IRC bridge sometimes being a pain in the behind, I can recommend setting up TheLounge on a VM or just straight-out paying for an IRCCloud account. Either will give you push notifications and device-sync.
<FromGitter> <BenDietze> @faustinoaq i installed at this moment, but, can you help me with correct Crystal settings? Sorry... Add a new Server... Name, Host, Port, ssl, auth? i never used irc on this and Crystal site only tells irc.freenode.net 😟
<faustinoaq> Yeah, no problem
<faustinoaq> Host: chat.freenode.net
<faustinoaq> Port: 6697
<faustinoaq> ssl: true
<faustinoaq> auth: none (at least you already have a registered nickname :)
<faustinoaq> Then add #crystal-lang channel and IRC should work like a charm :D
<faustinoaq> *unless you have a registered nickname
<faustinoaq> *auth: none
<faustinoaq> @BenDietze Also this one https://play.google.com/store/apps/details?id=com.irccloud.android&hl=en_GB looks very nice
duane has joined #crystal-lang
<FromGitter> <benharri> thelounge is the bomb
<FromGitter> <benharri> are you aware of irc.gitter.im
<faustinoaq> @benharri Nice :)
<FromGitter> <benharri> i've got a public instance of the lounge up at https://irc.tilde.team if you'd like to try it before setting it up
bhh has joined #crystal-lang
<bhh> oh hi
ben___ has joined #crystal-lang
<bhh> who else is ben
<bhh> i'm ben
return0e_ has quit [Remote host closed the connection]
<ben___> Oh, cool, trying IRCCloud now, looks very good 😀
return0e has joined #crystal-lang
<bhh> is there a free tier?
<ben___> Uups, what happens to my nickname? Underscores? Ouuuh
<ben___> 😆
<bhh> adds a _ every time it finds a nick that's already taken
<bhh> that means ben ben_ and ben__ are taken
<bhh> i ran into that before too lol
<ben___> Ok, thanks @faustinoaq I will try this 👌
<ben___> Ah ok, good to know 😁
<ben___> Thought unbelievably, ben isn't registered yet? Strike! 😋 but ok, now i am underscored 😃
<FromGitter> <r00ster91> try *ben*
faustinoaq_ has joined #crystal-lang
<ben___> Thanks 😜
<ben___> Underscored is ok
<FromGitter> <BenDietze> GOOD BYE GITTER 😄
faustinoaq_ has left #crystal-lang [#crystal-lang]
faustinoaq_ has joined #crystal-lang
<jokke> z64: hm ok but i will still have to implement Type.from_io
<bhh> ben has probably been registered since 1998 or whenever freenode started
<bhh> register it now if you like it!
<jokke> z64: why do i have to do this for structs? especially c structs defined inside lib
bhh has left #crystal-lang ["not here right now..."]
<faustinoaq_> Test IRCloud 123 Test Crystal is_Awesome!!! Rust, Julia, Nim and Elixir as well
<faustinoaq_> Wow 😅
<ben___> 😁 @bhh
<ben___> 😁😁 @faustinoaq
<ben___> Ok chatting on smartphone is sometimes tricky 😝
<ben___> Do this with gitter! 😁😁
<jokke> faustinoaq_: can you self host this?
<faustinoaq_> I don't think so, IRCloud is nice, but is kinda a private thing
<jokke> ah it does
<jokke> but you'll need a team license
<jokke> meh
<jokke> we'll stick with mattermost :P
<faustinoaq_> https://www.irccloud.com/?/upgrade :/
<jokke> but i like that they use irc
<jokke> why reinvent the wheel, right?
<faustinoaq_> yeah, thats fine
<FromGitter> <hmans> IRCCloud is really just a plain IRC client running in a cloud. Kind of like a znc/bnc with a nice web UI.
DTZUZO has joined #crystal-lang
<FromGitter> <hmans> I've been using it (with a paid plan), but will probably migrate to a self-hosted TheLounge soon.
<faustinoaq_> 😃 IRCloud is open source https://github.com/irccloud
<z64> jokke: probably because its not helpful for the compiler to make assumptions about how you want your type instantiated from an IO
<z64> s/compiler/crystal
<z64> but i don't know, just a guess
<FromGitter> <hmans> faustinoaq_, irccloud has a GitHub org with some open source repositories, that doesn't mean the product is available as open source.
<FromGitter> <hmans> You can't self-host it.
<jokke> oh they use erlang :D
<FromGitter> <hmans> FWIW, TheLounge is open-source and IMO nicer to use than IRCCloud, it just involves more work (because you *have* to self-host it.)
<jokke> z64: mh well
<jokke> z64: it's a struct. it's just a blob of bytes
<jokke> there's not much choise
<jokke> *choice
<z64> *shrug*, z64 didn't write it
<z64> IIRC there is a stale `marshall` branch
<jokke> heh
<z64> maybe look at that
<faustinoaq_> hmans, Oh, ok 👍
<FromGitter> <benharri> yeah, i'm using thelounge now. it's way nicer and doesn't limit you to 2 networks. just have to have somewhere to host it. raspberry pi at home or a tiny vps somewhere are plenty
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <hmans> @benharri A $5 VM on Digital Ocean or similar will be more than enough
<FromGitter> <hmans> I wish there were more nano VM offerings out there
<FromGitter> <benharri> i've had good luck with ssdnodes.com
<FromGitter> <hmans> You could probably cram it into a Docker container and put it on a $1 VM on hyper.sh
<FromGitter> <benharri> lol yeah you could: there's already a docker container for it: https://github.com/thelounge/thelounge-docker
<jokke> z64: hmmm there's a unsafe_as(...)
faustinoaq_ has left #crystal-lang [#crystal-lang]
<jokke> but i don't think this would work
<jokke> especially if you need to convert endianness
<faustinoaq> @hmans Wow, I didn't know about hyper.sh, Thank you! :)
<z64> jokke: yeah idk about things like strings either, which could be "any" length in the slice
<FromGitter> <hmans> faustinoaq, it's great, but I don't *entirely* trust its stability/performance. I was having some severe issue with crashing containers a couple of weeks ago which eventually made me move my stuff away from it. :/
<jokke> yeah you're right
<z64> of course you would have some size encoded, but who knows
<faustinoaq> well, I think I can run a crystal binary on 64MB of RAM ;-D
<FromGitter> <hmans> @faustinoaq It absolutely can! I was running https://hmans.io off it
<FromGitter> <hmans> (a Crystal thing)
<faustinoaq> Oh, nice Maybe I can use something like https://manas.tech/blog/2017/04/03/shipping-crystal-apps-in-a-small-docker-image.html ? :)
<FromGitter> <benharri> hmans: was?
<FromGitter> <hmans> @faustinoaq That's what I'm doing with crankypants
<FromGitter> <hmans> @benharri As mentioned above, I moved away after continuing stability issues :/
<FromGitter> <benharri> ahhh right. makes sense
<FromGitter> <hmans> Here's my crankypants Dockerfile, resulting in a 14 MB (uncompressed) container for my app: https://github.com/hmans/crankypants/blob/master/Dockerfile
<FromGitter> <hmans> A little background, crankypants is a project related to Indieweb-powered distributed social blogging, so I had an interest in making the executable as small and resource-gentle as possible, which eventually landed me in Crystal land.
<FromGitter> <S-YOU> Nice
<FromGitter> <hmans> Indieweb is centered around the idea that a) you're hosting your own stuff b) on your own domain, turning domain/host names into user names in a big social network called "the web" (instead of coming up with your own protocols et al, like Mastodon/Diaspora/etc. have done)
<FromGitter> <hmans> Crankypants looks like a plain blog from the outside, but also has https://hmans.io/app that you as the owner of the site use to interact with your site and the rest of the network.
<FromGitter> <hmans> It has a client-side app that essentially mimicks Facebook et al, ie. you see posts from other users (domains), reply to them, like them, repost them
<FromGitter> <hmans> Interactions like those are published as web documents on your own domain and distributed towards interested parties through Webmentions (a protocol from the Indieweb stack.)
<faustinoaq> @hmans crankypants looks very nice, I gonna try to create a clone using amber :-P
<FromGitter> <hmans> If the remote end speaks Webmention, it can pull the like/repost/etc. into its own system, and if it doesn't, it will just happily ignore it and nothing is lost
<FromGitter> <hmans> I'm making it GDPR-aware: other participants of the system (the web) can ping your crankypants instance and request deletion of "their" data. It's all automated.
<FromGitter> <fridgerator> `from scratch` is such a killer feature
<FromGitter> <hmans> (The goal re GDPR is not necessarily to make it legally sane -- I'm not a lawyer -- but to demonstrate towards interested parties/authorities that you're taking shit seriously)
<FromGitter> <hmans> I love how nano crankypants is thanks to Crystal and SQLite. It will serve a full static page, including fetching stuff from the database, in well under 1ms.
<FromGitter> <benharri> that's awesome
<FromGitter> <hmans> The blog part of it uses Turbolinks just to save the browser from rethinking the CSS over and over again, but half of me just did it ironically. Browsers are pretty optimized, I will do some hardcore benchmarking eventually to see if I'm really winning anything
<faustinoaq> @hmans, Interesting you even have your own micro-framework "crappy" :D https://github.com/hmans/crankypants/tree/master/crappy
<FromGitter> <hmans> @faustinoaq I have indeed, and I think it's pretty cool! I started with Kemal, but just couldn't warm up to it (with apologies to Serdar)
<FromGitter> <hmans> It's called "Crappy" for a reason: it's a port of an oldish Ruby framework I once wrote called "Happy".
<FromGitter> <hmans> And maybe it's also crappy. Who knows.
<faustinoaq> lol
<FromGitter> <hmans> This is what code using it looks like: https://github.com/hmans/crankypants/blob/master/src/crankypants/web/routers/blog.cr
<FromGitter> <hmans> It basically removes the router, ie. the glue between incoming request paths and the code that is to be executed is simply your code. Plain routing tree stuff.
<FromGitter> <hmans> My hypothesis is that that this removes most, if not all, the complexity of optimizing an actual router for quickly matching paths (see radix, which Kemal uses)
<FromGitter> <hmans> while retaining performance.
<FromGitter> <hmans> Crappy's biggest problem right now is that it instantiates an object for every request, I'd like to change that eventually to calm down the GC a bit
<FromGitter> <hmans> FWIW, the intention has never been to write/publish yet another web framework, I consider this mostly a byproduct of what I'm doing with Crankypants.
<faustinoaq> @hmans Very Interesting, it looks similar to "Toro": https://github.com/soveran/toro
<FromGitter> <hmans> @faustinoaq Oh, nice! I was not aware of Toro, but it looks like pretty much the same thing, yeah.
<faustinoaq> @hmans Yeah, you're right, there so many crystal "frameworks", sometimes is better to do things from scratch, and crystal raw is pretty easy :)
<FromGitter> <hmans> @faustinoaq I'm just a) weird that way and b) a web framework nut. Also, I'm not terribly fond with most people making things work like either Rails or Sinatra. As much as I love Rails, there's no need to copy it in other languages (Elixir's Phoenix is sort of guilty of this), and when it comes to Sinatra... well... let me tell you, I've actually dabbled in Sinatra's code, and it does some terrible, terrible
<FromGitter> ... things to make certain non-features work. I'm not a fan.
<FromGitter> <hmans> Apologies for being extra chatty today, coming out about Crankypants always gets me so excited. :b
<faustinoaq> Hehe no problem, At least Kemal/Amber/Lucky offer some nice things like examples, guides, cookbooks, generators, sometimes devs want to get things fast and ready to go, that's when "frameworks" are really useful :)
<FromGitter> <hmans> Yeah, I'm very excited to see where they're all headed. Crystal, too, obviously.
<faustinoaq> Yeah, by example `amber g scaffold Post title:string content:text` and you will have a working Blog without touching a line of code :)
<faustinoaq> Also `amber g api` is coming very soon ;)
<FromGitter> <hmans> Yeah, it's nice. It has its own ORM, right?
<jokke> hmm is it possible to define methods on enums/structs in lib?
<faustinoaq> @hmans Yeah, amber uses Granite by default, but you can change it by others like Crecto, Jennifer, Lucky::Record or whatever you want :)
<faustinoaq> Models are low coupled in amber
<FromGitter> <hmans> @faustinoaq Gotta take a look at them. I'm currently using Crecto, but for no particular reason, and I'd like to find out more about our ecosystem
<FromGitter> <hmans> (For the record, I'm happy with Crecto. But also curious!)
<faustinoaq> Well, I like Crecto, its logs are very very nice, Thanks @fridgerator! <3
<jokke> crecto is great
<FromGitter> <fridgerator> 👍
<jokke> i just wish i could define separate repos for each model
<FromGitter> <hmans> I'd love to tackle implementing an acme client shard some time soon, I would like Crankypants to be able to provision its own SSL certificate through Let's Encrypt so you don't have to put nginx in front of it just for SSL
<jokke> maybe i've overlooked something
<FromGitter> <fridgerator> jokke you could if you wanted
<jokke> i could?
<jokke> nice :)
<FromGitter> <fridgerator> you can have as many repos as you want
<jokke> mmh can i somehow inherit the config?
<FromGitter> <fridgerator> hrmm i'm not sure
<jokke> my use case is just that oftentimes specific models have specific types of queries which i'd want to implement in just their own repositories
<faustinoaq> Wow, hyper.sh is even cheaper that this SCAM: https://vds6.net/ XD
<FromGitter> <hmans> Regarding hyper.sh, keep in mind that you'll also pay $1/month for an IP address, plus storage of your volumes and actual Docker images (even if they're super-popular, well-known images)
<FromGitter> <hmans> So it's not cheap-cheap-cheap.
<faustinoaq> Oh, ok 👍
<FromGitter> <hmans> When I was running my Crankypants instance off it, I was basically paying $1/mo for the container, $1/mo for the IP address, and a couple of cents for volume and image storage
<FromGitter> <hmans> (which is still great. Just saying.)
<FromGitter> <hmans> To me this was mostly an experiment to find out if Crankypants is happy with a 64 MB RAM VM. (It was!)
<FromGitter> <fridgerator> jokke ah I see, i'll have to look into if would be possible to implement something like this
<jokke> cool
<jokke> this would also make it unnecessary to pass the model to all queries
<jokke> *the model class)
<FromGitter> <hmans> @jokke, could mixins help with your use case?
<jokke> you mean mixins that i would include in the main repo?
<jokke> not really
<FromGitter> <hmans> :/
<jokke> meh why can't i define methods for lib stuff
<FromGitter> <hmans> @jokke, you should be able to reopen structs -- but maybe I'm misunderstanding your earlier question?
<jokke> mh ok
<jokke> i'll try that
<FromGitter> <hmans> "lib" as in "standard library"?
Creatornator has joined #crystal-lang
<FromGitter> <hmans> In case that is what you're saying, Crystall will happily allow you to mess around with built-in classes and structs, eg. https://github.com/hmans/crankypants/blob/master/src/ext/presence.cr
<FromGitter> <hmans> but I'm beginning to suspect I simply didn't understand your question correctly
<FromGitter> <S-YOU> @faustinoaq , @vlazar , I have uploaded my initial h2o bindings and hello example from h2o. ⏎ https://github.com/s-you/h2o.cr
<faustinoaq> @S-YOU Awesome!! Thank you so much! :)
<FromGitter> <hmans> \o/ @S-YOU \o/
<FromGitter> <picatz> @S-YOU I was waiting for that since you posted that status on twitter ✌️
<jokke> hmans: no i mean the lib context as in c bindings
Nathanaelle has quit [Read error: Connection reset by peer]
<jokke> any idea how i can find out the underlying type of an enum?
<FromGitter> <hmans> @jokke, see, I'm useless
<jokke> :D
<jokke> no worries
<faustinoaq> @S-YOU How did you fix your `$h2o__tokens : H2oTokenT[100]` issue?
<FromGitter> <S-YOU> by write C extensions, with h2o__tokens as pointer which points to that static array
<FromGitter> <S-YOU> its in src/ext
<faustinoaq> Oh, nice :)
<ben___> Awesome @S-YOU ✨
<FromGitter> <S-YOU> kind of work-around, it I could do, malloc on Crystal and assign one by one, but it is too much code in Crystal side.
<FromGitter> <hmans> Regarding the relationship between crecto Repos and Queries doing stuff, I've been following the Ecto model to simply not put actualy query code into the Repo modules.
<FromGitter> <hmans> ie., seeing the Repo as nothing more than configuration of what database and table to map things to/from, and putting actual query code into separate modules.
<FromGitter> <hmans> (instead of spamming Repo modules with query-related methods.)
Nathanaelle has joined #crystal-lang
<FromGitter> <hmans> I don't know if this helps. It probably doesn't. :b
<faustinoaq> @S-YOU WDYT about a `h2o_crystal` plaintext/json test on TFB? https://github.com/TechEmpower/FrameworkBenchmarks/tree/master/frameworks/Crystal
<jokke> hmans: yeah that's probably the way to go
<FromGitter> <S-YOU> it could be done I think, I havn't setup TFB on my machine yet. I just discover that repo today. 😄
<faustinoaq> XD
Nathanaelle has quit [Ping timeout: 240 seconds]
<FromGitter> <S-YOU> btw, original c code for h2o example is here - https://github.com/h2o/h2o/blob/master/examples/libh2o/simple.c
Nathanaelle has joined #crystal-lang
<FromGitter> <S-YOU> example use `http://127.0.0.1:7890/hello`
<FromGitter> <S-YOU> good thing is h2o has built-in router (kind of), so less overhead there too, I guess.
<RX14> yay i'm free
<FromGitter> <hmans> <3
<FromGitter> <S-YOU> Great! 😄
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <hmans> Is there *any* way a macro can introspect a method invocation passed to it and alter it?
<FromGitter> <hmans> or more generally speaking, modify the AST passed to it as a block instead of just emitting its own AST and/or invoking the passed block?
<FromGitter> <S-YOU> `macro spawn` might be interesting for that case. it does rewriting arguments.
<jokke> how do i call a macro from a macro?
p0p0pr37_ has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
<jokke> i just get undefined macro variable my_other_macro
<FromGitter> <hmans> Probably {{ my_other_macro }}
<FromGitter> <hmans> @S-YOU thanks!
<jokke> yeah no
<jokke> this isn't working
p0p0pr37 has quit [Ping timeout: 240 seconds]
p0p0pr37_ is now known as p0p0pr37
<jokke> i think i have to escape something
<jokke> so that it's expanded in a later pass
<jokke> but it doesn't seem to work either
<jokke> i escaped {{first}}
<FromGitter> <S-YOU> what if you write just `first`?
<jokke> good idea
<jokke> hm no
<FromGitter> <S-YOU> xD
<jokke> then it's undefined local variable or method first
<jokke> maybe {{@type}}.first
<jokke> aha!
<jokke> it worked
<jokke> but
<jokke> it's not the class i was hoping for
<jokke> how hard can it be to just get the underlying primitive type of the enum? :D
Creatornator has joined #crystal-lang
faustinoaq has quit [Ping timeout: 256 seconds]
duane has quit [Ping timeout: 244 seconds]
duane has joined #crystal-lang
<z64> jokke: iirc this isn't exposed anywhere
<jokke> yeah.. my only hope now is to resolve one of the members into a number literal and use that to get the class
<jokke> but i don't seem to be able to do this either
<jokke> {{MyEnum::MyMbember}} will expand to a numberliteral
<jokke> ahh finally!
<jokke> if you know of a better way to do this, please let me know
Philpax has quit [Ping timeout: 240 seconds]
<z64> hmm i thought you may be able to pull it off of `Arg#restriction` from `Foo.class.methods`, but i'm just getting Nop even though Int32 is printed
<z64> dont know enough to say why though ;(
<FromGitter> <bararchy> So, new Go version, new Rust version, new dot-net-core version, no Crystal in arch updates XD
<FromGitter> <bararchy> Any updates? :) I really want 25
Nathanaelle has quit [Ping timeout: 260 seconds]
Nathanaelle has joined #crystal-lang
return0e has quit [Ping timeout: 244 seconds]
Nathanaelle has quit [Read error: Connection reset by peer]
rohitpaulk has joined #crystal-lang
return0e has joined #crystal-lang
Nathanaelle has joined #crystal-lang
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
<FromGitter> <Grabli66> And i want 1.0, so what? :)
<FromGitter> <r00ster91> 1) 0 definitely needs to have windows support
<FromGitter> <Grabli66> Yes, indeed.
<FromGitter> <bararchy> Because 1.0 is a very specific long term goal, and 0.25.0 should be here anytime now
DTZUZU has quit [Quit: WeeChat 1.9]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DTZUZU has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
p0p0pr37 has quit [Ping timeout: 260 seconds]
p0p0pr37_ is now known as p0p0pr37
Nathanaelle has quit [Ping timeout: 256 seconds]
Nathanaelle has joined #crystal-lang
<FromGitter> <vlazar> @S-YOU you are awesome! thanks for sharing h2o bindings :shipit:
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
rohitpaulk has joined #crystal-lang
Creatornator has joined #crystal-lang
<txdv> h2o bindings?
<txdv> searching for h2o crystal ... is hard
<txdv> @vlazar can you share that thing?
<FromGitter> <bew> txdv https://github.com/s-you/h2o.cr
<FromGitter> <vlazar> txvd http://crystalshards.xyz/?filter=h2o
<txdv> uses libuv
<FromGitter> <vlazar> yes, look at s-you/uv.cr
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <vlazar> hm
<FromGitter> <vlazar> I assume it's required for h2o
<txdv> h2o is a parser for http requests
<txdv> which is 20 times faster than http-parser used by node!
<txdv> woooaaaawwww
Raimondi has quit [Read error: Connection reset by peer]
Raimondi has joined #crystal-lang
return0e has quit [Read error: No route to host]
return0e has joined #crystal-lang
vikaton has joined #crystal-lang
<FromGitter> <r00ster91> why is this happening? https://carc.in/#/r/473l/edit
<FromGitter> <hugoabonizio> @r00ster91 because you're using the same Array.new(3, ' ') for the three arrays
<FromGitter> <hugoabonizio> using block variation will behave like you want
<FromGitter> <hugoabonizio> https://carc.in/#/r/473q
<FromGitter> <r00ster91> oh..ohh okay. A bit strange. But thanks!
Nathanaelle has quit [Quit: Quit]
<FromGitter> <hugoabonizio> @r00ster91 it's no strange, on your original code `Array.new(3, ' ')` is being evaluated once and being passed as parameter, on the block version, the block is called each time - creating a new array instance
<FromGitter> <hugoabonizio> made sense? 😄
<FromGitter> <r00ster91> kinda
<FromGitter> <bew> @S-YOU I thought that h2o didn't use libuv anymore, but their own fast event loop
<FromGitter> <bew> This blog post explains why he stopped using libuv http://blog.kazuhooku.com/2014/09/the-reasons-why-i-stopped-using-libuv.html?m=1
<FromGitter> <bew> So why do you have some kind of libuv bindings in your h2o binding?
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
duane_ has joined #crystal-lang
duane has quit [Ping timeout: 248 seconds]
<FromGitter> <vlazar> https://h2o.examp1e.net/faq.html ⏎ ⏎ > To build H2O as a library you will need to install the following dependencies: ⏎ > ⏎ > libuv version 1.0 or above ... [https://gitter.im/crystal-lang/crystal?at=5b11b57c361a950a663434e8]
Creatornator has quit [Quit: Textual IRC Client: www.textualapp.com]
<RX14> parsing http requests is likely not your bottleneck in anything but benchmarks
<RX14> binding h2o is a waste of effort in my opinion
<RX14> 100k requests per second 8really is* enough for everyone - unless you're always serving the exact same response to everyone
<RX14> in which case use nginx
<txdv> :D
<txdv> yeah
<txdv> i remember when the h2o benchmarks came out and idutny looked at http-parser
<txdv> he benchmarked it and the benchmarks revealed that a 20x increase of speed would add 0.6 request per second in a benchmark where he was getting 1200 request per second through
<txdv> (for node)
<RX14> lol exactly
<txdv> but in node they use javascript, which is slow as fuck ... it might be a bit more here
<RX14> go optimize the general IO pathway :)
<RX14> crystal is in general fast enough for most things to be happy with crystal's performance by default
<RX14> already
<RX14> except for the DB brivers
<RX14> thats what really needs work
<oprypin> 🅱rivers
<RX14> definitely not been drinking :)
<txdv> generating strings and passing them to the db drivers?
<RX14> more like the DB pool implementation I suspect
<RX14> someone needs to benchmark why the crystal DB bwenchmark is so bad compared to the HTTP one
<RX14> cryastal was 20th with 80% of the peak performance in plaintext
<RX14> thats awesome
<RX14> in json is was 22nd with nearly 90%
<RX14> in single query it already dropped to 56th
<RX14> with only 40% of the peak performance
<RX14> so yeah
<RX14> focus on the benchmark we suck in first: db
<RX14> (talking about techempower)
faustinoaq has joined #crystal-lang
<txdv> so maybe some multi byte instruction lib for json would improve crystal in that benchmark
Guest97416 has quit [Ping timeout: 240 seconds]
<txdv> but usually, when you add any kind of additional logic to handling that json, that performance advantage of text processing vanishes very fast
maxpowa has joined #crystal-lang
duane_ has quit [Ping timeout: 256 seconds]
<RX14> json is fast enough
<RX14> it actually increases our lead
<RX14> focus on DB
p0p0pr37_ has joined #crystal-lang
p0p0pr37 has quit [Ping timeout: 240 seconds]
p0p0pr37_ is now known as p0p0pr37
duane has joined #crystal-lang
duane has quit [Ping timeout: 240 seconds]
faustinoaq has quit [Ping timeout: 265 seconds]
return0e has quit [Ping timeout: 260 seconds]
sz0 has joined #crystal-lang
duane has joined #crystal-lang
havenwood has joined #crystal-lang
<havenwood> It looks like Crystal shares this odd behavior with CRuby and JRuby: 2147483648.times.count { |n| n } #=> -2147483648 : Int32
faustinoaq has joined #crystal-lang
<faustinoaq> >> 2147483648.times.count { |n| n }
<DeBot> faustinoaq: Sorry, that took too long. - https://carc.in/#/r/473w
<havenwood> 2147483647.times.count { |n| n } #=> 2147483647 : Int32
return0e has joined #crystal-lang
<faustinoaq> https://tio.run/##Sy6qLC5JzPn/v0DByNDE3MTC2MzEQq8kMze1WC85vzSvRKFaoSavRiFPofb/fwA
<havenwood> I was running an internal self-diagnostic `self.worries.count { |worry| worry }` and they suddenly went negative. Now I'm carefree. Whee!
<faustinoaq> Oh, that's not good
<faustinoaq> i think there is an issue about that
return0e has quit [Read error: Connection reset by peer]
duane has quit [Ping timeout: 260 seconds]
<faustinoaq> havenwood https://tio.run/##Sy6qLC5JzPn/v0DByNDE3MTC2MzEQq8kMze1WC85vzSvRKFaoSavRiFPofb/fwA
<faustinoaq> Oh, wrong link
<faustinoaq> ^^ https://tio.run/##RYyxCsIwGIT3PMWNFqHYGmqXjr6Bu8TkLwaSVJpkKKbPHlMrOBx83MednBcfhMnZTioawtVFS7N4GDrcKgYoGiGn6EJh7IQBp3vs@LchIZ94I1H6yeOAZrPQIxZNRoGw/seFyCm2hb1i8GgbfuH9ueN9HbQlX@835dIlOKw5fwA
<faustinoaq> No idea Why tio.run urls are so long XD
<faustinoaq> But is the only online compiler with that support long duration tasks :)
<faustinoaq> Such big and interesting comment: http://disq.us/p/o6pthd :)
<faustinoaq> Oh, wrong link again XD
<faustinoaq> What!? Crystal had an "hacky" official ICR :D
<faustinoaq> BTW, is operator overloading a good thing? Ref: http://www.oracle.com/technetwork/java/simple-142616.html#4098http://www.oracle.com/technetwork/java/simple-142616.html#4098
Ven`` has joined #crystal-lang
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]