4 ms·
How do you feel about the productivity for web development in Rust?
by faitswulff 8y ago
How do you feel about the productivity for web development in Rust?
- Dowwie 8y agoMy priorities are unique to my situation, so a responsible answer to your question is "it depends on what you're trying to do". I am trying to create a scalable platform. Without having best practices to learn from, I had to discover what that required while trying to make the most of Rust. The discovery process involves many iterations of trying approaches out until a decent one emerges. On the other hand, once I laid the tracks down, I found my usual hindrances to productivity: business logic and data modeling. I am much more productive with Rust and raw SQL parameter binding than Python with SQLAlchemy query builder. Evidently, the costs associated with using an orm are greater than the benefits for someone who is fluent in SQL. Learning a dsl and then fighting the dsl and then asking for help repeatedly, just to accomplish the same task and no more, is a really bad use of time.
- ralala 8y agohow are you building dynamic queries without a query builder? (for example creating a complex where condition based on given GET parameters)
- Dowwie 8y agoYou could answer this question for your Python work if you refactor one of your dynamic queries to SQL Alchemy's query binding facility. You're working with a query string so you manipulate the string using whatever tools are available in the language. Lots of possible approaches in Python. Same for Rust.
- steamer25 8y ago> Evidently, the costs associated with using an orm are greater than the benefits for someone who is fluent in SQL. I largely agree although I've recently discovered the beauty of re-usable, type-checked sub-clauses by composing C# lambda expressions for Entity Framework using e.g., AndAlso(): https://stackoverflow.com/a/13968172 https://stackoverflow.com/a/13968172
- rmdashrfstar 8y agoDo you have an example of where you’ve found writing raw SQL queries was more efficient in both time spent programming and time spent executing the query? I built an API in Python and SQLALchemy. Originally, it was built in Flask and Flask-SQLALchemy, but I eventually decided to migrate it to Falcon + SQLService and saw greatly improved response times from my API (hosted on AWS Lambda). Am I likely to see as significant improvements from a switch to Rust + raw SQL queries? I am kindly looking for a reason to learn Rust. :) With the recent improvements to AWS Lambda, a Rust run-time is a reality and I am open to migrating the project once again for any additional speed improvements.