173 points · by zerointensity · 3y ago · 113 comments
Makes me wonder if you could integrate this ambition to do the web-stuff in your Python file with the FastAPI/Pydantic BaseModel situation. Like a HTML templating library made out of Python data classes (or Pydantic BaseModels).
Either way, I respect the ambition! :) Always cool to see web stuff with Python.
I’m guessing this would be similar to LiveView? If so, I’m not sure Python will handle the concurrency as well as Elixir…
Edit: I see now that the goal is to compile this to JS, so I’m assuming it’s going to be quite the opposite of LiveView and will do everything on the client?
What did you learn from doing this one?
What makes your framework different?
i.e. if you want to implement py-to-js, don't also reinvent routing at the same time. Grab an existing py-to-js engine and make something tiny with it. If it shows the value of the idea, then it will be picked up by the wider community.
I like the idea of decorators for turning query and body parameters into function parameters, I haven't seen that before, however is there a syntax where I can specify many parameters without taking many LOC?
For example you could have ``@query("name", "age")`` and look at the function signature using the 'inspect' module to determine that name should be a str and age an int. Or maybe ``@query(name=str, age=int)`` .
Also, mention it uses ASGI in the docs, so people are reassured on how to deploy it. And list that it is already compatible with uvicorn and etc.
However, fastapi manages this without a decorator, only a type hint. Is there any gain doing it like this?
What's the rationale behind view.py?
However, my opinion is that is a PITA that every Flask project has a different structure, unlike a "batteries included" framework like Django, Rails, etc.
However, the focus has moved to py4web [1] which has many of web2py's strengths (including the DAL), but with a more orthodox architecture at the cost of a little more complexity and a slightly steeper learning curve.
Edit: It looks like some of the hot-paths are implemented in C. Interesting! (I would recommend pointing this out in the readme)
this exactly. stop handwaving vague marketing terms, and spell out the technical reasons. this isn't good enough for a show HN imo
edit: just read that OP is 15 yo. ok, i get it. well, treat this is advice to improve your technical documentation, it'll do wonders for your career :)
Aside my web involvement I did a lot of print design as well. For print wysiwyg is perfectly fine.
But how would you wysiwyg for a medium that is inherently multifaced? I mean your window could be small, or huge, portrait or landscape, it could have colors or not, heck it could even be print.
So you won't get what you see unless you replicate the exact conditions under which it was seen when tou made it. Do you want that thing that you scale to stay at fixed size, should it stay at fixed distances to the viewport borders? If yes which ones? What happens if users set their font sizes differently and your perfectly scaled text box overflows? Either that wysiwyg editor has very opinionated choices that won't work for half of the people, or it will have auch a complexity in its options you will be better off with learning css in the first place.
Web is not print, nobody will get what you see.
That being said, if you are really just about content, I would just use the most basic default browser css (so basically none) and html and call it a day. That won't look shiny, but if people want shiny they can do their own styling. Some of my favourite blogs do this.
Other than that I wouldn't discount the fact that a backend can be a crucial part of the content as well as it allows you to do valuable things that are geared towards the consumption of said content, e.g. taxonomy (tags, categories, authors, consistent dates), but also more specialized things like linking between relevant topics, etc.
Of course you could also do that by hand, but then you wouldn't be focusing on the content, wouldn't you?
In the end it is your content and you want to present it in a certain way. If you want precise control over the how, you have to deal with these things — if it ia just about the content, use whatever CMS you like and never look back.
It is doable, but it requires a stable runtime. Just the HTML/CSS ecosystem is too flaky, and HTML/CSSS is a poorly design system for this type of interactive systems/apps.
1997 calling, they say they have that wysiwyg tool you’ve been waiting for.
Web frameworks need to be a visual medium where you can create ui using visual tools and the "backend" side of things merge seamlessly.
And by headless I mean something which builds on what the web provides like buttons but adds a whole lot more of components which are used but are unstyled.
I wrote one in PHP and 3 devs were able to build and maintain a 800 page CRUD system with it (still going strong, makes a ton of money). It has complex business logic, is fully unit testable and allows for escape hatches when needed.
I'm in the process of rebuilding the DSL in C# with the lessons learned (because Entity Framework is awesome). And might open source.
Solving this “problem” just doesn’t seem like a good use of a time. There are now 4738484 different viable ways to build a website, adding another way is just a waste of everyone’s time
Personally, I think it's a great direction and hope it sticks.
"Streamsync is an open-source framework for creating data apps. Build user interfaces using a visual editor; write the backend code in Python." [0] https://github.com/streamsync-cloud/streamsync
is the biggest question here..
I know I don't mention my age because I want people to judge my work objectively. (not to imply that I'm a teenager...)
And I can't center a div without a google search...
(I am a back-end dev tho, so its a little better than it sounds)
Internet latencies should be in single digit to low double digit milliseconds range.
I would expect the slowest of web frameworks in bash to parse and route an http request in 1ms, so even if you replaced that with a hand written custom assembly version running at 1nanosecond, that would still be dwarfed by the networking jitter.
I supposed that's one way to judge environmental footprint. Pretty sure the climate activists would be unhappy about it though. ;)