Cultural Diffusion of Programming Languages

Cultural Diffusion of Programming Languages preview image

1 collaborator

Sergi_valverde Sergi Valverde (Author)

Tags

cultural evolution  

Tagged by Sergi Valverde over 9 years ago

diffusion of technology 

Tagged by Sergi Valverde over 9 years ago

multilingualism 

Tagged by Sergi Valverde over 9 years ago

programming languages 

Tagged by Sergi Valverde over 9 years ago

software 

Tagged by Sergi Valverde over 9 years ago

Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.0.5 • Viewed 837 times • Downloaded 73 times • Run 0 times
Download the 'Cultural Diffusion of Programming Languages' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

This model demonstrates the effect of “positive feedback” in the diffusion of programming language innovations. This is an implementation of the model described in the paper “A Cultural Diffusion Model for the Rise and Fall of Programming Languages” by Sergi Valverde and Ricard V. Sole (submitted for publication in Human Biology). For a detailed discussion and analysis of this model, the reader is encouraged to refer to our paper (check the 'Files' tab).

Positive feedback (also called “increasing returns to scale” in the economic literature) refers to social amplification effects that are beneficial for the rich and harmful for the poor. Sometimes, the less fit option rises to full market domination because “the more users a given technology has, the larger the chances that other users will acquire it”. That is, the more frequent option dominates over the initially less popular options.

HOW IT WORKS

The model consists of a static population of developers and a fixed pool of programming languages. Each developer is located at each patch of the lattice. Similarly to Axelrod’s model of cultural dissemination (see reference at the end), the programming culture of a developer is described by a vector that holds a certain number of languages from 1 to M. Initially, all developers (patches) do not use any language. At each time step, patches update its cultural value following three rules: (1) “Innovation” a developer ‘discovers’ a new language chosen at random with certain probability; (2) “Adoption” this is a contact-like process between neighbouring developers. One of the neighbour patches is selected at random and one language is adopted with a probability that is proportional to its frequency in the population. (3) “Forgetting” patches discard one language at random with some probability. Rare languages are discarded more frequently.

HOW TO USE IT

Choose the population size selecting the size of the lattice in x and y directions and input these values on “model settings”. Every patch has a color which represents the diversity of adopted languages (check the function ‘transfer_colormap’ to learn how the mapping is performed). The mapping was been designed to indicate the presence (or absence) of language diversity. If two patches show the same color, it is because they have adopted exactly the same programming languages. The user interface presents four input boxes for the following parameters: probability of innovation, probability of adoption, probability of forgetting and maximum number of distinct languages. The qualitative behaviour of the model is quite robust to a wide range of parameter values.

THINGS TO NOTICE

This is a minimal model of programming language adoption based in popularity rankings. The model can reproduce the empirical distribution of language popularity, e.g., the TIOBE index (http://www.tiobe.com/tiobe_index?page=index). The frequency-rank distribution of language popularity follows a generalised beta distribution (DGBD) (Martinez-Mekler et al, 2009).

Models like this can help us to understand why some technologies success (or fail) within a competitive environment. According to the simulated dynamics of technological adoption, a large percentage of existing programming languages will be abandoned in the short/mid-term.

THINGS TO TRY

Vary the population size, the maximum number of languages that can coexist in the community and the probabilities of innovation and adoption. How language diversity depends on variable innovation rates?

EXTENDING THE MODEL

Future work should extend the model in order to take into account specific features of programming languages, like the existence of specific technological niches or the cognitive characteristics of specific languages.

NETLOGO FEATURES

The implementation uses the ‘array’ extension (this extension comes pre-packaged with Netlogo 5.0). It is possible to adapt this model to use lists but the array extension makes the model run faster.

RELATED MODELS

This model is related to the “Urban Suite — Positive Feedback” found in the Netlogo Models Library and also to community implementations of the Axelrod’s model of Cultural Dissemination.

CREDITS AND REFERENCES

This model has been developed by Sergi Valverde and Ricard Solé. It was implemented by Sergi Valverde (svalver@gmail.com). This is the paper were the model was first described:

Valverde, S., Solé, R. V. (2015) A Cultural Diffusion Model for the Rise and Fall of Programming Languages, Human Biology 87(3), 224-234.

In the following paper there is related network analysis of programming language evolution:

Valverde, S., Solé, R. V. (2005) Punctuated Equilibrium in the Large-Scale Evolution of Programming Languages, J. Roy. Soc. Interface, 12(107) 20150249. doi: 10.1098/rsif.2015.0249.

The generalised beta distribution has been described here:

Martinez-Mekler, G., Martínez, R. A., del Ro, M. B., Mansilla R., Miramontes, P., and Cocho, G. (2009) Universality of Rank-Ordering Distributions in the Arts and Sciences PLoS ONE 4(3): e4791.

This is the paper where Axelrod presented his model of cultural dissemination:

Axelrod, R. 1997. “The dissemination of culture - A model with local convergence and global polarization.” Journal of Conflict Resolution 41:203-226.

HOW TO CITE

If you mention this model in a publication, we will ask that you include this citation for the model itself:

Valverde, S., Solé, R. V. (2015) A Cultural Diffusion Model for the Rise and Fall of Programming Languages, Human Biology 87(3), 224-234.

COPYRIGHT AND LICENSE

Copyright 2015 Sergi Valverde.

CC BY-NC-SA 3.0

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Sergi Valverde at svalver@gmail.com.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

; A Model of Cultural Diffusion of Programming Languages
; Sergi Valverde and Ricard Solé
; May, 15th (2015)
; The array extension requires Netlogo 5.0
extensions [array]
globals 
[
  num-iter 
  max-capacity
  census
]

patches-own [
  ; the programming culture of a developer is described by a list holding up to 'max-capacity' languages  
  langj
]

to setup
  set num-iter 0
  set max-capacity 3
  set census array:from-list n-values ( 1 + MaxLang ) [5]
 
  ; set empty lists
  ask patches 
  [
;     set langj  (list (1 + random MaxLang )  (1 + random MaxLang ) ( 1 + random MaxLang ))
    set langj (list)
  ]
  transfer_colormap
end 

to plot-census
  clear-plot
 ; foreach n-values array:length census [?] 
 let llista sort-by > array:to-list census
  foreach llista
  [ 
    plot log ? 10 
  ]
end 

to transfer_colormap
  ask patches
  [
    let langs sort-by > langj
    let r 0
    let g 0
    let b 0
    let len length langs
    if len > 0 [
      set r (item 0 langs) / (1 + MaxLang)
    ]
    if len > 1 [
      set g (item 1 langs) / (1 + MaxLang)
    ]
    if len > 2 [
      set b (item 2 langs) / (1 + MaxLang)
    ]
    set pcolor rgb  (255.0 * r)  (255.0 * g) (255.0 * b)
  ]  
end 

; Weighted random draw from a list, options: 
; 1) Use the NetLogo/Rnd-Extension
; 2) http://stackoverflow.com/questions/22615519/netlogo-weighted-random-draw-from-a-list-how-to-use-rnd-extension

to-report weighted-rand-index2 [ values probs ]
  let i -1
  let found false
  let nc length probs
  while [(not found) ]
  [
    set i random nc
    let p item i probs
    if ( random-float 1.0 < p ) or ( p >= 0.9999999999 )
    [
       set found true 
    ]
  ]
  report i 
end 

 
; this is executed in patch context

to-report least-frequent-known [lan C ] ; langj census
  if C = 0 [   ; Is this a "Memento" world?
    report -1
  ]
  if length lan = 0 [ ; An ignorant programmer?  
    report -1
  ]
  if length lan = 1 [
    report 0 
  ]
  let prob map [ 1.0 - ((array:item census ?) / C) ] lan
  report  weighted-rand-index2 lan prob
end 

; this is executed in patch context

to-report most-frequent-known [ lan C ] ; langj census
  if C = 0 [   ; Is this a "Memento" world?
    report -1
  ]
  if length lan = 0 [ ; An ignorant programmer?  
    report -1
  ]
  if length lan = 1 [
    report 0 
  ]
  let prob map [ ((array:item census ?) / C) ] lan
  report weighted-rand-index2 lan prob
end 

to adoption 
   let check true
    
    ; Rule #1: Innovation 
    if (random-float 1.0 < ProbInnov) 
    [
      ; check if this developer has some free memory slots
      if length langj < max-capacity
      [
        ; discover one random language
        let l (1 + random MaxLang)
        
        ; is this new  ?
        if not member? l langj 
        [
          set langj lput l langj
          
           ; update census[l] ++; 
          array:set census l (array:item census l + 1)
        ]
      ]
      set check false
    ]
    
    ; Rule #2: Adoption
    if (random-float 1.0 < ProbAdoption) and check
    [
      ; pick one random neighbor
      let n one-of neighbors
      
      ; source(n) knows at least one language
      let langv [langj] of n
      if length langv > 0
      [
          ; compute normalization constant
        let C (sum array:to-list census)
        
        ; learn  the most frequent language  
         let lv item  (most-frequent-known langv C) langv
         
         ; check whether lv is a new language for the target j
         if not member? lv langj 
         [
            let lenj length langj 
            if lenj >= max-capacity
            [
              ; random replacement 
              let i random lenj 
              let f item i langj   
              set langj remove-item i langj   
              array:set census f (array:item census f - 1)              
            ]
            set langj lput lv langj
            array:set census lv (array:item census lv + 1)
         ]
      ]
      set check false
    ]
    
    ; Rule #3: Language Forgetting
    if (random-float 1.0 < ProbForget) and check
    [
      ; at least knows 2 different languages (one will be forgotten)
      if length langj > 1 
      [
        ; compute normalization constant
        let C (sum array:to-list census)
        
         ; remove the least frequent language
         let i (least-frequent-known langj C)
         let f item i langj 
         
         ; update census[l] --; 
         array:set census f (array:item census f - 1)
         
         ; forget 
         set langj remove-item i langj        
       ]
    ]
end 

to go   
  ; pick a random developer
  ;  let p one-of patches
  
  ; ask p  
  ask patches
  [ 
   adoption
  ] 
  
   transfer_colormap
 
  plot-census
  set num-iter num-iter + 1
end 

There are 2 versions of this model.

Uploaded by When Description Download
Sergi Valverde over 9 years ago Additional information about the model. Download this version
Sergi Valverde over 9 years ago Initial upload Download this version

Attached files

File Type Description Last updated
A cultural diffusion model of programming languages.pdf pdf This is the paper were the model was first described: Valverde, S., Solé, R. V. (2015) "A Cultural Diffusion Model for the Rise and Fall of Programming Languages" Human Biology 87(3), 224-234. over 9 years ago, by Sergi Valverde Download
Cultural Diffusion of Programming Languages.png preview Preview for 'Cultural Diffusion of Programming Languages' over 9 years ago, by Sergi Valverde Download

This model does not have any ancestors.

This model does not have any descendants.