当前位置:网站首页>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 .
边栏推荐
- 【VHDL 并行语句执行】
- Regular e-commerce problems part1
- dash plotly
- 这5个摸鱼神器太火了!程序员:知道了快删!
- Explore Cassandra's decentralized distributed architecture
- What is the interval in gatk4??
- Redis technology leak detection and filling (II) - expired deletion strategy
- Installing postgresql11 database under centos7
- 2022焊工(初级)判断题及在线模拟考试
- Idea add class annotation template and method template
猜你喜欢
Why should we understand the trend of spot gold?
json 数据展平pd.json_normalize
Common validation comments
[CV] Wu Enda machine learning course notes | Chapter 8
After the interview, the interviewer roast in the circle of friends
2022 tea master (intermediate) examination questions and mock examination
Kbu1510-asemi power supply special 15A rectifier bridge kbu1510
知识点滴 - 关于苹果认证MFI
Cnopendata American Golden Globe Award winning data
2022-07-06: will the following go language codes be panic? A: Meeting; B: No. package main import “C“ func main() { var ch chan struct
随机推荐
json 数据展平pd.json_normalize
Wx is used in wechat applet Showtoast() for interface interaction
[mathematical notes] radian
Rust Versus Go(哪种是我的首选语言?)
【经验分享】如何为visio扩展云服务图标
微博发布案例
242. Bipartite graph determination
Asemi rectifier bridge rs210 parameters, rs210 specifications, rs210 package
[GUET-CTF2019]虚假的压缩包
解决问题:Unable to connect to Redis
C语言航班订票系统
【webrtc】m98 screen和window采集
知识点滴 - 关于苹果认证MFI
Figure out the working principle of gpt3
vus.SSR在asynData函数中请求数据的注意事项
[UVM foundation] what is transaction
[Matlab] Simulink 自定义函数中的矩阵乘法工作不正常时可以使用模块库中的矩阵乘法模块代替
Qt学习28 主窗口中的工具栏
【斯坦福计网CS144项目】Lab4: TCPConnection
gslx680触摸屏驱动源码码分析(gslX680.c)