IvanR
Folks, I’ve made a Domo library adding new/1 constructor function to a struct that automatically checks conformance to the struct’s type.
The library includes the custom compiler that works right after Elixir in the chain to prepare pattern matchings.
Library usage looks like the following:
defmodule Foo do
use Domo
defstruct [:title]
@type t :: %__MODULE__{title: String.t()}
end
Foo.new(title: :hello)
** (ArgumentError) the following values should have types defined for fields of the Foo struct:
* Invalid value :hello for field :title of %Foo{}. Expected the value matching the <<_::_*8>> type.
I’m looking for the codebases with lots of structs to check the compilation times without/with use Domo in structures via the following command.
mix deps.compile && mix clean && time mix compile
Can you, please, share if you know one or two open-source projects that has as many structs with defined @type t() as possible?
P.S. Is it an absurd idea to ask you to test on a proprietary codebase? Please, DM if you can do such a measurement; I can send concrete steps in reply ![]()
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #code-sync
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #elixirconf-us
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #blog-post
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #security
- #elixirconf-eu
- #processes
- #api
- #forms
- #hex











Showing Posts 1 to 2- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
mudasobwa
I would go with a single file defining thousands of structs. Somewhat alongside the following lines.
That way nothing else would affect the benchmark, all the code is at fingers etc.
IvanR
Thanks, it seems like a property-based test and works for a synthetic check
Same time, I’m curious about production targeted codebases because it gives the most interesting combinations of structs and types.