ข้ามไปเนื้อหา

ภาษาดาร์ต

จากวิกิพีเดีย สารานุกรมเสรี
Dart
กระบวนทัศน์Multi-paradigm: functional, imperative, object-oriented, reflective[1]
ออกแบบโดยLars Bak, Kasper Lund
ผู้พัฒนาGoogle
ปรากฏครั้งแรก10 ตุลาคม 2011; 15 ปีก่อน (2011-10-10)[2]
รุ่นเสถียร
3.13.7[3] แก้ไขบนวิกิสนเทศ / 22 ตุลาคม 2026; 18 วันก่อน (22 ตุลาคม 2026)
การกำหนดชนิดตัวแปร1.x: Optional
2.x: Inferred[4] (static, strong)
แพลตฟอร์มCross-platform
โอเอสCross-platform
สัญญาอนุญาตBSD
นามสกุลไฟล์.dart
เว็บไซต์dart.dev
ตัวแปลภาษาหลัก
Dart VM, dart2native, dart2js, DDC, Flutter
ได้รับอิทธิพลจาก
C, C++, C#, Erlang, Java, JavaScript, Ruby, Smalltalk, Strongtalk,[5] TypeScript[6]

ดาร์ต (Dart) เป็นภาษาโปรแกรมที่ออกแบบโดย Lars Bak และ Kasper Lund และพัฒนาโดยกูเกิล[7] สามารถใช้ในการพัฒนาโปรแกรมประยุกต์บนเว็บ และ แอปมือถือ ตลอดจนแอปพลิเคชันเซิร์ฟเวอร์ และ แอปพลิเคชันเดสก์ท็อป

ดาร์ตเป็นภาษาเชิงวัตถุอิงคลาส และมีการเก็บขยะ ที่มีวากยสัมพันธ์แบบภาษาซี[8] ดาร์ตสามารถทำการคอมไพล์ออกมาเป็นรหัสเครื่อง, จาวาสคริปต์ หรือ WebAssembly รุ่นล่าสุดของภาษาดาร์ตคือรุ่น3.13.7[3] แก้ไขบนวิกิสนเทศ

ความเป็นมา

[แก้]

ดาร์ตได้รับการเปิดตัวในการประชุม GOTO ใน ออร์ฮูส ประเทศเดนมาร์ก ระหว่างวันที่ 10-12 ตุลาคม พ.ศ. 2554[9] Lars Bak และ Kasper Lund เป็นผู้ก่อตั้งโครงการดาร์ต[10] ดาร์ต 1.0 เปิดตัวเมื่อวันที่ 14 พฤศจิกายน 2556[11]

ดาร์ต 2.0 ได้รับการเปิดตัวในเดือนสิงหาคม 2561 โดยมีการเปลี่ยนแปลงภาษารวมถึงระบบชนิดข้อมูล[12]

การป้องกันตัวชี้ที่เป็นโมฆะ

[แก้]

ตั้งแต่เวอร์ชัน 2.12 เป็นต้นไป ภาษาดาร์ตมีการป้องกันตัวชี้ที่เป็นโมฆะ (อังกฤษ: null safety)[13] สิ่งนี้เป็นการรับประกันว่าตัวชี้ที่เป็นโมฆะจะไม่สามารถเกิดขึ้นได้ เว้นแต่จะได้รับอนุญาตอย่างจัดแจ้ง

ฟลัตเตอร์

[แก้]

Google เปิดตัว Flutter สำหรับการพัฒนาแอพ ฟลัตเตอร์ถูกสร้างขึ้นโดยใช้ Dart, C, C++ และ Skia ฟลัตเตอร์เป็นเฟรมเวิร์ก UI ที่โอเพ่นซอร์สและหลายแพลตฟอร์ม ก่อน Flutter 2.0 นักพัฒนาสามารถกำหนดเป้าหมายได้เฉพาะ Android, iOS และเว็บเท่านั้น การเปิดตัว Flutter 2.0 เพิ่มการรองรับ macOS, Linux และ Windows ในรูปแบบเบต้า[14] Flutter 2.10 เปิดตัวพร้อมการสนับสนุนการผลิต (production support) สำหรับ Windows[15] และ Flutter 3 เปิดตัวการสนับสนุนการผลิตสำหรับแพลตฟอร์มเดสก์ท็อปทั้งหมด[16]

ตัวอย่าง

[แก้]

ตัวอย่างโปรแกรมเฮลโลเวิลด์

void main() {
  print('Hello, World!');
}

อ้างอิง

[แก้]
  1. ↑ Kopec, David (30 มิถุนายน 2014). Dart for Absolute Beginners. Apress. น. 56. ISBN 9781430264828. สืบค้นเมื่อ 24 พฤศจิกายน 2015.{{cite book}}: CS1 maint: date auto-translated (ลิงก์)
  2. ↑ Bak, Lars (10 ตุลาคม 2011). "Dart: a language for structured web programming". Google Code Blog. สืบค้นเมื่อ 31 มกราคม 2016.{{cite web}}: CS1 maint: date auto-translated (ลิงก์)
  3. 1 2 "Release 3.13.7". 22 ตุลาคม 2026. สืบค้นเมื่อ 23 ตุลาคม 2026.
  4. ↑ "The Dart type system". dart.dev.
  5. ↑ "Web Languages and VMs: Fast Code is Always in Fashion. (V8, Dart) - Google I/O 2013". YouTube. สืบค้นเมื่อ 22 ธันวาคม 2013.{{cite web}}: CS1 maint: date auto-translated (ลิงก์)
  6. ↑ "The Dart Team Welcomes TypeScript". 10 กันยายน 2019. สืบค้นเมื่อ 22 กุมภาพันธ์ 2020.{{cite web}}: CS1 maint: date auto-translated (ลิงก์)
  7. ↑ "A Bit About Dart - Learn Dart: First Step to Flutter". Educative: Interactive Courses for Software Developers (ภาษาอังกฤษ). สืบค้นเมื่อ 2023-06-20.
  8. ↑ "A Tour of the Dart Language". dart.dev. สืบค้นเมื่อ 2018-08-09.
  9. ↑ "Dart, a new programming language for structured web programming", GOTO conference (presentation) (opening keynote), Århus conference, 2011-10-10{{citation}}: CS1 maint: location missing publisher (ลิงก์)
  10. ↑ Ladd, Seth. "What is Dart". What is Dart?. O'Reilly. สืบค้นเมื่อ สิงหาคม 16, 2014.{{cite web}}: CS1 maint: date auto-translated (ลิงก์)
  11. ↑ "Dart 1.0: A stable SDK for structured web apps". news.dartlang.org. สืบค้นเมื่อ 2018-08-08.
  12. ↑ Moore, Kevin (2018-08-07). "Announcing Dart 2 Stable and the Dart Web Platform". Dart. สืบค้นเมื่อ 2018-08-08.
  13. ↑ Hracek, Filip (2020-06-10). "Announcing sound null safety". Dart (ภาษาอังกฤษ). สืบค้นเมื่อ 2023-05-12.
  14. ↑ Sells, Chris (2021-03-03). "What's New in Flutter 2.0". Flutter (ภาษาอังกฤษ). สืบค้นเมื่อ 2023-05-12.
  15. ↑ Sneath, Tim (กุมภาพันธ์ 3, 2022). "Announcing Flutter for Windows".{{cite web}}: CS1 maint: date auto-translated (ลิงก์)
  16. ↑ Chisholm, Kevin (2022-05-12). "What's new in Flutter 3". Flutter (ภาษาอังกฤษ). สืบค้นเมื่อ 2023-05-12.

แหล่งข้อมูลอื่น

[แก้]