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
suffix
Jul 27, 2013

Wheeee!

ultravoices posted:

okay you sort of can do that in python by with hasattr, it will retain state between function calls but the attribute will be accessible from outside the scope of the function.

how would you use hasattr?

the only ways i've seen in python is either
code:

static_foos = ['foo']
def foo():
    global static_foos
or, grossly,
code:
def foo(*, _static_foos=['foo']):

Adbot
ADBOT LOVES YOU

redleader
Aug 18, 2005

Engage according to operational parameters
so the madmen who work on webkit are thinking seriously about removing one of js's few good features

i like how they're planning on introducing a bunch of really low-level threading primitives into js, rather than a set of less footgunny concurrency abstractions.

feedmegin
Jul 30, 2008

redleader posted:

so the madmen who work on webkit are thinking seriously about removing one of js's few good features

i like how they're planning on introducing a bunch of really low-level threading primitives into js, rather than a set of less footgunny concurrency abstractions.

Ahahaha I look forward to the combination of your average JavaScript programmer and what basically seems to be the barebones Posix threads model. Gonna be glorious.

ultravoices
May 10, 2004

You are about to embark on a great journey. Are you ready, my friend?

suffix posted:

how would you use hasattr?


code:
def holy_shit():
  if not hasattr(holy_shit, "piss"):
     holy_shit.piss = "piss" 
  holy_shit.piss += "s"

Arcsech
Aug 5, 2008

redleader posted:

so the madmen who work on webkit are thinking seriously about removing one of js's few good features

i like how they're planning on introducing a bunch of really low-level threading primitives into js, rather than a set of less footgunny concurrency abstractions.

javascript, much like go, seems determined to completely reinvent the history of programming languages from first principles

Soricidus
Oct 21, 2010
freedom-hating statist shill
first as tragedy, then as farce, then as farce again but ~in the browser~

TOPS-420
Feb 13, 2012

i dont think the webkit devs "get" concurrency

https://twitter.com/filpizlo/status/903250367663693824

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum
my one core CPU (sometimes?? poo poo gets complicated) executes serially, can't do concurrency sorry thread havers, execute your programs somewhere else

Soricidus
Oct 21, 2010
freedom-hating statist shill

Sweeper posted:

my one core CPU (sometimes?? poo poo gets complicated) executes serially, can't do concurrency sorry thread havers, execute your programs somewhere else

there's a range of models for running more than one bit of code at a time with shared memory, from cooperative multitasking up to multi-cpu systems. it's debatable where you draw the line and say "this is concurrent, this is not", but i think it's reasonable to put that line at the point at which another bit of code can run at an unpredictable point in your code -- i.e. pre-emptive multitasking. and event loops are not on the concurrent side of that line.

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

Soricidus posted:

there's a range of models for running more than one bit of code at a time with shared memory, from cooperative multitasking up to multi-cpu systems. it's debatable where you draw the line and say "this is concurrent, this is not", but i think it's reasonable to put that line at the point at which another bit of code can run at an unpredictable point in your code -- i.e. pre-emptive multitasking. and event loops are not on the concurrent side of that line.

I guess I consider the 'wait' time in tasks to be a part of the total task, so if you are waiting for I/O you can do something else "concurrently" when whatever you were doing is waiting for an interrupt or something

sarehu
Apr 20, 2007

(call/cc call/cc)
Having done Go a bit my biggest complaint is over keeping track of what the heck ":=" is doing to my already-declared variables and their scope.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Soricidus posted:

there's a range of models for running more than one bit of code at a time with shared memory, from cooperative multitasking up to multi-cpu systems. it's debatable where you draw the line and say "this is concurrent, this is not", but i think it's reasonable to put that line at the point at which another bit of code can run at an unpredictable point in your code -- i.e. pre-emptive multitasking. and event loops are not on the concurrent side of that line.
if your tasks are along the lines of "read a HTTP response" then it is useful and accurate to describe an event loop as (being capable of) performing those tasks concurrently.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
read lauer & needham y'all

Carthag Tuek
Oct 15, 2005

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



Gazpacho posted:

read lauer & needham y'all

              /


me: ehh

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
btw the dual to timeslicing in event-driven systems would be an event handler that has to do something CPU-intensive so it slices that up by throwing subtask events into its own queue but then it doesn't filter to ensure that it's only processing the subtasks and accidentally takes an external request from the queue before it has taken the last subtask.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
why would you slice an event up if you were going to put the queue in a filtered mode that only took those slices

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
so that the runtime can switch to other tasks waiting on other queues at each pop

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
ah, sure, makes sense

JawnV6
Jul 4, 2004

So hot ...
c is still awesome, hth

and a bonus

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!


JawnV6
Jul 4, 2004

So hot ...

yah camping is good too, i went up to mendocino to avoid the hell on earth of a 90+ sf

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

thats the guy what wrote the article

Asshole Masonanie
Oct 27, 2009

by vyelkin
wow what a loving mutant he is

post hole digger
Mar 21, 2011

JawnV6 posted:

yah camping is good too, i went up to mendocino to avoid the hell on earth of a 90+ sf

where did you go in mendocino where it wasnt even hotter

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

didnt know c developers were normal

JawnV6
Jul 4, 2004

So hot ...

my bitter bi rival posted:

where did you go in mendocino where it wasnt even hotter

state park right on the coast, hiked in to the primitive campsites ~2mi inland. was only like 80's?

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
C is a good language for writing C programs in

JewKiller 3000
Nov 28, 2006

by Lowtax

Gazpacho posted:

C is a good language for writing C programs in

a gun is a good tool for killing innocent children with

just because the tool is good at doing the job doesn't mean the job should be done

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

JewKiller 3000 posted:

a gun is a good tool for killing innocent children with

please try not to summon ESR

Workaday Wizard
Oct 23, 2009

by Pragmatica

Gazpacho posted:

C is a good language for writing C programs in

which c?

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
that guy really needs to learn the difference between a research article and a blog post

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

JewKiller 3000 posted:

a gun is a good tool for killing innocent children with
I wouldn't trust you with a gun or with C but that's your problem

Asshole Masonanie
Oct 27, 2009

by vyelkin

JewKiller 3000 posted:

a gun is a good tool for killing innocent children with

just because the tool is good at doing the job doesn't mean the job should be done

excellent username/post combo

Max Facetime
Apr 18, 2009

Gazpacho posted:

that guy really needs to learn the difference between a research article and a blog post

yeah what is this, this is way too coherent for a PL PDF

I mean, including C code and not pseudo code, that's so.... explicit

Cybernetic Vermin
Apr 18, 2005

Gazpacho posted:

that guy really needs to learn the difference between a research article and a blog post

where, to be clear, the difference is that the people who produce the former have to pretend there is a deep difference to preserve: 1) an archaic system of academic publishers; and; 2) their own continued existence within a byzantine funding system which has an concept of "merit" derived mostly from the publishers of point 1

Cybernetic Vermin
Apr 18, 2005

(my funding is secure through 2018 so i am comfortable talking poo poo for a little while yet)

Workaday Wizard
Oct 23, 2009

by Pragmatica
why do academic journals insist on the bad two column layout, bad font, bad spacing, bad page size, and bad writing style?

Cybernetic Vermin
Apr 18, 2005

you need to name some names there, because for all the hate i already heaped on publishers above i must say i usually come away impressed with the quality of work they put into cleaning up manuscripts only a handful of people ever read

Workaday Wizard
Oct 23, 2009

by Pragmatica
i dunno man. all of them?

everytime i open a paper its always the same lovely 2 col layout. i just love it when a sentence runs six lines and have 3 words hyphenated to the next line.

oh and you almost never get a glossary for any terms introduced in the paper. nor will you get an index or a table of content for long papers.

in conclusion, academic paper layout blows goats QED

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=

Shinku ABOOKEN posted:

in conclusion, academic paper layout blows goats ∎

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