All Episodes

November 22, 2024 40 mins

Natan Rolnik from swifttoolkit.dev and I chatted about building tools in Swift, ArgumentParser, Swift Package Manager, and more.

Guest

Announcements

Links

Related Episodes

Mark as Played
Transcript

Episode Transcript

Available transcripts are automatically generated. Complete accuracy is not guaranteed.
Leo Dion (host) (00:03):
Welcome to another episode of Empower Apps.
I'm your host, Leo Deanne, andtoday I'm joined by Nathan Rolnick.
Nathan, thank you so muchfor coming on the show.

Natan Rolnik (guest) (00:12):
Hey.
Hi Leo.
Thank you for having me.

Leo Dion (host) (00:15):
Before we begin, let you do your own introduction.

Natan Rolnik (guest): Alright so I'm Nathan. (00:20):
undefined
I've been doing iOS for awhile, since iOS three four.
I learned to program in objective Cand that, that's mostly my passion.
Along the way I'velearned other stuff and.
Nowadays I work at as asenior iOS dev at monday.com.

(00:41):
And in my free time, I alsowrite content mostly around the
tooling and server side Swift, inmy, website, swift toolkit.dev.
That's really like a passion of

Leo Dion (host) (00:55):
Have you written?
Have you written for code?
Go?

Natan Rolnik (guest) (00:59):
Yeah.
In the past, I also I wrotesome articles for Kodeco.

Leo Dion (host) (01:03):
So Monday

Natan Rolnik (guest) (01:04):
That's how I started writing also,

Leo Dion (host) (01:07):
okay, so Monday has two Israeli CCO Kodeco.
That's pretty awesome

Natan Rolnik (guest) (01:14):
month, yes.
Yeah, we have a few more in here inthe country we have a few more people
that contributed to Kodeco, but

Leo Dion (host) (01:20):
But previous guests, we were just chatting before the show,
previous guest Shai is also at Monday.
A pretty, sounds likea pretty great place,

Natan Rolnik (guest) (01:29):
Yeah, we have,

Leo Dion (host) (01:30):
people.

Natan Rolnik (guest) (01:31):
Yeah.
I can't say that about myself,but yeah, we have a growing team.

Leo Dion (host) (01:36):
Yeah.

Natan Rolnik (guest) (01:37):
It's a, it's an interesting product.

Leo Dion (host) (01:40):
Yeah.
It is an interesting product.
We we were just talking a lot onlineand you've been posting a lot of great
stuff that I wanted to chat about on the
We've been talking a lot online about.
Some of the stuff you've been workingon and some of the stuff on your blog.
I wanted to maybe let you introducewhat you've been talking about
and what you've been working onlately when it comes to Swift.

Natan Rolnik (guest) (02:01):
What I've been, my, my goal of this website was to
produce some content that I feel thatthe community lacked a little bit with
good tutorials, practical tutorials,and and even sometimes interactive
stuff on the web of content focusedon, on tooling and server side.
For example, one of the thingsthat I did was a package

(02:25):
swift syntax file cheat sheet.
That, that was one of the, that wasactually one of the first posts.
Another one that I'm reallyproud about it was a.
The Swift argument parserinteractive guide, so we co like it.
This is divided in threesections and explaining options
and flags and arguments.

(02:46):
What are the difference between them andoption groups and how to handle errors.
So I built a little terminal simulatorwhere people can actually run commands
that run executables that are inthe sample code so they can see the
result of how, what that code means.
So mostly it's been content aroundCLI stuff a little bit about the

(03:11):
server side that I wanna writemore about it now that we just had
Hummingbird two released by Adames,

Leo Dion (host) (03:21):
Yeah, you just

Natan Rolnik (guest): yeah, I just published, (03:22):
undefined

Leo Dion (host) (03:23):
of the recording.
So people shoulddefinitely check that out.
Hummingbird is fantastic.
I

Natan Rolnik (guest) (03:28):
Yeah, it is.
There, I think both, both Vapor andHummingbird, they are, they're amazing.
And I think that connects a littlebit to, what I wanted to say is that
I, I think that Swift is, empowersus so much in ways that 10 years
ago we couldn't as iOS developersthat you had to learn other errors.

(03:48):
You still have, and I don't thinkthat you shouldn't learn other
stuff but it gives so much power.
Cons in comparing to wherewe were 10, 15 years ago.

Leo Dion (host) (03:59):
Could you imagine this stuff in objective C, like

Natan Rolnik (guest) (04:02):
Yeah.
I actually, I.

Leo Dion (host) (04:04):
or command line objective C?
It's just I'm sureit's a possible, right?

Natan Rolnik (guest) (04:10):
but Swift is great in so many ways.
You can talk about that later,

Leo Dion (host) (04:14):
Yeah.

Natan Rolnik (guest) (04:14):
that makes it

Leo Dion (host) (04:15):
let's I wanna talk.
Go ahead.
Sorry.

Natan Rolnik (guest) (04:18):
I know that makes it much more of a fit.
I'm sure like you could write allthese things with objective C, but
not only the verity, but languagefeatures and that SWIFT allows us.
I, in one of my talks that Igave recently about, was like
a quick introduction to Vapor.
I actually had a screenshot of aservice that was called Objective Cloud.

(04:39):
I'm not sure you remember that.
Gave a framework.
They gave a frameworkthat you could write.
servers just like vapor, but notjust like vapor, but in, in the
same sense that vapor or express.
So you could write objective stuffand they had a cloud that ran on
Mac and could help with deploying.

(05:00):
So Swift is may, maybe that thevision is the same, that you can
share code may, that you can useknowledge or models and deploy
that on the cloud and have that aspart of your app in another place.

Leo Dion (host) (05:14):
Let's deep dive a little bit more into the CLI part yeah.
What, why do you thinkSWIFT is a good option?
Just let's start particularlywhen it comes to CLI tools.

Natan Rolnik (guest) (05:28):
Yeah.
I like to divide that in three orfour areas where I see the advantages.
And the first one isthe language itself.
Like it has so many great features.
It has all the foundation, APIthat we already, we are used to
date and gets improved and likedate formatting and whatnot.

(05:48):
Like all foundation.
We have I don't know, e enums, likethe associated values, like all
this can live inside a CLI tool.
We have macros.
You can use macros fromyour own, from your tools.
You can use as in Kuwait, which is.
For CLI tools, they'resuper helpful as well.

(06:08):
Like all the time you have to do eithernetwork requests or disc operations
that they are, they might take sometime, so writing them with as in Kuwait,
is much, much better than completionblocks or promises and futures.
And ma many things like that.
The language is, we allare used to it, right?

(06:29):
So that's number one.
Number two I think is if you're runningon a Mac, you can access UI kit and
app kit, APIs, and even Swift ui.
If you wanna draw some stuffyou can generate images.
That's a second advantage.
The third one is thewhole ecosystem, right?
We, you, we can use packages that runon Linux, but they also run on Mac.

(06:52):
And they are packages that maybeyou are already familiar with and
you can also share code with yourown I dunno, within your team and
iOS app and CLI and maybe a servercomponent that uses the same models.
And I think that the most importantof them, like the fourth one is that
if you have a team of iOS developers,they all are gonna know swift.

(07:13):
Like one, one person might know more,no, the other one might know Python,
the other one might know Ruby and Rust.
But if it's a team of mobile developersand iOS developers, they all should know
Swift and they could be able to jumpin and improve and fix and add features
and stuff like so I think that there,like there are four different, these

(07:36):
are four different advantages that.
They're very powerful.

Leo Dion (host) (07:40):
do you think it's easier to go from being an iOS developer
in SWIFT to a CLI tool developer inSwift, or is it easier to go from a
node or Python developer of CLI toolsto a SWIFT developer in CLI tools.
Does that make sense?

Natan Rolnik (guest) (08:01):
It makes, I think that's, I think that maybe
I'm not sure about the answer, but Ithink that because the node ecosystems
started more from the backend, likeend point, like from the backend view.
So they probably started offwith more tooling around that.
And

Leo Dion (host) (08:18):
Did it though, like Node is JavaScript based?
It was

Natan Rolnik (guest) (08:22):
Yeah.
Oh

Leo Dion (host) (08:23):
is actually all browser.
Browser base.
So technically

Natan Rolnik (guest): No, but let's say Ruby. (08:27):
undefined

Leo Dion (host) (08:28):
mean it's node but

Natan Rolnik (guest) (08:30):
Yeah, but let's

Leo Dion (host) (08:31):
it is more, yeah.
Yeah.
Okay.
There we go.

Natan Rolnik (guest) (08:34):
like they're by definition they have this more purpose
of, I'm not sure about the purpose,but if you say Ruby, you're probably
gonna think about Ruby on Rails, orif you say no, you're probably gonna
think about Express or other framework.
So that, that's basicallywhere I wanna go.
So I think that as a consequencethat their ecosystem is much

(08:58):
more robust in that sense.
And they're good options.
They might be a better option from,I dunno if you are a programmer
that knows both languages, but.
You are not specifically coming,like from a, focusing on a team
of five OS developers or might beprobably that no is a better choice.

(09:22):
I don't know, maybe.

Leo Dion (host) (09:23):
right,

Natan Rolnik (guest) (09:23):
but but I think that the ecosystem is
growing and the, there's been alot of evolution and work on that.
So I think that time makes, itmakes it roll here as more and more
efforts are invested and we have morepackages around it, I think it's a
matter of time and, the communityrealizes that this is a really
good option and as it grows, right?

(09:46):
How do you see this?

Leo Dion (host) (09:47):
Yeah.
I think as we'll talk about later, Ifeel like the ecosystem when it comes
to CLI tools has really seen like a big.
It seems like there's been a lotgoing on lately in the last six
months as far as what's out there.
Obviously we've had argument par parserwhich has been a big benefit and I've

(10:09):
even given a talk at, it was like fiveyears ago, I think I gave a talk on it.
But it's like there's a lot you can do.
Let's talk a little bit more aboutargument parser specifically.
What so you, what did you learn whenyou built that interactive tool?
As far as how it works or howthe mechanics of it work or
what are some quirks aboutit that people don't realize?

(10:31):
When you built the interactive toolthat you don't think most people know.

Natan Rolnik (guest) (10:34):
The interactive guide actually made me learn other
things about Lambdas and 'cause theyactually run, they run in a lambda
and I just returned the result.
I actually learned morein the last few weeks.
I had the chance to give it a try toSwift Cloud by Andrew Barber, which
I also wrote a little bit about it.

(10:57):
And the argument parser is itactually has it, it does a few things.
It's not only parsing, it doesparsing of commands and translates
the them into structs thatyou can that where code lives.
Sorry, but, and, but it also doesall the handling of the main, of

(11:17):
like the entry point of your tool.
Like you don't need to, you don't needto write the main function, right?
You just mark your str your, likeyour root command with at main
and possible possible commandtakes care of getting the inputs
translate, like doing the parsing,calling the validate function first.

(11:39):
First it validates, then it runs andit wraps that in a dual catch block
in a look at statement and if iterrors, it also outputs there, error.
It, so it does a lot around it.
So that's what I learned in more inthe bit in, in the last few weeks.
I.
And it's great.
I just felt that it's a bit limitedif you want a bit more control.

(12:00):
And if you want

Leo Dion (host) (12:01):
do you mean exactly?

Natan Rolnik (guest) (12:02):
If you wanna add colors and displayers with with
styling or I don't know if you wannaadd loaders or interactive input.
we were just talking about Node, right?
Like it they support this.
They have packages thatthey do this right away.

(12:25):
And let's say we have console kitfrom the folks at Vapor that it
does some sort of of interactivestuff, but it's not in the same
package as the Arwin parser.
So I'm also not sureif that's their goal.

Leo Dion (host) (12:38):
Like it makes sense that argument pars are, is
good about the front end part,but I do agree that there's like
something missing when it comes to.
Not the front end part.
The, they, they've, they have atool that's really good at parsing
arguments and just running a thing.
And what I do agree is missing issome of the pieces that you mentioned.

(13:01):
So let's go over what you mentioned.
You said loaders.
What do you mean by loaders?
Exactly.

Natan Rolnik (guest) (13:06):
In the same way that you, when you have a UI
on, on an app, that you'll seea loader and then data shows.
Sometimes you, let's say you wannaauthenticate with some service or you
wanna run a service that takes a while.
I don't know.
It's gonna build a docker imageor download a docker image.
It's nice to see some output inthe same way that you don't wanna
see a blank screen on an app.

(13:27):
You also don't wanna see in theterminal that it's stuck 'cause
you dunno what's going on.
So another thing that I learned recentlyis like how, let's say loaders work.
They actually in CLI tools,they, they actually print stuff
and delete and update that.
And it, it keeps changing the outputwithout pre, without adding more.

(13:48):
It just replaces the current state.
So

Leo Dion (host) (13:51):
What we're talking about is the like VT 100 commands
basically, where you can do controlcommands to say, move the cursor
to the left, move the cursor

Natan Rolnik (guest): yeah our printing stuff. (14:00):
undefined

Leo Dion (host) (14:02):
Colors, printing, all that

Natan Rolnik (guest) (14:04):
yes.
And console kit has alot of that stuff but

Leo Dion (host) (14:08):
Oh, really?
Okay.

Natan Rolnik (guest) (14:09):
console, kt they have manuals and there's
also a great a great package.
It's called Swift,TUI, with a capital t.
That it has a similar

Leo Dion (host) (14:17):
about that in this show.

Natan Rolnik (guest) (14:19):
Yeah.
And

Leo Dion (host) (14:20):
UI.

Natan Rolnik (guest) (14:21):
yeah and you can use that for terminal apps, CLI apps.
And, I don't think that's thegoal of the argument parser.
Like it's so good at parsingand the way they designed all
the property wrappers options,option groups, flags, arguments.
It's super powerful.

(14:41):
But in the same way so let's sayI, I was looking for interactivity
in the argument parser, and I foundthat there's a branch that it's
1-year-old it's been stale and it'sa bit of a bu bummer 'cause we have
no idea what, where that's gonnahap, like where it's headed and
what's the direction and what's.

Leo Dion (host) (15:03):
how is argument parser working with?
When it comes to Swift six type stuff

Natan Rolnik (guest): that's a good question. (15:09):
undefined

Leo Dion (host) (15:10):
You know if there's no issues with like
Sendible or anything like that?

Natan Rolnik (guest) (15:13):
I'm not sure they're marked with it.
It's worth checking.
I'm not a hundred percent sure

Leo Dion (host) (15:19):
Yeah, it's fine.
I figured I'd ask.
I, the other thing you hadon here was Specter kit.
Did you look at that as well?

Natan Rolnik (guest): I didn't try it yet. (15:28):
undefined
It's in my wishlist of poststhat I wanna, of, packages
that I wanna highlight.
I want to play around with it andsee, but it's, yeah it, I don't
think it's similar to swift ey tothe other package we mentioned.
It's also nice for building UIs andborders and tables and things like that.

Leo Dion (host) (15:49):
Okay.
Yeah, I'm looking at this stuff.
It's amazing what people have done and

Natan Rolnik (guest) (15:53):
Oh yeah.
It's incredible.
'cause like

Leo Dion (host) (15:55):
I think, I don't know, I've started three or four
different projects where I played witha VT 11 a hundred stuff in the codes.
And it's all, it's justlike a rabbit hole for me.
I think what for me is missing andwe've, me, I, maybe I've mentioned
this on the previous podcast, but ismore stuff hooked up to observable.
I know that's what's going onwith Swift two E, but with the new

(16:16):
change from combine I'm not surethat it's compatible with the new
Yeah, the new observable stuff.
So that's really what I'd liketo see is something like that.
The other tool I'm gonna

Natan Rolnik (guest) (16:28):
I think that all this is eventually they're gonna arrive.
But I I'm not sure if disappointingis the word, but I would be
nice to see more efforts onthose areas from everyone.
And I include myself there

Leo Dion (host) (16:41):
If only we had infinite time.

Natan Rolnik (guest) (16:43):
Yes.

Leo Dion (host) (16:43):
I wanted to mention that I use a lot.
It's not swift based, but it'sdefinitely used in my iOS development
and that would be Fast lane.
It has a really nice terminalinterface where it doesn't try to
do everything, but it tries to doenough that I feel like there's a
lot of great ideas there that we inthe SWIFT community could use when

Natan Rolnik (guest) (17:03):
Yeah.
I think that they also have.

Leo Dion (host) (17:05):
an interactive app

Natan Rolnik (guest) (17:08):
Yeah, they have the advantage that in Ruby they, they
can do all the plugins stuff and it'slike much more dynamic and they plays
together much more nicer than Swiftit, it's super, it's much harder to do
that in Swift, if you wanted to haveplugins for cli and I know that Ruby is
much more friendly on, in this aspect.

Leo Dion (host) (17:28):
Anything else you wanna talk about when it comes to CLI Tools?

Natan Rolnik (guest) (17:32):
I just think that ui and experience of
CLI tools, they're, there's an.
Even when we write for ourselves,like we could do better in, in terms
of explaining what's available,like what commands are available
and help and things like that.
And like dividing dividing s commandsand sub commands into sections

(17:57):
like in, of different of differentdifferent areas or different domains.
And also output, like being ableto control output and instead
of like just excode build, likejust spitting out information and
That's why there are many parser or Ithink it's XY pretty or X, that does

Leo Dion (host) (18:18):
Yeah.
XY pretty, yep.
That's a big one.

Natan Rolnik (guest) (18:21):
Yeah.
So I think that's, I.
It's worth, like in general, toolinginvesting time in tooling and in tooling
UI and in tooling experience is oneof those things that you never regret.
' cause in the end of the day it'sa tool that it's gonna help you.
So I've, and anytime you spend on it,you're gonna, you're gonna get a, get

(18:42):
it back pretty quick once you use it.

Leo Dion (host) (18:46):
So there was a really interesting article you had out a
few weeks ago about this kBox idea.
Explain what that means exactlyand why you built a macro

Natan Rolnik (guest) (18:58):
no I, that was, that's not mine actually.
The macro itself iswritten by Rick Vanden.
is he's from la.
No it's fine.
So all credits go to him.
'cause I actually, I met him and I sawthis him, I saw him presenting about
it in, in a conference and beforethat I actually, I didn't invest

(19:19):
time in really understanding whatcopy on the right means and all the
consequences and how, and what's theimpact it, it can have in your in apps.
And so basically this goesback the basics of reference
types and value types.
And copy and write goes to theconcept that when you use value

(19:41):
types, whenever you copy thosetypes, they actually take memory.
And instead of, differentlythan reference types
where just copy a pointer.
But the memory is the same.
The memory address of all thecopied objects are the same.

(20:02):
When you use value types, youactually use more ram memory, right?
So if you copy thousands andthousands of STRs that have many
integer and strings and otherprimitives, it actually takes
more space on all of these.
So copy and write is actually a,it's not a new concept in computing.

(20:24):
It's like from the eighties thatsays you just copy if you're
gonna change, you just copy thevalue if you're gonna change it.
If you're not gonna changeit, just use a pointer.
So instead of replicating this thisvalue types everywhere and having
them redundantly in many places inthe memory, just keep a pointer.

(20:47):
Like you, you usually use a storage,like you use a class, internal
class that is storage and you onlyreally copy it in the memory if
you are gonna modify the value.
So that's actually whatcopy on the right means.
It's copy whenever you're gonnado a right, if you're not gonna
change or if not gonna do a right.
Don't copy it.

(21:07):
So in Swift you can do that usingthe function that is called is
unique is uniquely referenced.

Leo Dion (host) (21:15):
Is known, uniquely referenced.
Yep.

Natan Rolnik (guest): known, uniquely referenced. (21:17):
undefined
Yeah.
So you can do that inyour own properties.
And you can write a storageand it's fairly easy.
Like it's a few lines of code to dothis for properties but whenever you
have more and more properties that youwanna include in this copy and write
pattern, it gets more, it's more work.

(21:38):
And then if you have a lot of STRswith a lot of properties that you
wanna support this, it gets reallyit's a lot of boilerplate code.
So what Rick wrote is, yeah, go

Leo Dion (host) (21:49):
I just, sorry, I had a couple of questions.
So why use obstruct if anyways?
If you're just gonna usepointers in the long run?

Natan Rolnik (guest) (21:59):
Because you still wanna be able to wait.
Let me think a little bit more about it.

Leo Dion (host) (22:06):
No

Natan Rolnik (guest) (22:07):
No that, that's a good question.
'Leo Dion (host): cause somebody's gonna be like, okay, why do
I have to add all this cruft?
Why not just use a classanyways and call it good?

Natan Rolnik (guest): right, because Oh, okay. (22:18):
undefined
So when we added to, wecould keep that part out.
But so the problem is that whenyou have classes everywhere,
whenever you change a property ofone object, it's gonna change all

Leo Dion (host) (22:35):
all of 'em.

Natan Rolnik (guest) (22:36):
for all of them.

Leo Dion (host) (22:37):
Okay.
That makes total

Natan Rolnik (guest) (22:39):
so with STRs you keep with copy and write,
you keep the best of both words.
That's what I used in myarticle explaining it.

Leo Dion (host) (22:45):
Yeah, that's a really good point.

Natan Rolnik (guest) (22:47):
You use

Leo Dion (host) (22:48):
So basically it's a struct.
It's a

Natan Rolnik (guest) (22:50):
wraps a class,

Leo Dion (host) (22:53):
right?
And then this

Natan Rolnik (guest) (22:55):
you share memory.
When I, whenever it'sthe same, you share the

Leo Dion (host) (22:58):
same thing.
There you go.

Natan Rolnik (guest): Change, you copy that (23:00):
undefined

Leo Dion (host) (23:02):
Okay.

Natan Rolnik (guest) (23:03):
and that macro does it in a really smart and short way.
You just declare you, you attach themacro to your struct and you declare
which properties you want to besupporting, you want to support copy
and write and it'll do all the codegeneration behind the scenes for you.

Leo Dion (host) (23:24):
yeah, where I've seen this is and you mention it here,
is Swift Neo, but specifically likeVapor, a lot of the Vapor Storage stuff
uses this kind of idea where they haveit's a struct, but then the properties
are all like with a class inside it.
That's where I've seen this a lot.
And is it like, is this somethingyou should be doing when you're

(23:47):
building an iOS app or isit more useful on the server

Natan Rolnik (guest) (23:50):
No, I actually think it's very relevant
to iOS and Mac OS apps because itcan, this can affect performance.
Not only you waste more memory, butyou also waste computing processing
for copying all this stuff.
So if you pass around a lot of databetween views, like between view
models or between different objects.
If you are in the scale in like inhigh scales and property and these

(24:13):
drugs, they are big, it might alsolike, it might be very relevant, but
it, but you also need to take intoaccount some considerations that.
When using copy and write in, in, insome place, like in some conditions it
can lead to performance issues as well.

Leo Dion (host) (24:32):
It has to do with the check or what specifically is

Natan Rolnik (guest) (24:34):
yeah.
Be because if you're, like, let'ssay you have a, an array of values
and you're iterating over them,and inside a for loop, you have,
you are modifying something.
And so let's say you, you're gonna haveyou, you're gonna be at every, right?
You're gonna be copying stuff.
And this is inside for loop, so you canthat's called accidental quadratics.

(24:59):
It's a concept that I mentioned inthe, in that blog post that I also
had no idea that existed beforelearning about copy and write.
And I linked there some to sometalks about performance in Swift.
They're very they explain thisconcept in a more friendly
way than just a scary name.

(25:20):
So it can actually lead to issuesif you don't know what you're
doing, like it needs to be usedwith not knowing what you're doing.
Like just don't throw it everywhere.
And I think it's also worth mentioningthe, in the cowbox repo, they have
another repo that they link to anotherrepo of benchmarks and it shows data
how much data is consumed and howmuch memory is consumed and what

(25:45):
the real impact can be in an app.
And I think it you can run themboth, the food truck sample
app from from the last DD.
So what Rick did, Rick took thatproject, and he applied the Carbox macro
in some, in, in some of the str there.
And he compared that performanceand memory and pro, he did

(26:05):
profiling and he explains everythingin the in, in that ripple.
So if you, if for people who are intothis kind of into this kind of work
and analysis and getting into thelower levels of how your code performs,
that's definitely like a, that'sa feast for people who like this.

Leo Dion (host) (26:25):
And we'll put a link to that in the show notes as well.
Of course, your article and the repo.
What do you think is, what do youthink is missing when it comes to
Swift Package Manager right now?

Natan Rolnik (guest) (26:37):
There's one thing that really annoys me is
whenever I wanna spin off a newproject that I know exactly what I
want that I don't have the option toget a template and start using that.
For example, if you wanna starta new vapor project, you probably
should use the vapor CI It'sgonna ask you a few questions.
Do you want fluent, do you want, do youwanna use which database do you want?

(27:01):
Do you want Leaf, which is atemplate, temp, templating engine.
And then it's gonna, it'sgonna take all that and create
for you a starter project.
And for people who worked with NPM,that's, let's say I, my website
is built on in, I just like you doN-P-M-N-P-M create and it follows all

(27:26):
the instructions that template has.
And that's also an interactive thingthat you interact with the questions
and based on our, on your answers,it's gonna create your template.
So I feel that for these projectsso I want to create a lambda.
Okay.
Where do you start from in Swift?
Okay.
There's a.

(27:48):
I go to the Swift AWSLambda run runtime repo.
And then I read the, read meand I copy where with whatever
package dependencies I need to add.
Then I create, I go to theterminal and I do swift packaging.
It there just type executableand I start manually doing stuff.

(28:08):
So e even if there were templatesfor this, I would need to go manually
and clone the repository and removethe gate remote and do a lot of,
there's a lot of repetition andthings that in other ecosystems, they
already solved that with templates.

Leo Dion (host) (28:26):
well, Nathan, can't you just use Xcode to
create your Swift Pro package?
Won't that do everything?
Not really.

Natan Rolnik (guest) (28:34):
Yeah.
Not really.
So well, we could all write a toolthat would do this, but let's say NPM
has this built in do NPM create and Ifeel that some of these, this things
we're still not sure if limited or

Leo Dion (host) (28:50):
already talked about like a, we have
a terminal front end, right?
What would you we're, let's justsay we had that right where it could
ask you questions, like you're justtalking purely about creating a swift
package through the terminal andlike asking certain questions, right?

Natan Rolnik (guest) (29:07):
Based on, yeah, based on a template that some
organization or some individualput it out there to help, to ease.

Leo Dion (host) (29:15):
How, yeah, I wouldn't be, would you want something to where
you had like NPM install save where itactually adds the dependency for you?

Natan Rolnik (guest) (29:25):
Do you know what I learned not
recently that SPM supports that?
There was a great articlewe can link to that.
I'm, I don't remember.
I'll send you later.
Verwer mentioned it in iOS thatweekly, a few weeks ago, I think.

Leo Dion (host) (29:40):
Okay.

Natan Rolnik (guest) (29:42):
I think it was two

Leo Dion (host) (29:43):
work like pretty well or like I do now?
I re I'm actuallyremembering what you said.
Yeah.

Natan Rolnik (guest) (29:50):
But with n pm it's much easier, right?
You just do.
'cause in, in SPM we have a few layers.
We have there's the package dependencyand there's the target dependency.
So first you need to add yourpackage dependency to your package,
and once you have that, you can addtwo different target dependencies.
With NPM, I don't think that you canhave multiple targets or you just

(30:13):
add there's, there are dependenciesand they have dependencies, but you
just run one command and it installs.

Leo Dion (host) (30:19):
So you had an episode with them a few weeks ago,

Natan Rolnik (guest) (30:22):
Yes.
Was a

Leo Dion (host) (30:23):
they?
Is that what he was talking about

Natan Rolnik (guest) (30:26):
No, I think he published it.
Someone else who publishedthis second I could find it.

Leo Dion (host) (30:33):
yeah, we'll put a link to that in the

Natan Rolnik (guest): We'll put a link to that. (30:35):
undefined
Yeah.

Leo Dion (host) (30:37):
Yeah.
Yeah, no, I agree.
A hundred.
I've gone down that rabbit hole too.
So I'm looking for something where Ican create a package and be like, do
you want to build a command line tool?
Do you want to build a server?
Do you want to build a Lambda?
And then.
Just gets it started for you.
'cause I do feel likethat's missing a lot.

(30:59):
Yeah, totally.
Though let's, let me just be devil'sadvocate, even though I agree with you.
But there are toolsout there no problem.
There are tools out there likeVapor, CLI essentially for
JavaScript, stuff like that's not.
Unreasonable that you build a customcommand line tool for your I agree.

(31:24):
It's not great, but like I've used V

Natan Rolnik (guest) (31:26):
it's,

Leo Dion (host) (31:27):
I've done I've done stuff with React native
where it's like basically yourun the command and it creates a
whole package, Dutch a for you.
So there, there is a lot of stuffin the JavaScript community out
there specifically for this casewhere it's what I'm trying to say
is like the vapor CLI is not totallyunreasonable approach to that.

(31:49):
Even though I wish it was more

Natan Rolnik (guest) (31:50):
No, for sure.
But what I mean is that I feel wouldbe very helpful to the H ecosystem is
having this baked into, like havinga standard that whoever wants to
offer a template that, that is SPMcompatible would be helpful and nice.

Leo Dion (host) (32:08):
So I would like to do that.
So I've published my own DSL forSWIFT packages that I use now for
server side and iOS applications.
And like for me, it wouldn't bethat hard to go take the next
step and like basically turnit into a command line tool.
That's what I'd like to do withit, to where there would be a lot,

(32:30):
I don't know if you've looked atpackage DSL, but basically the
idea being like, yeah, no problem.
But like the idea being is youcreate, you put all your dependencies
and stuff in separate filesand use like a SWIFT ui, DSL to

Natan Rolnik (guest): Nice Results builders. (32:44):
undefined

Leo Dion (host) (32:46):
yes, lots of result builders.
And that would even make it easier.
'cause all you have to do iscreate a new file or remove
a file and there you go.
So yeah, that's you're motivating me.
Thanks.
'cause I need more stuffto do right now, obviously

Natan Rolnik (guest) (33:02):
Yes.
Could just publish it in using Homebrew.

Leo Dion (host) (33:07):
Yeah.

Natan Rolnik (guest) (33:08):
You know what maybe this could be swift evolution
proposal, especially if maybethe Swift Server work group could

Leo Dion (host) (33:19):
I do think the package dot Swift is a bit dated for a lot of
reasons, so I wouldn't be surprised ifin the next year or two we get a new

Natan Rolnik (guest) (33:30):
new one.

Leo Dion (host) (33:31):
Yeah.
Just 'cause there's a lot ofstuff to it that's awkward.

Natan Rolnik (guest): Standards are hard to replace. (33:36):
undefined
One can hope.

Leo Dion (host) (33:40):
What else did you wanna talk about before we close out?
We had a few other topics on the doc,but I want, what are you most interested
in talking about before we close out?

Natan Rolnik (guest) (33:49):
no, I think we covered a lot.
What my main message with thiswith my website is basically we can
much easier than five, not even 10years ago, five, four years ago.
We can build tools and evenserver stuff in a much more
easier way than a while ago.

(34:09):
And they help us.
Like I I've done stuff that I'mhappy, I invested time on them and.
And it pays off.
It's worth investing it.
We have tons of opportunitiesfor automating processes
or improving processes.
But if you're like just focused on,on the app itself we don't, like if

(34:32):
we leave this little box of gettingthings done and thinking more about
this processes and how you can,like, how you can help your team and
how you can help your future selflike that's the main message is.
You can go out and build stuff for youand for our team and it's gonna be worth
it and it's gonna be maintainable thinkthat again, we are in a different place

(34:56):
that we were not five, four years ago.
So I think that everyone should tryto familiarize themselves with these
tools and this giving, at leastgiving a try for, I dunno deploying
a little function or deploying stuffeven for personal stuff for fun.

Leo Dion (host) (35:15):
Do you think any of the stuff that you've
picked up is applicable?
Specifically to the typical, 99%of us are Swift UI iOS developers.
What do you think you've picked upin your development tools that has
helped you when it comes to just yourday-to-day iOS development stuff,
I do think like you get a greaterappreciation of the language and what

(35:37):
you could do with the language andunderstanding it's for versatility
and how so I actually give you an insexample is when I was at the server
site Swift conference Franz gave areally good talk on this width pattern
that he used with non sendable objects.
And this was specificallyfor the server, right?

(35:59):
And it occurred to me that thisis a, this is this issue while
it's more applicable to the serveris something I've run into when
it comes to certain non sendabletypes stuff concerning swift data.
And it was like a eureka moment forme of something that I could directly
apply to my Swift UI work that'snot even server related, but it's

(36:20):
oh wow, yeah, this is really cool.
And.
That's a specific instance, butthere's little things where you
pick up on stuff in the server.
Like I've seen, like the stuff youtalked about the copy on, I'm sure
that's more on the server, but it'sdefinitely, like you said, applicable in

Natan Rolnik (guest): Oh, it's totally, yeah. (36:35):
undefined

Leo Dion (host) (36:37):
Yeah.

Natan Rolnik (guest): I think that, let's say (36:37):
undefined

Leo Dion (host) (36:38):
I think that's the thing that grew out of, that's a thing
that grew out of the server community,I'm sure, but it's definitely, like you
said, applicable for iOS development.
So there's things like thatI find when it comes to to,
to working on this stuff.

Natan Rolnik (guest) (36:50):
No, I think even if you learn other languages, you can
learn things that are relevant to likeconcepts or even limitations, like
some languages they have limitationsthat with those limitations you learn
new techniques or new patterns thatin some more advanced you cases you
don't have to use or but I don't know.

(37:10):
But I think that, answering to yourquestion, maybe, I don't know the
concept of fu futures and promises, I.
I learned a little bit ofjs and a little bit of vapor

Leo Dion (host) (37:20):
Sharp and js.
That was it for me.
And then going into Vapor, it was like,yeah, I get totally what's going on?
And then I was like, man, I wishthey had async weight though.
And then Eureka, here we are.
Yeah.

Natan Rolnik (guest) (37:33):
And so I, even though I had never used promises
in, in, in the iOS domain, it'sit's good to know more techniques
and more patterns and more youthink about things as streams.
So for example, if you are gonna workwith reactive stuff or com combine and
even async, async sequences it's thesame, it's the same thought, right?

(37:56):
It's the same way of thinking likethat every, everything is a stream.
I think that even talking aboutswift concurrency, on the server.
You also have you, you have to dealwith sandal, maybe non copyable,
maybe all the strict concurrency.
And maybe it's gonna be easierto learn there than in, on

(38:17):
the, on an iOS app case.
And from there you could start applying.
Or maybe you have a smaller appon the server that's easier to
start migrating to start migratingto, to the SWIFT six strict mode.
And once you're ready and you understoodhow it works you could apply that to
a bigger scale iOS app or framework.

Leo Dion (host) (38:40):
exactly.
Exactly.
100%.
Nathan, thank you so muchfor coming on the show.
This is really

Natan Rolnik (guest): Thank you for reaching (38:47):
undefined

Leo Dion (host) (38:48):
Where can people find you online?

Natan Rolnik (guest) (38:49):
I'm on both X and Mastodon as Nathan Ron without an H.
We can leave the link and I've been,so the website we mentioned it's Swift
Toolkit, do Dev also on X and Masteron.
I've been posting weekly for alittle bit more than four months.
The, there's, I've, again, I'vebeen focusing on on content that is

(39:15):
not sure if different than, but Itry to make stuff that's sometimes
interactive, sometimes with tutorials.
So if you're interested inthis domain, I'll definitely.
Go there.
Yeah, these are the places I can,I'll be happy to chat with anyone that

Leo Dion (host) (39:30):
I definitely check out the articles on
their, on Nathan's website.
There's a lot of good stuff.
And subscribe or follow 'cause yeah.
People can find me onTwitter at Leo g Dion.
My website is bright digit.com.
I'm Leo GD on at C Im on Mastodon.
Yeah, if you're watching this onYouTube, please and subscribe.

(39:52):
And if you're listening to this on apodcast player, please put a review.
If you have any requestsfor topics let me know.
Reach out to me.
I'd love to hear what you think.
Join our Patreon to get early accessto episodes like this and subscribe
to the newsletter so that way youcan catch some more content as well.
Thank you everybody, and havea good rest of your week.

(40:14):
Bye.

Natan Rolnik (guest) (40:15):
Bye-Bye.
Advertise With Us

Popular Podcasts

On Purpose with Jay Shetty

On Purpose with Jay Shetty

I’m Jay Shetty host of On Purpose the worlds #1 Mental Health podcast and I’m so grateful you found us. I started this podcast 5 years ago to invite you into conversations and workshops that are designed to help make you happier, healthier and more healed. I believe that when you (yes you) feel seen, heard and understood you’re able to deal with relationship struggles, work challenges and life’s ups and downs with more ease and grace. I interview experts, celebrities, thought leaders and athletes so that we can grow our mindset, build better habits and uncover a side of them we’ve never seen before. New episodes every Monday and Friday. Your support means the world to me and I don’t take it for granted — click the follow button and leave a review to help us spread the love with On Purpose. I can’t wait for you to listen to your first or 500th episode!

Crime Junkie

Crime Junkie

Does hearing about a true crime case always leave you scouring the internet for the truth behind the story? Dive into your next mystery with Crime Junkie. Every Monday, join your host Ashley Flowers as she unravels all the details of infamous and underreported true crime cases with her best friend Brit Prawat. From cold cases to missing persons and heroes in our community who seek justice, Crime Junkie is your destination for theories and stories you won’t hear anywhere else. Whether you're a seasoned true crime enthusiast or new to the genre, you'll find yourself on the edge of your seat awaiting a new episode every Monday. If you can never get enough true crime... Congratulations, you’ve found your people. Follow to join a community of Crime Junkies! Crime Junkie is presented by audiochuck Media Company.

Ridiculous History

Ridiculous History

History is beautiful, brutal and, often, ridiculous. Join Ben Bowlin and Noel Brown as they dive into some of the weirdest stories from across the span of human civilization in Ridiculous History, a podcast by iHeartRadio.

Music, radio and podcasts, all free. Listen online or download the iHeart App.

Connect

© 2025 iHeartMedia, Inc.