<FromGitter>
<Sija> @straight-shoota That had to happen sooner or later :) Congrats! š
non-aristotelian has quit [Quit: non-aristotelian]
laaron- has quit [Remote host closed the connection]
laaron has joined #crystal-lang
_whitelogger has joined #crystal-lang
laaron- has joined #crystal-lang
laaron has quit [Remote host closed the connection]
<FromGitter>
<icyleaf> Congrats! @straight-shoota
laaron has joined #crystal-lang
laaron- has quit [Remote host closed the connection]
_whitelogger has joined #crystal-lang
<FromGitter>
<sam0x17> is anyone familiar with the zlib integration in crystal? I'm looking for the easiest way to apply the DEFLATE algorithm to a Slice(UInt8), but I'm finding the zlib API to be crazy complicated
laaron- has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron- has quit [Remote host closed the connection]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
_whitelogger has quit [Ping timeout: 250 seconds]
_whitelogger has joined #crystal-lang
<FromGitter>
<sam0x17> is this the fastest way to concatenate two slices? from what I can tell copy to/from isn't very useful here because there is no way to specify an offset: ā ā ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c272721ab910e7d3aec5ae4]
laaron has joined #crystal-lang
laaron- has quit [Remote host closed the connection]
<FromGitter>
<vladfaust> @anamba give it a try github.com/onyxframework/background
<FromGitter>
<sam0x17> @oprypin thanks. I still dont get how the + offset thing works. When I try the following I get index out of bounds: ā ā ```def slice_concat(a : Bytes, b : Bytes) ā b.copy_to(a + b.size) ā end``` [https://gitter.im/crystal-lang/crystal?at=5c279129babbc178b2f74d34]
<mps>
j8r: I dislike github so don't have account there
<mps>
we had talk at Alpine to move to gitlab, although don't know will that be done
<mps>
btw, when played with go-lang I always had split mind about static building, sometimes static are good but sometimes it is not
<mps>
and, as you know, go-lang prefer or even force static building
<FromGitter>
<j8r> that's bad for system tools.
<FromGitter>
<j8r> My opinion is better to statically link applications which are independent of the OS
<FromGitter>
<j8r> and dynamic link those that are dependent, like UI/Desktop stuff in GTK/Qt
<FromGitter>
<j8r> gitlab isn't much that different than github
<Jenz>
I recommend taking a look at sr.ht
<Jenz>
Though it's only beta atm
<Jenz>
It looks very promising ATM
<FromGitter>
<j8r> The best would be not migrate X to Y, but have X mirrored from Y
<mps>
Jenz: sr.ht was also discussed with the author of it, he is often on the Alpine irc
<Jenz>
What did he say?
<FromGitter>
<j8r> git is decentralized, it shouldn't be a problem to have multiple mirrors
<mps>
Jenz: to me also it is very interesting but it is not yet ready for big projects like distro
<Jenz>
Yeah, gotta agree...
<Jenz>
I can't rename my issue-tracker D:
<Jenz>
Ye
<Jenz>
*Yet
<mps>
ddvault (author) is very responsive
<mps>
s/ddvault/ddevault/
<mps>
j8r: my dislike to github is from 'political' point of view, not technical
<FromGitter>
<j8r> didn't know, really promising. Sounds like a gitolite++
<mps>
excuse me, have a guests. cul
<FromGitter>
<j8r> gitlab is also meh (still better) with freemium ;/
<Jenz>
How can I find out at compile time whether the release flag is present?
<Jenz>
{% flag?(:release) %} ?
<Jenz>
Eh just with an `if`
<Jenz>
Ok, nvm. flag?(:release) works
<trashhalo[m]>
Is anyone using crystal in prod? and if so whats the percentage of your codebase thats cr?
Jenz has quit [Ping timeout: 250 seconds]
<FromGitter>
<j8r> IIRC @sam0x17 and @bararchy have Crystal code in prod
<FromGitter>
<greenbigfrog> depends on how you want to define prod ;) If you want to count hobby projects that actually get used, I've got one that's 100% crystal (shitty code though because I'm completely self taught and sometimes a bit lazy to go back and rewrite stuff if it works)
Renich has joined #crystal-lang
<FromGitter>
<j8r> prod usually means money implications
<FromGitter>
<j8r> that allow to earn money from
Raimondi has quit [Ping timeout: 240 seconds]
<trashhalo[m]>
yea prod for me has money implications.
laaron has joined #crystal-lang
<FromGitter>
<bararchy> yeha, NeuraLegion uses crystal in prod
Renich_ has joined #crystal-lang
<FromGitter>
<wontruefree> would this make a 32bit crystal compiler on a 64 bit machine? `make crystal FLAGS='--cross-compile --target "i686-linux-gnu"'`
<FromGitter>
<Blacksmoke16> should return a `Nop` but it does
laaron has quit [Ping timeout: 256 seconds]
Renich has quit [Ping timeout: 272 seconds]
Renich_ is now known as Renich
<FromGitter>
<fridgerator> I have a couple of production services written in 100% crystal
<FromGitter>
<fridgerator> and a couple internal tools using crystal as well
<FromGitter>
<Blacksmoke16> how would you test a web framework?
<FromGitter>
<Blacksmoke16> like prob run the server instance then the spec
<FromGitter>
<sam0x17> usually you would have unit testing built into the web framework. there is also a selenium shard so you can simulate the browser
<FromGitter>
<Blacksmoke16> š
<FromGitter>
<kingsleyh> Taiko is not bad for testing too
<FromGitter>
<Blacksmoke16> check this out, WIP prototype but is pretty neat
<FromGitter>
<Blacksmoke16> *yet another web framework* but with param conversion
<FromGitter>
<Blacksmoke16> vs having to deal with converting strings all the time, also have an `Exists` converter that can fetch the record from db from like `/users/123` # => `SELECT from USERS where id = 123`
<FromGitter>
<Blacksmoke16> assuming whatever orm you are using has a `find` method
<FromGitter>
<vladfaust> > assuming whatever orm you are using has a `find` method ā ā That's bad IMO
<FromGitter>
<Blacksmoke16> meh, its not a big deal imo, can just define your own find method if you want it to do something diff or it doesnt have one by default
<FromGitter>
<vladfaust> Overall annotation approach looks fresh, good job
<FromGitter>
<Blacksmoke16> šÆ
<FromGitter>
<vladfaust> What about Integer params?
<FromGitter>
<vladfaust> Or non-model params, like "foo" and "bar"?
<FromGitter>
<vladfaust> For an action
laaron has joined #crystal-lang
laaron- has quit [Remote host closed the connection]
<FromGitter>
<Blacksmoke16> to require the params to match a regex to match that the route
<FromGitter>
<Blacksmoke16> all param conversion happens at compile time, so with many files i dont think it would be a big deal, not much diff than rails or something
<FromGitter>
<j8r> Looks neat. Only hope I can still use my structs :)
<FromGitter>
<Blacksmoke16> thats one issue i dont know an answer to
<FromGitter>
<Blacksmoke16> since this works by just finding all classes that inherit from an abstract `Controller` class
<FromGitter>
<Blacksmoke16> cant define a struct and a class with the same name
<FromGitter>
<j8r> Isn't possible to do like `Serializable`?
<FromGitter>
<Blacksmoke16> like what?
<FromGitter>
<Blacksmoke16> have to include it?
<FromGitter>
<j8r> `include Athena::Controller`
<FromGitter>
<j8r> :)
<FromGitter>
<j8r> It could even be used in a module
<FromGitter>
<Blacksmoke16> i dont think i could
<FromGitter>
<Blacksmoke16> since this works by just finding all classes that inherit from an abstract Controller class
<FromGitter>
<Blacksmoke16> to build out the routes for the radix tree
<FromGitter>
<vladfaust> Now I see why you asked for an ability to iterate through all type annotated with specific annotation, @Blacksmoke16
<FromGitter>
<vladfaust> You could get rid of Controller and just annotate methods if it worked
<FromGitter>
<Blacksmoke16> `{% methods = c.class.methods.select { |m| m.annotation(Get) || m.annotation(Post) || m.annotation(Put) } %}` is how im doing it atm, works for me
<FromGitter>
<Blacksmoke16> yea pretty much
<FromGitter>
<Blacksmoke16> `{% for c in Athena::Controller.all_subclasses %}`
<FromGitter>
<Blacksmoke16> could also override the controller class to add custom methods used on all routes
<FromGitter>
<j8r> @Blacksmoke16 what happens if I want 2 servers in 2 fibers for instance?
<FromGitter>
<Blacksmoke16> idk
<FromGitter>
<Blacksmoke16> lol
<FromGitter>
<Blacksmoke16> how would i test that?
<FromGitter>
<Blacksmoke16> the server if ofc just build on `HTTP::Server` so i dont *think* it would be a big deal?
<FromGitter>
<Blacksmoke16> but i dont know for sure
<FromGitter>
<j8r> you run a server that listen on X in the main fiber, then you `spawn` a new one and start a new server listening on Y
<FromGitter>
<j8r> logically, they won't share the same routes
<FromGitter>
<j8r> so in your case, 2 different objects that inherit from your controller
<FromGitter>
<j8r> I am afraid they may share the same routes :/
<FromGitter>
<Blacksmoke16> mm sorry, still not sure i follow
<FromGitter>
<Blacksmoke16> share the same routes as in two apps define same route?