Skip to content

Commit

Permalink
why mesop
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwillchen committed Apr 28, 2024
1 parent e61bf29 commit 6892b47
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/blog/posts/why_mesop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
date: 2024-04-27
draft: true
---

# Why Mesop?

As I've shared about Mesop, one question I get is why build another UI framework?

Even though there's many popular options in this space such as Gradio and Streamlit, I think there's opportunity to innovate and try something different.

So how is Mesop different? Mesop tries to straddle the line between being friendly for developers without frontend knowledge while applying the principles of maintainable frontends from modern web frameworks. This means that we try to reuse the ideas without making Mesop app developers learn about intricacies of the various FE technologies we use like Angular.

Let's share some concrete ideas.

## Components are functions

One of the powerful ideas that React introduced is creating the notion of components which are encapsulated blocks of the UI. Mesop embraces this idea of composing your UI out of components and instead of using JSX, we use the standard Python language syntax to imitate a similar hierarchy, in particular by using `with`.

Functions are great because reusing components is natural (it's what every developer gravitates towards when they want to reuse code).

## Composable primitives

Mesop consists of low-level components such as `box` and `text` which are thin wrappers around the browser's building blocks, DOM elements. This means that you can create custom UIs (__showexamples__).

Oftentimes, Python UI frameworks start from high-level building blocks, but this causes constraints in the kinds of applications you can build. By starting with low-level building blocks, there's a much broader set of use cases that we can support, including ones that I never thought about.

## Easy to get started

Even though there's low-level building blocks, many use cases particularly for internal AI/ML apps are pretty straightforward. Building your first real-world Mesop app should take just a few lines of code. That's why we created the [chat](), [text to image]() and [text to text]() components.

## Try Mesop

If this sounds intriguing, I recommend reading the [Getting Started guide]() and giving Mesop a try.

0 comments on commit 6892b47

Please sign in to comment.