Skip to content

Commit 40abf77

Browse files
authored
Merge pull request #168 from manikanta-hitunik-com/patch-345600
Update 486-csnakes-embed-python-code-in-.net.txt
2 parents 4394cda + cbbd15a commit 40abf77

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

transcripts/486-csnakes-embed-python-code-in-.net.txt

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
00:00:16 but using the full libraries, especially the C and Rust-based ones, has been out of reach
88

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
1010

1111
00:00:27 integration between the two languages. And we have them both on the show today to tell us all about it.
1212

@@ -130,7 +130,7 @@
130130

131131
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?
132132

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.
134134

135135
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?
136136

@@ -394,7 +394,7 @@
394394

395395
00:17:58 And that's the difference is that most packages in the ecosystem these days are designed and tested for CPython.
396396

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.
398398

399399
00:18:09 But all the other implementations are pretty much a no.
400400

@@ -426,7 +426,7 @@
426426

427427
00:19:04 Yeah, I'm Python is one.
428428

429-
00:19:06 Pigeon, we've covered in a past episode.
429+
00:19:06 Pyjion, we've covered in a past episode.
430430

431431
00:19:08 Oh, that's not going to work.
432432

@@ -558,7 +558,7 @@
558558

559559
00:23:19 And then it would generate a function that can call that for you with .NET equivalence.
560560

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.
562562

563563
00:23:32 And like that's most of the project is really about that particular problem.
564564

@@ -636,7 +636,7 @@
636636

637637
00:27:08 I wish we had this in Python.
638638

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.
640640

641641
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.
642642

@@ -746,7 +746,7 @@
746746

747747
00:31:27 And they're all running in separate threads in a thread pool in .NET.
748748

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.
750750

751751
00:31:32 Like you shouldn't have to know too much in terms of what it is and how it works.
752752

@@ -1108,7 +1108,7 @@
11081108

11091109
00:44:02 Yeah.
11101110

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.
11121112

11131113
00:44:06 It can fetch it.
11141114

@@ -1212,7 +1212,7 @@
12121212

12131213
00:48:16 Yeah.
12141214

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.
12161216

12171217
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.
12181218

@@ -1224,7 +1224,7 @@
12241224

12251225
00:48:56 Yeah, well, the front end written in HTML and JavaScript.
12261226

1227-
00:48:59 The API is written in dotnet.
1227+
00:48:59 The API is written in .NET.
12281228

12291229
00:49:01 You're using Postgres as the database.
12301230

@@ -1238,7 +1238,7 @@
12381238

12391239
00:49:16 It's just real enough.
12401240

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.
12421242

12431243
00:49:24 So I from a dotnet developer, I feel very much at home.
12441244

@@ -1300,7 +1300,7 @@
13001300

13011301
00:51:30 And in the Python code, we use open telemetry to show the trace of it talking to the database.
13021302

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.
13041304

13051305
00:51:42 So from dotnet from start to finish, you see the request come in on the front end.
13061306

@@ -1348,7 +1348,7 @@
13481348

13491349
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.
13501350

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.
13521352

13531353
00:53:36 And we're using psycho PG, which is like depends on a whole bunch of like third party libraries as well.
13541354

@@ -1406,7 +1406,7 @@
14061406

14071407
00:55:54 And so on and so forth.
14081408

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.
14101410

14111411
00:56:08 So yeah, it's something you can definitely do not 100% sure whether you can do it on mobile.
14121412

@@ -1454,7 +1454,7 @@
14541454

14551455
00:58:13 That's awesome.
14561456

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.
14581458

14591459
00:58:20 Got it. Let's go.
14601460

@@ -1474,7 +1474,7 @@
14741474

14751475
00:58:54 You know, it will work with 32 bit ints and 32 or 64 bit floats, for example.
14761476

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.
14781478

14791479
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.
14801480

@@ -1611,4 +1611,3 @@
16111611
01:02:23 Thank you.
16121612

16131613
01:02:24 We'll see you next time.
1614-

0 commit comments

Comments
 (0)