Programming

บริษัท Modular ผู้พัฒนาโคงสร้างพื้นฐานสำหรับการพัฒนาปัญญาประดิษฐ์ เปิดตัวภาษา Mojo ที่ตัวภาษาเหมือนภาษา Python แต่เป็นภาษาคอมไพล์และใช้ฟีเจอร์เร่งความเร็วต่างๆ ของซีพียูจนได้ประสิทธิภาพเต็มที่ ในงานที่สามารถใช้ฟีเจอร์ประมวลผลขนานของซีพียูได้มากๆ สามารถทำความเร็วได้เหนือ Python ปกติถึง 35,000 เท่าตัว

ทีมพัฒนาระบุว่าออกแบบให้ Mojo เป็น superset ของภาษา Python ทำให้กระบวนการย้ายโค้ดจาก Python มายัง Mojo ทำได้ไม่ยากเกินไป และตัว Mojo เองจะฝัง CPython ไว้ในตัวเพื่อให้รันโค้ด Python เดิมได้ทั้งหมด แล้วค่อยๆ ย้ายโมดูลหรือโค้ดบางส่วนไปรันใน Mojo จริงๆ รูปแบบเดียวกับ Swift ที่ทำงานร่วมกับ Objective-C ได้แนบแน่น ขณะที่ตัว Mojo เองจริงๆ จะรองรับรูปแบบการเขียนโปรแกรมระดับล่างมากขึ้น ควบคุมชนิดตัวแปร, กำหนดความเป็นเจ้าของตัวแปร (แบบเดียวกับ Rust), ตลอดจนเข้าไปควบคุม MLIR ไฟล์คั่นกลางระหว่างการคอมไพล์

แนวทางการเร่งความเร็วโค้ด Python นั้นมีหลายรูปแบบ ตัว Python เองก็มีความพยายามปรับปรุงประสิทธิภาพอย่างต่อเนื่องในช่วงหลัง หลายโครงการพยายามสร้างภาษา "เหมือน Python" ขึ้นมาโดยคอมไพล์เป็นโค้ดแบบเนทีฟได้ หรือบางโครงการ เช่น TensorFlow อาศัยการคอมไพล์โค้ด Python บางส่วนให้เป็นเนทีฟผสมกับโค้ด Python ปกติ

ทาง Modular ระบุว่าตั้งใจจะโอเพนซอร์ส Mojo ออกมาภายหลัง แต่ตอนนี้ยังขอทดสอบวงปิด โดยผู้สนใจต้องลงชื่อขอทดสอบล่วงหน้าเท่านั้น

ที่มา - Modular

Hiring! บริษัทที่น่าสนใจ

Carmen Software company cover
Carmen Software
Hotel Financial Solutions
Next Innovation (Thailand) Co., Ltd. company cover
Next Innovation (Thailand) Co., Ltd.
We are web design with consulting & engineering services driven the future stronger and flexibility.
KKP Dime company cover
KKP Dime
KKP Dime บริษัทในเครือเกียรตินาคินภัทร
Kiatnakin Phatra Financial Group company cover
Kiatnakin Phatra Financial Group
Financial Service
Fastwork Technologies company cover
Fastwork Technologies
Fastwork.co เว็บไซต์ที่รวบรวม ฟรีแลนซ์ มืออาชีพจากหลากหลายสายงานไว้ในที่เดียวกัน
Thoughtworks Thailand company cover
Thoughtworks Thailand
Thoughtworks เป็นบริษัทที่ปรึกษาด้านเทคโนโยลีระดับโลกที่คว้า Great Place to Work 3 ปีซ้อน
Iron Software company cover
Iron Software
Iron Software is an American company providing a suite of .NET libraries by engineer for engineers.
CLEVERSE company cover
CLEVERSE
Cleverse is a Venture Builder. Our team builds several tech companies.
Nipa Cloud company cover
Nipa Cloud
#1 OpenStack cloud provider in Thailand with our own data center and software platform.
Bangmod Enterprise company cover
Bangmod Enterprise
The leader in Cloud Server and Hosting in Thailand.
CIMB THAI Bank company cover
CIMB THAI Bank
MOVING FORWARD WITH YOU - CIMB is the leading ASEAN Bank
Bangkok Bank company cover
Bangkok Bank
Bangkok Bank is one of Southeast Asia's largest regional banks, a market leader in business banking
MuvMi (Urban Mobility Tech Co.,Ltd.) company cover
MuvMi (Urban Mobility Tech Co.,Ltd.)
Shape the future of urban mobility towards affordable, clean, and safe solutions
T.N. Digital Solution Co., Ltd. company cover
T.N. Digital Solution Co., Ltd.
TNDS has been involving in every first move of banking’s major digital transformation.
KBTG - KASIKORN Business-Technology Group company cover
KBTG - KASIKORN Business-Technology Group
KBTG - "The Technology Company for Digital Business Innovation"
Siam Commercial Bank Public Company Limited company cover
Siam Commercial Bank Public Company Limited
"Let's start a brighter career future together"
Icon Framework co.,Ltd. company cover
Icon Framework co.,Ltd.
Global Standard Platform for Real Estate แพลตฟอร์มสำหรับธุรกิจอสังหาริมทรัพย์ครบวงจร มาตรฐานระดับโลก
REFINITIV company cover
REFINITIV
The Financial and Risk business of Thomson Reuters is now Refinitiv
H LAB company cover
H LAB
Re-engineering healthcare systems through intelligent platforms and system design.
The Gang Technology Co., Ltd. company cover
The Gang Technology Co., Ltd.
We're a Digital Agency that helps our customers transform their business into digital with ease.
LTMH company cover
LTMH
LTMH มุ่งเน้นการพัฒนาผลิตภัณฑ์ที่สามารถช่วยพันธมิตรของเราให้บรรลุเป้าหมาย
Seven Peaks company cover
Seven Peaks
We Drive Digital Transformation
Wisesight (Thailand) Co., Ltd. company cover
Wisesight (Thailand) Co., Ltd.
The Best Choice For Handling Social Media · High Expertise in Social Data · Most Advanced and Secure
MOLOG Tech company cover
MOLOG Tech
We are Modern Logistic Platform, Specialize in WMS, OMS and TMS.
Data Wow Co.,Ltd company cover
Data Wow Co.,Ltd
We enable our clients to realize increased productivity by solving their most complex issues by Data
LINE Company Thailand company cover
LINE Company Thailand
LINE, the world's hottest mobile messaging platform, offers free text and voice messaging + Call
LINE MAN Wongnai company cover
LINE MAN Wongnai
Join our journey to becoming No.1 food platform in Thailand
แต่เป็นภาษาคอมไพล์... สามารถทำความเร็วได้เหนือ Python ปกติถึง 35,000 เท่าตัว

เปลี่ยนจาก script language เป็น compile language แล้วเร็วขึ้นไม่ใช่เรื่องแปลกอะไร

แต่ Syntax ควรเปลี่ยนด้วย ผมว่า scope โดยใช้ indent นี้ไม่ work

เรื่อง Indent ถ้าต้องเขียนบน plain text ผมว่ามันก็ชีวิตลำบากจริงๆแหละ แต่พอเรามี tools ช่วย ก็ลืมๆมันไปได้

ว่าแต่ถ้า python เปลี่ยน syntax ไม่ใช้ indent ก็น่าจะทำ backward compatibility กับโค๊ดเดิมยากสุดๆ กรณีที่เขียนผสมกัน เว้นแต่จะแยก extension เพราะไม่เหมือน JS ที่มี {} เข้ามาช่วยแยก นอกจาก line break

ส่วนตัวที่งานหลักใช้ c++ โปรเจคส่วนตัวใช้ python
ผมชอบscopeแบบindentมากกว่า{} เพราะทุกคนจะเขียนเหมือนๆกันหมด พอมา {} ในc++ มีทั้งที่ขึ้นบันทัดใหม่ กับไม่ขึ้นบันทัดใหม่ ซึ่งการไม่ขึ้นบันทัดใหม่ มันก็ไม่ต่างอะไรกับ indent

ก็แบบเดียวกับข้างบนครับ คือก็ต้องใช้เครื่องมือบังคับไป (ผมใช้ clang-format)

แต่ปัญหาของ C++ คือหลาย ๆ คนเค้าอาจจะหัว conservative นิดนึง คิดว่าการจัดฟอร์แมทด้วยมือมันดีที่สุดแล้ว ก็ต้องสู้กันต่อไป

ผมไม่ได้บอกว่าจัดมือไม่ดีนะ แค่บอกว่าในหลาย ๆ สถานการณ์ ใช้เครื่องมือช่วยดีกว่า

ขนาด python ยังเถียงกันไม่จบ (ภาษาบังคับ + มี best practice ของภาษา pep8 อยู่แล้ว)

ผมใช้ black ก่อน push ทุกไฟล์จบ ไม่ต้องเถียงกัน

ที่ผมว่าไม่ work มันไม่เกี่ยวกับเรื่อง format ครับ สมัยนี้ tool ช่วย format เยอะมาก

มันแค่เขียนแยก scope ใน indent level เดี่ยวกันไม่ได้น่ะครับ
ภาษาอื่นมัน แยกแบบนี้ได้

{
//scope1
}
{
//scope2
}

ผมยังนึกไม่ออกว่าถ้าใช้ indent จะทำยังไง
ภาษาสมัยนี้มันเอาเรื่อง scope มาใช้กันมาขึ้นด้วย

และเวลา indent ผิด แล้วไป error ที่ runtime นี้ผมรู้สึกว่าหา error ยากมาก (ผมเคยใช้ Python มานิดเดียว)