text stringlengths 0 2.35k |
|---|
[2219.08 --> 2226.44] Before I think go, I was just publishing binaries and like making sure that like I have the, you know, the right version all across. |
[2226.78 --> 2232.32] Versioning still is a problem with go get, but like, I, I think it's a, it's an okay sacrifice. |
[2233.44 --> 2233.96] Yeah. |
[2233.96 --> 2234.40] Okay. |
[2235.30 --> 2245.10] I'm just going to, what I'm going to do is just keep moving on to different go tools because I've, I've, I'm already learning things about these as well. |
[2246.44 --> 2252.74] And the other one, the other one with go build, which I love is the fact that we can do cross compilation. |
[2253.40 --> 2256.96] Now this, this has been around from, I think the beginning. |
[2256.96 --> 2266.50] Um, essentially for those that don't know, you can choose the, the target architecture, the target machine to build your go code for. |
[2266.90 --> 2272.66] That's very useful if you're using Docker, cause you can do like on a Mac, you can do the build for Docker. |
[2272.90 --> 2279.24] And then you've got the doc, you've got the binary, the Linux binary, uh, that you can then put into the Docker image. |
[2279.54 --> 2284.26] Or you can of course put the code into Docker and build it in there, uh, in that environment. |
[2284.26 --> 2288.74] But do you, how would you, how's your experience with cross compilation so far? |
[2289.40 --> 2290.42] I think it was magic. |
[2290.42 --> 2299.36] Like when I first saw, um, you know, they were typing go, oh, it's go, actually it's pronounced goose, um, and windows and go build. |
[2299.36 --> 2300.84] And like, you get a windows binary. |
[2301.00 --> 2302.08] It was like, whoa. |
[2302.38 --> 2302.74] Right. |
[2302.74 --> 2308.00] Like, um, I, it was fascinating and I usually generate binaries for Linux. |
[2308.00 --> 2312.72] So it was like, I kept, you know, working on my Mac without any worry or anything. |
[2312.72 --> 2313.84] It was so awesome. |
[2314.26 --> 2314.82] Yeah. |
[2315.02 --> 2315.96] Have you used it, Johnny? |
[2316.50 --> 2316.94] Absolutely. |
[2317.28 --> 2321.14] Um, one of my, uh, first, uh, one of my first jobs using go full time. |
[2321.38 --> 2328.68] My responsibility was the, basically to, to have, uh, sort of a multi, multi platform, um, build process. |
[2328.86 --> 2332.78] Um, so basically I relied on, on goose and gorge quite a bit. |
[2332.78 --> 2342.72] Um, and for those of you who don't know what gorgeous is busy, the, that's the companion to, to goose, uh, G O A R C H, um, for go architecture. |
[2342.72 --> 2344.06] Um, yeah. |
[2344.06 --> 2345.06] Yeah. |
[2345.06 --> 2352.10] So using goose and gorge were sort of a bread and butter, um, to having that work done and basically being able to push up binaries for all kinds of different platforms. |
[2352.10 --> 2358.16] And I mean, there are a ton of them that, you know, go support out of the box, um, for ARM processors. |
[2358.16 --> 2362.54] And, and, and I mean, there's, there's a, there's a, there's a, the combination, a sheer combination you can have. |
[2362.78 --> 2370.52] Um, I've lost, I've lost track of, of, of, of basically how all the different variations you can push out, but it's, it's really was a godsend. |
[2370.52 --> 2375.14] I mean, I, there's no way I would have been able to, to sort of get that job done without, without these things being in there. |
[2375.76 --> 2382.92] Uh, I think it's also awesome that like, I was doing a lot of developments, uh, for ARM and, you know, for a Raspberry Pi, for example. |
[2383.32 --> 2390.26] Uh, the processor on a, you know, typical Raspberry Pi is just going to be not comparable to my laptop. |
[2390.26 --> 2394.92] So I would just, you know, build things on my laptop because it's going to be faster. |
[2394.92 --> 2400.08] And then I will push it to the Raspberry Pi because it's just so much easier to do cross compilation. |
[2400.82 --> 2404.18] And, uh, it's just like maybe like 10 times faster or something. |
[2404.88 --> 2405.32] Wow. |
[2406.18 --> 2408.04] And so how does it actually work? |
[2409.08 --> 2418.12] Because obviously the compiler is doing a few steps and then ultimately it then creates a binary that's made up of, um, from the machine code. |
[2418.12 --> 2422.26] And is it just that the machine code is generated differently depending on the architecture? |
[2422.92 --> 2423.00] Yeah. |
[2423.08 --> 2426.16] You know, like, I mean, they know what to generate for each architecture. |
[2426.56 --> 2431.04] So they just basically take the inputs and they know what to map it. |
[2431.14 --> 2436.76] And then they generate, uh, the output based on the, you know, um, operating system and architecture. |
[2438.14 --> 2444.06] And that must've been possible because of the way that they built the tool system. |
[2444.06 --> 2449.10] Do you think it was deliberate that they wanted to be able to build to any target architecture? |
[2449.10 --> 2455.98] Or do you feel like they just realized they could after because they'd just built it and designed it in a simple way? |
[2456.76 --> 2460.70] I don't think you, you stumble on something like this, um, by accident. |
[2460.70 --> 2473.70] I think I had, I mean, if I had to guess, I'd say this was by design, um, is considering that the, the creators of, of the language busy to head, they had, um, they see they were building for, for Google. |
[2473.70 --> 2474.00] Right. |
[2474.00 --> 2485.30] So I imagine that at some point they need to be able to run, um, binaries on different platforms with different CPU architectures and, you know, 32 bits or 64 bits and all that, and all that good stuff. |
[2485.40 --> 2490.12] So I imagine this must've been sort of a part of the plan, part of the design. |
[2490.34 --> 2498.96] This, this seems way too complicated and way too powerful a feature to have just come across, um, um, to have fallen out of the build system. |
[2498.96 --> 2499.96] Hmm. |
[2499.96 --> 2500.46] Hmm. |
[2500.46 --> 2505.56] There's also like, we, uh, I think simplified the process, but there's this intermediate assembly. |
[2505.56 --> 2510.30] So, uh, the compiler first translates everything to that intermediate assembly. |
[2510.30 --> 2518.16] And from that point on, uh, they are being compiled to the, you know, the architecture specific, um, machine code, uh, instructions. |
[2518.16 --> 2524.64] So, so, um, it's, it's actually like, you know, the internals of compilers, like this, like two step thing. |
[2524.64 --> 2529.36] Uh, and this is like a really typical way the compilers work. |
[2529.48 --> 2533.50] They're just, you know, taking it, converting everything into an intermediate language. |
[2534.04 --> 2538.96] And then from that intermediate language, you can just basically target whatever architecture you want to target. |
[2539.46 --> 2539.98] Hmm. |
[2540.28 --> 2542.66] And of course you can have build tags as well. |
[2543.36 --> 2546.62] Does anyone want to describe build tags? |
[2547.44 --> 2547.66] Yeah. |
[2547.72 --> 2551.38] Build tags are, uh, it's providing conditional completion. |
[2551.38 --> 2554.66] And you can create different rules. |
[2554.66 --> 2560.30] For example, you can have constraints to say, only use this file for Linux builds. |
[2560.30 --> 2566.48] Or you can say, I just want only arm builds to have this file included in the build. |
[2566.70 --> 2571.04] Uh, you can, there are many different rules provided by the tool chain. |
[2571.16 --> 2573.70] Uh, go version is one of them. |
[2574.08 --> 2576.58] Arbitrary custom build tags is one of them. |
[2576.58 --> 2590.28] So it kind of gives you this like, you know, possibility to switch to different implementations depending on the go version, uh, depending on the, you know, the, uh, operating system or architecture or some custom build tags. |
[2590.64 --> 2591.08] Yeah. |
[2591.12 --> 2594.46] I've used those successfully when it comes to testing. |
[2594.46 --> 2603.98] Sometimes if there are long running tests or if there are integration tests that require a different dependency to be running or something, I use build tag in our test files. |
[2603.98 --> 2607.24] And that's quite an easy way to choose a subset of things to run. |
[2607.96 --> 2611.64] Um, and it's just a special comment that goes at the top of the file, isn't it? |
[2612.14 --> 2612.44] Yeah. |
[2612.44 --> 2617.14] It's just like, I think it, it must be on, um, I mean, it's on the top of the file. |
[2617.38 --> 2620.02] Um, there's a particular place, but that's it. |
[2620.08 --> 2621.30] Um, and it's really readable. |
[2621.30 --> 2630.72] I think my only complaint about this rules, uh, about the build constraints is like, it's just really hard to sometimes just, you know, have like multiple rules represented. |
[2630.72 --> 2632.68] It becomes really hard to parse. |
[2632.68 --> 2643.60] Like if you want to have like more complex rules, like, Hey, just include this file on Linux, um, you know, Darwin and blah, blah, but not on this particular thing. |
[2643.60 --> 2652.48] And I think on top of that, like not for this custom build tag, like I think writing those expressing those, uh, complicated, more complex type of constraints is a little bit hard. |
[2652.48 --> 2654.70] But otherwise I think it's just pretty straightforward. |
[2655.06 --> 2656.98] And I use build tags all the time. |
[2656.98 --> 2670.98] This episode is brought to you by our friends at retool. |
[2671.14 --> 2677.90] Retool helps teams focus on product development and customer value, not building and maintaining internal tools. |
[2677.90 --> 2687.60] It's a low code platform built specifically for developers, no more UI libraries, no more hacking together data sources, and no more worrying about access controls. |
[2688.10 --> 2696.00] Start shipping internal apps to move your business forward in minutes with basically zero uptime, reliability, or maintenance burden on your team. |
[2696.34 --> 2705.38] Some of the best teams out there trust retool, Brex, Coinbase, Plaid, DoorDash, LegalGenius, Amazon, Allbirds, Peloton, and so many more. |
[2705.38 --> 2710.44] The developers at these teams trust retool as their platform to build their internal tools. |
[2710.64 --> 2711.90] And that means you can too. |
[2712.10 --> 2713.06] It's free to try. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.