From 6892b47dacea6089b2910745fada16061d7d3691 Mon Sep 17 00:00:00 2001 From: Will Chen Date: Sat, 27 Apr 2024 23:54:08 -0700 Subject: [PATCH] why mesop --- docs/blog/posts/why_mesop.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 docs/blog/posts/why_mesop.md diff --git a/docs/blog/posts/why_mesop.md b/docs/blog/posts/why_mesop.md new file mode 100644 index 00000000..fe7d6efc --- /dev/null +++ b/docs/blog/posts/why_mesop.md @@ -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.