|
6 | 6 |
|
7 | 7 | 00:00:16 but using the full libraries, especially the C and Rust-based ones, has been out of reach
|
8 | 8 |
|
9 |
| -00:00:22 until Seasnakes. This project by Anthony Shaw and Aaron Powell unlocks some pretty serious |
| 9 | +00:00:22 until Csnakes. This project by Anthony Shaw and Aaron Powell unlocks some pretty serious |
10 | 10 |
|
11 | 11 | 00:00:27 integration between the two languages. And we have them both on the show today to tell us all about it.
|
12 | 12 |
|
|
130 | 130 |
|
131 | 131 | 00:07:15 And then finally, there's just not as many packages or options in the .NET space. So it's always been that like, "Ah, okay, well, if I want to learn this, the tutorial is in Python or the package it recommends using is in Python." So it was always kind of like, how do we bridge that gap?
|
132 | 132 |
|
133 |
| -00:07:30 That was kind of one of the early thinkings of just, you know, that's a clear problem space, right? Like a lot of people are learning that, but then going into industry and maybe Python isn't the language that the organization they're working with is using. |
| 133 | +00:07:30 That was kind of one of the early thinking's of just, you know, that's a clear problem space, right? Like a lot of people are learning that, but then going into industry and maybe Python isn't the language that the organization they're working with is using. |
134 | 134 |
|
135 | 135 | 00:07:43 How do we still have that? A fundamental knowledge that they've gained or the like the tooling they want to use available to them?
|
136 | 136 |
|
|
394 | 394 |
|
395 | 395 | 00:17:58 And that's the difference is that most packages in the ecosystem these days are designed and tested for CPython.
|
396 | 396 |
|
397 |
| -00:18:05 And this is all, at least they're tested for PyPy. |
| 397 | +00:18:05 And this is all, at least they're tested for PyPI. |
398 | 398 |
|
399 | 399 | 00:18:09 But all the other implementations are pretty much a no.
|
400 | 400 |
|
|
426 | 426 |
|
427 | 427 | 00:19:04 Yeah, I'm Python is one.
|
428 | 428 |
|
429 |
| -00:19:06 Pigeon, we've covered in a past episode. |
| 429 | +00:19:06 Pyjion, we've covered in a past episode. |
430 | 430 |
|
431 | 431 | 00:19:08 Oh, that's not going to work.
|
432 | 432 |
|
|
558 | 558 |
|
559 | 559 | 00:23:19 And then it would generate a function that can call that for you with .NET equivalence.
|
560 | 560 |
|
561 |
| -00:23:24 And then it handles the the marshalling, like the transfer of the types backwards and forwards between .NET and Python. |
| 561 | +00:23:24 And then it handles the marshalling, like the transfer of the types backwards and forwards between .NET and Python. |
562 | 562 |
|
563 | 563 | 00:23:32 And like that's most of the project is really about that particular problem.
|
564 | 564 |
|
|
636 | 636 |
|
637 | 637 | 00:27:08 I wish we had this in Python.
|
638 | 638 |
|
639 |
| -00:27:09 I know we have something kind of like it with list compreemptions, but it's not the same. |
| 639 | +00:27:09 I know we have something kind of like it with list copromotion's, but it's not the same. |
640 | 640 |
|
641 | 641 | 00:27:12 One thing that I really wanted to make sure that we were tackling with this and to Anthony's point before of the, that you've got two very different type systems that you're working with.
|
642 | 642 |
|
|
746 | 746 |
|
747 | 747 | 00:31:27 And they're all running in separate threads in a thread pool in .NET.
|
748 | 748 |
|
749 |
| -00:31:30 And you shouldn't have to worry about the gill. |
| 749 | +00:31:30 And you shouldn't have to worry about the gil. |
750 | 750 |
|
751 | 751 | 00:31:32 Like you shouldn't have to know too much in terms of what it is and how it works.
|
752 | 752 |
|
|
1108 | 1108 |
|
1109 | 1109 | 00:44:02 Yeah.
|
1110 | 1110 |
|
1111 |
| -00:44:02 But with UV, V and V, give it a Python version. |
| 1111 | +00:44:02 But with UV, VENV, give it a Python version. |
1112 | 1112 |
|
1113 | 1113 | 00:44:06 It can fetch it.
|
1114 | 1114 |
|
|
1212 | 1212 |
|
1213 | 1213 | 00:48:16 Yeah.
|
1214 | 1214 |
|
1215 |
| -00:48:17 So one thing I wanted maybe could spend a couple minutes talking about this Anthony is I saw an example where you you showed integrating open telemetry and ASP dotnet and Postgres and all sorts of stuff together, not just a, you know, hello world sort of example, which shows some really cool stuff, but maybe doesn't convince people that they could do cool stuff with it. |
| 1215 | +00:48:17 So one thing I wanted maybe could spend a couple minutes talking about this Anthony is I saw an example where you showed integrating open telemetry and ASP.net and Postgres and all sorts of stuff together, not just a, you know, hello world sort of example, which shows some really cool stuff, but maybe doesn't convince people that they could do cool stuff with it. |
1216 | 1216 |
|
1217 | 1217 | 00:48:39 You want to just maybe talk us through some of the moving parts of that to give people a sense of a more realistic example.
|
1218 | 1218 |
|
|
1224 | 1224 |
|
1225 | 1225 | 00:48:56 Yeah, well, the front end written in HTML and JavaScript.
|
1226 | 1226 |
|
1227 |
| -00:48:59 The API is written in dotnet. |
| 1227 | +00:48:59 The API is written in .NET. |
1228 | 1228 |
|
1229 | 1229 | 00:49:01 You're using Postgres as the database.
|
1230 | 1230 |
|
|
1238 | 1238 |
|
1239 | 1239 | 00:49:16 It's just real enough.
|
1240 | 1240 |
|
1241 |
| -00:49:17 The weather demo is like the canonical dotnet demo of when you do file new API projects like here is a weather app. |
| 1241 | +00:49:17 The weather demo is like the canonical .NET demo of when you do file new API projects like here is a weather app. |
1242 | 1242 |
|
1243 | 1243 | 00:49:24 So I from a dotnet developer, I feel very much at home.
|
1244 | 1244 |
|
|
1300 | 1300 |
|
1301 | 1301 | 00:51:30 And in the Python code, we use open telemetry to show the trace of it talking to the database.
|
1302 | 1302 |
|
1303 |
| -00:51:36 And we we use Python logging and that log information on the trace information all gets put into the same trace. |
| 1303 | +00:51:36 And we use Python logging and that log information on the trace information all gets put into the same trace. |
1304 | 1304 |
|
1305 | 1305 | 00:51:42 So from dotnet from start to finish, you see the request come in on the front end.
|
1306 | 1306 |
|
|
1348 | 1348 |
|
1349 | 1349 | 00:53:20 And it shows something which is practical in Python and something which is practical in .NET, which is like a proper app with tracing and logging and all the, you know, all those kind of features.
|
1350 | 1350 |
|
1351 |
| -00:53:30 And on the Python side, we're using pandas, which, you know, and we're using numpy, which is the C extension. |
| 1351 | +00:53:30 And on the Python side, we're using pandas, which, you know, and we're using NumPy, which is the C extension. |
1352 | 1352 |
|
1353 | 1353 | 00:53:36 And we're using psycho PG, which is like depends on a whole bunch of like third party libraries as well.
|
1354 | 1354 |
|
|
1406 | 1406 |
|
1407 | 1407 | 00:55:54 And so on and so forth.
|
1408 | 1408 |
|
1409 |
| -00:55:56 Well, you know, like with sea snakes, you could expose that model, create some surface areas in just Python APIs that is then going to be consumable by a .NET application. |
| 1409 | +00:55:56 Well, you know, like with Csnake, you could expose that model, create some surface areas in just Python APIs that is then going to be consumable by a .NET application. |
1410 | 1410 |
|
1411 | 1411 | 00:56:08 So yeah, it's something you can definitely do not 100% sure whether you can do it on mobile.
|
1412 | 1412 |
|
|
1454 | 1454 |
|
1455 | 1455 | 00:58:13 That's awesome.
|
1456 | 1456 |
|
1457 |
| -00:58:14 You reach inside of the the ND array, just grab its actual memory and just say, got it. Let's go. |
| 1457 | +00:58:14 You reach inside of the ND array, just grab its actual memory and just say, got it. Let's go. |
1458 | 1458 |
|
1459 | 1459 | 00:58:20 Got it. Let's go.
|
1460 | 1460 |
|
|
1474 | 1474 |
|
1475 | 1475 | 00:58:54 You know, it will work with 32 bit ints and 32 or 64 bit floats, for example.
|
1476 | 1476 |
|
1477 |
| -00:59:00 So like if you're storing a 2D matrices in 32 bit floats in NumPy and then you want to send that to to .NET to I don't know, like pick out some specific values or like do some calculations in .NET, then you can just chuck that back as a buffer. |
| 1477 | +00:59:00 So like if you're storing a 2D matrices in 32 bit floats in NumPy and then you want to send that to .NET to I don't know, like pick out some specific values or like do some calculations in .NET, then you can just chuck that back as a buffer. |
1478 | 1478 |
|
1479 | 1479 | 00:59:17 And there's information in the docs about how to do this and then you can just access the values directly out of memory.
|
1480 | 1480 |
|
|
1611 | 1611 | 01:02:23 Thank you.
|
1612 | 1612 |
|
1613 | 1613 | 01:02:24 We'll see you next time.
|
1614 |
| - |
0 commit comments