From Go To Rust | Prime Reacts

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

ความคิดเห็น • 130

  • @dmitriyobidin6049
    @dmitriyobidin6049 ปีที่แล้ว +151

    1 year into rust rewrite: Why we are switching to Zig from Rust.

    • @rj7250a
      @rj7250a ปีที่แล้ว +42

      1 year into Zig rewrite: why we are switching to JDSL from Zig.

    • @logantcooper6
      @logantcooper6 ปีที่แล้ว +12

      ​@@rj7250a1 year into JDSL rewrite: Why we are switching to Carbon from JDSL

    • @rj7250a
      @rj7250a ปีที่แล้ว +25

      @@logantcooper6 that is impossible, JDSL is the greatest programming language of all time, only a genius like Tom could create such language.

    • @dmitriyobidin6049
      @dmitriyobidin6049 ปีที่แล้ว

      @@rj7250a That's until someone created JDSX(adding dynamic features to jdsl).

    • @stefano_schmidt
      @stefano_schmidt ปีที่แล้ว +1

      Can anybody explain this meme about JDSL and Tom?

  • @holmybeer
    @holmybeer ปีที่แล้ว +81

    "the segfault comes from the go rt itself"
    At this point I would give up programing and start selling art on a beach

    • @MattBolt35
      @MattBolt35 ปีที่แล้ว

      We have inside joke at work where we say “I should’ve been a gardener” whenever faced with a complex problem. Selling art on the beach is brilliant 🤣

    • @lucasrodrigo4797
      @lucasrodrigo4797 9 หลายเดือนก่อน

      como falar que é Brasileiro sem falar que vc é brasileiro.

  • @esra_erimez
    @esra_erimez ปีที่แล้ว +98

    I find the article to be compelling. The firm I work for is converting a large code base from C++ to Go. We are seeing a huge performance improvement. We don't have to use generics to solve language problems. We aren't coding defensively. And, the team is actually enjoying the process and look forward to when we are completely on Go.

    • @danielchettiar5670
      @danielchettiar5670 ปีที่แล้ว +31

      Performance improvements in Go over Cpp? Is the Cpp code written badly?

    • @FlanPoirot
      @FlanPoirot ปีที่แล้ว

      ​@@danielchettiar5670 either that or they've managed to heavily parallelize the program due to Go's goroutines and native concurrency primitives

    • @DennisJHarrisonJrHere
      @DennisJHarrisonJrHere ปีที่แล้ว

      @@danielchettiar5670 Opinion (I have switched to Go from C & C++ for many projects): C++ takes extra effort to coax the performance gains out of it. If you're doing things in parallel in C++ you have a lot to keep up with. One of the advantages of Golang here is that it's compiler will work out a stronger solution for concurrency than most C++ engineers can put together in a reasonable time. So, you get ~97% of the best possible performance with a few lines of code and move on. Your constraints will be I/O and Golang has good tooling for handling those kinds of problems compared to many legacy languages.

    • @DBGabriele
      @DBGabriele ปีที่แล้ว +19

      It is quite common, when your team is made by Java developers.

    • @_____case
      @_____case ปีที่แล้ว

      ​@@danielchettiar5670 C++ asynchrony is not a well defined story. I suspect that they have a lot of complexity in this arena that is addressed by the migration to Go.

  • @autofires
    @autofires ปีที่แล้ว +31

    “Have you finished the upgrade yet?”
    “Nope”
    “Why not?!”
    “Working on the blog post”

    • @georgehelyar
      @georgehelyar ปีที่แล้ว +3

      From the post, they have a "content engineer" for their blog posts, so I guess when you have enough spare money to hire an extra job role to write blog posts then it's not a problem

  • @mtgarcez
    @mtgarcez ปีที่แล้ว +134

    they rewrote in rust because they wanted to do it in rust, there is no other reason

    • @DrKartoffelsalat
      @DrKartoffelsalat ปีที่แล้ว +31

      For the meme.

    • @ooogabooga5111
      @ooogabooga5111 ปีที่แล้ว +2

      Yep

    • @khai96x
      @khai96x ปีที่แล้ว +14

      Even if one exclude the low-level aspect of Rust, the remaining features would still be desirable and hard to find in other (popular) languages.

    • @temper8281
      @temper8281 ปีที่แล้ว +2

      Yes. It would be good if they said that though.

    • @tonyhart2744
      @tonyhart2744 ปีที่แล้ว +2

      why you blowoff the secret lil bro

  • @tobyzieglerrr
    @tobyzieglerrr ปีที่แล้ว +28

    While i personally think Rust > Go: Why did they rewrite in the first place? Dont see any valid reason to do this... too much free time?

    • @MrIlsundur
      @MrIlsundur ปีที่แล้ว +40

      They rewrote their codebase to rust to justify writing this article

    • @ViníciusMiguel-q1g
      @ViníciusMiguel-q1g ปีที่แล้ว +1

      They have an entire prior article explaining why they'd like to use Rust instead of Go. Mostly: Not using CGO & they'd be happy using Rust

    • @muhwyndham
      @muhwyndham ปีที่แล้ว

      ​@@ViníciusMiguel-q1gcgo is not that bad.

  • @elanticrypt0
    @elanticrypt0 ปีที่แล้ว +6

    I just want to say that i started learning GO then i discover RUST and i love it, but for me tooks a loooot of time to get one simple thing done with rust. For my work I make a few projects in go and was more easy once that i learn the rust basics. For me go is the tool while i learning rust and make the switch between this two great languages is more easy and i can get the job done. Thats is the thing that count. Be happy work happy.

  • @diegolikescode
    @diegolikescode ปีที่แล้ว +16

    9AM (BR Timezone) and we're already here.

  • @konberner170
    @konberner170 ปีที่แล้ว +5

    Among the things they seemed to not have learned, is that doing all of this work for little to no benefit is a waste of time. Go is fine, and that roadmap could have probably been done in the tine it took to do this.

  • @zebedie2
    @zebedie2 ปีที่แล้ว +7

    If you wanted to build it in such a way that it could be run on multiple platforms and be installed via npm
    then you could build from rust to the wasm32-wasi target then run it via something like wasitime, the only downside with that approach is that it's not 64bit

    • @dealloc
      @dealloc ปีที่แล้ว +2

      That would require an additional dependency; wasmtime. They pointed out that they didn't even want to release with a dependency on glibc (which is pretty standard), because it wasn't available in all Linux distros, especially those used for CI, where Turbo is going to be utilized for the most part.

  • @MattBolt35
    @MattBolt35 ปีที่แล้ว

    1:04 - I ported a library from Go to Rust that used fairly heavy syscalls, and surprisingly saw substantial improvement in overall performance. Unfortunately, I didn’t dive back into the Go side to actually compare, but I assume that there’s a some strange system level locking that has to occur with Go’s runtime scheduler (runtime.LockOSThread()). Total speculation concerning CPU performance.

  • @fulconandroadcone9488
    @fulconandroadcone9488 ปีที่แล้ว +5

    Full re wriret sounds like: "Bulldoze the city this time it will be a better place to live in. "

  • @realsong-fake
    @realsong-fake ปีที่แล้ว +3

    LOL. They seriously wrote an article on how to parse command argument, serialize a json and spin up a child process in Rust.

  • @michalbotor
    @michalbotor ปีที่แล้ว +27

    coming up: why we are porting back to go
    and then: how we are porting back to go
    seriously, all this article is, is them complaining how everything sucks when you try to write your program in 2+ languages at a time.
    they should have stayed with go, go it's more than fast enough for a build system.

  • @ebukaume
    @ebukaume ปีที่แล้ว +1

    The test part: I understood it to mean that didn't have tests and advice having test before you start PORTING. Similar to how you would when "refactoring".

  • @hellelo.5840
    @hellelo.5840 ปีที่แล้ว +27

    Rust, C++, Go developers, spend all their time rewriting projects and measuring performance 😂.
    Other developers scale horizontally.

    • @T1Oracle
      @T1Oracle ปีที่แล้ว +1

      Once you Rust, you don't Go back. C++ what I did there?

    • @Mortyst
      @Mortyst ปีที่แล้ว +16

      Other developers spend all their time managing and load balancing their fleet of VMs. Rust, C++ and Go developers just run everything on a single cpu core.

    • @hellelo.5840
      @hellelo.5840 ปีที่แล้ว

      @@Mortyst c++, go, rust developers are underpaid.

  • @muhwyndham
    @muhwyndham ปีที่แล้ว +27

    For all of the shenanigans they go through during the article, I still don't understand the reason why they move from go to rust.
    What makes it "more maintainable" and "allows them to handle new features better" exactly?

    • @mckrack
      @mckrack ปีที่แล้ว

      Would you drink toilet water?

    • @muhwyndham
      @muhwyndham ปีที่แล้ว +3

      @@mckrack I assume Rust is the toiler water (because metal pipe is where rust meant to be)
      Then why would they want to drink toilet water??!

    • @mckrack
      @mckrack ปีที่แล้ว +3

      @@muhwyndham You assume wrong. It is a reference to movie Idiocracy. th-cam.com/video/kAqIJZeeXEc/w-d-xo.html

  • @caspera3193
    @caspera3193 ปีที่แล้ว +2

    Feels like a huge flex without a good reason to me. I dont see the problem with Golang tbh.

  • @laughingvampire7555
    @laughingvampire7555 ปีที่แล้ว

    I worked in a team who attempted a full rewrite, from a site written in php and prolog and perl to a site written in java. It was a mess, the java team was chasing the moving target all the time, and us in the ETL team were also chasing the moving target and the mess of old database they had.

    • @Malix_Labs
      @Malix_Labs ปีที่แล้ว +5

      Rewrite a website in Java in 2023 seems weird to me

  • @alexdegaston422
    @alexdegaston422 ปีที่แล้ว

    Instead of doing Full Rewrites its better to move to a Micro Modules First approach while doing Death By Attrition on all of the existing systems. This means you try to move more code/logic into custom code modules, focus on thin presentation layers, and slowly do attrition of what's already in place until you can simply just shut it down & nobody notices.

  • @musdevfrog
    @musdevfrog ปีที่แล้ว +33

    This sounded like such a hassle to do. How much performance is boosted? 2x? 3x? Also, didn't they have a junior dev constantly telling them to use Rust in the first place?

    • @sumanth3036
      @sumanth3036 ปีที่แล้ว

      😅

    • @andreilucasgoncalves1416
      @andreilucasgoncalves1416 ปีที่แล้ว +15

      They lose performance in the first execution and gain performance in updates, it will probably not be more than 20%
      So dumb move

    • @T1Oracle
      @T1Oracle ปีที่แล้ว +6

      I've been that dev so many times.
      "Hey guys, we should do this."
      "No! I mean, we agree, but we can't, so no."
      *a few years later*
      "So we did the thing you wa- oh, right you left a year ago..."

    • @Spiun666
      @Spiun666 ปีที่แล้ว

      Its not just performance, Go error handling is tedious and error-prone. If you've used other cli tools written in Go (such as kubectl) you would've seen how the standard error handling is lacking. Turborepo has had problems that stem from it.
      Its not impossible to use a completely different paradigm for error handling and reporting in Go. One example is Terraform, which have switched over their error reporting mechanism several times, starting with returning more complex diagnostics objects, then and switching to full blown request/response objects (you report errors by using imperative api such as `response.Diagnostics.Append(...)` and then at the end you use `if resp.Diagnostics.HasError() { return }`
      In Rust its possible to build abstractions for errors that lead to clean tracebacks pretty easily (e.g. anyhow) and traits such as `From` can make the entire process much more pleasant - and more importantly, impossible to mess up. (Its so easy to forget to add diagnostics correctly with a mutable API and end up with "success" thats super hard to debug, which has happened before in turborepo)

    • @74Bagas
      @74Bagas ปีที่แล้ว +2

      that junior dev 😂, aka primeagen fanboy, aka me

  • @istasi5201
    @istasi5201 ปีที่แล้ว +1

    youtube makes all my prime videos at 360p :(, the name is.... pixelagen

  • @thekwoka4707
    @thekwoka4707 ปีที่แล้ว

    I think on the testing for port is still good, but making sure you are testing E2E and Integration, not new tests inside the Rust stuff.

  • @trapexit
    @trapexit ปีที่แล้ว

    @14:30 See Erlang for many years of understanding that...

  • @Luclecool123
    @Luclecool123 ปีที่แล้ว +3

    15:20 and this my friends is a sheep

  • @Lodeous
    @Lodeous ปีที่แล้ว

    How do they know when people interviewed with the NSA?

  • @Kazyek
    @Kazyek ปีที่แล้ว +24

    The IRONY of having a Go/Rust "fast" build system for JAVASCRIPT/TYPESCRIPT (implying they do JavaScript/TypeScript stuff) 😂

    • @michaelslattery3050
      @michaelslattery3050 ปีที่แล้ว +36

      The real irony is that Go builds far faster than Rust.
      Also I found this ironic quote on their blog: "At the heart of Turborepo is a very simple idea: never do the same work twice."

    • @biskitpagla
      @biskitpagla ปีที่แล้ว +6

      @@michaelslattery3050 bruh 😂

    • @danielchettiar5670
      @danielchettiar5670 ปีที่แล้ว

      ​@@michaelslattery3050Loooooooool ☠️

    • @andreilucasgoncalves1416
      @andreilucasgoncalves1416 ปีที่แล้ว +2

      TurboRepo purpose is to make development performance better? It seems they not even know what they are working with

  • @alanhoff89
    @alanhoff89 ปีที่แล้ว +4

    They should have migrated to HTMX instead.

  • @architect-ki7el
    @architect-ki7el 7 หลายเดือนก่อน

    28:30 the FEDiverse banning FEDs...

  • @wassafshahzad8618
    @wassafshahzad8618 ปีที่แล้ว +4

    Love your content and thanks for uploading on TH-cam

  • @AScribblingTurtle
    @AScribblingTurtle ปีที่แล้ว

    Continuous Licensing in itself is cancer. Once the license holder pulls the plug, any product using something with the licenses will be dead in the water. Look no further than the games industry. How many good games are simply not available anymore, just because some artist somewhere said "Nope you are not allowed to use my song anymore", despite said song only being maybe 1 or 2 % of the end product?
    To make it clear. I have no problem with people wanting recognition or even compensation (Like a one-time fee) for their work.
    Where I have a problem with it, is when the License requires continuous payment or Rules on how you can market your product.
    Because now the license holder gets a significant amount of control over your project, without adding further value to it.
    So over time, what you get becomes less and less in comparison, to what you pay.

  • @BryanSeigneur0
    @BryanSeigneur0 ปีที่แล้ว +1

    Is glibc not LGPL (Library GPL) but raw GPL? Surprising.

    • @dealloc
      @dealloc ปีที่แล้ว +4

      It is licensed under LGPL (Lesser General Public License, not Library).
      LGPL allows glibc be _dynamically linked_ into software that may or may not be (L)GPL licensed. However, they didn't want to have the extra dependency, snd rather would need to statically link the library, meaning copying the interfaces and library binary _into_ their software for re-distribution, which is not allowed under LGPL, unless you also release your software under (L)GPL.
      if glibc had used MPLv2 (Mozilla Public License) then they would have been allowed to.

  • @esra_erimez
    @esra_erimez ปีที่แล้ว +2

    Why is it that you do not link to the original articles?

    • @deistormmods
      @deistormmods ปีที่แล้ว +2

      He did. It's in description.

  • @daltonyon
    @daltonyon ปีที่แล้ว

    Great article show how to move to other language with successful !

  • @rolandinnamorato1953
    @rolandinnamorato1953 ปีที่แล้ว

    best elocution in the game. 💯

  • @doomguy6296
    @doomguy6296 ปีที่แล้ว

    The only way to get good at anything, is keeping at it.

  • @KurtSchwind
    @KurtSchwind ปีที่แล้ว

    I've never heard the term "Roman writing" before. What is that?

  • @立立山立山立
    @立立山立山立 ปีที่แล้ว

    From Rust To Zig

  • @rolandinnamorato1953
    @rolandinnamorato1953 ปีที่แล้ว

    Mr Primeagen, do you now or have you ever worked for...THE EN-ES-AY?

  • @5h00G0fg
    @5h00G0fg ปีที่แล้ว +2

    I want to C Rust Go

  • @susiebaka3388
    @susiebaka3388 ปีที่แล้ว

    7:42 are you actually surprised? :P

  • @zahash1045
    @zahash1045 ปีที่แล้ว

    Windows copping whose Ws right there

  • @aquamirrorX
    @aquamirrorX ปีที่แล้ว +4

    my JS framework is better than your JS framework

  • @Luix
    @Luix ปีที่แล้ว

    Where are the stories from. C# or Java to CPP?
    I think that make the process of programming slower is no funny to the developers.

  • @PatrickMacielCampos
    @PatrickMacielCampos ปีที่แล้ว

    9:01 dont support windows? Prime!!!! Omg man LoL

  • @dogbiscuitninja
    @dogbiscuitninja ปีที่แล้ว

    Hello World

  • @max_ishere
    @max_ishere ปีที่แล้ว +2

    Honestly after doing Go I take it back. Go is pretty good because it's so boring.

  • @khhnator
    @khhnator ปีที่แล้ว

    i thought you were cool primagen

  • @ViníciusMiguel-q1g
    @ViníciusMiguel-q1g ปีที่แล้ว +2

    12:06 is a huge L for Prime

    • @sn-xc7rv
      @sn-xc7rv ปีที่แล้ว +1

      I think he was referencing Ballmer

    • @NatoBoram
      @NatoBoram ปีที่แล้ว

      Should've been clearer, GPL is the GOAT

  • @cariyaputta
    @cariyaputta ปีที่แล้ว +3

    RIIR.

    • @Kane0123
      @Kane0123 ปีที่แล้ว +10

      I love that TH-cam suggest that I can click a button and translate this to English.

    • @Kane0123
      @Kane0123 ปีที่แล้ว +4

      RIIR is translated to RIRR. The old Rewrite it Rust Rust.

    • @peter9477
      @peter9477 ปีที่แล้ว

      Rewrite It In Rust, for anyone who wasn't helped by the translate feature...

  • @romanstingler435
    @romanstingler435 ปีที่แล้ว +4

    rewrite GO in RUST :)7

  • @vitasartemiev
    @vitasartemiev ปีที่แล้ว +1

    TBF, NSA is pretty cringe, what with trying to backdoor public key cryptography and all.

  • @abanoubha
    @abanoubha ปีที่แล้ว

    Go ➡️ Rust
    then
    Rust ➡️ Zig
    then
    wtf 😒

    • @lagseeing8341
      @lagseeing8341 ปีที่แล้ว +1

      no one is moving from rust to zig

    • @abanoubha
      @abanoubha ปีที่แล้ว

      soon they will be

    • @ExylonBotOfficial
      @ExylonBotOfficial ปีที่แล้ว +1

      ​@@abanoubhawhy?

    • @abanoubha
      @abanoubha ปีที่แล้ว

      There will be a shiny new thing to try

  • @romankoshchei
    @romankoshchei ปีที่แล้ว +2

    When you say "Something like Protobuf" what else can it be if not Protobuf.

    • @ViníciusMiguel-q1g
      @ViníciusMiguel-q1g ปีที่แล้ว +3

      FlatBuffers, bincode, Thrift?

    • @jasondoe2596
      @jasondoe2596 ปีที่แล้ว

      ​@@ViníciusMiguel-q1g ...and Cap'n Proto, designed by one of the creators of Protobuf.

    • @peter9477
      @peter9477 ปีที่แล้ว +1

      Also msgpack, postcard, CBOR, ... and numerous others. Depending on what "like" means.

  • @lasun8960
    @lasun8960 ปีที่แล้ว

    wow wa ve va

  • @wassafshahzad8618
    @wassafshahzad8618 ปีที่แล้ว

    Damn it, I just switched from Learning GO to RUST.

    • @deistormmods
      @deistormmods ปีที่แล้ว +3

      You should stick with Go and build something. I can write Rust code but if you already started with Go, just stick with that. I only switched to Rust for my specific use case. I'd use Go in place of Java, Node, Python, for server side stuff if I'm doing web stuff. Systems programming, reverse engineering, etc, I'd use Rust.

    • @danielchettiar5670
      @danielchettiar5670 ปีที่แล้ว

      What will you use Go/Rust for? Rust has fewer jobs than Go in the web space anyways for now, if that matters for you

  • @pencilcheck
    @pencilcheck ปีที่แล้ว

    rust for algo trading!!

  • @vuau1717JKKq
    @vuau1717JKKq ปีที่แล้ว

    lol triggered go shills. not sure which 1 is worse, the go community or the rust community.

  • @tomwilliam7299
    @tomwilliam7299 ปีที่แล้ว

    Go is die before it born 🤣🤣🤣🤣 C# is better than Go