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.
It	was	finally	Christmas:	
Perl	6	is	here!	
Wim	Vanderbauwhede
School	of	Compu6ng	Science
University	of	Glasgow
“Language	is	
ideology”
Kress,	Gunther,	et	al.	"Language	as	ideology."	(1982).
A	trip	down	memory	lane
2007
•  Perl6/Pugs	invited	talk	at	POPL	2007	
•  Audrey	Tang	had	created	Pugs,	a	Perl	6	
implementa6on	in	Haskell	
•  Perl	6	wa...
Perl	6meline
Dow	Jones		index,	1985-2015
Context
hZp://www.codeeval.com/
Context	
TIOBE	Index	for	February	2016,	hZp://www.6obe.com/
Popularity	of	programming	languages	–	TIOBE
Context
TIOBE	Index	for	February	2016,	hZp://www.6obe.com/
Popularity	of	programming	languages	–	TIOBE
Perl
Neil	Stephenson,	“Cryptonomicon”,		p480
Perl	5
•  Interpreted	
•  Dynamically	typed	
•  Garbage	collec6on	
•  In	that	sense	very	similar	to	JavaScript,	
Python,	R...
Perl	5
•  Uses	funny	characters	for	typing:	
				$:	scalar	
				@:	array	(list)	
				%:	hash	(dic6onary,	map)	
				&:	subr...
Perl	5
•  But	also:	
•  Lexical	scoping	
•  Higher-order	func6ons	
•  Anonymous	func6ons	
•  Closures
Perl	6
•  Is	a	new	language,	not	backward	
compa6ble	with	Perl	5.	
•  S6ll	mostly	Perl	
•  But	a	modern	language
Compiler	and	VM
Compiler	(Rakudo)
hZps://github.com/rakudo/rakudo
VM	(MoarVM)
•  Meta-object	protocol	based	
•  Precise,	genera6onal,	and	parallel	GC	
•  First-class	code	objects,	closures...
Grammars
Parsing
• 	Perl	6	has	Grammars,	Rules,	Tokens	and	Regexes	as	
part	of	the	language	
• 	Similar	to	classes	but	used	to	orga...
Objects
JavaScript	 Python	
Objects
Perl	6	Objects
Perl	6	Objects
Roles
Perl	6	Objects
• 	Accessors	for	free
• 	Default	constructor
• 	Inheritance	
• 	Roles	(mixins)
• 	Built	on	a	Meta	Object	Pr...
But	wait	…
Perl	6	Objects
Perl	6	Objects
Gradual	typing!
Gradual	typing
• 	By	default	variables	are	dynamically	typed.	
• 	Explicitly	typed	variables	are	sta6cally	typed.	
• 	But	...
Gradual	typing:	subsets
• 	Type	constraint	checked	at	run	6me
Gradual	typing:	type	capture
• 	Defer	the	specifica6on	of	a	type	constraint	to	the	
6me	the	func6on	is	called.		
• 	Allows	...
Gradual	typing:	type	capture
• 	Defer	the	specifica6on	of	a	type	constraint	to	the	
6me	the	func6on	is	called.		
• 	Allows	...
Roles
Roles
• 	Basis	for	the	Perl	6	type	system		
• 	Used	for	composi6on	and	mixins	
• 	In	Perl	6,	the	“funny	characters”	are	sy...
No	more	funny	characters!
• 	Actually,	the	“funny	characters”	are	now	op6onal:
Polymorphic	func6ons
• 	Also	known	as	mul6ple	dispatch
Polymorphic	func6ons
• 	Also	known	as	mul6ple	dispatch
Polymorphic	func6ons
• 	Looks	familiar?
Parametric	roles
• 	Roles	that	take	one	or	more	type	variables
Possibly	Maybe
FuncHonal	
programming
Func6onal	features
• 	Higher-order	func6ons	
• 	Anonymous	func6ons	(lambdas)		
• 	Currying	
• 	Immutable	lists,	lazy	evalu...
Type	capture	revisited
• 	Type	capture	also	works	with	closures	and	lambdas
Lazy	lists
• 	Perl	6	dis6nguishes	between	sequences,	lists	and	
arrays.	
• 	Sequences	are	immutable,	but	are	consumed	
whe...
Seq	and	List
Array
Promises
Concurrency
• 	High-level	
• 	Promises	(futures)	
• 	Channels	
• 	Supplies	
• 	Low-level	
• 	Threads	
• 	Schedulers	
• 	Lo...
Promises
Conclusion
• 
Thank you!
It was finally Christmas: Perl 6 is here!
Upcoming SlideShare
Loading in …5
×

It was finally Christmas: Perl 6 is here!

13,341 views

Published on

In this talk I introduce Perl 6 and some of its exciting new features, especially gradual typing, roles and some functional programming features like lazy lists.
This talk was given at the Scottish Programming Languages Seminar on 24th Feb 2016 at the School of Computing Science of Glasgow University.

Published in: Software
  • Vedrò dopo le vacanze all'hotel trentino www.hoteltevini.com/it/
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • You can try to use this service ⇒ www.HelpWriting.net ⇐ I have used it several times in college and was absolutely satisfied with the result.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • https://legitpillsstore.com/ Text or call ;+1(917)-790-5806 WHATSAPP ……. +1(917)-790-5806  wiickr me ; petersonericson ORDER QUALITY OXYCOTIN , PERCOCET , NORCO, XANAX,VALIUM , U-47700,MORPHINE VIAL , HYDROCODONE, Oxycodone,ACTAVIS PROMETHAZINE,KETAMINE CRYSTAL ETC  https://legitpillsstore.com/ Text or call ;+1(917)-790-5806  WHATSAPP ……. +1(917)-790-5806  wiickr me ; petersonericson We offer medicines like, pain pills, pain relief, diet pills, weight loss, sleeping pills, anti-anxiety, anti-depression…etc.our products are of high standard qualities SERIOUS BUYERS ONLY. SAMPLE HUNTERS PLEASE EXCUSE Am not a cop or feds agent so please don’t contact me and ask if am one . Also i don’t do cod and i don’t want bull####. Will offer my help to those who are legitimately in need of their medications. . 1-Delivery & quality Guaranteed 100%. 2-Express Delivery Available with UPS,FedEx,EMS. 3-Tracking numbers available with references. 4-Shipping secure and discreet ,Delivery time.1-5 days depending on location. 5-Additional Discounts on Bulk Orders 6-Best Prices, Discreet Shipping https://legitpillsstore.com/ Text or call ;+1(917)-790-5806 WHATSAPP ……. +1(917)-790-5806 wiickr me ; petersonericson Below is a list of some of our product Nembutal ; powder,liquid and pills forms . Actavis Promethazine with Codeine purple cough syrup Klonopincovid 19 sterilized masks Opana 10, 20, 30 and 40 mg Xanax 1 mg Upjohn footbals Xanax 1 mg ( blue Ksalol) Xanax SR 2 mg ( brand Upjohn) Xanax 2 mg ( Pfizer LongBars) Valium 10 mg Bensedine Valium 2mg, 5mg and 10mg Oxycodone-APAP ( Wattson labs) and ( Physicians tc.) 10/ 325mg Oxycontin 20mg, 40mg and 80mg Norco Yellow tabs Watson fentanyl brand name: duragesic 5-12 12.5 mcg/hr patches box Demerol ( Meperidine HCL) caps 8 ACTAVIS PROMETHAZINE KETAMINE CRYSTAL EPHEDRINE AMBIEN 10MG morphine 30MG WATSON 325 10MG WATSON 853 10MG VICODIN 5MG VICODIN ES 7.5MG EPHEDRINE 30MG Celebrex 100mg Codeine 15mg Hydrocodone Watson 540 10/ 325 WATSON 540 10/ 500 OXYCOTIN 80MG OXYCOTIN 20MG, 40MG HYDROCODONE 10MG/500MG HYDROCODONE 5MG/500MG METHADONE 10MG, 40MG WAFERS Lorcet – ( Hydrocodone Bitartrate/ Acetaminophen) 10 mg/ 650 mg AMBIEN ( Zolpidem, Stilnox) 10 mg seconal (chemical name-secobarbital) LO LOESTRIN FE ADIPEX-P 37.5MG ###### 100MG Lorazepam 2.5 mg ( Ativan) Clonazepam 2 mg ( Rivotril) CIALIS 20MG Percocet 10/ 325 Norco – ( Hydrocodone Bitartrate/ Acetaminophen ) 5 mg/ 325 mg Percocet 5/ 325 endocet 10/ 325 hydrocodone-ibuprofen (brand name:vicoprofen) suboxone subutex watson 540 Dilaudid 8mg Soma 350mg Adderall 30mg Ritalin 10mg Tramadol ( Ultram) 50mg ibrpohen advil pm Atarax 25mg gold FIORICET (BUTALBITOL 50MG) – MIKART Hydrocodone 539 Roxicodone 15mg, 30mg Opana 40mg Growth Hormones Ansomone, Hygetropin, Kigtropin, Igtropin IGF, Jintropin , HGH Blue Top, IGF-1LR3 and many more not listed *Green Crack……………….. Grade: AA *sour Diesel ……………..Grade: A+ Top Shelf *Grand Daddy Purple …………………Grade: A *Sensi Star x ak47 …………….Grade: AAA *Afghan Kush ………………….Grade: A *Northern Lights #5 ……………….Grade: A+ *Lemon drop………………Grade: A+ *Purple Kush………………Grade:A+ Top Shelf *OG Kush ……………Grade:A++ Top Shelf *purple-urkle…………..Grade: A- Just place your orders. Overnight shipping within USA, to Australia,Canada, UK, Germany, Sweden ,SPAIN New Zealand, Etc. WE HAVE ABOUT 400 DIFFERENT PRODUCTS IN STOCK Delivery & quality Guaranteed 100%. Express Delivery Available with UPS,FedEx,EMS..DHL Order details Full name …. Street / house address ….. Postcode: …………………. City / Town ………………………. Region / State ………………….. Country …………………………………. Exact product………………………………… Exact Quantity……………………………….. TRACKING NUMBER AVAILABLE Dr.ERICSON https://legitpillsstore.com/ Text or call ;+1(917)-790-5806 WHATSAPP ……. +1(917)-790-5806 wiickr me ; petersonericson Thanks For You are all welcome Dr.ERICSON ……………….
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://fb2pdfbooks.com/ } ......................................................................................................................... Download Full EPUB Ebook here { http://fb2pdfbooks.com/ } ......................................................................................................................... Download Full doc Ebook here { http://fb2pdfbooks.com/ } ......................................................................................................................... Download PDF EBOOK here { http://fb2pdfbooks.com/ } ......................................................................................................................... Download EPUB Ebook here { http://fb2pdfbooks.com/ } ......................................................................................................................... Download doc Ebook here { http://fb2pdfbooks.com/ } ......................................................................................................................... ......................................................................................................................... ...................................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://fb2pdfbooks.com/ } ......................................................................................................................... Download Full EPUB Ebook here { http://fb2pdfbooks.com/ } ......................................................................................................................... Download Full doc Ebook here { http://fb2pdfbooks.com/ } ......................................................................................................................... Download PDF EBOOK here { http://fb2pdfbooks.com/ } ......................................................................................................................... Download EPUB Ebook here { http://fb2pdfbooks.com/ } ......................................................................................................................... Download doc Ebook here { http://fb2pdfbooks.com/ } ......................................................................................................................... ......................................................................................................................... ...................................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

It was finally Christmas: Perl 6 is here!

  1. 1. It was finally Christmas: Perl 6 is here! Wim Vanderbauwhede School of Compu6ng Science University of Glasgow
  2. 2. “Language is ideology” Kress, Gunther, et al. "Language as ideology." (1982).
  3. 3. A trip down memory lane
  4. 4. 2007
  5. 5. •  Perl6/Pugs invited talk at POPL 2007 •  Audrey Tang had created Pugs, a Perl 6 implementa6on in Haskell •  Perl 6 was promised for "Christmas” •  And there was some delay …
  6. 6. Perl 6meline Dow Jones index, 1985-2015
  7. 7. Context hZp://www.codeeval.com/
  8. 8. Context TIOBE Index for February 2016, hZp://www.6obe.com/ Popularity of programming languages – TIOBE
  9. 9. Context TIOBE Index for February 2016, hZp://www.6obe.com/ Popularity of programming languages – TIOBE
  10. 10. Perl Neil Stephenson, “Cryptonomicon”, p480
  11. 11. Perl 5 •  Interpreted •  Dynamically typed •  Garbage collec6on •  In that sense very similar to JavaScript, Python, Ruby, …
  12. 12. Perl 5 •  Uses funny characters for typing: $: scalar @: array (list) %: hash (dic6onary, map) &: subrou6ne •  Incorporates a separate language: regular expressions (PCRE)
  13. 13. Perl 5 •  But also: •  Lexical scoping •  Higher-order func6ons •  Anonymous func6ons •  Closures
  14. 14. Perl 6 •  Is a new language, not backward compa6ble with Perl 5. •  S6ll mostly Perl •  But a modern language
  15. 15. Compiler and VM
  16. 16. Compiler (Rakudo) hZps://github.com/rakudo/rakudo
  17. 17. VM (MoarVM) •  Meta-object protocol based •  Precise, genera6onal, and parallel GC •  First-class code objects, closures, … •  Excep6ons •  Con6nua6ons •  Threads, mutexes, … •  JIT compila6on hZps://github.com/MoarVM/MoarVM
  18. 18. Grammars
  19. 19. Parsing •  Perl 6 has Grammars, Rules, Tokens and Regexes as part of the language •  Similar to classes but used to organize parsers •  Rules are lexeme parsers •  Tokens are token parsers •  Regexes are PCREs •  Perl 6 is parsed and executed using a Perl 6-style grammar.
  20. 20. Objects
  21. 21. JavaScript Python Objects
  22. 22. Perl 6 Objects
  23. 23. Perl 6 Objects Roles
  24. 24. Perl 6 Objects •  Accessors for free •  Default constructor •  Inheritance •  Roles (mixins) •  Built on a Meta Object Protocol •  Full introspec6on •  So s6ll nothing special …
  25. 25. But wait …
  26. 26. Perl 6 Objects
  27. 27. Perl 6 Objects
  28. 28. Gradual typing!
  29. 29. Gradual typing •  By default variables are dynamically typed. •  Explicitly typed variables are sta6cally typed. •  But type checks can be deferred to run 6me. •  Underlying theory: hZps://github.com/samth/gradual-typing-bib
  30. 30. Gradual typing: subsets •  Type constraint checked at run 6me
  31. 31. Gradual typing: type capture •  Defer the specifica6on of a type constraint to the 6me the func6on is called. •  Allows to refer to a type both in the signature and the func6on body.
  32. 32. Gradual typing: type capture •  Defer the specifica6on of a type constraint to the 6me the func6on is called. •  Allows to refer to a type both in the signature and the func6on body.
  33. 33. Roles
  34. 34. Roles •  Basis for the Perl 6 type system •  Used for composi6on and mixins •  In Perl 6, the “funny characters” are syntax for a set of predefined roles: @: Posi6onal (array) %: Associa6ve (hash) &: Callable (subrou6ne) •  So …
  35. 35. No more funny characters! •  Actually, the “funny characters” are now op6onal:
  36. 36. Polymorphic func6ons •  Also known as mul6ple dispatch
  37. 37. Polymorphic func6ons •  Also known as mul6ple dispatch
  38. 38. Polymorphic func6ons •  Looks familiar?
  39. 39. Parametric roles •  Roles that take one or more type variables
  40. 40. Possibly Maybe
  41. 41. FuncHonal programming
  42. 42. Func6onal features •  Higher-order func6ons •  Anonymous func6ons (lambdas) •  Currying •  Immutable lists, lazy evalua6on •  Tail call op6miza6on •  Op6onal immutable variables
  43. 43. Type capture revisited •  Type capture also works with closures and lambdas
  44. 44. Lazy lists •  Perl 6 dis6nguishes between sequences, lists and arrays. •  Sequences are immutable, but are consumed when iterated. •  Lists are immutable •  Arrays are mutable •  By defaults Seq, List and Array are lazy, but can be made eager.
  45. 45. Seq and List
  46. 46. Array
  47. 47. Promises
  48. 48. Concurrency •  High-level •  Promises (futures) •  Channels •  Supplies •  Low-level •  Threads •  Schedulers •  Locks
  49. 49. Promises
  50. 50. Conclusion • 
  51. 51. Thank you!

×