Python

Anaconda โครงการภาษา Python สำหรับงาน data science เปิดโครงการ PyScript โครงการโอเพนซอร์สสำหรับนำภาษา Python ไปใช้งานแทนจาวาสคริปต์ หรือแม้แต่จะทำงานร่วมกับจาวาสคริปต์ก็ยังได้

PyScript ไม่ใช่เพียงแค่ตัว Python เปล่าๆ แต่รองรับการดาวน์โหลดโมดูลเพิ่มเติม เช่น Bokeh, numpy และยังมีคอนโซล REPL (ช่องให้พิมพ์และดูผลแบบเดียวกับ Python notebook) โดยตัวโครงการต่อยอดมาจาก pyodide โครงการ Python บน WASM แต่การเรียกใช้งานง่ายกว่ามากเพราะแค่โหลดสคริปต์เข้าไว้ใน HTML ก็สามารถใช้แท็ก <py-script> และ <py-repl> ได้เลย

ตอนนี้โครงการยังอยู่ในระดับทดลองอยู่ และทีมงานทดสอบกับ Chrome อย่างเดียว แต่ผมทดลองใช้งานกับ Firefox ก็ใช้งานได้ดี

ที่มา - Anaconda

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

output assembly ขึ้นอยู่กับภาษาต้นทางเยอะอยู่ครับ

ถ้าตัวลักษณะภาษาต่างกับลักษณะของ assembly มาก ๆ คนเขียน compiler/transpiler ก็ต้องหาทาง implement feature พิเศษของภาษาเหล่านั้นด้วย (ส่วนในภาษาที่มีความใกล้เคียงกัน ก็เทียบเคียงฟีเจอร์ได้เลย) ทำให้ฟีเจอร์บางอย่างอาจจะได้ asm ที่มีความยาวมาก ๆ และ performance ก็จะไม่ดี

คำแนะนำทั่วไปคือ asm ที่ดี คือ asm ที่สั้นครับ ถ้าเป็นภาษาที่แปลมาได้ asm ยาว ๆ มันก็จะไม่ดีเพราะต้องใช้คำสั่งเยอะ ๆ นี่ล่ะ

ถ้าพูดถึงพฤติกรรมแล้ว WASM ไม่ใช่ Assembly หรืออย่างน้อย ๆ ก็ไม่ใช่ Assembly ที่ transpile ไปเป็น machine code ได้โดยตรงด้วยความแตกต่างของ Target Architecture จริง ๆ Assembly มันไม่ควรมีความหมายที่เกี่ยวข้องกับความเร็วด้วยซ้ำ มันก็เป็นแค่รูปย่อของ Instruction ที่มนุษย์อ่านได้แล้วรอให้เครื่องนำไป Interpret, Transpile ต่อ บางคนเอาไปทำเป็น Buzz Word ให้เชื่อว่าถ้าเป็น Assembly แล้วมันจะเร็ว ทั้งที่จริงแล้วมันไม่เกี่ยวเลย

WebAssembly เป็นมาตรฐาน Portable Binary Format ที่ถูกคิดค้นขึ้นมาให้ทำงานกับเบราว์เซอร์ โดยมุ่งเน้นให้สามารถอ่านโดยมนุษย์ได้ง่าย ปลอดกัย และมีฟังก์ชันสำหรับให้ทุก Architecture สามารถนำไป Transpile เป็น Machine Code ของตัวเองได้ แต่พฤติกรรมจริง ๆ มันขึ้นกับเบราว์เซอร์หรือ Compiler ว่าจะจัดการกับรหัส WASM อย่างไร บางทีจะสร้าง Dumb WASM Machine มา Interpret ไปเรื่อย ๆ แบบไม่ Compile และเสีย Benefit ของ WASM ไปแทบทั้งหมดก็ยังได้ หรือใน V8 ที่คุยว่าจะแปลไปเป็น Machine Code ตรง ๆ เลย พร้อม Optimise ระหว่างการทำงานให้ด้วย แต่พอทำงานจริงดันช้ากว่า Firefox (ในบางงานช้ากว่า 2 เท่า) ส่วนตัวที่เคยใช้งาน Game Engine ที่เขียนด้วย WASM 2 ตัว (Godot, Unity) ทั้ง 2 ตัว แพ้ด้านความเร็ว/เสถียรภาพด้าน Framerate/Frametime ให้กับ Engine ที่เขียนด้วย JS ล้วนอย่าง GameMaker, GDevelop แบบราบคาบ (ชนะเฉพาะด้านการประมวลผลเท่านั้น) ด้วย Overhead ของ WASM/JS binding ที่ยังห่วยบัดซบอยู่มาก แต่บางโปรแกรมถ้า WASM ไม่ได้ทำงานแบบ Real-time จะไม่ค่อยมีปัญหาด้านประสิทธิภาพ เช่น Google Earth, SketchUp พวกนี้ทำงานได้ลื่น ๆ บนเบราว์เซอร์เพราะเขียนส่วนสำคัญที่ต้องการ Response Time ด้วย JS ก่อนที่จะประมวลผลบางอย่างที่ต้องการประสิทธิภาพ/พอร์ตออกมา JS ไม่ได้ด้วย WASM