Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Trends in programming languages

1,312 views

Published on

Published in: Technology
  • Be the first to comment

Trends in programming languages

  1. 1. Trends in Programming Languages Anton Moldovan @AntyaDev
  2. 2. • Horse-power of many-core… • …but how to program those? Concurrent • Schematized, static, dynamic… • …so, what’s the sweet spot? Dynamic • New level of expressiveness… • …how about the essence? Functional
  3. 3. Dynamic Languages Simple and succinct Implicitly typed Meta-programming No compilation Static Languages Robust Performant Intelligent tools Better scaling
  4. 4. • non-schematized data • • • • Metaprogramming • •
  5. 5. Theory of Computation (Lambda Calculus, Alonzo Church) LISP Heritage Reality of Hardware Fortran Heritage (Memory, John Von Neumann) ML SmallTalk C Java C++ C# Scheme Haskell
  6. 6. var res = xs.Where(C# x => x % 2 == 0); Visual Basic Dim res = xs.Where(Function(x) x Mod 2 = 0) F# let res = xs |> Seq.filter (fun x -> x % 2 = 0); var res = xs.filter(function(x) { return x % 2 == 0; }); JavaScript auto res = find_if(xs.begin(), xs.end(), [] (int i) { return x % 2 == 0; }); C++11
  7. 7. First class functions FP Immutable data Referential transparency Algebraic data types Type inference Pattern matching Essence Niceties
  8. 8. Visual Studio .NET Functional F#
  9. 9. Type Inference
  10. 10. “Local” Inference • Confine your focus to a single declaration • Compute the type directly • Move on to the next one… • Can't infer parameter types…
  11. 11. Pros • Mostly intuitive behavior • Very simple to implement • (the compiler does this work anyway)
  12. 12. “Global” Inference • Look at the literals • Look at the functions and other values something interacts with • Look at any explicit type constraints • If there are no constraints anywhere, automatically generalize to generic types
  13. 13. function printLabel(labelledObj: {label: string}) { console.log(labelledObj.label); } var myObj = {size: 10, label: "Size 10 Object"}; printLabel(myObj);
  14. 14. //start an instance of the firefox browser start firefox //go to url url "http://lefthandedgoat.github.io/canopy/testpages/" //assert that the element with an id of 'welcome' has //the text 'Welcome‘ "#welcome" == "Welcome"
  15. 15. project "F# DSL Article" starts "01/01/2009" resource "Dmitri" isa "Writer" with_rate 140 resource "Computer" isa "Dumb Machine" with_rate 0 group "DSL Popularization" done_by "Dmitri" task "Create basic estimation DSL" takes 1 day task "Write article" takes 1 day task "Post article and wait for comments" takes 1 week group "Infrastructure Support" done_by "Computer" task "Provide VS2010 and MS Project" takes 1 day task "Download and deploy TypograFix" takes 1 day task "Sit idly while owner waits for comments" takes 1 week prepare my_project

×