ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.33.0 | 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
<FromGitter> <straight-shoota> @watzon You can surely expose a C interface. That's essentially what the compiler (or rather LLVM) does to build any Crystal binary.
<FromGitter> <watzon> Is there documentation on doing that anywhere? All I managed to find was @ysbaddaden's project from a couple years ago.
<FromGitter> <straight-shoota> ```crystal build test.cr --single-module --link-flags="-shared" -o libtest.so --prelude=empty``` ⏎ ⏎ I'm skipping the prelude for a minimal demonstration, but it should also work with default runtime. [https://gitter.im/crystal-lang/crystal?at=5e4f200d8e726c7dc5b959e0]
<FromGitter> <watzon> Oh awesome
<FromGitter> <straight-shoota> There's no documentation I'm aware of but it's also not an officially supported feature.
<FromGitter> <watzon> That makes sense. I've seen issues in Github for it, but could never find anything concrete.
<FromGitter> <straight-shoota> It's really very basic stuff, actually. Even I can understand it and my C foo is really low.
<FromGitter> <straight-shoota> You might want to look at `src/crystal/main.cr` how the default runtime is set up.
<FromGitter> <watzon> Thanks for the help
<FromGitter> <straight-shoota> I'm glad to share some Crystal knowledge
<FromGitter> <straight-shoota> There's also an extensive answer on SO: https://stackoverflow.com/questions/32916684/can-a-crystal-library-be-statically-linked-to-from-c
<FromGitter> <watzon> Awesome. That should be a lot of help
<FromGitter> <watzon> Damn, are there no ORMs that have a `::Serializable` module? The Crystal DB shard does, but I was hoping for an ORM.
<FromGitter> <watzon> @Blacksmoke16 ever thought of doing this in granite?
<FromGitter> <Blacksmoke16> what to handle to/from db?
<FromGitter> <Blacksmoke16> whats the point of that if you're using an orm?
<FromGitter> <watzon> Exactly. More `from` than anything.
<FromGitter> <Blacksmoke16> granite already has `.from_rs` iirc
<FromGitter> <watzon> Maybe my case is special, but I have a ton of classes that are already built and I don't want to duplicate the class' structure if I can avoid it.
<FromGitter> <Blacksmoke16> i.e. that already have properties?
<FromGitter> <watzon> Yeah, and already include `JSON::Serializable`
<FromGitter> <Blacksmoke16> fwiw granite includes `JSON::Serialziable` for you, and its `column` macro essentially just defines an ivar and throws an annotation on it
<FromGitter> <watzon> And the database connector isn't a mandatory thing, it's only going to be included if you include a `Persistence` module
<FromGitter> <Blacksmoke16> so should just have to like replace your `property` with `column`
<FromGitter> <Blacksmoke16> or add the annotation manually i guess would work too
<FromGitter> <watzon> Is there a column annotation?
<FromGitter> <Blacksmoke16> yes
<FromGitter> <Blacksmoke16> its not in the public api tho
<FromGitter> <Blacksmoke16> but you can prob figure it out
<FromGitter> <watzon> That could work. I guess I just have to essentially redefine all the fields and apply the annotation to them.
<FromGitter> <Blacksmoke16> why cant you just replace `property` with `column`?
<FromGitter> <watzon> I probably can, I'll have to try
<FromGitter> <watzon> As long as it doesn't mess anything up
<FromGitter> <Blacksmoke16> it shouldnt
<FromGitter> <Blacksmoke16> just defines an ivar, and manual getter/setter
<FromGitter> <watzon> Ok cool. Let's see how it works out.
<FromGitter> <Blacksmoke16> internally it makes the ivar nilable tho
<FromGitter> <Blacksmoke16> πŸ‘
<FromGitter> <Blacksmoke16> i have a PR to refactor some stuff, but general idea is similar
<FromGitter> <watzon> Hmm wait. I have to extend `Granite::Base` don't I?
<FromGitter> <watzon> Hope that doesn't do anything weird
<FromGitter> <Blacksmoke16> :shrug:
<FromGitter> <watzon> Well here goes
<FromGitter> <Blacksmoke16> πŸ‘
<FromGitter> <watzon> Damn I was worried about that
<FromGitter> <Blacksmoke16> whats that?
<FromGitter> <watzon> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e4f2b32dafa3029f642d4f8]
<FromGitter> <Blacksmoke16> :sad:
<FromGitter> <watzon> Very
<FromGitter> <watzon> Too bad `Granite::Base` isn't a module
<FromGitter> <Blacksmoke16> indeed
<FromGitter> <Blacksmoke16> no reason it cant be afaik
<FromGitter> <watzon> If it can be it would be a lot better
<FromGitter> <Blacksmoke16> maybe make an issue for it
<FromGitter> <watzon> Since having it as a class keeps you from extending other types
<FromGitter> <Blacksmoke16> be pretty easy, but ofc big breaking change
<FromGitter> <watzon> Maybe it doesn't have to be. What if everything in `Granite::Base` were moved into it's own module with a different name, like `Granite::Modelable` or something, and then that same module were included into `Granite::Base`? That should allow it to continue functioning, right?
<FromGitter> <Blacksmoke16> :0
<FromGitter> <Blacksmoke16> prob yea
<FromGitter> <watzon> Added the issue
<FromGitter> <Blacksmoke16> πŸ‘
OvermindDL1 has quit [Ping timeout: 246 seconds]
OvermindDL1 has joined #crystal-lang
<FromGitter> <watzon> @Blacksmoke16 is there a way from within `macro included` to get the class of the including type?
<FromGitter> <Blacksmoke16> `@type` should be that
<FromGitter> <watzon> `@type.id` is returning the module
<FromGitter> <Blacksmoke16> escape your macro expression or use verbatim
<FromGitter> <watzon> Verbatim? I know I've heard that before, but I've never used it
<FromGitter> <Blacksmoke16> makes it so you dont have to do `\{{` everywhere
<FromGitter> <watzon> I guess the problem is really because they're nested `macro included` calls
<FromGitter> <Blacksmoke16> yes
<FromGitter> <watzon> And the `@type.id` is in the second one
<FromGitter> <watzon> Making these changes to granite is ending up harder than I thought because of the high reliance on macros
<FromGitter> <watzon> Specifically `macro inherited` which now needs to be `macro included`, but also not...
<FromGitter> <watzon> Right now when I escape the macro expression I get the type `Granite::Base+` rather than the extending type
<FromGitter> <watzon> Without the escape I get the name of the module
<FromGitter> <Blacksmoke16> are you including it in more than one module?
<FromGitter> <Blacksmoke16> since a module cant be abstract :/
<FromGitter> <watzon> The top level module is only being included in `Granite::Base`
<FromGitter> <watzon> And each sub module is only being included in the top level module, `Granite::Modelable` for now
<FromGitter> <watzon> If I only have one `macro included` `@type.id` gives me `Parent.class`
<FromGitter> <watzon> Originally it called `self`, but that stopped working with the module
<FromGitter> <ImAHopelessDev_gitlab> why is `+` appended the end of `Animal` in the virtual and abstract type docs page? `# pet : Animal+`
<FromGitter> <Blacksmoke16> oh sorry
<FromGitter> <Blacksmoke16> `You can see that @pet is Animal+. The + means it's a virtual type, meaning "any class that inherits from Animal, including Animal".`
<FromGitter> <ImAHopelessDev_gitlab> oh, it's showing output from `tool`
<FromGitter> <ImAHopelessDev_gitlab> i thought new syntax got introduced for a second, i was like wtf
<FromGitter> <Blacksmoke16> is there something similar to PHP's `continue 2`?
<FromGitter> <watzon> This is why abstract types are a necessity in many cases
<FromGitter> <Blacksmoke16> yea apparently so
<FromGitter> <watzon> I still don't get why I'm having this problem though :/
<FromGitter> <watzon> I'm sure I'm just doing something wrong
<FromGitter> <ImAHopelessDev_gitlab> `next 2`?
<FromGitter> <ImAHopelessDev_gitlab> it needs to be implemented?
<FromGitter> <Blacksmoke16> no because in crystal land that would return `2` to the block
<FromGitter> <ImAHopelessDev_gitlab> maybe a different keyword can be introduced
<FromGitter> <watzon> For what?
<FromGitter> <ImAHopelessDev_gitlab> PHP's `continue 2` ⏎ ⏎ > If a switch is inside a loop, continue 2 will continue with the next iteration of the outer loop.
<FromGitter> <Blacksmoke16> i refactored to avoid needing it
<FromGitter> <Blacksmoke16> prob why its not a thing already
<FromGitter> <Blacksmoke16> `arr.select().map` versus `arr.map.compact!`?
<FromGitter> <watzon> Hmm interesting
<FromGitter> <watzon> Yeah probably best to avoid that
<FromGitter> <Blacksmoke16> either way `arr` would have to be iterated twice
<FromGitter> <ImAHopelessDev_gitlab> arr.select().map for me
<FromGitter> <Blacksmoke16> oh wait
<FromGitter> <Blacksmoke16> `.compact_map` πŸ˜†
<FromGitter> <watzon> Well there you go lol
<FromGitter> <watzon> I actually didn't know that existed
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/master/Enumerable.html#compact_map(&)-instance-method
<FromGitter> <watzon> Love learning new things about Crystal
<FromGitter> <Blacksmoke16> me neither
<FromGitter> <ImAHopelessDev_gitlab> oh that's a cool method
postmodern has joined #crystal-lang
<FromGitter> <ImAHopelessDev_gitlab> https://crystal-lang.org/api/master/Enumerable.html#cycle(&)-instance-method ⏎ ⏎ "forever" huh? disgonnabegood.jpg
<FromGitter> <Blacksmoke16> `loop { each { |x| yield x } }`
<FromGitter> <Blacksmoke16> yup
<FromGitter> <Blacksmoke16> sometimes idk how i feel about crystal efficiency, esp when you have a file with `record Athena::Routing::Parameter(T), value : T` literally just that in it
teardown has joined #crystal-lang
<FromGitter> <ImAHopelessDev_gitlab> power of macros?
<FromGitter> <Blacksmoke16> pretty much
<FromGitter> <Blacksmoke16> tl;dr im refactoring how i handle controller arguments/param converters internally
<FromGitter> <Blacksmoke16> oops wrong ch
<FromGitter> <Blacksmoke16> is the context if anyone has opinions/thoughts
<FromGitter> <watzon> https://carc.in/#/r/8lpk
<FromGitter> <watzon> Can anyone explain why exactly this doesn't work?
<FromGitter> <Blacksmoke16> `instance_vars` only works in context of a method
<FromGitter> <watzon> Ahh ok
<FromGitter> <watzon> That sucks
<FromGitter> <Blacksmoke16> yup
<FromGitter> <Blacksmoke16> i need it to implement ORM associations how i want
<FromGitter> <Blacksmoke16> but seems like ill be dreaming for a while ha
<FromGitter> <watzon> Yeah no kidding
<FromGitter> <watzon> I do love macros though, they allow me to keep things update proof by doing shit like this
<FromGitter> <watzon> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e4f4a1e8e726c7dc5b9bbbf]
<FromGitter> <watzon> Don't have to worry about methods on `Chat` changing
<FromGitter> <watzon> Well until I have an ORM that I can include rather than extend I'm going to put off adding database persistence
<FromGitter> <Blacksmoke16> could you not define an interface with the stuff you need
<FromGitter> <Blacksmoke16> that could be included into any ORM based on `crystal-db` to supply what you need?
<FromGitter> <Blacksmoke16> defining a `crystal-db` interface would probably be the better approach anyway, more low level but would be ORM agnostic
<FromGitter> <Blacksmoke16> i.e. an ORM could do the same but provide a more user friendly api
<FromGitter> <watzon> I mainly just don't want to deal with `crystal-db` because I hate writing SQL, but I may end up doing that eventually anyway
<FromGitter> <Blacksmoke16> what exactly are you trying to do?
<FromGitter> <Blacksmoke16> store message results to the db by including a module?
<FromGitter> <watzon> Basically this, but using a database
<FromGitter> <watzon> I have `json_persistence`, which saves a `json_file` on exit and stores everything in memory, but obviously that isn't ideal for production use
<FromGitter> <Blacksmoke16> why not just include `Persistence` into your granite model
<FromGitter> <Blacksmoke16> or at the very least define a `GranitePersistence`
<FromGitter> <Blacksmoke16> at a quick glance it essentially would be like
<FromGitter> <watzon> Well `Persistence` get's included into a `Tourmaline::Client` instance. I was working on defining `GranitePersistence`, but I need to be able to define my models
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e4f559840ac4a7fb9fa68ee]
<FromGitter> <Blacksmoke16> make them do it?
<FromGitter> <watzon> That's basically what I had
<FromGitter> <Blacksmoke16> ah
<FromGitter> <watzon> But not being able to overload this (https://github.com/watzon/tourmaline/blob/master/src/tourmaline/models/chat.cr) because of the way Granite is structured is getting in my way.
<FromGitter> <Blacksmoke16> id maybe try to define a more general interface using `crystal-db`
<FromGitter> <Blacksmoke16> then have ORM specific interfaces that make implementing the more general one easier
<FromGitter> <Blacksmoke16> like based on https://crystal-lang.github.io/crystal-db/api/0.8.0/DB/PoolPreparedStatement.html or something, and just use the current ORM to generate the SQL
<FromGitter> <Blacksmoke16> where the general interface would define most of that logic and the ORM specific interface would return the SQL
<FromGitter> <watzon> I haven't worked much with database stuff in Crystal thusfar. Do you have an example of how something like that would be done?
<FromGitter> <Blacksmoke16> in which case could probably use https://crystal-lang.github.io/crystal-db/api/0.8.0/DB.html#mapping(properties,strict=true)-macro
<FromGitter> <Blacksmoke16> tbh no, i think it would also depend on what db driver is being used
<FromGitter> <Blacksmoke16> would deff be pretty low level...
<FromGitter> <Blacksmoke16> if you want to keep things generic between databases
<FromGitter> <watzon> Yeah I don't care that much right now. I just want one database layer that works. I don't particularly even care what database it is, I just need one.
<FromGitter> <Blacksmoke16> pg :p
<FromGitter> <watzon> PG is preferred haha
ur5us_ has quit [Ping timeout: 248 seconds]
postmodern has quit [Quit: Leaving]
sagax has joined #crystal-lang
_ht has joined #crystal-lang
_ht has quit [Client Quit]
_ht has joined #crystal-lang
_ht has quit [Quit: _ht]
<FromGitter> <kingsleyh> hello - can anyone tell me how @board is being mutated here? it seems impossible that it should be getting mutated - maybe a very subtle bug in my code that I've missed? https://github.com/kingsleyh/goaf3/blob/master/src/domain/board.cr#L42
Nicolab has joined #crystal-lang
Nicolab has quit [Quit: Leaving.]
<FromGitter> <mavu> @kingsleyh are you not intentionally changing pieces within @board?
<FromGitter> <kingsleyh> @mavu - as far as my understanding goes - the swap method should not mutate @board - and if I want to mutate @board - I should have to do `@board = swap(p1, p1, @board)`
<FromGitter> <kingsleyh> but just calling `swap(p1, p2, @board)` should not mutate @board - should it ?
<FromGitter> <asterite> it's mutating the data inside board, so it's mutating board. Or what do you mean by mutating?
<FromGitter> <kingsleyh> do you expect that calling the swap method will change the contents of the @board variable?
<FromGitter> <kingsleyh> I didn't expect it should
<FromGitter> <asterite> yes, you are changing the pieces inside it
<FromGitter> <asterite> if you don't want that to happen you should create a new piece inside the map. block
<FromGitter> <asterite> but then you should assign the value of swap to a new variable, but I don't know where would that go since there's only a single board in the code
<FromGitter> <mavu> @kingsleyh In crystal all objects (except primitive types) are passed around as references
<FromGitter> <mavu> They are not copied on method calls.
<FromGitter> <kingsleyh> ok thanks - I always thought that - mapping over an array of items would never change the array - unless the result of the map was assigned back to the array - but I see now that this is not the case!
<Andriamanitra> you're not actually changing the array itself as the array is just a "list of references" - what is changing is the objects those references point to
<FromGitter> <kingsleyh> ok great thanks - I've created new Pieces instead of mutating
darkstardevx has quit [Remote host closed the connection]
<FromGitter> <mavu> Is there a way to use the linux inotify to react to file changes?
darkstardevx has joined #crystal-lang
<FromGitter> <j8r> yes @mavu https://github.com/petoem/inotify.cr
<FromGitter> <mavu> thanks :)
darkstardevx has quit [Remote host closed the connection]
darkstardevx has joined #crystal-lang
gangstacat has quit [Quit: Ĝis!]
<FromGitter> <msa7> Hi ⏎ ⏎ I try to do ⏎ ⏎ ```{ ⏎ "err": 1, ⏎ "message": "not found" ⏎ }``` ... [https://gitter.im/crystal-lang/crystal?at=5e4fb4afc2c73b70a44c40ed]
<FromGitter> <asterite> what's the status code?
darkstardevx has quit [Ping timeout: 240 seconds]
<FromGitter> <msa7> 404 NOT_FOUND
<FromGitter> <asterite> That usually means the URI is wrong
<FromGitter> <msa7> ah… true in curl i use `api/1/item/` in crystal `api/1/item`. Thanks
<FromGitter> <msa7> all good now
<FromGitter> <msa7> got 200
<FromGitter> <asterite> Cool!
darkstardev13 has joined #crystal-lang
<FromGitter> <msa7> It my question. What do you mean `you the one`?
gangstacat has joined #crystal-lang
alexherbo2 has joined #crystal-lang
<FromGitter> <wout> What's the best way to get an instance variable dynamically? I've got a struct with `JSON::Serializable`, so a solution would be `JSON.parse(to_json)["dynamic_name"]`. Which works, but I am wondering now if there isn't a more elegant way.
Human_G33k has joined #crystal-lang
HumanGeek has quit [Ping timeout: 260 seconds]
<FromGitter> <straight-shoota> Instance variables can't be dynamically defined. They are set in stone at compile time. In order to store dynamic data, you need a data structure like a `Hash` (which is what `JSON::Any` is based on).
<FromGitter> <straight-shoota> Whether you use JSON to serialize such data is a different question, depending on your use case. But there's no "more elegant way" to store dynamic data other than a `Hash` or similar data structure.
<raz> crystal makes programming so easy, it feels like cheating
<FromGitter> <wout> @straight-shoota I think I wasn't clear in my question. I am looking for a way to get a value from a struct instance, similar to `.send("name")` in Ruby.
<raz> wout: these types of questions are difficult to answer because it's very case-dependent.
<raz> but the good news is, once you've overcome a few of them, you suddenly realize how much nicer and safer it is in Crystal (send is almost never a good idea in ruby either)
<FromGitter> <asterite> @wout There's no way to do what you want
<FromGitter> <wout> Ok, so here is a bit more context:
<FromGitter> <wout> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e4fcd884880f07ed1ecaaa6]
<FromGitter> <wout> @asterite Thanks, then I will stick with the current setup.
<FromGitter> <asterite> parent_param is not dynamic at all
<FromGitter> <asterite> it depends on the class name
<FromGitter> <asterite> you can get that at compile-time with macros
<FromGitter> <asterite> let me try something
<FromGitter> <asterite> (so you can do it, just not with send)
<FromGitter> <wout> Great, thanks!
<FromGitter> <asterite> Here: https://play.crystal-lang.org/#/r/8lru
<FromGitter> <asterite> I recommend reading about "macros" and "macro methods" in the reference ( https://crystal-lang.org/reference ) and exploring the Crystal::Macros module ( https://crystal-lang.org/api/0.33.0/Crystal/Macros.html )
<FromGitter> <asterite> @msa7 "you the one" == "you the person"
<FromGitter> <wout> @asterite Thanks, that's working as expected. And you are right, I need to read up on macros. Thanks again!
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
<FromGitter> <636f7374> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e5000493ca8a67fb80ce50d]
<FromGitter> <636f7374> `__U6_addr` in macOS,` __in6_u` in Heroku (Linux).
<FromGitter> <636f7374> Maybe there are other differences on other Linux? For the time being.
<FromGitter> <636f7374> `Sija/ipaddress.cr`, `watzon/subnet` difference?
<FromGitter> <636f7374> Classless inter-domain routing (CIDR) Enhance.
_ht has joined #crystal-lang
alexherbo2 has joined #crystal-lang
alexherbo22 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 255 seconds]
alexherbo22 is now known as alexherbo2
sagax has quit [Remote host closed the connection]
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/master/Crystal/Macros/Arg.html should prob include an argument to know if its a `splat` or `double splat`
_whitelogger has quit [Ping timeout: 248 seconds]
_whitelogger has joined #crystal-lang
<FromGitter> <watzon> They're basically the same @636f7374
<FromGitter> <watzon> I had no idea he already had a port of that gem when I made mine
return0e has joined #crystal-lang
return0__ has quit [Ping timeout: 272 seconds]
beepdog has quit [Ping timeout: 246 seconds]
olbat[m] has quit [Ping timeout: 252 seconds]
erdnaxeli has quit [Ping timeout: 260 seconds]
juanfra_ has quit [Ping timeout: 260 seconds]
beepdog has joined #crystal-lang
erdnaxeli has joined #crystal-lang
juanfra_ has joined #crystal-lang
erdnaxeli has quit [Client Quit]
juanfra_ has quit [Client Quit]
beepdog has quit [Quit: killed]
<FromGitter> <636f7374> @watzon Okay. : )
juanfra_ has joined #crystal-lang
sagax has joined #crystal-lang
<FromGitter> <acoolstraw> > @acoolstraw What's confusing with the API docs? ⏎ ⏎ just a bit hard to get what you're looking for
erdnaxeli has joined #crystal-lang
olbat[m] has joined #crystal-lang
beepdog has joined #crystal-lang
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 255 seconds]
<FromGitter> <watzon> The docs right now aren't great imo
<FromGitter> <watzon> The generation especially since we're missing things like groups and custom theming
<FromGitter> <Blacksmoke16> the latter could be solved by redoing the css to allow overriding classes
<FromGitter> <Blacksmoke16> which you could prob do now but i imagine its quite messy
<FromGitter> <acoolstraw> I'm more saying that there isn't enough docs
<FromGitter> <acoolstraw> but that's a personal issue I have withA PI documentation
<FromGitter> <acoolstraw> I think that Crystal's reference docs are some of the greatest docs I've seen for languages/libraries
<FromGitter> <acoolstraw> I mean there's some other projects whose docs are incredibly hard to understand
<FromGitter> <tenebrousedge> @acoolstraw do you know about devdocs.io ?
<FromGitter> <acoolstraw> no
<FromGitter> <tenebrousedge> check it out
<FromGitter> <acoolstraw> I don't think it'd help
<FromGitter> <acoolstraw> what I'm trying to say is that there should be examples of how to connect everything, and they should be placed correctly
<FromGitter> <acoolstraw> but I understand that's hard to do
<FromGitter> <tenebrousedge> connect everything? like what?
<FromGitter> <Blacksmoke16> how to make a program :p
<FromGitter> <acoolstraw> yeah ^
<FromGitter> <acoolstraw> like, you have one function and you have another
<FromGitter> <acoolstraw> you know they're gonna be used with one another
<FromGitter> <acoolstraw> but you can't really figure that out that fast from the docs
<FromGitter> <tenebrousedge> `puts "Hello, World!"
<FromGitter> <acoolstraw> you gotta ask people, which is annoying
<FromGitter> <Blacksmoke16> imo its not crystal's responsibility to teach you how to program
<FromGitter> <636f7374> You just have to try it yourself, using `crystal play`.
<FromGitter> <acoolstraw> no, not crystal
<FromGitter> <acoolstraw> I mean shards
<FromGitter> <acoolstraw> Crystal has quite good docs
<FromGitter> <Blacksmoke16> thats more so on the user's that made those shards
<FromGitter> <acoolstraw> yeah
<FromGitter> <acoolstraw> that's what I'm saying
<FromGitter> <Blacksmoke16> than the abilities of the api doc generation
<FromGitter> <tenebrousedge> if the shard has unit tests, those are often more accurate and useful than whatever documentation they may have
<FromGitter> <636f7374> I basically never look at the documentation when using shard.
<FromGitter> <acoolstraw> how do you use them then?
<FromGitter> <636f7374> I will only look at the source code.
<FromGitter> <acoolstraw> well, yeah
<FromGitter> <acoolstraw> that works, but not for novice or intermediate developers
<FromGitter> <636f7374> Because Crystal is so easy to understand.
<FromGitter> <acoolstraw> it gets tricky once you have huge projects like LibUI
<FromGitter> <636f7374> libUI has examples.
<FromGitter> <636f7374> Crystal libUI is a bit complicated, I think you can check the documentation of libUI (C).
<FromGitter> <636f7374> Crystal libUI is just a thin and light wrapper.
<FromGitter> <acoolstraw> those examples are a bit...
<FromGitter> <acoolstraw> tough
<FromGitter> <636f7374> Same usage as in C.
<FromGitter> <636f7374> libUI some abi are already bound (E.g. Hedron).
Human_G33k has quit [Remote host closed the connection]
Human_G33k has joined #crystal-lang
<FromGitter> <igor-alexandrov> Hello. Two good news: 1) We added support of S3 to Shrine.cr: https://github.com/jetrockets/shrine.cr 2) We ported content_disposition Ruby gem to Crystal as part of Shrine work https://github.com/jetrockets/content_disposition.cr
<FromGitter> <acoolstraw> Shrine seems interesting
<FromGitter> <acoolstraw> is it for web projects?
<FromGitter> <igor-alexandrov> Mainly yes, but I believe you can use it not only in web.
<FromGitter> <acoolstraw> yep
<FromGitter> <acoolstraw> so is it like a replacement to regular file uploading included in Kemal or other frameworks?
<FromGitter> <igor-alexandrov> It is a toolkit (based on Shrine.rb https://shrinerb.com/) that helps to upload, process and manage files.
<FromGitter> <asterite> @acoolstraw shrine seems to be about uploading files to external services like S3. Maybe you are thinking about uploading files to a server. Kemal and other frameworks handle that. Shrine handles where to physically store those files
<FromGitter> <acoolstraw> aw
<FromGitter> <acoolstraw> S3 is real expensive
<FromGitter> <Blacksmoke16> not really, depends how you use it
<FromGitter> <Blacksmoke16> long term archive is stupid cheap
<FromGitter> <acoolstraw> yeah
<FromGitter> <acoolstraw> but for small projects I don't like the price
<FromGitter> <acoolstraw> wait
<FromGitter> <acoolstraw> I'm confusing it with something else, sorry
<FromGitter> <acoolstraw> it's really cheap, wow
<FromGitter> <Blacksmoke16> main cost comes from the requests to add/retrieve the data
<FromGitter> <acoolstraw> surprised that storage costs less
ua has quit [Ping timeout: 240 seconds]
<FromGitter> <Blacksmoke16> storage is cheap these days
<FromGitter> <Blacksmoke16> terabyte SSDs are under $100
<FromGitter> <636f7374> I like M.2.
<FromGitter> <636f7374> Samsung 9x0 EVO / Pro
<FromGitter> <acoolstraw> terabyte
<FromGitter> <acoolstraw> they're charging practically nothing for hundreds of terabytes
<FromGitter> <acoolstraw> also, are they?
<FromGitter> <acoolstraw> the ones I've looked for are a bit over that
<FromGitter> <Blacksmoke16> you can find them, idk how *good* they are tho
<FromGitter> <acoolstraw> they've been gradually decreasing in prices though
<FromGitter> <acoolstraw> good ones have been $200 last year and now they're 130-150$
<FromGitter> <acoolstraw> double the HDD cost, much more the speed
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
_ht has quit [Remote host closed the connection]
_ht has joined #crystal-lang
_ht has quit [Quit: _ht]
alexherbo2 has joined #crystal-lang
<FromGitter> <christopherzimmerman> I picked up ~5 1TB SSDs a few months ago for like 80 each and I’ve been really happy with them. Haven’t noticed any real differences from my $150 one.
<FromGitter> <Blacksmoke16> Probably will in life span