Coder Social home page Coder Social logo

Comments (4)

noozo avatar noozo commented on May 28, 2024

Hope you don't mind, but i went ahead and built it.

As a side note which might affect you in the future:

Since Phosphoricons include 1047 icons (Heroicons are only 230) i hit some weird dynamic function count limit on the erlang VM. So i decided to make some changes and generate packages per letter prefixing the icon (for instance the alarm icon will live under the Bold.A package. If Heroicons ever gets to 1024+ icons you will probably have the same issue :)

https://hex.pm/packages/phosphoricons

from heroicons_elixir.

mveytsman avatar mveytsman commented on May 28, 2024

Happy to see forks and more projects.

Is this function limit because the functions are generated via a macro or can you not have a module with more than 1024 functions?

I think that a future direction for this project (and perhaps your fork!) is to statically generate the code and download the icons, and have a task to update them - so we can tie package version to heroicon version. See #6 for some discussion on it

from heroicons_elixir.

noozo avatar noozo commented on May 28, 2024

Yeah, that would be helpful. I don't know what is the limit, but the error is something like this:

Compiling 2 files (.ex)

== Compilation error in file lib/phosphoricons.ex ==
** (CompileError) elixir_compiler_2:1: function '__MODULE__'/1+13:
  An implementation limit was reached.
  Try reducing the complexity of this function.

  Instruction: {call_ext,4,{extfunc,'Elixir.Module','__put_attribute__',4}}

    (stdlib 3.16.1) lists.erl:1342: :lists.foreach/2

Maybe you can shed some more light on it :)

from heroicons_elixir.

tcoopman avatar tcoopman commented on May 28, 2024

@noozo I just did a test:

defmodule Generator do
  defmacro __using__(_opts) do
    quote do
      defmodule Generated do
        for i <- Enum.to_list(1..2000) do
          name = "name_#{i}"

          quote do
            def unquote(name)() do
              nil
            end
          end
        end
      end
    end
  end
end

This compiles fine, so I guess it's not just that limit that you're running into

from heroicons_elixir.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.