fbpx
วิกิพีเดีย

ภาษาเอฟชาร์ป

ภาษาเอฟชาร์ป (F#) เป็นภาษาสำหรับเขียนโปรแกรมคอมพิวเตอร์แบบ strongly typed บนดอตเน็ตเฟรมเวิร์กและ Mono ที่สนับสนุนโมเดลการเขียนโปรแกรมหลายแบบรวมทั้ง การเขียนโปรแกรมเชิงฟังก์ชัน การเขียนโปรแกรมเชิงวัตถุ และการเขียนโปรแกรมเชิงคำสั่ง F# เป็นภาษาดอตเน็ต สามารถเรียกใช้เอพีไอของดอตเน็ต และถูกเรียกจากภาษาดอตเน็ตอื่นๆ นอกจากนั้น F# ยังสามารถถูกใช้กับโปรแกรมประยุกต์บนเว็บ เขียนโปรแกรมสำหรับหน่วยประมวลผลกราฟิกส์ หรือ GPU และใช้เขียนโปรแกรมสำหรับแมคโอเอสเท็น ไอโอเอส และ แอนดรอยด์ โดยใช้ Programming tool สร้างโดยบริษัท Xamarin

ประวัติ

F# ถูกเริ่มสร้างโดย Don Syme และทีม ที่ Microsoft Research โดยมีพื้นฐานมาจากภาษา OCaml (ซึ่งเป็นภาษาในตระกูลภาษา ML)

ปัจจุบันภาษาเอฟชาร์ปได้ถูกโอเพนซอร์ส และพัฒนาโดย F# Software Foundation, Microsoft, และผู้พัฒนาทั่วๆไป

ภาพรวม

F# เป็นภาษาแบบ strongly typed ที่สนับสนุนโมเดลการเขียนโปรแกรมหลายแบบ รวมทั้งการเขียนโปรแกรมเชิงฟังก์ชัน การเขียนโปรแกรมเชิงวัตถุ และการเขียนโปรแกรมเชิงคำสั่ง โดยที่ทุกอย่างในเช่นฟังก์ชัน control flows ใน F# เป็น expression ที่มี type หรือ โครงสร้างข้อมูล ที่สามารถถูกประกอบเข้ากันได้

โครงสร้างข้อมูลที่สำคัญที่มีใน F# ได้แก่:

  • Unit ซึ่งคล้ายกับ Void ในภาษาตระกูลภาษาC
  • Tuple
  • Record
  • Discriminated unions
  • List
  • Option

โปรแกรมตัวอย่าง

โปรแกรมหา Factorial

> let rec fact = function | 0 -> 1 | n -> n * fact(n-1);; val fact : int -> int 

ผลลัพธ์

> fact 12;; val it : int = 479001600 

วินโดวส์ฟอร์ม

open System.Windows.Forms let form = new Form() do form.Visible <- true do form.TopMost <- true do form.Text <- "Welcome to F#" let x = 3 + (4 * 5) do form.Text <- (if x = 23 then "Correct!" else "incorrect") 

อ้างอิง

  1. The F# Software Foundation. "Using F# with HTML5 Web Applications". สืบค้นเมื่อ 2014-06-07.
  2. The F# Software Foundation. "Using F# for GPU Programming". สืบค้นเมื่อ 2014-06-07.
  3. The F# Software Foundation. "Use F# on Mac OSX". สืบค้นเมื่อ 2014-06-07.
  4. The F# Software Foundation. "Use F# for iOS App Development". สืบค้นเมื่อ 2014-06-07.
  5. The F# Software Foundation. "Use F# for Android Development". สืบค้นเมื่อ 2014-06-07.
  6. ผู้ร่วมสร้าง F#
  7. F# ที่ Microsoft Research
  8. Contributing to the F# Language, Library and Tools

ดูเพิ่ม

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

  • แหล่งข้อมูลสำหรับ F#
  • The F# Software Foundation
  • หนังสือ Développement d'applications avec Objective Caml

ภาษาเอฟชาร, เป, นภาษาสำหร, บเข, ยนโปรแกรมคอมพ, วเตอร, แบบ, strongly, typed, บนดอตเน, ตเฟรมเว, กและ, mono, สน, บสน, นโมเดลการเข, ยนโปรแกรมหลายแบบรวมท, การเข, ยนโปรแกรมเช, งฟ, งก, การเข, ยนโปรแกรมเช, งว, ตถ, และการเข, ยนโปรแกรมเช, งคำส, เป, นภาษาดอตเน, สามารถเร,. phasaexfcharp F epnphasasahrbekhiynopraekrmkhxmphiwetxraebb strongly typed bndxtentefrmewirkaela Mono thisnbsnunomedlkarekhiynopraekrmhlayaebbrwmthng karekhiynopraekrmechingfngkchn karekhiynopraekrmechingwtthu aelakarekhiynopraekrmechingkhasng F epnphasadxtent samartheriykichexphiixkhxngdxtent aelathukeriykcakphasadxtentxun nxkcaknn F yngsamarththukichkbopraekrmprayuktbnewb 1 ekhiynopraekrmsahrbhnwypramwlphlkrafiks hrux GPU 2 aelaichekhiynopraekrmsahrbaemkhoxexsethn 3 ixoxexs 4 aela aexndrxyd 5 odyich Programming tool srangodybristh Xamarin enuxha 1 prawti 2 phaphrwm 3 opraekrmtwxyang 3 1 opraekrmha Factorial 3 2 winodwsfxrm 4 xangxing 5 duephim 6 aehlngkhxmulxunprawti aekikhF thukerimsrangody Don Syme aelathim 6 thi Microsoft Research 7 odymiphunthanmacakphasa OCaml sungepnphasaintrakulphasa ML pccubnphasaexfcharpidthukoxephnsxrs 8 aelaphthnaody F Software Foundation Microsoft aelaphuphthnathwipphaphrwm aekikhF epnphasaaebb strongly typed thisnbsnunomedlkarekhiynopraekrmhlayaebb rwmthngkarekhiynopraekrmechingfngkchn karekhiynopraekrmechingwtthu aelakarekhiynopraekrmechingkhasng odythithukxyanginechnfngkchn control flows in F epn expression thimi type hrux okhrngsrangkhxmul thisamarththukprakxbekhaknidokhrngsrangkhxmulthisakhythimiin F idaek Unit sungkhlaykb Void inphasatrakulphasaC Tuple Record Discriminated unions List Optionopraekrmtwxyang aekikhopraekrmha Factorial aekikh gt let rec fact function 0 gt 1 n gt n fact n 1 val fact int gt int phllphth gt fact 12 val it int 479001600 winodwsfxrm aekikh open System Windows Forms let form new Form do form Visible lt true do form TopMost lt true do form Text lt Welcome to F let x 3 4 5 do form Text lt if x 23 then Correct else incorrect xangxing aekikh The F Software Foundation Using F with HTML5 Web Applications subkhnemux 2014 06 07 The F Software Foundation Using F for GPU Programming subkhnemux 2014 06 07 The F Software Foundation Use F on Mac OSX subkhnemux 2014 06 07 The F Software Foundation Use F for iOS App Development subkhnemux 2014 06 07 The F Software Foundation Use F for Android Development subkhnemux 2014 06 07 phurwmsrang F F thi Microsoft Research Contributing to the F Language Library and Toolsduephim aekikhOCaml C aehlngkhxmulxun aekikhaehlngkhxmulsahrb F The F Software Foundation hnngsux Developpement d applications avec Objective Caml bthkhwamekiywkbkarekhiynopraekrm hrux phasaopraekrmniyngepnokhrng khunsamarthchwywikiphiediyidodyephimkhxmulekhathungcak https th wikipedia org w index php title phasaexfcharp amp oldid 9348943, wikipedia, วิกิ หนังสือ, หนังสือ, ห้องสมุด,

บทความ

, อ่าน, ดาวน์โหลด, ฟรี, ดาวน์โหลดฟรี, mp3, วิดีโอ, mp4, 3gp, jpg, jpeg, gif, png, รูปภาพ, เพลง, เพลง, หนัง, หนังสือ, เกม, เกม