7 ms·
I'm not exaggerating but this might just be the highest impact library I've seen. As a backend developer who has lots of great project ideas but bail at the tho
by vikinghckr 4y ago
I'm not exaggerating but this might just be the highest impact library I've seen. As a backend developer who has lots of great project ideas but bail at the thought of having to use JavaScript and HTML, this library is a godsend!
My only question is why it took so long for someone to implement it? And where are the equivalent libraries for Go, Rust and Java?
- jeremycarter 4y agoI have seen a .NET project that did something similar to this, it was called Bridge. That was 8 years ago no sure if it's still available.
- raphinou 4y agoWebsharper[1] lets you develop web apps all in F# or C#. Its reactive HTML layer is particularly useful. 1: https://websharper.com/ https://websharper.com/
- troymc 4y agoThese days, in the .NET ecosystem, there is Blazor. You write your whole web app in HTML, CSS and C# (frontend and backend). There are several different deployment models; Wikipedia gives a good summary: https://en.wikipedia.org/wiki/Blazor https://en.wikipedia.org/wiki/Blazor
- apetuskey 4y agoThank you really appreciate that!
- raphinou 4y agoIn java I know of https://www.webtoolkit.eu/jwt/ https://www.webtoolkit.eu/jwt/
- nu11ptr 4y ago> And where are the equivalent libraries for Go, Rust and Java? Not aware of anything yet for Go/Rust, but Java and Python have had libs like this for a while now (to the point that Pyjamas hasn't been updated in a decade): * GWT (Java) * Pyjamas (Python) * Vaadin (Java) Those are general purpose. After that you have the sci/data-oriented python frameworks like dash, streamlit, etc.
- vram22 4y agoOne for C++ is https://www.webtoolkit.eu/wt https://www.webtoolkit.eu/wt by https://www.emweb.be/ https://www.emweb.be/
- alanbernstein 4y agoWell, I haven't looked into this one deeply yet, so I'm not sure what the differences are exactly. But there are many existing, broadly similar, projects. I see this as a solution to "I want to make an interactive website, and I don't want to touch the JS ecosystem at all and/or I really prefer python-specific libraries". This is my position exactly, so I sort of keep track of what's available. From that perspective, this is in the same space as: web2py, pyjs, streamlit, brython, pyodide, pywebio, gleam. I'm sure there are others.
- nuclearnice1 4y agoUseful list. Dash & bokeh as two more in the space https://github.com/plotly/dash https://github.com/plotly/dash https://docs.bokeh.org/en/latest/ https://docs.bokeh.org/en/latest/
- cutler 4y agoThis is a futile pursuit simply because you are creating a layer of abstraction over JS using another dynamic language so there's no real gain other than syntactic sugar.
- alanbernstein 4y agoWould you say the same thing about web assembly and emscripten? At least one of the above is based on those. Using scientific and numeric packages from the python ecosystem is more than syntactic sugar, IMO. It seems like the JS world mostly ignores that stuff. I have yet to try a real project with any of those python web tools. I know just enough HTML, vanilla JS and DOM API to cobble together ugly sites when I need to, so that's what I do. But I am optimistic that a better alternative will emerge eventually.
- jiggywiggy 4y agoThese tools are a waste of time. They take longer to learn then basic js and then in 3 years support is dropped you might have well learned a bit more js. It's a bit big but just run nextjs, it solves almost everything for you. Even deployment is one click away. Would take 5 mins to get started. And a few hours to understand for a seasoned dev.
- RonnieOwnsLexus 4y agoactually, as per the docs the framework is converting python code to Javascript. So you would need to JS skills to debug. Most of the problems in web front have been solved in JS (think CSS styles, state management) re-writting it in python would be pain, especially when everything compiles to js
- picklelo 4y agoOur goal is for the user to never have to see JS. We try to catch most errors in Python during compile time. We're also not trying to reinvent things like CSS styles, just make them accessible in Python.
- tasuki 4y ago> We try to catch most errors in Python during compile time. I feel Python is not the best language for catching most errors during compile time.
- picklelo 4y agoWe're using Pydantic and our compiler has custom type-checking on top of Python to catch these issues.
- grift_economy 4y ago[dead]
- moffkalast 4y agoThat's not gonna happen if they have to solve browser runtime errors. And with there being so much variance between browsers and random nonsense to hack around, how can you possibly get around that? Besides, python and js are so similar it's really funny to see people not wanting to use one but cling to the other.
- alanbernstein 4y agoThe available libraries are quite different between the two languages.
- abraxas 4y agoJava does have Vaadin but it's a mostly proprietary software. But it is very good and largely under appreciated.
- agroot12 4y agoMaybe I am an optimist, but I'd say Vaadin is mostly Open Source (Apache License). You can build complete web applications with the open source version. Only some advanced components (e.g. an Excel-like grid, a WYSIWYG editor, Highcharts components) are proprietary and require a subscription for development, while the builds can be freely distributed.
- ativzzz 4y agoSo ruby has a JS transpiler - opal - https://opalrb.com/ https://opalrb.com/ I tried using it a little bit but the reality is if you need JS to make your app more interactable it's really worth it to just learn some JS. As soon as you need something complex the extra layer of abstraction just gets in the way and becomes more of a headache, and if you don't need anything complex then you don't need a fancy JS solution in the first place. JS only becomes complex when you are trying to create an enterprise version of your app along with a build platform. You can always just sprinkle in <script> tags in your HTML for simple one liners without getting into the weeds.
- jrumbut 4y agoJS is complicated because the browser environment is complicated. If it's going to be rendered by and live in a web browser it will either be complicated or limited in some way (like low code/no code tools).
- DoesntMatter22 4y agoThat's not really true. It's complicated because the language is one of the worst to manage.
- eddsh1994 4y agoIt's not really any worse than Python or Ruby, but you also get TypeScript which helps
- FridgeSeal 4y agoI posit that it is both. Dealing with interactivity in the browser is subtle, complex and full of edge cases. JavaScript is also a horrible, broken language that’s not really fit for purpose. We’ve collectively invested a lot of time and resources trying to improve the experience of working with it, but the point still stands.
- deleted 4y ago
- riceart 4y ago> My only question is why it took so long for someone to implement it? Uhhhh. Because it didn’t. Google GWT was huge on the hype cycle about 15 years ago. You know this has been done before over a decade ago, multiple times in Java and Python. Not saying the space can’t be improved upon but I fail to see how it’s any more revolutionary now.
- dragonwriter 4y ago> My only question is why it took so long for someone to implement it? This is by far the first front-end python implementation/framework. Skulpt, Brython, Anvil, PyFyre, PyScript, PyWebIO, and the list goes on…
- zx14 4y agoSerious question, why not Typescript? Are you not aware of it or do you have other reasons?
- psnehanshu 4y agoYou may not realise this, but TS is just JS + Types.
- incrudible 4y agoYou may not realize this, but that makes all the difference in the world.
- psnehanshu 4y agoYou may not realise this, but this post is about a framework that let's python devs make modern web apps without touching the JS ecosystem. The root comment appreciates the framework, and shares their unwillingness to write JavaScript and HTML. The reply to that comment asks why don't they try TypeScript. I think that reply is absurd because asking someone to write TypeScript when they dislike JavaScript in the first place is absurd. I know and realise the fact that JS+Types is way better than plain JS, and infact I write TypeScript on everyday basis.
- incrudible 4y ago> I think that reply is absurd because asking someone to write TypeScript when they dislike JavaScript in the first place is absurd. I don't think it's absurd to ask someone to try Typescript first before jumping through hoops just to make Python run on the web, which certainly brings a lot of problems of its own. You do have to actually try it to see how it's a completely different experience, even if the types are just bolted on.
- naraga 4y ago.NET has Blazor, seen something similar in Rust. I believe there are tons of similar libs
- killerstorm 4y agoHmm? In 90s and 2000s most web frameworks did not rely on JS at all, they were completely server-side. I.e. the server renders a page. User clicks a button, browser collects data from a form and sends request to the server. The server updates its state and renders a new page. There are some downsides to that approach, but it can be pretty good if you just need to get some information and/or let user browse a data collection. Compile-to-JS approach started to appear in mid 2000s.
- hdhrufjdi 4y agoNope, but something better, e.g. Leptos for Rust which enables you to write Rust code and RsX (JsX equivalent) that runs on the server until all WASM is loaded to run it in the browser