当前位置:网站首页>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 .
边栏推荐
- Live broadcast platform source code, foldable menu bar
- 解决问题:Unable to connect to Redis
- [advanced digital IC Verification] command query method and common command interpretation of VCs tool
- 【斯坦福计网CS144项目】Lab4: TCPConnection
- IO stream file
- [UVM foundation] what is transaction
- Button wizard collection learning - mineral medicine collection and running map
- Solve could not find or load the QT platform plugin "xcb" in "
- 【数学笔记】弧度
- 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
猜你喜欢

知识点滴 - 关于苹果认证MFI

Is the test cycle compressed? Teach you 9 ways to deal with it

mysql多列索引(组合索引)特点和使用场景

2022 recurrent training question bank and answers of refrigeration and air conditioning equipment operation

Most elements

2022制冷与空调设备运行操作复训题库及答案

有 Docker 谁还在自己本地安装 Mysql ?

misc ez_usb

buuctf misc USB

2022 welder (elementary) judgment questions and online simulation examination
随机推荐
Qt学习27 应用程序中的主窗口
2022年全国最新消防设施操作员(初级消防设施操作员)模拟题及答案
[2022 actf] Web Topic recurrence
[OBS] win capture requires winrt
vus. Precautions for SSR requesting data in asyndata function
Wechat applet data binding multiple data
Gslx680 touch screen driver source code analysis (gslx680. C)
Write CPU yourself -- Chapter 9 -- learning notes
LeetCode 40:组合总和 II
JS get all date or time stamps between two time stamps
[unity] several ideas about circular motion of objects
Tongda injection 0day
[2022 ciscn] replay of preliminary web topics
Common validation comments
IO stream file
What is the interval in gatk4??
Route jump in wechat applet
gslx680触摸屏驱动源码码分析(gslX680.c)
Few-Shot Learning && Meta Learning:小样本学习原理和Siamese网络结构(一)
paddlepaddle 29 无模型定义代码下动态修改网络结构(relu变prelu,conv2d变conv3d,2d语义分割模型改为3d语义分割模型)