Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Владимир Дашукевич (Квартирник)

Avatar for FrontFest FrontFest
November 21, 2017

Владимир Дашукевич (Квартирник)

Avatar for FrontFest

FrontFest

November 21, 2017
Tweet

More Decks by FrontFest

Other Decks in Programming

Transcript

  1. Вопросы на сегодня: 1. Будет ли Javascript заменен другим языком?

    2. Строгая типизация в JavaScript? 3. Что нового ожидается в JavaScript? 4. Чего не хватает в JavaScript? 1
  2. Что такое WebAssembly: WebAssembly or wasm is a new portable,

    size- and load-time-efficient format suitable for compilation to the web. webassembly.org “ 4
  3. 5

  4. 6

  5. 7

  6. 8

  7. 9

  8. Для чего можно его использовать: 1. Трудоемкие задачи 2. Алгоритмы

    обработки изображений 3. Алгоритмы обработки видео 4. Алгоритмы криптографии 12
  9. 15

  10. 17

  11. 19

  12. 21

  13. export class Vector3D { x:float32; y:float32; z:float32; constructor(x:float32, y:float32, z:float32){

    this.x = x; this.y = y; this.z = z; } } 01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 24
  14. 27

  15. 29

  16. 33

  17. Языки программирования: 1. Dart 2. TypeScript 3. Kotlin 4. Elm

    5. PureScript 6. Reason 7. Haxe 8. Nim 9. и другие 37
  18. class Point { final double x, y; const Point(this.x, this.y);

    bool get isInsideUnitCircle => x * x + y * y <= 1; } 01. 02. 03. 04. 05. 39
  19. class Person { private name: string; private age: number; constructor(name:

    string, age: number) { this.name = name; this.age = age; } toString(): string { return `${this.name} (${this.age})`; } 01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 41
  20. package html fun main(args: Array<String>) { val result = html

    { head { title { +"XML encoding with Kotlin" } } ul { for (arg in args) li { +arg } }} println(result) } 01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 43
  21. 45

  22. 47

  23. 49

  24. 51

  25. 53

  26. 56

  27. Atomics 1. add 2. and 3. compareExchange 4. exchange 5.

    load 6. or 7. store 8. sub 9. xor 63
  28. var sab = new SharedArrayBuffer(1024); var int32 = new Int32Array(sab);

    // первый Worker Atomics.wait(int32, 0, 0); console.log(int32[0]); // 123 // второй Worker console.log(int32[0]); // 0; Atomics.store(int32, 0, 123); Atomics.wake(int32, 0, 1); 01. 02. 03. 04. 05. 06. 07. 08. 09. 65
  29. let i32 = new Int32Array(sab) ... lock.lock() i32[1] = i32[2]

    + i32[3]; i32[0] += 1 lock.unlock() 01. 02. 03. 04. 05. 06. 67
  30. var napa = require('napajs'); var zone1 = napa.zone.create('zone1', { workers:

    4 }); zone1.broadcast('console.log("hello world");'); zone1.execute((text) => text, ['hello napa']) .then((result) => { console.log(result.value); }); 01. 02. 03. 04. 05. 06. 07. 08. 69
  31. // Rest let { x, y, ...z } = {

    x: 1, y: 2, a: 3, b: 4 }; x; // 1 y; // 2 z; // { a: 3, b: 4 } // Spread let n = { x, y, ...z }; n; // { x: 1, y: 2, a: 3, b: 4 } 01. 02. 03. 04. 05. 06. 07. 08. 75
  32. async function* readLines(path) { let file = await fileOpen(path); try

    { while (!file.EOF) { yield await file.readLine(); } } finally { await file.close(); } } 01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 78
  33. 82

  34. 84

  35. 89

  36. function getEncoder(encoding) { const encoder = encoding === "utf8" ?

    new UTF8Encoder() : encoding === "utf16le" ? new UTF16Encoder(false) : encoding === "utf16be" ? new UTF16Encoder(true) : throw new Error("Unsupported encoding"); } 01. 02. 03. 04. 05. 06. 92
  37. [0, 1, 2, 3, 4, 5].flatMap(x => [x, x +

    1]); // [0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6] 01. 02. 94
  38. interface Observable { constructor(subscriber : SubscriberFunction); subscribe(observer : Observer) :

    Subscription; subscribe(onNext : Function, onError? : Function, onComplete? : Function) : Subscription; } 01. 02. 03. 04. 05. 06. 07. 97
  39. // old style var street = user.address && user.address.street; //

    new style var street = user.address?.street || "Some street"; var input = myForm.querySelector('input[name=foo]')?.value 01. 02. 03. 04. 05. 99
  40. interface Iterable { [Symbol.iterator]() : Iterator; } interface Iterator {

    next() : IteratorResult; } interface IteratorResult { value: any; done: boolean; } 01. 02. 03. 04. 05. 06. 07. 08. 09. 10. 101
  41. 102

  42. Stage 0 1. Pattern matching 2. Cancellation 3. Additional Meta

    Properties 4. Zones 5. Shorthand Improvements 6. Structured Clone 103