<FromGitter>
<watzon> Libgen can't be used on C files huh? Only headers?
<FromGitter>
<watzon> That's unfortunate when I have a library with no header files
<FromGitter>
<tenebrousedge> can you generate the header?
<FromGitter>
<watzon> Just tried using makeheaders, but the output header isn't complete for some reason. Doesn't include `#includes` or other things that are necessary.
<FromGitter>
<sam0x17> is anyone familiar with overriding the default startup message in Kemal? I found https://github.com/kemalcr/kemal/pull/291 however doing `Kemal.run { "custom message" }` does not override the default startup message
<FromGitter>
<Blacksmoke16> so like running your code then this asserts it did what it was supposed to?
<alex```>
yes
<FromGitter>
<Blacksmoke16> hm
<alex```>
crystal impl could be more terse because I don’t have to deal with colored output, count failures, etc.
<FromGitter>
<Blacksmoke16> whats your thing do? that would prob help
<alex```>
it collects directories, then in a loop, cd into it, test if whether the directory hold a valid test (contains stdin, stdout files), then run the test using ./batch < stdin > stdout; if stdout != expectation, it is an error
<FromGitter>
<Blacksmoke16> i mean your actual code that this tets
<FromGitter>
<nsuchy> I work with temporary VMs to debug and write apps to avoid whatever I was last working on from affecting my new app (e.g. broken database/etc configs, env vars, etc), doing all the stuff by hand is a lot of googling each time around, this script takes less than 2 minutes to prepare everything
<FromGitter>
<nsuchy> working on integrations with Hetzner Cloud next
<FromGitter>
<nsuchy> So it can automatically create a virtual machine and ssh you into an environment after the script does the install
lucasb has quit [Quit: Connection closed for inactivity]
<FromGitter>
<sam0x17> @Blacksmoke16 is there a way I could "monkey-patch" that method? I need to replace the "Kemal is ready to lead" part
<FromGitter>
<Blacksmoke16> thats what i said
<FromGitter>
<sam0x17> oh cool didn't know crystal could do that
<FromGitter>
<Blacksmoke16> i mean could just do `arguments = Array(String).from_json(File.read("arguments.json")) + ["--no-confirm", "--editor", %(cp file "${@}")]`?
<FromGitter>
<Blacksmoke16> and drop default/extra args
<FromGitter>
<Blacksmoke16> or even save default args to a const
<FromGitter>
<Blacksmoke16> @vladfaust you have to make sure you define all initializers at the same level, otherwise the initializers of the subclass will override those of the parent.
<FromGitter>
<vladfaust> Well, it's broken. Hope someone would come with a simple solution then
<FromGitter>
<Blacksmoke16> 😬
<FromGitter>
<nsuchy> @vladfaust I don't think there is one, the change makes sense from a technical standpoint, but I'd opt for a warning rather than breaking the constructors
<FromGitter>
<nsuchy> A bunch of stuff is broken right now without a patch
<FromGitter>
<Blacksmoke16> indeed, granite serialization is broken, since apparently it was implemented on the basis of a bug
<FromGitter>
<vladfaust> I'll wait for what granite comes to then
<FromGitter>
<Blacksmoke16> i dont know how to fix it
<FromGitter>
<Blacksmoke16> managed a workaround using the mapping macros, but then something caused invalid memory access
<FromGitter>
<nsuchy> Team at Ulayer is at a loss
<FromGitter>
<nsuchy> (to be fair, we're fairly new to crystal ecosystem)
<FromGitter>
<Blacksmoke16> @vladfaust you know it better than i do, but try defining all your intializers within a like macro included
<FromGitter>
<vladfaust> That's not modular
<FromGitter>
<Blacksmoke16> i mean just to see if that fixes it
<FromGitter>
<Blacksmoke16> as thats what is going on, a level lower defines a diff initializer which overrides the parent
<FromGitter>
<Blacksmoke16> could also just redefine the initializers on the lower level and just call super
<FromGitter>
<Blacksmoke16> that would prob do it as well
<FromGitter>
<vladfaust> But I do need both initializers
<FromGitter>
<vladfaust> Damn
<FromGitter>
<Blacksmoke16> all specs passed after i moved ` include Onyx::SQL::Serializable` to outside the macro included
<FromGitter>
<Blacksmoke16> :shrug:/
<FromGitter>
<vladfaust> Nope, try running db specs
<FromGitter>
<vladfaust> It's a module and module inclusion doesn't include static methods
<FromGitter>
<vladfaust> And `Serializable`'s `macro included` is not run if moving `Serializable` away from `macro included` in `Model`
<FromGitter>
<Blacksmoke16> hmm
<FromGitter>
<vladfaust> I can't make `Serializable` a class or struct, because it would apply constraints. And `Serializable` objects aren't necessarily classes, for example, they could be just non-mutable business objects, ideal for stack memory
<FromGitter>
<vladfaust> I had great composition model and now it's breakingly broken
<FromGitter>
<vladfaust> So Serializable can be a module only. And modules don't allow class methods... But serializable objects must be, um, deserializable, i.e. instantiate-able from some payloads
<FromGitter>
<vladfaust> If I could change Crystal, I'd made class methods included as well. So many times I faced issues with it
<FromGitter>
<watzon> Sameeee
<FromGitter>
<watzon> One of the biggest pains in the ass
<FromGitter>
<Blacksmoke16> @vladfaust move your `def initialize(**values : **T) : self forall T` inside the macro included
<FromGitter>
<Blacksmoke16> wrapped in a `{% verbatim do %}`
<FromGitter>
<Blacksmoke16> and try that, crystal and sqlite passed
<FromGitter>
<watzon> That's what I've had to do anytime I need to include class methods as well
<FromGitter>
<watzon> Can anyone tell me why this is failing? I'm at a loss. https://carc.in/#/r/71ry
<FromGitter>
<vladfaust> You're the hero, @Blacksmoke16. It works!
<FromGitter>
<Blacksmoke16> 👍
<FromGitter>
<vladfaust> You're officially a macro professor
<FromGitter>
<vladfaust> Would try integration tests to see if it works
<FromGitter>
<Blacksmoke16> yea i dont have anything setup
<FromGitter>
<Blacksmoke16> id be interested in seeing if it works when including like json serializable within a model
<FromGitter>
<Blacksmoke16> or if that kills the other initializers
<FromGitter>
<vladfaust> Not my case, though. Onyx::SQL doesn't allow other serializables to be included yet
<FromGitter>
<Blacksmoke16> really?
<FromGitter>
<vladfaust> BTW, the change also works with 0.28.0, no breaking changes then 🎉
<FromGitter>
<vladfaust> @watzon you have `|n|`, which is clearly not `Nil`
<FromGitter>
<vladfaust> `&block : Node ->` maybe
<FromGitter>
<watzon> Whoops, wrong direction
<FromGitter>
<vladfaust> @Blacksmoke16 I'm pleased with the fact that someone actually uses Onyx::SQL on such a low level. I've spent much time on designing and documenting the low-lvl API, and `schema` is just a newbie sweet wrapper :D
<FromGitter>
<Blacksmoke16> like any reason why you cant determine its not nil via the type of the property?
<FromGitter>
<vladfaust> As far as I remember, yes, it doesn't matter. But for most of cases, when you do arbitrary queries which would have absent columns, `schema` defines a nilable property
<FromGitter>
<vladfaust> It's just more natural than `user.name?` and runtime exceptions
<FromGitter>
<Blacksmoke16> no i mean, make it so you dont need the `not_null: true`
<FromGitter>
<Blacksmoke16> if your type if `Int32`
<FromGitter>
<Blacksmoke16> but `Int32?` would be same as `not_null: false`
<FromGitter>
<Blacksmoke16> something like `ivar.type.nilable?`
<FromGitter>
<vladfaust> Ah, sorry, I've misread it. Well, again, an arbitrary query can return an absent column (you just don't `select` it), therefore a value would be `nil`
<FromGitter>
<vladfaust> So it's natural to have nilable types in a model, which doesn't say anything about the DB column
<FromGitter>
<Blacksmoke16> orm we use at work just returns an associative array when you do that, could use a namped tuple in crystal case?
<FromGitter>
<Blacksmoke16> but yea, makes sense
<FromGitter>
<vladfaust> I've put many thought in returning a strict type from a query, but haven't come to a solution yet
<FromGitter>
<vladfaust> You can have `Serializable` objects, though. They can be initiailized from a model query as well
<FromGitter>
<Blacksmoke16> id imagine you would have access to the types of the columns selected
<FromGitter>
<Blacksmoke16> then could be like `NamedTuple(col1: String, col2: Int32).from hash_from_rs`
<FromGitter>
<vladfaust> I think we haven't come to a solution yet
<FromGitter>
<Blacksmoke16> fair
<FromGitter>
<vladfaust> Not every model field/reference should be annotated
<FromGitter>
<vladfaust> Which is similar to other serializables
<FromGitter>
<Blacksmoke16> how would that work with ivars from other shards tho?
<FromGitter>
<Blacksmoke16> i could just reopen and add the ignore annotation i guess
<FromGitter>
<vladfaust> The same as with `JSON::Serializable`. If you want a var to be ignored in JSON, you explicitly add an ignore to it
<FromGitter>
<Blacksmoke16> that at least has a common way to do that
<FromGitter>
<vladfaust> Ignoring is not trivial, as I have lots of places where ivars are iterated. I can't work on it right now, but I keep it in mind
<FromGitter>
<Blacksmoke16> hmm, ill see if i can work around it then
<FromGitter>
<Blacksmoke16> rip `Cannot implicitly read field EveShoppingApi::Character@validator : (CrSerializer::Validator | Nil) from a DB::ResultSet at key "validator", because its type is not <= DB::Any. Consider applying a converter to EveShoppingApi::Character@validator to make it work ⏎ `
<FromGitter>
<vladfaust> Damn, I see
<FromGitter>
<Blacksmoke16> yea, is assuming every ivar is a column atm
<FromGitter>
<vladfaust> I'll try to fix it tomorrow if it doesn't bring new bugs :)
<FromGitter>
<Blacksmoke16> 👍
<FromGitter>
<Blacksmoke16> cheers
<FromGitter>
<vladfaust> Yeah :) Thanks for the bugfix! And good night
<FromGitter>
<Blacksmoke16> np o/
<FromGitter>
<watzon> Why is it that ` Bytes` is an alias to `Slice(UInt8)`, but `String#bytes` returns an `Array(UInt8)`? Shouldn't it be returning a `Slice`?
<FromGitter>
<watzon> Should I create an issue for that? Because I feel like it's a glaring inconsistency.
<rkeene>
Has anyone used the package "duktape.cr" ? I'm trying to use it and it appears to be pretty much completely undocumented
<FromGitter>
<watzon> rkeene nfortunately a lot of people don't document their code. May be a good project for you to go in, figure out what things are doing, document, and pull request
<rkeene>
In this case (and probably most cases) it's easier for me to just use something else -- I just wanted to make sure I wasn't missing the documentation somewhere
<FromGitter>
<watzon> Is there something else in Crystal that you can use in place of duktape? I don't think anyone has added bindings for v8 yet.
<rkeene>
I mean use something different like Go
<FromGitter>
<tenebrousedge> D:
<FromGitter>
<watzon> Ohh, well that's sad making
<FromGitter>
<watzon> Duktape doesn't look too terribly undocumented