ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.34.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
straight-shoota has quit [Ping timeout: 260 seconds]
_whitelogger has joined #crystal-lang
deavmi has quit [Read error: No route to host]
deavmi has joined #crystal-lang
<FromGitter> <naqvis> Yeah, agree, this should be the right behavior
rcvalle has quit [Ping timeout: 240 seconds]
rocx has quit [Ping timeout: 260 seconds]
<FromGitter> <Blacksmoke16> Think i should alias `.to_json` and `.from_json` to my implementation? I leaning towards no
<FromGitter> <naqvis> yeah
<FromGitter> <Blacksmoke16> now comes the fun part of how to wire this up to athena, while keeping it optional
<FromGitter> <Blacksmoke16> well no, im getting ahead of my self. first write a bunch of tests and document all this :laugh:
<FromGitter> <naqvis> I believe you are right on the topic
<FromGitter> <naqvis> I also had this thought/question of optional dependency, but don't think shards is able to pull deps optionally on conditions specified
<FromGitter> <Blacksmoke16> nope
<FromGitter> <Blacksmoke16> sec
<FromGitter> <naqvis> as it only differentiate between dev and non-dev deps
<FromGitter> <Blacksmoke16> can do option 3, but is kinda hacky. I decided upon option 2
rcvalle has joined #crystal-lang
<FromGitter> <naqvis> yeah, but how would you deal with `dependencies` section in shards.yml ?
<FromGitter> <naqvis> should user add? or not add the entries for particular shard?
<FromGitter> <naqvis> i mean requiring is different then shard pulling the lib
<FromGitter> <Blacksmoke16> right, if they want to use it, they would have to add the shard
<FromGitter> <Blacksmoke16> and require the corresponding ext file
<FromGitter> <Blacksmoke16> plan atm would be to define the serializer as a service for the DI shard. Then the stuff that needs it, define it as an optional service so that if defined it'll be injected, otherwise itll be `nil`. Then i could use the serializer if its not nil and the type is my interface, otherwise falling back on `.to_json`
<FromGitter> <naqvis> i was talking about something like rust cargo 'features`
<FromGitter> <naqvis> they are very neat
<FromGitter> <Blacksmoke16> yea, or really having a more official way to check if a shard is installed
<FromGitter> <naqvis> yeah, i like your approach of overriding the default or falling back when user doesn't asks so
<FromGitter> <Blacksmoke16> DI ftw 😉
<FromGitter> <naqvis> but you are writing a more generic (de)serializer, how would user opt for (in/out)put format?
<FromGitter> <naqvis> or am i mistaken on your plan you to support json,yaml etc?
<FromGitter> <Blacksmoke16> the serializer would support JSON/YAML, however not sure I really need to allow them to customize the io format? who would make an api in yaml?
<FromGitter> <naqvis> true, but how would this shard guess if usage is for json or yml?
<FromGitter> <naqvis> i mean, this is more kind of a general package
<FromGitter> <naqvis> where anyone willing to use general api irrespective of format can utilize it
<FromGitter> <Blacksmoke16> sorry to be clear, im talking about having the serializer shard as an optional dependency within athena
<FromGitter> <naqvis> and when needed, can invoke (de)serialize method and done
<FromGitter> <Blacksmoke16> (my web framework)
<FromGitter> <naqvis> yeah, I understand, but you will be using the ASR::Serializer in Athena and there its definitely will be dealing with json as in/out
<FromGitter> <naqvis> but how would you configure ASR::Serializer in Athena to use json?
<FromGitter> <naqvis> that was my question
<FromGitter> <Blacksmoke16> ah, something like
<FromGitter> <Blacksmoke16> ``````
<FromGitter> <Blacksmoke16> ``````
<FromGitter> <Blacksmoke16> guess you cant do code blocks in here?
<FromGitter> <Blacksmoke16> ``````
<FromGitter> <Blacksmoke16> ``````
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5eaf85a97975db7ebfe18c2d]
<FromGitter> <Blacksmoke16> (updated)
<FromGitter> <Blacksmoke16> just hardcode it realy
<FromGitter> <naqvis> yeah, make sense then
<FromGitter> <Blacksmoke16> the user could also define something on their own if they need more complex logic, this is just a sane default
<FromGitter> <naqvis> looks very clean
<FromGitter> <Blacksmoke16> thanks :) i try haha
<FromGitter> <naqvis> 👍
<FromGitter> <naqvis> another quick question on ASR::Serializer, behind the scences its wired to stdlib implementation of json/yaml, right?
<FromGitter> <naqvis> believe you have done your own abstractions over stdlib ones?
<FromGitter> <naqvis> what if new format is added or dev using via 3rd party shard?
<FromGitter> <naqvis> is there a mechanism to have ASR::Serializer use different format?
<FromGitter> <Blacksmoke16> yea, uses `JSON::Any` and `YAML::Any` under the hood, but adds another abstraction on top of them to provide a common interface
<FromGitter> <Blacksmoke16> format is an argument when calling `#deserialize` or `#serializer`
<FromGitter> <Blacksmoke16> so deff would be possible to have that be variable
<FromGitter> <Blacksmoke16> however you cant reopen an enum, so it would have to be added to core first
<FromGitter> <Blacksmoke16> as i was saying before a more robust solution would be to something within the shard itself versus relying upon json/yaml any and implement a proper interface/abstraction, but for now its prob fine
<FromGitter> <Blacksmoke16> only other format i could see supporting that is common would be xml
<FromGitter> <naqvis> yeah, but there are other binary formats like 'messagepack` etc
<FromGitter> <Blacksmoke16> true
<FromGitter> <Blacksmoke16> this is where optional shards would come in handy too
<FromGitter> <naqvis> i would say having more general approach is better, thus giving dev options to go with any they need
<FromGitter> <naqvis> by just implementing some interface and bingo they are done
<FromGitter> <naqvis> true
<FromGitter> <Blacksmoke16> require my shard, and require another shard that defines the parsing logic for it
<FromGitter> <Blacksmoke16> required if you want to use type X
<FromGitter> <naqvis> like in go, dev can just implement `Mashaler` interface with one method and they are ready for serialization, sames goes for UnMarshaler interface
<FromGitter> <naqvis> yeah, agree that would be very clean interface
<FromGitter> <Blacksmoke16> to be clear thats possible
<FromGitter> <Blacksmoke16> serializer.serialize object, :yaml
<FromGitter> <Blacksmoke16> serializer.serialize object, :json
<FromGitter> <Blacksmoke16> assuming `object` includes my module
<FromGitter> <naqvis> dev can bind the actual (de)serializer shard at backend to your ASR::Serializer one and just use ASR::Serializer to interact
<FromGitter> <naqvis> so you mean, one can just override the `serialize` method of your module and that's all needed?
<FromGitter> <Blacksmoke16> yup, just sucks you cant reopen `Format`, so it would have to be added/released to support a new format
<FromGitter> <Blacksmoke16> no, the format is based on an enum
<FromGitter> <Blacksmoke16> like its an argument
<FromGitter> <naqvis> ASR::Serializer will invoke that method when asked to serialize?
<FromGitter> <Blacksmoke16> `def serialize(data : _, format : ASR::Format, context : ASR::SerializationContext = ASR::SerializationContext.new, **named_args) : String`
<FromGitter> <Blacksmoke16> uses the enum member to get the correct visitor, i.e. the type that actually does the logic for (de)serialization
<FromGitter> <naqvis> re-opening looks like hacky
<FromGitter> <Blacksmoke16> you cant even reopen the enum
<FromGitter> <naqvis> can't we just have an interface, where one need to implement just method and leave rest to shard to take care of?
<FromGitter> <codenoid> stay healthy crystal folks
<FromGitter> <naqvis> something like `abstract def format : String` just an example
<FromGitter> <naqvis> ``````
<FromGitter> <naqvis> oops
<FromGitter> <Blacksmoke16> yea cant do code blocks in here :/
<FromGitter> <naqvis> ```module Serializer ⏎ abstract def format ⏎ abstract def serialize.....``` [https://gitter.im/crystal-lang/crystal?at=5eaf90fc31a6d25d7ca9170e]
<FromGitter> <naqvis> you can, its just entering send away the message
<FromGitter> <Blacksmoke16> ah, normally shift+enter doesnt do that
<FromGitter> <naqvis> but seems in thread-mode those keys combination doesn't work
<FromGitter> <Blacksmoke16> yea :/
<FromGitter> <naqvis> so i type in normal mode an then copy/paste :D
<FromGitter> <Blacksmoke16> but in regards to that example, wouldnt that mean you would need a serializer for each type?
<FromGitter> <Blacksmoke16> format*
<FromGitter> <naqvis> i was thinking in terms of those ORMs on how they take `tablename`
<FromGitter> <naqvis> some just use the class/struct name as their tablename and some allow to override the tablename
<FromGitter> <naqvis> shouldn't it be good if ASR::Serializer have something similar?
<FromGitter> <naqvis> that will make usage of `Format` redundant in method call
<FromGitter> <Blacksmoke16> as a way to specify the format of the type?
<FromGitter> <naqvis> and will just work
<FromGitter> <naqvis> yeah
<FromGitter> <Blacksmoke16> but wouldnt that tightly couple a type to a format
<FromGitter> <Blacksmoke16> which im not sure is ideal
<FromGitter> <naqvis> aha
<FromGitter> <naqvis> agree
<FromGitter> <naqvis> but general use case, require format is always fixed one
<FromGitter> <Blacksmoke16> way i have things setup now is a single serializer for all types, where a type is not tied to a specific format
<FromGitter> <Blacksmoke16> well i could see a usecase for a framework to do like`
<FromGitter> <naqvis> but agree that approach will restrict the usage to specific format
<FromGitter> <Blacksmoke16> `GET /user/10/?format=xml`
<FromGitter> <Blacksmoke16> or based on `Accept` header
commavir has quit [Excess Flood]
<FromGitter> <naqvis> yeah, i like that
<FromGitter> <Blacksmoke16> which is possible now
<FromGitter> <naqvis> as most of the sites with api does support that approach
commavir has joined #crystal-lang
<FromGitter> <naqvis> where user can specify the output format
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5eaf929c97338850a2e67373]
<FromGitter> <Blacksmoke16> or whatever
<FromGitter> <naqvis> json is always default, but one can ask for different format via URI
<FromGitter> <Blacksmoke16> yup
<FromGitter> <jwaldrip> Lets see how long it takes anyone to notice...
<FromGitter> <naqvis> agree, if its already handling that way, then why not go with `NamedTuple` to specify the format?
<FromGitter> <Blacksmoke16> :thinking: how would that be better than an enum?
<FromGitter> <naqvis> that will save re-opening the struct to add new format (if there is any)?
<FromGitter> <Blacksmoke16> kinda relying on the enum to return the correct visitor
<FromGitter> <Blacksmoke16> sorry, when i was talking about re-opening the enum, i was saying that you cant
<FromGitter> <Blacksmoke16> so to support a new format, they would have to open a PR to add that format to the `Format` enum, and provide visitors for it
<FromGitter> <naqvis> yeah true
<FromGitter> <naqvis> gotcha
<FromGitter> <Blacksmoke16> like those
<FromGitter> <codenoid> what ._.
<FromGitter> <Blacksmoke16> which once they are there, the implementation of *how* the `ASR::Any` is returned could be up to an external shard
<FromGitter> <jwaldrip> https://crystalshards.org/
<FromGitter> <Blacksmoke16> i.e. could have multiple shards that could act as "backends" to `XML`
<FromGitter> <jwaldrip> feedback welcome
<FromGitter> <naqvis> yeah, I was talking on similar approach
<FromGitter> <naqvis> so it does allow adding new formats a breeze by just extending (de)`serialization_visitor_interface.cr`
<FromGitter> <naqvis> but tbh i'm still not getting my head work with extending enum for formats
<FromGitter> <Blacksmoke16> in theory yes, hardest part would be the deserialization side of things
<FromGitter> <naqvis> i mean as dev is already extending the required interface, they should be saved away from doing sth else
<FromGitter> <naqvis> code should deal with that
<FromGitter> <naqvis> but I understand as module has already provided support for json and yaml
<FromGitter> <naqvis> and generic to any format, so need a way to tell which format one want to use
<FromGitter> <Blacksmoke16> something i defined
<FromGitter> <codenoid> `503 Service Temporarily Unavailable`
<FromGitter> <Blacksmoke16> could use a string or whatever, but :shrug:
<FromGitter> <naqvis> how about get rid of Format enum?
<FromGitter> <naqvis> and pass the visitor as the param for method call?
<FromGitter> <jwaldrip> Should not be
<FromGitter> <Blacksmoke16> could work, but would be a strange API for the user
<FromGitter> <Blacksmoke16> "whats a visitor?"
<FromGitter> <naqvis> like `serialize(fmt : SerializationVisitorInterface).....`
<FromGitter> <naqvis> defaults to JSON impl
<FromGitter> <naqvis> this way, one needn't to provide the format
<FromGitter> <Blacksmoke16> i used to use a module that included a specific interface
<FromGitter> <naqvis> as shard will in-turn call respective impl methods when performing the (de)serialization
<FromGitter> <Blacksmoke16> like `serializer.serialize obj, JSON`
<FromGitter> <naqvis> yeah
<FromGitter> <Blacksmoke16> that would allow using custom formats more freely, but if i recall there was some problem with it so switched to enum
<FromGitter> <naqvis> default is JSON
<FromGitter> <naqvis> aah
<FromGitter> <naqvis> i've used modules extensively in shards i've built
<FromGitter> <naqvis> and didn't encounter any issue
<FromGitter> <naqvis> but i'm sure you must have hit by something
<FromGitter> <naqvis> which I haven't
<FromGitter> <naqvis> just sharing my thoughts and not necessarily you have to agree with all of them :)
<FromGitter> <Blacksmoke16> all good. enum works quite well. I'm just skeptical that there are enough custom formats out there to have a need to make things less strict
<FromGitter> <Blacksmoke16> in which case someone opening a PR adding a new format with some sort of implementation would be fine
<FromGitter> <Blacksmoke16> messagepack already has an `Any` type, so might have to try a test implementation of it as a trial run
<FromGitter> <naqvis> agree
<FromGitter> <watzon> Oooh nice update
<FromGitter> <Blacksmoke16> ill deff give that a shot once i get things more finalized
<FromGitter> <naqvis> but my take was from different perspective, suppose i'm using this in my application, where need is to have another format other than what this shard offers (same messagepack)
<FromGitter> <Blacksmoke16> actually, let me throw it in right now and see what happens
<FromGitter> <naqvis> i can use this shard for implementation of JSON/YAML and extend visitor for other format
<FromGitter> <Blacksmoke16> thats the idea, but that extension would require making a PR to the shard to scaffold some stuff
<FromGitter> <naqvis> in this case, now I would have to change the code of this shard, to update enum
<FromGitter> <Blacksmoke16> ill have to think on that, maybe ill try the module again
<FromGitter> <naqvis> but shouldn't code be following the open-close principle?
<FromGitter> <naqvis> i mean your awsome shard is already open where it does allow extension for new formats via visitor implementation
<FromGitter> <naqvis> but tbh i'm reluctant in changing shard code-base for any new extension i've added
<FromGitter> <Blacksmoke16> just that the enum doesnt play well with it :/
<FromGitter> <naqvis> as this will require external shard updated code need to be shipped with my code for it to work on another machine
<FromGitter> <Blacksmoke16> maybe just string constants would be ok
<FromGitter> <naqvis> say CI
<FromGitter> <naqvis> yeah, its just that enum stuff is not clicking with me
<FromGitter> <Blacksmoke16> type safety :shrug:
<FromGitter> <Blacksmoke16> prevents `:josn`
<FromGitter> <Blacksmoke16> i do agree thats a big drawback, ill have to think on it more
<FromGitter> <naqvis> :thubmsup:
<FromGitter> <naqvis> i mean enum is good when we have fixed set of options, but your module is more general, so it shouldn't be restricted by enum
<FromGitter> <Blacksmoke16> i guess i was viewing it as something fairly fixed
<FromGitter> <Blacksmoke16> also fwiw
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5eaf9dc0f0377f1631666106]
<FromGitter> <Blacksmoke16> doesnt exactly work correctly atm, but would be something like that
<FromGitter> <naqvis> thanks, and this proves how easy your shard is to get extended for new formats. I used msgpack just as an example, but i love the way you have put-up api for extension
<FromGitter> <naqvis> and that could be any proprietary or non-custom format
<FromGitter> <Blacksmoke16> ahh wasnt serializing the keys
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5eaf9fa19f0c955d7da1b430]
<FromGitter> <Blacksmoke16> neat
<FromGitter> <Blacksmoke16> anyway ill sleep on how to make extending it easier
<FromGitter> <Blacksmoke16> ill catch you later o/
<FromGitter> <naqvis> :awsome
<FromGitter> <naqvis> sure thing
<FromGitter> <naqvis> gn
<FromGitter> <Blacksmoke16> lol no way
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5eafa1497a24ff01b0fd9428]
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5eafa159adb0ec5c2be286ae]
<FromGitter> <Blacksmoke16> apparently thats all it takes
<FromGitter> <Blacksmoke16> anyway, off to bed for real now
<FromGitter> <naqvis> wow, that's very neat and simplify things to much greater extent
<FromGitter> <watzon> @jwaldrip it would be nice if dependents were listed somewhere. I see a count, but I don't see a list.
<FromGitter> <jwaldrip> On my list to do ;-)
<FromGitter> <jwaldrip> I have the data, just need to write the query
<FromGitter> <watzon> 2 other things. How often are shards updated? And where does the email come from?
<FromGitter> <watzon> Mine seems to be wrong haha, so I need to know where to update it
<FromGitter> <watzon> Ahh nvm, it's from `shard.yml`
<FromGitter> <watzon> Having a button to force an update could be nice
<FromGitter> <jwaldrip> The indexer runs once per hour and will continue until the github rate limit is exceeded.
<FromGitter> <watzon> Hmm nice
<FromGitter> <watzon> Only other thing I can think of right now @jwaldrip, is that it could be nice to have some badges. For instance, dependencies and dependents badges that can be added to a README
<FromGitter> <jwaldrip> There are a series of strategies. ⏎ 1) repo search for language=Crystal ⏎ 2) code search of file=shard.yml ⏎ 3) known GitHub api ids will try and update without using search ⏎ 4) unknown github api ids will search by url and update accordingly. [https://gitter.im/crystal-lang/crystal?at=5eafa8ad7a24ff01b0fda2b3]
<FromGitter> <watzon> Nice redesign though. I like it.
<FromGitter> <jwaldrip> Badges would be a fun addition. I'll add that to the list.
<FromGitter> <jwaldrip> One thing to note that makes the redesign different than other indexes. Only projects with valid shard files will be indexed.
<FromGitter> <watzon> It's one thing we're really missing for Crystal. I can think of a few that would be nice. Crystal version, dependents, and dependencies are the main ones.
<FromGitter> <watzon> > One thing to note that makes the redesign different than other indexes. Only projects with valid shard files will be indexed. ⏎ ⏎ This is nice
<FromGitter> <jwaldrip> Also, there is a blacklist maintained as a yml in the root of the repo. This will prevent those projects from showing on the front page.
<FromGitter> <jwaldrip> Things like invidious have a valid shard file but don't provide themself to be useful to the community.
<FromGitter> <jwaldrip> I still store those projects and I have thought of doing a separate projects area of the app, but I don't much see it's usefulness.
<FromGitter> <jwaldrip> The purpose of the site is to empower creators
<FromGitter> <jwaldrip> Generating docs is on my short list... just have to avoid all the system access you can do in macros.
<FromGitter> <jwaldrip> If you don't mind opening issues for the things you would like to see, I can work on them.
<FromGitter> <jwaldrip> Also, feel free to contribute. It was fun to build, but this was for the community and would love to see it be maintained by the community.
<FromGitter> <watzon> Oh you're planning on actually generating docs for shards and having something like a central documentation repository? Like docs.rs?
<FromGitter> <jwaldrip> Correct
<FromGitter> <watzon> That would be awesome
<FromGitter> <jwaldrip> Correct
<FromGitter> <watzon> Any kind of API available or planned?
<FromGitter> <jwaldrip> Gitter for iPhone... sorry about that
<FromGitter> <jwaldrip> Would love to do that as well.
<FromGitter> <watzon> It would be fun to build a telegram bot on the back of that API
<FromGitter> <jwaldrip> I'm also going to be building a cli that provides some additional functionality and will allow things like `facet search kemal` or `facet add Kemal`
<FromGitter> <jwaldrip> And clearly I have already thought of a name for the Cli ;-)
<FromGitter> <watzon> Haha that would be awesome too
<FromGitter> <jwaldrip> Facet : I.e. the side of a crystal
<FromGitter> <watzon> I take it that `facet add` would add a dependency to `shard.yml`
<FromGitter> <jwaldrip> Correct
<FromGitter> <watzon> Which is something I've been hoping `shards` would integrate for a long ass time
<FromGitter> <jwaldrip> Parse the yml, modify it, and write it
<FromGitter> <watzon> That's awesome
<FromGitter> <jwaldrip> I also want to add `facet install kemal`
<FromGitter> <watzon> Well definitely let me know if there are any specific things you need help with, I'd be more than happy to contribute
<FromGitter> <jwaldrip> Which would download, compile, and place the binary in your path.
<FromGitter> <watzon> YES!
<FromGitter> <watzon> Another thing that's been wanted by many for `shards` itself
<FromGitter> <jwaldrip> The repo is open. PRs accepted anytime. It seems like the demand for api/cli is top of mind ;-)
<FromGitter> <watzon> But... here we are
<FromGitter> <jwaldrip> If you can't change the thing, build a new one ;-)
<FromGitter> <watzon> Well I'll definitely take a look at the code base tomorrow and see what it would take to get an API going
<FromGitter> <watzon> I see you're not using a framework?
<FromGitter> <watzon> Oh wait, is `orion` a framework?
<FromGitter> <jwaldrip> Orion for the web pieces
<FromGitter> <watzon> Ok haha
<FromGitter> <watzon> Never used it
<FromGitter> <jwaldrip> I wrote it. Check the docs out. I think it's pretty comprehensive
<FromGitter> <watzon> Will do for sure
<FromGitter> <jwaldrip> ^ love that I can do that now
<FromGitter> <watzon> 😁
<FromGitter> <jwaldrip> Ah. The readme is in adoc
<FromGitter> <jwaldrip> https://github.com/obsidian/orion
<FromGitter> <watzon> We need good, easy to find instructions on building static binaries using docker
flips has quit [Quit: bbl ...]
flips has joined #crystal-lang
sz0 has joined #crystal-lang
_ht has joined #crystal-lang
<FromGitter> <Uzay-G> Hey! Crystal looks really cool :). I really like ruby's style and I am excited to learn it and even build some shards
ua_ has quit [Ping timeout: 260 seconds]
_ht has quit [Remote host closed the connection]
_ht has joined #crystal-lang
ua_ has joined #crystal-lang
<FromGitter> <mavu> Welcome! It realy is a beautiful language
<FromGitter> <Uzay-G> yeah. Are there any good static site generators built in crystal? I am thinking of building one that kind of extends jekyll
straight-shoota has joined #crystal-lang
<FromGitter> <ArtLinkov> Hey all, ⏎ Is there a way to add a custom dynamic massage to a spec validation test? ⏎ For example, this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5eafef65f0377f1631671910]
<FromGitter> <mavu> @Uzay-G I don't know, but you can check this list: https://github.com/veelenga/awesome-crystal
<FromGitter> <Uzay-G> cool
rocx has joined #crystal-lang
<FromGitter> <kingsleyh> hello - does anyone know how to put 2 slices together into a single slice? `slice1 = "hello".to_slice + "bye".to_slice`
<FromGitter> <tenebrousedge> create a larger slice, fill it in with the smaller ones
<FromGitter> <kingsleyh> got an example?
<FromGitter> <tenebrousedge> something like `a = bigslice; a[0..1000].copy_from(small_slice); a[1000..-1].copy_from(other_small_slice)`
<FromGitter> <kingsleyh> thanks
<FromGitter> <naqvis> @ArtLinkov you can use `fail` to use your custom messages like ⏎ `fail("Some message") unless 1 == 2`
<FromGitter> <Blacksmoke16> @naqvis so I thought about it a bit
<FromGitter> <Blacksmoke16> what do you think about making the type restriction of the `format` argument `ASR::Format | String`
<FromGitter> <Blacksmoke16> so you still get type safety for the most common use cases
<FromGitter> <Blacksmoke16> but then have methods within the serializer type that can be redefined to support custom types
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5eb00dd50b23797ec05f64ba]
<FromGitter> <Blacksmoke16> by default string would use `ASR::Format.parse`
<sorcus> Blacksmoke16: :-)
Xeago has quit [Ping timeout: 264 seconds]
<FromGitter> <naqvis> So you mean, other than implementing the (de)serialize visitors, one also need to override these methods for new format?
<FromGitter> <Blacksmoke16> yes
<FromGitter> <naqvis> just use msgpack example, suppose its implemented by user of this shard, then what else steps he/she need to perform to have it enabled?
<FromGitter> <Blacksmoke16> my thought is that if its like an "official" format, it'll be in the enum. Otherwise this gives the ability to extend it for private/custom formats not common enough to support in the main shard
<FromGitter> <naqvis> then it definitely make sense
<FromGitter> <Blacksmoke16> create the two visitors, and redefine these two methods to allow resolving the format to their visitor
<FromGitter> <naqvis> my understanding was that, this allows common formats like json/yaml, but one can extend it for project specific use, without making any modification to the shard code-base
<FromGitter> <Blacksmoke16> correct
<FromGitter> <Blacksmoke16> and still provides the type saftey of the enum for common formats
<FromGitter> <naqvis> as long as user of this shard are allowed to extend, I think it will be good
<FromGitter> <chosenhood> Someone knows how to create a tuple like this using a macro? ⏎ P.S. (Yes, I have to use macros. It's a simple representation of my actual code) ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5eb010f27975db7ebfe2cacf]
<FromGitter> <naqvis> personally I would have gone with asking the user to provide the concrete class as a param, which would do the (de)serialize
<FromGitter> <tenebrousedge> `{{ NAMES.splat }}`
<FromGitter> <naqvis> but I understand, there are always different ways to do same things
<FromGitter> <tenebrousedge> or you can do it like you did
<FromGitter> <naqvis> ```serialize(JSONSerializeVisitor.new).......```
<FromGitter> <naqvis> sth like this
<jhass> chosenhood: if outside a macro definition, you'll need a {% begin %} before the { and an {% end %} after the } to enter/exit the macro context
<FromGitter> <naqvis> in that way, if tomorrow there is new XYZ format, one can simply invoke the methods by just passing the concrete class meeting the ASR::Serializer contract
<FromGitter> <tenebrousedge> dang, gitter has threads now?
<FromGitter> <naqvis> hurray, isn't it great 😆
<FromGitter> <tenebrousedge> I guess we don't need slack now
<FromGitter> <naqvis> with you 👍
<FromGitter> <Blacksmoke16> ah, just not a fan of that. exposes too much to someone who just wants to serialize something, like `serialize obj, :json`
<FromGitter> <naqvis> agree
<FromGitter> <Blacksmoke16> plus if a new format is officially added they could just swap `:json` for `:xml` or whatever
<FromGitter> <naqvis> true, but my thoughts were more on projects/dev which will use it for project specific use and they might have some proprietary or custom formats, which aren't going to be made public
v2px__ has quit [Ping timeout: 260 seconds]
<FromGitter> <naqvis> i mean kind of stdlib like functionality, it offers general formats, but also allows custom extensions
<FromGitter> <naqvis> but you already clarified that, one can still extend it for proj specific use, so I believe we are on same page now
<FromGitter> <Blacksmoke16> in which case just redefining those two methods would be it. then there is a common API, and thats fairly simple
<FromGitter> <naqvis> yeah, true
<FromGitter> <Blacksmoke16> > i mean kind of stdlib like functionality, it offers general formats, but also allows custom extensions ⏎ ⏎ in what regard?
<FromGitter> <jwaldrip> They dont work well on the iOS app :-/
<FromGitter> <naqvis> like `Digest`, there are stdlib provided impls, but one can also add their own when needed
<FromGitter> <naqvis> i mean, allows extension
<FromGitter> <naqvis> and your shard is already doing that
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <Blacksmoke16> ill prob go with this for now and see how it plays out
<FromGitter> <naqvis> and your shard is doing great work of unifying the (de)serialize API, thus hiding the actual format details
<FromGitter> <chosenhood> thanks m8 totally 4got about begin and end
<FromGitter> <naqvis> with you
<FromGitter> <Blacksmoke16> mhm, the other big benefit is consolidating the macros
<FromGitter> <Blacksmoke16> annotations*
<FromGitter> <Blacksmoke16> `@[ASR::Skip]` would affect all formats
<FromGitter> <Blacksmoke16> versus `JSON::Field(ignore: true)` ...
<FromGitter> <naqvis> true and the best and cleanest thing is , one just need to know `ASR::Serialize` and full stop
<FromGitter> <naqvis> don't need to know format specific (De)Serialize interfaces and calling format specific methods
<FromGitter> <naqvis> tbh very clean and very friend for dev who dont' want to go into nitty-gritty details
<FromGitter> <naqvis> at the same time open for dev who want to extend it for new formats
<FromGitter> <naqvis> excellent job 👍
<FromGitter> <Blacksmoke16> thanks :) I can't take all the credit tho
<FromGitter> <Blacksmoke16> https://jmsyst.com/libs/serializer is based on this php lib we use at work
<FromGitter> <Blacksmoke16> mainly around the annotations and use navigator/visitor pattern. works quite well in crystal due to overloading
<FromGitter> <naqvis> great work and contribution to crystal community
Xeago has joined #crystal-lang
hightower2 has quit [Read error: Connection reset by peer]
<FromGitter> <asterite> how do I reply in a thread from a mobile?
<FromGitter> <Blacksmoke16> idt you can
<FromGitter> <asterite> good for threads, but there is still only one channel here
<FromGitter> <Blacksmoke16> you can have more than one channel under the lang
<FromGitter> <Blacksmoke16> https://gitter.im/crystal-lang
<FromGitter> <asterite> interesting
<FromGitter> <Blacksmoke16> apparently there is a db ch? :p
<repo> has anyone here packaged crystal apps with flatpack?
<FromGitter> <Blacksmoke16> nope, used snapcraft tho
<travis-ci> crystal-lang/crystal#2838db7 (master - Log: Add Log.capture spec helper (#9201)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/682951966
travis-ci has joined #crystal-lang
travis-ci has left #crystal-lang [#crystal-lang]
<DeBot> https://github.com/crystal-lang/crystal/pull/9201 (Log: Add Log.capture spec helper)
<FromGitter> <ArtLinkov> @naqvis gotcha! That's exactly what I was looking for! Thanks :D
<FromGitter> <Blacksmoke16> that one command is essentially it
<FromGitter> <Blacksmoke16> if anything, maybe update https://github.com/crystal-lang/crystal/wiki/Static-Linking
HumanGeek has joined #crystal-lang
<FromGitter> <naqvis> great 👍
Human_G33k has quit [Ping timeout: 264 seconds]
rcvalle has quit [Remote host closed the connection]
<FromGitter> <kingsleyh> hello - could use a hand
<FromGitter> <kingsleyh> more to follow
<FromGitter> <watzon> Damn it doesn't look like the docker images include all the necessary dependencies
<FromGitter> <Blacksmoke16> hm?
<FromGitter> <watzon> I'm getting `undefined reference to lzma_code` among other `lzma` issues
<FromGitter> <Blacksmoke16> sec
<FromGitter> <Blacksmoke16> try that
<FromGitter> <kingsleyh> actually there is no more to follow - I figured it out - thanks
<FromGitter> <watzon> Well that got me past lzma at least haha
<FromGitter> <watzon> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5eb042e8adb0ec5c2be42589]
<FromGitter> <Blacksmoke16> use single quotes
<FromGitter> <Blacksmoke16> that happens when the link flag thing runs on local versus container
<FromGitter> <watzon> With single quotes it seems to think that the pkg-config thing is a target :/
<FromGitter> <watzon> This is what I have so far ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5eb0438497338850a2e82c1c]
<FromGitter> <watzon> I feel like I need to add this all to a dockerfile
<FromGitter> <Blacksmoke16> or at least a bash script :S
<FromGitter> <tenebrousedge> or both
<FromGitter> <tenebrousedge> docker <3 bash
<FromGitter> <Blacksmoke16> sec
<FromGitter> <tenebrousedge> but if you have a volume then docker-compose is very convenient
<FromGitter> <Blacksmoke16> ogh yea i had trouble with this before
<FromGitter> <watzon> Got it working!
<FromGitter> <Blacksmoke16> oh?
<FromGitter> <watzon> Yep, just threw it all into a dockerffile, had it install libxml and openssl, and attached a volume
<FromGitter> <Blacksmoke16> nice
<FromGitter> <watzon> I'm gonna clean it up, but this is pretty much what I ended up with to get it working ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5eb045f7a9de3d01b1e98425]
<FromGitter> <Uzay-G> does anyone have experience with the discord-cr wrapper?
<FromGitter> <Uzay-G> i am having a bit of trouble with the docs?
<jhass> ?expert=Don't try to find an expert, just ask your question directly, giving people as much context as possible.
<DeBot> jhass: Set expert.
<FromGitter> <Uzay-G> actually i am starting to understand how it works
<FromGitter> <jwaldrip> Dont forget the shards build `--release` flag...
<FromGitter> <jwaldrip> `--production` does not do a compiler release.
<FromGitter> <jwaldrip> @watzon
<FromGitter> <watzon> Yeah haha, I got that. That file was just for testing.
hightower3 has joined #crystal-lang
lunarkitty has quit [Ping timeout: 260 seconds]
_ht has quit [Remote host closed the connection]
_ht has joined #crystal-lang
lunarkitty has joined #crystal-lang
<repo> how do i check at compile time if my app is compiled with the --static flag?
<repo> flag?(:static) doesn't seem to be set
<FromGitter> <Blacksmoke16> makes sense, its not a flag
<repo> i geuss
<repo> guess
<FromGitter> <Blacksmoke16> whats the use case?
<repo> need to alter linker flags
<repo> it links a static lib
<repo> and thus needs to set -Wl,Bstatic ... -Wl,Bdynamic
<repo> but only if it's not already compiled with the --static flag
_ht has quit [Ping timeout: 246 seconds]
_ht has joined #crystal-lang
<FromGitter> <Blacksmoke16> hmm
<FromGitter> <Blacksmoke16> wonder why `flag?(:release)` works then
<repo> yeah
<repo> ah
<repo> my bad
<repo> used {{debug flag?(:static)}} instead of {{puts ...}}
<FromGitter> <Blacksmoke16> rip, that would do it
<FromGitter> <j8r> `{% if flag?(:static) %}` works
<repo> yeah
<FromGitter> <j8r> What is the issue then?
<repo> nothing anymore :)
<repo> i just used debug instead of puts to test it
<FromGitter> <j8r> ha ok :)
<FromGitter> <Uzay-G> Hmm, I'm getting a weird error with discordcr and the `Time` module specifically. Could someone help me?
<FromGitter> <Uzay-G> Here is the error:
<FromGitter> <Uzay-G> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5eb0627ea9de3d01b1e9d6a4]
<FromGitter> <Blacksmoke16> what version of crystal/the lib you using?
<FromGitter> <Blacksmoke16> because that method doesnt exist anymore
<FromGitter> <j8r> and search `epoch`
<oprypin> Uzay-G, wew it was removed in Crystal 0.27.0
<oprypin> Nov 1, 2018
<FromGitter> <j8r> yes, this library is not up to date - at all
<FromGitter> <Uzay-G> oh ok
<FromGitter> <Uzay-G> oof
<FromGitter> <Uzay-G> oh man that's too bad.
<FromGitter> <j8r> time to fork & PR, I guess
<FromGitter> <Blacksmoke16> what library you using?
<FromGitter> <Blacksmoke16> pretty sure there is an up to date discord one
<FromGitter> <Uzay-G> discordcr
<FromGitter> <Uzay-G> the last commit was in february
<FromGitter> <Uzay-G> so not outdated
<FromGitter> <Blacksmoke16> latest release is from `Jun 23, 2018`
<FromGitter> <Blacksmoke16> that would do it
<FromGitter> <Blacksmoke16> prob want to pin the version to some commit on master
<FromGitter> <Uzay-G> what do you mean?
<FromGitter> <Uzay-G> you think I should just pull from the project?
<oprypin> Uzay-G, specify `version: commithash`
<oprypin> in shard.yml
<FromGitter> <Uzay-G> oh ok thanks 👍
<FromGitter> <Blacksmoke16> i think its `commit: hash`
<oprypin> oh damn, right
<oprypin> `commit: f55992da080f3ca1a4e02d0b96ce3e61fadd0471`
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5eb0640422f9c45c2a6c488e]
<FromGitter> <Blacksmoke16> as a heads up ^
<oprypin> Blacksmoke16, i dont understand
<FromGitter> <Uzay-G> ok thanks
<FromGitter> <Blacksmoke16> i asked maintainer about it. apparently there is a branch for 0.34.0 support that'll be released soonish
<FromGitter> <Uzay-G> alright. And then I should just need to run `shards install` right? It doesnt seem to update the lib. Sorry but I am very much a beginner with crystal but I'm excited
<FromGitter> <Blacksmoke16> try `shards update`
<FromGitter> <Uzay-G> still the same error.
<FromGitter> <Uzay-G> These are my dependencies:
<FromGitter> <Uzay-G> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5eb0655114b48f0698ac1bc4]
<FromGitter> <Blacksmoke16> i think its a bug with shards, i tested on master and it works. for now just rm -rf lib and shard.lock and run `shards install`
<FromGitter> <Blacksmoke16> ran into this when using `branch: xx`
<FromGitter> <Uzay-G> oh ok thx
<FromGitter> <Uzay-G> that fixed that problem :). Now I have many others probably related to just fetching the last commit :0
<FromGitter> <Blacksmoke16> hehe gl
<FromGitter> <Uzay-G> yeah
<FromGitter> <Uzay-G> I might just do not use the wrapper
<FromGitter> <Blacksmoke16> :/
<FromGitter> <Uzay-G> alright I fixed it :)
<FromGitter> <Blacksmoke16> that was quick
<FromGitter> <Uzay-G> I found the `cr-0.34` branch and just used that one
<FromGitter> <Blacksmoke16> cool
lanodan has quit [Ping timeout: 256 seconds]
lanodan has joined #crystal-lang
<FromGitter> <kingsleyh> evening: how do I convert this javascript to crystal: `1 + 0x80000000 == 2147483649`
<FromGitter> <watzon> @kingsleyh `1_u64 + 0x80000000`
<FromGitter> <watzon> The left side argument is being incremented, so it has to fit into the final size
<FromGitter> <kingsleyh> thanks :)
<FromGitter> <kingsleyh> @watzon I've got a ` seed = Slice(UInt8).new(37)`how can I put`1 + 0x80000000` on the end of it?
<FromGitter> <watzon> @Blacksmoke16 does granite have a "create or update" type query?
<FromGitter> <Blacksmoke16> mmm
<FromGitter> <kingsleyh> @watzon see here
<FromGitter> <kingsleyh> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5eb078427a24ff01b0ffcfa5]
<FromGitter> <watzon> @kingsleyh well the number you're trying to add would be a UInt64, so you'd probably have to do something with `IO::ByteFormat`
<FromGitter> <watzon> Let me see if I can figure it out
<FromGitter> <Blacksmoke16> @watzon how would that work?
<FromGitter> <Blacksmoke16> logic to determine if a record is new or not if is if it has a PK and some ivar was updated to `true`
_ht has quit [Remote host closed the connection]
<jhass> kingsleyh: Maybe using an IO::Memory will be easier. It has #write_bytes and #to_slice
<FromGitter> <watzon> Well it would have to require the pk be included in the query. Something like `User.upsert(id: 123456, name: "Joe")`
_ht has joined #crystal-lang
<FromGitter> <watzon> So if a user with the id 123456 exists it would be updated, otherwise it would be created
<jhass> and if you .new it up with the final size and won't even need to realloc
<FromGitter> <watzon> Yeah `IO::Memory` would probably be the way to go
<FromGitter> <Blacksmoke16> @watzon i dont think so, but it would be pretty easy to add i think?
<FromGitter> <Blacksmoke16> assuming the `id` you actually provide should be the one created if using auto PK
<FromGitter> <Blacksmoke16> shouldnt*
<FromGitter> <watzon> I feel like it should be. It would be pretty helpful for my current use case.
<FromGitter> <kingsleyh> @watzon but how do I `1 + 0x80000000` for IO::Memory - it want's bytes not an UInt64
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5eb07a205cd4fe50a3ec8735]
<FromGitter> <Blacksmoke16> something like that?
<FromGitter> <watzon> @kingsleyh basically you need something like this https://carc.in/#/r/90bp
<FromGitter> <watzon> Of course the code will depend on the endianness you want
<FromGitter> <watzon> @gla
<jhass> possibly not even needing the .pos
<FromGitter> <watzon> @Blacksmoke16 seems about right to me. Would `find_by` args try to find with all the args though? Or just ones that are private keys?
<jhass> given the stuff you write before
<FromGitter> <watzon> Yeah probably not
<FromGitter> <Blacksmoke16> it would AND together all them
<FromGitter> <kingsleyh> @watzon hmm it's not putting stuff in the right order so maybe I do need pos
<FromGitter> <kingsleyh> oh no its ok - I used write_bytes for a single byte and it expanded it more than I though
<FromGitter> <kingsleyh> I should have used write_byte singular for that one
<FromGitter> <watzon> I just realized, I don't think you have enough space. The data you're trying to put on the end takes up 8 bytes, but after your `copy_from` operation you only have 5 bytes left over as far as I can tell
<FromGitter> <watzon> Ahh ok haha, well if you got it working that's great
<FromGitter> <kingsleyh> well I don't have it working yet lol
<jhass> that's the downside of IO::Memory, it'll silently regrow to make space
<FromGitter> <kingsleyh> it's so easy in javascript compared to Crystal hah: https://github.com/alepop/ed25519-hd-key/blob/master/src/index.ts#L34
<FromGitter> <watzon> @Blacksmoke16 so in the ideal situation I feel like it should just be upserting based on the pk. Using `find_by` will attempt to find a record using all the args, right? So unless a record matches exactly it is only ever going to attempt to create a new record.
<FromGitter> <Blacksmoke16> ah true
<FromGitter> <watzon> And if it does match exactly that kinda defeats the purpose of updating
<FromGitter> <Blacksmoke16> i think there is a method to get the pk value
<FromGitter> <watzon> If there is that would be awesome
<FromGitter> <Blacksmoke16> could make it where the first arg is the pk to lookup, then you can drop that into a `find`
<FromGitter> <watzon> For now I guess I'll just check if the record exists and handle the logic myself
<FromGitter> <Blacksmoke16> `upsert(100, name: "Jim")`
ua_ is now known as ua
<FromGitter> <watzon> > could make it where the first arg is the pk to lookup, then you can drop that into a `find` ⏎ ⏎ That would work as welll
<FromGitter> <Blacksmoke16> same logic but replace `find_by` with `find`
<FromGitter> <Blacksmoke16> then assume rest of args are the things to update/create with
<FromGitter> <Blacksmoke16> would also require all required args to be included in that tho
<FromGitter> <kingsleyh> @watzon the `1_i64 + 0x80000000` is not working - the js result is: `002b4be7f19ee27bbf30c667b642d5f4aa69fd169872f8fc3059c08ebae2eb19e780000001` but I'm getting `002b4be7f19ee27bbf30c667b642d5f4aa69fd169872f8fc3059c08ebae2eb19e70100008000000000`
<FromGitter> <watzon> Oh so you're just trying to add `80000001` to the end?
<FromGitter> <kingsleyh> the first number changes: e.g. 1 can be any number then you add it to the 0x80000000. and put it on the end of the array
<FromGitter> <kingsleyh> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5eb07e5ba9de3d01b1ea2be5]
<FromGitter> <kingsleyh> in javascript it's like this: https://github.com/alepop/ed25519-hd-key/blob/master/src/index.ts#L83
<FromGitter> <kingsleyh> and in Dart it's like this: https://github.com/alepop/dart-ed25519-hd-key/blob/master/lib/src/base.dart#L68
<FromGitter> <kingsleyh> but in Crystal there must be more hoops to jump through
<FromGitter> <didactic-drunk> How do I use an empty lambda in a type alias? ⏎ `````` [https://gitter.im/crystal-lang/crystal?at=5eb07efa0b23797ec060a2de]
<FromGitter> <Blacksmoke16> prob easier to do `Proc(Nil)`
<FromGitter> <kingsleyh> @watzon this seems more like it ` io.write_bytes(1_u32 + 0x80000000)`
<FromGitter> <kingsleyh> but still not correct
<FromGitter> <didactic-drunk> @Blacksmoke16 👍
<FromGitter> <watzon> @kingsleyh https://carc.in/#/r/90c8
<FromGitter> <watzon> There you go
<FromGitter> <watzon> Guess it was a uint32
<FromGitter> <kingsleyh> ah yes
<FromGitter> <kingsleyh> thanks
<FromGitter> <didactic-drunk> Do you know if the alias problem is a known/unknown bug?
<FromGitter> <Blacksmoke16> could try it with https://github.com/crystal-lang/crystal/pull/9208
<FromGitter> <Blacksmoke16> not sure if related or not tho
<FromGitter> <watzon> Ahh Granite is still using "logger" and it's throwing warnings at me haha
<FromGitter> <Blacksmoke16> is a PR to fix it ^.^
<FromGitter> <watzon> Yay haha. Any way to silence them in the mean time?
<FromGitter> <Blacksmoke16> `--warnings none`
_ht has quit [Quit: _ht]
<FromGitter> <Blacksmoke16> should https://crystal-lang.org/api/master/XML/Builder.html#cdata(text:String):Nil-instance-method handle escaping closing tags within the string?
<FromGitter> <Uzay-G> man I am going crazy trying to set this up: https://clear.gitbook.io/project/introduction/installation
<FromGitter> <Uzay-G> could anyone help me with info on how I need to setup postgres?
<FromGitter> <Uzay-G> Thank you so much for your kind help
<FromGitter> <Blacksmoke16> are you getting an error?
<FromGitter> <Uzay-G> yeah my connection is refused
<FromGitter> <Uzay-G> I think the way i setup my connection is wrong:
<FromGitter> <Blacksmoke16> is the db running?
<FromGitter> <Uzay-G> `Clear::SQL.init("postgres://uzay@localhost/onyx", connection_pool_size: 5) ⏎ `
<FromGitter> <Uzay-G> yeah
<FromGitter> <Uzay-G> but I just get connection refused
<FromGitter> <Blacksmoke16> anything in the db logs?
<FromGitter> <Blacksmoke16> make sure pw, username, etc is correct
<FromGitter> <Uzay-G> maybe i need to specify port?
<FromGitter> <Blacksmoke16> maybe? id imagine it would be using the default tho
<FromGitter> <Uzay-G> i have a user postgres with db onyx
<FromGitter> <Uzay-G> so I am trying: `Clear::SQL.init("postgres://postgres@localhost/onyx", connection_pool_size: 5)`
<FromGitter> <Uzay-G> weird: `You are connected to database "onyx" as user "postgres" via socket in "/var/run/postgresql" at port "5432".`
Stephie has quit [Quit: Fuck this shit, I'm out!]
Vexatos has quit [Quit: ZNC Quit]
Stephie has joined #crystal-lang
<FromGitter> <z64> has there been any discussion about backtraces with `Log.err(exception: ex)`? ⏎ they're often invaluable in helping with user reported errors of our app and at the moment I just end up adding `Log.error { ex.inspect_with_backtrace }` after every `Log.err` call
<FromGitter> <Blacksmoke16> wouldnt that be better suited to the formatter?
<FromGitter> <Blacksmoke16> or backend
<FromGitter> <Blacksmoke16> as you have it within the entry
<FromGitter> <Blacksmoke16> @Uzay-G are you doing anything other than trying to connect? could be failing on some query?
Vexatos has joined #crystal-lang
<FromGitter> <z64> that is what i am asking. will I have to customize the formatted or has there been any movement about supporting that in the stock backends? i haven't been following the discussion, been too scattered between prs/issues to keep track of lately
<FromGitter> <Uzay-G> idts @Blacksmoke16 because it says the connection is refused
<FromGitter> <Blacksmoke16> @z64 might be handled with https://github.com/crystal-lang/crystal/pull/9211
<FromGitter> <Blacksmoke16> changes the default format which seems to be using `inspect_with_backtrace(@io)`
<FromGitter> <tenebrousedge> postgres can be a bear to get setup
<FromGitter> <Blacksmoke16> how are you running it? docker?
<FromGitter> <z64> yeah that looks like the ticket to watch then. thanks.
<FromGitter> <Uzay-G> > postgres can be a bear to get setup ⏎ ⏎ yeah
<FromGitter> <Uzay-G> usually i dont spend too much time on setting up db
<FromGitter> <tenebrousedge> have you created a root user and/or a project-specific user?
<FromGitter> <Uzay-G> it's root
<FromGitter> <tenebrousedge> did you assign the appropriate permissions for the db?
<FromGitter> <Uzay-G> like what?
<FromGitter> <tenebrousedge> `grant all`
<FromGitter> <Uzay-G> i will try. Thanks for your help
<FromGitter> <tenebrousedge> can you log into `psql` with those creds and query the db?
v2px__ has joined #crystal-lang