Nova: A New Web Framework for Erlang

64 points by taure a day ago

Hi Hacker News community,

I'm excited to share Nova, a new web framework built for Erlang, designed to make web development in Erlang simpler, faster, and more approachable. Nova leverages Erlang's concurrency, reliability, and scalability to create a robust yet lightweight framework for building modern web applications.

Key features:

* Lightweight and modular: Easy to integrate with existing Erlang projects.

* Built for concurrency: Harnesses Erlang's actor model for high-performance web apps.

* Developer-friendly: Simplifies routing, middleware, and template handling.

* Extensible: Supports plugins and custom integrations.

Check it out: GitHub: https://github.com/novaframework/nova Homepage: https://novaframework.org Getting Started Guide: https://dev.to/taure/getting-started-with-nova-1ioo/stats

We’re early in development and would love feedback from the community! If you’re an Erlang enthusiast or curious about building web apps with a language known for its reliability (think WhatsApp or RabbitMQ), give Nova a spin and let us know your thoughts.

What do you think about using Erlang for web development? Any features you’d love to see in a framework like this?

CollinEMac a day ago

This seems like a tough sell when Phoenix is already so good. I'm struggling to see why I'd use this over that.

  • worthless-trash a day ago

    Because its not elixir, its erlang. For those of us who dont do elixir, this fits the knowledge I already have.

    • taure a day ago

      Nova is also more close to beam so it can be used with elixir and lfe or other beam languages.

prophesi a day ago

Not sure how this hit the front page without linking the actual project.

https://novaframework.org/

  • taure a day ago

    Thank you. I missed to add a new line where the homepage is..

azaras a day ago

Why do you use Erlang instead of Elixir?

  • johnnyjeans a day ago

    No rebinding, better fits the grain of the OTP, no AST macros. Last I checked, the debugging experience with elixir was pretty subpar. Erlang is also a fundamentally nicer syntax that I find a great deal more readable. I'm not really sure what the appeal of Elixir as a language is actually supposed to be, outside of people who have spent a lot of time writing Ruby code.

    • asa400 a day ago

      Full disclosure: I started with Erlang, I get paid to work with Elixir every day, I love Erlang still.

      Why someone might like Elixir:

        - slightly less crufty stdlib for a lot of the basic stuff (though we still use the Erlang stdlib all the time)
        - the Elixir community started off using binaries instead of charlists so everything uses binaries
        - great general collections libraries in the stdlib that operate on interfaces/protocols rather than concrete collections (Enum, Stream)
        - macros allow for default impls and a good deal less boilerplate, great libraries like Phoenix and Ecto, and the community seems to be pretty judicious with their use
        - protocols allow datatype polymorphism in a really nice way (I know about behaviours, they are also good)
        - very standard build tool/project layout/generators that have been there from the start (Erlang has caught up here with rebar, it seems)
        - a lot of high quality libraries for web stuff, specifically
        - convenience stuff around common OTP patterns like Task, Task.Supervisor, Agent, etc.
      
      For me, I love the clarity and brevity of Erlang the language but I find Elixir a lot more pleasant to use day-to-day. This is just personal, I am not making a general statement saying Elixir is better.

      > Last I checked, the debugging experience with elixir was pretty subpar.

      Just curious, why is this? All of the Erlang debugging stuff seems to work.

      • klibertp a day ago

        > Just curious, why is this? All of the Erlang debugging stuff seems to work.

        But you'd see a decompiled Erlang-ish code in the (WX-based, graphical) debugger, no? Genuinely curious, I think it was like that last I checked, but that was in 2019.

    • klibertp a day ago

      > I'm not really sure what the appeal of Elixir as a language is actually supposed to be

      Easy:

          - rebinding
          - higher-level OTP abstractions
          - AST macros
          - nicer, more readable syntax
          - (optionally) cleaner stdlib
      
      (Assuming you're not trolling: you chose to focus on features that can only be judged subjectively, and therefore can only be discussed as preferences. It's ok to have them, but actively displaying them is a bit pointless. Objectively measurable features of both languages put them very close together, with both having slight advantages over the other in different areas, on average making them almost equivalent. Especially compared to anything non-BEAM.)
      • johnnyjeans a day ago

        I'm not trolling, but I'm very serious about language design after going through a long gauntlet. I don't think making mutation easy, and also having the ability to hide code execution, is necessarily a good practice in a system principally designed for safe, robust and efficient concurrency. Don't use a flathead on a phillips screw.

        • asa400 17 hours ago

          Rebinding is not mutation. This seems pedantic but is an important distinction. None of the semantics of the runtime are changed. The data remains immutable. You probably know this. However, for the benefit of readers who may be less familiar: Erlang does not allow variables to be rebound, so it's somewhat typical for Erlang code like this:

            X1 = 8.
            X2 = X1 + 1.
            X3 = X2 * 302.
          
          You cannot, say, do this:

            X1 = 8.
            X1 = X1 + 1.
          
          This is because in Erlang (and in Elixir) the `=` is not just assignment, it is also the operator for pattern matching. This has implications that are too broad for this post, but the key point here is that it's attempting to see if the the left side and the right side "can match".

          Whereas writing the same thing in Elixir would look like:

            x = 8
            x = x + 1
            x = x * 302
          
          This is because Elixir allows `x` to be rebound, in effect changing what data `x` points to, but not mutating the underlying data itself. Under the hood Elixir rewrites each expression into something resembling the Erlang version.

          The practical effect of this is that if you for example insert a process spawn somewhere in between any of the lines that references `x`, that process gets its own totally immutable version of the data that `x` points to at that point in time. This applies in both Erlang and Elixir, as data in both is completely immutable.

          • johnnyjeans 6 hours ago

            It should also be noted that handling state like that is not really idiomatic Erlang. State is updated at a process level, thus traditionally you spawn another process which is trivial to do. On the BEAM that is fast enough for 95% of cases. If you really need mutation on local variables for performance reasons, you should already be writing NIFs anyways.

            State variables are what I think corpos call a "code smell". The BEAM/OTP isn't a number cruncher, there are better tools out there if you're doing a lot of that. Erlang is, at it's core, about constraint logic programming. It should be best thought as a tool for granular, scalable, distributable userspace scheduling. If you need something outside of that, NIFs or Ports. Both are quite nice.

            • asa400 6 hours ago

              This has nothing to do with math or number crunching on the BEAM. This has nothing to do with mutation. This has nothing to do with performance.

              This kind of process and function-local static single-assignment code is all over the place in Erlang codebases. It's incredibly common. The other popular method is tail recursion.

              I searched for literally 30 seconds and found these:

                - https://github.com/ninenines/cowboy/blob/master/src/cowboy_router.erl#L139-L144
                - https://github.com/ninenines/cowboy/blob/master/src/cowboy.erl#L201-L205
                - https://github.com/ninenines/cowboy/blob/master/src/cowboy_http2.erl#L487-L506
  • cmdrk a day ago

    Not to pick on you, but there are always posts like this in every Erlang thread. One is not strictly superior to the other, and the BEAM community benefits from the variety IMO.

  • taure a day ago

    We started with Erlang before Elixir was created and we still use it for everything we do.

    This is more to have a smooth web framework similar to Phoenix but for Erlang.

    You can also use Nova for elixir.

  • colecut a day ago

    It seems he wanted to make an alternative to Elixir..

regularfry a day ago

You've run into the same naming problem GM did with the Vauxhall/Opel Nova: "No Va" literally means some variant of "it doesn't go" in (at least) Italian, Spanish, and French.