DEV Community

Cover image for I built a Streamlit alternative because I hated "Full-Script Reruns" (Introducing Violit) πŸš€
Dope Flamingo
Dope Flamingo

Posted on

I built a Streamlit alternative because I hated "Full-Script Reruns" (Introducing Violit) πŸš€

πŸ‘‹ Hi, I'm a developer who loves Python.

I’m a software engineer working in the industry, and I’ve spent my nights and weekends grinding on this open-source project.

Personally, I really love Streamlit. Its intuitive syntax is a game-changer, and many of my friends in AI/Data research use it for prototyping every day.

But as projects grew, I saw them suffering from a structural performance issue: "The Full-Script Rerun."

Every time you click a button, the entire Python script runs from top to bottom. Watching the loading spinner spin endlessly (or seeing the app crash) made me want to fix this as a developer.

I tried recommending NiceGUI as an alternative. It's great, but the feedback was consistent:

"The syntax is too different from Streamlit."

"Customizing the design (Material Design) is too hard."

So, I decided to take matters into my own hands.

"What if I built a tool that is as easy as Streamlit, but as fast as React?"

That’s how Violit was born.


πŸ’œ The Philosophy behind Violit

Violit is built on top of FastAPI and Shoelace (Web Components). My architectural goals were clear:

  1. Fine-grained Reactivity: When data changes, update only the specific component. No full page reruns.
  2. Zero Learning Curve: If you know Streamlit, you should be able to use Violit in 10 minutes.
  3. Beautiful by Default: You shouldn't need to know CSS to make it look good. Just set theme="cyberpunk".

πŸ”₯ Show me the Code

Violit inherits the developer experience of Streamlit. You don't need to know complex callbacks or useEffect. The flow of your Python code becomes the UI.

Python

import violit as vl

app = vl.App(title="Violit Demo")

# State declaration (Similar to React's useState or SolidJS signals)
count = app.state(0)

# Clicking the button updates ONLY the 'count' variable.
# No full script rerun happens.
app.button("Increment", on_click=lambda: count.set(count.value + 1))

# When 'count' changes, only this text component updates.
app.text("Current Count:", count)

app.run()
Enter fullscreen mode Exit fullscreen mode

⚑ Benchmark: Streamlit vs. Violit

Because Violit uses fine-grained reactivity, it doesn't need to re-read data or re-render the entire DOM when a state changes.

Here is a comparison of rendering speeds when plotting graphs with large datasets:

Data Points Streamlit Rendering Violit Rendering
100K ~62ms ~14ms
500K ~174ms ~20ms
1M ~307ms ~24ms

As you can see, Violit shows minimal performance degradation even with large datasets, as it bypasses the heavy rerun cycle.

Another Benchmark : Initial Chart Loading Speed (5 Million Data Points)

This comparison shows the rendering of a graph plot using 5 million generated data points. (Top: Streamlit, Bottom: Violit)

As you can see, Violit demonstrates a drastically faster app startup speed compared to Streamlit.


🎨 20+ Themes, One Line of Code

I believe that "Aesthetics are a feature."

Violit comes with over 20 preset themes ranging from bootstrap to cyberpunk and vaporwave.

  • Bootstrap

  • Dracula

  • Hand-drawn

You can switch the entire look of your app with a single argument.


🌐 "I built the Violit website... with Violit"

Talk is cheap. To prove that Violit is ready for production (MVP), I built the official landing page and documentation entirely using Violit.

It supports Hybrid Rendering (HTMX for large traffic, WebSocket for real-time) and can even be Desktop mode using pywebview.

Violit aims to go beyond being just another Streamlit alternative. Our goal is to enable developers to build complete web services (MVPs) entirely in Python.


πŸ™ Give it a try!

I’m developing this in public, and it’s currently at v0.1.11. It’s still early days, but the response from Reddit and the community has been amazing.

If you are looking for a faster alternative to Streamlit for your dashboards or AI demos, please give it a try and let me know what you think!

Thanks for reading! Happy coding. πŸ’œ

Top comments (0)