14 ms·
FastUI: Build Better UIs Faster
- gar1t 3y agoGradio does a pretty good job here.
- h0h0h0 3y ago[flagged]
- deleted 3y ago[deleted]
- PufPufPuf 3y agoThis isn't a new concept, other examples include Solara (React-based) and NiceGUI (Vue-based). It's very practical for internal apps, if you accept that all controls have a small delay due to events being processed server-side.
- cyberax 3y agoIs there anything similar for Go?
- iamflimflam1 3y agoMaybe this: https://fyne.io/ https://fyne.io/
- shmooper 3y agoThanks for sharing! I wasn't aware of these frameworks. As for the events being processed server-side, this is exactly where FastUI differs from any other framework I've stumbled so far - the widgets are sent to the client, and it knows how to render them, so just like any other js framework there's no roundtrip for every keystroke.
- paradox460 3y agoPhoenix LiveView works this way
- jeremycarter 3y ago[flagged]
- deleted 3y ago[deleted]
- CyberDildonics 3y agoI guess building UIs in this case means building html forms in python, although the examples look more complicated then just building a web page and responding to http requests. I don't know why someone would say "Build UIs" and not mention html, it seems pretty myopic to think a UI automatically means a web page.
- LtWorf 3y agoYeah I was originally wondering which toolkit it was using, and how it would compare against PyQt for example… but it seems a completely different thing.
- boxed 3y agoThis seems way slower (in dev time) and more verbose than iommi https://docs.iommi.rocks/ https://docs.iommi.rocks/
- madeofpalk 3y agoFor something called "FastUI" it sure does seem pretty slow at making a basic website with simple 2000s-era HTML...
- LtWorf 3y agoWell FastAPI was originally based on pydantic 1.x, which was extremely slow (so slow in fact that they removed the benchmarks from the website). I am the author of typedload, a similar library written in pure python. Mostly for fun I started to see how much I could improve performances, benchmarking against other libraries. I was very surprised to find out that pydantic2, despite the rewrite in rust, wasn't overwhelmingly faster… in fact it is still slower than my pure python library in some cases. But, I guess having "fast" in the name sounds good! https://ltworf.github.io/typedload/performance.html https://ltworf.github.io/typedload/performance.html (I re-run them every time I release).
- 0cf8612b2e1e 3y agoI am certainly not in love with how the FastAPI team handles comparisons or development. Hiding superior benchmarks. Immediately closing Github issues (they refile as Discussions to keep the issue count low). So on and so forth.
- LtWorf 3y agoI suspect that part of the problem is that they got VC money to do the rewrite in rust, and it took very long and the results aren't as amazing as expected. But that's just my own conspiracy. I have no idea. Perhaps things changed since I last ran the benchmarks. Benchmarking isn't easy. I know that my software using my library mostly loads Unions, so that's a focus in my benchmarks. However I have absolutely no idea of what the other users are doing with it, and my benchmarks might not be relevant to them. In the end I wrote them for myself mostly, to check for possible regressions in performances.
- manojlds 3y agoFast for me was about the DX rather than performance.
- qudat 3y agoIt seems the big selling point is building websites without JS. To each their own but typescript is one of the best programming languages I’ve used. I do enjoy python a lot but whenever I use it I feel like I’m going a decade into the past, especially with their tooling (lint, types, formatters, package manager, venv, etc). I wrote a post recently about how I feel like this loathing of all things FE/JS is overblown: https://bower.sh/front-end-complexity https://bower.sh/front-end-complexity
- deleted 3y ago[deleted]
- behnamoh 3y ago[flagged]
- frde_me 3y agoYou can basically say that about everything running on a computer. The types in any language aren't a thing, it's all just bits going back and forth.
- eropple 3y agoI have some bad news for you about the types in Python--which, for the record, I really like and have made me willing to write Python!--if your objection is that the types are "just an illusion". Much like Pydantic, good use of TypeScript types involves shape validation on input. (I have worse news for you about C or C++ or anything that isn't typed exclusively based on how wide its register is, but that's nitpicking.)
- petesergeant 3y ago> I have worse news for you about C or C++ or anything that isn't typed exclusively based on how wide its register is I would be interested in hearing this nitpicking, I know little about C or C++
- 3y ago
- krawczstef 3y agoWe built an app with it -- https://blog.dagworks.io/p/building-a-lightweight-experiment https://blog.dagworks.io/p/building-a-lightweight-experiment. You can see the code here https://github.com/DAGWorks-Inc/hamilton/blob/main/hamilton/plugins/h_experiments/server.py https://github.com/DAGWorks-Inc/hamilton/blob/main/hamilton/.... Usually we've been prototyping with streamlit, but found that at times to be clunky. FastUI still has rough edges, but we made it work for our lightweight app. Note: we generally found it snappier than streamlit.
- japhyr 3y agoCan you share anything specific about what was clunky/ not snappy about streamlit? I've been exploring streamlit, and it took a little bit to figure out how to use it well, and deploy it appropriately.
- elijahbenizzy 3y agoOn the same team — I’ve really enjoyed strsmlkt and built an app (that made it to the HN front page!) https://share.streamlit.io/-/auth/app?redirect_uri=https%3A%2F%2Fimage-telephone.streamlit.app%2F https://share.streamlit.io/-/auth/app?redirect_uri=https%3A%.... That said, I’ve found it to be clunky in a few ways: 1. State management is not intuitive — anything that involves rendering complex state/reacting at it changes requires a ton of session state type stuff. 2. I’ve very often had to go into css/markdown hacks 3. The control flow of when it’s running/executing makes for clunky interactions 4. Some API decisions are painful. For instance, a block str comment in the file will render as st.write 5. Long running (or even not instant tasks) make for some annoying engineering challenges — the UI is tied to the compute, so you have to be smart about juggling it 6. Caching is not smart — it’s quite useful, but it’s easy to get lost in caching/state I’ve been dreaming about streamlit but a little more state/function oriented. E.g. react-based. Not far from fastUI These are both great tools for prototyping, but I’ve found that I’ll pull up tailwind + some UI framework when I want something slick and it’ll take a few times as long.
- jairuhme 3y ago
- jawns 3y ago> In the abstract, FastUI is like the opposite of GraphQL but with the same goal — GraphQL lets frontend developers extend an application without any new backend development; FastUI lets backend developers extend an application without any new frontend development. I know a lot of backend developers who are backend developers specifically because they don't enjoy frontend work and prefer to leave that work to people who actually enjoy it. And I know a lot of frontend developers who feel the same way, only from the other side. The tagline of FastUI is "Build Better UIs Faster," but I think this will likely end up being "Build Passable UIs Faster," because yes, for simple cases, you can represent HTML components as Python or Javascript or whatever other language you want, but once you need to build something complex on the frontend, it becomes very irritating very fast when you have to work like this -- and good luck getting your frontend buddies to help you, because now they have to get up to speed on a new framework to understand what it's doing.
- calvinmorrison 3y agoIts a shame that RAD on the web is so far behind stuff like Qt
- LoganDark 3y agoWhat makes Qt special here? Qt has its own issues that make it painful to use.
- rescbr 3y agoWeb development used to have a RAD experience in the ages of PHP 4/ASP Classic and Dreamweaver. For better or worse, we lost this capability in the path for code purity, RESTful services and SPAs.
- g-b-r 3y agoand accessibility, and standards compliance, and maintainable code...
- 3y ago
- IceDane 3y agoOh No. Is it that time again? Someone who isn't really a front-end developer reinventing front-end development. I can't wait to be handed an application by my data scientists that uses this and is a complete trash fire that I need to rebuild from scratch... Again. I guess streamlit has competition.
- screye 3y agoIt comes from a place of necessity, not want. In many product engineering teams, a solution doesn't exist until there is a UI experience to interact with it. It allows data scientists to showcase the benefit of their model as a full experience. I wouldn't use it for a large scale app. But tools like these are excellent for quickly mocking up a sample UI to sell an idea to your leadership. Too often leadership does not get the benefits of a ML/AI/DataScience driven feature if they can't see it inside something that resembles a UX. Front end people don't get this pain, because their work has immediate visible impact. Backend work doesn't need to be sold because it naturally emerges out of the needs of supporting a certain number of users. ML work, lacks visibility just like backend but isn't as self evident as backend work. Tools like streamlit fill that gap.
- bormaj 3y agoThis is probably the best summarization I've seen that describes this space. Even outside of ML, there's a real use case for building small, contained UIs for non-technical people to use in place of CLI tools. The focus of these products should be 0 to 1 rather than 1 to Inf.
- wruza 3y agoWhile the sentiment is relatable, I think it’s too harsh. Frontend devs would better thought why people ignore their mainstream and use simpler tools instead. For what’s worth, the scenario you described assumes they did something useful behind that trash fire and for some reason avoided dealing with a frontend team/guy. Explanation through pure incompetence fails to see and meet their needs.
- 3y ago
- pests 3y agoHow does this compare to React Server Components? Which are basically just server side routes / rendering + optional pre-rendering ala static site generators using simplified react components?
- internetter 3y agoIt's essentially worse. The target audience is people like data scientists who are only familiar with Python, but it won't replace isomorphic javascript anytime soon or ever.
- halfcat 3y agoThe main difference is there’s at least 1 company using FastUI /s (but only half)
- kumarvvr 3y agoIs this a good way to build UI? The syntax looks very awkward. IMV, XML is the best format for any Declarative UI. Tools to generate that XML (or HTML) are better value than these systems. I would love to see an XML based UI generator in Python.
- 8n4vidtmkvmk 3y agoSkip the python and use xml+xslt directly in the browser if you like it
- int_19h 3y agoThe XML+XSLT equivalent here would be an XSLT stylesheet with a bunch of predefined rich parametrized templates that you can just <xsl:call-template>. Hand-coding XSLT to produce HTML (or whatever) is still rather tedious.
- dustrider 3y agoDid this extensively in the mid-naughties. Huge site, lots of data and traffic. Performance exceeded what was available at the time, scaled super well, but not something I’d ever go back to. - xslt is not a programming language. As soon as you start using xslt:functions you’re doomed. - it is not a fit for interactive UIs. It’s good for static content, trying to mix in js goes wrong very quickly. My opinion is that these days infra is cheap enough that you get all the same benefits by doing standard templating in your language of choice from your data in json or whatever. Which I know is essentially the same thing without the specialist software and dsl. And that’s kind of the point.
- vidarh 3y agoSimilar story for me. Conceptually I still like the idea, but not with XSL. JS operating on JSON as you say can do the same, but without all the needless pain. Though I'd still love a more declarative option - but I'll sacrifice that before I use XSL again.
- 3y ago
- webprofusion 3y agoIt doesn't seem better or faster but apart from that, great!
- nextworddev 3y agoThis is a better retool alternative
- cheptsov 3y agoSounds promising! Gonna check it out.
- slmjkdbtl 3y agoWhat's the use case for this? Is doing a roundtrip to the server on every client interaction ever a good idea for building user facing UI?
- dgellow 3y agoInternal tooling
- Culonavirus 3y agoIt's even called "FastUI", that is hilarious.
- jacobyoder 3y agoFast to develop, not necessarily as fast as a 'written and optimized by hand' UI.
- jasonjmcghee 3y agoHave you used FastAPI? Certain functionality like file upload is mind blowingly slow. FastX is popular these days.
- dralley 3y agoAnyone have experience with Django Ninja?
- duckmysick 3y agoI have trouble finding the FastX project you mentioned. Can you tell me its website? The top results I get are for the Fast and Furious movie. After specifying the context ("API", "web", "framework") I get hits for remote desktop software which also has API: https://www.starnet.com/fastx/ https://www.starnet.com/fastx/ https://www.starnet.com/help/fastx-v3-api/ https://www.starnet.com/help/fastx-v3-api/ And "fastx python" returns a module for parsing FASTA files https://pypi.org/project/pyfastx/ https://pypi.org/project/pyfastx/
- 3y ago
- la_fayette 3y agoThis remindes me to java server faces, which was not a great experience in the long run. IMHO, trying to put all the subtleties of frontend development into server side abstractions would only work for a limited set of applications, such as admin UIs.
- promiseofbeans 3y agoThis seems to mainly be useful for spinning up quick and dirty internal tools. But for that use-case, isn't it easier to use something visual and established like Retool (https://retool.com/ https://retool.com/) or that generates nice react code, like MUI Toolpad (https://mui.com/toolpad/ https://mui.com/toolpad/)?
- AlchemistCamp 3y agoReact code is basically the opposite of nice. Bad language and horrible ecosystem :D Seriously, I first tried it in 2013, used it for work from 2014-2016 and here and there for odd projects later, and the amount of churn and complexity of the ecosystem has been surprising every time I check back on it. My Obj-C from even longer ago pretty much all runs fine and is fairly understandable even for most iOS devs who started after Swift was the default.
- hu3 3y agoAgreed. And React Components was the final nail in the coffin for me. Tainting what used to be a lean frontend library with server side concepts [1] was a net negative in my opinion. [1] https://react.dev/reference/react/use-server https://react.dev/reference/react/use-server
- wruza 3y agoChiming in to not let you feel alone in this. React feels like you're doing low-level assembly in an esoteric functional language that ought to be simulated in javascript, but due to limitations of the latter you have to simulate it by hand, by following the manual. Looks absolutely delusional to everyone who catched peak ui phases like Cocoa and UIKit. I remember writing custom components in Obj-C and never thinking about all the nonexistent issues which React claims to be a perfect solution for every few years.
- mleonhard 3y ago> Beyond Python and React ... Implementing frontends for other platforms like mobile ... I'm building something like this for mobile: https://www.applin.dev https://www.applin.dev
- kapilvt 3y agoI was looking at this space and nicegui seemed like the best ootb experience. https://nicegui.io/ https://nicegui.io/ Fastui seems prettty barebones mostly a form adapter to pydantic models that I can see.
- TheCapeGreek 3y agoThe stated goal/outcome seems pretty good. Glad to see more of this in Python in particular. To those dissing it for production use case over a hand build frontend by a frontend dev: yeah, no shit. But not everything needs such work put in. This is perfect for internal tools, and there's plenty of indie hackers out there proving that you don't need an immaculate UI to get customers anyway. Use it for what it is good for. We need more tools like this, because it cuts the development effort in half when it hits its stride. That's very valuable for internal tools especially, where you need something functional first and pretty second. That being said, as a biased Laravel developer, I can highly recommend Filament both as an admin panel builder and declarative UI component kit like FastUI. It's Livewire based instead of React/Vue/etc and so firmly within the Laravel ecosystem, if that bothers you. https://filamentphp.com/ https://filamentphp.com/
- lowercased 3y ago> where you need something functional first and pretty second. Yet Filament manages to be fairly 'pretty' out of the box. I did a POC for a client project, and replicated about 10% of their current system in about a month, and got a fair amount of praise from folks at both the professional look/style/feel, yet... I did 0 on the styling, just used the defaults. Yes, Filament has some rough edges when you try to color outside the lines, as with any toolkit. However, I don't think I've found anything else that comes remotely close to the combination of productivity and decent styling out of the box. Not just in PHP, but in any stack.
- aqme28 3y ago[flagged]
- sirsinsalot 3y agoAfter years of crispy forms and HTML-in-Python hackery, I am firmly on the side that the presentation layer shouldn't be so tightly coupled to the code that renders it. A template language (that isn't Python) is sufficient. Even better if you can render the templates from different languages. I'll never be defining web app presentation in Python.
- Capricorn2481 3y agoWhy not Python? I've never seen huge differences between Jinja, Razor, or Blade. Is there something about it you find extra annoying?
- pjerem 3y agoIn Jinja, Razor, or Blade, you write, HTML that you enrich. With FastUI, you write Python.
- peddling-brink 3y agoWhen Python is the hammer you have.. Not every web app needs to survive HN levels of traffic. Empowering the <insert profession here> that already knows Python to make an app to automate their team’s toil is a great thing.
- astrea 3y agoExactly. If your team is fully fluent in Python and has a need for a web UI, easier to adopt something like FastUI than try to quickly upskill in JavaScript for a one-off project.
- sirsinsalot 3y agoPerhaps, but it is a false economy. Anyone writing a UI for the web, should be fluent in HTML/CSS and so on. In that case, other templating approaches make more sense. I say this with absolute conviction; you're just deferring costs, technical debts with compounding interest. When you come to pay it off, it'll bankrupt you.
- betimsl 3y agoUse this and after a while you find yourself building UIs slower.
- ic_fly2 3y agoCall me old fashjioned but what is wrong with django and htmx? Works beautifully and fast, send only rendered code to the front. Have db admin for when you scale
- pjerem 3y agoI'm currently writing an app with Django. It's such a breeze. Everything just works and I only have to think about the problem I want to solve. The documentation is as fantastic as it was 10-15 years ago. I'm not even really fan of Python and I really miss static typing (renaming things is painful) but oh well, I'm so productive with it that I can live with this. Honestly, I think it's the only framework that I've ever used (never tried RoR though) which allows total flexibility while never bothering you with technical thoughts. It's still as shitty to deploy as it was a decade ago but now we have containers so who cares. I'm writing this app during a pause in my career (mainly frontend) after a burnout and it's reigniting my love for writing web apps.
- AlchemistCamp 3y agoI don't like Django as much as Phoenix (or Rails for that matter), but I'd take it over a Node-based backend any day of the week.
- pjerem 3y agoPhoenix looks really cool too but I’d have to learn Elixir and while that’s something I want to do (already started some years ago), my main prerequisite for this project was not to struggle and going comfy. Building something out of my hand with no roadblocks was more important to me than to learn something new.
- AlchemistCamp 3y agoIt's a very simple language. I've worked on half a dozen projects where I helped an experienced dev new to Elixir ramp up to 80%-90% productivity within a few days. Learning Phoenix (and a few other libraries like Ecto and now LiveView) is what would eat up your time. Phoenix used to be very easy for Rails/Django/Laravel devs to pick up a few years ago, but now that LiveView is thoroughly built-in and Phoenix.View has been replaced by Phoenix.Component, it's much less familiar to those learners.
- appveyor 3y agoFlet (https://flet.dev https://flet.dev) might be easier for backend devs as it doesn't assume any web experience at all. You use controls (aka widgets) with events (not request/response) and can build not only web, but desktop and mobile apps - all with a single codebase. Disclaimer: I'm Flet developer.
- FireInsight 3y agoUnfortunately Flutter (which seems to be the backend for Flet), is IIRC rendered in a HTML5 canvas, which yields bad accessibility and is overall a pretty bad way to build web apps. It's kind of unbalanced, as web tech, on the other hand, is pretty good at building desktop apps.
- appveyor 3y agoSEO - maybe, but IFAIK accessibility in Flutter web app shouldn't be an issue (I just saw this comment from someone on Flutter team: https://news.ycombinator.com/item?id=24922849 https://news.ycombinator.com/item?id=24922849). They've been recently doing a great job in terms of performance (compiling app to WebAssembly) and size. I agree that Flutter web is not good for building websites, but for web apps, especially those "internal" apps used by a small group of users, it's a pretty decent solution.
- mleonhard 3y ago> When you run flet build <target_platform> command it ... Packages Python app using package command of serious_python package. -- https://flet.dev/docs/guides/python/packaging-app-for-distribution https://flet.dev/docs/guides/python/packaging-app-for-distri... It looks like Flet is for client-side code. It lets you write Flutter apps with Python instead of Dart. > Simple Architecture - No more complex architecture with JavaScript frontend, REST API backend, database, cache, etc. With Flet you just write a monolith stateful app in Python only and get multi-user, realtime Single-Page Application (SPA). -- https://flet.dev https://flet.dev If I'm writing Python that runs on the mobile device, it must talk to a server to read & write data. Doesn't this still require an API backend, database, cache, etc?
- CrzyLngPwd 3y ago...and yet, it is slow.
- mikeocool 3y agoIt’s amazing how many front end frameworks now exist that require running a backend server to even render basic HTML. This, remix, next, Astro, and so many others. Do the features offered by these really warrant the complexity?
- avarun 3y agoMaking initial page loads significantly faster, especially on intermittent mobile connections (which is an extremely common situation often underestimated by web developers) is worth a little bit of complexity, yes. And the entire point of these frameworks is to abstract away most of that complexity.
- cuu508 3y agoWhat complexity is needed or helpful? Plain HTML is simple and loads quick.
- drowsspa 3y agoThat's the elevator pitch, but as someone with a middle-tier Android phone and in an area with not that stable mobile connection, those supposely "optimized" pages work much worse than plain old HTML. It's even funny how my phone struggles to even render the home pages of these projects. Developers always find ways to down-compensate gains due to Moore's law and its infrastructure equivalents.
- avarun 3y agoOf course it's slower than plain HTML being delivered from the server. That's not what we're comparing to, and frankly if that approach fits the needs of your project then go ahead and use it. The real comparison point is client rendered SPAs, which is the status quo in web app development that SSR frameworks are competing with. If that's your starting point, SSR is a strict optimization and a significant improvement for almost all usecases besides internal admin tools that are only meant to be used on desktop.
- 3y ago
- no_wizard 3y ago> If you're a frontend developer — you can concentrate on building magical components that are truly reusable, no copy-pasting components for each view. Please tell me this isn’t common. It’s been a solved problem for at least 15 years now. At least since PHP had any form of prominence on the backend in the late 90s early 2000s. At a minimum going all the way back to knockout.js, handlebars, YUI and ember. If this is common in 2024 I have lots of questions
- account-5 3y agoI write my side projects in dart/flutter. Least friction, less hassle. If I needed to write a web app and flutter wouldn't cut it, I'd probably go htmx. EDIT: my main issue is figuring out how to simply deploy a website.
- hanniabu 3y agoNetlify is my goto for deployment, they make it super simple. Link your repo and set your production branch, build command, and directory to publish and whenever you commit it'll automatically deploy.
- FireInsight 3y agoI'm just here to fullfill the prediction by someone, I don't remember who, that every time Netlify is mentioned in the future [this thread](https://news.ycombinator.com/item?id=39520776 https://news.ycombinator.com/item?id=39520776) is mentioned. Maybe someone will even recommend Cloudflare Pages or a $5 VPS.
- pizzafeelsright 3y agoWow. Keep others updated. There really should be a max bill on every cloud service. I've accidently ran up a bill with AWS. Alarms aren't enough. Notifications aren't enough.
- deleted 3y ago[deleted]
- yakkomajuri 3y agoI used to believe in the use case of projects like these but I think AI is making their case significantly weaker. The idea of "hey, you're a backend dev and can just quickly generate a UI in your own language" is quite a valid one, but these days you spend a a couple hours on ChatGPT and get a pretty decent UI out of it, without needing to really know frontend. I'm far from being one of those people that's like all in on AI, but I've definitely been super impressed with its abilities to generate basic boilerplate code when you're working on project from scratch.
- mleonhard 3y agoMost of the cost of a software project is from ongoing maintenance. When we make it easy to write the first version and make maintenance harder, the total cost of the project goes up. Projects like FastUI allow maintenance of a project with fewer skills, directly reducing the cost of maintenance: owning teams spend less time learning and maintaining their skills and there are fewer bugs due to engineers making mistakes because of low skill-level in a technology. Also, projects like FastUI make the project's tech stack much simpler. Simplicity helps reliability, incident resolution, security, testing, adding features, removing dead code, refactoring, etc. Highly-productive teams apply these ideas and keep their systems as simple as possible. As tools like FastUI mature, they will become standard in healthy engineering orgs.
- ilirium 3y agoOnce upon a time there was Google Web Toolkit (GWT), ASP.NET WebForms. What approach do they use, the same as FastUI? Now there is Blazor for C#, how does its approach differ from FastUI? I think they all promise to write UI for Web without writing JavaScript code.
- nsteel 3y agoFor me, the main technical difference with Pydantic over the host of other similar libs is runtime validation. Which, with modern typed Python, you often don't need and which you pay for in speed: even Pydantic v2 is still relatively slow. "Pydantic models for UI components" seems odd to me. Surely runtime validation is unnecessary in this application and static analysis is a better fit. I am guessing it's the close integration with FastAPI that really holds the value here. For me, ideally this wouldn't use Pydantic but given the author and their situation, using Pydantic is probably the main reason this project actually exists.
- denterosso 3y agoIt's like GWT for Python. Is that a fair assessment, you'd say?