In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > IT Information >
Share
Shulou(Shulou.com)11/24 Report--
CTOnews.com Sept. 8, Mojo is a programming language developed by Modular AI that is designed specifically for AI and claims to be 68000 times faster than Python.
Mojo is now available for local download and running, and in addition to compilers, Mojo SDK includes a complete set of developers and IDE tools that can be used to build and iterate Mojo applications, the official announced today.
Modular AI said that since the launch of the Mojo programming language on May 2, more than 120000 developers have signed up to use Mojo Playground, and more than 19000 developers have actively discussed Mojo on Discord and GitHub.
Mojo is now available for download locally, but there is currently only a Linux version, and officials have promised to add macOS and Windows support to the upcoming release.
According to reports, Mojo is a high-performance "Python++" programming language for computing, launched for AI developers, with the passage of time, it will develop into a superset of Python.
Currently, Mojo supports seamless integration with arbitrary Python code and has an extensible programming model for performance-critical systems, including accelerators commonly found in artificial intelligence (such as GPU).
In addition, CTOnews.com noted in his blog that Mojo claims to combine the advantages of dynamic and static languages to achieve 68000 times the performance of today's Python and provides full interoperability with the Python ecosystem, allowing seamless use of Python libraries.
The following is the code for calculating the Euclidean distance using Mojo:
$mojoWelcome to Mojo! 🔥 Expressions are delimited by a blank line.Type `: mojo help` for further assistance.1 >% python2. Import numpy as np3. N = 100000004. Anp = np.random.rand (n) 5. Bnp = np.random.rand (n) 6 > from tensor import Tensor7. Let n: Int = 100000008. Var a = Tensor [DType.float64] (n) 9. Var b = Tensor [DType.float64] (n) 10. For i in range (n): 11. A [I] = anp [I]. To _ float64 () 12. B [I] = BNP [I]. To _ float64 () 13 > from math import sqrt14. Def mojo_naive_dist (a: Tensor [DType.float64], b: Tensor [DType.float64])-> Float64:15. Var s: Float64 = 0.016. N = a.num_elements () 17. For i in range (n): 18. Dist = a [I]-b [I] 19.s + = dist*dist20. Return sqrt (s) 23 > fn mojo_fn_dist (a: Tensor [DType.float64], b: Tensor [DType.float64])-> Float64:24. Var s: Float64 = 0.025. Let n = a.num_elements () 26. For i in range (n): 27. Let dist = a [I]-b [I] 28. S + = dist*dist29. Return sqrt (s) 30.31 > let naive_dist = mojo_naive_dist (a, b) 32. Let fn_dist = mojo_fn_dist (a, b) 33. Print (fn_dist) 34. 1290.82142509223535. Print (naive_dist) 36. 1290.8521425092235 in addition, Mojo allows developers to build statically compiled executables that can be deployed without any dependencies, such as:
$mojo build hello. 🔥 $. / helloHello Mojo 🔥! 963$ ls-lGtranh hello*-rw-r--r-- 10 817 Sep 3 23:59 hello. 🔥-rwxr-xr-x 10 22K Sep 3 23:59 helloMojo also has an official extension for Visual Studio Marketplace, which supports syntax highlighting, statement diagnostics, formatting, completion suggestions, etc.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.