当前位置:网站首页>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 .
边栏推荐
- Gslx680 touch screen driver source code analysis (gslx680. C)
- Ansible
- 这5个摸鱼神器太火了!程序员:知道了快删!
- Linux server development, SQL statements, indexes, views, stored procedures, triggers
- Pytorch parameter initialization
- SQL优化的魅力!从 30248s 到 0.001s
- Installing postgresql11 database under centos7
- 微信小程序中的路由跳转
- PHP exports millions of data
- 解决问题:Unable to connect to Redis
猜你喜欢
Write CPU yourself -- Chapter 9 -- learning notes
【斯坦福计网CS144项目】Lab3: TCPSender
通信设备商,到底有哪些岗位?
Detailed explanation of uboot image generation process of Hisilicon chip (hi3516dv300)
Cnopendata list data of Chinese colleges and Universities
Mysql高低版本切换需要修改的配置5-8(此处以aicode为例)
leetcode:105. 从前序与中序遍历序列构造二叉树
2022 tea master (intermediate) examination questions and mock examination
IPv4 exercises
海思芯片(hi3516dv300)uboot镜像生成过程详解
随机推荐
今日现货白银操作建议
Redis technology leak detection and filling (II) - expired deletion strategy
【p2p】本地抓包
Visualization Document Feb 12 16:42
[unity] several ideas about circular motion of objects
PHP exports millions of data
Pytest+allure+jenkins environment -- completion of pit filling
Qt学习28 主窗口中的工具栏
JS get all date or time stamps between two time stamps
Is the test cycle compressed? Teach you 9 ways to deal with it
Route jump in wechat applet
图解GPT3的工作原理
Rust Versus Go(哪种是我的首选语言?)
pytest+allure+jenkins环境--填坑完毕
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
[GUET-CTF2019]虚假的压缩包
vus.SSR在asynData函数中请求数据的注意事项
dash plotly
[UVM practice] Chapter 2: a simple UVM verification platform (2) only driver verification platform
Pytest + allure + Jenkins Environment - - achèvement du remplissage de la fosse