当前位置:网站首页>Rust versus go (which is my preferred language?)
Rust versus go (which is my preferred language?)
2022-07-07 07:54:00 【Xijing swordsman】
List of articles
Rust Versus Go
Link to the original text : https://dormoshe.io/trending-news/rust-versus-go-52434
After learning these languages from the following author's book , I have been using it for the past year Rust and Go.
Herbert Wolverson’s Hands-on Rust:
Ricardo Gerardi’s Powerful Command-Line Applications in Go:
Over the past year, colleagues and colleagues have been asking ,Medium Articles and Reddit Rust and Go A big problem that seems to appear in the forum is ,“ Which is better? ?” There is really no answer to this question , Because it is a very subjective decision . Almost all these articles and posts are written in “ As the case may be ” ending . But since engineers prefer absolute decisions , This is not a satisfactory answer . So a better question is ,“ Which one do you prefer ?” After using these two languages in various scenarios , My default preferred language is ……Go.
Why Go?
I'm not a system programmer , I spend most of my time with DevOps Related work .Go Is for DevOps The design of the , This is in Docker、Grafana and Kubernetes Wait for all DevOps It is obvious in the application centered on . I have no patience to compile for a long time , I just found that the failure of the build was due to some slow errors , Sometimes it takes me hours to figure it out . Just like those who have read my new book or in recent Changelog Podcast As everyone who listens to my interview knows , I use it at home Raspberry Pi. Try compiling a ratio “Hello, World!” Longer Rust Applications stay Raspberry Pi On . If you're lucky , Assuming there are no compilation errors , It will be finished in an hour or more .
**Go The embedded runtime that carries every executable with you , But compared with the overall benefits of compilation speed and portability , It's relatively small .** Although both languages have many dependencies , But in recent months ,Rust It has become a bigger target of supply chain attack , This may be due to its growing prominence in the community , Because it is accepted as Linux kernel . image System76 Such companies also say , They intend to make use Rust To build Pop!OS desktop.
performance
In terms of performance , I find - For my micro project , Both are similar . I'm not building large-scale parallelism PB Level architecture , It's about building small... That can do a specific task well 、 Stable procedures .
If Want to keep things simple and don't care about performance , that Python Scripts will do . however ,** If you want higher performance and a fairly small native executable , that Go Is my main language choice .** Of course , The language has no official GUI Support , but Rust So it is with . Although both languages exist based on Webkit Of GUI project , But I don't have enough interest in them to learn them .
Command line program
actually , Due to the nature of its terminal centric output , These languages let me rediscover the fun and speed of non bloated command-line iterative programs . for example , I am here Go Write a custom Twitter client , It highlights the key theme labels and people I care about in different colors , So that I can quickly 、 Visually identify interesting posts in my feed . It is used on the back end Redis cloud , So every time I run tw when , It will be synchronized between the various operating systems I run it . I use Go It took less than an hour to write the code , Even in my Pi Zero It took less than a few seconds to compile on . Although I have thought about using Rust Rewrite it just to practice my language ability , But time goes on , Only so many hours a day can be spent on study and experiment .
Rust Do you have a chance ?
If so Rust You can reduce the compilation time to a more reasonable time , And provide less stupid error messages when compiling interrupts , I may reassess my major language choices . But for now , When I need to quickly create and deploy new programs ,Go It is the first choice of my coding list .
边栏推荐
- [UVM practice] Chapter 1: configuring the UVM environment (taking VCs as an example), run through the examples in the book
- Use and analysis of dot function in numpy
- 自定义类加载器加载网络Class
- 即刻报名|飞桨黑客马拉松第三期等你挑战
- Cnopendata geographical distribution data of religious places in China
- 【VHDL 并行语句执行】
- [Matlab] Simulink 自定义函数中的矩阵乘法工作不正常时可以使用模块库中的矩阵乘法模块代替
- Solve could not find or load the QT platform plugin "xcb" in "
- Solution: could not find kf5 (missing: coreaddons dbusaddons doctools xmlgui)
- Technology cloud report: from robot to Cobot, human-computer integration is creating an era
猜你喜欢
[Stanford Jiwang cs144 project] lab3: tcpsender
[experience sharing] how to expand the cloud service icon for Visio
[UTCTF2020]file header
探索干货篇!Apifox 建设思路
@component(““)
即刻报名|飞桨黑客马拉松第三期等你挑战
[webrtc] m98 Screen and Window Collection
2022年全国最新消防设施操作员(初级消防设施操作员)模拟题及答案
[Stanford Jiwang cs144 project] lab4: tcpconnection
Numbers that appear only once
随机推荐
2022制冷与空调设备运行操作复训题库及答案
JS get all date or time stamps between two time stamps
Kbu1510-asemi power supply special 15A rectifier bridge kbu1510
Detailed explanation of uboot image generation process of Hisilicon chip (hi3516dv300)
[performance pressure test] how to do a good job of performance pressure test?
【webrtc】m98 screen和window采集
Linux server development, MySQL process control statement
CTF daily question day43 rsa5
图解GPT3的工作原理
2022年茶艺师(中级)考试试题及模拟考试
Numbers that appear only once
Use and analysis of dot function in numpy
【斯坦福计网CS144项目】Lab3: TCPSender
Visualization Document Feb 12 16:42
2022-07-06:以下go语言代码是否会panic?A:会;B:不会。 package main import “C“ func main() { var ch chan struct
Six methods of flattening arrays with JS
leanote私有云笔记搭建
C语言通信行程卡后台系统
numpy中dot函数使用与解析
Common validation comments