<FromGitter>
<Blacksmoke16> i guess it all boils down to
<FromGitter>
<Blacksmoke16> if you log a colorized `STRING` would you expect to see `[33mSTRING[0m` or `STRING` in a log file
<FromGitter>
<tenebrousedge> can you set a value at initialization for whether the output supports color?
<FromGitter>
<Blacksmoke16> and should there be a way to customize it
<FromGitter>
<tenebrousedge> I would expect the logger to behave like other unix programs, and use colors when directed at an interactive terminal, and to strip them for text output
<FromGitter>
<Blacksmoke16> i think that would be ideal
<FromGitter>
<Blacksmoke16> but gotta think on how to implement that
<FromGitter>
<tenebrousedge> the handler should probably know whether the output supports color
<FromGitter>
<Blacksmoke16> heres another question, would it be ok that it would have to be handled in every handler?
<FromGitter>
<Blacksmoke16> or suppose it could be a comon on the parent formatter type, of which each handler could do something like
<FromGitter>
<Blacksmoke16> with it defaulted to false?
<FromGitter>
<Blacksmoke16> then its decoupled from the handler, albeit a bit more verbose
<FromGitter>
<tenebrousedge> I would expect the handler to have something like a `supports_color?` property, or perhaps an `ansi?` one, and that this would default to `false`
<FromGitter>
<tenebrousedge> presumably this would be passed or detected at initialization
<FromGitter>
<tenebrousedge> I don't know how it can be detected, I just know that it can be done
<FromGitter>
<Blacksmoke16> then if it doesnt support color, strip them out
<FromGitter>
<Blacksmoke16> just seems more like something a formatter should do
<FromGitter>
<Blacksmoke16> oo heres an idea
<FromGitter>
<Blacksmoke16> make it part of the abstract formatter type, but enabled on the handler level
<FromGitter>
<Blacksmoke16> which internally sets it on that handler's formatter instance
<FromGitter>
<Blacksmoke16> bit better UX you think?
hypercore has quit [Ping timeout: 260 seconds]
hypercore has joined #crystal-lang
alex``` has quit [Ping timeout: 250 seconds]
<FromGitter>
<tenebrousedge> that looks good to me
<FromGitter>
<sam0x17> ugg still getting this error in lambda (crystal app compiled via static alpine image) only and not locally whenever I hit an https link with `HTTP:Client`: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5da7bf4adbf676673471f912]
<FromGitter>
<sam0x17> I'm assuming I need to give crystal access to ca certificates somehow
<FromGitter>
<tenebrousedge> probs
<FromGitter>
<sam0x17> somehow :(
<FromGitter>
<sam0x17> hopefully crystal has an option somewhere where I can specify a cacerts bundle file like curl has
<FromGitter>
<sam0x17> googling is just finding a bunch of crystal reports crap of course
<FromGitter>
<ImAHopelessDev_gitlab> can someone please explain to me consts in a way so i can understand.
<FromGitter>
<tenebrousedge> constants are used for values that shouldn't change over the execution of the program. They're usually a good substitute for a global reference to something
<FromGitter>
<tenebrousedge> classes are technically constants, I think
<FromGitter>
<tenebrousedge> constants must exist at compile time
<FromGitter>
<tenebrousedge> I'm told that constants that are values (`A = 5`) are in-lined at compile time
<FromGitter>
<tenebrousedge> now if you're talking about JS consts
<FromGitter>
<tenebrousedge> that's a different story
<FromGitter>
<sam0x17> the reason they aren't always inlined is things like `MY_COOL_CONSTANT = Set.new{1, 2, 3}`
<FromGitter>
<ImAHopelessDev_gitlab> i just don't understand when i see them used in parameters, not so much in crystal, but for example, in godot `int get_available_bytes() const`, which i don't get cause the byte amount is so different depending on what's on the socket, so does it become a "constant" that doesn't change
<FromGitter>
<sam0x17> oh that's different
<FromGitter>
<sam0x17> what language is that?
chemist69 has quit [Ping timeout: 250 seconds]
<FromGitter>
<tenebrousedge> c++ I think
<FromGitter>
<ImAHopelessDev_gitlab> gdscript, however, i see it in c++ as well. i think i can understand constants in crystal, because of what @tenebrousedge said really resonated with how i thought about them. but then @tenebrousedge mentioned "JS consts, that's a diff story". which I assume..
<FromGitter>
<ImAHopelessDev_gitlab> const has diff meanings in diff languages??
<FromGitter>
<sam0x17> because in javascript they aren't really constants
<FromGitter>
<sam0x17> you can do stuff to override it and still change the value
<FromGitter>
<tenebrousedge> and most of what I said about the compiler doesn't apply
<FromGitter>
<sam0x17> constants in interpreted (rather than compiled) languages are usually "fake" because there aren't compiler optimizations in place to take advantage of the fact that they are constants -- they are usually just variables with some special syntax
<FromGitter>
<tenebrousedge> except in TypeScript, and we're not talking about TypeScript
<FromGitter>
<sam0x17> if I do `const MY_NUM = 7;` in javacript, it creates a variable named `MY_NUM` and loads the value `7` into it when you run that line of the script. If I do the same in crystal, `MY_NUM = 7`, that will get built into the program itself so the memory address for the variable `MY_NUM` will be pre-programmed to contain `7` when the program loads
<FromGitter>
<ImAHopelessDev_gitlab> > A "const function", denoted with the keyword const after a function declaration, makes it a compiler error for this class function to change a member variable of the class.
<FromGitter>
<sam0x17> its a weird C++ism essentially
<FromGitter>
<ImAHopelessDev_gitlab> So.. this const is NOT the same as a Crystal const
<FromGitter>
<sam0x17> exactly
<FromGitter>
<ImAHopelessDev_gitlab> My gosh that really threw me off
<FromGitter>
<tenebrousedge> but c++ does have constants
<FromGitter>
<sam0x17> yes
<FromGitter>
<sam0x17> this thing is closer to in rust how things can be mutable or not mutable
<FromGitter>
<sam0x17> on a method level
<FromGitter>
<ImAHopelessDev_gitlab> > you are promising that the original variable (inside the function frame) will not be modified. And again, because you’re returning it by value, it’s copied so the original value could never be modified via the return value.
<FromGitter>
<ImAHopelessDev_gitlab> Basically, in the get_available_bytes function, that const is making sure that bytes is NEVER modified
<FromGitter>
<tenebrousedge> yes
<FromGitter>
<ImAHopelessDev_gitlab> Awww O_o
<FromGitter>
<ImAHopelessDev_gitlab> COOL
<FromGitter>
<tenebrousedge> or any other variable part of that class
<FromGitter>
<ImAHopelessDev_gitlab> That makes sense, cause those bytes read are the data, it shouldn't be touched
<FromGitter>
<sdogruyol> More interaction = more people into Crystal
blassin has quit [Ping timeout: 240 seconds]
blassin has joined #crystal-lang
absolutejam has joined #crystal-lang
context has joined #crystal-lang
<FromGitter>
<zacheryph> question, why do all the web frameworks appear to treat crystal like its a scripting language
<FromGitter>
<zacheryph> ie, why do all of them have deployment instructions of `install crystal, put code on server, pull deps, run tasks/compile`
<FromGitter>
<zacheryph> vs using one of crystals selling points of `compile, copy binary to server, execute with config file/env vars`
<FromGitter>
<absolutejam_gitlab> I think it's just the most understandable/portable workflow
<FromGitter>
<absolutejam_gitlab> A bit daunting to say create a docker image, push to a private registry, template values from consul, create a Kubernetes deployment...
<FromGitter>
<absolutejam_gitlab> That was a bit of an exaggerated example...
<FromGitter>
<zacheryph> thats a bit overboard ;)
<FromGitter>
<absolutejam_gitlab> But I agree, there should be more emphasis on statically compiling and 'here is your binary'
<FromGitter>
<absolutejam_gitlab> This aint PHP
<FromGitter>
<absolutejam_gitlab> we aint ftping
return0e has quit [Ping timeout: 265 seconds]
return0e has joined #crystal-lang
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
<FromGitter>
<sdogruyol> @zacheryph @absolutejam_gitlab we're getting there :)
<FromGitter>
<sdogruyol> Currently statically compiling is not so hassle-free as in Go or Rust
<FromGitter>
<sdogruyol> That's why we're not emphasizing it too much
absolutejam has quit [Read error: Connection reset by peer]
absolutejam has joined #crystal-lang
<FromGitter>
<zacheryph> ahh gotcha
<FromGitter>
<absolutejam_gitlab> Go's is so hassle-free because the stdlin is all written in Go, right?
<FromGitter>
<absolutejam_gitlab> I dunno why I always write stdlin
asterite has quit [Quit: Bye]
asterite has joined #crystal-lang
<FromGitter>
<zacheryph> @sdogruyol can i ask whats *not* hassle free or is it documented somewhere
<FromGitter>
<ImAHopelessDev_gitlab> GOOD LORD JSON::Serializable is amazing
<FromGitter>
<ImAHopelessDev_gitlab> just mapped my entire LEVEL DATA structure baby let's get it
<FromGitter>
<mavu> @zacheryph I have been wondering about the same thing. Docker here, static compile there. Its all coping mechanisms for dealing with the fragmentation of platforms. Theoretically I would prefer to have a OS'native' package for things. for example make a debian packge of your Crystal software and deploy that. ⏎ But that leaves arch users, build a package for them , then comes fedora, macos, gentooo, etc. ⏎
<FromGitter>
... Appimage is an option with a bit more easy portability.
<FromGitter>
<absolutejam_gitlab> I'd always opt for Docker
<FromGitter>
<mavu> maybe snap. I think Docker is way overused for jobs that would be better served with a different mechanism
<FromGitter>
<absolutejam_gitlab> Why the fuck is there no :shrug: emoji in Gitter
<FromGitter>
<absolutejam_gitlab> Docker alpine is fine for static compilation though
<FromGitter>
<mavu> But in the end, it doesn't matter. I build debian packages because thats my target and my system.
<FromGitter>
<mavu> others find docker easier (the nutters. :P)
<FromGitter>
<absolutejam_gitlab> I mean, I see merit in the likes of Snap, AppImage, flatpak, etc.
<FromGitter>
<absolutejam_gitlab> But they're just as fragmented at times
<FromGitter>
<absolutejam_gitlab> Docker/OCI format is what I live and breath though, so I'm comfortable with it
sagax has quit [Ping timeout: 245 seconds]
<FromGitter>
<mavu> I tried docker for a while, but I came to the conclusion that Docker and me just don't speak the same language. ⏎ Docker commands kept not doing what I was expecting, and things in Docker-land were not called what I would have called them etc. ⏎ That in the end was just too tedious. ⏎ But thats a matter of taste as much as anything. [https://gitter.im/crystal-lang/crystal?at=5da83c7e4afd703a4ef5d1e0]
blassin6 has joined #crystal-lang
blassin has quit [Ping timeout: 250 seconds]
absolutejam has quit [Ping timeout: 265 seconds]
absolutejam has joined #crystal-lang
sagax has joined #crystal-lang
alex``` has joined #crystal-lang
_whitelogger has joined #crystal-lang
EvilKhaosKat has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
EvilKhaosKat has quit []
EvilKhaosKat has joined #crystal-lang
<FromGitter>
<sdogruyol> @zacheryph about static compilation..guess there's not :P
absolutejam has quit [Ping timeout: 240 seconds]
fifr[m] has joined #crystal-lang
fifr[m] has left #crystal-lang ["User left"]
absolutejam has joined #crystal-lang
fifr[m] has joined #crystal-lang
dwdv_ has quit [Quit: quit]
<FromGitter>
<zacheryph> no issue or no document? ;)
<FromGitter>
<zacheryph> @mavu yeah but there should be no reason you cannot compile and build each package, you shouldn't need to compile for each target
<FromGitter>
<zacheryph> i mean... barring major glibc version discrepencies
<FromGitter>
<straight-shoota> @zacheryph Regarding the original question about deployment lifecycle: I guess that at least part of this workflow is encouraged by continuous integration paradigm. When you constantly rebuild the software it's simply easier to merge build and deploy stages together. It's a matter of economics: How often do you deploy vs. how often do you build. If you don't deploy the same builds often enough, the
<FromGitter>
... complexity of separation is not worth it.
EvilKhaosKat has quit [Remote host closed the connection]
<FromGitter>
<zacheryph> yeah but you are still avoiding simplicity. `clone this big repo, download crystal, download dependencies, build` vs ... `download this binary`
<FromGitter>
<straight-shoota> Static building is nice, but I don't think it's the most important thing in the world. You can as easily build a dynamically-linked binary with gnu, and use the package manger to install the necessary binaries. Done. It can save a lot of effort, because besides glibc, there are also other libraries that have problems with static linking. If you control the build and deploy environments, there is no
<FromGitter>
... strong reason to use static linking at all. Dynamic works just the same. ⏎ Static linking shines when you distribute a binary without control of it's execution environment. Then users don't need to hassle with installing libraries.
<FromGitter>
<zacheryph> so i really dont care a huge deal if its static/dynamic, my question was contexted in the frame of the web frameworks available today. none of them really are designed to produce usable/distributable binary artifacts in the end
<FromGitter>
<Blacksmoke16> kemal/athena dont have any external deps
<FromGitter>
<Blacksmoke16> i'm sure there are others as well
<FromGitter>
<straight-shoota> Yeah, I figured as much and wanted to clarify, because static linking came up in the discussion.
<FromGitter>
<zacheryph> ill have to download and play a little but at least what ive seen the example/docs/deployment always shows the basic clone/build
<FromGitter>
<straight-shoota> `download this binary`: where do you download it from? This requires to setup and maintain an extra build stage and distribution channel.
<FromGitter>
<zacheryph> depending on your project... your laptop, any of the free CI out there, internally your.. intenral CI
<FromGitter>
<zacheryph> distribution channel, the `releases` tab of your github project
<FromGitter>
<zacheryph> i was just wondering why it seems like the ability to distribute via single binary is avoided in the web frameworks
<FromGitter>
<Blacksmoke16> im assuming you mean like, i install crystal, dev a webapp/api, then want to deploy that webapp/api as a single binary?
<FromGitter>
<Blacksmoke16> w/o installing crystal on the server
<FromGitter>
<straight-shoota> For frameworks it doesn't make any sense to distribute a binary, because they're just frameworks. They're only distributed as source code to build you webapp upon it. Then you build that app and deploy it.
<FromGitter>
<Blacksmoke16> ^
<FromGitter>
<absolutejam_gitlab> yeah, they don't work like something like hugo
<FromGitter>
<zacheryph> ... i mean the project you are writing WITH the framework
<FromGitter>
<absolutejam_gitlab> which you run and it spits out your artifacts
<FromGitter>
<zacheryph> ie; i write an app in amber, or amethyst (defunct?) or lucky
<FromGitter>
<zacheryph> and distribute my app in a binary
<FromGitter>
<absolutejam_gitlab> But you mean the instructions should tell you how to an app and create a binary to be distributed
<FromGitter>
<Blacksmoke16> cant speak for those 2, but its deff possible
<FromGitter>
<absolutejam_gitlab> I think clarification of the build and deploy steps perhaps
<FromGitter>
<absolutejam_gitlab> I definitely think there's merit to what you're saying @zacheryph
<FromGitter>
<zacheryph> possible yeah, none of them seem to show that or judging from the docs, doesnt seem like it would be easy
<FromGitter>
<absolutejam_gitlab> Like Phoenix provides how to do it in their docs
<FromGitter>
<absolutejam_gitlab> there's docs for developing which uses all the auto-reloading magic
<FromGitter>
<absolutejam_gitlab> or how to create an erlang release package for production deployment
<FromGitter>
<Blacksmoke16> i know its possible for kemal, athena, and other can
<FromGitter>
<absolutejam_gitlab> perhaps it's an opportunity to help with those project's docs
<FromGitter>
<Blacksmoke16> depends how the framework sets things up i guess :shrug:
<FromGitter>
<zacheryph> @Blacksmoke16 thnx ill check them out
<FromGitter>
<straight-shoota> I guess currently there aren't many Crystal webapps available that have reached a point of maturity where you'd distribute binaries :D
<FromGitter>
<Blacksmoke16> either that or most come from a more rails way of doing things?
absolutejam has quit [Ping timeout: 240 seconds]
<FromGitter>
<Blacksmoke16> also i think amber/lucky have dependencies on like node?
<FromGitter>
<abnersajr> One question about `JSON::Serializable`. How is the correct way to serialize an object value from a key? ⏎ Is it a `NamedTuple` or Creating new classes like in the question that I've made?
<FromGitter>
<Blacksmoke16> was just replying to that thread
<FromGitter>
<Blacksmoke16> you can do `def on_to_json(json : JSON::Builder)`
<FromGitter>
<Blacksmoke16> which gets called after the obj is done being serialized, i.e. you could do `builder.field "count", @entires.uniq.size`
<FromGitter>
<Blacksmoke16> which would add that on
<FromGitter>
<Blacksmoke16> > How is the correct way to serialize an object value from a key? ⏎ ⏎ Do you mean based on the value of a key serialize the correct class?
<FromGitter>
<Blacksmoke16> like `{"type": "dog"}` etc?
<FromGitter>
<abnersajr> I did: `API::Search` `API::Serializer::Search`. Then on the initialize of `API::Search` I pass the Serializer on the `initialize`
<FromGitter>
<Blacksmoke16> how do you have it setup exactly? like `load data from db => use those to new up serializer classes => render the json in the api response`?
<FromGitter>
<Blacksmoke16> obs the objects are going to be empty since they have no values but you get the idea
<FromGitter>
<wontruefree> @straight-shoota I dont know if you have time but I dont understand why that is failing. And I cannot reproduce it. Do you know what is going on?
<FromGitter>
<abnersajr> @Blacksmoke16 this is supposed to work API::Entries.from_json(%({"name": "Abner", "date": 0}))
<FromGitter>
<bew> @abnersajr this should work already isn't it?
<FromGitter>
<kinxer> @abnersajr Why are you trying to deserialize json instead of just having default instances?
<FromGitter>
<abnersajr> the only difference is that I don't have the new method
<FromGitter>
<Blacksmoke16> just define one?
<FromGitter>
<Blacksmoke16> since both properties on `DelveDepth` have defaults you just have to add `def initialize; end` then can do `DelveDepth.new`
<FromGitter>
<abnersajr> But this one in my project is working
<FromGitter>
<abnersajr> @kinxer this don't work on the playground at least with 0.31.1
<FromGitter>
<bew> @bcardiff the new install pages are pretty!! Just a note, on the archlinux install page (I only looked at that one) https://crystal-lang.org/install/on_arch_linux/ it looks like the Snapcraft install section is mandatory to have crystal.. I think it would be better to say `Install using pacman` for normal install, and `Install using snapcraft` for the snapcraft install, wdyt?
<FromGitter>
<Blacksmoke16> snap should have its own section
<FromGitter>
<Blacksmoke16> it can be used to install crystal on most of those OS
<FromGitter>
<straight-shoota> @wontruefree Sorry no idea. Seems to be totally unrelated
<FromGitter>
<straight-shoota> I can give you ssh access if that would help to figure this out on the CI machine
<FromGitter>
<marynowac> @bew will/crystal-pg
<FromGitter>
<bcardiff> @Blacksmoke16 @bew thanks for the feedback. The intention is for the user to pick the distro that is been used and list there the available options. Some distros users might not know the existante of snapcraft for example and that might be the only option currently. ⏎ ⏎ Changes the phrase and sections for better clarification is definitely double. ⏎ ⏎ We can iterate in the forum & crystal-website
<FromGitter>
<Blacksmoke16> is first bit of the trace if you wanted to include that
<FromGitter>
<Blacksmoke16> like how to structure your comments on methods and stuff?
<FromGitter>
<absolutejam_gitlab> Yeah
<FromGitter>
<Blacksmoke16> not that i know of, is up to each shard
<FromGitter>
<absolutejam_gitlab> The likes of Python and PHP have standardised comments
<FromGitter>
<absolutejam_gitlab> documenting parameter types etc.
<FromGitter>
<Blacksmoke16> crystal handles that for you tho
<FromGitter>
<absolutejam_gitlab> while types aren't necessary for Crystal, it'd be nice to have a standard format for supplying context
<FromGitter>
<absolutejam_gitlab> Or return types, or what exceptions are raised
<FromGitter>
<Blacksmoke16> also handles that
<FromGitter>
<absolutejam_gitlab> types was the worst example I could have started with
<FromGitter>
<Blacksmoke16> the former at least
<FromGitter>
<Blacksmoke16> :P
<FromGitter>
<Blacksmoke16> was thinking of a like `RAISES: ArgumentError When *other* is less than 0`
<FromGitter>
<Blacksmoke16> could be handy
<FromGitter>
<Blacksmoke16> `Foo.Bar.baz/2` whats this do?
<FromGitter>
<Blacksmoke16> what is `2`?
<FromGitter>
<absolutejam_gitlab> In Elixir, you refer to the function definition by its arity
<FromGitter>
<absolutejam_gitlab> `Foo.Bar.baz/0` and `Foo.Bar.baz/1` are distinct
<FromGitter>
<Blacksmoke16> ah so to link to a specific overload?
<FromGitter>
<absolutejam_gitlab> Yeah
<FromGitter>
<Blacksmoke16> gotcha
<FromGitter>
<Blacksmoke16> id clarify that in your comment
<FromGitter>
<absolutejam_gitlab> and you can actually have multiple variants of `/1` because of guard clauses
<FromGitter>
<absolutejam_gitlab> eg `def foo(items) when is_list(items) do`
<FromGitter>
<naqvis> how can we pass `Pointer(Pointer(UInt8))` to C code from crystal? I'm working on crystal binding and in C there is `[in,out]` param and i'm passing `Slice#to_unsafe`, but i'm getting error `must pass Pointer(Pointer(UInt8)), not Pointer(UInt8)`, i found that doing `pointerof` on `unsafe` is not working.
<FromGitter>
<kinxer> I've never opened an issue before... Well, here goes.
<FromGitter>
<bew> @absolutejam_gitlab how do you refer to each variant then?
<FromGitter>
<absolutejam_gitlab> You can't in that case
<FromGitter>
<absolutejam_gitlab> That's the only shortcoming
<FromGitter>
<bew> i see
<FromGitter>
<Blacksmoke16> `Pointer(UInt8)*`?
<FromGitter>
<naqvis> thanks @Blacksmoke16 , let me check that
<FromGitter>
<Blacksmoke16> er no
<FromGitter>
<Blacksmoke16> that would be the type, but not how to do it
<FromGitter>
<bew> can you link to a documentation @naqvis ?
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter>
<naqvis> in C it is `next_out : Uint8T**`
<FromGitter>
<bew> and your crystal type is what?
<FromGitter>
<naqvis> crystal type is `Slice`
<FromGitter>
<bew> ah i see
<FromGitter>
<bew> make a var of the to_unsafe, then do a pointerof on it
<FromGitter>
<marynowac> @bew @Blacksmoke16 ⏎ i use standard shard from will/crystal-pg
EvilKhaosKat has joined #crystal-lang
<FromGitter>
<bew> @marynowac I don't know enough of pg nor crystal-pg to give proper help here, I'd suggest to wait some time for someone who can help you better, then if no one comes, post an issue on crystal-pg repo
EvilKhaosKat has quit [Quit: Leaving]
lvmbdv has joined #crystal-lang
EvilKhaosKat has joined #crystal-lang
<FromGitter>
<kinxer> @Blacksmoke16 It was already reported... Ah, well. Maybe one day I'll make a useful contribution to Crystal.
EvilKhaosKat has quit [Quit: This computer has gone to sleep]
<FromGitter>
<Blacksmoke16> :p
<FromGitter>
<straight-shoota> @marynowac what's your issue?
<FromGitter>
<marynowac> @straight-shoota i cannot connect to pg database. got an exception "(DB::ConnectionRefused), caused by: *Cleartext auth* is not supported"
<FromGitter>
<ImAHopelessDev_gitlab> @marynowac is basically trying to connect to his postgres db using ⏎ ⏎ ```DB.open "postgres://myuser:mypasswd@remoteserver/mydb" do |db| ⏎ # code ⏎ end``` ⏎ ⏎ He receives an exception: ... [https://gitter.im/crystal-lang/crystal?at=5da8c50fdbf6766734793983]
<FromGitter>
<marynowac> that's not my postgres. i have no power to change config there :-[
<FromGitter>
<Blacksmoke16> did you try the other form of auth?
<FromGitter>
<Blacksmoke16> it might support that but not cleartext
<FromGitter>
<marynowac> how to force other form of auth using crystal?
<FromGitter>
<straight-shoota> It's just as it says. `crystal-pg` doesn't support cleartext password authentication.
<FromGitter>
<absolutejam_gitlab> can you re-open a class and add it yourself?
<FromGitter>
<straight-shoota> There is no config for this. It's not implemented and that seems to be on purpose.
<FromGitter>
<marynowac> so what can i do to get access to that database? change to php/python?
<FromGitter>
<absolutejam_gitlab> Do you really wanna send cleartext credentials?
<FromGitter>
<Blacksmoke16> try using MD5 vs cleartext
<FromGitter>
<Blacksmoke16> i dont have example of how to do that but that might work
<FromGitter>
<marynowac> how to do that?
<FromGitter>
<straight-shoota> @Blacksmoke16 The server asks for cleartext password and the Crystal client can't produce that.
<FromGitter>
<straight-shoota> @absolutejam_gitlab If the connection is encrypted, sending cleartext password should be save actually.
<FromGitter>
<Blacksmoke16> but im pretty sure thats how granite does its specs, wouldnt that also fail?
<FromGitter>
<absolutejam_twitter> Oh makes sense, I didn't think about that 😁
<FromGitter>
<absolutejam_twitter> Man I really wanna play with Amber
alexherbo2 has joined #crystal-lang
<FromGitter>
<straight-shoota> @Blacksmoke16 It really just depends on the server, which authentication method it asks for. It's typically MD5.
<FromGitter>
<Blacksmoke16> ohh i think i see the issue, MD5 and cleartext use the same connection string, but the issue is how those creds are validated on the server
<FromGitter>
<Blacksmoke16> not how you provide them
<FromGitter>
<Blacksmoke16> @marynowac see if the server can be updated to support MD5?
<FromGitter>
<marynowac> i don't have any power to change server cofiguration
<FromGitter>
<straight-shoota> I guess it's just an easier-to-maintain alternative to adding custom patches to upstream libraries.
<FromGitter>
<kinxer> @absolutejam_gitlab Any chance to use the word "crystalline" is great, but I'd still prefer to have a term with a negative connotation. :P
<FromGitter>
<kinxer> @absolutejam_gitlab Also, does Crystal give you a lot of opportunities to be *facet*ious?
<FromGitter>
<ImAHopelessDev_gitlab> looks like the brainf*ck language lol
<FromGitter>
<kinxer> Yeah, it's not the prettiest, but I like Rust from what I've seen of it so far.
<FromGitter>
<bew> ah yes in rust, `&'a` represents the lifetime of the variable `s` iirc
<FromGitter>
<bew> hmm more like `'a` only
<FromGitter>
<kinxer> I think `&` marks it as an immutable reference.
<FromGitter>
<kinxer> Or at least a reference.
<FromGitter>
<bew> yes, and references are immutable by default so yes
<FromGitter>
<ImAHopelessDev_gitlab> looking at this code, i think the concrete truck just arrived. it just delivered 10 gallons of wet concrete and poured it around my feet, solidifying my use for crystal even more
<FromGitter>
<bew> ahah rust is awesome though, it's my next lang to learn when-i-have-time
<FromGitter>
<kinxer> @ImAHopelessDev_gitlab Crystal is much easier to write, but there some definite benefits to using Rust, depending on your application.
<FromGitter>
<kinxer> Yeah, I'm still (slowly) making my way through their intro book, but they won me over with `enums` that can have struct-like values and methods.
<FromGitter>
<bew> yeah they are pretty nices! it's possible to do in crystal but not as easily as in rust
<FromGitter>
<kinxer> It seems like a great language to replace processing-intensive C and C++ with.
<FromGitter>
<kinxer> (Or really *any* C or C++...)
<FromGitter>
<ImAHopelessDev_gitlab> i dabbled in nim-lang. participated on their forums, received good help. they have a good/nice community like crystal.
<FromGitter>
<ImAHopelessDev_gitlab> have not tried rust, but maybe later down the road
<oprypin>
`let mut` 👿
<FromGitter>
<kinxer> @oprypin Lol.
<FromGitter>
<ImAHopelessDev_gitlab> however, i can think of game ideas / implementations of features, and my mind will subconsciously process those ideas out into crystal code. i can't do this with other languages at the moment, so i'm sticking with crystal. going to be using crystal for a long time. there is no turning back
<FromGitter>
<kinxer> @ImAHopelessDev_gitlab As I mentioned, it *is* harder to write than Crystal. I've seen people complaining about wrestling with Crystal's type system, which I don't really experience myself, but I had some serious difficulty trying to wrap my mind around Rust's ownership system when writing up a simple toy genetic algorithm problem.
<FromGitter>
<kinxer> And I'm still trying to understand Traits, which are *kind of* like Crystal's modules. There's no inheritance at all in Rust, though, so you have to do everything with traits, generics, and composition.
<FromGitter>
<ImAHopelessDev_gitlab> Yeah, if you are having difficult, imagine me trying to understand 😆
<FromGitter>
<kinxer> It's just your background. You don't have a formal computer science education (which is, of course, perfectly fine) and you started in PHP, so your ideas about programming have been formed from your programming experiences, which are almost all (I think) in PHP, Crystal, and GDScript.
<FromGitter>
<ImAHopelessDev_gitlab> Yep, and JS! LOL
<FromGitter>
<ImAHopelessDev_gitlab> I've transcended to Crystal, I think I hit peak :)
<FromGitter>
<kinxer> It's definitely much nicer to work with than anything I've worked with previously.
<FromGitter>
<ilanpillemer> Can only classes inherit?
<FromGitter>
<ilanpillemer> There is no peak
<FromGitter>
<ilanpillemer> Beware of the Blub Paradox
<FromGitter>
<ilanpillemer> Go uses structural typing, which is also unusual
<FromGitter>
<ilanpillemer> I tried to use inheritance with structs and its just complaining
<FromGitter>
<ilanpillemer> Yes. Its one of the easiest traps to fall into.
<FromGitter>
<ilanpillemer> when out hunting heffalumps, beware the Blub Paradox.
<FromGitter>
<kinxer> It's right up there with trying to use Markdown custom links with a URL that has closing parentheses in it.
<FromGitter>
<kinxer> My constant bane on Gitter.
<FromGitter>
<ImAHopelessDev_gitlab> @kinxer I actually raged kinda hard when the breaking-changes happened with division operator and stuff. That's when I looked into nim, cause my goodness their syntax is amazing (imo). However, I quickly realized it would take AGES to convert my entire master and game server files over. Plus, I feel like I would betray all the people who played a role in helping me to get to where I'm at with
<FromGitter>
... Crystal. And most importantly, game features and ideas can flow into Crystal code when I want it to, I can't do that with other languages (not as versed). ⏎ ⏎ So I accepted straight-shoota's advice and tucked my tail in and adapted. All I had to do was change `/` to `//` about 50 times across several files, but that's a t ... [https://gitter.im/crystal-lang/crystal?at=5da8e5f2809de9699f570382]
<FromGitter>
<ilanpillemer> 🐰
<FromGitter>
<kinxer> > The entire programming world *doesn't revolve around my codebase and practices*, so I should learn to adapt. That's my take on it anyway.
<FromGitter>
<ilanpillemer> @ImAHopelessDev_gitlab its a online change with sed
<FromGitter>
<ilanpillemer> learn sed and grep
<FromGitter>
<kinxer> ^
<FromGitter>
<kinxer> If you're feeling adventurous, learn `awk`, too. But only if you're feeling adventurous.
<FromGitter>
<ilanpillemer> I learnt about pgrep today
<FromGitter>
<ilanpillemer> so useful
<FromGitter>
<kinxer> I don't use `awk` very often, but I learned it a few weeks ago for a filtering thing I needed at work.
<FromGitter>
<bew> there's pkill too :) @ilanpillemer
<FromGitter>
<kinxer> Oh, that does look useful.
<FromGitter>
<tenebrousedge> `ag` > `grep`
<FromGitter>
<bew> @ImAHopelessDev_gitlab are you really girng? this is really someone else I'm reading, I'm glad you climbed that step :D
<FromGitter>
<kinxer> @ImAHopelessDev_gitlab If you look into any of these things, you'd be using them on WSL (since I think you work on Windows primarily?).
<FromGitter>
<bew> `rg` > `ag` :D
<FromGitter>
<ilanpillemer> is `pkill acme-lip` the same as `kill `pgrep acme-lsp`?
<FromGitter>
<bew> yes
<FromGitter>
<ilanpillemer> nice
<FromGitter>
<ilanpillemer> what does it do if the process does not exist?
<FromGitter>
<bew> nothing, exit with error code 1
<FromGitter>
<tenebrousedge> @bew I don't know if I want my grepper to use `.gitignore`
<FromGitter>
<bew> @ilanpillemer for pgrep and pkill, note that if you have 2 running processes `ab1` and `ab2`, `pgrep ab` will match both and `pkill ab` will kill both
<FromGitter>
<bew> this happened to me a lot of time with hanging ssh sessions, and I do `pkill ssh` and it also kills my `ssh-agent` ><
<FromGitter>
<ilanpillemer> lol
<FromGitter>
<bew> you can use `-x` / `--exact` for an exact match though
<FromGitter>
<bew> _I'm going to make an alias immediatelyç
<FromGitter>
<absolutejam_twitter> Rg is amazingly fast
<FromGitter>
<ilanpillemer> like `wget -c`
<FromGitter>
<absolutejam_twitter> And I spent a day learning awk and it's my go to tool for a lot of things now
<FromGitter>
<ilanpillemer> and `emacs -nw`
<FromGitter>
<absolutejam_twitter> Don't start a holy war
<FromGitter>
<ilanpillemer> emacs and vim are the same thing really.
alexherbo2 has quit [Ping timeout: 240 seconds]
<FromGitter>
<absolutejam_twitter> You going to get hate from both sides now
<FromGitter>
<ilanpillemer> I tried to learn vim, but my emacs muscle memory made it impossible. I use acme mainly now
<FromGitter>
<absolutejam_twitter> Id love to try emacs again but I've become supper accustomed to kakounes modal style that I feel like I'd have to unlearn loads
<FromGitter>
<absolutejam_twitter> And I can't deal with emacs key combos
<FromGitter>
<ilanpillemer> acme is amazing
<FromGitter>
<ilanpillemer> both vim and emacs have need them. And you end up littering your code with stange things and accidently doing incorrect things.
<FromGitter>
<bew> I watched the intro to acme, but it looks like the mouse is used for way too many things
<FromGitter>
<ilanpillemer> you need a 3 button mouse
<FromGitter>
<absolutejam_twitter> I'm happy with Kakoune
<FromGitter>
<ilanpillemer> I use the contour mouse
<FromGitter>
<bew> yeah, touchpad on laptops are no good
<FromGitter>
<absolutejam_twitter> It's hipster but it works really well for what I need
<FromGitter>
<ilanpillemer> yeah then emacs or vim probably is best
<FromGitter>
<ilanpillemer> I guess touchpad works well with menu driven IDEs too
<FromGitter>
<absolutejam_twitter> I'm the opposite, I try and use my mouse as little as possible
<FromGitter>
<ilanpillemer> I have had a strange journey withj acme
<FromGitter>
<absolutejam_twitter> Tmux, kakoune and when I was on Linux, bspsm as my window manager
<FromGitter>
<bew> well now that I'm married to my nvim config, I can't stand having to aim a button with a mouse ^^
<FromGitter>
<ilanpillemer> yeah. I was the same for many years
<FromGitter>
<ilanpillemer> but acme mouse use is different
<FromGitter>
<ilanpillemer> as a game I forced myself to use acme for a month
<FromGitter>
<absolutejam_twitter> I'm genuinely interested in this conversation but just realised I have to be up in 3 hours to do a rabbitmq reboot
<FromGitter>
<bew> arf, script it!
<FromGitter>
<ilanpillemer> then I stopped and went to emacs, then intelliji, then emacs, then visual code, then intellij, then emacs and now acme.
<FromGitter>
<absolutejam_twitter> Not being ignorant
<FromGitter>
<Blacksmoke16> you can sleep when you're dead :S
<FromGitter>
<ilanpillemer> and I tried vim for a week
<FromGitter>
<absolutejam_twitter> Bit more than just a reboot
<FromGitter>
<absolutejam_twitter> I've got 2 kids, if I don't sleep, I will be dead
<FromGitter>
<Blacksmoke16> xD
<FromGitter>
<absolutejam_twitter> Laters
<FromGitter>
<bew> see ya
<FromGitter>
<ilanpillemer> and now emacs only in the terminal as it hangs to much
<FromGitter>
<ilanpillemer> but now that I have learnt how to extend acme. I am sold.
<FromGitter>
<ilanpillemer> why is that pink?
<FromGitter>
<bew> Oo?
<FromGitter>
<ilanpillemer> hmm.. seems it meant that message didnt send.
<FromGitter>
<ilanpillemer> I reloaded and it disappeared.. maybe gitter has an editor war detector and prevents certain messages displaying.
<FromGitter>
<bew> ahahah
<FromGitter>
<bew> let's try it
<FromGitter>
<bew> vim > emacs
<FromGitter>
<bew> nop!
<FromGitter>
<tenebrousedge> spacevim ❤️
<FromGitter>
<ilanpillemer> Emacs > vim
<FromGitter>
<ilanpillemer> seemed to work
<FromGitter>
<bew> neovim > emacs then
<FromGitter>
<ilanpillemer> Is there a better way of writing this
<FromGitter>
<ilanpillemer> am I tired and brain dead or is it wrong?
<FromGitter>
<bew> full program?
<FromGitter>
<ilanpillemer> that is the full program
<FromGitter>
<bew> where d you print the `[` `]` `,` ` `
<FromGitter>
<ilanpillemer> I think I am doing something silly now
<FromGitter>
<ilanpillemer> I dont
<FromGitter>
<ilanpillemer> the x and the y I guess are arrays?
<FromGitter>
<bew> ah
<FromGitter>
<bew> yes
<FromGitter>
<ilanpillemer> I am not doing something right
<FromGitter>
<bew> y is array
<FromGitter>
<bew> yes
<FromGitter>
<bew> it's definitely wrong :P
<FromGitter>
<ilanpillemer> Yes.. so I am not getting an 8 by 8 array. I am getting lots of arrays.. and somehow setting the value to 1 is doing weird things too