Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
No Pants
Dec 10, 2000

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

Adbot
ADBOT LOVES YOU

Kazinsal
Dec 13, 2011



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

CarForumPoster
Jun 26, 2013

⚡POWER⚡

handle posted:

done. all my posts are via carrier pigeon and transcribed by gig workers. please send more candles.


thank you folks! yep, we only need the one user. i'll check out django first.

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

toiletbrush
May 17, 2010

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
and all of the parameters are optional so when the intractable interconnected defaulting logic breaks its impossible to 'find usages' to tell who's using it with that usage pattern

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

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.

problem is (a) i don't know python well, (b) php 5 still makes me scared to consider php 8, and (c) i've written a lot of vanilla JS but not frameworks/server-side.

webhost makes it easy to start with python/django or php/laravel. i can install node.js but i'd have to figure out the frontend, i guess? any advice for which approach is most salvageable if i only half know what i'm doing?

use java and swing

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

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

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

there's whole entire languages with typing and portability, op. why use a p-lang?

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

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.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



pro tip: don't make web

Dont Touch ME
Apr 1, 2018

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

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

Nothing wrong with any of this tbh, other than using bash as your shell scripting language.

shoeberto
Jun 13, 2020

which way to the MACHINES?

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.

problem is (a) i don't know python well, (b) php 5 still makes me scared to consider php 8, and (c) i've written a lot of vanilla JS but not frameworks/server-side.

webhost makes it easy to start with python/django or php/laravel. i can install node.js but i'd have to figure out the frontend, i guess? any advice for which approach is most salvageable if i only half know what i'm doing?

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.

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


Carthag Tuek posted:

pro tip: don't make web

*Peter Parker voice* how do i code web?

Share Bear
Apr 27, 2004

we're having a bunch of java devs write python occasionally now and now i know what my java looks like to other people

FlapYoJacks
Feb 12, 2009
Python is very good and I have used it in several embedded Linux products that have uptimes measured in years.

Share Bear
Apr 27, 2004

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

duz
Jul 11, 2005

Come on Ilhan, lets go bag us a shitpost


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

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

Jabor posted:

OOP more like POO

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

Share Bear posted:

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

oh i remember that. welcome.

handle
Jan 20, 2011

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

dash is stupid easy to read, write, deploy to heroku and can use a browsers basic auth
this seems cool, thanks! i'm going to stick with django for now because i'm trying to learn what "real" structure would look like in a larger application.

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.
cool, good to know. all i've written is tweaks to suuuper-imperative code with no structure, so if i unlearn that it'll be ok :unsmith:

12 rats tied together
Sep 7, 2006

i would suggest flask + alembic over django but you did say your hosting provider has some django support already

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost

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

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003

bob dobbs is dead posted:

dude im writing clojure for money nowadays

im sittin here lookin at this 70 member stack trace thinkin: it aint a good language

what do you mean you want a specific data structure? here in clojure land, all our data structures are the same data structure.

12 rats tied together
Sep 7, 2006

bob dobbs is dead posted:

i would only suggest this to peeps who are sick of djangos poo poo
:hai:

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost

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

Private Speech
Mar 30, 2011

I HAVE EVEN MORE WORTHLESS BEANIE BABIES IN MY COLLECTION THAN I HAVE WORTHLESS POSTS IN THE BEANIE BABY THREAD YET I STILL HAVE THE TEMERITY TO CRITICIZE OTHERS' COLLECTIONS

IF YOU SEE ME TALKING ABOUT BEANIE BABIES, PLEASE TELL ME TO

EAT. SHIT.


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

Corla Plankun
May 8, 2007

improve the lives of everyone
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

Share Bear
Apr 27, 2004

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

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++

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

12 rats tied together
Sep 7, 2006

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

shoeberto
Jun 13, 2020

which way to the MACHINES?
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.

12 rats tied together
Sep 7, 2006

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

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
300 ms is a deec backend budget and python can easily meet it

epitaph
Dec 31, 2008
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.

12 rats tied together
Sep 7, 2006

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?

epitaph
Dec 31, 2008

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.

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
'we wanna do leastconn w/o doin leastconn' is time for mitzenmacher power-of-two-random-choices load balancing

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003
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???

12 rats tied together
Sep 7, 2006

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

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



nullrouting is the best load balancer imo

epitaph
Dec 31, 2008

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

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
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

Adbot
ADBOT LOVES YOU

12 rats tied together
Sep 7, 2006

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.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply