|
12 rats tied together posted:the best part of working in a lovely c# code base is finding all the overloads and extension methods for abstract sealed private ataraxic List<Fart> buttfarter since the signature is so loving long that you have to scroll right to find the part thats different that's usually okay if i'm looking at it in visual studio, my brain has been thoroughly poisoned my current bane is seeing two or more generic parameters slapped on everything because someone saw some code that was repeated twice
|
# ? May 14, 2021 08:14 |
|
|
# ? Apr 19, 2024 23:49 |
|
98% of my code is just straight up ol' fashioned C and the remaining bits are either bash, makefile abominations, or assembler. it's me, i'm the terrible programming I'm thinking about learning python tho, there's a dialect with typing and an actually portable runtime and engine called kuroko that someone I know on IRC is developing. they even ported it to the EFI shell so you can run python-esque poo poo on bare metal if you feel spicy
|
# ? May 14, 2021 09:09 |
|
handle posted:done. all my posts are via carrier pigeon and transcribed by gig workers. please send more candles. Django is great and I use it but it def has a learning curve. if what you want is basically a single page app that doesn’t need the many good features of Django dash is stupid easy to read, write, deploy to heroku and can use a browsers basic auth https://dash.plotly.com/authentication
|
# ? May 14, 2021 09:49 |
|
12 rats tied together posted:the best part of working in a lovely c# code base is finding all the overloads and extension methods for abstract sealed private ataraxic List<Fart> buttfarter since the signature is so loving long that you have to scroll right to find the part thats different
|
# ? May 14, 2021 09:49 |
|
handle posted:i'd love a recommendation: i need to choose between python, php or node.js for a small web application. the application is CRUD-like but needs single-user login. use java and swing
|
# ? May 14, 2021 11:54 |
|
Kazinsal posted:98% of my code is just straight up ol' fashioned C and the remaining bits are either bash, makefile abominations, or assembler. it's me, i'm the terrible programming there's whole entire languages with typing and portability, op. why use a p-lang?
|
# ? May 14, 2021 11:56 |
|
fart simpson posted:there's whole entire languages with typing and portability, op. why use a p-lang? I like p lang. Sometimes you just need something that describes state machines.
|
# ? May 14, 2021 11:56 |
|
pro tip: don't make web
|
# ? May 14, 2021 13:38 |
|
Kazinsal posted:98% of my code is just straight up ol' fashioned C and the remaining bits are either bash, makefile abominations, or assembler. it's me, i'm the terrible programming Nothing wrong with any of this tbh, other than using bash as your shell scripting language.
|
# ? May 14, 2021 13:51 |
|
handle posted:i'd love a recommendation: i need to choose between python, php or node.js for a small web application. the application is CRUD-like but needs single-user login. fwiw PHP 8 is fine. It's finally in the post-Facebook era where it had to be turned into a real language. It basically writes like Java now. Just general info, but the Python/Django rec from everyone is a solid direction. re: Python chat, I actually really appreciate that the whole language boils down to one consistent design philosophy, even when that philosophy means that you have to do some gymnastics to accomplish OOP. I still fight a bit with coworkers to get files to be treated as modules, and not be named the way you name a Java class file.
|
# ? May 14, 2021 14:40 |
|
Carthag Tuek posted:pro tip: don't make web *Peter Parker voice* how do i code web?
|
# ? May 14, 2021 14:46 |
|
we're having a bunch of java devs write python occasionally now and now i know what my java looks like to other people
|
# ? May 14, 2021 14:48 |
|
Python is very good and I have used it in several embedded Linux products that have uptimes measured in years.
|
# ? May 14, 2021 14:51 |
|
python pays my rent and does its job well enough i also did a 180 on f-strings since everyone else likes them, peer pressure works
|
# ? May 14, 2021 15:07 |
|
shoeberto posted:fwiw PHP 8 is fine. It's finally in the post-Facebook era where it had to be turned into a real language. It basically writes like Java now. agreed, and when using a static analyzer like psalm, you can get type errors on the bits that php doesnt type check yet however i wouldnt use laravel for anything if i could help it, symfony doesn't need another layer on top of it to be good and usable
|
# ? May 14, 2021 15:32 |
|
Jabor posted:OOP more like POO
|
# ? May 14, 2021 15:40 |
|
Share Bear posted:python pays my rent and does its job well enough oh i remember that. welcome.
|
# ? May 14, 2021 15:45 |
|
CarForumPoster posted:Django is great and I use it but it def has a learning curve. if what you want is basically a single page app that doesn’t need the many good features of Django shoeberto posted:fwiw PHP 8 is fine. It's finally in the post-Facebook era where it had to be turned into a real language. It basically writes like Java now.
|
# ? May 14, 2021 17:25 |
|
i would suggest flask + alembic over django but you did say your hosting provider has some django support already
|
# ? May 14, 2021 17:47 |
|
12 rats tied together posted:i would suggest flask + alembic over django but you did say your hosting provider has some django support already i would only suggest this to peeps who are sick of djangos poo poo django implements an assload of poo poo for you, but as your plang project grows to monstrous proportion you will find it implemented poo poo in ways that are suirted for a newspaper company not for you specifically. so you have to be sick of djangos poo poo to appreciate flask really hard ime
|
# ? May 14, 2021 17:48 |
|
bob dobbs is dead posted:dude im writing clojure for money nowadays what do you mean you want a specific data structure? here in clojure land, all our data structures are the same data structure.
|
# ? May 14, 2021 17:51 |
|
bob dobbs is dead posted:i would only suggest this to peeps who are sick of djangos poo poo
|
# ? May 14, 2021 17:52 |
|
DELETE CASCADE posted:what do you mean you want a specific data structure? here in clojure land, all our data structures are the same data structure. thats not clojureland, thats all of lispland, the kingdom of which clojureland is only a duchy
|
# ? May 14, 2021 18:07 |
|
python is great for when you want to use python b/c you're sitting below the level of complexity where it becomes bad it's somewhat miserable for everything else e: one annoying pain point of python though is dealing with binary data and bit manipulation, that really makes you wish you were using C or C++ Private Speech fucked around with this message at 19:35 on May 14, 2021 |
# ? May 14, 2021 19:27 |
|
it also doesn't have a single flaw that isn't ten times worse in php or node.js land so it is the clear winner in that contest
|
# ? May 14, 2021 19:41 |
|
Private Speech posted:python is great for when you want to use python b/c you're sitting below the level of complexity where it becomes bad i'm curious in 2021 in the decade of microservices, where complexity gets big like a native desktop app? something where performance matters? those i can see python being terrible back end application? depends on how big and traffic i suppose
|
# ? May 14, 2021 19:54 |
|
agreed but i would add that the point of complexity where python becomes bad is such a high watermark that the vast majority of web services/platforms should be written and glued together fully in python, but terminate at more performant or domain specific tooling when needed none of that applies if you are working outside the domain of web poo poo, of course
|
# ? May 14, 2021 20:05 |
|
It's pretty optimal in the niche of data manipulation and processing. I haven't seen anything else that's anywhere near as needs-suiting as it. A nice Postgres database comes close, but you've got to still do your DDL and actually load the data. Pandas bypasses all that bullshit glue code pretty nicely.
|
# ? May 14, 2021 20:16 |
|
Share Bear posted:back end application? depends on how big and traffic i suppose i think the typical stateless back end application can scale to an arbitrarily large amount of "big" and "traffic" in python, or more accurately, its going to blow up and become lovely but it will have everything to do with service design and nothing to do with python specifically you could write grubhub again today fully in python, cassandra is still java and postgres is still c. the bottleneck will be because you did something loving stupid in cassandra or postgres and not because the 30 line flask application running in a container processes an order in 10 seconds of local time + 1.5 second network round trip compared to a c++ program that does it in 0 seconds of local time + 1.5 second network round trip
|
# ? May 14, 2021 20:18 |
|
300 ms is a deec backend budget and python can easily meet it
|
# ? May 14, 2021 20:45 |
|
scaling python deployments becomes a real hassle once we're talking large request rates (think millions per second). load balancing is really hard to scale with lots of instances and low per-core request rates; unless you start doing stateful stuff you'll have huge imbalances between least and most loaded. i've seen 20000 core python deployments running at 30% avg utilization because that was the only way worst case load would not cause success rates to drop unacceptably low.
|
# ? May 14, 2021 20:58 |
|
what kind of deployment has a model where a single(?) python process is polling for work and assigning it to one of 20,000 cores?
|
# ? May 14, 2021 21:00 |
|
12 rats tied together posted:what kind of deployment has a model where a single(?) python process is polling for work and assigning it to one of 20,000 cores? 20000 cores distributed over many machines. the point is load distribution becomes uneven when you have a large number of nodes and small number of requests per node (80% between most and least loaded when we measured). never really had these sorts of problems when i worked in java shops since you can get decent performance out of the jvm, but with python you'd look at 10 ms of baseline minimum latency and easily 100 ms+ to do something useful.
|
# ? May 14, 2021 21:33 |
|
'we wanna do leastconn w/o doin leastconn' is time for mitzenmacher power-of-two-random-choices load balancing
|
# ? May 14, 2021 21:47 |
|
running a shell script that invokes a python script in a loop, causing the shell to relaunch python every time: what do you mean there's a problem with my implementation???
|
# ? May 14, 2021 21:48 |
|
ok I think I follow - I assume there's some sort of load balancer here that is pushing work to like, gunicorn or some type of webserver, which is spawning workers inefficiently across a bunch of servers that each have a bunch of cores one way to address this would be to push serialized jobs or work_needed events to a location that your workers pull from or react to. you can be a lot more intentional about which python processes are running on your servers this way, probably use something like supervisord and taskset to pin python processes to each core instead of relying on the webserver scheduler you could do this in push-mode too by configuring each worker on its own tcp port and then having your load balancer forward to every pid+port. thinking about it for a sec this is pretty much how a container scheduler implementation would work too
|
# ? May 14, 2021 21:52 |
|
nullrouting is the best load balancer imo
|
# ? May 14, 2021 22:02 |
|
12 rats tied together posted:one way to address this would be to push serialized jobs or work_needed events to a location that your workers pull from or react to. you can be a lot more intentional about which python processes are running on your servers this way, probably use something like supervisord and taskset to pin python processes to each core instead of relying on the webserver scheduler assumes you know how many workers you should reasonably run. easy to calculate if all time is spent on cpu, harder with lots of switching between waiting and running. we have a system now where workers are allowed to accept if they receive a token from a worker going to sleep (i.e. waiting in select/poll for some rpc/db call to complete). it works ok. edit: also cpu pinning is bad unless you ~know what you are doing~ bob dobbs is dead posted:'we wanna do leastconn w/o doin leastconn' is time for mitzenmacher power-of-two-random-choices load balancing yep, this makes things a lot better. epitaph fucked around with this message at 22:15 on May 14, 2021 |
# ? May 14, 2021 22:10 |
|
you also squeeze out like 10% more utilization by 3 or 4 choices on typical fat tailled loads which is not worth mentioning for the academic but worth mentioning for the real-computer-toucher
|
# ? May 14, 2021 22:16 |
|
|
# ? Apr 19, 2024 23:49 |
|
epitaph posted:assumes you know how many workers you should reasonably run. easy to calculate if all time is spent on cpu, harder with lots of switching between waiting and running. we have a system now where workers are allowed to accept if they receive a token from a worker going to sleep (i.e. waiting in select/poll for some rpc/db call to complete). it works ok. i don't really like scaling anything based on CPU, especially on a server that is primarily running a GC language. i would much rather have "we know that our service operating on this hardware can usually process x events/sec" and then scale based on outstanding unprocessed events. this requires that all of your events are similar in time-to-process, which has been the case for all systems ive worked on that do 7 figures of events/sec, but probably is not always true. in adtech where our events came right from "someone somewhere opened a webpage" and we couldn't know that the events existed until they did, you can usually do some holt winters poo poo to get a baseline, but we just scaled on CPU and it was "fine" the token model is really clever though, i guess the workers have plenty of time to generate a secure token since they're just chilling waiting for network i/o, and then you could monitor the amount of currently valid tokens to get an easy view into # of active workers, or put limits on allowed active tokens to maybe avoid the classic self-DDOS scenarios.
|
# ? May 14, 2021 22:39 |